What is the mistake in this code?! - Android Q&A, Help & Troubleshooting

I've created an update.zip, but something is wrong, cause when i flash it, this is the output:
Code:
--Install from sdcard...
Finding update package...
Opening update package...
Installing update...
E:Error in /sdcard/update.zip
(Status 6)
Installation aborted.
But i cant understand where is the mistake in the script. This is my UPDATER-SCRIPT:
Code:
ui_print("|------------------------------|");
ui_print("| 10% Update Started |");
ui_print("| 20% Mounting "/system" |");
ui_print("| 30% Mounting "/cache" |");
ui_print("| 40% Mounting "/data" |");
ui_print("| 50% Mounting "/sdcard" |");
mount("MTD", "system", "/system");
mount("MTD", "cache", "/cache");
mount("MTD", "userdata", "/data");
mount("MTD", "sdcard", "/sdcard");mount("MTD", "system", "/system");
mount("MTD", "cache", "/cache");
mount("MTD", "userdata", "/data");
mount("MTD", "sdcard", "/sdcard");
ifelse
(
is_mounted("/data") == "/data",
ui_print(" Mount ok"),
(
run_program("/sbin/busybox", "mount", "/system");
run_program("/sbin/busybox", "mount", "/cache");
run_program("/sbin/busybox", "mount", "/data");
run_program("/sbin/busybox", "mount", "/sdcard");
)
);
ui_print("| 60% Removing Applications |");
delete("/system/app/Music.apk");
delete("/system/app/DSPManager.apk");
delete("/system/app/GenieWidget.apk");
delete("/system/app/MusicFX.apk");
delete("/system/app/SpareParts.apk");
delete("/system/app/Talk.apk");
delete("/system/app/GalaxyICS-FileManager.apk");
delete("/system/app/QuickSearchBox.apk");
ui_print("| 70% Installing Applications |");
package_extract_dir("data", "/data");
set_perm(1000, 1000, 0644, "/data/app/Facebook.apk");
set_perm_recursive(1000, 1000, 0777, 0777, "/data/data/com.facebook.katana");
delete("/data/dalvik-cache/[email protected]@[email protected]");
ui_print("| *Facebook |");
set_perm(1000, 1000, 0644, "/data/app/FileManager.apk");
delete("/data/dalvik-cache/[email protected]@FileManager.a[email protected]");
ui_print("| *Root Explorer |");
set_perm(1000, 1000, 0644, "/data/app/Flash-10.2.apk");
delete("/data/dalvik-cache/[email protected]@[email protected]");
ui_print("| *Adobe Flash |");
set_perm(1000, 1000, 0644, "/data/app/Gameboid.apk");
set_perm_recursive(1000, 1000, 0777, 0777, "/data/data/com.androidemu.gba");
delete("/data/dalvik-cache/[email protected]@[email protected]");
ui_print("| *Gameboy Emulator |");
set_perm(1000, 1000, 0644, "/data/app/Memo.apk");
delete("/data/dalvik-cache/[email protected]@[email protected]");
ui_print("| *InkPad |");
set_perm(1000, 1000, 0644, "/data/app/MoveTheBox.apk");
delete("/data/dalvik-cache/[email protected]@[email protected]");
ui_print("| *MoveTheBox Game |");
set_perm(1000, 1000, 0644, "/data/app/Music.apk");
delete("/data/dalvik-cache/[email protected]@[email protected]");
ui_print("| *Music Player |");
set_perm(1000, 1000, 0644, "/data/app/Whatsapp.apk");
set_perm_recursive(1000, 1000, 0777, 0777, "/data/data/com.whatsapp");
delete("/data/dalvik-cache/[email protected]@[email protected]");
ui_print("| *Whatsapp |");
set_perm(1000, 1000, 0644, "/data/app/Wpatester.apk");
set_perm_recursive(1000, 1000, 0777, 0777, "/data/data/tester.wpa");
delete("/data/dalvik-cache/[email protected]@[email protected]");
ui_print("| *WPA Tester |");
ui_print("| 80% Removing Dalvik-Cache |");
ui_print("| 90% Unmounting filesystem |");
unmount("/sdcard");
unmount("/data");
unmount("/cache");
unmount("/system");
ifelse
(
is_mounted("/data") == "/data",
(
run_program("/sbin/busybox", "umount", "/system");
run_program("/sbin/busybox", "umount", "/cache");
run_program("/sbin/busybox", "umount", "/data");
run_program("/sbin/busybox", "umount", "/sdcard");
)
);
ui_print("| 100% Installation completed |");

