How to restore to stock using signed OTA Zip - HTC One S

I got the HTC One S (S4) with Hboot 2.15 carrier is Virgin Mobile Canada (Bell Mobility, CID: BM_____1) with bootloader unlock via HTC Dev. I have been using CyanogenMod for quite some time and have no nandoird backup. My phone was updated to JellyBean via an OTA prior to unlocking and installing custom rom.
My reason from wanting to restore to stock is that I can't facepalm s-off but discovered that Moonshine s-off is compatible with my phone and stock OTA from carrier. I want s-off mainly to flash custom kernel. I've been just using fastboot to flash the boot.img thus far but seems that I can't do this with customer kernels.
I looked on the RUU thread in the development section and there is no RUU for my phone (ally RUU's for my carrier are older and don't work). The signed OTA for BM is available as a zip. There is no .exe here. Inside the OTA zip there is a firmware.zip which contains things like the radio, recovery, and boot.img. The zip for the OTA also includes a folder for /system. This is not a system.img but just a folder. There are some other small files also.
I tried locking the bootloader via fastboot and then flashing the OTA zip that doesn't work. If I extract the firmware.zip from the OTA's zip and after running "fastboot oem rebootRUU" I am able to flash the firmware.zip successfully. This however doesn't allow the phone to boot as nothing is flashed to /system.
I'm not sure how to get this to work. I read that what I need to do is rename the OTA's zip to update.zip and place is sdcard partition and then I can from the stock recovery flash this. I am able to get in the stock recovery but when there it displays and error saying that it can't mount sdcard (both CWM and TWRP can mount SD card). How do I flash this to restore to stock. How can I get the /system part of the OTA to flash?

Related

[ThinkTank] Rebrand the unbrandable SLCD

This thread is supposed to become a HowTo eventually. In fact I will write it like a HowTo, but with some remarks and questions in between, as I have not tried the procedure (still on unrooted stock rom atm). I just thought I post this here anyway, as it might be helpful for someone.
Until all the questions are answered and someone succeded to rebrand, consider this thread as a think tank, with some of the thinking already done
So what is this all about? There often is the question how to flash the correct stock rom for warranty purposes. This is an easy task if the correct RUU is available. Unfortunately the recent SLCD desires often lack a corresponding RUU. If you flash the 2.1 ruu that rebrands an amoled, you will end up with a black screen, making an ota update nearly impossible.
But now S-Off is in the wild, there might be a workaround for that. There are just some things that have to be considered first... Things that I am not sure of will be marked in red. I will explain some more details on the explicit steps when the principle is confirmed working. If you dont have a clue how to perform those steps right now, it might be better to wait for the more detailed version.
As always: Do this at your own risk.
[UPDATE]
Some advances have been made here thanks to Hummelchen, who volunteered to try this procedure on his desire. It was a T-Mobile germany branded Amoled device, but care was taken to ensure that this procedure also works on SLCD without going through a phase where the screen stays black. Nonetheless, a final test still has to be done.
I updated the HowTo, but better wait until Hummelchen has confirmed it, as he was the one who tried it.
Prereqs:
- A desire to rebrand with S-Off
- fastboot and a zip-sign tool ready to run
- A RUU that corresponds to your carrier (that would normally break your display)
- The froyo OTA package that updates from the software version included in the RUU
Rename the ota_update to 'update.zip' and copy it to the root of your sd on the phone (better not forget that)
Extract the rom.zip from the RUU (double check CID in android-info.txt, compare with http://forum.xda-developers.com/showthread.php?t=631519) by running the RUU (without phone connected) and fetching the file out of your temp folder
extract the zip and delete the hboot file and the recovery
Extract OTA, extract the firmware.zip within the OTA and copy the included recovery.img into the same directory where the rest of the RUU files are
(maybe not really needed: edit android-info.txt like here)
zip, sign
boot into fastboot
fastboot erase cache
fastboot oem rebootRUU
fastboot flash zip <your_signed_zip>
Don't try to boot into the system now. As the kernel does not have SLCD drivers, all will be black
Instead boot into recovery and apply the OTA -> you will end up on a totally debranded/unrooted/s-on desire!
Thanks go to Hummelchen, who came up with lots of ideas and the guts to just try it on his own device. Also to ieftm for a little support on fastboot commands.
mblaster
For TMobile Germany/UK/CzechRep./Netherlands (according to the CID info in the OTA and base ROM) users, Hummelchen has prepared something nice:
Hummelchen said:
Okay, here is it: CustomRUU
# MD5
9ff8adf8c2471c3e2d085203d4923904 customRUU.zip
# SHA1
b5c3e174af3a797ed4f500d573794db74c595d35 customRUU.zip
I didn't found another way as fastboot. But if this RUU works, we could write a simple script to install it.
This customRUU comes without Hboot. So everyone could test it without risk.
This is the way:
1. Go to fastboot (the script could send: adb reboot-bootloader)
2. type: fastboot erase cache
3. type: fastboot oem rebootRUU
4. type: fastboot flash zip customRUU.zip
5. type: fastboot reboot
The phone will reboot to T-Mobile Stock rom.
-----------------------------------------------------
Now the way to do it on other roms (don't tested) with hboot.
1. Strip the rom.zip from your 2.1 RUU and extract it to your favorite folder.
2. delete recovery and hboot.
3. Open the OTA.zip, open the firmware.zip which is in it and extract the recovery.img to the first folder.
4. Open android-info.txt and delete hbootpreupdate:2. Save it!
5. Now zip the files in the first folder and use the commands above.
6. Now you have a S-Off Hboot and the new recovery. You should be able to flash the OTA.zip with your recovery. This OTA will overwrite your Hboot.
That's it
Click to expand...
Click to collapse
Has anyone tested?
Sent from my HTC Desire using XDA App
At least no one reported back. Seems like the interest in this topic is not too great.
I've found a RUU on T- Mobile AT to rebrand a SLCD Desire (froyo). It's the solution for my problem.
Sent from my HTC Desire using XDA App
A little question: I’ve i use the RUU_Bravo_TMO_UK_1.21.110.4_Radio_32.36.00.28U_4.06.00.02_2_release_127570_signed.exe the SLCD will brick (HBOOT 0.80). Could i use Fastboot to flash the Update.zip with Froyo without root (HBOOT 0.93)?
So i have to go to the bootloader and press „Power“, plug it to my notebook an send a „fastboot flash update.zip“ ? Could it work?
If this works, i will get a rebranded SLCD desire
Hummelchen said:
A little question: I’ve i use the RUU_Bravo_TMO_UK_1.21.110.4_Radio_32.36.00.28U_4.06.00.02_2_release_127570_signed.exe the SLCD will brick (HBOOT 0.80). Could i use Fastboot to flash the Update.zip with Froyo without root (HBOOT 0.93)?
So i have to go to the bootloader and press „Power“, plug it to my notebook an send a „fastboot flash update.zip“ ? Could it work?
If this works, i will get a rebranded SLCD desire
Click to expand...
Click to collapse
No, you will loose S-OFF since it will flash an unpatched HBOOT. Hence fastboot will be as good as useless.
Dragooon123 said:
No, you will loose S-OFF since it will flash an unpatched HBOOT. Hence fastboot will be as good as useless.
Click to expand...
Click to collapse
Also No . I think you can't even fastboot flash a .zip file. €: OK, just ReadTFM ... Fastboot flash update update.zip seems to work. But as stated, don't do it.
You will have to unpack the zip and flash the images manually (skipping hboot obviously).
@Hummelchen: Do you have a german TMo Desire? €: OK, just noticed the flag below your avatar...
mblaster said:
@Hummelchen: Do you have a german TMo Desire? €: OK, just noticed the flag below your avatar...
Click to expand...
Click to collapse
Yes. My Amoled Desire have a stucking pixel and TMo will send a SLCD. I hate the hard way
Sent from my HTC Desire using XDA App
Hummelchen said:
... the SLCD will brick (HBOOT 0.80) ...
Click to expand...
Click to collapse
Hummelchen said:
Yes. My Amoled Desire has a stucking pixel ...
Click to expand...
Click to collapse
Do you want to rebrand a SLCD or AMOLED Desire
Because with AMOLED you can just install the Eclair RUU and apply the OTA update...
My next desire will be an SLCD one. But I don't want to root as long as there's no easy way back.
Sent from my HTC Desire using XDA App
Hummelchen said:
My next desire will be an SLCD one. But I don't want to root as long as there's no easy way back.
Sent from my HTC Desire using XDA App
Click to expand...
Click to collapse
That's why I started this thread here. In theory my plan should work, but i am quite reluctant to test it myself just for the kicks. I am also on a german T-Mobile Desire.
€: I just had a nice idea, I just need to know if the current custom recoveries are able to apply a patched/resigned or even an unpatched OTA-update.zip.
This would allow the following:
1) Extract the rom.zip from the RUU (the one that would break slcd), unzip it, delete the hboot and recovery, zip again, fastboot flash update rom.zip -> everything but hboot and recovery are stock
2a) Boot into recovery and flash the ota.zip file and be stock/unrooted/s-on OR
2b) remove the firmware.zip from the ota.zip (also remove 'write_firmware_image("PACKAGE:firmware.zip", "zip");' from the updater script), zip, sign, flash from recovery. Manually fastboot flash boot/radio/rcdata from the omitted firmware.zip. This will bring you to a stock/unrooted system, but with s-off hboot and a custom recovery. This has the advantage, that you can make an actual nandroid of a stock system without root files sticking around. From there you can play around with your system as you like and always unroot in 2 simple steps by restoring the stock nandroid and fastboot flashing the firmware.zip (removing custom recovery and hboot from the phone).
I am just not sure if the custom recoveries handle the ota packages as intended (with all the file patching going on there), but i think there is no reason why it should not work.
Hmm... I could reroot my Amoled desire and test it
If hboot and recovery not affected i can flash the whole ruu on fail, right?
Edit: I've extracted the Rom.zip, deleted hboot and recovery and created a signed update.zip
Sent from my HTC Desire using XDA App
Would be interesting to see the result. I think as long as you can enter the bootloader (the one from alpharev) you cant really screw it up, as you can always install a recovery or system via fastboot. I think the RUU also only depends on a working hboot.
So if you are careful with that hboot (and remove it from the ota also), you should be fine (I hope...).
Might be that you need a goldcard for flashing the RUU to get back to stock afterwards, but I am not sure of that.
It would be great if you tried that, as it would make sure that there is a way back to stock for SLCD owners without a friendly RUU. Please report back if you have been brave enough to try.
ok, i've done it. I S-off'ed my Desire and try to flash the rom.zip of the T-mobile RUU without Hboot and recovery.
Flashing the system.img didn't work because it needs the original Hboot. Fastboot says: File is to large. Same on Recovery.
Flashing boot.img works, but without system... It seems the 0.80 Hboot has another patitionsize as 0.93. That's stupid.
Thats strange. The system image of the TMO RUU (I think i have downloaded the newer one of the 2 available) is only 222 MB. Standard size for Data is 258 MB, so it should fit in withut problems. I am quite sure that all the official hboots have the same partition size.
Did you by chance install an alpharev hboot with modded partition table, like the N1 table (149 MB) or the modded Sense Table (180 MB)?
Did you try to flash only the system.img via fastboot flash system instead of fastboot flash update zipfile.zip?
BTW: Thanks for trying.
Thats strange. The system image of the TMO RUU (I think i have downloaded the newer one of the 2 available) is only 222 MB. Standard size for Data is 258 MB, so it should fit in withut problems. I am quite sure that all the official hboots have the same partition size.
Click to expand...
Click to collapse
Hm.. Strange
Did you by chance install an alpharev hboot with modded partition table, like the N1 table (149 MB) or the modded Sense Table (180 MB)?
Click to expand...
Click to collapse
I had it originally. I start the Iso, S-Off and after that i try to flash the rom.zip.
Did you try to flash only the system.img via fastboot flash system instead of fastboot flash update zipfile.zip?
Click to expand...
Click to collapse
I try:
- Fastboot update rom.zip
- Fastboot flash system system.img
- Fastboot update system.zip (pack it with 7zip)
I also try to flash the rom.zip and the system.zip with clockworkmod recovery
Nothing works... :/
You could try a 'fastboot erase system -w' before flashing. This clears /system /data and /cache. Perhaps it helps.
€: Come to think about it this really makes sense. I guess the flashing routine checks how much space is free, as it perhaps does not necessarily delete the existing files on the partition. I don't know how the flashing process works, but maybe it is more similar to a file copy operation than a linux 'dd'.
mblaster said:
You could try a 'fastboot erase system -w' before flashing. This clears /system /data and /cache. Perhaps it helps.
Click to expand...
Click to collapse
It didn't work. Tested 2 mins ago
Seems like this problem is more or less known.
http://forum.xda-developers.com/showpost.php?p=8596521&postcount=38
Maybe we could ask ieftm for some help. €: Sent him a message.
Another thought: Did you use 'fastboot update filename.zip' or 'fastboot flash update filename.zip'? I've seen both syntaxes and they might do something different. Perhaps just try the one you didn't use.

[RESOLVED] Did I kill my phone ? catch-22

Hi,
After running with revolutionary and my rooted stock rom 1.47.401.4, I got yesterday a new OTA with 2.10.401.4 (2.3.5 and sense 3).
When trying to install it, it failed (blue android with big "!" on my screen)
First I downgraded my hboot back to 0.98.0000, but than I did something stupid .
I flash my hboot to the one provided with the OTA 2.00.0002, incl radio and all other stuff from the firmware.zip.
Now I ended up with a *** LOCKED *** HBOOT 2.00.0002, but also a 1.47.401.4 rom with android.
I tried to use the RUU_Saga_HTC_Europe_1.47.401.4_Radio_20.28I.30.085 AU_3805.06.02.03_M_release_199410_signed.exe from windows, but that fails as the hboot has the incorrect version.
THe other thing I could do is go back to a 0.98 HBOOT, but that doesn't work either. the rom is ***LOCKED***, I have no root and it's S-ON.
I also searched for an RUU_Sage_HTC_Europe_*2.10.401.4*.exe as that might work because the HBOOT has the right version, but I could not find anything like that
Does anyone have an idea how I can go forward or how to go back ??
My phone is alive again as used the recovery.img procedure below and installed Saga3D 3.0. After that, I tried also the RUU installation to fully go back to stock, but that doesn't work. It complains about a security failure in hboot screen. I locked it back with 'fastboot oem lock', but that doesn't make the RUU work either.
lessimp said:
THe other thing I could do is go back to a 0.98 HBOOT, but that doesn't work either. the rom is ***LOCKED***, I have no root and it's S-ON.
Click to expand...
Click to collapse
did u try that or u think that wont work?
Before I updated to 2.00.0002, I created a dd-backup on the sdcard for the 0.98.000
when I however use adb to connect, I don't see how I can restore that back without root. I also didn't see the sdcard mounted
I was also thinking ....
Would it maybe also be possible to create a PG88IMG.zip with all the right software for 1.47.401.4 ? and restore that via recovery ? would the current hboot allow a downgrade ?
Today I was able to get the **LOCKED*** off to UNLOCKED via htcdev.com
In the thread http://forum.xda-developers.com/showthread.php?t=1299438
I found this (identical to my problem)
If anyone has the same problem and has hboot-2.00.0002 & S-ON you have to unlock the bootloader via htcdev.com site following all the steps and flash the EXT4 Recovery via FASTBOOT and NOT ADB.!!
Then go to recovery and flash any custom rom.
I don't unserstand what I have to do next. ADB does not work anymore, and only fastboot is available. I downloaded an EXT4 recovery (4EXTRecovery_v2.1.0_saga.zip) which have me an recovery.img and a META-INF folder.
When I name the zip image update.zip, and run
C:\android>fastboot.exe update update.zip
it fails with ...
archive does not contain 'android-info.txt'
archive does not contain 'android-product.txt'
error: update package has no android-info.txt or android-product.txt
How to I proceed to get it working ?
BTW, HBOOT is UNLOCKED but still S-ON
Please help
you already update hboot right. try this
RUU_Saga_S_HTC_Europe_2.10.401.5_Radio_20.4801.30. 0822U_3822.10.08.04_M_release_219480_signed
from here.
budingyun said:
you already update hboot right. try this
RUU_Saga_S_HTC_Europe_2.10.401.5_Radio_20.4801.30. 0822U_3822.10.08.04_M_release_219480_signed
from here.
Click to expand...
Click to collapse
You can RUU with that correct version or follow my instructions to achieve custom recovery/rom since you are already "unlocked":
Skanob said:
You should be able to change your recovery without any problem if your s-off or unlocked 2.xx.xx hboot s-on.
1. Get 4ext recovery.img
2. connect phone on fastboot
3. In cmd use these command to push the recovery image:
fastboot flash recovery D:\recovery.img (<- should be directory of 4ext recovery image)
fastboot reboot-bootloader
Now you should have 4ext recovery.
Sent from my HTC Desire S using XDA App
Click to expand...
Click to collapse
From here on you can now flash custom ROMs that you would like that is compatible to Desire S.

