mirror of
https://github.com/Divested-Mobile/DivestOS-Build.git
synced 2025-05-02 06:26:20 -04:00
Add build option to enable lowram/go on all devices
This commit is contained in:
parent
746c925a22
commit
5af16e1ddd
6 changed files with 65 additions and 4 deletions
|
@ -130,8 +130,18 @@ enableDexPreOptFull() {
|
|||
cd "$DOS_BUILD_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";
|
||||
echo "Enabled full dexpreopt for $1";
|
||||
fi;
|
||||
cd "$DOS_BUILD_BASE";
|
||||
}
|
||||
export -f enableDexPreOptFull;
|
||||
|
||||
enableLowRam() {
|
||||
cd "$DOS_BUILD_BASE$1";
|
||||
if [ -f lineage.mk ]; then echo '$(call inherit-product, $(SRC_TARGET_DIR)/product/lowram.mk)' >> lineage.mk; fi;
|
||||
if [ -f BoardConfig.mk ]; then echo 'MALLOC_SVELTE := true' >> BoardConfig.mk; fi;
|
||||
if [ -f BoardConfigCommon.mk ]; then echo 'MALLOC_SVELTE := true' >> BoardConfigCommon.mk; fi;
|
||||
echo "Enabled lowram for $1";
|
||||
cd "$DOS_BUILD_BASE";
|
||||
}
|
||||
export -f enableLowRam;
|
||||
|
|
|
@ -68,6 +68,7 @@ patch -p1 < "$DOS_PATCHES/android_build/0001-Automated_Build_Signing.patch"; #Au
|
|||
sed -i 's/messaging/Silence/' target/product/*.mk; #Replace AOSP Messaging app with Silence
|
||||
sed -i 's/ro.secure=0/ro.secure=1/' core/main.mk;
|
||||
#sed -i 's/ro.adb.secure=0/ro.adb.secure=1/' core/main.mk;
|
||||
cp "$DOS_PATCHES/android_build/lowram.mk" target/product/lowram.mk;
|
||||
|
||||
enterAndClear "device/qcom/sepolicy";
|
||||
patch -p1 < "$DOS_PATCHES/android_device_qcom_sepolicy/0001-Camera_Fix.patch"; #Fix camera on user builds XXX: REMOVE THIS TRASH
|
||||
|
@ -261,10 +262,11 @@ sed -i "s/TZ.BF.2.0-2.0.0134/TZ.BF.2.0-2.0.0134|TZ.BF.2.0-2.0.0137/" board-info.
|
|||
|
||||
#Make changes to all devices
|
||||
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 "device" -maxdepth 2 -mindepth 2 -type d -exec bash -c 'enhanceLocation "$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 'enableForcedEncryption "$0"' {} \;
|
||||
#if [ "$STRONG_ENCRYPTION_ENABLED" = true ]; then find "device" -maxdepth 2 -mindepth 2 -type d -exec bash -c 'enableStrongEncryption "$0"' {} \; fi;
|
||||
#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";
|
||||
|
||||
|
|
|
@ -116,8 +116,18 @@ enableDexPreOptFull() {
|
|||
cd "$DOS_BUILD_BASE$1";
|
||||
if [ -f BoardConfig.mk ]; then
|
||||
sed -i "s/WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY := true/WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY := false/" BoardConfig.mk;
|
||||
echo "Enabled full dexpreopt";
|
||||
echo "Enabled full dexpreopt for $1";
|
||||
fi;
|
||||
cd "$DOS_BUILD_BASE";
|
||||
}
|
||||
export -f enableDexPreOptFull;
|
||||
|
||||
enableLowRam() {
|
||||
cd "$DOS_BUILD_BASE$1";
|
||||
if [ -f lineage.mk ]; then echo '$(call inherit-product, $(SRC_TARGET_DIR)/product/go_defaults.mk)' >> lineage.mk; fi;
|
||||
if [ -f BoardConfig.mk ]; then echo 'MALLOC_SVELTE := true' >> BoardConfig.mk; fi;
|
||||
if [ -f BoardConfigCommon.mk ]; then echo 'MALLOC_SVELTE := true' >> BoardConfigCommon.mk; fi;
|
||||
echo "Enabled lowram for $1";
|
||||
cd "$DOS_BUILD_BASE";
|
||||
}
|
||||
export -f enableLowRam;
|
||||
|
|
|
@ -242,10 +242,11 @@ sed -i "s/TZ.BF.2.0-2.0.0134/TZ.BF.2.0-2.0.0134|TZ.BF.2.0-2.0.0137/" board-info.
|
|||
|
||||
#Make changes to all devices
|
||||
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 "device" -maxdepth 2 -mindepth 2 -type d -exec bash -c 'enhanceLocation "$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 'enableForcedEncryption "$0"' {} \;
|
||||
#if [ "$STRONG_ENCRYPTION_ENABLED" = true ]; then find "device" -maxdepth 2 -mindepth 2 -type d -exec bash -c 'enableStrongEncryption "$0"' {} \; fi;
|
||||
#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";
|
||||
|
||||
|
|
|
@ -37,6 +37,7 @@ export DOS_MICROG_INCLUDED="NLP"; #Determines inclusion of microG. Options: NONE
|
|||
export DOS_HOSTS_BLOCKING=true; #Switch to false to prevent inclusion of our HOSTS file
|
||||
export DOS_HOSTS_BLOCKING_LIST="https://divestos.xyz/hosts"; #Must be in the format "127.0.0.1 bad.domain.tld"
|
||||
export DOS_OVERCLOCKS_ENABLED=true; #Switch to false to disable overclocks
|
||||
export DOS_LOWRAM_ENABLED=false; #Switch to true to enable lowram/Go configuration on all devices
|
||||
export DOS_STRONG_ENCRYPTION_ENABLED=false; #Switch to true to enable AES-256bit encryption XXX: THIS WILL **DESTROY** EXISTING INSTALLS!
|
||||
export DOS_NON_COMMERCIAL_USE_PATCHES=false; #Switch to false to prevent inclusion of non-commercial use patches
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue