[How-To] Disable Forced Encryption

Search This thread

glensta

Senior Member
Jul 1, 2010
1,646
408
Over here
Ok all don't smack me too hard Lol.

I'm rooted with twrp installed. Which one should I flash in Fastboot and sounds like it'll wipe data afterwards?

Thanks ahead.
 

bbedward

Inactive Recognized Developer
Jun 6, 2010
1,892
2,574
Cleveland, OH
Ok all don't smack me too hard Lol.

I'm rooted with twrp installed. Which one should I flash in Fastboot and sounds like it'll wipe data afterwards?

Thanks ahead.

Just follow the instructions and you'll be ok, twrp and root don't matter for it - it's just changing the kernel/ramfs partition out. You have to factory reset in order for the encryption to "turn off." Normally encryption is forced at bootup on the Nexus 6 (can't be disabled), this just gives you the ability to disable it - which apparently fixes some I/O read issues (as expected from an encryption SW layer I guess).
 
  • Like
Reactions: jjhiza

glensta

Senior Member
Jul 1, 2010
1,646
408
Over here
Just follow the instructions and you'll be ok, twrp and root don't matter for it - it's just changing the kernel/ramfs partition out. You have to factory reset in order for the encryption to "turn off." Normally encryption is forced at bootup on the Nexus 6 (can't be disabled), this just gives you the ability to disable it - which apparently fixes some I/O read issues (as expected from an encryption SW layer I guess).

I booted into fastboot mode and did the fastboot flash which said it completed. Then I did the fastboot erase user data to factory reset the device, no it's stuck in twrp recovery mode blinking on and off. Any suggestions? Do I need to reflash the factory image?
 

bbedward

Inactive Recognized Developer
Jun 6, 2010
1,892
2,574
Cleveland, OH
I booted into fastboot mode and did the fastboot flash which said it completed. Then I did the fastboot erase user data to factory reset the device, no it's stuck in twrp recovery mode blinking on and off. Any suggestions? Do I need to reflash the factory image?

That's weird. It shouldn't have anything to do with TWRP or recovery in general. If you can't get it to boot, then you're probably best of reflashing the factory image. (You did "fastboot flash boot" not "fastboot flash recovery" right :p)
 

Xileforce

Senior Member
Feb 27, 2012
3,057
3,125
This is awesome to hear! Hopefully we will be able to find out more about if the hardware is being utilized for the encryption after more devs start getting their hands on these.
 

glensta

Senior Member
Jul 1, 2010
1,646
408
Over here
That's weird. It shouldn't have anything to do with TWRP or recovery in general. If you can't get it to boot, then you're probably best of reflashing the factory image. (You did "fastboot flash boot" not "fastboot flash recovery" right :p)

Lol yes I did. I actually copied/pasted the command. Ok I'll reflash the factory image and go from there. Thanks
 

Berzerker7

Senior Member
Jan 17, 2010
847
257
If I have backups (from TiBu) created while the entire phone is encrypted and I pull the backups off the storage, can they be restored on the phone after I go through the process to disable mandatory encryption, or on any other unencrypted phone?
 

cheami

Senior Member
Nov 20, 2011
465
163
I am also getting FAST reboots into Google screen and TWRP. I was unlocked/rooted/TWRP before I attempted each step 100%. Stuck in boot loot.

I tried flashing stock image then again and nothing,
 

Lebage

Senior Member
Oct 28, 2014
105
13
Just went through the whole nine yards with my shiny new N6: unlocked, rooted, TWRP and now forced de-encryption. Really curious if the disabled auto encryption will improve battery.
 

glensta

Senior Member
Jul 1, 2010
1,646
408
Over here
I am also getting FAST reboots into Google screen and TWRP. I was unlocked/rooted/TWRP before I attempted each step 100%. Stuck in boot loot.

I tried flashing stock image then again and nothing,

Hmmmmm could be a pattern.

I tried flashing the factory image and this is what I"m getting:

C:\adt-bundle-windows-x86_64-20140702\sdk\platform-tools>flash-al
target reported max download size of 536870912 bytes
sending 'bootloader' (3807 KB)...
OKAY [ 0.122s]
writing 'bootloader'...
(bootloader) flashing partition ...
(bootloader) This may take a few seconds if a
(bootloader) different partition table is being
(bootloader) flashed since we need to backup
(bootloader) and restore a few partitions
(bootloader) Flashing primary GPT image...
(bootloader) Flashing backup GPT image...
(bootloader) flashing aboot ...
(bootloader) flashing sbl1 ...
(bootloader) flashing rpm ...
(bootloader) flashing tz ...
(bootloader) flashing sdi ...
(bootloader) flashing logo ...
OKAY [ 0.333s]
finished. total time: 0.457s
rebooting into bootloader...
OKAY [ 0.002s]
finished. total time: 0.003s
target reported max download size of 536870912 bytes
sending 'radio' (67170 KB)...
OKAY [ 2.106s]
writing 'radio'...
(bootloader) flashing modem ...
(bootloader) flashing mdm1m9kefs1 ...
(bootloader) flashing mdm1m9kefs2 ...
(bootloader) flashing mdm1m9kefs3 ...
(bootloader) flashing versions ...
OKAY [ 0.686s]
finished. total time: 2.794s
rebooting into bootloader...
OKAY [ 0.002s]
finished. total time: 0.003s
target reported max download size of 536870912 bytes
archive does not contain 'boot.sig'
archive does not contain 'recovery.sig'
failed to allocate 1679592636 bytes
error: update package missing system.img
Press any key to exit...

STUCK!!!!!!!!!
 

cheami

Senior Member
Nov 20, 2011
465
163
Hmmmmm could be a pattern.

I tried flashing the factory image and this is what I"m getting:

C:\adt-bundle-windows-x86_64-20140702\sdk\platform-tools>flash-al
target reported max download size of 536870912 bytes
sending 'bootloader' (3807 KB)...
OKAY [ 0.122s]
writing 'bootloader'...
(bootloader) flashing partition ...
(bootloader) This may take a few seconds if a
(bootloader) different partition table is being
(bootloader) flashed since we need to backup
(bootloader) and restore a few partitions
(bootloader) Flashing primary GPT image...
(bootloader) Flashing backup GPT image...
(bootloader) flashing aboot ...
(bootloader) flashing sbl1 ...
(bootloader) flashing rpm ...
(bootloader) flashing tz ...
(bootloader) flashing sdi ...
(bootloader) flashing logo ...
OKAY [ 0.333s]
finished. total time: 0.457s
rebooting into bootloader...
OKAY [ 0.002s]
finished. total time: 0.003s
target reported max download size of 536870912 bytes
sending 'radio' (67170 KB)...
OKAY [ 2.106s]
writing 'radio'...
(bootloader) flashing modem ...
(bootloader) flashing mdm1m9kefs1 ...
(bootloader) flashing mdm1m9kefs2 ...
(bootloader) flashing mdm1m9kefs3 ...
(bootloader) flashing versions ...
OKAY [ 0.686s]
finished. total time: 2.794s
rebooting into bootloader...
OKAY [ 0.002s]
finished. total time: 0.003s
target reported max download size of 536870912 bytes
archive does not contain 'boot.sig'
archive does not contain 'recovery.sig'
failed to allocate 1679592636 bytes
error: update package missing system.img
Press any key to exit...

STUCK!!!!!!!!!

I did it the manual way just fine here: http://www.ibtimes.co.uk/how-fix-er...roid-5-0-factory-images-nexus-devices-1474865

Going to attempt disable forced encryption again.

Edit: Manually go back to stock that way then attempt to disable encrypt again. Worked 100% for me with the same error you pasted before (I received it also).
 
Last edited:

glensta

Senior Member
Jul 1, 2010
1,646
408
Over here
I did it the manual way just fine here: http://www.ibtimes.co.uk/how-fix-er...roid-5-0-factory-images-nexus-devices-1474865

Going to attempt disable forced encryption again.

Edit: Manually go back to stock that way then attempt to disable encrypt again. Worked 100% for me with the same error you pasted before (I received it also).

Cool thank you I'll give that a shot. :good:

Edit - seems to work, thanks so much @cheami! I'm all out of thanks for the day but really appreciate it. I was swettin' bullets
 
Last edited:

tflogic

Senior Member
Apr 24, 2011
306
82
just a quick silly question. by disabling encryption, would it have any positive benefits for battery life?
 

Xileforce

Senior Member
Feb 27, 2012
3,057
3,125
just a quick silly question. by disabling encryption, would it have any positive benefits for battery life?
In my mind it makes sense that it should especially in the event that its not utilizing the hardware to do it as it is believed. I have to imagine that the CPU cycles required to de encrypt the files needed every time is worse not only for CPU performance, but for the battery as well. How much of course, I have no clue.

---------- Post added at 11:19 PM ---------- Previous post was at 11:17 PM ----------

Just went through the whole nine yards with my shiny new N6: unlocked, rooted, TWRP and now forced de-encryption. Really curious if the disabled auto encryption will improve battery.
Please let us know when u get results! I'm sure many are eagerly waiting.
 

Lebage

Senior Member
Oct 28, 2014
105
13
In my mind it makes sense that it should especially in the event that its not utilizing the hardware to do it as it is believed. I have to imagine that the CPU cycles required to de encrypt the files needed every time is worse not only for CPU performance, but for the battery as well. How much of course, I have no clue.

---------- Post added at 11:19 PM ---------- Previous post was at 11:17 PM ----------


Please let us know when u get results! I'm sure many are eagerly waiting.

Sure thing!
 

digitheatre

Senior Member
Aug 10, 2010
91
13
this is very interesting.. and someone even post this amazing result (he did ran few times just to confirm) .. is this true?

DdanQcll.png


if true than it is clear winner faster than iphone6+ except that it is not encrypted
SuHPtZG.png
 

italia0101

Senior Member
Nov 9, 2008
3,803
1,358
this is very interesting.. and someone even post this amazing result (he did ran few times just to confirm) .. is this true?

