yashsingh1/xdaforums huggingface dataset:
[Moto X4 Questions & Answers] redwoodie:
I already did that for you....though not with a custom ROM.

I used TWRP to back up and restore EFS.

I had read a warning on the TWRP site to back up EFS, Persist and Vendor prior to modding, so did it just in case.

Wasn't sure if it would have any effect with a no-longer-rooted phone, but it did.

What's going on is very mysterious, especially when it produces different results from same parameters.
[Moto X4 Questions & Answers] KrisM22:
Excellent with Twrp.

Yes, confusing - that's why I suggested maybe different mobo.
[Moto X4 Questions & Answers] aybarrap1:
Just to chime in...

I was under the impression that official EOS for the A1 version of the X4 ends towards the middle or end of summer. A1 devices are supposed to get 2 years of upgrades and 3 years security updates.
[Moto X4 Questions & Answers] redwoodie:
Wikipedia confirms 3 years security and 2 years OS updates for A1. So security updates until October 2020, but we're probably not going to see 10 on the X4.

https://en.wikipedia.org/wiki/Android_One
[Moto X4 Questions & Answers] redwoodie:
Flashed PPWS29.69-39-6-4. Phone was initially back to connecting and disconnecting from Wifi and no mobile connection. Flashed EFS from my backup again (I noticed the active slot had switched from B to A after flashing the update FFW). Now connecting Wifi, phone and data.

I'll get this reconfigured and use it for a day or so and then post a full guide.

Still unknown is whether it will take future OTAs or will require flash from user to update.
[Moto X4 Questions & Answers] redwoodie:
KrisM22, you may want to add warning in your thread about backing up EFS, Persist etc. before doing any mods. Thanks!
[Moto X4 Questions & Answers] KrisM22:
a) sounds very good!!!

b) as to adding the EFS warning, NO as I don't want in any way to make that a guide for modifying the X4, simply because that will encourage folks to do it. Too many folks will read it and think that "if they back up EFS they can get away with anything". I wouldn't want to be party to that.

- while it appears that it may be possible to return a phone to working stock, in some cases, if it hasn't been flashed with a custom ROM, there are too many variants of things that folks feel they "need" to do to their phones that would ultimately break it.

- for my past/older phones I have tried to post guides to help folks not screw things up too badly and get back to stock, but my sense of this phone is that any custom ROM available will break the Pie file system and render it unusable. It is unfathomable to me that the devs here have not assured themselves that their mods can be returned to working stock, but it is what it is. I haven't cooked since a very old windows phone (and some abortive attempts on a 7 AOSP) and have no interest in it - no one is pleased, everyone complains, and it is endless. And stock is better.

EOL and all that - everything you read is just folks' opinions and hopes - I wouldn't be too surprised if the One/fi got 10 and a sec update or 2, but then I wouldn't be at all surprised if it didn't. I like the phone as it is even though it has occasional quirks, probably mostly caused by my not frequently re-booting it. As to futures, when I decide to leave this one(hopefully not because I dropped it...) I would be looking for a used phone, perhaps around $100, that would likely upgrade to 11 or so - that is typical of my approach for phones. I no longer look for phones that can be custom modded(stock just works better), and I don't need root. btdt. I seem to have spent a bit of time on the XDA forums for this phone warning folks not to modify it, but I wouldn't be surprised if, in the future, I lose that interest. Too many folks had already destroyed their phones by the time I got here, and some just don't bother to read the forum. It used to be that when a release came out, that it would have problems and require a x.1 update. That happened as late as Oreo, but Pie has seemed pretty solid. for whatever reason. :)
[Moto X4 Questions & Answers] KrisM22:
Feb 1 just came out. PPWS29.69-39-6-5

Some folks on redit got it to work, one is stuck, mine says step 2 of 6 applying but actually does nothing, so I'll shut off wifi and try in the morning.

https://www.reddit.com/r/MotoX4/comments/f6fuh3/february_2020_ppws29693965_update_is_available/
[Moto X4 Questions & Answers] aybarrap1:
I go t the update today successfully but I am not unlocked or rooted as of yet.

This is what I thought. I just got the February security update today. I would not expect much past August.