Related

UpdateScript

Can anybody check my code?
Code:
ui_print("UltraRock for ARHD 9.0.0");
ui_print("");
ui_print("");
ui_print("Mounting /system");
mount("ext4", "EMMC", "/dev/block/mmcblk0p9", "/system");
ui_print("");
ui_print("Installing applications");
ui_print("");
package_extract_dir("system", "/system");
ui_print("");
ui_print("Setting permissions");
ui_print("");
run_program("chmod 0644 /system/app/FmRadio.apk");
run_program("chmod 0644 /system/app/SecLauncher2.apk");
ui_print("");
ui_print("Unmounting");
ui_print("");
unmount("/system");
ui_print("Looks we're done");
by some reason it tells me: status 0;
GR0S said:
Can anybody check my code?
Code:
ui_print("UltraRock for ARHD 9.0.0");
ui_print("");
ui_print("");
ui_print("Mounting /system");
mount("ext4", "EMMC", "/dev/block/mmcblk0p9", "/system");
ui_print("");
ui_print("Installing applications");
ui_print("");
package_extract_dir("system", "/system");
ui_print("");
ui_print("Setting permissions");
ui_print("");
run_program("chmod 0644 /system/app/FmRadio.apk");
run_program("chmod 0644 /system/app/SecLauncher2.apk");
ui_print("");
ui_print("Unmounting");
ui_print("");
unmount("/system");
ui_print("Looks we're done");
by some reason it tells me: status 0;
Click to expand...
Click to collapse
I have never seen
Code:
run_program("chmod 0644 /system/app/SecLauncher2.apk");
used for setting permissions..
use this instead
Code:
set_perm(0, 0, 0755, 0644, "/system/app/SecLauncher2.apk");
or
Code:
set_perm_recursive(0, 0, 0755, 0644, "/system/app");

package_extract_dir("data", "/data");

I've been using the updater-script in recovery mode to install apps on system/app and data/app partition
So far, i've had success in installing apps over system/app. But data/app is still out of reach. I have tried almost 50 times but it just doesn't work. I'm starting to think that [package_extract_dir("data", "/data");] is a myth and doesn't actually work in reality.
Here are two different unsuccessful set of codes i've tried
Code:
run_program("/sbin/busybox", "mount", "/data");
package_extract_dir("data", "/data");
set_perm(1000, 1000, 0771, "/data");
set_perm_recursive(1000, 1000, 0771, 0644, "/data/app");
set_perm_recursive(1000, 1000, 0771, 0644, "/data/data");
package_extract_dir("sdcard", "/sdcard");
run_program("/sbin/busybox", "umount", "/data");
Code:
run_program("/sbin/busybox", "mount", "/system");
run_program("/sbin/busybox", "mount", "/cache");
run_program("/sbin/busybox", "mount", "/data");
package_extract_dir("data", "/data");
set_perm_recursive(1000, 1000, 0771, 0644, "/data/app");
run_program("/sbin/busybox", "umount", "/system");
run_program("/sbin/busybox", "umount", "/cache");
run_program("/sbin/busybox", "umount", "/data");
ui_print("Finish");
Any suggestions will be greatly helpful
anyone? no one?
is this thread in the right sub forum?
Always best to ask questions in a questions area. Try here....
Don't keep bumping your thread. Not many people visit this forum, so atleast wait 1 day before bumping.
Instead of using busybox to mount the data partition, get partition info and mount it using mount command
e.g:
mount("/dev/block/mmcblk0p5", "ext4", "/data");
Use your partition address in the first argument. And filesystem type in second
thanks varun, i'll give this a try
i hope it is a mount command issue. I'll post back
edit: later added
how does this look?
Code:
mount("/dev/stl11", "rfs", "/data");
mount("/dev/stl9", "rfs", "/system");
mount("/dev/stl10", "rfs", "/cache");
package_extract_dir("data", "/data");
set_perm_recursive(1000, 1000, 0771, 0644, "/data/app");
umount("/dev/stl11", "rfs", "/data");
umount("/dev/stl9", "rfs", "/system");
umount("/dev/stl10", "rfs", "/cache");
ui_print("Finish");
broadways said:
thanks varun, i'll give this a try
i hope it is a mount command issue. I'll post back
edit: later added
how does this look?
Code:
mount("/dev/stl11", "rfs", "/data");
mount("/dev/stl9", "rfs", "/system");
mount("/dev/stl10", "rfs", "/cache");
package_extract_dir("data", "/data");
set_perm_recursive(1000, 1000, 0771, 0644, "/data/app");
umount("/dev/stl11", "rfs", "/data");
umount("/dev/stl9", "rfs", "/system");
umount("/dev/stl10", "rfs", "/cache");
ui_print("Finish");
Click to expand...
Click to collapse
Its ok if the partition addresses are correct.
And the unmount in incorrect
No args are needed for it
So only
unmount("/system")

