• If you are experiencing issues logging in, we moved to a new and more secure software and older account passwords were not able to be migrated. We recommend trying to reset your password, then contacting us if there are issues.
  • Nearly done! Migration cleanup is mostly done. There are a small number of issues left that we continue to work on, but all the heavy lifting is done. We still would love to hear feedback over at this thread and also check out the new XDA app! Thanks and we hope you enjoy the new forums, and thanks for your support of XDA <3

[Nougat][Stock][Rom] TWRP Flashable Stock Builds

NZedPred

Senior Member
Mar 16, 2016
857
1,632
93
Wellington
This project is a continuation of the thread here:
[ROM] TWRP Flashable Stock Builds

As the original author of that thread, Q9Nap, no longer has a Moto G5 Plus, I have started this project to continue the work that Q9Nap started.

About this project
This is a collection of stock roms that can be flashed by TWRP. These roms have the following modifications from stock:
  • DM-verity is disabled
  • Forced encryption of the data partition is disabled. It is still possible to encrypt the partition if you wish
  • The boot image has been modified to suppress the unlocked device warnings (although the N/A will still show)
  • The partition table and boot loader are not included, which makes it safer to up/down-grade.
  • Do not attempt to apply standard OTAs over these builds. They'll probably fail, worst case they will brick your phone

Usage
Steps to flash
  • Ensure you have the latest TWRP
  • Download an appropriate zip from one of the links below
  • Copy to the phone or SD card
  • BACKUP YOUR DATA
  • Flash the zip via TWRP
  • Optionally flash Magisk etc
  • Reboot
  • Profit?

How you can help with new builds
If your phone gets an OTA notification for a build that has not been released, please pull it and share it in this thread:
  • When the notification is received, allow your phone to download the OTA
  • Power off and boot into recovery
  • Go to Advanced -> File Manager
  • Navigate to /cache
  • There will be a file Blur_Version_x.y.z.potter.blah.zip
  • Copy it to internal storage or the sdcard
  • Copy to PC (optional)
  • Upload to Mega, Google Drive, wherever
  • Share the link
You can also remove the file from the /cache folder to prevent any auto-updates from happening.

Latest versions
NPNS25.137-93-18 (1 August 2018 security patches)
Android File Host - potter-twrp-flashable-NPNS25.137-93-18-aroma.zip
Dropbox - potter-twrp-flashable-NPNS25.137-93-18-aroma.zip
Released only for retus (US), but will be compatible with other channels.

NPNS25.137-93-14 (1 June 2018 security patches)
Android File Host - potter-twrp-flashable-NPNS25.137-93-14-aroma.zip
Dropbox - potter-twrp-flashable-NPNS25.137-93-14-aroma.zip
Suitable for the following channels:
  • retus (US)
  • reteu (Europe)
  • retapac (Asia Pacific)

NPNS25.137-92-14 (1 June 2018 security patches)
Android File Host - potter-twrp-flashable-NPNS25.137-92-14-aroma.zip
Dropbox - potter-twrp-flashable-NPNS25.137-92-14-aroma.zip
Suitable for the following channels:
  • retin (India)
  • retla (Latin America)
  • retbr (Brazil)

All versions that I have created will be placed in this folder at Android File Host:
https://androidfilehost.com/?w=files&flid=273039&sort_by=date&sort_dir=DESC

New - they will also be mirrored at Dropbox:
https://www.dropbox.com/sh/vgw7me2f8p5gcgq/AABoBfx1tMCOMMaXL4m75Fdma?dl=0


An important note for those who have flashed custom Oreo roms
It is a frequent issue regarding Oreo roms that the device's IMEI is set to 0 in certain conditions. It is possible that these roms (or something used with them) are tampering with the persist partition of the devices. When this occurs, if the EFS is erased, it is not reconstructed correctly.

The scripts used in earlier versions this rom erase the two modem partitions, modemst1 and modemst2. These are your EFS. Normally, if you have an intact persist partition, they are recreated on boot. However, if your persist is not intact, they may fail to be recreated. The ideal scenario in this case is that you have a backup of an intact persist partition, and you restore it before flashing this. The next best is to backup a working EFS before flashing this rom, and then restore the EFS after flashing. Note that the second scenario is not guaranteed to work for any future updates. If the modem firmware is updated in an update, then it may require the EFS to be reconstructed, relying upon an intact persist.

Versions of this rom that have "no-erase-modemst" in their filename do not have the commands to erase modemst1 and modemst2. The aroma installers make it optional to erase modemst1 and modemst2.

An update on the IMEI zero issue
I have created another project linked below, that explains what has happened to some people who have lost their IMEI after flashing Oreo roms, then flashing stock builds that erased the modemst1/2 partitions.
Fix Persist, resolve IMEI=0, Explanation, Requirements

If you have installed an Oreo rom previously, or have lost your IMEI, I recommend that you read the first couple of posts in that thread. Take appropriate steps to back up your persist and EFS before installing these roms.


Guide to creating TWRP flashable builds
The following post is a guide to creating these flashable builds. Please ask questions on how to create such builds in this project:
https://forum.xda-developers.com/g5-plus/how-to/guide-creating-twrp-flashbale-stock-roms-t3804776

XDA:DevDB Information
[Nougat][Stock][Rom] TWRP Flashable Stock Builds, ROM for the Moto G5 Plus

Contributors
NZedPred
ROM OS Version: 7.x Nougat
Based On: Stock ROM

Version Information
Status: Snapshot
Current Stable Version: 1 June 2018 security
Stable Release Date: 2018-07-07

Created 2018-07-07
Last Updated 2018-10-30
 
Last edited:

NZedPred

