Obfuscapk icon indicating copy to clipboard operation
Obfuscapk copied to clipboard

APK is not being obfuscated in Release / Debug flag off

Open zerobytes999 opened this issue 4 years ago • 2 comments

Obfuscating debuggable version of any app works.

I did alot of testing. I noticed that if an app in debug mode BUT the debuggable flag in build.gradle is switched to false the app will not be obfuscated using CallIndirection / Reflection / AdvancedReflection.

When turned off, then the app can be obfuscated via mentioned methods.

apktool version 2.5.0

Command used: python3 -m obfuscapk.cli -p -d /home/test/Obfuscapk/src/conversations-free-compat-universal-debug_ON_OBFUSCATED.apk -o CallIndirection -o Rebuild -o NewAlignment /home/test/Obfuscapk/src/Conversations-2.9.13-conversations-free-compat-universal-debug_ON.apk

zerobytes999 avatar Jun 02 '21 14:06 zerobytes999

I also observed something strange.

I was able to get CallIndirection obfuscation to work on debuggable = false apk.

The trick was to use ClassRename before using CallIndirection.

I decompiled the APK and it showed classes changed and CallIndirection being applied.

The result was the APK was not working

zerobytes999 avatar Jun 02 '21 18:06 zerobytes999

I found a work around, but it is tedious to execute.

I found out the main problem, it is with apktool.

It seems like it is not decompiling apk's with debug flag enabled properly. when the flag is enabled I see the folder has many smali files compared to debug disabled apk's

zerobytes999 avatar Jun 02 '21 20:06 zerobytes999