在Mac平台上反编译了某个知识付费类的app,用的weex技术。发现反编译不成功
流程如下
-
反编译apk java -jar apktool_2.3.0.jar d xxx_1.0.0_beta_offical.apk
-
回编译(将修改后的文件重新打包为一个apk) java -jar apktool_2.3.0.jar b xxx_1.0.0_beta_offical
-
签名后安装到手机上调试
结果发现在第二步总是不成功,找到https://github.com/iBotPeaches/Apktool/issues/1425 这个issue,发现提到了
Seems you might have an outdated framework. Make sure to run apktool empty-framework-dir --force to refresh those.复制代码
完整的回答如下
➜ Bug1425 apktool d app-debug.apk I: Using Apktool 2.2.2 on app-debug.apkI: Loading resource table...I: Decoding AndroidManifest.xml with resources...I: Loading resource table from file: /home/ibotpeaches/.local/share/apktool/framework/1.apkI: Regular manifest package...I: Decoding file-resources...I: Decoding values */* XMLs...I: Baksmaling classes.dex...I: Copying assets and libs...I: Copying unknown files...I: Copying original files...➜ Bug1425 apktool b app-debugI: Using Apktool 2.2.2I: Checking whether sources has changed...I: Smaling smali folder into classes.dex...I: Checking whether resources has changed...I: Building resources...I: Building apk file...I: Copying unknown files/dir...➜ Bug1425 复制代码
说的是framework过时了,需要在 /home/ibotpeaches/.local/share/apktool
目录下(这个目录在执行第一步反编译过程中出现过,那个就是你需要重新执行的目录)重新执行apktool empty-framework-dir --force
之后重新执行这三步,完美解决问题
特地纪录一下