使用apktool回编译的时候竟然遇到了错误,报错信息如下:

D:\Crack\Android>apktool b dir
I: Using Apktool 2.5.0
I: Checking whether sources has changed...
I: Smaling smali folder into classes.dex...
I: Checking whether resources has changed...
I: Building resources...
W: invalid resource directory name: D:\Crack\Android\dir\res navigation
brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [C:\Users\Admin\AppData\Local\Temp\brut_util_Jar_52243126270690387527391925891517951702.tmp, p, --forced-package-id, 127, --min-sdk-version, 16, --target-sdk-version, 28, --version-code, 844, --version-name, 2.2-844, --no-version-vectors, -F, C:\Users\Admin\AppData\Local\Temp\APKTOOL6711292814219983611.tmp, -e, C:\Users\Admin\AppData\Local\Temp\APKTOOL2644961127953177132.tmp, -0, arsc, -I, C:\Users\Admin\AppData\Local\apktool\framework\1.apk, -S, D:\Crack\Android\dir\res, -M, D:\Crack\Android\dir\AndroidManifest.xml]

经过一番查找原来需要 aapt2 打包解决,具体命令如下:

apktool b --use-aapt2 dir

执行的过程很顺利

C:\Users\Admin\Desktop>apktool b --use-aapt2 dir
I: Using Apktool 2.5.0
I: Checking whether sources has changed...
I: Checking whether resources has changed...
I: Building apk file...
I: Copying unknown files/dir...
I: Built apk...

打包完成,加上签名就可以愉快的使用了。

如果觉得我的文章对你有用,请随意赞赏