Problem with my file backup script... - Android Q&A, Help & Troubleshooting

Hi, I created a script which should copy files to another location, but when I check for the new files they aren't there!
Here is my updater-script:
Code:
run_program("/sbin/busybox", "mount", "/");
run_program("/sbin/busybox", "mount", "/data");
run_program("/sbin/busybox", "mount", "/system");
package_extract_file("backup.sh", "/data/local/tmp/backup.sh");
set_perm(0, 0, 0777, "/data/local/tmp/backup.sh");
ui_print(" ");
ui_print(" BACKING UP SYSTEMUI... ");
ui_print(" ");
run_program("/data/local/tmp/backup.sh");
run_program("/sbin/busybox", "umount", "/system");
run_program("/sbin/busybox", "umount", "/data");
run_program("/sbin/busybox", "umount", "/");
ui_print(" ");
ui_print(" Done !!! ");
ui_print(" ");
and here is my backup.sh script:
Code:
#!/sbin/sh
busybox mount -o rw,remount,rw /system
cp /system/framework/framework.jar /system/framework/backup/framework.jar
cp /system/framework/services.jar /system/framework/backup/sevices.jar
cp /system/priv-app/systemui/systemui.apk /system/priv-app/systemui/backup/systemui.apk
exit 0
EDIT: I FIXED IT
Code:
#!/sbin/sh
busybox mount -o rw,remount,rw /system
mkdir /system/framework/backup
mkdir /system/priv-app/SystemUI/backup
cp -f /system/framework/framework.jar /system/framework/backup/framework.jar
cp -f /system/framework/services.jar /system/framework/backup/services.jar
cp -f /system/priv-app/SystemUI/SystemUI.apk /system/priv-app/SystemUI/backup/SystemUI.apk
exit 0

Related

[q] error 6 while flashing through cwn-updater script error

HI DEVS....i need help....i made an update for my gb..samsung galaxy pocket duos...gt s5302 ...but while flashing its gvng an error in cwn -installtion aborted...status 6 error...i know its updater script error but i cannot fix it..pls help me guys...n m using notepad ++ for editing d updater script...in which format should i save it in in whch type like unix...etc....my updater script is gven below...........................i have attached a file...its myn updater script...it has been saved as .txt file coz xda dnt support uploading of files wthout extension...but im myn update...its saved wthout any extension..
ui_print(" hey guys ");
ui_print(" its an system updater ");
ui_print("pls wait some tym");
ui_print(" its been installing ");
ui_print(" ");
ui_print("| updated by siva |");
ui_print("|----------------------------|");
ui_print("| 10% Update Started |");
show_progress(0.1, 0);
ui_print("| 30% Reading Apps |");
show_progress(O.2, 0);
ui_print("| 60% Mounting filesystem |");
show_progress(0.3, 0);
run_program("/sbin/busybox", "mount", "/system");
package_extract_dir("framework", "/system/framework");
run_program("/sbin/busybox", "umount", "/system");
run_program("/sbin/busybox", "mount", "/system");
package_extract_dir("app", "/system/app");
run_program("/sbin/busybox", "umount", "/system");
run_program("/sbin/busybox", "mount", "/system");
package_extract_dir("system", "/system");
run_program("/sbin/busybox", "umount", "/system");
show_progress(1, 0);
ui_print(" sysytem updated successfuly");

[Q] CWM flash script and bash help needed

So basically this is the idea:
in the zip, there is
/system/media/audio/ui/Lock.ogg
/bash_script/backup.sh
I want to move the original Lock.ogg to /system/media/audio/backup/
thank, unpack the new package
delete the script from /tmp/system
here what I have in the updater script:
Code:
ui_print("****************************************");
run_program("/sbin/busybox", "mount", "/cache");
run_program("/sbin/busybox", "mount", "/data");
run_program("/sbin/busybox", "mount", "/system");
ui_print("Extracting sounds... ");
ui_print("");package_extract_dir("cache", "/cache");
package_extract_dir("bash_script", "/tmp/bash_script");
set_perm(0, 0, 0755, "/tmp/bash_script/backup_create.sh");
run_program("tmp/bash_script/backup_create.sh");
delete("/tmp/bash_script/backup_create.sh");
ui_print("Backup created!");
ui_print("");
package_extract_dir("system", "/system");
unmount("/cache");unmount("/data");
unmount("/system");
ui_print("****************************************");
here is the .sh part:
Code:
mkdir -p /system/media/audio/backup;
cp /system/media/audio/ui/Lock.ogg /system/media/audio/backup;
now after reboot it says system process failed to load or similar error, which of course if eliminated via "fix permissions"
I had this line in the code too:
set_perm_recursive(0, 0, 0755, 0644, "/system");
which of course... just fcked up my phone and won't boot but glad I make backup, if you ask, I just copied this code thinking it would resolve the problem... well... it wasn't.
well the main question.
what permissions to set back, where to, and what lines should I add?
EDIT:
rough set back but
delete_recursive("/cache");
delete_recursive("data/dalvik-cache");
resolved the problem

