I. Principle of Flash brush
I remember the first time I had a hard time flashing the machine. What is it about? Because I don't understand the principle, I only saw a bunch of tutorials, and I was afraid I could make a mistake by changing the cell phone into a brick. What makes me really understand the principle of Flash brush is to read this article: Click to view
Flash is either of the following methods:
The first is recoveryzip. at ordinary times, we add update.zip to the SD card, and then alt-S. This method calls the recovery method to copy various IMG or files. Do you want to know how recovery works? I didn't find any good information, so I looked at some source code of recovery here: Click to view
The second is the fastboot method, which is actually a cool method. To put it bluntly, fastboot refers to the existing image files in various partitions (IMG files, similar to the image files we make on the CD) writing directly to the specified partition by overwriting is a bit violent, and similar to the ghost restoration of the operating system.
Which of the following two methods is better:
Recoveryzip is simpler. Just put update.zip in the directory of the SD card, and then enter the rediscovery mode alt-S. But like any silly thing, his flexibility is very small, even if an error occurs, you do not know how to solve it. Generally, in order to ensure the reliability of the RoM, some installation environments will be determined in the installation program, and the mobile phone environment will be ever-changing, rom experts are also difficult to consider, in addition, the recovery program itself also has some environment verification.
The fastboot method is more flexible and more powerful. The fastboot method does not need to rely on recovery, or even the Linux underlying recovery mode cannot be entered. You can also use the fastboot method to work back. The fastboot mode actually calls SPL to flash the machine. If the SPL is broken, the fastboot mode cannot be used, that is, the brick. The fastboot method requires you to have the fastboot program on your computer and the mobile phone must enter the fastboot mode. For more information, see Google * ^_^ *
Ii. Let's look back at the partitions in the Android system (partitions may be inaccurate)
Partitions In the Android system I have learned are:
Hboot (the SPL we fl). This partition is the most basic boot partition (similar to the BIOS in a computer). If this partition is broken, it will almost become a brick, so we should be so careful when refreshing SPL.
Boot. This partition should be the boot partition of the Linux operating system.
Radio, this partition is related to some underlying device drivers or functional programs of mobile phones, such as phone calls and text messages. Different system versions have different radio packages, we usually use the ROM of a higher version. If we do not use the radio of a later version, the call may be abnormal.
Recovery, this partition is installed with the previously mentioned Recovery Program. Different Recovery versions can provide different functions, if you are interested, you can compile your own recovery based on the source code of the recovery. However, in general, the primary reason for rediscovery is to grant root permissions.
System is the main function program partition of the General released Rom. The Rom function and the customization of the built-in program should be modified and compiled based on this partition.
User data.
Cache, cache, which is generally used for the Cache during OTA upgrade, we can say that SPL can increase the size of the space in the program area, which is mainly to shrink the size of this area and then increase the size of the partitions in the program area.
Iii. Analysis of a typical Rom
We usually package the upgraded Rom into a recovery package. The packages that can be identified and processed by the recovery program should have a fixed format. Some important constraints I understand are as follows:
1) it must be a standard ZIP package;
2) The recovery script must be stored in the META-INF \ com \ google \ Android \ Update-script;
3) Some other certificates and signature information should be placed under \ META-INF.
4. Can we customize our Rom?
In theory, we can customize it ourselves.
The simplest customization should be to take an existing basic Rom that is considered to be good, replace some resources, add some built-in system programs, and then package and release;
To be more advanced, you should modify some built-in system programs, such as the original system programs in Chinese;
When it comes to a more advanced version, you should download the Android system source code on the official website of Android and compile it based on system-level customization and transplantation. For example, the current hot Android source code compilation system is transplanted.
If it is a simple self-made Rom, we should mainly solve the following problems:
1. Select a relatively stable internal and basic, Which boot. IMG is included in the update.zip package, and most of the System directories are directly available, which can be used as the basis for custom Rom.
2) modify the system. For example, you can customize something like this: System \ etc \ apns-conf.xml, this is to set the APN access point; System \ etc \ hosts, this is to set the host file, now many people cannot bind a Gmail package, so they can add one in this host file: 74.125.93.113 android.clients.google.com (of course, it is hard to say how long this address can be used )... if you want to customize something, you can view it on your own.
3) re-package the ROM signature. The previous article has introduced the basic structure of a rom package, but the package based on this structure still cannot be installed by recovery, because there is no signature! Rom signature can download an automatic signature tool auto-sign. Google is recommended for details. (Note: The Rom signature tool must be supported by java1.6, so the system must have a jre1.6 environment ).
The next step is a bit advanced. At present, I only pay attention to these basic things. errors are inevitable. You are welcome to correct them and make it easier.
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.