[SCRIPT - ROOT] Moto X Root Script (Locked Bootloader)

Search This thread

640k

Senior Member
Apr 18, 2008
1,366
289
Script removed/Effort "canceled" (see release notes)!







Dear fellow XDA'ers, i have written a quick and simple script to tie in all of the great work done by jcase and beaups that helps you root your Moto X. This script simply follows the instructions written by jcase and beaups and automates those scripts with a simple menu.

This script should technically work for "any" Moto X on "any" carrier, provided the methods contained within have the same success rate across all carriers. I do not have the capacity, nor experience, to trap for all situations.

This script ASSUMES that you already have the Motorola drivers installed and your device has successfully connected to your computer via USB Debugging Mode. If you need the drivers, they can be found here.

Instructions:
  1. Download and extract this script on to your Windows Desktop.
  2. Download ALL of the following to the same folder as the GO!.CMD ("640k's Moto X Root Script" Folder). These files should NOT be unzipped:
    • your specific 4.2.2 factory image.and/or 4.4 factory images (if you are on 4.4, you will need BOTH images).
    • jcase's RockMyMoto (4.2.2) and SlapMyMoto (4.4).
    • beaups' MotoWpNoMo.
    • Saurik's Cydia Impactor
  3. Execute Go!.CMD and follow the on-screen prompts.

Links:

Disclaimers:

  1. I make no warranties of any kind regarding the accuracy or efficiency of this script or the processes contained within. This script was tested on a single device and was written based off of the instructions provided within these forums. You can perform these steps yourself!
  2. jcase will NOT support the use of this script. Should you run in to issues with any of the functionality/procedures written specifically by jcase, you will not be supported by jcase unless you are following his methods.
  3. beaups will NOT support the use of this script. Should you run in to issues with any of the functionality/procedures written specifically by beaups, you will not be supported by beaups unless you are following his methods.


Because I have compiled other's hard work into a command-line script, i have decided to distribute my script uncompiled. That way, in the event of major changes, significant errors, etc., that I don't have time to address, the user community can lend a hand. If you find my work useful, please Thank Me.


WARNING
  • Make sure your device is fully charged before beginning!
  • Some people have reported an inability to flash their device, have received "unknown errors", weird partition errors and general chaos during the flashing/imaging process. If this happens to you, try a different USB port. I have read threads/seen reports where sometimes USB 3.0 ports cause failures during this process. Change to a USB 2.0 port and try again.
    [*]In general, it is difficult to completely brick your device using this method. As long as you can get to the fastboot menu, your device is recoverable. If your phone will not power on, you did not follow one of the two warnings above.

TIPS:
  • If "Waiting for device" seems to be taking a really long time (your device is ready, but the script hasn't picked it up yet), try either turning off USB Debugging and then back on, or try removing the USB cable and re-inserting it.
  • If you are on 4.4, looking for root, your device will be re-imaged two times with 4.2.2. Don't input your details until the 2nd time, to avoid having to repeat your effort.
  • Connect to your WiFi before enabling USB Debugging Mode to avoid IP Address errors. The batch script tends to get funny on some of the retries. I've tried working out most of the bugs.
  • I'm confident I haven't worked out 100% of the bugs in this script, although I've tried very hard. I've only tested it with one device, the XT1060. If you have issues, please do not PM me, post them here in the thread.
  • If for some reason the script abnormally ends or you close out of it, without running the cleanup process at the end, ADB will remain present and cause an error in the script, which will cause the script to fail. Browse to the folder with the CMD prompt and type "ADB kill-server" (kill-server is case-sensitive). This will get the script running again.

Thanks jcase, beaups, saurik and anyone else who has contributed to this effort!

Changelog:
  • 1/9/2014: Initial Release. Only tested on one device. Better bug management within each step, more options at advanced menu, including ADB Debug Window. Removed auto-upgrade to 4.4. I suspect this is where my woes were.
  • 1/9/2014: Removed ADMINISTRATOR requirement. I don't think this will do any harm, but it was creating conflicts with Windows 8.
  • 1/9/2014: Changed TELNET conditions to trap for user interaction.
  • 1/14/2014: Adjusted initial TELNET session.
  • 1/14/2014: Corrected a type on line 366 (would have given an error).
  • 1/15/2014: Re-worked TELNET routine again.
  • 1/16/2014: Simplified menu options, included automated checking for write protection. This check will skip steps once WP has already been turned off.
  • 1/16/2014: Included additional instruction, including more messaging and better message waiting.
  • 1/16/2014: Added additional messaging for troubleshooting purposes.
  • 1/16/2014: Corrected a bug related to BATCH language that was ending the TELNET steps.
  • 1/17/2014: Made another adjustment to TELNET handling.
  • 1/17/2014: Added additional error checking.
  • 1/17/2014: Added some wait time on the second TELNET phase.
  • 2/28/2014: Canceled script effort (ran out of time). With 4.4.2 released, none of the current root methods are valid or work.

BEFORE YOU START WITH ANY METHOD THAT REQUIRES YOU TO WIPE YOUR DEVICE, MAKE SURE YOUR DEVICE IS 100% FULLY CHARGED!! IF YOUR DEVICE SHUTS DOWN WHILE THE SYSTEM IS FLASHING YOU WILL BRICK YOUR DEVICE!!!
 
Last edited:

640k

Senior Member
Apr 18, 2008
1,366
289
Hold the phone. The script at the very last step isn't working. Can't fix right now. My personal device doesn't have root, so it failed. Will need to troubleshoot.
 
Last edited:
  • Like
Reactions: flipfreak

tea_dub84

Senior Member
Sep 19, 2010
65
23
Appreciate the effort put into this for the community

Sent from my XT1060 using xda app-developers app
 
  • Like
Reactions: sn2hotty

640k

Senior Member
Apr 18, 2008
1,366
289
ok so the script seems to be doing what it's designed to do, which is good. but i've borked my device testing it, which is bad. but i was able to trap for more conditions and provide a better menu system, which is good.

as soon as i can figure out if i can un-bork my device, i'll post the script back up.
 

flipfreak

Senior Member
Feb 26, 2011
85
7
I really appreciate your hard work. I've had trouble getting this to work by myself. I'd love to give this a shot later today. I had a few questions though.

You said to "install the script" after it is downloaded but what exactly needs to be installed? Also you said to put all the files in the install folder, but I'm not seeing an install folder in the extracted .rar.

I want to make sure the script runs smoothly so it would be best if I could see exactly how your files are set up. Would you perhaps be able to upload a screenshot?

Thanks!
 

640k

Senior Member
Apr 18, 2008
1,366
289
I really appreciate your hard work. I've had trouble getting this to work by myself. I'd love to give this a shot later today. I had a few questions though.

You said to "install the script" after it is downloaded but what exactly needs to be installed? Also you said to put all the files in the install folder, but I'm not seeing an install folder in the extracted .rar.

I want to make sure the script runs smoothly so it would be best if I could see exactly how your files are set up. Would you perhaps be able to upload a screenshot?

Thanks!

so my original intention was to distribute this as a self-extracting EXE but because i wanted to share my work and XDA's attachment policy, i changed it to a rar.

just unzip it (anywhere). you'll get a "640k's Moto X Root Script" folder. make sure your .zips from the links above are in the same folder as the Go!.CMD and you'll be good to go.
 
Last edited:
  • Like
Reactions: flipfreak

flipfreak

Senior Member
Feb 26, 2011
85
7
so my original intention was to distribute this as a self-extracting EXE but because i wanted to share my work and XDA's attachment policy, i changed it to a rar.

just unzip it (anywhere). you're get a "640k's Moto X Root Script" folder. make sure your .zips from the links above are in the same folder as the Go!.CMD and you'll be good to go.

Thank you! That clears things up. I'll give this a try later and let you know how it went
 

640k

Senior Member
Apr 18, 2008
1,366
289
Thank you! That clears things up. I'll give this a try later and let you know how it went

based on my testing, unless something goes completely wrong, it should be pretty hard to completely bork your phone. if you get into a bootloop, the advanced menu can help you restore your system files as long as you can get in to the bootloader (usually you can).
 

flipfreak

Senior Member
Feb 26, 2011
85
7
based on my testing, unless something goes completely wrong, it should be pretty hard to completely bork your phone. if you get into a bootloop, the advanced menu can help you restore your system files as long as you can get in to the bootloader (usually you can).

Hmm, well I tried it but it keeps telling me that 7za.exe is not in the folder, even though it is sitting right above Go!.CMD. Any idea why it would say this? I ran it as an administrator
 
Last edited:

640k

Senior Member
Apr 18, 2008
1,366
289
Hmm, well I tried it but it keeps telling me that 7za.exe is not in the folder, even though it is sitting right above Go!.CMD. Any idea why it would say this? I ran it as an administrator

can you screen shot the window and your folder where the files are?

thanks.
 

flipfreak

Senior Member
Feb 26, 2011
85
7

Attachments

  • RootScriptFolder.png
    RootScriptFolder.png
    28.5 KB · Views: 500

640k

Senior Member
Apr 18, 2008
1,366
289

did you extract the contents to your desktop? i'm guessing it's failing because you're technically not running the cmd file in the same folder. for example, windows will allow you to run files directly from a .zip, but it caches that file in to a temp folder somewhere. if you haven't unzipped the files, the script won't see any of the files.

i'm here to help, i want this to be successful.
 
  • Like
Reactions: sn2hotty

flipfreak

Senior Member
Feb 26, 2011
85
7
did you extract the contents to your desktop? i'm guessing it's failing because you're technically not running the cmd file in the same folder. for example, windows will allow you to run files directly from a .zip, but it caches that file in to a temp folder somewhere. if you haven't unzipped the files, the script won't see any of the files.

i'm here to help, i want this to be successful.

Yeah, the files are all extracted to my desktop. If I run it as an administrator, it gives me the error telling me that that 7za.exe is not in the folder. If I don't run it as an administrator, it tells me that it will abort and to press any key to continue. When I press any key, it brings me to the menu where it asks me what I want to do.

I'm not sure what I could be doing wrong. Maybe we should just wait and see if anyone else has this problem. It could be on my end.
 

640k

Senior Member
Apr 18, 2008
1,366
289
Yeah, the files are all extracted to my desktop. If I run it as an administrator, it gives me the error telling me that that 7za.exe is not in the folder. If I don't run it as an administrator, it tells me that it will abort and to press any key to continue. When I press any key, it brings me to the menu where it asks me what I want to do.

I'm not sure what I could be doing wrong. Maybe we should just wait and see if anyone else has this problem. It could be on my end.

ok i'm seeing the same issue. it's isolated to Windows 8. troubleshooting now.

Windows 8 is running the CMD prompt from /WINDOWS/SYSTEM32... which is the exact problem i detailed earlier. i'm going to remove the admin requirement. i don't think it's necessary.
 
  • Like
Reactions: flipfreak

640k

Senior Member
Apr 18, 2008
1,366
289
Yeah, the files are all extracted to my desktop. If I run it as an administrator, it gives me the error telling me that that 7za.exe is not in the folder. If I don't run it as an administrator, it tells me that it will abort and to press any key to continue. When I press any key, it brings me to the menu where it asks me what I want to do.

I'm not sure what I could be doing wrong. Maybe we should just wait and see if anyone else has this problem. It could be on my end.
download the new file and try it again.
 
  • Like
Reactions: flipfreak

640k

Senior Member
Apr 18, 2008
1,366
289
That got it working. I'm now stuck at attempting a telnet session. Should I restart? Here's a screenshot

i was afraid of that. open the TELNET.ERR file with notepad and show me the contents. jcase stuck some user interaction in there that only occurs one time, so i was never able to trap it again.

thanks for your help.
 

flipfreak

Senior Member
Feb 26, 2011
85
7
i was afraid of that. open the TELNET.ERR file with notepad and show me the contents. jcase stuck some user interaction in there that only occurs one time, so i was never able to trap it again.

thanks for your help.

No problem.

ÿýÿýÿûÿû

~ $ dalvikvm -cp /sdcard/RockMyMoto.jar RockMyMoto
RockMyMoto 1.0
by Justin Case
PayPal Donations maybe sent to: [email protected]
Special thanks to saurik, you rock!

System is write protected...
Executing step 1...
To use RockMyMoto you most solve a
simple equation. This helps ensure
you are paying attention, and also
amuses JesusFreke and myself.

Solve for a:

a/24=70

Please type a whole number as your answer:
 
  • Like
Reactions: 640k

Top Liked Posts

  • There are no posts matching your filters.
  • 29
    Script removed/Effort "canceled" (see release notes)!







    Dear fellow XDA'ers, i have written a quick and simple script to tie in all of the great work done by jcase and beaups that helps you root your Moto X. This script simply follows the instructions written by jcase and beaups and automates those scripts with a simple menu.

    This script should technically work for "any" Moto X on "any" carrier, provided the methods contained within have the same success rate across all carriers. I do not have the capacity, nor experience, to trap for all situations.

    This script ASSUMES that you already have the Motorola drivers installed and your device has successfully connected to your computer via USB Debugging Mode. If you need the drivers, they can be found here.

    Instructions:
    1. Download and extract this script on to your Windows Desktop.
    2. Download ALL of the following to the same folder as the GO!.CMD ("640k's Moto X Root Script" Folder). These files should NOT be unzipped:
      • your specific 4.2.2 factory image.and/or 4.4 factory images (if you are on 4.4, you will need BOTH images).
      • jcase's RockMyMoto (4.2.2) and SlapMyMoto (4.4).
      • beaups' MotoWpNoMo.
      • Saurik's Cydia Impactor
    3. Execute Go!.CMD and follow the on-screen prompts.

    Links:

    Disclaimers:

    1. I make no warranties of any kind regarding the accuracy or efficiency of this script or the processes contained within. This script was tested on a single device and was written based off of the instructions provided within these forums. You can perform these steps yourself!
    2. jcase will NOT support the use of this script. Should you run in to issues with any of the functionality/procedures written specifically by jcase, you will not be supported by jcase unless you are following his methods.
    3. beaups will NOT support the use of this script. Should you run in to issues with any of the functionality/procedures written specifically by beaups, you will not be supported by beaups unless you are following his methods.


    Because I have compiled other's hard work into a command-line script, i have decided to distribute my script uncompiled. That way, in the event of major changes, significant errors, etc., that I don't have time to address, the user community can lend a hand. If you find my work useful, please Thank Me.


    WARNING
    • Make sure your device is fully charged before beginning!
    • Some people have reported an inability to flash their device, have received "unknown errors", weird partition errors and general chaos during the flashing/imaging process. If this happens to you, try a different USB port. I have read threads/seen reports where sometimes USB 3.0 ports cause failures during this process. Change to a USB 2.0 port and try again.
      [*]In general, it is difficult to completely brick your device using this method. As long as you can get to the fastboot menu, your device is recoverable. If your phone will not power on, you did not follow one of the two warnings above.

    TIPS:
    • If "Waiting for device" seems to be taking a really long time (your device is ready, but the script hasn't picked it up yet), try either turning off USB Debugging and then back on, or try removing the USB cable and re-inserting it.
    • If you are on 4.4, looking for root, your device will be re-imaged two times with 4.2.2. Don't input your details until the 2nd time, to avoid having to repeat your effort.
    • Connect to your WiFi before enabling USB Debugging Mode to avoid IP Address errors. The batch script tends to get funny on some of the retries. I've tried working out most of the bugs.
    • I'm confident I haven't worked out 100% of the bugs in this script, although I've tried very hard. I've only tested it with one device, the XT1060. If you have issues, please do not PM me, post them here in the thread.
    • If for some reason the script abnormally ends or you close out of it, without running the cleanup process at the end, ADB will remain present and cause an error in the script, which will cause the script to fail. Browse to the folder with the CMD prompt and type "ADB kill-server" (kill-server is case-sensitive). This will get the script running again.

    Thanks jcase, beaups, saurik and anyone else who has contributed to this effort!

    Changelog:
    • 1/9/2014: Initial Release. Only tested on one device. Better bug management within each step, more options at advanced menu, including ADB Debug Window. Removed auto-upgrade to 4.4. I suspect this is where my woes were.
    • 1/9/2014: Removed ADMINISTRATOR requirement. I don't think this will do any harm, but it was creating conflicts with Windows 8.
    • 1/9/2014: Changed TELNET conditions to trap for user interaction.
    • 1/14/2014: Adjusted initial TELNET session.
    • 1/14/2014: Corrected a type on line 366 (would have given an error).
    • 1/15/2014: Re-worked TELNET routine again.
    • 1/16/2014: Simplified menu options, included automated checking for write protection. This check will skip steps once WP has already been turned off.
    • 1/16/2014: Included additional instruction, including more messaging and better message waiting.
    • 1/16/2014: Added additional messaging for troubleshooting purposes.
    • 1/16/2014: Corrected a bug related to BATCH language that was ending the TELNET steps.
    • 1/17/2014: Made another adjustment to TELNET handling.
    • 1/17/2014: Added additional error checking.
    • 1/17/2014: Added some wait time on the second TELNET phase.
    • 2/28/2014: Canceled script effort (ran out of time). With 4.4.2 released, none of the current root methods are valid or work.

    BEFORE YOU START WITH ANY METHOD THAT REQUIRES YOU TO WIPE YOUR DEVICE, MAKE SURE YOUR DEVICE IS 100% FULLY CHARGED!! IF YOUR DEVICE SHUTS DOWN WHILE THE SYSTEM IS FLASHING YOU WILL BRICK YOUR DEVICE!!!
    5
    Just curious to approximate numbers on people who have used this with success.
    Oh and you should put up a donate button 640. I know that you are using work from other people, but you give them all the credit for what they have done. I'm an adb noob, and I have been waiting for a relatively simple one click solution for root since I took the camera update.

    Thanks for the thought, but this exercise was really proof of concept for me. If I can make a few people happy, I hope they just hit the thanks button. All of these steps, anyone can do without the script. I don't want to step on the toes of the people who did the actual work. In the future, should one of these devs make a change or need help with a script, I hope that they reach out to me because of my success history.
    3
    Just curious to approximate numbers on people who have used this with success.
    Oh and you should put up a donate button 640. I know that you are using work from other people, but you give them all the credit for what they have done. I'm an adb noob, and I have been waiting for a relatively simple one click solution for root since I took the camera update.
    2
    Ok. Here's the deal. There's going to be some manual work for you.

    1. Close out of the script.
    2. Open a CMD window and change to the directory this script is located.
    3. Type the command, "ADB kill-server", hit enter, and do it again.
    4. Download the new script and either start over, or use the advanced menu to go through each step.

    Thanks for your help and patience!! I'm going to be taking off for the day. Your phone is currently usable, just not rooted. If you want to stop and pick up tomorrow, that's cool. I'll try to hop on the forums later to check in. This is the only pesky little bug I hadn't been able to tackle. I think I've got it, however, so please try again. Starting over won't hurt anything, just take extra time. But I recommend it just so we can run the script from end-to-end.

    THANKS AGAIN!
    2
    Thank you! That clears things up. I'll give this a try later and let you know how it went

    based on my testing, unless something goes completely wrong, it should be pretty hard to completely bork your phone. if you get into a bootloop, the advanced menu can help you restore your system files as long as you can get in to the bootloader (usually you can).