Senior Member
Mar 16, 2016
857
1,632
93
Wellington
I m on custom rom right now. If i Flash this rom , will there be any issue with volte or imei?
Shouldn't be. From what I've read, the issues with IMEI and VOLTE are relating to installing an Oreo custom rom and then flashing back to stock using fastboot.

Having said that, always make sure you have a backup of your persist and EFS. Refer to this thread for more details: https://forum.xda-developers.com/g5-plus/how-to/dev-fixing-baseband-t3806064. In particular, post #16 in the thread details how to backup and restore persist.

tldr; if you never installed an oreo custom rom, you'll be fine. if you installed an oreo custom rom, more than likely you're fine, but in either case, backup persist and efs.

EDIT: I've added a note to the OP about coming from an Oreo rom. My advise is changing slightly - if you previously installed an Oreo custom rom and don't have a persist backup from prior to doing so, you need an EFS backup. But as above, backup persist and efs to be safe regardless.
 
Last edited:
  • Like
Reactions: Klape and karan3660

Angel_Wolf

Member
Apr 7, 2016
10
1
0
TL;DR: I lost my IMEI while flashing this, and I'm trying to find out why did I lost it. PLEASE MAKE SURE TO BACKUP PERSIST, AND EFS, SO YOU DON'T HAVE TO GO THROUGH THE TROUBLE I WENT TO


Just to let you guys know, I came from the MIUI 9.6 ROM and flashed this ROM. Here was my steps

Rebooted to Recovery
Flashed the latest TWRP(Had an old one, I believe it was the Treble unofficial one)
Rebooted to Recovery again (to Boot into the new TWRP)
Clean Wiped and Formatted the Data
Flashed this ROM(NPNS25.137-93-14)
Rebooted to the new ROM

While Flashing this, I noticed it erased modemset1 and 2. I didn't bother much about it, until the ROM booted.

I noticed it deleted my IMEI, I managed to recover it, but I am now scared of flashing it again. What should I do

(PS: I never had this problem while flashing other ROMs, everything worked fine until I flashed this)

EDIT:
I checked updater-script, it apparently erases modemset1 and 2 to RAW, maybe that could be the problem?

EDIT 2: (Sorry for the constant edits :rolleyes: )
if you notice this:
Code:
ui_print("Erasing modemst1 ...");
format("raw", "EMMC", "/dev/block/bootdevice/by-name/modemst1", "0", "/modemst1");
ui_print(" ");

ui_print("Erasing modemst2 ...");
format("raw", "EMMC", "/dev/block/bootdevice/by-name/modemst2", "0", "/modemst2");
ui_print(" ");
I think the problem is that it erases them to "0", and that could be why I lost my IMEI

EDIT 3:
I noticed in another thread you mentioned you were patching the Modem with the new patches released on the June Security update. Isn't Modem unique for each device?
 
Last edited:

NZedPred

Senior Member
Mar 16, 2016
857
1,632
93
Wellington
Hi. I see that MIUI 9.6 is an Oreo rom, correct? If so, I'd be interested to know if you've ever flashed stock using fastboot at any stage since having an Oreo build.

On my phone, and I'm guessing on everyone else's for whom it works, the modemst partitions are recreated on boot of they have been erased. The lines on the script are no different from those that were on the previous thread's builds, so these builds aren't doing anything differently.

The modem partition is like drivers, so no it's not unique per device. The persist partition is unique per device, which is why it's important to back it up.
 
Last edited:

Angel_Wolf

Member
Apr 7, 2016
10
1
0
Hi. I see that MIUI 9.6 is an Oreo rom, correct? If so, I'd be interested to know if you've ever flashed stock using fastboot at any stage since having an Oreo build.

On my phone, and I'm guessing on everyone else's for whom it works, the modemst partitions are recreated on boot of they have been erased. The lines on the script are no different from those that were on the previous thread's builds, so these builds aren't doing anything differently.

The modem partition is like drivers, so no it's not unique per device. The persist partition is unique per device, which is why it's important to back it up.
No, I have stayed away from the Stock builds using fastboot. If anything, I have been using a debloated stock ROM that's on the November 2017 patch(and it's made to be flashed on TWRP).

Related to the modem partition, I understand now. But my question is, why does it turn my IMEI to 0? All I can think about is the "0" on the code I posted in my other post.

Sorry if it seems bland, it's late over here and I sending this message in the very same phone it got the IMEI problem.

If you need anything from my part, ask away. I know some stuff about Android and I can try to help you out to find a solution :fingers-crossed:
 

NZedPred

Senior Member
Mar 16, 2016
857
1,632
93
Wellington
No, I have stayed away from the Stock builds using fastboot. If anything, I have been using a debloated stock ROM that's on the November 2017 patch(and it's made to be flashed on TWRP).

Related to the modem partition, I understand now. But my question is, why does it turn my IMEI to 0? All I can think about is the "0" on the code I posted in my other post.

Sorry if it seems bland, it's late over here and I sending this message in the very same phone it got the IMEI problem.

If you need anything from my part, ask away. I know some stuff about Android and I can try to help you out to find a solution :fingers-crossed:
I can only assume that the device checks the EFS for IMEI data, and if it doesn't exist, creates the EFS (modemst1 and modemst2). The creation of the EFS is based upon data in the persist partition. Effectively, EFS is a cache. So if you have restored an old EFS backup, you have restored the cache, so it is using the IMEI data from the old backup. But if it didn't create it automatically, that suggests that there is an issue with the persist partition.

This post has lots of info (and I keep on linking to it - the IMEI issue is a big one!) https://forum.xda-developers.com/g5-plus/how-to/dev-fixing-baseband-t3806064