[One (M7) Android Development] Sneakyghost:
[2014|02|16] ViperOne and Firmware...

​

Intro:​

Generally speaking, Firmware does not have much to do with the ROM. As such, the ViperOne thread does not need a special section on this subject and i will only be brief with this.

However, at some rare occasions, it does make sense to talk about Firmware in relation to the ROM. I will try to catch some of that to avoid repeat questions.

For those who want to dive right in, you may hop over to my dedicated thread, which also features links to further firmware threads (i am not able to keep that up-to-date at all times, so you might find more current solutions in the other firmware threads).

Find it here:​

[GUIDE][MOD] GSM Firmware Flashing & Hboots red warning gone​

GSM Firmware FAQ

​

Q:

Is GSM firmware compatible with CDMA (Sprint/Verizon) or vice versa?

A:

Absolutely, NO.

Please don’t cross-flash firmware! The HTC ONE for CDMA (for example M7_wls / MID PN0720000) has two partitions more than the M7_ul variant and is very different in many aspects. Only this ViperOne ROM can run on GSM and CDMA (currently only Sprint), not so much the firmware. IF you managed to flash GSM firmware to your CDMA HTC ONE, i recommend going HERE and fix.

Q:

Do we need to have Firmware version matching ROM version?

A:

General answer: NO.

In some situations, an update to your firmware can prove useful nonetheless. When that will be necessary cannot be told up front. A good rule of thump might be to update firmware, whenever there is a change of Android base version, e.g. upgrading from Android 4.4 to Android 4.4.2.

Generally, you will notice the necessity by following the daily postings of users. If you see lots of random errors popping up and people getting angry with each other, the trolls coming out and telling everyone to wipe over and over again, it might be time to start over and reboot to bootloader, update all partitions to the latest version and wipe as good as you can and reflash a virgin copy of ViperOne.

A good example was the update from ViperOne 2.7 (Android 4.2.2) to ViperOne 3.xx (Android 4.3), where a good share of people faced considerable issues with their phones, which could be solved by updating the firmware and wiping the whole chip. Oh and, yeah, updating base enabled people to redeem the free Google Drive Storage offer.

Important information: People who have not yet set their NAND security to OFF might face unexpected and unwelcome obstacles obtaining S-OFF after a firmware update via the official update channel. For the HTC One, the methods Revone, Moonshine are tied to particular firmware versions and an uninformed early update often ruins chances to get the NAND security toggled off. However, Rumrunner and lately Firewater exploits allow to obtain S-OFF on more hboot-versions so far. HTC hasn’t patched those two yet (Current as of February 2014)…

Q:

How do i update firmware?

A:

S-ON Phones can have this: backup your system in recovery, copy backup to PC, backup your files from SDCard too, then run the latest available RUU (at time of writing that was 3.22 for WWE, 3.24 for T-Mobile) and then update via HTC OTA function, after that, copy your backup back to phone and then restore your NANDROID or else: flash ViperOne clean (recommended).

Notice: you might need to lock your bootloader (fastboot oem lock) again to be able to run a RUU. Unlock again after you’re done and reflash the custom recovery as first step.

The fastest way is via Fastboot or “FUU”. Method explained in my thread, link see top of post. S-OFF Phones only.

This method includes a RUU derivate i made, which works like the original RUU but has the system.img removed. It is much smaller this way and easier to download. I like to refer to it as "The FUU" (Firmware Update Utility).

It comes in 2 flavors:

1.) Full Stock WIPE version has everything in it except the system.img and is fit to fully update your M7 from as low as version 1.20 up to the latest. It will wipe the SDCard and leave any ROM in the system partition damaged and non-functional (sometimes it would still boot though, depending on what ROM you currently run). You will need to reflash your custom stuff such as recovery, kernel, splash screen or ROM afterwards. Make sure you backup your SDCard contents before running this. This "FUU" is the most proper way to update your phone. All you do is run it in windows, then flash TWRP (ideally, for ViperOne) and then push the rom.zip via adb push command to the phone's SDCard (while booted to recovery).

2.) Combined No-Wipe FUU without the SDcard repartitioning files and TWRP Recovery already added. It also has the Kernel and Ramdisk files removed and doesn't touch the splash screen either. Theoretically, you may use this to update your firmware from as low as 1.20 up to the latest without having to reflash your ROM or even backup/restore your SDCard contents. I have done this version for those of you who believe it works or simply dont have the time to do the full thing. I am NOT recommending it though. It has given me various troubles in the past.

