[Moto X Original Android Development] ecetim:
Hey guys - I read a lot of posts before I attempted (and succeeded) at rooting my Moto X. There are a lot of steps and the base instructions in this thread assume a lot of knowledge. I consolidated everything I read and after I ensured the steps I took down worked, I cleaned everything up into a series of steps that will hopefully be helpful to anyone attempting this process.

If jcase would like to put this in his first post, that would be fine by me, or maybe I could/should post it as a separate "for dummies" walkthrough. I'd also appreciate any feedback if anyone feels like something isn't clear or that I missed something. Without further ado:

Disclaimer: These steps are intended for Windows users. I followed these steps on Windows 7 with zero issues. Windows 8 and Windows Vista should be nearly identical, but I can't confirm that.

Resources & credit that I built these instructions from:

beaups - creator of MotoWpNoMo: http://xdaforums.com/showthread.php?t=2551113

DG4FREE - created a RockMyMoto guide: http://xdaforums.com/showthread.php?p=47067076

DeenyBird - helped fill in a lot of little blanks: http://xdaforums.com/showthread.php?p=49919486

Probably others!

Downloads:

Android 4.2.2 firmware for Moto X

SlapMyMoto (4.4 root exploit)

Found here: http://xdaforums.com/showpost.php?p=47745610&postcount=1

RockMyMoto root exploit: http://xdaforums.com/showthread.php?p=47067076

PuTTYtel.exe (Windows app for telnetting to phone): http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html

MotoWpnNomo write protection exploit: http://xdaforums.com/showpost.php?p=48033832&postcount=1

RSDLite (for flashing 4.2.2 image): http://www.4shared.com/rar/HkfWKoC5/RSD_Lite_615__MTK_Patch.html

Android SDK (for Adb and Fastboot): http://developer.android.com/sdk/index.html

Motorola USB drivers: https://motorola-global-portal.custhelp.com/app/answers/detail/a_id/88481/action/auth

Cydia Impactor (program for exploiting Android): http://www.cydiaimpactor.com/

General Steps:

1) Downgrade to Android 4.2.2 camera OTA using RSDlite

2) Root using RockMyMoto

3) Use MotoWpnNomo exploit

4) Re-flash 4.2.2 camera OTA using RSDlite

5) Take 4.4 OTA

6) Use SlapMyMoto to gain root in 4.4

Before beginning any steps:

Download all files listed above.

Ensure you are able to unzip files (Windows Vista and later have this built-in)

Enable USB debugging on your phone

Connect your phone to same WiFi network as PC

Plug phone into PC via USB and ensure it installs properly (do NOT use USB 3.0 port)

ADB setup:

1) Un-zip SDK file you downloaded.

2) Navigate to folder sdk\platform-tools. Copy the entire contents of this folder and make a new folder on your C: drive called "adb." We will be copying files to the C:\adb folder.

3) With phone plugged in, type:

adb devices

It should stay that it is initializing the ADB server and then list your phone. It may say "unauthorized" next to your phone's name. If this is the case, turn your phone on and there should be a prompt asking you to authorize access. Go ahead and do this.

Downgrade to 4.2.2 camera OTA

1) Locate the 4.2.2 firmware ZIP file and un-zip it.

2) Locate the XML file in the un-zipped folder; e.g. Verizon file is "VZW_XT1060_4.2.2-13.9.0Q2.X-116-MX-17-53_CFC_1FF" and open it in your text editor of choice (Windows Notepad is fine)

3) You must remove the following line from the XML file and then save the file:

<step operation="getvar" var="max-download-size" />

Now we are going to use RSDlite to flash the 4.2.2 camera OTA to your phone. Your phone should be connected and ADB working by now.

4) Open Command Line window as administrator, change the directory to your adb folder (type "cd adb") and reboot your phone into the bootloader with the following ADB command:

adb reboot bootloader

5) Once your phone is in fastboot mode, run RSDlite as administrator (it should prompt you for administrator privileges when you run the shortcut)

6) Your phone should show as connected in the RSDlite program. Click the three-dot browse file button and locate the folder where you un-zipped the 4.2.2 firmware and edited the XML file. Select the XML file

7) Click "Apply" and it will start flashing the firmware to your phone. Do not interrupt this process. Once the 4.2.2 camera OTA is installed it will boot into a fresh install. You can close RSDlite at this time. You are now on the 4.2.2 camera OTA.

Since you have just completely reset the phone, you will need to re-connect to your home WiFi and enable USB debugging.

************************************************************

Use RockMyMoto to gain root on 4.2.2

1) With your phone connected to your PC, find its IP address with the following command:

adb shell getprop dhcp.wlan0.ipaddress

Make note of this IP address.

2) Unzip the RockMyMoto file, copy its contents to the c:\adb folder, and push the files to your phone using these commands:

adb push su /sdcard/
adb push RockMyMoto.jar /sdcard/

3) Enable telnet on your PC. Go to control panel, search "Enable Windows features," and select "Telnet client."

4) Unzip the Cydia Impactor file and run the .exe application as administrator.

5) From the dropdown menu that loads initially (do NOT open up a command window in Cydia), select the option: "# start telnetd as system on port 2222"

The application should display a series of messages and will likely pause on "Waiting to complete" for a short while. This will take about a minute. When it is complete, the message dropdown will default back to "# start telnetd" and no status will be displayed.

6) Run the "puttytel.exe" file as administrator. Enter the IP address of your phone and port 2222 into the program. Make sure the connection type has Telnet selected and then click "Open" at the bottom.

7) Run the RockMyMoto exploit by entering this command into the telnet window:

dalvikvm -cp /sdcard/RockMyMoto.jar RockMyMoto

8) After it completes its activities, it will prompt you to reboot via ADB. Enter this command in your ADB window to reboot:

adb reboot

9) The RockMyMoto exploit needs to be run two more times. Repeat steps 5-7. The phone will auto-reboot this time. Repeat steps 5-7 the third and final time.

10) You should now have root in 4.2.2! To verify, enter the following line in your adb command window:

adb shell su -c "id"

If successful, it will return this:

uid=0(root) gid=0(root)

**********************************************************************************

Use MotoWpnNomo exploit to remove write protection

1) Locate the MotoWpnNomo file you downloaded and extract it. Run wpbegone.exe as administrator.

2) Follow the on-screen prompts. For the most part just type Yes and wait.

3) Once complete, you can verify its success by running the following command in your adb window:

adb shell getprop ro.boot.write_protect

It will return "0" if your efforts were successful.

**************************************************************************

Re-flash 4.2.2 camera OTA

1) Open Command Line window as administrator and reboot your phone into the bootloader with the following ADB command:

adb reboot bootloader

2) Once your phone is in fastboot mode, run RSDlite as administrator (it should prompt you for administrator privileges when you run the shortcut)

3) Your phone should show as connected in the RSDlite program. Click the three-dot browse file button and locate the folder where you un-zipped the 4.2.2 firmware and edited the XML file. Select the XML file

4) Click "Apply" and it will start flashing the firmware to your phone. Do not interrupt this process. Once the 4.2.2 camera OTA is installed it will boot into a fresh install. You can close RSDlite at this time. You are now on the 4.2.2 camera OTA.

Since you have just completely reset the phone, you will need to re-connect to your home WiFi and enable USB debugging.

***********************************************************************************

Use SlapMyMoto to root 4.4

1) Unzip SlapMyMoto-1,0.zip and place the jar file in the same folder as your ADB tools.

2) Push the jar file to your internal storage via the following ADB command:

adb push SlapMyMoto.jar /sdcard/SlapMyMoto.jar

3) Run Cydia Impactor application as administrator. From the dropdown menu that loads initially, select the option: "# start telnetd as system on port 2222"

The application should display a series of messages and will likely pause on "Waiting to complete" for a short while. This will take about a minute. When it is complete, the message dropdown will default back to "# start telnetd" and no status will be displayed.

4) Run the "puttytel.exe" file as administrator. Enter the IP address of your phone and port 2222 into the program. Make sure the connection type has Telnet selected and then click "Open" at the bottom.

5) Run the following command in the PuttyTel window:

dalvikvm -cp /sdcard/SlapMyMoto.jar SlapMyMoto

6) When it prompts you to reboot, do so using the adb command:

adb reboot

7) Repeat steps 3-5. It should auto-reboot this time.

8) Once it has rebooted, allow it to take the 4.4 OTA.

9) Once the 4.4 OTA has installed and rebooted, finish the process by entering the following lines into your ADB command window:

adb shell
cp /sdcard/install.sh /data/local/tmp/install.sh
chmod 755 /data/local/tmp/install.sh
echo "/data/local/tmp/install.sh" > /sys/kernel/uevent_helper

10) Wait about one minute after entering the last command. Manually reboot the phone (via adb or power button). You should now have root! Install SuperSu or your desired superuser app from the Play store.

Optional: Install SuperSu paid version and enable the OTA Survival Mode feature. Early reports indicate this will keep root when the new 4.4.2 OTA comes out.