Hello, so basically when I was on the June update of my Moto G4 Plus, build NPJS25.93-14-8, software channel reteu, model XT1642 when I decided to unlock my bootloader and flash RR. Now I want to go back to the stock firmware for several reasons, but I have some questions about flashing it. I know how to flash it trough fastboot, but I have some other questions.
1. What are the risks if I flash it?
2. Can I just restore my twrp backup for the fully stock rom, flash the stock recovery and update to the last build through ota? will that work?
3. Will there appear other problems I have to worry about?
4. Can I just flash the June patch through fastboot so that I don't have to flash the updated modems, fsg, bootloader, etc. but instead update them through ota after flashing the stock firmware? Or will that cause bugs?
Thanks for the help and please don't throw hate at me, the last device that I hade with android had android 4.4 and a MediaTek chipset, then I switched to Windows Mobile till last year.
1) As long as you flash the same or newer stock firmware as the latest on your device, you should be okay.
As of writing, if you flash the June 2017, Sept 2017 or Dec 2017 stock firmwares (NPJS25.93-14-8, NPJS25.93-14-10 or NPJS25.93-14-13 respectively) then you shouldn't run into issues and be okay to take OTA updates provided you do a full flash. By a full flash, I mean flashing GPT, bootloader, system, OEM, DSP, modem and the erase steps. If you're flashing the NPJS25.93-14-8 firmware, flashing the same firmware should do nothing to your GPT, bootloader or modem, but is a good routine to ensure your device is clean.
As you're switching from RR to stock firmware, a data wipe/erase is recommended - you may be able to use Titanium Backup or another backup app to preserve your app data, then restore it after flashing the stock ROM (though ensure the backup is off your device). You will have to root your stock ROM to use Titanium Backup however.
The risks come when you flash stock firmware of an older patch level than the stock firmware currently on your device (custom ROMs do not matter in this regard) - strictly speaking, it's not the act of downgrading but attempting to take OTA updates whilst downgraded that causes hard bricks. In most cases, if not all, I've noted that a mismatch of the bootloader patch level and the system patch level are what cause issues for most users. You cannot downgrade bootloaders, so downgrading leads to the following situation:
Say you're on the June 2017 firmware:
June 2017 bootloader, June 2017 system (or RR).
You downgrade to Marshmallow or an earlier build of Nougat (say in this case Dec 2016 Nougat firmware):
June 2017 bootloader (bootloader will block downgrades with a security downgrade error), December 2016 firmware.
You try to take an OTA update. However, OTA updates are only designed for updating, and appear to assume (from looking at the script) your system patch level is the same as your bootloader. If you did not downgrade, this assumption would hold. However, as you've downgraded, you'll get this:
March/June 2017 bootloader *, March 2017 system.
Due to the OTA having authorisation to flash to your bootloader without prior checks, the older OTA corrupts your newer bootloader (as denoted by the *), leading to a hard brick. We do have a blankflash at the moment to help with this, though the easiest way to avoid this situation is to only flash firmware of the same or newer build that what is on your device. Motorola does not support downgrading and assumes the user takes responsibility for downgrading.
2)In theory yes. However, if TWRP was allowed to make modifications before you took the backup, the subsequent OTA might fail as your system partition would be detected as not read-only. Furthermore, you'd need a stock logo.bin, so if you've flashed a logo.bin to hide the bootloader unlocked warning, you'd have to pull that from the NPJS25.93-14-8 stock ROM. TWRP to my knowledge does not back that up.
3)As long as you take your time, and have not downgraded/hard bricked in the past, you should be okay. Ensure you back up as much data with Titanium Backup as previously mentioned, and ensure that you do a full flash, so your GPT, bootloader and system are at the same patch level. As mentioned previously, having your device on the same patch level should mean you have fewer issues with OTAs and stability.
4)I'm not sure what you mean by the June patch, do you mean the June OTA update, or do you mean the June stock ROM?
echo92 said:
1) As long as you flash the same or newer stock firmware as the latest on your device, you should be okay.
As of writing, if you flash the June 2017, Sept 2017 or Dec 2017 stock firmwares (NPJS25.93-14-8, NPJS25.93-14-10 or NPJS25.93-14-13 respectively) then you shouldn't run into issues and be okay to take OTA updates provided you do a full flash. By a full flash, I mean flashing GPT, bootloader, system, OEM, DSP, modem and the erase steps. If you're flashing the NPJS25.93-14-8 firmware, flashing the same firmware should do nothing to your GPT, bootloader or modem, but is a good routine to ensure your device is clean.
As you're switching from RR to stock firmware, a data wipe/erase is recommended - you may be able to use Titanium Backup or another backup app to preserve your app data, then restore it after flashing the stock ROM (though ensure the backup is off your device). You will have to root your stock ROM to use Titanium Backup however.
The risks come when you flash stock firmware of an older patch level than the stock firmware currently on your device (custom ROMs do not matter in this regard) - strictly speaking, it's not the act of downgrading but attempting to take OTA updates whilst downgraded that causes hard bricks. In most cases, if not all, I've noted that a mismatch of the bootloader patch level and the system patch level are what cause issues for most users. You cannot downgrade bootloaders, so downgrading leads to the following situation:
Say you're on the June 2017 firmware:
June 2017 bootloader, June 2017 system (or RR).
You downgrade to Marshmallow or an earlier build of Nougat (say in this case Dec 2016 Nougat firmware):
June 2017 bootloader (bootloader will block downgrades with a security downgrade error), December 2016 firmware.
You try to take an OTA update. However, OTA updates are only designed for updating, and appear to assume (from looking at the script) your system patch level is the same as your bootloader. If you did not downgrade, this assumption would hold. However, as you've downgraded, you'll get this:
March/June 2017 bootloader *, March 2017 system.
Due to the OTA having authorisation to flash to your bootloader without prior checks, the older OTA corrupts your newer bootloader (as denoted by the *), leading to a hard brick. We do have a blankflash at the moment to help with this, though the easiest way to avoid this situation is to only flash firmware of the same or newer build that what is on your device. Motorola does not support downgrading and assumes the user takes responsibility for downgrading.
2)In theory yes. However, if TWRP was allowed to make modifications before you took the backup, the subsequent OTA might fail as your system partition would be detected as not read-only. Furthermore, you'd need a stock logo.bin, so if you've flashed a logo.bin to hide the bootloader unlocked warning, you'd have to pull that from the NPJS25.93-14-8 stock ROM. TWRP to my knowledge does not back that up.
3)As long as you take your time, and have not downgraded/hard bricked in the past, you should be okay. Ensure you back up as much data with Titanium Backup as previously mentioned, and ensure that you do a full flash, so your GPT, bootloader and system are at the same patch level. As mentioned previously, having your device on the same patch level should mean you have fewer issues with OTAs and stability.
4)I'm not sure what you mean by the June patch, do you mean the June OTA update, or do you mean the June stock ROM?
Click to expand...
Click to collapse
Thanks for taking your time and answering my silly questions. 4) I mean the June stock ROM. And I've forgotten...
5) If you relock the bootloader, will you be able to unlock it again? How exactly does this work? The device gets another ID that you use again on the Moto site? Or you unlock it with the key that you used the first time you unlocked?
6) I have seen people that flashed the stock firmware through fastboot without relocking the bootloader and the software status shown in bootloader mode changed from "Official" (like mine) to "Modified" and the phone would show "Your device has failed verification and may not boot propertly." instead of the one with the unlocked bootloader. Just like here: https://www.youtube.com/watch?v=4OQQn105Bp8 . Though I have seen that some of these packages on xda are "Signed by Moto". So the problem does not occur when flashing those images?
corlatemanuel said:
Thanks for taking your time and answering my silly questions. 4) I mean the June stock ROM. And I've forgotten...
Click to expand...
Click to collapse
You have stock backup of current firmware, restore it and check build number in settings >about.
5) If you relock the bootloader, will you be able to unlock it again? How exactly does this work? The device gets another ID that you use again on the Moto site? Or you unlock it with the key that you used the first time you unlocked?
Click to expand...
Click to collapse
There are no benefits for relocking. if you want to lock you can, and it can be unlocked with same key.
6) I have seen people that flashed the stock firmware through fastboot without relocking the bootloader and the software status shown in bootloader mode changed from "Official" (like mine) to "Modified" and the phone would show "Your device has failed verification and may not boot propertly." instead of the one with the unlocked bootloader. Just like here: https://www.youtube.com/watch?v=4OQQn105Bp8 . Though I have seen that some of these packages on xda are "Signed by Moto". So the problem does not occur when flashing those images?
Click to expand...
Click to collapse
Not true, that Modified status comes when you try to modify stock ROM, for various meaning, say installing mods in system (not in case of systemless), or if you try to remove/add apps to system/oem, when you change something in stock ROM, then you will get modified status. (Modification in custom ROM will not change it, only stock ROM does.)
So if you have official status right now, you don't need to worry about it.
Otherwise, to remove modified status,
You need to take OTA, (which can be dangerous as echo92 told you above.),
Bootloader relocking is not necessary to remove Modified, you can still take OTA and it will work..
> Flash June's patch (if you are 100% sure about current firmware)
> take OTA of September
Taking OTA makes it again official. (There was no update for bootloader in September patch, if not official again, December will make it..)
____Mdd said:
You have stock backup of current firmware, restore it and check build number in settings >about.
There are no benefits for relocking. if you want to lock you can, and it can be unlocked with same key.
Not true, that Modified status comes when you try to modify stock ROM, for various meaning, say installing mods in system (not in case of systemless), or if you try to remove/add apps to system/oem, when you change something in stock ROM, then you will get modified status. (Modification in custom ROM will not change it, only stock ROM does.)
So if you have official status right now, you don't need to worry about it.
Otherwise, to remove modified status,
You need to take OTA, (which can be dangerous as echo92 told you above.),
Bootloader relocking is not necessary to remove Modified, you can still take OTA and it will work..
> Flash June's patch (if you are 100% sure about current firmware)
> take OTA of September
Taking OTA makes it again official. (There was no update for bootloader in September patch, if not official again, December will make it..)
Click to expand...
Click to collapse
Ok then, since I'm 100% sure that I was on NPJS5.93-14-8 I'll flash that firmware, but where exactly do I find the one that I need? Doesn't the region matter? I'm on XT1642, in Europe, on the software channel reteu. So which one package do I use? I found 2 of them on AFH from tywinlannister7. And also, quite many people flashed the wrong modem and got into trouble, from what I've seen on xda. So any precautions I should take in that matter?
P.S. I don't want to flash the December patch since it updates the bootloader and there is no blankflash for that version yet... Also can't find the September one.
corlatemanuel said:
Ok then, since I'm 100% sure that I was on NPJS5.93-14-8 I'll flash that firmware, but where exactly do I find the one that I need? Doesn't the region matter? I'm on XT1642, in Europe, on the software channel reteu. So which one package do I use? I found 2 of them on AFH from tywinlannister7. And also, quite many people flashed the wrong modem and got into trouble, from what I've seen on xda. So any precautions I should take in that matter?
P.S. I don't want to flash the December patch since it updates the bootloader and there is no blankflash for that version yet... Also can't find the September one.
Click to expand...
Click to collapse
One by tywinlennister7, it is fine and confirmed working on different retails, (retin, retus, retla, many others.)
I have seen modem and other critical problems when one flashes old firmware (marshmallow roms), those all problems happened when old (MM) firmware is flashed.
You can take backup of all partitions by TWRP (fsg, data, system, boot, firmware, all options in shreps twrp), this all things can be helpful in case if something wrong happens, internal memory will be wiped so move them to external... Then flash....
About December, it's your wish to update or not.
If you are worried about blank-flash, then let me remind you again, you will need blank-flash only if you downgrade and take OTA. When you update to December's patch update, remove all older firmware on your computer and keep December's firmware zip only. If you need to flash stock, flash it, not other old..
List of Nougat firmware:
NPJS25.93-14-8 (June 2017) : https://androidfilehost.com/?fid=889764386195918175
This build appears to be targeted towards India, Brazil, EU and UK users, other territories may apply. This updates to NPJS25.93-14-10 (Sept 2017):
https://drive.google.com/file/d/0B9tngVBGIajVQkQtLUUxR2NOTnc/edit
NPJS25.93-14-13 is the December 2017 update from NPJS25.93-14-10: https://androidfilehost.com/?fid=745849072291698845
As ____Mdd has mentioned, the blankflash is only useful if you hard brick your device, and even then that usually only happens if you go flashing older firmware than what's on your device and then take an OTA update. If you don't downgrade, then you won't have a use for the blankflash normally.
If you want to be sure you're getting the right updates, you can flash the NPJS25.93-14-8 stock ROM, which should leave your device on the same patch level (if it was previously on NPJS25.93-14-8 and you're certain about that), then let the OTA updates download the correct patch. As your device firmware should all be on the same patch level, OTA updates should be okay. Bear in mind you may not receive the December 2017 OTA yet, as I've only seen it deployed to India/Mexico so far. It should be coming to EU soon if it's not arrived.
____Mdd said:
You can take backup of all partitions by TWRP (fsg, data, system, boot, firmware, all options in shreps twrp), this all things can be helpful in case if something wrong happens, internal memory will be wiped so move them to external... Then flash....
Click to expand...
Click to collapse
Ok, I was busy this week but I'm back with just a couple more questions:
Which partitions should I back up with the Partition Backup app and with TWRP? What format should I choose for the Partition Backup app?
Can I lock the bootloader after flashing and booting the stock ROM or do I have to do it while flashing?
I have restored my TWRP backup for NPJS5.93-14-8 and rooted it for the backup app. Is there any other helpful information about my device that I should share with you?
What should I install on my PC? I currently have mfastboot-v2 on my C:\ drive in the adb folder, should I install the Minimal ADB and Fastboot as I have seen people using it for the stock ROM flash? Also, do I need to install any drivers in particular?
echo92 said:
2)In theory yes. However, if TWRP was allowed to make modifications before you took the backup, the subsequent OTA might fail as your system partition would be detected as not read-only. Furthermore, you'd need a stock logo.bin, so if you've flashed a logo.bin to hide the bootloader unlocked warning, you'd have to pull that from the NPJS25.93-14-8 stock ROM. TWRP to my knowledge does not back that up.
Click to expand...
Click to collapse
So If I use this guide and relock the bootloader would I be okay? https://forum.xda-developers.com/moto-g4-plus/how-to/guide-sucsessfull-ota-update-rooting-t3472658
Also, relocking wipes Data and Internal Storage, right?
corlatemanuel said:
Ok, I was busy this week but I'm back with just a couple more questions:
Which partitions should I back up with the Partition Backup app and with TWRP? What format should I choose for the Partition Backup app?
Can I lock the bootloader after flashing and booting the stock ROM or do I have to do it while flashing?
I have restored my TWRP backup for NPJS5.93-14-8 and rooted it for the backup app. Is there any other helpful information about my device that I should share with you?
What should I install on my PC? I currently have mfastboot-v2 on my C:\ drive in the adb folder, should I install the Minimal ADB and Fastboot as I have seen people using it for the stock ROM flash? Also, do I need to install any drivers in particular?
So If I use this guide and relock the bootloader would I be okay? https://forum.xda-developers.com/moto-g4-plus/how-to/guide-sucsessfull-ota-update-rooting-t3472658
Also, relocking wipes Data and Internal Storage, right?
Click to expand...
Click to collapse
1) If you want to make a backup, I would make a backup with the standard TWRP partitions selected (should be all of them but without cache). I've not used the Partition Backup app so cannot comment as to which formats to use, but standard formats for system and cache should be ext4, and data as f2fs.
2)Generally if you want to lock your bootloader, you should flash the stock ROM first, then boot to the stock ROM. In Settings > Developer Options, you will want to turn on OEM unlocking. Then, you can re-lock your bootloader with a full flash of all the commands. For more info and things to be aware of, have a look at this post: https://forum.xda-developers.com/showpost.php?p=74971791&postcount=497 Be aware that if you choose to lock your bootloader, you may not be able to use backups of data you made as TWRP and backup apps may require an unlocked bootloader. Anything you kept on internal storage should be transferable back to your device though.
Re-locking likely wipes data and internal storage, so ensure you back up and keep the back ups off your device - on your computer is the best location - until you are done. Also, be warned that any SD cards you have formatted and adopted as internal storage will be unreadable and need erasing, unless you retain the encryption key. So if you have an adopted SD card, back that up too.
3)I would install Minimal ADB and fastboot (v1.4.2 or newer) as most of the newer guides are based on fastboot rather than mfastboot (which is Motorola's version of fastboot, if I recall). You may wish to have the Motorola device drivers installed too - https://motorola-global-portal.custhelp.com/app/answers/prod_detail/a_id/79106/p/30,75,27,
4)That guide is quite old, plus only restores your device back to a state where OTA updates would be possible (i.e. flashing stock recovery, system, OEM). That guide you linked will not re-lock your bootloader. If you want the commands to re-lock your device bootloader, this guide should help: https://forum.xda-developers.com/moto-g4-plus/how-to/stock-rom-npjs25-93-14-4-march-1-t3608138 Again, heed the warnings I note in the above link.
echo92 said:
1) If you want to make a backup, I would make a backup with the standard TWRP partitions selected (should be all of them but without cache). I've not used the Partition Backup app so cannot comment as to which formats to use, but standard formats for system and cache should be ext4, and data as f2fs.
2)Generally if you want to lock your bootloader, you should flash the stock ROM first, then boot to the stock ROM. In Settings > Developer Options, you will want to turn on OEM unlocking. Then, you can re-lock your bootloader with a full flash of all the commands. For more info and things to be aware of, have a look at this post: https://forum.xda-developers.com/showpost.php?p=74971791&postcount=497 Be aware that if you choose to lock your bootloader, you may not be able to use backups of data you made as TWRP and backup apps may require an unlocked bootloader. Anything you kept on internal storage should be transferable back to your device though.
Re-locking likely wipes data and internal storage, so ensure you back up and keep the back ups off your device - on your computer is the best location - until you are done. Also, be warned that any SD cards you have formatted and adopted as internal storage will be unreadable and need erasing, unless you retain the encryption key. So if you have an adopted SD card, back that up too.
3)I would install Minimal ADB and fastboot (v1.4.2 or newer) as most of the newer guides are based on fastboot rather than mfastboot (which is Motorola's version of fastboot, if I recall). You may wish to have the Motorola device drivers installed too - https://motorola-global-portal.custhelp.com/app/answers/prod_detail/a_id/79106/p/30,75,27,
4)That guide is quite old, plus only restores your device back to a state where OTA updates would be possible (i.e. flashing stock recovery, system, OEM). That guide you linked will not re-lock your bootloader. If you want the commands to re-lock your device bootloader, this guide should help: https://forum.xda-developers.com/moto-g4-plus/how-to/stock-rom-npjs25-93-14-4-march-1-t3608138 Again, heed the warnings I note in the above link.
Click to expand...
Click to collapse
So shreps' twrp can also backup the modems? I am on the 64-bit twrp from lannister7 (too lazy to check his name ) and it doesn't show the modems in "Backup", it only shows firmware, fsg, hw and ol the other stuff. And also, I have to flash the firmware twice if I want to lock the bootloader? I can imagine some really bad situations if you flash it with the OEM lock command included, some sh*t happens, you get an error and the device gets bricked whilst also being locked, and not being able to unlock it because of the "OEM Unlocking" option not being accessible, since the device would be bricked. So if I understand correctly, the OEM lock begin and OEM lock commands fully wipe the device, even the system, causing the need to flash everything again? Or the OEM lock commands require you to flash the stock ROM again because of safety issues?
corlatemanuel said:
So shreps' twrp can also backup the modems? I am on the 64-bit twrp from lannister7 (too lazy to check his name ) and it doesn't show the modems in "Backup", it only shows firmware, fsg, hw and ol the other stuff. And also, I have to flash the firmware twice if I want to lock the bootloader? I can imagine some really bad situations if you flash it with the OEM lock command included, some sh*t happens, you get an error and the device gets bricked whilst also being locked, and not being able to unlock it because of the "OEM Unlocking" option not being accessible, since the device would be bricked. So if I understand correctly, the OEM lock begin and OEM lock commands fully wipe the device, even the system, causing the need to flash everything again? Or the OEM lock commands require you to flash the stock ROM again because of safety issues?
Click to expand...
Click to collapse
Don't think shrep's TWRP backs up the modem, only the FSG partition (which appears to be half of the modem/baseband function). Modems are provided in the stock firmware anyhow.
Yes, you have to flash the firmware first (without OEM locking commands), then enable OEM unlocking in Settings>Developer Options, as I mentioned in the other post I wrote. Else, you may not be able to re-lock your bootloader. With OEM unlocking enabled, if a flash failed, you may still be able to unlock your bootloader and flash a custom ROM. Hence, this way gives you a way out, as you have OEM unlocking enabled, hence I recommending that you flash twice. After enabling OEM unlocking, then you flash fully with the OEM locking commands included.
Again, this is why I always say have plenty of time and do not rush this process, as this is critical to your device properly functioning, and to read up as much as you can on the pros and cons of the process.
The two OEM lock begin commands at the beginning of the locking command list will erase your device. Entering the first of those commands will prompt you and alert you to the fact your device is going to be erased. It only erases your data and likely your internal storage/cache, it should not erase any other partitions as they are usually not user modifiable.
If you are certain that your device is fully stock and at the same patch level, then you can use the OEM lock begin commands and OEM lock commands to lock your bootloader. However, if any of your device firmwares is not on the same patch level as your bootloader, you will likely have a boot failure as the firmware fails the bootloader verification checks (as the bootloader expects only firmware of the same patch level). Hence, I strongly recommend to re-flash the firmware to ensure you have clean stock firmware with matching patch levels.
Again, this process of re-locking your bootloader will mean no TWRP (no backups) or root or Titanium Backup.
echo92 said:
Don't think shrep's TWRP backs up the modem, only the FSG partition (which appears to be half of the modem/baseband function). Modems are provided in the stock firmware anyhow.
Yes, you have to flash the firmware first (without OEM locking commands), then enable OEM unlocking in Settings>Developer Options, as I mentioned in the other post I wrote. Else, you may not be able to re-lock your bootloader. With OEM unlocking enabled, if a flash failed, you may still be able to unlock your bootloader and flash a custom ROM. Hence, this way gives you a way out, as you have OEM unlocking enabled, hence I recommending that you flash twice. After enabling OEM unlocking, then you flash fully with the OEM locking commands included.
Again, this is why I always say have plenty of time and do not rush this process, as this is critical to your device properly functioning, and to read up as much as you can on the pros and cons of the process.
The two OEM lock begin commands at the beginning of the locking command list will erase your device. Entering the first of those commands will prompt you and alert you to the fact your device is going to be erased. It only erases your data and likely your internal storage/cache, it should not erase any other partitions as they are usually not user modifiable.
If you are certain that your device is fully stock and at the same patch level, then you can use the OEM lock begin commands and OEM lock commands to lock your bootloader. However, if any of your device firmwares is not on the same patch level as your bootloader, you will likely have a boot failure as the firmware fails the bootloader verification checks (as the bootloader expects only firmware of the same patch level). Hence, I strongly recommend to re-flash the firmware to ensure you have clean stock firmware with matching patch levels.
Again, this process of re-locking your bootloader will mean no TWRP (no backups) or root or Titanium Backup.
Click to expand...
Click to collapse
Well how can I backup the modem, modemst1 and modemst2 partitions then? that app that I mentioned doesn't work, It doesn't backup anything, and the shreps TWRP doesn't include modem backup. Need help ASAP, everything else is ready except for the backup.
P.S. I'm really tired of my G4 Plus having the icon of a keyboard in This PC )
Edit: I'm dumb, just realised that the FSG IS the modemst1 and modemst2, right?
corlatemanuel said:
Well how can I backup the modem, modemst1 and modemst2 partitions then? that app that I mentioned doesn't work, It doesn't backup anything, and the shreps TWRP doesn't include modem backup. Need help ASAP, everything else is ready except for the backup.
P.S. I'm really tired of my G4 Plus having the icon of a keyboard in This PC )
Edit: I'm dumb, just realised that the FSG IS the modemst1 and modemst2, right?
Click to expand...
Click to collapse
Let me clarify my recent post of backup of modem,
All issue i have seen related to corrupted modems and HW partition are happened when one tried to flash older firmwares, those are marshmallow firmwares..
Till then, i have never seen any modem or corrupted hw partition while flashing latest firmwares..
Just make sure your downloaded firmware is latest or same as you have right now..
corlatemanuel said:
Well how can I backup the modem, modemst1 and modemst2 partitions then? that app that I mentioned doesn't work, It doesn't backup anything, and the shreps TWRP doesn't include modem backup. Need help ASAP, everything else is ready except for the backup.
P.S. I'm really tired of my G4 Plus having the icon of a keyboard in This PC )
Edit: I'm dumb, just realised that the FSG IS the modemst1 and modemst2, right?
Click to expand...
Click to collapse
As ____Mdd has mentioned, backups of modem is only required if you've flashed the wrong firmware at some point (due to the different variants of stock firmware). You've given us no indication of that.
modemst1 and modemst2 are, as I understand it, caches and temporary storage of details that are normally wiped during a stock ROM flash, and are then re-filled when the device reboots. FSG is different to modemst1 and modemst2 I think, being one part of the modem/baseband firmware.
As we've both mentioned, modem and FSG are both provided by the stock ROM (as NON-HLOS.bin and fsg.mbn).
I have made it! I've flashed the stock rom without any problem or error!
I want to thank you all because I wouldn't have been able to flash this without your help! I have also locked the bootloader, then I updated to September update and, shortly afterwards, to December update. Now, if I will ever flash custom ROMs again (which has a high probability) I will know how to restore to the stock ROM. So thanks, and I will leave the thread open if anyone will have the need of assistance with this process, or maybe I will have other questions in the future! So, for the third time, thanks for your valuable help guys!
Related
Hi there, I have the x1642 model on nougat with ElementalX and phh root. I wish to revert to total stock but cannot find a stock nougat firmware or how to flash one. Help is much appreciated, thanks.
TekWiz said:
Hi there, I have the x1642 model on nougat with ElementalX and phh root. I wish to revert to total stock but cannot find a stock nougat firmware or how to flash one. Help is much appreciated, thanks.
Click to expand...
Click to collapse
For reverting back to Nougat, your best bet is to flash this stock ROM via fastboot. https://forum.xda-developers.com/moto-g4-plus/how-to/moto-g4-plus-xt1640-43-athene-npj25-93-t3549369 this is NPJ25.93-14, Dec 2016 security patch.
Instructions on how to flash are included, and if you​ don't wish to relock your bootloader, the OEM flash script will cover you. A few notes:
The extracted ROM takes over 2 GB of space, ensure you have that in the same place you install adb (or can set a path to your firmware location)
When flashing, you may see a security downgrade error when flashing gpt and bootloader partitions. That's normal, but if to want to ensure those partitions are not overwritten, edit your script to delete these lines:
Code:
fastboot flash partition gpt.bin
fastboot flash bootloader bootloader.img
Flashing this will remote TWRP, root and your data, so back up accordingly. You may wish to keep those backups off your device.
Updating to the latest OTA should be possible after flashing, however if you want to relock your device, best to lock it using this firmware before you install the OTA. If you've flashed or will flash the OTA (and your device will/is on NPJS25.93-14.4, March 2017 security patch), we currently are unable to relock devices (as the stock firmware we have access to isn't new enough!)
I've flashed this stock ROM onto my XT1642 (retgb) several times and have had no issues I can recall flashing or booting. Just ensure you read the instructions, backup if need be and good luck.
My only question, why do all these people keep hard bricking their phones? Please, your first step after unlocking your bootloader should be a full Nandroid backup, and download of the stock recovery. That way you have the full stock system, kernel and recovery in case of any mistake, OTA, or any other reason to go back to pure stock. If you need to back to stock, restore your backup, then flash the stock recovery in fastboot. Boom, pure stock, able to accept OTA updates, no issues. Please, for the love of God, make a backup before you make any modifications to your phone. Rant over, thanks for your patients.
Sent from my Moto G (5) Plus using Tapatalk
riggerman0421 said:
My only question, why do all these people keep hard bricking their phones? Please, your first step after unlocking your bootloader should be a full Nandroid backup, and download of the stock recovery. That way you have the full stock system, kernel and recovery in case of any mistake, OTA, or any other reason to go back to pure stock. If you need to back to stock, restore your backup, then flash the stock recovery in fastboot. Boom, pure stock, able to accept OTA updates, no issues. Please, for the love of God, make a backup before you make any modifications to your phone. Rant over, thanks for your patients.
Click to expand...
Click to collapse
Can I also flash the same fastboot ROM on which my device was while on stock (considering I was on the latest update and was trying to flash the fastboot ROM of the same version) if I forgot to make a nandroid backup?
psychopac said:
Can I also flash the same fastboot ROM on which my device was while on stock (considering I was on the latest update and was trying to flash the fastboot ROM of the same version) if I forgot to make a nandroid backup?
Click to expand...
Click to collapse
That should be okay, though be aware that doing so may erase your data in the process. If you need to, make a backup of your device as it currently is in nandroid/TWRP and move it off your device. That way, if anything happens, then you may be able to copy the TWRP backup back and restore your device.
---------- Post added at 05:42 AM ---------- Previous post was at 05:26 AM ----------
riggerman0421 said:
My only question, why do all these people keep hard bricking their phones? Please, your first step after unlocking your bootloader should be a full Nandroid backup, and download of the stock recovery. That way you have the full stock system, kernel and recovery in case of any mistake, OTA, or any other reason to go back to pure stock. If you need to back to stock, restore your backup, then flash the stock recovery in fastboot. Boom, pure stock, able to accept OTA updates, no issues. Please, for the love of God, make a backup before you make any modifications to your phone. Rant over, thanks for your patients.
Sent from my Moto G (5) Plus using Tapatalk
Click to expand...
Click to collapse
Unfortunately, in the majority of hard brick cases, a backup won't save your device, as it's not the system side of things that causes headaches, it's the underlying bootloader.
The main reason is, from what I've observed, is users flashing either the wrong firmware for their device (e.g. US firmware on an Indian device or vice versa) or attempting to downgrade their firmware. Either method can leave you with a mismatched bootloader and system. OTA updates check what system you have for installation purposes, but appear to assume the bootloader is the same patch level as your system. (Should they check for bootloader as well? That check would go some way to preventing hard bricks, but appears Motorola assumes you wouldn't flash firmware not intended for your device or downgrade...)
Thus, because you have a mismatched bootloader and system patch level, you can run into hard bricks when users attempt to subsequently take OTA updates, especially with bootloaders updated to May 2017 or newer.
E.g. a user flashed the US retail NPNS25.137-35-5 with May 2017 firmware onto their device, but wanted to revert back to the Indian firmware. They flashed back to NPN25.137-15 (Jan 2017 security patch) without being able to flash the bootloader, since bootloaders do not permit downgrading of bootloaders generally, and especially after the May 2017 patch. So you have a May 2017 bootloader but a Jan 2017 system. The OTA update downloads and begins flashing believing that your system is Jan 2017 and applies updates to your bootloader thinking it too is at the Jan 2017 patch level too. Of course, it's not - it's May 2017 - and thus causes a hard brick.
The current resolution for hard bricks is blankflashes to reset the bootloader. The only other resolution is that users do not downgrade their firmware, and are very careful with what they flash, and only flash the same firmware as they had or newer firmware that is a direct update of their existing firmware. Alternatively, flashing TWRP images of stock ROMs may be preferable, as these images only flash the system side of things (like a TWRP nandroid backup), so do not affect the bootloader.
echo92 said:
That should be okay, though be aware that doing so may erase your data in the process. If you need to, make a backup of your device as it currently is in nandroid/TWRP and move it off your device. That way, if anything happens, then you may be able to copy the TWRP backup back and restore your device.
Click to expand...
Click to collapse
That's absolutely okay with me as I always like to clean flash ROMs and I don't mind the data partition being erased.
echo92 said:
That should be okay, though be aware that doing so may erase your data in the process. If you need to, make a backup of your device as it currently is in nandroid/TWRP and move it off your device. That way, if anything happens, then you may be able to copy the TWRP backup back and restore your device.
---------- Post added at 05:42 AM ---------- Previous post was at 05:26 AM ----------
Unfortunately, in the majority of hard brick cases, a backup won't save your device, as it's not the system side of things that causes headaches, it's the underlying bootloader.
The main reason is, from what I've observed, is users flashing either the wrong firmware for their device (e.g. US firmware on an Indian device or vice versa) or attempting to downgrade their firmware. Either method can leave you with a mismatched bootloader and system. OTA updates check what system you have for installation purposes, but appear to assume the bootloader is the same patch level as your system. (Should they check for bootloader as well? That check would go some way to preventing hard bricks, but appears Motorola assumes you wouldn't flash firmware not intended for your device or downgrade...)
Thus, because you have a mismatched bootloader and system patch level, you can run into hard bricks when users attempt to subsequently take OTA updates, especially with bootloaders updated to May 2017 or newer.
E.g. a user flashed the US retail NPNS25.137-35-5 with May 2017 firmware onto their device, but wanted to revert back to the Indian firmware. They flashed back to NPN25.137-15 (Jan 2017 security patch) without being able to flash the bootloader, since bootloaders do not permit downgrading of bootloaders generally, and especially after the May 2017 patch. So you have a May 2017 bootloader but a Jan 2017 system. The OTA update downloads and begins flashing believing that your system is Jan 2017 and applies updates to your bootloader thinking it too is at the Jan 2017 patch level too. Of course, it's not - it's May 2017 - and thus causes a hard brick.
The current resolution for hard bricks is blankflashes to reset the bootloader. The only other resolution is that users do not downgrade their firmware, and are very careful with what they flash, and only flash the same firmware as they had or newer firmware that is a direct update of their existing firmware. Alternatively, flashing TWRP images of stock ROMs may be preferable, as these images only flash the system side of things (like a TWRP nandroid backup), so do not affect the bootloader.
Click to expand...
Click to collapse
That is the point of having a backup. You don't have to flash anything in fastboot. You have your OWN firmware backed up on YOUR OWN DEVICE and don't have to worry about any mismatch issues.I have been rooting and flashing custom ROMs for 5 years on 7 different devices( this is the first phone I have not rooted...yet). The first thing I always do after installing a custom recovery is make a full backup. That way if I do something wrong, I always have the stock ROM to go back to. I firmly believe all unlocking and rooting guides should have this step included and not listed as optional but as required. This would help prevent a lot trouble from users flashing the wrong firmware on their phones.
For what it is worth, I have rooted and ROMed: LG Optimus V, Nexus 7 (WIFI tablet), HTC One V, Samsung Galaxy 3, HTC Desire 820, Asus Transformer TF101 (tablet) and Motorola Moto G3. On all these devices I had a full backup of the stock system.
riggerman0421 said:
That is the point of having a backup. You don't have to flash anything in fastboot. You have your OWN firmware backed up on YOUR OWN DEVICE and don't have to worry about any mismatch issues.I have been rooting and flashing custom ROMs for 5 years on 7 different devices( this is the first phone I have not rooted...yet). The first thing I always do after installing a custom recovery is make a full backup. That way if I do something wrong, I always have the stock ROM to go back to. I firmly believe all unlocking and rooting guides should have this step included and not listed as optional but as required. This would help prevent a lot trouble from users flashing the wrong firmware on their phones.
For what it is worth, I have rooted and ROMed: LG Optimus V, Nexus 7 (WIFI tablet), HTC One V, Samsung Galaxy 3, HTC Desire 820, Asus Transformer TF101 (tablet) and Motorola Moto G3. On all these devices I had a full backup of the stock system.
Click to expand...
Click to collapse
I agree with what you wrote, a backup in TWRP and having the same stock ROM is essential to a safe and working device... A stock ROM is always useful in flashing the stock recovery and other stock firmware prior to taking an OTA update. With TWRP backups, you now have to be careful not to allow modifications before you take the backup, else the OTA detects the system partition is no longer readonly, if I recall.
Course, this would be much easier if Motorola/Lenovo released the stock firmware rather than having to depend on leaks, but I'm guessing they don't want to deal with users that flash the incorrect firmware for their device.
I have never flashed a phone before.
It seems I have a virus/malware that's inserted itself into the ROM on my phone. I perform a factory wipe and reset but the malware is there on the fresh install, redirecting webpages to a pop-up about Amazon or Walmart gift cards. Backing up the stock ROM seems not an option for me. Is it possible to download a stock ROM somehow?
vantastic415 said:
I have never flashed a phone before.
It seems I have a virus/malware that's inserted itself into the ROM on my phone. I perform a factory wipe and reset but the malware is there on the fresh install, redirecting webpages to a pop-up about Amazon or Walmart gift cards. Backing up the stock ROM seems not an option for me. Is it possible to download a stock ROM somehow?
Click to expand...
Click to collapse
We have all the stock firmwares posted here...
https://forum.xda-developers.com/g5-plus/how-to/stock-firmware-npn25-137-67-5-fastboot-t3694738
And TWRP flashable stock ROMs here...
https://forum.xda-developers.com/g5-plus/development/rom-twrp-flashable-stock-builds-t3675616
Hello, as the title says, I am a confused semi-noob with a rooted USA G5+. I wish to apply all the security updates to my phone (and upgrade to Oreo when it is available). I've read many, MANY guides to updating the G5+ and have some questions both general and specific. I'm using a USA Moto G5+ purchased the first week it was available in USA in March, rooted using a guide from this forum (which I can no longer find). I'm a mostly-noob. I can follow guides, but I am at "beginner-intermediate" familiarity with *nix systems, terminal commands, etc - for example I know that if you need superuser permissions to rm -rf something, you should be VERY sure that you want to delete that thing (and that you should back said file/directory up before doing anything!).
First, here's my system info:
Android version: 7.0
Model: XT1687
Software channel: retus
Build number: NPN25.137-33
Android security patch level: 1 January 2017 eek
Baseband version: M8953_02.03.07.06R POTTER_NA_CUST
Rooted using Magisk 11.6, SuperSU, and TWRP installed (need to check version, will update with this ASAP after I get off this telecon I'm currently on).
The PC I am using to root my phone is running Ubuntu 14.04 - I think this is relevant because a lot of easy GUI phone tools are Windows-only.
My questions are as follows:
1) There are a number of update guides for the G5+, some of which involve unrooting and locking the bootloader then running OTA updates, and some involve directly flashing ROMs to the phone. Which method is better? Which is easier? Which method is most difficult to brick my phone?
2) Which ROM do I want? My current build number is NPN25, but the system update prompt is for NPNS25.137-33-5. Shouldn't the NPNS only appear for G5S phones, not my basic usa G5+ ?
3) I'm on RETUS software channel - many guides are for RETEU and RETIN (EU and India). Besides the ROM used, can I just follow those guides to the letter (again, using the correct USA ROM) with my phone?
Thanks in advance for your help.
1.) It depends on what you want. If you want a stock experience, then unlocking the bootloader and rooting is what you want. Otherwise flashing a custom rom should do the trick. Neither should cause you to brick your phone. Just back up your boot partition and you should avoid any bootloops. Do not ever, ever flash the bootloader. Both are easy to do imo.
2.) You said you rooted your phone already. Did you happen to flash an entire stock rom to your phone? Maybe you downloaded the wrong one. I am on NPN25.137-83 and have the same phone (XT1687)
3.) All you need to do to root this phone is to unlock the bootloader through Motorola (which you should have already done if you are rooted), boot into bootloader (adb reboot bootloader), then boot into recovery (fastboot boot twrp.img). I kept my /system partition untouched so I flashed Magisk-v14.zip from an SD card that I inserted. That's pretty much it.
I also recommend flashing ElementalX kernel afterward, but that's not 100% necessary.
dunderball said:
1.) It depends on what you want. If you want a stock experience, then unlocking the bootloader and rooting is what you want. Otherwise flashing a custom rom should do the trick. Neither should cause you to brick your phone. Just back up your boot partition and you should avoid any bootloops. Do not ever, ever flash the bootloader. Both are easy to do imo.
2.) You said you rooted your phone already. Did you happen to flash an entire stock rom to your phone? Maybe you downloaded the wrong one. I am on NPN25.137-83 and have the same phone (XT1687)
3.) All you need to do to root this phone is to unlock the bootloader through Motorola (which you should have already done if you are rooted), boot into bootloader (adb reboot bootloader), then boot into recovery (fastboot boot twrp.img). I kept my /system partition untouched so I flashed Magisk-v14.zip from an SD card that I inserted. That's pretty much it.
I also recommend flashing ElementalX kernel afterward, but that's not 100% necessary.
Click to expand...
Click to collapse
Thanks for your reply. I am already rooted (from a guide on this very forum, which appears to have been deleted as I can no longer find it), and flashed a stock rom - the only one available in late March 2017, which was NPN25.137-33. XDA has MANY links to stock ROM images for the G5+, but none say which region the ROM is for (does it matter? There are SOME hardware difference between regions, no?). How do I know which Potter ROM is for my USA hardware?
I don't need a guide to root (as I'm already rooted). I need a guide to flashing updates, of which there are many. Hence my question of whether I should lock bootloader + return to stock and take the OTA directly from the phone, or sideload updated stock ROMs one by one. I'm interested in as close a stock experience as possible, so no custom ROMs.
I also don't know whether I modified the /system partition during my original hasty rooting - any way to check that?
boogiebot said:
Hello, as the title says, I am a confused semi-noob with a rooted USA G5+. I wish to apply all the security updates to my phone (and upgrade to Oreo when it is available). I've read many, MANY guides to updating the G5+ and have some questions both general and specific. I'm using a USA Moto G5+ purchased the first week it was available in USA in March, rooted using a guide from this forum (which I can no longer find). I'm a mostly-noob. I can follow guides, but I am at "beginner-intermediate" familiarity with *nix systems, terminal commands, etc - for example I know that if you need superuser permissions to rm -rf something, you should be VERY sure that you want to delete that thing (and that you should back said file/directory up before doing anything!).
First, here's my system info:
Android version: 7.0
Model: XT1687
Software channel: retus
Build number: NPN25.137-33
Android security patch level: 1 January 2017 eek
Baseband version: M8953_02.03.07.06R POTTER_NA_CUST
My questions are as follows:
1) There are a number of update guides for the G5+, some of which involve unrooting and locking the bootloader then running OTA updates, and some involve directly flashing ROMs to the phone. Which method is better? Which is easier? Which method is most difficult to brick my phone?
2) Which ROM do I want? My current build number is NPN25, but the system update prompt is for NPNS25.137-33-5. Shouldn't the NPNS only appear for G5S phones, not my basic usa G5+ ?
3) I'm on RETUS software channel - many guides are for RETEU and RETIN (EU and India). Besides the ROM used, can I just follow those guides to the letter (again, using the correct USA ROM) with my phone?
Thanks in advance for your help.
Click to expand...
Click to collapse
I don't own a G5 Plus, so up to you how much you take on board (I have a G4 Plus) - as always, please double-check anything you're not sure of. Stock ROM firmware is not to be trifled with...
1)Either way, to use OTA updates on the stock Motorola ROM, you'd have to re-flash back to stock (full stock, not TWRP flashables). You do not have to re-lock the bootloader, OTA updates can install with an unlocked bootloader. The key rule appears to be at least un-modified (read-only) stock system, stock OEM, stock recovery, stock logo and stock boot.img (kernel) partitions that are from all the same stock patch level and match the patch level of your bootloader (mixing and matching patch levels, e.g. older stock firmware with a newer bootloader is a really bad, brick causing, idea...). If you swiped to let TWRP make modifications, then you'll likely have modified the /system partition and require re-flashing/restoring an unmodified /system partition. Easiest way to restore these all to stock would be a firmware flash.
a)Leaving your bootloader unlocked allows you to root your device later, plus easier for troubleshooting. Only requires re-flashing stock firmware (which can leave your data intact, though back up as always).
b)Re-locking your bootloader is more complex, plus involves erasing your data. Cleaner, but does not restore your warranty. However, depending on your service centre and US consumer laws, service centres may take your device in for repairs depending on the fault.
c)Either path would require you to re-flash the same/newer stock ROM onto your device to successfully accept and install OTA updates. As you're on the Jan 2017 NPN25.137-33 update, that is the original update for US/EU devices (though as soon as you update, you cannot roll back to this build without potential issues). If you're worried about hard bricking, then re-locking will force you to only accept updates. Downgrading your stock firmware is only risky if you take OTA updates, so either re-lock your bootloader or do not downgrade your device stock firmware. That means only flashing NPN25.137-33 or later firmware, and then staying in step with your device firmware as you update. Staying in lock step can be difficult due to the sparsity of certain stock ROMs (Motorola is not keen on releasing stock ROMs, so generally it's been up to us to 'acquire' said stock ROMs.) Hence, be careful what you flash.
d)Either method would remove root, TWRP and magisk, though you could re-apply them once you've updated.
2)NPNS.... updates are for G5 Plus devices, the S denoting a security update (though Motorola's update naming system is a little inconsistent). G5S Plus devices appear to be running updates starting with NPS, G5 and G5S are NPP.
NPNS25.137-33-5 should be the next update in line for you, depending on your network (other devices on other networks do appear to get different updates, especially Verizon). The OTA servers should be suggesting the correct OTA build anyway!
3)Should be able to use the guides, just ensure you use the correct stock ROM. If you're on NPN25.137-33, here's a link for the stock ROM of the same build: https://mirrors.lolinet.com/firmware/moto/potter/official/RETAIL/
Also, you may wish to look into using this stock ROM (NPNS25.137-33-5, May 2017 security patch, should be the same as the update you're prompted to receive) to update and return to stock in one go: https://androidfilehost.com/?fid=961840155545594421
Either way, if you just want to revert back to stock, and wish to keep your data, then do not re-lock your bootloader and omit any fastboot commands with erase userdata (erase cache is okay) - such as the following fastboot commands you can try. Of course, back up your data as always just in case. Ensure also that you flash the same build as what is currently on your device - other builds may work, but render OTA updates inoperable unless you revert to the intended build for your region (but this process may damage your device and Motorola may ask you to pay for any damage caused in this regard).
Please verify these before using, check the number of sparse chunks matches the number in the stock ROM, and that these commands will not re-lock your bootloader. If you get pre-flash validation errors or security downgrade errors, double check what stock ROM you have present on your device and what stock ROM you're flashing, as these errors appear if trying to flash an older stock ROM (which as I've mentioned above is NOT recommended):
Code:
fastboot oem fb_mode_set
fastboot flash partition gpt.bin
fastboot flash bootloader bootloader.img
fastboot flash logo logo.bin
fastboot flash boot boot.img
fastboot flash recovery recovery.img
fastboot flash dsp adspso.bin
fastboot flash oem oem.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 erase cache
fastboot oem fb_mode_clear
fastboot reboot
Good luck whatever you decide.
Will i recive OTA update if i unlock the bootloader?
Androidtroll said:
Will i recive OTA update if i unlock the bootloader?
Click to expand...
Click to collapse
Yes. Just unlocking the bootloader still allows everything to work normally, though you can't install otas if you mounted or modified /system and /oem partitions, or have twrp recovery.
Otherwise your phone should still function as if it weren't unlocked.
In addition to the above reply - if you do modify your system and want to flash back to stock firmware, please check if you can download the correct firmware for your device. I see from your history you have a retEU device, so the latest series of firmwares would be the NPNS25.137-93 series (with NPNS25.137-93-10 being the April 2018 security patch). I'd suggest checking to see if there is a stock ROM matching your current build before you unlock the bootloader (either at https://mirrors.lolinet.com/firmware/moto/potter/official/RETAIL/ or https://firmware.center/firmware/Motorola/Moto G5 Plus/Stock/ or https://androidfilehost.com/?a=show&w=files&flid=171014 ) though it seems the latest firmware that's been leaked is NPNS25.137-93-4 (the Jan 2018 security patch build). Just as a headsup, firmware.center has a cryptominer that could keep your CPU at 100 % if you have their page open.
If you download and flash the NPNS25.137-92-10 firmware, which is the April 2018 security patch for Brazil/India devices, you may be able to re-lock your bootloader and get back to full stock, but you may not be able to receive OTA updates (as the NPNS25.137-92 series of updates do not appear to be deployed to the retEU channel), so be careful which firmware you flash.
You can still unlock your bootloader without having the latest firmware to hand, but until the firmware matching your stock firmware before you unlocked or newer is available, you may not be able to re-lock your device. You may be able to flash older stock firmware for EU devices, but please do not use OTA updates if you flash older stock firmware, else you may hard brick your device.
Good luck whichever way you decide.
bazinga137 said:
Yes. Just unlocking the bootloader still allows everything to work normally, though you can't install otas if you mounted or modified /system and /oem partitions, or have twrp recovery.
Otherwise, your phone should still function as if it weren't unlocked.
Click to expand...
Click to collapse
Yes the Same thing Happened
I had TWRP recovery and I installed the Security Patch
my Phone Stuck at TWRP
but it has One solution
First, take the data backup of all in twrp at your sd card
now install any custom Rom
Reboot your device and check the rom is working or not
do reboot and go back to your Twrp and Restore the backup
I tested it and It worked perfectly
echo92 said:
In addition to the above reply - if you do modify your system and want to flash back to stock firmware, please check if you can download the correct firmware for your device. I see from your history you have a retEU device, so the latest series of firmwares would be the NPNS25.137-93 series (with NPNS25.137-93-10 being the April 2018 security patch). I'd suggest checking to see if there is a stock ROM matching your current build before you unlock the bootloader (either at https://mirrors.lolinet.com/firmware/moto/potter/official/RETAIL/ or https://firmware.center/firmware/Motorola/Moto G5 Plus/Stock/ or https://androidfilehost.com/?a=show&w=files&flid=171014 ) though it seems the latest firmware that's been leaked is NPNS25.137-93-4 (the Jan 2018 security patch build). Just as a headsup, firmware.center has a cryptominer that could keep your CPU at 100 % if you have their page open.
If you download and flash the NPNS25.137-92-10 firmware, which is the April 2018 security patch for Brazil/India devices, you may be able to re-lock your bootloader and get back to full stock, but you may not be able to receive OTA updates (as the NPNS25.137-92 series of updates do not appear to be deployed to the retEU channel), so be careful which firmware you flash.
You can still unlock your bootloader without having the latest firmware to hand, but until the firmware matching your stock firmware before you unlocked or newer is available, you may not be able to re-lock your device. You may be able to flash older stock firmware for EU devices, but please do not use OTA updates if you flash older stock firmware, else you may hard brick your device.
Good luck whichever way you decide.
Click to expand...
Click to collapse
I would unlock the bootloader just to try to fix the camera (then edit the system files), not for flash twrp / custom rom
Androidtroll said:
I would unlock the bootloader just to try to fix the camera (then edit the system files), not for flash twrp / custom rom
Click to expand...
Click to collapse
Just unlocking the BL wouldn't be enough to edit system files. You'll need root privileges to do so and for that you will have to flash/boot TWRP to install a root app like magisk.
So all the useful information @echo92 posted above is significant for you.
Sent from my Moto G5 Plus using XDA Labs
Is there a way to take TWRP off or disable to still grab the security patches? Or is clean install/backup (like Rutambh mentioned) the only option? The reason I ask I needed TWRP to install camera mod, so it would be nice to still get those OTA's. I tried to just fastboot boot TWRP but it would just hang at it's logo. Flash was only option.
Frawgg said:
Is there a way to take TWRP off or disable to still grab the security patches? Or is clean install/backup (like Rutambh mentioned) the only option? The reason I ask I needed TWRP to install camera mod, so it would be nice to still get those OTA's. I tried to just fastboot boot TWRP but it would just hang at it's logo. Flash was only option.
Click to expand...
Click to collapse
If anything in /system or /oem is tampered like installing a camera mod (or just mounting system r/w) the only way to receive future OTA updates is flashing your current ROM incl. stock recovery via fastboot.
Sent from my Moto G5 Plus using XDA Labs
Does anyone know about this ?
The last version of the firmware that got OTA'ed to my phone is POTTER_RETAIL_7.0_NPNS25.137-93-8.
The only twrp backup of the firmware I have is while it was on POTTER_RETAIL_7.0_NPNS25.137-93-4.
When I tried to flash the phone with v 93-4 using fastboot, I got denied because of the version being older than that of the bootloader. But the problem is that I was able to erase prior to attempting writing ...
I need to re-install a stock rom in the phone, but POTTER_RETAIL_7.0_NPNS25.137-93-8 cannbot be found anywhere yet.
I though about twrp-flashing the phone with my 93-4 backup, but I am hesitant, I fear bricking the phone.
Is there any alternative to patience while waiting for POTTER_RETAIL_7.0_NPNS25.137-93-8_cid50_subsidy-DEFAULT_regulatory-DEFAULT_CFC.xml.zip eventually appearing somewhere ?
Or, in other words, knowing that the last OTA to my phone installed v 93-8, is there any way to flash POTTER_RETAIL_7.0_NPNS25.137-35-5_cid50_subsidy-DEFAULT_regulatory-DEFAULT_CFC.xml.zip for instance ?
CanadianGixxerman said:
I though about twrp-flashing the phone with my 93-4 backup, but I am hesitant, I fear bricking the phone.
Click to expand...
Click to collapse
An older version (your twrp backup) will work with a newer bootloader, however you can't do any OTAs. An OTA will try to apply the same changes to the bootloader that were already made, resulting in a hard brick - though the OTA would fail anyway since you don't have an intact /oem partition. You will have a functional phone, and you can get back on track after 93-8 images or Oreo are released.
I know because I'm in a similar situation. I wanted to update from 93-4 to 93-8, and I had an intact /system image backup, but /oem was mounted before so I had to flash it via fastboot. Little did I know it was from the wrong channel (retus instead of reteu), resulting in the OTA updating everything except for oem and messing stuff up, so I just flashed a 93-4 twrp backup. Everything works, patiently waiting for Oreo.
bazinga137 said:
I just flashed a 93-4 twrp backup.
Click to expand...
Click to collapse
Just curious. Did you have a full system image backup through twrp or just the system partition? I have a twrp backup of 93-8 stock boot, logo, oem, recovery, and system PARTITIONS which I thought would allow me to restore and take ota. However, since doing that I've read that system needs to be the full IMAGE backup through twrp. Confused so I haven't restored to take the 93-10 update which I got notification of yesterday.
craigl14 said:
Just curious. Did you have a full system image backup through twrp or just the system partition? I have a twrp backup of 93-8 stock boot, logo, oem, recovery, and system PARTITIONS which I thought would allow me to restore and take ota. However, since doing that I've read that system needs to be the full IMAGE backup through twrp. Confused so I haven't restored to take the 93-10 update which I got notification of yesterday.
Click to expand...
Click to collapse
Honestly, I am not sure. I did a twrp back up with the default selected partitions. But it turned out that this backup is not reliable. The phone does boot up on it, but suffers from applications crashes all over. Last I discovered is that the phone itself was not working for a phone, meaning making receiving calls is not possible.
craigl14 said:
Just curious. Did you have a full system image backup through twrp or just the system partition? I have a twrp backup of 93-8 stock boot, logo, oem, recovery, and system PARTITIONS which I thought would allow me to restore and take ota. However, since doing that I've read that system needs to be the full IMAGE backup through twrp. Confused so I haven't restored to take the 93-10 update which I got notification of yesterday.
Click to expand...
Click to collapse
It needs to be an image backup for OTAs. Unlike a regular backup, image backups are block-by block pristine copies, and restoring them preserves dm-verity and all /system checks. On the other hand the /oem partition cannot be backed up as an image (I asked GtrCraft, the official maintainer of twrp for some moto devices), and since OTAs also check if /oem has been tampered with, the update fails.
Updates will only pass if /oem has never been mounted, and you have a system image backup.
bazinga137 said:
It needs to be an image backup for OTAs. Unlike a regular backup, image backups are block-by block pristine copies, and restoring them preserves dm-verity and all /system checks. On the other hand the /oem partition cannot be backed up as an image (I asked GtrCraft, the official maintainer of twrp for some moto devices), and since OTAs also check if /oem has been tampered with, the update fails.
Updates will only pass if /oem has never been mounted, and you have a system image backup.
Click to expand...
Click to collapse
Dumb question...How do I know if the oem partition is tampered with or has never been mounted? I am rooted with elementalx kernel and supersu. TWRP partition stock backup made immediately after taking 93-8 update and before flashing twrp, rooting, etc. I know I am hosed without the system IMAGE as far as ota's go, but I'm just trying to learn.
I'm in the same boat. Pretty much stuck on 93-8 forever until a new full image is released somewhere. I might just move onto a custom Oreo rom.
dunderball said:
I'm in the same boat. Pretty much stuck on 93-8 forever until a new full image is released somewhere. I might just move onto a custom Oreo rom.
Click to expand...
Click to collapse
Well, I did that. I have tried a few cutom roms : Pixel Exprerience, Resurection Remix, AOSP extended, AOSiP and Dirty Unicorns. The latter and AOSiP are those I find the most reliable. Avoid PE and RR, too buggy, AOSP-E has issues with SIM/SDcard here.
But I will want to go back to stock moto rom when I can (ie : full 93-8 load fastboot flashable is released).
If moto had been quicker to release Oreo AND fix the wifi bug, I would not have given up on retus.
I guess I have an even more fundamental dumb question than my twrp restore issue and maybe it belongs in another thread. Aside from advanced excel formulas, I have no programming experience of any kind, let alone android. However, it seems to me that if I have a full firmware package for 93-4 (which I do) and a "blur" ota update file that takes it to 93-8 (which I do), I should be able to create a full 93-8 firmware package file myself from those two files without waiting on the file hosting sites. Maybe this is way too advanced a process but it seems to me this is 1+2=3 variety.
craigl14 said:
I guess I have an even more fundamental dumb question than my twrp restore issue and maybe it belongs in another thread. Aside from advanced excel formulas, I have no programming experience of any kind, let alone android. However, it seems to me that if I have a full firmware package for 93-4 (which I do) and a "blur" ota update file that takes it to 93-8 (which I do), I should be able to create a full 93-8 firmware package file myself from those two files without waiting on the file hosting sites. Maybe this is way too advanced a process but it seems to me this is 1+2=3 variety.
Click to expand...
Click to collapse
Your device now being at 93-8 is what's in the way. It seems like you can restore your twrp 93-4 on it, but you won't be able to relock the BL, hence OTA will not work.
CanadianGixxerman said:
Your device now being at 93-8 is what's in the way. It seems like you can restore your twrp 93-4 on it, but you won't be able to relock the BL, hence OTA will not work.
Click to expand...
Click to collapse
Sorry for the confusion. My restore issue is with the fact that I did not make a full system image twrp backup of stock 93-8. If I had, I would be able to restore and take ota's (assuming the oem issue doesn't interfere which I don't know about).
My last question is more fundamental and broader. There are quite a few people waiting on firmware updates. It just seems to me that if I have a full firmware package and an update package for that firmware, I should be able to create a newly updated full firmware package independent of what happens to be on my phone at any one time. Again, maybe really stupid and way beyond my capabilities.
I'm on a slightly same boat as OP, but I don't have my backup since I thought it was on my SD and wiped my phone, with the backup only there. I was on 93-8 when I wiped. Would getting a 93-4 backup work?
This question might of been answered but I did not see it when I read through this thread.
craigl14 said:
Sorry for the confusion. My restore issue is with the fact that I did not make a full system image twrp backup of stock 93-8. If I had, I would be able to restore and take ota's (assuming the oem issue doesn't interfere which I don't know about).
My last question is more fundamental and broader. There are quite a few people waiting on firmware updates. It just seems to me that if I have a full firmware package and an update package for that firmware, I should be able to create a newly updated full firmware package independent of what happens to be on my phone at any one time. Again, maybe really stupid and way beyond my capabilities.
Click to expand...
Click to collapse
I took a full backup of my system image through twrp, and I was on 93-8. I'll upload it when I have time and you can give it a try.
CanadianGixxerman said:
[...] but you won't be able to relock the BL, hence OTA will not work.
Click to expand...
Click to collapse
Why would you need to relock the BL to take an OTA?
craigl14 said:
My last question is more fundamental and broader. There are quite a few people waiting on firmware updates. It just seems to me that if I have a full firmware package and an update package for that firmware, I should be able to create a newly updated full firmware package independent of what happens to be on my phone at any one time. Again, maybe really stupid and way beyond my capabilities.
Click to expand...
Click to collapse
Sadly you can't apply an OTA to the firmware images, if that's what you're thinking. They need to be signed by moto to be flashable through fastboot. And if you'd want to provide someone with a twrp backup of a firmware higher than theirs, their bootloader would need to be updated too, via an OTA.
bazinga137 said:
if that's what you're thinking.
Click to expand...
Click to collapse
Thanks. That's exactly my question. So the answer is that Motorola controls the process. Makes sense. Any thoughts on my oem mounting question?
craigl14 said:
Thanks. That's exactly my question. So the answer is that Motorola controls the process. Makes sense. Any thoughts on my oem mounting question?
Click to expand...
Click to collapse
I really can't think of a way of checking the mount count of Android partitions, and I haven't found anything online.
I discovered the mount counter thingy when sweeping through logs of a failed OTA. I'm really not sure where the OTA script reads it from.
craigl14 said:
Sorry for the confusion. My restore issue is with the fact that I did not make a full system image twrp backup of stock 93-8. If I had, I would be able to restore and take ota's (assuming the oem issue doesn't interfere which I don't know about).
My last question is more fundamental and broader. There are quite a few people waiting on firmware updates. It just seems to me that if I have a full firmware package and an update package for that firmware, I should be able to create a newly updated full firmware package independent of what happens to be on my phone at any one time. Again, maybe really stupid and way beyond my capabilities.
Click to expand...
Click to collapse
I made a full backup of 93-8, but still i can't lock bootloader. We need complete firmware, until then, Lineage OS is the answer.
---------- Post added at 11:55 PM ---------- Previous post was at 11:52 PM ----------
bazinga137 said:
Why would you need to relock the BL to take an OTA?
Click to expand...
Click to collapse
No idea, i saw this first time now on Motorola. On any other manufacturers i could lock bootloader, and even get OTA updates just by flashing stock recovery and having unlocked bootloader was not a problem.
If your device was formally updated to NPNS25.137-93-8 (March 2018 security patch), then you could try to flash the NPNS25.137-93-4 (Jan 2018 security patch) update again as you previously tried (link to the Jan 2018 stock firmware for EU/US and Asia devices: https://mirrors.lolinet.com/firmware/moto/potter/official/RETAIL/ ). You may wish to ignore the security downgrade errors (you cannot downgrade bootloaders anyway, presumably to prevent you opening security vulnerabilities) when you flash, which should just be for GPT and bootloader. You may also see 'image signed with bad key' for recovery and boot as well, but verify those partitions, and the other partitions report [OKAY] after flashing. That way, you should have a NPNS25.137-93-4 system, with a NPNS25.137-93-8 bootloader, and when you boot you should have a device reporting with fully stock NPNS25.137-93-4. The next OTA you should receive is the NPNS25.137-93-8 OTA and then the NPNS25.137-93-10 April 2018 security patch OTA, which should bring you up to the latest stock firmware.
By reflashing the NPNS25.137-93-4 firmware, this should also restore your OEM partition to being untampered (read only status?), as should your system partition (which should be read only, I recall that swiping to allow modifications in TWRP sets your system partition to read-write, which causes the OTA to fail).
Normally, I would advise against downgrading and using OTA updates, as this is a prime way of hard bricking. However, in this case you are downgrading your device firmware to the firmware directly preceding the newest firmware you had (i.e. downgrading to NPNS25.137-93-4 from NPNS25.137-93-8), with the next OTA being NPNS25.137-93-8, which brings you back up to the build you had, this may be safe. To your device, you are flashing the same bootloader from the NPNS25.137-93-8 OTA as currently on your device, which should not hard brick.
If you previously had stock NPNS25.137-93-10, then I cannot recommend this procedure as you'll be downgrading two firmware versions (and you'll have to wait for newer stock firmware to be leaked), else if you try flashing NPNS25.137-93-4 onto the April 2018 firmware and try using OTA updates, you may hard brick and have a pricey paperweight. I also do not know if this will work by cross-flashing from the NPN25.137-92 series of updates either.
Of course, as the NPNS25.137-93-4 firmware is older than your bootloader, you will not be able to re-lock your bootloader (you'll need a newer firmware, probably the April 2018 or newer security patch stock firmware), but being back on full stock, you should be eligible for OTAs provided you only downgraded from NPNS25.137-93-8 (and that March 2018 security patch was the latest stock firmware on your device).
If you are truly concerned about hard bricking, then I would follow other member's suggestions in this thread and stay with TWRP flashables of the stock ROM, as they do not usually affect the bootloader.
Any questions or comments before you perform this procedure, please ask.
bazinga137 said:
I really can't think of a way of checking the mount count of Android partitions, and I haven't found anything online.
I discovered the mount counter thingy when sweeping through logs of a failed OTA. I'm really not sure where the OTA script reads it from.
Click to expand...
Click to collapse
Thanks. Weird. Sorry for hijacking this thread. But if my process were to take OTA after which it reboots, then IMMEDIATELY reboot into bootloader, fastboot BOOT into twrp (not flash it) and take a backup of boot, logo, oem, recovery and system (FULL IMAGE), how would that change oem?
CanadianGixxerman said:
Well, I did that. I have tried a few cutom roms : Pixel Exprerience, Resurection Remix, AOSP extended, AOSiP and Dirty Unicorns. The latter and AOSiP are those I find the most reliable. Avoid PE and RR, too buggy, AOSP-E has issues with SIM/SDcard here.
But I will want to go back to stock moto rom when I can (ie : full 93-8 load fastboot flashable is released).
If moto had been quicker to release Oreo AND fix the wifi bug, I would not have given up on retus.
Click to expand...
Click to collapse
What's buggy about PE? I was just about to try it...