[Moto G7 Power Guides, News, & Discussion] happysean28:
This is for a Motorola XT1955-5 Retail US. I wanted chrome and play store to where the user cant get to them, but other apps can still interact with them. This is a quick and dirty guide in case anyone is in same boat

Install drivers for Motorola g7 power.

Install adb and fastboot tools minimal. Do the portable version

Get the stock firmware from lolinet this person is great!

Flash your phone with the latest firmware. Commands are below. Notice we don't erase user data cuz we don't need to. If it doesn't, work, you can rerun and erase data.

Download the magisk manager app and install on phone

Unpack the stock firmware, and copy the boot.img to the phone

In magisk manager, install magisk (not manager). Select download and install, and select the boot.img

Once it creates the magisk_patched.img, copy that to your computer

Boot the phone to bootloader, and from your computer, run fastboot flash boot magisk_patched.img

Boot the phone normally, and go to magisk manager and see magisk is installed.

Now download the twrp temporary recovery image to your machine.

Boot to the bootloader

Now run: fastboot boot twrp-3.3.1-2-ocean.img

Go to mount. Check the box for system

Now to Advanced -> terminal, and run the commands to remove the system apps from the phone

rm -rf /system/system/app/Chrome

rm -rf /system/system/priv-app/Phonesky

Now boot the phone normally. You will see the play store and chrome are gone!

The trick now is to get a version of the app that we can load, but the user cant touch.

Download chrome and play store from apkmirror.com

Install them on the phone

Now download link2sd and install on phone

Use link2sd with root (it should prompt you for magisk root access), and "freeze" the chrome and play store apps

(Pro tip, make sure the latest version of android web view is installed to pair with latest version of chrome. You don't need to freeze web view)

Now get rid of link2sd.

Now you have a phone where people cant use chrome or play store, but other apps that require it will work.

This is mainly useful if you want a person to use the phone but not install apps on it. The only way around this for them would be to reflash the stock boot.img to the boot partition, or manually copy the app from a usb drive. But if you give someone the phone and say "don't install apps on it" and they don't have other devices, this is the way to do it.

Fastboot commands:

fastboot getvar max-sparse-size

fastboot oem fb_mode_set

fastboot flash partition gpt.bin

fastboot flash bootloader bootloader.img

fastboot flash modem NON-HLOS.bin

fastboot flash fsg fsg.mbn

fastboot erase modemst1

fastboot erase modemst2

fastboot flash dsp adspso.bin

fastboot flash logo logo.bin

fastboot flash boot boot.img

fastboot flash dtbo dtbo.img

fastboot flash system system.img_sparsechunk.0

fastboot flash system system.img_sparsechunk.1

fastboot flash system system.img_sparsechunk.2

fastboot flash system system.img_sparsechunk.3

fastboot flash system system.img_sparsechunk.4

fastboot flash system system.img_sparsechunk.5

fastboot flash system system.img_sparsechunk.6

fastboot flash system system.img_sparsechunk.7

fastboot flash system system.img_sparsechunk.8

fastboot flash system system.img_sparsechunk.9

fastboot flash system_b system_b.img_sparsechunk.0

fastboot flash system_b system_b.img_sparsechunk.1

fastboot flash system_b system_b.img_sparsechunk.2

fastboot flash vendor vendor.img_sparsechunk.0

fastboot flash vendor vendor.img_sparsechunk.1

fastboot flash oem oem.img

fastboot flash oem_b oem_other.img

##fastboot erase userdata

fastboot erase DDR

fastboot oem fb_mode_clear