[Samsung Galaxy J7 (2017) ROMs, Kernels, Recoveries] danielfm:
Spent weeks trying to find a modern and up-to-date ROM with enforcing SE Linux policy for my J730G, and this is the best I found! Thanks a lot (already hit the 'thanks' button!) For me to be completely happy, only if I could get device encryption to work, maybe someone here can help me identify the issue.

I got this output from 'logcat':

07-26 17:08:17.555 2693 31831 E Cryptfs : Unexpected value for crypto key location
07-26 17:08:17.555 2693 31831 E Cryptfs : Cannot get size of block device

Reading through the code (android.googlesource.com/platform/system/vold/+/master/cryptfs.cpp), for some reason real_blkdev variable seems to be empty, not sure this is expected. It seems to try to find the device by parsing the fstab file, and it don't find the correct entry.

I'm not sure which fstab it's trying to parse, but here's the content for each one I could find in my system (got this via the terminal in TWRP):

/vendor/etc/fstab.samsungexynos7870

# Android fstab file.
#<src> <mnt_point> <type> <mnt_flags and options> <fs_mgr_flags>
# The filesystem that contains the filesystem checker binary (typically /system) cannot
# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK

# system and vendor partition will be early-mounted by kernel
# /dev/block/platform/13540000.dwmmc0/by-name/SYSTEM	/system	ext4	ro,errors=panic	wait
/dev/block/platform/13540000.dwmmc0/by-name/CACHE	/cache	ext4	noatime,nosuid,nodev,noauto_da_alloc,discard,journal_checksum,data=ordered,errors=panic	wait,check
/dev/block/platform/13540000.dwmmc0/by-name/CACHE	/cache	f2fs	noatime,nosuid,nodev,noatime,inline_xattr	wait,check
/dev/block/platform/13540000.dwmmc0/by-name/USERDATA	/data	ext4	noatime,nosuid,nodev,noauto_da_alloc,discard,journal_checksum,data=ordered,errors=panic	wait,check,quota,reservedsize=128M,length=-20480
/dev/block/platform/13540000.dwmmc0/by-name/USERDATA	/data	f2fs	noatime,nosuid,nodev,discard,noatime,inline_xattr	wait,check,quota,reservedsize=128M,length=-20480
/dev/block/platform/13540000.dwmmc0/by-name/EFS	/mnt/vendor/efs	ext4	noatime,nosuid,nodev,noauto_da_alloc,discard,journal_checksum,data=ordered,errors=panic	wait,check

# VOLD
/devices/13560000.dwmmc2/mmc_host/mmc* auto auto defaults voldmanaged=sdcard:auto
/devices/13600000.usb/13600000.dwc3/xhci-hcd.2.auto/usb* auto auto defaults voldmanaged=usb:auto

What's interesting here is that there are duplicate entries for USERDATA and CACHE. I tried commenting the f2fs entries before retrying the encryption, with the same result.

/fstab.samsungexynos7870

# Android fstab file.
#<src> <mnt_point> <type> <mnt_flags and options> <fs_mgr_flags>
# The filesystem that contains the filesystem checker binary (typically /system) cannot
# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK

/dev/block/platform/13540000.dwmmc0/by-name/SYSTEM	/system	ext4 ro,errors=panic,noload wait,verify
/dev/block/platform/13540000.dwmmc0/by-name/CACHE	/cache	ext4 nosuid,nodev,noatime,noauto_da_alloc,discard,journal_async_commit,errors=panic wait,check
/dev/block/platform/13540000.dwmmc0/by-name/USERDATA	/data	ext4 nosuid,nodev,noatime,noauto_da_alloc,discard,journal_async_commit,errors=panic wait,check,forceencrypt=footer
/dev/block/platform/13540000.dwmmc0/by-name/EFS	/efs	ext4 nosuid,nodev,noatime,noauto_da_alloc,discard,journal_async_commit,errors=panic wait,check

# VOLD
/dev/block/platform/13540000.dwmmc0/by-name/HIDDEN /preload ext4 defaults voldmanaged=preload:auto
/devices/13560000.dwmmc2/mmc_host/mmc* auto vfat defaults voldmanaged=sdcard:auto
/devices/13600000.usb/13600000.dwc3/xhci-hcd.2.auto/usb* auto auto defaults voldmanaged=usb:auto

I already tried to resize the USERDATA partition to have a footer of 16kb, but I still get the error.

Am I missing something? Maybe this is not an issue with this ROM, but with how the vendor partition was set up.

Has anyone been able to encrypt their phone with this ROM? I've been looking for a more security-oriented ROM for a while that worked with my device, and I got real close to my dream setup with this one. It'd be perfect if I got the device encryption to work.