DivestOS/Scripts/init.sh

90 lines
3.5 KiB
Bash
Raw Normal View History

#!/bin/bash
2017-11-05 10:58:01 -05:00
#DivestOS: A privacy oriented Android distribution
2018-06-03 14:13:59 -04:00
#Copyright (c) 2017-2018 Divested Computing, Inc.
2017-11-05 10:58:01 -05: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/>.
#Sets settings used by all other scripts
2018-06-02 17:51:18 -04:00
#START OF USER CONFIGURABLE OPTIONS
export androidWorkspace="/mnt/Drive-3/"; #XXX: THIS MUST BE CORRECT TO BUILD!
export DEBLOBBER_REMOVE_IMS=false; #Set true to remove all IMS blobs
2018-06-13 07:23:59 -04:00
export DEBLOBBER_REPLACE_TIME=false; #Set true to replace Qualcomm Time Services with the open source Sony TimeKeep reimplementation
2018-06-03 14:13:59 -04:00
export DEFAULT_DNS="OpenNIC"; #Sets default DNS. Options: Cloudflare, OpenNIC
2018-06-05 00:35:42 -04:00
export GLONASS_FORCED_ENABLE=true; #Enables GLONASS on all devices
2018-06-02 17:51:18 -04:00
export MALWARE_SCAN_ENABLED=true; #Set true to perform a fast scan on patchWorkspace() and a through scan on buildAll()
2018-06-03 14:13:59 -04:00
export MALWARE_SCAN_SETTING="quick"; #buildAll() scan speed. Options: quick, extra, slow, full
2018-06-02 17:51:18 -04:00
export MICROG_INCLUDED=true; #Switch to false to prevent inclusion of microG
export HOSTS_BLOCKING=true; #Switch to false to prevent inclusion of our HOSTS file
2018-06-03 07:48:34 -04:00
export OVERCLOCKS_ENABLED=true; #Switch to false to disable overclocks
2018-06-02 18:28:40 -04:00
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";
2018-06-02 17:51:18 -04:00
#END OF USER CONFIGURABLE OPTIONS
BUILD_WORKING_DIR=${PWD##*/};
2018-06-03 08:02:43 -04:00
if [ -d ".repo" ]; then
echo "Detected $BUILD_WORKING_DIR";
else
echo "Not a valid workspace!";
return 1;
fi;
2018-06-02 17:51:18 -04:00
export base=$androidWorkspace"Build/$BUILD_WORKING_DIR/";
2018-06-03 08:02:43 -04:00
if [ ! -d $base ]; then
echo "Path mismatch! Please update init.sh!";
return 1;
fi;
2017-11-05 14:30:15 -05:00
export prebuiltApps=$androidWorkspace"PrebuiltApps/";
2018-06-02 17:51:18 -04:00
export patches=$androidWorkspace"Patches/$BUILD_WORKING_DIR/";
2017-12-08 18:59:55 -05:00
export cvePatchesLinux=$androidWorkspace"Patches/Linux/";
export cvePatchesAndroid=$androidWorkspace"Patches/Android/";
2017-11-28 12:28:55 -05:00
export dosWallpapers=$androidWorkspace"Patches/Wallpapers/";
2018-04-04 07:52:11 -04:00
export scriptsCommon=$androidWorkspace"Scripts/Common/";
2018-06-02 17:51:18 -04:00
export scripts=$androidWorkspace"Scripts/$BUILD_WORKING_DIR/";
2018-06-03 08:02:43 -04:00
if [ ! -d $scripts ]; then
echo "$BUILD_WORKING_DIR is not supported!";
return 1;
fi;
2017-10-30 01:30:10 -04:00
export cveScripts=$scripts"CVE_Patchers/";
2018-06-03 08:24:23 -04:00
export SIGNING_KEY_DIR=$androidWorkspace"Signing_Keys";
export OTA_PACKAGE_SIGNING_KEY=$SIGNING_KEY_DIR"/releasekey";
2017-10-30 01:30:10 -04:00
export ANDROID_HOME="/home/$USER/Android/Sdk";
2018-04-23 08:59:18 -04:00
export KBUILD_BUILD_USER="emy";
export KBUILD_BUILD_HOST="dosbm";
export ANDROID_JACK_VM_ARGS="-Xmx6144m -Xms512m -Dfile.encoding=UTF-8 -XX:+TieredCompilation";
export JACK_SERVER_VM_ARGUMENTS="${ANDROID_JACK_VM_ARGS}";
2018-04-23 08:59:18 -04:00
export GRADLE_OPTS="-Xmx2048m";
source $scriptsCommon"/Functions.sh";
source $scripts"/Functions.sh";
export LC_ALL=C;
2018-04-23 08:59:18 -04:00
unalias cp;
unalias mv;
unalias rm;
unalias ln;