Android-System Application replacement

Source: Internet
Author: User

The requirements are as follows:

All files in the system partition of Android have been signed and authenticated by the system, including dynamic libraries, executable files, and system APK applications. These files must be upgraded at one time before they can be used, otherwise, the system application cannot be upgraded due to the signature and unmodifiable features. Bundle System. im image system upgrades are highly risky first. Rom problems will cause the entire machine to become a waste iron, and there will be a lot of time for downloading whether it is an IP address or a cable, compared with power failure or flash partition failure, there may be some problems.


Solution:

By studying the Android system, we found that there is a very simple and basically no risk solution. Next time, we will briefly explain how to do it.


1. system applications are basically placed under/system/APP. Generally, the factory directly writes system. IMG to it.

2. for problematic application redevelopment, modify the following items:

Modify the version number in androidmainfest. xml:

Android: versioncode: it is mainly used for version upgrade. It is of the int type. The first version is defined as 1 and will increase progressively later. In this way, you can determine whether the upgrade is required by judging the value, this value is not displayed to the user. The version must be 1 higher than the system version.

Create an APK using the same signature as the original system application

3. reinstall the application

Use the ADB shell to log on to the box and use the PM command for forced installation. The application will be installed under/data/app, and the application will be opened after the machine is restarted.

PM install: installa package to the system. Options:
-R: reinstall an exisiting app, keeping its data.

PM install-r path


Disadvantages:

1. Only some flash space is occupied, that is, the executable Dex file under the/data directory is optimized for each APK of the system to be upgraded.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.