Search code examples
javaandroidbuildrom

How can I create custom Android ROM build?


I need to create a custom Android ROM build from img file that already built. I need to unpack it, replace some files (sounds, animation, change some build.prop entries), resign all the ROM with other platform cert (includes replaced APKs) and than create another img. Is there any tools that can do this? Thanks in advance.


Solution

  • Ok, I found the answer for my own question. All I need: simg2img and img2simg utilities that can be found in build tools of Your ROM build. To create custom ROM You need:

    1. Decompress system.img via simg2img.
    2. Mount system_raw.img as regular (ext4) image in Linux system.
    3. Replace all needed files.
    4. Resign all apks that have the same serial number as framework-res.apk including all jars and apks in framework folder (framework-res.apk also needs to be resigned).
    5. Unmount and compress image with img2simg utility
    6. Done!

    Now You have customized ROM that signed with a new platform key.

    P.S. Also, You need to replace res/keys file in recovery that matches the new platform key (OTA updates will not work without actual keys), but this is another story.