╭ apk-mitm v1.2.1
├ apktool v2.6.1
╰ uber-apk-signer v1.2.1
Using temporary directory:
/tmp/apk-mitm-b0a15db24ae9e1cd536b97ff8a97a01f
✔ Extracting APKs
✔ Finding base APK path
❯ Patching base APK
✔ Checking prerequisities
✔ Decoding APK file
✔ Applying patches
❯ Encoding patched APK file
↓ Encoding using AAPT2 [skipped]
→ Failed, falling back to AAPT...
✖ Encoding using AAPT [fallback]
→ I: Building resources...
Signing patched APK file
Signing APKs
Compressing APKs
Failed! An error occurred:
I: Using Apktool 2.6.1
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether resources has changed...
I: Building resources...
W: invalid resource directory name: <tmp_dir>/base-apk/decode/res navigation
brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [/tmp/brut_util_Jar_122576267098225401125692236861886579432.tmp, p, --forced-package-id, 127, --min-sdk-version, 21, --target-sdk-version, 33, --version-code, 350869, --version-name, 4.188.0, --no-version-vectors, -F, /tmp/APKTOOL13155722005023290828.tmp, -e, /tmp/APKTOOL2959610864625610547.tmp, -0, arsc, -I, <tmp_dir>/framework/1.apk, -S, <tmp_dir>/base-apk/decode/res, -M, <tmp_dir>/base-apk/decode/AndroidManifest.xml]
The full logs of all commands are available here:
/tmp/apk-mitm-b0a15db24ae9e1cd536b97ff8a97a01f/logs
Note that the above logs is simply aapt failing as expected, in a situation that calls for aapt2, as I understand it. The real reason is in the aapt2 failed log:
I think this is a very cool tool that I've found very useful, so I hope I can help narrow down a possible bug.
I believe this is a bug with
apk-mitm
rather thanapk-tools
, I'll demonstrate why momentarily.Using any Headspace APK or APKX (not sure if I can link directly), run
apk-mitm
.aapt2
fails, and so does fallbackaapt
.apk-mitm Headspace_\ Sleep\ \&\ Meditation_4.188.0_Apkpure.xapk
Note that the above logs is simply aapt failing as expected, in a situation that calls for aapt2, as I understand it. The real reason is in the aapt2 failed log:
decoding.log: https://pastebin.com/aVkmN4rW encoding-aapt2.failed.log: https://pastebin.com/qe4b9NL1 encoding-aapt.failed.log: https://pastebin.com/BhbxqyTu
This error is identical if I do an apk version or different version number of the Headspace app.
I believe this is a bug with
apk-mitm
because:apktool d Headspace_\ Sleep\ \&\ Meditation_4.182.0_Apkpure.apk
apktool b Headspace_\ Sleep\ \&\ Meditation_4.182.0_Apkpure/
Results in no errors.