diff --git a/README.md b/README.md index 24f4c9f47..17d2cfc31 100644 --- a/README.md +++ b/README.md @@ -7,13 +7,10 @@ There are two variants of this project: - OpenEUICC: The full-fledged privileged variant. - Due to its privilege requirement, OpenEUICC must be placed inside `/system/priv-app` and be signed with the platform certificate. - The preferred way to including OpenEUICC in a system image is to [build it along with AOSP](#building-aosp). - - __Note__: When privileged, OpenEUICC supports any eUICC chip that implements the SGP.22 standard, internal or external. However, there is __no guarantee__ that external (removable) eSIMs actually follow the standard. Please __DO NOT__ submit bug reports for non-functioning removable eSIMs. They are __NOT__ officially supported unless they also support / are supported by EasyEUICC, the unprivileged variant. - EasyEUICC: Unprivileged version that can run as a user app. - - This version supports two modes of operation: - 1. Inserted, removable eSIMs: Due to obvious security requirements, EasyEUICC is only able to access eSIM chips whose [ARF/ARA](https://source.android.com/docs/core/connect/uicc#arf) contains the hash of EasyEUICC's signing certificate. - 2. USB CCID Card Readers: Only `T=0` readers that use the standard [USB CCID protocol](https://en.wikipedia.org/wiki/CCID_(protocol)) are supported. In this mode, EasyEUICC can access any eSIM chip loaded in the card reader regardless of their ARF/ARA, as long as they implement the [SGP.22 standard](https://www.gsma.com/solutions-and-impact/technologies/esim/wp-content/uploads/2021/07/SGP.22-v2.3.pdf). + - Due to obvious security requirements, EasyEUICC is only able to access eSIM chips whose [ARF/ARA](https://source.android.com/docs/core/connect/uicc#arf) contains the hash of EasyEUICC's signing certificate. - Prebuilt release-mode EasyEUICC apks can be downloaded [here](https://gitea.angry.im/PeterCxy/OpenEUICC/releases) - - For removable eSIM chip vendors: to have your chip supported by official builds of EasyEUICC when inserted, include the ARA-M hash `2A2FA878BC7C3354C2CF82935A5945A3EDAE4AFA` + - For removable eSIM chip vendors: to have your chip supported by official builds of EasyEUICC, include the ARA-M hash `2A2FA878BC7C3354C2CF82935A5945A3EDAE4AFA` Building (Gradle) === diff --git a/app-common/src/main/java/im/angry/openeuicc/core/OmapiApduInterface.kt b/app-common/src/main/java/im/angry/openeuicc/core/OmapiApduInterface.kt index 711658adb..227977c90 100644 --- a/app-common/src/main/java/im/angry/openeuicc/core/OmapiApduInterface.kt +++ b/app-common/src/main/java/im/angry/openeuicc/core/OmapiApduInterface.kt @@ -3,7 +3,6 @@ package im.angry.openeuicc.core import android.se.omapi.Channel import android.se.omapi.SEService import android.se.omapi.Session -import android.util.Log import im.angry.openeuicc.util.* import net.typeblog.lpac_jni.ApduInterface @@ -11,10 +10,6 @@ class OmapiApduInterface( private val service: SEService, private val port: UiccPortInfoCompat ): ApduInterface { - companion object { - const val TAG = "OmapiApduInterface" - } - private lateinit var session: Session private lateinit var lastChannel: Channel @@ -49,17 +44,7 @@ class OmapiApduInterface( "Unknown channel" } - Log.d(TAG, "OMAPI APDU: ${tx.encodeHex()}") - - try { - return lastChannel.transmit(tx).also { - Log.d(TAG, "OMAPI APDU response: ${it.encodeHex()}") - } - } catch (e: Exception) { - Log.e(TAG, "OMAPI APDU exception") - e.printStackTrace() - throw e - } + return lastChannel.transmit(tx) } } \ No newline at end of file diff --git a/app-common/src/main/java/im/angry/openeuicc/ui/EuiccManagementFragment.kt b/app-common/src/main/java/im/angry/openeuicc/ui/EuiccManagementFragment.kt index ac0a99f8a..d49fa70ee 100644 --- a/app-common/src/main/java/im/angry/openeuicc/ui/EuiccManagementFragment.kt +++ b/app-common/src/main/java/im/angry/openeuicc/ui/EuiccManagementFragment.kt @@ -1,8 +1,6 @@ package im.angry.openeuicc.ui import android.annotation.SuppressLint -import android.content.ClipData -import android.content.ClipboardManager import android.content.Intent import android.os.Bundle import android.text.method.PasswordTransformationMethod @@ -295,14 +293,6 @@ open class EuiccManagementFragment : Fragment(), EuiccProfilesChangedListener, } } - iccid.setOnLongClickListener { - requireContext().getSystemService(ClipboardManager::class.java)!! - .setPrimaryClip(ClipData.newPlainText("iccid", iccid.text)) - Toast.makeText(requireContext(), R.string.toast_iccid_copied, Toast.LENGTH_SHORT) - .show() - true - } - profileMenu.setOnClickListener { showOptionsMenu() } } diff --git a/app-common/src/main/java/im/angry/openeuicc/ui/MainActivity.kt b/app-common/src/main/java/im/angry/openeuicc/ui/MainActivity.kt index 0f504ebbc..74fe38598 100644 --- a/app-common/src/main/java/im/angry/openeuicc/ui/MainActivity.kt +++ b/app-common/src/main/java/im/angry/openeuicc/ui/MainActivity.kt @@ -146,7 +146,7 @@ open class MainActivity : BaseEuiccAccessActivity(), OpenEuiccContextMarker { // If USB readers exist, add them at the very last // We use a wrapper fragment to handle logic specific to USB readers usbDevice?.let { - pages.add(Page(it.productName ?: getString(R.string.usb)) { UsbCcidReaderFragment() }) + pages.add(Page(it.productName ?: "USB") { UsbCcidReaderFragment() }) } viewPager.visibility = View.VISIBLE diff --git a/app-common/src/main/java/im/angry/openeuicc/ui/NotificationsActivity.kt b/app-common/src/main/java/im/angry/openeuicc/ui/NotificationsActivity.kt index 59abbc563..9758d18df 100644 --- a/app-common/src/main/java/im/angry/openeuicc/ui/NotificationsActivity.kt +++ b/app-common/src/main/java/im/angry/openeuicc/ui/NotificationsActivity.kt @@ -20,7 +20,6 @@ import androidx.recyclerview.widget.RecyclerView import androidx.swiperefreshlayout.widget.SwipeRefreshLayout import im.angry.openeuicc.common.R import im.angry.openeuicc.core.EuiccChannel -import im.angry.openeuicc.core.EuiccChannelManager import im.angry.openeuicc.util.* import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -54,16 +53,6 @@ class NotificationsActivity: BaseEuiccAccessActivity(), OpenEuiccContextMarker { notificationList.adapter = notificationAdapter registerForContextMenu(notificationList) - // This is slightly different from the MainActivity logic - // due to the length (we don't want to display the full USB product name) - val channelTitle = if (euiccChannel.logicalSlotId == EuiccChannelManager.USB_CHANNEL_ID) { - getString(R.string.usb) - } else { - getString(R.string.channel_name_format, euiccChannel.logicalSlotId) - } - - title = getString(R.string.profile_notifications_detailed_format, channelTitle) - swipeRefresh.setOnRefreshListener { refresh() } diff --git a/app-common/src/main/java/im/angry/openeuicc/ui/SettingsFragment.kt b/app-common/src/main/java/im/angry/openeuicc/ui/SettingsFragment.kt index 754cc5825..d471efab8 100644 --- a/app-common/src/main/java/im/angry/openeuicc/ui/SettingsFragment.kt +++ b/app-common/src/main/java/im/angry/openeuicc/ui/SettingsFragment.kt @@ -44,9 +44,6 @@ class SettingsFragment: PreferenceFragmentCompat() { findPreference("pref_advanced_disable_safeguard_removable_esim") ?.bindBooleanFlow(preferenceRepository.disableSafeguardFlow, PreferenceKeys.DISABLE_SAFEGUARD_REMOVABLE_ESIM) - - findPreference("pref_advanced_operational_profiles_only") - ?.bindBooleanFlow(preferenceRepository.operationalOnlyFlow, PreferenceKeys.OPERATIONAL_PROFILES_ONLY) } private fun CheckBoxPreference.bindBooleanFlow(flow: Flow, key: Preferences.Key) { diff --git a/app-common/src/main/java/im/angry/openeuicc/util/PreferenceUtils.kt b/app-common/src/main/java/im/angry/openeuicc/util/PreferenceUtils.kt index f04b6a2a4..53153405e 100644 --- a/app-common/src/main/java/im/angry/openeuicc/util/PreferenceUtils.kt +++ b/app-common/src/main/java/im/angry/openeuicc/util/PreferenceUtils.kt @@ -24,7 +24,6 @@ object PreferenceKeys { val NOTIFICATION_DELETE = booleanPreferencesKey("notification_delete") val NOTIFICATION_SWITCH = booleanPreferencesKey("notification_switch") val DISABLE_SAFEGUARD_REMOVABLE_ESIM = booleanPreferencesKey("disable_safeguard_removable_esim") - val OPERATIONAL_PROFILES_ONLY = booleanPreferencesKey("operational_profiles_only") } class PreferenceRepository(context: Context) { @@ -45,9 +44,6 @@ class PreferenceRepository(context: Context) { val disableSafeguardFlow: Flow = dataStore.data.map { it[PreferenceKeys.DISABLE_SAFEGUARD_REMOVABLE_ESIM] ?: false } - val operationalOnlyFlow: Flow = - dataStore.data.map { it[PreferenceKeys.OPERATIONAL_PROFILES_ONLY] ?: true } - suspend fun updatePreference(key: Preferences.Key, value: T) { dataStore.edit { it[key] = value diff --git a/app-common/src/main/res/layout/activity_main.xml b/app-common/src/main/res/layout/activity_main.xml index a61a368f7..cb5f22464 100644 --- a/app-common/src/main/res/layout/activity_main.xml +++ b/app-common/src/main/res/layout/activity_main.xml @@ -3,7 +3,8 @@ xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" - android:layout_height="match_parent"> + android:layout_height="match_parent" + tools:context=".ui.MainActivity"> Reload Slots Logical Slot %d - USB Enabled Disabled @@ -24,7 +23,6 @@ Cannot switch to new eSIM profile. Nickname cannot be longer than 64 characters - ICCID copied to clipboard Select Slot Select @@ -49,8 +47,7 @@ Are you sure you want to delete the profile %s? This operation is irreversible. Type \'%s\' here to confirm deletion - Notifications - Notifications (%s) + Profile Notifications Manage Notifications eSIM profiles can send notifications to the carrier when they are downloaded, deleted, enabled, or disabled. The queue of these notifications to be sent is listed here.\n\nIn Settings, you can specify whether to send each type of notification automatically. Note that even if a notification has been sent, it will not be deleted automatically from the record, unless the queue runs out of space.\n\nHere, you can manually send or delete each pending notification. Downloaded @@ -76,8 +73,6 @@ Advanced Disable Safeguards for Removable eSIMs By default, this app prevents you from disabling the active profile on a removable eSIM inserted in the device, because doing so may sometimes render it inaccessible.\nCheck this box to remove this safeguard. - Display only operational profiles - By default, this app lists only operational profiles. You can disable this to also see (and manage) testing and bootstrap profiles. Logs View recent debug logs of the application Info diff --git a/app-common/src/main/res/xml/pref_settings.xml b/app-common/src/main/res/xml/pref_settings.xml index cc3d5b105..db348fc15 100644 --- a/app-common/src/main/res/xml/pref_settings.xml +++ b/app-common/src/main/res/xml/pref_settings.xml @@ -29,11 +29,6 @@ app:iconSpaceReserved="false" app:title="@string/pref_advanced_disable_safeguard_removable_esim" app:summary="@string/pref_advanced_disable_safeguard_removable_esim_desc" /> - CallVoidMethod(env, callback, on_state_update, download_state_finalizing); // TODO: Expose error code as Java-side exceptions? ret = es10b_load_bound_profile_package(ctx, &es10b_load_bound_profile_package_result); - syslog(LOG_INFO, "es10b_load_bound_profile_package %d, reason %d", ret, es10b_load_bound_profile_package_result.errorReason); + syslog(LOG_INFO, "es10b_load_bound_profile_package %d", ret); out: euicc_http_cleanup(ctx);