[SuperSU] avicohh:
Hi [MENTION=631273]Chainfire[/MENTION]

I need help with something, hope it's the right thread for that.

I want to root some devices they don't have TWRP yet.

I was able to modify and flash the stock recovery with my own keys, I signed the zips and all work's fine.

The problem is that the stock recovery (samsung 6.0.1) doesn't recognize this format of zips with update-binary shell script instead of the old update-script.

There is an easy way to convert the newest zip to the old format? (by calling to the update-binary with sh command or something like that)

Thank you very much!

Edit:

For now, until I will find a real solution, I wrote this standart update-script for arm-v7 android 5.1-6.0 (which is almost always the case), and placed the the appropiate binary files in the zip.

ui_print("*********************");
ui_print("SuperSU installer ZIP");
ui_print("*********************");

ui_print("- Mounting /system, /data and rootfs");
run_program("/system/bin/mount", "/system");
run_program("/system/bin/mount", "/data");
run_program("/system/bin/mount", "-o", "rw,remount", "/system", "/system");
run_program("/system/bin/mount", "-o", "rw,remount", "/", "/");

ui_print("- Copying files");
package_extract_dir("system", "/system");
run_program("/system/bin/rm", "/system/bin/app_process");
run_program("/system/bin/rm", "/system/bin/install-recovery.sh");
run_program("/system/bin/mv", "/system/bin/app_process32", "/system/bin/app_process32_original");
run_program("/system/bin/cp", "/system/bin/app_process32_original", "/system/bin/app_process_init");
run_program("/system/bin/ln", "-s", "/system/xbin/daemonsu", "/system/bin/app_process");
run_program("/system/bin/ln", "-s", "/system/xbin/daemonsu", "/system/bin/app_process32");
run_program("/system/bin/ln", "-s", "/system/etc/install-recovery.sh", "/system/bin/install-recovery.sh");

ui_print("- Setting permissions");
set_perm(0, 0, 0755, "/system/app/SuperSU");
set_perm(0, 0, 0644, "/system/app/SuperSU/SuperSU.apk");
set_perm(0, 0, 0755, "/system/bin/.ext");
set_perm(0, 0, 0755, "/system/bin/.ext/.su");
set_perm(0, 0, 0755, "/system/bin/app_process32_original");
set_perm(0, 0, 0755, "/system/bin/app_process_init");
set_perm(0, 0, 0755, "/system/etc/install-recovery.sh");
set_perm(0, 0, 0644, "/system/lib/libsupol.so");
set_perm(0, 0, 0755, "/system/xbin/daemonsu");
set_perm(0, 0, 0755, "/system/xbin/su");
set_perm(0, 0, 0755, "/system/xbin/supolicy");
run_program("/system/bin/chown", "0.2000", "/system/bin/app_process32_original");
run_program("/system/bin/chown", "0:2000", "/system/bin/app_process32_original");
run_program("/system/bin/chown", "0.2000", "/system/bin/app_process_init");
run_program("/system/bin/chown", "0:2000", "/system/bin/app_process_init");

ui_print("- Setting selinux context");
run_program("/system/bin/chcon", "u:object_r:system_file:s0", "/system/app/SuperSU");
run_program("/system/bin/chcon", "u:object_r:system_file:s0", "/system/app/SuperSU/SuperSU.apk");
run_program("/system/bin/chcon", "u:object_r:system_file:s0", "/system/bin/.ext");
run_program("/system/bin/chcon", "u:object_r:system_file:s0", "/system/bin/.ext/.su");
run_program("/system/bin/chcon", "-h", "u:object_r:system_file:s0", "/system/bin/app_process");
run_program("/system/bin/chcon", "-h", "u:object_r:system_file:s0", "/system/bin/app_process32");
run_program("/system/bin/chcon", "-h", "u:object_r:system_file:s0", "/system/bin/install-recovery.sh");
run_program("/system/bin/chcon", "u:object_r:zygote_exec:s0", "/system/bin/app_process32_original");
run_program("/system/bin/chcon", "u:object_r:system_file:s0", "/system/bin/app_process_init");
run_program("/system/bin/chcon", "u:object_r:system_file:s0", "/system/etc/install-recovery.sh");
run_program("/system/bin/chcon", "u:object_r:system_file:s0", "/system/lib/libsupol.so");
run_program("/system/bin/chcon", "u:object_r:system_file:s0", "/system/xbin/daemonsu");
run_program("/system/bin/chcon", "u:object_r:system_file:s0", "/system/xbin/su");
run_program("/system/bin/chcon", "u:object_r:system_file:s0", "/system/xbin/supolicy");

ui_print("- Unmounting /system and /data");
unmount("/system");
unmount("/data");

ui_print("- Done !");

I signed the zip with the keys I created, and it works fine.

But it's the old system-root way (too complicated to include the boot patching in the update-script), so I need also to patch manually the boot.img (sepolicy), for the device will boot up.

I will appriciate any help with converting the last zip to update-script, to support every version and system less.

Thanks.