I will say that I honestly have no reason to root at this point. No bloatware and many of the features I added previously are now integrated. And with the ability to allow ADB permissions to run Tasker with full potential for my usage, I have found I do not miss having root.
[Moto X4 Questions & Answers] KrisM22:
Well seems a bit more likely.. But I would be surprised to see them just updating 9 till Aug, or even Oct. Glad yours worked.
[Moto X4 Questions & Answers] redwoodie:
My unrooted/restored X4 updated just now to 29.69-39-6-5. No issues.
[Moto X4 Questions & Answers] KrisM22:
using wifi?

---------- Post added at 10:54 PM ---------- Previous post was at 10:47 PM ----------

never mind, I just got an update complete. I didn't have wifi going so it did it over mobile data which at one point I allowed for it. Now I'm wondering how to turn that off....

Good news that one of yours took the update!!!!!!!
[Moto X4 Questions & Answers] redwoodie:
Well, sim was in and mobile data on. Wifi also. Probably the latter, I think it's set to update via wifi.

Also I'll turn on the other phone that has no sim, and see it it also does.
[Moto X4 Questions & Answers] redwoodie:
Second X4 update failed over wifi 4 times. Gets to 94% and bombs. This is the phone that had bigger problems (and obviously still has some).
[Moto X4 Questions & Answers] KrisM22:
do you know how to set it back from mobile to using just wifi?

Yup. and you say you never modified the recovery partn. Weird. Can you flash it with 39-6-4? or maybe the first or second Pie?
[Moto X4 Questions & Answers] redwoodie:
Flashing with 39-6-4 is what I did earlier. Remember I had to flash EMS to get the radios working again after 39-6-4.

After that the phone worked fine, but still acts like it did on 39-6-2. Tomorrow I'll try putting the sim in it, but I don' think it will help.
[Moto X4 Questions & Answers] redwoodie:
New problems. I put the SIM in the update looping X4 and it still fails at 94%. Then, after returning the SIM to the "good" working phone that updated to 39-6-5 successfully, it now won't stay connected either to Wifi or LTE. It was working fine a few minutes earlier before I switched the SIM. Tried reseating it a few times, no go. Acting just like the other phone that I had to flash EMS to to get connectivity back. Except, I don't have an EMS backup from this phone, only the looping one. Q: Is the IMEI baked into the EMS partition data, or baked into the phone hardware? Meanwhile I am leaving the SIM in the looping X4 as I need one that makes phone calls. Keeping Wifi off stalls the update looping.
[Moto X4 Questions & Answers] KrisM22:
very splattered incoherent thoughts:

