-
Notifications
You must be signed in to change notification settings - Fork 26
How to use yGuard
Tom edited this page Oct 9, 2018
·
4 revisions
#How to use the yGuard on Android
This wiki explains how to use the free Java obfuscator yGuard on Android (needs JavaIDEdroid PRO). First, you need to create the yGuard module which includes a bugfix for Android's JarOutputStream class:
- Get JavaIDEdroid v2.6.0 or later from Google Play
- Get !HelloJava_2-0-0.zip (Java app) from the Download area and unzip it to a subdirectory of your development root on the storage card of your Android device
- Get JarOutputStreamFix_1-0-0.zip from the Download area and save it as /sdcard/.JavaIDEdroid/JarOutputStreamFix_1-0-0.zip
- Download yguard-2.5.1.zip from http://www.yworks.com/
- Extract yguard.jar from yguard-2.5.1.zip/yguard-2.5.1/lib/ and save it as /sdcard/.JavaIDEdroid/yguard_2-5-1.jar
- Open the !HelloJava project and run the script 'create_yguard_module.bsh' in the project root
- Move the created module yguard_2-5-1_androidFix.jar.dex.zip to where you want it, e.g. the JavaIDEdroid_modules/ subdirectory of your development root (which is where I store my modules)
To use yGuard, you need to get Ant running on your Android device, since yGuard is implemented as Ant Custom Task:
- Get the Ant module
- Open the HelloJava project and edit the build.bsh: Set
bUseYguard=true
at the beginning of the script. Adjust the paths in the script to fit your environment. - Run the build.bsh script. This will create the HelloJava.jar and its obfuscated version HelloJava_obf.jar in the project root directory
In the download area, there is also a demo project (!HelloAndroid-with-yguard.zip) that shows how to use yGuard to obfuscate an Android app.