How does a ROM flash work (scripts possible?) - G1 Q&A, Help & Troubleshooting

This is some ways a basic question... but something most people don't bother to think about..
when I go to Recovery and Flash a zip file... what is actually taking place? is it only unzipping the contained files to their respective paths in the filesystem (just like a tarball), and/or are there any hooks such that a script of one flavor or another could automatically be run? (ie. to create some links, fix permissions, etc)

Every rom flash is based on an update script which is located at META-INF/com/google/android/. All the permissions are set through the update script. If you extract any rom and explore to the update script and see. You will find exactly how the rom flash works..

peshal said:
Every rom flash is based on an update script which is located at META-INF/com/google/android/. All the permissions are set through the update script. If you extract any rom and explore to the update script and see. You will find exactly how the rom flash works..
Click to expand...
Click to collapse
thanks! (was hoping it would be something like this)

Related

[Q] Integrating a language with a ROM .zip?

Hi,
I have a ROM, for example Enomther's. and I also have the arabic language libs. how can I integrate the arabic libs into the ROM's zip file so I don't have to flash another zip for arabic libs? I have attached the arabic libs.
Bump! anyone?
Come on, what kind of answer do you expect?
Here's the answer: you need to substitute the files in the original ROM zip and resign it - that's it.
Now you're going to ask, how to do it, because you have no clue - and the explanation is a lot of work to try and put in one post, and setting up signing applications involves installing Java SDK and some knowledge. If you're asking the question you're asking - it seems like you're far from being skilled enough in Android depths to do what you're asking to do, and that's why you see no answer. After all, if you'd want to do it - you'd have to search anyway, Google "sign apk zip" and here you go, a lot of tutorials show up. And if you didn't search and posted instead - it speaks for itself.
By the way, there's no good reason to integrate the libs into a standard ROM, moreover - it's a bad idea. ROMs tend to be updated, and the work that needs to be done setting up the environment for signing APKs and ZIPs is way more than flashing one update right after updating the ROM to a newer version. And ROMs are updated quite often.
Yeah i'm not skilled. I'm trying to learn... I am trying to make my own customized ROM for my country's users. And I didn't mean editing ROM files, I was saying how to push the lib into the ROM zip so people don't have to flash the arabic zip lib when they flash my customized ROM. So I hope you haven't missunderstood my question...
Ah, I see, you want to customize and share the ROM. In that case, you have to have the setup I'm talking about. The update.zip contains folders and files, which directly replace the files in the same folders in ROM, so if you have a ROM zip - you need to replace those files. The easiest way would be just extracting your update.zip, opening a ROM zip in 7zip / WinZip / WinRar / etc, putting those extracted files from update.zip in the right place into ROM zip by drag-and-drop, and then resigning the ROM file.
Please do some googling as to how to sign ZIP and APK files. There are some pretty good tutorials.
I have done that before, and I replaced the lib file with the ROM default lib. it's libskia.so, but I think because I didn't know I have to sign it it gave me an error while flashing through recovery. so after I replace the lib I have to re-compress the file and then sign the zip right?
You don't have to re-compress if you replace the file without decompressing the original ROM archive, by dragging-and-dropping the file into the archive.
And yes, you have to re-sign the ZIP after any changes you make to anything inside it.

Signing a bootanimation.zip

Hi,
i want to have the stock bootanimation on my N1 which is running CM7 #96
I have this attached bootanimation and want to sign it, so that i can flash it.
I dont want to push it to system/app via rootexplorer and change permission and reboot anymore.
How do i do that? Or can somebody get it done for me?
It's a little more complicated than just signing it - in fact, you don't need to sign it, you need to create a flashable zip which will install the file.
I find the easiest way is to add the file to a gapps package in the right directory structure, so that everything gets flashed in a single zip. You would need to look at the install script in the gapps package, and make sure it first removes the existing animation, and then check to see if it installs the whole /system structure, or individual files. If it installs individual files, you will need to list your animation...

[Q]I9001 Battery mod

