From 36fabeca42d1349f0d5df0d1f80b8bd3c14ab5e7 Mon Sep 17 00:00:00 2001 From: Tad Date: Thu, 28 Apr 2022 22:43:09 -0400 Subject: [PATCH] Deblob manifest.xml Reverts 766219aa Fixes https://github.com/Divested-Mobile/DivestOS-Build/issues/55 Signed-off-by: Tad --- Scripts/Common/Deblob.sh | 32 ++++++++++++++++++++++++++++---- Scripts/Common/Functions.sh | 4 +++- Scripts/init.sh | 2 -- 3 files changed, 31 insertions(+), 7 deletions(-) diff --git a/Scripts/Common/Deblob.sh b/Scripts/Common/Deblob.sh index 7fb4ad7b..0de215df 100644 --- a/Scripts/Common/Deblob.sh +++ b/Scripts/Common/Deblob.sh @@ -30,6 +30,7 @@ echo "Deblobbing..."; #WARNING: STRAY DELIMITERS WILL RESULT IN FILE DELETIONS blobs=""; #Delimited using "|" makes=""; + manifests=""; overlay="invalid_placeholder_aekiekan"; ipcSec=""; kernels=""; #Delimited using " " @@ -50,6 +51,7 @@ echo "Deblobbing..."; blobs=$blobs"|IFAAService.apk"; blobs=$blobs"|vendor.oneplus.hardware.ifaa.*"; makes=$makes"org.ifaa.android.manager"; + manifests="mlipay|hardware.ifaa"; #AIV (DRM) [Amazon] blobs=$blobs"|libaivdrmclient.so|libAivPlay.so"; @@ -58,6 +60,7 @@ echo "Deblobbing..."; blobs=$blobs"|libantradio.so"; #blobs=$blobs"|com.qualcomm.qti.ant.*"; makes=$makes"|AntHalService|com.dsi.ant.antradio_library"; + manifests=$manifests"|AntHci"; #aptX (Bluetooth Audio Compression Codec) [Qualcomm] if [ "$DOS_DEBLOBBER_REMOVE_APTX" = true ]; then @@ -73,6 +76,7 @@ echo "Deblobbing..."; blobs=$blobs"|vendor.qti.atcmdfwd.*|vendor.qti.hardware.radio.atcmdfwd.*"; blobs=$blobs"|atfwd.apk"; sepolicy=$sepolicy" atfwd.te"; + manifests=$manifests"|AtCmdFwd"; fi; #AudioFX (Audio Effects) @@ -87,8 +91,9 @@ echo "Deblobbing..."; fi; #Clearkey (DRM) [Google] - blobs=$blobs"|libdrmclearkeyplugin.so"; #prebuilt - #makes=$makes"|android.hardware.drm.*clearkey.*|libdrmclearkeyplugin"; #from source XXX: Breaks some Chromium forks + blobs=$blobs"|libdrmclearkeyplugin.so"; + makes=$makes"|android.hardware.drm.*clearkey.*|libdrmclearkeyplugin"; + manifests=$manifests"|clearkey"; #CMN (?) [?] #blobs=$blobs"|cmnlib.*"; @@ -105,6 +110,7 @@ echo "Deblobbing..."; overlay=$overlay"|config_wlan_data_service_package|config_wlan_network_service_package|config_qualified_networks_service_package"; #makes=$makes"|libcnefeatureconfig"; XXX: breaks radio sepolicy=$sepolicy" cnd.te qcneservice.te"; + manifests=$manifests"|com.quicinc.cne|iwlan"; fi; #CPPF (DRM) [?] @@ -156,6 +162,7 @@ echo "Deblobbing..."; blobs=$blobs"|com.qualcomm.qti.dpm.*"; sepolicy=$sepolicy" dpmd.te"; ipcSec=$ipcSec"|47:4294967295:1001:3004|48:4294967295:1000:3004"; + manifests=$manifests"|dpmQmiService"; fi; #DRM @@ -171,10 +178,12 @@ echo "Deblobbing..."; #blobs=$blobs"|libtpa_core.so|libdataencrypt_tpa.so|libpkip.so"; #OMAP SMC blobs=$blobs"|vendor.oneplus.hardware.drmkey.*|bin[/]hw[/]vendor.oneplus.hardware.hdcpkey.*|etc[/]init[/]vendor.oneplus.hardware.hdcpkey.*"; #OnePlus #blobs=$blobs"|vendor.oneplus.hardware.hdcpkey.*.so"; #XXX: Breaks radio, linked by libril-qc-hal-qmi.so + #manifests=$manifests"|OneplusHdcpKey"; blobs=$blobs"|smc_pa.ift|drmserver.samsung"; #Samsung blobs=$blobs"|provision_device"; #blobs=$blobs"|libasfparser.so|libsavsff.so"; #Parsers - #makes=$makes"|android.hardware.drm.*"; + makes=$makes"|android.hardware.drm.*"; + manifests=$manifests"|android.hardware.drm"; #makes=$makes"|libdrmframework.*"; #necessary to compile #makes=$makes"|mediadrmserver|com.android.mediadrm.signer.*|drmserver"; #Works but causes long boot times #sepolicy=$sepolicy" drmserver.te mediadrmserver.te"; @@ -184,6 +193,7 @@ echo "Deblobbing..."; blobs=$blobs"|embms.apk"; blobs=$blobs"|embms.xml"; blobs=$blobs"|embmslibrary.jar"; + manifests=$manifests"|embms"; #External Accessories if [ "$DOS_DEBLOBBER_REMOVE_ACCESSORIES" = true ]; then @@ -285,6 +295,7 @@ echo "Deblobbing..."; blobs=$blobs"|hdcp2xtest.srm"; blobs=$blobs"|hdcp1.*|hdcp2.*|tzhdcp.*"; makes=$makes"|android.hardware.drm.*hdcp.*"; + manifests=$manifests"|HDCPSession"; #HDR blobs=$blobs"|libdovi.so"; @@ -292,6 +303,7 @@ echo "Deblobbing..."; #blobs=$blobs"|libhdr_tm.so"; #XXX: potential breakage blobs=$blobs"|DolbyVisionService.apk"; blobs=$blobs"|dolby_vision.cfg|hdr_tm_config.xml"; + manifests=$manifests"|dolby.hardware.dms"; #I/O Prefetcher [Qualcomm] #blobs=$blobs"|libqc-opt.so"; #Can break camera in some cases @@ -299,6 +311,7 @@ echo "Deblobbing..."; blobs=$blobs"|bin[/]iop"; blobs=$blobs"|QPerformance.jar"; blobs=$blobs"|vendor.qti.hardware.iop.*"; + manifests=$manifests"|hardware.iop"; #IMS (VoLTE/Wi-Fi Calling) [Qualcomm] if [ "$DOS_DEBLOBBER_REMOVE_IMS" = true ]; then @@ -320,6 +333,7 @@ echo "Deblobbing..."; makes=$makes"|ims-ext-common"; sepolicy=$sepolicy" ims.te imscm.te imswmsproxy.te"; ipcSec=$ipcSec"|32:4294967295:1001"; + manifests=$manifests"|qti.ims|radio.ims"; fi; if [ "$DOS_DEBLOBBER_REMOVE_IMS" = true ] || [ "$DOS_DEBLOBBER_REMOVE_RCS" = true ]; then #RCS (Proprietary messaging protocol) @@ -331,6 +345,7 @@ echo "Deblobbing..."; blobs=$blobs"|RCSBootstraputil.apk|RcsImsBootstraputil.apk|uceShimService.apk"; #blobs=$blobs"|vendor.qti.ims.rcsconfig.*"; blobs=$blobs"|com.qualcomm.qti.uceservice.*"; + manifests=$manifests"|uceservice"; makes=$makes"|rcs_service.*"; ipcSec=$ipcSec"|18:4294967295:1001:3004"; fi; @@ -451,6 +466,7 @@ echo "Deblobbing..."; blobs=$blobs"|PR-ModelCert"; blobs=$blobs"|playread.*|hcheck.*"; makes=$makes"|android.hardware.drm.*playready.*"; + manifests=$manifests"|playready"; #Power [Google] blobs=$blobs"|LowPowerMonitorDevice.*.jar|PowerAnomaly.*.jar"; @@ -481,10 +497,12 @@ echo "Deblobbing..."; blobs=$blobs"|libHealthAuthClient.so|libHealthAuthJNI.so|libSampleAuthJNI.so|libSampleAuthJNIv1.so|libSampleExtAuthJNI.so|libSecureExtAuthJNI.so|libSecureSampleAuthClient.so"; #blobs=$blobs"|libsdedrm.so"; #Direct Rendering Manager not evil DRM? #XXX: potential breakage blobs=$blobs"|vendor.qti.hardware.tui.*"; + manifests=$manifests"|tui_comm|trustedui"; #Soter (Biometric Auth) [Tencent] blobs=$blobs"|SoterService.apk"; blobs=$blobs"|vendor.qti.hardware.soter.*"; + manifests=$manifests"|ISoter|hardware.soter"; #[Sprint] blobs=$blobs"|CQATest.apk|GCS.apk|HiddenMenu.apk|HiddenMenuLight.apk|LifetimeData.apk|SprintHM.apk|LifeTimerService.apk|SecPhone.apk|SprintMenu.apk"; @@ -513,6 +531,7 @@ echo "Deblobbing..."; #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"; + #manifests=$manifests"|improvetouch"; #Venus (Hardware Video Decoding) [Qualcomm] #blobs=$blobs"|venus.*"; @@ -541,6 +560,7 @@ echo "Deblobbing..."; blobs=$blobs"|wifilearner"; blobs=$blobs"|vendor.qti.hardware.wifi.wifilearner.*|vendor.qti.hardware.wigig.*"; blobs=$blobs"|libwigig_flashaccess.so|libwigig_pciaccess.so|libwigig_utils.so|libwigigsensing.so"; + manifests=$manifests"|wifilearner"; #Wfd (Wireless Display) [Qualcomm] #https://source.codeaurora.org/quic/la/platform/vendor/qcom-opensource/wfd-commonsys/ [useless] @@ -552,6 +572,7 @@ echo "Deblobbing..."; blobs=$blobs"|wfdconfigsink.xml|wfdconfig.xml"; blobs=$blobs"|com.qualcomm.qti.wifidisplayhal.*|vendor.qti.hardware.wifidisplaysession.*|android.hardware.drm.*wfdhdcp.*"; makes=$makes"|WfdCommon|android.hardware.drm.*wfdhdcp.*"; + manifests=$manifests"|wfdhdcp|wifidisplayhdcphal|WifiDisplay"; #Widevine (DRM) [Google] blobs=$blobs"|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|libvtswidevine32.so|libvtswidevine64.so|android.hardware.drm.*widevine.*"; @@ -575,6 +596,7 @@ echo "Deblobbing..."; export ipcSec; export kernels; export sepolicy; + export manifests; # #END OF BLOBS ARRAY # @@ -824,8 +846,10 @@ find device -name "*.mk" -type f -print0 | xargs -0 -n 1 -P 8 -I {} bash -c 'awk #find kernel -maxdepth 2 -mindepth 2 -type d -print0 | xargs -0 -n 1 -P 8 -I {} bash -c 'deblobKernel "{}"'; #Deblob all kernel directories 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 +perl -0777 -pe 's,(.*?),$1 =~ /'$manifests'/?"":$1,gse' -i $(grep 'format="hidl"' "$DOS_BUILD_BASE/device" -ril); #Deblob all matrixes #Credit: https://unix.stackexchange.com/a/72160 +perl -0777 -pe 's,(.*?),$1 =~ /'$manifests'/?"":$1,gse' -i $(grep 'format="hidl"' "$DOS_BUILD_BASE/hardware/interfaces" -ril); deblobVendors; #Deblob entire vendor directory -#rm -rf frameworks/av/drm/mediadrm/plugins/clearkey; #Remove ClearKey +rm -rf frameworks/av/drm/mediadrm/plugins/clearkey frameworks/av/drm/mediacas/plugins/clearkey; #Remove ClearKey rm -rf vendor/samsung/nodevice; # #END OF DEBLOBBING diff --git a/Scripts/Common/Functions.sh b/Scripts/Common/Functions.sh index e3381d9d..78fe6d69 100644 --- a/Scripts/Common/Functions.sh +++ b/Scripts/Common/Functions.sh @@ -306,6 +306,8 @@ processRelease() { sha512sum "$OUT_DIR/$PREFIX-ota.zip" > "$OUT_DIR/$PREFIX-ota.zip.sha512sum"; #Deltas + #grep update_engine Build/*/device/*/*/*.mk -l + local DOS_GENERATE_DELTAS_DEVICES=('akari' 'alioth' 'Amber' 'aura' 'aurora' 'avicii' 'blueline' 'bonito' 'bramble' 'cheryl' 'coral' 'crosshatch' 'davinci' 'discovery' 'enchilada' 'fajita' 'flame' 'FP3' 'guacamole' 'guacamoleb' 'hotdog' 'hotdogb' 'marlin' 'mata' 'pioneer' 'pro1' 'redfin' 'sailfish' 'sargo' 'sunfish' 'taimen' 'vayu' 'voyager' 'walleye' 'xz2c'); if [ "$DOS_GENERATE_DELTAS" = true ]; then if [[ " ${DOS_GENERATE_DELTAS_DEVICES[@]} " =~ " ${DEVICE} " ]]; then for LAST_TARGET_FILES in $ARCHIVE/target_files/$DOS_BRANDING_ZIP_PREFIX-$VERSION-*-dos-$DEVICE-target_files.zip; do @@ -539,7 +541,7 @@ export -f hardenBootArgs; enableAutoVarInit() { #grep TARGET_KERNEL_CLANG_COMPILE Build/*/device/*/*/*.mk -l - DOS_AUTOVARINIT_KERNELS=('essential/msm8998' 'fxtec/msm8998' 'google/coral' 'google/msm-4.9' 'google/sunfish' 'google/wahoo' 'oneplus/msm8996' 'oneplus/msm8998' 'oneplus/sdm845' 'oneplus/sm7250' 'oneplus/sm8150' 'razer/msm8998' 'razer/sdm845' 'sony/sdm660' 'sony/sdm845' 'xiaomi/sdm660' 'xiaomi/sdm845' 'xiaomi/sm6150' 'xiaomi/sm8150' 'xiaomi/sm8250' 'zuk/msm8996'); #redbull already supports init_stack_all_zero + local DOS_AUTOVARINIT_KERNELS=('essential/msm8998' 'fxtec/msm8998' 'google/coral' 'google/msm-4.9' 'google/sunfish' 'google/wahoo' 'oneplus/msm8996' 'oneplus/msm8998' 'oneplus/sdm845' 'oneplus/sm7250' 'oneplus/sm8150' 'razer/msm8998' 'razer/sdm845' 'sony/sdm660' 'sony/sdm845' 'xiaomi/sdm660' 'xiaomi/sdm845' 'xiaomi/sm6150' 'xiaomi/sm8150' 'xiaomi/sm8250' 'zuk/msm8996'); #redbull already supports init_stack_all_zero cd "$DOS_BUILD_BASE"; echo "auto-var-init: Starting!"; for kernel in "${DOS_AUTOVARINIT_KERNELS[@]}" diff --git a/Scripts/init.sh b/Scripts/init.sh index e2037682..50b2c894 100644 --- a/Scripts/init.sh +++ b/Scripts/init.sh @@ -81,8 +81,6 @@ export DOS_GPS_SUPL_HOST="supl.google.com"; #Options: Any *valid* SUPL server #Release Processing export DOS_MALWARE_SCAN_BEFORE_SIGN=false; #Scan device files for malware before signing export DOS_GENERATE_DELTAS=true; #Creates deltas from existing target_files in $DOS_BUILDS -#grep update_engine Build/*/device/*/*/*.mk -l -export DOS_GENERATE_DELTAS_DEVICES=('akari' 'alioth' 'Amber' 'aura' 'aurora' 'avicii' 'blueline' 'bonito' 'bramble' 'cheryl' 'coral' 'crosshatch' 'davinci' 'discovery' 'enchilada' 'fajita' 'flame' 'FP3' 'guacamole' 'guacamoleb' 'hotdog' 'hotdogb' 'marlin' 'mata' 'pioneer' 'pro1' 'redfin' 'sailfish' 'sargo' 'sunfish' 'taimen' 'vayu' 'voyager' 'walleye' 'xz2c'); #List of devices deltas will be generated for export DOS_AUTO_ARCHIVE_BUILDS=true; #Copies files to $DOS_BUILDS after signing export DOS_REMOVE_AFTER=true; #Removes device OUT directory after complete to reclaim space. Requires AUTO_ARCHIVE_BUILDS=true export DOS_REMOVE_AFTER_FULL=false; #Removes the entire OUT directory