Table of Contents

Information

xda-developers

Latest platform-tools

Linux

Windows

Factory Image

Filesystem Maintenance

Notes

Quick-commands

ext4

Encrypted

adb shell "umount '/sdcard' && umount '/cache' && umount '/data' && e2fsck -y -f -v '/dev/block/mmcblk0p41' && e2fsck -y -f -v '/dev/block/mmcblk0p26' && e2fsck -y -f -v '/dev/block/mmcblk0p21' && e2fsck -y -f -v '/dev/block/mmcblk0p1' && e2fsck -y -f -v '/dev/block/dm-0' && e2fsck -y -f -v '/dev/block/mmcblk0p38' && mount '/system' && mount '/data' && mount '/cache' && mount '/firmware' && rm -Rf '/data/dalvik-cache' && fstrim -v '/system' && fstrim -v '/data' && fstrim -v '/cache' && fstrim -v '/firmware' && sync && umount '/system' && umount '/data' && umount '/cache' && umount '/firmware' && reboot"

Unencrypted

adb shell "umount '/data' && umount '/cache' && umount '/sdcard' && e2fsck -y -f -v '/dev/block/mmcblk0p41' && e2fsck -y -f -v '/dev/block/mmcblk0p26' && e2fsck -y -f -v '/dev/block/mmcblk0p21' && e2fsck -y -f -v '/dev/block/mmcblk0p1' && e2fsck -y -f -v '/dev/block/mmcblk0p42' && e2fsck -y -f -v '/dev/block/mmcblk0p38' && mount '/system' && mount '/data' && mount '/cache' && mount '/firmware' && rm -Rf '/data/dalvik-cache' && fstrim -v '/system' && fstrim -v '/data' && fstrim -v '/cache' && fstrim -v '/firmware' && sync && umount '/system' && umount '/data' && umount '/cache' && umount '/firmware' && reboot"

Information

Unmount Partitions

umount '/system'
umount '/cache'
umount '/data'
umount '/sdcard'
umount '/firmware'

AIO

umount '/system' '/cache' '/data' '/sdcard' '/firmware'

ext4 Filesystem Maintenance

e2fsck -y -f -v '/dev/block/mmcblk0p41'
e2fsck -y -f -v '/dev/block/mmcblk0p38'
e2fsck -y -f -v '/dev/block/mmcblk0p42'
e2fsck -y -f -v '/dev/block/mmcblk0p1'

Mount Partitions

mount '/system'
mount '/data'
mount '/cache'
mount '/firmware'

AIO

mount -a

Clear Dalvik/ART Cache

adb shell
mount '/data'
rm -Rf '/data/dalvik-cache'

fstrim

adb shell
mount '/system' && mount '/firmware'
fstrim -v '/system' && fstrim -v '/data' && fstrim -v '/cache' && fstrim -v '/firmware' && sync

Quick-command

adb shell "mount -a || fstrim -v '/system' && fstrim -v '/data' && fstrim -v '/cache' && fstrim -v '/firmware' && sync"

Erase Everything

sudo fastboot erase 'all'

Flash Base

sudo fastboot flash 'bootloader' ~/'Downloads/shamu-'*'/bootloader-shamu-moto-'*'.img' && sudo fastboot reboot-bootloader && sleep 5 && sudo fastboot flash 'radio' ~/'Downloads/shamu-'*'/radio-shamu-'*'.img' && sudo fastboot reboot-bootloader

Ideal Stack

microG

Flash Order

F2FS TWRP

LineageOS for easy microG + UnifiedNlp

FrancoKernel

Settings

Script

nano ~/'Downloads/99-kernel.sh' && adb push ~/'Downloads/99-kernel.sh' '/storage/emulated/0' && rm ~/'Downloads/99-kernel.sh' && sync
#!/system/bin/sh

# I/O Scheduler (noop)
echo noop > /sys/block/mmcblk0/queue/scheduler
echo noop > /sys/block/mmcblk0rpmb/queue/scheduler

# fsync (disabled)
echo N > /sys/module/sync/parameters/fsync_enabled

# Vibration Intensity (75)
echo 75 > /sys/drv2605/rtp_strength

# Display Profile (obsanity_standard)
echo 245 245 256 > /sys/devices/platform/kcal_ctrl.0/kcal
echo 273 > /sys/devices/platform/kcal_ctrl.0/kcal_sat
echo 255 > /sys/devices/platform/kcal_ctrl.0/kcal_val
echo 255 > /sys/devices/platform/kcal_ctrl.0/kcal_cont
echo 0 > /sys/devices/platform/kcal_ctrl.0/kcal_hue

Install Script

