yashsingh1/xdaforums huggingface dataset:
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] Slickademo:
Wish I could just flash it in twrp lol. Speaking of twrp, do I have to reinstall it? Thanks for all the responses, you've been very helpful.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] rkleinhenz:
Let me ask a different way since nobody responded. Has anyone reflashed a stock image (either nougat or oreo) and received the Jan1 security update OTA? Or is there a way to get the update without waiting for the invite?
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] Neffy27:
I'll reply to you. I'm rooted on Jan OTA Android one firmware. I might have time this weekend to do what you did. Sorry I could not be of more help. I don't know of any way to queue the OTA for your case.

When you do get the update notification, somehow or someway try to copy the OTA off the phone before the install competes. Though I'm unsure where it downloads to.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] rkleinhenz:
Thanks! What would I be looking for in terms of the update file?
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] Neffy27:
Some type of OWPS27.1.1.zip I'm assuming.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] Silently:
I can confirm the following workflow:

1. Download stock .zip that matches current phone version (see this post for more information)

2. Extract boot.img from that .zip

3. Install MagiskManager and use the patch boot image option to, you guessed it, patch the stock boot.img file and then rename as boot_magisk.img

4. With an unlocked bootloader, run fastboot boot boot_magisk.img and confirm that the phone boots and MagiskManager sees that the phone is rooted

5. Run the command fastboot flash boot boot_magisk.img

6. The phone is now rooted!
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] shurik_1:
Pardon my ignorance despite having read the entire thread but this is is going to be the first device I root. My main (if not the only) purpose of rooting is to be able to make full backups so that if the device starts acting funny I could easily restore without factory reset and manual reinstall of all apps. It looked I can simply follow OP rooting method and then the preferred app to do the task is Flashfire. Yet, I got confused by [RECOVERY][UNOFFICIAL][TWRP 3.2.1]... thread. Is that another (or better) way to achieve my objective or are these complimentary/mutually exclusive? Thank you.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] Neffy27:
Do you have a copy of the boot.img from a 8.0 Fi Android One firmware with Jan patch applied?

---------- Post added at 06:18 PM ---------- Previous post was at 06:17 PM ----------

Having TWRP as your recovery to perform backups would be the preferred choice.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] Silently:
No, but if you download some stock firmware files with _FI_ and OPW27.XX in the name you can look at the information inside them to check if they are what you need.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] bombaglad:
hi, after using the patched boot.img for a long time, one magisk module misbehaved, and now i can't boot system (frozen on booting screen), only fastboot is available but any attempt to flash or boot an img results in a FAILED (remote: unknown command) error. any suggestions how to get it working again? the drivers are the same i have used before, and "fastboot devices" correctly identifies my device... thanks!
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] elliotn28:
Thanks to whoever posted links/references to stock images. I was able to flash my Moto X4 Android One device and get the OTA successfully!

For flashing, I extracted the info from flashfile.xml (in PAYTON_FI_OPW27.57-25-2_subsidy-DEFAULT_regulatory-DEFAULT_CFC.xml.zip) and ran the following commands. (I did not erase userdata though.)

fastboot getvar max-sparse-size

fastboot oem fb_mode_set

fastboot flash partition gpt.bin

fastboot flash bootloader bootloader.img

fastboot flash modem NON-HLOS.bin

fastboot flash fsg fsg.mbn

fastboot erase modemst1

fastboot erase modemst2

fastboot flash bluetooth BTFM.bin

fastboot flash dsp dspso.bin

fastboot flash logo logo.bin

fastboot flash boot boot.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 system system.img_sparsechunk.5

fastboot flash system system.img_sparsechunk.6

fastboot flash system_b system_other.img

fastboot flash oem oem.img

fastboot erase carrier

# DID NOT RUN THIS!!!! fastboot erase userdata

fastboot erase ddr

fastboot oem fb_mode_clear
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] androidnandroid:
Thanx a lot
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] marckusdavis:
Were you rooted, and if so, were you able to successfully re-reroot?
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] elliotn28:
I honestly didn't try re-rooting.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] Horror Business:
I used this method and I was able to re-root with the patched img in post #236.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] flamand:
Sorry if this is the wrong place to post this question. I'm wondering if rooting in itself trips safety net. I don't need magisk. The only reason I need root right now is for data profiles in Titanium Backup.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] darkdaemon32:
[/COLOR]

yes rooting will trip safetynet, either use magisk and systemless root or supersu and suhide to prevent safety net breaking
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] Neffy27:
Not to mention, you break OTA patching.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] TheBassDude:
I was originally rooted with Magisk and reflashed stock like [MENTION=5077758]elliotn28[/MENTION] did to take the updates. After that I had problems re-rooting with Magisk like I was, but was able to successfully flash SuperSU with the bootable TWRP.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] SR3TLAW:
What is the status of Root/Magisk and passing SafetyNet? Anyone want to save me the trouble of digging for the answer? lol
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] bombaglad:
magisk patched boot img works on original oreo update, passing safetynet reliably
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] SR3TLAW:
Wooo!

Im about to pull the trigger then. Thanks man
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] JaviLerma:
Hi, any chance to root with magisk and unencrypted data partition? I need modules, but i can´t flash because data is encrypted
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] Giocarro:
Did anyone try to root an xt1900-7 ?

I'd prefer not to be the bench-test just in case.

Edit: OK, not this is getting crazy! I'm not able to make the PC recognize the phone; I installed four different ADB and USB drivers packages, but in PC's device manager I still see an unrecognized device called Android payton S; obviously ADB and fastboot don't work.

Could anyone please share the exact drivers package they used?

I have a Windows 10 64 bit laptop by the way.

Thanks!
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] icarolessa:
Moto X4 Root Failed

Friends,

I tried to do root in Moto X4, I followed the tutorials in XDA and I could not. I searched for several links, some asking to download the modified boot.img, among others.

I unlocked the phone and now you have the unlock message. Can you send this message?

Someone got root because I can not do this. Thank you for your help
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] PherChe:
whats your suggetions

Magisk or SuperSu

I understand magisk is systemless and SuperSu write system

Thanks
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] himesh82:
Hi all,

Bit baffled here. I have unlocked my bootloader but when i try to flash twrp recovery i get the error message below. Can any one help?

target reported max download size of 536870912 bytes

sending 'recovery' (21712 KB)...

OKAY [ 0.480s]

writing 'recovery'...

(bootloader) Invalid partition name recovery

FAILED (remote failure)

finished. total time: 0.484s
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] SR3TLAW:
[MENTION=3683732]mightysween[/MENTION]

X4 just arrived loaded with 7.1.1. If my goal is passing root/safetynet, should I upgrade to 8.0 before doing anything?
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] mightysween:
Personally, I use SuperSU, mainly because I just want root. Magisk seems like overkill if you don't need its other features.

There is no recovery partition. TWRP is a boot image.

I am not a Magisk user, so not sure of the status of SN on 8.x vs 7.x... anyone out there have any advice?
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] PherChe:
Well

Something change on my phone. Says status system: modified and flash stock and this messages doesn’t change. Any idea?
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] SR3TLAW:
Thank-you sir. I'll poke around Magisk forum and possibly ask in the X4 Q&A.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] osprey42:
I have the unlocked XT1900-1 and have taken all the OTA updates before unlocking my bootloader, which puts me on OPWS27.1.2. I successfully unlocked the bootloader (though it took several tries) and am now trying "Oreo Method #2", fastboot boot the bootable TWRP image to flash SuperSU. "fastboot devices" can see the phone (and indeed I used fastboot to unlock it), but when I try to boot twrp-x4-BOOTABLE.img it is stuck at "downloading 'boot.img'..." until I pull the cable or restart the phone. Has anyone had success with this bootable TWRP and the February security update? Am I missing some kind of setting or setup steps?
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] TheBassDude:
[MENTION=9018136]osprey42[/MENTION] I was originally rooted using Oreo Method #1 but after updating to OPWS27.1.2 that method didn't seem to work. Method #2 flashing SuperSU in the bootable TWRP worked just fine for me though. Are you using the original USB-C cable? I've been told that can sometimes make a difference.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] GabrielRodriguesBR:
Hi , My Device Is XT 1900-6 , Brazil Version , But My OEM Not Allow to unlock , get one info Cannot enable OEM unlocking, says to connect to the internet or contact your carrier , Any Ideia ?

I'm In Rom PAYTON_OPWS27.57-40-6_subsidy-DEFAULT_regulatory-DEFAULT_CFC.xml !
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] osprey42:
Thanks, glad to hear at least that it *should* work. I had read that about the cable, I'm on the original one that came with the phone, tried different ports as well. I'll keep trying, maybe from a different PC, and check my fastboot version as well, currently have 5.1.1r36.

---------- Post added at 11:37 AM ---------- Previous post was at 10:59 AM ----------

Got the latest fastboot and adb from Google and tried again, with a slightly different result - 1st try failed (remote:unknown command), second try stuck at downloading boot.img again. I tried "getvar all" and I get some wildly different results every time, sometimes I get the full list, sometimes it looks like things are cut off. Seems like a bad connection, I've tried multiple cables, I'll try a different PC next. One question I had from looking at the getvar output, I see these two lines:

(bootloader) secure: yes

(bootloader) securestate: flashing_unlocked

Is this expected (the secure:yes part)? I read on another thread that means the bootloader is not unlocked, but it does give me the warning message about unlocked bootloader on startup and shows flashing_unlocked on the bootloader screen.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] SR3TLAW:
[MENTION=7109285]TheBassDude[/MENTION] [MENTION=9018136]osprey42[/MENTION]

