Jump to content


Photo

[GUIDE][MAC OSX] Cracking Sense: Unlocking HBOOT & Flashing

Started by dmmarck ,

  • Sign In To Reply:  

dmmarck #1

dmmarck
  • Ombudsman of Mountain View
  • Offline
  • 1381 posts
  • Location: Commonwealth of Virginia
  • Device: NEXII

Posted Aug 6 '13 @ 5:55 AM

Unlocking the HTC One with a Mac is ridiculously simple. If you want to sip from the luxurious fountain that is the HTC One development scene, please, continue reading.
 

WARNING

First thing’s first:  this will wipe your shit.  Your apps, your photos—everything.  Make a backup or don’t complain when your photos and Mumford and Sons mp3s are nowhere to be found.  Because unlocking wipes everything and it cares not about your feelings.  You assume all risks and liabilities.  Oh and your warranty is probably voided too.  So I hope you have insurance, lest the apocalypse happens.

Lastly, this guide is for Macs.  That's what I use (burn me at the stake later).  However, you can easily adapt it for Windows/PC as well.  Make sure you have the correct drivers installed and that you have ADB/fastboot on your machine (try the Android SDK).  Once you have that, just amend the fastboot commands accordingly (e.g. just use "fastboot" as a prefix instead of "./fastboot").

 
Before you prepare to unlock your One, you need an HTCdev account.  Why?  Because unlike the militant tyrants that run Samsung, HTC loves you and your tinkering…so long as you sort of pretend you’re doing it for serious business (i.e. app development).  So go to HTCdev.com and register.
 
You also need ADB/fastboot on your machine.  I’m using an old “superboot” folder from the ancient days of the Galaxy Nexus.  It’s in my main/home directory and has yet to fail me.  Alternatively, you can use the package Cory uses in his Nexus 7 unlocking guide.  Just make sure to unzip the package somewhere easy to find on your Mac, because you’ll be “cd’ing” (changing directory) to it and putting everything you need to flash in that folder.
 

NOTE


Quick note on fastboot.  For my ye ole superboot folder, the fastboot “prefix” (for lack of a better term) is “./fastboot-mac.”  Therefore, every time I type a fastboot command in Terminal, I need to use that prefix to “begin” the prompt.  For example, to flash a recovery, I type $ ./fastboot-mac flash recovery recoverythatisnotCWM.img and boom, it works.  If you use another fastboot folder/package, be familiar with the prefix.  It could be “./fastboot-mac” or it could be “./fastboot”; knowing that saves a lot of headaches and frustrations.*
 
Also, be familiar with how it generally works.  You need to be plugged in to your computer with your phone in HBOOT (the bootloader in normal speak) to use fastboot.  Once in HBOOT, select “FASTBOOT” with the volume keys and press power.  This puts you in “FASTBOOT USB” mode (this should be highlighted in a menacing red) and it enables flashing/communications between your Mac's Terminal and your One.  From here, you can type in fastboot commands from your Terminal and those commands will cause an effect on your phone, may it be flashing a baseband/radio, flashing a recovery, or erasing certain partitions.  It is a very powerful device, so read up or ask questions if you're nervous.  Once you learn it--and get used to it--it'll be like riding a bike.  Sort of.

Lastly, here's a protip for my kindred lazy souls:  if you don't feel like typing something out, particularly a name of a recovery, drag and drop the file/image into Terminal after typing out the requisite fastboot command, substituting the name of the thing you're flashing with the dropped item.  Additionally, if you want to "cd" to a certain directoy, such as the fastboot directory, drag and drop the folder after you type "cd" (plus a space after those letters).  The drag and drop shortcut is amazing and I use it relentlessly.  Why?  I can't tell you how many times I misspelled a recovery name or a stock image when I was up at 3 am flashing away like a G.  Countless, countless times.  

*For purposes of this guide, I'll be using "./fastboot-mac"

 
Lastly, make sure your One actually communicates with your Mac.  Download Android File Transfer (if you don't have it already) and plug the One into your Mac.  Does AFT pop up?  Does HTC SYNC pop up?  If the answer to both questions is a "yes," then have no fear, we're good to go.  I also recommend setting up HTC SYNC, but I don't think you need it (disclaimer: I did it months ago, have never used it, and have no idea what difference it makes).
 
Now, the easy part:
  • Using your shiny new HTCdev account, go to this convenient location that deals with this exact exercise.
  • See the "Supported Devices" menu on the right?  Open the menu and scroll allll the way down.  Select "All Other Supported Models" and click "Begin Unlock Bootloader."
  • Now, after agreeing to HTC's mandatory legal language (<3 lawyers), you'll be walked through a billion step process to unlock the bootloader.  Like Neo, you have two choices.  You can go through this list...or you can just wing it and come back to this at Step 9.  Let's wing it.
  • Go to the settings menu on your One and find the power menu.  You'll see something called "fast boot."  Unfortunately, you don't want this.  Unclick it.
  • Power down the phone and plug it into your Mac via a USB cable.
  • With the phone powered down, simultaneously hold down the POWER button and the VOLUME DOWN button.  This will send you to a white screen full of crazy colors--a/k/a HBOOT.  (Alternatively, if you're lazy like me, you can restart the phone instead of powering down.  During the restart, hold down volume down.  That'll get you to HBOOT as well.)
  • Do you see the word FASTBOOT in a list/menu of options?  Find it with your volume keys and use the power button to select it.  This will put you into FASTBOOT USB mode.
  • Now, just for shits and giggles, make sure have Terminal open on your Mac, make sure you've cd'ed to the proper fastboot folder, and make sure your device shows up in the list of fastboot devices.  Type this command $ ./fastboot-mac devices and hit enter.  Numbers showing up?  Good.
  • Now that fastboot is confirmed working, enter this command into Terminal: $ ./fastboot-mac oem get_identifier_token
  • If done correctly, the above results in a long and insane stream of numbers.  When you see this stream--a/k/a an Identifier Token, go to Step 9 of the HTCdev walkthrough.  
  • Copy and paste everything from (and including<<<< Identifier Token Start >>>> to <<<<< Identifier Token End >>>>> into Step 10 of the HTCdev walkthrough.  
  • If you highlighted the word "INFO" 18 times when copying your Identifier Token, delete that word.  It's superfluous and it will just result in HTC submitting your serial number to the NSA.  Hit submit once the Identifier Token is properly pasted into Step 10. 
  • Upon submission, the kind souls of HTCdev will email you a little binary file that will be used to unlock the device.  Wait for the email and save the binary into your fastboot folder.  The binary is Unlock_code.bin
  • Now that the binary is in your fastboot folder, flash it onto your device:  $ ./fastboot-mac unlocktoken Unlock_code.bin
  • This will open up a very Nexus-like menu on your phone; with the volume keys, choose "Yes" to unlock it and press power to accept your choice.
  • You should see a "Tampered" and "Unlocked" at the top of the HBOOT main menu.  This will confirm your sin of unlocking the bootloader.  Congrats  :).
 

INFO

Upon reboot, you'll have to sign in and set your phone up again. If you plan on flashing stuff immediately, just bypass everything by not signing in and getting to the main homescreen as soon as possible.


  • Cory Streater, Cyber Warrior and 7stringer like this

tacsig513.png

UNLEASH THE BEAST: General Nexus 5 Hackery


LG NEXUS 5 - Black 16GB, Android 4.4 KitKat, Unlocked, Rooted, franco.Kernel

ASUS NEXUS 7 (2013) - Black 16GB, Android 4.3 Jelly Bean, Unlocked

 


dmmarck #2

dmmarck
  • Ombudsman of Mountain View
  • Offline
  • 1381 posts
  • Location: Commonwealth of Virginia
  • Device: NEXII

Posted Aug 6 '13 @ 5:55 AM

If you're going to flash roms, you'll need a custom recovery.  Luckily, it's easy peasy to flash one: 

  1. Remember all the steps we took to use fastboot on a Mac and to get into HBOOT?  Do those (including making sure that silly "fast boot" option is unchecked).  Boot into HBOOT, select FASTBOOT, and wait at FASTBOOT USB with your phone plugged in and a Terminal window open.  Remember, be sure to "cd" to the fastboot package on your Mac, or else your Mac won't be able to communicate with your One!
  2. Download a recovery of your choice.  My recovery is the latest version of TWRP, found here.  Place the recovery image into the fastboot folder on your Mac.
  3. To flash the recovery, enter this command: $ ./fastboot-mac flash recovery [nameofrecoveryimage].img
  4. If you're lazy, like me, type the first bit of that and when you get to the recovery image name, drag and drop the img file from the folder into terminal.
  5. Press enter and let it flash.
  6. Now, reboot the bootloader by either a fastboot command ($ ./fastboot-mac reboot-bootloader) or by navigating in the HBOOT menu via the volume keys.
  7. Select RECOVERY from the HBOOT menu.  If you booted into a custom recovery, bravo.  If not--don't panic--this happens a lot (apparently).  Just repeat the steps.  It may also help not to reboot the bootloader and just boot directly into the recovery.  I also like to reboot the phone, go back to HBOOT, and boot into recovery again just to make sure everything works.

NOTE

Some folks don't get the recovery to "stick" (meaning it doesn't actually flash, or if it did, it gets erased). In fact, my first attempt ended up not sticking. I decided not to reboot the bootloader on the second attempt and for some reason, it worked. I also made sure that "fast boot" was not checked and I dragged and dropped the recovery image instead of typing it in.  A lot of this stuff can be trial and error.  My advice?  Calm, deep breaths and plenty of nicotine.


  • Cory Streater and 7stringer like this

tacsig513.png

UNLEASH THE BEAST: General Nexus 5 Hackery


LG NEXUS 5 - Black 16GB, Android 4.4 KitKat, Unlocked, Rooted, franco.Kernel

ASUS NEXUS 7 (2013) - Black 16GB, Android 4.3 Jelly Bean, Unlocked

 


dmmarck #3

dmmarck
  • Ombudsman of Mountain View
  • Offline
  • 1381 posts
  • Location: Commonwealth of Virginia
  • Device: NEXII

Posted Aug 6 '13 @ 5:55 AM

Flashing a rom is a fundamental exercise in the world of Android.  Here are some general pointers:

  1. When in doubt, wipe everything.  EVERYTHING.  Data, cache, dalvik.  If something screws up, 9 times out of 10 it's because you didn't wipe.  If you're updating a rom via a new "nightly," it's typical to only wipe the cache and the dalvik.  This is called a "dirty wipe" or a "dirty flash."
  2. With the One (and a lot of other devices), the boot.img must be flashed with the rom.  Now, don't panic.  For most roms, it'll have the boot.img (kernel and ramdisk) included.  The rom thread/post will clarify, and if it doesn't--ask the dev!  You can also fastboot the boot image, but alas, it's usually unnecessary.  If you're stuck in a bootloop (meaning it doesn't boot past an endless cycle of boot animations), the usual culprit is a lack of a boot.img.
  3. Be sure to flash the requisite Google Apps ("GAPPS") package.  Generally, this contains system apps like the initial setup app and the Play Store.  Without it, your phone is kind of useless.  Some roms include them (semi-illegally) while some roms feature a separate package.  Double check the rom thread.
  4. Regarding step 3, always always always flash GAPPS after you flash the rom.  See, most rom scripts, particularly AOSP-based ("Android Open Source Project") roms perform a system partition wipe prior to flashing.  Considering that the GAPPS install to the system partition, wiping it out after you install them seems like a fairly silly action.  Trust me--it happens.  If it happens to you, simply reboot into recovery and flash the GAPPS package again (or the whole package, if not separate).  

To flash a rom, here are the basic steps:

  1. Place the rom on the "SDcard," either manually through Android File Transfer or by ADBing it.
  2. Reboot into the recovery, via either HBOOT, the Terminal Emulator (on your phone), or some app that shortcuts to it (like Goo Manager).
  3. Make a backup, unless you like to live dangerously (I do, but do as I say and not as I do and just make a backup).
  4. Perform a wipe.  If it's a brand new rom, do a full wipe and just grin and bear it with Titanium Backup or Market Restore.  If it's a nightly update, just wipe the cache and the dalvik.  I also do my wipes in threes, because I'm neurotic and a bit OCD.
  5. Flash the rom zip.
  6. Flash the GAPPS zip (if required).
  7. You can wipe cache/dalvik now too, but it's sorta superfluous in most situations.
  8. Reboot, setup, and enjoy your device.

NOTE

You can also use apps like Rom Manager (Koush) and Goo Manager to flash stuff for you. While that's all well and good, understanding what's going on will save your ass when those apps cannot. So, use them at your own caution.

 

INFO

To achieve root access (meaning, access to the lowest possible directory, or the "root"), there are two common methods: flashing a superuser package or flashing a custom rom (or even stock rom) that comes pre-rooted. I always choose the latter. Alternatively, TWRP offers to flash a superuser package for you if it does not detect root. Therefore, if you followed the steps in post 2, you will be given the option to flash root upon rebooting out of TWRP. Follow the prompts and you'll be rooted in no time.

 

Also note that root and superuser "follows" the Android version.  You need to have the proper package that corresponds with the version of Android you are currently using.  For example, if you're on 4.2.2, you need a superuser package that can root 4.2.2.  Same with the trickier (and more problematic) 4.3.  Superuser is generally a binary and an application that implements the binary.  Thus, the binary must always be update and match your OS, or else it doesn't work.

 

Lastly, there's been some recent controversy regarding whether root access--as we've come to know it--is both necessary and viable in the future, particularly when you consider security implications.  Personally, I use a few root tools, notably file managers such as Root Explorer.  However, I don't necessarily need root access, hence my reliance on a rom to supply it for me.  If you wish to know more about root, accessing root, and rooting your One, please let us know.  We're here to inform you!


  • Cory Streater and 7stringer like this

tacsig513.png

UNLEASH THE BEAST: General Nexus 5 Hackery


LG NEXUS 5 - Black 16GB, Android 4.4 KitKat, Unlocked, Rooted, franco.Kernel

