[Q] SuperSU script file - Galaxy S III Q&A, Help & Troubleshooting

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 !");

Related

Need Help With updater-script

Hello to all!
So I was writing an updater-script and for some reason after flashing nothing seems to actually happened... I don't get any errors but when I reboot I don't see my changes reflected. The phone I am using is a Motorola Atrix 2 on 4.0.4. Thanks for any help!!
Here's the script:
Code:
ui_print("Google Now Remover by Farshad525hou");
ui_print("Mounting System");
run_program("/sbin/busybox", "mount", "/system");
ui_print("Removing Google Now");
delete("/system/app/velvet.apk");
delete("/system/app/voicesearchstub.apk");
ui_print("Installing Stock ICS Search");
package_extract_dir("system", "/system");
ui_print("Setting Permissions");
set_perm(0, 0, 0644, "system/app/googlequicksearchbox.apk");
ui_print("Unmounting System");
run_program("/sbin/busybox", "unmount", "/system");
ui_print("Removal Complete!");
ui_print("Don't Forget the Thanks Button!");
I gave you a response in the AROMA/Script thread. It's likely your mount command.
Sent from my LG-P999 using xda premium

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] UPDATE.ZIP Problem

Hi guyz. im currently trying to make update.zip for my android iptv / set top box. i have some issue i hope any of you guyz can help me with it
right now i have 1 method to actualy install apk using update.zip through stock recovery. it will install my apk directly to the "system/data". i dont want that because it will be deleted each time after the system update and i cant uninstall it.
if posible i would like to know how to edit this update.zip file so i can actualy install my apk to the data/app file.
i tried install gapss through this android but cant. i realize that this kind of
not working updater-script
run_program("/sbin/busybox", "mount", "/system");
run_program("/sbin/busybox", "mount", "/cache");
run_program("/sbin/busybox", "mount", "/data");
ui_print("| 80% Installing Applications |");
ui_print("Useless system app removal");
delete("/system/app/CMFileManager.apk");
delete("/system/app/CMWallpapers.apk");
package_extract_dir("data", "/data");
set_perm(1000, 1000, 0644, "/data/app/[PACKAGE].apk");
set_perm_recursive(1000, 1000, 0777, 0777, "/data/data/PACKAGE_DATA_FOLDER");
delete("/data/dalvik-cache/[email protected]@[PACKAGE][email protected]");
run_program("/sbin/busybox", "umount", "/system");
run_program("/sbin/busybox", "umount", "/cache");
run_program("/sbin/busybox", "umount", "/data");
-- any script that using sbin/busybox doest work with this device.
working updater-script
mount("ext4", "EMMC", "/dev/block/mmcblk0p8", "/system");
show_progress(1, 15);
ui_print("Copying files...");
package_extract_dir("system", "/system");
ui_print("Unmounting system...");
unmount("/system");
if posible i want to chage or add line that can copy my "data/app" folder to my device.
here is file of the working update.zip that i have tried.
p/s: this update.zip are very similar to http://joeykrim.com/evo3d/custom/index.php? proceses by this website

Problem while installing zip file

Hi,
I've used the bloatware-removal-skript from this post http://forum.xda-developers.com/android/software/gapps-google-apps-minimal-edition-t2943330 on my Galaxy S5 with CM12.1 for over a year and it worked very fine.
Now I've updated to CM13 and tried the skript again, it won't work. TWRP 2.8.7.0 just says:
Error flashing zip '/sdcard/postinstall.zip'
No further information.
I don't know how to fix this. Here's the content of my "updater-script":
Code:
ui_print("******************************************");
ui_print("Bloatware Removal Script for Android 6.x.x");
ui_print("");
ui_print("Release Date: 2016-01-09");
ui_print("******************************************");
show_progress(1, 15);
ui_print("Unmounting system");
run_program("/sbin/busybox", "umount", "/system");
ui_print("Mounting system");
run_program("/sbin/busybox", "mount", "/system");
show_progress(1, 15);
ui_print("Removing system bloat, if any...");
delete_recursive(
"/system/app/BasicDreams",
"/system/app/Browser",
"/system/app/Calendar",
"/system/app/Camera2",
"/system/app/CMWallpapers",
"/system/app/Eleven",
"/system/app/Email",
"/system/app/Exchange2",
"/system/app/Galaxy4",
"/system/app/HoloSpiralWallpaper",
"/system/app/LiveWallpapers",
"/system/app/LiveWallpapersPicker",
"/system/app/NoiseField",
"/system/app/PhaseBeam",
"/system/app/PhotoPhase",
"/system/app/PhotoTable",
"/system/app/SoundRecorder",
);
delete_recursive(
"/system/priv-app/AudioFX",
);
show_progress(1, 15);
ui_print("Copying files");
package_extract_dir("system", "/system");
show_progress(1, 15);
ui_print("Unmounting system");
run_program("/sbin/busybox", "umount", "/system");
ui_print("Installation complete!");
Any suggestions / ideas?
thx,
bigtreiber

Categories

Resources