Related
Hi,
I would like to add a form update.zip system / app folder in a couple of new apk.
Trying:
Code:
ui_print(" ");
ui_print("start");
show_progress(.200000, 5);
mount("MTD", "userdata", "/userdata");
package_extract_dir("system", "/system");
unmount("/userdata");
show_progress(.000000, 5);
ui_print("end");
structure:
-META-INF
-com
-google
-android
-update-binary
-update-script
-system
-app
-first.apk
-second.apk
clockworkmod go-> update.zip, run, no errors, end.
Go start the phone, browse rootexplorer, and nothing the apk app folder.
please help me.
heimdallr75 said:
Hi,
I would like to add a form update.zip system / app folder in a couple of new apk.
Trying:
Code:
ui_print(" ");
ui_print("start");
show_progress(.200000, 5);
mount("MTD", "userdata", "/userdata");
package_extract_dir("system", "/system");
unmount("/userdata");
show_progress(.000000, 5);
ui_print("end");
structure:
-META-INF
-com
-google
-android
-update-binary
-update-script
-system
-app
-first.apk
-second.apk
clockworkmod go-> update.zip, run, no errors, end.
Go start the phone, browse rootexplorer, and nothing the apk app folder.
please help me.
Click to expand...
Click to collapse
You need to replace 'system' with 'data',
So rename the 'system' folder to 'data' and then code your updater-script like this:
Code:
ui_print(" ");
ui_print("start");
show_progress(.200000, 5);
mount("MTD", "userdata", "/data");
package_extract_dir("data", "/data");
unmount("/data");
show_progress(.000000, 5);
ui_print("end");
Hope it helps,
Jack
JackG256 said:
You need to replace 'system' with 'data',
So rename the 'system' folder to 'data' and then code your updater-script like this:
Code:
ui_print(" ");
ui_print("start");
show_progress(.200000, 5);
mount("MTD", "userdata", "/data");
package_extract_dir("data", "/data");
unmount("/data");
show_progress(.000000, 5);
ui_print("end");
Hope it helps,
Jack
Click to expand...
Click to collapse
Thx Jack!
but correct working script:
Code:
mount("MTD", "userdata", "/system");
package_extract_dir("system", "/system");
unmount("/system");
its work
heimdallr75 said:
Thx Jack!
but correct working script:
Code:
mount("MTD", "userdata", "/system");
package_extract_dir("system", "/system");
unmount("/system");
its work
Click to expand...
Click to collapse
Oh I see now what are u trying to. Yes that is the correct way. Good idea.
Veronica
Sent from my GT540 using XDA App
Hey guys, made an tutorial on how to make an CWM installable .zip
Requirements
Notepad++
An CWM/Feamod installable .zip for your device
Instructions:
1. Get yourself an CWM installable .zip for your device.
2. Extract the .zip
3. Go into the META-INF folder, delete CERT.RSA, CERT.SF and MANIFEST.MF.
4. go to META-INF/com/google/android
5. Right-Click on updater-script and select Notepad++
6. You see an script. Edit it. If you want to extract the folder (zip)/system/media/audio/ui use this script:
Code:
package_extract_dir("system/media/audio/ui", "/system/media/audio/ui");
ui_print("text"); means the text shown when you install the .zip in CWM.
run_program("text"); means that CWM runs a program
delete("/system"); means that you delete /system
package_extract_dir("framework", "/system/etc"); means that the files in /system/framework are extracted in /system/etc (on the device)
Make the script. My script for my iPhone Sounds is
ui_print("iPhone-Sounds by FlorisNL");
Code:
show_progress(1.000000, 0);
mount("ext4", "/dev/block/mmcblk0p15", "/system");
set_progress(0.400000);
package_extract_dir("system/media/audio/ui", "/system/media/audio/ui");
set_progress(0.800000);
unmount("/system");
set_progress(0.900000);
ui_print("Installed Iphone-Sounds. Enjoy.");
set_progress(1.000000);
When your done, create an .zip with 7z. and test it. If you still got problems, feel free to post it in this topic.
(Sorry for my poor english sometimes ;p)
Floris
No need to make CWM flashable mod for audio files.
Put ogg/m4a/mp3 files in
sdcard/Alarms
sdcard/Notifications
sdcard/Ringtones
Reboot and media scanner will make them available in Settings > Sounds.
sdcard/Ringtones/.nomedia <- (0 size file)
Reboot and media scanner skip the folder sdcard/Ringtones
But I want to know. And im not porting ringtones only but also lock sounds, camera shutter sound, etc.
Sent from my GT-I9001 using xda premium
Then you must promise not to include aiPhaun sounds... :*
I don't want to be held responsible for distributing that to Android platform :\
O-T said:
Then you must promise not to include aiPhaun sounds... :*
I don't want to be held responsible for distributing that to Android platform :\
Click to expand...
Click to collapse
Lol ok, it was just an idea. I just like the shutter sound and the lock sounds of the iphone but I prefer Android.
Just take a normal zip for your device, extract it, look at the file in META-INF\com\google\android --> updater-script (edit only with notepad++ under windows os, otherwise with normal notepad or other software the line endings might get converted from UNIX style to windows style which will not work!)
Files to be copied will most likely be in a folder structure like \system\YourFile.
Be sure to remove in \META-INF files CERT.RSA, CERT.SF and MANIFEST.MF.
Those are the files that gurantee the file is correct and integer ("signed zip") will become invalid after repacking.
Then pack everything with 7zip (with format .zip and lightest compression) and make sure that when you open up your zip META-INF is in the zip root.
More information on updater-scripts can be found on XDA or google with search for edify script.
What do you exactly mean with a zip for your device? Another mod?
Sent from my GT-I9001 using xda premium
Yes. For example, this is the start of crybert's AIO package script for 9001.
Code:
ui_print(" AIO - Package v1 by crybert ");
ui_print("**********************************");
ui_print(" root ");
ui_print(" busybox ");
ui_print(" init.d ");
ui_print(" custom bootanimation ");
ui_print(" FeaModRecovery 1.4 ");
ui_print("**********************************");
ui_print(" Credits: ");
ui_print(" manveru0 - FeaModRecovery ");
ui_print(" KeksKlip - Root ");
ui_print(" ");
ui_print("**********************************");
show_progress(1.000000, 0);
ui_print("Preparing device");
mount("ext4", "EMMC", "/dev/block/mmcblk0p15", "/system");
package_extract_dir("system", "/system");
set_progress(0.200000);
ui_print("Activating SuperUser");
set_perm(0, 0, 06755, "/system/bin/su");
symlink("/system/bin/su", "/system/xbin/su");
set_progress(0.400000);
wintel_mac said:
Yes. For example, this is the start of crybert's AIO package script for 9001.
Code:
ui_print(" AIO - Package v1 by crybert ");
ui_print("**********************************");
ui_print(" root ");
ui_print(" busybox ");
ui_print(" init.d ");
ui_print(" custom bootanimation ");
ui_print(" FeaModRecovery 1.4 ");
ui_print("**********************************");
ui_print(" Credits: ");
ui_print(" manveru0 - FeaModRecovery ");
ui_print(" KeksKlip - Root ");
ui_print(" ");
ui_print("**********************************");
show_progress(1.000000, 0);
ui_print("Preparing device");
mount("ext4", "EMMC", "/dev/block/mmcblk0p15", "/system");
package_extract_dir("system", "/system");
set_progress(0.200000);
ui_print("Activating SuperUser");
set_perm(0, 0, 06755, "/system/bin/su");
symlink("/system/bin/su", "/system/xbin/su");
set_progress(0.400000);
Click to expand...
Click to collapse
This is my script how it's now. It is installing but its not replacing the Lock.ogg - Unlock.ogg - TW_Unlock.ogg files... Can you help me?
Code:
ui_print("iPhone-Sounds by FlorisNL");
show_progress(1.000000, 0);
mount("MTD", "/system/media/audio/ui", "/system/media/audio/ui");
set_progress(0.400000);
package_extract_dir("system/media/audio/ui", "/system/media/audio/ui");
set_progress(0.800000);
unmount("/system/media/audio/ui");
set_progress(0.900000);
ui_print("Installed Iphone-Sounds. Enjoy.");
set_progress(1.000000);
My Folder:
Code:
system/media/audio/ui/Lock.ogg TW_Unlock.ogg Unlock.ogg
Code:
META-INF/com/google/android/updater-binary and updater-script
Mount command seems wrong.
Sent from my GT-I9001 using XDA App
FlorisNL said:
This is my script how it's now. It is installing but its not replacing the Lock.ogg - Unlock.ogg - TW_Unlock.ogg files... Can you help me?
Code:
ui_print("iPhone-Sounds by FlorisNL");
show_progress(1.000000, 0);
mount("MTD", "/system/media/audio/ui", "/system/media/audio/ui");
set_progress(0.400000);
package_extract_dir("system/media/audio/ui", "/system/media/audio/ui");
set_progress(0.800000);
unmount("/system/media/audio/ui");
set_progress(0.900000);
ui_print("Installed Iphone-Sounds. Enjoy.");
set_progress(1.000000);
My Folder:
Code:
system/media/audio/ui/Lock.ogg TW_Unlock.ogg Unlock.ogg
Code:
META-INF/com/google/android/updater-binary and updater-script
Click to expand...
Click to collapse
Folders are ok.
script:
Code:
mount("ext4", "EMMC", "/dev/block/mmcblk0p15", "/system");
package_extract_dir("system", "/system");
All the rest is unneeded ui stuff. Nice to look at, not necessary...
Thank you so much! I did it http://forum.xda-developers.com/showthread.php?t=1502660 here is the result so far
Sent from my GT-I9001
Hi Floris,
Thanks for changing this into a tut, good job!
Regards,
Nika.
And be sure if you extracted the zip to a directory, when you zip back, zip what's INSIDE the folder and not the folder... yeah, I did that...
The updater-script must also be in UNIX format (definitely, but that mistake I didn't make... )
With CWM 6.0.4.4 you can zip with the "Ultra" compression in 7-zip and CWM will manage to open it.
Hi, can anyone help me with this
trying to create own package which CWM still fails to install
gives error E: failed to open update.zip (bad)
Aborted
Q1: Am I require to use 7zip and lightest compression?
Q2: what actually does the mount("ext4", "...) command do and is it required to use?
Q3: if I want to put custom apk file into /system/app/ and set rw-r-r permissions for it, which command do I use?
bflmpsvz said:
Hi, can anyone help me with this
trying to create own package which CWM still fails to install
gives error E: failed to open update.zip (bad)
Aborted
Q1: Am I require to use 7zip and lightest compression?
Q2: what actually does the mount("ext4", "...) command do and is it required to use?
Q3: if I want to put custom apk file into /system/app/ and set rw-r-r permissions for it, which command do I use?
Click to expand...
Click to collapse
A1: I always just zipped it, never looked at the compression quality. Just make sure to make a ZIP and not RAR or 7Z
A2: It mounts your system so you can write to it. Make sure to use an example mount command from a working ZIP of someone else for your specific device. The mount command is different in every device. On some recoveries with rooted ROMs you can use:
Code:
run_program("/sbin/busybox", "mount", "/system");
A3: For instance something like this:
Code:
show_progress(1.000000, 0);
ui_print(" Mounting SYSTEM...");
run_program("/sbin/busybox", "mount", "/system");
set_progress(0.100000);
ui_print(" Extracting files to SYSTEM...");
package_extract_dir("system", "/system");
set_progress(0.400000);
ui_print(" Setting /system/app/NAME.apk permission to 644...");
set_perm(0, 0, 644, "/system/app/NAME.apk");
set_progress(0.600000);
ui_print(" Unmounting SYSTEM...");
unmount("/system");
set_progress(0.900000);
ui_print("Install complete...");
set_progress(1.000000);
Why not use ADB for something like this (from your PC)?
Code:
adb remount
adb push NAME.apk_here /system/app/
adb shell chmod 644 /system/app/NAME.apk
adb reboot
Regards,
Nika.
Nice. I've found the error source - some files names had international accents. Now install passes to the end.
But another problem I have is that my files aren't mirrored into system.
Is package_extract_dir("system", "/system") recursive or do I have process every nested folder in it for extraction?
system\fonts
system\media\audio\alarms
system\media\audio\notifications
system\media\audio\ringtones
system\etc
system\bin
system\app
My script
Code:
ui_print("Integrating own fonts, sounds and customizations into system");
show_progress(1.000000, 0);
set_progress(0.000000);
package_extract_dir("system", "/system");
set_progress(1.000000);
ui_print("Installed custom files. Enjoy.");
Finishes successfully but when I boot into OS, the files aren't in place, and I install this zip as last package.
Looks to me like you're not mounting system. It therefore cannot add the files. Yes, with package_extract_dir it recursively extracts all files...
Verstuurd vanaf mijn E380 met Tapatalk
---------- Post added at 07:56 PM ---------- Previous post was at 07:52 PM ----------
BTW, in most cwm you can also mount system from the menu. Try that first and then run your script. Again, mounting system is required when you want to copy file to it. Figure out what command to use for your specific rom... Possibly also checkout how they do it for gapps and other generic installable zips...
Verstuurd vanaf mijn E380 met Tapatalk
<<<TeamRainless>>> The DEFINITIVE Guide to Making Update.zip Files for The Galaxy SII
YOU NEED TO KNOW HOW TO DO THIS.
It's like changing a flat tire... a skill you never really need until it's far too late for you to learn how to do it because now you're stuck in Compton on a Saturday night... Better to learn NOW.
June 11th, 2012 (If you're reading much later you might want to check and see if Google has changed everything again.)
For starters: I'm writing this guide because ALL of the other guides for making an update.zip suck. Most of them follow the pattern of "Create a file called 'updater-script', write some stuff in it... and you're done!"
I happily nuked my Galaxy S II 20 times... including accidentally erasing my internal SD trying to figure out which "some stuff" I was supposed to write.
That said... creating an update.zip isn't as easy as all the smart-asses would have you believe it is... but it isn't as hard as YOU think it is either. I'm going to show you how to do it in three steps:
1. update-binary - a file that I'm giving you.
2. updater-script - a text file so simple to write you can do it in notepad in under 60 seconds
3. signing tool - I provide the link for one below but you can use whatever you want. Takes less than a second. (Note: Only standard bootloader Update.zips need to be signed. CWM zips don't. Still it's a good practice and... like I said it takes less than a second to do.)
WARNING: Screwing up an Update.zip can, at the very least, force you to do a factory reset and a clean wipe. And... at worst brick your phone.
Now... that said, if you follow these instructions CAREFULLY... there is very little chance of that.
Now the very first thing you're going to need is the correct update-binary for your phone. I have included the one for the GS2.
If you use a different one... it probably won't work. At least this has been my experience. So if you get an "Installation Aborted" error... this is probably why.
Next we need to write an updater-script in your favorite txt editor. (Forget about the old, BS, "update-script" that was written in Amend. New scripts for new phones have to be written in Edify. I have no idea what Edify is... but Wikipedia does... and at the very least I know how to use it.)
We are going to make a simple update.zip that mounts /system, says some stuff, and then unmounts system. Beyond that it doesn't do a thing. So if you get cute and decide to "format" instead of "mount" system... or something crazy... then good luck to you, Sir.
Code:
[B]ui_print(" ");
ui_print(" ");
ui_print(" ");
ui_print(" ********************************* ");
ui_print(" * - XDA TeamRainless is AWESOME - * ");
ui_print(" * * ");
ui_print(" * * ");
ui_print(" ********************************* ");
ui_print(" ");
run_program("/sbin/busybox", "mount", "/system");
run_program("/sbin/busybox", "mount", "/data");
ui_print("Testing...");
ui_print("You might lose that girl's number now...");
ui_print("I'm DEAD serious... I'm erasing ONE number...");
ui_print("THAT girl's...");
ui_print("Ok. I'm not REALLY serious...");
run_program("/sbin/busybox", "umount", "/system");
run_program("/sbin/busybox", "umount", "/data");
ui_print("Done...");
[/B]
As I said before, this code will do absolutely nothing but mount /system, print some text, and then unmount it. There's no file extraction, or deleting, or permission stuff going on.
Update.zip files have a standardized structure. I'm simply going to copy and paste from this guy http://fokke.org/site/content/howto-create-android-updatezip-package because it's the only part of his damned tutorial that worked.
Code:
[B]update
+-
META-INF/
+- com/
+- google/
+- android/
+- update-binary
+- updater-script
system/
+- your files
[/B]
Here you've got two folders in your root folder (which I have called update): a "META-INF" folder and a "system" folder. The "META-INF" folder MUST be written exactly like that and MUST have all of the subdirectories above. (Note: Windows Users. Do not use "Send to Zip" because you will have "update.zip->Update->META-INF,system" But what you want is "update.zip->META-INF, system.") The "system" folder can be whatever you want. You don't even need a subfolder. You can have a folder called "shoes" and just have all the files you want to extract in "shoes" and make sure your updater-script says that.
Code:
[B]ui_print(" ");
ui_print(" ");
ui_print(" ");
ui_print(" ");
ui_print(" ");
ui_print(" ");
ui_print(" ");
ui_print(" ********************************* ");
ui_print(" * -Team Rainless - * ");
ui_print(" * * ");
ui_print(" * * ");
ui_print(" ********************************* ");
ui_print(" ");
run_program("/sbin/busybox", "mount", "/system");
run_program("/sbin/busybox", "mount", "/data");
ui_print("Writing. Hope this doesn't screw anything up...");
package_extract_dir("shoes", "/system/fonts");
run_program("/sbin/busybox", "umount", "/system");
run_program("/sbin/busybox", "umount", "/data");
ui_print("Done...");
[/B]
(Hmm... ADB'ed into the phone after running this script in Siyah 3.3.1's recovery and it said the "system" directory was erased... BAH that can't possibly be true!... it wasn't. EDIT: figured out what was going on. The last command in the zip unmounts /system... which "unmounts system" which is why I wasn't seeing it in recovery. So I simply went into "mount /system" in recovery then adb saw it just fine. I've been smarter...)
Throwing that command into the middle of updater-script will copy whatever is in the "shoes" directory to the "/system/font" directory on your phone.
Did that screw something up? Maybe wrong permission and you want to delete it but can't get back to root explorer? We'll make another update.zip that can delete it from CWM recovery.
Code:
[B]ui_print(" ");
ui_print(" ");
ui_print(" ");
ui_print(" ");
ui_print(" ");
ui_print(" ");
ui_print(" ");
ui_print(" ********************************* ");
ui_print(" * -Team Rainless - * ");
ui_print(" * * ");
ui_print(" * * ");
ui_print(" ********************************* ");
ui_print(" ");
run_program("/sbin/busybox", "mount", "/system");
run_program("/sbin/busybox", "mount", "/data");
ui_print("Deleting. Who told you to put that there in the first place?...");
delete("/system/fonts/Clockopia2.ttf");
run_program("/sbin/busybox", "umount", "/system");
run_program("/sbin/busybox", "umount", "/data");
ui_print("Done...");[/B]
Mind you... if you copy something to the system/apps directory, for example, that doesn't have the right permissions... you will get a thousand errors and you won't be able to run ANY applications on your phone. But if you know what you copied (kids... you should ALWAYS look inside of a zip file before blindly copying it to your phone) you can just use the delete command to get rid of it.
Now about permissions...
Code:
[B]set_perm(0,0,0644,"/system/whateveritis");[/B]
Nine times out of ten that will do it.
And 9/10 Update.zip tutorials would tell you to have a nice day at this point... but the last and most important thing is that the update.zip file must be SIGNED.
That JERK included a java script that would sign at the command prompt (I don't really hate this guy btw... I'm just from the Midwest. Have you ever seen a Bob Dylan interview? This is just how we talk...). I don't really know if it works or not... because his binary didn't work.
But my preferred method for signing is D4's Update Zip maker. http://forum.xda-developers.com/showthread.php?t=1207492
You go to:
1. File
2. Select Working Directory
3. Choose the directory of your update
And it will actually show the updater-script you just wrote and you can make any changes you need to make.
Hit "Build" and it will give you your signed zip.
It's for PC only... so if you have mac or linux you can try the Java file from the Jerk's page. (I *like* the guy! We're roommates!)
You can also use the program to generate scripts from scratch... but I didn't like HIS tutorial either. (Great program though chief!)
In the end I don't know if this was educational at all. I hope it was at least entertaining. I'd hate to think all this alcohol went to waste.
Looks complicated but I guess I'll try it.
Thanks for the tutorial mate!
Sent from my GT-I9100 using xda premium
beston94 said:
Looks complicated but I guess I'll try it.
Thanks for the tutorial mate!
Sent from my GT-I9100 using xda premium
Click to expand...
Click to collapse
It's EAAAAAAAAAAASY!
We're basically talking about ONE text file. You can even copy the first updater-script I have above EXACTLY and then just replace what you need (and keep the Team Rainless part so everyone knows how awesome I am!)
It's really just that text... and the overly complicated directory system... but you put some files in a directory and you copy and paste some text. Fast and easy.
Now reformated. (damn... double post... how to delete?)
Why do I need to sign my zips? I've never signed them, i organize the folders, then I ZIP it with 7ZIP with ultra mode. Never had a single problem without singing them.
marcellocord said:
Why do I need to sign my zips? I've never signed them, i organize the folders, then I ZIP it with 7ZIP with ultra mode. Never had a single problem without singing them.
Click to expand...
Click to collapse
I've got a better question:
Why do you zip your folders with 7-zip in "Ultra Mode"?
I mean... this is for a phone right? Or are you talking about gigantic roms or something like that?
CERT.RSA, CERT.SF, and Manifest.MF are all created by the signing process.
And here's an explanation:
http://forum.xda-developers.com/showpost.php?p=23321270&postcount=16
Default recovery requires a signed zip. CWM will take anything.
But since it takes less than a second to sign a zip why not just sign it so it'll work on both?
TeamRainless said:
I've got a better question:
Why do you zip your folders with 7-zip in "Ultra Mode"?
I mean... this is for a phone right? Or are you talking about gigantic roms or something like that?
CERT.RSA, CERT.SF, and Manifest.MF are all created by the signing process.
And here's an explanation:
http://forum.xda-developers.com/showpost.php?p=23321270&postcount=16
Default recovery requires a signed zip. CWM will take anything.
But since it takes less than a second to sign a zip why not just sign it so it'll work on both?
Click to expand...
Click to collapse
Some ROMs i've edited I've always deleted those cert.rsa, blah blah. I zipped my zips in ultra mode to compact it to the max. I can reduce one 300MB ROM to 180MB. CWM doesn't require that the zip is signed unless you toogle signature verification, which is disabled by default. And in this post he's saying that only stock recovery needs. On CWM you don't, at least I've never had to sign them...
marcellocord said:
Some ROMs i've edited I've always deleted those cert.rsa, blah blah. I zipped my zips in ultra mode to compact it to the max. I can reduce one 300MB ROM to 180MB. CWM doesn't require that the zip is signed unless you toogle signature verification, which is disabled by default. And in this post he's saying that only stock recovery needs. On CWM you don't, at least I've never had to sign them...
Click to expand...
Click to collapse
Exactly what I said.
If it's just for you, and you're only using CWM, then you don't need to sign. But if there's a chance you're releasing something to the masses, then it makes sense to sign because somebody might not be rooted.
Added a note about signing not being necessary in CWM.
Any idea why D4's Update Zip maker won't launch?
I tried in win 7 and XP, no chance
Java is installed. When I launch, nothing happens at all
figured it out, bye
update-binary
Nice tutorial, but how to create the update-binary which is specific to a device(which you havent mentioned).You have SII, but mine is another tablet(iBall 3G 7271 HD7).How can I create it for that?? Please help!
TeamRainless said:
YOU NEED TO KNOW HOW TO DO THIS.
It's like changing a flat tire... a skill you never really need until it's far too late for you to learn how to do it because now you're stuck in Compton on a Saturday night... Better to learn NOW.
June 11th, 2012 (If you're reading much later you might want to check and see if Google has changed everything again.)
For starters: I'm writing this guide because ALL of the other guides for making an update.zip suck. Most of them follow the pattern of "Create a file called 'updater-script', write some stuff in it... and you're done!"
I happily nuked my Galaxy S II 20 times... including accidentally erasing my internal SD trying to figure out which "some stuff" I was supposed to write.
That said... creating an update.zip isn't as easy as all the smart-asses would have you believe it is... but it isn't as hard as YOU think it is either. I'm going to show you how to do it in three steps:
1. update-binary - a file that I'm giving you.
2. updater-script - a text file so simple to write you can do it in notepad in under 60 seconds
3. signing tool - I provide the link for one below but you can use whatever you want. Takes less than a second. (Note: Only standard bootloader Update.zips need to be signed. CWM zips don't. Still it's a good practice and... like I said it takes less than a second to do.)
WARNING: Screwing up an Update.zip can, at the very least, force you to do a factory reset and a clean wipe. And... at worst brick your phone.
Now... that said, if you follow these instructions CAREFULLY... there is very little chance of that.
Now the very first thing you're going to need is the correct update-binary for your phone. I have included the one for the GS2.
If you use a different one... it probably won't work. At least this has been my experience. So if you get an "Installation Aborted" error... this is probably why.
Next we need to write an updater-script in your favorite txt editor. (Forget about the old, BS, "update-script" that was written in Amend. New scripts for new phones have to be written in Edify. I have no idea what Edify is... but Wikipedia does... and at the very least I know how to use it.)
We are going to make a simple update.zip that mounts /system, says some stuff, and then unmounts system. Beyond that it doesn't do a thing. So if you get cute and decide to "format" instead of "mount" system... or something crazy... then good luck to you, Sir.
Code:
[B]ui_print(" ");
ui_print(" ");
ui_print(" ");
ui_print(" ********************************* ");
ui_print(" * - XDA TeamRainless is AWESOME - * ");
ui_print(" * * ");
ui_print(" * * ");
ui_print(" ********************************* ");
ui_print(" ");
run_program("/sbin/busybox", "mount", "/system");
run_program("/sbin/busybox", "mount", "/data");
ui_print("Testing...");
ui_print("You might lose that girl's number now...");
ui_print("I'm DEAD serious... I'm erasing ONE number...");
ui_print("THAT girl's...");
ui_print("Ok. I'm not REALLY serious...");
run_program("/sbin/busybox", "umount", "/system");
run_program("/sbin/busybox", "umount", "/data");
ui_print("Done...");
[/B]
As I said before, this code will do absolutely nothing but mount /system, print some text, and then unmount it. There's no file extraction, or deleting, or permission stuff going on.
Update.zip files have a standardized structure. I'm simply going to copy and paste from this guy http://fokke.org/site/content/howto-create-android-updatezip-package because it's the only part of his damned tutorial that worked.
Code:
[B]update
+-
META-INF/
+- com/
+- google/
+- android/
+- update-binary
+- updater-script
system/
+- your files
[/B]
Here you've got two folders in your root folder (which I have called update): a "META-INF" folder and a "system" folder. The "META-INF" folder MUST be written exactly like that and MUST have all of the subdirectories above. (Note: Windows Users. Do not use "Send to Zip" because you will have "update.zip->Update->META-INF,system" But what you want is "update.zip->META-INF, system.") The "system" folder can be whatever you want. You don't even need a subfolder. You can have a folder called "shoes" and just have all the files you want to extract in "shoes" and make sure your updater-script says that.
Code:
[B]ui_print(" ");
ui_print(" ");
ui_print(" ");
ui_print(" ");
ui_print(" ");
ui_print(" ");
ui_print(" ");
ui_print(" ********************************* ");
ui_print(" * -Team Rainless - * ");
ui_print(" * * ");
ui_print(" * * ");
ui_print(" ********************************* ");
ui_print(" ");
run_program("/sbin/busybox", "mount", "/system");
run_program("/sbin/busybox", "mount", "/data");
ui_print("Writing. Hope this doesn't screw anything up...");
package_extract_dir("shoes", "/system/fonts");
run_program("/sbin/busybox", "umount", "/system");
run_program("/sbin/busybox", "umount", "/data");
ui_print("Done...");
[/B]
(Hmm... ADB'ed into the phone after running this script in Siyah 3.3.1's recovery and it said the "system" directory was erased... BAH that can't possibly be true!... it wasn't. EDIT: figured out what was going on. The last command in the zip unmounts /system... which "unmounts system" which is why I wasn't seeing it in recovery. So I simply went into "mount /system" in recovery then adb saw it just fine. I've been smarter...)
Throwing that command into the middle of updater-script will copy whatever is in the "shoes" directory to the "/system/font" directory on your phone.
Did that screw something up? Maybe wrong permission and you want to delete it but can't get back to root explorer? We'll make another update.zip that can delete it from CWM recovery.
Code:
[B]ui_print(" ");
ui_print(" ");
ui_print(" ");
ui_print(" ");
ui_print(" ");
ui_print(" ");
ui_print(" ");
ui_print(" ********************************* ");
ui_print(" * -Team Rainless - * ");
ui_print(" * * ");
ui_print(" * * ");
ui_print(" ********************************* ");
ui_print(" ");
run_program("/sbin/busybox", "mount", "/system");
run_program("/sbin/busybox", "mount", "/data");
ui_print("Deleting. Who told you to put that there in the first place?...");
delete("/system/fonts/Clockopia2.ttf");
run_program("/sbin/busybox", "umount", "/system");
run_program("/sbin/busybox", "umount", "/data");
ui_print("Done...");[/B]
Mind you... if you copy something to the system/apps directory, for example, that doesn't have the right permissions... you will get a thousand errors and you won't be able to run ANY applications on your phone. But if you know what you copied (kids... you should ALWAYS look inside of a zip file before blindly copying it to your phone) you can just use the delete command to get rid of it.
Now about permissions...
Code:
[B]set_perm(0,0,0644,"/system/whateveritis");[/B]
Nine times out of ten that will do it.
And 9/10 Update.zip tutorials would tell you to have a nice day at this point... but the last and most important thing is that the update.zip file must be SIGNED.
That JERK included a java script that would sign at the command prompt (I don't really hate this guy btw... I'm just from the Midwest. Have you ever seen a Bob Dylan interview? This is just how we talk...). I don't really know if it works or not... because his binary didn't work.
But my preferred method for signing is D4's Update Zip maker. http://forum.xda-developers.com/showthread.php?t=1207492
You go to:
1. File
2. Select Working Directory
3. Choose the directory of your update
And it will actually show the updater-script you just wrote and you can make any changes you need to make.
Hit "Build" and it will give you your signed zip.
It's for PC only... so if you have mac or linux you can try the Java file from the Jerk's page. (I *like* the guy! We're roommates!)
You can also use the program to generate scripts from scratch... but I didn't like HIS tutorial either. (Great program though chief!)
In the end I don't know if this was educational at all. I hope it was at least entertaining. I'd hate to think all this alcohol went to waste.
Click to expand...
Click to collapse
Hi Guys, for starters I have a CM7 Mirage-kang Build for NC, now been having some issues with Superuser lately and found out that it has problems with the SU Binary, so I went to their website and downloaded the SU Binary Flashables from 3.0.3.2 to the latest 3.1.1 and went ahead and checked the zips before flashing.
While checking the updater script of SU Binary I found out that it puts the SU Binary into "/system/bin" rather that "/system/xbin". So went ahead and edited the Flashable in order for the SU Binary to be put into "/system/xbin".
Now question is do I still need to do a symlink from "/system/xbin" to "/system/bin" for CM7? Because I'm not sure how CM handles App request for the Su Binary.
Posted here is the original and my edited updater script of Su Binary 3.0.3.2.
Original Code:
Code:
ui_print("***********************************************");
ui_print(" su binary 3.0.3.2 for Android 2.0-3.2");
ui_print("***********************************************");
show_progress(1.000000, 0);
ui_print(" Mounting SYSTEM...");
run_program("/sbin/busybox", "mount", "/system");
set_progress(0.100000);
ui_print(" Deleting SYSTEM:bin/su...");
delete("/system/bin/su");
set_progress(0.200000);
ui_print(" Deleting SYSTEM:xbin/su...");
delete("/system/xbin/su");
set_progress(0.300000);
ui_print(" Extracting files to SYSTEM...");
package_extract_dir("system", "/system");
set_progress(0.400000);
ui_print(" Setting SYSTEM:bin/su permissions to 06755...");
set_perm(0, 0, 06755, "/system/bin/su");
set_progress(0.500000);
ui_print(" Creating SYSTEM:xbin/su symbolic link...");
symlink("/system/bin/su", "/system/xbin/su");
set_progress(0.600000);
ui_print(" Unmounting SYSTEM...");
unmount("/system");
set_progress(0.900000);
ui_print("Install complete. Enjoy!");
set_progress(1.000000);
Edited Code:
Code:
ui_print("***********************************************");
ui_print(" su binary 3.0.3.2 for Android 2.0-3.2");
ui_print("***********************************************");
show_progress(1.000000, 0);
ui_print(" Mounting SYSTEM...");
run_program("/sbin/busybox", "mount", "/system");
set_progress(0.100000);
ui_print(" Deleting SYSTEM:bin/su...");
delete("/system/bin/su");
set_progress(0.200000);
ui_print(" Deleting SYSTEM:xbin/su...");
delete("/system/xbin/su");
set_progress(0.300000);
ui_print(" Extracting files to SYSTEM...");
package_extract_dir("system", "/system");
set_progress(0.400000);
ui_print(" Setting SYSTEM:xbin/su permissions to 06755...");
set_perm(0, 0, 06755, "/system/xbin/su");
set_progress(0.500000);
ui_print(" Creating SYSTEM:bin/su symbolic link...");
symlink("/system/xbin/su", "/system/bin/su");
set_progress(0.600000);
ui_print(" Unmounting SYSTEM...");
unmount("/system");
set_progress(0.900000);
ui_print("Install complete. Enjoy!");
set_progress(1.000000);
Credit:
Thanks to ChainsDD for providg FAQs and Flashable Zips for SU Binaries.
UPDATE
Turns out CM7 doesn't have symlinks for SU Binary in "/system/bin/" so don't need one.
Hi everyone,
I've created my own update.zip but I have a problem in the updater-script... After flashing the zip in the recovery, it erase my internal storage and I don't know where this problem come from..
Here is my code :
Code:
ifelse(getprop(ro.product.model)=="Nexus 4",ui_print("You have a Nexus 4... Script is continue..."),(ui_print("You haven't got a Nexus 4 ! Wipe aborted");abort()));
mount("ext4", "EMMC", "/dev/block/mmcblk0p22", "/cache");
mount("ext4", "EMMC", "/dev/block/mmcblk0p23", "/data");
mount("ext4", "EMMC", "/dev/block/mmcblk0p21", "/system");
ui_print(" ");
ui_print(" ");
ui_print(" ");
ui_print("Wiping Dalvik cache");
ui_print(" ");
delete_recursive("/data/dalvik-cache");
ui_print(" ");
ui_print("Dalvik cache wiped succesfully");
ui_print(" ");
ui_print(" ");
ui_print("Removing Media databases");
ui_print(" ");
delete_recursive("/dbdata/databases/com.android.providers.media");
delete_recursive("/dbdata/databases/com.cooliris.media");
ui_print(" ");
ui_print("Wiping cache");
ui_print(" ");
delete_recursive("/cache");
ui_print(" ");
ui_print("Cache wiped succesfully");
ui_print(" ");
ui_print(" ");
ui_print("Wiping data/factory reset");
ui_print(" ");
delete_recursive("/data");
delete_recursive("/cache");
delete_recursive("/sd-ext");
delete_recursive("/sdcard/.android_secure");
ui_print(" ");
ui_print("Data wiped succesfully");
ui_print(" ");
ui_print(" ");
ui_print("Removing system files from SD Card");
ui_print(" ");
delete_recursive("/sdcard/.data/footprints");
delete_recursive("/sdcard/.bookmark_thumb1");
delete_recursive("/sdcard/.data/mail");
delete_recursive("/sdcard/Android/data/com.google.android.apps.genie.geniewidget.news-content-cache");
delete_recursive("/sdcard/Android/data/com.android.providers.media");
delete_recursive("/sdcard/Android/data/com.google.android.apps.maps");
delete_recursive("/sdcard/.data/navigator/Data/Temporary");
delete_recursive("/sdcard/LazyList");
delete_recursive("/sdcard/LOST.DIR");
ui_print(" ");
ui_print("System files from SD Card removed");
Does somebody have an idea where this problem come from please ?
Thanks
UgoBoss said:
Hi everyone,
I've created my own update.zip but I have a problem in the updater-script... After flashing the zip in the recovery, it erase my internal storage and I don't know where this problem come from..
Here is my code :
Code:
ifelse(getprop(ro.product.model)=="Nexus 4",ui_print("You have a Nexus 4... Script is continue..."),(ui_print("You haven't got a Nexus 4 ! Wipe aborted");abort()));
mount("ext4", "EMMC", "/dev/block/mmcblk0p22", "/cache");
mount("ext4", "EMMC", "/dev/block/mmcblk0p23", "/data");
mount("ext4", "EMMC", "/dev/block/mmcblk0p21", "/system");
ui_print(" ");
ui_print(" ");
ui_print(" ");
ui_print("Wiping Dalvik cache");
ui_print(" ");
delete_recursive("/data/dalvik-cache");
ui_print(" ");
ui_print("Dalvik cache wiped succesfully");
ui_print(" ");
ui_print(" ");
ui_print("Removing Media databases");
ui_print(" ");
delete_recursive("/dbdata/databases/com.android.providers.media");
delete_recursive("/dbdata/databases/com.cooliris.media");
ui_print(" ");
ui_print("Wiping cache");
ui_print(" ");
delete_recursive("/cache");
ui_print(" ");
ui_print("Cache wiped succesfully");
ui_print(" ");
ui_print(" ");
ui_print("Wiping data/factory reset");
ui_print(" ");
delete_recursive("/data");
delete_recursive("/cache");
delete_recursive("/sd-ext");
delete_recursive("/sdcard/.android_secure");
ui_print(" ");
ui_print("Data wiped succesfully");
ui_print(" ");
ui_print(" ");
ui_print("Removing system files from SD Card");
ui_print(" ");
delete_recursive("/sdcard/.data/footprints");
delete_recursive("/sdcard/.bookmark_thumb1");
delete_recursive("/sdcard/.data/mail");
delete_recursive("/sdcard/Android/data/com.google.android.apps.genie.geniewidget.news-content-cache");
delete_recursive("/sdcard/Android/data/com.android.providers.media");
delete_recursive("/sdcard/Android/data/com.google.android.apps.maps");
delete_recursive("/sdcard/.data/navigator/Data/Temporary");
delete_recursive("/sdcard/LazyList");
delete_recursive("/sdcard/LOST.DIR");
ui_print(" ");
ui_print("System files from SD Card removed");
Does somebody have an idea where this problem come from please ?
Thanks
Click to expand...
Click to collapse
Hi,
Maybe try to remove all the sdcard content script It wipes all your internal storage??? I think no, just the files in folders that following the path /sdcard/*****
Where does this script? what do you want to flash?
EDIT: what do you mean exactly by "internal storage" ?, because your script makes a full wipe, so it's normal...
viking37 said:
Hi,
Maybe try to remove all the sdcard content script It wipes all your internal storage??? I think no, just the files in folders that following the path /sdcard/*****
Where does this script? what do you want to flash?
EDIT: what do you mean exactly by "internal storage" ?, because your script makes a full wipe, so it's normal...
Click to expand...
Click to collapse
By "internal storage" I mean all the content of /sdcard /0, all my data.
With this script I just want to do wipe dalvik cache, cache and /data.
What do you mean by "your script makes a full wipe, so it's normal..." ? I don't want this, I don't see where I wrote in the script to wipe the content of my internal storage, of my sdcard...
Thank's for replying
Re: Updater-script problem
Here is your culprit:
Code:
delete_recursive("/data");
Internal storage resides in /data/. Try specifying the folders you want deleted?
estallings15 said:
Here is your culprit:
Code:
delete_recursive("/data");
Internal storage resides in /data/. Try specifying the folders you want deleted?
Click to expand...
Click to collapse
That's weird because in the recovery when I do wide data/factory reset it does a formating /data, but I have always my internal storage..
I want to do, in the updater-script, a factory reset like the recovery does when we do wipe data/factory reset, this isn't possible ?
Re: Updater-script problem
UgoBoss said:
That's weird because in the recovery when I do wide data/factory reset it does a formating /data, but I have always my internal storage..
I want to do, in the updater-script, a factory reset like the recovery does when we do wipe data/factory reset, this isn't possible ?
Click to expand...
Click to collapse
Ever used the wipe or format data option? It wipes ALL internal memory. As I said, if you can't find another method you can individually list all the folders and use the delete_recursive command for each. Alternatively, you could package ...Awesome...'s wipe script and just have a line to run the script at the beginning of your updater.script. His script is very thorough. Obviously, of you wanted to release whatever you're working on you would want to give him credit.
You may also check it for reference to see how he wipes data without wiping the internal "SD."
estallings15 said:
Ever used the wipe or format data option? It wipes ALL internal memory. As I said, if you can't find another method you can individually list all the folders and use the delete_recursive command for each. Alternatively, you could package ...Awesome...'s wipe script and just have a line to run the script at the beginning of your updater.script. His script is very thorough. Obviously, of you wanted to release whatever you're working on you would want to give him credit.
You may also check it for reference to see how he wipes data without wiping the internal "SD."
Click to expand...
Click to collapse
Thank's man ! I will look closer to that
EDIT : I found, I was deleting /data but in /data ther is a floder /media wich contain the folder /0 and this folder is the internal storage ! So I delete everything that's in /data exept /media
UgoBoss said:
Thank's man ! I will look closer to that
EDIT : I found, I was deleting /data but in /data ther is a floder /media wich contain the folder /0 and this folder is the internal storage ! So I delete everything that's in /data exept /media
Click to expand...
Click to collapse
Exactly.
How about saving data via updater script?
Is there a way to save data via updater script without using a thirdparty app?
UgoBoss said:
Thank's man ! I will look closer to that
EDIT : I found, I was deleting /data but in /data ther is a floder /media wich contain the folder /0 and this folder is the internal storage ! So I delete everything that's in /data exept /media
Click to expand...
Click to collapse
i know this was old but how do u write it updater script?