After reading it sounds like y’all are both rooting 8.0. My device just came in and I’m trying to figure out if I should upgrade to 8.0 and then unlock and root.

Any luck with Magisk?
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] zrex:
---------- Post added at 03:17 PM ---------- Previous post was at 03:06 PM ----------

[/COLOR]

I got it to flash, but now it is stuff between the warning screen and the white screen with the colored bar and the red moto at the bottom
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] robsharp78:
I followed Oreo Method #2 and it worked with one hicup. The installed SuperSU just hung and never launched after selecting start. I uninstalled and reinstalled via the play store and all was well. Thank You! I have a moto X4 from bestbuy the XT-1900-01 variant.

Spoke too soon it's hanging on boot :-\
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] KenNashua:
Dumb question, but I can temporarily root by booting, but not flashing the modified magisk boot image after unlocked the bootloader? I should be able to continue taking OTA update if reboot after my root requirements are done?
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] robsharp78:
My problem was caused by not reading the twrp prompts and having TWRP install itself after I flashed supersu. I will say the flash to stock method was very unreliable. I had to unplug and reset the phone multiple times to get mfastboot to flash the sparse chunk image files. I would flash .0 then .1 would hang and I would have to crtl-c mfastboot.exe and unplug the phone. On one occasion I had to powercycle the phone around chunk .5

Anyhow after a butt puckering few hours I am rooted using method2 on Oreo.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] rkleinhenz:
I installed the Feb 1 image. Then installed the official TWRP w/o a hitch. Then installed SuperSU (method 2 in the OP) - it all worked like a charm, no issues!!! :) Good deal!
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] bamaredwingsfan:
When you did the above mentioned method 2 to root. You did unlock the bootloader first correct?
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] robsharp78:
yeah I did the oem unlock first.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] birckston:
That would be really awesome if that worked. We could relock the bootloader after presumably too.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] birckston:
For Oreo method #2, is it possible to undo the SuperSU modifications without reflashing the world? What particular modifications does flashing SuperSU make? Just the boot partition? If so, does it patch both A and B partitions? If not, would flashing the other partition over the SuperSU'd partition work to completely remove root? :cowboy:
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] romhippo.com:
I am wondering whether there is also root method #3?

1. Install the official TWRP https://twrp.me/motorola/motorolamotox4.html

2. Flash Magisk Manager 16.x https://xdaforums.com/apps/magisk/official-magisk-v7-universal-systemless-t3473445

??
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] anonyo:
Yes, it works. I "flashed" the official TWRP and then flashed the latest Magisk 16.0 zip using TWRP. The Magisk properly patched the boot and everything. So now, I have working TWRP flashed and root with Magisk. Everything running smoothly without issues.

My phone details:

Model: XT1900-2 (Payton retail)

Android Version: 8.0.0

Motorola Version: OPW27.57-40 (December 1, 2017 patch level)
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] romhippo.com:
Yes, I thought so :) I think the answer is yes, but let me ask anyway ... Does your device pass the safetynet check?
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] anonyo:
No, it doesn't. But I don't mind that. Gaining root access is more important to me.

Edit: I think it doesn't pass Safetynet because I have installed Xposed as well, didn't check safetynet before installing that as I really don't care about safetynet.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] romhippo.com:
Yes, that is correct.

However, you can install xposed through the Magisk app - in a systemless way of course. That does not solve the safetnet check issue. But at least you can set "Magisk core only mode" (in the settings of Magisk), reboot, and then pass the safety check. To acticate xposed you just have to unset that mode again (and reboot).
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] :
I do not have xposed installed and I pass Safetynet. Rooted via magisk installer zip in official twrp.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] anonyo:
Yes, I have installed topjohnwu's Xposed in systemless mode only, And as I said, i really don't care about safetynet so I will never bother about all that rebooting. Thanks anyway.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] Davi p:
Guyz im getting trouble tryng to root this, can Someone help me??
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] krossifix:
Brilliant!! Able to confirm that Method 2 works flawlessly on XT1900-2.

1> phone in bootloader mode - installed firmware with feb security patch

2> rebooted device until set up screen and back to boot loader mode

3> booted to official twrp (not flash as quoted on the method)

4> flash SuperSU

5> from TWRP reboot to system and continue set up as usual.

of course unlocked the bootloader before performing all the above steps.

Thanks [MENTION=3683732]mightysween[/MENTION] for the rooting guide

just wondering if there is any way to have TWRP installed permanently instead of having to boot it from fastboot all the time.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] anonyo:
Download and installation instructions on official TWRP site https://twrp.me/motorola/motorolamotox4.html. I have permanently flashed TWRP using this method.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] mightysween:
I would recommend using official TWRP as it is now being regularly maintained.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] krossifix:
Awesome!! just what i was looking for.. she runs TWRP permanently now.. :good:
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] Davi p:
im getting this error on moto x4

