mirror of
https://github.com/Divested-Mobile/DivestOS-Build.git
synced 2025-01-12 07:59:36 -05:00
Fixes
This commit is contained in:
parent
65320ccc2d
commit
d9c0a95a3c
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#Goal: Remove as many proprietary blobs without breaking core functionality
|
#Goal: Remove as many proprietary blobs without breaking core functionality
|
||||||
#Outcome: Increased battery/performance/privacy/security, Decreased ROM size
|
#Outcome: Increased battery/performance/privacy/security, Decreased ROM size
|
||||||
#TODO: Clean init*.rc files, Create TWRP version, Remove more variants
|
#TODO: Clean init*.rc files, Create TWRP version, Modularize, Remove more variants
|
||||||
|
|
||||||
#
|
#
|
||||||
#Device Status (Tested under LineageOS 14.1 and 11.0)
|
#Device Status (Tested under LineageOS 14.1 and 11.0)
|
||||||
@ -134,8 +134,11 @@ export base;
|
|||||||
#Thermal Throttling [Qualcomm]
|
#Thermal Throttling [Qualcomm]
|
||||||
#blobs=$blobs"|libthermalclient.so|libthermalioctl.so|thermal-engine";
|
#blobs=$blobs"|libthermalclient.so|libthermalioctl.so|thermal-engine";
|
||||||
|
|
||||||
#Time Service [Qualcomm] XXX: Requires that https://github.com/LineageOS/android_hardware_sony_timekeep be included in repo manifest
|
#Time Service [Qualcomm]
|
||||||
#blobs=$blobs"|libtime_genoff.so"; #The radio needs this
|
#XXX: Requires that https://github.com/LineageOS/android_hardware_sony_timekeep be included in repo manifest
|
||||||
|
#XXX: This is another aggressive change and might be disabled in the future
|
||||||
|
#XXX: Time seems to be set properly with these blobs removed without Sony TimeKeep, so there may be more shenanigans here
|
||||||
|
#blobs=$blobs"|libtime_genoff.so"; #XXX: Breaks radio
|
||||||
blobs=$blobs"|libTimeService.so|time_daemon|TimeService.apk";
|
blobs=$blobs"|libTimeService.so|time_daemon|TimeService.apk";
|
||||||
|
|
||||||
#Venus (Hardware Video Decoding) [Qualcomm]
|
#Venus (Hardware Video Decoding) [Qualcomm]
|
||||||
@ -173,6 +176,9 @@ export base;
|
|||||||
deblobDevice() {
|
deblobDevice() {
|
||||||
devicePath=$1;
|
devicePath=$1;
|
||||||
cd $base$devicePath;
|
cd $base$devicePath;
|
||||||
|
if [ "${PWD##*/}" == "flo" ] || [ "${PWD##*/}" == "mako" ]; then #Older devices don't seem to use time_daemon TODO: Automate or extend this
|
||||||
|
replaceTime="false";
|
||||||
|
fi;
|
||||||
if [ -f Android.mk ]; then
|
if [ -f Android.mk ]; then
|
||||||
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
|
||||||
sed -i '/ALL_DEFAULT_INSTALLED_MODULES/s/$(DXHDCP2_SYMLINKS)//' Android.mk; #Remove Discretix firmware
|
sed -i '/ALL_DEFAULT_INSTALLED_MODULES/s/$(DXHDCP2_SYMLINKS)//' Android.mk; #Remove Discretix firmware
|
||||||
@ -182,24 +188,30 @@ deblobDevice() {
|
|||||||
sed -i '/ALL_DEFAULT_INSTALLED_MODULES/s/$(WV_SYMLINKS)//' Android.mk; #Remove Google Widevine firmware
|
sed -i '/ALL_DEFAULT_INSTALLED_MODULES/s/$(WV_SYMLINKS)//' Android.mk; #Remove Google Widevine firmware
|
||||||
fi;
|
fi;
|
||||||
if [ -f BoardConfig.mk ]; then
|
if [ -f BoardConfig.mk ]; then
|
||||||
sed -i 's/BOARD_USES_QC_TIME_SERVICES := true/BOARD_USES_QC_TIME_SERVICES := false/' BoardConfig.mk; #Switch to Sony TimeKeep
|
if [ -z "$replaceTime" ]; then
|
||||||
if ! grep -q "BOARD_USES_QC_TIME_SERVICES := false" BoardConfig.mk; then echo "BOARD_USES_QC_TIME_SERVICES := false" >> BoardConfig.mk; fi; #Switch to Sony TimeKeep
|
sed -i 's/BOARD_USES_QC_TIME_SERVICES := true/BOARD_USES_QC_TIME_SERVICES := false/' BoardConfig.mk; #Switch to Sony TimeKeep
|
||||||
|
if ! grep -q "BOARD_USES_QC_TIME_SERVICES := false" BoardConfig.mk; then echo "BOARD_USES_QC_TIME_SERVICES := false" >> BoardConfig.mk; fi; #Switch to Sony TimeKeep
|
||||||
|
fi;
|
||||||
sed -i 's/BOARD_USES_QCNE := true/BOARD_USES_QCNE := false/' BoardConfig.mk; #Disable CNE
|
sed -i 's/BOARD_USES_QCNE := true/BOARD_USES_QCNE := false/' BoardConfig.mk; #Disable CNE
|
||||||
sed -i 's/BOARD_USES_WIPOWER := true/BOARD_USES_WIPOWER := false/' BoardConfig.mk; #Disable WiPower
|
sed -i 's/BOARD_USES_WIPOWER := true/BOARD_USES_WIPOWER := false/' BoardConfig.mk; #Disable WiPower
|
||||||
fi;
|
fi;
|
||||||
if [ -f device.mk ]; then
|
if [ -f device.mk ]; then
|
||||||
awk -i inplace '!/'$makes'/' device.mk; #Remove all shim references from device makefile
|
awk -i inplace '!/'$makes'/' device.mk; #Remove all shim references from device makefile
|
||||||
#Switch to Sony TimeKeep
|
if [ -z "$replaceTime" ]; then
|
||||||
echo "PRODUCT_PACKAGES += \\" >> device.mk;
|
#Switch to Sony TimeKeep
|
||||||
echo " timekeep \\" >> device.mk;
|
echo "PRODUCT_PACKAGES += \\" >> device.mk;
|
||||||
echo " TimeKeep" >> device.mk;
|
echo " timekeep \\" >> device.mk;
|
||||||
|
echo " TimeKeep" >> device.mk;
|
||||||
|
fi;
|
||||||
fi;
|
fi;
|
||||||
if [ -f "${PWD##*/}".mk ] && [ "${PWD##*/}".mk != "sepolicy" ]; then
|
if [ -f "${PWD##*/}".mk ] && [ "${PWD##*/}".mk != "sepolicy" ]; then
|
||||||
awk -i inplace '!/'$makes'/' "${PWD##*/}".mk; #Remove all shim references from device makefile
|
awk -i inplace '!/'$makes'/' "${PWD##*/}".mk; #Remove all shim references from device makefile
|
||||||
#Switch to Sony TimeKeep
|
if [ -z "$replaceTime" ]; then
|
||||||
echo "PRODUCT_PACKAGES += \\" >> device.mk;
|
#Switch to Sony TimeKeep
|
||||||
echo " timekeep \\" >> device.mk;
|
echo "PRODUCT_PACKAGES += \\" >> "${PWD##*/}".mk;
|
||||||
echo " TimeKeep" >> device.mk;
|
echo " timekeep \\" >> "${PWD##*/}".mk;
|
||||||
|
echo " TimeKeep" >> "${PWD##*/}".mk;
|
||||||
|
fi;
|
||||||
fi;
|
fi;
|
||||||
if [ -f system.prop ]; then
|
if [ -f system.prop ]; then
|
||||||
sed -i 's/drm.service.enabled=true/drm.service.enabled=false/' system.prop;
|
sed -i 's/drm.service.enabled=true/drm.service.enabled=false/' system.prop;
|
||||||
@ -207,7 +219,7 @@ deblobDevice() {
|
|||||||
sed -i 's/persist.bt.enableAptXHD=true/persist.bt.enableAptXHD=false/' system.prop; #Disable aptX
|
sed -i 's/persist.bt.enableAptXHD=true/persist.bt.enableAptXHD=false/' system.prop; #Disable aptX
|
||||||
sed -i 's/persist.cne.feature=./persist.cne.feature=0/' system.prop; #Disable CNE
|
sed -i 's/persist.cne.feature=./persist.cne.feature=0/' system.prop; #Disable CNE
|
||||||
sed -i 's/persist.dpm.feature=./persist.dpm.feature=0/' system.prop; #Disable DPM
|
sed -i 's/persist.dpm.feature=./persist.dpm.feature=0/' system.prop; #Disable DPM
|
||||||
sed -i 's/persist.gps.qc_nlp_in_use=1/persist.gps.qc_nlp_in_use=0/' system.prop; #Disable QC Location Provider
|
sed -i 's/persist.gps.qc_nlp_in_use=./persist.gps.qc_nlp_in_use=0/' system.prop; #Disable QC Location Provider
|
||||||
sed -i 's/persist.sys.dpmd.nsrm=./persist.sys.dpmd.nsrm=0/' system.prop; #Disable DPM
|
sed -i 's/persist.sys.dpmd.nsrm=./persist.sys.dpmd.nsrm=0/' system.prop; #Disable DPM
|
||||||
sed -i 's/ro.bluetooth.emb_wp_mode=true/ro.bluetooth.emb_wp_mode=false/' system.prop; #Disable WiPower
|
sed -i 's/ro.bluetooth.emb_wp_mode=true/ro.bluetooth.emb_wp_mode=false/' system.prop; #Disable WiPower
|
||||||
sed -i 's/ro.bluetooth.wipower=true/ro.bluetooth.wipower=false/' system.prop; #Disable WiPower
|
sed -i 's/ro.bluetooth.wipower=true/ro.bluetooth.wipower=false/' system.prop; #Disable WiPower
|
||||||
@ -244,13 +256,15 @@ deblobDevice() {
|
|||||||
sed -i 's|<bool name="config_device_vt_available">true</bool>|<bool name="config_device_vt_available">false</bool>|' overlay/frameworks/base/core/res/res/values/config.xml;
|
sed -i 's|<bool name="config_device_vt_available">true</bool>|<bool name="config_device_vt_available">false</bool>|' overlay/frameworks/base/core/res/res/values/config.xml;
|
||||||
sed -i 's|<bool name="config_device_wfc_ims_available">true</bool>|<bool name="config_device_wfc_ims_available">false</bool>|' overlay/frameworks/base/core/res/res/values/config.xml;
|
sed -i 's|<bool name="config_device_wfc_ims_available">true</bool>|<bool name="config_device_wfc_ims_available">false</bool>|' overlay/frameworks/base/core/res/res/values/config.xml;
|
||||||
fi;
|
fi;
|
||||||
if [ -d sepolicy ] && [ "${PWD##*/}".mk != "flo" ]; then
|
if [ -d sepolicy ]; then
|
||||||
#Switch to Sony TimeKeep
|
if [ -z "$replaceTime" ]; then
|
||||||
echo "allow system_app time_data_file:dir { create_dir_perms search };" >> sepolicy/system_app.te;
|
#Switch to Sony TimeKeep
|
||||||
echo "allow system_app time_data_file:file create_file_perms;" >> sepolicy/system_app.te;
|
echo "allow system_app time_data_file:dir { create_dir_perms search };" >> sepolicy/system_app.te;
|
||||||
|
echo "allow system_app time_data_file:file create_file_perms;" >> sepolicy/system_app.te;
|
||||||
|
fi;
|
||||||
fi;
|
fi;
|
||||||
sed -i 's|service time_daemon /system/bin/time_daemon|service timekeep /system/bin/timekeep restore\n oneshot|' init.*.rc rootdir/init.*.rc rootdir/etc/init.*.rc &> /dev/null || true; #Switch to Sony TimeKeep
|
if [ -z "$replaceTime" ]; then sed -i 's|service time_daemon /system/bin/time_daemon|service timekeep /system/bin/timekeep restore\n oneshot|' init.*.rc rootdir/init.*.rc rootdir/etc/init.*.rc &> /dev/null || true; fi; #Switch to Sony TimeKeep
|
||||||
rm -f rootdir/etc/init.qti.ims.sh #Remove IMS startup script
|
rm -f rootdir/etc/init.qti.ims.sh rootdir/init.qti.ims.sh init.qti.ims.sh; #Remove IMS startup script
|
||||||
rm -rf IMSEnabler; #Remove IMS compatibility module
|
rm -rf IMSEnabler; #Remove IMS compatibility module
|
||||||
rm -rf data-ipa-cfg-mgr; #Remove IPACM
|
rm -rf data-ipa-cfg-mgr; #Remove IPACM
|
||||||
rm -rf libshimwvm; #Remove Google Widevine compatibility module
|
rm -rf libshimwvm; #Remove Google Widevine compatibility module
|
||||||
|
@ -23,7 +23,7 @@ ANDROID_HOME="/home/$USER/Android/Sdk"
|
|||||||
mkdir -p /tmp/ar
|
mkdir -p /tmp/ar
|
||||||
cd /tmp/ar
|
cd /tmp/ar
|
||||||
wget https://spotco.us/hosts -N #XXX: /hosts is built from non-commercial use files, switch to /hsc for release
|
wget https://spotco.us/hosts -N #XXX: /hosts is built from non-commercial use files, switch to /hsc for release
|
||||||
wget https://github.com/Ranks/emojione/raw/master/extras/fonts/emojione-android.ttf -N #XXX: Requires attribuition
|
wget https://github.com/emojione/emojione/raw/master/extras/fonts/emojione-android.ttf -N #XXX: Requires attribuition
|
||||||
|
|
||||||
#Accept all SDK licences, not normally needed but Gradle managed apps fail without it
|
#Accept all SDK licences, not normally needed but Gradle managed apps fail without it
|
||||||
mkdir -p "$ANDROID_HOME/licenses"
|
mkdir -p "$ANDROID_HOME/licenses"
|
||||||
|
Loading…
Reference in New Issue
Block a user