[Q] Restore nandroid missing system/lib?

Need help trying to restore a stock nandroid after successfully flashing Endymion. The backup doesn’t include system/lib as this setting wasn’t enabled in 4ext, which is essential with the later hboot if you plan to restore a stock nandroid after trying another rom. What hasn’t worked:
Flashing PG88IMG containing lib.img/android-info.txt, also tried PG88IMG containing rom.zip from stock RUU. Both these seemed to install as I got the progress bar during installation with no error messages. After each flash I restored the backup, which was okay, then flashed the stock boot.img in fastboot, but reboot still brings me back to recovery.
Installing the rom.zip from sd card in 4ext (couldn’t open zip, installation aborted).
Last ditch effort, I pasted the lib.img into the backup folder and then restored but same again.
In all attempts I’ve wiped everything/formatted partitions.
Maybe it’s not possible to do this, but I’m just putting it out there to get some opinions before the hassle of relocking the bootloader and then flashing the complete RUU.
Bootloader "UNLOCKED"
SAGA PVT SHIP S-ON RL
HBOOT-2.00.0002
RADIO-3822.10.08.04_M
eMMC-boot
Aug 22 2011, 15:22:13
Flashing Endymion ROM, followed by Nandroid restoring only /data and /cache, should do it. If you're getting Endymion ROM.zip errors - check MD5, it's most likely a bad download.
Thanks, I'll give it a shot and report back..
Okay, I've done what you suggested, I've now got Endy with home screen etc. from the stock nandroid. Is there a further step I should take to restore the complete stock backup with the missing system/lib?
The same method - you should grab a stock-based ROM zip, as stock as possible. Rooted stock will be the best. Flash it, then restore your stock backup over it.
If you can't find such ROM - then there are several options with RUU that includes lib.img:
1) Try in fastboot - fastboot flash lib lib.img.
2) Take lib.img, unpack it (EXT4 reading tools - use google to see what you need, something like DiskInternals Linux Reader), take a ROM.zip, replace everything under /system/lib with what you unpacked. Flash this ZIP, restore your stock backup after it, flash stock boot.img.
3) Just give up and use the RUU way.
Tried flashing lib.img but fails at sig verification apparently because bootloader is unlocked, which I think is why PG88IMGs also didn’t flash. I guess the most straightforward way is to relock then try flashing lib again, failing that the stock rom.zip, then finally give up and install the ruu if all else fails.
You might need stock recovery to relock and boot properly, and if that's the case - you won't be able to operate with ROM ZIPs anymore.
SOLVED
For anyone with the same problem, this got me back to restoring the stock nandroid:
1. Flashed stock boot.img (kernel)
2. Relocked bootloader (fastboot oem lock)
3. Inserted gold card sd
4. Installed RUUxxxxxx.exe via Windows (first attempt gave me CID error:131
so tried another gold card and it installed okay)
5. Restored stock nandroid!
6. Unlocked bootloader using original HTC unlock token
7. Flashed 4ext recovery again
The only difference is my main version is now higher according to fastboot getvar all, even though the version shown in phone info is the original. Now, after enabling system/lib in 4ext settings before doing a backup, I can restore both Endy and stock roms. When the ota is released I’ll restore an old stock backup, of which nothing was changed apart from recovery, no Superuser etc., then flash the stock recovery. According to HTC, otas are unaffected by an unlocked bootloader, so I’m hopeful this will work.. :fingers-crossed:

