superblaubeere27 / obfuscator

A java obfuscator (GUI)
MIT License
846 stars 233 forks source link

Android studio APK obfuscation #80

Open hamzaydia opened 4 years ago

hamzaydia commented 4 years ago

I want to obfuscate an android app without using Proguard basic obfuscation, I want to have unreadable code, How to use this obfuscator to achieve this? Thanks

Grennith commented 4 years ago

41 not entirely sure the method I posted is correct. Order should be Compile->ProGuard->SB's obf

bluemods commented 4 years ago

This is kind of a hacky way to do it, but I take the APK, extract it using APK Easy Tool to get the dex files, use dex2jar to convert it to jar, run the jar through the obfuscator, then use jar2dex to convert it back to dex and rezip it.

Please note that when you run the JAR through the obfuscator it requires a minimum of API level 26 (Android 8.0) because it makes use of java.util.Base64, so you'll have to patch that to use android.util.Base64 if you want to run it on lower API devices

kamimart commented 4 years ago

@bluemods that's what i'm thinking, but it looks like this obfuscator is somehow not compatible when used for Android. I keep getting errors and the app couldn't launch. Looks like it's better to find Android-specific/tailored obfuscators out there.

bluemods commented 4 years ago

@bluemods that's what i'm thinking, but it looks like this obfuscator is somehow not compatible when used for Android. I keep getting errors and the app couldn't launch. Looks like it's better to find Android-specific/tailored obfuscators out there.

Android smali files cause errors, your personal code shouldn't

febryanasaperdana commented 4 years ago

I've just tried the hack suggested by @bluemods and @kamimart, and found that @kamimart was correct. The protected app can not launch. I think this obfuscator is made for general-purpose Java applications, such as servlets/executable or standalone JARs, and not tailored specifically for Android applications. Android-targeted obfuscators have different configurations, and there are many factors to consider. I think that's why this obfuscator is not compatible with Android applications.

@bluemods The smali is invalid/corrupted because of the obfuscator.