Editing a flashable zip. - Android Software/Hacking General [Developers Only]

I would like to create a zip I can flash that will replace the contents of the /system/media/audio/ringtones folder. Basically if I delete everything (except the META-INF folder) I don't need from a ROM zip I have and copy the files I want into that folder will that be ok to flash?
Sometimes I flash a ROM before deleting ringers I don't want.

You should delete almost everything in updater-script except mount/unmount system and package_extract_dir ("system" "/system".), then you put what you want in system/media/audio (in the zip), then you should be able to flash it in recovery.
Sent from my Sensational phone

Related

[MOD] Sense 2.06 BootAnimation from /data/local

A mod that you apply to a flashed rom then the boot animation runs from /data/local and can be replaced manually or using boot animation changer.
Flash after any Sense rom that normally has bootanimation in /system/customize/resource
It will delete the 2 files in /system/customize/resource
Flash my own custom bootanimation.zip & android_audio.mp3 to /data/local/ (Only to make sure it works)
create the required symlinks that survive reboot's.
You can then just replace the files in /data/local/ as needed.
Thanks to lambrospower for the idea
[edit]
BootAnim_Restore added, restores the default htc bootanimation.zip & android_audio.mp3 to /system/customize/resource
i am greatly thank you for all the support you gave me...very nice MOD although i integrated it into my rom...very good for all the others that do not bake their roms!!!!
there is a slight renaming typo....bootA[m]i[N]_to_Data
This works on Official froyo/sense ROM but I have one question. How can I edit the path in the ZIP file to \data\local\ when I change the boot animation in your ZIP file. The reason is because I have tried various bootanimation.zip file but none seem to change from yours and boot animation lite doesnt have the one I want.
It's already /data/local,
Just use ADB or a file manager and replace the one this zip install's in /data/local/
Klutsh said:
It's already /data/local,
Just use ADB or a file manager and replace the one this zip install's in /data/local/
Click to expand...
Click to collapse
I know the file path is already there but when I replace the bootanimation it also deletes the path. It doesnt keep it.
I am looking to avoid ADB as I dont understand it and when I view the SD card I can see a folder called data but there is no local folder.
These do not go on the SDcard, but on internal memory.
You can replace the zip file inside the zip I attached then flash it turning signature check off.
Will disabling signature check put the bootanimation.zip in the correct place?
As I said, i tried simply changing the bootanimation.zip in the archive but when I do that it deletes the path that the file has to go to ie, \data\local\.
Thank you so much for this!
I can finally have a good bootanim.
Sent from my HTC Desire using XDA App
Shetlander said:
Will disabling signature check put the bootanimation.zip in the correct place?
As I said, i tried simply changing the bootanimation.zip in the archive but when I do that it deletes the path that the file has to go to ie, \data\local\.
Click to expand...
Click to collapse
try after updating the zip not to change its mode....keep it to store...do not use any compression...it might be this the problem
Finally sussed out how to replace the bootanimation.zip file and retain the correct path. All good now.
Thanks Klutsh for a usefull little tool.
Brilliant!
Thnx!
BootAnim_Restore added to the first post, restores the default htc bootanimation.zip & android_audio.mp3 to /system/customize/resource
How did you end up managing to do it as I too can't find a local folder in my data folder...
when i ran the bootamin_to_data zip my phone changed boot animation to a gentleman with text saying DeLite (or similar) but still I couldn't find a local folder in my data folder, nor could i find wher this delite image was stored, so i ran the restore.zip and am now back to where I started...
After the change files are stored in /data/local/
Now this is brilliant!!
Ever since the Froyo came out for the desire it's been very hard to put custom bootanimations to the desire. NOT ANYMORE!!!!
Thanx a bunch mate!
ok, can someone tell me where to push the Bootanimation files to?
Presumably if they're on the phone i cannot navigate to the file using a pc & USB?
Should i use ADB in which case, can you tell me the script for the ADB command
Or should i transfer to the SD and use rootexplorer / astro to move it to the data/local file?
OK Sorted it, i just put bootanimation.zip in Android/tools, then use ADB command
C:\androidSDK\tools>adb push bootanimatino.zip data/local

[Q] How to flash NAND ROM with no DAF

I downloaded the "CoreDroid_Desire_HD_GB_2.3.3_V4.5". I tried flashing the zip file using clockwordmod however it fails. When i extract the Zip file i find only boot.image, installbusybox file, data folder, META-INF folder & system folder... Can you please advise how can i flash this rom where there is no DAF.exe or any installer?
Thanks,
mohamed_baher said:
I downloaded the "CoreDroid_Desire_HD_GB_2.3.3_V4.5". I tried flashing the zip file using clockwordmod however it fails. When i extract the Zip file i find only boot.image, installbusybox file, data folder, META-INF folder & system folder... Can you please advise how can i flash this rom where there is no DAF.exe or any installer?
Thanks,
Click to expand...
Click to collapse
What phone do you have?
Sorry forget to mention. HTC HD2.

[Q] App to Zip entire directory

Is there a way to zip up an entire directory not just individual files. I have a schedule with titanium backup and then uploaded them to dropbox, but if possible I'd rather have the backup as a zip file.
Leshy01 said:
Is there a way to zip up an entire directory not just individual files. I have a schedule with titanium backup and then uploaded them to dropbox, but if possible I'd rather have the backup as a zip file.
Click to expand...
Click to collapse
Not with a zip file afaik, in zip format a single file is compressed.
**Use .rar format, its an archived/compressed format so it supports multiple directories. This is the ideal method.**
Alternativly you could use separate archive/compression formats such as the '.tar.gz' format where you first archive(make into a single file) the directory into a .tar, and then compress in gzip format giving you .tar.gz. You can o this using 7zip, but its not a commonly used file extension anymore rar has taken over so I suggest you use that.
Jandyman said:
Not with a zip file afaik, in zip format a single file is compressed.
Click to expand...
Click to collapse
Incorrect, Zip can hold any directory structure, just like Rar and Tar.
ASTRO File Manager can handle zip files the same as a regular directory. Hit Menu -> New -> Zip File, name it, and it gets added to the file list for the current directory. From there, it acts like a directory - tap on it to navigate inside it, move/copy files/directories to it, etc.
Ghost Commander will do this as well, and it's pretty awesome.

How to make a CWM file

Hello, I have searched everywhere and cant find the answer to my question. I wanted to replace a file using CWM .zip how in the heck do I do that? Most of all I just wanted to learn how to do it as well...
Thanks,
Chad
Well to begin with you can take an existing zip with the file path you need, delete everything in the folders not touching the META-inf folder at all, those are the install instructions, and put the file you want to flash in the correct folder. I think thats how everyone starts out.
studacris said:
Well to begin with you can take an existing zip with the file path you need, delete everything in the folders not touching the META-inf folder at all, those are the install instructions, and put the file you want to flash in the correct folder. I think thats how everyone starts out.
Click to expand...
Click to collapse
but your update-script has to match what you are flashing via cwm. if you take a rom zip and just pop in a few files in place of the whole rom structures, your flash will fail because your update-script is looking for specific structures.
Oxicottin said:
Hello, I have searched everywhere and cant find the answer to my question. I wanted to replace a file using CWM .zip how in the heck do I do that? Most of all I just wanted to learn how to do it as well...
Thanks,
Chad
Click to expand...
Click to collapse
One way would be to use: Update Zip creator/modifier (Requires Windows)
yeah it would be bad mojo if you used a wipe rom zips META INFO to make an update zip.....
Thanks a million everyone......
Sorry for being late to the party again.. Here goes my attempt at an explanation though:
Essentially, a CWM flashable zip is just a zip file with the file system replicated in it. So for example, if you wanted to add swype, and you know Swype.apk would regularly go in /system/app, then you would create a blank folder called 'system', and another folder inside system called 'app', and put your Swype.apk inside that. (/system/app/Swype.apk)
After that, all that's left is to build an update script. So, from your root directory (where your system folder is), you would make another directory called META-INF, with a folder inside called 'com', another one inside that called 'google', and finally one called 'android' inside that (/META-INF/com/google/android), you put a text file in there called 'update-script' that tells recovery what you want to do (in this case, copy swype over to the corresponding directory on the file system).
http://forum.xda-developers.com/showthread.php?t=641223
^There's a guide for how to make those. You can also pick apart any rom you find in the dev section and check out the update script for reference.
After that, it's just a matter of zipping up all the contents in your root directory, then signing the zip with testsign.jar
modest_mandroid said:
Sorry for being late to the party again.. Here goes my attempt at an explanation though:
Essentially, a CWM flashable zip is just a zip file with the file system replicated in it. So for example, if you wanted to add swype, and you know Swype.apk would regularly go in /system/app, then you would create a blank folder called 'system', and another folder inside system called 'app', and put your Swype.apk inside that. (/system/app/Swype.apk)
After that, all that's left is to build an update script. So, from your root directory (where your system folder is), you would make another directory called META-INF, with a folder inside called 'com', another one inside that called 'google', and finally one called 'android' inside that (/META-INF/com/google/android), you put a text file in there called 'update-script' that tells recovery what you want to do (in this case, copy swype over to the corresponding directory on the file system).
http://forum.xda-developers.com/showthread.php?t=641223
^There's a guide for how to make those. You can also pick apart any rom you find in the dev section and check out the update script for reference.
After that, it's just a matter of zipping up all the contents in your root directory, then signing the zip with testsign.jar
Click to expand...
Click to collapse
Is there a way from the CWM interface to do the same with a backup you create? I noticed backups are not in the same format, they are usually .img, .tar, and an md5 file?

