[Motorola One Guides, News, & Discussion] likeyea:
Hi. I've noticed that after this last time I did a stock factory reflash using fastboot, every time I try to install LOS to the phone, Three google apps are left behind on the home screen. So did a factory recovery again, with the motorola recovery assistant. The apps were still there.

each time, booted TWRP, formatted data, then reboot into TWRP, then clear dalvik, system, data before trying to install LOS. The gapps fragments still showed up. What is known is that the play store and play services are not left behind, only the apps themselves remain., so they don't actually work, they just complain that play services is not present and exit.

Searched around on the internet but didn't really see a solution. so I came up with my own. I'm posting it here to get some feedback, and to maybe see if someone has a better way, because just flashing the stock rom was not solving this problem.

All steps in this walk through were done with adb fastboot and TWRP recovery.

##Make sure

both

of the above tools AND the USB drivers

definitely work

on your PC and device before doing this, you will be

intentionally

bricking your phone! I am

not

responsible for your device if you try this!##

Stuff you need:

a) The blankflash .zip from this guide: https://xdaforums.com/motorola-one/development/blankflash-motorola-one-t4097391

b) The factory rom .zip for the baseband version currently running on your deen from lolinet.

c) The 8.1.0 rom .zip for your deen from lolinet.

d) LineageOS or other non-gapps rom of your choice. I used the one from this guide: https://xdaforums.com/motorola-one/development/rom-lineage-17-1-motorola-one-t4131339

All Motorola One firmwares are here: https://mirrors.lolinet.com/firmware/moto/deen/official/

DO NOT UNPLUG THE PHONE WHILE DOING THIS. I don't know what will happen if you do.

Steps I did:

0) Unzip both of the roms and the blankflash into their own folders on the PC. Put LOS on your sdcard.

1) Reflash phone to factory stock. Do the initial set up and activate usb debugging in developer tools.

2) Reboot the phone into bootloader mode.

3) Flash the 8.1.0 rom. The phone will brick. It should brick to the blinking LED, but if it just bricks with no LED the PC should still pick it up and initialize the blankflash driver, as long as the usb drivers were installed correctly.

4) Flash the blankflash to get it back into bootloader.

5) Use these commands to flash only the BL, baseband, modem and stub partition from the factory stock flash .zip you downloaded from step b) above to your phone:

fastboot getvar max-sparse-size
fastboot oem fb_mode_set

fastboot flash partition gpt.bin
fastboot flash bootloader bootloader.img

fastboot flash modem_a NON-HLOS.bin
fastboot flash modem_b NON-HLOS.bin
fastboot flash fsg_a fsg.mbn
fastboot flash fsg_b fsg.mbn
fastboot erase modemst1
fastboot erase modemst2
fastboot flash dsp_a adspso.bin
fastboot flash dsp_b adspso.bin

fastboot flash boot_a boot.img
fastboot flash boot_b boot.img
fastboot flash system_a system_other.img
fastboot flash system_b system_other.img

fastboot oem fb_mode_clear
fastboot set_active b
fastboot reboot bootloader

6) boot into TWRP, wipe/format data. Type yes to confirm.

7) Reboot to bootloader

8) Boot to TWRP again

8) Wipe/advance wipe/system-data-dalvik ONLY

9) Install LOS from your sd card.

10) After LOS install, boot to bootloader

11) Getvar all, if active slot is not a, set it to a

12) Boot LOS.

Thoughts? Is there a better way to do this??

(edited to clarify the steps)