APKEditor icon indicating copy to clipboard operation
APKEditor copied to clipboard

Implement switch to keep extractNativeLibs manifest option

Open basilgello opened this issue 2 years ago • 1 comments

Introduce the CLI option to preserve android:extractNativeLibraries to allow re-packing apps that initially ship with this setting (and some code relies on it!)

To repack such an application with apktool successfully, one needs to:

  • put shared library extension (so) to doNotCompress section of apktool.yml in the decompiled app directory:

    doNotCompress:
    - so
    
  • build APK back using apktool b

  • zipalign using the zipalign tool from latest Android SDK:

    zipalign -p -f 4 app-rebuilt.apk                                                                                  
    
  • sign APK by apksigner or uber-apk-signer skipping its own zipalign step:

    java -jar uber-apk-signer --skipZipAlign
    

basilgello avatar Oct 15 '23 11:10 basilgello

Sorry not convinced the purpose of keeping extractNativeLibs. AFIK extractNativeLibs is for when the library is archived in compressed format and needs to tell lib loader to extract first before loading. During merging all native libs kept uncompressed.

I appreciate if you drop here sample apk that proves your point.

Thank you

REAndroid avatar Feb 12 '24 12:02 REAndroid