I tried to generate a .apk from a classes.dex generated by samli. But I get these erros:
Failure [INSTALL_FAILED_SHARED_USER_INCOMPATIBLE] (when I try to install the .apk on the emulator)
Error [INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES] (when I try to install the .apk on my phone).
Here are the steps what I have done:
- Extraced classes.dex from an existing .apk
- ./baksmali classes.dex
- ./smali out
- mv out.dex classes.dex
- Extracted the whole .apk content in a folder and replaced classes.dex which the new one
- Generated a .zip-file and renamed it to *.apk
- signed the app: jarsigner -verbose -keystore my-release-key.keystore MyFieldTest.apk mykey
Here is the beginning of the manifest:
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:sharedUserId="android.uid.phone" package="com.htc.fieldtest" android:versionCode="1" android:versionName="1.0" > <application android:label="Field Test"> <activity android:label="@string/app_name" android:name="FieldTestActivity" android:process="com.android.phone" android:launchMode="singleInstance">
I know that the app was first signed by a HTC devloper and now by me. But is there as possibility to fix the problem?
preguntado el 10 de marzo de 12 a las 13:03
It sounds like you might have multiple signatures in the new apk files. Try deleting the files in META-INF directory before creating the new zip.
Also, Your new apk probably has compressed resources now. I'm not sure how android will handle that. In the apk files that aapt generates, the resources (images, xml, etc.) are no compressed, so that they can be mapped into memory directly, without having to extract them.
If you aren't modifying the resources, your best bet is to replace the classes.dex file in the original apk file, rather than creating a new one. If you are trying to modify the resources as well, you should use apktool to extract/repack the apk instead.