yashsingh1/xdaforums huggingface dataset:
[Moto X4 Questions & Answers] redwoodie:
Mobile works with SIM installed. I shut down to install the SIM so it's stayed working through one reboot. I'm slightly encouraged.

Regarding restoring apps and data from Drive cloud backup, I came across this info on the link below. Apparently they added that ability to 8.1, but I can't find any way to do it in 9. I added my google account (skipped on initial setup), it offered to restore contacts but nothing else. Confirmed my backups are sitting there in Drive and no way to initiate a restore? This seems like elemental functionality, did they remove it from 9? Google is getting as dumb as M$oft.

https://www.xda-developers.com/android-8-1-restore-data-device-setup/
[Moto X4 Questions & Answers] KrisM22:
restoring google backup from cloud - I only know that when I tried it after an install, it didn't work/offer it.
[Moto X4 Questions & Answers] redwoodie:
Another reboot, back to intermittent Wifi/mobile. This is getting old.

I may try flashing my Feb 4 backup. Or I may run over it with the truck in the driveway. I'll decide later.
[Moto X4 Questions & Answers] KrisM22:
you say intermittent wifi, but still mobile working fine? or was sim removed again?

yeah, restore oldest backup for bad phone.

since that should include persist and efs, I am out of ideas.

truck in driveway seems a mite harsh but I feel your pain. Maybe you'll get another idea in coming weeks. What exactly did you do to that phone? I know no custom roms but I think majisk and plus what? It's tough for me to believe phone failure.
[Moto X4 Questions & Answers] redwoodie:
Wifi and mobile both connect and disconnect 2-3x per minute. I was able to make 1 call to my landline but it dropped after 3 seconds when mobile cut out.

All I ever did to it was unlock BL, root with Magisk, then unroot when OTA wouldn't take. Still refused OTA, so then flashed -4, that's when the radio problems started.
[Moto X4 Questions & Answers] KrisM22:
Thanks.

I assume everything in wi-fi preferences is off.

APN is selected.

settings/system/reset options/reset mobile,wifi,...

assure apps can't search wifi in background. (don't know setting - offered at setup)(set to no or off at setup.)

tethering off.

