• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

{OUTDATED}[Guide][Stock ROM] The original non-Prime conversion thread

Search This thread
C

ColtonDRG

Guest
Update March 8 2017: As you can probably tell, this is very old. I have not worked on the device in several months and I have no idea if these methods are still safe. Please proceed with caution. I will be using one of these on a daily basis in the near future, so I probably will get back into development, and hope to release new content for the phone to help out the community. Please accept this as an official warning that the following is probably out of date and that you should be very careful should you decide to try it. The original post in it's entirety is spoilered below. You have been warned.


Update: A new update was released for the Prime model, V6.6, which replaces the preloader and completely breaks SPFT. If you unlocked your bootloader (so you can use fastboot) in any capacity before taking that update, there may be hope for you yet, but as of right now V6.6 is unsupported. Update: If you used this method to safely* take* the V6.6* update*, this will still work.

Update: I just checked the stats, and this has been downloaded more than 3 thousand times. I never thought my humble little conversion guide would help out so many people. I have also added a new mirror at [REDACTED], so anyone in North America who was having trouble with the Europe mirror, give that one a shot. It should be faster! I have updated all links in the guide to use the new North America mirror, and added a separate Europe mirror link after each link.

Hello! This is a tutorial for converting the Amazon Prime Edition BLU R1 HD to the OEM BLU version. This will overwrite the relevant partitions on your Amazon version of the device with the non-Amazon version. The physical model number on your device will still be a tell (obviously), but besides that, there will be no way to tell your device apart from the regular model! You can also use this method to convert non-Prime to Prime version, and undo OTAs or system modifications. This will restore a 100% out of the box image from either edition on your device.

This will work if you have software version...
This will NOT work on software version...
  • V6.6
The V6.6 update brought a new preloader that breaks our ability to use SPFT. I am currently working on ways to reverse the damage, but as of right now, there is no way to convert (or downgrade) from software V6.6

You can use this on any 16/2 R1 HD with supported software version to...
  • Convert to the non-Prime OEM version
  • Convert to the Prime version
  • Remove ads (via conversion to non-Prime version)
  • Unroot
  • Downgrade to V6.1
  • Downgrade to V12
  • Undo system alterations/tampers
  • Restore the system image to the way it was when you first opened the box
  • Unbrick a device (if bricked because of bad system/recovery/boot image)
There are a handful of reports about this working flawlessly on the 8/1 model as well. I have not personally tested this, so there is still some risk factor.

This only overwrites the system, recovery, and boot partitions. Any other partitions that have been altered will not be restored. In most cases, other partitions should not have been altered, so this is not a concern. I have a full system backup of all partitions, but there is currently evidence to suggest that it is not safe to flash all of the partitions, so I will not release that backup until more is known.

You *should* be able to safely pull this off without wiping your data. This does not require your phone to be rooted or have any other modifications. You can pull it straight out of the box and do this process! If your phone is rooted, you'll lose it. This will make your phone EXACTLY like the non-Prime version comes out of the box! You can also convert a non-Prime device (or a converted Prime device back) to a Prime device using the same method, but I'm not exactly sure why you would want to. I did this all on Linux, but the Windows should work fine too as long as you have drivers dealt with. If you don't have drivers dealt with, I'm not your guy. I'll just tell you to use a better operating system. You'll also need an archive program that can deal with tar.gz files, because that's how my computer zipped them.

And the standard disclaimer: If this bricks your phone or makes it become sentient and plot with other sentient phones to murder your entire family, it's not my fault. That's all on you, buddy.

Ok, without further ado, on to the tutorial!

First, you need these things. Some of the files are quire large, so it might take a while to download:
  • You'll need the latest version of Smart Phone Flash Tools, or SPFT for short. You can download that from this site, or from [REDACTED]. Please use the latest version for your OS.
  • You'll need to download the system image. If you're converting to the non-Prime version, [REDACTED]. If you're converting to the Prime version, [REDACTED]
  • You need the scatter file. This will tell SPFT where the partitions are. This is the same for both variants, so just download [REDACTED]

Once you have those things, you can start actually flashing your phone:
  1. Power your phone completely OFF! This will not work if your phone is powered on. SPFT writes directly to the phone's memory, bypassing all security measures the phone has, so it requires the phone to be completely OFF to get safe and exclusive access to the memory. DO NOT PLUG IN YOUR PHONE YET!
  2. Extract SPFT into a folder on your computer. If you can't figure out how to do that, please stop tinkering with your phone. It's only a matter of time until you break something.
  3. Extract the system image into the same folder you put SPFT in. The three files (boot.img, recovery.img, system.img) should be in the same folder as all the other SPFT files, including the binaries.
  4. Run SPFT. On Windows, simply double clicking the SPFT executable should do the trick. On Linux, you must run the flash_tool.sh script as root. Open a terminal emulator, cd to the SPFT folder, and run `sudo ./flash_tool.sh`. If you recieve an error about permissions, run `chmod +x flash_tool.sh` and try the first command again.
  5. Go to the Download tab in SPFT and click the Scatter-loading button on the far right side. DO NOT click the Download Agent button. When the file picker dialog pops up, find and open the r1hd-spft-scatter.txt file you downloaded earlier.
  6. You should see a list of partitions. Only three of them (boot, recovery, system) should be checked, and the location should point to the files you extracted from the tar.gz file earlier. If this is not the case, double-click the location block of the boot, recovery, and system partitions, and select the boot.img, recovery.img, and system.img files from your filesystem respectively. After selecting the files, the boxes should check themselves.
  7. From the dropdown in the upper left of the partition list, make sure Download Only is selected. Any other option could damage your device.
  8. Click the Download button in the upper left.
  9. While your phone is OFF, plug it into your computer with a data safe USB cable. The cable that came in the box from the factory is ideal, but any good quality cable will work just fine.
  10. SPFT should start overwriting your phone. If you receive an error from SPFT, unplug your phone, close SPFT, and repeat steps 4 through 9. The whole process takes about 10 minutes, after which you should see a window with a large green checkmark. Once you see that window, you can safely unplug your phone and start it up. You're all done!

And as a bonus, I've also included a guide for unlocking the bootloader, getting custom recovery, and rooting the device after you've done this in post #2. That makes this your one stop shop for getting a brand new Prime phone out of the box!! :)

HUGE THANKS TO @mrmazak FOR THEORIZING THIS METHOD AND GETTING ME THE NON-PRIME SYSTEM IMAGE TO USE!

As always, if you have any questions, just ask in a thread reply or send me a private message on XDA. And by the way, hit the Thanks button in the lower right corner of the post if my guide helps you. It motivates me to keep this up to date and write more helpful guides. If you feel like giving me even more motivation and help fund future development, [REDACTED].
 
Last edited by a moderator:
C

ColtonDRG

Guest
{OUTDATED}[GUIDE][OEM][Stock] Bootloader Unlock, TWRP, and root!

Update March 8 2017: As you can probably tell, this is very old. I have not worked on the device in several months and I have no idea if these methods are still safe. Please proceed with caution. I will be using one of these on a daily basis in the near future, so I probably will get back into development, and hope to release new content for the phone to help out the community. Please accept this as an official warning that the following is probably out of date and that you should be very careful should you decide to try it. The original post in it's entirety is spoilered below. You have been warned.


Ok, now you've converted your brand new Prime phone to the non-Prime version. How do you unlock this sucker? The conversion process actually unlocks the standard unlock method from the factory, so it's VERY simple! No hoops to jump through or anything. You'll need adb and fastboot. You can get those as part of the official Android developer kit, your distro's repos (on Linux) or Homebrew (on Mac). Of course, this guide works for the normal non-converted non-Prime version as well. This WILL wipe your phone, so make sure you back up any important data before doing this.

This guide is for the OEM (non-Prime) version. If you have the Prime version, convert it to OEM using the guide above BEFORE doing this guide.

The standard disclaimer from above still applies.

This guide is broken up into two parts. Unlocking the bootloader, and rooting the phone. If you are preparing to install Magisk, do the bootloader unlock, skip the rooting part and move on to the Magisk guide. You do not need the files above if you are only unlocking the bootloader. If your bootloader is already unlocked, skip the bootloader unlocking part and skip to rooting the phone. If you are preparing to install Magisk and your bootloader is already unlocked, you shouldn't be here. Also please note that the bootloader can sometimes re-lock itself after completing a conversion/restore from the guide above, especially to/from the Prime version, so if you're not sure, play it safe and re-unlock your bootloader.

Part 1 - Unlocking the bootloader:
  1. Boot up your phone. If you haven't already gone through the initial setup process, go through it. The bootloader unlock process will wipe your phone, so skip as many questions as possible so you don't waste your time.
  2. Open the Settings app, go to About device, fine the Build number (it's toward the bottom), and tap on it 8-10 times (until it says you are now a developer. If it says there's no need and you're already a developer, you can skip to the next step)
  3. Go back to the main Settings menu. You should see a new option where About device used to be, Developer options! Click on it.
  4. Toward the top of the long list of developer options, there is an option called "OEM unlocking". If it's switched off, switch it on. If it's switched on, switch it off and back on again. You may get a warning saying that device protection features won't work. Click Enable and proceed. You may also be prompted to enter your password/PIN/pattern lock if you have one.
  5. Scroll down a little bit to reveal USB debugging. Switch it on if it's not already.
  6. Connect your phone to your computer using a data safe cable. Do not disconnect it until the very end.
  7. On your computer, open a terminal emulator (or Command Prompt with ADB access) and run `adb reboot bootloader`. If you get a message complaining about keys or authorization, check your phone. There should be a window asking for permission for your computer to access the device. Allow it and run the command again.
  8. Your phone will reboot into fastboot mode.
  9. On your computer, run `fastboot oem unlock`. On the phone you will get a warning message talking about the implications of unlocking the bootloader. Press Volume Up to accept them. If everything goes smoothly, your bootloader should now be unlocked. You're not ready to flash quite yet! Flashing at this stage WILL brick your phone, so it's important that you continue following the guide carefully.
  10. On your computer, run `fastboot reboot`. Your phone should reboot anywhere from 3 to 5 times. If it reboots more than that, your phone is bricked and you need to start again by following the guide above again.
  11. Once Android starts up again, you should see the setup wizard. Your bootloader is now unlocked!

Part 2 - rooting the phone:

BEFORE YOU PROCEED: If you want your phone to be encrypted AND rooted, it's important that you unlock the bootloader using the steps above first, then use the encryption APK to encrypt your phone BEFORE installing TWRP and rooting your device. This device is an exception to the general rule of flashing TWRP first and then rooting afterwards. Repeat, if you want your phone encrypted and rooted, unlock the bootloader FIRST, then encrypt SECOND, then flash TWRP THIRD, and root your phone LAST.

This is the guide for rooting the actual phone. You must unlock the bootloader using the steps above before doing this part.

First, you'll need these things on your computer.

Linux Users: On Linux, you must add `sudo` to the beginning of all fastboot commands, because most Linux distributions will not give you enough access to the hardware without being root.

And finally, the guide:
  1. Hold Volume Up and Power until the phone turns on with the boot menu. Once the boot menu appears, use the volume keys to scroll to [Fastboot Mode] and press the power button to select it. It's the middle option.
  2. On your computer, cd to the folder where you downloaded twrp-3.0.2-1-r1hd-lopestom.img and do `fastboot flash recovery twrp-3.0.2-1-r1hd-lopestom.img`.
  3. On your computer, do `fastboot boot twrp-3.0.2-1-r1hd-lopestom.img`.
  4. Once TWRP boots up, dismiss the prompt about mounting the system, go to Reboot, then choose Recovery. Your device will reboot back into TWRP. I know this step seems odd, but just trust me.
  5. Make a backup if you want. It's not a bad idea, but seeing how you just unlocked your bootloader so your data is gone and we have the images in case you somehow brick the system, I doubt you actually need it.
  6. In TWRP, go to Advanced, then ADB Sideload. Slide the confirmation slider all the way to the right to confirm.
  7. On your computer, cd to the folder where you downloaded SuperSU and run `adb sideload [SuperSU-zip-name.zip]`, replacing the last argument with the name of the SuperSU zip you downloaded, of course. If your computer says "waiting for device" for a long time, cancel with Ctrl+C, run `adb kill-server`, then run the first command again but with `sudo` in front this time.
  8. Reboot the phone. If everything worked correctly, you should now have a rooted phone with SuperSU, bootloader unlocked, and custom recovery! Yay for cheap phones!

As always, if you have any questions, just ask in a thread reply or send me a private message on XDA. And by the way, hit the Thanks button in the lower right corner of the post if my guide helps you. It motivates me to keep this up to date and write more helpful guides. If you feel like giving me even more motivation and help fund future development, [REDACTED].
 
Last edited by a moderator:

abs0lute

Member
Jun 20, 2007
8
2
Can you verify the image you uploaded for the non-Prime version? I'm getting unexpected EOF errors when extracting in Windows using 7Zip and TarTool, and I'm also getting an "operation not permitted" error when extracting using the built in Archive Utility in OS X.
 
C

ColtonDRG

Guest
Can you verify the image you uploaded for the non-Prime version? I'm getting unexpected EOF errors when extracting in Windows using 7Zip and TarTool, and I'm also getting an "operation not permitted" error when extracting using the built in Archive Utility in OS X.
Yeah, that's because the image isn't fully uploaded. My internet is very slow, so it's taking a while to upload. Sorry about that. I was hoping it would be finished by the time I finished writing this, but alas, nope. I will have all files uploaded by tomorrow, along with .md5 files so you can verify the checksums, so come back then. Again, sorry. I guess I should have posted this _after_ I got those uploaded. Oh! And I have North America mirrors coming within the next couple months. It seems a little oxy-moronic to host files for a US only device on an EU server, but unfortunately, servers in the US are significantly more expensive. :)
 

abs0lute

Member
Jun 20, 2007
8
2
Yeah, that's because the image isn't fully uploaded. My internet is very slow, so it's taking a while to upload. Sorry about that. I was hoping it would be finished by the time I finished writing this, but alas, nope. I will have all files uploaded by tomorrow, along with .md5 files so you can verify the checksums, so come back then. Again, sorry. I guess I should have posted this _after_ I got those uploaded. Oh! And I have North America mirrors coming within the next couple months. It seems a little oxy-moronic to host files for a US only device on an EU server, but unfortunately, servers in the US are significantly more expensive. :)

No problem - thanks for your work on this!
 
C

ColtonDRG

Guest
No problem - thanks for your work on this!
Just finished uploading the non-Prime version. I will start the other upload before sleeping and update the post removing the warning when I awaken, assuming everything has gone well. You're free to attempt a non-Prime conversion now. Just don't do it the other way around yet. ;)

Sent from my LG G4 using XDA Labs
 

bupkis

Member
Jul 10, 2015
40
15
Can't wait to give this a shot. Well, at least after someone else reports success first...
 

dsstest

Member
Aug 25, 2006
5
0
followed post 1 convert to non prime steps on windows, did not do the bootloader unlock steps.
phone booted up ok, followed by android is upgrading x of 37.
phone working and no ad's on lock screen
the amazon apps are still there but appear to be disabled, causing errors at first boot.
disabled or uninstall the apps. - used cleanmaster
everything seems ok now
 
Last edited:

bupkis

Member
Jul 10, 2015
40
15
I report success. :p Of course I did everything in the guide here before posting it. I'm not irresponsible. It's completely safe. :) I just finished uploading the files, so please go ahead and give it a shot. :)

ok, away we go! :laugh:

When I try to download the scatter file it just opens the file in a new browser window.
>nevermind, figured it out...success!
...on to bootloader unlock, TWRP, root...
 
Last edited:
C

ColtonDRG

Guest
...
When I try to download the scatter file it just opens the file in a new browser window.
...
Yeah, that's a problem with my server configuration. I'll fix it later. For now, you can save the file by opening it in a browser window and pressing Ctrl+S
 

bupkis

Member
Jul 10, 2015
40
15
I have completed the process successfully-TWRP, root, no ads but do still have all the Amazon apps so something is screwy but not the end of the world.
 
C

ColtonDRG

Guest
I have completed the process successfully-TWRP, root, no ads but do still have all the Amazon apps so something is screwy but not the end of the world.
Nope, it's not screwy. The non-Amazon version does include a lot of the Amazon apps. You can uninstall some of them the normal way (they're pre-installed user apps), and others you can either disable or uninstall using your favourite system app remover. :)
 

notfix

New member
Aug 5, 2016
3
0
Anyone else missing Encrypt section in Settings > Security after converting to non-prime?
 

knicknut

Member
Jun 14, 2013
17
2
When I try to load the scatter, SPFT says "Error: Initializing scatter file failed. Please check the name of scatter file which you load is legal." I downloaded it from both the primary link and your mirror, same error. Any ideas? Thanks.

EDIT: Looks like I downloaded the oldest version, not the newest version of SPFT. Whoops! I'll leave my mistake on here to help others who may assume the first link is the right one.
 
Last edited:
C

ColtonDRG

Guest
Anyone else missing Encrypt section in Settings > Security after converting to non-prime?
It is missing. How peculiar. I will attempt to implement a workaround in a little bit. Sorry about that.

Update: The Encryption activity exists on the phone, we just can't get to it from the settings menu. You can launch it by manually launching com.android.settings.Settings$CryptKeeperSettingsActivity using your preferred method for launching arbitrary activities. I will release an app that will launch this activity for you ASAP!
 
Last edited by a moderator:
  • Like
Reactions: notfix

Top Liked Posts

  • There are no posts matching your filters.
  • 69
    C
    ColtonDRG
    Update March 8 2017: As you can probably tell, this is very old. I have not worked on the device in several months and I have no idea if these methods are still safe. Please proceed with caution. I will be using one of these on a daily basis in the near future, so I probably will get back into development, and hope to release new content for the phone to help out the community. Please accept this as an official warning that the following is probably out of date and that you should be very careful should you decide to try it. The original post in it's entirety is spoilered below. You have been warned.


    Update: A new update was released for the Prime model, V6.6, which replaces the preloader and completely breaks SPFT. If you unlocked your bootloader (so you can use fastboot) in any capacity before taking that update, there may be hope for you yet, but as of right now V6.6 is unsupported. Update: If you used this method to safely* take* the V6.6* update*, this will still work.

    Update: I just checked the stats, and this has been downloaded more than 3 thousand times. I never thought my humble little conversion guide would help out so many people. I have also added a new mirror at [REDACTED], so anyone in North America who was having trouble with the Europe mirror, give that one a shot. It should be faster! I have updated all links in the guide to use the new North America mirror, and added a separate Europe mirror link after each link.

    Hello! This is a tutorial for converting the Amazon Prime Edition BLU R1 HD to the OEM BLU version. This will overwrite the relevant partitions on your Amazon version of the device with the non-Amazon version. The physical model number on your device will still be a tell (obviously), but besides that, there will be no way to tell your device apart from the regular model! You can also use this method to convert non-Prime to Prime version, and undo OTAs or system modifications. This will restore a 100% out of the box image from either edition on your device.

    This will work if you have software version...
    This will NOT work on software version...
    • V6.6
    The V6.6 update brought a new preloader that breaks our ability to use SPFT. I am currently working on ways to reverse the damage, but as of right now, there is no way to convert (or downgrade) from software V6.6

    You can use this on any 16/2 R1 HD with supported software version to...
    • Convert to the non-Prime OEM version
    • Convert to the Prime version
    • Remove ads (via conversion to non-Prime version)
    • Unroot
    • Downgrade to V6.1
    • Downgrade to V12
    • Undo system alterations/tampers
    • Restore the system image to the way it was when you first opened the box
    • Unbrick a device (if bricked because of bad system/recovery/boot image)
    There are a handful of reports about this working flawlessly on the 8/1 model as well. I have not personally tested this, so there is still some risk factor.

    This only overwrites the system, recovery, and boot partitions. Any other partitions that have been altered will not be restored. In most cases, other partitions should not have been altered, so this is not a concern. I have a full system backup of all partitions, but there is currently evidence to suggest that it is not safe to flash all of the partitions, so I will not release that backup until more is known.

    You *should* be able to safely pull this off without wiping your data. This does not require your phone to be rooted or have any other modifications. You can pull it straight out of the box and do this process! If your phone is rooted, you'll lose it. This will make your phone EXACTLY like the non-Prime version comes out of the box! You can also convert a non-Prime device (or a converted Prime device back) to a Prime device using the same method, but I'm not exactly sure why you would want to. I did this all on Linux, but the Windows should work fine too as long as you have drivers dealt with. If you don't have drivers dealt with, I'm not your guy. I'll just tell you to use a better operating system. You'll also need an archive program that can deal with tar.gz files, because that's how my computer zipped them.

    And the standard disclaimer: If this bricks your phone or makes it become sentient and plot with other sentient phones to murder your entire family, it's not my fault. That's all on you, buddy.

    Ok, without further ado, on to the tutorial!

    First, you need these things. Some of the files are quire large, so it might take a while to download:
    • You'll need the latest version of Smart Phone Flash Tools, or SPFT for short. You can download that from this site, or from [REDACTED]. Please use the latest version for your OS.
    • You'll need to download the system image. If you're converting to the non-Prime version, [REDACTED]. If you're converting to the Prime version, [REDACTED]
    • You need the scatter file. This will tell SPFT where the partitions are. This is the same for both variants, so just download [REDACTED]

    Once you have those things, you can start actually flashing your phone:
    1. Power your phone completely OFF! This will not work if your phone is powered on. SPFT writes directly to the phone's memory, bypassing all security measures the phone has, so it requires the phone to be completely OFF to get safe and exclusive access to the memory. DO NOT PLUG IN YOUR PHONE YET!
    2. Extract SPFT into a folder on your computer. If you can't figure out how to do that, please stop tinkering with your phone. It's only a matter of time until you break something.
    3. Extract the system image into the same folder you put SPFT in. The three files (boot.img, recovery.img, system.img) should be in the same folder as all the other SPFT files, including the binaries.
    4. Run SPFT. On Windows, simply double clicking the SPFT executable should do the trick. On Linux, you must run the flash_tool.sh script as root. Open a terminal emulator, cd to the SPFT folder, and run `sudo ./flash_tool.sh`. If you recieve an error about permissions, run `chmod +x flash_tool.sh` and try the first command again.
    5. Go to the Download tab in SPFT and click the Scatter-loading button on the far right side. DO NOT click the Download Agent button. When the file picker dialog pops up, find and open the r1hd-spft-scatter.txt file you downloaded earlier.
    6. You should see a list of partitions. Only three of them (boot, recovery, system) should be checked, and the location should point to the files you extracted from the tar.gz file earlier. If this is not the case, double-click the location block of the boot, recovery, and system partitions, and select the boot.img, recovery.img, and system.img files from your filesystem respectively. After selecting the files, the boxes should check themselves.
    7. From the dropdown in the upper left of the partition list, make sure Download Only is selected. Any other option could damage your device.
    8. Click the Download button in the upper left.
    9. While your phone is OFF, plug it into your computer with a data safe USB cable. The cable that came in the box from the factory is ideal, but any good quality cable will work just fine.
    10. SPFT should start overwriting your phone. If you receive an error from SPFT, unplug your phone, close SPFT, and repeat steps 4 through 9. The whole process takes about 10 minutes, after which you should see a window with a large green checkmark. Once you see that window, you can safely unplug your phone and start it up. You're all done!

    And as a bonus, I've also included a guide for unlocking the bootloader, getting custom recovery, and rooting the device after you've done this in post #2. That makes this your one stop shop for getting a brand new Prime phone out of the box!! :)

    HUGE THANKS TO @mrmazak FOR THEORIZING THIS METHOD AND GETTING ME THE NON-PRIME SYSTEM IMAGE TO USE!

    As always, if you have any questions, just ask in a thread reply or send me a private message on XDA. And by the way, hit the Thanks button in the lower right corner of the post if my guide helps you. It motivates me to keep this up to date and write more helpful guides. If you feel like giving me even more motivation and help fund future development, [REDACTED].
    25
    C
    ColtonDRG
    {OUTDATED}[GUIDE][OEM][Stock] Bootloader Unlock, TWRP, and root!

    Update March 8 2017: As you can probably tell, this is very old. I have not worked on the device in several months and I have no idea if these methods are still safe. Please proceed with caution. I will be using one of these on a daily basis in the near future, so I probably will get back into development, and hope to release new content for the phone to help out the community. Please accept this as an official warning that the following is probably out of date and that you should be very careful should you decide to try it. The original post in it's entirety is spoilered below. You have been warned.


    Ok, now you've converted your brand new Prime phone to the non-Prime version. How do you unlock this sucker? The conversion process actually unlocks the standard unlock method from the factory, so it's VERY simple! No hoops to jump through or anything. You'll need adb and fastboot. You can get those as part of the official Android developer kit, your distro's repos (on Linux) or Homebrew (on Mac). Of course, this guide works for the normal non-converted non-Prime version as well. This WILL wipe your phone, so make sure you back up any important data before doing this.

    This guide is for the OEM (non-Prime) version. If you have the Prime version, convert it to OEM using the guide above BEFORE doing this guide.

    The standard disclaimer from above still applies.

    This guide is broken up into two parts. Unlocking the bootloader, and rooting the phone. If you are preparing to install Magisk, do the bootloader unlock, skip the rooting part and move on to the Magisk guide. You do not need the files above if you are only unlocking the bootloader. If your bootloader is already unlocked, skip the bootloader unlocking part and skip to rooting the phone. If you are preparing to install Magisk and your bootloader is already unlocked, you shouldn't be here. Also please note that the bootloader can sometimes re-lock itself after completing a conversion/restore from the guide above, especially to/from the Prime version, so if you're not sure, play it safe and re-unlock your bootloader.

    Part 1 - Unlocking the bootloader:
    1. Boot up your phone. If you haven't already gone through the initial setup process, go through it. The bootloader unlock process will wipe your phone, so skip as many questions as possible so you don't waste your time.
    2. Open the Settings app, go to About device, fine the Build number (it's toward the bottom), and tap on it 8-10 times (until it says you are now a developer. If it says there's no need and you're already a developer, you can skip to the next step)
    3. Go back to the main Settings menu. You should see a new option where About device used to be, Developer options! Click on it.
    4. Toward the top of the long list of developer options, there is an option called "OEM unlocking". If it's switched off, switch it on. If it's switched on, switch it off and back on again. You may get a warning saying that device protection features won't work. Click Enable and proceed. You may also be prompted to enter your password/PIN/pattern lock if you have one.
    5. Scroll down a little bit to reveal USB debugging. Switch it on if it's not already.
    6. Connect your phone to your computer using a data safe cable. Do not disconnect it until the very end.
    7. On your computer, open a terminal emulator (or Command Prompt with ADB access) and run `adb reboot bootloader`. If you get a message complaining about keys or authorization, check your phone. There should be a window asking for permission for your computer to access the device. Allow it and run the command again.
    8. Your phone will reboot into fastboot mode.
    9. On your computer, run `fastboot oem unlock`. On the phone you will get a warning message talking about the implications of unlocking the bootloader. Press Volume Up to accept them. If everything goes smoothly, your bootloader should now be unlocked. You're not ready to flash quite yet! Flashing at this stage WILL brick your phone, so it's important that you continue following the guide carefully.
    10. On your computer, run `fastboot reboot`. Your phone should reboot anywhere from 3 to 5 times. If it reboots more than that, your phone is bricked and you need to start again by following the guide above again.
    11. Once Android starts up again, you should see the setup wizard. Your bootloader is now unlocked!

    Part 2 - rooting the phone:

    BEFORE YOU PROCEED: If you want your phone to be encrypted AND rooted, it's important that you unlock the bootloader using the steps above first, then use the encryption APK to encrypt your phone BEFORE installing TWRP and rooting your device. This device is an exception to the general rule of flashing TWRP first and then rooting afterwards. Repeat, if you want your phone encrypted and rooted, unlock the bootloader FIRST, then encrypt SECOND, then flash TWRP THIRD, and root your phone LAST.

    This is the guide for rooting the actual phone. You must unlock the bootloader using the steps above before doing this part.

    First, you'll need these things on your computer.

    Linux Users: On Linux, you must add `sudo` to the beginning of all fastboot commands, because most Linux distributions will not give you enough access to the hardware without being root.

    And finally, the guide:
    1. Hold Volume Up and Power until the phone turns on with the boot menu. Once the boot menu appears, use the volume keys to scroll to [Fastboot Mode] and press the power button to select it. It's the middle option.
    2. On your computer, cd to the folder where you downloaded twrp-3.0.2-1-r1hd-lopestom.img and do `fastboot flash recovery twrp-3.0.2-1-r1hd-lopestom.img`.
    3. On your computer, do `fastboot boot twrp-3.0.2-1-r1hd-lopestom.img`.
    4. Once TWRP boots up, dismiss the prompt about mounting the system, go to Reboot, then choose Recovery. Your device will reboot back into TWRP. I know this step seems odd, but just trust me.
    5. Make a backup if you want. It's not a bad idea, but seeing how you just unlocked your bootloader so your data is gone and we have the images in case you somehow brick the system, I doubt you actually need it.
    6. In TWRP, go to Advanced, then ADB Sideload. Slide the confirmation slider all the way to the right to confirm.
    7. On your computer, cd to the folder where you downloaded SuperSU and run `adb sideload [SuperSU-zip-name.zip]`, replacing the last argument with the name of the SuperSU zip you downloaded, of course. If your computer says "waiting for device" for a long time, cancel with Ctrl+C, run `adb kill-server`, then run the first command again but with `sudo` in front this time.
    8. Reboot the phone. If everything worked correctly, you should now have a rooted phone with SuperSU, bootloader unlocked, and custom recovery! Yay for cheap phones!

    As always, if you have any questions, just ask in a thread reply or send me a private message on XDA. And by the way, hit the Thanks button in the lower right corner of the post if my guide helps you. It motivates me to keep this up to date and write more helpful guides. If you feel like giving me even more motivation and help fund future development, [REDACTED].
    3
    C
    ColtonDRG
    Update March 8 2017: As you can probably tell, this is very old. I have not worked on the device in several months and I have no idea if these methods are still safe. Please proceed with caution. I will be using one of these on a daily basis in the near future, so I probably will get back into development, and hope to release new content for the phone to help out the community. Please accept this as an official warning that the following is probably out of date and that you should be very careful should you decide to try it. The first post has been updated with a warning similar to this one and the entirety of the original post has been placed in spoiler tags. You have been warned.
    2
    C
    ColtonDRG
    Can't wait to give this a shot. Well, at least after someone else reports success first...
    I report success. :p Of course I did everything in the guide here before posting it. I'm not irresponsible. It's completely safe. :) I just finished uploading the files, so please go ahead and give it a shot. :)
    2
    C
    ColtonDRG
    ColtonDRG, I have flashed Rootjunkys remove ads and block OTA rom and unlocked bootloader via his guide, also installed TWRP and rooted, my phone seems ptetty stable. I like the idea of flashing the non prime rom, if I follow your guide and flash to non prime varient, the bootloader should remain unlocked correct? Should just have to install TWRP and reroot again, right? Then its just a matter of unrooting to get any OTAs? Also rootjunky also has a non prime firmware hosted, is there a difference with your methods. I am glad people are working on this and I am happy with the phone, just from the way your describing it, it seems your method may be cleaner, with no offense intended towards anyone. Thanks for your help.
    I am not aware of rootjunky's non-Prime firmware, but most of his methods seem like slopped together hacks to me and I am just not a fan of that sort of thing, so I would say that my methods are probably cleaner. There is also some question as to weather or not rootjunky's images are ACTUALLY clean or unmodified. Mine are. As for the bootloader staying unlocked, yes, it should theoretically stay unlocked, but I have had mine relock before. Make a TWRP backup before converting, just in case. As long as everything works OK, yes, it should just be a matter of reinstalling TWRP and re-rooting. As for getting OTAs, I recommend re-running this guide for a fresh unroot/clean system before taking any OTAs.

    Sent from my LG G4 using XDA Labs