obfuscator icon indicating copy to clipboard operation
obfuscator copied to clipboard

Android studio APK obfuscation

Open hamzaydia opened this issue 4 years ago • 5 comments

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

hamzaydia avatar Apr 25 '20 18:04 hamzaydia

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

Grennith avatar Apr 26 '20 04:04 Grennith

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

bluemods avatar Apr 28 '20 23:04 bluemods

@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.

kamimart avatar Jul 03 '20 07:07 kamimart

@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

bluemods avatar Jul 03 '20 21:07 bluemods

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.

febryanasaperdana avatar Aug 19 '20 15:08 febryanasaperdana