shroudedcode / apk-mitm

🤖 A CLI application that automatically prepares Android APK files for HTTPS inspection
https://npm.im/apk-mitm
MIT License
3.6k stars 337 forks source link

error: No resource identifier found for attribute 'enableOnBackInvokedCallback' in package 'android' #140

Open vaibhavc418 opened 9 months ago

vaibhavc418 commented 9 months ago

└─$ apk-mitm base.apk

╭ apk-mitm v1.2.1 ├ apktool v2.6.1 ╰ uber-apk-signer v1.2.1

Using temporary directory: /tmp/apk-mitm-8614bba5e16eaac0f422f5262accc83a

✔ 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

Failed! An error occurred:

Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true I: Using Apktool 2.6.1 I: Checking whether sources has changed... I: Checking whether sources has changed... I: Checking whether resources has changed... I: Building resources... W: /decode/AndroidManifest.xml:55: error: No resource identifier found for attribute 'enableOnBackInvokedCallback' in package 'android' W: brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [/tmp/brut_util_Jar_183153951611876323557423823724616312424.tmp, p, --forced-package-id, 127, --min-sdk-version, 22, --target-sdk-version, 33, --version-code, 202309141, --version-name, 4.1.1, --no-version-vectors, -F, /tmp/APKTOOL17917242155822454722.tmp, -e, /tmp/APKTOOL5320680608667801444.tmp, -0, arsc, -I, /framework/1.apk, -S, /decode/res, -M, /decode/AndroidManifest.xml]

The full logs of all commands are available here: /tmp/apk-mitm-8614bba5e16eaac0f422f5262accc83a/logs

SimonIT commented 9 months ago

I got the same problem. The root of this problem seem to be in the apktool iBotPeaches/Apktool#2712

saschnet commented 8 months ago

You can fix it by using your "custom apktool". That should be the newest release directly from apktool. E.g.

apk-mitm --apktool ./apktool29.jar base.apk
Brosssh commented 7 months ago

Thank you! I had the same issue and that fixed it for me

omidshm commented 7 months ago

Thanks, same issue too, and update apktool works for me

MartyK87 commented 4 months ago

I can't do this. can someone please tell me how to update apktool via apk-mitm. Ive downloaded a .bat file and the latest .jar, put in windows dir and still throwing me up errors.

intuol commented 3 months ago

I can't do this. can someone please tell me how to update apktool via apk-mitm. Ive downloaded a .bat file and the latest .jar, put in windows dir and still throwing me up errors.

You have to drag the apktool.jar file into cmd.