[TUT] [for NOOB] editing updater-script for noobs!

DrewT4XP0908

New member
Jul 4, 2018
3
0
0
Im still confused

Hello, I just ported a rom to my device using a windows tool and it said there was a problem with the updater-script so i looked over it and didnt understand anything. I came over to XDA for a solution and found this. After reading i still dont get why when i flash i get an error ending in code 11 in twrp...this is my updater-script. if anyone can help me corrcet the problems that would be great. i just spent a few hours porting this rom and adding extra features to it so i dont wanna trash it...

Updater-Script:
ifelse is_mounted /system/ unmount /system/
package_extract_dir("install", "/tmp/install");
set_metadata_recursive /tmp/install uid 0 gid 0 dmode 0755 fmode" 0644
set_metadata_recursive /tmp/install/bin uid 0 gid 0 dmode 0755 fmode" 0755
run_program("/tmp/install/bin/backuptool.sh", "backup");
show_progress(0.750000, 0);
block_image_update /dev/block/platform/13540000.dwmmc0/by-name/SYSTEM package_extract_file("system.transfer.list system.new.dat.br system.patch.dat abort E1001: Failed to update system", "image.");
show_progress(0.020000, 10);
run_program("/tmp/install/bin/backuptool.sh", "restore");
show_progress(0.050000, 5);
package_extract_file("boot.img", "/dev/block/platform/13540000.dwmmc0/by-name/BOOT");
show_progress(0.200000, 10);
set_progress(1.000000);
set_perm(0, 0, 06755, "/system/xbin/su");
symlink("/system/xbin/su", "/system/bin/su");
set_perm(0, 1000, 0755, "/system/xbin/busybox");
symlink("/system/xbin/busybox", "/system/bin/busybox");
run_program("/system\/xbin\/busybox", "--install", "-s", "/system/xbin");
assert(package_extract_file("boot.img", "/tmp/boot.img"),
write_raw_image("/tmp/boot.img", "boot"),
delete("/tmp/boot.img"));
 

Mikha777

Senior Member
Apr 21, 2011
400
188
0
Hello, I just ported a rom to my device using a windows tool and it said there was a problem with the updater-script so i looked over it and didnt understand anything. I came over to XDA for a solution and found this. After reading i still dont get why when i flash i get an error ending in code 11 in twrp..
Error 11 could be because you don't have the right version of TWRP.
 

Vats12

Senior Member
Jan 2, 2019
89
12
0
Where to get the `update-binary` to flash the zip with adb sideload feature?

Background: I have a Samsung device. I have install a stock ROM on it using Odin3 v3.13. I want to edit the system image of the AP file of the ROM and then flash it. For this I have extracted the system image from the AP file and tried to make a valid tar or tar.md5 file to flash with Odin. It failed to flash. I have also tried Heimdall but got Handshake errors. So, I am thinking of flashing it with adb sideload feature because there is no custom recovery available for my Samsung S10 5G (Qualcomm).

I have created a simple update script as following:
Code:
format("yaffs2", "MTD", "system", "/system");
ui_print("Format Completed");
mount("yaffs2", "MTD", "system", "/system");
package_extract_file("system.img", "/system");
unmount("/system");
Now, the problems is where to get the correct binary to run my script with adb sideload feature?
 

karandpr

Space too small for my titles. Check Signature
Staff member
Feb 20, 2011
9,688
13,151
263
Prolific Troll
Background: I have a Samsung device. I have install a stock ROM on it using Odin3 v3.13. I want to edit the system image of the AP file of the ROM and then flash it. For this I have extracted the system image from the AP file and tried to make a valid tar or tar.md5 file to flash with Odin. It failed to flash. I have also tried Heimdall but got Handshake errors. So, I am thinking of flashing it with adb sideload feature because there is no custom recovery available for my Samsung S10 5G (Qualcomm).

I have created a simple update script as following:
Code:
format("yaffs2", "MTD", "system", "/system");
ui_print("Format Completed");
mount("yaffs2", "MTD", "system", "/system");
package_extract_file("system.img", "/system");
unmount("/system");
Now, the problems is where to get the correct binary to run my script with adb sideload feature?
:eek:
No No No. Your script is for quite old system.
This won't work on newer Samsung phones. (They use emmc)
I doubt you can flash anything using stock Samsung recoveries since the recovery blocks unsigned zips. And only Samsung can sign the zips.
 
  • Like
Reactions: Vats12

Vats12

Senior Member
Jan 2, 2019
89
12
0
:eek:
No No No. Your script is for quite old system.
This won't work on newer Samsung phones. (They use emmc)
I doubt you can flash anything using stock Samsung recoveries since the recovery blocks unsigned zips. And only Samsung can sign the zips.
So, the only option I have is to find a way to flash modified AP file. Do you have any idea how can I make a valid tar/tar.md5 that can be flashed with the Odin? I am facing this issue.
 

karandpr

Space too small for my titles. Check Signature
Staff member
Feb 20, 2011
9,688
13,151
263
Prolific Troll
  • Like
Reactions: Vats12

Vats12

Senior Member
Jan 2, 2019
89
12
0
:eek:
No No No. Your script is for quite old system.
This won't work on newer Samsung phones. (They use emmc)
I doubt you can flash anything using stock Samsung recoveries since the recovery blocks unsigned zips. And only Samsung can sign the zips.
Wondering, Why fastboot don't require such signing and can flash any image?