[Moto G 2015 Android Development] MSe1969:
Hi,

this thread aims at keeping the LineageOS 13.0 version alive for the Moto G 2015 (osprey) device with current security patches from LineageOS (branch 'cm-13.0'). The build here has already a history in this thread on XDA - it may be worth to scroll through it to find additional information.

The build has got the following features:

LineageOS 13 with current security patches

Patched for microG (see https://microg.org, signature spoofing as switchable permission)

Squid kernel for the Osprey device (own fork)

LineageOS Jelly Browser

Current Android System Webview

CMUpdater is not part of this build

Renewed CA-certificates from AOSP master branch

VoLTE (may not work in all cases!)

Current build data

Download here

AOSP tag android-6.0.1_r81

Security string 2018-06-01

Android System Webview on M66 (stable, taken from LineageOS 14.1)

Contains the fix for the KRACK attack against WPA2

Root access included (can be switched on/off in developer settings)

Unofficial microG-build as 2nd build variant

Download here

Hardened build with pre-installed microG apps. For more information, see https://lineage.microg.org/

(This is an unofficial build for LineageOS 13 f. osprey based on the work described on the project page)

Different from the 1st build, the following features apply, everything else is the same:

No root available (can be flashed separately)

Pre-installed microG apps (see lineage.microg.org page)

SQLite 'secure delete' feature enabled

Access to /proc/net blocked for user apps

Enhanced Privacy Guard (1): Switches for motion sensors and other sensors available

Enhanced Privacy Guard (2): Switches for read phone state and storage (read/write) available

Oreo backport: SET_TIME_ZONE permission restricted to system apps

Oreo backport: Access to timers in /proc restricted

Cloudflare DNS (1.1.1.1) as default fallback

Privacy-preferring default settings

Source Code links

LineageOS: https://github.com/LineageOS

Kernel: https://github.com/MSe1969/android_kernel_motorola_msm8916/tree/mse_cm13

microG patch: https://github.com/microg/android_p...aster/patches/android_frameworks_base-M.patch

microG-Build: https://github.com/lineageos4microg

local manifest: https://github.com/cm13-microG/local_manifests

hardening features: see reserved post further below

Installation instructions

YOU ARE RESPONSIBLE SOLELY YOURSELF FOR ANY ACTIONS YOU DO WITH YOUR DEVICE !!!

Please note - I won't explain any single aspect (e.g. how to install 'fastboot' on your PC or troubleshoot USB connectivity issues under Windows). Search the net and consult the search engine of your choice or look here in XDA, there is plenty information available.

Pre-Requisites

Get familiar with the hardware keys of the Motorola Moto G 2015 (osprey) device, especially how to enter fastboot mode (switch phone off hold power + volume down together for about 3 seconds) and recovery mode (in fastboot mode, switch with volume key to the reboot recovery option and select with power key)

Have fastboot and adb installed on your PC and make sure, you can connect via USB to your device in fastboot mode and via adb

Download the most current .ZIP file of this ROM and place it to your phone's internal memory or SD card

If you wish to install Google apps (GApps), please refer to the GApps section further below

An unlocked bootloader (read the warnings carefully and backup your data!

Install TWRP recovery

If you come from stock ROM and have just unlocked your boot loader, this is the next thing to do. If you have already a working custom recovery on your device, there is no necessity to replace it.

However - I recommend to use the TWRP recovery linked here. The following instructions are based on TWRP.

To install TWRP, download the TWRP.img file (Note: replace "TWRP.img" in the following instructions with the real file name) from this section to your PC, get it into 'fastboot mode', connect the device via USB to your PC and enter the following command on your PC:

fastboot flash recovery TWRP.img

Afterwards, directly boot into 'recovery mode' (see above) - I recommend not to boot the phone's Android system after having flashed TWRP. Once TWRP has been launched, you may decide to reboot your phone and install the ROM at any time later. But the first boot after flashing TWRP should be TWRP in recovery mode.

Advanced Wipe

ONLY perform the steps described here, if you come from Stock ROM or a different Custom ROM!

Boot into recovery mode. In TWRP, choose "Wipe", "Advanced" and spefify "Dalvik", "System", "Cache" and "Data" to be wiped.

Make sure NOT to wipe "Internal memory" or "SD Card". Swipe to confirm the deletion and get back into the main menu.

GApps

The following instructions only apply for the 1st variant, do not flash Gapps over the "microG build":

You do not need to install GApps, but you may wish to do so. In that case, download GApps from here and put the .ZIP also to the SD card or Internal memory of your device.

Choose ARM as platform, Android 6.0 and the flavor of your choice. I recommend "pico", as this leaves you the most freedom to only install, what you really need; you can later still install all the Google products you want and do not need to live with pre-installed Google applications you have no use for. The 'microG patch' in this ROM has no negative impact on installing Gapps.

Install the ROM

In the TWRP main menu, choose "Install". A file manager appears to let you navigate to your internal memory (path /sdcard) or your SD card (path /external_sd).

Choose the .ZIP file of this ROM and swipe to flash. If you update from a previous version of this ROM, you don't need to perform a wipe.

If you had GApps already installed before the update, there is no need to flash them again. They will be automatically restored during the flash process.

(Note: If you wish to get rid of GApps, navigate to TWRP's file manager in the Advanced section of the main menu, go to path /system/addon.d and delete the file 70-gapps.sh, before flashing the ROM update)

If you come from a different ROM (or stock firmware), make sure that you have performed the Wipe steps above.

If you wish to install GApps, select the respective .ZIP file directly afterwards, do not boot into Android before having flashed GApps. When finished flashing, return to the main menu, choose "Reboot" and then "System", which will cause your phone to boot into Lineage OS 13.0 - be patient, the first boot after flashing a new ROM takes quite long!

microG Installation

These instructions apply to the 1st 'default' variant, not the 'microG build' (which has already microG installed)

The ROM is patched for the use of microG, but it does not contain the microG system components.

The best way to obtain them is to include the microG repository into the F-Droid store as described on the microG Download page, where you will also find links for the direct download of the .apk files.

Please refer to the official installation instructions. However, there are three pieces of information, which are explained on the microG pages, but unfortunately not directly in the installation instructions, so I would like to point them out here:

Download the 'unstable' Gms Core version 0.2.4-105-... to avoid "outdated play services" warnings

The Location Provider functionality is included in Gms Core, but also available as separate application. I recommend Gms Core - however, the explanation is not included in Gms Core, but only here

To grant the signature spoofing permission, go to Settings - Apps - Advanced (the 'gear' icon) - App Permissions - Spoof package signature; it is not possible when you enter the individual app's permissions menu

Credits

Android Open Source project (AOSP)

LineageOS project

squid2 (Kernel)

microG project

XDA:DevDB Information

Osprey LineageOS 13 with microG patch, ROM for the Moto G 2015

Contributors

MSe1969

Source Code: https://github.com/cm13-microG/local_manifests

ROM OS Version: 6.0.x Marshmallow

ROM Kernel: Linux 3.10.x

Based On: LineageOS

Version Information

Status: Testing

Created 2017-10-23

Last Updated 2018-07-24