2018-12-18 20:39:55 +00:00
|
|
|
#!/bin/bash
|
|
|
|
#DivestOS: A privacy oriented Android distribution
|
2019-06-18 17:49:01 +00:00
|
|
|
#Copyright (c) 2017-2018 Divested Computing Group
|
2018-12-18 20:39:55 +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/>.
|
|
|
|
|
|
|
|
#Last verified: 2018-07-10
|
|
|
|
|
|
|
|
patchAllKernels() {
|
2018-12-18 22:21:06 +00:00
|
|
|
startPatcher "kernel_zte_msm8930";
|
2018-12-18 20:39:55 +00:00
|
|
|
}
|
|
|
|
export -f patchAllKernels;
|
|
|
|
|
|
|
|
resetWorkspace() {
|
2018-12-19 02:34:32 +00:00
|
|
|
repo forall -c 'git add -A && git reset --hard' && rm -rf out && repo sync -j20 --force-sync;
|
2018-12-18 20:39:55 +00:00
|
|
|
}
|
|
|
|
export -f resetWorkspace;
|
|
|
|
|
|
|
|
scanWorkspaceForMalware() {
|
2019-09-17 04:55:50 +00:00
|
|
|
local 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";
|
2018-12-18 20:39:55 +00:00
|
|
|
scanQueue=$scanQueue" $DOS_BUILD_BASE/vendor/cm $DOS_BUILD_BASE/vendor/cmsdk";
|
2019-04-01 02:46:37 +00:00
|
|
|
scanForMalware true "$scanQueue";
|
2018-12-18 20:39:55 +00:00
|
|
|
}
|
|
|
|
export -f scanWorkspaceForMalware;
|
|
|
|
|
|
|
|
buildDevice() {
|
2019-09-14 00:26:43 +00:00
|
|
|
export OTA_PACKAGE_SIGNING_KEY="$DOS_SIGNING_KEYS/$1/releasekey";
|
2019-09-03 00:00:39 +00:00
|
|
|
brunch "cm_$1-user" && processRelease $1 false;
|
2018-12-18 20:39:55 +00:00
|
|
|
}
|
|
|
|
export -f buildDevice;
|
|
|
|
|
|
|
|
buildDeviceDebug() {
|
2019-09-14 00:26:43 +00:00
|
|
|
unset OTA_PACKAGE_SIGNING_KEY;
|
2018-12-18 20:39:55 +00:00
|
|
|
brunch "cm_$1-eng";
|
|
|
|
}
|
|
|
|
export -f buildDeviceDebug;
|
|
|
|
|
|
|
|
buildAll() {
|
|
|
|
if [ "$DOS_MALWARE_SCAN_ENABLED" = true ]; then scanWorkspaceForMalware; fi;
|
2019-08-06 00:34:08 +00:00
|
|
|
if [ "$DOS_OPTIMIZE_IMAGES" = true ]; then optimizeImagesRecursive "$DOS_BUILD_BASE"; fi;
|
2019-09-07 13:56:47 +00:00
|
|
|
brunch lineage_nex-user && processRelease nex false; #broken encryption
|
2018-12-18 20:39:55 +00: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-19 02:34:32 +00: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-qcom;
|
2019-05-18 03:26:25 +00:00
|
|
|
repopick -i 230054 230392; #asb disclaimer
|
2019-09-07 13:56:47 +00:00
|
|
|
repopick -it asb-2019.03-cm11;
|
|
|
|
#repopick -it asb-2019.04-cm11 -e 246293;
|
2019-05-18 03:26:25 +00:00
|
|
|
repopick -it asb-2019.05-cm11;
|
2019-06-08 06:34:04 +00:00
|
|
|
repopick -it asb-2019.06-cm11;
|
2019-07-07 22:59:01 +00:00
|
|
|
repopick -it asb-2019.07-cm11;
|
2019-08-12 21:14:25 +00:00
|
|
|
repopick -it asb-2019.08-cm11;
|
2018-12-18 20:39:55 +00:00
|
|
|
|
|
|
|
source "$DOS_SCRIPTS/Patch.sh";
|
|
|
|
source "$DOS_SCRIPTS/Defaults.sh";
|
|
|
|
source "$DOS_SCRIPTS/Rebrand.sh";
|
2018-12-19 04:39:29 +00:00
|
|
|
if [ "$DOS_OVERCLOCKS_ENABLED" = true ]; then source "$DOS_SCRIPTS_COMMON/Overclock.sh"; fi;
|
2019-03-04 08:11:51 +00:00
|
|
|
source "$DOS_SCRIPTS_COMMON/Optimize.sh";
|
2018-12-19 04:39:29 +00:00
|
|
|
source "$DOS_SCRIPTS_COMMON/Deblob.sh";
|
2018-12-18 20:39:55 +00:00
|
|
|
source "$DOS_SCRIPTS_COMMON/Patch_CVE.sh";
|
|
|
|
source build/envsetup.sh;
|
|
|
|
}
|
|
|
|
export -f patchWorkspace;
|