sensepost / objection

📱 objection - runtime mobile exploration
GNU General Public License v3.0
7.23k stars 829 forks source link

[bug] Rebuilding the APK error: Resource entry InThreadComposerTextArea already has bag item android:textColorHint. #465

Closed lucaswxp closed 1 week ago

lucaswxp commented 3 years ago

Hello guys.

Initially I thought this was an apktool, but I followed this guide to pack/unpack and apktool worked fine (https://github.com/sensepost/objection/wiki/Android-APK-Patching)

Everything runs fine up to this point:

Rebuilding the APK with the frida-gadget loaded...
Rebuilding the APK may have failed. Read the following output to determine if apktool actually had an error: 

W: /tmp/tmpgievm3ob.apktemp/res/values/styles.xml:3782: error: Resource entry InThreadComposerTextArea already has bag item android:textColorHint.
W: /tmp/tmpgievm3ob.apktemp/res/values/styles.xml:3781: Originally defined here.
W: 
brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [/tmp/brut_util_Jar_6730937837035564647.tmp, p, --forced-package-id, 127, --min-sdk-version, 21, --target-sdk-version, 30, --version-code, 289692181, --version-name, 187.0.0.32.120, --no-version-vectors, -F, /tmp/APKTOOL2083865402873489821.tmp, -e, /tmp/APKTOOL4940271435371649937.tmp, -0, arsc, -I, /home/lucaswxp/.local/share/apktool/framework/1.apk, -S, /tmp/tmpgievm3ob.apktemp/res, -M, /tmp/tmpgievm3ob.apktemp/AndroidManifest.xml]

Built new APK with injected loadLibrary and frida-gadget
Performing zipalign
Zipalign completed
Signing new APK.
Signed the new APK
Copying final apk from /tmp/tmpgievm3ob.apktemp.aligned.objection.apk to com.instagram.android.armeabi.objection.apk in current directory...
Cleaning up temp files...

Thing is... in the end it says the APK with built... why is that?

As said, apktool works as its own. I checked the xml file it's complaining and it really does have a invalid xml, but why would this matter?

APK: https://www.apkmirror.com/apk/instagram/instagram-instagram/instagram-instagram-187-0-0-32-120-release/instagram-187-0-0-32-120-4-android-apk-download/download/

kkm commented 2 years ago

yes with me it also happens. i think it only happened on instagram.

JesseSchnupp commented 1 year ago

I still have the same problem as of today, using the latest apktool 2.6.1 still produces this error when attempting to patch the instagram apk.

IPMegladon commented 1 week ago

If you encounter this issue, I would recommend trying to patch with the --skip-resources flag (in the linked docs that is the -r flag for apktool). The new version of objection will likely have this as the default. Closing this issue for now as it has become stale, feel free to reopen.