Question about android .img rom modding - Android Q&A, Help & Troubleshooting

Hi!
I am new to modding, so forgive me if this is a noob question;
Is there an easy way to incorporate a small .zip update file into an existing Android rom .img file?
To be more precise:
I have created a custom rom for a Tanix tx3 mini android box using an existing rom and editing with the AMLogic CustomizationTool.
The clock on the device is not working and requires a small patch/update/fix, this patch is already available in a .zip file that has to be flashed using twrp after installing the rom.
Is there an easy way, just using the pc, to add this .zip patch into the .img file?

Related

[KITCHEN][WIN][GUIDE][MIUI] CosmicUI Kitchen (MIUI 2.4.20 on FXP)

Introduction
Here I am releasing the kitchen and a lengthy guide on what makes it special, how it works, et cetera; as my goodbye gift to the X10 forum as I want to keep this knowledge open so others might be able to help. Please be aware that this is not for newbies, I hope that other people still building custom ROM's for X10 will put my research to good use. It is directly (but heavily modified and enhanced) based on the script by erenz1202 and probably has additional credits, I don't know. His original thread is here for your reference.
I hope to keep this kitchen/guide a progressive effort, I will do my best to keep this thread maintained with the help of all contributors. If you have any questions, don't hesitate to ask! But if you're a newbie and don't know anything about development, please don't spam the thread with silly questions... I don't have the time to teach someone how to use a computer
This thread is under construction, I did rush writing it. Please post your suggestions for sections/updates/anything in this thread. I would love to see a good "Team-XDA" effort
If any other MIUI ROM builders want to take my sh!t and use it in their ROM, I really don't care so go for it. LOL. Credit would be nice but I wouldn't be surprised if you don't. But I really hope this doesn't cause a bunch of people to release ROM's based on this MIUI with no real GOOD changes without sharing the knowledge here, the X10 Dev forum is already enough of a popularity-contest
Notable Features
- Automatic APK/JAR injection subroutines (see below for details)
- Full logging of the build script/process
- Unique tweaks/hacks not present in any other MIUI ROM, fully documented and explained (see below for details)
Requirements
- Windows Vista/7 required (Windows XP cannot handle this advanced batch file)
- Java Runtime Environment
- Above-average knowledge of batch files, XML, smali
Downloads
You can find all relevant downloads, including old versions of CosmicUI, in my Mediafire folder - the important stuff is in the 'Kitchen' subfolder.
http://www.mediafire.com/?ksvtupinjw8nd
- Kitchen update for v0.6.x is also added. You still need to original kitchen, download the update ZIP and extract it to your kitchen folder (overwrite all) to update it. The new version brings a pre-build script to inject language files, and also a post-build script to PNG Optimize/zipalign/recompress JAR's and APK's.
Also included as a separate download is a self-extracting EXE of MIUI 2.4.20 for Incredible S (from MIUI UK i.e. miuiandroid.com), which Cosmic UI was based on. FXP-CM7 is not included, you will need download that from the OT too.
Instruction/Guide
Unpack the kitchen.zip archive to a new folder on your Windows Vista/7 PC. Doesn't matter where, just as long as you have full administration rights (and run the batch file as administrator if you have UAC enabled). Here is an explanation of the kitchen contents:
base_cm7source
- Extract FXP-CM7 files here. CosmicUI v0.5 uses FXP-124. Use the /system contents of the flashable ZIP, not the system subfolder (i.e. this is valid - .\base_cm7source\build.prop)
base_miui
- Extract MIUI files here. Note that this folder is modified with every build, I have created a self-extracting EXE of MIUI 2.4.20 for Incredible S from miuiandroid.com and uploaded it to the mediafire folder. Place this in the root kitchen folder and run it if you need to unpack again, it will extract to the base_miui folder. Open the EXE with WinRAR (or 7-Zip) if you want to inspect it. If you want an original ZIP of MIUI 2.4.20 for various devices, check the page here for direct downloads.
base_postmods
- Precompiled stuff for the MIUI build, either replacing original MIUI/FXP files or completely new. Some is unique to CosmicUI, details in next section.
base_postmods_inject
- Source files for automated JAR/APK injection functions, with a specific folder structure and details of each modification included. Details in next section.
base_postmods_inject_obsolete
- As above, but these are no longer used (and excluded from the build script). They were either for older versions of CosmicUI or only ever used in my test builds.
base_postmods_special
- Special injections for use with my automated mods/scripts in CosmicUI, currently used for building Extended Settings APK/JAR and HW-LED fixed framework APK. The build script will show that these injections are not automated like the base_postmods_inject folder.
base_tool
- All the dependencies and tools used for the build script. Includes 7z binary, aapt, apktool and package-signing jar's. Note that I use APKTool for jar files instead of smali/baksmali, because APK tool has some fixes that the original (bak)smali doesn't. So if you manually decompile APK's/JAR's, you will need to use Apktool v1.4.3 to keep smali/xml compatibility with the mods in this kitchen (you will get compile errors if you mix decompiled files from different versions). This folder also contains a custom 'usr' folder from the original kitchen, I never updated it and it is still used by the build script.
CosmicUI Modpack (obsolete since 0.4)
- Just an extracted Flashable-ZIP of the old Modpack for 0.3 (pre-Aroma). Don't use it on new versions
CosmicUI-FixPermissions
- Just an extracted Flashable-ZIP of a little updater-script that fixes all permissions on /system partition, useful when pushing new files via adb in CWR without having to chmod/chown. I originally made it to save time but it's a bit redundant if you use my modified kCernel-v01 since it boots directly to TouchRecovery (which has Fix Permissions in the menu).
CosmicUI-kernel-kCernel_v01
- Just an extracted Flashable-ZIP of my modified kCernel v01. Only differences are (a) the boot graphic and (b) Boot Menu removed and only uses Touch Recovery (saves time).
CosmicUI-v0.4.01.122
CosmicUI-v0.5.01.124
- Templates for CWM-flashable ZIP after building. Move the system folder into this folder, ZIP the contents and flash. Includes all the Aroma install stuff.
~build.bat
- The main magic. This batch file is well commented and has a lot of experimental stuff commented-out. Take a look. If it makes no sense to you at all, you're not experienced enough to use a kitchen! But feel free to ask specific questions about it
~build.txt
- This is the log file (new one created every time) when running the above script. Good for checking errors with the build, especially with APK Tool (de)compiling or missing files. Pretty fancy stuff there!
How to do a quick build to make CosmicUI v0.5.x?
1) Extract contents of FXP-124 .\system\ to base_cm7source
2) Extract MIUIandroid.com's 2.4.20 for Incredible S contents of .\system\ to base_miui
3) Run the ~build.bat file (yes, it takes a while - the JAR/APK injection mainly)
4) Move the new created .\system\ folder to the flashable-CWM ZIP template folder (e.g., .\CosmicUI-v0.5.01.124\)
5) ZIP up the contents of the template folder you used above, and install the update in CWR.
About base_postmods_inject
Inside the folder you will see two others, app and framework - this is pretty self explanatory. If we go inside framework for example, we will see three folders and three files:
framework.jar [folder]
framework-res.apk [folder]
services.jar [folder]
framework.txt
framework-res.txt
services.txt
Let's take a look at framework.jar. The txt file for it just explains what is in there, it's not used in the build script but is for your info. In this case, it details the changed files used for patching-in some WebKit and Net code to eliminate the need for the 2048 read_ahead_kb tweak that most other MIUI ROM's for X10 need to prevent the WLOD's. Anyway, inside the folder is a smali folder - it follows the same directory tree of the original decompiled package (remember - with apktool 1.4.3), but with only the changes necessary for the patch. [FYI, The 'build' folder is re-created with every build, designed to be a cached-compile to speed the build process but it doesnt work right - probably because of changed timestamps. Don't worry about it.]
Anyway, you could use a program like WinMerge to examine the differences of the changed files and find the patches I made. In the case of framework.jar there is a problem with battery drain in the \net\ code (I think), it's a fairly dirty hack that might put the system_server in a constant loop. I don't know. Anyway, that's everything explained about the apk/jar injection feature. I think. If you want to mod another .apk or .jar, remember to compare your changes to the original and then - following the directory tree of existing injection mods as a template - make new folders and move the modified files there.
UNDER CONSTRUCTION, NOT FINISHED. Ideas/suggestions welcome! Peace
This seems awesome!!!! thanks alot!!
wow, this is beyond generous....thank you very much.
Sent from my Desire HD using xda premium
Tnkz a LOT!!!!!!
I'll still be working on this, I'm not getting rid of my X10 yet. Current priorities:
(1) Get latest MIUI Camera working
(2) Fix battery drain when data enabled
(3) Make it multilanguage
(4) What else? Ideas welcome.
I am also considering downgrading the MIUI version. The current 2.4.20 was never "stable", it was a development release from Xaomi. MIUI 2.3.7 was the last "stable" MIUI Gingerbread release. I don't know the difference between 2.3.7 and 2.4.20 though, does anyone know?
Dan if you update the rom so update miui version not get back to 2.3.7 ( just kidding )
while im looking on miuis thread i'v seen 2.5.11 ( camera updated )
and 2.5.25 i think its more stable than the 2.6.8 version ( that what i see )
so why not to update to a new miui ??
sparxx4 said:
Dan if you update the rom so update miui version not get back to 2.3.7 ( just kidding )
while im looking on miuis thread i'v seen 2.5.11 ( camera updated )
and 2.5.25 i think its more stable than the 2.6.8 version ( that what i see )
so why not to update to a new miui ??
Click to expand...
Click to collapse
Sorry, don't know how I missed this reply lol. Well MIUI 2.3.7 is the last stable gingerbread release of MIUI. 2.4.20 was only ever a development release. So I think there may be some bugs in 2.4.20 (but I can't find anything).
MIUI 2.5 and onwards are only for ICS sadly. I do plan to work on MIUI for ICS in some time, but there are already a heap of X10 MIUI ROM's for ICS and MIUI4 is still beta and many things will change.
Looking at the official MIUI download page, they say Latest Version is 2.6.1. But the latest Gingerbread release is 2.3.7c (e.g. for Desire).
And then in the development downloads, the last one listed for Gingerbread is only 2.4.13.
I have dug around for newer MIUI versions for Gingerbread, I am 99% sure that 2.4.20 is the last one. The best I can do is work on porting over some of the newer apps from MiCode project Gingerbread-branch (open-source MIUI repo) because those apps might have some new updates and fixes.
v0.6 kitchen update added to the folder.
- Kitchen update for v0.6.x is also added. You still need to original kitchen, download the update ZIP and extract it to your kitchen folder (overwrite all) to update it. The new version brings a pre-build script to inject language files, and also a post-build script to PNG Optimize/zipalign/recompress JAR's and APK's.
Click to expand...
Click to collapse
i dont know what im doing ,,,but im trying
Dan on your kitchen you use Incredible s miui rom
but erenz use nexus 1 miui rom
so what the different ?
Any screenshot?? Interesting
Sent from my X10i using xda premium
Superman said:
Any screenshot?? Interesting
Sent from my X10i using xda premium
Click to expand...
Click to collapse
screenshot for what my friend ??
---------- Post added at 02:43 PM ---------- Previous post was at 02:41 PM ----------
i think i found it why you use the incredible s miui not the nexus 1
simple i think bcuz it have the latest stable GB miui wich 2.4.2 and nexus 1 have the 2.3.3
how smart i am
right ?
sparxx4 said:
screenshot for what my friend ??
---------- Post added at 02:43 PM ---------- Previous post was at 02:41 PM ----------
i think i found it why you use the incredible s miui not the nexus 1
simple i think bcuz it have the latest stable GB miui wich 2.4.2 and nexus 1 have the 2.3.3
how smart i am
right ?
Click to expand...
Click to collapse
2.4.2 was not a stable MIUI it was the last development release on GB branch.
Is there xloud for miui ?? Its realy low
Sent from my X10i using XDA
hey Dan can i build v 7 with this steps only ??
How to do a quick build to make CosmicUI v0.5.x?
1) Extract contents of FXP-124 .\system\ to base_cm7source
2) Extract MIUIandroid.com's 2.4.20 for Incredible S contents of .\system\ to base_miui
3) Run the ~build.bat file (yes, it takes a while - the JAR/APK injection mainly)
4) Move the new created .\system\ folder to the flashable-CWM ZIP template folder (e.g., .\CosmicUI-v0.5.01.124\)
5) ZIP up the contents of the template folder you used above, and install the update in CWR.
or there is another thing i have to do ??
That's pretty much it yes, as long as you don't want multilanguage and stuff. There is another batch file for multilanguage injection in the kitchen update. Examine the batch files for details and usage.
But what exactly would make that v7? It'll be the same as 0.6.
i just name it v7
but whats im going to do just updating CM source for the last .. i just want to get into making a rom world
a small step for me but it give me alot and i will be happy if you help me
and pleas talk to me simple english i dont understand all the dev words
---------- Post added at 10:19 AM ---------- Previous post was at 10:14 AM ----------
so here what i'v do for now
taking miui base from the incredible s
taking fxpCm7.2 130 base
puting it on the folders ,, run Build
im cool for now ??
Well... If you don't understand all the dev words you might have a hard time working with the kitchen Yeah cool, you could try building with FXP129 or whatever the latest CM7 is for X10.
What the ROM really needs in an experienced smali and script editor.
CosmicDan said:
Well... If you don't understand all the dev words you might have a hard time working with the kitchen Yeah cool, you could try building with FXP129 or whatever the latest CM7 is for X10.
What the ROM really needs in an experienced smali and script editor.
Click to expand...
Click to collapse
yeah im sure you too had a hard time on the beginning
i will try google what i dont understand and ask you for sure
so after build done ,, i just take the System folder add it to a flashble folder and zip it ???
sparxx4 said:
yeah im sure you too had a hard time on the beginning
i will try google what i dont understand and ask you for sure
so after build done ,, i just take the System folder add it to a flashble folder and zip it ???
Click to expand...
Click to collapse
Yes.
then im cool for now .. build done and the zip done ... all is need now testing the rom

