niklashigi / apk-mitm

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

[com.instagram.barcelona] Failed to encode patched APK file #134

Open aleclarson opened 1 year ago

aleclarson commented 1 year ago
brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [/var/folders/9p/k7vwjbvj5qz6xbp6hn52mk540000gn/T/brut_util_Jar_114139953841027883445031710942778052214.tmp, p, --forced-package-id, 127, --min-sdk-version, 28, --target-sdk-version, 33, --version-code, 493450267, --version-name, 291.0.0.31.111, --no-version-vectors, -F, /var/folders/9p/k7vwjbvj5qz6xbp6hn52mk540000gn/T/APKTOOL12104384423043456691.tmp, -e, /var/folders/9p/k7vwjbvj5qz6xbp6hn52mk540000gn/T/APKTOOL303456030424436580.tmp, -0, arsc, -I, <tmp_dir>/framework/1.apk, -S, <tmp_dir>/decode/res, -M, <tmp_dir>/decode/AndroidManifest.xml]

Logs

❯ apk-mitm base.apk

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

  Using temporary directory:
  /private/var/folders/9p/k7vwjbvj5qz6xbp6hn52mk540000gn/T/apk-mitm-1898a7840b92834ddafbdb40ca48f4c4

  ✔ 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:

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: <tmp_dir>/decode/res/values/styles.xml:4711: error: Resource entry InThreadComposerTextArea already has bag item android:textColorHint.
W: <tmp_dir>/decode/res/values/styles.xml:4710: Originally defined here.
W: 
brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [/var/folders/9p/k7vwjbvj5qz6xbp6hn52mk540000gn/T/brut_util_Jar_114139953841027883445031710942778052214.tmp, p, --forced-package-id, 127, --min-sdk-version, 28, --target-sdk-version, 33, --version-code, 493450267, --version-name, 291.0.0.31.111, --no-version-vectors, -F, /var/folders/9p/k7vwjbvj5qz6xbp6hn52mk540000gn/T/APKTOOL12104384423043456691.tmp, -e, /var/folders/9p/k7vwjbvj5qz6xbp6hn52mk540000gn/T/APKTOOL303456030424436580.tmp, -0, arsc, -I, <tmp_dir>/framework/1.apk, -S, <tmp_dir>/decode/res, -M, <tmp_dir>/decode/AndroidManifest.xml]

encoding-aapt2.failed.log

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_classes7 folder into classes7.dex...
I: Checking whether sources has changed...
I: Smaling smali_classes6 folder into classes6.dex...
I: Checking whether sources has changed...
I: Smaling smali_classes8 folder into classes8.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_classes5 folder into classes5.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: /private/var/folders/9p/k7vwjbvj5qz6xbp6hn52mk540000gn/T/apk-mitm-1898a7840b92834ddafbdb40ca48f4c4/decode/res/values-h640dp/layouts.xml:3: error: invalid value for type 'layout'. Expected a reference.
W: /private/var/folders/9p/k7vwjbvj5qz6xbp6hn52mk540000gn/T/apk-mitm-1898a7840b92834ddafbdb40ca48f4c4/decode/res/values-h640dp/layouts.xml: error: file failed to compile.
W: /private/var/folders/9p/k7vwjbvj5qz6xbp6hn52mk540000gn/T/apk-mitm-1898a7840b92834ddafbdb40ca48f4c4/decode/res/values-land/layouts.xml:3: error: invalid value for type 'layout'. Expected a reference.
W: /private/var/folders/9p/k7vwjbvj5qz6xbp6hn52mk540000gn/T/apk-mitm-1898a7840b92834ddafbdb40ca48f4c4/decode/res/values-land/layouts.xml:4: error: invalid value for type 'layout'. Expected a reference.
W: /private/var/folders/9p/k7vwjbvj5qz6xbp6hn52mk540000gn/T/apk-mitm-1898a7840b92834ddafbdb40ca48f4c4/decode/res/values-land/layouts.xml:5: error: invalid value for type 'layout'. Expected a reference.
W: /private/var/folders/9p/k7vwjbvj5qz6xbp6hn52mk540000gn/T/apk-mitm-1898a7840b92834ddafbdb40ca48f4c4/decode/res/values-land/layouts.xml: error: file failed to compile.
W: /private/var/folders/9p/k7vwjbvj5qz6xbp6hn52mk540000gn/T/apk-mitm-1898a7840b92834ddafbdb40ca48f4c4/decode/res/values-sw600dp/layouts.xml:3: error: invalid value for type 'layout'. Expected a reference.
W: /private/var/folders/9p/k7vwjbvj5qz6xbp6hn52mk540000gn/T/apk-mitm-1898a7840b92834ddafbdb40ca48f4c4/decode/res/values-sw600dp/layouts.xml:4: error: invalid value for type 'layout'. Expected a reference.
W: /private/var/folders/9p/k7vwjbvj5qz6xbp6hn52mk540000gn/T/apk-mitm-1898a7840b92834ddafbdb40ca48f4c4/decode/res/values-sw600dp/layouts.xml: error: file failed to compile.
W: /private/var/folders/9p/k7vwjbvj5qz6xbp6hn52mk540000gn/T/apk-mitm-1898a7840b92834ddafbdb40ca48f4c4/decode/res/values/layouts.xml:3: error: invalid value for type 'layout'. Expected a reference.
W: /private/var/folders/9p/k7vwjbvj5qz6xbp6hn52mk540000gn/T/apk-mitm-1898a7840b92834ddafbdb40ca48f4c4/decode/res/values/layouts.xml:4: error: invalid value for type 'layout'. Expected a reference.
W: /private/var/folders/9p/k7vwjbvj5qz6xbp6hn52mk540000gn/T/apk-mitm-1898a7840b92834ddafbdb40ca48f4c4/decode/res/values/layouts.xml:5: error: invalid value for type 'layout'. Expected a reference.
W: /private/var/folders/9p/k7vwjbvj5qz6xbp6hn52mk540000gn/T/apk-mitm-1898a7840b92834ddafbdb40ca48f4c4/decode/res/values/layouts.xml:6: error: invalid value for type 'layout'. Expected a reference.
W: /private/var/folders/9p/k7vwjbvj5qz6xbp6hn52mk540000gn/T/apk-mitm-1898a7840b92834ddafbdb40ca48f4c4/decode/res/values/layouts.xml:7: error: invalid value for type 'layout'. Expected a reference.
W: /private/var/folders/9p/k7vwjbvj5qz6xbp6hn52mk540000gn/T/apk-mitm-1898a7840b92834ddafbdb40ca48f4c4/decode/res/values/layouts.xml:8: error: invalid value for type 'layout'. Expected a reference.
W: /private/var/folders/9p/k7vwjbvj5qz6xbp6hn52mk540000gn/T/apk-mitm-1898a7840b92834ddafbdb40ca48f4c4/decode/res/values/layouts.xml:9: error: invalid value for type 'layout'. Expected a reference.
W: /private/var/folders/9p/k7vwjbvj5qz6xbp6hn52mk540000gn/T/apk-mitm-1898a7840b92834ddafbdb40ca48f4c4/decode/res/values/layouts.xml:10: error: invalid value for type 'layout'. Expected a reference.
W: /private/var/folders/9p/k7vwjbvj5qz6xbp6hn52mk540000gn/T/apk-mitm-1898a7840b92834ddafbdb40ca48f4c4/decode/res/values/layouts.xml:11: error: invalid value for type 'layout'. Expected a reference.
W: /private/var/folders/9p/k7vwjbvj5qz6xbp6hn52mk540000gn/T/apk-mitm-1898a7840b92834ddafbdb40ca48f4c4/decode/res/values/layouts.xml:12: error: invalid value for type 'layout'. Expected a reference.
W: /private/var/folders/9p/k7vwjbvj5qz6xbp6hn52mk540000gn/T/apk-mitm-1898a7840b92834ddafbdb40ca48f4c4/decode/res/values/layouts.xml:13: error: invalid value for type 'layout'. Expected a reference.
brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [/var/folders/9p/k7vwjbvj5qz6xbp6hn52mk540000gn/T/brut_util_Jar_16581312801682274652650306484792113954.tmp, compile, --dir, /private/var/folders/9p/k7vwjbvj5qz6xbp6hn52mk540000gn/T/apk-mitm-1898a7840b92834ddafbdb40ca48f4c4/decode/res, --legacy, -o, /private/var/folders/9p/k7vwjbvj5qz6xbp6hn52mk540000gn/T/apk-mitm-1898a7840b92834ddafbdb40ca48f4c4/decode/build/resources.zip]
lpcs007 commented 1 year ago

did you solve the issue?

ErrorxCode commented 1 year ago

Same issue

marioeivissa commented 8 months ago

same issue,any help please?