From e4435f9eac5b04dd92a9d0b88c53b1be52b79a84 Mon Sep 17 00:00:00 2001 From: Tad Date: Wed, 14 Mar 2018 00:41:05 -0400 Subject: [PATCH] Tweaks and cleanup --- .../android_packages_apps_FDroid/0001.patch | 21 ------------------ .../android_packages_apps_FDroid/0001.patch | 21 ------------------ PrebuiltApps | 2 +- Scripts/LineageOS-14.1/Functions.sh | 22 ++++++++++++++++++- Scripts/LineageOS-14.1/Patch.sh | 4 +++- Scripts/LineageOS-14.1/Rebrand.sh | 2 +- Scripts/LineageOS-15.1/Functions.sh | 14 +++++++++++- Scripts/LineageOS-15.1/Patch.sh | 2 +- Scripts/LineageOS-15.1/Rebrand.sh | 2 +- 9 files changed, 41 insertions(+), 49 deletions(-) delete mode 100644 Patches/LineageOS-14.1/android_packages_apps_FDroid/0001.patch delete mode 100644 Patches/LineageOS-15.1/android_packages_apps_FDroid/0001.patch diff --git a/Patches/LineageOS-14.1/android_packages_apps_FDroid/0001.patch b/Patches/LineageOS-14.1/android_packages_apps_FDroid/0001.patch deleted file mode 100644 index e8c84031..00000000 --- a/Patches/LineageOS-14.1/android_packages_apps_FDroid/0001.patch +++ /dev/null @@ -1,21 +0,0 @@ -From 17d82df9831a6e5801203ffe3b0e1aba177f7b20 Mon Sep 17 00:00:00 2001 -From: Daniel Micay -Date: Tue, 19 Jan 2016 19:24:47 -0500 -Subject: [PATCH] mark as privileged app - ---- - Android.mk | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/Android.mk b/Android.mk -index c6110a3..ce4e8cf 100644 ---- a/Android.mk -+++ b/Android.mk -@@ -19,6 +19,7 @@ $(fdroid_root)/$(fdroid_dir)/$(fdroid_apk): - cd $(fdroid_root)/$(fdroid_dir) && gradle assembleRelease - - LOCAL_CERTIFICATE := platform -+LOCAL_PRIVILEGED_MODULE := true - LOCAL_SRC_FILES := $(fdroid_dir)/$(fdroid_apk) - LOCAL_MODULE_CLASS := APPS - LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX) diff --git a/Patches/LineageOS-15.1/android_packages_apps_FDroid/0001.patch b/Patches/LineageOS-15.1/android_packages_apps_FDroid/0001.patch deleted file mode 100644 index e8c84031..00000000 --- a/Patches/LineageOS-15.1/android_packages_apps_FDroid/0001.patch +++ /dev/null @@ -1,21 +0,0 @@ -From 17d82df9831a6e5801203ffe3b0e1aba177f7b20 Mon Sep 17 00:00:00 2001 -From: Daniel Micay -Date: Tue, 19 Jan 2016 19:24:47 -0500 -Subject: [PATCH] mark as privileged app - ---- - Android.mk | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/Android.mk b/Android.mk -index c6110a3..ce4e8cf 100644 ---- a/Android.mk -+++ b/Android.mk -@@ -19,6 +19,7 @@ $(fdroid_root)/$(fdroid_dir)/$(fdroid_apk): - cd $(fdroid_root)/$(fdroid_dir) && gradle assembleRelease - - LOCAL_CERTIFICATE := platform -+LOCAL_PRIVILEGED_MODULE := true - LOCAL_SRC_FILES := $(fdroid_dir)/$(fdroid_apk) - LOCAL_MODULE_CLASS := APPS - LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX) diff --git a/PrebuiltApps b/PrebuiltApps index df494cf7..518f42b0 160000 --- a/PrebuiltApps +++ b/PrebuiltApps @@ -1 +1 @@ -Subproject commit df494cf7ca300cf448ce26c0f3eb33799f5dd913 +Subproject commit 518f42b01375427783ac267e342f96b3804babce diff --git a/Scripts/LineageOS-14.1/Functions.sh b/Scripts/LineageOS-14.1/Functions.sh index 0b708ad1..14482fe8 100644 --- a/Scripts/LineageOS-14.1/Functions.sh +++ b/Scripts/LineageOS-14.1/Functions.sh @@ -99,7 +99,7 @@ export -f patchWorkspace; enableDexPreOpt() { cd $base$1; - if [ $1 != "device/amazon/thor" ] && [ $1 != "device/samsung/i9100" ] && [ $1 != "device/lge/h850" ]; then #Some devices won't compile, or have too small of a /system partition + if [ $1 != "device/amazon/thor" ] && [ $1 != "device/samsung/i9100" ] && [ $1 != "device/lge/h850" ] && [ $1 != "device/lge/mako" ]; then #Some devices won't compile, or have too small of a /system partition if [ -f BoardConfig.mk ]; then echo "WITH_DEXPREOPT := true" >> BoardConfig.mk; echo "WITH_DEXPREOPT_PIC := true" >> BoardConfig.mk; @@ -112,13 +112,33 @@ enableDexPreOpt() { export -f enableDexPreOpt; enableDexPreOptFull() { + cd $base$1; if [ -f BoardConfig.mk ]; then sed -i "s/WITH_DEXPREOPT_BOOT_IMG_ONLY := true/WITH_DEXPREOPT_BOOT_IMG_ONLY := false/" BoardConfig.mk; echo "Enabled full dexpreopt"; fi; + cd $base; } export -f enableDexPreOptFull; +disableDexPreOpt() { + cd $base$1; + if [ -f BoardConfig.mk ]; then + sed -i "s/WITH_DEXPREOPT := true/WITH_DEXPREOPT := false/" BoardConfig.mk; + echo "Disabled dexpreopt"; + fi; + cd $base; +} +export -f disableDexPreOpt; + +compressRamdisks() { + if [ -f BoardConfig.mk ]; then + echo "LZMA_RAMDISK_TARGETS := boot,recovery" >> BoardConfig.mk; + echo "Enabled ramdisk compression"; + fi; +} +export -f compressRamdisks; + enhanceLocation() { cd $base$1; #Enable GLONASS diff --git a/Scripts/LineageOS-14.1/Patch.sh b/Scripts/LineageOS-14.1/Patch.sh index 8bb2ca26..39ef179c 100755 --- a/Scripts/LineageOS-14.1/Patch.sh +++ b/Scripts/LineageOS-14.1/Patch.sh @@ -110,10 +110,10 @@ sed -i 's/ln -s /ln -sf /' Android.mk; sed -i 's/ext.androidBuildVersionTools = "24.0.3"/ext.androidBuildVersionTools = "25.0.3"/' build.gradle; enterAndClear "packages/apps/FDroid" -patch -p1 < $patches"android_packages_apps_FDroid/0001.patch" #Mark as privileged cp $patches"android_packages_apps_FDroid/default_repos.xml" app/src/main/res/values/default_repos.xml; #Add extra repos sed -i 's|gradle|./gradlew|' Android.mk; #Gradle 4.0 fix sed -i 's|/$(fdroid_dir) \&\&| \&\&|' Android.mk; #One line wouldn't work... no matter what I tried. +#TODO: Change the package ID until https://gitlab.com/fdroid/fdroidclient/issues/843 is implemented enterAndClear "packages/apps/FDroidPrivilegedExtension" patch -p1 < $patches"android_packages_apps_FDroidPrivilegedExtension/0002-Release_Key.patch" #Change to release key @@ -216,6 +216,8 @@ find "device" -maxdepth 2 -mindepth 2 -type d -exec bash -c 'enableForcedEncrypt find "kernel" -maxdepth 2 -mindepth 2 -type d -exec bash -c 'hardenDefconfig "$0"' {} \; cd $base +#Fixes +disableDexPreOpt device/lge/mako #Fix broken options enabled by hardenDefconfig() sed -i "s/CONFIG_STRICT_MEMORY_RWX=y/# CONFIG_STRICT_MEMORY_RWX is not set/" kernel/lge/msm8996/arch/arm64/configs/lineageos_*_defconfig; #Breaks on compile # diff --git a/Scripts/LineageOS-14.1/Rebrand.sh b/Scripts/LineageOS-14.1/Rebrand.sh index 8747f79d..202ec02a 100644 --- a/Scripts/LineageOS-14.1/Rebrand.sh +++ b/Scripts/LineageOS-14.1/Rebrand.sh @@ -41,7 +41,7 @@ sed -i 's|>LineageOS|>DivestOS|' res/values*/strings.xml enter "vendor/cm" sed -i 's|https://lineageos.org/legal|https://divestos.xyz/pages/about.html|' config/common.mk; -#sed -i '/.*ZIPFILE=/s/lineage/divestos/' build/envsetup.sh +sed -i '/.*ZIPFILE=/s/lineage/divestos/' build/envsetup.sh rm -rf bootanimation #TODO: Create a boot animation cd $base diff --git a/Scripts/LineageOS-15.1/Functions.sh b/Scripts/LineageOS-15.1/Functions.sh index a2b6f175..98f57ee5 100644 --- a/Scripts/LineageOS-15.1/Functions.sh +++ b/Scripts/LineageOS-15.1/Functions.sh @@ -91,7 +91,7 @@ export -f patchWorkspace; enableDexPreOpt() { cd $base$1; - if [ $1 != "device/amazon/thor" ] && [ $1 != "device/samsung/i9100" ] && [ $1 != "device/lge/h850" ]; then #Some devices won't compile, or have too small of a /system partition + if [ $1 != "device/amazon/thor" ] && [ $1 != "device/samsung/i9100" ] && [ $1 != "device/lge/h850" ] && [ $1 != "device/lge/mako" ]; then #Some devices won't compile, or have too small of a /system partition if [ -f BoardConfig.mk ]; then echo "WITH_DEXPREOPT := true" >> BoardConfig.mk; echo "WITH_DEXPREOPT_PIC := true" >> BoardConfig.mk; @@ -104,13 +104,25 @@ enableDexPreOpt() { export -f enableDexPreOpt; enableDexPreOptFull() { + cd $base$1; if [ -f BoardConfig.mk ]; then sed -i "s/WITH_DEXPREOPT_BOOT_IMG_ONLY := true/WITH_DEXPREOPT_BOOT_IMG_ONLY := false/" BoardConfig.mk; echo "Enabled full dexpreopt"; fi; + cd $base; } export -f enableDexPreOptFull; +disableDexPreOpt() { + cd $base$1; + if [ -f BoardConfig.mk ]; then + sed -i "s/WITH_DEXPREOPT := true/WITH_DEXPREOPT := false/" BoardConfig.mk; + echo "Disabled dexpreopt"; + fi; + cd $base; +} +export -f disableDexPreOpt; + compressRamdisks() { if [ -f BoardConfig.mk ]; then echo "LZMA_RAMDISK_TARGETS := boot,recovery" >> BoardConfig.mk; diff --git a/Scripts/LineageOS-15.1/Patch.sh b/Scripts/LineageOS-15.1/Patch.sh index a628a71e..41695297 100755 --- a/Scripts/LineageOS-15.1/Patch.sh +++ b/Scripts/LineageOS-15.1/Patch.sh @@ -101,10 +101,10 @@ sed -i 's/ln -s /ln -sf /' Android.mk; sed -i 's/ext.androidBuildVersionTools = "24.0.3"/ext.androidBuildVersionTools = "25.0.3"/' build.gradle; enterAndClear "packages/apps/FDroid" -patch -p1 < $patches"android_packages_apps_FDroid/0001.patch" #Mark as privileged cp $patches"android_packages_apps_FDroid/default_repos.xml" app/src/main/res/values/default_repos.xml; #Add extra repos sed -i 's|gradle|./gradlew|' Android.mk; #Gradle 4.0 fix sed -i 's|/$(fdroid_dir) \&\&| \&\&|' Android.mk; #One line wouldn't work... no matter what I tried. +#TODO: Change the package ID until https://gitlab.com/fdroid/fdroidclient/issues/843 is implemented enterAndClear "packages/apps/FDroidPrivilegedExtension" patch -p1 < $patches"android_packages_apps_FDroidPrivilegedExtension/0002-Release_Key.patch" #Change to release key diff --git a/Scripts/LineageOS-15.1/Rebrand.sh b/Scripts/LineageOS-15.1/Rebrand.sh index 4b80e8bc..f34e92c9 100644 --- a/Scripts/LineageOS-15.1/Rebrand.sh +++ b/Scripts/LineageOS-15.1/Rebrand.sh @@ -41,7 +41,7 @@ sed -i 's|>LineageOS|>DivestOS|' res/values*/strings.xml enter "vendor/lineage" sed -i 's|https://lineageos.org/legal|https://divestos.xyz/pages/about.html|' config/common.mk; -#sed -i '/.*ZIPFILE=/s/lineage/divestos/' build/envsetup.sh +sed -i '/.*ZIPFILE=/s/lineage/divestos/' build/envsetup.sh rm -rf bootanimation #TODO: Create a boot animation cd $base