Author Topic: shrinking jpct.jar  (Read 5733 times)

Offline dmouse

  • byte
  • *
  • Posts: 17
    • View Profile
shrinking jpct.jar
« on: September 12, 2008, 09:28:04 pm »
Hi all,

I am glad to say that I am near the end of my first project with JPCT  ;D

I am currently compressing resources etc.. and trying to make the download size as small as possible (it's a web applet). I have a couple of questions :

1) Are we allowed (and is it advisable) to delete .class files from jpct.jar that we don't need? I have experimented with this, and have produced a version of jpct.jar that is 141K (original size 205K, using verion 1.1.6). Would using this break any terms of use? My project seems to run well with the trimmed version of jpct.

2) Has anyone had any luck with obfuscating a jpct project? I am using Proguard 4.2 (latest version), and I can create working builds by obfuscating my own project class files (with significant reduction from 181K down to 54K!!!). However, when I try to obfuscate the jpct class files, the project no longer works (class files are no longer found etc...). Has anyone obfuscated JPCT before, is it possible?

Thanks in advance.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: shrinking jpct.jar
« Reply #1 on: September 13, 2008, 12:35:36 am »
...it's not allowed until the author (that would be me... ;)) allows you to do so. So...feel free to delete class files that you don't need. No clue about obfuscation...i think i've played around with it in the past, but i really can't remember the results.
« Last Edit: September 13, 2008, 12:42:22 am by EgonOlsen »

Offline zammbi

  • float
  • ****
  • Posts: 361
    • View Profile
Re: shrinking jpct.jar
« Reply #2 on: September 13, 2008, 05:05:16 am »
I remember trying Proguard on jpct, but failed on all tries.

Offline dmouse

  • byte
  • *
  • Posts: 17
    • View Profile
Re: shrinking jpct.jar
« Reply #3 on: September 13, 2008, 07:58:09 pm »
...it's not allowed until the author (that would be me... ;)) allows you to do so. So...feel free to delete class files that you don't need. No clue about obfuscation...i think i've played around with it in the past, but i really can't remember the results.

Thanks Egon!

I was wondering about the Loader.class, which is 25K, is there a smaller version of this class, or would it be possible to compile a smaller version of this class? My code only uses 3DS files, and I am guessing that I might be able to cut out about 15K, if I didn't need to include code for all the other formats.

Offline dmouse

  • byte
  • *
  • Posts: 17
    • View Profile
Re: shrinking jpct.jar
« Reply #4 on: September 13, 2008, 08:07:25 pm »
I remember trying Proguard on jpct, but failed on all tries.

Ok, thanks for letting me know, at least I know that perhaps it is not something that only I am doing wrong.

It is a shame this doesn't work, when I try to obfuscate jPCT is shrinks down from about 205K to about 72K, but obviously this is useless if it doesn't actually work  :'(

For anyone reading this perhaps in the future, who might be interested, you _can_ obfuscate your own class files with ProGuard, by using something like "-libraryjars C:\dev2\Java\jPCT\jpct.jar", and by not including the jpct.jar in your current working directory. Then copy the jpct.jar file into you newly obfuscated target directory, and jpct (unobfuscated) will run with your obfuscated class files. Maybe someone will find this useful.

Offline zammbi

  • float
  • ****
  • Posts: 361
    • View Profile
Re: shrinking jpct.jar
« Reply #5 on: September 14, 2008, 05:01:58 am »
Well there was a topic on this around here, which said what classes to keep. But even when I didn't touch the classes it still never worked.
But I would love to know which settings, because I really want to shrink my game when its out.

Offline samreid

  • byte
  • *
  • Posts: 3
    • View Profile
Re: shrinking jpct.jar
« Reply #6 on: October 14, 2009, 02:03:25 am »
Could I also have permission to use Proguard's shrinking feature on jpct.jar?  It's an essential part of our toolchain, and we need to minimize the size of our resulting jars.  I know others have reported some problems with using this (see above), but I didn't want to try without permission.

Thanks,
Sam Reid

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: shrinking jpct.jar
« Reply #7 on: October 14, 2009, 06:59:21 am »
The license allow you to obfuscate/repack the jar...so feel free to do so.