Cleaning system partition and getprop() function - General Questions and Answers

Good day to everyone!
I've am going to move to another device and so I wanted to have some fun tinkering with my old Redmi 3. Doing so I've stumbled upon little issue: Wiping /system partition removes build.prop so getprop() function used in updater-scripts returns empty string.
Code:
assert(getprop("ro.product.device") == "ido" || getprop("ro.build.product") == "ido" || abort("E3004: This package is for device: ido; this device is " + getprop("ro.product.device") + "."););
From what I understand, wiping all partitions including /system is recommended before flashing a new ROM, but that means getprop() function returns empty string and the assertion fails. I have to remove that assertion before installing zip with the ROM.
I must be wrong somewhere because that assertion would make no sense if getprop() always returns empty string on clean device. Any thoughts?

me too
Cubiss said:
Good day to everyone!
I've am going to move to another device and so I wanted to have some fun tinkering with my old Redmi 3. Doing so I've stumbled upon little issue: Wiping /system partition removes build.prop so getprop() function used in updater-scripts returns empty string.
Code:
assert(getprop("ro.product.device") == "ido" || getprop("ro.build.product") == "ido" || abort("E3004: This package is for device: ido; this device is " + getprop("ro.product.device") + "."););
From what I understand, wiping all partitions including /system is recommended before flashing a new ROM, but that means getprop() function returns empty string and the assertion fails. I have to remove that assertion before installing zip with the ROM.
I must be wrong somewhere because that assertion would make no sense if getprop() always returns empty string on clean device. Any thoughts?
Click to expand...
Click to collapse
I'm trying to replace my ROM, wiped the system, data, and caches partitions as instructed, and am also running into this NULL value for product.device. I see no one else has chirped in with a suggestion. I'm now in limbo land and rather not happy.

cawli2 said:
I'm trying to replace my ROM, wiped the system, data, and caches partitions as instructed, and am also running into this NULL value for product.device. I see no one else has chirped in with a suggestion. I'm now in limbo land and rather not happy.
Click to expand...
Click to collapse
Well, there is a workaround. You can just remove the assert from updater-script.
1) Extract \META-INF\com\google\android\updater-script
2) Remove the assert, line should look something like this:
Code:
assert(getprop("ro.product.device") == "ido" || getprop("ro.build.product") == "ido" || abort("E3004: This package is for device: ido; this device is " + getprop("ro.product.device") + "."););
or this
Code:
getprop("ro.product.device") == "polaris" || abort("E3004: This package is for \"polaris\" devices; this is a \"" + getprop("ro.product.device") + "\".");
3) Replace updater-script in zip file with the editted one
Now your zip should install without any errors. Just be sure the zip is actually designated for your device.
Cheers!

that works, thanks!
I've never done a direct file extract-edit-replace into a zip before - learn something new every day! (7zip)
Thank you for this. I had seen the assertion removal in a post elsewhere - unzipped, edit file, rezip but it would not load with that format. So your 'in-place- suggestion did the trick and I am now running LineageOS 16 on my Canadian Samsung Galaxy S4.

Related

galaxy gio :error 7 installation aborted

I'm getting error 7 installation aborted. Just got my phone today.
"GT-5660" || getprop("ro.product.device") == "GT-S5570" || getprop("ro.build.product") == GT-S670" || getprop("ro.product.product") == "GT=S670" || getprop("ro.product.device" == "GT-B7510" || getprop("ro.product.product"( == "GT-B7510"
E:Error in /tmp/sideload/package.zip
(Status 7)
Model: GT-S5660V
how to solve?
error 7 message
This is what I did with cm7 and ultrajack on my 8150a...
If you unzip the rom file and go into: META-INF\com\google\android open the updater script in notepad and remove the first line (assert) save and re-zip the files and that should get rid of the error 7 message when flashing with ultrajack.
Hello could you tell me how to open the update scrip in Notepad
are not very practical
thanks
script
Right click the file and it will ask you what program it wants to be opened with.. select notepad.. edit it and then save. Then zip up the files you opened previously.
thedrill said:
Right click the file and it will ask you what program it wants to be opened with.. select notepad.. edit it and then save. Then zip up the files you opened previously.
Click to expand...
Click to collapse
but be sure that deleted the first line?
because here http://forum.xda-developers.com/showthread.php?t=1111414&page=4
says that we must add 5660m but to me is 5660v

