How do I obfuscate my midlet jar files on Mac? |
install proguard and change the midlet.pro configuration file as follows:
# define library jars
-libraryjars /System/Library/Frameworks/JavaVM.framework/Versions/ CurrentJDK/Classes/classes.jar
-libraryjars /Developer/Java/mpp-sdk/midp.jar
-libraryjars /Developer/Java/mpp-sdk/cldc.jar
# do not use mixed case classnames
# -dontusemixedcaseclassnames
use the following shell script to obsuscate the jar file:
=============
#!/bin/sh
#Author: Yuet
mppdev="/Developer/Java/mpp-sdk"
proguard=${mppdev}/proguard/lib/proguard.jar
preverify=${mppdev}/osx/preverify/preverify
jarpath= "/System/Library/Frameworks/JavaVM.framework/Classes/classes.jar"
classpath="${jarpath}:${mppdev}/cldc.jar:${mppdev}/midp.jar"
infile=$1
outfile="out-$1"
arg3="@${mppdev}/proguard/mymidlets.pro"
java -jar $proguard -dontusemixedcaseclassnames -injars $infile -outjars $outfile $arg3
unzip $outfile -d "temp-$infile"
$preverify -classpath $classpath -d "temp-$infile" "temp-$infile"
cd "temp-$infile"
zip -r ../jarsObfuscated/$infile *
cd ..
rm $outfile
rm -rf "temp-$infile"
===================
Sponsors links: |
0 comments:
Post a Comment or Discuss in forum
Post a Comment or Discuss in forum