Restore nex/11.0 and cleanup

This commit is contained in:
Tad 2017-11-06 15:34:40 -05:00
parent db7f521c28
commit 5bc79a7ad7
17 changed files with 423 additions and 33 deletions

View file

@ -0,0 +1,34 @@
#!/bin/bash
#DivestOS: A privacy oriented Android distribution
#Copyright (c) 2017 Spot Communications, 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/>.
#Sets settings used by all other scripts
export androidWorkspace="/mnt/Drive-1/Development/Other/Android_ROMs/";
export base=$androidWorkspace"Build/LineageOS-11.0/";
export patches=$androidWorkspace"Patches/LineageOS-11.0/";
export cvePatches=$androidWorkspace"Patches/Linux_CVEs/";
export scripts=$androidWorkspace"Scripts/LineageOS-11.0/";
export cveScripts=$scripts"CVE_Patchers/";
export ANDROID_HOME="/home/$USER/Android/Sdk";
export KBUILD_BUILD_USER=emy
export KBUILD_BUILD_HOST=dosbm
export GRADLE_OPTS=-Xmx2048m

View file

@ -0,0 +1,79 @@
#!/bin/bash
cd $base"kernel/zte/msm8930"
git apply $cvePatches/CVE-2012-6657/ANY/0.patch
git apply $cvePatches/CVE-2012-6701/ANY/0.patch
git apply $cvePatches/CVE-2012-6704/ANY/0.patch
git apply $cvePatches/CVE-2013-2015/3.4/0.patch
git apply $cvePatches/CVE-2014-0196/ANY/0.patch
git apply $cvePatches/CVE-2014-1739/ANY/0.patch
git apply $cvePatches/CVE-2014-2523/ANY/0.patch
git apply $cvePatches/CVE-2014-4655/ANY/0.patch
git apply $cvePatches/CVE-2014-4656/ANY/0.patch
git apply $cvePatches/CVE-2014-7822/3.2-^3.16/0.patch
git apply $cvePatches/CVE-2014-7970/3.4/2.patch
git apply $cvePatches/CVE-2014-8173/ANY/0.patch
git apply $cvePatches/CVE-2014-8709/ANY/0.patch
git apply $cvePatches/CVE-2014-9420/3.2-^3.18/1.patch
git apply $cvePatches/CVE-2014-9683/3.2-^3.18/1.patch
git apply $cvePatches/CVE-2014-9715/ANY/0.patch
git apply $cvePatches/CVE-2014-9870/ANY/0.patch
git apply $cvePatches/CVE-2014-9900/ANY/0.patch
git apply $cvePatches/CVE-2015-1593/ANY/0.patch
git apply $cvePatches/CVE-2015-1805/3.4-^3.16/0.patch
git apply $cvePatches/CVE-2015-2041/ANY/0.patch
git apply $cvePatches/CVE-2015-2686/ANY/0.patch
git apply $cvePatches/CVE-2015-2922/ANY/0.patch
git apply $cvePatches/CVE-2015-3636/ANY/0.patch
git apply $cvePatches/CVE-2015-7515/3.2-^4.4/1.patch
git apply $cvePatches/CVE-2015-7550/ANY/0.patch
git apply $cvePatches/CVE-2015-8937/ANY/0.patch
git apply $cvePatches/CVE-2015-8939/ANY/0.patch
git apply $cvePatches/CVE-2015-8944/ANY/0.patch
git apply $cvePatches/CVE-2016-0723/ANY/0.patch
git apply $cvePatches/CVE-2016-0774/ANY/1.patch
git apply $cvePatches/CVE-2016-0821/ANY/0.patch
git apply $cvePatches/CVE-2016-10233/ANY/0.patch
git apply $cvePatches/CVE-2016-2185/ANY/0.patch
git apply $cvePatches/CVE-2016-2186/ANY/0.patch
git apply $cvePatches/CVE-2016-2384/ANY/0.patch
git apply $cvePatches/CVE-2016-2544/ANY/0.patch
git apply $cvePatches/CVE-2016-2545/ANY/0.patch
git apply $cvePatches/CVE-2016-2546/ANY/0.patch
git apply $cvePatches/CVE-2016-2547/ANY/0.patch
git apply $cvePatches/CVE-2016-2549/ANY/0.patch
git apply $cvePatches/CVE-2016-3138/ANY/0.patch
git apply $cvePatches/CVE-2016-3854/ANY/0.patch
git apply $cvePatches/CVE-2016-4569/ANY/0.patch
git apply $cvePatches/CVE-2016-4578/ANY/0.patch
git apply $cvePatches/CVE-2016-5195/3.4/0.patch
git apply $cvePatches/CVE-2016-5829/ANY/0.patch
git apply $cvePatches/CVE-2016-6672/ANY/0.patch
git apply $cvePatches/CVE-2016-6753/ANY/0.patch
git apply $cvePatches/CVE-2016-6828/ANY/0.patch
git apply $cvePatches/CVE-2016-7915/ANY/0.patch
git apply $cvePatches/CVE-2016-8399/ANY/1.patch
git apply $cvePatches/CVE-2016-8404/ANY/0.patch
git apply $cvePatches/CVE-2016-8406/ANY/0.patch
git apply $cvePatches/CVE-2016-8650/ANY/0.patch
git apply $cvePatches/CVE-2016-9604/ANY/0.patch
git apply $cvePatches/CVE-2016-9793/ANY/0.patch
git apply $cvePatches/CVE-2017-0403/ANY/0.patch
git apply $cvePatches/CVE-2017-0404/ANY/0.patch
git apply $cvePatches/CVE-2017-0648/ANY/0.patch
git apply $cvePatches/CVE-2017-0710/ANY/0.patch
git apply $cvePatches/CVE-2017-0751/ANY/0.patch
git apply $cvePatches/CVE-2017-0786/ANY/0.patch
git apply $cvePatches/CVE-2017-1000251/3.4/1.patch
git apply $cvePatches/CVE-2017-13080/ANY/0.patch
git apply $cvePatches/CVE-2017-13080-Extra/ANY/0.patch
git apply $cvePatches/CVE-2017-13080-Extra/ANY/1.patch
git apply $cvePatches/CVE-2017-15265/ANY/0.patch
git apply $cvePatches/CVE-2017-2671/ANY/0.patch
git apply $cvePatches/CVE-2017-5970/ANY/0.patch
git apply $cvePatches/CVE-2017-6074/ANY/0.patch
git apply $cvePatches/CVE-2017-6345/ANY/0.patch
git apply $cvePatches/CVE-2017-6348/ANY/0.patch
git apply $cvePatches/CVE-2017-6951/ANY/0.patch
git apply $cvePatches/CVE-2017-7487/ANY/0.patch
git apply $cvePatches/CVE-2017-9242/ANY/0.patch
cd $base