this site dont allow me to post my images erros i will write then

fastboot flash recovery twrp.img - nothing happens

fastboot boot twrp.img(like on the tutorial)- downloading "boot.img" and nothing happens

please someone help me :/
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] anonyo:
Have you unlocked your bootloader? If yes, have you authorized fastboot access to your device? When you give command "fastboot devices" you should see in the command window something like this, "XYZ1234 devices". If you see "XYZ1234 unauthorized", that means you haven't authorized fastboot access.

Also, if you have an Amazon device, then I think you cannot do anything on it since you cannot unlock it (I may be wrong, but I believe so).

Also, as [MENTION=3683732]mightysween[/MENTION] has said in post #299, use the official TWRP and its installation instructions.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] mightysween:
You need to either fastboot flash to the BOOT partition (no recovery partition on this device), or fastboot boot the BOOTABLE version of TWRP (the others will not boot).
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] rczrider:
1.) Does the Magisk method work on the Android One (Project Fi) variant?

2.) The Oreo method doesn't mention unlocking the bootloader first. Does that mean it's not necessary, or is it an unwritten step?
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] Psycake:
Does this really work? This sounds like an easier and more straight-forward way of rooting. So why is the Magisk 15.3 patched boot image method (that can be confusing for some users and can no longer work after a certain update) mentioned in the original post instead of this one?
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] dimdom1919:
yes that works, even on my xt1900-7
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] Psycake:
Cool, thanks!
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] dimdom1919:
but so that the device is also decrypted you have to change a file in the first post then everything really goes. and xposed you can also install but only on the app the ZIP files do not want and I'm not sure if you can remove this because this ZIP does not want synonymous. Android P-ify works but only in v2.0.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] Psycake:
What? I can't much of what you're saying. What do you mean in your first sentence?
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] dimdom1919:
Ok Sorry I'm German and translate it with the Google translator.

In the first post in this thread, you have to change the file root (in this case, magisk). To decrypt the device. You have to do this now.

Xposed works too. But unfortunately only about the app. The ZIP file can not be flashed. It looks the same when you uninstall. The zip file does not work. Therefore, no idea if you can uninstall xposed.

Android P-ify works but only in the 2.0 version.

German:

In dem ersten Beitrag in diesem Thread steht man muss nach dem man root hat (in diesem Fall magisk) eine Datei ferändern. Damit man das Gerät entschlüsselt. Dies muss man auch jetzt tun.

Xposed funktioniert auch. Aber leider nur über die App. Die ZIP Datei lässt sich nicht flashen. Genauso sieht es auch beim deinstallieren aus. Die zip Datei funktioniert nicht. Daher keine Ahnung ob man xposed deinstallieren kann.

Android O-ify funktioniert auch aber nur in der 2.0 version.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] Psycake:
Okay, got it, but I still don't fully understand.

I only care about the first point. Would you mind explaining that a bit further? I understand I have to do something with the Magisk file to decrypt the file, but I don't know what or even what file (official Magisk image or this patched boot one).
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] dimdom1919:
Since we have some language difficulties here, I explain that much more closely.

Twrp and magisk install normally and then do this here.

1. With any root file editor/text editor (Amaze, Total Commander, etc) open /system/vendor/etc/fstab.qcom as a text file for editing.

2. At the end of the /data partition entry, delete "fileencryption=ice" and replace it with "encryptable=footer".

3. Save fstab.qcom (and make sure it is actually saved properly!)

Then restart and done. In the settings is still encrypted but if you click on it then you can encrypt the device.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] Psycake:
So this is just to decrypt it? Is it necessary? If not, what benefits does it have?
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] dimdom1919:
yes it's just to decrypt it. The benefits are that TWRP becomes fully functional and everything works what you want to do. otherwise there may be problems with installing some stuff in TWRP and root apps. but for substratum and similar things it is not necessary.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] Psycake:
Okay, thanks for the clarification. One more question though: I also have a Moto G5 Plus, and for that one I just wiped the sdcard and data partitions using TWRP. Can I do that here?
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] dimdom1919:
I happened to have a Moto G5 Plus and unfortunately no. Yes you can do it but not decrypt it. Unfortunately, the Moto G5 Plus is much simpler and different in terms of Custom Roms, Root and system changes.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] Psycake:
Ojay, thanks!
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] Psycake:
DUDE, I did this and now the phone doesn't boot. The system partition looks like it has lost the majority of its files. Do I have to reflash stock firmware?
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] dimdom1919:
yes I think that does not work anymore, because on the (Stock) February update that worked. But not in the (A1) March version. And now here. Then I do not think so, unfortunately, and yes, the stock Rome flash over it again.