[HOW TO] an easier way to flash PH98IMG files


Last Updated:

  1. scotty85

    scotty85 Guides Guide

    with s-off here,more folks may be attempting to install things a PH98IMG files,wich can cause certain fustrations. i personally have quit alltogether installing any PxxxIMG files on the sd card,on ANY of my htc devices. what follows is a guide ive placed in other forums,and decided to include here as well:

    all htc phones utilize a PxxxIMG file system to flash RUUs and such in hboot. having guides up here,the TB,the inc,and merge forums, and being active on the board i see alot of folks have trouble getting PxxxIMG(PH98IMG in case of the rezound) to work. the prollem usually has simple fix,but sometimes causes folks an extreme amount of confusion.

    but there is an easier way :)

    i mess with my various htc devices alot,and have found using fastboot is a much faster,easier way to flash PxxxIMG files. you dont need to transfer files to your SD,or boot to change files if youve got a couple to do.

    in a nutshell,youre going to place your file into the folder where adb and fastboot live(prolly platform tools or tools if youre an advanced user that has the sdk installed),place the phone in fastboot,put it in RUU mode and flash the file with this command: fastboot flash zip <filename>.zip

    if you rooted with revolutionary,and have no idea what fastboot or adb even are,heres a step by step:

    1)set up adb and fastboot download this file,wich contains adb and fastboot.
    http://www.mediafire.com/?hzf1u4bowjewhdq
    md5 sum: 9d1c0e2a98f09bb65521889870334b65

    extract it,and place the extracted(not zipped) mini-adb folder on the root of the C drive of your PC. in windows 7,you should be able to just right click,then extract files. if not,you may need a utility such as 7 zip

    re-install revolutionarys drivers,if you dont still have them on your PC from when you rooted.

    open a command window. in windows 7,just click the start bubble,then type "command" in the search box. this should open a small black window.

    change to your mini-adb directory(folder) by the entering the following command at the prompt in your command window: cd c:\mini-adb this should change your prompt to "mini-adb>" indicating that youve changed to that directory.

    *note if you unlocked with my guide,you can use your mini-adb_vigor file. just cd to that directory( cd c:\mini-adb_vigor)

    2)flash your file put the file that you want to flash into the mini adb-folder. you can copy/paste,drag/drop or move it however you are comfortable moving files.

    plug in your phone. enable usb debugging,if its not allready.

    enter the following commands. from here on,commands will be bold and italics,comments will be blue. each line is one command,enter them one at a time. you can copy/paste or type them in.

    md5sums <filename> this will output the md5 sum of the file you will flash. make sure it matches that listed for your download

    adb devices should output your phones serial number

    adb reboot bootloader will boot you into the fastboot screen(white with colored letters)

    fastboot devices will again output serial number

    fastboot erase cache

    fastboot oem rebootRUU

    fastboot flash zip <filename>.zip

    you will see a green line on your phone as the file flashes.youll see outut in your cmd window. sometimes when flashing a complete RUU you will get an error that says "failed,reflush immediately". dont panic,just run the above line again to reflash your file

    after you get a "finished" message:

    at this point,ycould actually flashe more files if you wanted. for example,a radio and a recovery. just repeat the "fastboot flash zip" command untill youve flashed all your files. then:

    fastboot reboot-bootloader this will take you back to the white fastboot screen

    fastboot reboot your phone should reboot

    and of course,heres what the outputs will look like in the command window. red are my inputs. in this example,im installing twrp recovery on my thunderbolt,with a .zip file called: twrp111rbox1_PG05IMG

    Code (Text):
    1. Microsoft Windows [Version 6.1.7601]
    2. Copyright (c) 2009 Microsoft Corporation.  All rights reserved.
    3.  
    4. C:\Users\Scott>[COLOR="Red"]cd c:\mini-adb[/COLOR]
    5.  
    6. c:\mini-adb>[COLOR="red"]md5sums twrp111rbox1_PG05IMG.zip[/COLOR]
    7.  
    8. MD5sums 1.2 freeware for Win9x/ME/NT/2000/XP+
    9. Copyright (C) 2001-2005 Jem Berkes - http://www.pc-tools.net/
    10. Type md5sums -h for help
    11.  
    12. [Path] / filename                              MD5 sum
    13. -------------------------------------------------------------------------------
    14. [c:\mini-adb\]
    15. twrp111rbox1_PG05IMG.zip                       31ae566360d4729ff1be2a5a67952777
    16.  
    17. c:\mini-adb>[COLOR="red"]adb devices[/COLOR]
    18. * daemon not running. starting it now *
    19. * daemon started successfully *
    20. List of devices attached
    21. HT12CS012936    device
    22.  
    23.  
    24. c:\mini-adb>[COLOR="red"]adb reboot bootloader[/COLOR]
    25.  
    26. c:\mini-adb>[COLOR="red"]fastboot devices[/COLOR]
    27. HT12CS012936    fastboot
    28.  
    29. c:\mini-adb>fastboot erase cache
    30.                erasing 'cache'... OKAY [  0.262s]
    31. finished. total time: 0.263s
    32.  
    33. c:\mini-adb>[COLOR="red"]fastboot oem rebootRUU[/COLOR]
    34.                               ... OKAY [  0.222s]
    35. finished. total time: 0.223s
    36.  
    37. c:\mini-adb>[COLOR="red"]fastboot flash zip twrp111rbox1_PG05IMG.zip[/COLOR]
    38.        sending 'zip' (5573 KB)... OKAY [  0.907s]
    39.                  writing 'zip'... INFOzip header checking...
    40. INFOzip info parsing...
    41. INFOchecking model ID...
    42. INFOchecking custom ID...
    43. INFOstart image[recovery] unzipping & flushing...
    44. INFO[RUU]UZ,recovery,0
    45. INFO[RUU]UZ,recovery,15
    46. INFO[RUU]UZ,recovery,27
    47. INFO[RUU]UZ,recovery,37
    48. INFO[RUU]UZ,recovery,47
    49. INFO[RUU]UZ,recovery,60
    50. INFO[RUU]UZ,recovery,70
    51. INFO[RUU]UZ,recovery,82
    52. INFO[RUU]UZ,recovery,98
    53. INFO[RUU]UZ,recovery,100
    54. INFO[RUU]WP,recovery,0
    55. INFO[RUU]WP,recovery,100
    56. OKAY [  7.010s]
    57. finished. total time: 7.918s
    58.  
    59. c:\mini-adb>[COLOR="red"]fastboot reboot-bootloader[/COLOR]
    60.      rebooting into bootloader... OKAY [  0.151s]
    61. finished. total time: 0.151s
    62.  
    63. c:\mini-adb>[COLOR="red"]fastboot reboot[/COLOR]
    64.                      rebooting...
    65. finished. total time: 0.150s
    66.  
    67. c:\mini-adb>
    seems a lil complicated,but once you do it a couple times,its quick and easy. :)

    this method will work for s-on,or s-off phones. it will me more of a PITA with an s-on device,as the android info document inside the PH98IMG file will need to have the correct info.

    to get any PH98IMG to flash on an unlocked s on phone,you will need to:
    1)make sure the file only contains changeable images-i.e. boot,system,or recovery
    2)make sure the android info document contains the same or higher main version than what is on your phone currently.

    see http://androidforums.com/rezound-al...ndly-root-guide-start-finish.html#post3997778 for some tips on dealing with main version errors

    Advertisement
    sirjake, chucktr, lepa71 and 5 others like this.
  2. thornev

    thornev Well-Known Member

    I want to note that I followed this procedure and ran into a snag when executing "fastboot flash zip <filename>.zip". The command did fail as mentioned above, but re-executing the command resulted in "waiting for device." I waited a minute or so and nothing happened.

    What Scotty has suggested to do in this case is (after waiting at least 10 minutes for the "waiting for device" message to clear):

    1. pull battery
    2. boot to HBOOT (vol down + power)
    3. select FASTBOOT on HBOOT screen
    4. restart at the step: fastboot oem rebootRUU
    scotty85 likes this.
  3. dassh

    dassh Member

    How would this work if you have to flash the old firmware patch? I'm still s-on, with the GB firmware.

    Thanks
  4. scotty85

    scotty85 Guides Guide

    im not sure what youre asking... the firmware patch is flashed in recovery,not in hboot.

    this is for flashing any file that you would normally rename PH98IMG and then flash in hboot
    manbat, dassh and chknhwk like this.
  5. dassh

    dassh Member


    Ugh! I wasn't thinking the whole process thru. Thanks!
  6. vforvendetta68

    vforvendetta68 New Member

    I'm stuck in 1.02.605.6. I've been trying to flash 2.01.605.11 ruu for over a week now. I have a mac computer that doesn't have bootsrap. S-on and unlocked. Every f'n time I try flashing from hboot it loads for awhile but says parsing and diverts back to hboot start screen.
  7. scotty85

    scotty85 Guides Guide

    your bootloader needs to be relocked if you wish to flash a full,signed by htc ruu. you can only flash things in the unlocked bootloader that are system,recovery,or boot images.

    if you relock,and make sure your sd card is FAT32,and that the PH98IMG is on the root of the sd,it should flash.

    biggest issue folks have is incorrect name(phone must see PH98IMG.zip using wondows its easy to accidentaly name it PH98IMG.zip.zip. far less often,the file is named just PH98IMG),or the sd card format

    windows hides the file ext,so renaming "PH98IMG" with windows should result in the correct file for the phone "PH98IMG.zip"

    hope that helps :)
  8. chucktr

    chucktr Member

    Hello Scott,
    Almost called you Scooter, my nephew Scott's nickname. Anyway, we have copied your stuff over to our WebSite that we are creating concerning the ReZound. We have also 'used' your info. One part bothers us... the "fastboot flash zip recovery.zip". Everywhere else that we look we only find "recovery.img" type files being used. Now then, we used your example as a guideline to "flash zip" TWRP onto our ReZound. This was the first time we had tried installing it as a zip. All the rest were through GooManager. About two hours later we tried to make a call and could not. Our phone operations were screwed up. The 'touch' screen was going bananas. Later at home we tried to restore it to stock and have not been successful. We can get what looks like ok and then it screws up. Can even have a hard time turning it off.

    We believe that this is probably only coincidental and our Electronics were about to fail anyway -but- we still have the question about zip versus img. We have used your splendid info in the past with NO problems. For this one we would like a little clarification.

    We did have to take our ReZound back and they did replace it. So it was what it looked like, an Electronic failure. We had one before, 7 months after obtaining the first one. Now 11+ months later we are getting our third one. Still would like the img versus zip clarification IF one is available. We have searched the Web and can not find the info.

    Thanks,
    Chuck
  9. scotty85

    scotty85 Guides Guide

    fastboot flash zip zipfilename.zip and fastboot flash partition imagename.img are completely different operations.

    with the fastboot flash partition imagename.img you need to be unlocked or running a patched hboot(wich is only possible if youre s off)

    fastboot flash zip zipfilename.zip is a way to flash zip files that would normally be named PH98IMG and flashed via a FAT32 formatted sd card. as such,only those types of files can be used. they must contain a properly named partition(examle hboot,recovery,or boot) and a correctly configured android info text document.

    this type of file is a way to install various images with a stock,locked hboot.

    what clarification do you need,or what further questions do you have? you can searech for "flash PH98IMG" for info,basically all this guide is doing is flashing that type of file from fastboot instead of from the sd card. the advantages are:
    1)you dont need to physically move the file onto and off of the sd card
    2)proper name is no longer a factor-the zip file and be named anything(example ph98img-amon-3.14.zip)
    3)sd card format is no longer a factor. this can be used even if an sd card is not present in the phone :eek:

    i mess with several htc phones. this works for all of them,and since i find it cumbersom and tedious to move stuff on and off the sd card and then wait for the phone to load and flash files in hboot,i have stopped using the sd card a looong time ago on phones that it works on. matter of fact,flashing files physically from the sd does not work at all on newer phones that do not contain a removeable sd. placing a PxxxIMG file on the internal storage of a one s,one x,one xl,or one,does not work. the only option to flash PxxxIMG type files is via fastboot as described here.

    i assure you the method itself has not destroyed your electronics. if your devices were s off,the file itself if it contained a corrupt image could have affected something,but the method itself defiantely did not. if it did id have alot of dead phones on my hands ;) :p

    feel free to holler if you have any further questions.

    last and not least,if you have copied any of my guides,id appreciate a link so i can check them out :)
    chucktr likes this.
  10. Colchicine

    Colchicine Well-Known Member

  11. scotty85

    scotty85 Guides Guide

    the black screen,with silver htc in the middle,is the correct response. this is ruu mode. youll have to issue more commands if you want anything further to happen ;)
    Colchicine likes this.
  12. Colchicine

    Colchicine Well-Known Member

    DOH!
    Further evidence of my ineptitude.

    So issued the next command. The command window said that it had finished flashing the RUU, but the green bar on the screen got to 75% and stopped. I waited, and decided to continue with the next command and my output looks identical to yours. I went through the rest of the process and I still get bootlooping.

    Did the green bar indicate it wasn't actually finished?
  13. scotty85

    scotty85 Guides Guide

    as long as the cmd window said finished,it was fine. the green bar is often not very accurate,and doenst quite reach the right side of the screen :eek:

    you can try the factory reset and clear storage options in hboot,but if the bootlooping continues after that,its likely that the raindrops have simply damaged some internal part of the phone :(
  14. Colchicine

    Colchicine Well-Known Member

    It appears to be a goner. :(
  15. chucktr

    chucktr Member

    Thanks for the reply. Yes, I know and realize the statement about the hardware was foolish. It was only coincidental that the hardware failed at that time. Thought you might find it funny -but- guess it wasn't worded properly. Anywho, we are very thankful to you and mrsmith for most of the accomplishments on our ReZound.

    I am getting older and have more 'senior moments' than I care to. The img versus zip question was, as you suspected and sorta declared, foolish. Sorry. -But- once again thanks for your excellent descriptions.

    My adventures are to be found at:
    HTC Rezound - Smartphone and
    CM10 Install

    We have been trying to collect 'ALL' the information on the ReZound before it disappears. Had it for a long, long time before we got the courage to 'play' with it. Anyway, thanks and if you have any discrepancies with my WebPages please let me know.
    scotty85 likes this.
  16. chucktr

    chucktr Member

    Well I read the information again... and again... and finally saw what I didn't see before.

    fastboot flash zip zipfilename.zip
    fastboot flash partition imagename.img

    Sorry I didn't read them correctly or closely enough the very first time. I was trying to:

    fastboot flash recovery recovery.img

    I never saw the 'partion' option.
    ==================
    Because I once again misinterpreted the command description. I have made enough of a fool of myself so we can please just drop this subject. -But- thanks very much for all your info and help. I will continue to follow your advice.
    scotty85 likes this.
  17. scotty85

    scotty85 Guides Guide

    glad it finally clicked for you... the various boot and flash commands are similar and can be very confusing.

    i skimmed over your web pages,looks like alot of good info. defiantely more than i can take in a few minutes ;)

    glad to be of help,holler if you have any further clarifications and/or questions :)
  18. chucktr

    chucktr Member

    Scott,
    Thanks for the friendly reply. I have used your info a lot and as you can tell in my WebPages I refer to you -- a lot. IF there is anything that you do not want to be associated with please let me know and I'll remove any references ... if there are any.
    My concentration is on the ReZound which is my first and only smartphone. I do believe that it got orphaned to soon. Hardware wise it is a strong phone ... in my humble opinion. So, thanks for your continued efforts and I hope to converse with you again.
    Chuck
    scotty85 likes this.
  19. chucktr

    chucktr Member

    Hello Scotty,

    Your explanations are great and they cover everything. Just have one more question (actually 1000's more, but just one for now:)). We have been 'playing' with the CM10.1 JB for the ReZound, and it appears that the procedure to install it should work for the AndroidPolice_4.03.605.2_PH98IMG.zip also... am I right??? This is using TWRP.

    Oooops a second question. Can the above System zip's be installed following your directions or do the System zips have to be installed differently.

    We are just being cautious(cowardly!) and seeking directions from an "experienced" individual.

    Thanks in advance for your answer,
    Chuck

    The CM10.1 install is as follows:

    1. Compare MD5 Sum
      Windows: MD5 Calculator
      LINUX: Open Terminal and type: md5sum [path to the rom on your sd card]
      Mac: Open a terminal and type: md5 [path to the rom on your sd card]
    2. Put the ROM .zip file on the root of your SD Card
    3. ReBoot to Recovery
    4. Select "Wipe"
    5. Wipe the following:
      Wipe ALL data/factory reset x2
      Wipe /data x2
      Wipe /cache x2
      Wipe Dalvik-cache x3
      Wipe /boot x2
      Wipe /system x3
      Optionally wipe:
      Wipe battery stats
      Wipe rotate settings ​
    6. Scroll to and press Return
    7. Install ROM from SD Card
    8. ReBoot and enjoy!
  20. scotty85

    scotty85 Guides Guide

    oops,saw this in an email,forgot to come here and actually reply to it :eek:

    on your first question,zips intended to flash in recovery,i.e.,roms, are put together differently than zip files intended to be installed by the bootloader.

    as such,cm10.1 will have to be installed via recovery,and the PH98IMG type files will have to be installed using hboot and the sd card,or fastboot and ruu mode(as described here)

    im not sure what youre refering to as a system zip? im assuming that youre refering to a PH98IMG type file,wich will need to be installed via the bootloader.

    a PH98IMG file contains an android info text document,wich basically tells the phone some important info about the phone. the main version,the CID allowed to flash it,wether or not to make the phone require a second flash after the bootloader and radios are installed(called a hboot pre-update) amongst other things.

    also contained are one or more appropriately named images. example: system,boot,recovery,radio,splash1, etc. if these images are not named corrcetly,the phone will not flash them. the phone will flash whatever image you name correctly to that partition :eek: example,rename your boot image "recovery" and the phone will install recovery into the boot partition. this is just for information,dont actually do it. installing the wrong images can destroy the phones file system,potentially unrepairably. the point is to use caution what images you place inside a zip file for the phone to flash,as it will flash them. a corrupt image could much things up nicely.

    the PH98IMG files can be signed,or unsigned. an s-off phone obviously will flash anything you pack up in the correct format.

    an s-on phone,if unlocked will allow you to flash unsigned PH98IMG with boot,system,and recovery images only.

    to flash a signed,full ruu file,the s on phone must be locked. attempts to modify the signed PH98IMG file will break the signiture,so the phone will not flash them.

    last and not least,your rom install procedure is just fine for s off phones. if the device is s on,youll need to either fastboot boot recovery,or manually install the boot image.

    you dont need to wipe things multiple times. electronic wipes are not like sweeping bread crumbs off the counter-leaving little electronic bits in place. :p wiping once is fine. i think the recomendations to wipe multiple times originated for the desire for rom devs to make sure folks did it at least once ;) :D

    hope that answered your questions sufficiently :)
    chucktr likes this.
  21. chucktr

    chucktr Member

    Hello Scotty,

    Thanks very much for the reply. Yes. Your explanation cleared up some things and brought questions on others which I will hold off until I have studied the most recent info.

    This is very good info and I would like to include it on my WebPages -- with credit to you -- IF you don't mind. I will make a private viewing for you IF you so desire.

    This is getting more and more fun.

    Thanks muchly.
    Chuck
  22. chucktr

    chucktr Member

    Scott,
    I have translated the CM10 install from the 'SD Card' version to a 'fastboot' version or at least I think I have. My main concern is the 'rebootRUU' part. I couldn't find any info on it -but- I do believe that it is necessary. Am I correct??
    Thanks for your time and help,
    Chuck

    =============== SD Card version ================

    1. Compare MD5 Sum
      Windows: MD5 Calculator
      LINUX: Open Terminal and type: md5sum [path to the rom on your sd card]
      Mac: Open a terminal and type: md5 [path to the rom on your sd card]
    2. Put the ROM .zip file on the root of your SD Card
    3. ReBoot to Recovery
    4. Select "Wipe"
    5. Wipe the following:
      Wipe ALL data/factory reset x2
      Wipe /data x2
      Wipe /cache x2
      Wipe Dalvik-cache x3
      Wipe /boot x2
      Wipe /system x3
      Optionally wipe:
      Wipe battery stats
      Wipe rotate settings ​
    6. Scroll to and press Return
    7. Install ROM from SD Card
    8. ReBoot and enjoy!

    ============== Fastboot version ============

    1. Compare MD5 Sum
      Windows: MD5 Calculator
      LINUX: Open Terminal and type: md5sum [path to the rom on your sd card]
      Mac: Open a terminal and type: md5 [path to the rom on your sd card]
    2. Put the ROM .zip file in your AndroidSDK dir
    3. Connect ReZound to the PC in Charge mode.
    4. adb devices - check that we are connected
    5. adb reboot bootloader -
    6. fastboot devices -
    7. Wipe the following:
      fastboot erase data
      fastboot erase cache
      fastboot erase Dalvik-cache
      fastboot erase boot
      fastboot erase system
    8. fastboot oem rebootRUU -
    9. fastboot flash zip ROM.zip -
    10. fastboot reboot-bootloader -
    11. fastboot reboot - ReBoot and enjoy!
  23. scotty85

    scotty85 Guides Guide

    correct. if you want to flash something from fastboot,the phone has to be in ruu mode

    well,i do not believe you can erase dalvik cache,as its normal location is inside the /data partition. so you need to fastboot erase cache,data,boot,system

    otherwise,that would work,assuming a proper rom.zip with an android info text document,and properly named cm10 boot and system images. :)
    chucktr likes this.
  24. chucktr

    chucktr Member

    And thanks again Scott,

    However, your last statement:

    left me a little uncomfortable. IF the ROM.img is flashable via the SD card, say the CM10.1 image, then it should be flashable with the fastboot... right?? I mean, they should have the 'same' requirements. Especially, IF you are S-Off.

    Take care,
    Chuck
  25. scotty85

    scotty85 Guides Guide

    no. they do not have the same requirements at all. thats what i was getting at with this explanation above(wich i apparently didnt do very well :p):

    extract a PH98IMG file,such as an ruu. then extract your cm10 rom. youll find that while the rom does contain a boot image that is suitable to pack into a PH98IMG file,that it does NOT contain a system image,it contains install scripts and system files. nor will it have an android info text document,so the cm10 rom zip is not flashable via the bootloader.

    using the fastboot flash zip command and ruu mode,you can only flash PH98IMG files that would also flash from the sd card. maybe this is where your confusion about the types of files originates. the method described here is simply a way to flash PH98IMG files that doesnt need a properly formated sd card,and the files can be named something else.

    if you really have your heart set on creating a cm10 PH98IMG file,youd have to flash the rom via recovery,boot the phone,then dump the system partition. you could then pack up this image file,with the boot image file from the rom,and a proper android info document. there is no way to flash any file intended for recovery flash directly from the bootloader(hboot or fastboot/ruu mode). recovery files will need to be installed via a custom recovery.

    hope that clears it up for you :)

Share This Page