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

locales_config.xml:3: error: Error parsing XML: unbound prefix #92

Open anki-code opened 2 years ago

anki-code commented 2 years ago

Hi! I've got the error:

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_classes2 folder into classes2.dex...
I: Checking whether resources has changed...
I: Building resources...
W: /tmp/apk-mitm-b447b9303a25bf6b3ef7bc6223531604/base-apk/decode/res/xml/locales_config.xml:3: error: unbound pre
fix.
W: /tmp/apk-mitm-b447b9303a25bf6b3ef7bc6223531604/base-apk/decode/res/xml/locales_config.xml: error: file failed t
o compile.
brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [/tmp/brut_util_Jar_16
4211268516868455704548094665375130847.tmp, compile, --dir, /tmp/apk-mitm-b447b9303a25bf6b3ef7bc6223531604/base-apk
/decode/res, --legacy, -o, /tmp/apk-mitm-b447b9303a25bf6b3ef7bc6223531604/base-apk/decode/build/resources.zip]

How I can fix this?

Thanks!

moikeygraham commented 2 years ago

Looks like this is a specific bug in apk-tool & APK bundles: https://github.com/iBotPeaches/Apktool/issues/2756

haocse commented 2 years ago

Does anyone know how to bypass this issue manually?

PratikBodawala commented 2 years ago

try this, https://github.com/shroudedcode/apk-mitm/issues/93#issuecomment-1164733021

spiffytech commented 1 year ago

#93 (comment)

This was a good start. I also had to remove the locales_config entry from decode/res/values/public.xml, and I deleted decode/res/xml/locales_config.xml just in case.

Lazza commented 9 months ago

Use the latest version of apktool

I suggest you download the latest version of apktool and set the correct JAR path, e.g.:

apk-mitm myfile.xapk --apktool /home/[...]/apktool_2.8.1.jar       # Linux
apk-mitm myfile.xapk --apktool C:\Users\[...]\apktool_2.8.1.jar    # Windows

Please note: the path must be absolute, not relative.