that's all I can think of at the moment...
[Moto X4 Questions & Answers] redwoodie:
Tried restoring the earliest TWRP backup, it just bootlooped (I didn't expect success, as it was already having problems when that backup was taken). Tried flashing -5, Wifi now connecting and disconnecting as before even after erasing modems t1/t2 again. No point in even trying SIM.

I think I may l try 26.69-26 later on, then give up if that fails. Other phone works fine but still on -4 and OTA fail. I'm wary of flashing -5 on it as it's my "working" phone.
[Moto X4 Questions & Answers] KrisM22:
agreed - if it works at all, leave it alone. I don't know if the problem is the phone or the software they are giving us. It seems very odd that you have corked 2 phones.
[Moto X4 Questions & Answers] redwoodie:
The problem would have to be Magisk, with a faulty unroot/restoration of the backup boot image . I had the bootloader unlocked on the working one since May but unrooted, it took OTAs fine. All the trouble started with unrooting to take -4.
[Moto X4 Questions & Answers] KrisM22:
yes but... I would have thought that any of these stock flashes would have given you a correct bootloader. I guess there must be some other info in some other partition that got screwed up.

Unlikely that rooting it would make any difference now, I suppose...

Maybe taking a system image of your other phone and restoring everything in it except EFS to the "bad" phone? unless you have an older system image of the good phone, in which case use that.
[Moto X4 Questions & Answers] redwoodie:
That's probably worth a try. I've done that successfully with other older phones. Restored full TWRP backups between multiple XT926's including apps and data, effectively cloning the phones. IMEI was never a problem.

Since I have a backup of the EFS on the Bad phone, I might even try using it too if "without it" fails. I assume I could restore the "bad phone" backup if IMEI migrated with EFS. I honestly suspect IMEI is actually hardcoded into a chip in the phone. And if this phone is as buggered as it seems, at some point there's little to lose. Most attempts to fix make it worse.

All this said, I have not successfully restored ANY TWRP backup on the X4.
[Moto X4 Questions & Answers] KrisM22:
yep. on another tangent I need to lengthen the time before voicemail picks up if no answer and that brought me back to a bunch of codes and in there I noticed a reset that you might try before trying anything else, but remember I haven't tried these and don't know what they'll do. I'll PM it to you but give me 5 minutes.

---------- Post added at 06:04 PM ---------- Previous post was at 05:45 PM ----------

"All this said, I have not successfully restored ANY TWRP backup on the X4."

yeah, could be twrp - I don't think Dees or whoever has one.

---------- Post added at 06:21 PM ---------- Previous post was at 06:04 PM ----------

remove your SD card for that reset...
[Moto X4 Questions & Answers] redwoodie:
Dees?
[Moto X4 Questions & Answers] KrisM22:
person that maintains twrp for one of the phones i used - don't remember which one.

actually "Maintainer: kaneawk, erfanoabdi" and I don't know either one.
[Moto X4 Questions & Answers] KrisM22:
somebody posted a question that gave me the idea to do a backup system image but no go: when going to SDcard I get

Backup failed. cleaning backup folder. (within 100bytes of 4128). tried twice. 50GB room on card.

So I tried it to internal but got, in red

cannot create /data/media/0/TWRP folder.

operation not permitted.

failed to make backup folder.

any ideas why I'm getting this?

on SDcard recovery log at end

I:Backup_Folder is: '/external_sd/TWRP/BACKUPS/serial/2020-03-24--19-06-04'
I:Calculating backup details...
* Total number of partitions to back up: 1
* Total size of all data: 4128MB
* Available space: 50771MB
[BACKUP STARTED]
* Backup Folder: /external_sd/TWRP/BACKUPS/serial/2020-03-24--19-06-04
Backing up System Image...
I:Reading '/dev/block/bootdevice/by-name/system_b', writing '/external_sd/TWRP/BACKUPS/serial/2020-03-24--19-06-04/system_image.emmc.win'
Truncating string cache entries.
Truncating string cache entries.
Truncating string cache entries.
Truncating string cache entries.
Truncating string cache entries.
Truncating string cache entries.
Truncating string cache entries.
Truncating string cache entries.
Truncating string cache entries.
Truncating string cache entries.
Truncating string cache entries.
I:Error writing destination fd (No such file or directory)
Backup Failed. Cleaning Backup Folder.
I:Copying file /tmp/recovery.log to /external_sd/TWRP/BACKUPS/serial/2020-03-24--19-06-04/recovery.log

There was no TWRP folder and thus no recovery log on internal.
[Moto X4 Questions & Answers] redwoodie:
Unreliable now working

This afternoon, being inside and bored numb on a cold COVID-19 day, I got the misbehaving X4 out and did some flashing. First, tried original Pie 29.69-26. No connectivity at all, mobile or wifi--on 3rd setup screen not even a MAC address. Nuthin'.

Flashed -2, much better results. Phone downloaded -4 and updated successfully, rebooted then downloaded -5 and updated successfully. Two reboots and mobile/wifi still working.

Whatever was buggered in the modems, apparently -2 was the fix. Or maybe it's just reflashing the last WORKING system you had.

Shoulda listened to KrisM22's nagging me to flash -2 sooner. Thanks Kris.

I'll repost in a couple of days if all is still well and we'll call this one solved, um, sorta anyway. I do still have to fix the other X4 that won't update from -4 to -5.

About the backup issue posted 3/25, I got similar messages trying to back up to SD and USB OTG. Try internal storage?
[Moto X4 Questions & Answers] KrisM22:
by -2 do you mean

XT1900-1_PAYTON_FI_9.0_PPW29.69-39-2_subsidy-DEFAULT_regulatory-DEFAULT_CFC.xml.zip

or

XT1900-1_PAYTON_FI_9.0_PPWS29.69-39-6-2_subsidy-DEFAULT_regulatory-DEFAULT_CFC.xml.zip
[Moto X4 Questions & Answers] redwoodie:
XT1900-1_PAYTON_FI_9.0_PPWS29.69-39-6-2_subsidy-DEFAULT_regulatory-DEFAULT_CFC.xml.zip
[Moto X4 Questions & Answers] KrisM22:
EXCELLENT!!!!!!!
[Moto X4 Questions & Answers] redwoodie:
Next steps...use phone a couple days, verify all functions (SFSG!)

Back up everything

Address 2nd phone still stuck on 29.69-39-6-4...wondering if I should flash -2 or -4?
[Moto X4 Questions & Answers] KrisM22:
I thought you already had done -4 on that one. I guess I'd try -2

Excellent progress!!!!!!!!!!
[Moto X4 Questions & Answers] redwoodie:
Just received update 29.69-39-6-6 on the recently resurrected X4.
[Moto X4 Questions & Answers] redwoodie:
Backing up, I got TWRP "Error opening '/persist/cache/recovery/.version' (No space left on device)"

Any ideas? The backup proceeded and seemed to complete OK.
[Moto X4 Questions & Answers] KrisM22:
alas, mine is unsuccessful. I'll deal with it tomorrow. Probably rebuild with -2.

I wonder if it is not liking the EFS etc restore.

No ideas. Thinking these TWRP backups are not dependable, so just re-build using google backup. Crude but seems to work........ Dunno.........
[Moto X4 Questions & Answers] redwoodie:
Sigh. Connectivity problems returned after -6 update. As before, wifi/mobile connecting/disconnecting and UI frequently restarting. It worked for a couple of days after I flashed -2 and it updated to -5.

Erased modems t1/t2 and working again...for now.

Luckily I didn't flash the other phone still stuck on -4.
[Moto X4 Questions & Answers] KrisM22:
Bah!
[Moto X4 Questions & Answers] redwoodie:
My sediments azackly
[Moto X4 Questions & Answers] KrisM22:
There is/are some stuffs on the phone that the factory put there, and, can exist in a single or double file system.

edit: so that sent me looking for how to list all partitions - that quickly gave me a headache since it's GPT. wouldn't matter anyway since we have no idea how to figure what was changed , and no way to get it back...
[Moto X4 Questions & Answers] redwoodie:
What about flashing something to the non-active slot?
[Moto X4 Questions & Answers] KrisM22:
how would that help?
[Moto X4 Questions & Answers] redwoodie:
I was thinking maybe somehow some residue of Magisk or root persists there, and that's why updates fail. Or modems go wonky.

I flashed -2 on the active slot, it updated to -4 and -5, seemed OK. So, did it swap slots for each update? Then 6 installed, probably to inactive, and reboot swapped to it. Somehow the modems didn't get erased on that update? Or there's some other garbage left there?

Hypothetically:

I flashed -2 to A

Phone installed -4 to B

Phone installed -5 to A

Phone installed -6 to B, modems crapped out

-2 and -4 were only active on the phone for an hour or less, and I didn't try to make calls but wifi worked long enough to download the updates. I never wiped "B", but you'd think the install script would take care of that.

I'm flailing about here. I would think if it swaps slots each update that everything old should be overwritten, but....what if Moto's update script doesn't "know" the phone was once rooted, and/or isn't configured to take a previously rooted phone back to ground zero stock?
[Moto X4 Questions & Answers] KrisM22:
I believe that's correct - or at least what they claim - that downloading the update puts a rom modified with that update in the other slot. But if so, I don'r see how there could be majisk residue there - unless it had been carried along with anything you do. And if you did now write to the not-in-use slot, how could you do it in such a way that it would clear that bad residue? Flailing around can sometimes be a very good thing.
[Moto X4 Questions & Answers] redwoodie:
Well, what if: 1) Magisk didn't perfectly restore the stock boot image on unrooting, and 2) the update didn't overwrite the boot image?
[Moto X4 Questions & Answers] KrisM22:
but don't you flash the boot image each time you flash a zip?
[Moto X4 Questions & Answers] redwoodie:
Yup. But where does that reside--what partition? When I flash boot.img am I dirty flashing it? Maybe a format is needed to decontaminate it?
[Moto X4 Questions & Answers] KrisM22:
"<step MD5="33e754d22e8da8865230ea36df487ba4" filename="bootloader.img" operation="flash" partition="bootloader"/>"

