mirror of
https://github.com/Divested-Mobile/DivestOS-Build.git
synced 2024-10-01 01:35:54 -04:00
Remove silly carrier restrictions
Signed-off-by: Tad <tad@spotco.us>
This commit is contained in:
parent
ef51b5e5af
commit
19d5f73b50
@ -621,6 +621,23 @@ updateRegDb() {
|
||||
}
|
||||
export -f updateRegDb;
|
||||
|
||||
fixupCarrierConfigs() {
|
||||
cd "$DOS_BUILD_BASE";
|
||||
local pathsToFixup="packages/apps/CarrierConfig/assets/*.xml device/*/*/overlay/packages/apps/CarrierConfig/res/xml/vendor.xml device/*/*/overlay/CarrierConfigResCommon/res/xml/vendor.xml device/*/*/rro_overlays/CarrierConfigOverlay/res/xml/vendor.xml";
|
||||
#Things we don't want
|
||||
#Reference (BSD-3-Clause): https://github.com/GrapheneOS/carriersettings-extractor/blob/13/carriersettings_extractor.py
|
||||
local ccLines="allow_adding_apns_bool|apn_expand_bool|hide_ims_apn_bool|hide_preset_apn_details_bool|hide_enable_2g_bool";
|
||||
sed -i -E "/($ccLines)/d" $pathsToFixup;
|
||||
local ccArrays="read_only_apn_fields_string_array|read_only_apn_types_string_array";
|
||||
sed -i -E "/("$ccArrays").*num=\"0\"/d" $pathsToFixup; #ugly hack because next line is very greedy
|
||||
perl -0777 -pe 's,(<string-array.*?>.*?</string-array>),$1 =~ /'$ccArrays'/?"":$1,gse' -i $pathsToFixup; #Credit: https://unix.stackexchange.com/a/72160
|
||||
sed -i "/^ $/d" $pathsToFixup;
|
||||
sed -i "/^ $/d" $pathsToFixup;
|
||||
#sed -i '/^[[:space:]]*$/d' *.xml;
|
||||
cd "$DOS_BUILD_BASE";
|
||||
}
|
||||
export -f fixupCarrierConfigs;
|
||||
|
||||
disableEnforceRRO() {
|
||||
cd "$DOS_BUILD_BASE$1";
|
||||
awk -i inplace '!/PRODUCT_ENFORCE_RRO_TARGETS .= framework-res/' *.mk &>/dev/null || true;
|
||||
|
@ -406,6 +406,8 @@ cd "$DOS_BUILD_BASE";
|
||||
deblobAudio || true;
|
||||
removeBuildFingerprints || true;
|
||||
changeDefaultDNS || true; #Change the default DNS servers
|
||||
fixupCarrierConfigs || true; #Remove silly carrier restrictions
|
||||
cd "$DOS_BUILD_BASE";
|
||||
|
||||
#Tweaks for <2GB RAM devices
|
||||
#none yet
|
||||
|
@ -483,6 +483,7 @@ deblobAudio || true;
|
||||
removeBuildFingerprints || true;
|
||||
enableAutoVarInit || true;
|
||||
changeDefaultDNS || true; #Change the default DNS servers
|
||||
fixupCarrierConfigs || true; #Remove silly carrier restrictions
|
||||
cd "$DOS_BUILD_BASE";
|
||||
#rm -rfv device/*/*/overlay/CarrierConfigResCommon device/*/*/rro_overlays/CarrierConfigOverlay device/*/*/overlay/packages/apps/CarrierConfig/res/xml/vendor.xml;
|
||||
|
||||
|
@ -557,6 +557,7 @@ deblobAudio || true;
|
||||
removeBuildFingerprints || true;
|
||||
enableAutoVarInit || true;
|
||||
changeDefaultDNS || true; #Change the default DNS servers
|
||||
fixupCarrierConfigs || true; #Remove silly carrier restrictions
|
||||
cd "$DOS_BUILD_BASE";
|
||||
#rm -rfv device/*/*/overlay/CarrierConfigResCommon device/*/*/rro_overlays/CarrierConfigOverlay device/*/*/overlay/packages/apps/CarrierConfig/res/xml/vendor.xml;
|
||||
|
||||
|
@ -455,6 +455,7 @@ deblobAudio || true;
|
||||
removeBuildFingerprints || true;
|
||||
enableAutoVarInit || true;
|
||||
changeDefaultDNS || true; #Change the default DNS servers
|
||||
fixupCarrierConfigs || true; #Remove silly carrier restrictions
|
||||
cd "$DOS_BUILD_BASE";
|
||||
#rm -rfv device/*/*/overlay/CarrierConfigResCommon device/*/*/rro_overlays/CarrierConfigOverlay device/*/*/overlay/packages/apps/CarrierConfig/res/xml/vendor.xml;
|
||||
|
||||
|
@ -481,6 +481,7 @@ deblobAudio || true;
|
||||
removeBuildFingerprints || true;
|
||||
enableAutoVarInit || true;
|
||||
changeDefaultDNS || true; #Change the default DNS servers
|
||||
fixupCarrierConfigs || true; #Remove silly carrier restrictions
|
||||
cd "$DOS_BUILD_BASE";
|
||||
#rm -rfv device/*/*/overlay/CarrierConfigResCommon device/*/*/rro_overlays/CarrierConfigOverlay device/*/*/overlay/packages/apps/CarrierConfig/res/xml/vendor.xml;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user