反编译 React Native index.android.bundle [英] Decompile React Native index.android.bundle
问题描述
我正在使用 React Native 和集成库 react-native-obfuscating-transformer混淆我的代码.现在反编译我的 APK 后,我相信我的整个 js 代码都在 assets/index.android.bundle 下.
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.
推荐答案
For Macbook
brew install apktool
安装 apktool
后,通过在终端上运行此命令来解压缩 apk 文件,如下所示:
after install apktool
, unzip apk file by run this command on terminal like this:
apktool d /pathOfApkFile.apk
之后,您将在 pathOfApkFile/assets/index.android.bundle
你可以使用 react-native-decompiler 来反编译 index.android.bundle
文件
than you can use react-native-decompiler for decompile index.android.bundle
file
你可以通过运行这个命令反编译index.android.bundle
you can decompile index.android.bundle
by run this command
npx react-native-decompiler -i ./index.android.bundle -o ./output
之后,你会在./output
目录下得到JS反编译文件
after that, you will get JS decompiled file in ./output
directory
React Native 已经在做 uglify js 代码了.
React Native is already doing uglify js code.
和 react-native-obfuscating-transformer 也在制作复杂的丑化代码
and react-native-obfuscating-transformer is also make complex uglifying code
它类似于 MD5 和 SHA256 加密,并且没有可用的工具正确知道何时进行机器学习和蛮力为我们提供估计代码
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
如果你想改变 react-native-obfuscating-transformer 是否实现,那么你可以编辑 index.android.bundle 并保存代码,然后实现 react-native-obfuscating-transformer 并编辑和比较两个文件
您可以通过在 build.gradle 中添加名为 bundleInRelease: true
的标志并添加 Hermes 将 js 包转换为字节码以提高效率
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
注意:没有办法反编译index.android.bundle
,因为这个文件包含uglify代码,一行可能有很多反面
Note: There is no way to decompile index.android.bundle
because this file contains uglify code which has many reverses possible of one line
您可以使用 DEX2JAR 将 apk 转换为 java 代码您可以从 JD-GUI
you can use DEX2JAR to convert apk to java code and you can view that code from JD-GUI
你可以看到这个视频
这篇关于反编译 React Native index.android.bundle的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!