-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[INSTALL_FAILED_INVALID_APK: Failed to extract native libraries, res=-2] after Compile #1626
Comments
Sorry delayed on this. Was going to look into it, but forgot my dev phone today. Just letting you know I read this and have the application locally and will look into it hopefully tomorrow. |
Hi I have update download link any info on this issue? Regards |
Think this is triggered by setting |
Interesting. Apktool should not change values of the Manifest though. I'll run some tests with that info.
AAPT already has it set to |
Yes if I put true the extractNativeLibs apk compiled works.. strange if whit -r option apk have same problems.. Regards |
Looked into this some more. If going by the words of @danhawkes & @Deltafox79 that manually changing this I confirmed that the property was false in the original application, the decoded original application and the rebuilt (dirty) application. Apktool should not be in the market of random changing properties in the Manifest. There was some research online that an application needs to be "zipaligned" to resolve this issue. I read that here: scala-android/sbt-android#252 Might be worth testing. Resign, then zipalign and try with the property set to false. |
I can confirm this behavoir with a different apk. It still only works when I set |
I can also confirm that this is still an issue in 2.3.4. zipaligning the apk did unfortunately not fix it. Could the issue be related to apktool compressing the native libs for some reason? From what I can see, .so-files are actually on the doNotCompress list though... |
Hi Any news on this issue? also whit latest apktool-2.4.1-c20659-SNAPSHOT-small.jar this bug is present.. Just use d for decompile apk and manifest change android:extractNativeLibs="false" why false? Download apk for test : Regards |
With the current version of the Android build environment the manifest attribute |
@iBotPeaches If extractNativeLibs="false", then .so files should not be ZIP compressed. The system will load .so files directly from APK binary file. It won't work if .so files are compressed. For a dirty fix, you should always change this attribute to true. |
Thanks for the research. I see. So the property extraction is required if true, if false is just uses random access to stream file. |
Seems to work with 2.4.2-d3f9d5-SNAPSHOT. After rebuilding, |
I was running into this issue (in apktool 2.4.1, and using zipalign after jarsigner) and @giacomoferretti's approach worked for me. |
This should be handled now with proper handling of compression. Zipaligning may be required to align to 4byte boundries. Closing. |
I'm having this issue on 2.6.0. Removing the property from the manifest allows it to work. |
Chiming in to say that the important part for me was that I had to add the |
I still got this error even with the latest version 2.7. The workaround with To sign the app, I used these commands (from https://blog.securityevaluators.com/bypassing-okhttp3-certificate-pinning-c68a872ca9c8):
Note that according to https://developer.android.com/studio/command-line/zipalign, if we use jarsigner, we have to align the APK after, not before (as we can see on https://medium.com/@felipecsl/bypassing-certificate-pinning-on-android-for-fun-and-profit-1b0d14beab2b). |
When you add extra .so file maybe you try inject
In my case it worked. No changes to manifest and I decompiled with |
adding frida in the |
I am also having this issue in 2.9.1, although I haven't tried any of the fixes in this thread yet. |
The fix to change |
i decompile using apktool d -r |
Information
apktool -version
) -2.3.0
Windows
PlayStore
Stacktrace/Logcat
After recompile apk and signed I have this issue when install recompiled apk...
Steps to Reproduce
apktool
apktool.bat r ..apk
Frameworks
If this APK is from an OEM ROM (Samsung, HTC, LG). Please attach framework files
(
.apks
that live in/system/framework
or/system/priv-app
)APK
If this APK can be freely shared, please upload/attach a link to it.
http://www17.zippyshare.com/v/cE36EDY0/file.html
Questions to ask before submission
apktool d
,apktool b
without changing anything?yes
yes
yes
The text was updated successfully, but these errors were encountered: