Skip to content

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:

  1. Get JavaIDEdroid v2.6.0 or later from Google Play
  2. 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
  3. Get JarOutputStreamFix_1-0-0.zip from the Download area and save it as /sdcard/.JavaIDEdroid/JarOutputStreamFix_1-0-0.zip
  4. Download yguard-2.5.1.zip from http://www.yworks.com/
  5. 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
  6. Open the !HelloJava project and run the script 'create_yguard_module.bsh' in the project root
  7. 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:

  1. Get the Ant module
  2. 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.
  3. 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.

Clone this wiki locally