Guide: howto update stock rom with unlocked bootloader, root, TWRP and keep user data - Moto G7 Plus Guides, News, & Discussion
With unlocked bootloader, and with TWRP and magisk root installed, you currently can't install any of the motorola OTA:s.
Below have been tested on XT1965-3 while on RETEU, PPWS29.98-66 (security updates installed up until 1 january 2019), with TWRP 3.3.0 installed and rooted, to update to latest stock rom PPWS29.98-66-2 (security updates installed up until 1 april 2019), without wiping internal storage and /data (i.e. all files, apps and settings untouched).
I take no responsibility what so ever for using this guide. Below worked for me. Be prepared to lose all your files, hard brick your phone etc.
Get latest official stock firmware, I got it from https://forum.xda-developers.com/showpost.php?p=79653779&postcount=6 , unzip it
Connect your phone to your computer with usb-cable. Put your phone in flash mode (power button+volume down), open your terminal application (below tested on macOS and linux), get root
sudo -s
navigate in terminal to folder where you unzipped the full stock rom
check the below commands visavi the files from your downloaded stock rom (below works for version mentioned above - future updates may contain more or fewer for example sparse files).
fastboot getvar max-sparse-size
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 bluetooth BTFM.bin
fastboot flash dsp dspso.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_b system_b.img_sparsechunk.0
fastboot flash system_b system_b.img_sparsechunk.1
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 carrier
fastboot erase ddr
fastboot flash logo logo.bin
fastboot reboot
Let your phone reboot and pray
After a hopefully successfull boot with everything still intact, then adb fastboot TWRP and from TWRP reinstall your root.
in flash mode once again
fastboot boot twrp-build-version-lake.img
wedgehog said:
With unlocked bootloader, and with TWRP and magisk root installed, you currently can't install any of the motorola OTA:s.
Below have been tested on XT1965-3 while on RETEU, PPWS29.98-66 (security updates installed up until 1 january 2019), with TWRP 3.3.0 installed and rooted, to update to latest stock rom PPWS29.98-66-2 (security updates installed up until 1 april 2019), without wiping internal storage and /data (i.e. all files, apps and settings untouched).
I take no responsibility what so ever for using this guide. Below worked for me. Be prepared to lose all your files, hard brick your phone etc.
Get latest official stock firmware, I got it from https://forum.xda-developers.com/showpost.php?p=79653779&postcount=6 , unzip it
Connect your phone to your computer with usb-cable. Put your phone in flash mode (power button+volume down), open your terminal application (below tested on macOS and linux), get root
sudo -s
navigate in terminal to folder where you unzipped the full stock rom
check the below commands visavi the files from your downloaded stock rom (below works for version mentioned above - future updates may contain more or fewer for example sparse files).
fastboot getvar max-sparse-size
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 bluetooth BTFM.bin
fastboot flash dsp dspso.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_b system_b.img_sparsechunk.0
fastboot flash system_b system_b.img_sparsechunk.1
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 carrier
fastboot erase ddr
fastboot flash logo logo.bin
fastboot reboot
Let your phone reboot and pray
After a hopefully successfull boot with everything still intact, then adb fastboot TWRP and from TWRP reinstall your root.
in flash mode once again
fastboot boot twrp-build-version-lake.img
Click to expand...
Click to collapse
with XT1965-3_LAKE_RETEU_9.0_PPW29.98-111_subsidy-DEFAULT_regulatory-DEFAULT_CFC.xml at least for me dirty flash failed, rom didn't boot
did a backup of /data/ to external storage from TWRP with internal storage decrypted (had to boot TWRP from fastboot a couple of times before the decrypt password prompt were shown on boot of TWRP)
did also a backup of internal storage over MTP with TWRP to computer.
then flashed again with below commands, WHICH WILL ERASE INTERNAL STORAGE
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 bluetooth BTFM.bin
fastboot flash dsp dspso.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_b system_b.img_sparsechunk.0
fastboot flash system_b system_b.img_sparsechunk.1
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 carrier
fastboot erase userdata
fastboot erase ddr
fastboot oem fb_mode_clear
fastboot reboot
Thereafter successfull boot, reboot to flash mode, boot TWRP again, restore internal storage over MTP from TWRP, restore of data from backup to external storage which were made above
all apps and settings back, and on latest moto firmware.
any chance of capturing the delta OTA's to make them twrp-flashable?
Lupask said:
any chance of capturing the delta OTA's to make them twrp-flashable?
Click to expand...
Click to collapse
Would probably be doable as in almost all other devices in general and older motorola devices in particular have had that. I for one do not have the knowledge of how to do that (and not the time available even if I had that knowledge =) )
I can confirm that at least for me, a dirty flash like the one described in post 1 in this thread worked again with the latest OTA/firmware for RETEU - XT1965-3_LAKE_RETEU_9.0_PPWS29.98-111-3_subsidy-DEFAULT_regulatory-DEFAULT_CFC, when written over the second latest (XT1965-3_LAKE_RETEU_9.0_PPW29.98-111_subsidy-DEFAULT_regulatory-DEFAULT_CFC)
I did however have trouble booting the latest twrp twrp-3.3.1-0-v5.1-lake-jlb from fastboot, phone rebooted after it was sent over adb boot instead of booting twrp it went straight back to fastboot. Tried many times with rebooting to phone home screen in between. But adb fastbooting the older twrp-3.3.0-lake worked straight away, and thereafter installing twrp-3.3.1-0-v5.1-lake-jlb with it's zip worked straight away.
I have tried to get the OTA file for my g7plus from a bugreport.
But it is only 100 Mb rather than the more than 1 Gb is see most roms.
Could it actually be an OTA update? Screenshot of the .zip contents attached.
SvenHee said:
I have tried to get the OTA file for my g7plus from a bugreport.
But it is only 100 Mb rather than the more than 1 Gb is see most roms.
Could it actually be an OTA update? Screenshot of the .zip contents attached.
Click to expand...
Click to collapse
Doesn't seem likely, date is 2009
For reference, here is the line where I found this url:
Code:
12-06 14:19:06.869 5831 14719 D OtaApp : UpdaterEngineHelper:applyPayload, applying payload with downloadUrl = https://dlmgr.gtm.svcmot.com/dl/dlws/1/download/*lots-of-stuff*%3D offsetvalue = 9258 fileSize = 107713236
Lupask said:
any chance of capturing the delta OTA's to make them twrp-flashable?
Click to expand...
Click to collapse
It would be no problem to catch them and make them TWRP flashable. But it's strongly not recommended to do that!! Do an OTA-update only if your device is fully on stock! Otherwise the OTA-update will override incorrect blocks of your partitions and this could crash your entire system irreversible.
Related
Moto g xt 1064 won't boot
So a lady I work with asked me to get her pictures and stuff off her phone. But it doesn't boot past the Motorola boot logo. I can't unlock the bootloader because she wants her stuff off the phone and that would delete it all. Is there a way I could reflash system with fastboot to get the phone to boot (if that's the problem) or even better dumb the internal storage to get her pictures off. My main goal is to get her stuff off the phone. I looked at a few sites showing the fastboot commands but I can't find one to dump the internal storage. It's all flashing commands. Sent from my SAMSUNG-SM-G900A using Tapatalk
download the firmware here http://forum.xda-developers.com/mot...riginal-motorola-firmware-collection-t3153533 unzip it and cd to the directory you unzipped it to then run Code: fastboot flash partition gpt.bin fastboot flash motoboot motoboot.img fastboot flash logo logo.bin fastboot flash boot boot.img fastboot flash recovery recovery.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 modem NON-HLOS.bin fastboot erase modemst1 fastboot erase modemst2 fastboot flash fsg fsg.mbn MAKE SURE YOU FLASH THE SAME FIRMWARE IT WAS ON BEFORE IT QUIT BOOTING
No OS, adb: Total xfer=0.00x
Hi everyone. Accidentally wiped the OS, apparently people fixed it using ADB. I'm trying to sideload a rom but adb says "Total xfer 0.00x" and my moto g says ADB Sideload Complete: Failed. Any ideas how to fix this? ADDED: In case if someone wonders how I fixed this: 1) Reboot the phone into bootloader mode. 2) Open a command prompt / terminal (Start -> cmd.exe in Win7) and browse to the folder with the extracted firmware. 3) Connect your phone to your PC. 4) Flash stock firmware. fastboot flash partition gpt.bin fastboot flash motoboot motoboot.img fastboot flash logo logo.bin fastboot flash boot boot.img fastboot flash recovery recovery.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 modem NON-HLOS.bin fastboot erase modemst1 fastboot erase modemst2 fastboot flash fsg fsg.mbn fastboot -w
some commands can not load and no know such device:silly:
cant flash oreo sign Firmware/cant write boot.img (no error)
Hello, I get always the same error for every thing I try to flash " cant write ...... ((no error)) The device have Android 9 stock firmware unsigned security update november 2018 And I try to install PAYTON_OPWS27.57_40_14_XT1900_7_DS_8.0.0_subsidy_DEFAULT_regulatory_DEFAULT_CFC.xml.zip bootloader is open fastboot run, Flashing works with this pc and OS normaly since I try to flash my smartfone I have noch basband anymore. I used this file 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 flash modemst2 fastboot flash bluetooth BTFM.bin fastboot flash dsp dspso.bin fastboot flash boot boot.img fastboot flash recovery recovery.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_b system_other.img fastboot flash oem oem.img fastboot erase carrier fastboot erase userdata fastboot erase ddr fastboot oem fb_mode_clear PAUSE fastboot reboot
so you're trying to downgrade from pie to oreo. is the bootloader unlocked?
yes , but the first time I try to flash I forgot it , after that I unlocked the device and I try it again and I have the same error message
Flash just the bootloader "fastboot flash bootloader bootloader.img", then press volume-down multiple times until you see "Log". What is the output? It might be related to these issues (thread 1, thread 2). Workarounds include using another PC or older version of fastboot.
I try it today , you mean the bootloader from Oreo right? thanks for support
flashing bootloader was sucessful here is the log: cmd:getvar:slot-count cmd:gevar:has-slot:bootloader cmd:getvarartiton-type:bootloader Cmd: getvar:maxdownload-size cmd: download:0094c100 cmd: flash:bootloader I try to flash all again it stop at dsp dspo.bin the status change to official baseband is back but I stilll have android 9
tomtom_38 said: I try to flash all again it stop at dsp dspo.bin Click to expand... Click to collapse Try flashing again, this time one-by-one. Attach the bootloader log when it stops at dsp. On the PC side, did flashing dsp resulted in "cant write ...... ((no error))" error. What are the command outputs?
C:\Users\Thomas\Desktop\minimal_adb_fastboot_1.4.3_portable_XT1900>fastboot flash dsp dspso.bin target reported max download size of 536870912 bytes sending 'dsp_a' (16384 KB)... this happens by flashing dsp dspso and this ist the log flashing bootloader was sucessful here is the log: cmd:getvar:slot-count cmd:getvar:slot-count cmd: getvar:has slot:bluetooth cmd: getvar:current-slot cmd:getvarartition-type:bluetooth_a cmd:getvar:max-download-size cmd:download:0046f100 cmd:flash:bluetooth_a cmd:getvar:slot-count cmd:getvar:has-slot:dsp cmd:getvar:current-slot cmd:getvarartiton-type:dsp_a cmd:getvar:max-download-size cmd:download:01000000 Cmd: getvar:maxdownload-size cmd: download:0094c100 cmd: flash:bootloader this makes me perplex Im erasing modem st1 but Iam not write everything ------------------------------------------- C:\Users\Thomas\Desktop\minimal_adb_fastboot_1.4.3_portable_XT1900>fastboot erase modemst1 erasing 'modemst1'... OKAY [ 0.016s] finished. total time: 0.016s ------------------------------------------------------------------------------------------------------------------ C:\Users\Thomas\Desktop\minimal_adb_fastboot_1.4.3_portable_XT1900>fastboot flash modemst2 unknown partition 'modemst2' error: cannot determine image filename for 'modemst2'
tomtom_38 said: >fastboot flash modemst2 unknown partition 'modemst2' error: cannot determine image filename for 'modemst2' Click to expand... Click to collapse The script you got is incorrect. modemst2 should be erased instead. I couldn't find the version you have from the mirror. I found another OPWS27.57 zip. They're both "OPWS27.57" and Android 8.0, so the script should be similar. If you want to make sure, inspect line 14 onward of the flashfile.xml. Check whether the zip has recovery.img as well. Unzip the attached file. Put the attached flash_all.bat into the firmware folder and run it. Code: fastboot getvar max-sparse-size fastboot oem fb_mode_set fastboot flash partition gpt.bin fastboot flash bootloader bootloader.img fastboot reboot-bootloader sleep 8 fastboot flash modem NON-HLOS.bin fastboot flash fsg fsg.mbn fastboot erase modemst1 fastboot erase modemst2 fastboot flash bluetooth BTFM.bin fastboot flash dsp dspso.bin fastboot flash logo logo.bin fastboot flash boot boot.img fastboot flash recovery recovery.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_b system_other.img fastboot flash oem oem.img fastboot erase carrier fastboot erase userdata fastboot erase ddr fastboot oem fb_mode_clear fastboot reboot-bootloader sleep 8
ok, it worked with clean win 7 . thanks, but in no firmware is a recovery .img and I cant do an ota update to pie.
tomtom_38 said: in no firmware is a recovery .img and I cant do an ota update to pie. Click to expand... Click to collapse If you did "fastboot flash boot boot.img", the stock recovery should be there. munchy_cool said: flash stock boot.img. recovery is built within boot.img. Click to expand... Click to collapse ------------------- Try this guide. But I'm puzzled why you downgrade to Oreo and back to Pie. btw, "bootloader is open fastboot run" is mentioned in the OP, is the bootloader unlocked?
I will try it, I do it because I need a official signed version to send my smartpfone to a repair center. the best sigened version I found is oreo and I downgrade to oreo and upgtade with motrola update services to pie
hey I flashed slot a and b with the same firmware but the message "you loading a different os" still apear. The bootloader show that the firmware is a official version?! I looking for a solution but I found only the way tto flash both slots
What commands did you use to flash to both slots? They should be: fastboot --set-active=a 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_b system_other.img
Ok I use this comand to change the slot fastboot --set-active=other and then I flash manually all positions from the flash _all .zip from the first page one time for each slot
tomtom_38 said: hey I flashed slot a and b with the same firmware but the message "you loading a different os" still apear. Click to expand... Click to collapse Does it look like this? tomtom_38 said: The bootloader show that the firmware is a official version Click to expand... Click to collapse I'm using Havoc and it also shows as "official". tomtom_38 said: fastboot --set-active=other Click to expand... Click to collapse you mean "fastboot --set-active=b"?
Guide: restore River to good as new stock, clean bootloader
Edit: i just realized I put this in the wrong area, can a mod help me out This took me hours to figure out honestly, and I have experience with this stuff. So, I want this to be as easy to find as possible for other folks. To go back to stock: 1. Hold down Power and Volume till the boot menu shows up. 2. Plug the phone into your PC 3. Get the newest firmware for your phone model. I bought mine at Best Buy, so it was RETUS aka retail US. https://mirrors.lolinet.com/firmware...iver/official/ 4. Extract the archive, and enter that folder in your terminal 5. Run the following commands from that folder. I saved these commands in a shell script and ran it but I think you can just paste it THIS WILL WIPE ANY DATA ON YOUR PHONE AND PUT IT BACK TO FULL FACTORY FIRMWARE WITH LOCKED BOOT LOADER. At least when I ran it, it got my phone 100% no more complaints when it boots about untrusted code. This also restored my OTA ability and I was able to get the Android 10 update without any issues. fastboot oem lock begin 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 system.img_sparsechunk.10 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 vendor vendor.img_sparsechunk.2 fastboot flash oem oem.img fastboot flash oem_b oem_other.img fastboot erase userdata fastboot erase DDR fastboot oem fb_mode_clear fastboot oem lock fastboot oem lock fastboot oem lock fastboot flash boot boot.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 system.img_sparsechunk.10 fastboot flash oem oem.img fastboot oem lock Click to expand... Click to collapse
idumych said: Edit: i just realized I put this in the wrong area, can a mod help me out Click to expand... Click to collapse [Using "Report" button] How to Report issues / Moderators assistance by TonyStark https://forum.xda-developers.com/showthread.php?t=1718423 Sent from my ali using XDA Labs
Please, how can I uninstall Magisk??
Please help me with your knowledge for a little while. I really need help because my android is bootlooping and this is the only phone I have. I really need your help here. -I followed this guide with little differences https://forum.xda-developers.com/moto-e5/how-to/guide-root-twrp-moto-e5-play-explained-t3856182 -I took precautions and I downloaded the respective twrp for my phone (moto e5 nora). -I couldn't make a backup because I'm lower-class college student and I can't afford a micro sd bigger than 4gb (I should have given up here). -I installed Magisk and i thought it went well because no errors showed (at least that's what I think) -Bootloop showing some numbers (80012a99-867fda48-...) -I tried to uninstall using the uninstaller.zip so I could install an older version of Magisk but twrp says "cannot access /data please uninstall with magisk manager" but I just can't do it because android it's bootlooping. Other data (it may be useful): -After installing the last version of Magisk, abd won't recognize the phone ("adb devices") but "fastboot devices" will. -I cannot repair /data but I can format it to ext4,ext2, etc (but it didn't work). -I'm downloading stock image but I don't know how safe will it be to reinstall the whole Android. I'm afraid I can permanently damage my phone after what I have done here. This is the first time I post here. I don't usually ask for help, I don't like to bother people. Thanks in advance and forgive me for my English!
FIXED If someone has the same problem, this is what I did: 1-Download the LAST (this is very important) version ROM. I recommend lolinet (dot) com for our Moto E5. 2-Download adb and decompress the ROM into the adb folder. 3-Open command promt and go to adb's directory. 4-Check that your phone is being recognized by your pc: Code: fastboot devices 5- Copy and paste: Code: fastboot oem fb_mode_set fastboot flash partition gpt.bin fastboot flash dsp adspso.bin fastboot flash bootloader bootloader.img fastboot flash recovery recovery.img fastboot flash logo logo.bin fastboot flash boot boot.img fastboot flash modem NON-HLOS.bin fastboot erase modemst1 fastboot erase modemst2 fastboot flash fsg fsg.mbn 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 erase DDR fastboot erase cache fastboot erase userdata fastboot flash oem oem.img fastboot flash vendor vendor.img fastboot oem fb_mode_clear Then fastboot reboot and there you go! I'm very glad and I hope you, future readers, find this useful enough to get your phone running as it used to run when we were real happy.