2017-10-18 11:54:56 +00:00
|
|
|
#!/bin/bash
|
2020-11-17 15:11:40 +00:00
|
|
|
#DivestOS: A privacy focused mobile distribution
|
2022-05-01 05:13:46 +00:00
|
|
|
#Copyright (c) 2017-2022 Divested Computing Group
|
2017-11-05 15:58:01 +00:00
|
|
|
#
|
|
|
|
#This program is free software: you can redistribute it and/or modify
|
|
|
|
#it under the terms of the GNU General Public License as published by
|
|
|
|
#the Free Software Foundation, either version 3 of the License, or
|
|
|
|
#(at your option) any later version.
|
|
|
|
#
|
|
|
|
#This program is distributed in the hope that it will be useful,
|
|
|
|
#but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
#GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
#You should have received a copy of the GNU General Public License
|
|
|
|
#along with this program. If not, see <https://www.gnu.org/licenses/>.
|
2021-10-16 23:15:19 +00:00
|
|
|
umask 0022;
|
2021-10-16 19:28:15 +00:00
|
|
|
set -euo pipefail;
|
2021-10-16 23:15:19 +00:00
|
|
|
source "$DOS_SCRIPTS_COMMON/Shell.sh";
|
2017-10-18 11:54:56 +00:00
|
|
|
|
|
|
|
#Updates select user facing strings
|
2021-10-16 20:28:41 +00:00
|
|
|
#Last verified: 2021-10-16
|
2017-10-18 11:54:56 +00:00
|
|
|
|
2018-04-23 12:59:18 +00:00
|
|
|
echo "Rebranding...";
|
2017-10-18 14:00:05 +00:00
|
|
|
|
2021-07-09 00:41:33 +00:00
|
|
|
if enter "bootable/recovery"; then
|
2020-04-14 20:15:33 +00:00
|
|
|
sed -i 's|Android Recovery|'"$DOS_BRANDING_NAME"' Recovery|' ./*ui.cpp;
|
2021-07-09 00:41:33 +00:00
|
|
|
fi;
|
2017-11-10 17:23:07 +00:00
|
|
|
|
2021-07-09 00:41:33 +00:00
|
|
|
if enter "build"; then
|
2017-10-19 23:19:26 +00:00
|
|
|
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
|
2018-06-29 04:55:21 +00:00
|
|
|
sed -i '/CM_TARGET_PACKAGE/s/lineage/'"$DOS_BRANDING_ZIP_PREFIX"'/' core/Makefile;
|
2021-07-09 00:41:33 +00:00
|
|
|
fi;
|
2017-10-19 23:19:26 +00:00
|
|
|
|
2021-07-09 00:41:33 +00:00
|
|
|
if enter "frameworks/base"; then
|
2018-06-29 04:55:21 +00:00
|
|
|
generateBootAnimationMask "$DOS_BRANDING_NAME" "$DOS_BRANDING_BOOTANIMATION_FONT" core/res/assets/images/android-logo-mask.png;
|
|
|
|
generateBootAnimationShine "$DOS_BRANDING_BOOTANIMATION_COLOR" "$DOS_BRANDING_BOOTANIMATION_STYLE" core/res/assets/images/android-logo-shine.png;
|
2021-07-09 00:41:33 +00:00
|
|
|
fi;
|
2018-06-24 08:26:59 +00:00
|
|
|
|
2021-07-09 00:41:33 +00:00
|
|
|
if enter "packages/apps/CMParts"; then
|
2020-10-31 14:49:54 +00:00
|
|
|
sed -i '/.*egg_title/s/LineageOS/'"$DOS_BRANDING_NAME"'/' res/values*/strings.xml;
|
|
|
|
sed -i '/.*cmparts_title/s/LineageOS/'"$DOS_BRANDING_NAME"'/' res/values*/strings.xml;
|
|
|
|
sed -i '/.*privacy_settings_category/s/LineageOS/'"$DOS_BRANDING_NAME"'/' res/values*/strings.xml;
|
2021-07-09 00:41:33 +00:00
|
|
|
fi;
|
2020-10-31 14:49:54 +00:00
|
|
|
|
2021-07-09 00:41:33 +00:00
|
|
|
if enter "packages/apps/Settings"; then
|
2018-06-29 04:55:21 +00:00
|
|
|
sed -i '/.*cmlicense_title/s/LineageOS/'"$DOS_BRANDING_NAME"'/' res/values*/cm_strings.xml;
|
|
|
|
sed -i '/.*cmupdate_settings_title/s/LineageOS/'"$DOS_BRANDING_NAME"'/' res/values*/cm_strings.xml;
|
|
|
|
sed -i '/.*mod_version/s/LineageOS/'"$DOS_BRANDING_NAME"'/' res/values*/cm_strings.xml;
|
2021-07-09 00:41:33 +00:00
|
|
|
fi;
|
2017-10-18 11:54:56 +00:00
|
|
|
|
2021-07-09 00:41:33 +00:00
|
|
|
if enter "packages/apps/SetupWizard"; then
|
2018-06-29 04:55:21 +00:00
|
|
|
sed -i 's|http://lineageos.org/legal|'"$DOS_BRANDING_LINK_PRIVACY"'|' src/com/cyanogenmod/setupwizard/LineageSettingsActivity.java;
|
2020-10-31 14:49:54 +00:00
|
|
|
sed -i '/.*os_name/s/LineageOS/'"$DOS_BRANDING_NAME"'/' res/values*/strings.xml;
|
2021-03-22 23:59:15 +00:00
|
|
|
sed -i '/.*services/s/LineageOS/'"$DOS_BRANDING_NAME"'/g' res/values*/strings.xml;
|
|
|
|
sed -i '/.*setup_services/s/LineageOS/'"$DOS_BRANDING_NAME"'/g' res/values*/strings.xml;
|
2021-07-09 00:41:33 +00:00
|
|
|
fi;
|
2017-10-18 11:54:56 +00:00
|
|
|
|
2021-07-09 00:41:33 +00:00
|
|
|
if enter "packages/apps/Updater"; then
|
2018-09-20 21:41:19 +00:00
|
|
|
sed -i 's|0OTA_SERVER_CLEARNET0|'"$DOS_BRANDING_SERVER_OTA"'|' src/org/lineageos/updater/misc/Utils.java;
|
|
|
|
sed -i 's|0OTA_SERVER_ONION0|'"$DOS_BRANDING_SERVER_OTA_ONION"'|' src/org/lineageos/updater/misc/Utils.java;
|
2018-06-29 04:55:21 +00:00
|
|
|
sed -i 's|>LineageOS|>'"$DOS_BRANDING_NAME"'|' res/values*/strings.xml;
|
2021-07-09 00:41:33 +00:00
|
|
|
fi;
|
2017-10-18 11:54:56 +00:00
|
|
|
|
2022-03-19 16:41:49 +00:00
|
|
|
if enter "system/core"; then
|
|
|
|
sed -i 's/LineageOS/'"$DOS_BRANDING_NAME"'/' debuggerd/tombstone.cpp;
|
|
|
|
fi;
|
|
|
|
|
2021-07-09 00:41:33 +00:00
|
|
|
if enter "vendor/cm"; then
|
2018-06-29 04:55:21 +00:00
|
|
|
sed -i 's|https://lineageos.org/legal|'"$DOS_BRANDING_LINK_ABOUT"'|' config/common.mk;
|
|
|
|
sed -i '/.*ZIPPATH=/s/lineage/'"$DOS_BRANDING_ZIP_PREFIX"'/' build/envsetup.sh;
|
2021-08-07 18:49:28 +00:00
|
|
|
sed -i '/.*config_mms_user_agent/s/LineageOS/'"$DOS_BRANDING_NAME"'/g' overlay/common/frameworks/base/core/res/res/values*/config.xml
|
2018-06-24 08:26:59 +00:00
|
|
|
rm -rf bootanimation;
|
2021-07-09 00:41:33 +00:00
|
|
|
fi;
|
2017-10-18 14:00:05 +00:00
|
|
|
|
2018-06-29 04:55:21 +00:00
|
|
|
cd "$DOS_BUILD_BASE";
|
2021-10-16 19:28:15 +00:00
|
|
|
echo -e "\e[0;32m[SCRIPT COMPLETE] Rebranding complete\e[0m";
|