[HTC One A9] alray:
FAQ - Instructions

FREQUENTLY ASKED QUESTIONS:​

What RUU should I use, can I flash this RUU

:

Use "fastboot getvar all" to get and note your MID, CID and version-main.

Both your MID and CID must be listed under the RUU you want to flash

Knowing your version-main, read FAQ 2 and 3.

RUU version numbers explained

a.bb.ccc.dd

a: Usually 1 digit only. Major android update since device release. This device shipped with Marshmallow so a RUU starting with 1 is Marshmallow, with 2 is Nougat and so on.

bb: Usually 2 digits. Major changes in HTC firmware/software

ccc: Usually 3 digits, sometimes 4. This numbers represent your region/carrier version. This number doesn't change (unless you convert your phone). E.G: 1.10.617.1 isn't newer than 1.10.401.1. Both are same versions designed for different operators/regions.

dd: Usually 2 digits, sometimes 3. Minor update / security fix

Do I need S-OFF ?

If your phone is S-ON you can't downgrade simply by flashing an old ruu **(See how to downgrade with S-ON below). The combination of a, bb and dd (see above explanations) of the ruu you want to flash must be same or newer than your version-main (fastboot getvar version-main)

If your phone is S-ON you can't convert to another region/carrier. The ccc digits in a.bb.ccc.dd must be the same (see above explanations)

If your phone is S-ON you can only flash signed RUU or Signed Firmware. If the RUU file name you want to flash ends with "decrypted.zip" it is not signed and will requires S-OFF. If its ending with "signed.zip" it is signed and can be flashed with S-ON

UPDATING from Marshmallow to Nougat RUU (2.xx.xxx.x)?

READ THIS !!!

EXPECT THIS:

bootloader reporting these errors:

(bootloader) ERR check AES encrypted magic string failed.

FAILED (remote: 12 RU_ZIP_ERROR )

Signature verify fail

and ruu will not flash

WHY:

HTC is now signing Nougat RUUs with a different signature than Marshmallow RUUs. The Key to read that signature is embedded in your phone firmware, more precisely in the HOSD (hosd.img).

That mean, if your phone is still running a Marshmallow firmware (version starting with 1.) your phone firmware (and so your hosd.img) had not been updated yet with the new signature key which will result in your phone not being able to verify the Nougat ruu signature.

HOW TO SOLVE:

You can't flash a Nougat RUU if your phone isn't already running the Nougat firmware ---> You must update your firmware to 2.xx.xxx.x before flashing a 2.xx.xxx.x RUU / You can't update from 1.xx.xxx.x to 2.xx.xxx.x without updating your firmware to 2.xx.xxx.x first.

DOWNGRADING from Nougat to Marshmallow

READ THIS !!!

Read FAQ #4, same thing apply when downgrading, you need the old marshmallow decryption key on your phone for the marshmallow RUU to pass signature verification. Downgrade your firmware to 1.xx.xxx.x before flashing a 1.xx.xxx.x RUU.

DOWNGRADING with S-ON:

Below explanations are for the One A9

Only

. This procedure can work on other HTC devices but will require a different command since the partitions are different for each device.

