2018-02-11 23:50:18 -05:00
#!/bin/bash
2020-11-17 10:11:40 -05:00
#DivestOS: A privacy focused mobile distribution
2020-04-14 21:39:51 -04:00
#Copyright (c) 2017-2020 Divested Computing Group
2018-02-11 23:50:18 -05:00
#
#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/>.
#Goal: Remove as many proprietary blobs without breaking core functionality
#Outcome: Increased battery/performance/privacy/security, Decreased ROM size
#TODO: Clean init*.rc files, Modularize, Remove more variants
2020-08-29 16:03:11 -04:00
echo "Deblobbing..." ;
2018-02-11 23:50:18 -05:00
#
#START OF BLOBS ARRAY
#
#WARNING: STRAY DELIMITERS WILL RESULT IN FILE DELETIONS
blobs = "" ; #Delimited using "|"
makes = "" ;
2021-01-18 07:11:54 -05:00
overlay = "invalid_placeholder_aekiekan" ;
2018-08-24 18:35:53 -04:00
ipcSec = "" ;
2018-02-11 23:50:18 -05:00
kernels = "" ; #Delimited using " "
2018-06-16 18:41:22 -04:00
sepolicy = "" ;
2018-02-11 23:50:18 -05:00
2019-03-22 19:35:28 -04:00
#ACDB (Audio Calibration DataBase) [Qualcomm] XXX: Breaks audio output
#blobs=$blobs".*.acdb|florida.*.bin"; #databases
#blobs=$blobs"|libacdb.*.so|libaditrtac.so|libaudcal.so"; #loaders
2018-02-11 23:50:18 -05:00
2018-07-01 00:34:34 -04:00
#ADSP/Hexagon (Hardware Digital Signal Processor) [Qualcomm]
2019-03-23 17:33:39 -04:00
#blobs=$blobs"[/]adsp[/]|.*adspd.*|.*adsprpc.*";
#blobs=$blobs"|libfastcvadsp_stub.so|libfastcvopt.so|libadsp.*.so|libscve.*.so";
2018-06-16 18:41:22 -04:00
#sepolicy=$sepolicy" adspd.te adsprpcd.te";
2018-02-11 23:50:18 -05:00
#Alipay (Payment Platform) [Alibaba]
2019-03-23 17:33:39 -04:00
blobs = $blobs "ifaadaemon|ifaadaemonProxy" ;
blobs = $blobs "|alipay.*" ;
2020-02-17 18:06:39 -05:00
blobs = $blobs "|IFAAService.apk" ;
blobs = $blobs "|vendor.oneplus.hardware.ifaa.*" ;
makes = $makes "org.ifaa.android.manager" ;
2019-03-23 12:49:58 -04:00
#AIV (DRM) [Amazon]
blobs = $blobs "|libaivdrmclient.so|libAivPlay.so" ;
2018-02-11 23:50:18 -05:00
2019-10-29 01:41:33 -04:00
#ANT (Wireless)
blobs = $blobs "|libantradio.so" ;
2020-02-19 22:07:57 -05:00
#blobs=$blobs"|com.qualcomm.qti.ant.*";
2020-02-17 18:06:39 -05:00
makes = $makes "|AntHalService|com.dsi.ant.antradio_library" ;
2019-10-29 01:41:33 -04:00
2018-02-11 23:50:18 -05:00
#aptX (Bluetooth Audio Compression Codec) [Qualcomm]
2019-03-23 17:33:39 -04:00
blobs = $blobs "|.*aptX.*|libbt-aptx.*.so" ;
blobs = $blobs "|aptxui.apk" ;
2018-02-11 23:50:18 -05:00
2018-08-24 23:56:38 -04:00
#AT Command Handling/Forwarding (See: https://atcommands.org)
2020-11-02 19:13:32 -05:00
blobs = $blobs "|bin[/]atd|drexe|log_serial_arm|at_distributor|connfwexe" ;
blobs = $blobs "|ATFWD-daemon" ;
2020-11-01 09:50:03 -05:00
blobs = $blobs "|vendor.qti.atcmdfwd.*|vendor.qti.hardware.radio.atcmdfwd.*" ;
2020-11-02 19:13:32 -05:00
blobs = $blobs "|atfwd.apk" ;
blobs = $blobs "|OBDM_Permissions.apk" ;
2018-08-26 20:32:19 -04:00
sepolicy = $sepolicy " atfwd.te" ;
2018-02-11 23:50:18 -05:00
2019-03-23 12:49:58 -04:00
#AudioFX (Audio Effects)
2018-06-30 14:49:22 -04:00
if [ " $DOS_DEBLOBBER_REMOVE_AUDIOFX " = true ] ; then
2019-03-23 17:33:39 -04:00
blobs = $blobs "|fmas_eq.dat" ;
2021-04-07 22:45:57 -04:00
blobs = $blobs "|libasphere.so|libdownmix.so|libeffectproxy.so|libfmas.so|libldnhncr.so|libmmieffectswrapper.so|libreverbwrapper.so|libshoebox.so|libvisualizer.so|libvolumelistener.so|libLifevibes_lvverx.so|libLifevibes_lvvetx.so|libhwdap.so" ;
2020-10-11 19:22:14 -04:00
#blobs=$blobs"|libspeakerbundle.so|libmotaudioutils.so"; #XXX: Breaks audio on Motorola devices (?)
2019-03-23 17:33:39 -04:00
blobs = $blobs "|libqcbassboost.so|libqcreverb.so|libqcvirt.so" ; #Qualcomm
2018-07-01 22:06:29 -04:00
#blobs=$blobs"|libbundlewrapper.so|libqcompostprocbundle.so|libqcomvoiceprocessing.so|libqcomvisualizer.so";
2020-10-20 07:20:40 -04:00
blobs = $blobs "|libhwdap.*.so|libswdap.*.so|lib_dlb_msd.so|vendor.dolby.hardware.dms.*" ; #Dolby
2019-03-23 17:33:39 -04:00
blobs = $blobs "|libsonypostprocbundle.so|libsonysweffect.so" ; #Sony
2018-06-30 14:49:22 -04:00
fi ;
2018-02-11 23:50:18 -05:00
#Clearkey (DRM) [Google]
blobs = $blobs "|libdrmclearkeyplugin.so" ;
2019-10-11 13:29:04 -04:00
#CMN (?) [?]
2019-09-03 17:42:03 -04:00
#blobs=$blobs"|cmnlib.*";
2018-02-11 23:50:18 -05:00
#CNE (Automatic Cell/Wi-Fi Switching) [Qualcomm]
2020-11-02 19:13:32 -05:00
if [ " $DOS_DEBLOBBER_REMOVE_CNE " = true ] ; then
#blobs=$blobs"|libcneapiclient.so|libNimsWrap.so|com.quicinc.cne.*.so"; #XXX: Breaks radio
blobs = $blobs "|andsfCne.xml|ATT_profile.*.xml|cneapiclient.xml|com.quicinc.cne.xml|ConnectivityExt.xml|profile1.xml|profile2.xml|profile3.xml|profile4.xml|profile5.xml|ROW_profile.*.xml|SwimConfig.xml|VZW_profile.*.xml" ;
blobs = $blobs "|cnd" ;
blobs = $blobs "|cneapiclient.jar|com.quicinc.cne.*.jar|ConnectivityExt.jar" ;
2021-01-18 07:11:54 -05:00
blobs = $blobs "|CNEService.apk|CneApp.apk|CACertService.apk|IWlanService.apk" ;
2020-11-02 19:13:32 -05:00
blobs = $blobs "|libcneconn.so|libcneqmiutils.so|libcne.so|libvendorconn.so|libwms.so|libwqe.so|libcneoplookup.so" ;
2021-01-18 07:11:54 -05:00
#blobs=$blobs"|vendor.qti.data.factory.*|vendor.qti.hardware.data.dynamicdds.*|vendor.qti.hardware.data.latency.*|vendor.qti.hardware.data.qmi.*|vendor.qti.latency.*|vendor.qti.hardware.data.iwlan.*";
overlay = $overlay "|config_wlan_data_service_package|config_wlan_network_service_package|config_qualified_networks_service_package" ;
2021-06-17 09:34:21 -04:00
#makes=$makes"|libcnefeatureconfig"; XXX: breaks radio
2020-11-02 19:13:32 -05:00
sepolicy = $sepolicy " cnd.te qcneservice.te" ;
fi ;
2018-02-11 23:50:18 -05:00
2019-10-11 13:29:04 -04:00
#CPPF (DRM) [?]
blobs = $blobs "|libcppf.so" ;
blobs = $blobs "|cppf.*" ;
2018-08-24 18:35:53 -04:00
#Diagnostics
2020-10-22 15:24:17 -04:00
#https://source.codeaurora.org/quic/la/platform/vendor/qcom-opensource/diag/ [headers]
#https://source.codeaurora.org/quic/imm/imm/sources/diag/ [related?]
blobs = $blobs "|[/]diag[/]|diag_callback_client|diag_dci_sample|diag_klog|diag_mdlog|diag_mdlog-getlogs|diag_mdlog-wrap|diag[/]mdm|diag_qshrink4_daemon|diag_socket_log|diag_uart_log|drmdiagapp|libdrmdiag.so|ssr_diag|test_diag|cnss_diag" ;
2018-08-24 23:56:38 -04:00
#blobs=$blobs"|libdiag.so|libsdm-diag.so|libDiagService.so"; #XXX: Breaks qseecomd AND brightness control (?)
2018-08-24 18:35:53 -04:00
ipcSec = "4097:4294967295:2002:2950:3009:2901|4097:4294967295:3009" ;
2018-02-11 23:50:18 -05:00
2018-05-20 23:28:01 -04:00
#Dirac (Audio Codec + Effects) [Dirac]
2020-10-11 04:46:19 -04:00
#if [ "$DOS_DEBLOBBER_REMOVE_AUDIOFX" = true ]; then
#blobs=$blobs"|libDiracAPI_SHARED.so|.*dirac.*"; #XXX: Breaks headphone jack
#blobs=$blobs"|diracmobile.config";
#fi;
2018-02-11 23:50:18 -05:00
#Discretix (DRM/HDCP) [Discretix Technologies]
2019-03-23 17:33:39 -04:00
blobs = $blobs "|DxDrmServerIpc|discretix" ;
blobs = $blobs "|libDxHdcp.so|libDxModularPluginNv.so|libDxDrmServer.so" ;
blobs = $blobs "|DxHDCP.cfg|DxDrmConfig.txt" ;
blobs = $blobs "|dxhdcp.*|dxcpr.*" ;
2019-08-12 17:14:25 -04:00
blobs = $blobs "|libhdcpsrm.so|libcpion.so" ;
2018-06-30 23:42:40 -04:00
makes = $makes "|DxHDCP.cfg" ;
2018-02-11 23:50:18 -05:00
2021-08-21 15:34:00 -04:00
#Display Color Tuning [Qualcomm] #XXX: still breaks boot on some devices
#blobs=$blobs"|mm-pp-daemon|mm-pp-dpps";
2020-10-20 07:20:40 -04:00
blobs = $blobs "|colorservice.apk|PPPreference.apk|CABLService.apk|QdcmFF.apk" ;
2021-08-21 15:34:00 -04:00
#blobs=$blobs"|libmm-color-convertor.so|libsd_sdk_display.so|libdpps.so";
2021-06-06 16:56:05 -04:00
#blobs=$blobs"|libdisp-aba.so|libmm-abl-oem.so|libmm-abl.so|libmm-als.so|libmm-disp-apis.so|libmm-qdcm.so"; #XXX: needed for hwcomposer(?)
2021-08-21 15:34:00 -04:00
#blobs=$blobs"|vendor.display.color.*|vendor.display.postproc.*|vendor.qti.hardware.qdutils_disp.*|com.qti.snapdragon.sdk.display.*";
#makes=$makes"|vendor.lineage.livedisplay.*service-legacymm";
2018-02-11 23:50:18 -05:00
#DivX (DRM) [DivX]
2019-03-23 17:33:39 -04:00
blobs = $blobs "|libDivxDrm.so|libSHIMDivxDrm.so" ;
2018-02-11 23:50:18 -05:00
#DPM (Data Power Management) [Qualcomm]
2020-10-22 15:24:17 -04:00
#https://source.codeaurora.org/quic/la/platform/vendor/qcom-opensource/dpm/ [headers]
2019-03-23 17:33:39 -04:00
blobs = $blobs "|com.qti.dpmframework.jar|dpmapi.jar|tcmclient.jar" ;
blobs = $blobs "|com.qti.dpmframework.xml|dpmapi.xml|dpm.conf|NsrmConfiguration.xml" ;
blobs = $blobs "|dpmd|dpmQmiMgr" ;
blobs = $blobs "|dpmserviceapp.apk" ;
blobs = $blobs "|libdpmctmgr.so|libdpmfdmgr.so|libdpmframework.so|libdpmnsrm.so|libdpmtcm.so|libdpmqmihal.so" ;
blobs = $blobs "|com.qualcomm.qti.dpm.*" ;
2018-06-16 18:41:22 -04:00
sepolicy = $sepolicy " dpmd.te" ;
2018-08-24 18:35:53 -04:00
ipcSec = $ipcSec "|47:4294967295:1001:3004|48:4294967295:1000:3004" ;
2018-02-11 23:50:18 -05:00
#DRM
2019-03-23 12:49:58 -04:00
blobs = $blobs "|lib-sec-disp.so|libSecureUILib.so|libsecureui.so|libsecureuisvc_jni.so|libsecureui_svcsock.so" ; #Qualcomm
2020-10-20 07:20:40 -04:00
blobs = $blobs "|com.qualcomm.qti.services.secureui.*" ;
2018-02-11 23:50:18 -05:00
blobs = $blobs "|liboemcrypto.so|libtzdrmgenprov.so" ;
blobs = $blobs "|libpvr.so|librmp.so|libsi.so|libSSEPKCS11.so" ;
2018-08-23 19:25:33 -04:00
blobs = $blobs "|libdrmctaplugin.so|libdrmmtkplugin.so|libdrmmtkwhitelist.so|libmockdrmcryptoplugin.so" ;
2019-03-23 12:49:58 -04:00
blobs = $blobs "|libOMXVideoDecoder.*Secure.so" ; #Decoding
blobs = $blobs "|htc_drmprov.*|gpsample.mbn|gptauuid.xml" ; #HTC
blobs = $blobs "|if.bin" ; #Intel PAVP backend
blobs = $blobs "|liblgdrm.so" ; #LG
#blobs=$blobs"|libtpa_core.so|libdataencrypt_tpa.so|libpkip.so"; #OMAP SMC
2020-02-17 18:06:39 -05:00
blobs = $blobs "|vendor.oneplus.hardware.drmkey.*|vendor.oneplus.hardware.hdcpkey.*" ; #OnePlus
2019-03-23 12:49:58 -04:00
blobs = $blobs "|smc_pa.ift|drmserver.samsung" ; #Samsung
blobs = $blobs "|provision_device" ;
#blobs=$blobs"|libasfparser.so|libsavsff.so"; #Parsers
2018-06-17 19:42:17 -04:00
makes = $makes "|android.hardware.drm.*|libdrmclearkeyplugin" ;
#makes=$makes"|libdrmframework.*"; #necessary to compile
#makes=$makes"|mediadrmserver|com.android.mediadrm.signer.*|drmserver"; #Works but causes long boot times
2018-06-23 02:38:49 -04:00
#sepolicy=$sepolicy" drmserver.te mediadrmserver.te";
sepolicy = $sepolicy " hal_drm_default.te hal_drm.te hal_drm_widevine.te" ;
2018-02-11 23:50:18 -05:00
2019-03-21 08:55:01 -04:00
#eMBMS [Qualcomm]
2019-03-23 17:33:39 -04:00
blobs = $blobs "|embms.apk" ;
blobs = $blobs "|embms.xml" ;
blobs = $blobs "|embmslibrary.jar" ;
2019-03-21 08:55:01 -04:00
2018-06-30 14:49:22 -04:00
#External Accessories
if [ " $DOS_DEBLOBBER_REMOVE_ACCESSORIES " = true ] ; then
2019-03-23 17:33:39 -04:00
#dragon
blobs = $blobs "|DragonKeyboardFirmwareUpdater.apk" ;
#griffin
blobs = $blobs "|ProjectorApp.apk|MotCameraMod.apk|ModFmwkProxyService.apk|ModService.apk" ;
blobs = $blobs "|libcamera_mods_legacy_hal.so|libmodmanager.*.so|com.motorola.mod.*.so|libmodhw.so" ;
blobs = $blobs "|mods_camd" ;
blobs = $blobs "|projectormod.xml|com.motorola.modservice.xml" ;
blobs = $blobs "|motorola.hardware.mods_camera.*" ;
#mata
2020-11-02 19:13:32 -05:00
blobs = $blobs "|[/]Score[/]|[/]Klik[/]|Score.apk|Klik.apk" ;
2019-03-23 17:33:39 -04:00
blobs = $blobs "|vendor.essential.hardware.sidecar.*" ;
blobs = $blobs "|vendor-essential-hardware-sidecar.*.xml" ;
#albus
blobs = $blobs "|DTVPlayer.apk|DTVService.apk" ;
2018-06-30 14:49:22 -04:00
fi ;
2018-02-11 23:50:18 -05:00
#Face Unlock [Google]
blobs = $blobs "|libfacenet.so|libfilterpack_facedetect.so|libfrsdk.so" ;
#GPS [Qualcomm]
2019-03-23 17:33:39 -04:00
#blobs=$blobs"|gpsd";
#blobs=$blobs"|libflp.so|libgps.utils.so|libloc_api_v02.so|libloc_core.so|libloc_ds_api.so|libloc_eng.so|libloc_ext.so|libizat_core.so";
#blobs=$blobs"|flp.default.so|flp.msm.*.so|gps.default.so|gps.msm.*.so";
#blobs=$blobs"|flp.conf";
2018-02-11 23:50:18 -05:00
2018-06-30 19:52:46 -04:00
#Graphics
if [ " $DOS_DEBLOBBER_REMOVE_GRAPHICS " = true ] ; then
blobs = $blobs "|eglsubAndroid.so|eglSubDriverAndroid.so|libbccQTI.so|libC2D2.so|libc2d30_bltlib.so|libc2d30.so|libc2d30.*.so|libCB.so|libEGL.*.so|libGLES.*.so|libgsl.so|libq3dtools_esx.so|libq3dtools.*.so|libQTapGLES.so|libscale.so|libsc.*.so" ;
blobs = $blobs "|libglcore.so|libnvblit.so|libnvddk_vic.so|libnvglsi.so|libnvgr.so|libnvptx.so|libnvrmapi.*.so|libnvrm_graphics.so|libnvrm.so|libnvwsi.so" ; #NVIDIA
blobs = $blobs "|gralloc.*.so|hwcomposer.*.so|memtrack.*.so" ;
blobs = $blobs "|libadreno_utils.so" ; #Adreno
blobs = $blobs "|libllvm.*.so" ; #LLVM
blobs = $blobs "|libOpenCL.*.so|libclcore_nvidia.bc" ; #OpenCL
blobs = $blobs "|vulkan.*.so" ; #Vulkan
2019-03-22 19:35:28 -04:00
makes = $makes "|android.hardware.vulkan.*|libvulkan" ;
fi ;
if [ " $DOS_DEBLOBBER_REMOVE_RENDERSCRIPT " = true ] || [ " $DOS_DEBLOBBER_REMOVE_GRAPHICS " = true ] ; then
blobs = $blobs "|android.hardware.renderscript.*" ;
blobs = $blobs "|librs.*.so|libRSDriver.*.so|libnvRSCompiler.so|libnvRSDriver.so" ; #Adreno
blobs = $blobs "|libPVRRS.*.so|libufwriter.so" ; #Intel
makes = $makes "|android.hardware.renderscript.*" ;
2018-06-30 19:52:46 -04:00
fi ;
2018-06-30 14:49:22 -04:00
#Fingerprint Reader
if [ " $DOS_DEBLOBBER_REMOVE_FP " = true ] ; then
2019-03-23 17:33:39 -04:00
blobs = $blobs "|fingerprint.*.so|libbauthserver.so|libcom_fingerprints_service.so|libegis_fp_normal_sensor_test.so|lib_fpc_tac_shared.so|libfpfactory.*.so|libsynaFpSensorTestNwd.so" ;
blobs = $blobs "|fpc_early_loader" ;
blobs = $blobs "|fpctzappfingerprint.*" ;
blobs = $blobs "|android.hardware.biometrics.fingerprint.*" ;
2018-07-12 21:14:11 -04:00
makes = $makes "|android.hardware.biometrics.fingerprint.*|android.hardware.fingerprint.*" ;
2018-06-30 14:49:22 -04:00
fi ;
2019-03-21 08:55:01 -04:00
#FM Radio [Google]
blobs = $blobs "|FMRadioGoogle.apk|FmRadioTrampoline2.apk" ;
2020-10-20 07:20:40 -04:00
#[Google]
2020-10-22 15:24:17 -04:00
blobs = $blobs "|TetheringEntitlement.apk|CarrierLocation.apk|CarrierWifi.apk|CarrierSettings.apk" ;
2020-10-20 07:20:40 -04:00
blobs = $blobs "|HardwareInfo.apk" ;
blobs = $blobs "|SCONE.apk" ; #???
2021-04-04 17:06:47 -04:00
blobs = $blobs "|DevicePersonalizationPrebuilt.*.apk" ; #Live Captions?
#EUICC (Virtual SIM) [Google]
blobs = $blobs "|EuiccGoogle.apk|EuiccSupportPixel.apk" ; #EUICC is useless without GMS
blobs = $blobs "|esim0.img|esim-v1.img|esim-full-v0.img" ;
makes = $makes "|android.hardware.telephony.euicc.*" ;
2020-10-20 07:20:40 -04:00
2018-07-12 16:49:05 -04:00
#Google Camera
2021-08-09 23:39:16 -04:00
#blobs=$blobs"|com.google.android.camera.*";
2018-07-12 16:49:05 -04:00
2020-10-20 07:20:40 -04:00
#Google Setup Wizard
blobs = $blobs "|DreamlinerPrebuilt.apk|DreamlinerUpdater.apk" ;
blobs = $blobs "|com.google.android.apps.dreamliner.xml|dreamliner.xml" ;
2020-10-23 16:39:15 -04:00
#Google Tango
blobs = $blobs "|TangoCore.apk|TangoDiscovery.apk" ;
blobs = $blobs "|tango_service" ;
blobs = $blobs "|libtango_device.*.jar" ;
2020-10-23 18:15:01 -04:00
blobs = $blobs "|libtango_.*.so" ;
2020-10-23 16:39:15 -04:00
2018-07-12 16:49:05 -04:00
#Google TV
2019-03-21 08:55:01 -04:00
blobs = $blobs "|LeanbackIme.apk|LeanbackLauncher.apk|AtvRemoteService.apk|GamepadPairingService.apk|GlobalKeyInterceptor.apk|RemoteControlService.apk|TV.apk|CanvasPackageInstaller.apk|Overscan.apk" ;
2019-03-23 12:49:58 -04:00
#Gemini PDA [Planet]
blobs = $blobs "|ApplicationBar.apk|Gemini_Keyboard.apk|GeminiInputDevices.apk|notes.apk" ;
2019-03-21 08:55:01 -04:00
#[Huawei]
blobs = $blobs "|HWSarControlService.apk" ;
2018-07-12 16:49:05 -04:00
2018-02-11 23:50:18 -05:00
#HDCP (DRM)
2019-03-23 17:33:39 -04:00
blobs = $blobs "|libmm-hdcpmgr.so|libstagefright_hdcp.so|libhdcp2.so" ;
2020-10-23 16:39:15 -04:00
blobs = $blobs "|libtsechdcp.so|libtlk_secure_hdcp_up.so|libstagefright_hdcp.so|libnvhdcp.so" ;
2020-10-23 18:15:01 -04:00
blobs = $blobs "|srm.bin|insthk|hdcp_test|tsechdcp_test" ;
2019-03-24 13:39:14 -04:00
blobs = $blobs "|hdcp2xtest.srm" ;
2020-02-23 20:51:13 -05:00
blobs = $blobs "|hdcp1.*|hdcp2.*|tzhdcp.*" ;
2018-02-11 23:50:18 -05:00
2018-06-28 20:11:20 -04:00
#HDR
2021-08-09 23:39:16 -04:00
blobs = $blobs "|libdovi.so|libhdr_tm.so" ;
2019-03-23 17:33:39 -04:00
blobs = $blobs "|DolbyVisionService.apk" ;
2019-08-23 12:23:43 -04:00
blobs = $blobs "|dolby_vision.cfg|hdr_tm_config.xml" ;
2018-06-28 20:11:20 -04:00
2018-02-11 23:50:18 -05:00
#I/O Prefetcher [Qualcomm]
2019-03-25 20:30:27 -04:00
#blobs=$blobs"|libqc-opt.so"; #Can break camera in some cases
blobs = $blobs "|libqti-iop.*.so" ;
2019-03-23 17:33:39 -04:00
blobs = $blobs "|bin[/]iop" ;
blobs = $blobs "|QPerformance.jar" ;
blobs = $blobs "|vendor.qti.hardware.iop.*" ;
2018-02-11 23:50:18 -05:00
#IMS (VoLTE/Wi-Fi Calling) [Qualcomm]
2020-02-19 22:07:57 -05:00
if [ " $DOS_DEBLOBBER_REMOVE_IMS " = true ] ; then
2020-05-02 22:29:23 -04:00
#blobs=$blobs"|libimsmedia_jni.so|vendor.qti.hardware.radio.ims.*";
blobs = $blobs "|lib-imsdpl.so|lib-imscamera.so|libimscamera_jni.so|lib-imsqimf.so|lib-imsSDP.so|lib-imss.so|lib-imsvt.so|lib-imsxml.so|lib-imsvideocodec.so|lib-imsvtextutils.so|lib-imsvtutils.so" ;
2020-02-19 22:07:57 -05:00
blobs = $blobs "|imscmservice|imsdatadaemon|imsqmidaemon" ;
2020-05-02 22:29:23 -04:00
blobs = $blobs "|imscm.xml|ims.xml|android.hardware.telephony.ims.xml" ;
2020-10-21 17:02:24 -04:00
blobs = $blobs "|qti_permissions.xml|qti-vzw-ims-internal.xml" ;
2020-02-19 22:07:57 -05:00
blobs = $blobs "|imssettings.apk|ims.apk" ;
2020-10-21 17:02:24 -04:00
blobs = $blobs "|imscmlibrary.jar|qti-vzw-ims-internal.jar" ;
blobs = $blobs "|com.qualcomm.qti.imscmservice.*|vendor.qti.ims.*" ;
2020-02-19 22:07:57 -05:00
#RTP
blobs = $blobs "|ims_rtp_daemon|lib-rtpcommon.so|lib-rtpcore.so|lib-rtpdaemoninterface.so|lib-rtpsl.so" ;
blobs = $blobs "|vendor.qti.imsrtpservice.*" ;
#Misc.
blobs = $blobs "|lib-dplmedia.so|librcc.so|libvcel.so|libvoice-svc.so" ;
2018-06-30 14:49:22 -04:00
blobs = $blobs "|volte_modem[/]" ;
2020-02-19 22:07:57 -05:00
makes = $makes "|ims-ext-common" ;
2018-06-30 14:49:22 -04:00
sepolicy = $sepolicy " ims.te imscm.te imswmsproxy.te" ;
2018-08-24 18:35:53 -04:00
ipcSec = $ipcSec "|32:4294967295:1001" ;
2018-06-30 14:49:22 -04:00
fi ;
2020-10-21 17:02:24 -04:00
if [ " $DOS_DEBLOBBER_REMOVE_IMS " = true ] || [ " $DOS_DEBLOBBER_REMOVE_RCS " = true ] ; then
#RCS (Proprietary messaging protocol)
2020-10-22 15:24:17 -04:00
#https://source.codeaurora.org/quic/la/platform/vendor/qcom-opensource/rcs-service/ [useless]
2020-10-21 17:02:24 -04:00
blobs = $blobs "|imsrcsd" ;
blobs = $blobs "|lib-imsrcscmclient.so|lib-ims-rcscmjni.so|lib-imsrcscmservice.so|lib-imsrcscm.so|lib-imsrcs.so|lib-imsrcs-v2.so|lib-rcsimssjni.so|lib-rcsjni.so|lib-uceservice.so" ;
blobs = $blobs "|rcsimssettings.jar|rcsservice.jar" ;
blobs = $blobs "|rcsimssettings.xml|rcsservice.xml" ;
blobs = $blobs "|CarrierServices.apk|RCSBootstraputil.apk|RcsImsBootstraputil.apk|uceShimService.apk" ;
#blobs=$blobs"|vendor.qti.ims.rcsconfig.*";
blobs = $blobs "|com.qualcomm.qti.uceservice.*" ;
makes = $makes "|rcs_service.*" ;
ipcSec = $ipcSec "|18:4294967295:1001:3004" ;
fi ;
2018-02-11 23:50:18 -05:00
#IPA (Internet Packet Accelerator) [Qualcomm]
2020-10-22 15:24:17 -04:00
#https://source.codeaurora.org/quic/la/platform/hardware/qcom/data/ipa-cfg-mgr/
#https://source.codeaurora.org/quic/la/platform/hardware/qcom/data/ipacfg-mgr/
#https://source.codeaurora.org/quic/la/platform/vendor/qcom-opensource/data-ipa-cfg-mgr/
2018-02-11 23:50:18 -05:00
blobs = $blobs "|ipacm-diag" ;
2018-08-24 18:35:53 -04:00
if [ " $DOS_DEBLOBBER_REMOVE_IPA " = true ] ; then
blobs = $blobs "|ipacm" ;
makes = $makes "|ipacm|IPACM_cfg.xml" ;
kernels = $kernels " drivers/platform/msm/ipa" ;
fi ;
2018-02-11 23:50:18 -05:00
2018-05-16 14:21:20 -04:00
#IS? (DRM) [?]
blobs = $blobs "|isdbtmm.*" ;
2018-06-30 14:49:22 -04:00
#IR
if [ " $DOS_DEBLOBBER_REMOVE_IR " = true ] ; then
2019-03-23 17:33:39 -04:00
blobs = $blobs "|cir_fw_update" ;
blobs = $blobs "|consumerir.*.so|ibcir_driver.so|libcir_driver.so|libhtcirinterface_jni.so" ;
blobs = $blobs "|htcirlibs.jar" ;
blobs = $blobs "|CIRModule.apk" ;
blobs = $blobs "|cir.img" ;
2018-07-12 21:14:11 -04:00
makes = $makes "|android.hardware.ir.*|android.hardware.consumerir.*" ;
2018-06-30 14:49:22 -04:00
fi ;
2018-02-11 23:50:18 -05:00
#Keystore/TrustZone (HW Crypto) [Qualcomm]
2019-03-23 17:33:39 -04:00
#blobs=$blobs"|keystore.qcom.so|libdrmdecrypt.so|libdrmfs.so|libdrmtime.so|libQSEEComAPI.so|librpmb.so|libssd.so|libQTEEConnector.*.so";
#blobs=$blobs"|qseecomd";
2019-03-24 13:39:14 -04:00
blobs = $blobs "|qseecom_sample_client|qseecom_security_test|qseeproxysampledaemon" ;
2019-03-23 17:33:39 -04:00
#blobs=$blobs"|keymaster.*|tzapps.*";
#blobs=$blobs"|vendor.qti.hardware.qteeconnector.*";
2018-02-11 23:50:18 -05:00
2019-03-23 12:49:58 -04:00
#libMM (multimedia encoder/decoder/parser) [Qualcomm]
#blobs=$blobs"|libmmparser.so|libmmipstreamsourcehttp.so";
2018-02-11 23:50:18 -05:00
#Location (gpsOne/gpsOneXTRA/IZat/Lumicast/QUIP) [Qualcomm]
2020-10-22 15:24:17 -04:00
#https://source.codeaurora.org/quic/la/platform/vendor/qcom-opensource/location/
2020-02-19 22:07:57 -05:00
blobs = $blobs "|libalarmservice_jni.so|libasn1cper.so|libasn1crt.so|libasn1crtx.so|libgdtap.so|libloc_ext.so|libloc_xtra.so|liblowi_wifihal_nl.so|liblowi_wifihal.so|libquipc_os_api.so|libquipc_ulp_adapter.so|libxt_native.so|libxtwifi_ulp_adaptor.so|libxtwifi_zpp_adaptor.so" ;
#blobs=$blobs"|libulp2.so|libxtadapter.so|libgeofence.so|liblbs_core.so|libdataitems.so|libdrplugin_client.so|libDRPlugin.so|libevent_observer.so|liblocationservice_glue.so|liblocationservice.so|liblowi_client.so";
2019-03-23 17:33:39 -04:00
blobs = $blobs "|cacert_location.pem|com.qti.location.sdk.xml|com.qualcomm.location.xml|izat.conf|izat.xt.srv.xml|lowi.conf|xtra_root_cert.pem|xtwifi.conf" ;
blobs = $blobs "|com.qti.location.sdk.jar|izat.xt.srv.jar" ;
blobs = $blobs "|com.qualcomm.location.apk|com.qualcomm.services.location.apk|xtra_t_app.apk" ;
2020-02-23 20:51:13 -05:00
blobs = $blobs "|gpsone_daemon|izat.xt.srv|location-mq|loc_launcher|lowi-server|slim_ap_daemon|slim_daemon|xtwifi-client|xtwifi-inet-agent|xtra-daemon" ;
2021-01-18 07:11:54 -05:00
overlay = $overlay "|config_comboNetworkLocationProvider|config_enableFusedLocationOverlay|config_enableNetworkLocationOverlay|config_fusedLocationProviderPackageName|config_enableNetworkLocationOverlay|config_networkLocationProviderPackageName|com.qualcomm.location" ;
2018-02-11 23:50:18 -05:00
2020-10-20 07:20:40 -04:00
#Machine Learning [Qualcomm]
blobs = $blobs "|vendor.qti.hardware.mlshal.*|vendor.qti.hardware.cvp.*" ;
blobs = $blobs "|libopenvx.so|libnpu.so|libcvp.*.so" ;
2018-02-11 23:50:18 -05:00
#Misc
blobs = $blobs "|libjni_latinime.so|libuiblur.so|libwifiscanner.so" ;
2020-10-20 07:20:40 -04:00
#Motion Sense
blobs = $blobs "|OsloFeedback.apk" ;
blobs = $blobs "|oslo.so|oslo.napp_header" ;
blobs = $blobs "|BufferConfigValOslo.bin|OsloSensorConfig.bin|OsloSensorPackage.bin" ;
blobs = $blobs "|vendor.google.airbrush.*|libairbrush-pixel.so" ;
blobs = $blobs "|libdarwinn_client.so|libdarwinn_compiler.so|vendor.google.darwinn.service.*" ;
#blobs=$blobs"|pixelatoms-cpp.so|vendor-pixelatoms-cpp.so"; #???
2019-09-02 20:00:39 -04:00
#Music Detection [Google]
blobs = $blobs "|AmbientSensePrebuilt.apk" ;
blobs = $blobs "|dnd.descriptor|dnd.sound_model|music_detector.descriptor|music_detector.sound_model" ;
2019-03-21 08:55:01 -04:00
2019-03-23 12:49:58 -04:00
#[Motorola] #See: http://www.beneaththewaves.net/Projects/Motorola_Is_Listening.html
2020-10-20 07:20:40 -04:00
blobs = $blobs "|BuaContactAdapter.apk|com.motorola.DirectedSMSProxy.xml|com.motorola.msimsettings.xml" ;
2019-03-23 17:33:39 -04:00
blobs = $blobs "|MotoDisplayFWProxy.apk|com.motorola.motodisplay.xml" ;
blobs = $blobs "|com.motorola.camera.xml|com.motorola.gallery.xml" ;
blobs = $blobs "|EasyAccessService.apk" ;
2019-03-23 20:15:38 -04:00
blobs = $blobs "|batt_health" ;
#blobs=$blobs"|dbvc_atvc_property_set";
2019-03-23 17:33:39 -04:00
blobs = $blobs "|com.motorola.motosignature.jar|com.motorola.motosignature.xml|MotoSignatureApp.apk" ;
blobs = $blobs "|TriggerEnroll.apk|TriggerTrainingService.apk|com.motorola.triggerenroll.xml" ;
2020-07-19 16:10:48 -04:00
blobs = $blobs "|audio.motvr.default.so" ;
2019-03-23 20:15:38 -04:00
blobs = $blobs "|libcce-socketjni.so|libmotocare.so" ;
#blobs=$blobs"|qmi_motext_hook|libmdmcutback.so|libqmimotext.so|libmotext_inf.so"; #necessary for radio
2018-02-11 23:50:18 -05:00
makes = $makes "|com.motorola.cameraone.xml" ;
2019-03-23 12:49:58 -04:00
#OMA-DM/SyncML #See: https://www.blackhat.com/docs/us-14/materials/us-14-Solnik-Cellular-Exploitation-On-A-Global-Scale-The-Rise-And-Fall-Of-The-Control-Protocol.pdf
blobs = $blobs "|SyncMLSvc.apk|libsyncml_core.so|libsyncml_port.so" ; #SyncML
blobs = $blobs "|libvdmengine.so|libvdmfumo.so" ; #RedBend
blobs = $blobs "|libdme_main.so|libwbxmlparser.so|libprovlib.so" ;
blobs = $blobs "|dm_agent|dm_agent_binder" ;
blobs = $blobs "|npsmobex" ; #Samsung?
2021-06-26 14:13:03 -04:00
blobs = $blobs "|ConnMO.apk|OmaDmclient.apk|USCCDM.apk|com.android.omadm.service.xml|DCMO.apk|DiagMon.apk|DMConfigUpdate.apk|DMConfigUpdateLight.apk|DMService.apk|libdmengine.so|libdmjavaplugin.so|SprintDM.apk|SDM.apk|whitelist_com.android.omadm.service.xml|com.android.sdm.plugins.connmo.xml|com.android.sdm.plugins.sprintdm.xml|com.google.omadm.trigger.xml|com.android.sdm.plugins.diagmon.xml|com.android.sdm.plugins.dcmo.xml|com.android.sdm.plugins.usccdm.xml" ; #Sprint
2019-03-23 12:49:58 -04:00
2019-03-23 20:15:38 -04:00
#OpenMobileAPI [SIM Alliance]
#https://github.com/seek-for-android/platform_packages_apps_SmartCardService
#blobs=$blobs"|org.simalliance.openmobileapi.jar";
#blobs=$blobs"|org.simalliance.openmobileapi.xml";
2018-02-11 23:50:18 -05:00
#Performance [Qualcomm]
#blobs=$blobs"|msm_irqbalance";
#Devices utilizing perfd won't hotplug cores without it
2019-03-23 17:33:39 -04:00
#blobs=$blobs"|mpdecision|perfd";
#blobs=$blobs"|libqti-perfd.*.so";
#blobs=$blobs"|perf-profile.*.conf";
#blobs=$blobs"|vendor.qti.hardware.perf.*";
2019-03-21 08:55:01 -04:00
blobs = $blobs "|Perfdump.apk" ;
2018-02-11 23:50:18 -05:00
2018-06-30 19:52:46 -04:00
#Peripheral Manager
2020-10-22 15:24:17 -04:00
#https://source.codeaurora.org/quic/la/platform/system/peripheralmanager/ [headers]
2019-03-23 17:33:39 -04:00
#blobs=$blobs"|libperipheral_client.so|libspcom.so";
#blobs=$blobs"|pm-proxy|pm-service|spdaemon";
2018-06-30 19:52:46 -04:00
2019-09-02 20:00:39 -04:00
#Pixel Visual Core [Google]
#blobs=$blobs"|easelmanagerd";
#blobs=$blobs"|EaselServicePrebuilt.apk";
2021-08-09 23:39:16 -04:00
#blobs=$blobs"|libeaselcomm.so|libeaselcontrol.amber.so|libhdrplusclient.so|libhdrplusclientimpl.so|libhdrplusmessenger.so";
2019-09-02 20:00:39 -04:00
2018-02-11 23:50:18 -05:00
#Playready (DRM) [Microsoft]
2019-03-23 17:33:39 -04:00
blobs = $blobs "|prapp|scranton_RD" ;
blobs = $blobs "|libtzplayready.so|libdrmprplugin.so|libprdrmdecrypt.so|libprmediadrmdecrypt.so|libprmediadrmplugin.so|libseppr_hal.so" ;
blobs = $blobs "|PR-ModelCert" ;
2019-03-23 12:49:58 -04:00
blobs = $blobs "|playread.*|hcheck.*" ;
2018-02-11 23:50:18 -05:00
2019-03-22 05:27:58 -04:00
#Power [Google]
blobs = $blobs "|LowPowerMonitorDevice.*.jar|PowerAnomaly.*.jar" ;
2018-02-11 23:50:18 -05:00
#Project Fi [Google]
blobs = $blobs "|Tycho.apk" ;
#Quickboot [Qualcomm]
2020-10-22 15:24:17 -04:00
#https://source.codeaurora.org/quic/la/platform/packages/apps/FastPowerOn/
2019-10-11 13:29:04 -04:00
blobs = $blobs "|power_off_alarm" ;
2019-03-21 08:55:01 -04:00
blobs = $blobs "|QuickBoot.apk|PowerOffAlarm.apk" ;
2019-10-11 13:29:04 -04:00
blobs = $blobs "|vendor.qti.hardware.alarm.*" ;
2018-02-11 23:50:18 -05:00
#QTI (Tethering Extensions) [Qualcomm]
2019-03-23 17:33:39 -04:00
blobs = $blobs "|libQtiTether.so" ;
blobs = $blobs "|QtiTetherService.apk" ;
2018-02-11 23:50:18 -05:00
2019-03-22 05:27:58 -04:00
#RIL [Qualcomm]
blobs = $blobs "|Asdiv.apk" ;
2019-03-21 08:55:01 -04:00
#[Samsung]
blobs = $blobs "|SystemUpdateUI.apk" ;
2018-02-11 23:50:18 -05:00
#SecProtect [Qualcomm]
blobs = $blobs "|SecProtect.apk" ;
#SecureUI Frontends
2018-06-28 20:11:20 -04:00
blobs = $blobs "|libHealthAuthClient.so|libHealthAuthJNI.so|libSampleAuthJNI.so|libSampleAuthJNIv1.so|libSampleExtAuthJNI.so|libSecureExtAuthJNI.so|libSecureSampleAuthClient.so|libsdedrm.so" ;
2019-10-11 13:29:04 -04:00
blobs = $blobs "|vendor.qti.hardware.tui.*" ;
2018-02-11 23:50:18 -05:00
2020-02-17 18:06:39 -05:00
#Soter (Biometric Auth) [Tencent]
blobs = $blobs "|SoterService.apk" ;
blobs = $blobs "|vendor.qti.hardware.soter.*" ;
2018-02-11 23:50:18 -05:00
#[Sprint]
2020-11-15 08:16:23 -05:00
blobs = $blobs "|CQATest.apk|GCS.apk|HiddenMenu.apk|HiddenMenuLight.apk|LifetimeData.apk|SprintHM.apk|LifeTimerService.apk|SecPhone.apk|SprintMenu.apk" ;
2018-08-24 18:35:53 -04:00
ipcSec = $ipcSec "|238:4294967295:1001:3004" ;
2018-02-11 23:50:18 -05:00
#Thermal Throttling [Qualcomm]
2020-10-22 15:24:17 -04:00
#https://source.codeaurora.org/quic/la/platform/vendor/qcom-opensource/thermal-engine/ [headers]
2019-03-23 17:33:39 -04:00
#blobs=$blobs"|thermal-engine";
#blobs=$blobs"|libthermalclient.so|libthermalioctl.so";
2018-02-11 23:50:18 -05:00
#Time Service [Qualcomm]
2020-10-22 15:24:17 -04:00
#https://source.codeaurora.org/quic/la/platform/vendor/qcom-opensource/time-services/ [headers]
2018-06-24 01:27:33 -04:00
#Requires that android_hardware_sony_timekeep be included in repo manifest
2018-06-29 00:55:21 -04:00
if [ " $DOS_DEBLOBBER_REPLACE_TIME " = true ] ; then
2018-06-23 01:08:42 -04:00
#blobs=$blobs"|libtime_genoff.so"; #XXX: Breaks radio
2019-03-23 17:33:39 -04:00
blobs = $blobs "|libTimeService.so" ;
blobs = $blobs "|TimeService.apk" ;
blobs = $blobs "|time_daemon" ;
2018-06-23 01:08:42 -04:00
sepolicy = $sepolicy " qtimeservice.te" ;
2018-06-13 07:07:47 -04:00
fi ;
2018-02-11 23:50:18 -05:00
2020-10-20 07:20:40 -04:00
#[T-Mobile]
blobs = $blobs "|TmobileGrsuPrebuilt.apk" ;
#Touchscreen [Qualcomm] XXX: breaks touch
#blobs=$blobs"|vendor.qti.hardware.improvetouch.*"; #TODO: test with just this line uncommented
#blobs=$blobs"|hbtp_daemon|hbtp_cmd.sh";
#blobs=$blobs"|libhbtpclient.so|libhbtpdsp.so|libhbtpfrmwk.so";
2018-02-11 23:50:18 -05:00
#Venus (Hardware Video Decoding) [Qualcomm]
2019-03-23 17:33:39 -04:00
#blobs=$blobs"|venus.*";
2018-02-11 23:50:18 -05:00
#[Verizon]
2019-08-26 14:36:48 -04:00
blobs = $blobs "|libmotricity.so|libakuaf.so" ;
2020-10-21 17:02:24 -04:00
blobs = $blobs "|com.qualcomm.location.vzw_library.jar|com.verizon.hardware.telephony.ehrpd.jar|com.verizon.hardware.telephony.lte.jar|com.verizon.ims.jar|VerizonUnifiedSettings.jar" ;
2020-10-20 07:20:40 -04:00
blobs = $blobs "|CarrierSetup.apk|OemDmTrigger.apk|appdirectedsmspermission.apk|AppDirectedSMSService.apk|AppDirectedSMSProxy.apk|VerizonSSOEngine.apk|VZWAPNLib.apk|vzwapnpermission.apk|VZWAPNService.apk|VZWAVS.apk|VzwLcSilent.apk|vzw_msdc_api.apk|VzwOmaTrigger.apk|VerizonAuthDialog.apk|MyVerizonServices.apk|WfcActivation.apk|obdm_stub.apk|QAS_DVC_MSP.*.apk|Showcase.apk|LLKAgent.apk" ;
2020-10-21 17:02:24 -04:00
blobs = $blobs "|com.android.vzwomatrigger.xml|vzw_mvs_permissions.xml|obdm_permissions.xml|com.verizon.services.xml|features-verizon.xml|com.qualcomm.location.vzw_library.xml|com.verizon.apn.xml|com.verizon.embms.xml|com.verizon.hardware.telephony.ehrpd.xml|com.verizon.hardware.telephony.lte.xml|com.verizon.ims.xml|com.verizon.provider.xml|com.vzw.vzwapnlib.xml|vzw_sso_permissions.xml|com.vzw.hardware.lte.xml|com.vzw.hardware.ehrpd.xml|verizon_config_params.txt|com.verizon.llkagent.xml|vzw_mvs_sysconfig.xml" ;
2018-02-11 23:50:18 -05:00
#Voice Recognition
2020-02-19 22:07:57 -05:00
blobs = $blobs "|liblistenhardware.so|liblistenjni.so|liblisten.so|liblistensoundmodel.*.so|libqvop-service.so|librecoglib.so|libsupermodel.so|libtrainingcheck.so" ;
#blobs=$blobs"|libadpcmdec.so|sound_trigger.primary.*.so|libgcs.*.so|libsmwrapper.so";
2019-03-23 17:33:39 -04:00
blobs = $blobs "|audiomonitor|qvop-daemon" ;
blobs = $blobs "|HotwordEnrollment.apk|HotwordEnrollment.*.apk" ;
2021-03-26 16:32:02 -04:00
#blobs=$blobs"|es305_fw.bin"; #XXX: breaks audio
2021-01-01 20:16:19 -05:00
#blobs=$blobs"|aonvr1.bin|aonvr2.bin"; #XXX: required by adspd, likely for more than VR
2019-03-23 17:33:39 -04:00
blobs = $blobs "|vendor.qti.voiceprint.*" ;
2021-08-03 21:31:34 -04:00
blobs = $blobs "|com.android.hotwordenrollment.*" ;
2020-02-19 22:07:57 -05:00
#makes=$makes"|android.hardware.soundtrigger.*|libsoundtriggerservice";
#makes=$makes"|sound_trigger_mixer_paths.xml|sound_trigger_platform_info.xml";
2018-02-11 23:50:18 -05:00
2020-10-20 07:20:40 -04:00
#Wi-Fi [Qualcomm]
2020-10-22 15:24:17 -04:00
#https://source.codeaurora.org/quic/la/platform/vendor/qcom-opensource/wigig/ [headers]
#https://source.codeaurora.org/quic/qsdk/oss/wigig-utils/ [useless]
2020-10-20 07:20:40 -04:00
blobs = $blobs "|wifilearner" ;
2020-10-22 15:24:17 -04:00
blobs = $blobs "|vendor.qti.hardware.wifi.wifilearner.*|vendor.qti.hardware.wigig.*" ;
2020-10-20 07:20:40 -04:00
blobs = $blobs "|libwigig_flashaccess.so|libwigig_pciaccess.so|libwigig_utils.so|libwigigsensing.so" ;
2020-10-22 15:24:17 -04:00
#Wfd (Wireless Display) [Qualcomm]
#https://source.codeaurora.org/quic/la/platform/vendor/qcom-opensource/wfd-commonsys/ [useless]
2020-10-20 07:20:40 -04:00
blobs = $blobs "|libmmparser_lite.so|libmmrtpdecoder.so|libmmrtpencoder.so|libmmwfdinterface.so|libmmwfdsinkinterface.so|libmmwfdsrcinterface.so|libwfdavenhancements.so|libwfdcommonutils.so|libwfdhdcpcp.so|libwfdmmsink.so|libwfdmmsrc.so|libwfdmmutils.so|libwfdnative.so|libwfdrtsp.so|libwfdservice.so|libwfdsm.so|libwfduibcinterface.so|libwfduibcsinkinterface.so|libwfduibcsink.so|libwfduibcsrcinterface.so|libwfduibcsrc.so|libwfdcommonutils_proprietary.so|libwfdhaldsmanager.so|libwfdmmservice.so|libwfdmodulehdcpsession.so|libwfdcodecv4l2.so|libwfdconfigutils.so|libwfdmminterface.so|libwfdclient.so|libwfdhdcpservice_proprietary.so" ;
blobs = $blobs "|wfdservice|wifidisplayhalservice|wfdhdcphalservice" ;
2019-03-23 17:33:39 -04:00
blobs = $blobs "|WfdService.apk" ;
blobs = $blobs "|WfdCommon.jar" ;
blobs = $blobs "|wfdconfigsink.xml|wfdconfig.xml" ;
2020-10-20 07:20:40 -04:00
blobs = $blobs "|com.qualcomm.qti.wifidisplayhal.*|vendor.qti.hardware.wifidisplaysession.*|android.hardware.drm@1.1-service.wfdhdcp.*" ;
2019-10-11 13:29:04 -04:00
makes = $makes "|WfdCommon" ;
2018-02-11 23:50:18 -05:00
#Widevine (DRM) [Google]
2019-03-23 17:33:39 -04:00
blobs = $blobs "|libdrmclearkeyplugin.so|libdrmwvmplugin.so|libmarlincdmplugin.so|libwvdrmengine.so|libwvdrm_L1.so|libwvdrm_L3.so|libwvhidl.so|libwvm.so|libWVphoneAPI.so|libWVStreamControlAPI_L1.so|libWVStreamControlAPI_L3.so|libdrmmtkutil.so|libsepdrm.*.so" ;
blobs = $blobs "|test-wvdrmplugin|oemwvtest" ;
blobs = $blobs "|com.google.widevine.software.drm.jar" ;
blobs = $blobs "|com.google.widevine.software.drm.xml" ;
2020-10-20 07:20:40 -04:00
#blobs=$blobs"|smc_pa_wvdrm.ift"; breaks maguro/toro* boot
2018-05-11 06:50:57 -04:00
blobs = $blobs "|tzwidevine.*|tzwvcpybuf.*|widevine.*" ;
2020-05-02 22:29:23 -04:00
makes = $makes "|libshim_wvm|move_widevine_data.sh" ;
2018-02-11 23:50:18 -05:00
#WiPower (Wireless Charging) [Qualcomm]
2019-03-23 17:33:39 -04:00
blobs = $blobs "|libwbc_jni.so|wbc_hal.default.so" ;
blobs = $blobs "|a4wpservice.apk|com.quicinc.wbcserviceapp.apk" ;
blobs = $blobs "|com.quicinc.wbc.jar|com.quicinc.wbcservice.jar" ;
blobs = $blobs "|com.quicinc.wbcservice.xml|com.quicinc.wbc.xml" ;
2018-02-11 23:50:18 -05:00
makes = $makes "|android.wipower|android.wipower.xml|com.quicinc.wbcserviceapps|libwipower_jni|wipowerservice" ;
export blobs;
export makes;
export overlay;
2018-08-24 18:35:53 -04:00
export ipcSec;
2018-02-11 23:50:18 -05:00
export kernels;
2018-06-16 18:41:22 -04:00
export sepolicy;
2018-02-11 23:50:18 -05:00
#
#END OF BLOBS ARRAY
#
#
#START OF FUNCTIONS
#
deblobDevice( ) {
2019-09-17 00:55:50 -04:00
local devicePath = " $1 " ;
2018-06-29 00:55:21 -04:00
cd " $DOS_BUILD_BASE $devicePath " ;
2019-09-17 00:55:50 -04:00
if [ " $DOS_DEBLOBBER_REPLACE_TIME " = false ] ; then local replaceTime = "false" ; fi ; #Disable Time replacement
if ! grep -qi "qcom" BoardConfig*.mk; then local replaceTime = "false" ; fi ; #Disable Time Replacement
2018-02-11 23:50:18 -05:00
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
2018-06-25 07:59:24 -04:00
#sed -i '/ALL_DEFAULT_INSTALLED_MODULES/s/$(CMN_SYMLINKS)//' Android.mk; #Remove CMN firmware
2018-02-11 23:50:18 -05:00
sed -i '/ALL_DEFAULT_INSTALLED_MODULES/s/$(DXHDCP2_SYMLINKS)//' Android.mk; #Remove Discretix firmware
2018-06-29 00:55:21 -04:00
if [ " $DOS_DEBLOBBER_REMOVE_IMS " = true ] ; then sed -i '/ALL_DEFAULT_INSTALLED_MODULES/s/$(IMS_SYMLINKS)//' Android.mk; fi ; #Remove IMS firmware
2018-02-11 23:50:18 -05:00
sed -i '/ALL_DEFAULT_INSTALLED_MODULES/s/$(PLAYREADY_SYMLINKS)//' Android.mk; #Remove Microsoft Playready firmware
sed -i '/ALL_DEFAULT_INSTALLED_MODULES/s/$(WIDEVINE_SYMLINKS)//' Android.mk; #Remove Google Widevine firmware
sed -i '/ALL_DEFAULT_INSTALLED_MODULES/s/$(WV_SYMLINKS)//' Android.mk; #Remove Google Widevine firmware
fi ;
2020-02-19 22:07:57 -05:00
if [ -f BoardConfig.mk ] ; then
2018-02-11 23:50:18 -05:00
if [ -z " $replaceTime " ] ; then
2020-02-19 22:07:57 -05:00
sed -i 's/BOARD_USES_QC_TIME_SERVICES := true/BOARD_USES_QC_TIME_SERVICES := false/' BoardConfig*.mk & >/dev/null || true; #Switch to Sony TimeKeep
2018-02-11 23:50:18 -05:00
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 ;
2018-06-30 19:52:46 -04:00
if [ " $DOS_DEBLOBBER_REMOVE_GRAPHICS " = true ] ; then
#sed -i 's/USE_OPENGL_RENDERER := true/USE_OPENGL_RENDERER := false/' BoardConfig.mk;
#if ! grep -q "USE_OPENGL_RENDERER := false" BoardConfig.mk; then echo "USE_OPENGL_RENDERER := false" >> BoardConfig.mk; fi;
if ! grep -q "USE_OPENGL_RENDERER := true" BoardConfig.mk; then echo "USE_OPENGL_RENDERER := true" >> BoardConfig.mk; fi ;
fi ;
2020-02-19 22:07:57 -05:00
fi ;
2020-11-02 19:13:32 -05:00
if [ " $DOS_DEBLOBBER_REMOVE_CNE " = true ] ; then sed -i 's/BOARD_USES_QCNE := true/BOARD_USES_QCNE := false/' BoardConfig*.mk & >/dev/null || true; fi ; #Disable CNE
2020-02-19 22:07:57 -05:00
sed -i 's/BOARD_USES_WIPOWER := true/BOARD_USES_WIPOWER := false/' BoardConfig*.mk & >/dev/null || true; #Disable WiPower
sed -i 's/TARGET_HAS_HDR_DISPLAY := true/TARGET_HAS_HDR_DISPLAY := false/' BoardConfig*.mk & >/dev/null || true; #Disable HDR
2021-01-18 09:11:37 -05:00
sed -i 's/BOARD_SUPPORTS_SOUND_TRIGGER := true/BOARD_SUPPORTS_SOUND_TRIGGER := false/' BoardConfig*.mk & >/dev/null || true; #Disable Sound Trigger
sed -i 's/BOARD_SUPPORTS_SOUND_TRIGGER_HAL := true/BOARD_SUPPORTS_SOUND_TRIGGER_HAL := false/' BoardConfig*.mk & >/dev/null || true;
sed -i 's/BOARD_SUPPORTS_SOUND_TRIGGER_5514 := true/BOARD_SUPPORTS_SOUND_TRIGGER_5514 := false/' BoardConfig*.mk & >/dev/null || true;
2020-02-19 22:07:57 -05:00
sed -i 's/AUDIO_FEATURE_ENABLED_DS2_DOLBY_DAP := true/AUDIO_FEATURE_ENABLED_DS2_DOLBY_DAP := false/' BoardConfig*.mk & >/dev/null || true; #Disable Dolby
sed -i 's/BOARD_ANT_WIRELESS_DEVICE := true/BOARD_ANT_WIRELESS_DEVICE := false/' BoardConfig*.mk & >/dev/null || true; #Disable ANT
2020-02-23 20:51:13 -05:00
awk -i inplace '!/BOARD_ANT_WIRELESS_DEVICE/' BoardConfig*.mk & >/dev/null || true;
2020-02-19 22:07:57 -05:00
if [ " $DOS_DEBLOBBER_REMOVE_RENDERSCRIPT " = true ] || [ " $DOS_DEBLOBBER_REMOVE_GRAPHICS " = true ] ; then
2020-02-23 20:51:13 -05:00
awk -i inplace '!/RS_DRIVER/' BoardConfig*.mk & >/dev/null || true;
2018-02-11 23:50:18 -05:00
fi ;
if [ -f device.mk ] ; then
if [ -z " $replaceTime " ] ; then
2018-06-30 19:52:46 -04:00
echo "PRODUCT_PACKAGES += timekeep TimeKeep" >> device.mk; #Switch to Sony TimeKeep
fi ;
if [ " $DOS_DEBLOBBER_REMOVE_GRAPHICS " = true ] ; then
2018-06-30 23:42:40 -04:00
echo "PRODUCT_PACKAGES += libyuv libEGL_swiftshader libGLESv1_CM_swiftshader libGLESv2_swiftshader" >> device.mk; #Build SwiftShader
2018-02-11 23:50:18 -05:00
fi ;
fi ;
2019-09-17 00:55:50 -04:00
local baseDirTmp = ${ PWD ##*/ } ;
local suffixTmp = "-common" ;
2018-02-11 23:50:18 -05:00
if [ -f " ${ PWD ##*/ } " .mk ] && [ " ${ PWD ##*/ } " .mk != "sepolicy" ] ; then
if [ -z " $replaceTime " ] ; then
2018-06-30 19:52:46 -04:00
echo "PRODUCT_PACKAGES += timekeep TimeKeep" >> " ${ PWD ##*/ } " .mk; #Switch to Sony TimeKeep
fi ;
if [ " $DOS_DEBLOBBER_REMOVE_GRAPHICS " = true ] ; then
2018-06-30 23:42:40 -04:00
echo "PRODUCT_PACKAGES += libyuv libEGL_swiftshader libGLESv1_CM_swiftshader libGLESv2_swiftshader" >> " ${ PWD ##*/ } " .mk; #Build SwiftShader
2018-02-11 23:50:18 -05:00
fi ;
fi ;
2020-02-19 22:07:57 -05:00
2021-01-18 07:11:54 -05:00
awk -i inplace '!/loc.nlp_name/' *.prop *.mk & >/dev/null || true; #Disable QC Location Provider
sed -i 's/drm.service.enabled=true/drm.service.enabled=false/' *.prop *.mk & >/dev/null || true;
sed -i 's/bt.enableAptXHD=true/bt.enableAptXHD=false/' *.prop *.mk & >/dev/null || true; #Disable aptX
if [ " $DOS_DEBLOBBER_REMOVE_CNE " = true ] ; then sed -i 's/cne.feature=./cne.feature=0/' *.prop *.mk & >/dev/null || true; fi ; #Disable CNE
2021-01-29 20:37:43 -05:00
sed -i 's/dpm.feature=11/dpm.feature=0/' *.prop *.mk & >/dev/null || true; #Disable DPM
2021-05-29 17:29:36 -04:00
sed -i 's/dpm.feature=./dpm.feature=0/' *.prop *.mk & >/dev/null || true; #Disable DPM
2021-01-18 07:11:54 -05:00
sed -i 's/gps.qc_nlp_in_use=./gps.qc_nlp_in_use=0/' *.prop *.mk & >/dev/null || true; #Disable QC Location Provider
sed -i 's/sys.dpmd.nsrm=./sys.dpmd.nsrm=0/' *.prop *.mk & >/dev/null || true; #Disable DPM
sed -i 's/bluetooth.emb_wp_mode=true/bluetooth.emb_wp_mode=false/' *.prop *.mk & >/dev/null || true; #Disable WiPower
sed -i 's/bluetooth.wipower=true/bluetooth.wipower=false/' *.prop *.mk & >/dev/null || true; #Disable WiPower
2021-01-29 20:37:43 -05:00
sed -i 's/wfd.enable=1/wfd.enable=0/' *.prop *.mk & >/dev/null || true; #Disable Wi-Fi display
2018-02-11 23:50:18 -05:00
if [ -f system.prop ] ; then
if ! grep -q "drm.service.enabled=false" system.prop; then echo "drm.service.enabled=false" >> system.prop; fi ; #Disable DRM server
2018-06-30 23:42:40 -04:00
if [ " $DOS_DEBLOBBER_REMOVE_GRAPHICS " = true ] ; then
2021-01-18 07:11:54 -05:00
echo "sys.ui.hw=disable" >> system.prop;
#echo "graphics.gles20.disable_on_bootanim=1" >> system.prop;
2018-07-09 16:04:09 -04:00
echo "debug.sf.nobootanimation=1" >> system.prop;
2021-01-18 07:11:54 -05:00
sed -i 's/opengles.version=.*/opengles.version=131072/' system.prop;
2018-06-30 23:42:40 -04:00
fi ;
2020-02-19 22:07:57 -05:00
fi
#Disable IMS
if [ " $DOS_DEBLOBBER_REMOVE_IMS " = true ] ; then
2021-01-18 07:11:54 -05:00
sed -i 's/ims.volte=true/ims.volte=false/' *.prop *.mk & >/dev/null || true;
sed -i 's/ims.vt=true/ims.vt=false/' *.prop *.mk & >/dev/null || true;
sed -i 's/radio.calls.on.ims=true/radio.calls.on.ims=false/' *.prop *.mk & >/dev/null || true;
sed -i 's/radio.calls.on.ims=1/radio.calls.on.ims=0/' *.prop *.mk & >/dev/null || true;
sed -i 's/radio.hw_mbn_update=./radio.hw_mbn_update=0/' *.prop *.mk & >/dev/null || true;
sed -i 's/radio.jbims=./radio.jbims=0/' *.prop *.mk & >/dev/null || true;
sed -i 's/radio.sw_mbn_update=./radio.sw_mbn_update=0/' *.prop *.mk & >/dev/null || true;
sed -i 's/radio.sw_mbn_volte=./radio.sw_mbn_volte=0/' *.prop *.mk & >/dev/null || true;
sed -i 's/radio.VT_ENABLE=./radio.VT_ENABLE=0/' *.prop *.mk & >/dev/null || true;
sed -i 's/radio.VT_HYBRID_ENABLE=./radio.VT_HYBRID_ENABLE=0/' *.prop *.mk & >/dev/null || true;
sed -i 's/volte_enabled_by_hw=./volte_enabled_by_hw=0/' *.prop *.mk & >/dev/null || true;
sed -i 's/dbg.ims_volte_enable=./dbg.ims_volte_enable=0/' *.prop *.mk & >/dev/null || true;
sed -i 's/dbg.volte_avail_ovr=1/dbg.volte_avail_ovr=0/' *.prop *.mk & >/dev/null || true;
sed -i 's/dbg.vt_avail_ovr=1/dbg.vt_avail_ovr=0/' *.prop *.mk & >/dev/null || true;
fi ;
if [ " $DOS_DEBLOBBER_REMOVE_IMS " = true ] || [ " $DOS_DEBLOBBER_REMOVE_CNE " = true ] ; then
sed -i 's/data.iwlan.enable=true/data.iwlan.enable=false/' *.prop *.mk & >/dev/null || true;
sed -i 's/dbg.wfc_avail_ovr=1/dbg.wfc_avail_ovr=0/' *.prop *.mk & >/dev/null || true;
2018-02-11 23:50:18 -05:00
fi ;
2020-10-21 17:02:24 -04:00
if [ " $DOS_DEBLOBBER_REMOVE_IMS " = true ] || [ " $DOS_DEBLOBBER_REMOVE_RCS " = true ] ; then
2021-01-18 07:11:54 -05:00
sed -i 's/rcs.supported=./rcs.supported=0/' *.prop *.mk & >/dev/null || true; #Disable RCS
2020-10-21 17:02:24 -04:00
fi ;
2018-02-11 23:50:18 -05:00
if [ -f configs/qmi_config.xml ] ; then
sed -i 's|name="dpm_enabled" type="int"> 1 <|name="dpm_enabled" type="int"> 0 <|' configs/qmi_config.xml; #Disable DPM
fi ;
if [ -f init/init_*.cpp ] ; then
#Disable IMS
2018-06-29 00:55:21 -04:00
if [ " $DOS_DEBLOBBER_REMOVE_IMS " = true ] ; then
2020-02-19 22:07:57 -05:00
sed -i 's/property_set("persist.ims.volte", "true");/property_set("persist.ims.volte", "false");/' init/init_*.cpp;
sed -i 's/property_set("persist.ims.vt", "true");/property_set("persist.ims.vt", "false");/' init/init_*.cpp;
sed -i 's/property_set("persist.radio.calls.on.ims", "true");/property_set("persist.radio.calls.on.ims", "false");/' init/init_*.cpp;
sed -i 's/property_set("persist.radio.jbims", ".");/property_set("persist.radio.jbims", "0");/' init/init_*.cpp;
sed -i 's/property_set("persist.radio.VT_ENABLE", ".");/property_set("persist.radio.VT_ENABLE", "0");/' init/init_*.cpp;
sed -i 's/property_set("persist.radio.VT_HYBRID_ENABLE", ".");/property_set("persist.radio.VT_HYBRID_ENABLE", "0");/' init/init_*.cpp;
2018-06-13 07:07:47 -04:00
fi ;
2020-10-21 17:02:24 -04:00
if [ " $DOS_DEBLOBBER_REMOVE_IMS " = true ] || [ " $DOS_DEBLOBBER_REMOVE_RCS " = true ] ; then
sed -i 's/property_set("persist.rcs.supported", ".");/property_set("persist.rcs.supported", "0");/' init/init_*.cpp; #Disable RCS
fi ;
2018-02-11 23:50:18 -05:00
fi ;
if [ -f overlay/frameworks/base/core/res/res/values/config.xml ] ; then
awk -i inplace '!/' $overlay '/' overlay/frameworks/base/core/res/res/values/config.xml;
2020-02-19 22:07:57 -05:00
sed -i 's|<bool name="config_enableWifiDisplay">true</bool>|<bool name="config_enableWifiDisplay">false</bool>|' overlay/frameworks/base/core/res/res/values/config.xml;
2018-02-11 23:50:18 -05:00
sed -i 's|<bool name="config_uiBlurEnabled">true</bool>|<bool name="config_uiBlurEnabled">false</bool>|' overlay/frameworks/base/core/res/res/values/config.xml; #Disable UIBlur
#Disable IMS
2018-06-29 00:55:21 -04:00
if [ " $DOS_DEBLOBBER_REMOVE_IMS " = true ] ; then
2020-02-19 22:07:57 -05:00
sed -i 's|<bool name="config_carrier_volte_available">true</bool>|<bool name="config_carrier_volte_available">false</bool>|' overlay/frameworks/base/core/res/res/values/config.xml;
sed -i 's|<bool name="config_carrier_vt_available">true</bool>|<bool name="config_carrier_vt_available">false</bool>|' overlay/frameworks/base/core/res/res/values/config.xml;
sed -i 's|<bool name="config_device_volte_available">true</bool>|<bool name="config_device_volte_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_dynamic_bind_ims">true</bool>|<bool name="config_dynamic_bind_ims">false</bool>|' overlay/frameworks/base/core/res/res/values/config.xml;
awk -i inplace '!/config_ims_package/' overlay/frameworks/base/core/res/res/values/config.xml;
2018-06-13 07:07:47 -04:00
fi ;
2021-01-18 07:11:54 -05:00
if [ " $DOS_DEBLOBBER_REMOVE_IMS " = true ] || [ " $DOS_DEBLOBBER_REMOVE_CNE " = true ] ; then
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_carrier_wfc_ims_available">true</bool>|<bool name="config_carrier_wfc_ims_available">false</bool>|' overlay/frameworks/base/core/res/res/values/config.xml;
fi ;
2018-02-11 23:50:18 -05:00
fi ;
2020-10-22 15:24:17 -04:00
if [ -f overlay/packages/services/Telephony/res/values/config.xml ] ; then
awk -i inplace '!/platform_carrier_config_package/' overlay/packages/services/Telephony/res/values/config.xml;
fi ;
2018-02-11 23:50:18 -05:00
if [ -d sepolicy ] ; then
if [ -z " $replaceTime " ] ; then
2018-07-20 20:06:36 -04:00
numfiles = ( *) ; numfiles = ${# numfiles [@] } ;
2021-01-18 07:11:54 -05:00
if [ " $numfiles " -gt "5" ] ; then #only if device doesn't use a common sepolicy dir
2020-10-20 05:24:09 -04:00
#Switch to Sony TimeKeep
#Credit: @aviraxp
#Reference: https://github.com/LineageOS/android_device_oneplus_oneplus2/commit/3b152a3c1198d795de4175e6b9927493caf01bf0
echo "/sys/devices/soc\.0/qpnp-rtc-8/rtc/rtc0(/.*)? u:object_r:sysfs_rtc:s0" >> sepolicy/file_contexts;
echo "/(system/vendor|vendor)/bin/timekeep u:object_r:timekeep_exec:s0" >> sepolicy/file_contexts;
echo "type vendor_timekeep_prop, property_type;" >> sepolicy/property.te;
echo "persist.vendor.timeadjust u:object_r:vendor_timekeep_prop:s0" >> sepolicy/property_contexts;
echo "user=system seinfo=platform name=com.sony.timekeep domain=timekeep_app type=app_data_file" >> sepolicy/seapp_contexts;
2021-06-14 16:43:04 -04:00
cp " $DOS_PATCHES_COMMON /android_timekeep_sepolicy/timekeep.te " sepolicy/;
cp " $DOS_PATCHES_COMMON /android_timekeep_sepolicy/timekeep_app.te " sepolicy/;
2018-07-20 20:06:36 -04:00
fi ;
2018-02-11 23:50:18 -05:00
fi ;
fi ;
2018-07-20 20:06:36 -04:00
if [ -z " $replaceTime " ] ; then #Switch to Sony TimeKeep
2020-10-20 05:24:09 -04:00
#sed -i 's|service time_daemon /system/bin/time_daemon|service time_daemon /system/bin/timekeep restore\n oneshot|' init.*.rc rootdir/init.*.rc rootdir/etc/init.*.rc &> /dev/null || true;
awk -i inplace '!|mkdir /data/time/ 0700 system system|' init.*.rc rootdir/init.*.rc rootdir/etc/init.*.rc & > /dev/null || true;
2018-07-20 20:06:36 -04:00
fi ;
2020-11-02 19:13:32 -05:00
if [ " $DOS_DEBLOBBER_REMOVE_CNE " = true ] ; then rm -f board/qcom-cne.mk product/qcom-cne.mk; fi ; #Remove CNE
if [ " $DOS_DEBLOBBER_REMOVE_IMS " = true ] ; then
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
fi ;
2020-02-17 18:06:39 -05:00
rm -rf ifaa org.ifaa.android.manager; #Remove AliPay
2018-08-24 18:35:53 -04:00
if [ " $DOS_DEBLOBBER_REMOVE_IPA " = true ] ; then rm -rf data-ipa-cfg-mgr; fi ; #Remove IPA
2021-09-06 04:18:27 -04:00
rm -rf libshim_wvm libshimwvm libshims/wvm_shim.cpp; #Remove Google Widevine compatibility module
2018-02-11 23:50:18 -05:00
rm -rf board/qcom-wipower.mk product/qcom-wipower.mk; #Remove WiPower makefiles
2020-02-19 22:07:57 -05:00
#awk -i inplace '!/'$ipcSec'/' configs/sec_config &>/dev/null || true; #Remove all IPC security exceptions from sec_config
2018-09-21 16:32:02 -04:00
awk -i inplace '!/' $blobs '/' ./*proprietary*.txt & >/dev/null || true; #Remove all blob references from blob manifest
2019-03-21 17:13:26 -04:00
awk -i inplace '!/' $blobs '/' ./*/*proprietary*.txt & >/dev/null || true; #Remove all blob references from blob manifest location in subdirectory
2018-02-11 23:50:18 -05:00
if [ -f setup-makefiles.sh ] ; then
2018-06-29 00:55:21 -04:00
bash -c " cd $DOS_BUILD_BASE $devicePath && ./setup-makefiles.sh " ; #Update the makefiles
2018-02-11 23:50:18 -05:00
fi ;
2018-06-29 00:55:21 -04:00
cd " $DOS_BUILD_BASE " ;
2018-02-11 23:50:18 -05:00
}
export -f deblobDevice;
deblobKernel( ) {
2019-09-17 00:55:50 -04:00
local kernelPath = " $1 " ;
2018-06-29 00:55:21 -04:00
cd " $DOS_BUILD_BASE $kernelPath " ;
2018-06-23 01:08:42 -04:00
rm -rf $kernels ;
2018-06-29 00:55:21 -04:00
cd " $DOS_BUILD_BASE " ;
2018-02-11 23:50:18 -05:00
}
export -f deblobKernel;
2018-06-16 18:41:22 -04:00
deblobSepolicy( ) {
2019-09-17 00:55:50 -04:00
local sepolicyPath = " $1 " ;
2018-06-29 00:55:21 -04:00
cd " $DOS_BUILD_BASE $sepolicyPath " ;
2018-06-16 18:41:22 -04:00
if [ -d sepolicy ] ; then
cd sepolicy;
2018-06-23 01:08:42 -04:00
rm -f $sepolicy ;
2018-06-16 18:41:22 -04:00
fi ;
2018-06-29 00:55:21 -04:00
cd " $DOS_BUILD_BASE " ;
2018-06-16 18:41:22 -04:00
}
export -f deblobSepolicy;
2018-02-11 23:50:18 -05:00
deblobVendors( ) {
2018-06-29 00:55:21 -04:00
cd " $DOS_BUILD_BASE " ;
2018-06-23 01:08:42 -04:00
find vendor -regextype posix-extended -regex '.*(' $blobs ')' -type f -delete; #Delete all blobs
2018-02-11 23:50:18 -05:00
}
export -f deblobVendors;
2021-04-04 17:06:47 -04:00
deblobVendorMk( ) {
2019-09-17 00:55:50 -04:00
local makefile = " $1 " ;
2018-06-29 00:55:21 -04:00
cd " $DOS_BUILD_BASE " ;
2018-06-23 01:08:42 -04:00
awk -i inplace '!/' $blobs '/' " $makefile " ; #Remove all blob references from makefile
2018-02-11 23:50:18 -05:00
}
2021-04-04 17:06:47 -04:00
export -f deblobVendorMk;
deblobVendorBp( ) {
local bpfile = " $1 " ;
cd " $DOS_BUILD_BASE " ;
#TODO: remove these lines instead
sed -i -E "s/apk.*(" $blobs ").*/apk: \"proprietary\/priv-app\/qcrilmsgtunnel\/qcrilmsgtunnel.apk\", enabled: false,/g" " $bpfile " ;
sed -i -E "s/jars.*(" $blobs ").*/jars: \[\"proprietary\/system\/framework\/qcrilhook.jar\"\], enabled: false,/g" " $bpfile " ;
sed -i -E "s/srcs.*(" $blobs ").*/srcs: \[\"proprietary\/vendor\/lib\/libtime_genoff.so\"\], enabled: false,/g" " $bpfile " ;
#TODO make this work for more then these two blobs
#Credit: https://stackoverflow.com/a/26053127
sed -i ':a;N;s/\n/&/3;Ta;/manifest_android.hardware.drm@1.3-service.widevine.xml/!{P;D};:b;N;s/\n/&/8;Tb;d' " $bpfile " ;
sed -i ':a;N;s/\n/&/3;Ta;/vendor.qti.hardware.radio.atcmdfwd@1.0.xml/!{P;D};:b;N;s/\n/&/8;Tb;d' " $bpfile " ;
}
export -f deblobVendorBp;
2018-02-11 23:50:18 -05:00
#
#END OF FUNCTIONS
#
#
#START OF DEBLOBBING
#
2019-08-05 20:53:50 -04:00
find build -name "*.mk" -type f -print0 | xargs -0 -n 1 -P 8 -I { } bash -c 'awk -i inplace "!/$makes/" "{}"' ; #Deblob all makefiles
2019-08-05 23:56:52 -04:00
find device -maxdepth 2 -mindepth 2 -type d -exec bash -c 'deblobDevice "$0"' { } \; ; #Deblob all device directories
2021-08-09 18:02:39 -04:00
find device -name "*.mk" -type f -print0 | xargs -0 -n 1 -P 8 -I { } bash -c 'awk -i inplace "!/$makes/" "{}"' ; #Deblob all makefiles
2020-10-20 07:20:40 -04:00
#find device -maxdepth 3 -mindepth 2 -type d -print0 | xargs -0 -n 1 -P 8 -I {} bash -c 'deblobSepolicy "{}"'; #Deblob all device sepolicy directories XXX: Breaks builds when other sepolicy files reference deleted ones
#find kernel -maxdepth 2 -mindepth 2 -type d -print0 | xargs -0 -n 1 -P 8 -I {} bash -c 'deblobKernel "{}"'; #Deblob all kernel directories
2021-04-04 17:06:47 -04:00
find vendor -name "*endor*.mk" -type f -print0 | xargs -0 -n 1 -P 8 -I { } bash -c 'deblobVendorMk "{}"' ; #Deblob all makefiles
find vendor -name "Android.bp" -type f -print0 | xargs -0 -n 1 -P 8 -I { } bash -c 'deblobVendorBp "{}"' ; #Deblob all makefiles
2018-02-11 23:50:18 -05:00
deblobVendors; #Deblob entire vendor directory
2018-05-15 17:45:22 -04:00
rm -rf frameworks/av/drm/mediadrm/plugins/clearkey; #Remove ClearKey
2018-02-11 23:50:18 -05:00
rm -rf vendor/samsung/nodevice;
#
#END OF DEBLOBBING
#
2018-06-29 00:55:21 -04:00
cd " $DOS_BUILD_BASE " ;
2018-02-11 23:50:18 -05:00
2020-08-29 16:03:11 -04:00
echo "Deblobbing complete!" ;