[Q] SuperSU script file

I have a Concern about SuperSU root files, while i have been always using Super User for a long time, i could say that SuperSU is much better, but the issue is that i was browsing inside the zip file of the SuperSU and i came to the script file and i opened it with a notepad, while i am not a developer to fully understand whats is written but a few line about copying and fixing permissions for both Maps and youtube make me wonder whats the relation between SuperSU and those apps specially that the script file for Super user never had such lines
This is the Content of the Script file included with the SuperSU:
ui_print("*********************");
ui_print("SuperSU installer ZIP");
ui_print("*********************");
ui_print("- Mounting /system, /data and rootfs");
run_program("/sbin/busybox", "mount", "/system");
run_program("/sbin/busybox", "mount", "/data");
run_program("/sbin/busybox", "mount", "-o", "rw,remount", "/system", "/system");
run_program("/sbin/busybox", "mount", "-o", "rw,remount", "/", "/");
ui_print("- Disabling OTA survival");
package_extract_dir("tools", "/system");
run_program("/system/chattr", "-i", "/system/bin/.ext/.su");
delete("/system/chattr");
ui_print("- Removing old files");
delete("/system/bin/su");
delete("/system/xbin/su");
delete("/system/bin/.ext/.su");
delete("/system/app/Superuser.apk");
delete("/system/app/Superuser.odex");
delete("/system/app/SuperUser.apk");
delete("/system/app/SuperUser.odex");
delete("/system/app/superuser.apk");
delete("/system/app/superuser.odex");
delete("/system/app/Supersu.apk");
delete("/system/app/Supersu.odex");
delete("/system/app/SuperSU.apk");
delete("/system/app/SuperSU.odex");
delete("/system/app/supersu.apk");
delete("/system/app/supersu.odex");
run_program("/sbin/busybox", "rm", "/data/dalvik-cache/*com.noshufou.android.su*");
run_program("/sbin/busybox", "rm", "/data/dalvik-cache/*Superuser.apk*");
run_program("/sbin/busybox", "rm", "/data/dalvik-cache/*SuperUser.apk*");
run_program("/sbin/busybox", "rm", "/data/dalvik-cache/*superuser.apk*");
run_program("/sbin/busybox", "rm", "/data/dalvik-cache/*eu.chainfire.supersu*");
run_program("/sbin/busybox", "rm", "/data/dalvik-cache/*Supersu.apk*");
run_program("/sbin/busybox", "rm", "/data/dalvik-cache/*SuperSU.apk*");
run_program("/sbin/busybox", "rm", "/data/dalvik-cache/*supersu.apk*");
ui_print("- Creating space");
run_program("/sbin/busybox", "cp", "/system/app/Maps.apk", "/Maps.apk");
run_program("/sbin/busybox", "cp", "/system/app/GMS_Maps.apk", "/GMS_Maps.apk");
run_program("/sbin/busybox", "cp", "/system/app/YouTube.apk", "/YouTube.apk");
run_program("/sbin/busybox", "rm", "/system/app/Maps.apk");
run_program("/sbin/busybox", "rm", "/system/app/GMS_Maps.apk");
run_program("/sbin/busybox", "rm", "/system/app/YouTube.apk");
ui_print("- Extracting files");
package_extract_dir("system", "/system");
ui_print("- Restoring files");
run_program("/sbin/busybox", "cp", "/Maps.apk", "/system/app/Maps.apk");
run_program("/sbin/busybox", "cp", "/GMS_Maps.apk", "/system/app/GMS_Maps.apk");
run_program("/sbin/busybox", "cp", "/YouTube.apk", "/system/app/YouTube.apk");
run_program("/sbin/busybox", "rm", "/Maps.apk");
run_program("/sbin/busybox", "rm", "/GMS_Maps.apk");
run_program("/sbin/busybox", "rm", "/YouTube.apk");
ui_print("- Setting permissions");
set_perm(0, 0, 0777, "/system/bin/.ext");
set_perm(0, 0, 06755, "/system/bin/.ext/.su");
set_perm(0, 0, 06755, "/system/xbin/su");
set_perm(0, 0, 0644, "/system/app/Superuser.apk");
set_perm(0, 0, 0644, "/system/app/Maps.apk");
set_perm(0, 0, 0644, "/system/app/GMS_Maps.apk");
set_perm(0, 0, 0644, "/system/app/YouTube.apk");
ui_print("- Unmounting /system and /data");
unmount("/system");
unmount("/data");
ui_print("- Done !");

