[DEV][TOOL] easyFLASHABLEzipBUILDER v1.0 - Android Software Development

For those who want an easy way to create and sign CWM flashable zips via windows, look no further... this is about as easy as it gets!
1. Unzip contents of package to a folder we'll call this folder "tools"
2. in "tools" you will now have the included files plus and "update" folder
3. in "update" folder you have "META-INF," "system," & "data" folders
4. place any files you want copied to system in "system" folder, make sure your structure is proper.
5. place any files you want copied to data in "data" folder, make sure structure is proper.
6. once you have everything set in place, you have four options:
• 6a: drag the folder on top of "DRAGandDROPzipANDsign.bat" wait for it to finish, you will end up with {folder_name}_update.zip in the same folder as 7za.exe
• 6b: double click SIGNandZIPmanual.bat, type the name of the working folder, hit enter, wait for it to finish, it will loop back and allow you to complete another task, or hit X + Enter exit.
• 6c: double click SIGNonlyMANUAL.bat, enter just the zip filename you want to sign (no extension), hit enter and wait for it to finish. It will loop back and allow you to sign another one or hit X + Enter to exit.
• 6d: drag a ZIP on top of DRAGandDROPsignONLY.bat to sign/re-sign a zip that's already been built.
Click to expand...
Click to collapse
I suggest if you are using this method to replace any system files, to delete the existing file first by adding some lines to the updater-script found in the META-INF folder. as follows:
Code:
delete("/system/app/Rosie.apk");
these lines can be added below the
Code:
mount("MTD", "data", "/data");
line... make sure filenames correct because they are case sensitive.
Hopefully this will make your lives a little easier =)
LATEST VERSION MIRROR: CLICK HERE
Code:
CHANGELOG:
1.1 - Current
~~* Silent update, forgot to include a couple of the updated files... oops! =)
1.0 - Update
~~* All drag & drop versions now support dragging and dropping from anywhere, not just the "working" directory.
~~* Fixed manual versions, where the loopback to work with more files was not working properly.
~~* Now deletes the unsigned zip after building the signed zip.
~~* Cleaned up folder a bit, now works from _bin folder, and outputs to _out folder. Batch file should stay in "main" folder, one level above _bin folder.
0.9 - Update
~~* Added sign only, manual plus drag & drop versions
~~* Included FR translation (google) of the d&d zip and sign
0.8 - Update
~~* removed the random .apk that was accidentally included in 0.6, not sure what happened to 0.7... lol
0.6 - Initial forum release

quick little update... apparently I had included a small .apk in the update folder... my bad, sorry for the waste of bandwidth =)
as the great homer simpson would say: DOH!

Hi ...
I'm not developer but it seems what you're doing will help other developers (and in the end: I'll benefit from that)...
Here's a "thank you" note..
... note: this post is just my way to become a post-whore like you.... j/k

would it also work for Amon-RA?

bestofrhcp said:
would it also work for Amon-RA?
Click to expand...
Click to collapse
yes, latest versions of amon-ra and cwm are both work only with edify scripts, so yes. you just need to know what your specific system & data paths are, system should be the same for everyone, but some devices use userdata /userdata instead of data /data... hopefully that makes sense =)
hope this helps =)
a new version, for the "manual" script will actually loop back when finished building/signing a zip, so that you can do multiple build/sign sessions, without having to reopen the script after every build/sign session will be updated shortly... I've already tested it and got it working... no real changes to the drag-and-drop file as it's not really necessary... I am trying to figure out a way to do a drag and drop sign only script, so once I have that figured out I will updated again...

updated =)

Thanks! This will save me from using Terminal Emulator after each cm nightly flash.

wilnotdie said:
thanks! This will save me from using terminal emulator after each cm nightly flash.
Click to expand...
Click to collapse
oops! Oops! ^~^

UDPATED... sorry if you downloaded 1.0, download again now @ 1.1... forgot to include a couple of the updated files... double checked everything this time though... =) enjoy!

looks like you might be able to answer my question
was playing around and deleted systemui.apk from system\app folder...
was trying to replace with another one... that did not work...
so i tired putting back the original one... and that does not install either...
is there a way to install that back on ?
if it is just guide me a lil bit...
will this procedure actually install the file?
http://forum.xda-developers.com/showthread.php?t=1268661
thank you

heart_crafter said:
looks like you might be able to answer my question
was playing around and deleted systemui.apk from system\app folder...
was trying to replace with another one... that did not work...
so i tired putting back the original one... and that does not install either...
is there a way to install that back on ?
if it is just guide me a lil bit...
will this procedure actually install the file?
http://forum.xda-developers.com/showthread.php?t=1268661
thank you
Click to expand...
Click to collapse
just do this
Code:
adb remount
adb push SystemUI.apk /system/app
adb reboot
no need to "install" it, it just needs to be in the system/app folder at boot time... you might actually want to "adb reboot recovery" instead of "adb reboot" and then clear dalvik before rebooting into OS again...

I tried testing it by droping a apk in a folder called app and then dropping the app folder in data and then went ahead and used the .bat. I went into recovery, flashed it without an error but nothing was installed once i booted. Any ideas? Dont scripts very like some have a run program system/xbin/busybox etc?
edit. I was able to move the folder from data to system and then ran the script and flashed it and it worked, it should up once it booted. Is there any way to get it to flash data/app?

benjamminzIS said:
just do this
Code:
adb remount
adb push SystemUI.apk /system/app
adb reboot
no need to "install" it, it just needs to be in the system/app folder at boot time... you might actually want to "adb reboot recovery" instead of "adb reboot" and then clear dalvik before rebooting into OS again...
Click to expand...
Click to collapse
thanks for the code...
but i already had copied the file into system/app... and it wasnt working (wasnt installing) just did a dalvic wipe now... and looked at that file permission and it was different from all other system apps... so i matched them up.. and rebooted ... and systemtray is back
thank you!

jgrimberg1979 said:
edit. I was able to move the folder from data to system and then ran the script and flashed it and it worked, it should up once it booted. Is there any way to get it to flash data/app?
Click to expand...
Click to collapse
here's the hint from the first post:
benjamminzIS said:
I suggest if you are using this method to replace any system files, to delete the existing file first by adding some lines to the updater-script found in the META-INF folder. as follows:
Code:
delete("/system/app/Rosie.apk");
these lines can be added below the
Code:
mount("MTD", "data", "/data");
line... make sure filenames correct because they are case sensitive.
Click to expand...
Click to collapse
copy the extract_package line that references "system" and change "system" to "data" in all cases, or if you have no need to copy anything to system then just change all "system" cases to "data" rename the "system" folder to "data" then add your files as necessary...

I am not sure i understand. Let me try and clarify what i am in trying to do. I am trying to build a flashable zip that contains an apk that i want to essential be installed in data/app directory. thats it.
What i see from the script below is that you have everything covered, system and data, so i am assuming if nothing is in the folder as system then it will be skipped over, correct
ui_print("");
ui_print("");
ui_print("Clearing dalvik cache ...");
delete_recursive("/data/dalvik-cache");
mount("MTD", "system", "/system");
mount("MTD", "data", "/data");
ui_print("");
ui_print("");
ui_print("Installing files to system ...");
package_extract_dir("system", "/system");
unmount("/system");
ui_print("");
ui_print("");
ui_print("Installing files to data ...");
show_progress(0.700000, 50);
package_extract_dir("data", "/data");
unmount("/data");
show_progress(10.000000, 1);
ui_print("Done.");

jgrimberg1979 said:
I am not sure i understand. Let me try and clarify what i am in trying to do. I am trying to build a flashable zip that contains an apk that i want to essential be installed in data/app directory. thats it.
Click to expand...
Click to collapse
oh ok... sorry... yeah I think for anything that goes to data, there needs to be an install command try adding install("/data/app/filename.apk"); for each file, after the package_extract_dir("data", "/data"); function... not sure if that is correct, but maybe?

Related

Error after sign Zip Files. "Can't find update script"

I followed each one of your steps. I get an error when trying to install the signed zip. "Can't find update script" Can anyone please help me with this.
thank you
I'm doing option 2. I get it signed just get an error "Can't find update script"
This quick guide will teach you how to sign ROMs!
WARNING : YOU WILL NEED AT LEAST A BASE KNOWLEDGE OF HOW TO USE COMMAND PROMPT.
The knowledge of signing ROMs can prove useful to anyone! By knowing how to sign ROMs, you can modify your favorite ROM to add or delete APKs, so when you flash the ROM your favorite apps will be present! Or you can delete apps you don't use so they will not be installed when flashing the ROM!
Before starting, you need a couple of things. First you will need Java SE Development Kit and Java SE Runtime Environment . You can download them HERE.
After you have downloaded and installed both, you will need a very useful tool made by someone at XDA-Developers (if you know who it is please let me know).
Download this tool (attached) and unzip everything inside of it into one common folder. I personally unzipped everything into my Android SDK folder.
Signing
Now run the autosign.bat. You will have to go through commands 1(Set PATH variable for SDK) ,2 (Set CLASSPATH variable for signing tool) and 3 (Install registry entries). They are very easy to use and just follow the instructions. If you are asked to confirm and/or replace a file, always select yes!
Now you are finally ready to sign! There are two options to sign the .zip
1)Find the ROM (.zip) and right click and select "Resign Zip". If you use this option a command prompt box should quickly appear and disappear.
OR
2) Using the Autosign.bat, select option 4, and then write the directory and file name of the ROM. For example,
D:\Android\ROMs\YourROMHere.zip
It will hang for a bit at the part where it says "signing", and then it should say something along the lines of "Successfully completed if no errors above"
If this helped you, comment below!
http://androidforums.com/developer-101/8665-how-signing-roms.html
Anyone...... I know someone knows
You have to zip the contents of the rom, not the rom itself. i.e. if you sign the rom folder, it will be ROM_Signed.zip->ROM->system/data/metainf... you get the picture. Go into the folder you want to zip and then sign, select the contents, and zip them. It will then be ROM_Signed.zip->/system/data/metainf. Then just sign it.
update-script is a script that tells the flash utility what to do. It is located in the zip as part of the following directory structure:
META-INF/com/google/android
The contents can vary. For Darktremor A2SD 2.6.1, here's the contents:
show_progress 0.1 0
copy_dir PACKAGE:system SYSTEM:
show_progress 0.1 10
PACKAGE is used by android to reference the actual zip file, or package file.
SYSTEM is used to represent /system
DATA is used to represent /data
CACHE is used to represent /cache
BOOT is used to represent the boot partition (which is where you flash boot.img)
RECOVERY is used to represent the recovery partition. Never actually seen this used. I guess it used for an update.zip that you would flash via fastboot.
The zip file has to be structured in the same way as the file system on your phone. If you want to install something to, say, /system/bin, you must have a system folder, which in turn has a bin folder.
What I would do is take one of the available ROMs and unzip it. Then look for their update-script. Usually ROM packages are more detailed in the update-script.
If you don't have update-script in your zip file, the flash utility in recovery won't know what to do.
networx2002 said:
I followed each one of your steps. I get an error when trying to install the signed zip. "Can't find update script" Can anyone please help me with this.
thank you
I'm doing option 2. I get it signed just get an error "Can't find update script"
This quick guide will teach you how to sign ROMs!
WARNING : YOU WILL NEED AT LEAST A BASE KNOWLEDGE OF HOW TO USE COMMAND PROMPT.
The knowledge of signing ROMs can prove useful to anyone! By knowing how to sign ROMs, you can modify your favorite ROM to add or delete APKs, so when you flash the ROM your favorite apps will be present! Or you can delete apps you don't use so they will not be installed when flashing the ROM!
Before starting, you need a couple of things. First you will need Java SE Development Kit and Java SE Runtime Environment . You can download them HERE.
After you have downloaded and installed both, you will need a very useful tool made by someone at XDA-Developers (if you know who it is please let me know).
Download this tool (attached) and unzip everything inside of it into one common folder. I personally unzipped everything into my Android SDK folder.
Signing
Now run the autosign.bat. You will have to go through commands 1(Set PATH variable for SDK) ,2 (Set CLASSPATH variable for signing tool) and 3 (Install registry entries). They are very easy to use and just follow the instructions. If you are asked to confirm and/or replace a file, always select yes!
Now you are finally ready to sign! There are two options to sign the .zip
1)Find the ROM (.zip) and right click and select "Resign Zip". If you use this option a command prompt box should quickly appear and disappear.
OR
2) Using the Autosign.bat, select option 4, and then write the directory and file name of the ROM. For example,
D:\Android\ROMs\YourROMHere.zip
It will hang for a bit at the part where it says "signing", and then it should say something along the lines of "Successfully completed if no errors above"
If this helped you, comment below!
http://androidforums.com/developer-101/8665-how-signing-roms.html
Click to expand...
Click to collapse
HeroMeng said:
You have to zip the contents of the rom, not the rom itself. i.e. if you sign the rom folder, it will be ROM_Signed.zip->ROM->system/data/metainf... you get the picture. Go into the folder you want to zip and then sign, select the contents, and zip them. It will then be ROM_Signed.zip->/system/data/metainf. Then just sign it.
Click to expand...
Click to collapse
It took my brain a min, but i got it.
Thanks

