yashsingh1/xdaforums huggingface dataset:
[Nexus 5X General] merpattersonnet:
What worked for me without a wipe, still encrypted

Here's how I ended up with a rooted and encrypted Nexus 5X:

Restore to factory install with ./flash-all.sh (may not be necessary from a factory install state, but not what I tested)

Let the system boot to beginning of initial setup wizard (if interrupted, encryption is corrupt and you have to start over)

Froce reboot into bootloader (hold down power button and volume down button at the same time until the bootloader screen appears)

Flash modified boot partition with 'fastboot flash boot boot.img'

Flash TWRP recovery with 'fastboot flash recovery twrp-###-bullhead.img'

Boot into recovery by selecting recovery with the volume buttons and pressing the power button

Sideload BETA-SuperSU-v###.zip

Reboot to system

Finish setup wizard

Enjoy an encrypted and rooted phone

There was a ton of trial and error so I hope this is reproducible but I offer no guarantee. :)
[Nexus 5X General] sn0warmy:
Very curious about this. Please post back with an update. The thought of not being able to use Android Pay, ruins it for me. I'm not going to own an Android phone, especially a Nexus device, and not root it. But I also want to be able to use Android pay for purchases. I use Apple Pay with my work-purchased iPhone 6s and I must say, once you experience that, you won't ever want to go back to pulling out your wallet.
[Nexus 5X General] IwantricexD:
Are there any drawbacks to rooting and keeping encryption versus rooting and disabling encryption? So far it seems the fingerprint reader is working (Android Pay doesn't, but we already knew that didn't work with root). Will it mess with getting OTAs or anything of that sort? I've never had an encrypted phone (coming from a Nexus 5 and OPO) so I don't know how encryption affects the bootloader unlocking/flashing TWRP/flashing Super SU process.
[Nexus 5X General] ATOMICTB:
Ok guys,

I unlocked and decrypted my 5X.

Speed increase is very noticeable. Apps open instantly on the first launch from a reboot. Once they are in memory it's just blistering. It wasn't this noticeable when I decrypted my Nexus 6.

I did not root so Android pay still works. I just wanted decrypted without root.

Update: Interestingly though, benchmarks are scoring lower now than what I am seeing on a bunch of benchmark videos on the 5X. Google may have optimizations for encryption?

Real world use seems quicker but if you are about to do this to your own 5X run a few benchmarks before and after for the hell of it. Might be interesting.

Update 2: My bad. The benchmark decrease was caused by Google syncing 40 metric ass-tons of my data in the background. I only mentioned Benchmarks at all because it was such a drastic difference. Everything looks ok now.
[Nexus 5X General] ubcjack:
If I just wanted decrypted without root, is flashing twrp necessary? Or only the modified boot img is enough?
[Nexus 5X General] sn0warmy:
Yep. Flash the modified boot image then you have to fastboot format user data, fastboot format cache and reboot.
[Nexus 5X General] ubcjack:
I'm sorry but I'm confused about the 'yep'

Do you mean it's not necessary to flash twrp and only modified boot img is needed.
[Nexus 5X General] mjondj:
can this be undone and returned to stock for returning to google?
[Nexus 5X General] johnpwu:
Bad news :( I gave it a try today and it wouldn't let me pay. I'm planning on trying one more place and will post an update when I do, but things aren't looking good.
[Nexus 5X General] Dri94:
Will this work with flashify instead of adb?
[Nexus 5X General] oldsk00lz:
With it encrypted, were you able to use Android Pay? (trying both with Root enabled/disabled) I think an unlocked bootloader will prevent, but just curious...
[Nexus 5X General] nyjumpman:
Hmm how did you end up doing that? I have access to adb in fastboot mode but not when the phone is booted up into regular system.

Where did you end up getting the ADB Interface driver?
[Nexus 5X General] btort1:
I think its somewhere in the page where you download android sdk. My problem was when i enabled usb debugging, it wouldn't recognize my phone even though I just unlocked bootloader the night before. So i looked at device manager and there was a yellow or red mark on my phone. I kept trying over and over and restarted 10 times and I even tried mac and it still can't find my phone which was wierd. So just google nexus driver's or something like that and search youtube. Thats what I did and finally able to flash modded boot image and then twrp after everything was working.
[Nexus 5X General] Baldilocks:
Is there any way to remove the "Warning" page at boot up? ((I guess we need a new logo.bin, huh?)) Maybe someone will come up with a nice Marshmallow logo. ;)
[Nexus 5X General] ubcjack:
Did anyone notice any improvement on using hdr+ after decrypt?

