I am looking into the various tools for obfuscation. Proguard looks to be a good option and in my prelim tests works ok. Are there any recommended obfuscators for bd-j or alternatively any know issues when using proguard?
Here is my ant obfuscate task
Thanks billf and vinaykagarwal. I will try your builds.
My article on Java code protection has pointers to a handful of actively maintained free and commercial obfuscators. I regret I do not know much about BD-J, so you may need to ask the vendors if they support it and/or if there are any special steps involved.
I use Proguard and it seems to do a pretty good job. I have inspected the obfuscated code many times and it does exactly what I would expect.
Would you mind sharing the settings that you are using, or alternatively your config file (which I am using through an ant build)?
Here are the proguard settings I've used. I haven't tested these on tons of players or anything, but they work for the ten or so I happen to have put the disc in. The last line that turns off some of the optimizations was the hard one -- it was one of those trial-and-error binary search things to figure out that this is what works.
billf$ cat build-proguard-args.txt
-keep public class * implements javax.tv.xlet.Xlet
-keep public class * implements com.hdcookbook.grin.Director
-keep public class * implements com.hdcookbook.grin.GrinXHelper
-optimizations !method/marking/private, *
I haven't completely integrated this into my ant build the right way, but here's how I invoke it:
billf$ cat ~/bin/proguard
Doing this with a GRIN-based xlet compresses things down nicely, and makes them run measurably faster. The resulting JAR is a bit over half the original JAR size -- it goes from 112832 bytes to 68987 on a moderately complex project, which is a 39% reduction in size. The final xlet has 65 classes (down from 70), and given the class load time on a BD player, keeping things down to this size range is something I would recommend.
Your use of this web site or any of its content or software indicates your agreement to be bound by these Terms of Participation.
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.