From 9b156f7b664ece49dd679e9fc1dc8b0df9ce6b68 Mon Sep 17 00:00:00 2001 From: Tad Date: Fri, 22 Jun 2018 23:41:08 -0400 Subject: [PATCH] Allow rebrander to be configured from init.sh + misc changes - Add caffeine to default quick tiles --- PrebuiltApps | 2 +- Scripts/LineageOS-14.1/Defaults.sh | 2 +- Scripts/LineageOS-14.1/Rebrand.sh | 20 ++++++++++---------- Scripts/LineageOS-15.1/Defaults.sh | 2 +- Scripts/LineageOS-15.1/Functions.sh | 1 - Scripts/LineageOS-15.1/Rebrand.sh | 28 ++++++++++++++-------------- Scripts/init.sh | 5 +++++ 7 files changed, 32 insertions(+), 28 deletions(-) diff --git a/PrebuiltApps b/PrebuiltApps index dd837ba6..ec413f9a 160000 --- a/PrebuiltApps +++ b/PrebuiltApps @@ -1 +1 @@ -Subproject commit dd837ba69a5226249c0b5b3cfc208050fba427bc +Subproject commit ec413f9a73af36a99f2589f0b7d02df461ca8dfa diff --git a/Scripts/LineageOS-14.1/Defaults.sh b/Scripts/LineageOS-14.1/Defaults.sh index 056af221..72719af1 100644 --- a/Scripts/LineageOS-14.1/Defaults.sh +++ b/Scripts/LineageOS-14.1/Defaults.sh @@ -25,7 +25,7 @@ echo "Changing default settings..."; enter "frameworks/base"; -sed -i '0,/wifi,cell,battery/s/wifi,cell,battery,dnd,flashlight,rotation,bt,airplane/wifi,cell,bt,dnd,flashlight,rotation,battery,profiles,location,airplane,saver,hotspot,nfc/' packages/SystemUI/res/values/config.xml; #Default quick tiles +sed -i '0,/wifi,cell,battery/s/wifi,cell,battery,dnd,flashlight,rotation,bt,airplane/wifi,cell,bt,dnd,flashlight,rotation,battery,profiles,location,airplane,caffeine,saver,hotspot,nfc/' packages/SystemUI/res/values/config.xml; #Default quick tiles sed -i 's/def_lock_screen_allow_private_notifications">true/def_lock_screen_allow_private_notifications">false/' packages/SettingsProvider/res/values/defaults.xml; sed -i 's/def_lockscreen_sounds_enabled">1/def_lockscreen_sounds_enabled">0/' packages/SettingsProvider/res/values/defaults.xml; sed -i 's/def_networks_available_notification_on">true/def_networks_available_notification_on">false/' packages/SettingsProvider/res/values/defaults.xml; diff --git a/Scripts/LineageOS-14.1/Rebrand.sh b/Scripts/LineageOS-14.1/Rebrand.sh index f6431ee2..70c552af 100644 --- a/Scripts/LineageOS-14.1/Rebrand.sh +++ b/Scripts/LineageOS-14.1/Rebrand.sh @@ -21,30 +21,30 @@ echo "Rebranding..."; enter "bootable/recovery"; -sed -i 's|Android Recovery|DivestOS Recovery|' *_ui.cpp; +sed -i 's|Android Recovery|'"$REBRAND_NAME"' Recovery|' *_ui.cpp; enter "build"; sed -i 's|echo "ro.build.user=$USER"|echo "ro.build.user=emy"|' tools/buildinfo.sh; #Override build user sed -i 's|echo "ro.build.host=`hostname`"|echo "ro.build.host=dosbm"|' tools/buildinfo.sh; #Override build host -sed -i '/CM_TARGET_PACKAGE/s/lineage/divested/' core/Makefile; +sed -i '/CM_TARGET_PACKAGE/s/lineage/'"$REBRAND_ZIP_PREFIX"'/' core/Makefile; enter "packages/apps/Settings"; -sed -i '/.*cmlicense_title/s/LineageOS/DivestOS/' res/values*/cm_strings.xml; -sed -i '/.*cmupdate_settings_title/s/LineageOS/DivestOS/' res/values*/cm_strings.xml; -sed -i '/.*mod_version/s/LineageOS/DivestOS/' res/values*/cm_strings.xml; +sed -i '/.*cmlicense_title/s/LineageOS/'"$REBRAND_NAME"'/' res/values*/cm_strings.xml; +sed -i '/.*cmupdate_settings_title/s/LineageOS/'"$REBRAND_NAME"'/' res/values*/cm_strings.xml; +sed -i '/.*mod_version/s/LineageOS/'"$REBRAND_NAME"'/' res/values*/cm_strings.xml; enter "packages/apps/SetupWizard"; sed -i 's|http://lineageos.org/legal|https://divestos.xyz/index.php?page=privacy_policy|' src/com/cyanogenmod/setupwizard/LineageSettingsActivity.java; -sed -i '/.*setup_services/s/LineageOS/DivestOS/' res/values*/strings.xml; -sed -i '/.*services_explanation/s/LineageOS/DivestOS/' res/values*/strings.xml; +sed -i '/.*setup_services/s/LineageOS/'"$REBRAND_NAME"'/' res/values*/strings.xml; +sed -i '/.*services_explanation/s/LineageOS/'"$REBRAND_NAME"'/' res/values*/strings.xml; cp $patches"android_packages_apps_SetupWizard/logo.xml" "res/drawable/logo.xml"; #Replace Lineage logo with ours enter "packages/apps/Updater"; -sed -i 's|>LineageOS|>DivestOS|' res/values*/strings.xml; +sed -i 's|>LineageOS|>'"$REBRAND_NAME"'|' res/values*/strings.xml; enter "vendor/cm"; -sed -i 's|https://lineageos.org/legal|https://divestos.xyz/index.php?page=about|' config/common.mk; -sed -i '/.*ZIPPATH=/s/lineage/divested/' build/envsetup.sh; +sed -i 's|https://lineageos.org/legal|'"$REBRAND_LEGAL"'|' config/common.mk; +sed -i '/.*ZIPPATH=/s/lineage/'"$REBRAND_ZIP_PREFIX"'/' build/envsetup.sh; rm -rf bootanimation #TODO: Create a boot animation cd $base; diff --git a/Scripts/LineageOS-15.1/Defaults.sh b/Scripts/LineageOS-15.1/Defaults.sh index 2dbcdf18..44d21d55 100644 --- a/Scripts/LineageOS-15.1/Defaults.sh +++ b/Scripts/LineageOS-15.1/Defaults.sh @@ -32,7 +32,7 @@ sed -i 's/proximityCheckOnWakeEnabledByDefault">false/proximityCheckOnWakeEnable #sed -i 's/VOLBTN_MUSIC_CONTROLS, 1/VOLBTN_MUSIC_CONTROLS, 0/' sdk/src/java/org/lineageos/internal/buttons/LineageButtons.java; #FIXME enter "frameworks/base"; -sed -i '0,/wifi,bt,dnd,flashlight/s/wifi,bt,dnd,flashlight,rotation,battery,cell,airplane,cast/wifi,cell,bt,dnd,flashlight,rotation,battery,sync,location,airplane,saver,hotspot,nfc/' packages/SystemUI/res/values/config.xml; #Default quick tiles +sed -i '0,/wifi,bt,dnd,flashlight/s/wifi,bt,dnd,flashlight,rotation,battery,cell,airplane,cast/wifi,cell,bt,dnd,flashlight,rotation,battery,sync,location,airplane,caffeine,saver,hotspot,nfc/' packages/SystemUI/res/values/config.xml; #Default quick tiles sed -i 's/def_lock_screen_allow_private_notifications">true/def_lock_screen_allow_private_notifications">false/' packages/SettingsProvider/res/values/defaults.xml; sed -i 's/def_lockscreen_sounds_enabled">1/def_lockscreen_sounds_enabled">0/' packages/SettingsProvider/res/values/defaults.xml; sed -i 's/def_networks_available_notification_on">true/def_networks_available_notification_on">false/' packages/SettingsProvider/res/values/defaults.xml; diff --git a/Scripts/LineageOS-15.1/Functions.sh b/Scripts/LineageOS-15.1/Functions.sh index 244ebd2a..3627b33b 100644 --- a/Scripts/LineageOS-15.1/Functions.sh +++ b/Scripts/LineageOS-15.1/Functions.sh @@ -75,7 +75,6 @@ patchWorkspace() { if [ "$MALWARE_SCAN_ENABLED" = true ]; then scanForMalware false "$prebuiltApps $base/build $base/device $base/vendor/lineage"; fi; source build/envsetup.sh; - repopick -f 206123; #bionic: Sort and cache hosts file data for fast lookup repopick -f 214824 209584 209585 215010 214300; #g3-common repopick -f 211404 211405 211406 211407 211408 211409; #d852 repopick -f 211396 214817; #d855 diff --git a/Scripts/LineageOS-15.1/Rebrand.sh b/Scripts/LineageOS-15.1/Rebrand.sh index 18d391f0..6b4740e9 100644 --- a/Scripts/LineageOS-15.1/Rebrand.sh +++ b/Scripts/LineageOS-15.1/Rebrand.sh @@ -21,40 +21,40 @@ echo "Rebranding..."; enter "bootable/recovery"; -git revert 6ac3bb48f9d10e604d4b2d6c4152be9d35d17ea0; +git revert bc57208dfcd0958d03a00bbcf5345be6ceac9988 6ac3bb48f9d10e604d4b2d6c4152be9d35d17ea0; patch -p1 < $patches"android_bootable_recovery/0001-Remove_Logo.patch"; #Remove logo rendering code rm res*/images/logo_image.png; #Remove logo images -sed -i 's|Android Recovery|DivestOS Recovery|' *_ui.cpp; -sed -i 's|LineageOS|DivestOS|' ui.cpp; +sed -i 's|Android Recovery|'"$REBRAND_NAME"' Recovery|' *_ui.cpp; +sed -i 's|LineageOS|'"$REBRAND_NAME"'|' ui.cpp; enter "build/make"; sed -i 's|echo "ro.build.user=$USER"|echo "ro.build.user=emy"|' tools/buildinfo.sh; #Override build user sed -i 's|echo "ro.build.host=`hostname`"|echo "ro.build.host=dosbm"|' tools/buildinfo.sh; #Override build host enter "lineage-sdk"; -sed -i '/.*lineage_version/s/LineageOS/DivestOS/' lineage/res/res/values*/strings.xml; -sed -i '/.*lineage_updates/s/LineageOS/DivestOS/' lineage/res/res/values*/strings.xml; -sed -i '/.*lineageos_system_label/s/LineageOS/DivestOS/' lineage/res/res/values*/strings.xml; +sed -i '/.*lineage_version/s/LineageOS/'"$REBRAND_NAME"'/' lineage/res/res/values*/strings.xml; +sed -i '/.*lineage_updates/s/LineageOS/'"$REBRAND_NAME"'/' lineage/res/res/values*/strings.xml; +sed -i '/.*lineageos_system_label/s/LineageOS/'"$REBRAND_NAME"'/' lineage/res/res/values*/strings.xml; enter "packages/apps/LineageParts"; -sed -i '/.*trust_feature_security_patches_explain/s/LineageOS/DivestOS/' res/values*/strings.xml; +sed -i '/.*trust_feature_security_patches_explain/s/LineageOS/'"$REBRAND_NAME"'/' res/values*/strings.xml; enter "packages/apps/Settings"; -sed -i '/.*lineagelicense_title/s/LineageOS/DivestOS/' res/values*/cm_strings.xml; +sed -i '/.*lineagelicense_title/s/LineageOS/'"$REBRAND_NAME"'/' res/values*/cm_strings.xml; enter "packages/apps/SetupWizard"; sed -i 's|http://lineageos.org/legal|https://divestos.xyz/index.php?page=privacy_policy|' src/org/lineageos/setupwizard/LineageSettingsActivity.java; -sed -i '/.*setup_services/s/LineageOS/DivestOS/' res/values*/strings.xml; -sed -i '/.*services_explanation/s/LineageOS/DivestOS/' res/values*/strings.xml; +sed -i '/.*setup_services/s/LineageOS/'"$REBRAND_NAME"'/' res/values*/strings.xml; +sed -i '/.*services_explanation/s/LineageOS/'"$REBRAND_NAME"'/' res/values*/strings.xml; cp $patches"android_packages_apps_SetupWizard/logo.xml" "res/drawable/logo.xml"; #Replace Lineage logo with ours enter "packages/apps/Updater"; -sed -i 's|>LineageOS|>DivestOS|' res/values*/strings.xml; +sed -i 's|>LineageOS|>'"$REBRAND_NAME"'|' res/values*/strings.xml; enter "vendor/lineage"; -sed -i 's|https://lineageos.org/legal|https://divestos.xyz/index.php?page=about|' build/core/main_version.mk -sed -i '/.*ZIPPATH=/s/lineage/divested/' build/envsetup.sh; -sed -i '/LINEAGE_TARGET_PACKAGE/s/lineage/divested/' build/tasks/bacon.mk; +sed -i 's|https://lineageos.org/legal|'"$REBRAND_LEGAL"'|' build/core/main_version.mk +sed -i '/.*ZIPPATH=/s/lineage/'"$REBRAND_ZIP_PREFIX"'/' build/envsetup.sh; +sed -i '/LINEAGE_TARGET_PACKAGE/s/lineage/'"$REBRAND_ZIP_PREFIX"'/' build/tasks/bacon.mk; rm -rf bootanimation; #TODO: Create a boot animation cd $base; diff --git a/Scripts/init.sh b/Scripts/init.sh index bba7dd0d..d1fd715e 100644 --- a/Scripts/init.sh +++ b/Scripts/init.sh @@ -31,6 +31,11 @@ export HOSTS_BLOCKING=true; #Switch to false to prevent inclusion of our HOSTS f export OVERCLOCKS_ENABLED=true; #Switch to false to disable overclocks export STRONG_ENCRYPTION_ENABLED=false; #Switch to true to enable AES-256bit encryption XXX: THIS WILL **DESTROY** EXISTING INSTALLS! export NON_COMMERCIAL_USE_PATCHES=false; #Switch to false to prevent inclusion of non-commercial use patches + +#XXX: Changing the following rebranding variables only updates textual references +export REBRAND_NAME="DivestOS"; +export REBRAND_ZIP_PREFIX="divested"; +export REBRAND_LEGAL="https://divestos.xyz/index.php?page=privacy_policy"; #END OF USER CONFIGURABLE OPTIONS BUILD_WORKING_DIR=${PWD##*/};