Help: Busybox updater script - T-Mobile, Samsung Galaxy SIII

Hey guys.
Ive been making recovery zips ever since my HD2 days. But recently, they haven't been working. I usually would mount things like /system and /data with the updater-script mount but have started using busybox. Well i was successfull in using it, but now when i wanted to edit the zip to change the contents it doesnt apply the update. Like for instance, the second i open up an updater-zip using 7-Zip, it doesnt install anything. no errors come up but nothing gets installed. Like my modded market zip, if i open it up and replace it with say the stock market, then flash it. Nothing gets coppied. No system files are changed. Do i need to mount as rw in my updater script? I'll give that a try but i never recall having to have that. Or am i missing a simple annoying step? I never zipalign or sign them as i never recall ever having to. Well im up for any ideas. Thanks XDA

It's impossible to troubleshoot without seeing the file, but maybe this can help you? This is taken from my Superuser zip. If it doesn't help you, I need to see your script.
Code:
ui_print("");
ui_print("Superuser 3.2");
ui_print("Mounting /system...");
run_program("/sbin/busybox", "mount", "/system");
ui_print("Mounting /data...");
run_program("/sbin/busybox", "mount", "/data");
ui_print("Removing old root access...");
delete("/system/bin/su");
delete("/system/xbin/su");
ui_print("Removing old superuser apps...");
delete("/system/app/Superuser.apk");
delete_recursive("/data/data/com.noshufou.android.su");
delete_recursive("/data/data/com.noshufou.android.su.elite");
delete("/system/app/eu.chainfire.supersu-1.apk");
delete("/data/eu.chainfire.supersu-1.apk");
delete_recursive("/data/data/eu.chainfire.supersu");
delete_recursive("/data/data/eu.chainfire.supersu.pro");
ui_print("Extracting archive...");
package_extract_dir("system", "/system");
ui_print("Setting permissions...");
set_perm(0, 0, 06755, "/system/xbin/su");
set_perm(0, 0, 0644, "/system/app/Superuser.apk");
ui_print("Unmounting /data...");
run_program("/sbin/busybox", "umount", "/data");
ui_print("Unmounting /system...");
run_program("/sbin/busybox", "umount", "/system");

I thought i attached it -.- sorry lol.
But here it is. its quite simple.
Code:
run_program("/sbin/busybox", "mount", "/system");
package_extract_dir("system", "/system");
unmount("/system");
This has never failed before

elesbb said:
I thought i attached it -.- sorry lol.
But here it is. its quite simple.
Code:
run_program("/sbin/busybox", "mount", "/system");
package_extract_dir("system", "/system");
unmount("/system");
This has never failed before
Click to expand...
Click to collapse
Which update-binary are you using? Did you change it recently? Are you using TWRP? If you mount with busybox, why don't you unmount with it?

Aerowinder said:
Which update-binary are you using? Did you change it recently? Are you using TWRP? If you mount with busybox, why don't you unmount with it?
Click to expand...
Click to collapse
Never had to. Im lazy so typing unmount("/system"); is easier. And no i am using the one ive always used never changed it.

elesbb said:
Never had to. Im lazy so typing unmount("/system"); is easier. And no i am using the one ive always used never changed it.
Click to expand...
Click to collapse
The new TWRP update requires an updated binary, I thought? I read that on their website. And I seem to recall you using TWRP?
If you go back to using the old mount commands for the system partition, does it work?

Aerowinder said:
The new TWRP update requires an updated binary, I thought? I read that on their website. And I seem to recall you using TWRP?
If you go back to using the old mount commands for the system partition, does it work?
Click to expand...
Click to collapse
Oh no I use cwm.
Sent from my SGH-T999 using Tapatalk 2

elesbb said:
And I didn't try the old method of mounting so I'm not sure.. But I think there was something wrong with the structure of the zip file because manually mounting system didn't work either.
Sent from my SGH-T999 using Tapatalk 2
Click to expand...
Click to collapse

The zip isn't being extracted at all?
It would be wise to use this command, I think: set_perm_recursive(0, 0, 0755, 0644, "/system/app"); after you extract.
If that doesn't work, direct me to the app you are building the zip file from, and I will test it.
Edit: what are your 7zip settings?

Aerowinder said:
The zip isn't being extracted at all?
It would be wise to use this command, I think: set_perm_recursive(0, 0, 0755, 0644, "/system/app"); after you extract.
If that doesn't work, direct me to the app you are building the zip file from, and I will test it.
Edit: what are your 7zip settings?
Click to expand...
Click to collapse
7 zip settings are stock. And I managed to get it working by using another zip and copying the updater-script into that zip as well as moving the files. And I have a separate zip that sets my permissions. I created that after manually trying to replace framework-Res.apk which made it reboot before I could change permission :3
Sent from my SGH-T999 using Tapatalk 2

Default settings worked for me: normal compression level with deflate compression. Glad you got it fixed.

Aerowinder said:
Default settings worked for me: normal compression level with deflate compression. Glad you got it fixed.
Click to expand...
Click to collapse
Yes but I'd like to know what borked it -.-
Sent from my SGH-T999 using Tapatalk 2

Related

[WIP] Xoom Update Script

In the IRC channel, bigrushdog and myself have created an update script for the xoom. Its a WIP, but we have used it to install themes, apps, and even the current tiamat kernel. Just put the files/folders into the /data or /system folders inside the zip. Flash in recovery. Thanks to bigrushdog we now have a script that does not require busybox. This one will wipe cache and push whatever you put in data or system.
Wipes Cache and Dalvik Cache
Awesome, thanks!
Sorry but what can I do with this
Sent from my Xoom using XDA App
ui_print("This is a generic Xoom Recovery Flasher");
ui_print("Developed by BWCorvus");
ui_print(" ");
run_program("/sbin/busybox", "mount", "/data");
ui_print("Wiping Cache and Dalvik Cache in case you forgot.. ");
format("MTD", "cache");
delete_recursive("/data/dalvik-cache/");
delete_recursive("/data/boot-cache/");
ui_print("Extracting Data Files...");
package_extract_dir("data", "/data");
run_program("/sbin/busybox", "umount", "/data");
ui_print("Extracting System Files...");
show_progress(0.1, 0);
run_program("/sbin/busybox", "mount", "/system");
package_extract_dir("system", "/system");
show_progress(0.1, 10);
show_progress(0.2, 0);
show_progress(0.2, 10);
run_program("/sbin/busybox", "umount", "/system");
ui_print("All done. Enjoy!");
Click to expand...
Click to collapse
Suggest adding the bolded just for convenience..
This would DEF help those who are not ADB savvy, cool!
fsunoles157 said:
Sorry but what can I do with this
Sent from my Xoom using XDA App
Click to expand...
Click to collapse
Basically this allows you to flash files, instead of pushing them. Good for kernels, themes, apps and one day roms.
do i just flash this zip in recovery? and then what?
fsunoles157 said:
do i just flash this zip in recovery? and then what?
Click to expand...
Click to collapse
You add the files you want to flash, like say BIGDX theme files (framework and bootanimation). Then you flash this in recovery, and it will install the files, over writing the originals. You just need to make sure you put it in the right directory.
sorry and what directory would that be? trying to learn here and if i get you right i will be adding files to this zip?
bwcorvus said:
You add the files you want to flash, like say BIGDX theme files (framework and bootanimation). Then you flash this in recovery, and it will install the files, over writing the originals. You just need to make sure you put it in the right directory.
Click to expand...
Click to collapse
fsunoles157 said:
sorry and what directory would that be? trying to learn here and if i get you right i will be adding files to this zip?
Click to expand...
Click to collapse
Well it would depend on where you want the file to go, that is the directory you put it in. Yes inside the zip. Best thing i can do, is if you wanna pop by the irc channel #xoom on freenode, i could walk you through one.
ok definately how do i get there? i just use xoomforums and xda :-/
bwcorvus said:
Well it would depend on where you want the file to go, that is the directory you put it in. Yes inside the zip. Best thing i can do, is if you wanna pop by the irc channel #xoom on freenode, i could walk you through one.
Click to expand...
Click to collapse
I guess this refer to:
http://webchat.freenode.net/
where it's self explanatory?
bwcorvus said:
In the IRC channel, bigrushdog and myself have created an update script for the xoom. Its a WIP, but we have used it to install themes, apps, and even the current tiamat kernel. Just put the files/folders into the /data or /system folders inside the zip. Flash in recovery. For this to work, you MUST have busybox installed on the xoom.
Original
Added stiffspliff data wipes
Click to expand...
Click to collapse
which zip should we be using? Is the only difference is that the wipe.zip will erase the original file during the flash process? So I need to place an apk file into the system folder within the update.zip to get it to flash.
TheBurgh said:
which zip should we be using? Is the only difference is that the wipe.zip will erase the original file during the flash process? So I need to place an apk file into the system folder within the update.zip to get it to flash.
Click to expand...
Click to collapse
The wipe just has cache wipes, so you can use either. I'll edit it when I get home.
Sent from my PC36100
bwcorvus said:
The wipe just has cache wipes, so you can use either. I'll edit it when I get home.
Sent from my PC36100
Click to expand...
Click to collapse
just copy files/folders you want to install to the correct folders in the update.zip and flash?
TheBurgh said:
just copy files/folders you want to install to the correct folders in the update.zip and flash?
Click to expand...
Click to collapse
That's it man.
Sent from my PC36100
bwcorvus said:
That's it man.
Sent from my PC36100
Click to expand...
Click to collapse
Give it a shot. Thanks
Bump for update
so if your file is within a subfolder in system would you make the same subfolder in the update script (in the appropriate folder of course)? My guess is yes.
EDIT
Yes I got it. But what is the best way to zip it back up. I used winzip and my first try caused the install to abort? The 2nd time I tried it I just moved stuff around in the original update script using winrar and it worked. My guess is winzip f'd it up somehow.
Thanks
kev0153 said:
so if your file is within a subfolder in system would you make the same subfolder in the update script (in the appropriate folder of course)? My guess is yes.
EDIT
Yes I got it. But what is the best way to zip it back up. I used winzip and my first try caused the install to abort? The 2nd time I tried it I just moved stuff around in the original update script using winrar and it worked. My guess is winzip f'd it up somehow.
Thanks
Click to expand...
Click to collapse
I usually just add stuff to the zip. Never actually unzip it. Do not try to rename stuff inside the zip though, always makes it fail.
Sent From My Evo

[Q] [Help] CWR Updater-script ( Error 6 )

Okay so Im trying to write a update script to bring my phone from a stock rom / custom rom and remove carrier / system bloatware and unwanted apps and install some apps from the .zip this file comes from and then run a permissions fix.
I can get the system to remove the bloatware and install the apps i tell it to, but the second i add in the fix permissions script, I get an error in CWR ( error 6 ), i know this is to do with the encoding into UNEX but im using NOTEPAD in windows & Jedit and saving them in a UNEX friendly format.
Every time i get a error 6 no matter how i encode the raw file. . . any ideas do i have some formatting wrong in my code ?
ui_print("**************************************************************");
show_progress(0.800000, 0);
mount("ext4", "EMMC", "/dev/block/mmcblk0p9", "/system");
ui_print("Extracting /system");
package_extract_dir("system", "/system");
ui_print("Setting Permissions");
set_perm_recursive(0, 0, 0755, 0644, "/system/app")
;
mount("ext4", "EMMC", "/dev/block/mmcblk0p9", "/system");
mount("ext4", "EMMC", "/dev/block/mmcblk0p7", "/cache");
mount("ext4", "EMMC", "/dev/block/mmcblk0p10", "/data");
ui_print("Deleting Bloatware");
delete("/system/app/Zinio.apk");
delete("/system/app/Stk.apk");
delete("/system/app/SocialHub.apk");
delete("/system/app/SnsProvider.apk");
delete("/system/app/SnsDisclaimer.apk");
delete("/system/app/SnsAccountTw.apk");
delete("/system/app/SnsAccountMs.apk");
delete("/system/app/SnsAccountLi.apk");
delete("/system/app/syncmldm.apk");
delete("/system/app/SecretWallpaper1.apk");
delete("/system/app/SecretWallpaper2.apk");
delete("/system/app/SamsungWidget_WeatherClock.apk");
delete("/system/app/SamsungWidget_News.apk");
delete("/system/app/SamsungApps.apk");
delete("/system/app/ReadersHub.apk");
delete("/system/app/PressReader.apk");
delete("/system/app/Kobo.apk");
delete("/system/app/GenieWidget.apk");
delete("/system/app/FTM.apk");
delete("/system/app/FTS.apk");
delete("/system/app/Dlna.apk");
delete("/system/app/Days.apk");
delete("/system/app/SamsungWidget_News.apk");
delete("/system/app/Emailwidget.apk");
delete("/system/app/Emailwidget.odex");
ui_print("Installed Samsung Apps & Removed Un-wanted apps from /system/app");
run_program("/sbin/mount", "/dev/block/stl9", "/system");
ui_print("Running Script...");
package_extract_dir("system", "/system");
ui_print("Fixing Permissions");
ui_print("3");
ui_print("2");
ui_print("1");
set_perm(0, 0, 0755, "/system/bin/fix_permissions");
Click to expand...
Click to collapse
I can provide the whole .zip if needed
Thanks
at times when u edit the file it does save in the unix\linux format..
what editor are you using..
try using notepad++
open the original unmodified file in notepad++ and the modify and save it in that..
should work
xinfinityoO said:
at times when u edit the file it does save in the unix\linux format..
what editor are you using..
try using notepad++
open the original unmodified file in notepad++ and the modify and save it in that..
should work
Click to expand...
Click to collapse
Im using "JEdit"
[EDIT] whats the best file format to save it as in notepad++ ? i tried unex and all files (*.*) pure unex game me status 4 error and *.* gives me error 6 again, any ideas ?
I have uploaded the full .Zip if someone could test to see if it works for them ?
hutzdani said:
Im using "JEdit"
[EDIT] whats the best file format to save it as in notepad++ ? i tried unex and all files (*.*) pure unex game me status 4 error and *.* gives me error 6 again, any ideas ?
I have uploaded the full .Zip if someone could test to see if it works for them ?
Click to expand...
Click to collapse
i never changed the file format..
just find a script from one of the mods etc.. modify it in notepad++ and just click save.. dont choose any file formats..well it worked for me..
best of luck
Problem
Please Delete
Hi,
You can generate a remove and restore script here:
http://forum.xda-developers.com/showthread.php?t=1308447
You can use it as an example