[Q] Couple of questions about ROM development

Hello!
First of all, thanks to all you repliers!
I'd really like to know a few things creating a ROM:
1. how can I create an update.zip starting from a system.img? (I know how to sign) In case can I simply install the img and then push /system changes, like root or busybox?
2. how can I install busybox manually? Can I create a script which does the job for me (i.e. busybox --install command at first boot then delete the script itself), avoiding me to write loads of symlinks?
3. when I've created an update.zip, is it easy to root the ROM? I mean, just push su and SuperUser.apk? Or I need a particular boot.img?
Thanks
elegos said:
Hello!
First of all, thanks to all you repliers!
I'd really like to know a few things creating a ROM:
1. how can I create an update.zip starting from a system.img? (I know how to sign) In case can I simply install the img and then push /system changes, like root or busybox?
Click to expand...
Click to collapse
Clockwork Recovery won't install system image files for some reason. You'll need to dump the yaffs2 filesystem then zip it up into the update.zip, then use an updater-script to set unix permissions (zip doesn't preserve these). Also, there's no need to sign the update.zip. It's only meaningful to the device's firmware if it is signed by the device's manufacturer.
elegos said:
Hello!
2. how can I install busybox manually? Can I create a script which does the job for me (i.e. busybox --install command at first boot then delete the script itself), avoiding me to write loads of symlinks?
Click to expand...
Click to collapse
Certainly. You can add a script and call it from updater-script during the install.
elegos said:
Hello!
3. when I've created an update.zip, is it easy to root the ROM? I mean, just push su and SuperUser.apk? Or I need a particular boot.img?
Thanks
Click to expand...
Click to collapse
Boot image is irrelevant to a properly rooted system. Just adding SuperUser should be sufficient.
That's cool!
1. as of the system.img, I see there is a system folder too - is that just enought zipping it?
2. may you please tell me how to call a script within an edify updater-script please?
3. thanks
I don't understand. You have a system.img and a system folder? In what? What are you starting from? If you use a zipped system, you WILL need to set unix permissions, symlinks and modes as these are NOT preserved in a zip file.
As far as calling scripts, something like this:
run_program PACKAGE:installbusybox.sh

[Tool][TLC]UpdatezipCreator

The Team Lambent Corrosion member presents:
UpdatezipCreator​
I've found some time to build a new app that can create updates (as zip archive flashable via recovery).
Features:
-Simply to use interface
-Edify & Amend scripts
-Automatic signing
-Signing single ZIPs
-Drag&Drop
I hope that app will work without any bugs
Changelog:
1.0.0.1
-adding update-binary to edify scripts (possibility of choosing own update-binary)
-added default scripts for edify scripts
-settings not stored in my documents
1.0.0.2
-Adding folders
-Drag&Drop
-Signing single zip archive
1.0.0.3
-Fixed bug with the wrong name of edify scripts
1.0.0.4
-Not signed archive is kept in temporary directory
-Functions library (inserting functions)
1.0.0.5
-Problem with update_ont_signed path solved (I hope so)
1.0.0.6
-Log mode
1.0.0.7
-Signing bug fixed
1.0.0.8
-Handling linux newline character in scripts
10/05/2013 - updated links due to many requests (unfortunately, my dropbox accounts was generating to much traffic )
DOWNLOAD:
Rar archive - about 540 kb
Source code - about 1,3 MB - Visual Studio C#
Installer - about 850 kb
Now this'll get success!
I can't wait to get back to my laptop and try it! Thanks OP!
Sent from my Nexus S 4G using xda premium
Awesome
benzyniarz1 said:
The Team Lambent Corrosion member presents:
UpdatezipCreator​
I've found some time to build a new app that can create updates (as zip archive flashable via recovery).
Features:
-Edify & Amend scripts
-Signing
I hope that app will work without any bugs
Changelog:
1.0.0.1
-adding update-binary to edify scripts (possibility of choosing own update-binary)
-added default scripts for edify scripts
-settings not stored in my documents
1.0.0.2
-Adding folders
-Drag&Drop
-Signing single zip archive
DOWNLOAD:
Rar archive - about 390 kb
Source code - about 500 kb - Visual Studio C#
Click to expand...
Click to collapse
Dude, this rocks!! Is there any way you can post a update script for HTC thunderbolt? I will def be donating!
I cant seem to get CWR to take any of my zips. I am getting in error "status 4" any ideas?
jgrimberg1979 said:
Dude, this rocks!! Is there any way you can post a update script for HTC thunderbolt? I will def be donating!
Click to expand...
Click to collapse
Thanks, but what do you mean by update-script for the HTC thunderbolt? Scripts built-in are universal (amend) or almost universal (you need only to change mounting point manually). If you don't know how, I can prepare the specify script for your device.
I'm going to use phoneDatabase from amend2edify to prepare the mount points for different devices.
jgrimberg1979 said:
I cant seem to get CWR to take any of my zips. I am getting in error "status 4" any ideas?
Click to expand...
Click to collapse
1. Are you have a full root kernel in the phone?
2. Are you tried to use the both update-scripts? (amend or edify)
3. If you were using edify, did you changed mounting point in script?
I think that CWM scripts should work on the CWR..
If you could make one for me that would be awesome. I tried using both amend and edify.
benzyniarz1 said:
Thanks, but what do you mean by update-script for the HTC thunderbolt? Scripts built-in are universal (amend) or almost universal (you need only to change mounting point manually). If you don't know how, I can prepare the specify script for your device.
I'm going to use phoneDatabase from amend2edify to prepare the mount points for different devices.
1. Are you have a full root kernel in the phone?
2. Are you tried to use the both update-scripts? (amend or edify)
3. If you were using edify, did you changed mounting point in script?
I think that CWM scripts should work on the CWR..
Click to expand...
Click to collapse
Yes I am full root and s-off
Yes I tried using both
I am not sure how to do that
jgrimberg1979 said:
Yes I am full root and s-off
Yes I tried using both
I am not sure how to do that
Click to expand...
Click to collapse
You've tried edify, but didn't change the mounting point, so it couldn't work.. You need to change the line
mount("/dev/block/stl6", "system", "/system", "rw");
Click to expand...
Click to collapse
to:
mount("/dev/block/mmcblk0p25", "system", "/system", "rw");
Click to expand...
Click to collapse
Here is a prepared update-script for your device. Load it in update-script tab page in the app before making update.zip. I hope it will work. Do not forget to check the edify script in options.
So, here are steps:
Add files you want to
Check the edify script and built-in update-binary in the options page
Load prepared file or change "mount" line manually in a update-script page
Create zip archive
You can also try to mount system via (instead of "mount(..."):
run_program("/sbin/busybox", "mount", "-t", "auto", "/dev/block/mmcblk0p25", "/system");
Click to expand...
Click to collapse
It also should work.
Thanks! I will test it out tonight and get back to you.
Sent from my ADR6400L using Tapatalk
benzyniarz1 said:
You've tried edify, but didn't change the mounting point, so it couldn't work.. You need to change the line
to:
Here is a prepared update-script for your device. Load it in update-script tab page in the app before making update.zip. I hope it will work. Do not forget to check the edify script in options.
So, here are steps:
Add files you want to
Check the edify script and built-in update-binary in the options page
Load prepared file or change "mount" line manually in a update-script page
Create zip archive
You can also try to mount system via (instead of "mount(..."):
It also should work.
Click to expand...
Click to collapse
I cant get it to work. I am getting an error status 25. I have tried all the combinations. I have tried the different update binary and updater scripts and i get the same outcome.
update.. It looks like for my phone i need an updater-script rather than update script. Here is a link to the successful zip. I had to open the finished zip(ur program) and delete the update-script and replace it with an updater-script. Is there any way you can adjust it so it will have the right scripts each time so i dont have to manually change anything? That would be awesome. I have been looking for something like this for years. so nice to have simple gui and not have to use update.zip creator and then use amend2edify to make a zip. here is a link http://www.mediafire.com/?29vyc5sojdm946b
Thanks a lot.. it's all my fault. I've not noticed, that amend scripts require "update-script" name and edify scripts "updater-script"...
The new version has been released, please try it now
simply changelog:
1.0.0.3
-Fixed bug with the wrong name of edify scripts
benzyniarz1 said:
Thanks a lot.. it's all my fault. I've not noticed, that amend scripts require "update-script" name and edify scripts "updater-script"...
The new version has been released, please try it now
simply changelog:
1.0.0.3
-Fixed bug with the wrong name of edify scripts
Click to expand...
Click to collapse
It is still not working. I think it may be something with the signing process or something. to get the zips to work i have to take the zipnotsigned in the folder use 7zip and delete the update-binary and delete updater script and replace it work the scripts that i used in the zip that i uploaded for you and then resign it. Once i do that it will flash just fine.
jgrimberg1979 said:
It is still not working. I think it may be something with the signing process or something. to get the zips to work i have to take the zipnotsigned in the folder use 7zip and delete the update-binary and delete updater script and replace it work the scripts that i used in the zip that i uploaded for you and then resign it. Once i do that it will flash just fine.
Click to expand...
Click to collapse
Ok, so.. please try this.. maybe the problem is with mount command.
Step like before:
Add files you want to
Check the edify script and built-in update-binary in the options page
Load prepared file or change "mount" line manually in a update-script page
Create zip archive
benzyniarz1 said:
Ok, so.. please try this.. maybe the problem is with mount command.
Step like before:
Add files you want to
Check the edify script and built-in update-binary in the options page
Load prepared file or change "mount" line manually in a update-script page
Create zip archive
Click to expand...
Click to collapse
That is an update-script, should i just rename it to updater-script?
It still isn't working. It does work if I use the updater-script and update-binary by means of going into the unsigned zip and dropping them in to replace the ones that are in there and then signing the zip. I has got to be something with the way the program is handling the scripts, because i could type the exact same thing in the edit window and it still wont flash. Either that or it is update-binary. Do you want me to upload the scripts? Here is the updater-script that works when i drop it in the zip with 7z.
ui_print("Script generated by amend2edify v1.0.1.2.");
ui_print("Using mount points for Thunderbolt.");
ui_print("***********************************************");
ui_print("Performing Update...");
ui_print("Mounting mount points...");
run_program("/sbin/mount", "/dev/block/mmcblk0p25", "/system");
run_program("/sbin/mount", "/dev/block/mmcblk0p26", "/data");
run_program("/sbin/mount", "/dev/block/mmcblk0p27", "/cache");
package_extract_dir("data", "/data");
ui_print("Unmounting mount points...");
run_program("/sbin/umount", "/system");
run_program("/sbin/umount", "/data");
run_program("/sbin/umount", "/cache");
ui_print("Update Complete.");
jgrimberg1979 said:
That is an update-script, should i just rename it to updater-script?
Click to expand...
Click to collapse
No, you don't have to. App is automatically changing the name (update-script or updater-script) depending on chosen script type in options.
jgrimberg1979 said:
It still isn't working. It does work if I use the updater-script and update-binary by means of going into the unsigned zip and dropping them in to replace the ones that are in there and then signing the zip. I has got to be something with the way the program is handling the scripts, because i could type the exact same thing in the edit window and it still wont flash. Either that or it is update-binary. Do you want me to upload the scripts? Here is the updater-script that works when i drop it in the zip with 7z.
ui_print("Script generated by amend2edify v1.0.1.2.");
ui_print("Using mount points for Thunderbolt.");
ui_print("***********************************************");
ui_print("Performing Update...");
ui_print("Mounting mount points...");
run_program("/sbin/mount", "/dev/block/mmcblk0p25", "/system");
run_program("/sbin/mount", "/dev/block/mmcblk0p26", "/data");
run_program("/sbin/mount", "/dev/block/mmcblk0p27", "/cache");
package_extract_dir("data", "/data");
ui_print("Unmounting mount points...");
run_program("/sbin/umount", "/system");
run_program("/sbin/umount", "/data");
run_program("/sbin/umount", "/cache");
ui_print("Update Complete.");
Click to expand...
Click to collapse
It looks like the update-binary you are using is the same like used in my app, so it can't be the problem.
I have no idea why it's not working if you type these commands in the editor. The output file should be the same as if you put your updater-script with the same commands via 7zip!..
However.. I've got idea - try to type these commands, and choose in options own update-binary that works for you. If it still won't work, please send me output archive.
oo one more thing - how do you sing the archive to get it work? via my app?
This is exactly what I was looking for.
Thanks.
Is there a way to make this work on a Mac?
If not, I can use my gf's laptop.
Thanks for your hard work.
benzyniarz1 said:
No, you don't have to. App is automatically changing the name (update-script or updater-script) depending on chosen script type in options.
It looks like the update-binary you are using is the same like used in my app, so it can't be the problem.
I have no idea why it's not working if you type these commands in the editor. The output file should be the same as if you put your updater-script with the same commands via 7zip!..
However.. I've got idea - try to type these commands, and choose in options own update-binary that works for you. If it still won't work, please send me output archive.
oo one more thing - how do you sing the archive to get it work? via my app?[/QUOT
I used a couple of processes but i used your app for signing after making the script edits with 7zip
Click to expand...
Click to collapse
lozonw said:
This is exactly what I was looking for.
Thanks.
Is there a way to make this work on a Mac?
If not, I can use my gf's laptop.
Thanks for your hard work.
Click to expand...
Click to collapse
Thanks!
I think it's possible..
Just look at http://www.mono-project.com/Main_Page.
You need only to compile sources via Mono on a Mac.
jgrimberg1979 said:
I used a couple of processes but i used your app for signing after making the script edits with 7zip
Click to expand...
Click to collapse
Strange.. so update-binary is not a problem, signing is not a problem too... updater-scripts only stays, but I have no idea why it's not working when you paste a script in editor but when the replace an updater-script with the same script via 7zip it's working...
Maybe it's sth wrong with ICSharpCode.SharpZipLib library? Maybe it is worth trying to use Zip64?

[TUTORIAL] Create your own UPDATE.ZIP

Hi all! This is a guide from PIRATEPARTY about the creation of a simple UPDATE.ZIP to flash on your Android phone, in recovery mode.
I've created a repository on GITHUB where you can download the "update.zip" that we'll use and modify.
So, this is the repository: update.zip--for-Android-Devices-
You can download it as ZIP archive and rename it as update.zip .
So, we have now the most important file, that we're going to modify:
All the apps that you want to insert in the archive and install on the phone, must have the .apk estension and you have to put them in /data/app . Then, if you want also the app data files, you have to take these files from your phone, going with a rooted file manager (i suggest Root_Explorer) to /data/data , copying the app folder and pasting it in /data/data of the UPDATE.ZIP.
So we have all the apps and datas that we want. Now, we have to write the script.
Let's go to META-INF/com/google/android/ and open 'updater-script' with a simple text editor.
The only lines that you have to modify are:
Code:
set_perm(1000, 1000, 0644, "/data/app/[PACKAGE].apk");
set_perm_recursive(1000, 1000, 0777, 0777, "/data/data/PACKAGE_DATA_FOLDER");
delete("/data/dalvik-cache/[email protected]@[PACKAGE][email protected]");
For each app you have to write these lines. This is an example if you want to put ROOT_EXPLORER.APK in the UPDATE.ZIP:
Code:
set_perm(1000, 1000, 0644, "/data/app/ROOT_EXPLORER.APK");
set_perm_recursive(1000, 1000, 0777, 0777, "/data/data/ROOT_EXPLORER_DATA_FOLDER");
delete("/data/dalvik-cache/[email protected]@ROOT [email protected]");
That' all. But if you want to delete some apps from your phone, you have to write between
Code:
ui_print("| 80% Installing Applications |");
and
Code:
package_extract_dir("data", "/data");
this line:
Code:
delete("/APK_DIR/APP.APK");
IT'S IMPORTANT TO LEAVE AN EMPTY LINE AT THE END OF THE SCRIPT, OTHERWISE THE ZIP WON'T WORK!
You can easily find the name of the app going with Root Explorer to /system/app and searching the same app.
If you also want to add your modified Apps, you've to sign them with a simple app: Auto-Sign, putting them in /auto-sign/update/app and renaming it to Launcher.apk .
You can download AUTO-SIGN from the attachements!
With it you can sign your apks or your zip. So, finally, when you'll finish your zip, you'll have to put it in Auto-Sign folder ("/auto-sign").
Then, open Auto-Sign, choose your zip or apk, and click AUTO-SIGN. It will create a new apk or zip, name as SIGNED-apk/zip.
Now, you only have to put the update.zip on your sd-card and flash it! Have fun guys!
mackief,
Thanks for your tutorial. I wrote a removal script for GB that deletes everything i don't use in my ROM. I recently moved to ICS and that very script is still working but, each time, during restart, I lose root rights.
Any idea where it could come from?
What rom are u using?? What device??
I think that the problem is about the rom, cause you said that u didnt have problem in previous rom and you used the same script...
So, to find the problem, i have to know the rom, the device, and the script.
Can you post the script here?
mackief,
Sorry for having been so long to answer, I was not monitoring the thread
I use nightly CM9 roms for my Note (N7000). You'll find attached my latest script that still bothers me.
If you can have a look at it, it would be nice.
good lession for tweaking my one x
vua777 said:
good lession for tweaking my one x
Click to expand...
Click to collapse
I'm glad do help you!
The_Steph said:
mackief,
Sorry for having been so long to answer, I was not monitoring the thread
I use nightly CM9 roms for my Note (N7000). You'll find attached my latest script that still bothers me.
If you can have a look at it, it would be nice.
Click to expand...
Click to collapse
I read your script, but i think that the only problem is about the root app: Superuser and his components. So, check out if some elements that you want to delete are associated to Superuser, and dont delete superuser.apk .
However, usually, in CM9 there are some apps that you CANT and HAVE NOT to delete. I suggest to you to read this file: REMOVABLE APPS
So, Superuser gives you root rights, so dont delete it.
Dont delete the list of apps that is on the link above.
The last suggestion is that you have to check if you're deleting something else that can create bugs with superuser and his working.
Write me if you want to know something else or also if these solutions arent useful: i'll help you! Bye!
Interesting guide. I am curious though, you have it setting permissions but have you tried it without doing so? I ask because I made a script for CWM which copies my apk's to data/app/ and I don't set permissions and have no issues. In theory you shouldn't need to, the apk should retain the proper permissions even when copied. As well, why not set the permissions for the entire contents of the folder, ie, set the permission recursively like you do for data/data and have it run at the end of the script once everything is copied?
Lastly, one thing to note with this method of installing apps is that your first boot will take awhile, the ROM has to create the Dalvik for all the apps you just flashed, I hadn't considered that when i first ran my script and thought something was wrong.
Волк said:
Interesting guide. I am curious though, you have it setting permissions but have you tried it without doing so? I ask because I made a script for CWM which copies my apk's to data/app/ and I don't set permissions and have no issues. In theory you shouldn't need to, the apk should retain the proper permissions even when copied. As well, why not set the permissions for the entire contents of the folder, ie, set the permission recursively like you do for data/data and have it run at the end of the script once everything is copied?
Lastly, one thing to note with this method of installing apps is that your first boot will take awhile, the ROM has to create the Dalvik for all the apps you just flashed, I hadn't considered that when i first ran my script and thought something was wrong.
Click to expand...
Click to collapse
At first, i have to say to u that permissions can be not specified: i think that all the files that u put in a folder have the same permission of the folder. I set permissions only for safety.
Then, about the first boot duration, there's nothing wrong.
The system only take a while to put into effects the changes, creating the Dalvik for example.. Don't worry: it's normal!
I know it's building dalvik, it simply hadn't occurred to me initially that that was the reason for it not booting. A file can have a different permission than the folder, but I think it's only that you can have the folder r/w and a file r/o. Then, on your script you can just set permissions recursively and save yourself setting permission for each app/file individually.
Sent from my LG-P999 using xda premium
Yeah! You can just do it!
Before CWM 5, I used to have a script that would let me add lots of files without individual lines for each.
It worked similar to gapps, where files are separated by commas.
Any ideas?
I will be adding sound files to system/media/audio/alarm.
What are symlinks?
Sent from my MB525 using Tapatalk 2
hermeticist said:
Before CWM 5, I used to have a script that would let me add lots of files without individual lines for each.
It worked similar to gapps, where files are separated by commas.
Any ideas?
I will be adding sound files to system/media/audio/alarm.
Click to expand...
Click to collapse
U can easily write the package_extract command:
Code:
package_extract_dir("???", "/???");
You write the folder, and then the android folder when you want to extract the script package.
Then you set the permission of the folder and all is done!
pjgowtham said:
What are symlinks?
Sent from my MB525 using Tapatalk 2
Click to expand...
Click to collapse
Symlinks are Simbolic Links, so they link a folder to another folder, for example, a linked folder...
In Windows, you can create a link on the desktop and you can change the name of the linked icon, but it is anyway connect to the same file, with different name.
So, the symlinks are files that connect with other files. When the os see this symlinks, it read the element info to which it is connected??
It's not difficult to understand. I suggest to you to read this: SymLinks
Hope i've helped u all! If it doesnt, ask me again!
mackief said:
U can easily write the package_extract command:
Code:
package_extract_dir("???", "/???");
You write the folder, and then the android folder when you want to extract the script package.
Then you set the permission of the folder and all is done!
Click to expand...
Click to collapse
Thanks.
I'm a little unclear about setting permissions though. Would you mind explaining?
Thanks i understood
Sent from my MB525 using Tapatalk 2
hermeticist said:
Thanks.
I'm a little unclear about setting permissions though. Would you mind explaining?
Click to expand...
Click to collapse
So, if u want to set folder permissions, this is the code:
Code:
set_perm_recursive(1000, 1000, 0777, 0777, "/data/data/PACKAGE_DATA_FOLDER");
And these permissions are for a 'read-only' folder.
If u want to set file permissions, this is the code:
Code:
set_perm(1000, 1000, 0644, "/data/app/[PACKAGE].apk");
Also these permissions are for a 'read-only' file.
So do u need something else??
Hope u understood!
OK, here's one I can't seem to figure out, I want to copy data/app to my SD card. I tried(with /data mounted):
run_program("/sbin/busybox", "mkdir", "/sdcard/app/");
run_program("/sbin/busybox", "cp", "r", "/data/app/", "/sdcard/app/");
it fails with status 6, and log shows syntax error. I'm at a loss.
You're telling it to copy a file named "r". Change it to "-r".
I tried that already, I actually changed it to that, I played with my code a few times before posting.
Here is the last version I tried: http://db.tt/10DQzTQM
Sent from my LG-P999 using xda premium
nice tuto thank you very much for it
please i am noobe here
i have a unpadte to make but i don't know how here the structure of it
how to do the script please

[MOD][SCRIPT] Get More Storage by Relocating Dalvik Cache!

DISCLAIMER: YOU AGREE TO TAKE FULL RESPONSIBILITY FOR YOUR DEVICE IF YOU PROCEED.
The original thread (http://forum.xda-developers.com/moto-g/general/mod-save-data-space-cache-partition-t2942765) was getting to cluttered up with development and testing so I decided to start a new thread with the "finished" product. The original thread will be renamed to Q&A/Development. We might even ask for the old thread to be closed down. (up to @Bert98, the thread's creator.)
Moto G's internal eMMC card has a ~600Mb partition called /cache, which is not used since the apps' cache is stored in /data, so the latter fills up and the first one stays empty.
Owning a 8Gb model, having 600Mb not available for storage really bugged me, because my phone's memory (/data partition) was always full because it's a 5.7Gb space shared between apps and microSD files.
Now, it may not work for you if:
a) you have A LOT of apps installed.
And by "a lot", I mean more than 90-100 apps, but if you have a 8Gb model, you probably don't
b) you're running ART (this is default in lollipop and newer)
Since ART uses a lot more space than dalvik, the space in the /cache partition probably won't be enough. When I was running ART, it used 1Gb more than dalvik.
Original post by @Bert98
Click to expand...
Click to collapse
This was tested on my moto g 16GB which is running RetailUS_4.4.4 kitkat with CWM recovery. The custom ROM procedure was tested on the same phone but with cm11 Nightly installed.
Prerequisites:
1. You must have "adb root" functioning. If you don't head to this thread: http://forum.xda-developers.com/showthread.php?t=1687590 and there is a free download link at the bottom of the post.
Download and install the apk on your phone. Open up adbd insecure (the new app) and grant it superuser rights PERMANENTLY. Check the box that says "enable insecure binary" and make sure to check the box
that says "enable at boot."
2. You must have a recovery that can accept adb shell commands.
3. Root Access Duh?!
4. A windows machine capable of running batch files.
5. A decent text editor, notepad will work but notepad++ is strongly recommended. (Only needed if you are using STOCK ROM procedure)
Please, please make a nandroid backup before you continue!!!!
Stock ROM procedure:
Read the directions very carefully and then read them again, before continuing.
1. Download the cachemover_v1.3.zip from: LINK REMOVED DUE TO SCRIPT ISSUES.
2. Extract the contents.
3. Connect device to PC and navigate to the extracted folder.
4. Double click/Run the cachemover_Stock.bat
5. Follow the onscreen instructions until you get to the part where it says to edit a file.
6. About halfway through the script it will pull a file called "init.qcom.post_boot.sh" to the folder.
7. Open it with a TEXT editor and navigate to about line 487 (Might be different for 8gb model). Look here for a better understanding: https://www.dropbox.com/s/jr5lyl5s5i2jtpg/where to paste code.PNG?dl=0
8. Start a new line and paste this code in the file: (Refer to the image above for help)
Code:
chmod 655 /cache
chmod 655 /cache/dalvik-cache
chmod 655 /cache/dalvik-cache/*
9. Make sure to save the file in the same folder as the cachemover_Stock.bat
10. Press any key to continue on the script and let it do its thing.
11. It will reboot several times and land you on the home screen/lock screen.
12. If the script hangs after a reboot, you need to unlock the device to reestablish a connection with your computer.
13. There might be one or two force closes but once you close the notifications they will not come back.
Custom ROM procedure:
USE THIS FOR ROMS THAT DO NOT REMOUNT OR CHANGE PERMISSIONS OF /CACHE ON BOOT
1. Download the cachemover_v1.3.zip from: https://www.dropbox.com/s/bzj34g4q1s61ojz/cachemover_v1.3.zip?dl=0
2. Extract the contents.
3. Connect device to PC and navigate to the extracted folder.
4. Double click/Run the cachemover.bat
5. Follow the onscreen instructions.
If anything goes wrong:
Go to recovery, wipe cache, then wipe dalvik-cache and reboot. This should get your device back to how it was.
(If you used STOCK ROM procedure)
The script made a backup of the "init.qcom.post_boot.sh" file to /sdcard/init_backup
You can restore the shell script to /system/etc/ via shell commands or by using a root browser. To restore permissions:
Code:
chmod 740 /system/etc/init.qcom.post_boot.sh
chown root:root /system/etc/init.qcom.post_boot.sh
Custom ROM procedure already has a restore script!
I am currently working on an auto restore script for stock and that will be relased soon, hopefully! :good:
Changelog:
v1.0 - First stable release. Does not work on STOCK ROM.
v1.1 - Added a restore script.
v1.3 - Added support for STOCK ROM. There are still a few bugs.
How it works?!?!
Coming soon...
Huge thanks to @Bert98 and @dd043
Hit the thanks button if it worked! I went through about 50 factory resets, and reflashed the ROM about 25 times, and put about 10 hours of work into this script! Really motivates me for future projects. :laugh:
Thanks for your help man and effort.
I encountered a problem, everything works up until my device boots in CWM to fix permissions, then just sits there doing not alot I don't even see the option in my CWM.
Any ideas? cheers
Sent from my XT1032 using XDA Free mobile app
When it reboots to cwm unplug the cable and replug it, if it hangs just type these commands manually from a command window.
chmod 655 /cache
chmod 655 /cache/dalvik-cache
chmod 655 /cache/dalvik-cache/*
reboot
If this does not work you may ned to go into mounts & storage in the cwm menu and click mount /cache. Then try the commands again.
I'm having some issues on stock.
I thought 0655 fixed everything but no, I can't install any app after moving the dalvik-cache to /cache. I tried chmoding 0777 on the new cache folder, on /cache itself, to no avail.
Code:
E/dexopt cannot open '/data/dalvik-cache/[email protected]' for output
Anyone can confirm it's not only my device? And/or can help find a fix?
Also does someone knows how to execute commands on a particular init step? Real init.rc scripts can do:
Code:
on post-fs-data
mount -o bind /cache/dalvik /data/dalvik-cache
It there was a way to achieve the same from post_boot/init.d we could mount -o bind /cache/dalvik /data/dalvik-cache and all permissions issues would disappear as well as the need for symlink.
You have a typo in the threads title. Just a heads up.
Vuciz said:
You have a typo in the threads title. Just a heads up.
Click to expand...
Click to collapse
Thanks for letting me know!
dd043 said:
I'm having some issues on stock.
I thought 0655 fixed everything but no, I can't install any app after moving the dalvik-cache to /cache. I tried chmoding 0777 on the new cache folder, on /cache itself, to no avail.
Code:
E/dexopt cannot open '/data/dalvik-cache/[email protected]' for output
Anyone can confirm it's not only my device? And/or can help find a fix?
Also does someone knows how to execute commands on a particular init step? Real init.rc scripts can do:
Code:
on post-fs-data
mount -o bind /cache/dalvik /data/dalvik-cache
It there was a way to achieve the same from post_boot/init.d we could mount -o bind /cache/dalvik /data/dalvik-cache and all permissions issues would disappear as well as the need for symlink.
Click to expand...
Click to collapse
Let me try and do that right now... Ill get back to you if it does!
My script works on stock btw... But the mount way seems a bit easier and might cause less errors than my way.
Try it please.
skyguy126 said:
Let me try and do that right now... Ill get back to you if it does!
My script works on stock btw... But the mount way seems a bit easier and might cause less errors than my way.
Try it please.
Click to expand...
Click to collapse
Yes I've tried your script, all went well but the result is the same. The script itself works nicely btw
Applications present before moving cache work perfectly, but I can't install anything new. I suspect it might be my device but before wiping everything I'd prefer feedback from others :fingers-crossed:.
I cannot install new apps as well. The mount command you showed me has the same effect too. I honestly don't know anymore, the sym link did not allow the install of new apps nor did the mount command you sent me. Correct me if I am wrong.
Edit: Going through all the init files on my phone to see which one remounts /cache at boot.
Why does the init.rc get overwritten at boot. Is it because the kernel (boot.img) is the one that copies it over? I have found by changing the perms/locations in this file and init.target.rc you can achieve what this mod is trying to acomplish.
I don't see the mount cache command in CWM strange
I've managed to get back to normal, thanks for everyone's help though, I will keep and eye on the thread
Sent from my XT1032 using XDA Free mobile app
non-windows version?
Thanks for this tool. It's a great idea and our Motos really need it.
However, I have a problem - I do not own a windows license (os x and ubuntu user) and I would prefer not to spend $120 just to use it for this script. Pirating is out of the question for me.
I was wondering if there is any chance of having this script written for linux and/or mac. If impossible, is there a LEGAL way of running windows in a virtual machine? Something like a trial or similar?
If you know how just convert it to shell script for osx and Linux. I give you permission to do this but you may not take credit or rehost your creation.
Ok so I have the kernel extracted and we could modify and flash that, but I believe that it's not really necessary. There are a lot of risks to flashing kernels and I am not willing to take it. So is there a way we can modify dalvik so it creates it's cache in /cache instead.
skyguy126 said:
Why does the init.rc get overwritten at boot. Is it because the kernel (boot.img) is the one that copies it over? I have found by changing the perms/locations in this file and init.target.rc you can achieve what this mod is trying to acomplish.
Click to expand...
Click to collapse
Yes the init.rc is in the boot ramdisk. I don't think it would be worth the trouble to rebuild a boot.img. The moto g is fairly unbrickable but it's quite a lot of work to setup an environment to rebuild an image :/.
Too bad for the mount command, I was sure it was working but maybe I had changed something else and don't quite remember the steps to reproduce
We could possibly implement a shell script toggler for when we need to install new apps, but I'm afraid it'd become annoying fairly quickly: I noticed the issue initially because google play services decided to update itself, failed, and broke all google apps. As far as I know this autoupate can't be disabled.
Thanks for trying!
dd043 said:
Yes the init.rc is in the boot ramdisk. I don't think it would be worth the trouble to rebuild a boot.img. The moto g is fairly unbrickable but it's quite a lot of work to setup an environment to rebuild an image :/.
Too bad for the mount command, I was sure it was working but maybe I had changed something else and don't quite remember the steps to reproduce
We could possibly implement a shell script toggler for when we need to install new apps, but I'm afraid it'd become annoying fairly quickly: I noticed the issue initially because google play services decided to update itself, failed, and broke all google apps. As far as I know this autoupate can't be disabled.
Thanks for trying!
Click to expand...
Click to collapse
How about making a simple apk that toggles this feature. Something like when you click the icon it doesn't even open but gives a little notification of success. Something like that. I myself am not experienced with apks but I can put together a shell script for the apk.
skyguy126 said:
Ok so I have the kernel extracted and we could modify and flash that, but I believe that it's not really necessary. There are a lot of risks to flashing kernels and I am not willing to take it. So is there a way we can modify dalvik so it creates it's cache in /cache instead.
Click to expand...
Click to collapse
Patching dalvik itself sounds promising. It can probably be done with in a batch script with a command line hex editor.
The path is defined in frameworks/base/cmds/installd/installd.h
Code:
#define DALVIK_CACHE_PREFIX "/data/dalvik-cache/"
Not sure if there is another mention in the source tree.
But there's nothing to say we wouldn't face the same issue, the error message in the logcat is pretty generic
dd043 said:
Patching dalvik itself sounds promising. It can probably be done with in a batch script with a command line hex editor.
The path is defined in frameworks/base/cmds/installd/installd.h
Code:
#define DALVIK_CACHE_PREFIX "/data/dalvik-cache/"
Not sure if there is another mention in the source tree.
But there's nothing to say we wouldn't face the same issue, the error message in the logcat is pretty generic
Click to expand...
Click to collapse
Ill try it. I don't mind doing a bunch of resets because I am using my moto g as a test bench anyway. My daily driver is the OnePlus One
dd043 said:
Patching dalvik itself sounds promising. It can probably be done with in a batch script with a command line hex editor.
The path is defined in frameworks/base/cmds/installd/installd.h
Code:
#define DALVIK_CACHE_PREFIX "/data/dalvik-cache/"
Not sure if there is another mention in the source tree.
But there's nothing to say we wouldn't face the same issue, the error message in the logcat is pretty generic
Click to expand...
Click to collapse
EDIT: Unfortunately it didn't work. I don't know if I modified the installd file correctly. The program I used is HxD.
Is there a way we can force dalvik to start after the directories are created. And change dalvik to create it in /cache.

Categories

Resources