View file

@ -0,0 +1 @@
/home/spotcomms/Development/Other/Android_ROMs/Scripts/LineageOS-14.1/Deblob.sh

95
Scripts/LineageOS-11.0/Patch.sh Executable file
View file

@ -0,0 +1,95 @@
#!/bin/bash
#DivestOS: A privacy oriented Android distribution
#Copyright (c) 2017 Spot Communications, 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/>.
#Delete Everything and Sync
#repo forall -c 'git add -A && git reset --hard' && rm -rf out && repo sync -j20 --force-sync
#Apply all of our changes
#source ../../Scripts/LineageOS-11.0/00init.sh && source $scripts/Patch.sh && source $scripts/Deblob.sh && source $scripts/Patch_CVE.sh && source build/envsetup.sh
#Build!
#brunch lineage_nex-userdebug
#
#START OF PREPRATION
#
enter() {
echo "================================================================================================"
dir=$1;
cd $base$dir;
echo "[ENTERING] "$dir;
git add -A && git reset --hard;
}
enhanceLocation() {
cd $base$1;
#Enable GLONASS
sed -i 's/#A_GLONASS_POS_PROTOCOL_SELECT/A_GLONASS_POS_PROTOCOL_SELECT/' gps.conf gps/gps.conf configs/gps.conf &>/dev/null || true;
sed -i 's/A_GLONASS_POS_PROTOCOL_SELECT = 0.*/A_GLONASS_POS_PROTOCOL_SELECT = 15/' gps.conf gps/gps.conf configs/gps.conf &>/dev/null || true;
sed -i 's|A_GLONASS_POS_PROTOCOL_SELECT=0.*</item>|A_GLONASS_POS_PROTOCOL_SELECT=15</item>|' overlay/frameworks/base/core/res/res/values-*/*.xml &>/dev/null || true;
#Recommended reading: https://wwws.nightwatchcybersecurity.com/2016/12/05/cve-2016-5341/
#XTRA: Only use specified URLs
sed -i 's|XTRA_SERVER_QUERY=1|XTRA_SERVER_QUERY=0|' gps.conf gps/gps.conf configs/gps.conf &>/dev/null || true;
sed -i 's|#XTRA_SERVER|XTRA_SERVER|' gps.conf gps/gps.conf configs/gps.conf &>/dev/null || true;
#XTRA: Enable HTTPS
sed -i 's|http://xtra|https://xtra|' overlay/frameworks/base/core/res/res/values-*/*.xml gps.conf gps/gps.conf configs/gps.conf &>/dev/null || true;
#XTRA: Use format version 3 if possible
if grep -sq "XTRA_VERSION_CHECK" gps.conf gps/gps.conf configs/gps.conf; then #Using hardware/qcom/gps OR precompiled blob OR device specific implementation
sed -i 's|XTRA_VERSION_CHECK=0|XTRA_VERSION_CHECK=1|' gps.conf gps/gps.conf configs/gps.conf &>/dev/null || true;
sed -i 's|xtra2.bin|xtra3grc.bin|' gps.conf gps/gps.conf configs/gps.conf &>/dev/null || true;
elif grep -sq "BOARD_VENDOR_QCOM_LOC_PDK_FEATURE_SET := true" BoardConfig.mk boards/*gps.mk; then
if ! grep -sq "USE_DEVICE_SPECIFIC_LOC_API := true" BoardConfig.mk boards/*gps.mk; then
if ! grep -sq "libloc" *proprietary*.txt; then #Using hardware/qcom/gps
sed -i 's|xtra2.bin|xtra3grc.bin|' gps.conf gps/gps.conf configs/gps.conf &>/dev/null || true;
fi;
fi;
fi;
echo "Enhanced location services for $1";
cd $base;
}
export -f enhanceLocation;
#
#END OF PREPRATION
#
#
#START OF ROM CHANGES
#
#None
#
#END OF ROM CHANGES
#
#
#START OF DEVICE CHANGES
#
enter "device/zte/nex"
enableDexPreOpt
patch -p1 < $patches"android_device_zte_nex/Fixes.patch"
patch -p1 < $patches"android_device_zte_nex/Lower_DPI.patch"
enter "kernel/zte/msm8930"
patch -p1 < $patches"android_kernel_zte_msm8930/MDP-Fix.patch"
patch -p1 < $patches"android_kernel_zte_msm8930/Timeconst-Fix.patch"
#Make changes to all devices
cd $base
find "device" -maxdepth 2 -mindepth 2 -type d -exec bash -c 'enhanceLocation "$0"' {} \;
cd $base
#
#END OF DEVICE CHANGES
#

View file

@ -0,0 +1 @@
/home/spotcomms/Development/Other/Android_ROMs/Scripts/LineageOS-14.1/Patch_CVE.sh

View file

@ -37,7 +37,6 @@ git apply $cvePatches/CVE-2016-5867/ANY/0.patch
git apply $cvePatches/CVE-2016-5870/ANY/0.patch
git apply $cvePatches/CVE-2016-6672/ANY/0.patch
git apply $cvePatches/CVE-2016-6738/ANY/0.patch
git apply $cvePatches/CVE-2016-6741/3.10/0.patch
git apply $cvePatches/CVE-2016-6751/ANY/0.patch
git apply $cvePatches/CVE-2016-6753/ANY/0.patch
git apply $cvePatches/CVE-2016-7915/ANY/0.patch

View file

@ -180,7 +180,7 @@ enter "packages/apps/SetupWizard"
patch -p1 < $patches"android_packages_apps_SetupWizard/0001-Remove_Analytics.patch" #Remove the rest of CMStats
enter "packages/apps/Silence"
cp $patches"Silence/Android.mk" Android.mk #Add a build file
cp $patches"android_packages_apps_Silence/Android.mk" Android.mk #Add a build file
enter "packages/apps/Updater"
patch -p1 < $patches"android_packages_apps_Updater/0001-Server.patch" #Switch to our server