Um... I thought the IMEI was baked into (flashed into) the phone hardware - so, at one point, it had to have been added to the phone since I don't believe the mobo... wait, if I change the mobo, I get a new IMEI, so... somebody put it there, but I would guess that it was electronically added to it after it checked good.. no, not necessarily, ... (call up Foxcomm and ask them how they do it ;) ) I don't know. Can you change the IMEI of a phone (I'm trying to think back...) Nope, I don't know.

That being the case with the SIM, I would be inclined to get a new SIM and call your carrier and change the SIM numbers to that new SIM, put it in and see what happens(actually you would have it in when you call the carrier)(but I would put it in the first phone!) and see what happens.

It seems obvious that the phone is changing the SIM. I had no idea it would do that. But somehow the hardware ID of the first phone is now being seen differently.

As to 94% that would be near or after the fastboot flash somename_b I would think, so maybe the file structure of the second phone is hosed?

Some carriers are sensitive to IMEI, is yours? When I changed phones in the past I used to call ATT and give them new IMEI, but I don't think I did that with this one.

---------- Post added at 12:44 AM ---------- Previous post was at 12:41 AM ----------

thoughts on IMEI disappearing - some folks experience that but it seems if they go back to an previous rom it "re-appears" which means to me that it never disappeared, just couldn't be seen because rom thought it was in a different place. or something like that...

---------- Post added at 12:46 AM ---------- Previous post was at 12:44 AM ----------

In the phones that I have played with, this phone seems unique in its ability to be changed so that it cannot communicate with the carrier. Is it the phone, or what we are doing to it?

---------- Post added at 12:54 AM ---------- Previous post was at 12:46 AM ----------

I wish I could see your command log for the flash. The XML in the rom's zip encases the flash set with

fastboot oem fb_mode_set

...

fastboot oem fb_mode_clear

I do not know if that would be necessary if manually flashing but wondering if you did that? (I put together a bat prototype for -4 thinking I might have to do that when -5 was initially not going)
[Moto X4 Questions & Answers] redwoodie:
I did use the commands:

I was wondering why (or if) those are needed. The output after the first one was OKAY.

To be clear, the wonky phone still has its IMEI, at least it's shown under About Phone in Settings. My wondering about where it's baked in had to do with whether I could safely flash EMS on a different phone than it was backed up from.

The SIM is working for LTE/voice in the phone that refuses to update. This SIM been swapped many, many times between a large number of devices, and the gold contacts are very polished from many insertions, so maybe it has a problem. I'm on Verizon, they don't seem to care what phone the SIM is in or if I swap it between phones...inserting it has always activated devices within a few minutes. And I am pretty sure I can activate a SIM on their website.

But how could a SIM have any effect on Wifi? Or NFC for that matter--it and the Wifi icon are appearing and disappearing a couple of times a minute. After all, you can set up a factory rest phone ov3er Wifi/NFC just fine, no SIM required. This X4 worked fine for 2 days after the 39-6-5 update, then went bonkers after having its SIM removed and re-inserted.
[Moto X4 Questions & Answers] KrisM22:
no

yup, should be okay.

beats me. I am at a loss.
[Moto X4 Questions & Answers] redwoodie:
New SIM didn't help problem.

Saw this tutorial online. Wondering if my issue might be related.

https://www.theandroidsoul.com/fix-empty-imei-corrupted-efs-no-sim-unknown-baseband-wifibluetooth-issues-restoring-twrp-backup/

I'll try the suggested fastboot commands again, though they didn't fix it earlier.

fastboot erase modemst1
fastboot erase modemst2

If that fails I'll try flashing original stock Pie.

How can I find out if Slot A and Slot B each have their own EFS? Maybe extract a backup from the inactive slot?

And when flashing an OEM ROM, does it flash to the last active slot, or the inactive one?
[Moto X4 Questions & Answers] KrisM22:
Thanks for trying the new SIM.

Good luck with the erase's.

The idea that slot a&b have own EFS:: Don't know but guessing not as the possibility of having 2 different EFS's would be catastrophic to the phone - an update and it's gone. But I don't know.

I think when flashing an OEM ROM it's supposed to go to A. At least that seems to be the intent of the XML in the zip. Since it flashes the full ROM to A and a stub to B, it doesn't matter what the previous state of the phone was. That may be the purpose of that OEM flash line. But I think that it is quite possible, with some of the command strings I have seen, that it would go into B with the stub in A but try to boot to A, if that makes sense... which of course would be wrong. I believe RSDlite just grabed the XML and parsed and executed that info. Completely. but I don't know how it deals with this stuff:

<?xml version="1.0" ?>
<flashing> <header> <phone_model model="payton_fi"/>
<software_version version="payton_fi-user 9 PPWS29.69-39-6-4 4011a release-keysM660_7045.36.01.100R"/>
<subsidy_lock_config MD5="d41d8cd98f00b204e9800998ecf8427e" name="slcf_rev_d_default_v1.0.nvm"/>
<regulatory_config SHA1="da39a3ee5e6b4b0d3255bfef95601890afd80709" name="regulatory_info_default.png"/>
<sparsing enabled="true" max-sparse-size="536870912"/>
<interfaces>
<interface name="AP"/>
</interfaces>
</header>
<steps interface="AP">
<step operation="getvar" var="max-sparse-size"/>

maybe just ignore it?

I COULD BE WRONG ON ALL THIS!!!!!!!!!!!!!!!!!!!!!
[Moto X4 Questions & Answers] redwoodie:
Well whaddya know....flashed those erase modems t1/t2 commands and the Wifi, phone and NFC are back.

This phone, she is certainly a strange device, no yes?

For s#!ts and giggles I ran a getvar all...here's the output (this was before flashing modems, S/N and IMEI ***'d out

Wondering what the lines with "dirty" in them mean....corrupted stuff, or just related to unlocked BL? I saw similar lines from someone else's getvar in another X4 thread about lost Wifi/data/phone.
[Moto X4 Questions & Answers] redwoodie:
I have no idea how those smilies got into my code last post. Not in the code I pasted!

They replaced : and p with no space between them
[Moto X4 Questions & Answers] KrisM22:
the smilies are something that happens automagically by the editor.

here's mine - same dirty stuff - maybe throw in washer on heavy cycle... ;)

EXCELLENT that the erase's fixed that - very good to know!!!

---------- Post added 24th February 2020 at 12:17 AM ---------- Previous post was 23rd February 2020 at 11:59 PM ----------

that erase modemst1 and 2 may do nothing more than clear old settings. I hadn't really looked at that before, but it's in the XML so needs to be done.

---> Well done! Thanks!!!!!!!!!
[Moto X4 Questions & Answers] redwoodie:
You're welcome! Now to see if this new state has any durability. Like next taking OTA without issues.

Why it needed to have modems erased again is a mystery. Only thing I can think of, I was hot-swapping the SIM and maybe that buggered things. Will hereafter shut down phones before switching...though I never had a problem before now with hundreds of hot swaps. Guy at VZW today even told me hot swap's OK. Maybe not with this phone?

With or without Oxy-Clean?
[Moto X4 Questions & Answers] KrisM22:
def w/oxy clean and softener.

dunno - but glad you found and published a fix. I know a few folks are following this, hoping for a clue to their trashed phones. No clue for that yet but maybe some new ideas...

hot swap - I think I have mostly done cold but I know I inadvertently hot swapped this one because I plugged it in not fully and realized that when it was running. Didn't seem to bother it.
[Moto X4 Questions & Answers] redwoodie:
At this point, I'm not sure the issues I've had with the X4s are "solved." The scorecard: I have two working phones, one of which refuses to update, while the other lost radios after a "successful" update to 39-6-5. I was able to get radios back by running the erase modems t1/t2 commands in fastboot. On the non-updating one, I will probably wait until the full 39-6-5 FW is available and flash it. It may be that once these have been rooted (only real mod I have done besides BL unlock), then some fastboot meddling is required to keep them working. I've spent more time in fastboot this month than my entire previous Android experience, and it's getting a little old. As for assembling a tutorial on getting a rooted X4 back to stock and accepting OTAs, I can't identify a definitive "fix" or set of them for the issues, given that sometimes the same procedures have produced different results. My path has been so convoluted I'm not confident I could distill it to a workable set of steps. Bottom line, had I known what I was in for I never would have rooted the X4s, at least not before end of update support.

I saw on some other (earlier) threads about flashing stock that an additional command was added:

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

Wondering why that reboot command doesn't appear in the flashfile.xml and servicefile.xml files from the recent FFW. Maybe it's a relic from Oreo?

And....do A/B phones have a bootloader and boot.img in both slots? Maybe my inactive slot somehow retained the Magisk modified boot.img? Which would of course cause the OTA to fail.
[Moto X4 Questions & Answers] KrisM22:
a) Yes, I buy the "not wanting to post a "how-to" ". Cool.

