Motorola Moto G8 Power

From Free Knowledge Base- The DUCK Project: information for everyone
Jump to: navigation, search

The codename of the Moto G8 Power is “sofiar.” The common model is XT2041-1. There is a model XT-2041-3 also. Motorola maintains two different sets of firmware packages for the Motorola Moto G Power (code-name “sofia”) and the Moto G8 Power (code-name “sofiar”)

The Moto G8 Power device operates on Android 10. It utilizes an octa-core Qualcomm Snapdragon 665 SoC, 4GB RAM, 64GB of onboard memory that can be expanded. It comes with an IPS LCD with Full-HD+ 1080×2280 pixels resolution with a pixel density of 400 PPI. There are three rear cameras of 48MP primary + a 16MP secondary + a 5MP tertiary lens that features PDAF, HDR, Panorama, AI Portrait mode, and an LED flashlight. It has a 25MP front facing camera and 5,000mAh battery which is said to power the phone up to 2 days with exclusive fast charging support.

The rear mounted fingerprint scanner, an ambient light sensor, an accelerometer, proximity, and a compass sensor add to the feature list. The connectivity choices include a 3.5mm audio jack, Wi-Fi, Bluetooth, GPS, A-GPS, FM Radio, USB Type-C port, and Dual 4G VoLTE.

Root

There are (2) different levels of 'root' for this device as well as many other modern Android phones. Of the two methods, the easiest if the soft root method otherwise known as the Systemless root method. Although it offers slightly less control, it is easier to implement and maintain. Here we cover the soft root method.

The bootloader is a little bit of code that tells your device's operating system how to boot up. Motorola has done the work to make sure your device has a fully optimized, certified and tested version of Android. If you are a developer, unlocking the bootloader will allow you to customize your device. See: https://motorola-global-portal.custhelp.com/app/standalone/bootloader/unlock-your-device-a/action/auth

The Moto G8 Power requires the acquisition of a special unlock code you can obtain directly from Motorola company (as of 2020). This is a simple process request requiring you register with an email address and provide a special data-string from your phone. Motorola quickly responds via an automated process by providing you the unlock code to your email address.

The root process is in multiple parts. Part 1 ends with you having to request a special Unlock Key from Motorola Company. This will delay you as you cannot start Part 2 until you have received said unlock key. Fortunately, the process is automated and the reply email with your unlock code arrives within minutes, maybe less.

Magisk is an android app using a system-less root process that doesn’t tamper the system partitions while enabling root access. Magisk can also reserve online security devices to work apps properly, like any banking app, SafetyNet, etc.

Part 1: Set up communication between device and PC, query device, and request Unlock Key from Motorola for G8

  1. Open Settings on your phone and go to About Phone. Tap 7 times on Build Number to enable Developer Options.
  2. Now go to Settings > System -> Advanced -> Developer Options and enable OEM Unlocking and enable USB debugging
  3. Reboot phone
  4. Connect USB data cable from phone to PC.
  5. From PC linux command line type 'lsusb' and verify that the phone device is connected
  6. From PC linux command line type 'adb devices' and verify device is listed. If not, go below to section on how to add device to adb
  7. Wait for Android phone to prompt with the question "Allow USB debugging from this computer?" Tap YES, Always
  8. From PC linux command line type 'adb devices' and verify device is not still 'unauthorized' (see section on 'List of devices attached Unauthorized'
  9. Turn off your phone. Then press & hold Volume Down + Power button together.
  10. When the Fastboot screen appears, release both buttons. Once the phone boot into Fastboot mode, connect Moto G8 Power to Computer.
  11. Run 'fastboot oem get_unlock_data' - Even though 'adb devices' will NOT show the device, you can now run 'fastboot oem get_unlock_data' on the linux console to get the unlock data.
  12. Request your UNLOCK KEY from Motorola, see section below 'Request Unlock Key from Motorola'
  • (Step 2 Expanded): Phone has to be connected to a network, wifi is sufficient, to enable OEM Ublocking

Part 2: Use Motorola email code to unlock bootloader

  • Warning! - This will factory reset the phone. Even though you are not yet flashing a firmware, Motorola has their system design to reset the phone when you unlock the bootloader, for some reason.
  1. Check your email to obtain your unlock code from Motorola and power off your phone.
  2. Press & hold Volume Down + Power button together to boot into Fastboot mode again.
  3. Connect the USB cable.
  4. From the Linux console on your PC type 'fastboot devices' and make sure your phone is listed/detected. (if device not listed you cannot continue)
  5. Use the command 'fastboot oem unlock XXXXXXXXXXXXXXXXXXXX' replacing the X's with the digits of your personal unlock code you got from Motorola in that email.
  6. Wait for the message of success '(bootloader) Bootloader is unlocked!' (if unlock fails check digits of code or verify how you requested)
  7. Now your device is unlocked and all set to root.

Part 3:

  1. Download to your PC the Motorola firmware file 'SOFIAR_RETAIL_10_QPES30.79-124-2_subsidy-DEFAULT_regulatory-DEFAULT_CFC.xml.zip' - you can search to find a reliable source (careful of trojans, use trusted source, that's on you). Here is the tricky part, finding one that matches the exact version on your phone. For example, a phone with 'Build number: QPES30.79-124-7' requires the file: 'XT2041-1_SOFIAR_RETBR_10_QPES30.79-124-7_subsidy-DEFAULT_regulatory-DEFAULT_CFC.xml.zip' see Section below on 'Firmware Image Version and Region
  2. Double check that the phone settings in Developer Options that both are still enabled: OEM Unlocking, USB debugging. Most of the time you have to re-enable developer mode like done in Part 1.
  3. On phone Goto Developer Options, then 'Default USB Configuration' and change to 'File Transfer'
  4. On computer copy 'boot.img' and 'stub-release.apk' to your phone storage, path similar to 'mtp://[usb:002,012]/Internal shared storage/Download'
  5. Connect to WiFi and Install Magisk. Allow Magisk to upgrade to full version via WiFi.
  6. Now install Magisk Manager apk on your Moto G8 Power and open it stub-release.apk' (stub-release did not work in our test, used the full debug version)
  7. Use Magisk Manager to patch the image file boot.img from the firmware you downloaded and copied to the phone.
  8. Magisk will produce a boot-patched.img file, it can be difficult to find, if it doesnt appear try to copy it to the DCIM. Ensure it is visible and exists.
  9. Turn off your phone and then boot your Moto G8 Power into Fastboot mode.
  10. With USB cable still connected make sure your phone is listed/detected. From the Linux console on your PC type 'fastboot devices'
  11. From PC linux command line type 'fastboot flash boot boot.img'
  12. After flashing, you can reboot your phone to the system
  13. Use an App like RootCheck to ensure root super user is enabled. example 'Root Check_v4.4.1.0_apkpure.com.apk'

Linux adb and fastboot

Android Debug Bridge, aka ADB, is a tool that helps in sending basic Linux commands and a variety of Android Specific commands from PC to the connected Android devices.

In all, it is a versatile command line tool that allows you to communicate with a device.It is used to manage either an emulator instance or an actual Android device.

It is a part of the Android SDK and is made up of three components: A Client, a Daemon, and a server. It works when the device is powered on and booted into OS or Recovery.

FasttBoot is a tool that makes it possible for you to flash any partition on an Android device like system, recovery, Cache, boot, and other useful tasks.

With the help of this tool, you can flash the custom-built .img files via fastboot. It is a special diagnostic and engineering protocol that you can boot your Android device into.

While in Fastboot, you can modify the file system images from a computer over a USB connection. It also requires software from the Android SDK and different USB Drivers for Windows Computers.

how to add device to adb

Use some commands and make this happen, look at the examples here:

$ lsusb
Bus 002 Device 004: ID 22b8:2e80 Motorola PCS 

That shows the phone is connected and recognized by USB

Install 'adb'

$ apt-get install android-sdk-platform-tools-common

To get adb to see the Android, make sure you have a 'plugdev' group in the /etc/groups

$ sudo vigr

If not, you need to add it

$ sudo groupadd plugdev

Add yourself (your logged in username) to the plugdev

$ sudo vigr

Get device ID

$ lsusb

Then the first part of the 4 digit colon 4 digit number set (the first 4 numbers before the colon) is the ID you need

$ sudo touch /etc/udev/rules.d/51-android.rules

Add this line to the new file

SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", MODE="0666"

Notice that the '22b8' is the device ID from lsusb, replace that with your actual device ID

$ sudo chmod a+r /etc/udev/rules.d/51-android.rules
$ sudo service udev restart
$ adb devices 
List of devices attached 
ZXXXXXXXXX      unauthorized

List of devices attached Unauthorized

The adb devices command will show that the phone device is unauthorized if you have not yet responded to the prompt on the Moto G8 Power phone itself that comes up when the phone is properly connected, USB debugging is active.

On the Moto G8 Power phone Android asks "Allow USB debugging from this computer?" After "YES"

$ adb devices 
List of devices attached 
ZXXXXXXXXX      device

Request Unlock Key from Motorola

You should have received an email with your Unlock Key. Inside the email is a unique 20-character alphanumeric code that you will use to unlock your device. Sometimes it may be difficult to find a firmware to download that is current with what you have on the phone already. This is why it is important to NOT LET THE PHONE update firmware prior to you attempting to root.

To get the unlock data from the phone issue the following command while phone is connected via USB cable

$ fastboot oem get_unlock_data

You will get 5 lines of characters, mostly numbers, and the last line will be all zeros. You have to combine all those lines into one large string of those characters and submit that to Motorola.

Register to motorola, provide that code, then wait for the reply email. Detailed information about the process can be obtained from visiting UNLOCK YOUR BOOTLOADER.

Firmware Image Version and Region

The boot.img is patched, but the rest of the firmware files are not modified. So if you patch a boot.img from a firmware version different from your own installed version, this could brick the phone or cause other issues.

A phone with 'Build number: QPES30.79-124-7' requires the file: 'XT2041-1_SOFIAR_RETBR_10_QPES30.79-124-7_subsidy-DEFAULT_regulatory-DEFAULT_CFC.xml.zip which seems strange as the RETBR suggests "Retail Brazil" and the phone is US Global. Foreign firmware can be an issue if flashing the entire firmware. Since we are only using boot.img we can get away with this as the boot.img is going to be the same, Brazil, Global, or USA. It is the rest of the firmware files that can have differences in features or radio frequencies.

If you buy the phone meant for another market it may already have a foreign firmware. In this case you could download USA or Global and flash the entire firmware rather than just the boot.img.

Keep Root / Root preservation even after OTA Updates

You’ll usually lose your root access when you install an operating system OTA (Over the Air) update. On many devices, having root will prevent OTAs from downloading and flashing. On some devices it will actually download, but you would need a tool like FlashFire to successfully flash it. On other devices, it will not actually download, so you’d have to get the OTA file some other way.

No good answer here. Try to avoid OTA Updates.

Try to use FlashFire to Flash an OTA Update, Without Losing Root. Untested.

TWRP is probably needed to Flash an update over an already patched firmware.

Online Banking Complains the Device is Rooted

You are foolish if you are using an Android phone and app to do online banking. Don't do that. That is your money. These little junk phones are not secure root or not, they are not secure.

Go set up a secure computer and do your online banking.

But how does it (the banking app) or any other complaining app know the phone is rooted? This has to do with "SafetyNet" and the struggle between Magisk Hide and Google.

Google's SafetyNet technology is supposed to be triggered when it notices a rooted device, but MagiskHide does its best to keep applications from being aware that the phone has root. SafetyNet is Google's way to counter the MagiskHide and aggressively root out the rooted status of the phone.

After a March 2020 update to SafetyNet Magisk developer John Wu isn't convinced he'll find a solution that would keep Magisk intact once Google fully implements the change. MagiskHide will continue to conceal root, but it might soon not hide the fact that your bootloader is unlocked anymore, since that's what SafetyNet checks for.

Custom ROM

OmniROM 10

Unofficial OmniROM 10 - Developer vache of XDA made a custom ROM. ROM package must be flashed via Fastboot interface.

SIP-based calling

Motorola / Lenovo has purposely removed SIP support from the native dialer. This is a part of Android that Motorola has removed. Even though you should be able to use the native dialer to make VoIP SIP calls, you cannot because of this decision by Motorola / Lenovo to take away your freedom.

You can use 3rd party SIP dialers.

Zoiper softphone, there are only 6 steps needed to have your device up and running.

Keywords: Android SmartPhone Smart Phone PC