[How-To] Disable Forced Encryption

Search This thread

LordDeath

Senior Member
Nov 30, 2006
1,202
106
It seems like TWRP's backup ignores /data/media and I can't find a way to include it. :(
 

efrant

Retired Senior Moderator & Developers Relations
Feb 12, 2009
11,469
10,985
Montreal
Samsung Galaxy S20
It seems like TWRP's backup ignores /data/media and I can't find a way to include it. :(

/data/media is your internal storage, i.e., it is where TWRP stores the backup. What do you think would happen if TWRP would allow you to backup the location where it is storing the backup? ?

As was mentioned, once you complete your TWRP backup, just copy the entire /data/media to your computer.

Sent from my Nexus 6 using Tapatalk
 
M

moonbutt74

Guest
/data/media is your internal storage, i.e., it is where TWRP stores the backup. What do you think would happen if TWRP would allow you to backup the location where it is storing the backup? ?

As was mentioned, once you complete your TWRP backup, just copy the entire /data/media to your computer.

Sent from my Nexus 6 using Tapatalk

I think if twrp could back up it's backups while making it backups would cause a dimensional rift to open,
from which an abyssal devourer would emerge, playing celine dion's best songs on a kazoo.
[i am sooo bored...]
 

konaman

Senior Member
Mar 21, 2009
420
64
I cannot get fastboot or adb to work with my Mac. I type in the command in the op and it says it cannot find command or something. What am I doing wrong?
 

fegone

Senior Member
Nov 30, 2008
86
10
When I received my shamu, I directly unlocked the bootloader, flashed twrp and rom gapps... etc But I did know that we need to flash the boot-img before. Do this as soon as your Nexus 6 arrives, it will save from some hassle
 

mclisme

Senior Member
Feb 2, 2011
181
16
Is it possible to de-crypt without losing anything if you:
1) Take a nandroid backup
2) Decrypt
3) Restore backup

?

Will this get you to the exact same point as you were when you started the process, only this time decrypted? Also, what needs to be included in the backup for this to work? I guess system, data, boot and what about EFS partition? Recovery? Do they need to be included too?
 

Headhuntr

Member
Aug 23, 2010
10
0
Thank you for this great guide.

One question? Is it required to root the device or can I skip this step? I want my Nexus 6 as close to stock as possible but without the forced encryption.
 

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.