[Nexus 6 Android Development] hlxanthus:
Depreciated!! See this thread for the new recommended package. All of my instruction below is still valid, just use the new package from thread linked here.

http://xdaforums.com/showthread.php?t=3234422

~~DISCLAIMER~~​

Flashing roms, kernels, and mods come with NO guarantee, NONE, ZILCH, NADA . . Do NOT use this package if you do not grasp and understand this concept. You have been warned.

This is a recovery flashable that will extract your boot.img, unpack all pieces, modify fstab.shamu to disable forced encryption, repackage, and flash boot.img back to system. It does NOT actually unencrypt your device. More on that later.

It will work on ANY kernel for this device, regardless of whether it is the stock kernel, or a custom ROM kernel. Also to date, it has shown to work on any version of android . . it is essentially future proof (unless google throws us a major curve ball in the future and radically alters how encryption is triggered at first boot).

Why use this? Who is this package for?

-If you are running 100% Stock Rom, but have a recovery installed and wish to unencrypt your storage. No root needed.

-Running a custom kernel you like, but it forces encryption and you want to change that.

-Currently unencrypted but want to flash a rom that uses FORCEENCRYPTION by default (cyanogenmod12).

-Just bored and want to toss the dice and see what happens.

That is pretty sweet right? Now you can flash anything and as long as you flash this afterwords, you wont have to worry about booting a rom and seeing that dreaded "Encrypting" screen anymore.

What doesn't this do?

-Well, to be blunt . . it does NOT actually UNENCRYPT your device. You will have to bite that bullet on your own, but I will offer some advice on that front later.

Changelog:

03/30/2015

Remove my ill advised attempt to auto patch nightlies, not possible

01/12/2015

Initial Build/Release

Includes fully working patch to initrd, specifically fstab.shamu to revert FORCEENCRYPTION by default.

Buglist:

Auto patch support removed, would never work anywayaddon.d support not currently working - fix is to flash this package with every nightly to preserve unencryption

How to download and install?

Download - NO_FORCE_ENCRYPT_shamu_v1.0-signed.zip

Reboot Recovery - TWRP only has been tested as working

Select "Install" and navigate to where ever you stored that file . . likely /sdcard/downloads/

Take a deep breath and wait for it to finish.

TADA . . done. Reboot and Profit!!

NOTE: You can feel free to flash this as part of a line of other packages.

Example: You are already unencrypted and want to flash Cyanogenmod 12 (assumes you have all packages downloaded already)

-TWRP factory reset (optional but recommended when coming from another rom)

--TWRP's built in factory reset function does quite well, but if you are like me and want a clean slate . .

---TWRP>Wipe>ADVANCED WIPE> and check System, Data, Cache (will leave internal storage intact). This is recommened specifically in conjunction with switching GApps.

-Install> and select all packages at once. I recommend the following order . . Rom, then my Kernel Patcher, then SuperSU (optional), then GApps last.

That was certainly easy right? Well the truth is, unless you are already unencrypted . . nothing will be different. You will still be encrypted. Bummer right? But that is where these next steps come in. They will give you the options available to reach the fabled unencrypted status!!

Below are the only three options I know of unencrypt once you are running a patched kernel. Select one below that works for you.

~~WARNING~~​

The below methods WILL erase EVERYTHING from data, including your INTERNAL STORAGE. Backup all important files, pictures, etc before proceeding. You have been told!!

-Go to Android>Settings>Backup & restore>Factory data reset (may not work properly with a custom recovery installed)

-Reboot to recovery and go to TWRP>Wipe>FORMAT DATA . . type "yes" to confirm

-Reboot to bootloader and type . .

fastboot format userdata

[note - I originally said to use the fastboot erase userdata function. This caused a recovery bootloop. Switching to "format" instead solved this issue. Thanks [MENTION=1437842]aussie1234[/MENTION] for pointing this issue out to me]

Edit: make sure you boot android first after unencrypting before going into recovery. This will allow the proper creation of multiuser partitions, otherwise, twrp will not use the proper /data/media/0/ as root of storage.

Some may notice there is an experimental addon.d included. This

NOT WORKING YET. DO NOT TRY AND USE IT.

Not quite sure yet where in the chain it is broken, but that will be a problem for another day. In theory it should, but . . read the "disclaimer" at the top of this post. The idea here is to be able to flash nightlies as they roll out without having to re-apply this patch manually every time. This function is NOT supported on Stock Roms. If you try it and it works, let me know. Do NOT come yelling to me that it did not work and crying that you are now encrypted again. No whiner babies allowed.[REMOVED: didn't work and caused conflicts with some packages]

At the core of this tool is a script build by [MENTION=3147360]dk_zero-cool[/MENTION] which can be found . . [DEV][INITRD][2013-10-25] Injector - An Android Ramdisk Injection Tool

Ultimately, this package is as much his as it is mine. It is his magic script that did the hard part, I just put it to work in a new way.

Please don't share this package directly, link them back here if needed. That way, they can get proper support and instruction for its use.

Also thanks to [MENTION=3124065]rascarlo[/MENTION] . . his github made it easy to find what needed modded.