b) yes, the idea there was that you would want to have booted to a Pie bootloader before actually going ahead and flashing a and b.

HOWEVER, I'm not at all sure that that is all that is necessary to prep a phone to flash a Pie. iow we don't know what the first Pie OTA upgrade did to change things from O to P.

This is pivotal and probably why folks are not able to successfully flash stock and get it to work. Again it would be fun to have a having-flashed-custom-rom destroyed phone so I could play with ideas, but of course I won't try mine, and, more importantly, I would likely tire of trying very quickly.

c) I don't believe so, but I don't know. Is there a partition reader for android that would tell me what the partition setup is?
[Moto X4 Questions & Answers] KrisM22:
some site somewhere not talking specifically about the X4 said: (something on androidcentral.com)

We do not have Treble. (actually the XML in our ROM zip says that.)

We have "seamless updates" - 2 different system partitions. They talk as if this was in existence after M, thoughprobably only on some phones.

Now, for us, I do not know how much beyond the 2 different system partitions we have because I am not rooted and cannot see.

---------- Post added at 09:16 PM ---------- Previous post was at 08:31 PM ----------

I grabbed twrp 3.3.1-0 from twrp.me and did fastboot boot twrp.img and looked around. Nothing is obvious to me. I did see a /system/system which I don't recall before so they may be doing it within current structures but meaning of "system-b" then evades me. It is the bootloader that is running all this, I think. so "system-b" means something to the bootloader which then does something appropriate.

---------- Post added at 09:16 PM ---------- Previous post was at 09:16 PM ----------

