Modifying OTA updater-script 4.4.3 to update rooted phone - Moto X General

I have a moto X1058 with:
fastboot-ghost_retar-user-4.4.2-KXA20.16-1.26-24-release-keys-cid12-Latam-AR.zip
bootloader unlocked
rooted with supersu
philz_touch_6.41.6-xt1058.zip custom recovery
The update to 4.4.3 came so I dl it, but the update wont work because of my custom rom (I think) so I have to modify the updater-script inside the official OTA Blur_Version.161.44.26.ghost_row.Latam.en.AR.zip if not, I always got the "Status 7" error message.
So first I delete the bold lines:
mount("ext4", "EMMC", "system", "/system");
file_getprop("/system/build.prop", "ro.build.fingerprint") == "motorola/ghost_retar/ghost:4.4.2/KXA20.16-1.26/24:user/release-keys" ||
file_getprop("/system/build.prop", "ro.build.fingerprint") == "motorola/ghost_retar/ghost:4.4.3/KXA21.12-L1.22/58:user/release-keys" ||
abort("Package expects build fingerprint of motorola/ghost_retar/ghost:4.4.2/KXA20.16-1.26/24:user/release-keys or motorola/ghost_retar/ghost:4.4.3/KXA21.12-L1.22/58:user/release-keys; this device has " + getprop("ro.build.fingerprint") + ".");
assert(getprop("ro.product.device") == "ghost" ||
getprop("ro.build.product") == "ghost" ||
getprop("ro.product.device") == "ghost" ||
getprop("ro.build.product") == "ghost");
ui_print("Verifying current system...");
(I thinks this makes the checks pass... I dont know if this will brick the phone if the OTA update is for different from the phone model)
Then I run the update from clockworkmod recovery I have, it gives an error about some APKs that are expected to be on my phone, but arent because I root uninstall them, so it wont update.
Then I delete the each line giving errors, i.e. plusone.apk music2.apk cloudprint.apk etc (each one I uninstalled)
i.e. if I had root uninstall cloudprint.apk I had to delete the lines:
apply_patch_check("/system/app/CloudPrint.apk", "6ae7e170d4f44c6e0f42f200b3861102b86fe92c", "df3f0829bf636b8719245296533bb9e4ca2b62ce") || abort("\"/system/app/CloudPrint.apk\" has unexpected contents.");
and
assert(apply_patch("/system/app/CloudPrint.apk", "-",
6ae7e170d4f44c6e0f42f200b3861102b86fe92c, 3643274,
df3f0829bf636b8719245296533bb9e4ca2b62ce, package_extract_file("patch/system/app/CloudPrint.apk.p")));
Then I tried again the update and it worked
Hope it helps in someway...
PS: to get the OTA zip update I have to let the OTA update asks me to be downloaded, let it download, then with a root file explorer went to /cache/... on the phone and looked for the Blur_Version.161.44.26.ghost_row.Latam.en.AR.zip

If you are on the stock rom the OTA.zip is intended for, but just rooted and removed/changed things (like editing the build.prop, removed bloat APKs, etc), then it is relatively safe to unzip the OTA.zip, edit the manifest file to eliminate some of the checks, then re-zipping and manually applying.
sebadamus said:
....
(I thinks this makes the checks pass... I dont know if this will brick the phone if the OTA update is for different from the phone model)
...
Click to expand...
Click to collapse
The first 3 bold lines in your post show that the update is looking for a specific ROM and version be on your phone by looking in the /system/build.prop file that is currently on your phone, and if your phone doesn't match that, it wont install. Deleting them as you have, the OTA.zip could be applied to any phone. However, some files still wont get updated because their checksum in the manifest wont match the version on the phone (or in your case were not on the phone). That would either cause the OTA to fail, or the wrong versions might get placed on the phone.
If the OTA is for a different mode phone (XT1053 vs XT1058), or different rom (i.e. its a 4.4.3 update and you are applying it to a phone with stock 4.4), then it can get dangerous because you'd end up with mismatched files on your phone, or files that could be incompatible with your model. That is why there is a version check before the OTA installs.

Thanks KidJoe! So if my update is the right one, and the updated files haven been modifiend on my phone from its stock version, but I have a modified recovery, rooted phone or build.prop modified, this way is the only I could find to update applying OTA updates.
I could update to 4.4.4 from 4.4.3 (motox 1058 rooted, custom recovery philz) :good:

Related