[Q] Flashing Cyanogenmod 10

I'm trying to flash Cyanogenmod 10 stable on my Nexus S 4g using TWRP 2.3.3.0. As soon as it starts, it stops with:
script aborted: assert failed: getprop("ro.product.device") == "crespo4g" || getprop("ro.build.product") == "crespo4g"
assert failed: getprop("ro.product.device") == "crespo4g" || getprop("ro.build.product") == "crespo4g"
E:Error in /sdcard/Download/cm-10.0.0-crespo4g.zip
(Status 7)
Error flashing zip '/sdcard/Download/cm-10.0.0-crespo4g.zip'
I tried the CM 10.1 M zip and got the same error.
Any thoughts on things to try?
Thanks!
Not sure about twrp, but with cwm, there is an option to toggle assert before flashing.
I reflashed TWRP and that solved the issue. Thanks!

[ROM][4.4.2][BETA V3][UNOFFICIAL][MultiWindow]OMNI 4.4.2 for GalaxyR

Hi.
After some time using PAC-man 4.3 AIO, which I really like, I've decided to try the new [ROM][4.4.2][BETA V3][UNOFFICIAL][MultiWindow]OMNI 4.4.2 for GalaxyR
I've first flashed the TWRP version (2.6.3.1) in the link in the OP, but I've been unable to flash any ROM with this recovery. Back to CWM Recovery 6.0.1.5 touch and the new rom's been flashed with no problems, so it seems that the TWRP version in the OP is not working OK with our phone.
And what's worse, I've made a nandroid backup after trying the new rom. The backup has ended with no error, but when I've tried to restore it back It failed. Most of the data backed (1.5 GB) was in a lost+found folder inside the tar file. TWRP failed to restore and the system was unusable.
I had also a Titanium backup, so I had no data lost, but just wanted to report the problem.
Don't use 2.6.3.1 TWRP version, just stick to the previous 2.5 (has worked ok for me) or to CWM.
First thing, we have discussion thread... Why new thread?
Did u rebooted once after flashing twrp 2.6.3.1? This is must...
Sent from my GT-I9103 using Tapatalk
Sorry, I didn't nottice the discussion thread.
Yes, after flashing TWRP I rebooted the device, restarted again in recovery, TWRP backup OK and no way to flash ROM.
Post the recovery log... What error u r getting?
Sent from my GT-I9103 using xda app-developers app
Tried to reproduce again.
Flashed TWRP 2.6.3.1 again
reboot to 4.4 ROM and back to recovery mode.
Backup with TWRP
Wipe
Flash 4.4 ROM -> OK
Flash PACrom 4.3 -> Error
Restore previous backup -> OK
So, the problem with TWRM seems to be only with PACrom and not with 4.4, and the failure in the previous restore coud have been related to some corruption in my data (I have not recorded the log) . Can't attach the log. the error was:
Code:
Installing '/external_sd/ROM/PAC_rom/pac_i9103-nightly-20140111.zip'...
Checking for MD5 file...
I:Cannot find file /external_sd/ROM/PAC_rom/pac_i9103-nightly-20140111.zip.md5
Skipping MD5 check: no MD5 file found.
I:Zip contains SELinux file_contexts file in its root. Extracting to /file_contexts
script aborted: assert failed: getprop("ro.product.device") == "galaxyr" || getprop("ro.build.product") == "galaxyr" ||
getprop("ro.product.device") == "i9103" || getprop("ro.build.product") == "i9103" ||
getprop("ro.product.device") == "GT-I9103" || getprop("ro.build.product") == "GT-I9103" ||
getprop("ro.product.device") == "GTI9103" || getprop("ro.build.product") == "GTI9103"
assert failed: getprop("ro.product.device") == "galaxyr" || getprop("ro.build.product") == "galaxyr" || getprop("ro.product.device") == "i9103" || getprop("ro.build.product") == "i9103" || getprop("ro.product.device") == "GT-I9103" || getprop("ro.build.product") == "GT-I9103" || getprop("ro.product.device") == "GTI9103" || getprop("ro.build.product") == "GTI9103"
E:Error executing updater binary in zip '/external_sd/ROM/PAC_rom/pac_i9103-nightly-20140111.zip'
Error flashing zip '/external_sd/ROM/PAC_rom/pac_i9103-nightly-20140111.zip'
By the way, testing 4.4 rom, looks great. The screen for unlocking the SIM is not OK, all the numbers appear only by half.
Was unable to use the SD as a storage device, but after setprop persist.sys.usb.config mtp,adb it worked, no need to reboot.
Will keep on using 4.4
calling
i'm not able to make or receive calls.The proximity sensors remains red nd the screen blacks out.
venersi one
I think you should put the message on the discussion thread
I opened that thread by mistake, and all comments should be in the other one.

