使用apktool反编译后,再通过apktool回编译时候报错,W: invalid resource directory name:XXX\res navigation。
反编译:
apktool d test.apk
回编译:
apktool b dir_path -o test.apk
改为:
apktool b --use-aapt2 dir_path -o test.apk
如果后续出现,如下所示的:AndroidManifest.xml中XXX not found,直接在AndroidManifest.xml搜索XXX,然后删除,重新 apktool b --use-aapt2 dir_path -o test.apk 编译。
I: Checking whether resources has changed...
I: Building resources...
W: D:\android reverse\com.tuya.smartiot_4.3.1_482\AndroidManifest.xml:101: error: attribute android:preserveLegacyExternalStorage not found.
W: error: failed processing manifest.
brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [C:\Users\Administrator\AppData\Local\Temp\brut_util_Jar_44154619429855562321261283700243387626.tmp, link, -o, C:\Users\Administrator\AppData\Local\Temp\APKTOOL829895688864961046.tmp, --package-id, 127, --min-sdk-version, 21, --target-sdk-version, 27, --version-code, 482, --version-name, 4.3.1, --no-auto-version, --no-version-vectors, --no-version-transitions, --no-resource-deduping, -e, C:\Users\Administrator\AppData\Local\Temp\APKTOOL6931973206850436095.tmp, -0, arsc, -I, C:\Users\Administrator\AppData\Local\apktool\framework\1.apk, --manifest, D:\android reverse\com.tuya.smartiot_4.3.1_482\AndroidManifest.xml, D:\android reverse\com.tuya.smartiot_4.3.1_482\build\resources.zip]