sensepost / objection

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

[bug] INSTALL_PARSE_FAILED_MANIFEST_MALFORMED #696

Closed priv2024 closed 1 month ago

priv2024 commented 1 month ago

Describe the bug

I cannot install the patched application of this :

adb: failed to finalize session
Failure [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED: Failed parse during installPackageLI: /data/app/vmdl22371042.tmp/base.apk (at Binary XML file line #109): <meta-data> requires an android:value or android:resource attribute]

To Reproduce Steps to reproduce the behavior:

  1. Pull apks adb shell pm path com.gaiamtv | cut -d':' -f2- | xargs -I% -P$(nproc) adb pull % .
  2. adb uninstall com.gaiamtv
  3. objection patchapk --source base.apk
  4. objection signapk split_config.*.apk
  5. adb install-multiple *.objection.apk

Similar issues I did not find any similar issue

Expected behavior Application should be installed

Evidence / Logs / Screenshots Any output from objection, such as stack traces or errors that occurred. Be sure to run objection with the --debug flag so that errors from the agent are verbose enough to debug. For example:

$ objection patchapk --source base.apk
No architecture specified. Determining it using `adb`...
Detected target device architecture as: arm64-v8a
Using latest Github gadget version: 16.4.10
Patcher will be using Gadget version: 16.4.10
Detected apktool version as: 2.9.3-dirty
Running apktool empty-framework-dir...
I: Removing 1.apk framework file...
Unpacking base.apk
App already has android.permission.INTERNET
Setting extractNativeLibs to true...
Target class not specified, searching for launchable activity instead...
Smali not found in smali directory. This might be a multidex APK. Searching...
Found smali at: /tmp/tmpin2pptw6.apktemp/smali_classes8/com/gaiamtv/appmodules/views/splash/SplashActivity.smali
Reading smali from: /tmp/tmpin2pptw6.apktemp/smali_classes8/com/gaiamtv/appmodules/views/splash/SplashActivity.smali
Injecting into an existing constructor
Injecting loadLibrary call at line: 187
Attempting to fix the constructors .locals count
Current locals value is 2, updating to 3:
Writing patched smali back to: /tmp/tmpin2pptw6.apktemp/smali_classes8/com/gaiamtv/appmodules/views/splash/SplashActivity.smali
Creating library path: /tmp/tmpin2pptw6.apktemp/lib/arm64-v8a
Copying Frida gadget to libs path...
Rebuilding the APK with the frida-gadget loaded...
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/tmpin2pptw6.apktemp.aligned.objection.apk to base.objection.apk in current directory...
Cleaning up temp files...
$ objection signapk split_config.*.apk
Performing zipalign
Zipalign completed
Signing new APK.
Signed the new APK
Copying final apk from /tmp/tmpy5n38ob7.apktemp.aligned.objection.apk to split_config.arm64_v8a.objection.apk in current directory...
Cleaning up temp files...
Performing zipalign
Zipalign completed
Signing new APK.
Signed the new APK
Copying final apk from /tmp/tmpsxr8oise.apktemp.aligned.objection.apk to split_config.fr.objection.apk in current directory...
Cleaning up temp files...
Performing zipalign
Zipalign completed
Signing new APK.
Signed the new APK
Copying final apk from /tmp/tmp18ic44is.apktemp.aligned.objection.apk to split_config.xxhdpi.objection.apk in current directory...
Cleaning up temp files...
$ adb install-multiple *.objection.apk
adb: failed to finalize session
Failure [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED: Failed parse during installPackageLI: /data/app/vmdl414640531.tmp/base.apk (at Binary XML file line #109): <meta-data> requires an android:value or android:resource attribute]

Environment (please complete the following information):

Application

All .apk : https://www.upload.ee/files/17044875/app.zip.html

Additional context

First time I encounter an error. Continue your great work :100:

IPMegladon commented 1 month ago

Perhaps try this and let me know if it works: https://github.com/sensepost/objection/issues/679#issuecomment-2250758446

priv2024 commented 1 month ago

Thank you! I can confirm it worked 🔥

IPMegladon commented 1 month ago

Great to hear, will then close this issue for now and keep the other one open until it is decided whether or not it is worth adding this patching to objection.