Setting permissions to file after flashing .zip

I am trying to make my first custom ROM, but I have a problem with permissions.. this is my updater-script:
Code:
ui_print(" ");
ui_print("________________________________");
ui_print(" MADE BY FECHE ");
ui_print(" ** ONLY FOR CRYSTAL QUADCORE ** ");
ui_print("________________________________");
show_progress(0.200000, 10);
ui_print("Mounting..");
mount("ext4", "EMMC", "/dev/block/actc", "/system");
mount("ext4", "EMMC", "/dev/block/acte", "/cache");
mount("ext4", "EMMC", "/dev/block/actd", "/data");
show_progress(0.200000, 20);
delete_recursive("/system");
ui_print("Formatting /system..");
delete_recursive("/cache");
ui_print("Formatting /cache..");
delete_recursive("/data");
ui_print("Formatting /data..");
show_progress(0.200000, 35);
#Install system
ui_print("Installing /system.. (this will take a while)");
package_extract_dir("system", "/system");
show_progress(0.200000, 45);
symlink("/system/xbin/su", "/system/bin/su");
ui_print("Setting permissions..");
set_perm_recursive(0, 0, 0755, 0755, "/system");
show_progress(0.200000, 65);
#Finish_installation
ui_print("Unmouting..");
unmount("/system");
show_progress(0.200000, 80);
unmount("/data");
show_progress(1.000000, 90);
unmount("/cache");
ui_print(" ");
show_progress(1.000000, 0);
ui_print("Done, enjoy! :)");
But when I press on reboot on recovery, it says that the ROOT may have been lost, then it says, repair root? I press on 'no', the device restarts but it gets a black screen right after the device logo.. thanks.
take a look at:
set_perm() or set_perm_recursive()
link: http://forum.xda-developers.com/wiki/Edify_script_language

Fix my .zip

I'm trying make a debloat script for myself on crDroid A11.
Twrp gives errro:6 or error:1
Spoiler: updater-script
Code:
run_program("/sbin/mount", "/system");
ui_print("Deleting Unwanted Apps");
delete_recursive("/system/product/app/DeskClock");
delete_recursive("/system/product/app/Etar");
delete_recursive("/system/product/app/ExactCalculator");
delete_recursive("/system/product/app/Jelly");
delete_recursive("/system/product/app/LatinIME");
delete_recursive("/system/product/app/messaging");
delete_recursive("/system/product/priv-app/Contacts");
delete_recursive("/system/product/priv-app/crDroidMusic");
ui_print("DONE!");
ui_print("Extracting files");
package_extract_dir("system", "/system");
ui_print("Setting permissions");
ui_print(" GBoard");
set_perm(0, 0, 0644, "/system/product/app/GBoard/GBoard.apk");
ui_print(" MiX");
set_perm(0, 0, 0644, "/system/product/app/MiX/MiX.apk");
ui_print(" Nova");
set_perm(0, 0, 0644, "/system/product/app/Nova/Nova.apk");
Please correct where i'm goin wrong

Categories

Resources