yashsingh1/xdaforums huggingface dataset:
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] mightysween:
Was this a project Fi device, or retail?

Same ? to [MENTION=2916830]caain[/MENTION] ... project Fi or retail?

If anyone NOT on the Fi (sprout) variant has used this method to root, please chime in...
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] caain:
Project Fi. Worked without issue.

It seems like the only difference between his Best Buy version and the Fi version is the 'Software Variant' under About Phone. Build, moto version, baseband, kernel, etc. all seem the same. I'm not sure why your modified boot.img didn't work for him..
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] souleman:
That's what I thought, but always like to check. Not sure I'm going to do it until we know more about how the new partition system works.

Does flashfire work? If so, we should (hypothetically) be able to flash things without a modified recover partition, right? And since the bootloader hasn't actually been modified, should be able to flash magisk. And possibly Xposed.

Like i said, poorly hypothetical. Without having a proper way to recover if things go to crap, I'm not willing to test it myself.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] mightysween:
Best policy is to not tinker unless you know how to fix :)

I am setting up to try to build TWRP... had to purge my whole build system and start fresh, so will be awhile!

BTW, magisk 14.0 does not support this device... 14.3 is in beta with a/b support. Flashing it causes a bootloop.

Flashfire *should* work, I guess... but we have nothing to flash anyway :)
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] caain:
Notification LED works with root apps designed for Moto phones. It is small, white (no RGB, I think), and located just left of the earpiece. Per-app notifications do not work, and neither does blinking. Brightness adjustments do work. Screen on/off makes no difference.

A word of caution - I tried a LOT of apps with this. Only the ones designed for Moto/Lenovo seem to work (Light Flow does not). A lot of these apps are pretty terrible and buggy. I've got to the point where the LED light is stuck on, and somehow borked all my notifications in the process. Going to factory reset and start over. I'll post if root survives the reset, but I don't think it will.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] mightysween:
Interested to see what happens here. Obviously, SuperSU app will be gone... but kernel and /system changes would survive a reset that only includes userdata.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] caain:
Well, I'm hoping it's working properly because it's taking forever. I remember my Nexus 6 took quite a while to factory reset using the OS rather than TWRP (always fast). It's not bootlooping, but it is stuck at the AndroidOne screen. I'll leave it be for a while and see where it lands. Probably should have just done the reset through the bootloader, but I wasn't thinking.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] hotpl8:
I did try the flash you posted and it ran into an unknown error. I can't remember what exactly it said. But I ran out of time to really get into it. I after it got stuck on boot loop I restarted and had issue afterwards. On my second attempt to boot off image I lost some of the sdk functionality.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] caain:
Well guys, I'm now in the same boat as hotpl8. No baseband under bootloader. Kind of freaked out right now since this is my only phone. All I did was attempt a factory reset after flashing the modded boot.img. Going to try some of the other things mentioned on here now.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] mightysween:
Well, factory reset of a stock rooted rom has always been a crap shoot, especially from the OS "reset" option.

Did you try to wipe cache, davlik and factory reset from recovery??? That may be a good first step
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] caain:
Nothing I have tried has worked, and I've searched all over the place. I went through Moto-specific flashing directions on XDA and even flashed the modem from our Moto Server file. No joy.

So, I decided to be the guinea pig. I just flashed the firmware from the Moto server in its entirety. It is NOT Fi-specific. It's generic Moto X4. I was an idiot and also flashed a new logo, so I lost the Android One boot logo., but the phone booted and I'm going through setup now. Not happy about loosing my boot logo, but I'll flash it back to Android One if we ever get a copy of that.

I'll post when I have more info.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] mightysween:
There are always many guinea pigs with every brand new device. In a matter of weeks, we should have better stock firmwares and custom options to work with.

But, is the thing actually running OK on that firmware? Did you just repack the ZIP with the intact versions of all the files?
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] caain:
I'm hoping so, because now the thing yells "HELLO MOTO" when I boot it up. Very annoying. I did not repack, but used the full download I attempted to share through Mega the other day. I checked all the sums before flashing, and went one at a time (also following commands to 'erase' as I went along).

Yes, it appears to be working on this firmware. It is the same build and baseband version I was on before, and Fi just activated fine.

However, I am seeing that this is definitely not the Fi version of the Firmware. I appear to have all the 'extra' Moto bits on this firmware, and a slightly different launcher (transparent drawer rather than white). Moto Alexa is installed, as well as Moto Key, Moto Voice, and a greater amount of 'Moto' stuff in general. I miss my Fi version!!
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] mightysween:
FYI, this is directly from the OP:

I guess I will delete the rest... I assumed that people would realize that having TWRP simply means flashing your preferred root method.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] mightysween:
Updated OP with these instructions:
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] izzyfanto:
I have the Fi version.

