Implement switch to keep extractNativeLibs manifest option
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
doNotCompresssection ofapktool.ymlin the decompiled app directory:doNotCompress: - so
-
build APK back using
apktool b -
zipalign using the
zipaligntool 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
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