DdanQcll.png


if true than it is clear winner faster than iphone6+ except that it is not encrypted
SuHPtZG.png

Where did you find that ? can't verify its the N6 i guess.

---------- Post added at 09:06 AM ---------- Previous post was at 09:05 AM ----------

Thank you so much for this. Here are some quick I/O scores after disabling encryption.

http://imgur.com/DquRHEo

Does it feel any different in usage?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 206
    I'm not responsible for anything blah blah

    This is intended to disable forced encryption on the nexus 6. You can still encrypt the device after doing this, but it won't be automatically done.

    After observing how this force encryption stuff works, I got it mostly figured out. (It's entirely a SW layer, as is already widely known). Basically when all the devices from fstab are mounted in android with the forceencrypt option, fs_mgr sets a flag for encryption (something like IF This_Device_Isnt_Encrypted; then This_Device_Needs_Encryption). on devices (looks like android only allows you to encrypt 1 device, which is probably to prevent such cases as over-resource usage ,maybe some other conflict that it doesn't support over 1 device, idk) that have forceencrypt set on them, if it can't unmount the device before doing these encryption checks - in other words if it's usy (like a file is open) - it just skips encryption all together. So if the device had a file preventing it from being unmounted, it just says "oh well, skip encryption." I found this kinda odd behavior anyway :p

    You can still encrypt the device, it just isn't forced. Some people are complaining about the slowness of the encryption SW-layer (why force SW encryption? At least put some HW for it in the device). This makes it the way it probably should be - optional.

    Stock LMY47D/LMY47E/LMY47M/LMY47I (5.1.0) - No force encrypt:
    https://www.androidfilehost.com/?fid=95916177934540533

    Stock LRX22C (5.0.1) - No force encrypt:
    https://www.androidfilehost.com/?fid=95857557620392411

    Stock LRX21O (5.0) - No force encrypt:
    https://www.androidfilehost.com/?fid=95784891001613336

    Prerequisites:
    - You should be running the same build as the kernel you install (E.G. if you are running 5.1.0 LMY47D you should install the LM47D no force encrypt kernel)
    - Your bootloader must be unlocked (fastboot oem unlock)

    How-to install kernel:
    1.) Reboot to boot loader
    2.) Download the appropriate boot.img above
    3.) Install it via fastboot (fastboot flash boot boot_noforceencrypt.img)

    To disable forced encryption after kernel is installed:
    1.) Reboot to boot loader
    2.) Format userdata (fastboot format userdata) - This will erase all of your data (apps, sd card, etc.) - so make appropriate backups
    23
    5.0.1 boot image force encrypt disabled

    Disabled force encrypt in 5.0.1 (lrx22c)
    only change is forceencrypt->encryptable in fstab.shamu
    22
    I assume this boot.img will also work with the LYZ28E build?

    Here's one for LYZ28E

    Doesnt take a genius to mode the boot.img


    1. Extract the Android Image Kitchen zip i uploaded in this post
    2. drag in the boot.img file you wish to modify onto the unpackimg.bat file
    3. you should get a command window pop up, it should say succesfull and you will get a few folders added.
    4. open the ramdisk folder and open the fstab.shamu file using notepad++
    5. search for forceencrypt and replace it with encryptable. there should be only one case where this exists.
    6. save the file, go back to the root of the image kitchen folder, and run the repackimg.bat file.
    7. you should get a new boot.img build called image-new.img, you can use this now to flash on your device
    12
    Here's a link for the No Force Encrypt file I made for the MRA58K Nexus 6 Marshmallow factory image. Going to flash the files on to my phone now.

    PHP:
    http://www13.zippyshare.com/v/1lvgqKcI/file.html
    10
    Thanks! What do we do to upgrade from 5.0.1 to 5.1 exactly and keep the unencrypt?

    Couple of options, but first to note:
    - adb sideload from stock recovery will not work if you are not completely stock. It does a block-level update so it will fail if it finds a mismatch on the device boot.img and what it expects, like if you are already unencrypted.

    First option:
    - Flash the 5.1.0 factory image, and repeat the entire process
    - Will wipe everything

    Second option (ONLY if you are on stock LRX22C
    - You can extract the OTA update
    - Hack the script to not install boot img patch and disable md5 checks.
    - Don't do it this way

    Third option
    - Get the factory image and extract it
    - Flash the bootloader (fastboot flash bootloader bootloader-shamu-blah.zip)
    - Flash the radio (fastboot flash radio radio-shamu-blah.zip)
    - Reboot bootloader (fastboot reboot-bootloader)
    - Extract the: image-shamu-lm47yd.zip
    - Flash recovery (fastboot flash recovery recovery.img) Skip this if you are using a custom recovery and want to keep it
    - Flash modified boot.img in OP (fastboot flash boot bootimg_noforceencrypt_lmy47d.img)
    - Flash system (fastboot flash system system.img)

    The cache/userdata img are only needed if you want to full wipe.

    You will lose root, obviously, but can easily get it back from twrp.