[Q]My first updater-scipt can't copy file. Can you help me :( - Android Software/Hacking General [Developers Only]

My first updater-scipt can't copy file. Can you help me
i running this script on CWM5
This is my file --> http://www.mediafire.com/?n3pit1jilrrw4w1
This is my updater-script code :
Code:
ui_print("Adobe flash player - CWM");
ui_print("***Installing Files");
run_program("/sbin/mount", "/data");
package_extract_dir("data", "/data");
ui_print("***Setting Permissions");
set_perm (0, 0, 0644, "/data/app/com.adobe.flashplayer_111102059_11.1.102.59.apk");
set_perm (0, 0, 0644, "/data/data/com.adobe.flashplayer/lib/libflashplayer.so");
set_perm (0, 0, 0644, "/data/data/com.adobe.flashplayer/lib/libstagefright_froyo.so");
set_perm (0, 0, 0644, "/data/data/com.adobe.flashplayer/lib/libstagefright_honeycomb.so");
set_perm (0, 0, 0644, "/data/data/com.adobe.flashplayer/lib/libysshared.so");
unmount("/data");
ui_print("***Completed Reboot your phone***");
(i'm noob eng)

Related

MOD Please Delete

I am trying to learn how to create the edify scripts. I have several ring tones and live wall papers that I like to install and want to just flash them instead of using the adb. I have two folders in the root of the zip file the META-INF and system. Under the system folder I have an app folder, with apk's, and a lib folder for their libraries.
Here was my amend script that worked
Code:
show_progress 0.1 0
copy_dir PACKAGE:system SYSTEM:
set_perm_recursive 0 0 0755 0644 SYSTEM:app
set_perm_recursive 0 0 0755 0644 SYSTEM:lib
show_progress 0.1 10
This is my first edify script that does not work (Status 6)
Code:
show_progress(0.1, 0);
mount("MTD", "system", "/system");
package_extract_dir("system", "/system");
set_perm_recursive(0, 0, 0755, 0644, "/system/app");
set_perm_recursive(0, 0, 0755, 0644, "/system/lib");
unmount("/system");
show_progress(0.1, 10);
Then my latest edify script that runs but does not install the files
Code:
ui_print("Installing Live Wall Paper...");
ui_print("Mounting mount points...");
show_progress(0.1, 0);
run_program("/sbin/mount", "/dev/block/mtdblock4", "/system");
package_extract_dir("system", "/system");
show_progress(0.1, 10);
ui_print("Setting Permissions...");
show_progress(0.2, 0);
set_perm_recursive(0, 0, 0755, 0644, "system/app");
set_perm_recursive(0, 0, 0755, 0644, "system/lib");
show_progress(0.2, 10);
ui_print("Unmounting mount points...");
run_program("/sbin/umount", "/system");
ui_print("Update Complete.");
I want to learn this but I'm just going in circles now.
1. Why would my first edify script not run and gave me a "Status 6".
2. Why does my latest edify script run but does nothing.
Any help would be really really helpful. Thanks in advance.

[Q] custom ROM won't boot

I have an Ainol Novo 7 Basic.
I want to start cooking and this seems like a nice cheap device to start with!
I have made an update.zip using the system folder from the original ics 4.0.3 update.
The updater-script flashes fine in the modded CWM 5.0.5.
After reboot, the device wont boot to android. Just returns to CWM,
Not sure what the problem could be?
Any advice is appreciated.
I am new here and have only been on android just under a year.
I believe it may be a permissions error on my part.
But, I havn't been able to find any clear info on what permissions are needed. Just looked at a couple of other ROM zips updater-scripts for guidance...
Or, maybe there is importance in the order of the commands in updater-script?
here is the updater-script:
Code:
ui_print("<***************-------------------****************>");
ui_print(" Ainol Novo 7 Basic MasterROM 1.0");
ui_print("<***************-------------------****************>");
show_progress(1.000000, 0);
ui_print(" Clearing System...");
format("ext4", "system", "/dev/block/mmcblk0p1", "/system");
ui_print(" Mounting SYSTEM...");
mount("ext4", "system", "/dev/block/mmcblk0p1", "/system");
set_progress(0.140000);
ui_print(" Extracting files to SYSTEM...");
package_extract_dir("system", "/system");
set_progress(0.210000);
ui_print(" Clearing Data...");
format("ext4", "data", "/dev/block/mmcblk0p2", "/data");
ui_print(" Mounting DATA...");
mount("ext4", "data", "/dev/block/mmcblk0p2", "/data");
set_progress(0.280000);
ui_print(" Extracting files to DATA...");
package_extract_dir("data", "/data");
set_progress(0.350000);
ui_print(" Setting Permissions...");
set_perm_recursive(0, 0, 0755, 0644, "/system");
set_perm_recursive(0, 2000, 0755, 0755, "/system/bin");
set_perm_recursive(0, 2000, 0755, 0644, "/system/etc");
set_perm(0, 3003, 02750, "/system/bin/netcfg");
set_perm(0, 3004, 02755, "/system/bin/ping");
set_perm(0, 2000, 06750, "/system/bin/run-as");
set_perm(1000, 1003, 02755, "/system/bin/screenshot");
set_perm(1002, 1002, 0440, "/system/etc/dbus.conf");
set_perm(1014, 2000, 0550, "/system/etc/dhcpcd/dhcpcd-run-hooks");
set_perm_recursive(0, 2000, 0755, 0777, "/system/etc/init.d");
set_perm(0, 0, 0755, "/system/etc/init.d");
set_perm(0, 0, 0755, "/system/etc/wifi/wpa_supplicant.conf");
set_perm(0, 2000, 0550, "/system/etc/init.goldfish.sh");
set_perm(0, 0, 0544, "/system/etc/install-recovery.sh");
set_perm_recursive(0, 0, 0755, 0555, "/system/etc/ppp");
set_perm_recursive(0, 2000, 0755, 0755, "/system/xbin");
set_perm(0, 0, 06755, "/system/xbin/hcitool");
set_perm(0, 0, 06755, "/system/xbin/librank");
set_perm(0, 0, 06755, "/system/xbin/procmem");
set_perm(0, 0, 06755, "/system/xbin/procrank");
set_perm(0, 0, 06755, "/system/xbin/tcpdump");
set_progress(0.490000);
ui_print(" Unmounting DATA...");
unmount("/data");
set_progress(0.770000);
ui_print(" Unmounting SYSTEM...");
unmount("/system");
set_progress(0.840000);
ui_print(" Clearing Cache...");
format("ext4", "cache", "/dev/block/mmcblk0p3", "/cache");
ui_print("****************************************************");
ui_print(" Install complete. Enjoy!");
ui_print("****************************************************");
set_progress(1.000000);
masterjakeway said:
The updater-script flashes fine in the modded CWM 5.0.5.
After reboot, the device wont boot to android. Just returns to CWM,
Not sure what the problem could be?
Click to expand...
Click to collapse
The Novo7 version of CWM is very buggy, it's going to mess up your device. Please, don't use it. Try to reflash the last working version of firmware. You may need to do this twice, first to get native recovery image, then once again to get everything flashed properly with the native recovery.
ps. Friends don't let friends to use CWM on Novo7 Basic/Paladin =)

[ROM][AOSP][JB][4.1.2][STABLE] SuperNexus - I9300 - BUILD 5 - 17.10.12

Hey Guys,
i just tried to install PDroid but it doesn't work. I tried to patch the Rom but it doesnt work..
Got anyone an idea?
Here is the Error Message:
ROOT= /cygdrive/c/xxx/xxx/Desktop/Test/ApGPackages/ap/
TOOL= /cygdrive/c/xxx/xxxDesktop/Test/ApGPackages/ap//patch_tools.tgz
ROM= /cygdrive/c/xxx/xxx/Desktop/Test/SuperNexus-I9300-BUILD5-20121017.zip
ROMX= C:\Users\xxx/xxx\Test\SUPERN~1.ZIP
### verify tools ###
/cygdrive/c/Users/xxx/xxx/Test/ApGPackages/cygwin/bin/patch
/cygdrive/c/Users/xxx/xxx/Test/ApGPackages/cygwin/bin/tar
/cygdrive/c/Users/xxx/xxx/Test/ApGPackages/Java/bin/jar
/cygdrive/c/Users/xxx/xxx/Test/ApGPackages/Java/bin/java
/cygdrive/c/Users/xxx/xxx/Test/ApGPackages/cygwin/bin/cpio
### verify ROM ###
### running ./auto_patcher /cygdrive/c/Users/sven/Desktop/Test/SuperNexus-I9300-BUILD5-20121017.zip pdroid jellybean
PATH= /cygdrive/c/Users/sven/Desktop/Test/ApGPackages/ap/tmp20121024155356:/cygdrive/c/Users/sven/Desktop/Test/ApGPackages/Java/bin:/cygdrive/c/Users/sven/Desktop/Test/ApGPackages/cygwin/bin:/cygdrive/c/Users/sven/Desktop/Test/ApGPackages/cygwin/usr/sbin
### unzip patch tools ###
### unzip patch patches ###
... result of ROM check: RIL= Smdk4210RIL
### probe rom type ###
\vergr�t: system/framework/framework2.jar
\vergr�t: system/framework/framework2.jar
# VER= Auto-Patcher v2.2.03
# OS= cygwin 32bit
# VID= 4.1.2
# PID= pdroid
# MID= JZO54K
# RID= aosp-mod
# ANDR= jellybean
# BDID= 20121017
# DID= m0
# BID= 20121003
### DELETE FILES=
### COPY FILES=
### JAR FILES= system/framework/framework.jar system/framework/core.jar system/framework/services.jar
### APK FILES=
### IMG FILES=
### TXT FILES=
### unzip rom ###
### create updater script ###
... using Clockworkmod installer ...
# generated updater-script
mount("ext4", "EMMC", "/dev/block/mmcblk0p9", "/system");
package_extract_dir("system", "/system");
set_perm_recursive(0, 0, 0755, 0644, "/system");
set_perm_recursive(0, 2000, 0755, 0755, "/system/bin");
set_perm(0, 3003, 02750, "/system/bin/netcfg");
set_perm(0, 3004, 02755, "/system/bin/ping");
set_perm(0, 2000, 06750, "/system/bin/run-as");
set_perm_recursive(1002, 1002, 0755, 0440, "/system/etc/bluetooth");
set_perm(0, 0, 0755, "/system/etc/bluetooth");
set_perm(1000, 1000, 0640, "/system/etc/bluetooth/auto_pairing.conf");
set_perm(3002, 3002, 0444, "/system/etc/bluetooth/blacklist.conf");
set_perm(1002, 1002, 0440, "/system/etc/dbus.conf");
set_perm(1014, 2000, 0550, "/system/etc/dhcpcd/dhcpcd-run-hooks");
set_perm_recursive(0, 2000, 0755, 0755, "/system/etc/init.d");
set_perm(0, 0, 0755, "/system/etc/init.d");
set_perm(0, 2000, 0550, "/system/etc/init.goldfish.sh");
set_perm_recursive(0, 0, 0755, 0555, "/system/etc/ppp");
set_perm(0, 2000, 0755, "/system/vendor");
set_perm(0, 2000, 0755, "/system/vendor/firmware");
set_perm(0, 2000, 0755, "/system/vendor/lib");
set_perm_recursive(0, 2000, 0755, 0644, "/system/vendor/lib/drm");
set_perm(0, 0, 0644, "/system/vendor/lib/drm/libdrmwvmplugin.so");
set_perm_recursive(0, 2000, 0755, 0755, "/system/xbin");
set_perm(0, 0, 06755, "/system/xbin/librank");
set_perm(0, 0, 06755, "/system/xbin/procmem");
set_perm(0, 0, 06755, "/system/xbin/procrank");
set_perm(0, 0, 06755, "/system/xbin/su");
unmount("/system");
### create restore.zip ###
### decompile system files ###
... decompile framework.jar ...
... extract preloaded-classes ...
\vergr�t: preloaded-classes
... decompile core.jar ...
... decompile services.jar ...
### jar patch pdroid/jellybean/aosp-mod/20121003 ###
... apply framework.patch ...
1 out of 1 hunk FAILED -- saving rejects to file 'smali/android/app/ContextImpl$20.smali.rej'
... apply preloaded.patch ...
!!! PATCHING FAILED FOR android/app/ContextImpl$20.smali' !!!
!!! patch error for android/app/ContextImpl$20.smali' !!!
**************************************
**************************************

[Q] updater-script

Can anyone give a syntx error in my updater-script
Trying to flash using stock reocvery in my i9100g and give "status (6)" error
ui_print("SuperSU and Busybox Installer for GT-I9100G");
ui_print("3lo0sh @ XDA 2014");
ui_print("Mounting system...");
run_program("/sbin/mount", "/system");
run_program("/sbin/mount", "/system /system");
run_program("/sbin/mount", "/");
run_program("/sbin/mount", "/ /");
ui_print("Removing old files")
delete("/system/bin/su");
delete("/system/xbin/su");
delete("/system/bin/daemonsu");
delete("/system/bin/.ext/.su");
delete("/system/etc/install-recovery.sh");
delete("/system/etc/init.d/99SuperSUDaemon");
delete("/system/etc/.installed_su_daemon");
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");
delete("/data/dalvik-cache/*com.noshufou.android.su*");
delete("/data/dalvik-cache/*com.koushikdutta.superuser*");
delete("/data/dalvik-cache/*com.mgyun.shua.su*");
delete("/data/dalvik-cache/*Superuser.apk*");
delete("/data/dalvik-cache/*SuperUser.apk*");
delete("/data/dalvik-cache/*superuser.apk*");
delete("/data/dalvik-cache/*eu.chainfire.supersu*");
delete("/data/dalvik-cache/*Supersu.apk*");
delete("/data/dalvik-cache/*SuperSU.apk*");
delete("/data/dalvik-cache/*supersu.apk*");
delete("/data/dalvik-cache/*.oat");
delete("/data/app/com.noshufou.android.su-*");
delete("/data/app/com.koushikdutta.superuser-*");
delete("/data/app/com.mgyun.shua.su-*");
delete("/data/app/eu.chainfire.supersu-*");
delete_recursive("/system/bin/.ext");
ui_print("Installing SuperSU...");
package_extract_dir("system", "/system");
ui_print("Disabling OTA survival...");
set_perm(0, 0, 0755, "/system/xbin/chattr");
run_program("/system/xbin/chattr", "-i", "/system/xbin/su");
run_program("/system/xbin/chattr", "-i", "/system/bin/.ext/.su");
run_program("/system/xbin/chattr", "-i", "/system/xbin/daemonsu");
run_program("/system/xbin/chattr", "-i", "/system/etc/install-recovery.sh");
delete("/system/xbin/chattr");
ui_print("Setting permissions...");
set_perm(0, 0, 06755, "/system/xbin/su");
set_perm(0, 0, 0644, "/system/app/Superuser.apk");
set_perm(0, 0, 0644, "/system/app/Superuserpro.apk");
set_perm(0, 0, 04755, "/system/xbin/busybox");
set_perm(0, 0, 0777, "/system/bin/.ext");
set_perm(0, 0, 06755, "/system/bin/.ext/.su");
set_perm(0, 0, 0755, "/system/xbin/daemonsu");
set_perm(0, 0, 0755, "/system/etc/init.d/99SuperSUDaemon");
set_perm(0, 0, 0755, "/system/etc/install-recovery.sh");
set_perm(0, 0, 0644, "/system/etc/.installed_su_daemon");
ui_print("Installing Busybox...");
run_program("/system/xbin/busybox", "--install", "-s", "/system/xbin");
ui_print("Post-installation script...")
run_program("/system/xbin/su", "--install")
ui_print("Unmounting system...");
run_program("/sbin/umount", "/system");
run_program("/sbin/umount", "/");
ui_print("Installation complete!");
ui_print("Reboot now!");
Click to expand...
Click to collapse
plz hep me

lineageOS SU upgrader-script edit file Error 7 & 6

Hello, (sorry for bad english)
this is the first time i'm trying to root my phone so i might look like a fool
I downloaded SU file from official lineageOS page, because i have lineageOS, but i have no root and tried to install, when TWRP showed error 7. I
read that I need to remove the start of the text in upgrader-script. I'll be honest - i have no idea how it works and what should i remove. I was removing line by line and reziping files and tries to install this zip file. Everytime i had error 7, but when i deleted this line:
"If getprop("ro.build.system_root_image") != "true" then package_extract_dir("system", "/system");
TWRP shows error 6.
Can someone explain how this file works, what j should remove from this file to have no error?
Here is the full text from updater-script file:
ifelse(is_mounted("/system"), unmount("/system"));
package_extract_file("mount-system.sh", "/tmp/mount-system.sh");
package_extract_file("unmount-system.sh", "/tmp/unmount-system.sh");
set_metadata("/tmp/mount-system.sh", "uid", 0, "gid", 0, "mode", 0755);
set_metadata("/tmp/unmount-system.sh", "uid", 0, "gid", 0, "mode", 0755);
run_program("/tmp/mount-system.sh") == 0 || abort("Could not mount /system");
if getprop("ro.build.system_root_image") != "true" then
package_extract_dir("system", "/system");
set_metadata("/system/addon.d/51-addonsu.sh", "uid", 0, "gid", 0, "mode", 0755, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/etc/init/superuser.rc", "uid", 0, "gid", 0, "mode", 0644, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/xbin/su", "uid", 0, "gid", 2000, "mode", 0755, "selabel", "u:object_r:su_exec:s0");
symlink("/system/xbin/su", "/system/bin/su");
else
package_extract_dir("system", "/system_root/system");
set_metadata("/system_root/system/addon.d/51-addonsu.sh", "uid", 0, "gid", 0, "mode", 0755, "selabel", "u:object_r:system_file:s0");
set_metadata("/system_root/system/etc/init/superuser.rc", "uid", 0, "gid", 0, "mode", 0644, "selabel", "u:object_r:system_file:s0");
set_metadata("/system_root/system/xbin/su", "uid", 0, "gid", 2000, "mode", 0755, "selabel", "u:object_r:su_exec:s0");
symlink("/system/xbin/su", "/system_root/system/bin/su");
endif;
run_program("/tmp/unmount-system.sh") == 0 || ui_print("Could not unmount /system");
ui_print("Done");
s[ICODE]et_progress(1.000000);[/ICODE
AnykS said:
Hello, (sorry for bad english)
this is the first time i'm trying to root my phone so i might look like a fool
I downloaded SU file from official lineageOS page, because i have lineageOS, but i have no root and tried to install, when TWRP showed error 7. I
read that I need to remove the start of the text in upgrader-script. I'll be honest - i have no idea how it works and what should i remove. I was removing line by line and reziping files and tries to install this zip file. Everytime i had error 7, but when i deleted this line:
"If getprop("ro.build.system_root_image") != "true" then package_extract_dir("system", "/system");
TWRP shows error 6.
Can someone explain how this file works, what j should remove from this file to have no error?
Here is the full text from updater-script file:
ifelse(is_mounted("/system"), unmount("/system"));
package_extract_file("mount-system.sh", "/tmp/mount-system.sh");
package_extract_file("unmount-system.sh", "/tmp/unmount-system.sh");
set_metadata("/tmp/mount-system.sh", "uid", 0, "gid", 0, "mode", 0755);
set_metadata("/tmp/unmount-system.sh", "uid", 0, "gid", 0, "mode", 0755);
run_program("/tmp/mount-system.sh") == 0 || abort("Could not mount /system");
if getprop("ro.build.system_root_image") != "true" then
package_extract_dir("system", "/system");
set_metadata("/system/addon.d/51-addonsu.sh", "uid", 0, "gid", 0, "mode", 0755, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/etc/init/superuser.rc", "uid", 0, "gid", 0, "mode", 0644, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/xbin/su", "uid", 0, "gid", 2000, "mode", 0755, "selabel", "u:object_r:su_exec:s0");
symlink("/system/xbin/su", "/system/bin/su");
else
package_extract_dir("system", "/system_root/system");
set_metadata("/system_root/system/addon.d/51-addonsu.sh", "uid", 0, "gid", 0, "mode", 0755, "selabel", "u:object_r:system_file:s0");
set_metadata("/system_root/system/etc/init/superuser.rc", "uid", 0, "gid", 0, "mode", 0644, "selabel", "u:object_r:system_file:s0");
set_metadata("/system_root/system/xbin/su", "uid", 0, "gid", 2000, "mode", 0755, "selabel", "u:object_r:su_exec:s0");
symlink("/system/xbin/su", "/system_root/system/bin/su");
endif;
run_program("/tmp/unmount-system.sh") == 0 || ui_print("Could not unmount /system");
ui_print("Done");
s[ICODE]et_progress(1.000000);[/ICODE
Click to expand...
Click to collapse
Hi.
What device and version of LineageOS are you using?
The lineage add on su was depreciated after lineage 16.
If you are using Lineage 17 or newer, you will need to use Magisk for root.
Are you using TWRP for recovery or lineage's recovery?
If you are using TWRP, the recovery log file will be more complete and should help figure out what is triggering the error.
The TWRP recovery log file is saved in the tmp directory.
/tmp/recovery.log
If you need links to Magisk, these are the official links.
Downloads are in the github releases page.
Magisk GitHub - Link
Magisk GitHub - Releases - Link
Magisk General Support / Discussion xdaThread - Link
Article about lineage discontinuing add on su.
LineageOS is dropping its own superuser implementation - xdaArticle - Link
What each line in META-INF/com/google/android/updater-script is doing.
Code:
ifelse(is_mounted("/system"), unmount("/system"));
package_extract_file("mount-system.sh", "/tmp/mount-system.sh");
package_extract_file("unmount-system.sh", "/tmp/unmount-system.sh");
set_metadata("/tmp/mount-system.sh", "uid", 0, "gid", 0, "mode", 0755);
set_metadata("/tmp/unmount-system.sh", "uid", 0, "gid", 0, "mode", 0755);
run_program("/tmp/mount-system.sh") == 0 || abort("Could not mount /system");
Check and unmount system if mounted.
Extract the mount-system script from the zip file into the temp directory.
Extract the unmount-system script from the zip file into the temp directory.
Set the permissions for the mount script.
Set the permissions for the unmount script.
Mount system or error out if system can not be mounted.
Then.
Code:
if getprop("ro.build.system_root_image") != "true" then
package_extract_dir("system", "/system");
set_metadata("/system/addon.d/51-addonsu.sh", "uid", 0, "gid", 0, "mode", 0755, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/etc/init/superuser.rc", "uid", 0, "gid", 0, "mode", 0644, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/xbin/su", "uid", 0, "gid", 2000, "mode", 0755, "selabel", "u:object_r:su_exec:s0");
symlink("/system/xbin/su", "/system/bin/su");
else
package_extract_dir("system", "/system_root/system");
set_metadata("/system_root/system/addon.d/51-addonsu.sh", "uid", 0, "gid", 0, "mode", 0755, "selabel", "u:object_r:system_file:s0");
set_metadata("/system_root/system/etc/init/superuser.rc", "uid", 0, "gid", 0, "mode", 0644, "selabel", "u:object_r:system_file:s0");
set_metadata("/system_root/system/xbin/su", "uid", 0, "gid", 2000, "mode", 0755, "selabel", "u:object_r:su_exec:s0");
symlink("/system/xbin/su", "/system_root/system/bin/su");
endif;
The first part is for a traditional device.
System is mounted to /system​
Check if system is rooted, if not then
Extract the su files from the system directory in the zip file into the system directory.
Set the permissions for the addon.d backup script.
This is the script that runs when you update lineage. It will back up and restore the su files and permissions.​
Set the permissions for the superuser rc file.
Set the permissions for the su binary.
Creates a link from bin to xbin.
If su is called from system/bin, it will use system/xbin/su​
The second part (else) runs the same commands as the first part on a system as root device.
System is mounted as system_root/system (This would not work on a device that uses /system/system.)​The endif line just closes the if-then-else statement.
The last part.
Code:
run_program("/tmp/unmount-system.sh") == 0 || ui_print("Could not unmount /system");
ui_print("Done");
set_progress(1.000000);
Unmount system or error out if system can not be unmounted.
Display "Done" on the screen.
Set progress to 100%
Hope this helps more than confuse.
Cheers.
ipdev said:
Hi.
What device and version of LineageOS are you using?
The lineage add on su was depreciated after lineage 16.
If you are using Lineage 17 or newer, you will need to use Magisk for root.
Are you using TWRP for recovery or lineage's recovery?
If you are using TWRP, the recovery log file will be more complete and should help figure out what is triggering the error.
The TWRP recovery log file is saved in the tmp directory.
/tmp/recovery.log
If you need links to Magisk, these are the official links.
Downloads are in the github releases page.
Magisk GitHub - Link
Magisk GitHub - Releases - Link
Magisk General Support / Discussion xdaThread - Link
Article about lineage discontinuing add on su.
LineageOS is dropping its own superuser implementation - xdaArticle - Link
What each line in META-INF/com/google/android/updater-script is doing.
Code:
ifelse(is_mounted("/system"), unmount("/system"));
package_extract_file("mount-system.sh", "/tmp/mount-system.sh");
package_extract_file("unmount-system.sh", "/tmp/unmount-system.sh");
set_metadata("/tmp/mount-system.sh", "uid", 0, "gid", 0, "mode", 0755);
set_metadata("/tmp/unmount-system.sh", "uid", 0, "gid", 0, "mode", 0755);
run_program("/tmp/mount-system.sh") == 0 || abort("Could not mount /system");
Check and unmount system if mounted.
Extract the mount-system script from the zip file into the temp directory.
Extract the unmount-system script from the zip file into the temp directory.
Set the permissions for the mount script.
Set the permissions for the unmount script.
Mount system or error out if system can not be mounted.
Then.
Code:
if getprop("ro.build.system_root_image") != "true" then
package_extract_dir("system", "/system");
set_metadata("/system/addon.d/51-addonsu.sh", "uid", 0, "gid", 0, "mode", 0755, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/etc/init/superuser.rc", "uid", 0, "gid", 0, "mode", 0644, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/xbin/su", "uid", 0, "gid", 2000, "mode", 0755, "selabel", "u:object_r:su_exec:s0");
symlink("/system/xbin/su", "/system/bin/su");
else
package_extract_dir("system", "/system_root/system");
set_metadata("/system_root/system/addon.d/51-addonsu.sh", "uid", 0, "gid", 0, "mode", 0755, "selabel", "u:object_r:system_file:s0");
set_metadata("/system_root/system/etc/init/superuser.rc", "uid", 0, "gid", 0, "mode", 0644, "selabel", "u:object_r:system_file:s0");
set_metadata("/system_root/system/xbin/su", "uid", 0, "gid", 2000, "mode", 0755, "selabel", "u:object_r:su_exec:s0");
symlink("/system/xbin/su", "/system_root/system/bin/su");
endif;
The first part is for a traditional device.
System is mounted to /system​
Check if system is rooted, if not then
Extract the su files from the system directory in the zip file into the system directory.
Set the permissions for the addon.d backup script.
This is the script that runs when you update lineage. It will back up and restore the su files and permissions.​
Set the permissions for the superuser rc file.
Set the permissions for the su binary.
Creates a link from bin to xbin.
If su is called from system/bin, it will use system/xbin/su​
The second part (else) runs the same commands as the first part on a system as root device.
System is mounted as system_root/system (This would not work on a device that uses /system/system.)​The endif line just closes the if-then-else statement.
The last part.
Code:
run_program("/tmp/unmount-system.sh") == 0 || ui_print("Could not unmount /system");
ui_print("Done");
set_progress(1.000000);
Unmount system or error out if system can not be unmounted.
Display "Done" on the screen.
Set progress to 100%
Hope this helps more than confuse.
Cheers.
Click to expand...
Click to collapse
Thank You so much!
I make torrible mistake. You have right - i installed the 17.7.1 version of LineageOS and tried to install SU 16.0. Installation of Magisk was very simple and easy. Finally after 3/4 days i rooted my Motorola E5 (nora)
if I tried to solve it myself, it would take me a long time, so thank you so much again.
Before I deleted the rom zip file by accident and i forgot how i edited upgrader-script file, so your help and explanation of how this script works helped me a lot too!
Thanks again for help and taking yours time.
I heard about magisk before, but I thought it was some strange, dangerous software, but thanks to these links you convinced me
Have a good day!

Categories

Resources