mirror of
https://github.com/Divested-Mobile/DivestOS-Build.git
synced 2025-05-02 06:26:20 -04:00
Replace DNS patches with a function + some misc fixes
This commit is contained in:
parent
5772b68224
commit
3a3fe5aca9
9 changed files with 55 additions and 314 deletions
|
@ -194,7 +194,7 @@ echo "Deblobbing..."
|
|||
#blobs=$blobs"|libthermalclient.so|libthermalioctl.so|thermal-engine";
|
||||
|
||||
#Time Service [Qualcomm]
|
||||
#Requires that https://github.com/LineageOS/android_hardware_sony_timekeep be included in repo manifest
|
||||
#Requires that android_hardware_sony_timekeep be included in repo manifest
|
||||
if [ "$DEBLOBBER_REPLACE_TIME" = true ]; then
|
||||
#blobs=$blobs"|libtime_genoff.so"; #XXX: Breaks radio
|
||||
blobs=$blobs"|libTimeService.so|time_daemon|TimeService.apk";
|
||||
|
@ -265,18 +265,14 @@ deblobDevice() {
|
|||
awk -i inplace '!/'"$makes"'/' device.mk; #Remove references from device makefile
|
||||
if [ -z "$replaceTime" ]; then
|
||||
#Switch to Sony TimeKeep
|
||||
echo "PRODUCT_PACKAGES += \\" >> device.mk;
|
||||
echo " timekeep \\" >> device.mk;
|
||||
echo " TimeKeep" >> device.mk;
|
||||
echo "PRODUCT_PACKAGES += timekeep TimeKeep" >> device.mk;
|
||||
fi;
|
||||
fi;
|
||||
if [ -f "${PWD##*/}".mk ] && [ "${PWD##*/}".mk != "sepolicy" ]; then
|
||||
awk -i inplace '!/'"$makes"'/' "${PWD##*/}".mk; #Remove references from device makefile
|
||||
if [ -z "$replaceTime" ]; then
|
||||
#Switch to Sony TimeKeep
|
||||
echo "PRODUCT_PACKAGES += \\" >> "${PWD##*/}".mk;
|
||||
echo " timekeep \\" >> "${PWD##*/}".mk;
|
||||
echo " TimeKeep" >> "${PWD##*/}".mk;
|
||||
echo "PRODUCT_PACKAGES += timekeep TimeKeep" >> "${PWD##*/}".mk;
|
||||
fi;
|
||||
fi;
|
||||
if [ -f system.prop ]; then
|
||||
|
|
|
@ -185,6 +185,55 @@ getDefconfig() {
|
|||
}
|
||||
export -f getDefconfig;
|
||||
|
||||
changeDefaultDNS() {
|
||||
dnsPrimary="";
|
||||
dnsPrimaryV6="";
|
||||
dnsSecondary="";
|
||||
dnsSecondaryV6="";
|
||||
if [ -z "$DNS_PRESET"]; then
|
||||
if [[ "$DEFAULT_DNS_PRESET" == "Cloudflare" ]]; then
|
||||
dnsPrimary="1.0.0.1";
|
||||
dnsPrimaryV6="2606:4700:4700::1001";
|
||||
dnsSecondary="1.1.1.1";
|
||||
dnsSecondaryV6="2606:4700:4700::1111";
|
||||
elif [[ "$DEFAULT_DNS_PRESET" == "OpenNIC" ]]; then
|
||||
dnsPrimary="169.239.202.202";
|
||||
dnsPrimaryV6="2a05:dfc7:5353::53";
|
||||
dnsSecondary="185.121.177.177";
|
||||
dnsSecondaryV6="2a05:dfc7:5::53";
|
||||
elif [[ "$DEFAULT_DNS_PRESET" == "DNSWATCH" ]]; then
|
||||
dnsPrimary="84.200.69.80";
|
||||
dnsPrimaryV6="2001:1608:10:25::1c04:b12f";
|
||||
dnsSecondary="84.200.70.40";
|
||||
dnsSecondaryV6="2001:1608:10:25::9249:d69b";
|
||||
elif [[ "$DEFAULT_DNS_PRESET" == "Google" ]]; then
|
||||
dnsPrimary="8.8.8.8";
|
||||
dnsPrimaryV6="2001:4860:4860::8888";
|
||||
dnsSecondary="8.8.4.4";
|
||||
dnsSecondaryV6="2001:4860:4860::8844";
|
||||
elif [[ "$DEFAULT_DNS_PRESET" == "OpenDNS" ]]; then
|
||||
dnsPrimary="208.67.222.222";
|
||||
dnsPrimaryV6="2620:0:ccc::2";
|
||||
dnsSecondary="208.67.220.220";
|
||||
dnsSecondaryV6="2620:0:ccd::2";
|
||||
elif [[ "$DEFAULT_DNS_PRESET" == "Quad9" ]]; then
|
||||
dnsPrimary="9.9.9.9";
|
||||
dnsPrimaryV6="2620:fe::fe";
|
||||
dnsSecondary="149.112.112.112";
|
||||
dnsSecondaryV6="2620:fe::10"; #not real secondary, primary "unsecured"
|
||||
fi;
|
||||
else
|
||||
echo "You must first set a preset via the DEFAULT_DNS_PRESET variable in init.sh!";
|
||||
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";
|
||||
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/8\.8\.4\.4/$dnsSecondary/" $files &>/dev/null || true;
|
||||
sed -i "s/2001:4860:4860::8844/$dnsSecondaryV6/" $files &>/dev/null || true;
|
||||
}
|
||||
export -f changeDefaultDNS;
|
||||
|
||||
editKernelLocalversion() {
|
||||
defconfigPath=$(getDefconfig)
|
||||
sed -i 's/CONFIG_LOCALVERSION=".*"/CONFIG_LOCALVERSION="'"$1"'"/' $defconfigPath &>/dev/null || true;
|
||||
|
|
|
@ -84,8 +84,7 @@ sed -i 's|config_permissionReviewRequired">false|config_permissionReviewRequired
|
|||
patch -p1 < "$patches/android_frameworks_base/0001-Reduced_Resolution.patch"; #Allow reducing resolution to save power TODO: Add 800x480
|
||||
if [ "$MICROG_INCLUDED" = true ]; then patch -p1 < "$patches/android_frameworks_base/0003-Signature_Spoofing.patch"; fi; #Allow packages to spoof their signature (MicroG)
|
||||
if [ "$MICROG_INCLUDED" = true ]; then patch -p1 < "$patches/android_frameworks_base/0005-Harden_Sig_Spoofing.patch"; fi; #Restrict signature spoofing to system apps signed with the platform key
|
||||
if [ "$DEFAULT_DNS" = "Cloudflare" ]; then patch -p1 < "$patches/android_frameworks_base/0006-DNS_Cloudflare.patch"; fi; #Switch to Cloudflare DNS
|
||||
if [ "$DEFAULT_DNS" = "OpenNIC" ]; then patch -p1 < "$patches/android_frameworks_base/0006-DNS_OpenNIC.patch"; fi; #Switch to OpenNIC DNS
|
||||
changeDefaultDNS;
|
||||
#patch -p1 < "$patches/android_frameworks_base/0007-Connectivity.patch"; #Change connectivity check URLs to ours
|
||||
patch -p1 < "$patches/android_frameworks_base/0008-Disable_Analytics.patch"; #Disable/reduce functionality of various ad/analytics libraries
|
||||
rm -rf packages/PrintRecommendationService; #App that just creates popups to install proprietary print apps
|
||||
|
|
|
@ -84,8 +84,7 @@ sed -i 's/com.android.messaging/org.smssecure.smssecure/' core/res/res/values/co
|
|||
sed -i 's|config_permissionReviewRequired">false|config_permissionReviewRequired">true|' core/res/res/values/config.xml;
|
||||
if [ "$MICROG_INCLUDED" = true ]; then patch -p1 < "$patches/android_frameworks_base/0002-Signature_Spoofing.patch"; fi; #Allow packages to spoof their signature (microG)
|
||||
if [ "$MICROG_INCLUDED" = true ]; then patch -p1 < "$patches/android_frameworks_base/0003-Harden_Sig_Spoofing.patch"; fi; #Restrict signature spoofing to system apps signed with the platform key
|
||||
if [ "$DEFAULT_DNS" = "Cloudflare" ]; then patch -p1 < "$patches/android_frameworks_base/0004-DNS_Cloudflare.patch"; fi; #Switch to Cloudflare DNS
|
||||
if [ "$DEFAULT_DNS" = "OpenNIC" ]; then patch -p1 < "$patches/android_frameworks_base/0004-DNS_OpenNIC.patch"; fi; #Switch to OpenNIC DNS
|
||||
changeDefaultDNS;
|
||||
#patch -p1 < "$patches/android_frameworks_base/0005-Connectivity.patch"; #Change connectivity check URLs to ours
|
||||
patch -p1 < "$patches/android_frameworks_base/0006-Disable_Analytics.patch"; #Disable/reduce functionality of various ad/analytics libraries
|
||||
if [ "$NON_COMMERCIAL_USE_PATCHES" = true ]; then patch -p1 < "$patches/android_frameworks_base/Copperhead/0005-Deny_USB.patch"; fi; #Deny USB support (Copperhead CC BY-NC-SA)
|
||||
|
|
|
@ -23,7 +23,7 @@ export androidWorkspace="/mnt/Drive-3/"; #XXX: THIS MUST BE CORRECT TO BUILD!
|
|||
export DEBLOBBER_REMOVE_AUDIOFX=false; #Set true to remove AudioFX
|
||||
export DEBLOBBER_REMOVE_IMS=false; #Set true to remove all IMS blobs
|
||||
export DEBLOBBER_REPLACE_TIME=false; #Set true to replace Qualcomm Time Services with the open source Sony TimeKeep reimplementation
|
||||
export DEFAULT_DNS="OpenNIC"; #Sets default DNS. Options: Cloudflare, OpenNIC
|
||||
export DEFAULT_DNS_PRESET="OpenNIC"; #Sets default DNS. Options: Cloudflare, OpenNIC, DNSWATCH, Google, OpenDNS, Quad9
|
||||
export GLONASS_FORCED_ENABLE=true; #Enables GLONASS on all devices
|
||||
export MALWARE_SCAN_ENABLED=true; #Set true to perform a fast scan on patchWorkspace() and a through scan on buildAll()
|
||||
export MALWARE_SCAN_SETTING="quick"; #buildAll() scan speed. Options: quick, extra, slow, full
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue