create flashable zip question - Desire Q&A, Help & Troubleshooting

I have 4 computers that I use and 2 of them have adb drivers installed, the other 2(work computers that i am not really allowed to install much on) does not. To be able to push files to my htc desire on the computers that i do not have adb drivers installed I need a flashable zip. I only want to push files such as ringtones, /system apps, bootanimation.zip files and such, i have no intention of changing the framework or the theme and so on. So could anyone point me in the direction of where could i find a ready empty zip file like this or a tutorial in how to make one?
P.S. one of the uses for this is when i am out on a business trip i do not have my personal computer with me, so if brut-maps gets updated i want to be able to push it to the phone without adb.

Hello.
I only have basic knowledge on the subject, so i'm just gonna explain what i do when i need to flash something via flashable .zip.
1) Get a simple flashable .zip used to flash files anywhere on the /system partition.
2) Open it with WinRAR or 7zip or whatever. Navigate to META-INF/com/google/android/. There you will find two files: update-binary and updater-script. You need not touch the binary, because it's the same for all flashable .zips. What you need to do is extract then edit the updater-script, as that tells the recovery what to do with the flashable .zip's contents.
3) Editing the updater-script: let's say we need to create a .zip to flash a new Mail.apk to /system/app. The updater-script's content would need to be:
Code:
show_progress(0.1, 0);
mount("MTD", "system", "/system");
delete("/system/app/Mail.apk");
package_extract_dir("system", "/system");
show_progress(0.1, 10);
unmount("/system");
The "show_progress" lines are self-explanatory. The "mount" command tells the system to mount the /system partition. We then delete the old Mail.apk and tell the recovery where we want to extract the contents of the .zip. After everything's done, we unmount /system.
Add the edited updater-script to the archive, overwriting the original one. Be sure to set your archiver to "Normal" compression level.
4) Creating the proper directory structure: again, let's say we need to flash Mail.apk to /system/app and that we have properly configured the updater-script for this task. We now need to create a folder named "system" (anywhere on the PC), place a subfolder named "app" inside it, then place the new Mail.apk inside the "app" subfolder. We then add the whole structure to the flashable .zip (making sure that there are no other folders in it than "META-INF") and that's that! Again, make sure you use "Normal" compression.
5) Copy the .zip to your SD card, reboot into Recovery and flash the .zip.
6) Enjoy!

thank you very much, that was exactly the kind of information i was looking for.

You're welcome.
Here's a simple flashable .zip i used to replace media_profiles.xml in the /system/etc folder when i didn't have a PC handy and my phone wouldn't boot. You can edit it and use it for your own purpose.

Related

[Kernel/CW] Kernel Update ZIP file for Clockwork MOD

I am not sure if someone posted something similar or not.
Anyways.
This ZIP file does not have a KERNEL in it, it is just a ZIP with empty boot and system folder. The META-INF contains a script that will copy everything in boot to your \boot in your ROM and everything in system to your \system in your ROM.
NOTE: It will overwrite any files that have the same file name in the same folder. So, yes, you can use it for other than updating kernel, say copying a file to a specific folder in \system partition, or \boot partition.
Just open with 7-zip, drop zImage file into the boot folder, then drop modules in the system\lib\modules folder. Copy the zip file to your SD, then run Clockwork Recovery, and install the zip.
thanks,
will try this ASAP
LiFE1688 said:
I am not sure if someone posted something similar or not.
Anyways.
This ZIP file does not have a KERNEL in it, it is just a ZIP with empty boot and system folder. The META-INF contains a script that will copy everything in boot to your \boot in your ROM and everything in system to your \system in your ROM.
NOTE: It will overwrite any files that have the same file name in the same folder. So, yes, you can use it for other than updating kernel, say copying a file to a specific folder in \system partition, or \boot partition.
Just open with 7-zip, drop zImage file into the boot folder, then drop modules in the system\lib\modules folder. Copy the zip file to your SD, then run Clockwork Recovery, and install the zip.
Click to expand...
Click to collapse
It doesn't have to be signed?
Code:
ui_print("Welcome to MDJ Kernel Updater");
mount("MTD", "boot", "/boot");
mount("MTD", "system", "/system");
ui_print("Copying zImage...");
package_extract_dir("boot", "/boot");
ui_print("Copying modules...");
package_extract_dir("system", "/system");
unmount("/system");
unmount("/boot");
ui_print("All Done...");
I don't see anything in the updater-script that requires signing.
Actually, original idea and script by Shadiku...
He actually made two scripts.
can i create a folder called androidapp and put the apks in it and install them automatically like we do with the SD roms
it's not working for me.. try to change the kernel to hastarin that support Extended battere..
it says "Instalation aborted "... what happened?
any clue?
edit : can push the Zimage and some other files, but it stuck with the gogogo...

[1st try]Create a CWM flashable zip to place apk file in /data/app

i try to make a cwm flashable zip today
see some xda post and finally flashed apk in /data/app
but i don't the script is actually right or not, just know it work
i follow this
http://forum.xda-developers.com/showthread.php?t=1545165
and this
sign+ v1.2.2
http://forum.xda-developers.com/showthread.php?t=997180
1. download the data.zip
2. unzip it and place the apk you want to flash into /data/app
3. edit update-binary file
in META-INF\com\google\android
i add following script
ui_print is the words you want to show in cwm
ui_print(" PLACE YOUR TEXT HERE ");
ui_print("----------------------");
run_program("/sbin/busybox", "mount", "/data");
show_progress(1, 15);
ui_print("Copying files...");
package_extract_dir("data", "/data");
unmount("/data");
ui_print("Unmounting system...");
run_program("/sbin/busybox", "umount", "/data");
ui_print("Installation complete!");
refer [] AL [] (http://forum.xda-developers.com/showthread.php?t=1545165
)
2 important notes here though in order to avoid problems:
* Each line of the updater-script MUST end with a ";" (no " ") ;
* There HAS TO BE at least one blank line after the last ( ; ) line of code.
4. zip META-INF and data folder to zip file as storage(no compression)
5. use sign+ v1.2.2, it will sign the zip file
6. then you can put it on you phone and flash it
if you want to flash the apk in system/app/
just change the name of folder from data to system
and the script also change "data" to "system"
i don't know the script is 100% correct or not
if it is not please correct me
You know, it would be much easier to simply place the apk in /data/app using a root file explorer... it would save you all the fuss. Unless you're trying to automate something/make a CWM package for release...
Hi,
Like as said FredFS456 it's the simply way.
Or use a "generic" CMW.zip like this:https://rapidshare.com/files/1752806149/CMW_data_app.zip
Put your app in /data/app inside the zip file (with winrar for example) and it's good to flash it...For you,you ask for a CMW.zip just for /data/app...
With right permissions.
In any case you can take another CMW.zip file for another apps or files,in the theme and apps or dev section there is a bunch of CMW.zip that you can take for your use (/system/app-/data/app-/system/framework-etc...),just erase/remplace your files...
I also need a generic CMW zip to replace the framework-res.apk for my gradient mapping fix Anyone got one?
arzbhatia said:
I also need a generic CMW zip to replace the framework-res.apk for my gradient mapping fix Anyone got one?
Click to expand...
Click to collapse
Hi,
Here:https://rapidshare.com/files/288220955/CMW_Framework.zip
According it's just for your request.
But guys...It's so difficult to take any CMW zip file?As I said above there are around depending on what you want...
Just take a zip and modify it what you want...unless you take a zip for /system/app and you want a /system/framework..
At worst take a complete ROM,delete all files in each folder (keep folders) and add what you want in each folders (like system/app-System/framework-etc) and erase all except the "META-INF" folder!
CREDITS:A thanks goes to all those who I took these CMW zip files...
FredFS456 said:
You know, it would be much easier to simply place the apk in /data/app using a root file explorer... it would save you all the fuss. Unless you're trying to automate something/make a CWM package for release...
Click to expand...
Click to collapse
i have a sc-04d galaxy nexus which have a sim lock
after full wipe and flash a new rom (sim lock again) it have not any file explorer
if i have not wifi connection , no PC, i have no way to use the ****domoco apk to unlock sim card
so i make this flashable zip, flash the ****domoco apk and file explorer in the phone
and get the 3g signal
viking37 said:
Hi,
Like as said FredFS456 it's the simply way.
Or use a "generic" CMW.zip like this:https://rapidshare.com/files/1752806149/CMW_data_app.zip
Put your app in /data/app inside the zip file (with winrar for example) and it's good to flash it...For you,you ask for a CMW.zip just for /data/app...
With right permissions.
In any case you can take another CMW.zip file for another apps or files,in the theme and apps or dev section there is a bunch of CMW.zip that you can take for your use (/system/app-/data/app-/system/framework-etc...),just erase/remplace your files...
Click to expand...
Click to collapse
no need to sign the zip again if change the content?
why something need signed a flashable zip?
ygvuhb said:
no need to sign the zip again if change the content?
why something need signed a flashable zip?
Click to expand...
Click to collapse
Hi,
No,I do this when I want a CWM.zip,I never signed the zip and everything is good.
Just be careful what you put in the zip file and what it is intended...
Second question...I don't know...
viking37 said:
Hi,
No,I do this when I want a CWM.zip,I never signed the zip and everything is good.
Just be careful what you put in the zip file and what it is intended...
Second question...I don't know...
Click to expand...
Click to collapse
Hey, sorry to hijack this thread, but could someone make a CWM flashable zip with superuser in the system/app folder? I installed a beta rom, and root doesn't seem to be working properly :/
EDIT: Nevermind, I installed AOKP, gonna play it safe for a while.
hi
if i want to change the file premission
any script i have to add?
Hi guys, im trying to find/create a cwm zip that will install IO file manager, i've downloaded several here on xda but they dont work because their not compatible with edify.
I tried using this application http://forum.xda-developers.com/showthread.php?t=903598 to convert the zip to edify but now when i flash cwm gives me a "status 0" error.
Can any of you guys help me with this?
Thanks in advance.
The script of magic
or you can use this really easy script my friend
try it on it works! plus you can write more staff than apks cause copy everything that is at main system
ui_print("Test Script");
ui_print("By ~:Infeno:~");
show_progress(0.500000, 0);
ui_print("Writing System");
run_program("/sbin/busybox", "mount", "/system");
package_extract_dir("system", "/system");
unmount("/system");
ui_print("Finishing of copying Apks and etc...");
show_progress(0.100000, 0);

[GUIDE] How to make a flashable zip for Sprint Galaxy S3

So this is a guide on how to make a flashable zip (a zip file you put on your SD and install it via a custom recovery). I'm going to assume if you want to make a flashable zip it's because you modified an app (or found one on the internet but it's not meant for our device) so I'm not going to explain how to modify an app or anything like that but I will post some resourceful links
*I own a laptop and use Windows so all the information is based on that, please adjust information if you have a different OS. You can also do all of this using a file explorer and text editor on your phone
So, I've attached a flashable zip that is meant for our devices and uses our mount points. I will go through some situations on where you can/should use it.
First, download the attached zip and extract it (7-Zip is free, use stock settings).
Within the extracted folder you will find data, system, and META-INF folder. Go to the base of the end of the META-INF folder structure and open up the updater-script file (I use Notepad++). This dictates what gets "flashed" and the text you see while in recovery. After you open it pay attention to these lines:
ui_print("");
Click to expand...
Click to collapse
-This will display text inside recovery, you want to enter text within the parenthesis and quotations, so if you wanted your text to say
Hey There
Click to expand...
Click to collapse
Your text in updater-script would look like
ui_print("Hey There");
Click to expand...
Click to collapse
And don't forget that semicolon!
OK so that's how you enter custom text that you would see in recovery. Next important lines you'll see are
mount("ext4", "EMMC", "/dev/block/mmcblk0p14", "/system");
mount("ext4", "EMMC", "/dev/block/mmcblk0p15", "/data");
Click to expand...
Click to collapse
This mounts your system (/system) and data (/data) partitions so whatever apps/jars/xml's/boot animations/fonts/etc you flash will end up where you want them to go (as long as you have the appropriate file structure; continue reading on that)
So you want to keep those within your updater-script, even if you are just flashing a system app it will not hurt anything on your set up if /data is mounted.
The next important lines are
package_extract_dir("system", "/system");
package_extract_dir("data", "/data");
Click to expand...
Click to collapse
This now extracts whatever you have in your /system and /data folders within your zip into your system so it's important to make sure that you're satisfied with whatever you have in those folders prior to flashing
The last two lines,
run_program("/sbin/busybox", "umount", "/system");
run_program("/sbin/umount", "/data");
Click to expand...
Click to collapse
simply unmounts the data and system partitions after everything is flashed
Just a note, this should not be used if you are flashing an entire ROM, I will update this with an updater script for this.
So after you modified your files and signed them correctly place them in their appropriate locations. For example, if it is a modified SystemUI.apk you will make a file structure like /system/app/SystemUI.apk, then select both the META-INF folder and system folder, right click and scroll to 7-Zip and select "Add to Archive", use stock settings and select OK. Place your zip on your internal or external SD and flash in recovery
This should be used for modified system files (apps, jars, files (init.d scripts, xmls), boot animations, apns, init.* files, etc), or data files (themed Facebook, Twitter, apps you download from Google Play)
IMPORTANT NOTES:
-If you are going to flash something, make sure the name of the apk's/jar's/files match the original apk's/jar's/files (example: if you are on a TW ROM and flashing a modified Messaging app you or someone else made, the correct name for that app is SecMms.apk). In that example, your apk would be in /system/app/SecMms.apk
-If you are flashing a modified Google Play, Gmail, YouTube, etc (themed, hacked, etc) make sure the app you flashed isn't in /data/app/ so make sure you delete apps that were automatically updated by going to /data/app/ (using a file explorer with root permissions) then flashing it.
-MAKE A BACKUP! Just in case. You can always make a backup of whatever apps your flashing by copy/pasting them onto your SD then make a flashable backup zip just in case something goes wrong
-It won't hurt your system if you have empty folders in your zip. If you're lazy just don't delete the empty /data or /system folders in my example
-Here are some general file locations of common apps that you may be flashing:
Google Play (/system/app/Phonesky.apk)
Messaging App (Touch Wiz) (/system/app/SecMms.apk)
SystemUI (statusbar) (/system/app/SystemUI.apk)
Framework-res (Android Framework) (/system/framework/framework-res.apk)
Gmail (/system/app/Gmail.apk)
Bootanimation (/system/media/bootanimation.zip)
LINKS:
apktool (make sure you Google how to set-up apktool in accordance with your OS)
-Notepad++ (what I use to modify xml's and updater-scripts)
-7-zip (I personally use WinRAR but this is free so...)
-File Explorer (FX) (what I use to create/extract zips on my phone)
**I will add more in the next few days, really late here so I'm going to crash
**reserved for morphs and whatnot
one more I guess
thanks fergie! Good Stuff!
THANK YOU SOOOOOOOOOOOO MUCH FOR THIS!!!!!!!!!
Been looking for something like this since I got my S3!
Thanks for the great tut.
Sent from my SPH-L710 using xda premium
No problem. Any other tips or tutorials anyone want to suggest?
Sent from my SPH-L710 using Tapatalk 2

[Q] Install Google Talk (on Jelly King 2.0)

Hello!
I have installed Jelly King 2.0 on my Wildfire S (S-ON) and I really like it. But I miss the Google Talk app. I know that I could flash another GAPPS zip, but I think that would use too much space. So, how can I install just the Google Talk app without all the other gapps?
Here is what I already tried - and what didn't work:
0. Search for an solution in this Forum
1. Take the talk.apk from gapps and try to install
2. Put the talk.apk in /data/app
3. Put it in /system/app - couldn't move anything into that folder in spite of being root. I guess because of S-ON?
My next approach would be to create a flashable zip with just Google Talk - but I don't know how to do that. Or is there another way?
here you go.
i made zip of gtalk.
just boot to recovery and flash it.
Thanks!
Some more questions:
1. Shouldn't the Talk.apk be in the folder /system/app/ instead of just /app/? (I am comparing to a gapps zip in which it is located there)
2. How can I create such a zip-file myself? I don't know what the META-INF folder should content. Could I just copy this folder from any gapps.zip? And could I take the Talk.apk from there as well? (I would be more comfortable about using the app if I knew its source)
edit:
Okay, I took a look into the files in META-INF...and I think the answer to my first question is in this line of the file "updater-script":
package_extract_dir("app", "/system/app");
Anyway: Where did you get the "update-binary" file from? And I also can't see what the other three files (CERT.SF, CERT.RSA and MANIFEST:RSA) are for as the files they are providing a SHA1-checksum (?) for are not even in the zip-file.
vi!n said:
Thanks!
Some more questions:
1. Shouldn't the Talk.apk be in the folder /system/app/ instead of just /app/? (I am comparing to a gapps zip in which it is located there)
2. How can I create such a zip-file myself? I don't know what the META-INF folder should content. Could I just copy this folder from any gapps.zip? And could I take the Talk.apk from there as well? (I would be more comfortable about using the app if I knew its source)
Click to expand...
Click to collapse
first for your information.
s-on dosent mean you can't install apps in /system/app or anywhere else.i have s-on too.with s-on you can do alot of stuffs.you need s-off to just flashing some radios,dual-boot etc(mostly advanced stuff)
so,s-on isn't problem.probably mostly all people here has s-on.
1. yeah talk.apk is in /system/app & gapps also installed in /system/app.about your gapps zip i need to see it.but might you flashed wrong gapps.
2. you can make flashable zips easily.just you need to put apps,framework,scripts (anything you want in correct order)
then time for meta-inf file.all things in that file remained unchanged except updater-script.
you need to edit updater-script to make zip work..
e.g. you put talk.apk in zip then how phone know where to install and how to ?
so your updater script will like this:
Code:
run_program("/sbin/busybox", "mount", "/system");
package_extract_dir("app", "/system/app");
run_program("/sbin/busybox", "umount", "/system");
first line for mount system.
then zip will install contains of app in /system/app
and third line for unmounting system.
i sent you PM which contains more detailes about making zip.
if you need any other help,feel free to tell.
Thanks, that helped a lot! The problem is solved for me now.
I was just editing my last post when you answered - so everything below "edit" can be ignored.
vi!n said:
Thanks, that helped a lot! The problem is solved for me now.
I was just editing my last post when you answered - so everything below "edit" can be ignored.
Click to expand...
Click to collapse
yeah and about other files,they are common in every zip.
update binary is needed so phone can understand updater script.
all in one solution,when we make zip we just need to edit updater script all other files in meta-inf will be as it as.no change at all.just put whole folder in zip.

TOOLS TO WORK ON ROM

Hi!
I let you here some tools to work on ROM.
First One is Brottli (files ROM format) to Ext4, like it say change from brottli format to ext4 format as example system.new.dat.br and system.transfer.list to system.ext4
Brottli_Dat_to_EXT4.zip
Second on ( the one i use more to extract files from ext4 format images) 7z_Ext4_Imgextractor, for this tool you need to extract, enter in work folder, right click on 7z.exe, compatibility and select execute as administrator or it will not work properly.
7z_Ext4_Imgextractor.zip
Third, is the same as 7z_Ext4_Imgextractor.zip but i only use if 7z_Ext4_Imgextractor.zip doesn´t work. Some times extract with a few errors...
Ext4_Imgextractor.zip
And the last one, is a Update.zip, inside you will find system and vendor folders, inside that folder you can paste a directory/file as you find inside the extract image, example if the file is in vendor/etc, you need to create/paste etc directory inside vendor...
Important Only works with directory with 755 permission and files with 644 permission!!!!! You need to know what you are doing...
update.zip
I hope this tools helps you.

Categories

Resources