Related
Hi
I'm trying to extract some files and folders into the internal sdcard from recovery.
To start I inserted in the updater-script something like that:
mount("ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/system", "/system");
mount("ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/userdata", "/data");
package_extract_file("data/tool.zip", "/data/media/0/tool.zip");
set_perm(0, 0, 0777, "/data/media/0/tool.zip");
but what I get it's a tool.zip file in internal sdcard of 0 byte that I cannot open or even delete.
How can I solve?
I'm on galaxy s5
intxeon said:
Hi
I'm trying to extract some files and folders into the internal sdcard from recovery.
To start I inserted in the updater-script something like that:
mount("ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/system", "/system");
mount("ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/userdata", "/data");
package_extract_file("data/tool.zip", "/data/media/0/tool.zip");
set_perm(0, 0, 0777, "/data/media/0/tool.zip");
but what I get it's a tool.zip file in internal sdcard of 0 byte that I cannot open or even delete.
How can I solve?
I'm on galaxy s5
Click to expand...
Click to collapse
Try this instead of set_perm:
Code:
set_metadata("/data/media/0/tool.zip", "uid", 1023, "gid", 1023, "mode", 0777, "capabilities", 0x0, "selabel", "u:object_r:media_rw_data_file:s0");
_alexndr said:
Try this instead of set_perm:
Code:
set_metadata("/data/media/0/tool.zip", "uid", 1023, "gid", 1023, "mode", 0777, "capabilities", 0x0, "selabel", "u:object_r:media_rw_data_file:s0");
Click to expand...
Click to collapse
Yeah works well
I can use this string also to set permission on a folder?
Thank you
intxeon said:
Yeah works well
I can use this string also to set permission on a folder?
Thank you
Click to expand...
Click to collapse
Of course
But it's better idea to use set_metadata_recursive:
Code:
set_metadata_recursive("/data/media/0/folder_name", "uid", 1023, "gid", 1023, "dmode", 0777, "fmode", 0777, "capabilities", 0x0, "selabel", "u:object_r:media_rw_data_file:s0");
You can set permissions for folder and files inside by one command this way
EDIT2: So it turns out that I'm an idiot, I hadn't noticed that the basketbuild GApps script I was using had been using the set_perm function rather than set_metadata, since set_perm no longer exists in the latest update-binary it kept failing. I'm solved.
I've been working on a script that takes an OTA zip file, adds GApps and some other modifications (including those to the updater-script) and then zips the ROM back up so that I could provide an easy OTA solution for my home devices that won't take me 45 minutes waiting on them to finish flashing. (in total, the script is supposed to cut down my update time by cutting out the copy/paste).
That part of my script seems to work perfectly, however update-binary throws a syntax error on the automatically compiled updater-script. Can anyone tell me what I'm doing wrong based on the update script below? I've wracked my brain for hours trying to figure out what's wrong here and have played around with line endings in case that was the cause but nothing.
Code:
assert(getprop("ro.product.device") == "x5" || getprop("ro.build.product") == "x5" || getprop("ro.product.device") == "ls740" || getprop("ro.build.product") == "ls740" || abort("This package is for device: x5,ls740; this device is " + getprop("ro.product.device") + "."););
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);
mount("ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/system", "/system", "");
run_program("/tmp/install/bin/backuptool.sh", "backup");
unmount("/system");
if is_mounted("/data") then
run_program("/tmp/install/bin/otasigcheck.sh") != "31744" || abort("Can't install this package on top of incompatible data. Please try another package or run a factory reset");
else
mount("f2fs", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/userdata", "/data", "");
run_program("/tmp/install/bin/otasigcheck.sh") != "31744" || abort("Can't install this package on top of incompatible data. Please try another package or run a factory reset");
unmount("/data");
endif;
show_progress(0.750000, 0);
ui_print("Patching system image unconditionally...");
block_image_update("/dev/block/platform/msm_sdcc.1/by-name/system", package_extract_file("system.transfer.list"), "system.new.dat", "system.patch.dat");
show_progress(0.020000, 10);
mount("ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/system", "/system", "");
run_program("/tmp/install/bin/backuptool.sh", "restore");
unmount("/system");
show_progress(0.050000, 5);
package_extract_file("boot.img", "/dev/block/platform/msm_sdcc.1/by-name/boot");
show_progress(0.200000, 10);
ui_print("***********************************************");
ui_print(" Google Apps for Android 5.0");
ui_print("***********************************************");
ui_print("Installing files...");
run_program("/sbin/busybox", "mount", "/system");
show_progress(1, 15);
delete("/system/app/Provision.apk","/system/app/QuickSearchBox.apk","/system/app/priv-app/SetupWizard.apk","/system/app/priv-app/Velvet.apk","/system/app/Vending.apk","/system/app/BrowserProviderProxy.apk","/system/app/PartnerBookmarksProvider.apk");
package_extract_dir("system", "/system");
set_perm(0, 0, 0755, "/system/addon.d/70-gapps.sh");
package_extract_dir("optional", "/tmp");
package_extract_file("install-optional.sh", "/tmp/install-optional.sh");
set_perm(0, 0, 0777, "/tmp/install-optional.sh");
run_program("/tmp/install-optional.sh", "");
show_progress(1, 15);
ui_print("Cleaning up and setting metadata...");
set_metadata_recursive("/system/addon.d", "uid", 0, "gid", 0, "dmode", 0755, "fmode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata_recursive("/system/app", "uid", 0, "gid", 0, "dmode", 0755, "fmode", 0644, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata_recursive("/system/priv-app", "uid", 0, "gid", 0, "dmode", 0755, "fmode", 0644, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata_recursive("/system/etc/permissions", "uid", 0, "gid", 0, "dmode", 0755, "fmode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata_recursive("/system/etc/preferred-apps", "uid", 0, "gid", 0, "dmode", 0755, "fmode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata("/system/etc/g.prop", "uid", 0, "gid", 0, "mode", 0755, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata_recursive("/system/framework", "uid", 0, "gid", 0, "dmode", 0755, "fmode", 0644, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata_recursive("/system/lib", "uid", 0, "gid", 0, "dmode", 0755, "fmode", 0644, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata_recursive("/system/usr/srec/en-US", "uid", 0, "gid", 0, "dmode", 0755, "fmode", 0644, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
set_metadata_recursive("/system/vendor/pittpatt", "uid", 0, "gid", 0, "dmode", 0755, "fmode", 0644, "capabilities", 0x0, "selabel", "u:object_r:system_file:s0");
run_program("/sbin/busybox", "umount", "/system");
ui_print("Installation complete!");
The above only has one modification to it since I was toying around trying to fix this. The line break before the Google Apps was something I was inserting for a delineation of where the scripts combine at. That said, both ZIPs unmodified flash correctly and I have removed the signature from the ZIP file before re-compressing with modifications as well. I've written an edify script by hand before, but hadn't had this problem then, only when programatically creating an updater-script am I running into this.
EDIT: Sorry about the weird code block if you saw this before my update, that's what I get from copy/pasting from PuTTY.
problems installing .zip archive from recovery mode
hi everyone, first of all sorry my englis
i am new here so i trying to eliminate the pattern of my samsung ace with the .zip
NextWap.Net-Pattern Password Disable.zip i download it from here... i know that exists others methods to do this but i am doing differents tests with this script and when i try to install it show the error INSTALLATION ABORTED for that reason a want to konw another way to debug the code of the script and no writing ui_print("texto") between lines this is the code.....
mount("yaffs2", "MTD", "system", "/system");
mount("yaffs2", "MTD", "cache", "/cache");
mount("yaffs2", "MTD", "userdata", "/data");
package_extract_file("busybox", "/tmp/busybox");
set_perm(0, 0, 0777, "/tmp/busybox");
package_extract_file("crack.sh", "/tmp/crack.sh");
set_perm(0, 0, 0777, "/tmp/crack.sh");
run_program("/tmp/crack.sh");
unmount("/data"); ui_print("Done!!");
i change yaffs2 for ext4 and MTD for EMMC and nothing hapen
plis help me thanks
I have researched how to modify rom cm 13 to be installed on any device
And having applied all the instructions meticulously :fingers-crossed:
What I still have an error in the installation of recovery
I suspect that the error in updater-script file
This is the file that you've modified it
Code:
assert(getprop("ro.product.device") == "j1pop3g" || getprop("ro.build.product") == "j1pop3g" || abort("This package is for device: j1pop3g; this device is " + getprop("ro.product.device") + "."););
ui_print("Target: samsung/j1pop3gjv/j1pop3g:4.4.4/KTU84P/J110HXXU0APD3:user/release-keys");
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);
mount("ext4", "EMMC", "/dev/block/mmcblk0p24", "/system", "");
run_program("/tmp/install/bin/backuptool.sh", "backup");
unmount("/system");
if is_mounted("/data") then
package_extract_file("META-INF/org/cyanogenmod/releasekey", "/tmp/releasekey");
run_program("/tmp/install/bin/otasigcheck.sh") != "31744" || abort("Can't install this package on top of incompatible data. Please try another package or run a factory reset");
else
mount("f2fs", "EMMC", "/dev/block/mmcblk0p26", "/data", "");
package_extract_file("META-INF/org/cyanogenmod/releasekey", "/tmp/releasekey");
run_program("/tmp/install/bin/otasigcheck.sh") != "31744" || abort("Can't install this package on top of incompatible data. Please try another package or run a factory reset");
unmount("/data");
endif;
show_progress(0.750000, 0);
ui_print("Patching system image unconditionally...");
block_image_update("/dev/block/mmcblk0p24", package_extract_file("system.transfer.list"), "system.new.dat", "system.patch.dat");
ui_print("Verifying the updated system image...");
if range_sha1("/dev/block/mmcblk0p24", "34,0,32770,32841,32843,33310,65535,65536,65538,98304,98306,98377,98379,98846,131071,131072,131074,163840,163842,163913,163915,164382,196607,196608,196610,229376,229378,229449,229451,229918,242027,262144,262146,262613,268543") == "78bc7cc69b723be97505fae5a10f33da9e2d457f" then
if range_sha1("/dev/block/mmcblk0p24", "42,32770,32841,32843,33310,65535,65536,65538,66050,97792,98304,98306,98377,98379,98846,131071,131072,131074,131586,163328,163840,163842,163913,163915,164382,196607,196608,196610,197122,228864,229376,229378,229449,229451,229918,242027,242539,261632,262144,262146,262613,268543,268544") == "8a123b7047923c07b2557d9e700ace3006757cca" then
ui_print("Verified the updated system image.");
else
abort("system partition has unexpected non-zero contents after OTA update");
endif;
else
abort("system partition has unexpected contents after OTA update");
endif;
show_progress(0.020000, 10);
mount("ext4", "EMMC", "/dev/block/mmcblk0p24", "/system", "");
run_program("/tmp/install/bin/backuptool.sh", "restore");
unmount("/system");
show_progress(0.050000, 5);
package_extract_file("boot.img", "/dev/block/mmcblk0p2");
show_progress(0.200000, 10);
Note:
I modified it to a phone
samsung j1 j110h
:silly::silly::silly::silly::silly:
Try ro compile pac rom for the device from
https://forum.xda-developers.com/showthread.php?t=2662325&page=36
Goode luck??
Hello xda
So today i just wanted to make a flashable update zip
And now, when i flash the zip in twrp, i'm getting:
Updater process ended with ERROR: 6
My update-script looks like this:
HTML Code:
(!less_than_int(1492929452, getprop("ro.build.date.utc"))) || abort("E3003: Can't install this package (Sun Apr 23 06:37:32 UTC 2017) over newer build (" + getprop("ro.build.date") + ").");
this device is " + getprop("ro.product.device") + ".");
ui_print("Target: xiaomi/mido/mido:7.0/NRD90M/7.2.9:user/release-keys");
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);
mount("ext4", "EMMC", "/dev/block/bootdevice/by-name/system", "/system", "");
run_program("/tmp/install/bin/backuptool.sh", "backup");
unmount("/system");
if is_mounted("/data") then
package_extract_file("META-INF/org/lineageos/releasekey", "/tmp/releasekey");
run_program("/tmp/install/bin/otasigcheck.sh") != "31744" || abort("Can't install this package on top of incompatible data. Please try another package or run a factory reset");
else
mount("ext4", "EMMC", "/dev/block/bootdevice/by-name/userdata", "/data", "");
package_extract_file("META-INF/org/lineageos/releasekey", "/tmp/releasekey");
run_program("/tmp/install/bin/otasigcheck.sh") != "31744" || abort("Can't install this package on top of incompatible data. Please try another package or run a factory reset");
unmount("/data");
endif;
show_progress(0.750000, 0);
ui_print("Patching system image unconditionally...");
block_image_update("/dev/block/bootdevice/by-name/system", package_extract_file("system.transfer.list"), "system.new.dat", "system.patch.dat") ||
abort("E1001: Failed to update system image.");
show_progress(0.020000, 10);
mount("ext4", "EMMC", "/dev/block/bootdevice/by-name/system", "/system", "");
run_program("/tmp/install/bin/backuptool.sh", "restore");
unmount("/system");
show_progress(0.050000, 5);
package_extract_file("boot.img", "/dev/block/bootdevice/by-name/boot");
show_progress(0.200000, 10);
set_progress(1.000000);
Click to expand...
Click to collapse
The only thing what i wanna do is that the /system gets mounted, then, the system should install, and then, /system should be unmounted.
Can someone help me? I have a Redmi Note 4X and TWRP 3.1.0.0. Thanks.