at the moment if i try to capture 3-4 hdr+ enabled pictues in a roll, camera app started to lag a bit... this is my main compliant for my n5x.

also hdr+ background processing seems longer than on n5. I assume it is due to increased mega pixel but if decrypt device would help, i'll do it
[Nexus 5X General] lupham1973:
Still awaiting delivery of my 5x. I know some of these questions have been asked, but I don't think they were fully answered yet.

With regards to root, removing encryption, and Android Pay. I've read that if you root, you can still add cards to Android Pay by temporarily disabling root via SuperSU. I've also read that if you are rooted, and attempt to pay with Android Pay, that it won't work. But I think I've read that if you disabled root temporarily via SuperSU prior to paying, that it will work. I don't plan to use Android Pay on a regular basis, but it would be a great backup for the times I forget my wallet, etc. And the extra time required to disable root temporarily would not be an issue.

But my main concern is removing encryption (don't need it, and still awaiting benchmarks showing before and after speeds). It seems unlocking the bootloader does not disable Android Pay as long as you are remain 'unrooted'? But I wonder if removing encryption will disable Android Pay (I'm guessing not but no one has confirmed this). Can anyone who has removed encryption, and has remained unrooted (or temporarily removed root via SuperSU) confirm if Android Pay still works? Does Android Pay still work if you have a custom recovery like TWRP and remain rooted? TWRP needs the device to be unencrypted to work correct?
[Nexus 5X General] agentdr8:
Decryption doesn't seem to help rapid HDR shots. I don't think it has to do with IO write speed, but more the increased processing needed. Watching top while taking multiple HDR+ shots shows:

User 70%, System 11%, IOW 0%, IRQ 1%
User 121 + Nice 745 + Sys 141 + Idle 206 + IOW 1 + IRQ 11 + SIRQ 6 = 1231

PID PR CPU% S #THR VSS RSS PCY UID Name
31763 2 61% S 65 2982044K 185420K fg u0_a47 com.google.android.GoogleCamera
901 3 3% S 98 2413188K 152580K fg system system_server

Very low/minimal iowait time, but the CPU cores are definitely stressed. This is with the userdata decrypted, zram disabled, and swappiness turned down to 1 (default is 60).
[Nexus 5X General] BlueZinc:
I am a little confused.

Folks are posting that that you don't need to decrypt in order to gain root.

Is there any disadvantage to maintaining encryption and gaining root versus decrypting first to get root?

:confused:

Thread for rooting encrypted 5X http://xdaforums.com/nexus-5x/general/root-unlock-removing-encryption-t3231369
[Nexus 5X General] eqjunkie829:
Haven't really seen a follow up if unencrypted is running significantly faster than encrypted. I don't really care about root right now, but I definitely don't want to wipe my phone if it's not going to make a difference.
[Nexus 5X General] Mbrook:
Is there a way to reverse this if I have to send it back to Google?
[Nexus 5X General] eqjunkie829:
Easily done by flashing factory stock image.
[Nexus 5X General] xperiatomaja:
qfuse in n5x? only 6p?
[Nexus 5X General] gangrif:
I have unlocked my bootloader, i'm hesitant to install root now though, as it sounds like android pay doesnt work with root. I'm not happy about that, i see the concern though. We need to be able to verify a secure client before we can accept it as a payment source. I wonder if we'll find a way around that.

I also have 0 interest in losing encryption. Even if there are performance gains to be had. Having my life on this little device in my pocket _requires_ encryption IMHO. If you lose your phone, and have android pay setup, and no encryption? Seems like a huge risk. I don't know what sort of data pay keeps on your device, but it seems pretty likely that someone could compromise your pay account if they got ahold of your devices local storage. And not just Pay, so many authentication sources on your phone. I wouldn't recommend removing encryption to anyone.
[Nexus 5X General] agentdr8:
No indication that the 5x has one as of yet.
[Nexus 5X General] merpattersonnet:
Right you are, Android Pay doesn't work.
[Nexus 5X General] lupham1973:
So I'm a bit confused here. Post #53 above states Android Pay does not work with it decrypted (but post does not mention if root was disabled or not).

