I am trying to install a modified apk file onto my Nook Simple Touch. I modified the Reader.apk program, recompiled it, and signed it with my own key.
I know that you cannot install an app over a current app if the signing keys are different. However, I am getting the error INSTALL_FAILED_UPDATE_INCOMPATIBLE
even after completely uninstalling the original Reader.apk app.
After checking the packages.xml file, I removed the entry for the old Reader.apk app. And I am still getting this error. The app is completely uninstalled, and I cannot install my modified version.
Even signing the original sources with my new key causes this error to come up (so it has nothing to do with the actual changes I made).
The solution is to modify the AndroidManifest.xml
file. You need to remove the sharedUserId
attribute in the second line.
The Reader.apk file is a system app, and it is made by the manufacturers of the device itself, who also made several other apps. Due to this, they were able to set the sharedUserId flag, which allows all of their apps to interact with each other. As a security design, all the apps are required to have the same signing key. When I tried to install the modified app, it failed to install because it was trying to share the user id with the other apps while lacking the proper signing key.
By removing the flag in the xml, you can successfully install the modified app. Change the following line in the AndroidManifest.xml
file from this:
<manifest android:sharedUserId="android.media" android:versionCode="1"
android:versionName="1.0" package="com.bn.nook.reader.activities"
xmlns:android="http://schemas.android.com/apk/res/android">
to this:
<manifest android:versionCode="1" android:versionName="1.0"
package="com.bn.nook.reader.activities"
xmlns:android="http://schemas.android.com/apk/res/android">`
See this xda post for more details. (Full Disclosure: I wrote that post.)