Hello everyone,
Can someone please inform and post a thread link of a battery mod that works on the i9001? By battery mod I mean small zip file that is installed from recovery and changes the stock battery meter
You can make it yourselt.
1. Use Root Explorer to get your framework-res.apk file
2. Go to http://uot.dakra.lt/ to customize it yourselt.
3. Go to http://forum.xda-developers.com/showthread.php?t=1253707 to download the Root-i9001-Signed.zip
4. Put the modified framework-res.apk in the above zip file and delete the unneeded files.
5. Update the updater-script file, resign the zip file.
6. Flash the zip file in recovery.
Do you like this one?
quest221 said:
You can make it yourselt.
1. Use Root Explorer to get your framework-res.apk file
2. Go to http://uot.dakra.lt/ to customize it yourselt.
3. Go to http://forum.xda-developers.com/showthread.php?t=1253707 to download the Root-i9001-Signed.zip
4. Put the modified framework-res.apk in the above zip file and delete the unneeded files.
5. Update the updater-script file, resign the zip file.
6. Flash the zip file in recovery.
Do you like this one?
Click to expand...
Click to collapse
If you use manveru0's kernal and recovery you can now flash the update files as they come from the kitchen
quest221 said:
You can make it yourselt.
1. Use Root Explorer to get your framework-res.apk file
2. Go to http://uot.dakra.lt/ to customize it yourselt.
3. Go to http://forum.xda-developers.com/showthread.php?t=1253707 to download the Root-i9001-Signed.zip
4. Put the modified framework-res.apk in the above zip file and delete the unneeded files.
5. Update the updater-script file, resign the zip file.
6. Flash the zip file in recovery.
Do you like this one?
Click to expand...
Click to collapse
Hmm... yes, nice, but I'm not in to designing things. I was looking for something that has been already created
what's the version of your Rom?
quest221 said:
what's the version of your Rom?
Click to expand...
Click to collapse
Firmware version : 2.3.4
baseband version I9001XXKP4
Kernel Version : [email protected] #7
Build Number : GINGERBREAD.XXKP4
I use Go launcher (from my opinion it's the best), if you think otherwise please post the better launcher, I am opened to experiment others.
Many thanks,
Ciprian
I don't have a I9001XXKP4 Rom in my hard drive. If you can send your your framework-res.apk, I can make one for you.
quest221 said:
I don't have a I9001XXKP4 Rom in my hard drive. If you can send your your framework-res.apk, I can make one for you.
Click to expand...
Click to collapse
I would like something like http://img225.imageshack.us/img225/9943/smoothbatt.png if it is possible.
I have attached framework-res.apk
opps a
hey guys!
just used this. twice great kitchen, really revamped some of the more boring icons on stock roms. thanks for the tip!!
1framework-res_I9001XXKP4_signed.zip is the file that I updated the updater-script so you can flash it in the in-build recovery.
1framework-res_I9001XXKP4_original_signed.zip is your original file. If there are any issues, you can flash it back in the in-build recovery.
How to:
Copy the zip file to the internal SD card, not the external one, go to recovery, flash it.
quest221 said:
1framework-res_I9001XXKP4_signed.zip is the file that I updated the updater-script so you can flash it in the in-build recovery.
1framework-res_I9001XXKP4_original_signed.zip is your original file. If there are any issues, you can flash it back in the in-build recovery.
How to:
Copy the zip file to the internal SD card, not the external one, go to recovery, flash it.
Click to expand...
Click to collapse
Thanks, exactly what I needed. I flashed it and all is ok
quest221 said:
1framework-res_I9001XXKP4_signed.zip is the file that I updated the updater-script so you can flash it in the in-build recovery.
1framework-res_I9001XXKP4_original_signed.zip is your original file. If there are any issues, you can flash it back in the in-build recovery.
How to:
Copy the zip file to the internal SD card, not the external one, go to recovery, flash it.
Click to expand...
Click to collapse
can i use it on 2.3.6 rom?
nope because you will end up in a bootloop by flashing this
its only for XXKP4
urm, Ive tried to do as you told in post number 2(by cooking it according to my own preference)
but my problem starts from step number 5
5. Update the updater-script file, resign the zip file.
Click to expand...
Click to collapse
I already received the cooked file
but I dont know how to change the update script and end up failing to update using the zip file.
can you please help me?
or link me to a place that really can help me to learn better on changing the update script.
try this one, I updated the updater-script, you can compare it with the one from kitchen.
PS: Forgot to update the update-binary file, now try the new one. It should work.
Thanks!!!! But I got an error that states
E:error in /tmp/sideload/package.zip
(status 2)
I wonder whats wrong.
looked in a thread
http://forum.xda-developers.com/showthread.php?t=1194245&page=3
and from what I understand it seems to be a problem with the update binary. But Im just an end user and this is too much for me.
anyway maybe Ill try to flash the cranium ROM and try to cook again a new one and use your update script.
cheers!!
Hi,
Is there any posibility to change framework-res.apk file without CWM? I don't want to instal CWM becouse of it has a problem with front side cam and I need this cam. It's can't be overwritten when the phone works. Maybe some adb and push command is possible.
Could you help me by describing the whole procedure? Sorry for my English.
@quest221
Can you maybe make one for Android 2.3.5 like the screenshot @ page 1?
I have baseband I9001XXKPF, Build XXKPG
I update the zip file with the new update-binary file.
Is there any posibility to change framework-res.apk file without CWM?
Click to expand...
Click to collapse
Yes, I just use the recovery from Samsung, not the third-party.
Check the post #2, that's the steps. Also replace the update-binary file with the one in my zip file.
Can you maybe make one for Android 2.3.5 like the screenshot @ page 1?
Click to expand...
Click to collapse
Upload your framework-res.apk file.

[Q] How exactly does flashing work?

Hi all,
My question is aimed to head deep into the Android OS and the flashing process itself. I know that if I flash my phone with a new ROM that system files are replaced and also some other files too. My question is how is this done? Is there an exact order in which the files have to be replaced, and are they "just" overwritten or are they deleted first and then the new ones put in place?
Forgive me if this question has already been answered. I really tried my best to find answers on Google and in here.
Thanks in advance for any enlightening comment.
Open up an update-script and your dilemma will be solved
Sent from my GT-I9000 using Tapatalk
Essentially, like the previous reply mentioned the android OS is heavily partitioned, but has a lot of sneaky mount points to hide this fact.
Really all a CWM flashable zip does is follow a script, easily readable in the zip, to copy files throughout the OS partition.
If you look in the zip you'll see a few things, the biggest thing here is the /System folder. It contains the entirety of the system partition that makes your ROM /Your ROM/. Also you'll see boot.img which is the kernel (and CWM). A modem.bin file is also present, but to my understanding is only flashed if one is not currently present.
When looking at CM9's zip, you'll see an updater.sh. This is the shell script that's run on using CWMs install function.
It's process checks a few environment things and installs (copys over /system) based on this.
Check out the script, it's really interesting.
Thanks to all of you
I will have a look inside a script then.

Patching core.jar & service.jar in Kit Kat

Manual how to apply patches android, for those who do not get it in the standard way. News for firmware based CM11, KitKat, 4.4.4 and others...
We will need 1 ) Root Explorer or another file manager. 2 ) Lucky Patcher.
And so, we go through the Root Explorer to system/framework and look there for a couple of files with names core.jar and services.jar, found means to copy to SD card for further action with them.
Go to Lucky Patcher and select the function to "Rebuild and install". We are looking for in the open filemanager copied our files, click on each of them and choose the function "Patch file firmware", patched both files close Lucky Patcher.
Open Root Explorer find our patched copy and rename them from the core-patched.jar in the core.jar, and so did a services-patched.jar in services.jar.
Put them in the firmware in two ways.
The first :
Through the Root Explorer to replace the first system/framework file core.jar and put it right (rw-r - r--).
Reboot and look at the first two Lucky Patcher android patch applied. Good!!!
Replace the same in system/framework file services.jar and the phone itself will go into a reboot may reboot itself again, nothing wrong with that.
Go through the Root Explorer on the road system/framework to the file services.jar and give him the right to (rw-r - r--).
Watch in Lucky Patcher all three patch applied android.
The second method:
For him, we need the establishment of recovery TWRP or CWM and Aroma Filemanager. Earnest request before to do something, then test Aroma FM on your device !!!
We go in and start recovery Aroma Filemanager. After that, everything just as in Root Explorer, substitute core.jar on patched us exhibiting rights (rw-r - r--) and reboot.
Again in recovery and launch Aroma Filemanager. And substitution of services.jar but rights can and should be put immediately (rw-r - r--).
Reboot and you're done.
One piece of advice if something goes wrong as we would like it keep copies non patching core.jar and services.jar.
You can always get them back into place and put right through Aroma Filemanager.
Addition to those who have odex firmware :
In odex firmware need to copy the core.odex and sevices.odex on sdcard.
Go to Lucky Patcher, and on the bottom panel to select "Install and rebuild".
Then, select a file core.odex and select to patch the firmware file, then select services.odex and also choose to patch the firmware file, then rename and put them back into the system/framework.
Ms_Julia said:
Manual how to apply patches android, for those who do not get it in the standard way. News for firmware based CM11, KitKat, 4.4.4 and others
Click to expand...
Click to collapse
Why patch these files?
AXDFREEDOM said:
Why patch these files?
Click to expand...
Click to collapse
To disable signature verification in the package manager.
AXDFREEDOM said:
Why patch these files?
Click to expand...
Click to collapse
...
Ms_Julia said:
...
Click to expand...
Click to collapse
Which ROM you now use??
No need to patch this files, because you can install paid apps from google without this, playstore dont chech it for verificatio, better leave this files alone, I dont know how to say. Xd
You dont need to patch anything.
And if you dont know Lucky patcher is illegal on xda.
Your guide is good
But, that dont need to do.
Paget96 said:
Which ROM you now use??
No need to patch this files, because you can install paid apps from google without this, playstore dont chech it for verificatio, better leave this files alone, I dont know how to say. Xd
You dont need to patch anything.
And if you dont know Lucky patcher is illegal on xda.
Your guide is good
But, that dont need to do.
Click to expand...
Click to collapse
Thank you, I know it. But sometimes it is necessary for example to amend the application to the best of his work. And to set it is necessary to use patches to disable signature verification.
Ms_Julia said:
Thank you, I know it. But sometimes it is necessary for example to amend the application to the best of his work. And to set it is necessary to use patches to disable signature verification.
Click to expand...
Click to collapse
That can make problems in ROM, that is maybe good with some apps, but I dont know which app need this??
Paget96 said:
That can make problems in ROM, that is maybe good with some apps, but I dont know which app need this??
Click to expand...
Click to collapse
I think u don't need to use these patches. As u said they lead to illegal activities. I have no key problems they cause only help with all applications. Because I have a direct hands. How well do u know the android ?
Ms_Julia said:
I think u don't need to use these patches. As u said they lead to illegal activities. I have no key problems they cause only help with all applications. Because I have a direct hands. How well do u know the android ?
Click to expand...
Click to collapse
I know pretty much, but I dont know anythig about coding.
Paget96 said:
I know pretty much, but I dont know anythig about coding.
Click to expand...
Click to collapse
U know the only thing is the top of android. But the essence of not even examined, it's clear that u are not a programmer or developer. Just once again I say to u for u my user guide is useless , unless u want to learn everything. And to know a lot more than it is now at the moment.
Ms_Julia said:
U know the only thing is the top of android. But the essence of not even examined, it's clear that u are not a programmer or developer. Just once again I say to u for u my user guide is useless , unless u want to learn everything. And to know a lot more than it is now at the moment.
Click to expand...
Click to collapse
I dont understand you.
Paget96 said:
I dont understand you.
Click to expand...
Click to collapse
These patches are needed for a more complete control over the android. Do you understand now?
Big thanx for this great tutorial,its very usefull.but one request i have about patching with lucky.maybe its possible to patch the service.jar for full tweaking like v6 supercharger etc. As we know zeppelinrox is working on it and we can do it by hand with very anoying smalipatches one by one,so maybe its possible to make it with luckypatcher too?
GREETZ FROM TEAM-OPTIMA!!!
NmAa said:
I guess what she's trying to impost is that we must own our phone because it's ours not Google and we must live in our own...
#LG #P705
#RECOVERY: TWRP 2.6.3.0/P700
#ROM:CM11/IMER
Click to expand...
Click to collapse
YES!!! :thumbup:
-CALIBAN666- said:
Big thanx for this great tutorial,its very usefull.but one request i have about patching with lucky.maybe its possible to patch the service.jar for full tweaking like v6 supercharger etc. As we know zeppelinrox is working on it and we can do it by hand with very anoying smalipatches one by one,so maybe its possible to make it with luckypatcher too?
GREETZ FROM TEAM-OPTIMA!!!
Click to expand...
Click to collapse
Did not think about it yet, but ask the creator of the LP.
Ms_Julia said:
Manual how to apply patches android, for those who do not get it in the standard way. News for firmware based CM11, KitKat, 4.4.4 and others...
.
Click to expand...
Click to collapse
thank you for this i been working hard trying to get this ported for the nexus 7 2013 "flo" now its patched and working. i tryed to manually edit services.jar my self but resulted in a billion force closing apps. now i am able to sign my apps and they boot p.s this post has been the most helpful than any others
i cant patch the copied files (core.jar and services.jar ) in SD card plz help...!!
Ms_Julia said:
Manual how to apply patches android, for those who do not get it in the standard way. News for firmware based CM11, KitKat, 4.4.4 and others...
We will need 1 ) Root Explorer or another file manager. 2 ) Lucky Patcher.
And so, we go through the Root Explorer to system/framework and look there for a couple of files with names core.jar and services.jar, found means to copy to SD card for further action with them.
Go to Lucky Patcher and select the function to "Rebuild and install". We are looking for in the open filemanager copied our files, click on each of them and choose the function "Patch file firmware", patched both files close Lucky Patcher.
Open Root Explorer find our patched copy and rename them from the core-patched.jar in the core.jar, and so did a services-patched.jar in services.jar.
Put them in the firmware in two ways.
The first :
Through the Root Explorer to replace the first system/framework file core.jar and put it right (rw-r - r--).
Reboot and look at the first two Lucky Patcher android patch applied. Good!!!
Replace the same in system/framework file services.jar and the phone itself will go into a reboot may reboot itself again, nothing wrong with that.
Go through the Root Explorer on the road system/framework to the file services.jar and give him the right to (rw-r - r--).
Watch in Lucky Patcher all three patch applied android.
The second method:
For him, we need the establishment of recovery TWRP or CWM and Aroma Filemanager. Earnest request before to do something, then test Aroma FM on your device !!!
We go in and start recovery Aroma Filemanager. After that, everything just as in Root Explorer, substitute core.jar on patched us exhibiting rights (rw-r - r--) and reboot.
Again in recovery and launch Aroma Filemanager. And substitution of services.jar but rights can and should be put immediately (rw-r - r--).
Reboot and you're done.
One piece of advice if something goes wrong as we would like it keep copies non patching core.jar and services.jar.
You can always get them back into place and put right through Aroma Filemanager.
Addition to those who have odex firmware :
In odex firmware need to copy the core.odex and sevices.odex on sdcard.
Go to Lucky Patcher, and on the bottom panel to select "Install and rebuild".
Then, select a file core.odex and select to patch the firmware file, then select services.odex and also choose to patch the firmware file, then rename and put them back into the system/framework.
Click to expand...
Click to collapse
i cant patch the copied files (core.jar and services.jar ) in SD card plz help...!!
it says a warning
the file ".jar" doesnt contain classes.dex for patch . try patch ".odex" file for this ".jar" file
what to do..?? plz help
Prem_414 said:
i cant patch the copied files (core.jar and services.jar ) in SD card plz help...!!
it says a warning
the file ".jar" doesnt contain classes.dex for patch . try patch ".odex" file for this ".jar" file
what to do..?? plz help
Click to expand...
Click to collapse
Do exactly what the error said. Also are you deodexed? I was able to patch this my self on nexus 7 and my s3 touchwiz.
Sent from my SGH-T999 using XDA Free mobile app
Android 5.0.2
there are this cores...
miguelrivas said:
Android 5.0.2
there are this cores...
Click to expand...
Click to collapse
I'm not sure if the signing is the same way for lollipop as in 4.4 and below I have tried it but it didn't work. You can try and see but you will only have art core to use your os doesn't support davlik anymore
Sent from my SAMSUNG-SGH-I747 using XDA Free mobile app

Categories

Resources