yashsingh1/xdaforums huggingface dataset:
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] caain:
I'd wait for mightysween to weigh in on this. I haven't flashed his modified boot.img myself yet, though I did unlock the device in preparation for it. I forgot unlocking erases all userdata so I'm setting the thing up again.

We

think

what we downloaded from the Moto server in the other thread is a complete firmware package for the current X4 Fi build. It is untested apart from the boot.img, to my knowledge. Did you by chance look at your 'About Phone' screen before this? I would specifically be interested in what was under "Software Variant", "Software Channel", and "build number". You mentioned previously that you purchased your X4 from Best Buy, so we may be working with different animals as there are several X4 variants. I am no developer, but it's possible that the stock boot.img files differ between variants.

---------- Post added at 12:19 AM ---------- Previous post was at 12:11 AM ----------

So my "Motorola version" under the "About Phone" heading does report NPW26.83-34-0-1. However, my build number reports NPW26.4. Is this what yours is reading? Software variant reads google_fi, software channel reads retus. I wonder if it wouldn't be a good idea to get a cross comparison on these figures from those with Amazon and Best Buy devices.

I've got cold feet on flashing the boot.img after hotpl8 ran into issues, but I'm wondering if it's due to the variant differences. The firmware we got from the Moto server is NPW26.83-34-0-1, baseband M660_7020.05.01.52.01R. It ought to work as a backup for Fi variants, but I'd hate to be the first one that flashes it. Just mailed my N6 back to Google yesterday, so I've got no backup.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] DiDGR8:
For everybody worrying about the modified boot.img, I was able to flash it without issue and everything is running fine. Got Titanium BU and Root Explorer (and Busybox) running w/root privileges. Android Pay is borked, but unlocking the bootloader did that.

Bootloader Info:

AP fastboot Flash Mode (Secure)

BL: MBM-3.0-uefi-f02712d-171004

Baseband: M660_7020.05.01.052.01R PAYTON_NA_CUST

Product/Variant: payton XT1900-1 32GB P4

Serial Number: **********

CPU: SDM630 1.0 (2)

eMMC: 32GB SAMSUNG DD68MB RV=08 PV=02 FV=0000000000000002

DRAM: 3GB SAMSUNGLP4x DIE=12Gb M5=01 M6=06 M7=00 M8=0E

Console[NULL]: null

Tools Mode Config: DISABLED

Power OK

oem_locked	(before unlock)

flashing_unlocked	(after unlock)

Software status: Official

Connect USB Data Cable	(cable uncconected)

Transfer Mode: USB Connected	(cable connected)
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] hotpl8:
build number: NPW26.4

MOTO Version: NPW26.83-34-0-1

Software channel: retus

Baseband Version: M660_7020.05.01.52.01 R PAYTON_NA_CUST

of course this is after I tried the method above. Not sure if this changed anything?
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] caain:
Probably not. But what does your "software variant" tag read?

Your moto version, baseband, and software channel are all identical to the Fi variant, it seems.

---------- Post added at 12:51 AM ---------- Previous post was at 12:48 AM ----------

I gave it a whirl after setting up my phone again from the bootloader unlock. All went well after 2 or 3 reboots. My bootloader info looks the same as yours as well. I never used Android Pay anyway!

I posted on r/MotoX4 and r/Project Fi asking for "About Phone" info from the other variants. From hotpl8's comment it seems like the Best Buy variant is on the same build and baseband.

Has anyone seen anything in the firmware from the Moto server that suggests it is 100% Fi-specific? All I see is build and baseband references. I wonder if it could safely be used as a backup for all variants (assuming it is in fact intact).
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] hotpl8:
payton XT1900-1

Now I do not have much command on the SDK. My command prompt was letting me input and reboot but now I says its having an unknown error.

Where did you get the factory image for the Fi? Wonder if I can find the factory image for the non-fi variant
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] mightysween:
Just reading back through... I am not sure what the version from Best Buy is. This image was from the Project Fi version (which it says, in bold, at the top and bottom of the OP, where it also says not to flash it if you aren't familiar with the risks and getting yourself out of trouble)

If your firmware is the same as what is described in the OP, then just flash the stock boot.img from here:

https://drive.google.com/file/d/0ByZWXbOZqmVqbUV5T3ZvZEFBZ2M/view?usp=drivesdk

If not, then you will need to find yourself a factory image for whatever variant of the device you have.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] mightysween:
There is a 4+ page thread in this very forum about our struggles in trying to download the Project Fi variant factory image! I am not aware of any other factory images available at this time.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] mightysween:
Rooting any device is dangerous, I guess.

But rooting the x4 seems as safe and stable as any other device. Can't get more simple than flashing SuperSU...
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] rkleinhenz:
I just looked at oreo boot method 2 in the OP. Seems straightforward enough and I'll likely give it a try later today. The encryption issue only affects a flashed TWRP, is my understanding correct? So if I want to use TWRP later at any time, I just boot that TWRP image from fastboot, right? If I boot into recovery directly from the phone, I get stock recovery? That sounds pretty swell, actually!!!!
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] bombaglad:
dangerous? all you have to do is unlock bootloader and flash patched boot img via fastboot... 100% fine, passes safetynet and absolutely stable.. nothing dangerous i can see
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] gugu6897:
I agree. I have managed to root many devices before my actual Moto X4. And I never had a problem with rooting or going back to stock ROM. But Moto X4 is a recently released device, so it's difficult to undo changes if some sh*t happens. Just like you said in the OP: WARNING: Several users have run into trouble trying to do factory reset after root. You are risking your device and you need to know how to get yourself out of trouble if you find yourself in it.

BTW I appreciate your effort to bring us so effortly the option to fully manage our device.

Sure, but you need to realize that Moto X4 is released in many versions. Maybe the methods won't work with my model XT1900-6 (Brazil). So, at this moment I will not take the risk yet.

Anyway, I thank you both.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] aresbigboy:
I followed OREO ROOT METHOD #1 to root my x4 .

but device loop reboot over 5 minutes and never booted .

it's seem be right? or should I wait more minutes ?
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] rkleinhenz:
Success with oreo method #2

Worked like a charm, BIG THANKS for your work and this thread!!!

One question. Is there a way to suppress the 'lock your boot loader' messages without relocking the bootloader? (On my old X-Pure there was a special logo you could flash that would suppress these.)

Rich
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] rehanraza:
Yea i tried flashing that logo to hide this msg but it doesn't work on both Oreo or nougat.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] rkleinhenz:
Not so much nougat or oreo, it's the different phone. (It worked on X Pure nougat). I was hoping someone might have made the same modification to the X4's logo, or maybe there's a different way to go about this. If I relock the boot loader, I would have to set my phone up again. If I make a nandroid backup, would I be able to restore with a locked bootloader? I presume not but don't know. Maybe if I backup with titaniumbackup, relock, and restore using titanium backup I wouldn't have to do it all over again?
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] scoobster223:
[MENTION=3846884]rkleinhenz[/MENTION]

You had success leaving the device encrypted? I'd like to leave everything as stock as possible and encrypted too, but don't want to get into too much trouble if that's not a valid setup.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] rkleinhenz:
Yes it is encrypted. It really was straightforward, the only minor nuisance for me was having to set up the phone from scratch again, after I unlocked the bootloader,
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] mightysween:
Leaving the device encrypted is totally fine with root... unencrypt is only to make TWRP work.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] gugu6897:
If I do root and need to remove it to use my warranty, will be there any evidence that I rooted the device?
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] mightysween:
Safest to not root if this is a concern.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] Twski:
Well, by unlocking your bootloader you are requesting a code for Motorola and giving them your unique device ID. Only by requesting this code you already legally voided your warranty (and that will be on their database).

In my old phone (a Sony), that had a problem with the screen, they didn't gave a damn about the unlocked bootloader and gave me a new phone. But, at least in my country, it's almost certain Motorola won't do any repair if you unlocked the bl.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] gugu6897:
Got it. Thanks for the explanation. In my last device (LG 4X HD) I am almost sure that I just needed to flash stock ROM via KDZ and the phone software was acting like untouchable. But I do not know how Motorola and Moto X4 works, so I will wait a bit more, like I always do after buying a new phone (normally this threshold time do not last more than a month haha)
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] rehanraza:
i can confirm magisk does not pass safety net. neither does it install any module. says failed after installation from mangisk manager. i havent tried editing fstab for magisk( afraid to break modem connectivity) but it works fine supersu
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] rkleinhenz:
nandroid backup failed?

I tried to do a backup from the bootable TWRP and it failed.. I had selected all partitions. createTarFork() process ended with ERROR: 255 . Any ideas?

P.S. The backup stops immediately when it gets to the data partition backup

P.P.S. On third thought... I suspect the fact that data is encrypted is what's killing it?
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] mightysween:
Yes. That is why there are dozens of posts about TWRP decrypt not working, and instructions to unencrypt. ;)

https://xdaforums.com/moto-x4/development/dev-testing-t3707432
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] 法克儿:
Is this root available on Amazon's ad device
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] rkleinhenz:
Yeah, didn't click till after I'd tried :)
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] Jayman007:
I don't want to root until I know it will pass SN. Once I see confirmation that magisk is helping to pass SN I will jump on root.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] bamaredwingsfan:
Just to be clear, before I can do any of this, I still need to get the unlock bootloader code from Motorola, correct? I'm on the fi version and id like to just get root access so I can uninstall some bloat on my device.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] mightysween:
That is my assumption... but I have never tested anything with a locked BL, so maybe someone else who has can confirm??
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] Twski:
Yes, you do need. I can't use fastboot boot on locked bootloader.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] scoobster223:
Root working! Trying to flash Xposed

