You need to remove android:sharedUserId="android.uid.system" from the application manifest.
Nope, same thing:
rk3399_rigol:/data/UserData/apk # pm uninstall com.rigol.webcontrol
Success
rk3399_rigol:/data/UserData/apk # pm uninstall --user 0 com.rigol.webcontrol
Success
1|rk3399_rigol:/data/UserData/apk # cmd package list packages|grep rigol
package:com.rigol.launcher
package:com.rigol.scope
1|rk3399_rigol:/data/UserData/apk # pm install -r Webcontrol-rebuilt2-signed-aligned.apk
Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE: Package com.rigol.webcontrol signatures do not match the previously installed version; ignoring!]
1|rk3399_rigol:/data/UserData/apk # pm install -r --user 0 Webcontrol-rebuilt2-signed-aligned.apk
Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE: Package com.rigol.webcontrol signatures do not match the previously installed version; ignoring!]
This property in the manifest specifies that the application should be installed as a system application and run under the "system" account. But for this, the application must be signed with a system key.
Yes, but the error is not just about a key mismatch, it's about a key mismatch
for an already installed app. Unless they reused that message or used poor wording, I think the system still thinks that the app is installed.
Here's the error I'm getting when I try to install the
original apk:
1|rk3399_rigol:/data/UserData/apk # pm install Webcontrol.apk
Failure [INSTALL_FAILED_ALREADY_EXISTS: Attempt to re-install com.rigol.webcontrol without first uninstalling.]
So the system really does think that it's already installed. I need to add the "-r" argument (reinstall) to make it install it.
Well, yes, when you install your self-signed application for the first time, you need to completely remove the native system one before installing it. But you have already done it In the future, when you update your application (with the same signature), you can simply update it without first deleting it.
Well apparently I still haven't uninstalled it well enough.
Any more ideas? Renaming the Webcontrol directory and the apk in it in /system/app doesn't help either.
Do I need to reboot? I'm a bit afraid to do it without webcontrol being installed, since the rigol boot scripts are so fragile and can render the system unusable.
UPDATE: I rebooted the scope, and lo and behold!
rk3399_rigol:/data/UserData/apk # pm install Webcontrol-rebuilt2-signed-aligned.apk
Success
Now it seems to lack permissions to access framebuffer or whatever, even though I did add the following to /etc/permissions/platform.xml:
<system-user-whitelisted-app package="com.rigol.webcontrol" />
Did I miss something else?
...or maybe it's my changes that broke it. Will look at that tomorrow.