DivestOS/Scripts/LineageOS-14.1/Rebrand.sh

52 lines
2.3 KiB
Bash
Raw Normal View History

#!/bin/bash
2017-11-05 15:58:01 +00:00
#DivestOS: A privacy oriented Android distribution
2018-06-03 18:13:59 +00:00
#Copyright (c) 2017-2018 Divested Computing, Inc.
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/>.
#Updates select user facing strings
2018-04-28 03:49:40 +00:00
#Last verified: 2018-04-27
2018-04-23 12:59:18 +00:00
echo "Rebranding...";
2017-10-18 14:00:05 +00:00
2018-04-23 12:59:18 +00:00
enter "bootable/recovery";
2018-06-23 04:21:48 +00:00
sed -i 's|Android Recovery|'"$REBRAND_NAME"' Recovery|' ./*_ui.cpp;
2017-11-10 17:23:07 +00:00
2018-04-23 12:59:18 +00:00
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/'"$REBRAND_ZIP_PREFIX"'/' core/Makefile;
2018-04-23 12:59:18 +00:00
enter "packages/apps/Settings";
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;
2018-04-23 12:59:18 +00:00
enter "packages/apps/SetupWizard";
2018-05-14 02:21:42 +00:00
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/'"$REBRAND_NAME"'/' res/values*/strings.xml;
sed -i '/.*services_explanation/s/LineageOS/'"$REBRAND_NAME"'/' res/values*/strings.xml;
2018-06-23 04:21:48 +00:00
cp "$patches/android_packages_apps_SetupWizard/logo.xml" "res/drawable/logo.xml"; #Replace Lineage logo with ours
2018-04-23 12:59:18 +00:00
enter "packages/apps/Updater";
sed -i 's|>LineageOS|>'"$REBRAND_NAME"'|' res/values*/strings.xml;
2018-04-23 12:59:18 +00:00
enter "vendor/cm";
sed -i 's|https://lineageos.org/legal|'"$REBRAND_LEGAL"'|' config/common.mk;
sed -i '/.*ZIPPATH=/s/lineage/'"$REBRAND_ZIP_PREFIX"'/' build/envsetup.sh;
2017-10-19 03:10:20 +00:00
rm -rf bootanimation #TODO: Create a boot animation
2017-10-18 14:00:05 +00:00
2018-06-23 04:21:48 +00:00
cd "$base";
2018-04-23 12:59:18 +00:00
echo "Rebranding complete!";