how to flash a .zip OTA

Hi boys,
Is it possible to install a .zip OTA file from scratch?
My phone is currently empty, no actual rom running. I want to revert to stock, and the only JB file available for rogers canada is a .zip OTA.
I tried installing the ICS RUU (as the .exe RUU for JB wasnt release) from windows, got a failed installation (failed RUU), probably because JB updated bunch of kernel files, radio etc.
OTA_EVITA_UL_JB_45_S_Rogers_WWE_3.17.631.2_0.23a.32.09.29_10.128.32.34a_release_299850qstr7rxdbfuofl6j.zip
I only have access to my fastboot and bootloader, i relocked the phone, reinstall stock hboot, and i only want to run this zip file as installation.
xatomicx said:
Hi boys,
Is it possible to install a .zip OTA file from scratch?
My phone is currently empty, no actual rom running. I want to revert to stock, and the only JB file available for rogers canada is a .zip OTA.
I tried installing the ICS RUU (as the .exe RUU for JB wasnt release) from windows, got a failed installation (failed RUU), probably because JB updated bunch of kernel files, radio etc.
OTA_EVITA_UL_JB_45_S_Rogers_WWE_3.17.631.2_0.23a.32.09.29_10.128.32.34a_release_299850qstr7rxdbfuofl6j.zip
I only have access to my fastboot and bootloader, i relocked the phone, reinstall stock hboot, and i only want to run this zip file as installation.
Click to expand...
Click to collapse
Pull the stock recovery from the ota file and flash with fastboot. Then put ota on root of sd and boot into recovery and choose update.
Sent from my HTC One XL using xda premium
31ken31 said:
Pull the stock recovery from the ota file and flash with fastboot. Then put ota on root of sd and boot into recovery and choose update.
Sent from my HTC One XL using xda premium
Click to expand...
Click to collapse
Thanks,
Exactly what i did, i had to push the zip in first, because if i run any recovery that doesnt let me mount im kinda screwed transferring file over.
So i move the file in the root folder.
I flash the recovery from the file.
Reboot the phone.
Run recovery....
Screen stay's up a bit with the htc logo (with red script saying to proceed at your own risk)
Then screen shuts down
Screen reopen again with logo for a few seconds.
Then nothing. phone is off.
I will try to relock maybe.
You have to relock if you're s-on. If your super cid and trying to run a 3.17/3.18 ota with s-on you'll brick
Sent from my HTC One X using xda app-developers app

