From d9970b3f77bf47480f20e70dfafcbc6415db75f9 Mon Sep 17 00:00:00 2001 From: Tad Date: Wed, 12 Sep 2018 13:43:05 -0400 Subject: [PATCH] Minor tweaks and update F-Droid --- Manifests/Manifest_LAOS-14.1.xml | 2 +- Manifests/Manifest_LAOS-15.1.xml | 2 +- Scripts/Common/Functions.sh | 18 ++++++------------ Scripts/LineageOS-14.1/Patch.sh | 5 ++--- Scripts/LineageOS-15.1/Patch.sh | 5 ++--- 5 files changed, 12 insertions(+), 20 deletions(-) diff --git a/Manifests/Manifest_LAOS-14.1.xml b/Manifests/Manifest_LAOS-14.1.xml index 0b360eeb..ee4bff99 100644 --- a/Manifests/Manifest_LAOS-14.1.xml +++ b/Manifests/Manifest_LAOS-14.1.xml @@ -68,7 +68,7 @@ - + diff --git a/Manifests/Manifest_LAOS-15.1.xml b/Manifests/Manifest_LAOS-15.1.xml index e5cbc6f4..103119a7 100644 --- a/Manifests/Manifest_LAOS-15.1.xml +++ b/Manifests/Manifest_LAOS-15.1.xml @@ -68,7 +68,7 @@ - + diff --git a/Scripts/Common/Functions.sh b/Scripts/Common/Functions.sh index e4f30629..a3907483 100644 --- a/Scripts/Common/Functions.sh +++ b/Scripts/Common/Functions.sh @@ -149,7 +149,7 @@ compressRamdisks() { } export -f compressRamdisks; -enhanceLocation() { +hardenLocation() { gpsConfig=$1; #Attempt to get the real device directory if [[ "$gpsConfig" = *"device/"* ]]; then @@ -196,7 +196,7 @@ enhanceLocation() { fi; echo "Enhanced location services for $deviceDir"; } -export -f enhanceLocation; +export -f hardenLocation; enableZram() { cd "$DOS_BUILD_BASE$1"; @@ -206,21 +206,15 @@ enableZram() { } export -f enableZram; -enableDiscard() { +hardenUserdata() { cd "$DOS_BUILD_BASE$1"; + #TODO: Ensure: noatime,nosuid,nodev sed -i '/\/data/{/discard/!s|nosuid|discard,nosuid|}' fstab.* root/fstab.* rootdir/fstab.* rootdir/etc/fstab.* &>/dev/null || true; - echo "Enabled discard for $1"; - cd "$DOS_BUILD_BASE"; -} -export -f enableDiscard; - -enableForcedEncryption() { - cd "$DOS_BUILD_BASE$1"; sed -i 's|encryptable=/|forceencrypt=/|' fstab.* root/fstab.* rootdir/fstab.* rootdir/etc/fstab.* &>/dev/null || true; - echo "Enabled forceencrypt for $1"; + echo "Hardened /data for $1"; cd "$DOS_BUILD_BASE"; } -export -f enableForcedEncryption; +export -f hardenUserdata; enableStrongEncryption() { cd "$DOS_BUILD_BASE$1"; diff --git a/Scripts/LineageOS-14.1/Patch.sh b/Scripts/LineageOS-14.1/Patch.sh index d084853b..6a6f4649 100755 --- a/Scripts/LineageOS-14.1/Patch.sh +++ b/Scripts/LineageOS-14.1/Patch.sh @@ -230,10 +230,9 @@ echo "" > atv/atv-common.mk; cd "$DOS_BUILD_BASE"; if [ "$DOS_LOWRAM_ENABLED" = true ]; then find "device" -maxdepth 2 -mindepth 2 -type d -exec bash -c 'enableLowRam "$0"' {} \;; fi; find "hardware/qcom/gps" -name "gps\.conf" -type f -exec bash -c 'enhanceLocation "$0"' {} \;; -find "device" -name "gps\.conf" -type f -exec bash -c 'enhanceLocation "$0"' {} \;; +find "device" -name "gps\.conf" -type f -exec bash -c 'hardenLocation "$0"' {} \;; find "device" -maxdepth 2 -mindepth 2 -type d -exec bash -c 'enableDexPreOpt "$0"' {} \;; -find "device" -maxdepth 2 -mindepth 2 -type d -exec bash -c 'enableDiscard "$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 'hardenUserdata "$0"' {} \;; #if [ "$STRONG_ENCRYPTION_ENABLED" = true ]; then find "device" -maxdepth 2 -mindepth 2 -type d -exec bash -c 'enableStrongEncryption "$0"' {} \;; fi; find "kernel" -maxdepth 2 -mindepth 2 -type d -exec bash -c 'hardenDefconfig "$0"' {} \;; cd "$DOS_BUILD_BASE"; diff --git a/Scripts/LineageOS-15.1/Patch.sh b/Scripts/LineageOS-15.1/Patch.sh index 1a9b7cd6..54cd644a 100755 --- a/Scripts/LineageOS-15.1/Patch.sh +++ b/Scripts/LineageOS-15.1/Patch.sh @@ -212,10 +212,9 @@ echo "" > atv/atv-common.mk; cd "$DOS_BUILD_BASE"; if [ "$DOS_LOWRAM_ENABLED" = true ]; then find "device" -maxdepth 2 -mindepth 2 -type d -exec bash -c 'enableLowRam "$0"' {} \;; fi; find "hardware/qcom/gps" -name "gps\.conf" -type f -exec bash -c 'enhanceLocation "$0"' {} \;; -find "device" -name "gps\.conf" -type f -exec bash -c 'enhanceLocation "$0"' {} \;; +find "device" -name "gps\.conf" -type f -exec bash -c 'hardenLocation "$0"' {} \;; find "device" -maxdepth 2 -mindepth 2 -type d -exec bash -c 'enableDexPreOpt "$0"' {} \;; -find "device" -maxdepth 2 -mindepth 2 -type d -exec bash -c 'enableDiscard "$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 'hardenUserdata "$0"' {} \;; #if [ "$STRONG_ENCRYPTION_ENABLED" = true ]; then find "device" -maxdepth 2 -mindepth 2 -type d -exec bash -c 'enableStrongEncryption "$0"' {} \;; fi; find "kernel" -maxdepth 2 -mindepth 2 -type d -exec bash -c 'hardenDefconfig "$0"' {} \;; cd "$DOS_BUILD_BASE";