Then we have the ZIP’s that are also in the FUU as stand-alones for fastboot RUUmode:

3.) Full Stock WIPE RUUmode zip - same as the above FUU version, just the zip, for flashing it manually via Fastboot / RUUmode. For the Linux or Mac OSX fraction or those who just dont need the RUU file bloat.

4.) Combined No-Wipe ZIP - same as the above FUU version, just the zip, for flashing it manually via Fastboot / RUUmode. For the Linux or Mac OSX fraction or those who just dont need the RUU file bloat.

Q:

Does it matter if i update firmware before or after flashing ViperOne?

A:

Theoretically, NO.

Technically, i have repeatedly faced issues if i picked some firmware package that only included vital stuff like hboot, radio, adsp and such and flashed that on a fully set up system.

Symptoms often included the WiFi becoming less functional, less reliable, mobile data issues, Wifi/Data switching getting slow and bad, issues with file access permissions on SD, problems with access to the phone from PC etc. etc.

So i have adopted a policy of always recommending a full wipe and full firmware flash (not just a collection of the most popular partitions) and then flashing ViperOne

after

that.

Q:

Why does my phone show backlight illumination and black screen while charging when powered off?

A:

Reason: change in hboot and recovery by HTC.

Expected behavior: charging animation like Samsung has while the phone is charging in OFF state. It is now never fully turning off while charging but booting into recovery, charging mode instead.

Cause of Black Screen: older custom recoveries not having included HTC's current charging binaries from current stock Recovery. Use TWRP 2.6.3.3 and higher. It will show a charging animation.

Available Fix: Latest TWRP 2.6.3.3 with those binaries.

Alternative Fix: old hboot 1.44, phone will fully power down. NOT recommended!

Easy Method:

Flash the no-wipe FUU from me (Sneakyghost) like e.g this one:

my FUU with that TWRP included: FUU 4.19.

Can be run on existing ROM, doesnt wipe, updates everything, hboot is stock, not hex edited. In other words: safe. The example FUU is different than those i do as “full stock” variants, those would wipe. This one doesn’t. To find out more, head over to my thread linked at top of post.

Q:

How do i determine my current “Firmware Version”?

A:

I believe there is some wrong info circulating the HTC Fora. People keep saying when running fastboot getvar all it will report the Firmware Version in the line “Version-Main”. This is not always true though. Fastboot getvar all or alternatively getvar mainver pulls a version it finds in the MISC partition. Source

So how does that version string get there? It is being taken from the android-info.txt file in any firmware zip that you flashed. The last zip you flashed determines what will be reported by the getvar function. So if you mess around with Firmware.zip’s and RUU’s a lot, chances are, that the version reported there is not equivalent to what you are already running. Often the android-info.txt has version entries not appropriate for the actual zip contents, for compatibility reasons, because it wasn’t done properly or whatever.

The "Firmware" as a concept like we use it on XDA does not exist in HTC's terms. HTC does NOT differentiate between the /System Partition (what we know as "the ROM") and the other 36 partitions. Hence, if you run getvar all or getvar mainver on a stock phone, it will report correctly. It does not go looking for a fictitious place where it would find a separate "Firmware" version. That place it is looking at is the Misc Partition and that’s correct as long as you haven’t messed with lots of different Firmware zips.. So, if you happen to run a hybrid system with a ROM from one base and the other partition images from another base or multiple bases (like hboot from 1.27, radio from 4.06 and ROM from 4.19) the getvar function will report as "Version-Main" what it finds in /misc/, precisely the last zip you flashed determines the string put there.

Example: you flashed a radio with a RUUmode zip from Base 4.19 but the android-info.txt is maybe still an old one because the dude who made the zip, just dropped the new radio into an old existing zip, the getvar function will later report that old version as your mainver.

To check your firmware: boot to bootloader and look at the combination of hboot version and radio version - if you didn't flash those separate, the combination will let you know what base you are on (each OTA and RUU has the radioversion in its name).

Finding out your firmware is a game of guesses and knowing what you did to your device and where you are coming from.

If totally lost, you can still open your hboot with a hex editor and search for the build date line and compare to others, do hash compares with existing partition images on e.g. my thread etc etc blah blah.

Long story short: you better know what you do because finding out your firmware is going to be difficult if you don't.