Scripts: localize variables in functions
This commit is contained in:
parent
e01e457b24
commit
4a1ebe1b71
@ -462,10 +462,10 @@ echo "Deblobbing..."
|
|||||||
#START OF FUNCTIONS
|
#START OF FUNCTIONS
|
||||||
#
|
#
|
||||||
deblobDevice() {
|
deblobDevice() {
|
||||||
devicePath="$1";
|
local devicePath="$1";
|
||||||
cd "$DOS_BUILD_BASE$devicePath";
|
cd "$DOS_BUILD_BASE$devicePath";
|
||||||
if [ "$DOS_DEBLOBBER_REPLACE_TIME" = false ]; then replaceTime="false"; fi; #Disable Time replacement
|
if [ "$DOS_DEBLOBBER_REPLACE_TIME" = false ]; then local replaceTime="false"; fi; #Disable Time replacement
|
||||||
if ! grep -qi "qcom" BoardConfig*.mk; then replaceTime="false"; fi; #Disable Time Replacement
|
if ! grep -qi "qcom" BoardConfig*.mk; then local replaceTime="false"; fi; #Disable Time Replacement
|
||||||
if [ -f Android.mk ]; then
|
if [ -f Android.mk ]; then
|
||||||
#Some devices store these in a dedicated firmware partition, others in /system/vendor/firmware, either way the following are just symlinks
|
#Some devices store these in a dedicated firmware partition, others in /system/vendor/firmware, either way the following are just symlinks
|
||||||
#sed -i '/ALL_DEFAULT_INSTALLED_MODULES/s/$(CMN_SYMLINKS)//' Android.mk; #Remove CMN firmware
|
#sed -i '/ALL_DEFAULT_INSTALLED_MODULES/s/$(CMN_SYMLINKS)//' Android.mk; #Remove CMN firmware
|
||||||
@ -502,8 +502,8 @@ deblobDevice() {
|
|||||||
echo "PRODUCT_PACKAGES += libyuv libEGL_swiftshader libGLESv1_CM_swiftshader libGLESv2_swiftshader" >> device.mk; #Build SwiftShader
|
echo "PRODUCT_PACKAGES += libyuv libEGL_swiftshader libGLESv1_CM_swiftshader libGLESv2_swiftshader" >> device.mk; #Build SwiftShader
|
||||||
fi;
|
fi;
|
||||||
fi;
|
fi;
|
||||||
baseDirTmp=${PWD##*/};
|
local baseDirTmp=${PWD##*/};
|
||||||
suffixTmp="-common";
|
local suffixTmp="-common";
|
||||||
if [ -f "${PWD##*/}".mk ] && [ "${PWD##*/}".mk != "sepolicy" ]; then
|
if [ -f "${PWD##*/}".mk ] && [ "${PWD##*/}".mk != "sepolicy" ]; then
|
||||||
awk -i inplace '!/'"$makes"'/' "${PWD##*/}".mk; #Remove references from device makefile
|
awk -i inplace '!/'"$makes"'/' "${PWD##*/}".mk; #Remove references from device makefile
|
||||||
awk -i inplace '!/'"$makes"'/' "${baseDirTmp%"$suffixTmp"}".mk &>/dev/null || true; #Remove references from device makefile
|
awk -i inplace '!/'"$makes"'/' "${baseDirTmp%"$suffixTmp"}".mk &>/dev/null || true; #Remove references from device makefile
|
||||||
@ -606,7 +606,7 @@ deblobDevice() {
|
|||||||
export -f deblobDevice;
|
export -f deblobDevice;
|
||||||
|
|
||||||
deblobKernel() {
|
deblobKernel() {
|
||||||
kernelPath="$1";
|
local kernelPath="$1";
|
||||||
cd "$DOS_BUILD_BASE$kernelPath";
|
cd "$DOS_BUILD_BASE$kernelPath";
|
||||||
rm -rf $kernels;
|
rm -rf $kernels;
|
||||||
cd "$DOS_BUILD_BASE";
|
cd "$DOS_BUILD_BASE";
|
||||||
@ -614,7 +614,7 @@ deblobKernel() {
|
|||||||
export -f deblobKernel;
|
export -f deblobKernel;
|
||||||
|
|
||||||
deblobSepolicy() {
|
deblobSepolicy() {
|
||||||
sepolicyPath="$1";
|
local sepolicyPath="$1";
|
||||||
cd "$DOS_BUILD_BASE$sepolicyPath";
|
cd "$DOS_BUILD_BASE$sepolicyPath";
|
||||||
if [ -d sepolicy ]; then
|
if [ -d sepolicy ]; then
|
||||||
cd sepolicy;
|
cd sepolicy;
|
||||||
@ -631,7 +631,7 @@ deblobVendors() {
|
|||||||
export -f deblobVendors;
|
export -f deblobVendors;
|
||||||
|
|
||||||
deblobVendor() {
|
deblobVendor() {
|
||||||
makefile="$1";
|
local makefile="$1";
|
||||||
cd "$DOS_BUILD_BASE";
|
cd "$DOS_BUILD_BASE";
|
||||||
awk -i inplace '!/'$blobs'/' "$makefile"; #Remove all blob references from makefile
|
awk -i inplace '!/'$blobs'/' "$makefile"; #Remove all blob references from makefile
|
||||||
}
|
}
|
||||||
|
@ -29,8 +29,8 @@ export -f startPatcher;
|
|||||||
|
|
||||||
enter() {
|
enter() {
|
||||||
echo "================================================================================================"
|
echo "================================================================================================"
|
||||||
dir="$1";
|
local dir="$1";
|
||||||
dirReal="$DOS_BUILD_BASE$dir";
|
local dirReal="$DOS_BUILD_BASE$dir";
|
||||||
if [ -d "$dirReal" ]; then
|
if [ -d "$dirReal" ]; then
|
||||||
cd "$dirReal";
|
cd "$dirReal";
|
||||||
echo -e "\e[0;32m[ENTERING] $dir\e[0m";
|
echo -e "\e[0;32m[ENTERING] $dir\e[0m";
|
||||||
@ -72,8 +72,8 @@ export -f gpgVerifyDirectory;
|
|||||||
scanForMalware() {
|
scanForMalware() {
|
||||||
if [ -x /usr/bin/clamscan ] && [ -r /var/lib/clamav/main.cvd ]; then
|
if [ -x /usr/bin/clamscan ] && [ -r /var/lib/clamav/main.cvd ]; then
|
||||||
echo -e "\e[0;32mStarting a malware scan...\e[0m";
|
echo -e "\e[0;32mStarting a malware scan...\e[0m";
|
||||||
excludes="--exclude-dir=\".git\" --exclude-dir=\".repo\"";
|
local excludes="--exclude-dir=\".git\" --exclude-dir=\".repo\"";
|
||||||
scanQueue="$2";
|
local scanQueue="$2";
|
||||||
if [ "$1" = true ]; then
|
if [ "$1" = true ]; then
|
||||||
if [ "$DOS_MALWARE_SCAN_SETTING" != "quick" ] || [ "$DOS_MALWARE_SCAN_SETTING" = "extra" ]; then
|
if [ "$DOS_MALWARE_SCAN_SETTING" != "quick" ] || [ "$DOS_MALWARE_SCAN_SETTING" = "extra" ]; then
|
||||||
scanQueue=$scanQueue" $DOS_BUILD_BASE/frameworks $DOS_BUILD_BASE/vendor";
|
scanQueue=$scanQueue" $DOS_BUILD_BASE/frameworks $DOS_BUILD_BASE/vendor";
|
||||||
@ -87,7 +87,7 @@ scanForMalware() {
|
|||||||
fi;
|
fi;
|
||||||
du -hsc $scanQueue;
|
du -hsc $scanQueue;
|
||||||
/usr/bin/clamscan --recursive --detect-pua --infected $excludes $scanQueue;
|
/usr/bin/clamscan --recursive --detect-pua --infected $excludes $scanQueue;
|
||||||
clamscanExit="$?";
|
local clamscanExit="$?";
|
||||||
if [ "$clamscanExit" -eq "1" ]; then
|
if [ "$clamscanExit" -eq "1" ]; then
|
||||||
echo -e "\e[0;31m----------------------------------------------------------------\e[0m";
|
echo -e "\e[0;31m----------------------------------------------------------------\e[0m";
|
||||||
echo -e "\e[0;31mWARNING: MALWARE WAS FOUND! PLEASE INVESTIGATE!\e[0m";
|
echo -e "\e[0;31mWARNING: MALWARE WAS FOUND! PLEASE INVESTIGATE!\e[0m";
|
||||||
@ -113,17 +113,17 @@ scanForMalware() {
|
|||||||
export -f scanForMalware;
|
export -f scanForMalware;
|
||||||
|
|
||||||
generateBootAnimationMask() {
|
generateBootAnimationMask() {
|
||||||
text=$1;
|
local text=$1;
|
||||||
font=$2
|
local font=$2
|
||||||
output=$3;
|
local output=$3;
|
||||||
convert -background black -fill transparent -font "$font" -gravity center -size 512x128 label:"$text" "$output";
|
convert -background black -fill transparent -font "$font" -gravity center -size 512x128 label:"$text" "$output";
|
||||||
}
|
}
|
||||||
export -f generateBootAnimationMask;
|
export -f generateBootAnimationMask;
|
||||||
|
|
||||||
generateBootAnimationShine() {
|
generateBootAnimationShine() {
|
||||||
color=$1;
|
local color=$1;
|
||||||
style=$2;
|
local style=$2;
|
||||||
output=$3;
|
local output=$3;
|
||||||
#The colors need to be symmetrical in order to make the animation smooth and not have any noticble lines
|
#The colors need to be symmetrical in order to make the animation smooth and not have any noticble lines
|
||||||
convert -size 1024x128 -define gradient:angle=90 "$style":"$color" \( +clone -flop \) +append "$output";
|
convert -size 1024x128 -define gradient:angle=90 "$style":"$color" \( +clone -flop \) +append "$output";
|
||||||
}
|
}
|
||||||
@ -143,36 +143,34 @@ export -f audit2allowADB;
|
|||||||
processRelease() {
|
processRelease() {
|
||||||
#Credit: GrapheneOS
|
#Credit: GrapheneOS
|
||||||
#https://github.com/GrapheneOS/script/blob/pie/release.sh
|
#https://github.com/GrapheneOS/script/blob/pie/release.sh
|
||||||
DEVICE="$1";
|
local DEVICE="$1";
|
||||||
BLOCK="$2";
|
local BLOCK="$2";
|
||||||
VERITY="$3";
|
local VERITY="$3";
|
||||||
|
|
||||||
DATE=$(date -u '+%Y%m%d')
|
local DATE=$(date -u '+%Y%m%d')
|
||||||
KEY_DIR="$DOS_SIGNING_KEYS/$DEVICE";
|
local KEY_DIR="$DOS_SIGNING_KEYS/$DEVICE";
|
||||||
VERSION=$(echo $DOS_VERSION | cut -f2 -d "-");
|
local VERSION=$(echo $DOS_VERSION | cut -f2 -d "-");
|
||||||
PREFIX="$DOS_BRANDING_ZIP_PREFIX-$VERSION-$DATE-dos-$DEVICE";
|
local PREFIX="$DOS_BRANDING_ZIP_PREFIX-$VERSION-$DATE-dos-$DEVICE";
|
||||||
ARCHIVE="$DOS_BUILDS/$DOS_VERSION/release_keys/";
|
local ARCHIVE="$DOS_BUILDS/$DOS_VERSION/release_keys/";
|
||||||
OUT_DIR="$DOS_BUILD_BASE/out/target/product/$DEVICE/";
|
local OUT_DIR="$DOS_BUILD_BASE/out/target/product/$DEVICE/";
|
||||||
|
|
||||||
echo -e "\e[0;32mProcessing release for $DEVICE\e[0m";
|
echo -e "\e[0;32mProcessing release for $DEVICE\e[0m";
|
||||||
|
|
||||||
#Arguments
|
#Arguments
|
||||||
unset BLOCK_SWITCHES;
|
|
||||||
if [ "$BLOCK" != false ]; then
|
if [ "$BLOCK" != false ]; then
|
||||||
BLOCK_SWITCHES="--block";
|
local BLOCK_SWITCHES="--block";
|
||||||
fi;
|
fi;
|
||||||
unset VERITY_SWITCHES;
|
|
||||||
if [[ "$VERITY" == "verity" ]]; then
|
if [[ "$VERITY" == "verity" ]]; then
|
||||||
VERITY_SWITCHES=(--replace_verity_public_key "$KEY_DIR/verity_key.pub" \
|
local VERITY_SWITCHES=(--replace_verity_public_key "$KEY_DIR/verity_key.pub" \
|
||||||
--replace_verity_private_key "$KEY_DIR/verity" \
|
--replace_verity_private_key "$KEY_DIR/verity" \
|
||||||
--replace_verity_keyid "$KEY_DIR/verity.x509.pem");
|
--replace_verity_keyid "$KEY_DIR/verity.x509.pem");
|
||||||
echo -e "\e[0;32m\t+ Verified Boot 1.0\e[0m";
|
echo -e "\e[0;32m\t+ Verified Boot 1.0\e[0m";
|
||||||
elif [[ "$VERITY" == "avb" ]]; then
|
elif [[ "$VERITY" == "avb" ]]; then
|
||||||
VERITY_SWITCHES=(--avb_vbmeta_key "$KEY_DIR/avb.pem" \
|
local VERITY_SWITCHES=(--avb_vbmeta_key "$KEY_DIR/avb.pem" \
|
||||||
--avb_vbmeta_algorithm SHA256_RSA2048 \
|
--avb_vbmeta_algorithm SHA256_RSA2048 \
|
||||||
--avb_system_key "$KEY_DIR/avb.pem" \
|
--avb_system_key "$KEY_DIR/avb.pem" \
|
||||||
--avb_system_algorithm SHA256_RSA2048);
|
--avb_system_algorithm SHA256_RSA2048);
|
||||||
AVB_PKMD="$KEY_DIR/avb_pkmd.bin";
|
local AVB_PKMD="$KEY_DIR/avb_pkmd.bin";
|
||||||
echo -e "\e[0;32m\t+ Verified Boot 2.0\e[0m";
|
echo -e "\e[0;32m\t+ Verified Boot 2.0\e[0m";
|
||||||
fi;
|
fi;
|
||||||
|
|
||||||
@ -182,7 +180,7 @@ processRelease() {
|
|||||||
"${VERITY_SWITCHES[@]}" \
|
"${VERITY_SWITCHES[@]}" \
|
||||||
$OUT_DIR/obj/PACKAGING/target_files_intermediates/*$DEVICE-target_files-*.zip \
|
$OUT_DIR/obj/PACKAGING/target_files_intermediates/*$DEVICE-target_files-*.zip \
|
||||||
$OUT_DIR/$PREFIX-target_files.zip;
|
$OUT_DIR/$PREFIX-target_files.zip;
|
||||||
INCREMENTAL_ID=$(grep "ro.build.version.incremental" $OUT_DIR/system/build.prop | cut -f2 -d "=" | sed 's/\.//g');
|
local INCREMENTAL_ID=$(grep "ro.build.version.incremental" $OUT_DIR/system/build.prop | cut -f2 -d "=" | sed 's/\.//g');
|
||||||
echo $INCREMENTAL_ID > $OUT_DIR/$PREFIX-target_files.zip.id;
|
echo $INCREMENTAL_ID > $OUT_DIR/$PREFIX-target_files.zip.id;
|
||||||
|
|
||||||
#Image
|
#Image
|
||||||
@ -201,7 +199,7 @@ processRelease() {
|
|||||||
if [ "$DOS_GENERATE_DELTAS" = true ]; then
|
if [ "$DOS_GENERATE_DELTAS" = true ]; then
|
||||||
for LAST_TARGET_FILES in $ARCHIVE/target_files/$DOS_BRANDING_ZIP_PREFIX-$VERSION-*-dos-$DEVICE-target_files.zip; do
|
for LAST_TARGET_FILES in $ARCHIVE/target_files/$DOS_BRANDING_ZIP_PREFIX-$VERSION-*-dos-$DEVICE-target_files.zip; do
|
||||||
if [[ -f "$LAST_TARGET_FILES.id" ]]; then
|
if [[ -f "$LAST_TARGET_FILES.id" ]]; then
|
||||||
LAST_INCREMENTAL_ID=$(cat "$LAST_TARGET_FILES.id");
|
local LAST_INCREMENTAL_ID=$(cat "$LAST_TARGET_FILES.id");
|
||||||
echo -e "\e[0;32mGenerating incremental OTA against $LAST_INCREMENTAL_ID\e[0m";
|
echo -e "\e[0;32mGenerating incremental OTA against $LAST_INCREMENTAL_ID\e[0m";
|
||||||
build/tools/releasetools/ota_from_target_files $BLOCK_SWITCHES -t 8 -k "$KEY_DIR/releasekey" -i \
|
build/tools/releasetools/ota_from_target_files $BLOCK_SWITCHES -t 8 -k "$KEY_DIR/releasekey" -i \
|
||||||
"$LAST_TARGET_FILES" \
|
"$LAST_TARGET_FILES" \
|
||||||
@ -278,15 +276,15 @@ smallerSystem() {
|
|||||||
export -f smallerSystem;
|
export -f smallerSystem;
|
||||||
|
|
||||||
hardenLocationConf() {
|
hardenLocationConf() {
|
||||||
gpsConfig=$1;
|
local gpsConfig=$1;
|
||||||
#Attempt to get the real device directory
|
#Attempt to get the real device directory
|
||||||
if [[ "$gpsConfig" = *"device/"* ]]; then
|
if [[ "$gpsConfig" = *"device/"* ]]; then
|
||||||
deviceDir=$(sed 's|gps/gps.conf||' <<< "$gpsConfig");
|
local deviceDir=$(sed 's|gps/gps.conf||' <<< "$gpsConfig");
|
||||||
deviceDir=$(sed 's|configs/gps.conf||' <<< "$deviceDir");
|
deviceDir=$(sed 's|configs/gps.conf||' <<< "$deviceDir");
|
||||||
deviceDir=$(sed 's|gps/etc/gps.conf||' <<< "$deviceDir");
|
deviceDir=$(sed 's|gps/etc/gps.conf||' <<< "$deviceDir");
|
||||||
deviceDir=$(sed 's|gps.conf||' <<< "$deviceDir");
|
deviceDir=$(sed 's|gps.conf||' <<< "$deviceDir");
|
||||||
else
|
else
|
||||||
deviceDir=$(dirname "$gpsConfig");
|
local deviceDir=$(dirname "$gpsConfig");
|
||||||
fi;
|
fi;
|
||||||
#Debugging (adb logcat | grep -i -e locsvc -e izat -e gps -e gnss -e location)
|
#Debugging (adb logcat | grep -i -e locsvc -e izat -e gps -e gnss -e location)
|
||||||
#sed -i 's|DEBUG_LEVEL = .|DEBUG_LEVEL = 4|' "$gpsConfig" &> /dev/null || true;
|
#sed -i 's|DEBUG_LEVEL = .|DEBUG_LEVEL = 4|' "$gpsConfig" &> /dev/null || true;
|
||||||
@ -332,7 +330,7 @@ hardenLocationConf() {
|
|||||||
export -f hardenLocationConf;
|
export -f hardenLocationConf;
|
||||||
|
|
||||||
hardenLocationFWB() {
|
hardenLocationFWB() {
|
||||||
dir=$1;
|
local dir=$1;
|
||||||
#Debugging (adb logcat | grep -i -e locsvc -e izat -e gps -e gnss -e location)
|
#Debugging (adb logcat | grep -i -e locsvc -e izat -e gps -e gnss -e location)
|
||||||
#sed -i 's|DEBUG_LEVEL = .|DEBUG_LEVEL = 4|' "$gpsConfig" &> /dev/null || true;
|
#sed -i 's|DEBUG_LEVEL = .|DEBUG_LEVEL = 4|' "$gpsConfig" &> /dev/null || true;
|
||||||
#Enable GLONASS
|
#Enable GLONASS
|
||||||
@ -393,21 +391,21 @@ export -f enableStrongEncryption;
|
|||||||
|
|
||||||
getDefconfig() {
|
getDefconfig() {
|
||||||
if ls arch/arm/configs/lineage*defconfig 1> /dev/null 2>&1; then
|
if ls arch/arm/configs/lineage*defconfig 1> /dev/null 2>&1; then
|
||||||
defconfigPath="arch/arm/configs/lineage*defconfig";
|
local defconfigPath="arch/arm/configs/lineage*defconfig";
|
||||||
elif ls arch/arm64/configs/lineage*defconfig 1> /dev/null 2>&1; then
|
elif ls arch/arm64/configs/lineage*defconfig 1> /dev/null 2>&1; then
|
||||||
defconfigPath="arch/arm64/configs/lineage*defconfig";
|
local defconfigPath="arch/arm64/configs/lineage*defconfig";
|
||||||
else
|
else
|
||||||
defconfigPath="arch/arm/configs/*defconfig arch/arm64/configs/*defconfig";
|
local defconfigPath="arch/arm/configs/*defconfig arch/arm64/configs/*defconfig";
|
||||||
fi;
|
fi;
|
||||||
echo $defconfigPath;
|
echo $defconfigPath;
|
||||||
}
|
}
|
||||||
export -f getDefconfig;
|
export -f getDefconfig;
|
||||||
|
|
||||||
changeDefaultDNS() {
|
changeDefaultDNS() {
|
||||||
dnsPrimary="";
|
local dnsPrimary="";
|
||||||
dnsPrimaryV6="";
|
local dnsPrimaryV6="";
|
||||||
dnsSecondary="";
|
local dnsSecondary="";
|
||||||
dnsSecondaryV6="";
|
local dnsSecondaryV6="";
|
||||||
if [ -z "$DNS_PRESET" ]; then
|
if [ -z "$DNS_PRESET" ]; then
|
||||||
if [[ "$DOS_DEFAULT_DNS_PRESET" == "CensurfriDNS" ]]; then #https://uncensoreddns.org
|
if [[ "$DOS_DEFAULT_DNS_PRESET" == "CensurfriDNS" ]]; then #https://uncensoreddns.org
|
||||||
dnsPrimary="91.239.100.100";
|
dnsPrimary="91.239.100.100";
|
||||||
@ -479,7 +477,7 @@ changeDefaultDNS() {
|
|||||||
echo "You must first set a preset via the DEFAULT_DNS_PRESET variable in init.sh!";
|
echo "You must first set a preset via the DEFAULT_DNS_PRESET variable in init.sh!";
|
||||||
fi;
|
fi;
|
||||||
|
|
||||||
files="core/res/res/values/config.xml packages/SettingsLib/res/values/strings.xml services/core/java/com/android/server/connectivity/NetworkDiagnostics.java services/core/java/com/android/server/connectivity/Tethering.java services/core/java/com/android/server/connectivity/tethering/TetheringConfiguration.java services/java/com/android/server/connectivity/Tethering.java";
|
local files="core/res/res/values/config.xml packages/SettingsLib/res/values/strings.xml services/core/java/com/android/server/connectivity/NetworkDiagnostics.java services/core/java/com/android/server/connectivity/Tethering.java services/core/java/com/android/server/connectivity/tethering/TetheringConfiguration.java services/java/com/android/server/connectivity/Tethering.java";
|
||||||
sed -i "s/8\.8\.8\.8/$dnsPrimary/" $files &>/dev/null || true;
|
sed -i "s/8\.8\.8\.8/$dnsPrimary/" $files &>/dev/null || true;
|
||||||
sed -i "s/2001:4860:4860::8888/$dnsPrimaryV6/" $files &>/dev/null || true;
|
sed -i "s/2001:4860:4860::8888/$dnsPrimaryV6/" $files &>/dev/null || true;
|
||||||
sed -i "s/8\.8\.4\.4/$dnsSecondary/" $files &>/dev/null || true;
|
sed -i "s/8\.8\.4\.4/$dnsSecondary/" $files &>/dev/null || true;
|
||||||
@ -488,7 +486,7 @@ changeDefaultDNS() {
|
|||||||
export -f changeDefaultDNS;
|
export -f changeDefaultDNS;
|
||||||
|
|
||||||
editKernelLocalversion() {
|
editKernelLocalversion() {
|
||||||
defconfigPath=$(getDefconfig)
|
local defconfigPath=$(getDefconfig)
|
||||||
sed -i 's/CONFIG_LOCALVERSION=".*"/CONFIG_LOCALVERSION="'"$1"'"/' $defconfigPath &>/dev/null || true;
|
sed -i 's/CONFIG_LOCALVERSION=".*"/CONFIG_LOCALVERSION="'"$1"'"/' $defconfigPath &>/dev/null || true;
|
||||||
}
|
}
|
||||||
export -f editKernelLocalversion;
|
export -f editKernelLocalversion;
|
||||||
@ -499,7 +497,7 @@ hardenDefconfig() {
|
|||||||
#Attempts to enable/disable supported options to increase security
|
#Attempts to enable/disable supported options to increase security
|
||||||
#See https://kernsec.org/wiki/index.php/Kernel_Self_Protection_Project/Recommended_Settings
|
#See https://kernsec.org/wiki/index.php/Kernel_Self_Protection_Project/Recommended_Settings
|
||||||
|
|
||||||
defconfigPath=$(getDefconfig)
|
local defconfigPath=$(getDefconfig)
|
||||||
|
|
||||||
#Enable supported options
|
#Enable supported options
|
||||||
#Disabled: CONFIG_DEBUG_SG (bootloops - https://patchwork.kernel.org/patch/8989981)
|
#Disabled: CONFIG_DEBUG_SG (bootloops - https://patchwork.kernel.org/patch/8989981)
|
||||||
|
@ -28,7 +28,7 @@ resetWorkspace() {
|
|||||||
export -f resetWorkspace;
|
export -f resetWorkspace;
|
||||||
|
|
||||||
scanWorkspaceForMalware() {
|
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";
|
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";
|
||||||
scanQueue=$scanQueue" $DOS_BUILD_BASE/vendor/cm $DOS_BUILD_BASE/vendor/cmsdk";
|
scanQueue=$scanQueue" $DOS_BUILD_BASE/vendor/cm $DOS_BUILD_BASE/vendor/cmsdk";
|
||||||
scanForMalware true "$scanQueue";
|
scanForMalware true "$scanQueue";
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@ resetWorkspace() {
|
|||||||
export -f resetWorkspace;
|
export -f resetWorkspace;
|
||||||
|
|
||||||
scanWorkspaceForMalware() {
|
scanWorkspaceForMalware() {
|
||||||
scanQueue="$DOS_BUILD_BASE/abi $DOS_BUILD_BASE/android $DOS_BUILD_BASE/art $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/platform_testing $DOS_BUILD_BASE/sdk $DOS_BUILD_BASE/system";
|
local scanQueue="$DOS_BUILD_BASE/abi $DOS_BUILD_BASE/android $DOS_BUILD_BASE/art $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/platform_testing $DOS_BUILD_BASE/sdk $DOS_BUILD_BASE/system";
|
||||||
scanQueue=$scanQueue" $DOS_BUILD_BASE/vendor/cm $DOS_BUILD_BASE/vendor/cmsdk";
|
scanQueue=$scanQueue" $DOS_BUILD_BASE/vendor/cm $DOS_BUILD_BASE/vendor/cmsdk";
|
||||||
scanForMalware true "$scanQueue";
|
scanForMalware true "$scanQueue";
|
||||||
}
|
}
|
||||||
@ -75,6 +75,7 @@ buildAll() {
|
|||||||
buildDevice himaul;
|
buildDevice himaul;
|
||||||
buildDevice Z00T;
|
buildDevice Z00T;
|
||||||
buildDevice flounder verity;
|
buildDevice flounder verity;
|
||||||
|
buildDeviceUserDebug i9100;
|
||||||
if [ "$DOS_BUILDALL_SUPERSEDED" = true ]; then
|
if [ "$DOS_BUILDALL_SUPERSEDED" = true ]; then
|
||||||
buildDevice flo;
|
buildDevice flo;
|
||||||
buildDevice mako;
|
buildDevice mako;
|
||||||
@ -103,7 +104,6 @@ buildAll() {
|
|||||||
buildDevice sailfish verity;
|
buildDevice sailfish verity;
|
||||||
buildDevice us997;
|
buildDevice us997;
|
||||||
buildDevice dragon verity;
|
buildDevice dragon verity;
|
||||||
buildDeviceUserDebug i9100;
|
|
||||||
buildDevice fugu;
|
buildDevice fugu;
|
||||||
fi;
|
fi;
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@ resetWorkspace() {
|
|||||||
export -f resetWorkspace;
|
export -f resetWorkspace;
|
||||||
|
|
||||||
scanWorkspaceForMalware() {
|
scanWorkspaceForMalware() {
|
||||||
scanQueue="$DOS_BUILD_BASE/android $DOS_BUILD_BASE/art $DOS_BUILD_BASE/bionic $DOS_BUILD_BASE/bootable $DOS_BUILD_BASE/build $DOS_BUILD_BASE/compatibility $DOS_BUILD_BASE/dalvik $DOS_BUILD_BASE/device $DOS_BUILD_BASE/hardware $DOS_BUILD_BASE/libcore $DOS_BUILD_BASE/libnativehelper $DOS_BUILD_BASE/packages $DOS_BUILD_BASE/pdk $DOS_BUILD_BASE/platform_testing $DOS_BUILD_BASE/sdk $DOS_BUILD_BASE/system";
|
local scanQueue="$DOS_BUILD_BASE/android $DOS_BUILD_BASE/art $DOS_BUILD_BASE/bionic $DOS_BUILD_BASE/bootable $DOS_BUILD_BASE/build $DOS_BUILD_BASE/compatibility $DOS_BUILD_BASE/dalvik $DOS_BUILD_BASE/device $DOS_BUILD_BASE/hardware $DOS_BUILD_BASE/libcore $DOS_BUILD_BASE/libnativehelper $DOS_BUILD_BASE/packages $DOS_BUILD_BASE/pdk $DOS_BUILD_BASE/platform_testing $DOS_BUILD_BASE/sdk $DOS_BUILD_BASE/system";
|
||||||
scanQueue=$scanQueue" $DOS_BUILD_BASE/lineage-sdk $DOS_BUILD_BASE/vendor/lineage";
|
scanQueue=$scanQueue" $DOS_BUILD_BASE/lineage-sdk $DOS_BUILD_BASE/vendor/lineage";
|
||||||
scanForMalware true "$scanQueue";
|
scanForMalware true "$scanQueue";
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@ resetWorkspace() {
|
|||||||
export -f resetWorkspace;
|
export -f resetWorkspace;
|
||||||
|
|
||||||
scanWorkspaceForMalware() {
|
scanWorkspaceForMalware() {
|
||||||
scanQueue="$DOS_BUILD_BASE/android $DOS_BUILD_BASE/art $DOS_BUILD_BASE/bionic $DOS_BUILD_BASE/bootable $DOS_BUILD_BASE/build $DOS_BUILD_BASE/compatibility $DOS_BUILD_BASE/dalvik $DOS_BUILD_BASE/device $DOS_BUILD_BASE/hardware $DOS_BUILD_BASE/libcore $DOS_BUILD_BASE/libnativehelper $DOS_BUILD_BASE/packages $DOS_BUILD_BASE/pdk $DOS_BUILD_BASE/platform_testing $DOS_BUILD_BASE/sdk $DOS_BUILD_BASE/system";
|
local scanQueue="$DOS_BUILD_BASE/android $DOS_BUILD_BASE/art $DOS_BUILD_BASE/bionic $DOS_BUILD_BASE/bootable $DOS_BUILD_BASE/build $DOS_BUILD_BASE/compatibility $DOS_BUILD_BASE/dalvik $DOS_BUILD_BASE/device $DOS_BUILD_BASE/hardware $DOS_BUILD_BASE/libcore $DOS_BUILD_BASE/libnativehelper $DOS_BUILD_BASE/packages $DOS_BUILD_BASE/pdk $DOS_BUILD_BASE/platform_testing $DOS_BUILD_BASE/sdk $DOS_BUILD_BASE/system";
|
||||||
scanQueue=$scanQueue" $DOS_BUILD_BASE/lineage-sdk $DOS_BUILD_BASE/vendor/lineage";
|
scanQueue=$scanQueue" $DOS_BUILD_BASE/lineage-sdk $DOS_BUILD_BASE/vendor/lineage";
|
||||||
scanForMalware true "$scanQueue";
|
scanForMalware true "$scanQueue";
|
||||||
}
|
}
|
||||||
@ -98,7 +98,7 @@ buildAll() {
|
|||||||
buildDevice bonito avb;
|
buildDevice bonito avb;
|
||||||
buildDevice sargo avb;
|
buildDevice sargo avb;
|
||||||
#Samsung
|
#Samsung
|
||||||
buildDeviceUserDebug i9100;
|
buildDeviceUserDebug i9100; #broken
|
||||||
#Intel
|
#Intel
|
||||||
buildDevice fugu; #broken
|
buildDevice fugu; #broken
|
||||||
}
|
}
|
||||||
|
@ -230,6 +230,9 @@ enterAndClear "device/moto/shamu";
|
|||||||
enterAndClear "device/oppo/msm8974-common";
|
enterAndClear "device/oppo/msm8974-common";
|
||||||
sed -i "s/TZ.BF.2.0-2.0.0134/TZ.BF.2.0-2.0.0134|TZ.BF.2.0-2.0.0137/" board-info.txt; #Suport new TZ firmware https://review.lineageos.org/#/c/178999/
|
sed -i "s/TZ.BF.2.0-2.0.0134/TZ.BF.2.0-2.0.0134|TZ.BF.2.0-2.0.0137/" board-info.txt; #Suport new TZ firmware https://review.lineageos.org/#/c/178999/
|
||||||
|
|
||||||
|
enterAndClear "kernel/google/marlin";
|
||||||
|
git revert 568f99db3c9; #Resurrect dm-verity
|
||||||
|
|
||||||
enter "vendor/google";
|
enter "vendor/google";
|
||||||
echo "" > atv/atv-common.mk;
|
echo "" > atv/atv-common.mk;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user