DivestOS/Scripts/LineageOS-15.1/Rebrand.sh

65 lines
3.0 KiB
Bash
Raw Normal View History

#!/bin/bash
#DivestOS: A privacy oriented Android distribution
2018-06-03 14:13:59 -04:00
#Copyright (c) 2017-2018 Divested Computing, Inc.
#
#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-27 23:09:52 -04:00
#Last verified: 2018-04-27
2018-04-23 08:59:18 -04:00
echo "Rebranding...";
2018-04-23 08:59:18 -04:00
enter "bootable/recovery";
git revert bc57208dfcd0958d03a00bbcf5345be6ceac9988 6ac3bb48f9d10e604d4b2d6c4152be9d35d17ea0;
2018-06-23 00:26:46 -04:00
patch -p1 < "$patches/android_bootable_recovery/0001-Remove_Logo.patch"; #Remove logo rendering code
rm res*/images/logo_image.png; #Remove logo images
2018-06-23 00:21:48 -04:00
sed -i 's|Android Recovery|'"$REBRAND_NAME"' Recovery|' ./*_ui.cpp;
sed -i 's|LineageOS|'"$REBRAND_NAME"'|' ui.cpp;
2018-04-23 08:59:18 -04:00
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
2018-06-24 04:26:59 -04:00
enter "frameworks/base";
2018-06-24 05:26:03 -04:00
generateBootAnimationMask "$REBRAND_NAME" "$REBRAND_BOOTANIMATION_FONT" core/res/assets/images/android-logo-mask.png;
2018-06-24 04:26:59 -04:00
2018-04-23 08:59:18 -04:00
enter "lineage-sdk";
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;
2018-04-03 09:10:49 -04:00
2018-04-23 08:59:18 -04:00
enter "packages/apps/LineageParts";
sed -i '/.*trust_feature_security_patches_explain/s/LineageOS/'"$REBRAND_NAME"'/' res/values*/strings.xml;
2018-04-22 02:41:18 -04:00
2018-04-23 08:59:18 -04:00
enter "packages/apps/Settings";
sed -i '/.*lineagelicense_title/s/LineageOS/'"$REBRAND_NAME"'/' res/values*/cm_strings.xml;
2018-04-23 08:59:18 -04:00
enter "packages/apps/SetupWizard";
2018-05-13 22:21:42 -04:00
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/'"$REBRAND_NAME"'/' res/values*/strings.xml;
sed -i '/.*services_explanation/s/LineageOS/'"$REBRAND_NAME"'/' res/values*/strings.xml;
2018-06-23 00:26:46 -04:00
cp "$patches/android_packages_apps_SetupWizard/logo.xml" "res/drawable/logo.xml"; #Replace Lineage logo with ours
2018-04-23 08:59:18 -04:00
enter "packages/apps/Updater";
sed -i 's|>LineageOS|>'"$REBRAND_NAME"'|' res/values*/strings.xml;
2018-04-23 08:59:18 -04:00
enter "vendor/lineage";
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;
2018-06-24 04:26:59 -04:00
rm -rf bootanimation;
2018-06-23 00:21:48 -04:00
cd "$base";
2018-04-23 08:59:18 -04:00
echo "Rebranding complete!";