✮ [GUIDE] ✮ Unlock + Root + Backup + Restore + Downgrade (Updated 01/08/17) - G 2014 General

ALL IN ONE GUIDE
Unlock + Root + Backup + Restore + Downgrade
For Moto G 2014 (2nd Generation)
titan (3G) : XT1063, XT1064, XT1068, XT1069
thea (4G/LTE): XT1072, XT1077, XT1078, XT1079
(Updated 1st August, 2017)​
Requirements:
1. Moto G 2014 2nd Generation (titan/thea)
2. Unmodified Stock ROM
3. Windows PC & Stable Internet Connection
4. Good Quality USB Cable & Functioning USB Port
5. Lots Of Patience & Common Sense
This guide is divided into 4 parts, read the below post & the comments before asking any question. Dont quote the entire post in the comments & ask what is only necessary.
PART I : UNLOCKING
This part is compulsory before proceeding to PART II. Your warranty will be voided after sending a request for an unlock key to Motorola used for unlocking process.
PART II : ROOTING
This part consists of 2 steps, flashing TWRP & flashing SuperSU Zip. After PART II is done, you can now flash custom ROMs, mods, scripts on your Moto G 2014.
PART III : RESTORING
This part is for those who wish to go back to the same stock firmware i.e. 6.0 to 6.0, 5.0.2 to 5.0.2 in case of boot loop, stuck at Motorola logo/boot-animation, BOOTLOADER UNLOCKED screen, OTA Update. You dont need an unlocked bootloader to flash the same stock firmware.
PART IV : DOWNGRADING
This part is for those who wish to revert back to previous Android version. i.e. 6.0 to .0.2 or 5.0.2 to 4.4.4. Please be very careful in this part as it can lead to dead devices if you dont follow the instructions correctly.
Code:
#include
/*
* Your warranty is now VOID !
*
* I am not responsible for bricked devices, dead SD cards,
* accidental data wipe or a thermonuclear war.
* If you have any concerns about steps included in this
* guide please do some research before trying it!
* YOU are choosing to make these modifications & if you
* point the finger at me for messing up , I will laugh at you.
*
* GOOD LUCK !
*/
PART I : UNLOCKING​
NOTE:
The warranty of all Non-European phones is lost permanently after UNLOCKING bootloader. LOCKING the bootloader again after UNLOCKING won't give your warranty back.
The warranty of all European phones is not lost after UNLOCKING bootloader. To claim warranty of an UNLOCKED European phone you will need to live in the European Union.
Requirements:
Minimal ADB + Fastboot Drivers v1.4.2
Motorola Device Manager Drivers v2.5.4
Unlock Bootloader Tutorial
Unlock Bootloader YouTube Video
Bootloader LOCKED, Status Code 0 : Bootloader was not UNLOCKED before by the user & is factory LOCKED, UNDER Warranty.
Bootloader UNLOCKED, Status Code 3 : Bootloader is UNLOCKED by the user, Warranty VOID.
Bootloader RELOCKED, Status Code 2 : Bootloader was UNLOCKED by the user & is LOCKED again by the user, Warranty VOID.
1. Users with LOCKED bootloaders will have to first UNLOCK their bootloader before proceeding, this will VOID your WARRANTY.
2. Users with UNLOCKED bootloader need not worry as this process will not wipe anything from the internal storage.
3. Users with RELOCKED bootloader will have to UNLOCK their bootloader again before proceeding, phone will be erased again after UNLOCKING.
4. After UNLOCKING the bootloader your phone's internal storage will be erased. Your installed apps, contacts, SMS, call logs, data like photos, music, videos in internal storage will be WIPED completely.
5. Use 'SuperBackup' App from Playstore & set the location of backup files to external sdcard.
6. Before proceeding make sure you backup everything & move your data from internal storage to external sdcard or PC.
PART II : ROOTING​
Requirements
Minimal ADB + Fastboot Drivers v1.4.2
Motorola Device Manager Drivers v2.5.4
TWRP v3.1.1-0 for titan
TWRP v3.1.1-0 for thea
SuperSU v2.82 Stable
A) Flashing TWRP
1. You need to unlock the bootloader before proceeding/
2. Install Motorola & Fastboot Drivers & restart your PC. Copy the SuperSU Zip inside your phone storage.
3. Go inside the installed adb fastboot folder. Hold "Shift" key & right click inside the folder & click on "Open CMD Window Here".
4. Copy the TWRP image file inside installed adb fastboot folder.
5. Switch off the phone, press & hold "Volume Down" & "Power" & release after 4-5 seconds.
6. Connect phone to PC . You will see "USB Connected" on the phone screen.
7. Type and press enter after each command
For titan (3G) : XT1063, XT1064, XT1068, XT1069
Code:
fastboot flash recovery twrp-3.1.1-0-titan.img
fastboot boot recovery twrp-3.1.1-0-titan.img
For thea (4G/LTE): XT1072, XT1077, XT1078, XT1079
Code:
fastboot flash recovery twrp-3.1.1-0-thea.img
fastboot boot recovery twrp-3.1.1-0-thea.img
7. Your phone will now boot into TWRP.
B) Backup Stock ROM (Optional)
1. Inside TWRP, select 'Backup', select 'System', 'Boot' & 'PDS' partitions & swipe to backup your Stock ROM.
C) Flashing SuperSU Zip
1. Select "Install" option, Select the location of SuperSU Zip & flash it, go back & select "Reboot", select "System".
2. Open the App Drawer & check for SuperSU app & then download 'Root Checker' app from Play store to check for root access.
PART III : RESTORING​
Requirements
Minimal ADB + Fastboot Drivers v1.4.2
Motorola Device Manager Drivers v2.5.4
Softbrick : Stock 5.0.2 Factory Firmware Image Installer
Hardbrick : Unbrick Moto G 2014 (2nd Gen)
1. You won't need to UNLOCK the bootloader to flash the firmware of your variant for your region. i.e. You can flash firmware on a LOCKED bootloader. However to flash a firmware for different region, your bootloader needs to be UNLOCKED. Check your Moto G 2nd Gen Model No & Regional Variant from here before proceeding. You will need it for downloading factory images for your corresponding phone.
2. If your device gets stuck in following situations it has soft bricked.
- Stuck on Motorola logo or "Unlocked Bootloader" screen.
- Stuck on boot animation or device restarts automatically (boot loop)
- Cannot boot into recovery mode.
- Can boot into fastboot mode only.
3. If your device gets stuck in following situations it has hard bricked.
- Cannot boot into fastboot mode.
- Cannot power on or cannot charge.
- Cannot boot into recovery mode.
Step By Step Troubleshooting Of Your Device
1. Check if it switches on or boots into fastboot menu, if it doesnt maybe the battery is depleted. Use a minimum 1A output charger & keep it plugged in overnight for atleast 10-12 hours. Repeat for 2-3 days. If it still doesnt power on, this means your phone is hardbricked & recovery may or may not be possible. Motherboard replacement might be needed. You will loose all your data & your IMEI number will be changed after your motherboard is replaced.
2. If it switches on & is stuck on Motorola logo/bootanimation or "Unlocked Bootloader" screen, hold power button till phone screen turns off. Your phone will restart, let it continue the booting process. If it still stuck, hold power button till phone screen turns off. After it turns off immediately press volume down while holding power button. Release both after 2-3 seconds. You will now boot into fastboot menu. This means your phone is softbricked & can be recovered by flashing correct factory image for your device. Flashing incorrect image or downgrading from a higher Android version to lower (Eg Marshmallow to Lollipop) may render your device permanently hard-bricked/dead.
PART IV : DOWNGRADING​
Requirements
Unlock Bootloader Here
Unlock Bootloader YouTube Video
Minimal ADB + Fastboot Drivers v1.4.2
Motorola Device Manager Drivers v2.5.4
5.0.2 Factory Firmware Image Installer
1. Boot into fastboot mode. Check your bootloader version from top 2nd line. It should say something like "48.86 (sha-5497-c9). 4886 is your bootloader version.
2. Marshmallow 6.0 to Lollipop 5.0.2 : If your bootloader version is 4886 (Marshmallow Bootloader), you need to make some changes in the easyinstaller.bat file inside the Stock Factory Firmware Image that you download or while flashing the ROM manually.
- Download Lollipop 5.0.2 Factory Firmware image zip from PART III RESTORING Section
- Unzip the contents & open easyinstaller.bat with notepad.
- Find the 2 lines "mfastboot.exe flash motoboot motoboot.img" & delete both of them.
- Delete the motoboot.img file inside the extracted contents.
- Run the easyinstaller.bat
- Do not type "mfastboot.exe flash motoboot motoboot.img" while flashing the Lollipop ROM manually
3. Lollipop 5.0.2 to Kitkat 4.4.4 : If your bootloader version is 4882/4883(Lollipop Bootloader), you need to make some changes while flashing the ROM manually.
- Download Kitkat 4.4.4 Factory Firmware image zip.
- Unzip the contents.
- Delete the motoboot.img file inside the extracted contents..
- Do not type "mfastboot.exe flash motoboot motoboot.img" while flashing the Kitkat 4.4.4 firmware image manually.
4. If you downgrade your bootloader version i.e flash a 4883 Lollipop bootloader on your existing 4886 Marshmallow bootloader, your phone will be hard-bricked / permanently dead. Therefore follow the instructions above carefully. I am not responsible for dead phones.
CREDITS
@Lucas Eugene for his thread 'Unlock Bootloader - Moto G (2nd Gen) [UPDATED]'
@Tomsgt for his YouTube video 'How to unlock the boot loader on your Motorola phone Moto X, G, & E all versions'.
@Chainfire for creating CF Auto Root & SuperSU.
@luca020400 for maintaining TWRP.
@reefuge for his thread '[STAGE FRIGHT][XT106x][5.0.2][LXB] Stock 5.0.2 Easy Installer via FastBoot Tool'​

Do I have to change anything if I have the bootloader already unlocked (especially to avoid the factory reset)?

Nagass said:
Do I have to change anything if I have the bootloader already unlocked (especially to avoid the factory reset)?
Click to expand...
Click to collapse
Just flash the latest SuperSU http://download.chainfire.eu/supersu with twrp. That's it.

Nagass said:
Do I have to change anything if I have the bootloader already unlocked (especially to avoid the factory reset)?
Click to expand...
Click to collapse
Please read the OP
Unlocked bootloader wont wipe anything after rooting.

Just remove install_recovory.sh from /system/etc/. when you bootep into twrp the first time
After flash supersu and reboot

It displays failure remote failure when I run bat.exe

Thank you so much, this tutorial is perfect. :good::good::good:
Now my girlfriend can enjoy her 5.0.2 rooted with twrp 2.4.8.0 installed.
Great

iamanubhav said:
It displays failure remote failure when I run bat.exe
Click to expand...
Click to collapse
https://forums.motorola.com/posts/132580d3df

thaaaaaaaaaaanks @luca020400
and I can delete the application motorola?

If I understood correctly, this method does not require unlock key from motorola to unlock bootloader. So, if I unlock the bootloader and restore the lock again later, then there won't be any way that motorola can get to know if it was unlocked ever (for warranty purpose )??

Thanks for this!
However, it results in the same issue I've found ANY time I've tried to install ANY version of SuperSU with ANY android version on this phone (1063). That is: after flashing supersu, I get a boot loop. The first few times this happened, I cursed and reformatted the entire phone. For anyone else who has encountered this, I just figured out a way around it! It looks like this problem *only* affects the recovery partition, which is easily re-flashed.
Here's what worked for me:
While boot looping, press and hold vol down + power until screen stays black for 5-10 seconds, then release. You'll get to fastboot mode here. Then, connect with a usb cable and in a cmd prompt, from within your adb directory, type fastboot flash recovery <recovery image name.img> and hit enter. Once it flashes sucessfully, you'll be able to start back up with "normal startup" from the device's fastboot menu and all should be well. And if you've done this to correct a boot loop brought on by this autoroot, you'll actually still have root once you start up. Hooray!
The recovery image that you flash can be TWRP (link above) or the stock android recovery (which I found on this forum somewhere, but will upload with a link as soon as Mega is nice to me again).
Hope this helps someone else.

himsin said:
If I understood correctly, this method does not require unlock key from motorola to unlock bootloader. So, if I unlock the bootloader and restore the lock again later, then there won't be any way that motorola can get to know if it was unlocked ever (for warranty purpose )??
Click to expand...
Click to collapse
You need to unlock it
These are the step after the unlock on lollipop roms

imp .questions
Hey thanks for this thread I have successfully rooted my phone
Q. And if Motorola pushes the 5.1 ota can I update my is to 5.1?I have just rooted and the recovery is also stock

luca020400 said:
You need to unlock it
These are the step after the unlock on lollipop roms
Click to expand...
Click to collapse
So, this method won't unlock the bootloader?? The very first warning in OP gave me the impression that it will also unlock the bootloader :silly:

himsin said:
So, this method won't unlock the bootloader?? The very first warning in OP gave me the impression that it will also unlock the bootloader :silly:
Click to expand...
Click to collapse
Yes , the tool unlock your bootloader
But anyway you need the motorola code and unlock process

luca020400 said:
Yes , the tool unlock your bootloader
But anyway you need the motorola code and unlock process
Click to expand...
Click to collapse
Now I am more confused.... If the tool unlocks the bootloader then shall I assume that it asks for the unlock code during process?

himsin said:
Now I am more confused.... If the tool unlocks the bootloader then shall I assume that it asks for the unlock code during process?
Click to expand...
Click to collapse
Yes it ask for unlock code

Didn't work for me on Linux
fastboot-linux binary included with auto-root seems to be not working.
I tried to use fastboot from ubuntu repositories, which works, but couldn't correctly boot auto-root image.
I used openrecovery-twrp-2.8.4.0-titan.img with "normal" procedure described here , and everything worked perfectly.
Thanks anyway!

luca020400 said:
Yes it ask for unlock code
Click to expand...
Click to collapse
Thanks for clearing the doubts

himsin said:
If I understood correctly, this method does not require unlock key from motorola to unlock bootloader. So, if I unlock the bootloader and restore the lock again later, then there won't be any way that motorola can get to know if it was unlocked ever (for warranty purpose )??
Click to expand...
Click to collapse
Yes they understand, since your STATUS number changes from 0 to 3.
When you relock it changes from 3 to 2.
So your warranty is lost forever. Be careful.
You can find this number on the display when you're on fastboot mode (turn off the device and then press power + volume down for aboout 5 sec and release)

Related

[GUIDE]Unlock Bootloader/Remove Unlocked Warning [Mini FAQ] - Moto E 2015 [UPDATED]

UNLOCK YOUR BOOTLOADER​
WARNING: UNLOCKING YOUR BOOTLOADER VOIDS YOUR WARRANTY.PROCEED AT YOUR OWN RISK. EXCEPT If You Live In The EU
NOTE: Unlocking the bootloader will Wipe/ factory reset your device, and will delete all personal data from your device such as apps, photos, messages, and settings.
Prepare Your Moto E for Bootloader Unlock
Code:
Your device must be charged up to 70% before going completely through the process mentioned below.
These firmwares are only for the Moto E 2015 variant.
Make sure that you have installed proper device drivers on your computer.
INSTRUCTIONS:
Make sure to take a backup of your entire device data.
Download the Android SDK OR Download the Minimal ADB and Fastboot
Install the latest Motorola USB Drivers on your desktop. Download here.
Go To Settings -> Dev Settings, And Select "Allow OEM Unlock"
Put your device in fastboot mode (power off, then press the power and volume down buttons simultaneously).
Open Command Prompt on androidsdk/platform-tools/ (Hold Shift and right click and press open command window here)
[*]If you have downloaded Minimal ADB and Fastboot Go to C://Program Files/Minimal ADB and Fastboot and open Command Prompt from there.
Connect your Phone to PC
Type this in the CMD prompt window - fastboot oem get_unlock_data
You will get a return string. Copy it. [Right Click-Mark- Mark the text by pressing the shift key-Now press Ctrl+C]
Paste all the lines together in a notepad. Remove the empty spaces.
Now go to the Motorola Site.Sign in using your Google account or Motorola ID. Scroll down the page and paste the copied string in the field at step #6. Then click on ‘Can my device be unlocked?’, after which a "REQUEST UNLOCK KEY" button will appear at the bottom of page.
To get your unlock key, select the ‘I Agree’ option. Note: You will receive an email with your Unlock Key at the email address you used to log in there.
Important – Copy the 20-character key that Motorola sent you via email. Make sure your device is connected.
Then in CMD type: fastboot devices (To check your device is connected)
Then type: fastboot oem unlock UNIQUE_KEY
NOTE: In above command, replace the word ‘UNIQUE_KEY’ with the unlock code that you got via email. Then hit enter and the unlocking process should begin. Wait for a while and soon you’ll see ‘Bootloader Unlocked’ warning on your Moto E.
To relock the bootloader:
Go to Fastboot and give the command fastboot oem lock
Relocking the boot loader causes serious issues with unlocking again and may even cause bootup problems. For more info refer here
You can always appreciate my work by pressing the Thanks Button.:good:
Good Day
XDA:DevDB Information
Unlock Bootloader/ Remove unlocked warning [Mini Faq], ROM for the Moto E 2015
Contributors
Lucas Eugene
ROM OS Version: 5.0.x Lollipop
Version Information
Status: Stable
Created 2015-03-04
Last Updated 2015-03-04
Video Tutorial
FAQ
[SIZE=+1]Q1:How to remove the unlocked bootloader message? [/SIZE]
Download the zip. or this(confirmed to work)
Extract all the files
Reboot to fastboot mode (power + vol down)
Now open cmd and use cd command to go to the directory where you placed the file.
Now Type the command: fastboot flash logo logo.bin
Reboot from the recovery (use vol up to select and vol down to navigate)
Now your bootlogo should be restored back to the normal version
​
Want to Get OTA updates even after Rooting your Device? Here's how.
Use the full unroot option from the Super Su
Flash the stock recovery Use Code : mfastboot flash recovery recovery.img
Now you'll be able to get OTA updates as before
Will this method work with both the 3G and 4g retail variants?
Yes it will
Can someone who has the Moto E 2015 post a system dump....I wish to create a ROM but don't have the device
Shawn5162 said:
Can someone who has the Moto E 2015 post a system dump....I wish to create a ROM but don't have the device
Click to expand...
Click to collapse
buy the device.. so u can make a dump and test ur rom
thanks
Thanks for this lovely moto e 2015 bootloader unlocking.
What about root? I assume we have to wait since we dont have a custom recovery yet?
fix-this! said:
What about root? I assume we have to wait since we dont have a custom recovery yet?
Click to expand...
Click to collapse
I'll be uploading a guide to root but I need someone to test it
Lucas Eugene said:
I'll be uploading a guide to root but I need someone to test it
Click to expand...
Click to collapse
Just to make sure people don't slip up like I did, do NOT change anything on the system without modifying the boot image. Dm-verity is enabled. I'm waiting for a boot image before releasing recovery + root
Is this for moto E only?
ryanallaire said:
Is this for moto E only?
Click to expand...
Click to collapse
The unlocking guide is pretty much the same for all Moto devices with a few changes
Lucas Eugene said:
Video Tutorial
Download the zip. Mirror
[/INDENT]
Click to expand...
Click to collapse
Might wanna fix those links. First one is invalid. And the mirror forces an exe download that installed 7 crapware programs to get to the zip..
Oh, and once its downloaded...doesn't work anyways, says logo.bin unable to be loaded
Does this work for Nexus 6?
Sent from my Nexus 6 using XDA Free mobile app
SurferNerd6987 said:
Might wanna fix those links. First one is invalid. And the mirror forces an exe download that installed 7 crapware programs to get to the zip..
Oh, and once its downloaded...doesn't work anyways, says logo.bin unable to be loaded
Click to expand...
Click to collapse
Sorry there is some problem with the links. I'll reupload the files probably by the end of this week
See OP
New Boot Logo Uploaded
cybojenix said:
Just to make sure people don't slip up like I did, do NOT change anything on the system without modifying the boot image. Dm-verity is enabled. I'm waiting for a boot image before releasing recovery + root
Click to expand...
Click to collapse
very impatient to root our devices.thank for your jobs cybojenix
Has anyone tried unlocking the Boost Mobile Moto E LTE bootloader with this method? Boost's Moto G can be bootloader unlocked so that's hope.
Just a note, be careful about the unlocking of bootloader yet. You cannot relock the phone without flashing a new system.img which doesn't exist yet.
Updated OP
Hello, some of the text is using black color instead of default, meaning it appear black on dark grey when using official XDA dark theme.

[GUIDE] [NOOB Friendly] Root and Install TWRP on HTC One M9

Mod information 2018-07-29
This method described below is outdated and following the guide might end in a bootloop if users are currently using the latest firmware.
​
This is a guide on how to root the HTC One M9.
Your M9 must have an unlocked bootloader. There is currently not a way to unlock the bootloader, so unless your phone comes with an unlocked bootloader, you will need to wait until HTC updates www.htcdev.com to unlock the M9 bootloader.
Video Guide: Video
Link to the correct TWRP to use thread by Captain_Throwback READ DISCLAIMERS!: http://forum.xda-developers.com/one-m9/orig-development/recovery-twrp-touch-recovery-t3066720
Link to TWRP page in general: http://twrp.me/devices/htconem9.html
Link to correct SuperSU to flash: http://forum.xda-developers.com/apps/supersu/2014-09-02-supersu-v2-05-t2868133
Unlocking the bootloader. (Thanks -markus-)
- Login into HTCdev
- Unlock Bootloader
- Get Started
- On "Select Your Device" Select "All Other Supported Models"
- Begin Unlock Bootloader
- Legal Terms "Proceed to Unlock Instructions
- On Phone pressing Volume Down + press Power to boot in "HTC download mode" (black Background)
- Connect Phone via USB
- CMD: fastboot oem get_identifier_token
- Copy and paste the token in Textfield "My Device Identifier Token:"
- You will receive an Email with "Unlock_code.bin
- CMD: fastboot flash unlocktoken Unlock_code.bin
- Press Volume Button to secelt Yes for Unlock bootloader
If your bootloader is unlocked, follow these steps.
Download and install ADB/Fastboot using 15 second ADB/Fastboot installer.
Plug in the One M9, enable USB debugging.
Open up command prompt, type
Code:
adb devices
Code:
adb reboot download
Code:
fastboot flash recovery C:\Users\XDADev\Downloads\TWRP.img
Replace C:\Users\XDADev\Downloads\TWRP.img with the path where the twrp.img is located for you.
Power off your device. Now, to boot into recovery mode.
Press and hold Volume Down button, then press the Power button to switch on your phone and release it, but keep holding the Volume Down button.
Select boot to recovery on the screen that appears(bootloader)
Download SuperSU.zip
Make sure you have an SD Card in your phone, then do
Code:
adb push C:\Users\XDADev\Downloads\UPDATE-SuperSU-v2.46.zip /sdcard
Once again, replace C:\Users\XDADev\Downloads\UPDATE-SuperSU-v2.46.zip with your path.
On your device, click Install, then at the top of the screen it should say Internal Storage or SDCard. If it does not say SD Card, click it and change it to SD Card.
Now find SuperSU.zip, click on it, and swipe to flash it.
Once SuperSU is done flashing reboot the phone, and open up SuperSU. You are now rooted!
If this helped you, feel free to click Thanks below.
Awesome! Thanks, I'll get a quick tutorial video up once I get my hands on an M9
FYI I'm pretty sure you can't root with the version of TWRP that's currently uploaded. It doesn't have writing to the system partition enabled. If you look in the recovery fstab, system is mounted as emmc.
You'll have to wait until an alternate version is uploaded for this to work. Someone will need to confirm whether rooting will completely break the ability to take an OTA too.
EDIT: There's also this disclaimer on the device page: "NOTE: Installing TWRP can break your ability to receive updates from HTC."
EDIT 2: The other question is whether unlocking the device will allow system to be written to at all in the OS, or only while in recovery. I think once some people have the device in their hands, some of these questions can finally be answered.
Captain_Throwback said:
FYI I'm pretty sure you can't root with the version of TWRP that's currently uploaded. It doesn't have writing to the system partition enabled. If you look in the recovery fstab, system is mounted as emmc.
You'll have to wait until an alternate version is uploaded for this to work. Someone will need to confirm whether rooting will completely break the ability to take an OTA too.
EDIT: There's also this disclaimer on the device page: "NOTE: Installing TWRP can break your ability to receive updates from HTC."
EDIT 2: The other question is whether unlocking the device will allow system to be written to at all in the OS, or only while in recovery. I think once some people have the device in their hands, some of these questions can finally be answered.
Click to expand...
Click to collapse
Test devices are S-OFF.....but bootloader locked. Go figure.
I have a t mobile M9 rooted
Hello I was able to unlock the bootloader from dev site and was able to install TWRP. I was able to install super SU and now i'm rooted!
here is my reddit post. http://www.reddit.com/r/htcone/comments/303ys2/just_got_my_hands_on_a_tmobile_htc_m9/
Worked for me
But to flash successfull recovery you have to boot to "htc download mode", the black background!
If you see white background you are on bootloader, here you are not able to flash TWRP Recovery, you will get the message "FAILED (remote: cannot flash this partition in s-on state)"
So boot to "download mode" an it work
trying this tomorrow.
Is there any way to virginize the device if I don't want it to be rooted anymore ?
DroidShift79 said:
trying this tomorrow.
Is there any way to virginize the device if I don't want it to be rooted anymore ?
Click to expand...
Click to collapse
Pull the stock recovery image before you flash TWRP. I neglected to do so (but I do have my Verizon device rooted with TWRP.
One problem, TWRP can't read or write to encrypted sdcards, either internal or removable.
My name is Harold and I'm a flashaholic.....
-markus- said:
Worked for me
But to flash successfull recovery you have to boot to "htc download mode", the black background!
If you see white background you are on bootloader, here you are not able to flash TWRP Recovery, you will get the message "FAILED (remote: cannot flash this partition in s-on state)"
So boot to "download mode" an it work
Click to expand...
Click to collapse
Markus, what device do you have.. international, verizon?
k1moe said:
Markus, what device do you have.. international, verizon?
Click to expand...
Click to collapse
I got it from O2 Germany CID is O2_102
Three questions:
1. Do I really have to buy an SD card to do this?
2. How do you boot to download mode?
3. Should the bootloader be unlocked before or after installing TWRP and rooting, or does it not matter?
1. Every XDA developer has one..
2. Choose REBOOT from the shut down menu, then when display turns black - press and hold hardware button volume - ..
3. That will save you from frustration..
jauhien said:
3. That will save you from frustration..
Click to expand...
Click to collapse
Thanks. You mean unlock bootloader first right?
-markus- said:
I got it from O2 Germany CID is O2_102
Click to expand...
Click to collapse
Um.. how do you have unlocked your bootloader? I got my M9 from Vodafone Germany (retail unit) and via HTCdev im not able to unlock BL
This will work on the u.s. m9 versions? Thanks
Sent from my SM-N910T using XDA Free mobile app
xda23 said:
This will work on the u.s. m9 versions? Thanks
Sent from my SM-N910T using XDA Free mobile app
Click to expand...
Click to collapse
The TWRP *should* work on all variants. Only way to know for sure is to try it .
k1moe said:
Um.. how do you have unlocked your bootloader? I got my M9 from Vodafone Germany (retail unit) and via HTCdev im not able to unlock BL
Click to expand...
Click to collapse
- Login into HTCdev
- Unlock Bootloader
- Get Started
- on "Select Your Device" i used "All Other Supported Models"
- Begin Unlock Bootloader
- Legal Terms "Proceed to Unlock Instructions
- On Phone pressing Volume Down + press Power to boot in "HTC download mode" (black Background)
- Connect Phone via USB
- CMD: fastboot oem get_identifier_token
- Copy and paste the token in Textfield "My Device Identifier Token:"
- You will receive an Email with "Unlock_code.bin
- CMD: fastboot flash unlocktoken Unlock_code.bin
- Press Volume Button to secelt Yes for Unlock bootloader
- thats it
I hope i could help you
Unlocked the bootloader and flashed TWRP...
SuperSU 2.46 isn't getting root...
When flashing it appears to be successful...
But then when the phone reboots there is no root access...
SuperSU - gives this error
If you just upgraded to Android 5.0, you need to manually re-root - consult the relevant forums for your device!
Anyone else have this problem or know a workaround.
jbm76 said:
Unlocked the bootloader and flashed TWRP...
SuperSU 2.46 isn't getting root...
When flashing it appears to be successful...
But then when the phone reboots there is no root access...
SuperSU - gives this error
If you just upgraded to Android 5.0, you need to manually re-root - consult the relevant forums for your device!
Anyone else have this problem or know a workaround.
Click to expand...
Click to collapse
How did you install SuperSU?
I put the Zip-File on internal Storage and boot from recovery and installed it.
I did not use the way about "adb push SuperSU-v2.46.zip /sdcard" because i don't have an SD-Card at moment.
-markus- said:
How did you install SuperSU?
I put the Zip-File on internal Storage and boot from recovery and installed it.
I did not use the way about "adb push SuperSU-v2.46.zip /sdcard" because i don't have an SD-Card at moment.
Click to expand...
Click to collapse
same as you did...

[Guide] Safe bootloader unlock, restore DRM, custom recovery, root, bootloader relock

** DISCLAIMER: I AM NOT A DEV AND THIS IS MY HOBBY. I ASSUME NO RESPONSIBILITY IF THIS BREAKS YOUR DEVICE **​
The following is tested on model E6553. This may work for the dual sim model too but I have not verified it. Do not flash the ftf and kernel files intended for one model onto another.​
I am not taking credit for any of the tools and kernels here. They are all developed by others. I am only telling you how to use them.
Credits: @zxz0O0, @tobias.waldvogel
0- Prerequisites
You need to have a functioning installation of adb and fastboot tools. You need to have proper Sony drivers installed on your PC to detect your phone when it is connected to the PC. You should be able to flash an ftf file using flashtool. If any of these sound unfamiliar to you, stop reading, go learn about them, and then come back.
1- How to unlock your bootloader without losing the DRM keys
Sony has designed this phone such that if you unlock your bootloader you lose your TA partition PERMANENTLY which includes some of the Xperia features and licenses that have to do with image processing etc. forever. You will also no longer receive OTAs. So in theory, without a copy of this TA partition (which is unique to each device and cannot be copied over from another) unlocking the bootloader results in an irreversible loss of some of your phone's features. Relocking the bootloader will not bring them back.
A hack exists that allows you to backup the TA partition before you unlock the bootloader. This backup will make the process completely reversible so if you ever need to send the tablet to Sony for repair or just want to return it to its original state you have a way. Follow these instructions carefully:
1.0- Before you begin keep in mind that this procedure, especially the unlocking step, completely erases your tablet. Disable myXperia and remove your google account before proceeding. The following will likely not work well with encryption.
1.1- Start by clean flashing any 28.0.A.8.266 firmware, For this tutorial I used the Customized NL ftf that you can get from here.
1.2- Enter service Mode by dialing *#*#7378423#*#* -> Service info -> configuration, and make sure the device is unlockable.
Also check -> Service Tests -> Security and you will see a bunch of "active" and "OK" attributes. You can take screenshots for your reference.
1.3- Turn on usb debugging mode on your phone.
1.4- Download iovyroot zip v0.4 or higher from here.
1.5- Unzip this zip file into a folder of your choice and open a command terminal there.
1.6- Connect the phone which is now in USB debugging mode to your PC and answer yes when the phone asks to authorize the PC to access it in USB debugging mode. You can check that the PC indeed sees the phone by running this command
Code:
adb devices
1.7- Run the following command:
Code:
tabackup
1.8- VERY IMPORTANT: Make sure the command completes with no errors. If all goes well you will have a file with a name like TA-05052016.img (the name may be different for you) with a size of 2MB in your folder.
1.9- Save this file in a very safe place. Save it on your hard disk, AND email it to yourself, AND put it on your google drive. If you lose this file you can never reverse the bootloader unlocking process.
1.10- Reboot the device.
1.11- Now you can unlock the bootloader. Follow the instructions at Sony's official website at http://developer.sonymobile.com/unlockbootloader Also save your unlock code that you obtain in this step somewhere. You may need it some day.
1.12- Reboot the device and it will briefly enter recovery and then start the phone initial setup.
1.13- (Optional) you can easily verify that your bootloader is unlocked by entering the fastboot mode, obtaining any boot image, and running the following command to boot your tablet with that image:
Code:
fastboot boot boot.img
1.14- (Optional) you can see that the DRM keys are erased from your tablet by repeating step 1.2 but this time you will see a bunch of errors under Service Tests -> Security.
1.15- As a side effect of unlocking the bootloader you lose the ability to receive OTA updates. Clean flash a Marshmallow ftf to continue. For this tutorial I used Marshmallow 6.0 E6553_Customized HK_1294-9654_32.1.A.1.185_R7C (the latest firmware at the time of this writing.)
2- How to emulate DRM keys and/or root and/or add recovery after unlocking the bootloader.
A hack exists that can emulate the DRM keys:
2.1- Extract the boot image from the 32.1.A.1.185 marshmallow ftf that you installed in step 1.15. Here are the steps to take:Open the ftf file with 7-zip or any zip program that you have at your disposal
Look for a file called kernel.sin and extract it.
Start flashtool and from Tools menu choose Sin Editor.
Select the kernel.sin that you extracted in the previous step and hit Extract data.
Flashtool will create a file called kernel.elf which you will use in the next step.​2.2- Download rootkernel_v4.42_Windows_Linux.zip (or a higher version) from http://forum.xda-developers.com/xperia-z5/development/root-automatic-repack-stock-kernel-dm-t3301605 and unzip it in a folder of your choice.
2.3- Copy the kernel.elf that you got in step 2.1 to this folder. If you want root, follow this guide through to section 5 place SuperSU 2.71 (or higher) in this folder as well. Make sure the name of the SuperSU zip starts with letters "SuperSU". The latest SuperSU can be obtained from: http://forum.xda-developers.com/apps/supersu/2014-09-02-supersu-v2-05-t2868133 (The rootkernel tool has a bug in its built-in SuperSU integration. See: http://forum.xda-developers.com/showpost.php?p=67485478&postcount=838)
2.4- Open a command terminal in this folder and run the rootkernel script. Your command should look similar to this:
Code:
rootkernel.cmd kernel.elf boot-patched.img
When prompted, answer as follows:- Sony RIC is enabled. Disable? [Y/n] Y (if you want root plus write access)
- Install TWRP recovery? [Y/n] Y (if you want to have recovery)
- Install busybox? [Y/n] Y (if you want busybox. It is very useful)
- Found SuperSU-v2.71-20160331103524.zip. Install? [Y/n] Y (if you want root)
- Install DRM fix? [Y/n] Y (if you want DRM emulation)​This will create a new kernel image called boot-patched.img which you will now flash on your phone.
2.5- Boot the phone in the fastboot mode and flash your patched image using the following fastboot command:
Code:
fastboot flash boot boot-patched.img
2.6- (Optional) You can reboot the phone and see that the DRM keys are indeed retrieved by repeating step 1.2. You can also open settings -> display, and look under Image Enhancement. If the DRM emulation is successful you will see this.
3- How to flash a custom or stock kernel
3.0- If you have already flashed the patched kernel in part 2 you will skip this part.
3.1- Whether you want to use a custom kernel or stock, and whether you have done the DRM patch described above or not, to flash a boot image (i.e. kernel) on your phone you need to restart the tablet in fastboot mode.
3.2- To flash the kernel use this command:
Code:
fastboot flash boot [I]name_of_your_kernel[/I]
You will replace name_of_your_kernel with whatever your kernel is called (e.g. boot.img, kernel.elf, etc.)
4- How to add and use recovery
4.1- Recovery is added to your kernel in step 2.4.
4.2- To enter recovery reboot the phone and touch the volume up key when the LED turns yellow during the boot splash screen.
5- How to root
5.1- Place SuperSU 2.71 zip (or higher) on the phone's sdcard. The latest SuperSU can be obtained from: http://forum.xda-developers.com/apps/supersu/2014-09-02-supersu-v2-05-t2868133
5.2- Reboot to recovery and flash the zip file.
6- How to relock bootloader and return it to original factory state
6.0- To relock the bootloader along with restoring the DRM keys the phone must have unmodified stock firmware.
6.1- Repeat step 1.1
6.2- Repeat steps 1.3, 1.4, and 1.5
6.3- Copy the TA backup image that you had obtained in section 1 in the iovyroot folder and use the tarestore command to flash the TA partition back onto the phone. The command will look similar to this:
Code:
tarestore TA-05052016.img
Make sure the command completes with no error. If it fails the first time try again. Reboot the phone. Your bootloader is now locked and your DRM keys restored.
6.4- (Optional) You can verify that you are back to the original locked state by repeating step 1.2.
Whoa Great
---------- Post added at 01:32 AM ---------- Previous post was at 12:50 AM ----------
najoor said:
** DISCLAIMER: I AM NOT A DEV AND THIS IS MY HOBBY. I ASSUME NO RESPONSIBILITY IF THIS BREAKS YOUR DEVICE **​The following is tested on model E6553. This may work for the dual sim model too but I have not verified it. Do not flash the ftf and kernel files intended for one model onto another.​I am not taking credit for any of the tools and kernels here. They are all developed by others. I am only telling you how to use them.
Credits: @zxz0O0, @tobias.waldvogel
0- Prerequisites
You need to have a functioning installation of adb and fastboot tools. You need to have proper Sony drivers installed on your PC to detect your phone when it is connected to the PC. You should be able to flash an ftf file using flashtool. If any of these sound unfamiliar to you, stop reading, go learn about them, and then come back.
1- How to unlock your bootloader without losing the DRM keys
Sony has designed this phone such that if you unlock your bootloader you lose your TA partition PERMANENTLY which includes some of the Xperia features and licenses that have to do with image processing etc. forever. You will also no longer receive OTAs. So in theory, without a copy of this TA partition (which is unique to each device and cannot be copied over from another) unlocking the bootloader results in an irreversible loss of some of your phone's features. Relocking the bootloader will not bring them back.
A hack exists that allows you to backup the TA partition before you unlock the bootloader. This backup will make the process completely reversible so if you ever need to send the tablet to Sony for repair or just want to return it to its original state you have a way. Follow these instructions carefully:
1.0- Before you begin keep in mind that this procedure, especially the unlocking step, completely erases your tablet. Disable myXperia and remove your google account before proceeding. The following will likely not work well with encryption.
1.1- Start by clean flashing any 28.0.A.8.266 firmware, For this tutorial I used the UK Generic ftf that you can get from here.
1.2- Enter service Mode by dialing *#*#7378423#*#* -> Service info -> configuration, and make sure the device is unlockable.
Also check -> Service Tests -> Security and you will see a bunch of "active" and "OK" attributes. You can take screenshots for your reference.
1.3- Turn on usb debugging mode on your phone.
1.4- Download iovyroot zip v0.4 or higher from here.
1.5- Unzip this zip file into a folder of your choice and open a command terminal there.
1.6- Connect the phone which is now in USB debugging mode to your PC and answer yes when the phone asks to authorize the PC to access it in USB debugging mode. You can check that the PC indeed sees the phone by running this command
Code:
adb devices
1.7- Run the following command:
Code:
tabackup
1.8- VERY IMPORTANT: Make sure the command completes with no errors. If all goes well you will have a file with a name like TA-05052016.img (the name may be different for you) with a size of 2MB in your folder.
1.9- Save this file in a very safe place. Save it on your hard disk, AND email it to yourself, AND put it on your google drive. If you lose this file you can never reverse the bootloader unlocking process.
1.10- Reboot the device.
1.11- Now you can unlock the bootloader. Follow the instructions at Sony's official website at http://developer.sonymobile.com/unlockbootloader Also save your unlock code that you obtain in this step somewhere. You may need it some day.
1.12- Reboot the device and it will briefly enter recovery and then start the phone initial setup.
1.13- (Optional) you can easily verify that your bootloader is unlocked by entering the fastboot mode, obtaining any boot image, and running the following command to boot your tablet with that image:
Code:
fastboot boot boot.img
1.14- (Optional) you can see that the DRM keys are erased from your tablet by repeating step 1.2 but this time you will see a bunch of errors under Service Tests -> Security.
1.15- As a side effect of unlocking the bootloader you lose the ability to receive OTA updates. Clean flash a Marshmallow ftf to continue. For this tutorial I used Marshmallow 6.0 E6553_Customized HK_1294-9654_32.1.A.1.185_R7C (the latest firmware at the time of this writing.)
2- How to emulate DRM keys and/or root and/or add recovery after unlocking the bootloader.
A hack exists that can emulate the DRM keys:
2.1- Extract the boot image from the 32.1.A.1.185 marshmallow ftf that you installed in step 1.15. Here are the steps to take:
Open the ftf file with 7-zip or any zip program that you have at your disposal
Look for a file called kernel.sin and extract it.
Start flashtool and from Tools menu choose Sin Editor.
Select the kernel.sin that you extracted in the previous step and hit Extract data.
Flashtool will create a file called kernel.elf which you will use in the next step.​2.2- Download rootkernel_v4.42_Windows_Linux.zip (or a higher version) from http://forum.xda-developers.com/xperia-z5/development/root-automatic-repack-stock-kernel-dm-t3301605 and unzip it in a folder of your choice.
2.3- Copy the kernel.elf that you got in step 2.1 to this folder. If you want root, place SuperSU 2.71 (or higher) in this folder as well. Make sure the name of the SuperSU zip starts with letters "SuperSU". The latest SuperSU can be obtained from: http://forum.xda-developers.com/apps/supersu/2014-09-02-supersu-v2-05-t2868133
2.4- Open a command terminal in this folder and run the rootkernel script. Your command should look similar to this:
Code:
rootkernel.cmd kernel.elf boot-patched.img
When prompted, answer as follows:
- Sony RIC is enabled. Disable? [Y/n] Y (if you want root plus write access)
- Install TWRP recovery? [Y/n] Y (if you want to have recovery)
- Install busybox? [Y/n] Y (if you want busybox. It is very useful)
- Found SuperSU-v2.71-20160331103524.zip. Install? [Y/n] Y (if you want root)
- Install DRM fix? [Y/n] Y (if you want DRM emulation)​This will create a new kernel image called boot-patched.img which you will now flash on your phone.
2.5- Boot the phone in the fastboot mode and flash your patched image using the following fastboot command:
Code:
fastboot flash boot boot-patched.img
2.6- (Optional) You can reboot the phone and see that the DRM keys are indeed retrieved by repeating step 1.2. You can also open settings -> display, and look under Image Enhancement. If the DRM emulation is successful you will see this.
3- How to flash a custom or stock kernel
3.0- If you have already flashed the patched kernel in part 2 you will skip this part.
3.1- Whether you want to use a custom kernel or stock, and whether you have done the DRM patch described above or not, to flash a boot image (i.e. kernel) on your phone you need to restart the tablet in fastboot mode.
3.2- To flash the kernel use this command:
Code:
fastboot flash boot [I]name_of_your_kernel[/I]
You will replace name_of_your_kernel with whatever your kernel is called (e.g. boot.img, kernel.elf, etc.)
4- How to add and use recovery
4.1- Recovery is added to your kernel in step 2.4.
4.2- To enter recovery reboot the phone and touch the volume up key when the LED turns yellow during the boot splash screen.
5- How to relock bootloader and return it to original factory state
5.0- To relock the bootloader along with restoring the DRM keys the phone must have unmodified stock firmware.
5.1- Repeat step 1.1
5.2- Repeat steps 1.3, 1.4, and 1.5
5.3- Copy the TA backup image that you had obtained in section 1 in the iovyroot folder and use the tarestore command to flash the TA partition back onto the phone. The command will look similar to this:
Code:
tarestore TA-05052016.img
Make sure the command completes with no error. If it fails the first time try again. Reboot the phone. Your bootloader is now locked and your DRM keys restored.
5.4- (Optional) You can verify that you are back to the original locked state by repeating step 1.2.
Click to expand...
Click to collapse
Very usefull step by step guide.. But is there is any method to root phone without unlocking Bl? Quite curious to know from you.
arokososoo said:
Whoa Great
---------- Post added at 01:32 AM ---------- Previous post was at 12:50 AM ----------
Very usefull step by step guide.. But is there is any method to root phone without unlocking Bl? Quite curious to know from you.
Click to expand...
Click to collapse
Not yet, atleast for my Dual SIM Version.
njaya95 said:
Not yet, atleast for my Dual SIM Version.
Click to expand...
Click to collapse
So you mean there is a way to root single sim version without unlocking BL?
Thanks ú so much! this is well writen, i will try this when i get the time to do a fresh install. Cheers mate
@arokososoo
Please, in the future never quote long OP and any other long posts. This is very annoying for mobile and desktop users to scroll to the next post. Thanks.
Sent from my Sony E6553 using XDA Labs
I wonder if E6533 can use this guide
Got as far as going to the sony website, there's no mention of phones that can be unlocked there and for some reason Ive got bootloader unlock allowed no, even with a sim free phone and my xperia turned off.....bummer
Stoneybridge said:
Got as far as going to the sony website, there's no mention of phones that can be unlocked there and for some reason Ive got bootloader unlock allowed no, even with a sim free phone and my xperia turned off.....bummer
Click to expand...
Click to collapse
I also unlocked my Z3+, although it wasn't supported. I just picked Z4 Tablet since it is the "nearest" one. Worked Got MM rooted now.
How long did that take on your devices? 1.1- Start by clean flashing any 28.0.A.8.266 firmware, For this tutorial I used the UK Generic ftf that you can get from here.
I am waiting for half an hour now...
Spoiler
Trilliard said:
How long did that take on your devices? 1.1- Start by clean flashing any 28.0.A.8.266 firmware, For this tutorial I used the UK Generic ftf that you can get from here.
I am waiting for half an hour now...
Spoiler
Click to expand...
Click to collapse
I can't see your picture, but I assume you have that stucking at modem/system ?
If so, downgrade Flashtool to 0.9.19
Well i got a soft brick, but was able to restore it trough Sony Companion. Here is the picture on another hoster http://fs5.directupload.net/images/160529/gr5fpf8t.png dont know on what point it stuck.
Funfact that two germans writting in english
Edit, big thanks version 0.9.19 worked perfect. Cant understand why the newest one doesnt work
Edit 2: System boots up, but when the setup start the process com.android.phone stops instant and if i hit ok the message comes instantly again after about ten times the phone reboot, i cant do anything else... next repair through sony companion and back to stock german 6.0. I´ll stop try it for today.
Trilliard said:
Well i got a soft brick, but was able to restore it trough Sony Companion. Here is the picture on another hoster http://fs5.directupload.net/images/160529/gr5fpf8t.png dont know on what point it stuck.
Funfact that two germans writting in english
Edit, big thanks version 0.9.19 worked perfect. Cant understand why the newest one doesnt work
Edit 2: System boots up, but when the setup start the process com.android.phone stops instant and if i hit ok the message comes instantly again after about ten times the phone reboot, i cant do anything else... next repair through sony companion and back to stock german 6.0. I´ll stop try it for today.
Click to expand...
Click to collapse
Did you forget to wipe?
In a thread i opened in Q&A a user said that even though service info reported bl unlock allowed NO, he managed to unlock it anyways using standard procedure, what do you think?
it seems like Sony RIC is not fully disabled with this patch.
Finally ! Works like a charm in my E6533 (Dual sim) !!! Thanks a lot !!!
Hi thiefxhunter,
How you do this? could you explain us step by step. I like to root my dual sim model.
Thanks.
Hi.. I am stuck in 2.5
My device is unlocked, It is connected in fastboot mode (blue led).
error msg
'Fastboot is not recognised as an internal or external command, operable program or batch file'
Please help me in this.
Solved..
Thanks for this post..
Thanks for this guide, it worked like a charm on my E6553 with 32.2.A.0.224
CorzCorry said:
I also unlocked my Z3+, although it wasn't supported. I just picked Z4 Tablet since it is the "nearest" one. Worked Got MM rooted now.
Click to expand...
Click to collapse
Can you please explain how did you do that? Thanks

Bootloader unlock failed. ID: Bad Key?

I just got my Moto G5 Plus today, and ran Motorola's official Bootloader unlock guide.
Upon starting up, I am now receiving an error that says "Your device has been unlocked and can't be trusted. ID: bad key"
I confirmed multiple times that I provided the correct unlock_data and entered the correct unique key provided.
Because of this I cannot flash TWRP.
"(bootloader) Image not signed or corrupt"
What can I do here? Is there a way to re-do the unlock?
Do I have to flash stock back to the phone? I cannot seem to find any guide on how to perform that properly.
Are you sure TWRP didn't flash because it gave me that same generic error (because it's no longer stock recovery) but it had installed fine. Did you try selecting 'Recovery Mode' in the bootloader and see if it loads? Hopefully you're following the rooting tutorial in this forum because you need to follow it closely to correctly gain root.
That 'bad key' message on startup is normal after unlocking and can be removed by flashing another 'logo.bin' as shown in this video, so actually seeing it shows that you probably did unlock successfuly.
Correct, as everyone has stated, this is normal for a bootloader unlocked device. You can flash a logo.bin to make your boot up look better
Sent from my Moto G (5) Plus using Tapatalk
Were you able to fix this? I have a similar problem.
I am also having this problem. Everyone saying this is normal, is wrong.
donjuro said:
I am also having this problem. Everyone saying this is normal, is wrong.
Click to expand...
Click to collapse
The "normal" message once it's bootloader unlocked is "Your device is unlocked and can't be trusted...Your device will boot in 5 seconds." - it doesn't say anything about a "key".
EDIT: oh, and where his said "ID: bad key" mine says "ID: n/a"
Yes I found out my problem was that I was using a later version of twrp and you have to first use an initial build on one of the rooting threads.
I'm having the same issue. Got the unlock key from Motorola and successfully unlocked bootloader from CMD. The phone then booted up as if it were new. I access the recovery mode and get "device has been unlocked and can't be trusted". No other option. I've tried manually and through CMD. I've downloaded all necessary files including the kernel, ADB, fastboot and twrp. Nothing works. Phone operates as if I factory reset it.
I just rooted my Moto G5s plus last night...here were my steps:
1.) Do the Motorola unlock B.S.
I had fastboot.exe and adb.exe from the Android SDK installed
I did find that I had to unlock my phone or adb could not see it
2.) After unlocking, you get the "untrusted phone" screen
3.) Use fastboot to flash a new boot image: fastboot flash boot logo.bin (I built a logo with MotoBootLogoMaker), this gets rid of the untrusted screen
4.) I do have the "bad key" message show up during boot, but it hasn't impacted anything...it is in white, my boot logo is in white, so you don't see it.
5.) Get a copy of SuperSU.zip on your sdcard and load into your device
6.) I installed TWRP (twrp-3.11-sanders.img) to the recovery partition, but that caused an issue: fastboot flash recovery twrp-3.11-sanders.img)
* Recovery wouldn't boot after this, so I successfully booted the image directly with: fastboot boot twrp-3.11-sanders.img
6.) TWRP successfully loaded....
7.) Use TWRP to install SuperSU.zip (this roots the device)
* I wiped the dalvik cache, but that hung and I ended up powering off...but fortunately it didn't brick the device
8.) After reboot, I logged in with "adb shell" and did an "su" to prove I was rooted.
9.) I replaced bootanimation.zip with one more to my liking than the Lenovo one (/system/media/bootanimation.zip I think was the location)
That was it...

Red Magic 5G Bootloader Unlock Guide: OR get ROOT & TWRP without unlocking the BL!!!

Red Magic 5G Bootloader Unlock Guide: OR get ROOT & TWRP without unlocking the BL!!!
***Bootloader Unlock Instructions for the Nubia Redmagic 5G + installing TWRP:***
WARNING: ANY BOOTLOADER UNLOCK METHOD INVOLVES THE RISK OF BRICKING YOUR DEVICE PERMANENTLY. WHILE THERE IS USUALLY A WAY TO RECOVER, DO NOT ATTEMPT THIS PROCEDURE IF YOU DO NOT KNOW WHAT YOU ARE DOING. BAD THINGS CAN HAPPEN. YOU HAVE BEEN WARNED!!! YOU MAY BE LEFT WITH A USELESS BRICK!!! READ ALL FURTHER WARNINGS EXPERIMENTAL METHOD IN ORIGINAL DOWNLOAD FILE WORKS, I'M USING IT
If you want a NOOB guide look at this post: https://forum.xda-developers.com/nu...beginner-tutorial-unlock-bootloader-t4131585/
Also note a user has managed to fix the FP sensor post BL unlock, see this post here: https://forum.xda-developers.com/nu.../guide-calibration-finger-print-loss-t4132961
Still, I suggest root bypass it's better.
MegaNZ Link for Root without unlocking the Bootloader, and without breaking the FP, also includes instructions for installing BlackMagic5G (explanation below), adding HD VOLTE, how to restore from a brick, and some other cool tricks: https://mega.nz/file/igphSCTD#OybJo9t1zwvJ0bdbAcN2BCqxWXAfHdhk3JFB4_5xkVc
I suggest you flash my BlackMagic5G and don't unlock your bootloader at all - just root. It's CN 2.52 ROM based. You'll get VOLTE, , GApps installed, Rooted with Magisk, TWRP, debloated, YouTube Vanced, AdAway, SmartPack Kernel Manager, etc. - looks like the Global / NA variant of the ROM. Almost perfect except still uses Messages and Phone from Nubia. Plus you will enable Face Unlock not available in the Global or NA versions of the ROM, and FP will still work! Click on the Google Search bar widget and the mic icon takes you to the Google Assistant, the left icon is Google Feed, type in the middle bar for a Google Search. Has 1Weather Free weather widget that looks great, and Google Calendar widget for your whole month of activities. Translate, Lens, Chrome, all the Google Apps are there. And the Chinese Nubia apps are nearly all GONE!
MegaNZ Link for BlackMagic5G Beta - IT'S ONLY THE DATA PARTITION + ROOTED KERNEL + NA SPLASH SCREEN, you NEED to 1) install the Red Magic 2.52 ROM below FIRST 2) Root using the first link posted above 3) Flash restore this from TWRP: https://mega.nz/file/r9hF2BwS#RrAXiFWSBNX8dLqfrH8nNHo_uigPC8uYXonwhALhGbo
MegaNZ Link for the Red Magic 5G CN 2.52 ROM: https://mega.nz/file/aoxBFAqY#EDt2OZBGTME4ZGKnERKpK_t-aJT_rWgD0aqBFkilRcY
*** NOW THE BOOTLOADER UNLOCK INSTRUCTIONS ***
Go to Settings / About phone / Build Number (NX659_J_ENCommon_V3.08 on North American Variant), click 7 times, Now you are a developer message appears, go back a menu to Settings / Other system settings / Developer options.
Enable:
OEM unlocking "Allow the bootloader to be unlocked"
USB debugging "Debug mode when USB is connected"
Install Minimal ADB and Fastboot (Windows 10 in this example): https://www.androidfilehost.com/?fid=746010030569952951
Default install path is:
C:\Program Files (x86)\Minimal ADB and Fastboot\
Go to the Search button on the bottom on Windows 10, type cmd, Command Prompt will appear in the menu. Right click it and Run as Administrator. All commands to be typed will be run in this Command Prompt window (referred to as terminal) unless otherwise stated to run on the phone.
Now Terminal window appears (it says Administrator: Command Prompt in the heading):
Text displayed is:
Microsoft Windows
(c) 2020 Microsoft Corporation. All rights reserved.
C:\WINDOWS\system32>
Typed in terminal:
cd "c:\Program Files (x86)\Minimal ADB and Fastboot"
I now connected the phone to a USB port on the PC.
On the phone, a Window appeared:
"Allow USB debugging?"
The computer's RSA key fingerprint is:
[36 digit code] Example:
C8:A17:E2:01:F6:A1
:368:10:E8:33:20:FB:
93:7D
Always allow from this computer (it's my computer so I clicked it since I trust the computer)
CANCEL / ALLOW (I clicked ALLOW)
Typed in terminal:
adb reboot bootloader
The phone reboots. Once the phone screen boots, in the center it says: Now you are in fastboot mode.
From the terminal I typed:
fastboot oem nubia_unlock NUBIA_NX659J
The terminal now displayed:
...
(bootloader) START update nubia fastboot unlock flag!!!
(bootloader) START set state to 1 ok!!!
In the terminal I typed:
fastboot flashing unlock *** DO NOT TYPE THIS IF YOU WANT TO KEEP A WORKING FP!!! READ TOP OF POST!!! AVOID THIS WITH THE EXPERIMENTAL METHOD OF ROOT WITH NO BL UNLOCK ***
Now a screen appeared on the phone with a big <!> red icon in the left corner. The rest in white text is a warning message. "By unlocking the bootloader, you will be able to install custom operating system on this phone. A custom OS is not subject to the same level of testing as the original OS, and can cause your phone and installed applications to stop working properly-
Software integrity cannot be guaranteed with a custom OS, so any data stored on the phone while the bootloader is unlocked may be at risk.
To prevent unauthorized access to your personal data, unlocking the bootloader will also delete all personal data on your phone.
Press the Volume keys to select whether to unlock the bootloader, then the Power Button to continue."
I selected UNLOCK BOOTLOADER and my device was completely erased. The factory OS loaded then. This process takes some time to complete.
Now the device rebooted with a warning message, and a big <!> yellow icon in the left corner.
"The boot loader is unlocked and software integrity cannot be guaranteed. Any data stored on the device may be available to attackers. Do not store any sensitive data on the device.
Visit this link on another device:
g.co/ABH"
Now the device reloads the firmware apparently and wipes all user data. Upon setting up the phone, the fingerprint display registration comes up and asked to place my finger on the back of the phone. There is no fingerprint sensor on the back of the Redmagic 5G! It is under the screen! So this step must be skipped. The ROM setup is corrupt or incomplete, a beta possibly. I setup the phone then went into Settings / Security to try to add a fingerprint. The button to add fingerprint then appears. Once I click the button, I get this error:
Loss of fingerprint calibration data
Loss of fingerprint calibration data was detected.
Currently unable to complete fingerprint entry,
please contact Nuia after-sales service via
4007006600
See the XDA post for recalibrating the FP: https://forum.xda-developers.com/nu.../guide-calibration-finger-print-loss-t4132961
ROOT FOR ALL DEVICES:
(These files are included in the tools download zip, Magisk 20.4 and MagiskManager-v7.5.1.apk, but this is the official source as updates post): Go to XDA and Download Magisk Manager and install the APK. Download the latest Magisk as well from the Manager. You can then reboot to Recovery (volume up + power, release the power button once the screen shows it loading, hold the volume up down until you see TWRP pop up). Flash Magisk from TWRP Install / Zip / sdcard / Magisk.zip reboot and you'll have root.
BL unlock first method was tested on North American variant and it works. But it breaks your FP sensor and gives you an annoying boot prompt.
If at any time you want to remove the OEM Bootloader unlock, you plug into the PC, go to the terminal for Minimal ADB and Fastboot, type:
adb reboot fastboot
fastboot oem nubia_unlock NUBIA_NX659J
fastboot flashing lock (screen will prompt to relock BL, choose to Relock)
The phone should reboot and install the original software. BUT...
If it says you are corrupted well, you have more issues.
You'll have to reflash the stock recovery.img, reboot to stock recovery, wipe data, wipe cache, and flash the CN update.zip rom to a flash drive FORMATTED TO FAT32 (annoying as hell) But you NEED a USB-C to OTG Adapter to attach a Flash Drive / SDCARD this way). If you don't have one, you better reflash TWRP using the prior instructions and flash the update.zip from there. Install, select the update.zip, flash. Wipe Data, Cache, ART/Dalvik. Reboot.
Now it should WIPE the entire phone and be back to normal Android 10 setup non rooted, no unlocked bootloader. Always beware of data loss doing root functions!!! Always be prepared to setup your phone entirely over again. Google Backup is very good to turn on before you do any of this stuff if you have already installed apps.
*** WARNING - THIS BYPASS METHOD COULD GO AWAY AT ANYTIME. IT SHOULD EVENTUALLY BE FIXED BY NUBIA ***
mslezak said:
{Mod edit}
***Bootloader Unlock Instructions for the Nubia Redmagic 5G + installing TWRP:***
Settings / About phone / Build # click 7 times, now your a dev message appears, good back a menu, go to Additional Settings / Developer Options
Enable:
ADB debugging, + OEM unlock
Connect phone to PC, approve device on phone RSA key for USB debugging
From Minimal ADB and Fastboot:
adb reboot bootlader
fastboot oem nubia_unlock NUBIA_NX659J
fastboot flashing unlock
(approve on phone with volume keys to unlock and hit the power button, now you'll get an annoyng mesage on boot as insecure unlocked BL) *ALL YOUR DATA WILL BE WIPED*
Next:
fastboot flash recovery recovery-TWRP-3.4.1B-0324-NUBIA_REDMAGIC_5G-CN-wzsx150.img
fastboot reboot recovery
Enter TWRP, set to not be removed by updates if prompted.
Boot up the device, setup as a new device. You're on stock ROM / kernel now unlocked.
Once you get up and running you'll want APK Mirror app to install stuff on the China Variant it's in the Nubia Playstore. Gboard download as well and set as default it's a lot easier than the Chinese keyboard that swaps between Chinese and English. Set size extra tall for this huge phone (I prefer anyhow). Chrome go download it from APK Mirror app as well. Then go to XDA and Download Magisk Manager and download it and install the APK. Download the latest Magisk as well from the Manager. You can then reboot to Recovery (volume up + power). Flash Magisk from TWRP reboot and you'll have root.
Note on my testing the fingerprint did not work after unlocking the bootloader. It says to contact Nubia support at some odd number. Hopefully they fix this.
Click to expand...
Click to collapse
You were able to actually install TWRP? Not just boot it? I thought A10 devices cant have twrp permanently installed?
That is a very good question my friend. I had to reflash it several times while rooting so it appears you are correct.
Now a window when I FIRST installed popped up and said make Recovery read only so a system update. can't overwrite it, to this I didn't even pay attention. So assuming that question does lock down recovery, it should stick.
mslezak said:
That is a very good question my friend. I had to reflash it several times while rooting so it appears you are correct.
Now a window when I FIRST installed popped up and said make Recovery read only so a system update. can't overwrite it, to this I didn't even pay attention. So assuming that question does lock down recovery, it should stick.
Click to expand...
Click to collapse
So its not permanent? Thats what I thought.
Well it could be permanent...
VZTech said:
So its not permanent? Thats what I thought.
Click to expand...
Click to collapse
What I was trying to say is that I've never had a phone where I had to select "prevent recovery from being overwritten" so I just clicked off the message. Had I selected "keep TWRP from being overwritten" then possibly it sticks. It's just a matter of making the recovery partition READ ONLY.
mslezak said:
What I was trying to say is that I've never had a phone where I had to select "prevent recovery from being overwritten" so I just clicked off the message. Had I selected "keep TWRP from being overwritten" then possibly it sticks. It's just a matter of making the recovery partition READ ONLY.
Click to expand...
Click to collapse
The issue with that could be any future updates though. Rm uses there own recovery for that. They don't provide fastboot images either I believe
Can anyone send me backup of the super partition?
I accidentally flashed an image to the super partition with twrp thinking it was the system partition (it technically is tho) and it bricked my phone and messed up twrp.
Only stock recovery works but the stock recovery cannot fix it by installing a full ota from a otg drive.
I do have a backup on my phone but it is inaccessable.
Could anyone please send me a backup of the super partition or have any idea on how to fix this?
(I tried to use edl and backup my data to recover my backup of the super partition but it seemed like it needed a programmer binary from qualcomm)
Future updates...
VZTech said:
The issue with that could be any future updates though. Rm uses there own recovery for that. They don't provide fastboot images either I believe
Click to expand...
Click to collapse
Yes what I've been told by prior Redmagic Users 3 and 3S is the ROM is released, as long as your boot.img is not patched with Magisk, it can be installed through the menus in Settings / About Phone / Update or someplace like that. You just download the ROM to the appropriate folder on the phone.
So far I have 1 link to a China ROM update here: https://ui.nubia.cn/rom/detail/65
Now on how to install the ROM, I use the Chrome browser set to autotranslate webpages. Most of the Chinese will be translated from here: https://bbs.nubia.com//thread-1136030-1-1.html
Basically it's going to wipe your device clean, and you can use a Nubia backup tool which will save all your items to a folder. Which then you should copy to your PC before installing the new ROM. Then it gives you instructions to get that data back onto your updated device.
apersomany said:
I accidentally flashed an image to the super partition with twrp thinking it was the system partition (it technically is tho) and it bricked my phone and messed up twrp.
Only stock recovery works but the stock recovery cannot fix it by installing a full ota from a otg drive.
I do have a backup on my phone but it is inaccessable.
Could anyone please send me a backup of the super partition or have any idea on how to fix this?
(I tried to use edl and backup my data to recover my backup of the super partition but it seemed like it needed a programmer binary from qualcomm)
Click to expand...
Click to collapse
Your probably screwed. I had this issue on a rm3s. You will need an unbrick tool. It was released for the rm3s about 4 mos after release. NUBIA should have true fastboot images available for download, but they dont.
VZTech said:
Your probably screwed. I had this issue on a rm3s. You will need an unbrick tool. It was released for the rm3s about 4 mos after release. NUBIA should have true fastboot images available for download, but they dont.
Click to expand...
Click to collapse
That's because of the super (dynamic) partition, see from the latest (and only) ROM:
Excerpt of the ROM installation script where it delineates the dynamic vs non dynamic partitions - you have product w/ a file transfer list, then vendor, system, and odm, The other files (boot.img, dtbo.img, splash.img, etc. and other various files) should be flashable with fastboot.
# Update dynamic partition metadata
assert(update_dynamic_partitions(package_extract_file("dynamic_partitions_op_list")));
unmap_partition("product");
block_image_update(map_partition("product"), package_extract_file("product.transfer.list"), "product.new.dat.br", "product.patch.dat");
unmap_partition("vendor");
block_image_update(map_partition("vendor"), package_extract_file("vendor.transfer.list"), "vendor.new.dat.br", "vendor.patch.dat");
unmap_partition("system");
block_image_update(map_partition("system"), package_extract_file("system.transfer.list"), "system.new.dat.br", "system.patch.dat");
unmap_partition("odm");
block_image_update(map_partition("odm"), package_extract_file("odm.transfer.list"), "odm.new.dat.br", "odm.patch.dat");
# --- End patching dynamic partitions ---
apersomany said:
I accidentally flashed an image to the super partition with twrp thinking it was the system partition (it technically is tho) and it bricked my phone and messed up twrp.
Only stock recovery works but the stock recovery cannot fix it by installing a full ota from a otg drive.
I do have a backup on my phone but it is inaccessable.
Could anyone please send me a backup of the super partition or have any idea on how to fix this?
(I tried to use edl and backup my data to recover my backup of the super partition but it seemed like it needed a programmer binary from qualcomm)
Click to expand...
Click to collapse
You should be able to flash the latest ROM via EDL mode if you've ever used EDL mode before, it usually requires shorting pins together in the device, although some recoveries will let you just boot into EDL mode if the phone still boots. It will be detected. Although on this device with the dynamic partition, I don't know how you would flash these in EDL mode... dynamic partitions - you have product w/ a file transfer list, then vendor, system, and odm that do not look like fastboot flashable parts. Possibly the unbrick tool for Redmagic 3/3S could be modified to do this for you.
mslezak said:
That's because of the super (dynamic) partition, see from the latest (and only) ROM:
Excerpt of the ROM installation script where it delineates the dynamic vs non dynamic partitions - you have product w/ a file transfer list, then vendor, system, and odm, The other files (boot.img, dtbo.img, splash.img, etc. and other various files) should be flashable with fastboot.
# Update dynamic partition metadata
assert(update_dynamic_partitions(package_extract_file("dynamic_partitions_op_list")));
unmap_partition("product");
block_image_update(map_partition("product"), package_extract_file("product.transfer.list"), "product.new.dat.br", "product.patch.dat");
unmap_partition("vendor");
block_image_update(map_partition("vendor"), package_extract_file("vendor.transfer.list"), "vendor.new.dat.br", "vendor.patch.dat");
unmap_partition("system");
block_image_update(map_partition("system"), package_extract_file("system.transfer.list"), "system.new.dat.br", "system.patch.dat");
unmap_partition("odm");
block_image_update(map_partition("odm"), package_extract_file("odm.transfer.list"), "odm.new.dat.br", "odm.patch.dat");
# --- End patching dynamic partitions ---
Click to expand...
Click to collapse
Yes those .img files can easily be fastboot flashed. Unfortunately it wont solve his problem. He needs the nubia unbrick tool, which is tough to get. I dont understand why Nubia makes things difficult. They should provide proper Fastboot files.
I already tried edl (not to flash, but to recover my backup of the super partition) but it seems like it needed a firehose binary. I still can use bootloader, fastbootd, recovery. It's just that the recovery fails at assert dynamic partition update thing with a error 7 (probably because my super partition turned into a normal partiton). I tried to flash a super empty image made with lpmake and try flashing the ota but that didn't work. I think if someone gives me a backup of the super partition I could flash that and that could work. I also had an idea of flashing a super partition of another devices factory image to make my super partition a dynamic partition, but I couldn't find any online.
apersomany said:
I already tried edl (not to flash, but to recover my backup of the super partition) but it seems like it needed a firehose binary. I still can use bootloader, fastbootd, recovery. It's just that the recovery fails at assert dynamic partition update thing with a error 7 (probably because my super partition turned into a normal partiton). I tried to flash a super empty image made with lpmake and try flashing the ota but that didn't work. I think if someone gives me a backup of the super partition I could flash that and that could work. I also had an idea of flashing a super partition of another devices factory image to make my super partition a dynamic partition, but I couldn't find any online.
Click to expand...
Click to collapse
I get a Global Device on Monday. I'll try to use Qualcomm tools to make a brick restore image of Global. If I get one made I'll post all the tools to restore the device on Mega.nz. Because of the super partition it has to be done this way. Not via TWRP as you know. I'm working on Dev tools for this device as fast as possible.
mslezak said:
I get a Global Device on Monday. I'll try to use Qualcomm tools to make a brick restore image of Global. If I get one made I'll post all the tools to restore the device on Mega.nz. Because of the super partition it has to be done this way. Not via TWRP as you know. I'm working on Dev tools for this device as fast as possible.
Click to expand...
Click to collapse
Thank you so much!
Okay I can't add anything special but daaamn this community is amazing. So much help I love you all
To relock BL repeat the instructions with 1 different command
Just replace
fastboot flashing unlock
with
fastboot flashing lock
Again you approve to lock on the phone prompt with the volume keys and your phone will be wiped and all will be back to normal, you'll be locked. And back to phone setup.
I'd edit the original post but the moderators took away my rights!!! Because I posted a Telegram link WHY - how do you expect development to get better???
BTW anyone with a NEW phone arriving that can record the FP failures and all errors please contact me so I can send to Nubia. They are waiting for me to reproduce the error but I already setup my new phone... Thinking I wouldn't be the ONLY ONE to contact [email protected] ... Guys you want developer support on this phone or not. Contribute please.
mslezak said:
{Mod edit}
***Bootloader Unlock Instructions for the Nubia Redmagic 5G + installing TWRP:***
Settings / About phone / Build # click 7 times, now your a dev message appears, good back a menu, go to Additional Settings / Developer Options
Enable:
ADB debugging, + OEM unlock
Connect phone to PC, approve device on phone RSA key for USB debugging
From Minimal ADB and Fastboot:
adb reboot bootlader
fastboot oem nubia_unlock NUBIA_NX659J
fastboot flashing unlock
(approve on phone with volume keys to unlock and hit the power button, now you'll get an annoyng mesage on boot as insecure unlocked BL) *ALL YOUR DATA WILL BE WIPED*
Next:
fastboot flash recovery recovery-TWRP-3.4.1B-0324-NUBIA_REDMAGIC_5G-CN-wzsx150.img
fastboot reboot recovery
Enter TWRP, set to not be removed by updates if prompted.
Boot up the device, setup as a new device. You're on stock ROM / kernel now unlocked.
Once you get up and running you'll want APK Mirror app to install stuff on the China Variant it's in the Nubia Playstore. Gboard download as well and set as default it's a lot easier than the Chinese keyboard that swaps between Chinese and English. Set size extra tall for this huge phone (I prefer anyhow). Chrome go download it from APK Mirror app as well. Then go to XDA and Download Magisk Manager and download it and install the APK. Download the latest Magisk as well from the Manager. You can then reboot to Recovery (volume up + power). Flash Magisk from TWRP reboot and you'll have root.
Note on my testing the fingerprint did not work after unlocking the bootloader. It says to contact Nubia support at some odd number. Hopefully they fix this.
Click to expand...
Click to collapse
Just in case if somebody need a Chinese version of official ROM v2.46 for RedMagic 5G.
Code:
https://mega.nz/file/vc0DiabR#npahTop-JXZ9Mwv-lA7G6DxTG2qqOOAf6AwW8NdEEKw
mslezak said:
Just replace
fastboot flashing unlock
with
fastboot flashing lock
Again you approve to lock on the phone prompt with the volume keys and your phone will be wiped and all will be back to normal, you'll be locked. And back to phone setup.
I'd edit the original post but the moderators took away my rights!!! Because I posted a Telegram link WHY - how do you expect development to get better???
BTW anyone with a NEW phone arriving that can record the FP failures and all errors please contact me so I can send to Nubia. They are waiting for me to reproduce the error but I already setup my new phone... Thinking I wouldn't be the ONLY ONE to contact [email protected] ... Guys you want developer support on this phone or not. Contribute please.
Click to expand...
Click to collapse
we found out that using the cn rom it all works without even unlocking the bootloader, even while oem unlock was disabled in dev options but there is some kind of vbmeta img required. a full guide is incoming.
VZTech said:
The issue with that could be any future updates though. Rm uses there own recovery for that. They don't provide fastboot images either I believe
Click to expand...
Click to collapse
You can flash their NX659J-update.zip files directly from TWRP that's how we restored our bricked devices already. So OTA updates no, but you can download them anyway and flash from TWRP directly. Yes we have to figure out a concrete restore method which isn't 100% working yet. I.e. all your data is lost this way apparently AT THIS MOMENT... MORE TO COME.

Categories

Resources