yashsingh1/xdaforums huggingface dataset:
[Moto X Q&A] Cozume:
First, with your device disconnected from any power source, boot into bootloader mode and verify that it says Device is UNLOCKED. Status Code: 3. BTW - the bootloader unlocked warning logo stays even if you relock the bootloader unless you flash a new logo.

Then if it does say device is unlocked, hit Volume Down to highlight Recovery and Volume Up to select recovery. Is that when you see a black screen? It takes TWRP a little while to load.
[Moto X Q&A] Tuse0708:
Nevermind....Thanks for the help, got it going.
[Moto X Q&A] jodaboda:
thanks!
[Moto X Q&A] Cozume:
You are welcome!
[Moto X Q&A] hbar98:
So I'm getting an unlock code. I am currently on 4.4.2, and if I read the posts right, I don't have to downgrade to 4.4 to root, TWRP will still root 4.4.2 without issue, right?

EDIT

Nevermind. I've slapped my Moto, so I'm going to SBF back to 4.4.2 to make sure there aren't any... issues...
[Moto X Q&A] fury683:
I'm currently rooted on 4.4. I have made changes to /system, so I can't take the OTA. I got an unlock code today. I understand that unlocking the bootloader will induce a Factory Data Reset. Do I need to SBF to stock 4.4 (or 4.2.2) before I do this? Will the FDR clear up the changes I made?

Furthermore, what order should I do these steps in? If I have 4.4 and unlock/root it, I can't take the OTA with non-stock recovery, correct? I would need a flashable ZIP for TWRP/CWM? Would it be better to unlock, FDR, take OTA to 4.4.2, then do TWRP and root?

Hopefully this isn't too silly of a question, I appreciate any advice for the best path to take on this.
[Moto X Q&A] t1.8matt:
Hey all, just ordered a Dev Edition to go along with my N5 and had a question regarding mfastboot. I downloaded mfastboot from one of the stickies, it was only one file and placed it in my sdk platform tools folder. I was reading on Motorola website about flashing factory images and seen this note-"NOTE: You must use the Motorola fastboot utility to flash (included in the Darwin/, Linux/ or Windows/ directory). Please do NOT use the Android fastboot utility.". First of all, what does it mean included in Windows directory? And I'm guessing about not using the Android fastboot utility, they want you to use "mfastboot flash...." instead of "fastboot flash...."? Just trying to get some research in before I receive the device. I'm used to using fastboot on my Galaxy Nexus and now my N5. I used to have alot of Moto devices before this and using the SBF files in Moto's flashing tool, but never had an unlockable bootloader Moto device that can use some form of fastboot.
[Moto X Q&A] :
Fastboot can't handle the file sizes. So Motorola made mfastboot. You have to use it when flashing the Moto x.

Sent from my cell phone telephone....
[Moto X Q&A] t1.8matt:
Ok, gotcha. And I've been reading a little about people wanting to downgrade from 4.4.2, but if you have a locked bootloader and upgraded to the latest bootloader, they can't without bricking. I assume this won't be an issue with an unlocked bootloader, even though I'm not sure of why you would want to downgrade. Edit: I see, for root reasons, but this shouldn't be an issue if you're flashing SuperSU in TWRP?

Edit again: I should read more. Rooting 4.4.2 with an unlocked bootloader isn't an issue if I follow this guide in this thread. Thanks for your help. Looking forward to getting this device.
[Moto X Q&A] :
Root will be easy. Same as a nexus. Unlock bootloader, flash custom recovery....root. install superSU if needed.

As far as what's NOT like a nexus....yes, you can still brick downgrading an unlocked device....even the dev edition...which is no different than any other unlocked Moto x. Without going into all the details, you can read about it all over....there is a specific way to downgrade. And you cannot take an ota after....that MAY brick any Moto x...locked or unlocked. There is tonnes of conflicting opinions on this....so read as much as you can, and decide from there. There's very specific ways to downgrade and upgrade after. In my opinion....there's risk involved in all of it.

Just Google "Moto x brick downgrade xda" to read the stories. :)

If you find you must downgrade from 4.4.2.....study hard before you do. ;)

Sent from my N5, N7, Moto X,G Tab 3 or S2..... ;)
[Moto X Q&A] t1.8matt:
Great info. But the only reason people are downgrading from 4.4.2 is if they have a locked bootloader and want to retain root?
[Moto X Q&A] :
Yes, but unlocked people downgrade too for one reason or another. It has to be done properly. Personally, I'd never recommend it. But that's just me.

Sent from my N5, N7, Moto X,G Tab 3 or S2..... ;)
[Moto X Q&A] t1.8matt:
OK, I'll do some more reading on it. Thanks again for your help.
[Moto X Q&A] :
On my nexuses (nexi?), I can just flash any bootloader I want.....no matter the version. NOT so on the x.

Sent from my N5, N7, Moto X,G Tab 3 or S2..... ;)
[Moto X Q&A] t1.8matt:
Yep, I've noticed that since I had a Galaxy Nexus. I wonder why Moto does that even for the Dev Edition. You would think at least on that model it wouldn't matter, but I guess there's no point speculating why a company does something like that. Really appreciate you giving me the time to answer my questions and not jumping down my throat like over in the N5 threads.
[Moto X Q&A] bensl84:
Subscribed. I ordered my Verizon DE two days ago. It hasn't shipped yet but they said it might be 7 days.... Keeping this thread in your back pocket
[Moto X Q&A] t1.8matt:
Ordered mine on the 15th, still hasn't shipped. Says it's in stock. Sorry going OT here.
[Moto X Q&A] NayOn:
Recovery

When I click on recovery I see laying Android icon with open body an message: No Command. So it's not clear how run SuperSU ....
[Moto X Q&A] T-Keith:
Two questions:

1. I have the 4.2.2 OTA update pending on my device. Should I take that before I unlock the bootloader, or doesn't it matter?

2. Is mfastboot available for Linux? Do I really need it?
[Moto X Q&A] t1.8matt:
That sounds like the factory recovery. Did you flash TWRP to your phone?
[Moto X Q&A] NayOn:
Yap, I did. Just re-did all steps without step #8 with "fastboot reboot-bootloader" and I'm all set now! :o

Do you have idea how to lock boot loader back and keep rooting?

Thank you,

Andrey
[Moto X Q&A] bensl84:
this may be slightly off topic but i couldn't find any definite steps to receive the ota once rooted besides going back to stock. this is what i did.

fastboot flash stock recovery then mfastboot flash system

i didn't lose any data just super user wich was to be expected and all the updates updated.

it took me a while to figure out so i thought i would share

thanks for the steps to root as well!!
[Moto X Q&A] t1.8matt:
Thanks for this guide. Made it easy as could be to root. Pretty much just like my Nexus.
[Moto X Q&A] KidJoe:
The Moto X bootloader has 3 states which are reported on the bootloader/fastboot screen... Locked, Unlocked and Relocked.

fastboot oem unlock <UNIQUE CODE> will unlock it, and change status to Unlocked.

fastboot oem lock will relock it, but the status is set to RELOCKED

We don't have a way to change the status back to LOCKED.
[Moto X Q&A] Grape Drank:
I'm pretty certain I know the answer to this, but I wanted to confirm.

The process of unlocking the bootloader will wipe the device correct? That was what happened with my Galaxy Nexus, so I can only assume the same holds true for the Moto X or any android device.
[Moto X Q&A] :
Yea, total wipe. ;)

Sent from my N5, N7, Moto X, G Tab 3 or S2.....
[Moto X Q&A] kpoverdorf:
Is it at all possible to Root the Moto X with out installing a custom recovery so I can still receive OTA updates without having to flashback the stock recovery?

If not, does flashing the stock recovery back on the phone wipe the phone?
[Moto X Q&A] KidJoe:
flashing stock recovery does NOT wipe the phone.

No, its not possible to root without installing custom recovery... however, if you are only flashing custom recovery to root, and don't need nandroid backups or other features, then once rooted, you can flash stock recovery back on your phone and run that way.

Again, keep in mind that OTA's updates include a manifest file listing particular files and their "check sums" it looks for on your phone. If they are not on your phone, or the ones on your phone don't match the expected check sum, the OTA will fail.
[Moto X Q&A] kpoverdorf:
OK. Learning :)

So basically after the Unlock/Root process is all done, even if I flash the stock recovery back on, there may be info that does not match the OTA update manifest causing it to fail. So rule of thumb is don't risk an OTA update if you are modded bc it's no guarantee the it will be successful.

So in order to be 100% sure an OTA update will be installed successfully I would have to unroot and return to stock (I can leave it unlocked though?).

Sorry. I'm not stupid. Just trying to cover all the bases and sometimes I overthink things too much.
[Moto X Q&A] KidJoe:
You've sort of got it... but not quite... And yes, you are over thinking a little...

You can be rooted, running TWRP day to day. If you've rooted and done things like the tethering hacks that have your replace file (Like the older VZW Entitlement APK hack, or the newer replace the framework.res.apk hack) you'd need to undo those and make sure you have stock recovery before you take an OTA. Other hacks that similarly replace/modify/delete system files would need to be undone too.

If all you do is install twrp, root, and install an app or two that require root in order to operate, then you'll only need stock recovery.

Take me for example.. I've flashed TWRP and Rooted, installed Wifi Tether For Root (or see This Post), Adfree, 3C Battery Widget, Quick Boot, and some root capable file managers... To get ready for the 4.4.2 update, since none of my apps modified/deleted system aps, all I needed to do was flash stock recovery back on and take the 4.4.2 OTA. Afterwards, I was still rooted, so I never flashed TWRP back on yet, I'm still running stock recovery.
[Moto X Q&A] kpoverdorf:
Ahh Gotcha.

Currently the only thing I would have to revert is the ExchangeNoPIN hack, but that's easy. I think it's safe to say I fully understand now.

That's really all I wanted to clarify. I understand the unlock/root process. My last phone was the GNex so I understood the basics but everything was literally automated for that phone so I am a little spoiled.

I will probably.. unlock, root, restore stock recovery and just let it be. Then I'll just have to remember to revert ExchangeNoPIN for updates. Done.

Thanks again! :laugh:
[Moto X Q&A] roweboat56:
Question about TWRP

I'm curious if anyone knows... this is more a question of curiosity. is it possible to flash the newest version of TWRP (2.7), or can only the 2.6... version be used?

I always like to think newer=better but i know that is not always the case.

TWRPS website even said the MOTO X is not compatible but i know it was referenced in version 2.6.3.1 (or whatever it is)

---------- Post added at 04:13 PM ---------- Previous post was at 04:09 PM ----------

nvermind. I'm assuming this: http://xdaforums.com/moto-x/development/twrp-2-6-3-f2fs-support-unlocked-t2458449

is all that will work because it had to be modded. =)
[Moto X Q&A] manoosie:
Just want to say this link helped with this process:

http://www.modaco.com/topic/368126-confused-as-to-how-to-unlock-bootloader/
[Moto X Q&A] thenetvines:
Will this work on the new Moto X GSM TMobile Moto Maker edition? I'm still not sure its bootloader can be unlocked, or use that safestrap tool, but some info says the bootloader can now be unlocked through the website.

http://www.reddit.com/r/MotoX/comments/1wkwe9/is_the_gsm_unlocked_version_on_motomaker_the/

I got this version:
[Moto X Q&A] KidJoe:
Yes, you can unlock the bootloader on that model, it voids the warranty, then you can use this process to root it.
[Moto X Q&A] thenetvines:
So if I understand correctly, once unlocking the bootloader, with a custum recovery, SU, and ROM, I don't have to worry about Write Protection, and/or updating the bootloader through SFB? :)

Lastly, would you please point me to the latest flashable zip through TWRP, or a rom flashable through fastboot maybe?
[Moto X Q&A] KidJoe:
Once you unlock your bootloader, write protection is disabled. You can then use the process in the first post of this thread to Root. It does not matter what ROM version you are on, the same holds true. You can use the process in the first post to root. You can flash an SBF or take an OTA update, and still use the process in the first post to root.

Not sure what you are asking. If you want to flash a ROM or update via TWRP, I've only seen one post, and that is for the Verizon XT106, but later on in thread, it doesn't look like its complete. To flash with fastboot... just download the SBF, unzip it, and manually fastboot flash each part (but make sure you use the Moto customized fastboot, aka mFastboot, or certain parts, like system.img, will fail to flash)
[Moto X Q&A] thenetvines:
Got it! The last part you mentioned cleared it up completely. Thanks for your support :)
[Moto X Q&A] roguealcatraz:
Hi KidJoe, i have some question about rooting on my XT1053 T-Mobile

I'm now at 4.4.2 and unlocked my bootloader yesterday. I want to have ability to get future OTA update but also need to be rooted in order to install Tasker, SetDNS, etc.

Since i don't need custom recovery so much, i might just flash stock recovery so i can still get OTA update. My question is how to flash stock recovery on my phone? can you explain step by step procedure? It will not wipe my data right?

I'm concerning about future OTA update because from previous experience, OTA update brings much improvements such as camera quality. I'm sure the next one will brings more enhancements. Thank you sir !
[Moto X Q&A] KidJoe:
Remember, even if you have stock recovery installed, the OTA's include a manifest file that contains a list of files and their check sums that it expects to be on your phone. If the files are missing, or the check sum for a particular file doesn't match (because you've replaced or altered the file), the OTA will fall.

I mention this because I'm not sure what SetDNS might change/alter, nor am I sure what else you might install/need.

As for how to flash stock recovery.. its simple. You need the SBF of the ROM on your phone. Unzip it. It will have the stock recovery.img file. Then just fastboot flash recovery recovery.img similar to the way you put TWRP on to root.

And you are correct, flashing recoveries does not wipe your data. Unlocking or relocking the bootloader will.
[Moto X Q&A] roguealcatraz:
I see..do you know where is those files that their check sums is expected to be matched for OTA? Do you currently working a method to ensure their exactness so an OTA update will be delivered?

Yeah i will install SetDNS, Tasker, maybe Root Explorer too..

Regarding the stock recovery, so i will need a SBF with original version (the phone comes in JB 4.2.2 but now it is already OTA updated to 4.4.2) or the newest version?for unzip, do i use winrar or specified command in cmd?

Sorry for beeing noob btw sir.i rarely used command line. my first android is Moto DEFY so doesn't do much command line :(
[Moto X Q&A] KidJoe:
To view the manifest, you need to copy the update ZIP file to your PC, or elsewhere, and unzip it... then you can look at the list of files. So there really isn't a way to be sure

The only way to be sure you have the correct versions, is manually undo any modifications you've made, etc.. Or flash back to stock.

For some background.. see -> http://mark.cdmaforums.com/MotoX-OTA.html (it was based off what I typed here -> http://xdaforums.com/moto-x/general/faq-kit-kat-how-to-prepare-carriers-t2536735 and some of its discussions, but cleaned up a little since 4.4.2 came out)

You have 4.4.2 on your phone now? then you need the recovery from the 4.4.2 SBF file. You need to go to Settings -> about ... and look at the Android Version, System Version and Build Number... those will help you get the right SBF file if you are getting them from say -> http://sbf.droid-developers.org/phone.php?device=0. The file will usually have that info in its description or file name.

You can unzip with Winzip, WinRAR, 7Zip, or the like. When you do, you'll see the recovery.img.
[Moto X Q&A] Woarden:
It seems I've been doing something wrong.

Unlocked bootloader

Firstly I didn't even manage to get into the TWRP custom recovery using twrp 2.6.3.1

It only gave me the bootloader unlocked screen and went on with normal boot after a while.

with 2.7.0.0 I booted into TWRP screen.

Installed the SuperSU zip file.

But no root access.

Running 4.4.2
[Moto X Q&A] Levistras:
I have a Moto X running 4.4.2, unlocked bootloader, twrp installed, however my write protection is still enabled.

C:\dev\adt-bundle-windows-x86_64-20130514\sdk\platform-tools>adb shell getprop ro.boot.write_protect

1

You state in your post that once you unlock your bootloader, write protection is disabled... but that doesn't seem to be the case for me. Can you confirm if there's something I can do from an unlocked bootloader state to disable the write protection?
[Moto X Q&A] :
Just install the custom recovery, root and test. Before worrying about it. ?

Sent from my N5, N7, Moto X, G Tab 3 or S2.....

---------- Post added at 12:37 PM ---------- Previous post was at 12:35 PM ----------

Sorry, you have twrp. Did root work then? Sometimes you have to download SuperSU or flash it in recovery.

I'm betting you're fine.

Sent from my N5, N7, Moto X, G Tab 3 or S2.....
[Moto X Q&A] Levistras:
I have SuperSU and Root working great... that's not a problem.

But since I'm write protected, I can't make any modifications to system... so having Root is fairly limiting...

I'm trying to figure out how to remove the write protection so that changes to /system don't get reverted upon reboot.
[Moto X Q&A] KidJoe:
I've not run into a case where 4.4.2 with bootloader unlocked, and twrp/supersu to root, still have write protection enabled.

So you've got your unlock code, did a fastboot oem unlock <unique_code> and it unlocked successfully (and wiped your phone), then you've done a mfastboot flash recovery twrp.img, booted into twrp and then installed the latest SuperSU.zip (while booted to TWRP)?
[Moto X Q&A] Levistras:
Absolutely correct.

Leveraging your thought that the unlock process removes the write protection, I went through the process to attempt to relock the phone. I sent over "fastboot oem lock begin" (not sure why you need the "begin" command.. but Moto X asks for it), then "fastboot oem lock". It sat there for 30 seconds before saying "LOCKED!" and rebooted.

Upon rebooting back into bootloader though, it still said "UNLOCKED"... If I try to unlock again from this state it says it's already unlocked and there's nothing to do.

So I can't relock it, it's already unlocked, it's got twrp and root and working SuperSU (su working for apps as well as for ADB), however I have write protection and can't make any /system changes as they don't persist after reboot.
[Moto X Q&A] :
I'd reflash stock, the same version you're on and start over. Something strange is happening....I think you're literally the first and only person to have this issue.

Weird.

Sent from my N5, N7, Moto X, G Tab 3 or S2.....
[Moto X Q&A] KidJoe:
If all you did was the fastboot oem lock, that might be the problem.

Try following what Moto has on their web site to relock (this will erase your files, data and settings so BACKUP TO YOUR PC BEFORE YOU BEGIN!!!!)... https://motorola-global-portal.custhelp.com/app/standalone/bootloader/recovery-images

There was a thread here on XDA that was talking about re-locking the bootloader, and that flashing and erasing data/cache was needed to do the oem lock... (see -> http://xdaforums.com/moto-x/general/noob-guide-unroot-relock-bootloader-vzw-t2571786 )

Oh, and use mFastboot is included in the 4.4.2 developer images which are request-able from Moto's web site.

Once you've properly re-locked your device, go ahead and try unlocking using the info in the first post and see what happens.

Oh, and why did you try to re-lock?
[Moto X Q&A] Levistras:
I only tried relock after finding your post that alluded to the fact that it was the unlock process that removed the write protection. I was thinking that if I would unlock again.. perhaps I would be unlocked without write protection this time.

Will this work on an XT1058? I have a bootloader-unlocked Rogers Moto X, which has different radio bands than the GSM Dev edition.

http://en.wikipedia.org/wiki/Moto_X#Variants

Not sure if this can be used to help me.. but the older 4.2.2 as well as 4.4.2 RSD Lite firmwares are available to me here: http://sbf.droid-developers.org/phone.php?device=0
[Moto X Q&A] KidJoe:
Remember... you want to flash the SBF that is the same ROM version as what is on your phone. If you have 4.4, get the 4.4 SBF. If you have 4.4.2 on your phone, get the 4.4.2 SBF. Don't downgrade in the process!!!

And while my post might have alluded to that the process of unlocking disabled write protection... I can't say at what part. Just that once unlocked WP is disabled. And I did NOT say that re-locking the bootloader will re-enable write protection (that is something I haven't tested).

I'm in a very uncomfortable position right now.. 1. I don't know exactly what you did, or why. 2. I don't know if you started out locked and unrooted, were trying to root and got lost along the way, or what. 3. I don't know if you were unlocked and just experimenting to see if re-locking enabled write protection or what.

I don't want to suggest the wrong things.. but at this point, following the moto process to flash and relock is the safest bet.
[Moto X Q&A] Levistras:
Well once upon a time I was locked and not rooted, this was back in the 4.2 days.

When 4.4.2 came out, there was a method released to root and maintain your root after performing the upgrade. (Silly me, I didn't really need this, because I'm unlocked I can TWRP and re-root from there.. but anyway)..

I followed this process to get into the 4.4 world with root: http://xdaforums.com/moto-x/orig-development/4-4-root-slapmymoto-1-0-motowpnomo-t2538896

And that's pretty much it... this left me in a state where I have 4.4.2, I am rooted, unlocked, with TWRP bootloader and SuperSU binary installed. But my "adb shell getprop ro.boot.write_protect" still returns 0.

If there is no magical command I can run with root permission to turn off that write_protect option... my next thought was to try to revert to a "locked" state and then unlock again, but only because you insinuated that part of the unlock process might remove my write protection.

In either case, I'm downloading the 4.4.2 RSD Lite file for the Rogers device, I will try a full flash back to that... and see where that leaves me. In any case, I should easily be able to re-TWRP and Root, so worst case will be that it just leaves me in the same spot I'm in now.

(My goal here is to be able to use things like Xposed that modify the system partition. Right now my only way to use these is to bundle up any changes they try to make to the /system partition and apply through through a flashable ZIP in TWRP (no write protection while in TWRP).)

---------- Post added at 08:35 PM ---------- Previous post was at 07:54 PM ----------

Unfortunately not good news...

Applied the SBF for Rogers 4.4.2. Was presented with a fresh device as far as I could tell, but upon going back to the bootloader, I'm still "UNLOCKED" (possibly expected)... so I tried fastboot oem lock begin, then fastboot oem lock, again on screen it said "LOCKED!" after 30 seconds, but upon reboot my bootloader still says unlocked.

I've reflashed TWRP and regained root... but I'm back where I started.

4.4.2, with TWRP, with root, but write protection is still enabled.