says it's going to some partition called bootloader.

I wonder if in 3310.img (twrp) there is a place to format and wipe it, along with the format data, and advanced wipe, before doing a flash. Though I was in there 5 minutes ago, I can't remember. I'm flashing -2 and restoring google backup which is huge so my phone will be tied up for a bit. I could check after that's done.

but doesn't fastboot flash bootloader - do that?

---------- Post added at 10:41 PM ---------- Previous post was at 10:34 PM ----------

fastboot erase bootloader ??? just before flashing it. Do at your own risk!!!!!!!!!!!!!!!!!!!!!!

---------- Post added at 10:43 PM ---------- Previous post was at 10:41 PM ----------

AND can you adb edit build.prop ??????????? (would like to remove a line from it without rooting and last time I tried superSU on the X4, it didn't root it)
[Moto X4 Questions & Answers] redwoodie:
Let me stew with that. Let me know how the flash and update went.
[Moto X4 Questions & Answers] KrisM22:
went fine: -2, 4, 5, 6. So my having restored EFS made no difference.
[Moto X4 Questions & Answers] redwoodie:
Great! as for backups, isn't there a way to do full backups/restores via ADB?
[Moto X4 Questions & Answers] KrisM22:
I don't know but probably. I always viewed stuff like that as crude, but people do it. :)
[Moto X4 Questions & Answers] redwoodie:
"Crude" might describe TWRP backups that are faulty & don't restore....
[Moto X4 Questions & Answers] KrisM22:
Yeah, that's true!
[Moto X4 Questions & Answers] KrisM22:
[MENTION=6507606]redwoodie[/MENTION] Is there an easy way to root this thing? that won't wreck it? I want to try a mod to build.prop. Thanks.
[Moto X4 Questions & Answers] redwoodie:
I only did it with Magisk. It rooted fine, but we both know the aftermath of trying to get back to stock.

In the next couple of days I'll try flashing -2 on my stuck on -4 phone that won't update, to see if I can get it back to normal. The one on -6 is doing fine.
[Moto X4 Questions & Answers] KrisM22:
Thanks, I was afraid of that.
[Moto X4 Questions & Answers] KrisM22:
Okay.

(edited!)

I was under the illusion from a post that I had read that there was a line in build.prop that would affect that(the delay to voicemail). So I flashed Magisk 20.4 I had to reboot twice but I could then use X-plore to edit build.prop, but, alas, that line was not there.

So, going back to stock: I format data, wipe all 3, flash -2, which took 4, 5, and 6 with no problems. - rigorously tested - works fine - no comm problems.

Okay I started another thread on the voicemail thing and finding that I can't have the app for the "fitbit" running on the phone - that makes the phone tolerable, I think, so I'm back on the X4, and YES, my build described above worked fine - no comm cutouts. many boots and tests on the delay to ringtone.
[Moto X4 Questions & Answers] redwoodie:
So here's some new strangeness. I wiped and flashed -2 on the other phone, the stuck-on-(-4) one, and I had the modems problem again with it. Tried erasing modems again, no go. I had put the SIM in it and mobile would connect for 3-5 seconds only, wifi same. then I put the SIM back in the working phone running -6, and the modem problem seemingly migrated to the "good" phone--same symptom cutting in/out etc. So I erased modems on it WITH THE SIM IN IT and it's back working again. I would have thought SIMS were 100% read-only? So putting the SIM in a non-connecting phone can apparently "infect" the next phone you switch it to? WTF, Android Coronavirus?

I will try your exact procedure above on the wonky one later and report results.

Are you wiping all 3 and formatting data in TWRP?
[Moto X4 Questions & Answers] KrisM22:
Yes, first wipe data, then back and advanced wipe all 3, then boot to bootloader and start the bat to flash the ROM.

I believe you have mentioned something like this cross infection in the past via the SIM card. I don't believe anything is being carried on the SIM card but I do believe that this build is sensitive to the presence/absence of a SIM card when it tries to use mobile. Though this last time I had no SIM in the X4 when I flashed it and took 4, 5, and 6. But then I stuck the SIM into it. But I could be all wrong on that.

This on/off behaviour of the modems seems to be unique to you - in other words I don't think I have heard that complaint elsewhere on any phone. And you have tried a different SIM.

No, I don't buy that your phone is defective. Unless somehow you have modded one of the other partitions.

You did do that copy partition thing that seems to be popular here. I have not and have no idea as to its effect. I was able to test 3 ROMs without using that. Probably because I tend not to read instructions and didn't know I was "supposed " to do that. (note: only PE10 made it necesary for me to fix EFS. Lineage16 and superiorOS did not, Though only PE10 actually worked for me.)
[Moto X4 Questions & Answers] redwoodie:
I'm blanking out on that--don't recall what it was.

You haven't done anything in TWRP to switch active slots, is that correct? Just flashed to the last active one?
[Moto X4 Questions & Answers] KrisM22:
No. I wouldn't know how to, or when to, switch slots.

EDIT - you know, thinking about that, I think the stuff in the bat file determines that as it says nothing (default) and -b for the dummy, so I don't know which slot it's actually putting it in.
[Moto X4 Questions & Answers] redwoodie:
Your back to stock mentions Format Data. I don't see where to do that in TWRP--do you just mean wipe? Wipe Data alone once, then Advanced Wipe Data, Dalvik & Cache?

Do you recall what the

was? Did you mean the Magisk patched boot image?
[Moto X4 Questions & Answers] redwoodie:
Advanced Wipe gives me these options: 1) Dalvik/Art Cache, 2) Data, 3) Internal Storage, 4) System, 5) Micro SD card. So wipe the first 2 and skip 3, 4 & 5?
[Moto X4 Questions & Answers] redwoodie:
OK, I just found Format Data!
[Moto X4 Questions & Answers] KrisM22:
Sorry for delay. I always wipe dalvik art cache, data, and system. so that's 1,2,4