Post #32 from ATOMICTB states Android Pay works with phone decrypted but unrooted. I assume bootloader was unlocked in order to decrypt the phone?
[Nexus 5X General] Mtk87:
Imho (not tested) android pay stops working when there are traces of root. Android pay is meant to work on devices without forced encryption, so that cannot be a way to distinguish when to stop running. Also, different bootloaders from different makers means that Android pay should be checking all this things before starting. So I think that as long as you keep far from root you can get Android pay.
[Nexus 5X General] Darkknight512:
Unlocking, flashing and rooting all went well thanks! Now I am restoring all my SMS and user apps from my Nexus 4 using Titanium Backup, nearly time to enjoy this phone. The fingerprint sensor is awesome!
[Nexus 5X General] gangrif:
I can say that the android pay app isn't giving me any complaints with an unlocked bootloader, but no other mods. I haven't tried actually using android pay to pay for anything though, it let me link a card and whatnot, but I dont have any retailers nearby that support it, so I havnet had the chance to try it.

I wanted to get the boot loader unlocked now, before I customized the phone. So i'd have the option to flash things later. I think i'm going to leave it clean until we find a way to make root and android pay work together (if that ever happens).
[Nexus 5X General] BlueZinc:
My Nexus 5X came with MDA89F, where do I find a modified boot image inorder to root? Any help would be greatly be appreciated.
[Nexus 5X General] szucsgf:
If I were you I would flash the latest MDB08I factory image, then follow the steps in the OP.
[Nexus 5X General] neopl666:
I would like to use this guide as well but my build is MDA89E.

Can I safely flash to MDB08I in order to follow this guide? What is the difference between the two builds? Are they not builds for different variants of 5x and someone on MDA89E should not flash to MDB08I? any clarification will be much appreciated, I can't take having unrooted phone for another day! thanks guys
[Nexus 5X General] 3's&7's:
Worked great, thanks for the reference guide here. I did not invest any amount of time with the device encrypted; arrived yesterday and immediately unlocked, decrypted, twrp, and root. For early adoption this was a pretty painless process to have control over a brand new nexus model.
[Nexus 5X General] rydare:
Great guide, worked flawlessly! My question is how will we install the OTA updates? I'm thinking it will involve sideloading the OTA via TWRP, and then flashing a new modified boot.img that matches the new version, and then finally installing the SuperSU.zip again via TWRP. Is this correct? I guess we'll know for sure once an update rolls out, but I'm just thinking ahead.
[Nexus 5X General] wiggy6230:
Thanks for the guide, all worked fine. All done to phone staright out of box :D

Is there a way to get rid of the Warning splash screen?
[Nexus 5X General] neopl666:
Thank you for this great guide. I ended up flashing build MDB08I (as mine was the one ending with the letter E) followed instructions and it worked flawlessly. I must add that this phone is SO MUCH faster and more responsive without encryption. So if any of you don't care for encryption, I highly recommend leaving it decrypted.
[Nexus 5X General] Baldilocks:
Now if you can make a modified logo.bin so we don't have to stare at the yellow triangle warning screen. ;)
[Nexus 5X General] deadlydreamx:
Any vids of encrypted vs decrypted yet?
[Nexus 5X General] dhruvraj:
Yes that's what I'm waiting for too
[Nexus 5X General] solara1973:
Are you referring to the message on boot that states that the device can't be checked because of the unlocked bootloader?

Does it go away if you relock the bootloader? And if you relock it does it affect root or anything else? I'm sure you can't flash anything new if its locked but if that's the only problem then it's easy enough to unlock it when you want to flash something?
[Nexus 5X General] rydare:
Do not relock the bootloader unless you are running the stock ROM signed by Google with stock recovery! Doing so with a modified ROM and/or recovery can brick the device. Although someone on these forums did make this mistake and were able to fix it. It's just something you really shouldn't do unless you know what you are doing.
[Nexus 5X General] nguyen21:
worked but ended up having to sideload su but worked fine after that
[Nexus 5X General] Michael_Meng:
After root 5x about half day. Performance get better. Useful guide
[Nexus 5X General] ethanfel:
I will probably unlock and unencrypt my futur n5x to be ready to root if i need it again but does it break OTA ?

And how can i remove encryption without rooting my phone ? :)

thx !
[Nexus 5X General] nitinvaid:
Yea it will break ota
[Nexus 5X General] badenglishihave:
Unencrypted Nexus 5X benchmarks

See attached photos.

Notes: on Androbench I used 256KB for sequential read/write buffer size, and 4KB for random read/write.
[Nexus 5X General] sgravel:
So I followed this guide to unlock bootloader and decrypt, but not root. I am guessing that, because I am currently using the modified boot image based on MDB08I, I can't go grab the system image for MDB08M and flash individual .img files for system, etc. in order to get on the latest build. I probably need to get a new boot image based on MDB08M which will not enforce encryption, right? Thanks
[Nexus 5X General] xxc0dvshal0xx:
Thanks for the info. Really good stuff
[Nexus 5X General] biohaz55:
MDB80M

