From 268ae82d1eecf6195f2e007f30dc00de6bf60349 Mon Sep 17 00:00:00 2001 From: Tavi Date: Wed, 8 May 2024 08:47:09 -0400 Subject: [PATCH] 20.0: Switch to latest (prebuilt) OpenEUICC Signed-off-by: Tavi --- Manifests/Manifest_LAOS-20.0.xml | 5 - .../0001-hacky-fix.patch | 132 ------------------ PrebuiltApps | 2 +- Scripts/LineageOS-20.0/Patch.sh | 6 +- 4 files changed, 2 insertions(+), 143 deletions(-) delete mode 100644 Patches/LineageOS-20.0/android_packages_apps_OpenEUICC/0001-hacky-fix.patch diff --git a/Manifests/Manifest_LAOS-20.0.xml b/Manifests/Manifest_LAOS-20.0.xml index b72ad4ec..f20bb726 100644 --- a/Manifests/Manifest_LAOS-20.0.xml +++ b/Manifests/Manifest_LAOS-20.0.xml @@ -2,7 +2,6 @@ - @@ -51,10 +50,6 @@ - - - - diff --git a/Patches/LineageOS-20.0/android_packages_apps_OpenEUICC/0001-hacky-fix.patch b/Patches/LineageOS-20.0/android_packages_apps_OpenEUICC/0001-hacky-fix.patch deleted file mode 100644 index 1d336088..00000000 --- a/Patches/LineageOS-20.0/android_packages_apps_OpenEUICC/0001-hacky-fix.patch +++ /dev/null @@ -1,132 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Tad -Date: Mon, 21 Aug 2023 08:07:40 -0400 -Subject: [PATCH] Hacky fix for misidentifying physical SIM - -Signed-off-by: Tad ---- - app/src/main/java/im/angry/openeuicc/core/EuiccChannel.kt | 4 +++- - .../java/im/angry/openeuicc/core/EuiccChannelManager.kt | 7 ++++--- - .../java/im/angry/openeuicc/service/OpenEuiccService.kt | 3 ++- - .../java/im/angry/openeuicc/ui/EuiccManagementFragment.kt | 4 ++-- - app/src/main/java/im/angry/openeuicc/ui/MainActivity.kt | 6 ++++-- - 5 files changed, 15 insertions(+), 9 deletions(-) - -diff --git a/app/src/main/java/im/angry/openeuicc/core/EuiccChannel.kt b/app/src/main/java/im/angry/openeuicc/core/EuiccChannel.kt -index 53fd3c7..0067996 100644 ---- a/app/src/main/java/im/angry/openeuicc/core/EuiccChannel.kt -+++ b/app/src/main/java/im/angry/openeuicc/core/EuiccChannel.kt -@@ -8,7 +8,8 @@ data class EuiccChannelInfo( - val cardId: Int, - val name: String, - val imei: String, -- val removable: Boolean -+ val removable: Boolean, -+ val ignore: Boolean - ) - - abstract class EuiccChannel( -@@ -19,6 +20,7 @@ abstract class EuiccChannel( - val name = info.name - val imei = info.imei - val removable = info.removable -+ val ignore = info.ignore - - abstract val lpa: LocalProfileAssistant - abstract val valid: Boolean -diff --git a/app/src/main/java/im/angry/openeuicc/core/EuiccChannelManager.kt b/app/src/main/java/im/angry/openeuicc/core/EuiccChannelManager.kt -index c710c9d..4e709ae 100644 ---- a/app/src/main/java/im/angry/openeuicc/core/EuiccChannelManager.kt -+++ b/app/src/main/java/im/angry/openeuicc/core/EuiccChannelManager.kt -@@ -67,12 +67,13 @@ class EuiccChannelManager(private val context: Context) { - uiccInfo.cardId, - "SIM ${uiccInfo.slotIndex}", - tm.getImei(uiccInfo.slotIndex) ?: return null, -- uiccInfo.isRemovable -+ uiccInfo.isRemovable, -+ (uiccInfo.getEid() == null || uiccInfo.getEid().matches("^[0]+$".toRegex())) - ) - - var euiccChannel: EuiccChannel? = null - -- if (uiccInfo.isEuicc && !uiccInfo.isRemovable) { -+ if (uiccInfo.isEuicc && !uiccInfo.isRemovable && !channelInfo.ignore) { - Log.d(TAG, "Using TelephonyManager for slot ${uiccInfo.slotIndex}") - // TODO: On Tiramisu, we should also connect all available "ports" for MEP support - euiccChannel = TelephonyManagerChannel.tryConnect(tm, channelInfo) -@@ -141,4 +142,4 @@ class EuiccChannelManager(private val context: Context) { - } - } - } --} -\ No newline at end of file -+} -diff --git a/app/src/main/java/im/angry/openeuicc/service/OpenEuiccService.kt b/app/src/main/java/im/angry/openeuicc/service/OpenEuiccService.kt -index eb41e7c..be94316 100644 ---- a/app/src/main/java/im/angry/openeuicc/service/OpenEuiccService.kt -+++ b/app/src/main/java/im/angry/openeuicc/service/OpenEuiccService.kt -@@ -58,6 +58,7 @@ class OpenEuiccService : EuiccService() { - - override fun onGetEuiccProfileInfoList(slotId: Int): GetEuiccProfileInfoListResult? { - val channel = findChannel(slotId) ?: return null -+ if(findChannel(slotId)!!.ignore) { return null } - val profiles = channel.lpa.profiles.operational.map { - EuiccProfileInfo.Builder(it.iccid).apply { - setProfileName(it.name) -@@ -179,4 +180,4 @@ class OpenEuiccService : EuiccService() { - // No-op -- we do not care - return RESULT_FIRST_USER - } --} -\ No newline at end of file -+} -diff --git a/app/src/main/java/im/angry/openeuicc/ui/EuiccManagementFragment.kt b/app/src/main/java/im/angry/openeuicc/ui/EuiccManagementFragment.kt -index 6a3b253..e261cac 100644 ---- a/app/src/main/java/im/angry/openeuicc/ui/EuiccManagementFragment.kt -+++ b/app/src/main/java/im/angry/openeuicc/ui/EuiccManagementFragment.kt -@@ -80,7 +80,7 @@ class EuiccManagementFragment : Fragment(), EuiccFragmentMarker, EuiccProfilesCh - @SuppressLint("NotifyDataSetChanged") - private fun refresh() { - swipeRefresh.isRefreshing = true -- -+ if(channel!!.ignore) { return } - lifecycleScope.launch { - val profiles = withContext(Dispatchers.IO) { - openEuiccApplication.subscriptionManager.tryRefreshCachedEuiccInfo(channel.cardId) -@@ -221,4 +221,4 @@ class EuiccManagementFragment : Fragment(), EuiccFragmentMarker, EuiccProfilesCh - - override fun getItemCount(): Int = profiles.size - } --} -\ No newline at end of file -+} -diff --git a/app/src/main/java/im/angry/openeuicc/ui/MainActivity.kt b/app/src/main/java/im/angry/openeuicc/ui/MainActivity.kt -index d0f7465..b286cde 100644 ---- a/app/src/main/java/im/angry/openeuicc/ui/MainActivity.kt -+++ b/app/src/main/java/im/angry/openeuicc/ui/MainActivity.kt -@@ -95,15 +95,17 @@ class MainActivity : AppCompatActivity() { - manager.enumerateEuiccChannels() - manager.knownChannels.forEach { - Log.d(TAG, it.name) -- Log.d(TAG, it.lpa.eid) -+ //Log.d(TAG, it.lpa.eid) - openEuiccApplication.subscriptionManager.tryRefreshCachedEuiccInfo(it.cardId) - } - } - - withContext(Dispatchers.Main) { - manager.knownChannels.forEach { channel -> -+ if(!channel!!.ignore) { - spinnerAdapter.add(channel.name) - fragments.add(EuiccManagementFragment.newInstance(channel.slotId)) -+ } - } - - if (fragments.isNotEmpty()) { -@@ -112,4 +114,4 @@ class MainActivity : AppCompatActivity() { - } - } - } --} -\ No newline at end of file -+} diff --git a/PrebuiltApps b/PrebuiltApps index f59d65f6..31ae5e51 160000 --- a/PrebuiltApps +++ b/PrebuiltApps @@ -1 +1 @@ -Subproject commit f59d65f6eeb20d58a65ccd4f4f353ed65d8c06d0 +Subproject commit 31ae5e5179470a9f593d64f27e2993267f38efc8 diff --git a/Scripts/LineageOS-20.0/Patch.sh b/Scripts/LineageOS-20.0/Patch.sh index 15927f75..b9aec05d 100644 --- a/Scripts/LineageOS-20.0/Patch.sh +++ b/Scripts/LineageOS-20.0/Patch.sh @@ -51,7 +51,7 @@ cd "$DOS_BUILD_BASE"; #top dir cp -r "$DOS_PREBUILT_APPS/Fennec_DOS-Shim" "$DOS_BUILD_BASE/packages/apps/"; #Add a shim to install Fennec DOS without actually including the large APK cp -r "$DOS_PREBUILT_APPS/SupportDivestOS" "$DOS_BUILD_BASE/packages/apps/"; #Add the Support app -#cp -r "$DOS_PREBUILT_APPS/OpenEUICC" "$DOS_BUILD_BASE/packages/apps/"; #Add the OpenEUICC app +cp -r "$DOS_PREBUILT_APPS/OpenEUICC" "$DOS_BUILD_BASE/packages/apps/"; #Add the OpenEUICC app gpgVerifyDirectory "$DOS_PREBUILT_APPS/android_vendor_FDroid_PrebuiltApps/packages"; cp -r "$DOS_PREBUILT_APPS/android_vendor_FDroid_PrebuiltApps/." "$DOS_BUILD_BASE/vendor/fdroid_prebuilt/"; #Add the prebuilt apps cp -r "$DOS_PATCHES_COMMON/android_vendor_divested/." "$DOS_BUILD_BASE/vendor/divested/"; #Add our vendor files @@ -322,10 +322,6 @@ if enterAndClear "packages/apps/Nfc"; then if [ "$DOS_GRAPHENE_CONSTIFY" = true ]; then applyPatch "$DOS_PATCHES/android_packages_apps_Nfc/0001-constify_JNINativeMethod.patch"; fi; #Constify JNINativeMethod tables (GrapheneOS) fi; -if enterAndClear "packages/apps/OpenEUICC"; then -applyPatch "$DOS_PATCHES/android_packages_apps_OpenEUICC/0001-hacky-fix.patch"; #Hacky fix for misidentifying physical SIM (DivestOS) -fi; - if enterAndClear "packages/apps/Settings"; then git revert --no-edit 41b4ed345a91da1dd46c00ee11a151c2b5ff4f43; applyPatch "$DOS_PATCHES/android_packages_apps_Settings/0004-Private_DNS.patch"; #More 'Private DNS' options (heavily based off of a CalyxOS patch)