[Q] CWM backup convert to TWRP

Is it possible to convert Cwm backups for use in TWRP or is it a simple case of drag and drop?
Sent from my Nexus S using xda premium
scoffyburito said:
Is it possible to convert Cwm backups for use in TWRP or is it a simple case of drag and drop?
Sent from my Nexus S using xda premium
Click to expand...
Click to collapse
Don't know it's possible currently but you can always restore the cwm backup using cwm, then flash twrp, and do a backup with twrp. Now it's converted. Quite a hassle but this is one way I know how.
Sent from my Nexus S using xda premium
[email protected] said:
Don't know it's possible currently but you can always restore the cwm backup using cwm, then flash twrp, and do a backup with twrp. Now it's converted. Quite a hassle but this is one way I know how.
Sent from my Nexus S using xda premium
Click to expand...
Click to collapse
Yeah I guess it's the only way
Sent from my Nexus S using xda premium
scoffyburito said:
Yeah I guess it's the only way
Sent from my Nexus S using xda premium
Click to expand...
Click to collapse
Found this http://www.droidviews.com/create-flashable-zip-cwmtwrp-backup/
It says:
Code:
Create Flashable Zip from CWM/TWRP Backup
The method for creating flashable Zip from CWM and TWRP backups are different as both the recoveries use different techniques to backup the device.
For CWM Backup
Transfer the CWM backup from Phone to PC.
Extract system.ext4.tar file with any of the archive apps like Winrar or 7zip, you will get the system folder of your device containing all the files.
Gather the boot.img from the CWM backup.
Now collect a META-INF folder from any custom ROM which is made for your device. Make sure you get the correct Meta-Inf folder, else the Zip won’t work and might worsen the condition of your device.
Select the META-INF, System folders and the boot.img and right click your mouse and select add to Archive.
In the Archive settings, choose the extension of the compressed file as Zip (Make sure of this part)
That’s it, your flashable Zip is now ready and you can flash it using any custom recovery.
For TWRP Backup
Transfer the TWRP backup from Phone to PC.
You’ll see a file named system.ext4.win which is the System partition backup of your device. Rename it to system.ext4.tar (Changing its extension from .win to .tar)
Extract the system.ext4.tar using an archive software like Winrar or 7zip.
If your TWRP backup is not in compression mode, you will directly get the system folder, else you will get a file named system.ext4, which should be renamed again to system.ext4.tar and extract it to get the system folder.
Take the boot.emmc.win file and rename it to boot.img.
Now collect a META-INF folder from any custom ROM which is made for your device. Make sure you get the correct Meta-Inf folder, else the Zip won’t work and might worsen the condition of your device.
Select the META-INF, System folders and the boot.img and right click your mouse and select add to Archive.
In the Archive settings, choose the extension of the compressed file as Zip (Make sure of this part)
Now you can use this Zip file to flash it on your Custom recovery.

Categories

Resources