1. Check out our companion app, Forums for Android! Download from Google Play

Root an easier way to flash PB31IMG files

Discussion in 'Android Devices' started by scotty85, Jan 20, 2012.

  1. scotty85

    scotty85 Well-Known Member
    Thread Starter

    Jul 25, 2010
    all htc phones utilize a PxxxIMG file system to flash RUUs and such in hboot. having guides up here,the thunderbolt,and merge forums, and being active on the board i see alot of folks have trouble getting PxxxIMG(PB31IMG in case of the incredible) 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 or unrevoked,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.
    Multiupload.com - upload your files to multiple file hosting sites!
    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 unrevoked/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.

    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.
    4. C:\Users\Scott>[COLOR="Red"]cd c:\mini-adb[/COLOR]
    6. c:\mini-adb>[COLOR="red"]md5sums twrp111rbox1_PG05IMG.zip[/COLOR]
    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
    12. [Path] / filename                              MD5 sum
    13. -------------------------------------------------------------------------------
    14. [c:\mini-adb\]
    15. twrp111rbox1_PG05IMG.zip                       31ae566360d4729ff1be2a5a67952777
    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
    24. c:\mini-adb>[COLOR="red"]adb reboot bootloader[/COLOR]
    26. c:\mini-adb>[COLOR="red"]fastboot devices[/COLOR]
    27. HT12CS012936    fastboot
    29. c:\mini-adb>fastboot erase cache
    30.                erasing 'cache'... OKAY [  0.262s]
    31. finished. total time: 0.263s
    33. c:\mini-adb>[COLOR="red"]fastboot oem rebootRUU[/COLOR]
    34.                               ... OKAY [  0.222s]
    35. finished. total time: 0.223s
    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
    59. c:\mini-adb>[COLOR="red"]fastboot reboot-bootloader[/COLOR]
    60.      rebooting into bootloader... OKAY [  0.151s]
    61. finished. total time: 0.151s
    63. c:\mini-adb>[COLOR="red"]fastboot reboot[/COLOR]
    64.                      rebooting...
    65. finished. total time: 0.150s
    67. c:\mini-adb>
    seems a lil complicated,but once you do it a couple times,its quick and easy. :)


    speedster63, zimlokks, rsarno and 2 others like this.
  2. sdrawkcab25

    sdrawkcab25 Well-Known Member

    Aug 5, 2010
    Added this to the root guide sticky
  3. rooterbooter

    rooterbooter Member

    Jan 21, 2012
    So I got the PB31IMG file mentioned here --> http://androidforums.com/incredible...egain-root-s-off-htc-unlocked-bootloader.html
    confirmed the MD5 checksum. Then followed those instructions and it diddnt work. So I followed your instructions and it is perfect until I reach the command fastboot flash zip <filename>.zip

    I get the following error:
    C:\mini-adb>fastboot flash zip PB31IMG.zip
    sending 'zip' (3064 KB)... OKAY [ 0.681s]
    writing 'zip'... INFOzip header checking...
    INFOzip info parsing...
    INFOchecking model ID...
    FAILED (remote: 41 model id check fail)
    finished. total time: 2.401s

    Not sure why model id check is failing. What could I be doing wrong? my bootloader shows S-On but it is unlocked for sure with htcdev. All I want is root so I can tether. Why isnt my poor rezound liking this? Please help!
  4. scotty85

    scotty85 Well-Known Member
    Thread Starter

    Jul 25, 2010
    well,first of all,this is for the incredible,not the rezound. if you do in fact have a rezound and not an incredible,that is why the id check is failing and not letting you flash,you will need your own rezound specific recovery image,and you may need a different superuse zip file,but otherwise the following will apply,with exception that rezound hboot files are PH98IMG,NOT PB31IMG ;)

    if you do have an incredible:

    unfortunately,htcdevs unlocked s-on and the radio s-off via unrevoked forever are not the same.

    some htcdev unlocked models seem to allow PxxxIMG to be installed via hboot,while some do not. typically you get the ID check error when trying to flash firmware for another carrier,so the issue must be something to do with the CID of the phone,and it *may* actually work to flash the PB31IMG in hboot by placing it on a "gold card". i unfortunately do not have any unlocked s-on devices to experiment with. only things i have htcdev unlocked were allready radio s-offed :eek: ,so im not 100% sure on the limitations of different models.

    you have a couple different options for getting your recovery. take the image out of the PB31IMG file(extract it first if you have to) and then place that image into your mini-adb,tools,platform tools,or wherever you are putting the files you want to push/flash. put the phone in fastboot as described above,and make sure its being recognized in your command window with "adb devices"

    the first option,if you want to permanently install a custom recovery,you can flash your recovery with the following command:

    fastboot flash recovery <recoveryname>.img

    for example,if your recovery is named PB31IMG-clockwork your command wuld be:
    fastboot flash recovery recovery-clockwork.img

    if you dont really need a custom recovery(i.e.,never intend to make backups,flash roms,etc.) you can "softboot" the recovery into the phones memory temporarily with the following command:

    fastboot boot <recoveryname>.img

    the recovery will launch on the phone,and you can flash the superuser zip file from your linked thread. wile on screen,the recovery will look and function just like it was there permanently. after you reboot to your OS,the custom recovery will be gone,and youll have the stock recovery in case OTA updates come that you dont want to miss.(yes,an OTA will break root,but all youll need to do is reflash the superuser zip files afterward). if you need to make a backup or flash a file,youll just need to repeat the process to softboot it again.

    so,with the a recovery named PB31IMG-clockwork your command would be:
    fastboot boot recovery-clockwork.img

    hope that helps :)
  5. nschiwy

    nschiwy Active Member

    Apr 3, 2012
    Computer Science Student
    So i followed the instructions to flash the 7.07 radio to my incredible and now it has been sitting at the splash screen for a long time... I decided to leave it alone in case this is something normal that it needs to do but it is getting to the point where I am feeling like I may have a brick :( is this something normal or is there something I can do to revert to my former settings to at least have a working phone? even if it has the ancient 7.28 radio (like it did before) I don't really care...


    the following is what I did in CMD, I admit that I didn't check the MD5 but I have never had a problem with it before. Maybe when using hboot/fastboot I should have been more careful.

    Code (Text):
    1. Microsoft Windows [Version 6.1.7601]
    2. Copyright (c) 2009 Microsoft Corporation.  All rights reserved.
    4. C:\Users\Nick>cd /
    6. C:\>cd miniadb_inc
    8. C:\miniadb_inc>adb devices
    9. * daemon not running. starting it now *
    10. * daemon started successfully *
    11. List of devices attached
    12. HT05PHJ02533    device
    15. C:\miniadb_inc>adb reboot bootloader
    17. C:\miniadb_inc>fastboot devices
    18. HT05PHJ02533    fastboot
    20. C:\miniadb_inc>fastboot erase cache
    21.                erasing 'cache'... OKAY [  1.262s]
    22. finished. total time: 1.262s
    24. C:\miniadb_inc>fastboot oem rebootRUU
    25.                               ... OKAY [  0.100s]
    26. finished. total time: 0.100s
    28. C:\miniadb_inc>fastboot flash PB31IMG.zip
    29. unknown partition 'PB31IMG.zip'
    30. error: cannot determine image filename for 'PB31IMG.zip'
    32. C:\miniadb_inc>fastboot flash zip PB31IMG.zip
    33.        sending 'zip' (5824 KB)... OKAY [  0.850s]
    34.                  writing 'zip'... INFOzip header checking...
    35. INFOshift signature_size for header checking...
    36. FAILED (remote: 32 header error)
    37. finished. total time: 6.547s
    39. C:\miniadb_inc>fastboot reboot-bootloader
    40.      rebooting into bootloader... OKAY [  0.098s]
    41. finished. total time: 0.098s
    43. C:\miniadb_inc>fastboot reboot
    44.                      rebooting...
    45. finished. total time: 0.096s
    47. C:\miniadb_inc>
    As you can tell, probably, it seems like it failed to flash the radio and in hboot it still says radio:..."7.28" so I am pretty sure that no update occurred which begs the question why did it change anything at all?? I AM able to access hboot and CWM and I am currently attempting to restore a nandroid I made with the hopes that when I reboot things will be back to normal

    UPDATE: Good News: performing the nandroid restore DID bring me back to where I was before in CM7.2 and I am perfectly happy with that. However, I wouldn't mind being able to update my radio to something that performs better because I did notice a significant change in the signal quality when switching from my D2 to the inc and at first I owned that up to the age of the phone but maybe that was because of the radio and if I could update that, I would be very happy!
  6. scotty85

    scotty85 Well-Known Member
    Thread Starter

    Jul 25, 2010
    i would verify the md5 of your download,and try it again. you can use the md5 sums utility inside the mini-adb file,as described in the first post, with the command:

    md5sums filename.ext

    with a pb31img.zip file,youd use:

    md5sums PB31IMG.zip

    it is extremely important to check md5 sums,or file sizes,or something,to verify the integrity of your download,as a corrupt hboot or radio WILL leave you with an unrecoverable brick.

    its pretty important with rom flashes as well,especially if youre using clockwork recovery. flashing bad files can destroy memory blocks that can eventually lead to the phone being unusable.

    in short- checking md5 sums is a habbit that would be good for you to get in to ;)

    where did you get your PB31IMG? it looks like it failed without even trying to flash it(wich may be good for you). im not 100% sure what the header failure is refering to. are you s-off?
    nschiwy likes this.
  7. nschiwy

    nschiwy Active Member

    Apr 3, 2012
    Computer Science Student
    checking the MD5s is just a pain but it's worth not breaking my phone so i guess i will have to start keeping an eye on it :)

    I do have S-Off, and I got the radio from DINC.DOES-IT.NET - HTC Incredible Files

    As with a lot of people, for some reason trying to flash the file in hboot does not work for some reason so when i saw your guide to using adb and oemRUU I was excited because even though I haven't had a lot of trouble with the old radio one thing that I want with my phone or just things in general is to have full control over it. When I buy something it is mine and I believe that any modifications that I make to it are completely fair game and it would be a much better world (in my opinion) if more phone manufacturers were more cooperative with the dev community like HTC is with their unlocked bootloader.
  8. scotty85

    scotty85 Well-Known Member
    Thread Starter

    Jul 25, 2010
    i agree completely, tho i do also believe that if i mess up my phone with a bad bootloader flash,then the manufacturer shouldnt have to warranty it. maybe if more folks were honest when they brick their devices it could be different. :(

    at any rate,i downloaded this radio file from your link,and made sure the md5 matched the one listed: 617E6969061DCBC3CA613FA6D02565F0

    fired up the junk inc into hboot,chose fastboot and at first i thot the android info document looked wierd,but it flashed fine,and rebooting back to bootloader it now shows for the baseband.

    im not sure why you had trouble with it... other than maybe a bad download,or maybe you were in hboot,not fastboot? make sure you have in red: FASTBOOT USB under the green writing.

    if you have a blue HBOOT USB PLUG you are in the wrong mode :eek: it can be misleading,as you do get a serial number back from "fastboot devices" while in hboot.

    Code (Text):
    2. c:\miniadb_inc>md5sums PB31IMGradio.zip
    4. MD5sums 1.2 freeware for Win9x/ME/NT/2000/XP+
    5. Copyright (C) 2001-2005 Jem Berkes - http://www.pc-tools.net/
    6. Type md5sums -h for help
    8. [Path] / filename                              MD5 sum
    9. -------------------------------------------------------------------------------
    10. [c:\miniadb_inc\]
    11. PB31IMGradio.zip                               617e6969061dcbc3ca613fa6d02565f0
    13. c:\miniadb_inc>fastboot erase cache
    14.                erasing 'cache'... OKAY [  0.569s]
    15. finished. total time: 0.569s
    17. c:\miniadb_inc>fastboot oem rebootRUU
    18.                               ... OKAY [  0.101s]
    19. finished. total time: 0.102s
    21. c:\miniadb_inc>fastboot flash zip PB31IMGradio.zip
    22.        sending 'zip' (9713 KB)... OKAY [  1.310s]
    23.                  writing 'zip'... INFOzip header checking...
    24. INFOzip info parsing...
    25. INFOchecking model ID...
    26. INFOchecking custom ID...
    27. INFOstart image[radio] unzipping & flushing...
    28. INFO[RUU]UZ,radio,0
    29. INFO[RUU]UZ,radio,9
    30. INFO[RUU]UZ,radio,18
    31. INFO[RUU]UZ,radio,23
    32. INFO[RUU]UZ,radio,32
    33. INFO[RUU]UZ,radio,37
    34. INFO[RUU]UZ,radio,46
    35. INFO[RUU]UZ,radio,51
    36. INFO[RUU]UZ,radio,60
    37. INFO[RUU]UZ,radio,69
    38. INFO[RUU]UZ,radio,78
    39. INFO[RUU]UZ,radio,87
    40. INFO[RUU]UZ,radio,92
    41. INFO[RUU]UZ,radio,97
    42. INFO[RUU]UZ,radio,100
    43. INFO[RUU]WP,radio,0
    44. INFO[RUU]WP,radio,7
    45. INFO[RUU]WP,radio,16
    46. INFO[RUU]WP,radio,21
    47. INFO[RUU]WP,radio,26
    48. INFO[RUU]WP,radio,35
    49. INFO[RUU]WP,radio,40
    50. INFO[RUU]WP,radio,45
    51. INFO[RUU]WP,radio,50
    52. INFO[RUU]WP,radio,100
    53. OKAY [ 27.300s]
    54. finished. total time: 28.611s
    56. c:\miniadb_inc>fastboot reboot-bootloader
    57.      rebooting into bootloader... OKAY [  0.099s]
    58. finished. total time: 0.100s
    60. c:\miniadb_inc>
    nschiwy likes this.
  9. nschiwy

    nschiwy Active Member

    Apr 3, 2012
    Computer Science Student
    UPDATE: I just downloaded it again from the dinc.does-it website and checked the md5 sum with a sum checker that i downloaded from the play store. They were equal so i am going to try everything again later. It was definitely a bad download the first time, the file size is significantly larger this time. I'm just glad it was so bad that it didn't know what to do with it rather than trying to flash a bad file. I don't have time to do the work now because I have to go to class but when i get home from work later I will try again and report back. Thanks for all of your help!
    scotty85 likes this.
  10. scotty85

    scotty85 Well-Known Member
    Thread Starter

    Jul 25, 2010
    no prollem... let me know how it goes. definately was a good thing it didnt flash... bad radio flash can brick your device :eek:

    also,a good app for checking things on your phone is scary aliens AFV "android file verifier". i use it... its a great app! :cool:
    nschiwy likes this.
  11. nschiwy

    nschiwy Active Member

    Apr 3, 2012
    Computer Science Student
    So I wound up flashing it using hboot and it worked! So it was a bad file that was holding me back the whole time. I'm just very glad it didn't try to flash the bad file through fastboot, I was very lucky for that. Anyway thank you very much for your help and guidance.

    To those reading this I highly recommend checking your MD5s if you don't already. I got lucky this time but I could have bricked my phone just as easily because I was being careless. Take that extra time so you don't wind up with a $200 paperweight :)
    scotty85 likes this.

Share This Page