[Q] How-to flash radio with S-Off

I'm running CM 11 nightlies on a S-Off HTC One S with hboot 2.15.
I would like to upgrade the radio, because I have no 3G data connection atm.
Most guides which I found are for the case of having no S-Off, i.e. S-On.
My best guess therefore is just to flash firmware.zip using fastboot.
However, I am unsure how to get the radio only from the latest OTA's. Inside there is the firmware.zip (in ROM.zip), which has much more than only radio.img. As far as I understand the how-to's, it is not possible to directly flash radio.img, but flashing a zip with fastboot is possible (I also tried flashing the radio.img directly, fastboot gives me 'not allowed' as expected).
The firmware.zip from the OTA is correctly packaged (it has a android.txt or so and is signed). Can I extract the radio.img, put it in a firmware.zip with the extra android file and sign it myself somehow?
Much thanks for your time!
Dooxed said:
Most guides which I found are for the case of having no S-Off, i.e. S-On.
My best guess therefore is just to flash firmware.zip using fastboot.
Click to expand...
Click to collapse
1) With S-Off, any partition is writable if you use the trick described here.
2) Firmware.zip from OTAs and RUUs also contains other stuff next to radio, such as bootloader (hboot), recovery etc. Get the firmware.zip from the OTA or RUU and extract the radio parts: radio.img, wcnss.img, and adsp.img and follow instructions at 1.
3) Can anyone explain what wcnss.img and adsp.img exactly are?

Categories

Resources