Moto G4 Flashing

4 Mar 2019

A short post this week, but first a quick update. I'm shifting my ‘normal’ release day to Monday as it’s hard to get nice pictures in natural light during the week during winter, so this gives me time over the weekend to take some. It also gives me some extra time to get stuff written up. Now on with the post.

Back in 2017 I brought a Motorola G4 as an test device and ended up switching over to Android. Last year it was replaced by a Nokia 7+, so it’s been sitting in a drawer doing nothing. I had to dig it out to get a 2FA key from it and wondered if I could do anything useful with it.

Most Motorola phones can be unlocked by going to their website and following the instructions. You use the fastboot tool (from the Android SDK) to get an unlock code, stick that into the website and get emailed a code, after agreeing that this invalidates any waranty you have.

So the next question was what to put on instead. After some searching I came across https://aospextended.com/ which do stripped down builds for quite a few devices, including the Moto G4/G4+ (athene), with a build of Pie (v9).

I'm not going to go into the whole process here, but there’s a few things that wern’t obvious to me in order to make it work.

Trying to just use TWRP will lead to the updater stopping with error 255 near the start. To get around this you need to use a custom version for the G4/G4+: https://forum.xda-developers.com/moto-g4-plus/development/recovery-team-win-recovery-project-t3842903

The Android image I used can be downloaded from: https://downloads.aospextended.com/athene .

If you want access to the Google Play store and other stuff you’ll need a copy of those as well. I got mine from https://opengapps.org/ , just make sure you get the ARM64-9.0 versions. The nano version was enough for me as I don’t want the other standard apps, just the store and the extra APIs.

You stick those zip onto an micro-SD card, flashing TWRP onto the recovery partition (use fastboot flashing unlock first) and booting into it by holding the volume down button when turning the phone on.

Start by doing a wipe of the Dalvik/System/Data/Cache areas, then install the OS and GApps zip, then finish by wiping the Dalvik/Cache again with the option in TWRP before rebooting.

Don’t forget to run fastboot flashing lock afterwards, just in case.

I've now got a Moto G4 running Pie, which runs better then the official OS which was stuck on v7.