xperia Z3dual flash ROM failed

I'm using a xperia z3dual,and yesterday I found a RR6.0.1 ROM and I tried to flash it.But TWRP keeps say ERROR 7.
I found update-script in the ROM package,and found this code:
HTML:
assert(getprop("ro.product.device") == "D6633" || getprop("ro.build.product") == "D6633" || getprop("ro.product.device") == "D6683" || getprop("ro.build.product") == "D6683" || getprop("ro.product.device") == "z3dual" || getprop("ro.build.product") == "z3dual" || abort("This package is for device: D6633,D6683,z3dual; this device is " + getprop("ro.product.device") + "."););
ui_print("Target: Sony/D6633/D6633:5.1.1/23.4.A.0.546/864948651:user/release-keys");
I guess that means verify the device.But it just thought my device is z3(actually D6683).I tried to edit this in the zip package,then tried to flash it and got an ERROR6.I was really puzzled.
Then I tried to edit build.prop using RootExplorer,it seems to work,I tried to getprop in the syetem:
HTML:
adb shell getprop ro.product.device
D6683
But when I reboot into recovery,getprop still return z3.I don't konw why.Could someone help me?
(Sorry for my terrible English)

Need Help for OTA update after Root on Ulefone with Mediatek device

I have an Ulefone Armor 11 5G that I rooted with magisk and modded vb-meta. The telphone works fine, a couple of days ago I receive the info of an OTA update that will update my phone to the version available on the site, but even if I flash back again the original vbmeta and boot partition, it says that maps block doesn't match.
I read that updating the whole ROM using Mediatek software and scatter file will do a factory reset of my phone, is it true?
Is it possible to find what this OTA will change and only modifies this partition/files?
TIA
I was able to download the OTA package and I think the problem is that it want to patch the boot.img.
Can somebody help me to mod the update-binary script so that instead of patching boot.img it can install direct a magisk patched image?
Here is the script:
getprop("ro.product.device") == "Armor_11_5G" || abort("E3004: This package is for \"Armor_11_5G\" devices; this is a \"" + getprop("ro.product.device") + "\".");
ui_print("Source: Ulefone/Armor_11_5G_EEA/Armor_11_5G:10/QP1A.190711.020/1608088743:user/release-keys");
ui_print("Target: Ulefone/Armor_11_5G_EEA/Armor_11_5G:10/QP1A.190711.020/1608088743:user/release-keys");
ui_print("Verifying current system...");
getprop("ro.build.fingerprint") == "Ulefone/Armor_11_5G_EEA/Armor_11_5G:10/QP1A.190711.020/1608088743:user/release-keys" ||
getprop("ro.build.fingerprint") == "Ulefone/Armor_11_5G_EEA/Armor_11_5G:10/QP1A.190711.020/1608088743:user/release-keys" ||
abort("E3001: Package expects build fingerprint of Ulefone/Armor_11_5G_EEA/Armor_11_5G:10/QP1A.190711.020/1608088743:user/release-keys or Ulefone/Armor_11_5G_EEA/Armor_11_5G:10/QP1A.190711.020/1608088743:user/release-keys; this device has " + getprop("ro.build.fingerprint") + ".");
patch_partition_check("EMMC:/dev/block/by-name/boot:33554432:223ec34e2968174b6d3da29dac6f8a0bfcca5d0a",
"EMMC:/dev/block/by-name/boot:33554432:4cecdfac1f170168f75e6d211bf6183bccc2c87a") ||
abort("E3005: \"EMMC:/dev/block/by-name/boot:33554432:223ec34e2968174b6d3da29dac6f8a0bfcca5d0a\" or \"EMMC:/dev/block/by-name/boot:33554432:4cecdfac1f170168f75e6d211bf6183bccc2c87a\" has unexpected contents.");
apply_patch_space(56631296) || abort("E3006: Not enough free space on /cache to apply patches.");
patch_partition_check("EMMC:/dev/block/by-name/md1img:66856432:5521bd20270f93c39a09be3cbd530b9297c959b7",
"EMMC:/dev/block/by-name/md1img:66794448:86f1fe5a143a19caf7339b05bf06f139021a4bfe") ||
abort("E3005: \"EMMC:/dev/block/by-name/md1img:66856432:5521bd20270f93c39a09be3cbd530b9297c959b7\" or \"EMMC:/dev/block/by-name/md1img:66794448:86f1fe5a143a19caf7339b05bf06f139021a4bfe\" has unexpected contents.");
apply_patch_space(66856432) || abort("E3006: Not enough free space on /cache to apply patches.");
if (range_sha1(map_partition("system"), "24,1,153,169,180,196,197,208,32770,32865,98306,98401,163842,163937,229378,229473,294914,295009,360480,360491,389561,390752,396945,397037,397038") == "656b63aa2bc44a7f7d7bf43bf9543f2efa3b3786" || block_image_verify(map_partition("system"), package_extract_file("system.transfer.list"), "system.new.dat", "system.patch.dat")) then
ui_print("Verified system image...");
else
check_first_block(map_partition("system"));
ifelse (block_image_recover(map_partition("system"), "24,1,153,169,180,196,197,208,32770,32865,98306,98401,163842,163937,229378,229473,294914,295009,360480,360491,389561,390752,396945,397037,397038") && block_image_verify(map_partition("system"), package_extract_file("system.transfer.list"), "system.new.dat", "system.patch.dat"), ui_print("system recovered successfully."), abort("E1004: system partition fails to recover"));
endif;
if (range_sha1(map_partition("vendor"), "62,1,75,612,618,635,636,657,900,1003,1005,1027,1028,3054,3055,14771,15407,16890,16902,16903,16905,16939,16990,17071,17072,17464,17465,17676,17677,17767,17914,27263,27769,27963,27964,28426,28427,29633,29647,29993,29994,30275,30939,31133,31134,32768,32770,32804,32844,49027,49109,51061,51062,53969,98306,98340,131101,131103,139062,139494,141707,141751,141752") == "34846d8a2c7977538dadd1efb5d91f9966e9063e" || block_image_verify(map_partition("vendor"), package_extract_file("vendor.transfer.list"), "vendor.new.dat", "vendor.patch.dat")) then
ui_print("Verified vendor image...");
else
check_first_block(map_partition("vendor"));
ifelse (block_image_recover(map_partition("vendor"), "62,1,75,612,618,635,636,657,900,1003,1005,1027,1028,3054,3055,14771,15407,16890,16902,16903,16905,16939,16990,17071,17072,17464,17465,17676,17677,17767,17914,27263,27769,27963,27964,28426,28427,29633,29647,29993,29994,30275,30939,31133,31134,32768,32770,32804,32844,49027,49109,51061,51062,53969,98306,98340,131101,131103,139062,139494,141707,141751,141752") && block_image_verify(map_partition("vendor"), package_extract_file("vendor.transfer.list"), "vendor.new.dat", "vendor.patch.dat"), ui_print("vendor recovered successfully."), abort("E2004: vendor partition fails to recover"));
endif;
if (range_sha1(map_partition("product"), "352,1,110,5400,5404,8920,8921,13665,13669,16029,16032,18403,18404,25978,25979,27629,27633,31435,31436,32768,32770,32864,32870,38451,38452,39987,39991,42358,42798,42806,42807,48833,48837,53149,53150,53167,53171,53175,53176,53540,53544,54051,54052,54064,54068,54072,54073,60966,60967,61368,61372,62361,62362,62386,62390,62394,62395,62825,62829,62840,62841,64225,64229,64238,64239,65536,65542,67890,67891,68448,68450,69131,69132,69139,69143,71742,71743,78908,78909,86959,86963,89303,89304,98304,98306,98400,98406,100737,100738,101368,101372,111609,111610,111616,111617,119066,119067,125174,125178,130798,130799,130805,130808,130835,130839,130843,130844,130896,130900,130905,130906,130948,130952,130956,130957,131035,131039,131045,131046,131050,131054,131058,131059,131072,131078,140822,140826,140832,140833,152040,152041,159105,159109,163840,163842,163936,163942,164963,164964,165345,165349,165359,165360,180526,180530,180534,180537,180541,180542,185942,185946,190096,190097,196608,196614,206493,206494,208761,208765,209526,209529,210295,210296,215527,215528,216770,216774,220759,220760,227143,227144,229376,229378,229472,229478,234350,234354,240108,240111,245871,245876,250032,250034,250042,250043,250044,250045,250063,250064,250065,250066,250072,250073,250111,250115,250120,250123,250128,250129,250340,250341,250433,250436,250536,250538,250541,250542,250545,250546,250549,250550,250553,250554,250557,250558,250561,250562,250565,250566,250571,250572,250577,250578,250583,250584,250607,250608,250628,250629,250635,250636,250656,250657,250673,250674,250680,250681,250698,250699,250705,250706,250725,250726,250741,250742,250747,250748,250766,250767,250773,250774,250794,250795,250811,250812,250815,250816,250819,250820,250823,250824,250827,250828,250831,250832,250835,250836,250840,250841,250845,250846,250850,250851,250858,251115,251410,251414,251424,251425,251805,251809,251819,251820,255667,255668,255986,255990,256071,256072,257390,257394,257431,257432,257456,257460,257464,257465,258997,259003,259032,259033,262144,262150,263001,263005,263089,263090,279472,279473,285921,285923,288682,288686,288732,288736,289137,289140,289545,289546,289717,289721,289728,289729,289769,289773,289778,289779,289915,289919,289927,289928,291176,291180,291209,291210,292259,292263,292272,292273,292337,292341,292345,294914,295008,327681,327686,360449,360454,386405,387571,393713,393805,393806") == "52984c63abc36a83819c139fa911df1f51ce3922" || block_image_verify(map_partition("product"), package_extract_file("product.transfer.list"), "product.new.dat", "product.patch.dat")) then
ui_print("Verified product image...");
else
ifelse (block_image_recover(map_partition("product"), "352,1,110,5400,5404,8920,8921,13665,13669,16029,16032,18403,18404,25978,25979,27629,27633,31435,31436,32768,32770,32864,32870,38451,38452,39987,39991,42358,42798,42806,42807,48833,48837,53149,53150,53167,53171,53175,53176,53540,53544,54051,54052,54064,54068,54072,54073,60966,60967,61368,61372,62361,62362,62386,62390,62394,62395,62825,62829,62840,62841,64225,64229,64238,64239,65536,65542,67890,67891,68448,68450,69131,69132,69139,69143,71742,71743,78908,78909,86959,86963,89303,89304,98304,98306,98400,98406,100737,100738,101368,101372,111609,111610,111616,111617,119066,119067,125174,125178,130798,130799,130805,130808,130835,130839,130843,130844,130896,130900,130905,130906,130948,130952,130956,130957,131035,131039,131045,131046,131050,131054,131058,131059,131072,131078,140822,140826,140832,140833,152040,152041,159105,159109,163840,163842,163936,163942,164963,164964,165345,165349,165359,165360,180526,180530,180534,180537,180541,180542,185942,185946,190096,190097,196608,196614,206493,206494,208761,208765,209526,209529,210295,210296,215527,215528,216770,216774,220759,220760,227143,227144,229376,229378,229472,229478,234350,234354,240108,240111,245871,245876,250032,250034,250042,250043,250044,250045,250063,250064,250065,250066,250072,250073,250111,250115,250120,250123,250128,250129,250340,250341,250433,250436,250536,250538,250541,250542,250545,250546,250549,250550,250553,250554,250557,250558,250561,250562,250565,250566,250571,250572,250577,250578,250583,250584,250607,250608,250628,250629,250635,250636,250656,250657,250673,250674,250680,250681,250698,250699,250705,250706,250725,250726,250741,250742,250747,250748,250766,250767,250773,250774,250794,250795,250811,250812,250815,250816,250819,250820,250823,250824,250827,250828,250831,250832,250835,250836,250840,250841,250845,250846,250850,250851,250858,251115,251410,251414,251424,251425,251805,251809,251819,251820,255667,255668,255986,255990,256071,256072,257390,257394,257431,257432,257456,257460,257464,257465,258997,259003,259032,259033,262144,262150,263001,263005,263089,263090,279472,279473,285921,285923,288682,288686,288732,288736,289137,289140,289545,289546,289717,289721,289728,289729,289769,289773,289778,289779,289915,289919,289927,289928,291176,291180,291209,291210,292259,292263,292272,292273,292337,292341,292345,294914,295008,327681,327686,360449,360454,386405,387571,393713,393805,393806") && block_image_verify(map_partition("product"), package_extract_file("product.transfer.list"), "product.new.dat", "product.patch.dat"), ui_print("product recovered successfully."), abort("E2004: product partition fails to recover"));
endif;
# ---- start making changes here ----
# --- Start patching dynamic partitions ---
# Update dynamic partition metadata
assert(update_dynamic_partitions(package_extract_file("dynamic_partitions_op_list")));
# Patch partition product
ui_print("Patching product image after verification.");
block_image_update(map_partition("product"), package_extract_file("product.transfer.list"), "product.new.dat", "product.patch.dat") ||
abort("E2001: Failed to update product image.");
# Patch partition vendor
ui_print("Patching vendor image after verification.");
show_progress(0.100000, 0);
block_image_update(map_partition("vendor"), package_extract_file("vendor.transfer.list"), "vendor.new.dat", "vendor.patch.dat") ||
abort("E2001: Failed to update vendor image.");
# Patch partition system
ui_print("Patching system image after verification.");
show_progress(0.800000, 0);
block_image_update(map_partition("system"), package_extract_file("system.transfer.list"), "system.new.dat", "system.patch.dat") ||
abort("E1001: Failed to update system image.");
# --- End patching dynamic partitions ---
ui_print("Patching boot image...");
show_progress(0.100000, 10);
patch_partition("EMMC:/dev/block/by-name/boot:33554432:223ec34e2968174b6d3da29dac6f8a0bfcca5d0a",
"EMMC:/dev/block/by-name/boot:33554432:4cecdfac1f170168f75e6d211bf6183bccc2c87a",
package_extract_file("boot.img.p")) ||
abort("E3008: Failed to apply patch to EMMC:/dev/block/by-name/boot:33554432:4cecdfac1f170168f75e6d211bf6183bccc2c87a");
show_mtupdate_stage("/cache/recovery/last_mtupdate_stage");
ifelse (
less_than_int(get_mtupdate_stage("/cache/recovery/last_mtupdate_stage"), "1") ,
(
ui_print("start to update general image");
package_extract_file("pi_img.img", "/dev/block/by-name/pi_img");
package_extract_file("cam_vpu3.img", "/dev/block/by-name/cam_vpu3");
package_extract_file("dtbo.img", "/dev/block/by-name/dtbo");
package_extract_file("vbmeta_system.img", "/dev/block/by-name/vbmeta_system");
package_extract_file("vbmeta_vendor.img", "/dev/block/by-name/vbmeta_vendor");
package_extract_file("cam_vpu2.img", "/dev/block/by-name/cam_vpu2");
package_extract_file("cam_vpu1.img", "/dev/block/by-name/cam_vpu1");
ui_print("Patching md1img image...");
show_progress(0.100000, 10);
patch_partition("EMMC:/dev/block/by-name/md1img:66856432:5521bd20270f93c39a09be3cbd530b9297c959b7",
"EMMC:/dev/block/by-name/md1img:66794448:86f1fe5a143a19caf7339b05bf06f139021a4bfe",
package_extract_file("patch/md1img.img.p")) ||
abort("E3008: Failed to apply patch to EMMC:/dev/block/by-name/md1img:66794448:86f1fe5a143a19caf7339b05bf06f139021a4bfe");
package_extract_file("spmfw.img", "/dev/block/by-name/spmfw");
set_mtupdate_stage("/cache/recovery/last_mtupdate_stage", "1");
),
ui_print("general images are already updated");
);
ifelse (
less_than_int(get_mtupdate_stage("/cache/recovery/last_mtupdate_stage"), "3") ,
(
if less_than_int(get_mtupdate_stage("/cache/recovery/last_mtupdate_stage"), "2") then
ui_print("start to update alt loader image");
package_extract_file("sspm.img", "/dev/block/by-name/sspm_2");
package_extract_file("tee.img", "/dev/block/by-name/tee2");
package_extract_file("scp.img", "/dev/block/by-name/scp2");
package_extract_file("mcupm.img", "/dev/block/by-name/mcupm_2");
package_extract_file("lk.img", "/dev/block/by-name/lk2");
package_extract_file("dpm.img", "/dev/block/by-name/dpm_2");
set_mtupdate_stage("/cache/recovery/last_mtupdate_stage", "2");
endif;
switch_active("sspm_1", "sspm_2");
switch_active("tee1", "tee2");
switch_active("scp1", "scp2");
switch_active("mcupm_1", "mcupm_2");
switch_active("lk", "lk2");
switch_active("dpm_1", "dpm_2");
set_mtupdate_stage("/cache/recovery/last_mtupdate_stage", "3");
),
ui_print("alt loder images are already updated");
);
ifelse (
less_than_int(get_mtupdate_stage("/cache/recovery/last_mtupdate_stage"), "5") ,
(
if less_than_int(get_mtupdate_stage("/cache/recovery/last_mtupdate_stage"), "4") then
ui_print("start to update main loader image");
package_extract_file("sspm.img", "/dev/block/by-name/sspm_1");
package_extract_file("tee.img", "/dev/block/by-name/tee1");
package_extract_file("scp.img", "/dev/block/by-name/scp1");
package_extract_file("mcupm.img", "/dev/block/by-name/mcupm_1");
package_extract_file("lk.img", "/dev/block/by-name/lk");
package_extract_file("dpm.img", "/dev/block/by-name/dpm_1");
set_mtupdate_stage("/cache/recovery/last_mtupdate_stage", "4");
endif;
switch_active("sspm_2", "sspm_1");
switch_active("tee2", "tee1");
switch_active("scp2", "scp1");
switch_active("mcupm_2", "mcupm_1");
switch_active("lk2", "lk");
switch_active("dpm_2", "dpm_1");
),
ui_print("main loader images are already updated");
);
delete("/cache/recovery/last_mtupdate_stage");
package_extract_file("vbmeta.img", "/dev/block/by-name/vbmeta");
post_ota_action();
set_progress(1.000000);
Click to expand...
Click to collapse
In bold Are the parts that I think should be modded.
Thanks
P.S.
If I remove:
patch_partition_check("EMMC:/dev/block/by-name/boot:33554432:223ec34e2968174b6d3da29dac6f8a0bfcca5d0a",
"EMMC:/dev/block/by-name/boot:33554432:4cecdfac1f170168f75e6d211bf6183bccc2c87a") ||
abort("E3005: \"EMMC:/dev/block/by-name/boot:33554432:223ec34e2968174b6d3da29dac6f8a0bfcca5d0a\" or \"EMMC:/dev/block/by-name/boot:33554432:4cecdfac1f170168f75e6d211bf6183bccc2c87a\" has unexpected contents.");
apply_patch_space(56631296) || abort("E3006: Not enough free space on /cache to apply patches.");
Click to expand...
Click to collapse
and I change
ui_print("Patching boot image...");
show_progress(0.100000, 10);
patch_partition("EMMC:/dev/block/by-name/boot:33554432:223ec34e2968174b6d3da29dac6f8a0bfcca5d0a",
"EMMC:/dev/block/by-name/boot:33554432:4cecdfac1f170168f75e6d211bf6183bccc2c87a",
package_extract_file("boot.img.p")) ||
abort("E3008: Failed to apply patch to EMMC:/dev/block/by-name/boot:33554432:4cecdfac1f170168f75e6d211bf6183bccc2c87a");
show_mtupdate_stage("/cache/recovery/last_mtupdate_stage");
ifelse (
less_than_int(get_mtupdate_stage("/cache/recovery/last_mtupdate_stage"), "1") ,
(
Click to expand...
Click to collapse
with
ui_print("start to update boot image");
package_extract_file("boot.img", "/dev/block/by-name/boot");
Click to expand...
Click to collapse
updating the right file in update.zip package it should work, am I wrong?
If I repack teh official recovery of the Ulefone without otacerts.zip would it me allow to sideload the update even if is not signed?
A big ;art of me wishes that I could just understand what you are saying and help you with the code changes that you have listed above. I don't have a clue if you have made the correct alterations and I won't even start to pretend I am proficient with rooting. This will be my 6th root and very much my most successful and the smoothest of all. When the OTA update came along I spent a whole night, right from sundown to sunup, looking for the answer that most made sense to me and/or didn't leave me having to download my backup again. After painful amounts of wasted time I took a chance and will say I have successfully updated and have root and nothing else on my phone was altered. I'm not used to being the person who is responsible for posting a-guide-to-what-they-did but I am thrilled to help right now and maybe this will see the eyes of a rare Ulefone Armor 11 5G owner:
- I made sure my phone was backed-up
- Also made sure I had lots of charge (over %50 will suffice)
- (optional and unnecessary) I downloaded the update but didn't allow it to install so I could find the files as I thought I would need to get a boot.img and alter it with Magisk but that was not correct. If you want to find those files I'd have to look again, feel free to ask me for that
- Downloaded the latest official ROM from the Ulefone website (which at the time didn't match the newest OTA update)
- Modified boot.img in magisk
- Moved that file to my laptop
- Removed Magisk
- Flashed the system files from the Official ROM with fastboot
- (if you have the update files) Flash them in fastboot
- If you want to save time just forget that last one and just boot into your phone and update as normal
- When the update is complete made sure to let the OS boot up
- Flashed that file from the other post (I'll find the name)
- Flashed the modified Magisk
- That was it, it worked!
Hope that helps you or someone else
So a small update.
Repacking the recovery without otacert doesn't work, becuase while sideloading it was looking for otacert.
I repack again the official recovery using Carliv image Kitchen for Android and changed the releasekey with the test key that I found in sign-em-anywhere 3.0. Once I did it I flashed the new recovery in my phone.
After that I signed my modded update.zip with MinSignApk.
Now when I launch from recovery adb sideload the process start without showing problem about the signature, but it still stops with an error
Target: Ulefone/Armor_11_5G_EEA/Armor_11_5G: 10/QP1A.190711.020/1608088743:user/release-keys
Verifying current system...
Device was remounted R/W 8 times Last remount happened on Wed Jun 2 11:01:04 2021
unable to use metadata to crrect errors
E1004: system partition fails to recover
E:Error in /sideload/package.zip (status 7)
Install from ADB completed with status 1.
Installation aborted.
E: Fota installation aborted.
E: No such file or directory
E: Fota installation aborted.
E:: Bad file descriptor
Click to expand...
Click to collapse
Can somebody understand where is the problem?
TIA

Categories

Resources