how to update system app by install a newer apk?

Hi, I have built a mokee rom and flash it into my phone(redmi4x santoni), then I use “mmm packages/apps/Messaging” built a new message apk, but I couldn’t install it to my phone(Cannot install platform packages to user storage!).
before built rom, I have copy all of my key file from ~/.android-certs to build/target/product/security.
In my world, i remember that a new apk can be used to update system app by installed in /data partition. Can anyone tell me how could I make a new apk which can used to update system app? Thank you,boys

what app do you want to install?

just the default message app, I want to modify this app to adapt my expect, and then install to my phone

I think app can’t be installed, which because the app signature is different.

but…for example, the weather app in miui, it can be update by miui appstore.

MoKee Messaging app is based on AOSP Messaging app, MoKee adds a lot of functions on AOSP Messaging, but they have also become different apps.
Although their package name is the same, the signature is not the same, so you can’t update MoKee Messaging by installing AOSP Messing or Google Messaging app or MIUI Messaging app or others.

emmm…I mean to install MoKee Messaging on MoKee. I have search a lots on internet, I guess it may because that Message app use the ‘platform’ signature, and MAYBE the app signed by platform signature could only update by ota package? I decide to change the LOCAL_CERTIFICATE in Message app from ‘platform’ to ‘releasekey’ and rebuilt rom and try again

:sweat_smile::sweat_smile::sweat_smile:Ok

After change the signature of Messaging app from ‘platform’ to ‘releasekey’, I succeed. Thank you for your help.

Usually I use the adb push command.
For this case, it should be
adb root
adb remount
adb push messaging.apk(the new app you build) system/app/massaging/messaging.apk

1 Like