I grabbed twrp 3.3.1-0 from twrp.me and did fastboot boot twrp.img and looked around. Nothing is obvious to me. I did see a /system/system which I don't recall before so they may be doing it within current structures but meaning of "system-b" then evades me. It is the bootloader that is running all this, I think. so "system-b" means something to the bootloader which then does something appropriate. EDIT when leaving twrp I noticed that I could boot (had the choice in twrp) to slot a or b and at the moment for me b was the default. EDIT2 it is possible that it is simply showing me ONLY the contents of the default slot.

---------- Post added at 09:52 PM ---------- Previous post was at 09:16 PM ----------

app Treble Check could/should be run on messed up phones to maybe tell their owners what the state of the phone is. Maybe it's only got 1 partition set and thus flashing an 8.x might be in order. Just throwing out thoughts here as I don't know for sure and each case is different.
[Moto X4 Questions & Answers] KrisM22:
ref magisk stuff left in system - remember that when flashing a rom we first do an erase, then the flash, so if you didn't fastboot boot twrp.img and erase system,data,cache,dalvik before flashing stock, stuff will appear to be left in there. - the things you think of at 6AM! :D

---------- Post added at 06:55 AM ---------- Previous post was at 06:10 AM ----------

This begs the question: why not flash stock from twrp. in other words: put lolinet stock zip on SDcard, fastboot boot twrp.img , wipe all 4, and then, from within twrp, flash the zip. use latest 3.3.1-0 . What am I missing here? Why have I never done this? Things you think of at 7AM... :p
[Moto X4 Questions & Answers] akillenb:
So I've had similar issues previously and have loaded Lineage on the phone 2 or 3 times, and gone back to stock, seemingly successfully. Last time around, going from PPWS29.69-39-6-2 to -4 wouldn't work, I think because it said the phone was "corrupted". After Manually wiping and updating to -4, it seemed happy. Then -5 was going into never ending fail loops, and I got disgusted with Motorola and loaded Lineage 16 again, for about 2-3 weeks. That worked fine, although I was only usinf it on wifi - not with a SIM. Today, I wiped lineage and loaded -4. While the phone was loading apps from a google backup, I saw that it was doing "an update in the background". After it finished loading apps, and I tweaked some settings, I rebooted, and it now seems to be happily running with -5. Sigh..... There is some truth to the i-things saying of "it just runs" ..... I definitely prefer Android overall, but am currently using an iPhone 6s for my daily driver.
[Moto X4 Questions & Answers] KrisM22:
just to clarify, you say you "loaded -4" - can I ask how? what is your process. do you erase the 4 partitions before flash? how? Thanks. If there is a bat file involved for the flash and you are willing to share it could you attach it here or PM it to me? Thanks. Does it work on wifi and mobile? Is there anything it doesn't do? If so, you are the first I have heard about that went from Lineage back to a working stock.
[Moto X4 Questions & Answers] akillenb:
Can't say I've been totally consistent with my reload, but basically, fastboot the phone, then boot twrp, and I formatted data, then wiped everything but my external sd card, and rebooted to fastboot. I used the "flash-all" script from the "reload stock" thread, after editing to kind of match the flashfile.xml from the stock zip. I think the only real change was to add the oem fb_mode commands at the beginning and end.
[Moto X4 Questions & Answers] KrisM22:
Thanks. Yep. you used temp twrp to erase things.

Yep. I think that is critical.

And, yes, adding the OEM commands at beginning and end. I was unable to find a reload stock thread - could you give me a link to it. Thanks.
[Moto X4 Questions & Answers] akillenb:
Here's a link to the "flash official" thread:

https://xdaforums.com/moto-x4/how-to/guide-how-to-flash-official-factory-t3808348

If for some reason the link doesn't work, look in the Moto X4 Guides, News and Discussion forum.
[Moto X4 Questions & Answers] KrisM22:
Thanks. I knew it was from munchycool but wanted to make sure it still didn't have that re-lock command. Thanks. Since you have had success that way, do you suppose it might be successful if, after wiping the partitions, you stayed in temp twrp and just flashed (install) the stock ROM?
[Moto X4 Questions & Answers] akillenb:
I really never knew you could flash a stock zipfile with twrp. I feel safer either running fastboot commands one at a time, or with a good script.