[HELP] Slight modifications to rebuild a kernel

I know this is a bit scarce, but I need help with a kernel. Why? Because I unfortunately don't have a
computer at the moment (much less Ubuntu suite), just my trusty GT-i9505. Also, I have a few
questions.
First of all, this is the guide I am following:
[GUIDE] Use aircrack-ng on android phone using Wireless USB Adapter
http://forum.xda-developers.com/showthread.php?t=2338179
This guide is aimed towards amateur kernel builders,
and the suggested ROM for use with this is Cyanogen Mod. Although, the post does mention that he was able to use his stock touchwiz ROM. He mentions he was able to do it with a few minor adjustments (along with the kernel and .md5 file):
I got this to work on my stock Samsung TouchWiz ROM by making a few adjustments:
- Get the kernel from Samsung: http://opensource.samsung.com/
- Change the lines in the .config file of the kernel below ## Samsung Rooting ... from =y to =n using nano
- To get boot.img, download the ...tar.md5 firmware matching your current firmware from http://www.sammobile.com/firmware/, rename .tar.md5 to .tar, and extract the boot.img. You cannot use mkbootimg here, only abootimg, as this boot.img has a special ramdisk address!
Click to expand...
Click to collapse
I would love to do this with my current TouchWiz ROM, (not stock) Samy Deluxe ROM- Operation Ivy
Any help/luck doing this? Thanks in advance
Bump
Bump. Let me also add that I can give the source to the kernel (of the ROM I have).
Really all that needs to be done is to rebuild that kernel (and follow the steps of course to the guide I'm using).
I have a TP Link tl-wn722n USB Wireless adapter, so I need to have the module/driver installed into that kernel.
The name of the kernel is 3.4.100-GoogyMax3_TW-v1.1.3
Here's the link to the kernel: http://forum.xda-developers.com/attachment.php?attachmentid=2895862&d=1407942420
I downloaded my kernel and looked inside of the zip file and don't seem to find a ".config" file as mentioned in the guide, but did see a boot.img so I don't believe there's a need to download the .md5 file:
I got this to work on my stock Samsung TouchWiz ROM by making a few adjustments:
- Get the kernel from Samsung: http://opensource.samsung.com/
- Change the lines in the .config file of the kernel below ## Samsung Rooting ... from =y to =n using nano
- To get boot.img, download the ...tar.md5 firmware matching your current firmware from http://www.sammobile.com/firmware/, rename .tar.md5 to .tar, and extract the boot.img. You cannot use mkbootimg here, only abootimg, as this boot.img has a special ramdisk address!
Click to expand...
Click to collapse
Any help at all would be greatly appreciated.
Bump... again...

[Q] Interesting files that must be dumped

What are the interesting files that must be dumped on android to create a modified rom ?

How can you extract the radio image from an official Sony ROM?

With other ROMs (e.g. Nexus devices, you simply download the official zip which contains the various images: system, vendor, kernel, RADIO, etc.)
Using Xperifirm to download an official Sony ROM, you get a folder full of crappy SIN files ...
How can one get a flashable radio.img?
u don't need one
This is not Q&A thread. Don't post question at here.

Magisk

good day fellow members
I have started using Android Devlopment for a few days
I am pretty new with everything
i have some understanding of java and python am still very learning
now I have made a custom rom for my j5 pro
I have compiled the kernel of source code and created a custom system
everything seems to work well on my phone
only I want to install root
now my question is how can I integrate magisk into the firmware so that I do not have to install it later using the zip file

Categories

Resources