Next, let's talk about how to install setting on a real machine.
-- 1. Run settings in the normal run Android Application Mode first,
[11:31:24-settings] uploading settings.apk onto device '0123456789abcdef'
[11:31:26-settings] installing settings.apk...
[11:31:29-settings] re-installation failed due to different application signatures.
[11:31:29-settings] You must perform a full uninstall of the application. Warning: This will remove the Application Data!
[11:31:29-settings] Please execute 'adb uninstall com. Android. settings' in a shell.
[11:31:29-settings] Launch canceled!
-- 2. If an installation error occurs, you must uninstall setting and use ADB uninstall com. Android. settings to find that it also fails. Here is an available uninstall method:
ADB shell "CD/system/APP; RM settings.apk ;"
ADB uninstall com. Android. Settings
-- 3. Uninstall OK and install again
[12:02:36-settings] installation error: install_failed_shared_user_incompatible
[12:02:36-settings] Please check logcat output for more details.
[12:02:36-settings] Launch canceled!
Open logcat:
01-02 09:49:09. 882: Error/packagemanager (2002): Package com. Android. settings has no signatures that match those in shared user Android. uid. system; ignoring!
<Manifest xmlns: Android = "http://schemas.android.com/apk/res/android"
Package = "com. Android. Settings"
Android: shareduserid = "android. uid. System"
Android: versioncode = "1"
Android: shareduserid is an attribute in androidmanifest. What does Google mean when surfing the Internet? It specifies the APK permission. Because setings needs to access system-level resources, you need to add android. UID. system permission, but the system permission is not any APK can be obtained at will, the system signature is required, platform. x509.pem and platform. pk8 allows you to gain system Permissions
-- 4. Obtain the platform. x509.pem and platform. pk8 files and sign your APK. The following is the batch processing statement I wrote to sign settings.
Java-jar signapk. Jar platform. x509.pem platform. pk8 ../settings/bin/settings.apk output/settings.apk
-- 5. after the signature is re-installed, you will find that your setting is not installed in/system/app, but in/data/app. It is the same as a common application, but it has system permissions, the usage is no different from the original setting.