Hey [MENTION=3683732]mightysween[/MENTION] thanks for the clarification on root install and encryption. Took me a few days to get a micro SD to toss the SuperSU.zip on but I can confirm that booting off the TWRP___.img file and then flashing SuperSU worked really nicely and I have root on a everything else "stock" FI phone.

I have another flashing question though. I grabbed a beta version of Xposed for Oreo (sdk26) and went back to TWRP to flash. During the install, it tosses an error saying it can't mount /system as read-write. SuperSU had to have read-write didn't it? Is there a step I missed?
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] mightysween:
Wouldn't Xposed also need /data access? Would need to unencrypt in that case...

System should be mounting... make sure the "mount read only" thing didnt get checked accidentally
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] LionLorena:
If I use this method, you think it would be ok or safe to relock the bootloader? (after some days of test to determine if it is stable and perhaps unlock after any major alteration to the system in case something goes wrong).

Because I would love not to give up on device protection against thieves that turns the phone into a paperweight.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] DreXor:
I'm running on 7.1.1, did the boot.img load vs flash method, is there any options to get the OTA updates to work or am I still stuck in factory mode for a while?
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] mightysween:
From the OP:

Ergo, my answer is: flash factory 8.0.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] TheBassDude:
I recently rooted using Oreo Method #1 and am having a couple problems with Magisk. It doesn't pass the SafetyNet Check (both etsProfile and basicIntegrity come back false) and the MagiskHide option is also not working. Are these known bugs or is it possibly just an issue with my device? A lot of forums I've looked at recommend unrooting and re-flashing Magisk but I know our X4 is still in its infancy and being tinkered with and would understand if we simply don't have those features available yet.

EDIT: I now see that others are having this issue so sorry for the redundant post
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] Abomb:
I just got the oreo update and rootet with magisk which was easy (thanks for the nice description) and works. But I can'T install/flash magisk modules from the magisk manager, it always gives the error that magisk can not be found or wrong version is installed. Is there something I missed?
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] rehanraza80:
You need to repatch image again. Goto magisk manager click install. Select direct patch method. Once re patched you can install modules easily. Just dont install busy box from mm repo otherwisw you will end up in boot loop
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] kiyip:
I did the

fastboot boot boot.img step and it worked on my moto x4 7.1.1,

then I tried to reset my phone because I wanted to set it up as a new device so I could easily transfer all of my data from my old phone to this new one. However the moto x4 is now permenetly stuck on the androidone boot screen. I thought the fastboot boot command made it so that you could test boot images without worrying about messing up the actual boot partition, do I need to fastboot boot with a new boot.img or do I need to flash an old boot image? I also downloaded a firmware, maybe flashing that would fix it? I don't have a big budget so I really don't want to mess up this phone, but I may have already, thanks in advance for any advice.

EDIT: I fixed my boot loop by following this link using fastboot,

https://xdaforums.com/moto-x4/development/flash-official-frmware-moto-x4-t3730750
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] mightysween:
From the OP:

Also, you have misunderstood "fastboot boot". It does not install the image to the boot partition, but it still executes it.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] kiyip:
Thanks for your reply man, I definitely should have read the whole thing first, but I got exited about rooting my phone! Thanks for the easy to follow methods and your prompt/effective support
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] Slickademo:
I'm confused how updates work. I unrooted my phone and with no root it still fails. Do I need to encrypt my device or something? Re-lock bootloader?
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] mightysween:
From the OP:
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] Slickademo:
Sorry, I even read that. I just figured un rooting would fix it. Apparently not that easy
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] toddnez:
I just received update notification for OPW27.1.1

I am rooted. Should I attempt to install the OTA? Android one phone.

I read the OP and it doesn't seem to address the situation of being rooted and receiving the OTA, which is why I'm asking. Any help would be appreciated. Thanks.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] toddnez:
Pic
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] olive23:
Can you capture OTA please?
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] Slickademo:
I tried to un root and update and it did not work. Apparently we have to flash back to stock, update and re root.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] toddnez:
Ok. Thanks
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] mightysween:
Third time this question has been answered in the past few pages...even the post right before this one!

Directly from the OP:

Anyone else want to ask? ;)
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] toddnez:
Lol. I just figured it out.

Did it ever occur to you that maybe the reason people kept asking the same questions had more to do with your misuse of the English language rather than other people's reading comprehension.

