Closed baltpeter closed 1 year ago
I have now bought a lot of four "Moto G7 Power"s. Mostly, because they were very cheap. But they do also fit the criteria set so far (cf. https://wiki.lineageos.org/devices/ocean/). And unlocking the bootloader seems to be officially supported.
The phones have arrived. \o/
Seems like the latest official update they got was for Android 10. I'll set up the latest LineageOS on one of them.
To install LineageOS, I have basically exactly followed the instructions in https://wiki.lineageos.org/devices/ocean/install:
adb reboot bootloader
fastboot devices
to verifyfastboot oem get_unlock_data
(bootloader)
or INFO
and paste into the website. Request unlock key (arrives via email).fastboot oem unlock <unlock key>
(run twice)flashing_unlocked
.wget https://mirrorbits.lineageos.org/recovery/ocean/20230121/lineage-20.0-20230121-recovery-ocean.img
adb reboot bootloader
fastboot devices
to verifyfastboot flash boot lineage-20.0-20230121-recovery-ocean.img
This output is okay, even though it looks like an error:
❯ fastboot flash boot lineage-20.0-20230121-recovery-ocean.img
(bootloader) is-logical:boot_b: not found
Sending 'boot_b' (25026 KB) OKAY [ 0.600s]
Writing 'boot_b' (bootloader) Image not signed or corrupt
OKAY [ 0.134s]
Finished. Total time: 0.915s
wget https://mirrorbits.lineageos.org/tools/copy-partitions-20220613-signed.zip
sha256sum copy-partitions-20220613-signed.zip
should be 92f03b54dc029e9ca2d68858c14b649974838d73fdb006f9a07a503f2eddd2cd
adb sideload copy-partitions-20220613-signed.zip
wget https://mirrorbits.lineageos.org/full/ocean/20230121/lineage-20.0-20230121-nightly-ocean-signed.zip
adb sideload lineage-20.0-20230121-nightly-ocean-signed.zip
Total xfer: 1.00x
, but in some cases, even if the process succeeds the output will stop at 47% and report adb: failed to read command: Success
. In some cases it will report adb: failed to read command: No error or adb: failed to read command: Undefined error: 0
which is also fine."adb sideload MindTheGapps-13.0.0-arm64-20221025_100653.zip
I have also fetched the unlock key for my other phone and documented the keys in https://git.my-server.in/tweasel/android-phones (but not unlocked that one yet).
You should do that too, @zner0L. We don't know how long Motorola will offer that service.
To root the device, I used Magisk (instructions based on https://topjohnwu.github.io/Magisk/install.html, https://docs.benjamin-altpeter.de/systems/android/#install-magisk, and https://wiki.lineageos.org/extracting_blobs_from_zips#extracting-proprietary-blobs-from-payload-based-otas):
vbmeta
partition (check using adb shell "ls -l /dev/block/by-name" | grep vbmeta
).boot.img
payload.bin
from the LineageOS installation file: unzip lineage-20.0-20230121-nightly-ocean-signed.zip payload.bin
git clone https://github.com/LineageOS/scripts && cd scripts
Create a venv and install the dependencies:
python -m venv venv
source venv/bin/activate
pip install protobuf==3.20.3 six
boot.img
: python update-payload-extractor/extract.py ../payload.bin --output_dir ..
boot.img
to the device: cd .. && adb push boot.img /sdcard/Download/
boot.img
from the Downloads folder, and tap "LET'S GO".adb pull /sdcard/Download/magisk_patched-*.img
adb reboot bootloader
fastboot flash boot magisk_patched-*.img
The rest of the setup necessary for appstraction (installing Frida) is documented here: https://github.com/tweaselORG/appstraction/tree/e912362d644505d114eba4663cc82c85637c8f92#physical-android-device
I had a problem reading out the oem data, because the permissions for adb need to be set correctly in udev. For Ubuntu, there is a package (apt-get install android-sdk-platform-tools-common
) that does this, but on Fedora (and other distros) you'll need to follow these instructions: https://github.com/M0Rf30/android-udev-rules
I updated Magisk through the app. That seems to have been a mistake, my root is now broken. (Trying to run su
yields /system/bin/sh: su: inaccessible or not found
).
Things I've tried unsuccessfully, so far:
boot.img
and reflash that.If I start the Magisk app after boot, it always first says that the device is rooted. But if I try to access su
, I get an error. If I then reopen that Magisk app, it says the device isn't rooted.
Next, I'll try updating to the latest LineageOS. From my previous experience, that should then require me to go through the full rooting steps again.
That has worked. I can now su
again.
I'm currently looking into what Android devices we should buy and at the same time also trying to give some recommendations for other people as to which devices are well-suited.
I'm using the LineageOS device list as a first filter for which devices to consider—I don't know whether we're going to use LineageOS for the analysis, but there are just waaay too many choices otherwise and LOS-supported devices provide a great way to continue using the device even if the manufacturer drops support later.
These are the criteria I'm setting:
(Note that these may well change later.)