Interesting, good to know, thanks for the tip!

Roger, I understand now, thanks for the clarification and hard work [MENTION=3683732]mightysween[/MENTION]!
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] disleyxc:
Hey guys,

a couple days ago I asked if a certain method worked to unlock Amazon Prime bootloader locked phones. Turns out someone on reddit posted a link to motorola unlock tool for their G5S and its unlocking amazon prime phones as well. Just did it on my X4. Im saving the key for later as I do not want to void the warranty just yet but get yours while you can.

Link to the thread: https://www.reddit.com/r/MotoG/comments/8oejjz/bootloader_unlock_for_amazon_prime_g5_plus/
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] bamaredwingsfan:
Wonder if it works on the fi Android one version of the x4
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] Z3RO2K:
Trying to install TWRP using the instructions here: https://twrp.me/motorola/motorolamotox4.html

Using the command:

It just keeps getting stuck, not doing anything:

My Bootloader is unlocked, I've tried different USB ports, USB Debugging is enabled, using the official latest ADB and Fastboot drivers from Google.

Cheers.

Edit: Fixed - Used minimal fastboot/adb and powershell. Spent an entire day/night on this issue.... ugh!
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] NTICompass:
So, you can bootloader unlock the Amazon Prime (with ads) Moto X4? I just bought a Moto X4 off eBay, and when I checked the listing I noticed it's the Amazon one...

I guess I'll wait until the phone gets here and just try the unlock... otherwise I'll need to return it (the eBay seller accepts returns).
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] ashishhsihsa:
Stock update

Will the device get OTA updates after twrp and root?

Or do we need flash stock images to keep it updated for stock?
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] olive23:
You need to be completely stock to receive and apply otas.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] NTICompass:
Didn't work with my "Prime Exclusive" Moto X4. Thanks, Amazon... Time to return this and get a *real* Moto X4.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] disleyxc:
Sorry to hear that friend. I guess I was lucky enough to have caught it at a time when Motorola's services were messing up. I have heard that this isn't the first time this has happened so if you're willing to wait for it to happen again then that's a possibility. I think that if you don't want to wait then you can probably get the Fi version for the same amount of money when you sign up and then cancel. Anyways best of luck to ya!
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] zenstonetiger:
alright...

I've finished unlocking the bootloader. However the May 1st OTA update is not completing through the OS (not sure why).

Where do i get the factory image (do i flash with adb?). And, after the quoted steps i should be able to start flashing roms?

Thank you for any help given.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] munchy_cool:
https://xdaforums.com/moto-x4/how-to/guide-how-to-flash-official-factory-t3808348

https://xdaforums.com/moto-x4/development/rom-lineage-os-15-1-t3802265
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] Zarxrax:
After rooting, how can I block the update nag-screen that I am getting at least once a day? It's not giving me an actual notificaiton that I can longpress to ignore, its a full screen thing that pops up.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] unfnknblvbl:
What's with how crazy this device is with fastboot? I can't for the life of me get mine to accept "fastboot boot twrp.img" - and it took several tries to get it to unlock, too!

I either get

E:\downloads> fastboot boot .\twrp-3.2.2-0-payton.img
downloading 'boot.img'...
FAILED (remote: unknown command)
finished. total time: 0.006s

or

E:\downloads> fastboot boot .\twrp-3.2.2-0-payton.img
downloading 'boot.img'...

...and it hangs for ages with no activity on the phone

is there a trick I'm missing?
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] gee one:
What do you get for fastboot getvar all?

I'm guessing you either have an old version of fastboot or a bad cable.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] gee one:
That's odd indeed. Maybe it's bad/weak memory?

I don't know if there are any diagnostics to test the memory.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] marckusdavis:
Keep stock everything, but root Moto X4?

Hopefully a simple question from a n00b:

If I want to keep everything stock (including recovery), and just root my (Project Fi) Moto X4, will the following work, and if not, what would the correct steps be?

1.) Make sure UDB/Debugging mode is enabled on my Moto X4

2.) Make sure I have the latest USB drivers, fastboot, and adb installed on my computer

3.) Make sure I have downloaded the TWRP image referenced in the OP

4.) Make sure I have downloaded something like SuperSU.zip and copied it to my Moto X4

5.) Unlock the bootloader of my Moto X4

6.) Boot my Moto X4 into fastboot/bootloader mode and connect it to my PC

7.) Execute the command "fastboot boot twrp.img" from my PC

8.) Use the now running TWRP to install the SuperSU.zip file on my Moto X4

9.) Reboot my Moto X4

Thanks!
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] munchy_cool:
use Magisk.

unlocking the bootloader will wipe all data, so backup.

Also, a detailed thread here.