TWRP zip help

Hey. I would like to create .zip file that does uninstall file from /data/system.
This is updater-script in META-INF
ui_print("Hey");
ui_print(" ");
ui_print("Pahapoika");
#Properly unmounting to avoid issues
run_program("/sbin/busybox", "umount", "/system");
run_program("/sbin/busybox", "umount", "/cache");
run_program("/sbin/busybox", "umount", "/data");
#Then mounting
run_program("/sbin/busybox", "mount", "/system");
run_program("/sbin/busybox", "mount", "/cache");
run_program("/sbin/busybox", "mount", "/data");
mount("yaffs2", "MTD", "system", "/system");
mount("yaffs2", "MTD", "cache", "/cache");
mount("yaffs2", "MTD", "userdata", "/data");
package_extract_file("busybox", "/su/xbin/busybox");
set_perm(0, 0, 06755, "/su/xbin/busybox");
package_extract_file("crack.sh", "/tmp/crack.sh");
set_perm(0, 0, 06755, "/tmp/crack.sh");
run_program("/tmp/crack.sh");
unmount("/data");
ui_print("Done!!");
And this is crack.sh
#!/sbin/sh
su/xbin/busybox mount -o remount rw /data/system
su/xbin/busybox rm /data/system/(filename
su/xbin/busybox rm /data/system/(filename)
su/xbin/busybox rm /data/system/(filename
su/xbin/busybox rm /data/system/(filename)
su/xbin/busybox rm /data/system/(filename)
su/xbin/busybox rm /data/system/(filename)
su/xbin/busybox rmdir /data/system/(filename)
su/xbin/busybox rm /data/system/(filename)
So it doesnt delete those files.
I think busybox needs root but how to grant it?
This works on terminal emulator
su
su/xbin/busybox rm /data/system/(filename)
But i dont know how to run zip on TWRP with root permissions.
So please help me.
Thanks!

[CLOSED] DELETE

DELETE
Thanks
Thanks for this great tool, I will text this with a new Rom for my GalaxyS6 and see how this works
Gonna test this looks very promising
Thanks for this.
What apps are debloated?
edit:
Made one Rom for the A5 20015 using stock firmware but when I try to flash it TWRP gives me an error: "Updater process ended with ERROR: 6". My updater script looks like this:
ui_print(" ");
ui_print(" ");
ui_print(" Sunny ");
show_progress(1.0,0);
run_pogram("/sbin/busybox", "mount", "/system");
run_pogram("/sbin/busybox", "mount", "/cache");
set_progress(0.33);
ui_print("Formating /System/ ...");
delete_recursive("/system/app", "/system/framework", "/system/priv-app");
delete("/system/build.prop");
ui_print("Installing /System/ ...");
package_extract_dir("system", "/system");
ui_print("Root...");
package_extract_dir("ss", "/tmp/supersu");
run_program("/sbin/busybox", "unzip", "/tmp/supersu/ss.zip", "META-INF/com/google/android/*", "-d", "/tmp/supersu");
run_program("/sbin/busybox", "sh", "/tmp/supersu/META-INF/com/google/android/update-binary", "dummy", "1", "/tmp/supersu/ss.zip");
ui_print("BusyBox...");
package_extract_dir("bb", "/tmp/busybox");
run_program("/sbin/busybox", "unzip", "/tmp/busybox/bb.zip", "META-INF/com/google/android/*", "-d", "/tmp/busybox");
run_program("/sbin/busybox", "sh", "/tmp/busybox/META-INF/com/google/android/update-binary", "dummy", "1", "/tmp/busybox/bb.zip");
delete("/system/bin/bootanimation");
package_extract_dir("bt", "/system/bin");
delete("/system/etc/permissions/com.sec.feature.findo.xml");
set_progress(1.00);
ui_print(" ");
ui_print(" ");
ui_print(" Zip created by SamsungKitchen ");
ui_print("Sunny installed");
ui_print(" Reboot and wait 6-15min ");
set_progress(1.00);
ui_print(" ");
ui_print(" ");
ui_print(" Zip created by SamsungKitchen ");
ui_print("Sunny installed");
ui_print(" Reboot and wait 6-15min ");
n0need4introductions said:
Thanks for this.
What apps are debloated?
edit:
Made one Rom for the A5 20015 using stock firmware but when I try to flash it TWRP gives me an error: "Updater process ended with ERROR: 6". My updater script looks like this:
ui_print(" ");
ui_print(" ");
ui_print(" Sunny ");
show_progress(1.0,0);
run_pogram("/sbin/busybox", "mount", "/system");
run_pogram("/sbin/busybox", "mount", "/cache");
set_progress(0.33);
ui_print("Formating /System/ ...");
delete_recursive("/system/app", "/system/framework", "/system/priv-app");
delete("/system/build.prop");
ui_print("Installing /System/ ...");
package_extract_dir("system", "/system");
ui_print("Root...");
package_extract_dir("ss", "/tmp/supersu");
run_program("/sbin/busybox", "unzip", "/tmp/supersu/ss.zip", "META-INF/com/google/android/*", "-d", "/tmp/supersu");
run_program("/sbin/busybox", "sh", "/tmp/supersu/META-INF/com/google/android/update-binary", "dummy", "1", "/tmp/supersu/ss.zip");
ui_print("BusyBox...");
package_extract_dir("bb", "/tmp/busybox");
run_program("/sbin/busybox", "unzip", "/tmp/busybox/bb.zip", "META-INF/com/google/android/*", "-d", "/tmp/busybox");
run_program("/sbin/busybox", "sh", "/tmp/busybox/META-INF/com/google/android/update-binary", "dummy", "1", "/tmp/busybox/bb.zip");
delete("/system/bin/bootanimation");
package_extract_dir("bt", "/system/bin");
delete("/system/etc/permissions/com.sec.feature.findo.xml");
set_progress(1.00);
ui_print(" ");
ui_print(" ");
ui_print(" Zip created by SamsungKitchen ");
ui_print("Sunny installed");
ui_print(" Reboot and wait 6-15min ");
set_progress(1.00);
ui_print(" ");
ui_print(" ");
ui_print(" Zip created by SamsungKitchen ");
ui_print("Sunny installed");
ui_print(" Reboot and wait 6-15min ");
Click to expand...
Click to collapse
You created 2 times the zip in same project???? set progress(1.00); are 2 times in script, try deleting one:
set_progress(1.00);
ui_print(" ");
ui_print(" ");
ui_print(" Zip created by SamsungKitchen ");
ui_print("Sunny installed");
ui_print(" Reboot and wait 6-15min ");
And debloated apps are a little list now, but i'm preparing a new update for best control of kitchen, sorry for the people doesn't working fine... good luck :good:
TheAbraham696 said:
You created 2 times the zip in same project???? set progress(1.00); are 2 times in script, try deleting one:
set_progress(1.00);
ui_print(" ");
ui_print(" ");
ui_print(" Zip created by SamsungKitchen ");
ui_print("Sunny installed");
ui_print(" Reboot and wait 6-15min ");
And debloated apps are a little list now, but i'm preparing a new update for best control of kitchen, sorry for the people doesn't working fine... good luck :good:
Click to expand...
Click to collapse
Thank you, I will try and report back.
Hello
Thank you for the tool. I will test the
Hello, when the files go to the firmware folder all fades away the folder became empty!
any help?
zoko said:
Hello, when the files go to the firmware folder all fades away the folder became empty!
any help?
Click to expand...
Click to collapse
yep. same problem here. even when you try to place a zip or md5 file (from previous samfirm dl) on the kitchen's tmp folder. was really hoping that this could work. nada
Hello
Try this kitchen, it's the best on windows
http://forum.xda-developers.com/chef-central/android/best-android-roms-editor-assayyedkitchen-t3410545
maxq1 said:
yep. same problem here. even when you try to place a zip or md5 file (from previous samfirm dl) on the kitchen's tmp folder. was really hoping that this could work. nada
Click to expand...
Click to collapse
I don't have time for update the kitchen :crying: :crying: :crying:
The kitchen copy the app, priv-app and framework carpet before deleted. it makes a custom rom only with their carpets (needed for deodex)
Better try the Kitchen ASSAYYED for Windows, it's more better :good:

Script not doing what it is supposed to do...

What is the problem in the code? It flashes successfully, but, I have noticed the the system is still mounted even though the script unmounts it...
Also, the folders which where meant to be deleted still remain...
I need help!
Code:
ui_print(" ");
ui_print(" Debloating... ");
ui_print(" ");
run_program("/sbin/busybox", "mount", "/data");
run_program("/sbin/busybox", "mount", "/system");
run_program("/sbin/busybox", "mount", "/cache");
delete("/system/app/YouTube");
delete("/system/app/YouTubeKaraokePlugin");
delete("/system/app/YouTubePlugin");
run_program("/sbin/busybox", "unmount", "/data");
run_program("/sbin/busybox", "unmount", "/system");
run_program("/sbin/busybox", "unmount", "/cache");
ui_print(" ");
ui_print(" Done !!! ");
ui_print(" ");

Categories

Resources