adb shell
su
mv '/storage/emulated/0/99-kernel.sh' '/magisk/.core/service.d/99-kernel.sh' && chown 'root':'root' '/magisk/.core/service.d/99-kernel.sh' && chmod '755' '/magisk/.core/service.d/99-kernel.sh' && sync

Check Settings

I/O Schedulers

cat '/sys/block/mmcblk0/queue/scheduler' '/sys/block/mmcblk0rpmb/queue/scheduler'
fsync

cat '/sys/module/sync/parameters/fsync_enabled'
Vibration Strength

cat '/sys/drv2605/rtp_strength'
Display Profile

cat '/sys/devices/platform/kcal_ctrl.0/kcal' '/sys/devices/platform/kcal_ctrl.0/kcal_sat' '/sys/devices/platform/kcal_ctrl.0/kcal_val' '/sys/devices/platform/kcal_ctrl.0/kcal_cont' '/sys/devices/platform/kcal_ctrl.0/kcal_hue'

Magisk

F-Droid

Install

wget -O ~/'Downloads/FDroid.apk' 'https://f-droid.org/FDroid.apk' && adb install ~/'Downloads/FDroid.apk' && adb shell 'sync' && rm -f ~/'Downloads/FDroid.apk' && sync

microG Repo

adb shell input text "microg.org/fdroid/repo"
adb shell input text "9BD06727E62796C0130EB6DAB39B73157451582CBD138E86C468ACC395D14165"

Apps

APK Restore

nano 'apk.sh' && chmod +x 'apk.sh'
#!/bin/sh
for file in *.apk
do
  adb install $file
done
./'apk.sh'

F-Droid

Core

Extras

Yalp Store

Disable

adb shell
su
pm disable 'com.android.email'
pm disable 'com.google.android.apps.gcs'
pm disable 'org.lineageos.jelly'
pm disable 'com.cyanogenmod.eleven'
pm disable 'com.google.android.apps.tycho'
pm disable 'org.lineageos.updater'

LocalGsmNlpBackend

FastLacellsGenerator

Dependencies

sudo dnf install 'sqlite' && sync

Download

wget -O ~/'Downloads/FastLacellsGenerator-master.zip' 'https://github.com/sobrus/FastLacellsGenerator/archive/master.zip' && unzip ~/'Downloads/FastLacellsGenerator-master.zip' -d ~/'Downloads'

Config

nano ~/'Downloads/FastLacellsGenerator-master/config'
MCC="310|311|312|313|316"
TOKEN="x"

Download and Generate Map Data

cd ~/'Downloads/FastLacellsGenerator-master' && ~/'Downloads/FastLacellsGenerator-master/flg'

Push Map Data

adb push ~/'Downloads/FastLacellsGenerator-master/lacells.db' '/storage/emulated/0/LocalGSMBackend/lacells.db.new'

Cleanup

rm -Rf ~/'Downloads/FastLacellsGenerator-master.zip' ~/'Downloads/FastLacellsGenerator-master' && sync

External database location

/storage/emulated/0/LocalGSMBackend
adb shell input text "/storage/emulated/0/LocalGSMBackend"

Legacy

Flash Order

F2FS TWRP

LineageOS

FrancoKernel

Magisk

Modules

Unified Hosts Adblock

hosts

The Open GApps Project

gapps-config.txt

# No Debug logs
# https://github.com/opengapps/opengapps/wiki/Advanced-Features-and-Options#debug-logs

#NoDebug

# Smart Pre-ODEXing of APKs
# https://github.com/opengapps/opengapps/wiki/Advanced-Features-and-Options#skip-smart-pre-odexing-of-apks

PreODEX

# Exclude GApps
# https://github.com/opengapps/opengapps/wiki/Advanced-Features-and-Options#include-or-exclude-gapps
# Expects Nano package

DialerFramework
CalSync
GoogleTTS
PackageInstallerGoogle
BatteryUsage
FaceDetect
FaceUnlock
Speech

# Remove Stock apps
# https://github.com/opengapps/opengapps/wiki/Advanced-Features-and-Options#remove-stock-apps
# Expects LineageOS

(Eleven)
(Email)
(Jelly)

App Disable

adb shell
su
pm disable 'com.google.android.syncadapters.calendar'
pm disable 'com.google.android.syncadapters.contacts'
pm disable 'com.android.email'
pm disable 'org.lineageos.jelly'
pm disable 'com.cyanogenmod.eleven'

Other Information

Display

DPI

wm density '493'
wm density '240'
wm density reset

Resolution

wm size 2160x3840
wm size 1080x1920
wm size 540x960
wm size reset
1)
can use flash-base.sh from the latest Factory Image
3)
if using microG, GCS will crash after reboots frequently; disabling it doesn't seem to break anything
4)
only useful for Android Wear
5)
Ingress UI starts to overlap any lower than this