For info guys.................. I've just flashed the MDB80M factory image then flashed the MDB80I modified boot.img from the 1st post and my N5X boots fine enabling me to continue with flashing recovery, removing encryption then flashing SuperSU
[Nexus 5X General] ethanfel:
thanks mate, that's a bummer :D
[Nexus 5X General] prokrypt:
I have one something I would like someone to test: after the user partition is made unencrypted, what happens when you flash the original boot.img back on?

I want to have an unencrypted device while still retaining the ability to use android pay (I will stay unrooted) and to do OTAs. I want to know if installing an OTA one day would suddenly nuke my precious [unencrypted] data.
[Nexus 5X General] chocmatic:
Delete
[Nexus 5X General] agentdr8:
OTAs by their very nature don't delete userdata. No one would ever update their device it if wiped their photos, docs, etc.
[Nexus 5X General] prokrypt:
This I understand. However, I do not know what will happen when the boot partition is replaced by an OTA update and the force encryption bits are set back to on. Will the system boot normally? Refuse to boot? Force a reformat? Re-encrypt the partition? etc...
[Nexus 5X General] agentdr8:
Oh I see. That's an interesting scenario. It could probably be tested now, by someone running unencrypted userdata, and then put the stock boot.img on.
[Nexus 5X General] TJSteveMX:
guys, i just got a Android System Update for November's security patches, i have modified boot and custom kernel, also Selinux permissible and encription disable, since its security patches its ok to restart/install? thanks in advanced.
[Nexus 5X General] teknoali:
thanks for all :) great working:cowboy:
[Nexus 5X General] firewoood:
worked for me!! Thanks a million!
[Nexus 5X General] androidsnax:
Worked for me, thanks?

Sent from my Nexus 5X
[Nexus 5X General] rydare:
You probably shouldn't attempt to install OTAs if you are running a custom kernel and modified boot.img. If you have TWRP recovery installed, it simply won't install. If you have stock recovery, there is the possibility that it will install and render the device unbootable.

The process for me for updating to build MDB08M was to download the zip file, and then flash:

radio-bullhead-xxxxxxx.img

bootloader-bullhead-xxxxx.img

boot.img (might be unnecessary, since we will flash a modified version later on.)

cache.img

system.img

vendor.img

While ignoring these:

recovery.img (would overwrite TWRP)

userdata.img (would erase your data)

I used this guide for the syntax and order for flashing, especially part 8. "How To Flash The Factory Images (And Return To Stock)". We're not going back to stock 100% but the process for flashing is very similar.

Before you reboot, flash the modified boot.img for your build (this allows your data to remain unencrypted and allows you to install SuperSU afterwards):

http://xdaforums.com/nexus-5x/gener...-beginners-t3206930/post63781454#post63781454

At this point I would do a regular boot just to make sure everything is working correctly.

Then you would flash your custom kernel again if you wanted to (I believe flashing system.img will bring you back to the stock kernel). Also this is the point where you would install the SuperSU zip in TWRP if you wanted to root.
[Nexus 5X General] ®azor:
hello, what about current 6.0.1 ? if i do understand everything correctly, we need a new boot.img, right?
[Nexus 5X General] rydare:
Here is the modified boot.img for the first 6.0.1 release
[Nexus 5X General] ®azor:
great)

everything worked. many thanks
[Nexus 5X General] vasili_defy:
Hey guys,

I followed the steps to the point but I am kinda stuck on boot image of Google..

