Rooting the Moto G (2014) model XT1072, a success report

in

Switching a smartphone for me was usually a tough choice as I'm not very much into the consumer market and I get bored quickly by endless feature comparisons. ProductChart was helpful with initial narrowing of the choice and the Moto G 2nd generation 4G model from 2014 coded XT1072 was chosen as the preliminary candidate.

Apart from all the typical features smartphones have I was attracted by the fact that the telephone seemed to be relatively developer friendly: you don't have to download any cryptic bootroms or exploits with Chinese readmes to unlock the bootloader, which is the first step to unlocking this Android 5 Lollipop device. Motorola will happily provide you with bootloader unlocking code, assuming you click through all the warnings about voiding your warranty (but be sure to read the Moto G FAQ from XDA to understand what this really means).

Note that there's a few older versions of this phone on the market, including a double SIM model XT1068 that only supports 3G. Rooting process for these older versions seem to be quite well described on XDA forums, which was not really the case with XT1072.

Fortunately, things worked well with XT1072 and I can now describe how exactly I did it, starting with a vanilla phone, just as it arrived in the parcel.

  1. Register with Motorola to obtain the unlock code. The route I took seems to be the easiest:
    • As part of the initial setup log into your Google account on the telephone. Don't get used to it too much, as the telephone will reset all configuration soon!
    • Go to Settings > Motorola ID and bind your Google identity with your telephone in Motorola's database.
    • Go to Motorola Support website and log in with your Google credentials. Your telephone should be already there.
  2. Install the Android tools that you will use to actually root the telephone.
    • Download the Motorola Device Manager which also contains the USB drivers required by the tools to speak to your phone. I tried Mac OS X drivers first, but they didn't work — I ended up doing all that on Windows.
    • Download the Android SDK Platform Tools. I did that by installing the whole Android Studio and only then discovered you might actually only install the standalone packages. What you're really after are two programs from this package: adb and fastboot. The Platform Tools end up installed in C:\users\username\AppData\Local\Android\sdk\platform-tools and this is where you need to open your command line prompt to run them on Windows.
  3. Make your telephone controllable by the computer by enabling the Developer options.
    • In older Androids these were accessible by default, but around version 4 they decided to hide them not to confuse users. Believe me or not, but the way to enable them is to go to Settings > About phone, scroll to the bottom and tap Build number seven (7) times. You will see a pop-up message and the Developer options will now be available in Settings.
    • Now go and enable Developer options > USB debugging.
    • Connect your telephone to the computer with the USB cable. Running the adb device command should return something and you should be now actually available to access the command shell with adb shell (but as unprivileged user).
  4. Unlock your bootloader.
    • On the telephone settings enable Developer options > Enable OEM unlock.
    • On the computer run adb reboot bootloader. This will reboot the telephone and display the bootloader console.
    • Now you need to talk to the telephone with fastboot command First run fastboot oem get_unlock_data. The command should output a long code. Now go to Motorola bootloader unlock page to understand how it needs to be formatted and paste the code there to get the unlock code.
    • After receiving the code run fastboot oem unlock UNLOCK where UNLOCK is the code you received from Motorola.
    • Telephone now reboots and will go through normal initial setup procedure. You'll need to be able to speak to it over adb again so repeat the above steps if necessary.
  5. Install the TWRP rescue image. TWRP is a recovery system for Android that allows you do do much more than just root your device (e.g. create backups) so it's good to have anyway. It will co-exist with the main operating system and you can choose to boot it when necessary through the bootloader.
    • Download the latest TWRP .img file from twrp.me. At the moment of this writing it was twrp-2.8.6.0-titan.img. Things are changing quickly in this world so always get the latest version. From now on you follow the Fastboot Install Method from the TWRP page.
    • Run adb reboot bootloader to restart the telephone into bootloader.
    • With the .img file in the same directory as fastboot command run fastboot flash recovery twrp-2.8.6.0-titan.img. This will upload the image file to the telephone and install it as the recovery image. Now type fastboot reboot.
    • Just as the phone display goes blank hold the power key and volume down pressed. This is a typical "break sequence" on most phones to show the bootloader instead of waiting for the operating system to come up and running adb reboot bootloader. The bootloader menu should show up.
    • Use the volume down key as a down arrow scroll to Recovery and click volume up that works as Enter key. A nice TeamWin logo should come up (the makers of TWRP). Now leave it for a moment and go to your computer.
  6. The final step is to install SuperSU. This is the actual application that enables root access on your device. It's a standard Android application, but if installed in the normal way (like Google Play) it won't give you root access — it has to be installed in the rescue mode with TWRP for the first time.
  7. Download SuperSU and keep it in the adb directory. Do not unpack the ZIP.
  8. In TWRP select Advanced > ADB Sideload. Check both Wipe options. Swipe right: TWRP will be now waiting for you to upload the file.
  9. On the computer run adb sideload UPDATE-SuperSU-v2.46.zip. TWRP will get the ZIP from your computer and install it on the telephone.
  10. Now you can reboot and start the normal system. Your telephone should be rooted and you'll see the SuperSU application installed among others.

Now, the whole purpose of me rooting the telephone was to install the AIMSICD surveillance detector (or was it just a pretext?). I did that through Aptoide store that hosts applications not normally found on Google Play. After installing Aptoide (download the APK and install) go to AIMSICD page and you can Aptoide will do the rest for you.