diff --git a/Scripts/LineageOS-14.1/Functions.sh b/Scripts/LineageOS-14.1/Functions.sh index edebb424..e3450bcb 100644 --- a/Scripts/LineageOS-14.1/Functions.sh +++ b/Scripts/LineageOS-14.1/Functions.sh @@ -86,7 +86,7 @@ export -f enableZram; enableForcedEncryption() { cd $base$1; - if [[ $1 != *"mako"* ]]; then #Forced encryption seems to prevent some devices from booting + if [[ $1 != "device/lge/mako" ]]; then #Forced encryption seems to prevent some devices from booting sed -i 's|encryptable=/|forceencrypt=/|' fstab.* root/fstab.* rootdir/fstab.* rootdir/etc/fstab.* &>/dev/null || true; echo "Enabled forceencrypt for $1"; fi; @@ -96,8 +96,12 @@ export -f enableForcedEncryption; enableStrongEncryption() { cd $base$1; - echo "TARGET_WANTS_STRONG_ENCRYPTION := true" >> BoardConfig.mk; - echo "Enabled AES-256 encryption for $1"; + if [ -f BoardConfig.mk ]; then + if [ $1 != "device/oneplus/bacon" ] && [ $1 != "device/motorola/clark" ] && [ $1 != "device/lge/d852" ]; then #These test devices currently have encryption enabled, don't break them + echo "TARGET_WANTS_STRONG_ENCRYPTION := true" >> BoardConfig.mk; + echo "Enabled AES-256 encryption for $1"; + fi; + fi; cd $base; } export -f enableStrongEncryption; diff --git a/Scripts/LineageOS-14.1/Patch.sh b/Scripts/LineageOS-14.1/Patch.sh index c34850e5..c095df04 100755 --- a/Scripts/LineageOS-14.1/Patch.sh +++ b/Scripts/LineageOS-14.1/Patch.sh @@ -215,10 +215,9 @@ disableDexPreOpt #bootloops cd $base find "device" -maxdepth 2 -mindepth 2 -type d -exec bash -c 'enhanceLocation "$0"' {} \; find "device" -maxdepth 2 -mindepth 2 -type d -exec bash -c 'enableForcedEncryption "$0"' {} \; -#find "device" -maxdepth 2 -mindepth 2 -type d -exec bash -c 'enableStrongEncryption "$0"' {} \; +find "device" -maxdepth 2 -mindepth 2 -type d -exec bash -c 'enableStrongEncryption "$0"' {} \; find "kernel" -maxdepth 2 -mindepth 2 -type d -exec bash -c 'hardenDefconfig "$0"' {} \; cd $base -enableStrongEncryption device/lge/mako #Enable experimental strong encryption for mako for testing sed -i "s/CONFIG_DEBUG_RODATA=y/# CONFIG_DEBUG_RODATA is not set/" kernel/google/msm/arch/arm/configs/lineageos_flo_defconfig; #Breaks on compile # #END OF DEVICE CHANGES