What an installation hell (2 days wasted)...
- Being constantly exposed to all potential features of Mobile Phones, I wanted to have several things going on at the same time:
- Full encryption of the phone with long password entered usually only at boot time
- Using an NFC ring usually to unlock the phone (I was hoping to use Smart Lock for it.)
- Being able to run Unity and Vuforia-based projects from my student (this actually lead to having to use maximum Kitkat)
- Being able to use k9 (also serious display issues in Lollipop)
- Root access
Summing it up, it was extremely hard. The only solution I could get working, was getting a stock ROM for the Samsung phone from some shady download site, using Odin 3.09 to flash the respective Rom, encrypting the phone (I think it maters to do this first), using chainfire to re-root it, and then installign Xposed and there NFC Screen unlock.
As a remark, the only Lollipop ROM I got to encrypt was Cyanogenmod 12. It was however very difficult and involved realigning the filesystem (making space at the end) and enabling write-properties for the keymaster file on the firmware patition.
- Here is a lose collection of links I used in this process:
Here is a copy of the (now old) discussion thread on disqus, which was spawned around this topic. If you want to add further comments, use the new comment system below:
2016-02-10: Ulrich Norbisrath
Just tried it again.
In addition to making space at the end, deleting the old key with ext, you also need to mount the firmware rw. So you have to enter: umount /firmware and then:
mount -t vfat /dev/block/platform/msm_sdcc.1/by-name/apnhlos /firmware
2015-09-30: Ulrich Norbisrath
Just finishing this up - I went back to stock kitkat/root/xposed as GPS and gyroscope/ accelorometer weren't working in cyanogenmod. So, I think the phone will stay there until I have some money for a new phone (I will avoid Samsung there -> too hard to mod). Zenfone 2?
2015-09-03: Ulrich Norbisrath
It's some time ago, I did this, but I did it several times (because I messed things up), so I think it should be reproducible. What really helps for debugging is to run adb logcat|grep crypt in a console to get error messages. First you need to make sure your data-partition has enough space and that the old keys have been deleted. What seemed to work was formatting the whole data partition first (in twrp) with ext2 and then the smaller partition with ext4 (maybe using dd and skip to write zeros in the end of the partition might work too).
After this, I started cyanogenmod 12.1 normally until it came up (eventually clear cache and dalvik). Then enable development and root and as root unmount the firmware and remount it rw. make sure to check that it really is rw afterwards. Then encrypting should work. It shows though a lot of garbage on the screen (progress 250%) while doing it, but keeping the logcat gives you some insurance that the system is not dead. Hope this helps and let me/us know if it worked.
- 2015-09-02: Donarsson
the only Lollipop ROM I got to encrypt was Cyanogenmod 12
Could you still reproduce this? I am trying hard to find a way to rum CM12 with encryption on my Note 3, I read all your provided links and tried changing permissions on the keymaster and resizing the data partition, reverting to stock and re-flashing everything, still doesn't work. I would be very thankful for any further hint how you achieved working encryption on CM12.