I NEVER wipe internal storage or SDcard. so NEVER 3 or 5

EDIT system is your ROM, and data is your, well, data. :)
[Moto X4 Questions & Answers] redwoodie:
Ah. Your 4/14 post didn't mention System specifically, just said "all 3". TWRP's standard wipe is Dalvik, ART cache and Data, so I assumed those 3 but I guess Dalvik and Art are the same.

Thoughts on slot info/links?
[Moto X4 Questions & Answers] KrisM22:
The old twrp used to have as separate items:

dalvik/art

cache

data

system

internal

SDcard

So I was used to saying "all 4" where I meant Dalvik/art, data, cache, system.

twrp 3.3.1.0 has

wipe/ advanced wipe:

1 dalvik /art cache (this is one item)

2 data

3 internal

4 system

5 SDcard

So now I say all 3 (dalvik-art-cache, data, system).

3310 default wipe (factory reset) is "data, cache, and dalvik". Who knows if cache and dalvik here are considered the same thing.

But, yes, a factory reset does NOT clear system, just data and caches.

But prior to flashing a ROM you should do advanced 1,2, and 4 to get rid of residual cruft left from the previous ROM.

---

slot info/links - I know absolutely nothing about this other than to notice that in a flash of a stock zip, after it has flashed all of the parts of the ROM, it flashes a dummy (system_other.img) into "-b". which would be the "other-than-default-slot".
[Moto X4 Questions & Answers] redwoodie:
All makes sense, wiping system especially if you had a custom ROM. Going stock to stock, though, I'd think the factory script would do the job., and I don't see "erase system", apparently it dirty flashes the sparsechunks. I will reflash wiping system and see what I get.

