Java 4k Resources Thread

Can anybody give me a kickstart on which proguard parameters to use?

Even if I use the most basic / safe parameters, the jar file comes out at under 300 bytes, and obviously it doesn’t even remotely work.

It’s probably removing the entire class since it’s “not used”. Try this:

-keep public class * extends java.applet.Applet
-keep public class * extends javax.swing.JApplet

Or: http://proguard.sourceforge.net/manual/examples.html#applet

I did:

-keep class *

which apparently didn’t patternmatch ‘public class X’.

* Riven is updating the webservice

Thanks Markus!

3508 bytes bytes now.

Left 4k Dead got BIGGER!
G.pack.gz => 4259 bytes

Hrr… I’ll make 2 outputs… one with, and one without proguard

Try

-keep public class *

or

-keep * class *

I used

-keep public class a

but that has an obvious downside…

Now outputs 2 files. I’ll probably only output the smallest file later on.

You just code better than pack200 can compress ,)

looking at the pack 200 spec, (section 5.9) it looks like you can manually inject an encoded attribute into a pack encoded class by defining an appropriate “attribute band”

However i do not think that it will compress any smaller than the pack 200 native non-class file storage as it seems be quite tight: as a minimum per file it will have a name (reference into the pack 200 constant pool) file size (32 or 64 bits depending file size) and then the raw file data.

Instead of that, maybe provide checkboxes for each tool you link to and have them all checked by default. Depending upon how fast your utility is, you could even have your service construct results for every possibility, then just return the smallest one.

Does anyone know where I can get Moogies program? Last years link doesnt seem to work (http://unlimited.woogley.net/hosted/moogie/4KJOv3.zip). I remember using it to good effect last year.

hmm… your right, woogley’s hosting seems to have stopped.

I am in the process of making v4 to output pack200 compressed output but if you want to use it right now i have attached it to this post.

It is in two parts, you will have to rename it from .pdf to .zip as this board does not accept zip files and max file size of 1.5meg.

Part 2 of the 4kjo tool.

Just a reminder that the tool is not very robust (as it was an in house tool) so it expects to be run from the command line with the working path to be where the tool is located.

Also i recall that some of the optimizers used do not handle file paths with spaces so best to not have paths with spaces :slight_smile:

Thanks moogie, You star!! Its pretty damn good… 4.6K -> 2.9K using your tool… To 2.1K after using Pack200…

If you can combine the 2 in version4 would be perfect! If you need somewhere to host it PM me and I’ll put in on my website…

Glad it helps.

Version 4 should be able to get it smaller tham 2.1k as i will use use the kzip or BJWdeflate to compress the .pack file to produce the .pack.gz.

I can host the file on my site if you like. Just give me permission and I’ll put the ZIP on it.

EDIT: I’ll just assume you don’t mind, because I won’t have time to put this up again later. :wink:

http://www.otcsw.com/files/4KJOv3.zip

hehe no problems :slight_smile:

I will try to get the updated version done when i get some “free” time… such time seems very rare lately :frowning:

Riven, your (absolutely brilliant) tool seems to be giving me a 404 when I try to access it. Were we taking up too much of your server’s CPU?

Oh, no, not a problem. Just upgraded to another server, and have to restore that 4K app and my JGO avatar, which had low-priority for now.