[Q]Help with Updater-Script Commands - Galaxy S III Q&A, Help & Troubleshooting

Hey guys... i'm trying to make a zip file that installs all the apps that i want and restore theirs data. the problem is that i need to mount internal SDcard i can't find the way. i have only found commands for other phones, and i don't know if this works for this phone.
so far i have this:
Code:
ui_print("-------------------------------------");
show_progress(0.500000, 0);
ui_print("");
ui_print("Mounting Partitions");
ui_print("");
run_program("/sbin/busybox", "mount", "/data");
ui_print("Pack de APKs, by Pelpa87");
ui_print("");
ui_print("-------------------------------------");
delete("");
delete("");
ui_print("");
ui_print("Installing");
package_extract_dir("data", "/data");
ui_print("");
ui_print("Setting Permisions");
set_perm(0, 0, 0644, "/system/app/XXXX.apk");
ui_print("");
ui_print("Unmounting Partitions");
unmount("/data");
ui_print("");
ui_print("Finish!");
ui_print("Enjoy :)");
ui_print("");
ui_print("-------------------------------------");
show_progress(1.000000, 0);
i want something like this: run_program("/sbin/busybox", "mount", "/data"); for mounting /Sdcard(0) but i can't find it.
EDIT: OK, in fact, what i really need is wich block and wich is the mounting point of the internal SD...i can't find it anywhere...in systems it's says its /dev/fuse but that won't work in CWR.
excuse my noobness
i'm trying to learn

Titanium backup does this already. You are re-inventing the wheel, well the apps and data part, not sure about the rooting part, use mobile odin to do the flashing?

Kangburra said:
Titanium backup does this already. You are re-inventing the wheel, well the apps and data part, not sure about the rooting part, use mobile odin to do the flashing?
Click to expand...
Click to collapse
yeah, i know that. i'm not trying to re-invent nothing at all...i'm just want to do something else, but i need this first...

Could try XDA.com Android hacking .
jje

Related

CWM Recovery Batch install issues

Hey all,
I created a little zip to be flashed in cwm recovery, It works great in almost every way, except some apps in /data/app and system/app in the zip do not get installed at all or are corrupted (both happen with diff apps). I've tried reflashing the same zip, repackaging it, and even installing the apks manually. Nothing works except installing the apks manually.
I've deduced that before packaging, the apks are fine. And because I've repacked it twice, and have had complete success packaging other flashable zips, I feel something is happening in CWM recovery, or maybe my updater script doesn't install to the directories the right way.
Is there a better way to batch install via recovery? Or something I'm missing in my script? Or is it not reliable to install apks via flashable zip?
This is how I do it.
In my zip I have:
Code:
/system
/app
/***.apk
/***.apk
/data
/app
/***.apk
/***.apk
/META-INF
/com
/google
/android
/update-binary
/updater-script
This is my updater script (modified from a remover script)
Code:
ui_print("---------------------------");
ui_print("SGS2 Batch Installer");
ui_print("and Bloatware Remover v0.2");
ui_print("---------------------------");
ui_print("Deleting useless bloatware ...");
delete("/system/app/AnalogClock.apk");
delete("/system/app/BuddiesNow.apk");
delete("/system/app/ChocoEUKor.apk");
delete("/system/app/Days.apk");
delete("/system/app/Dlna.apk");
delete("/system/app/DualClock.apk");
delete("/system/app/EmailWidget.apk");
delete("/system/app/GameHub.apk");
delete("/system/app/GenieWidget.apk");
delete("/system/app/Kies.apk");
delete("/system/app/KiesAir.apk");
delete("/system/app/kieswifi.apk");
delete("/system/app/Kobo.apk");
delete("/system/app/Microbesgl.apk");
delete("/system/app/MiniDiary.apk");
delete("/system/app/MtpApplication.apk");
delete("/system/app/MusicHub_U1.apk");
delete("/system/app/MusicPlayer.apk");
delete("/system/app/PhotoRetouching.apk");
delete("/system/app/PolarisOffice.apk");
delete("/system/app/PressReader.apk");
delete("/system/app/Protips.apk");
delete("/system/app/ReadersHub.apk");
delete("/system/app/SamsungApps.apk");
delete("/system/app/SamsungAppsUNA3.apk");
delete("/system/app/SamsungAppsUNAService.apk");
delete("/system/app/SamsungIM.apk");
delete("/system/app/SamsungWidget_News.apk");
delete("/system/app/SamsungWidget_ProgramMonitor.apk");
delete("/system/app/SamsungWidget_StockClock.apk");
delete("/system/app/SamsungWidget_WeatherClock.apk");
delete("/system/app/SecretWallpaper1.apk");
delete("/system/app/SecretWallpaper2.apk");
delete("/system/app/SevenEngine.apk");
delete("/system/app/SnsAccountFb.apk");
delete("/system/app/SnsAccountLi.apk");
delete("/system/app/SnsAccountMs.apk");
delete("/system/app/SnsAccountTw.apk");
delete("/system/app/SnsDisclaimer.apk");
delete("/system/app/SnsImageCache.apk");
delete("/system/app/SnsProvider.apk");
delete("/system/app/SocialHub.apk");
delete("/system/app/Talk.apk");
delete("/system/app/Talk2.apk");
delete("/system/app/TouchWiz30Launcher.apk");
delete("/system/app/Vending.apk");
delete("/system/app/VideoEditor.apk");
delete("/system/app/VideoPlayer.apk");
delete("/system/app/VoiceToGo.apk");
delete("/system/app/YouTube.apk");
delete("/system/app/Zinio.apk");
delete("/system/app/AnalogClock.odex");
delete("/system/app/BuddiesNow.odex");
delete("/system/app/ChocoEUKor.odex");
delete("/system/app/Days.odex");
delete("/system/app/Dlna.odex");
delete("/system/app/DualClock.odex");
delete("/system/app/EmailWidget.odex");
delete("/system/app/GameHub.odex");
delete("/system/app/GenieWidget.odex");
delete("/system/app/Kies.odex");
delete("/system/app/KiesAir.odex");
delete("/system/app/kieswifi.odex");
delete("/system/app/Kobo.odex");
delete("/system/app/Microbesgl.odex");
delete("/system/app/MiniDiary.odex");
delete("/system/app/MtpApplication.odex");
delete("/system/app/MusicHub_U1.odex");
delete("/system/app/MusicPlayer.odex");
delete("/system/app/PhotoRetouching.odex");
delete("/system/app/PressReader.odex");
delete("/system/app/Protips.odex");
delete("/system/app/ReadersHub.odex");
delete("/system/app/SamsungApps.odex");
delete("/system/app/SamsungAppsUNA3.odex");
delete("/system/app/SamsungAppsUNAService.odex");
delete("/system/app/SamsungIM.odex");
delete("/system/app/SamsungWidget_News.odex");
delete("/system/app/SamsungWidget_ProgramMonitor.odex");
delete("/system/app/SamsungWidget_StockClock.odex");
delete("/system/app/SamsungWidget_WeatherClock.odex");
delete("/system/app/SecretWallpaper1.odex");
delete("/system/app/SecretWallpaper2.odex");
delete("/system/app/SevenEngine.odex");
delete("/system/app/SnsAccountFb.odex");
delete("/system/app/SnsAccountLi.odex");
delete("/system/app/SnsAccountMs.odex");
delete("/system/app/SnsAccountTw.odex");
delete("/system/app/SnsDisclaimer.odex");
delete("/system/app/SnsImageCache.odex");
delete("/system/app/SnsProvider.odex");
delete("/system/app/SocialHub.odex");
delete("/system/app/Talk.odex");
delete("/system/app/Talk2.odex");
delete("/system/app/TouchWiz30Launcher.odex");
delete("/system/app/Vending.odex");
delete("/system/app/VideoEditor.odex");
delete("/system/app/VideoPlayer.odex");
delete("/system/app/VoiceSearch.odex");
delete("/system/app/VoiceToGo.odex");
delete("/system/app/YouTube.odex");
delete("/system/app/Zinio.odex");
ui_print(" ");
ui_print("Batch Installing!");
ui_print(" ");
ui_print("Extracting /system...");
package_extract_dir("system", "/system");
ui_print(" ");
ui_print("Extracting /sdcard...");
package_extract_dir("sdcard", "/sdcard");
ui_print(" ");
ui_print("Extracting /data...");
unmount("/data");
mount("ext4", "EMMC", "/dev/block/mmcblk0p10", "/data");
package_extract_dir("data", "/data");
unmount("/data");
ui_print("Done! Reboot that sh**!");
Anybody have any thoughts?
Thank you!
Endor

Dumb question.. How to make a update.zip

I know people talk about this all the time... I found a lot of thread of how to create a flashable zip file.. But every thread has it different than others. So I have tried it several ways and still get errors...
I'm trying to make a flashable zip to push an apk to system/app and I decided to do this to test it out...
This is the update-script I have tested it with
run_program("/sbin/busybox", "mount", "/system");
delete("/system/app/FlashBarService.apk");
package_extract_dir("system", "/system");
run_program("/sbin/busybox", "unmount", "/system");
Ok what I figure is the run_program is to mount system with busybox. Every line i see that it have this on there.. Then Im trying to replace an app from system/app so I put in delete("/system/app/name of app");
then package_extract_dir("system", :/system"); is so recovery can extract and push the zip file
and again run_program to unmount... But recovery is giving me an error status 4
I also deleted that delete line and still got status 4.
Again this is another way I tried it to do it with
run_program("/sbin/busybox", "mount", "/system");
run_program("/sbin/busybox", "mount", "/cache");
run_program("/sbin/busybox", "mount", "/data");
package_extract_dir("system", "/system");
run_program("/sbin/busybox", "umount", "/system");
run_program("/sbin/busybox", "umount", "/cache");
run_program("/sbin/busybox", "umount", "/data");
And this way too
mount("ext4", "EMMC", "/dev/block/mmcblk0p14", "/system");
mount("ext4", "EMMC", "/dev/block/mmcblk0p14", "/data");
package_extract_dir("system", "/system");
run_program("/sbin/busybox", "unmount", "/system");
run_program("/sbin/busybox", "unmount", "/data");
And till got status 4.
Inside my xxx.zip I have it set up this way META-INF/com/google/android
And other folder on root system/app
I have a GS3.
Like I said I have followed several threads about this and all looks different and none worked.
I know this is supposed to be the easies thing to do when it comes to android. But I just need to be directed to the right path.
Can somebody with more experience with this help me out?
Status 4 means that you have a syntax error somewhere... (yep, you have a syntax error or you're using notepad or wordpad to edit the files. That's it).
The best guide I ever seen out there is this one, take a look at it.
I use notepad++ to edit any android related files like build.prop. Thanks will look at that
Sent from my SGH-T999 using Tapatalk 4 Beta
Anyone?
gypsy214 said:
I use notepad++ to edit any android related files like build.prop. Thanks will look at that
Sent from my SGH-T999 using Tapatalk 4 Beta
Click to expand...
Click to collapse
Yeah. Notepad++ is best for this type of Editing in Windows.
Have you chosen the correct format in settings?
Edit>>EOL Conversions>>UNIX Format
The problem may be that windows use CR(carriage return) while unix(Android) uses LF (line feed) for a new line character.
You can also try to mount the system manually(there is option in CWM for that) & may be leave only the "package_extract_dir("system", "/system");" in the updater script.
Also, post the zip file here, so that problem can be easily identified.
GobletSky31689 said:
Yeah. Notepad++ is best for this type of Editing in Windows.
Have you chosen the correct format in settings?
Edit>>EOL Conversions>>UNIX Format
The problem may be that windows use CR(carriage return) while unix(Android) uses LF (line feed) for a new line character.
You can also try to mount the system manually(there is option in CWM for that) & may be leave only the "package_extract_dir("system", "/system");" in the updater script.
Also, post the zip file here, so that problem can be easily identified.
Click to expand...
Click to collapse
Will do.. But it works when I use notepad++ to add ui_print.

Help flashlable zip

Please help ...
I need to create a zip file flashlable
system / app
SystemUI.apk
Phone.apk
HtcDialer.apk
and another app
..............
/ framework
com.htc.resources.apk
framework-res.apk
here only those
my working
Hi
Ashle said:
Please help ...
I need to create a zip file flashlable
system / app
SystemUI.apk
Phone.apk
HtcDialer.apk
and another app
..............
/ framework
com.htc.resources.apk
framework-res.apk
here only those
my working
Click to expand...
Click to collapse
If you are only using System apks, then there is a Play Store App for that.
App2Zip
Search it.
I need to create a system app updater script and the framework / framework-res.apk, com.htc.resources.apk
My not working
mount("MTD", "system", "/system");
ui_print("started. . . .");
ui_print("flashable zip");
ui_print("");
ui_print("");
ui_print("");
ui_print("");
run_program("/sbin/busybox", "mount", "/system");
run_program("/sbin/busybox", "mount", "/data");
run_program("/sbin/busybox", "mount", "/cache");
package_extract_dir("system", "/system");
delete("/system/app/HtcContacts.odex");
delete("/system/app/HtcContactWidgets.odex");
delete("/system/app/HtcDialer.odex");
delete("/system/app/Phone.odex");
delete("/system/app/SystemUI.odex");
delete("/system/framework/com.htc.resources.odex");
delete("/system/framework/framework-res.odex");
set_perm(0, 0, 0644, "/system/framework/framework-res.apk");
set_perm(0, 0, 0644, "/system/framework/com.htc.resources.apk");
unmount("/system");
unmount("/cache");
unmount("/data");
ui_print("Done. Reboot!");
Click to expand...
Click to collapse
Ashle said:
I need to create a system app updater script and the framework / framework-res.apk, com.htc.resources.apk
My not working
Click to expand...
Click to collapse
1. mount("MTD", "system", "/system"); is wrong for DX as DX is using EMMC instead of MTD
The correct one is mount("ext4", "EMMC", "/dev/block/mmcblk0p24", "/system");
2. You don't need mount("ext4", "EMMC", "/dev/block/mmcblk0p24", "/system"); when you have run_program("/sbin/busybox", "mount", "/system");
3. There is no such thing as com.htc.resources.odex and framework-res.odex as there is no smali in these files
4. You don't need set_perm(0, 0, 0644, for system/app and system/framework
5. Why do you want to delete those odex files ? Most of the time, a stock odex ROM will not boot when you mix with deodexed files because the boothclass is broken
ckpv5 said:
1. mount("MTD", "system", "/system"); is wrong for DX as DX is using EMMC instead of MTD
The correct one is mount("ext4", "EMMC", "/dev/block/mmcblk0p24", "/system");
2. You don't need mount("ext4", "EMMC", "/dev/block/mmcblk0p24", "/system"); when you have run_program("/sbin/busybox", "mount", "/system");
3. There is no such thing as com.htc.resources.odex and framework-res.odex as there is no smali in these files
4. You don't need set_perm(0, 0, 0644, for system/app and system/framework
5. Why do you want to delete those odex files ? Most of the time, a stock odex ROM will not boot when you mix with deodexed files because the boothclass is broken
Click to expand...
Click to collapse
Yes .... :thumbup: :thumbup:
Edit SuperSense5 rom...
Change battery icon not working...
Icon wifi,data......,icon picture call contact,frame,....ok
Sent from my HTC Desire X using xda app-developers app

[HELP] Fix TWRP Error 255

Hello XDA Members! I Have Developed A Custom ROM. I Have Create A updater-script. It Showing "Process Ended With Error:255". Here Is My updater-script.
Code:
ui_print(">>> ZenMod Xperia <<<");
format("ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/system", "0", "/system");
mount("ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/system", "/system");
ui_print("Installing ZenMod");
ui_print("Please wait...");
show_progress(1.34,175);
package_extract_dir("system", "/system");
unmount("/system");
ui_print("Flashing Kernel...");
package_extract_file("boot.img", "/dev/block/platform/msm_sdcc.1/by-name/boot");
ui_print("Finished!");
show_progress(1.000000, 0);
Anybody Know How To Fix It?. If Anybody Know Please Help Me...
in recovery , that command row make the mistake ???
And where are the symlinks????
format("ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/system", "0", "/system"); <- What's the purpose of "0" in here?
Everything else looks fine though.
Copy the logcat of TWRP and upload, so you could help more
lol u need symlinks, permitions and much more and also add get device prop..lol updater script cant be this much short...
Harsh_1998 said:
lol u need symlinks, permitions and much more and also add get device prop..lol updater script cant be this much short...
Click to expand...
Click to collapse
lol why would he add symlinks and permissions uselessly?
and for the device prop it's a good practice to add it but not so necessary.
Updater-script can be shorter than this.
http://forum.xda-developers.com/showthread.php?t=1931585

How to make Migrate app backups compatible with our rom(and other AB roms)

EDIT: This guide is now not necessary, there is a mod of the app for system_root phones, and probably soon there will be official support.
Modded app (install on the rom before making backups):
https://forum.xda-developers.com/re...igrate-root-fixed-version-unofficial-t3944054
This guide is still valid, for those who have already done the backups, but they are not working.
How to make Migrate app backups compatible with our rom(and other AB roms)
I am not affiliated in anyway to this app. This is only a guide for those who want to use it to switch their apps between roms.
You are responsible if you miss anything and screw up your rom. I will not be offering any extra support.
Make sure to read and understand everything carefully before you proceed.
App:
https://play.google.com/store/apps/details?id=balti.migrate
1. Open the zip with winrar or 7zip
2. Inside the folder META-INF\com\google\android, extract the file updater-script
3. Open it with notepad/notepad++ or another text editor(if you know what you are doing)
4. Find these lines at the beginning:
Code:
ui_print("Mounting partition...");
run_program("/sbin/busybox", "mount", "/system");
run_program("/sbin/busybox", "mount", "/data");
ifelse(is_mounted("/data") && is_mounted("/system"), ui_print(""), ui_print("Mounting using self busybox...") && run_program("/tmp/mount_using_self_busybox.sh", "m"));
ifelse(is_mounted("/data") && is_mounted("/system"), ui_print("Mounted!"), abort("Mount failed! Exiting..."));
package_extract_file("prep.sh", "/tmp/prep.sh");
5. Change them to:
Code:
ui_print("Mounting partition...");
run_program("/sbin/busybox", "mount", "/system_root");
run_program("/sbin/busybox", "mount", "/data");
ifelse(is_mounted("/data") && is_mounted("/system_root"), ui_print(""), ui_print("Mounting using self busybox...") && run_program("/tmp/mount_using_self_busybox.sh", "m"));
ifelse(is_mounted("/data") && is_mounted("/system_root"), ui_print("Mounted!"), abort("Mount failed! Exiting..."));
package_extract_file("prep.sh", "/tmp/prep.sh");
6. Find these lines at the end:
Code:
ui_print(" ");
ui_print("Unmounting partitions...");
run_program("/sbin/busybox", "umount", "/system");
run_program("/sbin/busybox", "umount", "/data");
ifelse(is_mounted("/data") && is_mounted("/system"), ui_print(""), run_program("/tmp/mount_using_self_busybox.sh", "u"));
ui_print(" ");
ui_print("Finished!");
7. Change them to:
Code:
ui_print(" ");
ui_print("Unmounting partitions...");
run_program("/sbin/busybox", "umount", "/system_root");
run_program("/sbin/busybox", "umount", "/data");
ifelse(is_mounted("/data") && is_mounted("/system_root"), ui_print(""), run_program("/tmp/mount_using_self_busybox.sh", "u"));
ui_print(" ");
ui_print("Finished!");
8. Repack the file to the original position
9. Redo all of this for every migrate zip you have
Just a quick question. I don't have Mi 9 SE. So I rely on inputs from users so that I can issue a fix.
After changing this, does the helper app work as expected? Because someone told me that helper can't seem to find the migrate cache directory.
Thanks for the information.
For me it worked. If you need to make tests, contact me(I am on beta channel for your app in play store too)
redispade said:
For me it worked. If you need to make tests, contact me(I am on beta channel for your app in play store too)
Click to expand...
Click to collapse
Is it still working for you ? I tried these steps and I could not get it working. I am thinking to replace "system" as "system_root" in the updater script.
basically replace this:
Code:
ui_print("Unpacking helper");
package_extract_dir("system", "/system");
package_extract_file("helper_unpacking_script.sh", "/tmp/helper_unpacking_script.sh");
set_perm_recursive(0, 0, 0777, 0777, "/tmp/helper_unpacking_script.sh");
run_program("/tmp/helper_unpacking_script.sh", "/system/app/helper", "12");
set_perm_recursive(0, 0, 0777, 0777, "/system/app/MigrateHelper");
with this:
Code:
ui_print("Unpacking helper");
package_extract_dir("system_root", "/system_root");
package_extract_file("helper_unpacking_script.sh", "/tmp/helper_unpacking_script.sh");
set_perm_recursive(0, 0, 0777, 0777, "/tmp/helper_unpacking_script.sh");
run_program("/tmp/helper_unpacking_script.sh", "/system_root/app/helper", "12");
set_perm_recursive(0, 0, 0777, 0777, "/system_root/app/MigrateHelper");
The part you are modifying is for the helper apk. If it gives errors, you have done something wrong. If you want to replace that part, replace it with /system_root/system
Sent from my Mi 9 SE using Tapatalk
redispade said:
The part you are modifying is for the helper apk. If it gives errors, you have done something wrong. If you want to replace that part, replace it with /system_root/system
Sent from my Mi 9 SE using Tapatalk
Click to expand...
Click to collapse
Thanks for the quick response. I tried your changes only once again before doing my change and it somehow worked.

Categories

Resources