You wrote you can't "receive" the OTA (which you clearly can), when you really meant you can't "install" the OTA

I politely asked a question indicating I had already read the OP, and thought I had a distinguishable question, so I wasn't trying to waste anyone's time, and I still get a knee jerk jackass response.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] mightysween:
In the course of spending hundreds of hours on TWRP and hundreds more readying bringup for building Lineage, I never considered that my "use of the English" language would be the cause for complaint.

My deepest apologies for saying you won't be able to receive the OTA.

Also...maybe think before you start leveling insults at the only person currently building software for your device.

The OTA question has been answered multiple times before in multiple threads.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] Slickademo:
I appreciate your work brother
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] mightysween:
Speaking of OTA, has anyone checked if FlashFire has been updated? That app is (on many devices) capable of intercepting the OTA and force installing it on rooted devices.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] rotorbudd:
You're complaining about your own lack of comprehension to someone who is doing all the this work at no cost to you?

What a Special Snowflake :laugh:
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] Slickademo:
I tried, doesn't work. Hangs up and doesn't finish.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] mightysween:
Cool, thanks for checking... I think Chainfire is on hiatus, so may not get many updates specific to our A/B issues.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] toddnez:
]

Lol. No. I was responding in kind to someone who needlessly attacked me for politely asking a question.

Why don't you actually read the posts before interjecting yourself, sycophant.

---------- Post added at 03:10 PM ---------- Previous post was at 02:51 PM ----------

Slickademo kindly responded to my question and I thanked him before you got involved.

So there was no point for you to respond except to be a jackass. I have asked questions in other forums to people who have accomplished far more than you, and none of them responded rudely.

Oh and as for your "maybe think before you start leveling insults at the only person currently building software for your device" I wouldnt care if you were the only person building software for Android," if you attack me for asking a question, I will respond appropriately.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] rotorbudd:
Ok, then maybe mightysween should just submit his posts to you for editing be before subimission.

Most people would just grasp the idea that he meant "install" when he typed "receive" and not be so pedantic to post to the thread.

BTW, your post wasn't polite. You were being a jackass yourself. (Lol)
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] mightysween:
Ladies and gentlemen, I again apologize for saying you can't *receive* an OTA.

I will try to work on my English language skills in between dealing with posts like this brilliant contribution.

Now, back to reality. Please.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] onurd:
So, I had to re-flash the 27.57-25-2 boot image to my Fi X4 so I can get/install the new update. If I were to go again the magisk route and flash the patched boot, will it be the old 27.57-25-2 image or does somebody have to patch the boot.img for every release and repost?
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] onurd:
Magisk Patched Boot Image for OPWA27.1.1

Nevermind. I kind of dug around and found it out myself.

For the people who are wondering how to install the OTA:

1) Download the whole original OREO firmware package from https://firmware.center/firmware/Motorola/Moto X4/Stock/

2) Flash the whole package using the tutorial form the other forum posts. You have to type all the fastboot commands except fastboot erase userdata ( so you don't erase your data)

3) Restart your phone, download and install the OPWA27.1.1 OTA

4) Restart when done

5) Use the method in the first post to boot into bootloader

6) Download, unzip and flash this MAGISK patched new boot.img (I dumped it using TWRP myself and patched it using MAGISK on my FI X4; it works for me but NO WARRANTIES as the rule goes here)

6) Enjoy the rooted January 2018 security update OREO on your X4.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] mightysween:
Yes, if the boot image was changed as part of the update, you would need to re-patch it... but with most updates in the past, this has not been the case. If someone with the OTA can compare the hash of the boot vs. the prior build, we could see if it is different
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] Slickademo:
As far as those commands go, do you do them one at a time or can you copy and paste all of them into the terminal at once? Sorry if that's a silly question.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] onurd:
You will have to type them one after the other (you have to wait to finish the previous one). You can create a batch file and execute that if you want.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] rkleinhenz:
Taking the OTA...

I am a bit baffled, perhaps someone can explain this to me. I wanted to take the Jan01'18 OTA, I had got the update available notification but my phone was rooted so I knew could not take it directly. OK, I flashed stock Oreo which went w/o a hitch. So now I am on the Dec01'17 but I do not have the update notification! When I check for updates I am told I'm up to date. Is there some way to access the update directly? The phone is an Android One (Project Fi). My wife has the exact same phone but hers is not rooted and I took the update on hers directly.

Should I perhaps have started from Nougat rather than Oreo?

Rich
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] Slickademo:
Not sure how to make a batch file. Is that a ".bat" used on Windows? I'm using Mac.
[Moto X4 ROMs, Kernels, Recoveries, & Other Develop] onurd:
You have to create a shell script but if you have never done it just copy and paste the lines one by one into a terminal screen.