apk-mitm icon indicating copy to clipboard operation
apk-mitm copied to clipboard

Failed to encode using AAPT and AAPT2

Open hexclann opened this issue 2 years ago • 3 comments

System description: Ubuntu 20.04 Server x64 apk-mitm v1.2.1 apktool v2.6.1 uber-apk-signer v1.2.1

Error message: apk-mitm --skip-patches JioTV_base.apk

Encoding patched APK file
    ↓ Encoding using AAPT2 [skipped]
      → Failed, falling back to AAPT...
    ✖ Encoding using AAPT [fallback]
      → I: Building resources...

W: <tmp_dir>/decode/AndroidManifest.xml:39: error: No resource identifier found for attribute 'localeConfig' in package 'android'
W: brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [/tmp/brut_util_Jar_150856014502180151767358923453715532561.tmp, p, --forced-package-id, 127, --min-sdk-version, 21, --target-sdk-version, 30, --version-code, 277, --version-name, 7.0.5, --no-version-vectors, -F, /tmp/APKTOOL6837759197086241617.tmp, -e, /tmp/APKTOOL12593498215404150028.tmp, -0, arsc, -I, <tmp_dir>/framework/1.apk, -S, <tmp_dir>/decode/res, -M, <tmp_dir>/decode/AndroidManifest.xml]

Troubleshooting used:

root@beta:~# apktool decode JioTV_base.apk --output app-decoded -f
I: Using Apktool 2.6.0 on JioTV_base.apk
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: /root/.local/share/apktool/framework/1.apk
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Baksmaling classes.dex...
I: Baksmaling classes2.dex...
I: Baksmaling classes3.dex...
I: Baksmaling classes4.dex...
I: Copying assets and libs...
I: Copying unknown files...
I: Copying original files..
root@beta:~#
root@beta:~# apktool decode JioTV_base.apk --output app-decoded
I: Using Apktool 2.6.0
I: Checking whether sources has changed...
I: Smaling smali folder into classes.dex...
I: Checking whether sources has changed...
I: Smaling smali_classes3 folder into classes3.dex...
I: Checking whether sources has changed...
I: Smaling smali_classes4 folder into classes4.dex...
I: Checking whether sources has changed...
I: Smaling smali_classes2 folder into classes2.dex...
I: Checking whether resources has changed...
I: Building resources...
W: /root/app-decoded/AndroidManifest.xml:39: error: attribute android:localeConfig not found.
W: error: failed processing manifest.
brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [/tmp/brut_util_Jar_98174511133201110062587280750334677670.tmp, link, -o, /tmp/APKTOOL9506084464918434793.tmp, --package-id, 127, --min-sdk-version, 21, --target-sdk-version, 30, --version-code, 277, --version-name, 7.0.5, --no-auto-version, --no-version-vectors, --no-version-transitions, --no-resource-deduping, -e, /tmp/APKTOOL9292994309994995094.tmp, -0, arsc, -I, /root/.local/share/apktool/framework/1.apk, --manifest, /root/app-decoded/AndroidManifest.xml, /root/app-decoded/build/resources.zip]

root@beta:~# apktool build app-decoded --output app-rebuilt.apk
I: Using Apktool 2.6.0
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: /root/app-decoded/AndroidManifest.xml:39: error: No resource identifier found for attribute 'localeConfig' in package 'android'
W:
brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [/tmp/brut_util_Jar_122943158476594212298262336365894672586.tmp, p, --forced-package-id, 127, --min-sdk-version, 21, --target-sdk-version, 30, --version-code, 277, --version-name, 7.0.5, --no-version-vectors, -F, /tmp/APKTOOL485145000213752606.tmp, -e, /tmp/APKTOOL6561568611909862715.tmp, -0, arsc, -I, /root/.local/share/apktool/framework/1.apk, -S, /root/app-decoded/res, -M, /root/app-decoded/AndroidManifest.xml]

encoding-aapt2.failed.log decoding.log encoding-aapt.failed.log JioTV_base.zip (rename .zip to .apk)

hexclann avatar Jul 01 '22 11:07 hexclann

I'm also experiencing this issue. Getting this error:

W: <tmp_dir>/decode/res/font/APKTOOL_DUMMYVAL_0x7f090000.xml:4: error: No resource identifier found for attribute 'APKTOOL_DUMMYVAL_0x7f040293' in package 'android'

Any updates or advise?

glaksmono avatar Nov 08 '22 00:11 glaksmono

same issue, please help

marioeivissa avatar Mar 03 '24 14:03 marioeivissa

I: Using Apktool 2.6.1 I: Checking whether sources has changed... I: Smaling smali folder into classes.dex... I: Checking whether sources has changed... I: Smaling smali_classes2 folder into classes2.dex... I: Checking whether resources has changed... I: Building resources... brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 2): [/tmp/brut_util_Jar_70221136490252545111627714710170007115.tmp, c> W: /tmp/brut_util_Jar_70221136490252545111627714710170007115.tmp: 1: ^?ELF^B^A^A^B: not found W: /tmp/brut_util_Jar_70221136490252545111627714710170007115.tmp: 47: Syntax error: ")" unexpected

marioeivissa avatar Mar 03 '24 14:03 marioeivissa