ASUS NEXUS 7 (2013) - Black 16GB, Android 4.3 Jelly Bean, Unlocked

 


dmmarck #4

dmmarck
  • Ombudsman of Mountain View
  • Offline
  • 1381 posts
  • Location: Commonwealth of Virginia
  • Device: NEXII

Posted Aug 6 '13 @ 5:55 AM

Reserved for SOFF (if/when I do it).


tacsig513.png

UNLEASH THE BEAST: General Nexus 5 Hackery


LG NEXUS 5 - Black 16GB, Android 4.4 KitKat, Unlocked, Rooted, franco.Kernel

ASUS NEXUS 7 (2013) - Black 16GB, Android 4.3 Jelly Bean, Unlocked

 


dmmarck #5

dmmarck
  • Ombudsman of Mountain View
  • Offline
  • 1381 posts
  • Location: Commonwealth of Virginia
  • Device: NEXII

Posted Aug 6 '13 @ 5:56 AM

Reserved for common questions/answers.


tacsig513.png

UNLEASH THE BEAST: General Nexus 5 Hackery


LG NEXUS 5 - Black 16GB, Android 4.4 KitKat, Unlocked, Rooted, franco.Kernel

ASUS NEXUS 7 (2013) - Black 16GB, Android 4.3 Jelly Bean, Unlocked

 


zero neck #6

zero neck
  • The Ever-Living
  • Offline
  • 63 posts
  • Location: The Island.
  • Device: One.

Posted Aug 29 '13 @ 7:48 PM

GOT AN HTC ONE for VERIZON. gave up and upgraded. not so bad actually.

 

the phone is gorgeous.

 

ima root it now, thanks for the guidaince, counselor


  • Cory Streater, Christopher Coleman and dmmarck like this

Cory Streater #7

Cory Streater
  • Your Wish Is My Command
  • Offline
  • 1533 posts
  • Location: Seattle
  • Device: Samsung S6 Edge

Posted Sep 4 '13 @ 4:36 AM

GOT AN HTC ONE for VERIZON. gave up and upgraded. not so bad actually.

the phone is gorgeous.

ima root it now, thanks for the guidaince, counselor

I'm the one who bought your S3 on Swappa. That thing better be in excellent condition when I get it. J/K I was checking out current prices and saw your avatar lol. My battery cover is a disaster (peeling paint and scratches) and I was looking to see if others had sold with that issue. I'm surprised someone wanted it internationally.

Congrats on the One!

zero neck #8

zero neck
  • The Ever-Living
  • Offline
  • 63 posts
  • Location: The Island.
  • Device: One.

Posted Sep 5 '13 @ 11:55 AM

GOT AN HTC ONE for VERIZON. gave up and upgraded. not so bad actually.
the phone is gorgeous.
ima root it now, thanks for the guidaince, counselor

I'm the one who bought your S3 on Swappa. That thing better be in excellent condition when I get it. J/K I was checking out current prices and saw your avatar lol. My battery cover is a disaster (peeling paint and scratches) and I was looking to see if others had sold with that issue. I'm surprised someone wanted it internationally.
Congrats on the One!

Haha word, that Intl guy may have been a scam - I sold it to the other guy.

Turns out the one on Verizon hasn't been unlocked yet - all good tho bc its a beast with nova on it so far.

I priced the s3 to go quick and it did - less than 24 hrs after I posted it, got 240 for it with some scratches but the paint on it wasnt peeling or anything.

dmmarck #9

dmmarck
  • Ombudsman of Mountain View
  • Offline
  • 1381 posts
  • Location: Commonwealth of Virginia
  • Device: NEXII

Posted Sep 5 '13 @ 4:52 PM

GOT AN HTC ONE for VERIZON. gave up and upgraded. not so bad actually.

the phone is gorgeous.

ima root it now, thanks for the guidaince, counselor


Word. Root root root!

Sent from my One using Tapatalk 4


tacsig513.png

UNLEASH THE BEAST: General Nexus 5 Hackery


LG NEXUS 5 - Black 16GB, Android 4.4 KitKat, Unlocked, Rooted, franco.Kernel

ASUS NEXUS 7 (2013) - Black 16GB, Android 4.3 Jelly Bean, Unlocked

 


dmmarck #10

dmmarck
  • Ombudsman of Mountain View
  • Offline
  • 1381 posts
  • Location: Commonwealth of Virginia
  • Device: NEXII

Posted Oct 18 '13 @ 2:28 PM

SOFF achieved.


tacsig513.png

UNLEASH THE BEAST: General Nexus 5 Hackery


LG NEXUS 5 - Black 16GB, Android 4.4 KitKat, Unlocked, Rooted, franco.Kernel

ASUS NEXUS 7 (2013) - Black 16GB, Android 4.3 Jelly Bean, Unlocked