I am using React Native and integrated library react-native-obfuscating-transformer to obfuscate my code. Now after decompiling my APK, I believe my whole js code is under assets/index.android.bundle.
How can I debundle it and see my code whether obfuscation worked or not.
brew install apktool
after install apktool
, unzip apk file by run this command on terminal like this:
apktool d /pathOfApkFile.apk
After that you will get index.android.bundle
file at pathOfApkFile/assets/index.android.bundle
than you can use react-native-decompiler for decompile index.android.bundle
file
index.android.bundle
Fileyou can decompile index.android.bundle
by run this command
npx react-native-decompiler -i ./index.android.bundle -o ./output
after that, you will get JS decompiled file in ./output
directory
React Native is already doing uglify js code.
and react-native-obfuscating-transformer is also make complex uglifying code
It is something like MD5 and SHA256 encryption and there is no the tool available right know when make machine learning and bruteforce to give us estimated code
If you want to varify react-native-obfuscating-transformer is implemented or not then you can edit index.android.bundle and save code then implement react-native-obfuscating-transformer and edit and compare both file
you can make more uglify code by adding flag in build.gradle called bundleInRelease: true
and add Hermes which turns js bundle to bytecode for efficiency
REF
Note: There is no way to decompile index.android.bundle
because this file contains uglify code which has many reverses possible of one line
you can use DEX2JAR to convert apk to java code and you can view that code from JD-GUI
you can see this VIDEO
See https://android.jlelse.eu/getting-inside-apk-files-21dbd01529d4 :
If your app is written on React Native, using the same apktool you can find index.android.bundle file inside assets folder of decompiled APK folder. To open it using IntelliJ IDEA, right click on the file, Associate with File Type… and choose JavaScript. And it is usual minified .js file.
In other words, opening the .bundle file in an IDE such as Intellij will yield a minified .js file, which can then be formatted and compared with your source code. I hope this helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With