https://xdaforums.com/moto-x4/how-to/guide-how-to-root-moto-x4-install-twrp-t3806460
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] marckusdavis:
Thanks, unfortunately that method does not keep stock recovery though...
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] munchy_cool:
dont flash twrp zip.

just flash magisk zip from twrp when you boot into twrp.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] marckusdavis:
Well, that's close to stock everything since Magisk can be hidden. Thanks, I'll check it out. I was hoping for a pure and simple root install, but that may have to suffice...
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] munchy_cool:
doesnt get any simple than this.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] darkdaemon32:
Know its a late/old response but if your still having this issue, I was having this same issue, the fastboot i was using was outdated, download the new minimal adb/fastboot package 1.4.3 from here and try again https://androidfilehost.com/?fid=962187416754459552

---------- Post added at 03:16 PM ---------- Previous post was at 03:13 PM ----------

Also make sure you have the correct drivers for this device, I couldn't even get my device to respond over fastboot at one point and had to get my drivers from some weird third party verizon "device recovery and support" software to be able to connect to my phone, not sure why the drivers i had didn't want to work. All of this information is good for posterity and thats the main reason I am listing it off even though the thread is fairly old. I spent hours finding all this information myself.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] unfnknblvbl:
Thank you. I did eventually get mine done - weirdly, it only worked once I hooked my phone up through my ancient monitor's built-in USB hub. Go figure.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] scoobster223:
Flash to stock for updates

I've got a successfully rooted X4 that's still running the old 8.0.0 OPW27.1 so I figured it was time to finally update.

I know I need to flash stock first to take OTA, but do I need to flash the same version as I have installed now (8.0.0) or can I flash a stock version of the version I want to upgrade to(8.1) or ultimately Pie? Are there any other considerations other than the ROM to flash? I've checked a few other threads on flashing upgrades, but none seem to take in to account a rooted device and things are different with this X4 compared to other phones I've modded.

Thanks!
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] jugoslavpetrovic:
I still got fresh non-rooted eu variant and have the exact same concerns. Pitty this device is not that much popular here as I got used to with nexies and this one rocks with performance better.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] Comby_sk:
I flashed rooted XT1900-7 reteu 8.0 version (stuck on june security patch) with 8.1 retus version (used script flash all) and than july OTA and august OTA. Than rooted again with magisk. Everything works fine.

My way how to flash and root:

1. fastboot flash 8.1 OPW28.46-21 (clear all) - do not reboot to system

2. reboot to stock recovery - install OTA from adb sideload - july OTA Blur_Version.28.231.8.payton.retail.en.US

3. reboot to bootloader and run stock recovery again - install OTA from adb sideload - august OTA Blur_Version.28.241.14.payton.retail.en.US

4. reboot to system

5. reboot to bootloader and use fastboot boot twrp.img

6. in twrp flash magisk and reboot to system

Next OTA i will use all that steps. 1. step will be fastboot flash without erase user data. And will be new 4. step - install third OTA, than fourth OTA etc.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] scoobster223:
Thanks! So it sounds like I can just flash a stock ROM through the standard recovery's sideloader and that will simply put it back to an unrooted state. After that it's a matter of booting TWRP and rooting again. I've just been hesitant to flash anything on it since it seems particularly easy to get into bootloops on this device.

I noticed you flashed each update in sequence eg July and then August. Is that necessary? I'm sitting back at the December update so does that mean I need to sideload Jan and then Feb and then... ...to get to current? I'm not super savvy on the way Android handles things like that, but it would seem like each update would contain a fully working core system as well as the updates? Or does each update install new packages that future versions are dependent on and it's assumed the last version took care of that?
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] Comby_sk:
Full ROM from 1. step contains all updates to june 2018. When come new full ROM (for example with september security patch), just flash that new full ROM.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] jugoslavpetrovic:
Good question.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] shonmac11:
The Motorola site said that my Moto X4 bootloader can't be unlocked. Does anyone know why and if there's a work around
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] darkdaemon32:
I would assume it's because you have the Amazon version. That bootloader can't be unlocked
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] shonmac11:
I got it from a leasing site but I don't know if it's the Amazon version. Do you know the model number for the Amazon varient?
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] darkdaemon32:
Open the device settings and look at the model info and it should give you a clue in that screen. Amz in the model or the firmware version would tell you it's an amazon model. You can also look on the device for the model number. If I'm not mistaken it's printed on the bottom next to the charging port. If you Google that model number it will tell you which variant you have. I don't have them all memorized.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] shonmac11:
I have the XT1900-1
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] darkdaemon32:
That should be the unlockable version. I have the same phone as my backup and it unlocked fine first try. Did you enable the oem unlock feature from the settings? Is it the website that gave you the unlocking error?
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] shonmac11:
Yes and yes. I'm pretty bummed about it because it was my daily driver. I wanted to put Pie on it but since I can't I'm using my Redmi Note 5 Pro with Pie installed. I'll try again after work
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] darkdaemon32:
Honestly if the website is giving you the no then there's not much you can do because your firmware is what gives you the unlock code. Don't think you can change anything. There may be a workaround if you wipe the phone completely and try using the retus image or something to reflash. But I didn't that would change anything
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] shonmac11:
I'll double check to see if the OEM unlocking is enabled
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] abrfilho:
Which software channel do you have?
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] shonmac11:
Retus
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] abrfilho:
This device is unlockable, you can try another browser or incognito mode, sometimes the website give an error.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] shonmac11:
Going to try again now. Will update you on the outcome