Update.zip problem

Hi folks, can anyone enlighten me as to why, when i create an update.zip and flash it, the script installs everything it should except for anything in the "lib" folder. The app then obviously force closes due to no library file. It's doing my head in!
How do u create the update.zip ? Without some more details about the script itself we cant help u. It can be many errors or mistakes. Post the script and maybe we can help u!
Hazou
Thanks for reply, this is the script. It works, but as i said it never puts the lib folder in.
ui_print("-------------------------------------");
ui_print(" Script generated by App2zip");
ui_print("-------------------------------------");
ui_print(" Start Update");
ui_print(" Mounting filesystem");
run_program("/sbin/busybox", "mount", "/system");
run_program("/sbin/busybox", "mount", "/cache");
run_program("/sbin/busybox", "mount", "/data");
ui_print(" Restoring applications");
ui_print(" please wait...");
package_extract_dir("data", "/data");
set_perm(1000, 1000, 0644, "/data/data/com.viber.voip.apk");
set_perm_recursive(1000, 1000, 0777, 0777, "/data/data/com.viber.voip");
delete("/data/dalvik-cache/[email protected]@[email protected]@classes.dex");
run_program("/sbin/busybox", "umount", "/system");
run_program("/sbin/busybox", "umount", "/cache");
run_program("/sbin/busybox", "umount", "/data");
ui_print(" Update complete");
ui_print("-------------------------------------");
package_extract_dir("data", "/data"); set_perm(1000, 1000, 0644, "/data/data/com.viber.voip.apk"); set_perm_recursive(1000, 1000, 0777, 0777, "/data/data/com.viber.voip"); delete("/data/dalvik-cache/[email protected]@[email protected]@classes.dex");
I don't think there is anything telling the script to extract the system files from the zip, i think there should be a similar line to these but for system instead of data.......
Sent from my GT-I9100 using xda premium
Thanks scratch, I'll give it a whirl and see what happens.
yep Scratch is right. U need to add this:
package_extract_dir("system", "/system");
set_perm(0, 0, 0644, "/system/lib/[libfile]");
I dont think u need to add perm for a lib file, but if u do use 644 i think.
Hazou
Cheers guys but I've had a look in the zip file and there's 2 folders. META-INF and data. The data structure goes:- data/data/com.viber.voip and inside that there are the four folders for the app. They are "databases", "files", "lib" and "shared_prefs". All the folders except "lib" get copied over which is extremely weird. There's nothing waiting to go in the system partition, it's all on the data partition.

How to make a simple Installer.zip?

