Mobile-IoT-Security-Lab / Obfuscapk

An automatic obfuscation tool for Android apps that works in a black-box fashion, supports advanced obfuscation features and has a modular architecture easily extensible with new techniques
MIT License
55 stars 8 forks source link

Obfuscated apk failure #2

Open iwkse opened 2 months ago

iwkse commented 2 months ago

I'm running the obfuscator with basic configuration:

python -m obfuscapk.cli -p -o Rebuild -o NewAlignment -o NewSignature original.apk

But I receive this error while trying to install it

Failure [-124: Failed parse during installPackageLI: Targeting R+ (version 30 and above) requires the resources.arsc of installed APKs to be stored uncompressed and aligned on a 4-byte boundary]
X3no21 commented 2 months ago

This installation error is typically related to a signature issue in the app generated from Obfuscapk on an app that targets an Android version greater than or equal to 30. In detail, it is caused by the "resources.arsc" file being stored in its compressed form inside the .apk file and should not be stored in its uncompressed form.

A way to solve the problem could be to run the script provided from the https://github.com/mathieures/convert-apk repository to unpack the .apk file and align the resources.arsc, rebuild the working .apk, and install it.