---------- Post added at 09:56 PM ---------- Previous post was at 09:33 PM ----------

Hey thanks. I got the bootloader unlocked
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] aliensea:
TWRP Keep System Read Only

fastboot boot recovery.img

Do i need to "allow modification" in twrp or "kept system read only" to install magisk?

FYI: I'm not planning to install custom ROM.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] LuisAngel321:
Just fastboot boot recovery.img->install magisk->reboot system
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] hugehead83:
FYI All: I just bought the Moto X4 Android One XT1900-1 from Amazon ($359, 4GB RAM, 64GB ROM). It came with Android 8.1.0, build OPW28.3 and security patch level from June 1, 2018.

I had the bootloader unlocked and TWRP & Magisk installed within ~20 minutes (latest releases as of this post).

This has got to be the easiest phone I've ever rooted (or maybe I'm just getting old?)

Thanks to all the devs and tinkers who have come before me on this device.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] wolfNitin:
I upgrade my moto x4 android 7 to 8 now i want to root my device. So i unlocked my bootloader then i tried to flash twrp by ( fastboot flash recovery twrp.img) this commend but it shows me failed.

How can i flash twrp in moto x4 ? Please tell me steps
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] Comby_sk:
You have to use boot command instead flash:

fastboot boot twrp.img

Than flash magisk.zip as usual.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] wolfNitin:
Can anyone send me link of firmware stock rom of XT1900-2 3+32GB Indian version

My phone bootloop:crying:
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] nitinbhalla95:
Can you tell me which one is mine there Moto x4 XT 1900 - 02. 3+32GB. Indian version
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] aohus:
im so annoyed. you can't unlock bootloader for amazon variant... should have checked xda before purchasing.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] Organics:
Has anyone tried this method while on Pie???
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] Comby_sk:
Yes, it works on pie (magisk flashed within twrp).
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] enriquejones666:
Did you already have TWRP installed before upgrading to pie? (I'm wondering if I can install TWRP, after I've already upgraded to pie)
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] Comby_sk:
I haven't TWRP installed, only booted.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] Brownstain:
If you just want root, you don't need TWRP to install a patched_boot.img. Just boot to the patched image and install permanent root from the Magisk app. This is a little safer than fastboot flashing the patched image since it won't brick the phone if the patched image is incorrect

1. Obtain the stock boot image somehow (this is the only hard part)

2. Copy stock image to your phone

3. In the Magisk app, Install, Patch Boot Image File

4. Copy the patched file back to your computer

5. Boot to bootloader (I'm assuming it's already unlocked)

6. fastboot boot patched_boot.img (Do not use fastboot flash which can bootloop the device if you obtained the wrong stock boot.img)

7. Install from Magisk app (Direct Install)
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] tjololo12:
I'm having issues getting magisk v18 installed. I flashed 8.1 stock this morning, upgraded to 9.0 through the OTA update, verified everything. Then I booted to twrp and flashed the magisk v18 zip file like I've done in the past. When I reboot, magisk manager shows magisk isn't installed and asks if I want to install it, but doesn't give the direct install option. It worked once with 17.1, but never again. I'm going to have to find a stock boot and reflash, then restart I think.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] darkdaemon32:
If you can get the boot.img from the OTA you can manually patch using magisk
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] tjololo12:
No dice. I just got the boot.img from an older version, patched it, booted from it, boot went fine, but it shows magisk is not installed and doesn't give me the direct install option. I might have to revert to the previous version and hope that something gets figured out, cuz it's just not working for me. Maybe I can try the canary build.

EDIT: I've rogered it good now. Got a nice little bootloop going from flashing the old version I originally flashed...****.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] jhedfors:
You could try restoring my backed-up stock Fi Pie boot (unmodified).

Re-assembling my attached files:

-Download the 3 zips

-remove last .zip extension from the 3 files.

-Extract the first file, and you should end up with two files: boot.emmc.win, and boot.emmc.win.sha2.

Put these files in a folder with your other TWRP backups, and restore.

Worth a try maybe?