2018-12-18 15:39:55 -05:00
|
|
|
#!/bin/bash
|
|
|
|
#DivestOS: A privacy oriented Android distribution
|
|
|
|
#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/>.
|
|
|
|
|
|
|
|
#Last verified: 2018-07-10
|
|
|
|
|
|
|
|
patchAllKernels() {
|
2018-12-18 17:21:06 -05:00
|
|
|
startPatcher "kernel_zte_msm8930";
|
2018-12-18 15:39:55 -05:00
|
|
|
}
|
|
|
|
export -f patchAllKernels;
|
|
|
|
|
|
|
|
resetWorkspace() {
|
2018-12-18 21:34:32 -05:00
|
|
|
repo forall -c 'git add -A && git reset --hard' && rm -rf out && repo sync -j20 --force-sync;
|
2018-12-18 15:39:55 -05:00
|
|
|
}
|
|
|
|
export -f resetWorkspace;
|
|
|
|
|
|
|
|
scanWorkspaceForMalware() {
|
|
|
|
scanQueue="$DOS_BUILD_BASE/abi $DOS_BUILD_BASE/android $DOS_BUILD_BASE/bionic $DOS_BUILD_BASE/bootable $DOS_BUILD_BASE/build $DOS_BUILD_BASE/dalvik $DOS_BUILD_BASE/device $DOS_BUILD_BASE/hardware $DOS_BUILD_BASE/libcore $DOS_BUILD_BASE/libnativehelper $DOS_BUILD_BASE/ndk $DOS_BUILD_BASE/packages $DOS_BUILD_BASE/pdk $DOS_BUILD_BASE/sdk $DOS_BUILD_BASE/system";
|
|
|
|
scanQueue=$scanQueue" $DOS_BUILD_BASE/vendor/cm $DOS_BUILD_BASE/vendor/cmsdk";
|
|
|
|
scanForMalware true $scanQueue;
|
|
|
|
}
|
|
|
|
export -f scanWorkspaceForMalware;
|
|
|
|
|
|
|
|
buildDevice() {
|
|
|
|
brunch "cm_$1-user";
|
|
|
|
}
|
|
|
|
export -f buildDevice;
|
|
|
|
|
|
|
|
buildDeviceDebug() {
|
|
|
|
unset SIGNING_KEY_DIR;
|
|
|
|
unset OTA_PACKAGE_SIGNING_KEY;
|
|
|
|
brunch "cm_$1-eng";
|
|
|
|
}
|
|
|
|
export -f buildDeviceDebug;
|
|
|
|
|
|
|
|
buildAll() {
|
|
|
|
if [ "$DOS_MALWARE_SCAN_ENABLED" = true ]; then scanWorkspaceForMalware; fi;
|
|
|
|
#Select devices are userdebug due to SELinux policy issues
|
2018-12-19 02:15:15 -05:00
|
|
|
brunch lineage_nex-user;
|
2018-12-18 15:39:55 -05:00
|
|
|
}
|
|
|
|
export -f buildAll;
|
|
|
|
|
|
|
|
patchWorkspace() {
|
|
|
|
if [ "$DOS_MALWARE_SCAN_ENABLED" = true ]; then scanForMalware false "$DOS_PREBUILT_APPS $DOS_BUILD_BASE/build $DOS_BUILD_BASE/device $DOS_BUILD_BASE/vendor/cm"; fi;
|
2018-12-18 21:34:32 -05:00
|
|
|
sed -i "s/'git', 'show', '-q'/'git', 'show'/" build/tools/repopick.py; #fix for old git versions
|
|
|
|
source build/envsetup.sh;
|
|
|
|
#repopick -it asb-2018.09-cm11 -e 228457; #merged except for level
|
|
|
|
repopick -it asb-2018.09-cm11-qcom;
|
|
|
|
#repopick -it asb-2018.10-cm11 -e 234585; #merged except for level
|
|
|
|
repopick -it asb-2018.11-cm11 -e 234695;
|
|
|
|
repopick -it cm.service.adb.root; #security fix for -userdebug
|
|
|
|
repopick -it asb-2018.12-cm11;
|
2018-12-18 15:39:55 -05:00
|
|
|
|
|
|
|
source "$DOS_SCRIPTS/Patch.sh";
|
|
|
|
source "$DOS_SCRIPTS/Defaults.sh";
|
|
|
|
source "$DOS_SCRIPTS/Rebrand.sh";
|
2018-12-18 23:39:29 -05:00
|
|
|
if [ "$DOS_OVERCLOCKS_ENABLED" = true ]; then source "$DOS_SCRIPTS_COMMON/Overclock.sh"; fi;
|
2018-12-18 15:39:55 -05:00
|
|
|
source "$DOS_SCRIPTS/Optimize.sh";
|
2018-12-18 23:39:29 -05:00
|
|
|
source "$DOS_SCRIPTS_COMMON/Deblob.sh";
|
2018-12-18 15:39:55 -05:00
|
|
|
source "$DOS_SCRIPTS_COMMON/Patch_CVE.sh";
|
|
|
|
source build/envsetup.sh;
|
|
|
|
}
|
|
|
|
export -f patchWorkspace;
|