0

Is it possible to unpack an application and re-pack it with changes and make it work on Android 11?

I unpacked and recompiled an app without making any changes. I later signed it following this guide, but when i try to install it with adb, I obtain this error:

Failure [INSTALL_FAILED_INVALID_APK: Failed to extract native libraries, res=-2 –

I read that on Android 11 you have to sign the apk with schema v2. I did it but the app gives me an error when I try to install it.

6
  • Hi robert, my app can be installed on devices that have at least android 11 installed. I unpacked and recompiled it without making any changes. I later signed it following this guide: liapp.lockincomp.com/blog/blog-Post/… but when i try to install it with adb, I obtain this error: Failure [INSTALL_FAILED_INVALID_APK: Failed to extract native libraries, res=-2
    – moskino11
    Oct 31, 2022 at 13:44
  • When zipping the APK I would change the compression method to "store" (no compression). That should be the safest option to avoid problems. In some cases it may also be necessary to apply zipalign on the APK before signing.
    – Robert
    Oct 31, 2022 at 14:15
  • that is, when do I repack the application with apktool? could you tell me the command you mean?
    – moskino11
    Oct 31, 2022 at 15:11
  • INSTALL_FAILED_INVALID_APK Failed to extract native libraries, has nothing to do with APK signature v2. Please concentrate on one question. At the moment your question seems to be more like "how to repack an APK correctly". If you really want to ask that please edit your question and write it that way.
    – Robert
    Oct 31, 2022 at 15:16
  • I found this solution on the net: delete this tag from the manifest from the manifest --> android:extractNativeLibs="false" I deleted it and repackaged the application with the simple b command from apktool. Later i signed the application with jarsigner. I tried to install it with adb and now I get this error: 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]. What should I do in your opinion?
    – moskino11
    Oct 31, 2022 at 15:38

0

You must log in to answer this question.

Browse other questions tagged .