Frankdrey's Brick Adventure

Twas the night.......nah that's not gonna work...
Anyways, I had just compiled froyo from android source and wanted to flash it
But apparantly I needed a specific spl when I did "fastboot flashall -w" (one of them being 0.95.0000 or whatever, too lazy to remember..but it was one that didn't support fastboot....which is dumb lol since fastboot is saying to use it)...
So I decided to install engineering spl
I had danger spl and the 2.something radio it needs
I decided to flash it from recovery
BRICK!
So really g1s are impossible to brick...if you flash radio and spls from fastboot not recovery
(Most of this knowledge is from a thread about g1s and spls and bricking that I'm too lazy to link to)
What happens is that recovery FORCES the g1 to boot to recovery on next boot...even if you press buttons
And with a mismatched radio/spl recovery will not start
So you have a brick...
Moral: use fastboot not recovery
Anyways so my solution...
I had a really messed up rogers dream that had a cracked screen and bad ribbon cables...
Pretty much everything was broken except for the motherboard...
Well I decided to try and put this rogers motherboard into my tmobile g1
It worked!
Even booted up into the rom I used to have (biffmod) on the rogers dream before it got screwed up beyond usability
I am posting from my g1 with a rogers motherboard in it as I speak...post....
Moral 2: you can mix motherboards between dreams
One problem is that this ROM still has the keymap for the rogers dream and my home and call button don't work
Hopefully flashing a new rom it will detect the tmobile keyboard
Well this was fun...but I don't know if I'm gonna try to flash my aosp froyo or not again...
Comment please on how you manage to flash a compiled aosp froyo...maybe ill try flashing engineering spl again through fastboot this time
Edit: oh and I like this motherboards vibrate more
Its quieter...
The old one rattled like crazy
So this actually a very win situation
I got Frayo back on and everythings beautiful
In a rom's zip there is this file:
META-INF\com\google\android\updater-script
Try to open it and read the first lines, there are the asserts generally (the part that tells to the device that particular SPL/Radio/Files are needed to proceed the install)
Here's an example of an assert:
assert(getprop("ro.product.device") == "trout" || getprop("ro.build.product") == "trout" || getprop("ro.product.board") == "trout" ||
getprop("ro.product.device") == "sapphire" || getprop("ro.build.product") == "sapphire" || getprop("ro.product.board") == "sapphire");
assert(getprop("ro.bootloader") == "1.33.0013" ||
getprop("ro.bootloader") == "1.33.2013" ||
getprop("ro.bootloader") == "1.33.3013" ||
getprop("ro.bootloader") == "1.33.0013d");
This assert checks many things, with logical operators (|| that's or; == that's equal; "" that's a string; () that's an argument; etc). If you've ever programmed, you'll understand very fast how to change the assert to make it less agressive of checking this things and anothers and not let you install.
The previous assert cheched that the device, or product, ot board where "trout" or "sapphire". Also it needs an specific bootloader ("1.33.0013", or "1.33.2013", or"1.33.3013", or "1.33.0013d").
It's an good idea tho check the updater-script that's in your zip installation file, view what installs it, add/remove asserts and unwanted things, and then, proceed to install it safely from recovery and the SPL/Radio combo that you prefer. Also, it's an good idea to flash an alternative kernel (ezterry one's are very good).
Remember that the only thing that's really recommended to install from fastboot is the SPL and the Radio. Other things are installable from wherever you want (fastboot, OS, recovery) without an potential hard brick risk.
So, if you want to install an ROM (AOSP FroYo as you described), it's not needed to install it from fastboot, and it will not represent an brick risk if it really is only a ROM installer what you have.
---------- Post added at 06:16 PM ---------- Previous post was at 06:12 PM ----------
Oh, and if you can paste here the updater-script it would be usefull, more than one buddy will say you how to change it to let you install everithing by a correct and safe way.
Yes yes I know all of that
I'm using fastboot because the compiled output is not an update.zip
Its all the image files and I am supposed to do "fastboot flashall"
Its alright though...I got cm6 source working
That will work
Sent from my HTC Dream using Tapatalk
It should be also fun to convert your images to a zip format.
When you flash those full images, you don't know if it will flash more things than needed. Zip files give you more control, and the updater-script also.
The "fastboot flashall" command is kinda risky with images that touchs radio/spl/partitions layouts/etc. It's really recommended to do a wipe of everithing from fastboot when you're installing this images, and also, of course, know what those images will install and be carefull to have the right pre-requisites to don't harm the device.
Good to know you got it working after all !
Alright maybe putting images into zips will be an adventure for later
As of now, the AOSP froyo source and built images are in the deep dark room of a PC's deleted files
Thanks for the tip about flashall!
frankdrey said:
Alright maybe putting images into zips will be an adventure for later
As of now, the AOSP froyo source and built images are in the deep dark room of a PC's deleted files
Thanks for the tip about flashall!
Click to expand...
Click to collapse
No need for flashall
instead of using
Code:
make
use
Code:
make otapackage
You will find a zip ready for flashing
if you are building cm6 then use
Code:
squisher
to optimise the zip
have a look in the opticharger script to make improvements like replacing pngcrush with something better
Scrip said:
No need for flashall
instead of using
Code:
make
use
Code:
make otapackage
You will find a zip ready for flashing
if you are building cm6 then use
Code:
squisher
to optimise the zip
have a look in the opticharger script to make improvements like replacing pngcrush with something better
Click to expand...
Click to collapse
Thanks
And here I was about to go and start extracting the images and writing an updater-script
And I went back to AOSP
CM6 has too many missing files that I don't want to go through the trouble of finding
frankdrey said:
...And here I was about to go and start extracting the images and writing an updater-script...
Click to expand...
Click to collapse
OTA packaging is easier and more simple, I agree... but something is true... fighting with those extractions and updater-script is kinda funnier
Happy source-compiling
Alright I have the zip and all
It checks for the spls though
Should I just remove that from the script?
And try with DangerSPL?
DangerSPL is a port of the mytouch spl right?
Maybe I shoulda built for mytouch?
Also, it looks like it patches recovery after install.
Is that safe? Should I remove the entire folder and entry in the update script?
You must do a little change.
First, open the updater-script, then find the bootloader assert
It will be like this:
assert(getprop("ro.bootloader") == "1.33.0013" ||
getprop("ro.bootloader") == "1.33.2013" ||
getprop("ro.bootloader") == "1.33.3013" ||
getprop("ro.bootloader") == "1.33.0013d");
Just be shure to add the SPL version that you've installed on your phone already. For example, if I've a 1.33.2222 bootloader, then the change will be this:
assert(getprop("ro.bootloader") == "1.33.0013" ||
getprop("ro.bootloader") == "1.33.2013" ||
getprop("ro.bootloader") == "1.33.3013" ||
getprop("ro.bootloader") == "1.33.2222" ||
getprop("ro.bootloader") == "1.33.0013d");
It doesn't matter if you put the new bootloader assert on the beginning or at last or in the middle, it'll be the same. Also, you can delete some asserts if you want to. Be carefull to keep right the sintax.
And the recovery thing, it's better to delete that part, zip will give less troubles whithout that part. And better to delete it from the script and the zip!
I recommend you to use the 1.33.0013d SPL, it'll give you extra RAM and is fully compatible with AOSP FroYo. Just be shure that after flashing the ROM, you flash the right kernel to let the OS boot up.
And remember, if you use Amon_RA recovery, you'll need to re-sign the zip that you modify, if you don't do it, the verification part of the flashing will fail.
Ok thanks I thought all of that too, just wanted to make sure
Oh, and I forgot it...
DON'T edit the script with notepad on windows, it leaves an "Error 6" in recovery when flashing.
In windows you can use notepad++ (google it, it's free), or if you're using other text editor just be shure that the "Enter" (new line in text) key is on right encoding, it's kinda of Unicode if I've good memory yet
mishamosher said:
Oh, and I forgot it...
DON'T edit the script with notepad on windows, it leaves an "Error 6" in recovery when flashing.
In windows you can use notepad++ (google it, it's free), or if you're using other text editor just be shure that the "Enter" (new line in text) key is on right encoding, it's kinda of Unicode if I've good memory yet
Click to expand...
Click to collapse
Yes I have edited them before

CM10 ROM flash error (status 7) galaxy tab 10.1!!!!!

Hi guys, so my problem is this. After my tablet went into infinite boot I flashed my galaxy Tab 10.1 GT-P7500 with a restore ROM(ICS 4.0.4)that i had saved, but now when I try to flash CM10 throught CWM 6.0.xx I get a status 7 error.
Any one had the same problem?
Thanx!
I have download CM10 again for my device but I still get a status 7 error, anyone know how to fix this???
Thanx in advance!
drefcom said:
I have download CM10 again for my device but I still get a status 7 error, anyone know how to fix this???
Thanx in advance!
Click to expand...
Click to collapse
Flash the latest recovery from droidbasement, which is in the CM10 folder you've downloaded.
Status 7
Getting status 7 error, I am finding a lot of 'solutions' so far none have worked. Does anyone have a current solution? Using CM 10.1 on Galaxy 10.1 rooted with Clockwork Mod Recovery v4.0.0.4. Not my first ( or second root), but I'm still basically a noob.
!!! Solution for status 7 error in cwm !!!
A final solution for the status 7 problem is described below (this can be a little tricky but won't harm your device ):
1.Extract the ROM in a new folder, but remember the name of the ROM so you can repack it later for flashing...
2.Go to this address: ROM FOLDER ( the folder originally containing META-INF and system folders and boot.img)\META-INF\com\google\android\
3.open the "updater-script" file with notepad++ or another code editor...
4.the model checking assert is perhaps placed in the first line or is spread over the few first lines, and is this:
assert(getprop("ro.product.device") == "p4" || getprop("ro.build.product") == "p4");
this wicked (!) but sometimes useful model checking prevents flashing on some devices, mostly when flashing Cyanogenmod 10.1...
to tell the CWM system to omit that, you can turn it to a comment (!) by placing a "sharp" sign (#) in the beginning of the line, that will make it like this:
#assert(getprop("ro.product.device") == "p4" || getprop("ro.build.product") == "p4");
5. Happy Flashing!
sorry, I forgot: it doesn't matter if you flash a P7510 ROM on P7500, but I haven't tested it reverse (flashing P7500 ROM on P7510)...
Thanks!!!
Many, many thanks, this solution works!!
arashtarafar said:
A final solution for the status 7 problem is described below (this can be a little tricky but won't harm your device ):
1.Extract the ROM in a new folder, but remember the name of the ROM so you can repack it later for flashing...
2.Go to this address: ROM FOLDER ( the folder originally containing META-INF and system folders and boot.img)\META-INF\com\google\android\
3.open the "updater-script" file with notepad++ or another code editor...
4.the model checking assert is perhaps placed in the first line or is spread over the few first lines, and is this:
assert(getprop("ro.product.device") == "p4" || getprop("ro.build.product") == "p4");
this wicked (!) but sometimes useful model checking prevents flashing on some devices, mostly when flashing Cyanogenmod 10.1...
to tell the CWM system to omit that, you can turn it to a comment (!) by placing a "sharp" sign (#) in the beginning of the line, that will make it like this:
#assert(getprop("ro.product.device") == "p4" || getprop("ro.build.product") == "p4");
5. Happy Flashing!
sorry, I forgot: it doesn't matter if you flash a P7510 ROM on P7500, but I haven't tested it reverse (flashing P7500 ROM on P7510)...
Click to expand...
Click to collapse

Need help for OTA update Ale-L21

I have an ALE-L21 with B170 and I received the information about the B188 OTA update but, everytime I try to update the system stopped at 7-11%. I have unlocked bootloader and root so I believe that this is the problem.
I decided to anayze the update package that consist of:
three directories:
META-INF
patch
system
and a file:
update.app that I extracted using Huawei update extractor and it contains:
00.SHA256rsa.img
01.crc.img
02.curver.img
03.verlist.img
04.efi.img
05.fastboot1.img
06.boot.img
07.recovery.img
08.recovery2.img
11.cache.img
13.dtimage.img
14.dsp.img
15.fastboot.img
16.hifi.img
17.mcuimage.img
18.modemimage.img
19.modemnvm1.img
20.teeos.img
21.trustfirmware.img
Click to expand...
Click to collapse
I decided to analyze the updater-script in META-INF that I have attached and analyzing it I found that after verifying the version of the phone:
assert(file_getprop("/system/build.prop", "ro.build.fingerprint") == "hi6210sft/hi6210sft/hi6210sft:5.0/LRX21M/jenkins12081438:user/test-keys" ||
file_getprop("/system/build.prop", "ro.build.fingerprint") == "hi6210sft/hi6210sft/hi6210sft:5.0/LRX21M/jenkins10091506:user/test-keys");
assert(file_getprop("/system/build.prop", "ro.product.device") == "hi6210sft" ||
file_getprop("/system/build.prop", "ro.product.device") == "hi6210sft" ||
file_getprop("/system/build.prop", "ro.build.product") == "hi6210sft" ||
file_getprop("/system/build.prop", "ro.build.product") == "hi6210sft");
Click to expand...
Click to collapse
it starts to verify the sha1 checksum of files in cust and system directory
assert(apply_patch_check("/cust/channel/tr/xml/global_operator_name.xml", "b3ea5fa1a6affbeaf760e5f8e74d4cf681c57595", "371f5afc57db71120281b063752512e6e4dd6ed8"));
set_progress(0.004016);
[...]
before applying the patch:
apply_patch("/cust/channel/tr/xml/global_operator_name.xml", "-",
b3ea5fa1a6affbeaf760e5f8e74d4cf681c57595, 39876,
"371f5afc57db71120281b063752512e6e4dd6ed8",
package_extract_file("patch/cust/channel/tr/xml/global_operator_name.xml.p"));
set_progress(0.004016);
[...]
I believe that is during this part that something doesn't match after unlocking bootloader and rooting the system.
Is there a way to do a sha1 checksum of the files in cust and system directory and then compare to the one listed in this script?
at the end of the script there are some command that I don't understand:
ui_print("Unpacking new files...");
package_extract_dir("system", "/system");
package_extract_dir("modem", "/modem");
package_extract_dir("3rdmodem", "/3rdmodem");
package_extract_dir("cust", "/cust");
Click to expand...
Click to collapse
but modem and 3rdmodem package are not present anywhere
that is present only in this command:
ui_print("write radio image...");
write_firmware_image("UPDATE.APP", "radio");
Try to full unroot and system files like build.prop and other must be in original format(untouchable)
When I running this version of firmware many times install this OTA over the B170, so if you have EU model(ALE-L21 cust C432) should not be a problem to install it
sokkoban said:
Try to full unroot and system files like build.prop and other must be in original format(untouchable)
When I running this version of firmware many times install this OTA over the B170, so if you have EU model(ALE-L21 cust C432) should not be a problem to install it
Click to expand...
Click to collapse
I already did a full unroot but with no luck.
I never modify build.prop; how could I check if the other system file are in original format? I updated PlayStore to the latest version and integrated in system.
You want to update to 6.0?
If it's already been released the Italian dual sim version, I would install 6.0 happily
Sure, use B560. If not by local update then by fastboot commands...

Install incremental updates with TWRP

Hey guys,
Are you facing errors while installing incremental updates with twrp ? Here is the solution:
1. Download the incremental updates package.
2. Extract the updater-script with any extracting program.
3. Open the updater-script in notepad++ and delete the lines which look like this "getprop("ro.build.fingerprint") == "Xiaomi/oxygen/oxygen:7.1.1/NMF26F/7.12.1:user/release-keys" ||
getprop("ro.build.fingerprint") == "Xiaomi/oxygen/oxygen:7.1.1/NMF26F/7.12.8:user/release-keys" ||
abort("E3001: Package expects build fingerprint of Xiaomi/oxygen/oxygen:7.1.1/NMF26F/7.12.1:user/release-keys or Xiaomi/oxygen/oxygen:7.1.1/NMF26F/7.12.8:user/release-keys; this device has " + getprop("ro.build.fingerprint") + ".");" .
4. Now save the file and put back in zip file, replace the existing file.
5. Now you can flash the update without any problem.

vs995 - cant flash any roms (zip file is corrupt)

Ok guys,, been a long time since ive updated my vs995, an old old version of resurection remix back in the day. I remember there was a fix for it, i think it was the meta tag or something back in the day was wrong and id have to change it or something... It wont let me flash anything vs995..
Any suggestions on how to correct it? Thanks
Try updating your twrp. Here is my latest vs995 build (thread is here). Basically I suspect you're running one of the old "Elsa" twrp builds when what you're trying to flash may have stopped checking for it. This is all is if you're getting an error like "E3004: This package is for device: vs995; this device is elsa". It can be manually bypassed by deleting a line like
Code:
assert(getprop("ro.product.device") == "vs995" || getprop("ro.build.product") == "vs995" || abort("E3004: This package is for device: vs995; this device is " + getprop("ro.product.device") + "."););
in the updater-script file a few folders deep in the meta-inf folder of the zip.
Did you happen to download these roms with chrome on your phone? Chrome won't download them correctly because it thinks it's a harmful file. On the PC version you can choice to download anyway. On the Android version I haven't figured out how to do that yet.

Categories

Resources