There are two ways to create an android ROM:
- The method for compiling Android source code is complicated and will be introduced later;
- Create or customize the ROM based on the existing Rom.
This document describes how to customize a rom.
The machine I used here is Nexus One, so I downloaded a third-party Rom, which is based on Android farmer Rom 2.4. Of course, you can also use the ROM provided by cyanogenmod. In fact, Android farmer's Rom is customized based on the Rom.
Decompress the Rom. For example, the file name of Android farmer Rom 2.4 is:
N1_2.4_signed 2.zip
After decompression, you can see in the directory:
- Boot. imgfile, which is a system image, including some basic files for Linux kernel and system startup.
- META-INF directory, where the main system updates the script, path is: META-INF/COM/Google/Android/Updater-script
- The system/APP directory contains all the built-in applications in this directory, such as calendar, contacts, and Gmail. You can put your APK file in this directory, in this way, you can directly install
- System/bin directory, system command, can be executed after logging on through the ADB shell, such as top
- System/etc directory, similar to the/etc directory of Linux
- System/font directory, font
- System/framework directory, Android framework, is a Java implementation that supports Java Development under the Dalvik Virtual Machine
- System/lib directory, Android Local Shared Library, all so files, is a local shared library compiled by C, C ++
- The system/media directory contains a few media files, such as bootanimation.zip. Some PNG images in the compressed package are used for boot animation, which can be used to change the boot screen. Some audio files in the audio directory are used for ringtones and notifications.
In fact, the main step of this article is to customize the Rom is how to package the unlocked Rom signature. If it is only packaged back to zip, Android does not recognize it, an error is reported when the ROM package is verified.
After you place the custom APK file in the system/APP directory, you can also change the boot screen, add custom ringtones, and add commands (under system/bin, then you need to package the package back to the ZIP file.
Then, you need to use the signature tool to sign the zip package. The signature tool can be found:
Http://androidforums.com/developer-101/8665-how-signing-roms.html
Download. You must register a user to log on before downloading. The downloaded tool is executed in windows.
Run:
Autosign. bat
Set class_path for the first time and add testsign. Jar. The setting process is very simple. First, enter 2:
Then it will guess that your testsign. jar is in the current directory, So enter yes:
Select 4, manually enter the ROM path to be signed, and then enter yes:
The signature process takes some time and requires patience. After the signature, no new file is generated. It is completed by modifying the original file.
Original translated from: http://marshal.easymorse.com/archives/3622
//////////////////////////////////////// //////////////////////////////////////// ///////////////
Step 1: first, we need to have a compressed. Zip package, which is official and third-party rom. Step 2: Open the compressed package (the dual 4.0rom created by the TSM team is used as an example). We can see that the compressed package contains three folders and one boot. IMG: The data folder is the folder where the application is located. The APK we downloaded is installed on the memory card in the data folder, programs in this folder can be directly uninstalled. the meta-Info folder is the signature folder, and I will write it in the following tutorial. system is the system program folder, for example, HTC Sense, and some other files that cannot be uninstalled and can only be deleted with the re after root are all here, and everyone should be familiar with it, our main work goals are all in this system folder boot. IMG is a kernel file. third not: Let's go to the system folder to see. APP Folder: the hosts file and the corresponding. odex file PS: 2.3.5's romdoes not have .odexfile, And the 4.0system is imported into the odexfile. If we want to introduce a program to the system program, we will directly put .apk and. drag the odex file to the app folder in the compressed package. PS: In 4.0, some programs do not. put odex in the app folder together, causing program unavailability. about. I am still working on the odex file, so I won't talk much about it. bin Folder: This is complicated. net programmer, Bin folder should be no stranger, our DLL files are all in Bin, Here bin you can also understand so, normally we do not move him, such as busybox is put here. customoze: the custom settings. We recommend that you do not have XML or assembly language knowledge. for example, on the boot screen, boot music, and even some input method switching settings, you can modify the XML file here. ETC: Unknown... fonts: The font folder mainly contains the droidsans. TTF and droidsansfallback. TTF, where droidsans. TTF is in English, droidsansfallback. TTF is a Chinese font. We only need to change the appropriate font file to the two file names, and then drag it to the font folder in the compressed package to complete the font replacement. frameworks: the name looks like a frame structure folder. For example, the battery information we modified is displayed here. normal. lib: still studying ..... not moving. media: the built-in ringtones, text message sounds, and other media files are all here. go to the audio folder and we can see the following folders: alarms: Alarm ringstone: Incoming Call Notification: Notification UI: lock screen, we can drag your favorite ringtones to the corresponding folder of the compressed package. The advantage is that when you mount the mobile phone memory card, the default value will not be restored for incoming call ringtones. tts: multi-language support (should be). There are four other folders, so we can't move them anymore .... the main modification is above. here, we should have a basic understanding of how to streamline the Rom. below are some personalized settings 1: Modify the switch screen and ringtone to enter the Customize folder --- CID --- default. you can select default in XML. XML and click extract. In this way, only default is extracted. XML file. use NotePad to open (My vs2010 is the same), press Ctrl + F in notepad, and enter bootanimation in the pop-up search window to find the following code:
- <BootConfiguration>
- <BootAnimation animation="/system/customize/resource/hTC_bootup.zip" audio="/system/customize/resource/htc_boot.mp3"/>
- </BootConfiguration>
- <ShutdownConfiguration>
- <ShutdownAnimation image_png="/system/customize/resource/htc_downanimation.zip" image="" fps="10"/>
- </ShutdownConfiguration>
Bootanimaion indicates boot. You can change the boot screen by modifying the content of the following animation (you can extract a compressed package from another ROM) and audio indicates boot music. by default, HTC places the screen and music of the on/off server in the system/customize/ compressed package and rename it directly, and then drops it to the resoource folder. in addition. default. the XML modification ends here. If you are familiar with the XML code, take a good look at this and find a lot of interesting things. after streamlining the built-in system files and modifying the switch screen, what is the difference now? That's right, it's about the software version. If you see a software version called "spam dedicated", it's a very exciting thing to go to the system file, at the bottom of the page, no build is displayed. prop put the bushould. after the prop is decompressed separately, use notepad or notepad + to open it. (I recommend using notepad + here. You can download one by yourself. That's great. Of course, because I have vs2010, so it is opened with vs2010.) use Ctrl + F to find Ro. build. version. release = 4.0.3 (Android version, which can be replaced with 5.0 Beta version) Ro. build. sense. version = 4.0 (HTC Sense version, okay... you can change to version 5.0 for beta testing.) Ro. product. version = TSM ultimekangbang 3.0.1 (software version, okay, here is the special version of Long live for the soul of the thorn). The other builds will be better. the content of Prop can be studied by yourself, and there are many changes. finally, remember to change the build. the prop is dropped back to the compressed package to overwrite the original file. PS: Different Rom, this build. prop is not the same, for example, the Rom, build. prop is in the root directory. find other places that are not found by system. as mentioned above, when you have modified all the above items, a custom Rom will come out. |