If you're stuck S-ON and you must downgrade because there is no recent RUU available for your phone, there is method you can try. Usually it will only work if you are downgrading to a version that's is using the same bootloader version (well it was working that way for older HTC device using hboot i.e M7/M8, don't know if the same apply for A9). Usually if you're going to flash an older RUU with a version-main starting with the same digit at positon "a" (see above "RUU version explained") it should work. In many cases, the only things preventing you from downgrading when S-ON is your version-main: When flashing a RUU, your actual version-main is compared with the RUU version. If the RUU version is newer or equal to your version-main (and all other parameters explained above are ok), it will flash. Otherwise the ruu will fail. Your version-main number is stored on the /misc partition (mmcblk0p28) starting at decimal block #2208. See image below:

The good news for you is that mmcblk0p28 is not write protected, even when your phone is S-ON. So we can change the version-main value manually in that partition to a lower version so when flashing an old RUU it will pass that check.

How to manually change your version-main:

Warning:Always double check your partition table before doing any modification to confirm the location of your /misc partition. Another user reported to have his /misc partition located to p29 instead of p28. You don't want to mess your partition or write data to the wrong partition. Double check using "cat /proc/emmc" and "cat /proc/partition" from an adb shell.

​

Warning: "dd" commands can be dangerous. Make sure there is no typo in your command, you don't want to mess your partition or write data to the wrong partition.

​

Method 1:

When booted in the OS (a ROOTED rom is required)

With your phone connected to your computer, open an ADB command window

start an adb shell

ask and grant super user privileges

edit the version-main (see below explaination "What command should I use to edit my version-main")

exit the shell

reboot in bootloader/download and confirm your version-main correctly changed

strike over numbers = numbers used for example, read below to determine which numbers you must use.

adb shell
su
echo -ne "[STRIKE]1.10.651.1\x00\x00[/STRIKE]" | dd of=/dev/block/mmcblk0p28 bs=1 seek=2208
exit
exit
adb reboot download
fastboot getvar version-main

Method 2:

From a custom recovery (a ROOTED rom isn't required)

With your phone connected to your computer, open an ADB command window

start an adb shell

edit the version-main (see below explaination "What command should I use to edit my version-main")

exit the shell

reboot in bootloader/download and confirm your version-main correctly changed

adb shell
echo -ne "[STRIKE]1.10.651.1\x00\x00[/STRIKE]" | dd of=/dev/block/mmcblk0p28 bs=1 seek=2208
exit
adb reboot download
fastboot getvar version-main

Method 3:

From a terminal emulator (no computer required, ROOTED rom requried)

Start your terminal emulator app

Ask and grant SU to your terminal app

edit the version-main (see below explaination "What command should I use to edit my version-main")

exit the shell

reboot in bootloader/download and confirm your version-main correctly changed

su
echo -ne "[STRIKE]1.10.651.1\x00\x00[/STRIKE]" | dd of=/dev/block/mmcblk0p28 bs=1 seek=2208
exit
adb reboot download
fastboot getvar version-main

Method 4:

From TWRP's embedded terminal (No computer required, ROOTED rom not required)

Reboot your phone in recovery/twrp

from twrp main menu, select "Advanced" then "Terminal"

edit the version-main (see below explaination "What command should I use to edit my version-main")

reboot in bootloader/download and confirm your version-main correctly changed

echo -ne "[STRIKE]1.10.651.1\x00\x00[/STRIKE]" | dd of=/dev/block/mmcblk0p28 bs=1 seek=2208

What command should I use to edit my version-main (one more time, this is for the One A9 Only):

Use this command:

version-main must be replaced by the appropriate number for your situation. For example if you're going from 1.27.401.10 to 1.10.401.1, version-main will be 1.10.401.1\x00\x00. Do not remove the quotes in the command, they must be there:

i.e:

echo -ne "1.10.401.1\x00\x00" | dd of=/dev/block/mmcblk0p28 bs=1 seek=2208

Why adding \x00\x00 at the end of 1.10.401.1?

- In theory, a version-main can have up to 12 characters (this includes dots). Since 1.10.401.1 is only 10 characters we want to null out the last 2 characters that aren't used. x00 is the hexadecimal expression for the "null" value. If you're not doing this it could result in wrong version-main, for example if your previous version-main was 1.27.401.222 and you only input "1.10.401.1" instead of "1.10.401.1\x00\x00" in the command, the final result will be 1.10.401.122 since the last 2 digits weren't erased with the "null" value. If you're going to use a version-main that is 11 characters, only add \x00 once so the 12th characters in null.

Some RUU.exe links are dead, give a 404 error:

read this:

https://xdaforums.com/showpost.php?p=73313457&postcount=1021

How to flash (RUU.ZIP):

​

SD Card Method:

Rename the RUU zip file "2PQ9IMG.zip", save it at the root of your external sd card (FAT32) (exfat should also work, to be confirmed). Reboot the phone in download mode and wait for the magic...

Using fastboot commands Method (MS Windows, Linux, MacOS):

Save the ruu zip file in your adb/fastboot folder along with htc_fastboot.exe(see post 43). Open a command window from that folder then type:

fastboot oem rebootRUU
htc_fastboot flash zip <file_name>.zip

Wait for the "finished. Total time: xx sec" before doing anything. Then:

fastboot reboot

Make sure you have the latest HTC drivers installed on your computer and that you are using htc_fastboot.exe for the flash zip command.

How to flash RUU.EXE (For MS Windows Only)

​

Make sure you have the latest HTC drivers installed and MS Visual C++ 2008 Redistributable Package (If you launch the RUU and nothing happens, then you don't have the MS Visual C++ installed). Connect your phone to your computer and launch the ruu.exe file. Follow instruction from the RUU program.

How to flash firmware.zip

​

It can be done the same way as flashing a RUU.zip, see above SDcard & fastboot methods.