From 37344b0e536e641531cb5ffc3789dc61f02a4ab3 Mon Sep 17 00:00:00 2001 From: Cosmin Tanislav Date: Tue, 6 Aug 2024 03:37:29 +0300 Subject: [PATCH] sm6225-common: automatically patch ims https://review.lineageos.org/q/topic:%22extract-utils-apktool%22 Change-Id: I704e191adc7aafe6fe062c1bb330fbd1ca05493c --- extract-files.sh | 3 + ...pl-Return-0-in-getWfcMDN-in-any-case.patch | 39 ++++++++++++ ...n-t-call-setSubscriptionProperty-for.patch | 60 +++++++++++++++++++ ...remove-uses-library-for-moto-ims-ext.patch | 26 ++++++++ proprietary-files.txt | 2 +- 5 files changed, 129 insertions(+), 1 deletion(-) create mode 100644 ims-patches/0001-ImsConfigImpl-Return-0-in-getWfcMDN-in-any-case.patch create mode 100644 ims-patches/0002-ImsConfigImpl-don-t-call-setSubscriptionProperty-for.patch create mode 100644 ims-patches/0003-ims-remove-uses-library-for-moto-ims-ext.patch diff --git a/extract-files.sh b/extract-files.sh index d09dde8..c7d3eef 100755 --- a/extract-files.sh +++ b/extract-files.sh @@ -63,6 +63,9 @@ function blob_fixup() { system_ext/etc/permissions/moto-telephony.xml) sed -i "s#/system/#/system_ext/#" "${2}" ;; + system_ext/priv-app/ims/ims.apk) + apktool_patch "${2}" "$MY_DIR/ims-patches" + ;; vendor/etc/init/android.hardware.nfc@1.2-service-moto.rc) sed -i "s/class hal/override\n class hal/" "${2}" ;; diff --git a/ims-patches/0001-ImsConfigImpl-Return-0-in-getWfcMDN-in-any-case.patch b/ims-patches/0001-ImsConfigImpl-Return-0-in-getWfcMDN-in-any-case.patch new file mode 100644 index 0000000..2e1514f --- /dev/null +++ b/ims-patches/0001-ImsConfigImpl-Return-0-in-getWfcMDN-in-any-case.patch @@ -0,0 +1,39 @@ +From 399db1bf6d75ed1d9cd950981563cf16294ae121 Mon Sep 17 00:00:00 2001 +From: Erfan Abdi +Date: Sun, 26 Jan 2020 20:23:44 +0330 +Subject: [PATCH 1/3] ImsConfigImpl: Return 0 in getWfcMDN in any case + +--- + smali/org/codeaurora/ims/ImsConfigImpl.smali | 14 -------------- + 1 file changed, 14 deletions(-) + +diff --git a/smali/org/codeaurora/ims/ImsConfigImpl.smali b/smali/org/codeaurora/ims/ImsConfigImpl.smali +index 8daf334..b2ab653 100644 +--- a/smali/org/codeaurora/ims/ImsConfigImpl.smali ++++ b/smali/org/codeaurora/ims/ImsConfigImpl.smali +@@ -1385,22 +1385,8 @@ + .param p1, "subid" # I + + .line 814 +- iget-object v0, p0, Lorg/codeaurora/ims/ImsConfigImpl;->mContext:Landroid/content/Context; +- +- const-string v1, "wfc_ims_mdn" +- +- invoke-static {p1, v1, v0}, Landroid/telephony/SubscriptionManager;->getSubscriptionProperty(ILjava/lang/String;Landroid/content/Context;)Ljava/lang/String; +- +- move-result-object v0 +- +- .line 816 +- .local v0, "mdn":Ljava/lang/String; +- if-nez v0, :cond_0 +- + const-string v0, "0" + +- .line 817 +- :cond_0 + return-object v0 + .end method + +-- +2.46.0 + diff --git a/ims-patches/0002-ImsConfigImpl-don-t-call-setSubscriptionProperty-for.patch b/ims-patches/0002-ImsConfigImpl-don-t-call-setSubscriptionProperty-for.patch new file mode 100644 index 0000000..7492241 --- /dev/null +++ b/ims-patches/0002-ImsConfigImpl-don-t-call-setSubscriptionProperty-for.patch @@ -0,0 +1,60 @@ +From 17ca75d7ee7ab65c88027cb21080be6bc55a11c3 Mon Sep 17 00:00:00 2001 +From: Vachounet +Date: Wed, 27 Jan 2021 23:28:48 +0100 +Subject: [PATCH 2/3] ImsConfigImpl: don't call setSubscriptionProperty for + wfc_ims_mdn + +--- + smali/org/codeaurora/ims/ImsConfigImpl.smali | 36 -------------------- + 1 file changed, 36 deletions(-) + +diff --git a/smali/org/codeaurora/ims/ImsConfigImpl.smali b/smali/org/codeaurora/ims/ImsConfigImpl.smali +index b2ab653..cea9e43 100644 +--- a/smali/org/codeaurora/ims/ImsConfigImpl.smali ++++ b/smali/org/codeaurora/ims/ImsConfigImpl.smali +@@ -2993,42 +2993,6 @@ + + .line 741 + :cond_2 +- if-ne p1, v2, :cond_3 +- +- .line 742 +- new-instance v0, Ljava/lang/StringBuilder; +- +- invoke-direct {v0}, Ljava/lang/StringBuilder;->()V +- +- const-string v1, "setProvisionedStringValue WIFI_MDN set db value=" +- +- invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; +- +- move-result-object v0 +- +- invoke-static {p2}, Lcom/qualcomm/ims/utils/Log;->pii(Ljava/lang/Object;)Ljava/lang/String; +- +- move-result-object v1 +- +- invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; +- +- move-result-object v0 +- +- invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; +- +- move-result-object v0 +- +- invoke-static {p0, v0}, Lcom/qualcomm/ims/utils/Log;->i(Ljava/lang/Object;Ljava/lang/String;)V +- +- .line 743 +- iget v0, p0, Lorg/codeaurora/ims/ImsConfigImpl;->mSubId:I +- +- const-string v1, "wfc_ims_mdn" +- +- invoke-static {v0, v1, p2}, Landroid/telephony/SubscriptionManager;->setSubscriptionProperty(ILjava/lang/String;Ljava/lang/String;)V +- +- .line 748 +- :cond_3 + const/16 v3, 0x2c + + const/4 v5, 0x1 +-- +2.46.0 + diff --git a/ims-patches/0003-ims-remove-uses-library-for-moto-ims-ext.patch b/ims-patches/0003-ims-remove-uses-library-for-moto-ims-ext.patch new file mode 100644 index 0000000..15eff42 --- /dev/null +++ b/ims-patches/0003-ims-remove-uses-library-for-moto-ims-ext.patch @@ -0,0 +1,26 @@ +From a6b4917c78b9feff37f38cbc4c08b5da149f4e3b Mon Sep 17 00:00:00 2001 +From: Andrew Hexen +Date: Thu, 25 May 2023 11:51:44 -0700 +Subject: [PATCH 3/3] ims: remove uses-library for moto-ims-ext + +* This was added in 13 which breaks ims: +'java.lang.ClassNotFoundException org/codeaurora/ims/utils/QtiCarrierConfigHelper/ImsService.java' +--- + AndroidManifest.xml | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/AndroidManifest.xml b/AndroidManifest.xml +index 9ea2b38..9d09352 100644 +--- a/AndroidManifest.xml ++++ b/AndroidManifest.xml +@@ -49,6 +49,5 @@ + + + +- + + +\ No newline at end of file +-- +2.46.0 + diff --git a/proprietary-files.txt b/proprietary-files.txt index 5dec371..31cd080 100644 --- a/proprietary-files.txt +++ b/proprietary-files.txt @@ -333,7 +333,7 @@ system_ext/lib64/libimscamera_jni.so;SYMLINK=system_ext/priv-app/ims/lib/arm64/l system_ext/lib64/libimsmedia_jni.so;SYMLINK=system_ext/priv-app/ims/lib/arm64/libimsmedia_jni.so system_ext/lib64/vendor.qti.imsrtpservice@3.0.so system_ext/lib64/vendor.qti.imsrtpservice@3.1.so -system_ext/priv-app/ims/ims.apk|2641da4033820e180720ce70686fd74409803686|64999c3ddf13c1f10065d92838a2e43cc5b0c62e +system_ext/priv-app/ims/ims.apk vendor/bin/ims_rtp_daemon vendor/bin/imsdaemon vendor/etc/init/ims_rtp_daemon.rc