I posted the slot links in the interest of expanding our knowledge. Current thoughts:

The phone was stuck on -4 in Slot A and refused to update. Getvar said slot B wasn't bootable and wasn't "successful" (meaning a bad flash earlier?) On the working phone, Getvar says slot a is active and both slot A and slot B are bootable. And it took 3 updates. So maybe with a borked slot B there is no way it CAN update until it's put right, since it's trying to write to that slot. Maybe partitions are bad (which I wouldn't know how to fix), or maybe a fresh flash of B will help. One of those posts claimed you could switch to the previously active slot as a "fallback" and boot from it.

My guess is the flash of (system_other.img) into "-b" is just bootloader and recovery, since it's small in size.
[Moto X4 Questions & Answers] KrisM22:
I would suppose that theoretically if b is borked, there should be a way to undo/redo things but I think just a normal stock flash would start you off correctly.

yeah I saw that fallback... no idea.

What we don't know is if one of the other partitions got modified somehow.

but anyway, try flash again clearing system before flash and see if any change.

Seems like in days past there was a definite reason why you had to wipe system before any ROM flash. I seem to remember something about gapps but that maybe was something else. Don't remember. Just got into the habit of doing it.

Factory reset is just for situations like having used a rom for a long time but it seems borked so want to start over. sometimes that fixes things, but often, not.
[Moto X4 Questions & Answers] redwoodie:
I just attempted to switch slots in TWRP and it gave an error, there is no bootloader on B. So without that I think the phone updating is not happening. The last flash of system_other.img with fastboot gave OK so I dunno what's wrong. If there's no bootloader to reboot to then I wouldn't be able to flash anything, and I'm afraid it might brick or bootloop the thing to try rebooting to B.
[Moto X4 Questions & Answers] KrisM22:
yeah. not terribly surprised. just do a regular stock flash.
[Moto X4 Questions & Answers] redwoodie:
Wifi still cutting out and mobile not working after system wipe/data format/flash.

Getvar now says both slots are bootable though.

That is, "slot-unbootable:_a: no" "slot-unbootable:_b: no"
[Moto X4 Questions & Answers] KrisM22:
I assume when you flash it you are using the 2

fastboot erase modemst1

fastboot erase modemst2

I have no idea what the problem could be other than maybe some other partition got changed when you were modding it.
[Moto X4 Questions & Answers] redwoodie:
Yes, and I even redid the erase t1/t2 again after 1st boot since that has fixed problems in the past.

Remember, the phone was working fine on -4 until I reflashed -2 yesterday and I used only the .bat file you put together. Haven't modded anything else since.

Later I may try switching slots and flashing again.
[Moto X4 Questions & Answers] KrisM22:
hopefully the "bat1" file.

Yeah, I'm outa guesses.

---------- Post added at 09:42 PM ---------- Previous post was at 09:28 PM ----------

when you tried another SIM I assume you stuck a new SIM in there and called up your carrier and gave them the new SIM number. ?
[Moto X4 Questions & Answers] KrisM22:
How's life?