6

I'm trying to install an application in the system/app folder of a device. It needs to be done since I'm writing a QAT program and the tests need to run with a few privileges not available to third party apps.

I already have the device's firmware signing key and need to set the sharedUserId of the application to android.uid.system . It however keeps giving me a failure message "INSTALL_FAILED_SHARED_USER_INCOMPATIBLE" .

Any ideas on how I can fix this?

2
  • What exactly is giving you that error message? Please add the steps you're taking. Commented Aug 11, 2011 at 15:08
  • It's the package manager. One possible cause is that I'm generating the certificate myself with keytool and the relevant details provided, however the system's applications seem to have been signed with a certificate with a validity different than mine, since it was created at an earlier date. Could this be the problem I'm facing?
    – Archit
    Commented Aug 12, 2011 at 5:33

3 Answers 3

1

If you don't have root to follow the manual install procedure Demizey describes, then the app must be signed with the same key that the ROM is signed with; that's to say, the same key that the existing system apps are signed with. This is a security precaution: otherwise, anyone could write an app that would run with full system access on any device.

2

Found these instructions to install PowerManagerPro into /system/app, just modified them a little. (Note: first install the app into /data/app, like you would any app, and you need a rooted device.)

Open a Terminal Emulator app and execute the following command to copy the application to the sdcard:

su
cp /data/app/your.apk /sdcard/your.apk

If you can't find the application in /data/app try /data/apps-private/. Then, un-install your app from the device.

Execute the following commands in the terminal emulator to remount the /system directory as read/write and to install the application into the /system/app directory:

su
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
cp /sdcard/your.apk /system/app

If you prefer to use adb from your computer, execute these commands:

adb remount
adb shell cp /sdcard/your.apk /system/app
2
  • 1
    related: android.stackexchange.com/questions/4785/…
    – Lie Ryan
    Commented Aug 11, 2011 at 15:24
  • @Demizide: I've already tried that. I have two problems, first, the device is not rooted and is not going to be. Second the files in /system/app are owned by root and the group is also root. It somehow won't let me set the group to root, and keeps that as the shell. It's either because of this, or some other reason, the above method does not seem to work.
    – Archit
    Commented Aug 12, 2011 at 5:37
0

You may want to exploit the Master Key vulnerability.

Choose an app that, if lost or replaced, won't affect your using the device. Take its APK and find a way to modify the content of it, and and insert the files of your app. Do not overwrite anything in the original APK, but try to make 2 entries of the same file in the ZIP header. Then you can install the modified APK over the original one. It will inherit permissions from the original one, but work as you intend it to.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .