[Moto G4 Plus Guides, News, & Discussion] jer194:
Notes:

Recovery: TWRP

64 bit ROMs seem to require a special recovery version for flashing

(maybe due to a brotli compressed system file 'system.new.dat.br'?).

The TWRP one provided by DreamStar/Nikit in his

[DEV][WIP][HOW TO] 64-Bit ( ROMs + Kernel + TWRP ) thread works.

I'm using twrp-3-2-1 by tywinlannister7.

Boot TWRP without installation (just to try):

fastboot boot twrp.img

Automated current builds (for any device) might be retrieved from TWRP builder.

There is a TWRP build guide.

TWRP device tree generator might be helpful for builders ...

DBP (Dual Boot Patcher)

I'm using DualBootPatcher (DBP) (Open Source) to check all those ROMs, while leaving my main ROM (LineageOS 14.1 for microG) untouched.

Before flashing, I wipe System, Cache, Data, Dalvik cache in the corresponding DBP data slot.

Only ROM is being flashed (no SuperSU or Magisk, also no Google Apps).

DBP Guide

Some ROMs check for the right device in updater-script, which somehow doesn't work for DBP (indicated by 'mod'):

> head -13 META-INF/com/google/android/updater-script

assert(getprop("ro.product.device") == "athene" || getprop("ro.build.product") == "athene" ||
getprop("ro.product.device") == "athene_f" || getprop("ro.build.product") == "athene_f" ||
getprop("ro.product.device") == "xt1621" || getprop("ro.build.product") == "xt1621" ||
getprop("ro.product.device") == "xt1622" || getprop("ro.build.product") == "xt1622" ||
getprop("ro.product.device") == "xt1625" || getprop("ro.build.product") == "xt1625" ||
getprop("ro.product.device") == "xt1626" || getprop("ro.build.product") == "xt1626" ||
getprop("ro.product.device") == "xt1640" || getprop("ro.build.product") == "xt1640" ||
getprop("ro.product.device") == "xt1641" || getprop("ro.build.product") == "xt1641" ||
getprop("ro.product.device") == "xt1642" || getprop("ro.build.product") == "xt1642" ||
getprop("ro.product.device") == "xt1643" || getprop("ro.build.product") == "xt1643" ||
getprop("ro.product.device") == "xt1644" || getprop("ro.build.product") == "xt1644" || abort("E3004: This package is for device: athene,athene_f,xt1621,xt1622,xt1625,xt1626,xt1640,xt1641,xt1642,xt1643,xt1644; this device is " + getprop("ro.product.device") + "."););

Solution:

- Unzip ROM

- Modify 'META-INF/com/google/android/updater-script' (remove those lines)

- Zip ROM

- Flash modified ROM

Some ROMs can't be booted in DBP using their native kernel, see here for an explanation.

Possible workaround.

Usually, frostbite-11 RAMdisk combined with original kernel from ROM works.

GPS (and sensors): (images 1,2,3)

I'm using SatStat (Open Source) to check whether GPS (and Sensors, and Wifi, and networks) work.

'-' (dash) in 'Satellites' (first image) means: GPS does NOT work at all.

Only after 180203 GPS started to work on 64 bit ROMs.

In general, GPS works impressively well in OREO ROMs: quick fix; sensitive; works sometimes even in buildings; accurate ..

Links for SBAS: Wikipedia / EGNOS / post 140 / Snapdragon 617 / Support for Galileo

Camera:

I'm using OpenCamera (Open Source) to check whether taking images and videos (and audio) work.

All tested ROMs (except crDroid) support OpenCamera, as long as not using Camera2 API.

Some of the ROMs require 'Storage Access Framework' enabled in order to be able to store pictures and videos.

(maybe because I don't install SuperSU or Magisk).

In some (all?) ROMs flash is not in synch, leading to wrongly exposed pictures.

180722: flash works in Cameringo (if rooted)

Camera2 API can be switched on in 'settings' of OpenCamera.

It is supposed to be more advanced.

In particular it allows to take raw images.

180104: Camera2 API is still buggy in all of the tested ROMs (both arm and arm64).

- Every 2nd image is green.

- Frequently: 'Failed to connect to camera'

- Taking images in 'raw' mode is unreliable.

Camera flash sync problem

Flash is not synched to exposure, in recent (64 bit?) ROMs, therefore most pictures are wrongly exposed.

Alternative camera apps

I have read about Camerlingo, Footej, .. 'working'.

According to my tests, they have similar problems like OpenCamera.

FM:

In AOSiP 191213, add this to /system/etc/fm/fm_srch_af_th.conf:

[BANDCONFIG]
RadioBand=2

After reboot you can then tune between 76.0 and 108.0 (Reference).

Tips & tricks:

Take logs ([MENTION]DizzyBinary[/MENTION])

/sys/fs/pstore/ --- console ramoops (random reboot)

/data/tombstones --- app crashes

/data/system/dropbox/ --- general

logcat --- everything

XDA: How to get & read a logcat/ Troubleshoot your own issues! ('tools/monitor' in particular)

Bootloop, caused by setupwizard

In TWRP, do this:

echo "ro.setupwizard.mode=DISABLED" >> /system/build.prop

/system needs to be mounted r/w first.

Ref: This post by [MENTION=6813266]corlatemanuel[/MENTION]

(it did not work for me though)

Enable VoLTE ("Voice over LTE"):

This might help (as proposed here, by [MENTION=5473651]golden-guy[/MENTION]):

persist.dbg.volte_avail_ovr=1
persist.dbg.vt_avail_ovr=1
persist.dbg.wfc_avail_ovr=1

"Put it into /data/local.prop and it will survive OTA updates."

SELinux status switch

adb root
adb shell
setenforce 0 # set permissive or moderate
setenforce 1 # set enforcing
getenforce # show SElinux status

Mitigate 'Screen Burn'

As root (ref)

# echo '220 220 220' > /sys/devices/platform/kcal_ctrl.0/kcal

Retrieve boot image

dd if=/dev/block/bootdevice/by-name/boot of=boot.img

64 bit ROMs:

Indication for a 64 bit ROM: there is a /system/lib64 folder; or:

# uname -m -> aarch64

64 bit ROMs are memory hungry (~1.5 GB taken for system).

Lagging is being reported, in particular for 2GB systems. Disabling both Live Display and Night Light seems to reduce the lags.

@kur0g4ne

@____mdd

@sgspluss

Signature Spoofing / microG:

How to get the signature spoofing patch

MicroG installation instructions by [MENTION=8003791]Trademark97[/MENTION].

Boot scripts:

If using Magisk for rooting, scripts to be run at boot can be put here: /data/adb/service.d/

Examples:

- mount oem

- /sdext -> (link to external sdcard)

ADB reminders:

- getprop

- dumpsys

Attachments