Update : So I clean installed the ROM and the phone is booting ..sorry to reply late. Dint got to login to XDA
[Nexus 5X General] ®azor:
Please be more specific
[Nexus 5X General] Kennii:
after doing this mines still say encrypted :(

im on 6.0.1
[Nexus 5X General] ®azor:
Boot.img from the previous page + instructions frOm OP . that's it.
[Nexus 5X General] Kennii:
i tried it. steps are very simple. it still says encrypted ;(
[Nexus 5X General] cocaice2009:
This post really saved my Nexus 5X, thank you so much!
[Nexus 5X General] dkerlee:
Remember you need to allow OEM bootloader unlocking in the Developer Options under settings. Those need to be enabled too, from default, by clicking on <something> in settings seven times or whatever.
[Nexus 5X General] cspctec:
After following this method, am I able to install a custom ROM? Do I need to do anything specific before installing the custom ROM?
[Nexus 5X General] ®azor:
What I did was installing a custom rom and right after than installing a custom kernel which respects the current state of encryption
[Nexus 5X General] Schrotty35:
I have install the latest 6.0.1 on my Nexus 5x. How can i disabled the enctryption now? The bootimage on first post is for a older version.
[Nexus 5X General] Schrotty35:
Push

Gesendet von meinem Nexus 5X mit Tapatalk
[Nexus 5X General] SlimSnoopOS:
Fastboot format userdata (this will erase everything from your phone). Then install SuperSU 2.60+ or install a custom kernel that disables "forceencrypt."
[Nexus 5X General] Schrotty35:
Thank you. Whene i use cm13 is this the same way? Which kernel disabled forceencrypt?

Gesendet von meinem Nexus 5X mit Tapatalk
[Nexus 5X General] SlimSnoopOS:
I really don't know anything about CM13, sorry. CM seems to do their own thing. I know it will work on any other rom though. EX, Franco, Jolla, are a few kernels that support this. I am fairly certain every custom kernel has disabled that.
[Nexus 5X General] tacofromhell:
Nothing, looks like I was wrong :)
[Nexus 5X General] hmghmg:
So you mean I can EITHER install a custom kernel to keep my device from decrypting OR just Install SuperSU 2.60+? Because installing SuperSU 2.60+ feels like a more natural solution for me as I prefer keeping my kernels stock.
[Nexus 5X General] SlimSnoopOS:
No. To remove encryption, the userdata partition must be formatted first. Fastboot format userdata or format userdata in TWRP. Next, flash SuperSU or custom kernel to stay decrypted when you boot into the rom. The unmodified stock kernel forces encryption on boot.

Edit: format internal storage in TWRP
[Nexus 5X General] hmghmg:
Thank you for clarifying. Also, where do I go about finding the kernel in question for MHC19Q?
[Nexus 5X General] SlimSnoopOS:
The Nexus developer website has it. Download MHC19Q factory image, it is a 1+ GB file download. Once downloaded, you can find the boot.img (kernel) from the zip inside of the factory image tar file:

https://developers.google.com/android/nexus/images?hl=en
[Nexus 5X General] Xdevillived666:
Will this method work on N dev preview asw well?
[Nexus 5X General] SlimSnoopOS:
Yes, if you need to access TWRP. Preferably, start at fastboot and fastboot flash the modified boot.img from DP3 then format userdata. TWRP will work fine on N after that.

Modified boot.img can be found here:

http://xdaforums.com/showthread.php?t=3306684
[Nexus 5X General] andQlimax:
I unlocked the bootloadeer, flasthed twrp, flash supersu and wipe data, then boot the phone.

When it booted I saw it was encrypted! I understood that flashing supersu and the wipe data should decrypt it.

What I have to do? I feel a noob now

The first post is still valid? Do i need a modified boot? Supersu not enough?

EDIT: my fault, I should had "format data" in twrp, now it's decrypted :) Anyway first post could be updated
[Nexus 5X General] yoosefheidari:
hi

how can i wipe data/cache/dalvik on my n5x without install custom rdcovery?
[Nexus 5X General] datagubben:
I need help, after I "fastboot oem unlock" and then reoot, I got warning with orange triangle: Your bootloader needs to be locked for security purpose bla bla bla.

The mobile boots right away after 4 seconds but I dont want that!

Please help! :crying:
[Nexus 5X General] cilsoe:
When you unlock the bootloader, you get that message. That's just how it is.
[Nexus 5X General] Fif_:
Well at least on the 5X, you can flash a new imgdata and get rid of the warning. It won't get rid of the boot delay though.
[Nexus 5X General] VOLTAGEROCK:
Hope I'm not repeating someone's question already, but I can't download the SDK as my computer goes into "NOT RESPONDING" mode upon clicking save on the download link.

Is this an issue with windows 10 as four months ago I downloaded all of the needed files on a laptop using Vista that isn't available to me at this time?
[Nexus 5X General] sfhub:
Are you sure you actually need to download the SDK?

If all you want is adb and fastboot, you just need 4 files, not the whole SDK.
[Nexus 5X General] VOLTAGEROCK:
I just looked into this more, and I believe I'm in a different thread than I was in a few months ago.

So yes, I do have to go back into the right one and I believe you are correct.

Thanks.

Sent using my 5X on XDA
[Nexus 5X General] gbalerdi:
These are on a Nexus 6P forum, so they are for the N6p. Anywhere we can get the current modified boot.img for N5x?

Or are they the same?

Thanks

---------- Post added at 02:50 PM ---------- Previous post was at 02:40 PM ----------

Oh I found them. Here

http://xdaforums.com/nexus-5x/general/4-17-16-t3360574
[Nexus 5X General] nokiagye:
Hi if I disable the encryption with the next ota it's will come again?