I just want to make a "simple" installer zip so that each time i want to install a new ROM i can install my .zip file after the first boot and have all my old familiar ring tones and other system files installed to the device system folders.
I tried using another apps installation file as a "wrapper" for my files but getting an error message when trying to install it via Recovery. this is the updater-script file that i'm using:
ui_print("***************************");
ui_print("Personal Files installer ZIP");
ui_print("***************************");
ui_print("- Mounting /system");
run_program("/sbin/busybox", "mount", "/system");
run_program("/sbin/busybox", "mount", "/data");
ui_print("- Extracting files");
package_extract_dir("system", "/system");
ui_print("- Unmounting /system");
unmount("/system");
ui_print("- Done !");
Does anyone know what i'm doing wrong here?
Look for the aroma automatic app installer. It wraps your selected apps that belongs in the right directory into one flashable zip.....maybe its helpful ? Don't know if its exactly what you are looking for but maybe a pointer in the right way
1+
Check aroma thread, it has a link in OP to aroma apk maker
SkyDragon© New concept Rom coming, stay tuned with SD Team
Thanx, I checked out the aroma app maker but these only seem to allow you to make packages to install .apk files. I want to install some system files like ring tones and weather data base.
I guess that I need to play some more with the config files and installer scripts to suss them out more.
Sent witH desire from One X

[REQ/Help] Empty Flashable Zip (Template)

I upgraded from my GS3 to the N4.
I had a template for a flashable zip for the GS3 but dont think it applies to the N4.
Not only do I hope that someone can provide a template, but also hope that I can be taught to make a template for myself, for when the N5 comes out.
When exploring through the zip template for the GS3 (using Notepad++), inside META-INF > com > google > android > updater-script I see:
ui_print("Universal Updater Script - by Andybones");
unmount("/system");
show_progress(0.1, 0);
mount("ext4", "EMMC", "/dev/block/mmcblk0p14", "/system");
mount("ext4", "EMMC", "/dev/block/mmcblk0p15", "/data");
show_progress(0.500000, 80);
package_extract_dir("data", "/data");
package_extract_dir("system", "/system");
show_progress(0.2, 10);
show_progress(0.1, 0);
ui_print("Done!");
show_progress(0.1, 0);
ui_print("Enjoy!!");
show_progress(0.1, 0);
unmount("/data");
unmount("/cache");
unmount("/system");
My main concerns are 1. What differentiates each devices zips from eachother?, and 2. Does it make a difference that the GS3 was CDMA and now I am GSM (Verizon - T-Mobile)?
I attached the Template I use, complements to andybones at this thread: http://forum.xda-developers.com/showthread.php?t=2136746
Thanks in advance for any insight.
Wow..someone actually wants to learn around here...nice job!
1. The way it mounts the partitions and what it extracts where. Also the stuff it prints while flashing.
2. No it doesn't make a difference whether a phone is CDMA or GSM.
3. If you had a Verizon gs3, the way the bootloader was unlocked required some messing with the partitions so some flashable zips will mount partitions differently.
I can make a template for the nexus 4, but that wouldn't be much help to you. So I'll just explain what everything does.
BTW: This template will probably work on the nexus 4.
Code:
ui_print("Universal Updater Script - by Andybones");
"ui_print" is basically what you see when the user flashes the zip in recovery.
Code:
unmount("/system");
It unmounts the system partition. Duh. This is just precautionary incase it was mounted already.
Code:
show_progress(0.1, 0);
This moves the progress bar in TWRP or CWM. Some zips don't have this so you never know how far along the install is. Its not really needed for small zips because they finish so fast.
Code:
mount("ext4", "EMMC", "/dev/block/mmcblk0p14", "/system");
mount("ext4", "EMMC", "/dev/block/mmcblk0p15", "/data");
This says what type of partition it is and where to mount it. Its needed to copy the files from the zip into the phone. The /dev/block/.... is where the partition is located on the phone. It sometimes changes when people mess with the partitions to root/unlock the bootloader.
Code:
package_extract_dir("data", "/data");
package_extract_dir("system", "/system");
This extracts the contents of the folders "data" and "system" from the zip into the partitions that were mounted earlier.
Code:
unmount("/data");
unmount("/cache");
unmount("/system");
This unmounts all the partitions before exiting the script. Always a good idea even though it usually doesn't cause problems if you don't.
NOTE: I don't know why this is unmounting "/cache" when it never mounted it but...okay?
I thanked a while back but just wanted to reply and let you know that I have a much better understanding of how these work now.
Thanks again.
Sent from my Nexus 4 using xda app-developers app

Categories

Resources