[Xiaomi Mi 4C] ch55:
Hi, mates and OP!

I have an issue with device encryption on my Mi4C with latest emfox build (20161009).

Clean installed. Without Gapss and any other APKs.

TWRP 3.0.2 (kumajaya)

Encryption not working.

Trying to do following steps:

1. Clean install with wipe DATA (without root, gapps, etc)

2. Boot.

3. Setup PIN lock

4. Try to Encrypt... Device softreboots and stuck on CM logo. Waiting more than 2 hours - nothing happens. I reboot phone, and it loads normally, but without encryption.

Here is logs

10-10 23:34:10.626 4620 4623 D BootAnimation: Use save memory method, maybe small fps in actual.
10-10 23:34:12.692 4620 4623 D BootAnimation: Use save memory method, maybe small fps in actual.
10-10 23:34:15.245 510 510 I MSM-irqbalance: Decided to move IRQ216 from CPU0 to CPU1
10-10 23:34:15.319 359 359 W vold : type=1400 audit(0.0:16): avc: denied { read } for name="fd" dev="proc" ino=495 scontext=u:r:vold:s0 tcontext=u:r:logd:s0 tclass=dir permissive=0
10-10 23:34:15.319 359 359 W vold : type=1400 audit(0.0:17): avc: denied { getattr } for path="/proc/347/cwd" dev="proc" ino=33893 scontext=u:r:vold:s0 tcontext=u:r:logd:s0 tclass=lnk_file permissive=0
10-10 23:34:15.319 359 359 W vold : type=1400 audit(0.0:18): avc: denied { getattr } for path="/proc/347/root" dev="proc" ino=33894 scontext=u:r:vold:s0 tcontext=u:r:logd:s0 tclass=lnk_file permissive=0
10-10 23:34:15.319 359 359 W vold : type=1400 audit(0.0:19): avc: denied { getattr } for path="/proc/347/exe" dev="proc" ino=33895 scontext=u:r:vold:s0 tcontext=u:r:logd:s0 tclass=lnk_file permissive=0
10-10 23:34:20.246 510 510 I MSM-irqbalance: Decided to move IRQ163 from CPU0 to CPU1
10-10 23:34:25.246 510 510 I MSM-irqbalance: Decided to move IRQ51 from CPU2 to CPU1
10-10 23:34:30.246 510 510 I MSM-irqbalance: Decided to move IRQ133 from CPU2 to CPU1
10-10 23:34:40.379 359 359 W vold : type=1400 audit(0.0:20): avc: denied { read } for name="fd" dev="proc" ino=495 scontext=u:r:vold:s0 tcontext=u:r:logd:s0 tclass=dir permissive=0
10-10 23:34:40.379 359 359 W vold : type=1400 audit(0.0:21): avc: denied { getattr } for path="/proc/347/cwd" dev="proc" ino=33893 scontext=u:r:vold:s0 tcontext=u:r:logd:s0 tclass=lnk_file permissive=0
10-10 23:34:40.379 359 359 W vold : type=1400 audit(0.0:22): avc: denied { getattr } for path="/proc/347/root" dev="proc" ino=33894 scontext=u:r:vold:s0 tcontext=u:r:logd:s0 tclass=lnk_file permissive=0
10-10 23:34:40.379 359 359 W vold : type=1400 audit(0.0:23): avc: denied { getattr } for path="/proc/347/exe" dev="proc" ino=33895 scontext=u:r:vold:s0 tcontext=u:r:logd:s0 tclass=lnk_file permissive=0
10-10 23:34:40.412 348 359 E Cryptfs : unmounting /data failed: Device or resource busy
10-10 23:34:40.429 359 359 W vold : type=1400 audit(0.0:24): avc: denied { read } for name="fd" dev="proc" ino=495 scontext=u:r:vold:s0 tcontext=u:r:logd:s0 tclass=dir permissive=0
10-10 23:34:40.429 359 359 W vold : type=1400 audit(0.0:25): avc: denied { getattr } for path="/proc/347/cwd" dev="proc" ino=33893 scontext=u:r:vold:s0 tcontext=u:r:logd:s0 tclass=lnk_file permissive=0
10-10 23:34:40.429 359 359 W vold : type=1400 audit(0.0:26): avc: denied { getattr } for path="/proc/347/root" dev="proc" ino=33894 scontext=u:r:vold:s0 tcontext=u:r:logd:s0 tclass=lnk_file permissive=0
10-10 23:34:40.429 359 359 W vold : type=1400 audit(0.0:27): avc: denied { getattr } for path="/proc/347/exe" dev="proc" ino=33895 scontext=u:r:vold:s0 tcontext=u:r:logd:s0 tclass=lnk_file permissive=0
10-10 23:34:40.449 359 359 W vold : type=1400 audit(0.0:28): avc: granted { read write } for name="mmcblk0p27" dev="tmpfs" ino=13803 scontext=u:r:vold:s0 tcontext=u:object_r:block_device:s0 tclass=blk_file
10-10 23:34:40.449 359 359 W vold : type=1400 audit(0.0:29): avc: granted { read write open } for path="/dev/block/mmcblk0p27" dev="tmpfs" ino=13803 scontext=u:r:vold:s0 tcontext=u:object_r:block_device:s0 tclass=blk_file
10-10 23:34:40.449 359 359 W vold : type=1400 audit(0.0:30): avc: granted { getattr } for path="/dev/block/mmcblk0p27" dev="tmpfs" ino=13803 scontext=u:r:vold:s0 tcontext=u:object_r:block_device:s0 tclass=blk_file
10-10 23:34:40.556 348 359 E Cryptfs : Bad magic for real block device /dev/block/bootdevice/by-name/bk1
10-10 23:34:40.556 348 359 D Cryptfs : Just asked init to shut down class main
10-10 23:34:40.556 348 359 W vold : emulated unmount requires state mounted
10-10 23:34:40.549 359 359 W vold : type=1400 audit(0.0:31): avc: granted { read } for name="mmcblk0p44" dev="tmpfs" ino=13871 scontext=u:r:vold:s0 tcontext=u:object_r:userdata_block_device:s0 tclass=blk_file
10-10 23:34:40.549 359 359 W vold : type=1400 audit(0.0:32): avc: granted { read open } for path="/dev/block/mmcblk0p44" dev="tmpfs" ino=13871 scontext=u:r:vold:s0 tcontext=u:object_r:userdata_block_device:s0 tclass=blk_file
10-10 23:34:40.549 359 359 W vold : type=1400 audit(0.0:33): avc: granted { ioctl } for path="/dev/block/mmcblk0p44" dev="tmpfs" ino=13871 ioctlcmd=1260 scontext=u:r:vold:s0 tcontext=u:object_r:userdata_block_device:s0 tclass=blk_file
10-10 23:34:45.245 510 510 I MSM-irqbalance: Decided to move IRQ170 from CPU2 to CPU1
10-10 23:35:00.589 359 359 W vold : type=1400 audit(0.0:34): avc: denied { read } for name="fd" dev="proc" ino=495 scontext=u:r:vold:s0 tcontext=u:r:logd:s0 tclass=dir permissive=0
10-10 23:35:00.589 359 359 W vold : type=1400 audit(0.0:35): avc: denied { getattr } for path="/proc/347/cwd" dev="proc" ino=33893 scontext=u:r:vold:s0 tcontext=u:r:logd:s0 tclass=lnk_file permissive=0
10-10 23:35:00.589 359 359 W vold : type=1400 audit(0.0:36): avc: denied { getattr } for path="/proc/347/root" dev="proc" ino=33894 scontext=u:r:vold:s0 tcontext=u:r:logd:s0 tclass=lnk_file permissive=0
10-10 23:35:00.589 359 359 W vold : type=1400 audit(0.0:37): avc: denied { getattr } for path="/proc/347/exe" dev="proc" ino=33895 scontext=u:r:vold:s0 tcontext=u:r:logd:s0 tclass=lnk_file permissive=0
10-10 23:35:00.617 348 359 E Cryptfs : unmounting /data failed: Device or resource busy
10-10 23:35:00.618 348 359 W SocketClient: write error (Broken pipe)
10-10 23:35:00.619 348 359 W SocketClient: Unable to send msg '200 8 -1'

I've found solution - Encrypt without step 3 (PIN lock). Just clean install and immediately encrypt.

It works. But I can't access '/data' in TWRP. I don't know password to decrypt '/data'.

So the questions is:

1. How to Encrypt Mi4C right way (with ability to decrypt data in TWRP)?

2. What is default encryption password (if we don't provide it before encryption)?

Thanks!