feat: euicc memory reset, available when all profiles are disabled #208
8 changed files with 3 additions and 20 deletions
|
@ -57,6 +57,7 @@ open class EuiccManagementFragment : Fragment(), EuiccProfilesChangedListener,
|
||||||
private lateinit var fab: FloatingActionButton
|
private lateinit var fab: FloatingActionButton
|
||||||
private lateinit var profileList: RecyclerView
|
private lateinit var profileList: RecyclerView
|
||||||
private var logicalSlotId: Int = -1
|
private var logicalSlotId: Int = -1
|
||||||
|
private var enabledProfile: LocalProfileInfo? = null
|
||||||
private lateinit var eid: String
|
private lateinit var eid: String
|
||||||
|
|
||||||
private val adapter = EuiccProfileAdapter()
|
private val adapter = EuiccProfileAdapter()
|
||||||
|
@ -141,7 +142,7 @@ open class EuiccManagementFragment : Fragment(), EuiccProfilesChangedListener,
|
||||||
menu.findItem(R.id.euicc_info).isVisible =
|
menu.findItem(R.id.euicc_info).isVisible =
|
||||||
logicalSlotId != -1
|
logicalSlotId != -1
|
||||||
menu.findItem(R.id.euicc_memory_reset).isVisible =
|
menu.findItem(R.id.euicc_memory_reset).isVisible =
|
||||||
runBlocking { preferenceRepository.euiccMemoryResetFlow.first() }
|
enabledProfile == null
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onOptionsItemSelected(item: MenuItem) = when (item.itemId) {
|
override fun onOptionsItemSelected(item: MenuItem) = when (item.itemId) {
|
||||||
|
@ -206,6 +207,7 @@ open class EuiccManagementFragment : Fragment(), EuiccProfilesChangedListener,
|
||||||
|
|
||||||
val profiles = withEuiccChannel { channel ->
|
val profiles = withEuiccChannel { channel ->
|
||||||
logicalSlotId = channel.logicalSlotId
|
logicalSlotId = channel.logicalSlotId
|
||||||
|
enabledProfile = channel.lpa.profiles.enabled
|
||||||
eid = channel.lpa.eID
|
eid = channel.lpa.eID
|
||||||
euiccChannelManager.notifyEuiccProfilesChanged(channel.logicalSlotId)
|
euiccChannelManager.notifyEuiccProfilesChanged(channel.logicalSlotId)
|
||||||
if (unfilteredProfileListFlow.value)
|
if (unfilteredProfileListFlow.value)
|
||||||
|
|
|
@ -81,9 +81,6 @@ open class SettingsFragment: PreferenceFragmentCompat() {
|
||||||
requirePreference<CheckBoxPreference>("pref_developer_refresh_after_switch")
|
requirePreference<CheckBoxPreference>("pref_developer_refresh_after_switch")
|
||||||
.bindBooleanFlow(preferenceRepository.refreshAfterSwitchFlow)
|
.bindBooleanFlow(preferenceRepository.refreshAfterSwitchFlow)
|
||||||
|
|
||||||
requirePreference<CheckBoxPreference>("pref_developer_euicc_memory_reset")
|
|
||||||
.bindBooleanFlow(preferenceRepository.euiccMemoryResetFlow)
|
|
||||||
|
|
||||||
requirePreference<Preference>("pref_developer_isdr_aid_list").apply {
|
requirePreference<Preference>("pref_developer_isdr_aid_list").apply {
|
||||||
intent = Intent(requireContext(), IsdrAidListActivity::class.java)
|
intent = Intent(requireContext(), IsdrAidListActivity::class.java)
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,6 @@ internal object PreferenceKeys {
|
||||||
val REFRESH_AFTER_SWITCH = booleanPreferencesKey("refresh_after_switch")
|
val REFRESH_AFTER_SWITCH = booleanPreferencesKey("refresh_after_switch")
|
||||||
val UNFILTERED_PROFILE_LIST = booleanPreferencesKey("unfiltered_profile_list")
|
val UNFILTERED_PROFILE_LIST = booleanPreferencesKey("unfiltered_profile_list")
|
||||||
val IGNORE_TLS_CERTIFICATE = booleanPreferencesKey("ignore_tls_certificate")
|
val IGNORE_TLS_CERTIFICATE = booleanPreferencesKey("ignore_tls_certificate")
|
||||||
val EUICC_MEMORY_RESET = booleanPreferencesKey("euicc_memory_reset")
|
|
||||||
val ISDR_AID_LIST = stringPreferencesKey("isdr_aid_list")
|
val ISDR_AID_LIST = stringPreferencesKey("isdr_aid_list")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -80,7 +79,6 @@ open class PreferenceRepository(private val context: Context) {
|
||||||
val developerOptionsEnabledFlow = bindFlow(PreferenceKeys.DEVELOPER_OPTIONS_ENABLED, false)
|
val developerOptionsEnabledFlow = bindFlow(PreferenceKeys.DEVELOPER_OPTIONS_ENABLED, false)
|
||||||
val unfilteredProfileListFlow = bindFlow(PreferenceKeys.UNFILTERED_PROFILE_LIST, false)
|
val unfilteredProfileListFlow = bindFlow(PreferenceKeys.UNFILTERED_PROFILE_LIST, false)
|
||||||
val ignoreTLSCertificateFlow = bindFlow(PreferenceKeys.IGNORE_TLS_CERTIFICATE, false)
|
val ignoreTLSCertificateFlow = bindFlow(PreferenceKeys.IGNORE_TLS_CERTIFICATE, false)
|
||||||
val euiccMemoryResetFlow = bindFlow(PreferenceKeys.EUICC_MEMORY_RESET, false)
|
|
||||||
val isdrAidListFlow = bindFlow(
|
val isdrAidListFlow = bindFlow(
|
||||||
PreferenceKeys.ISDR_AID_LIST,
|
PreferenceKeys.ISDR_AID_LIST,
|
||||||
PreferenceConstants.DEFAULT_AID_LIST,
|
PreferenceConstants.DEFAULT_AID_LIST,
|
||||||
|
|
|
@ -163,8 +163,6 @@
|
||||||
<string name="euicc_memory_reset_hint_text">確認のため、ここに「%s」を入力してください</string>
|
<string name="euicc_memory_reset_hint_text">確認のため、ここに「%s」を入力してください</string>
|
||||||
<string name="euicc_memory_reset_confirm_text">EID が %s で終わるチップを消去することに同意します。これは元に戻せないことを理解しています。</string>
|
<string name="euicc_memory_reset_confirm_text">EID が %s で終わるチップを消去することに同意します。これは元に戻せないことを理解しています。</string>
|
||||||
<string name="euicc_memory_reset_invoke_button">消去する</string>
|
<string name="euicc_memory_reset_invoke_button">消去する</string>
|
||||||
<string name="pref_developer_euicc_memory_reset">eUICC の消去を可能にする</string>
|
|
||||||
<string name="pref_developer_euicc_memory_reset_desc">この操作は、デフォルトでは非表示になっている危険な操作です。代わりに、すべての構成ファイルを手動で削除することもできます。</string>
|
|
||||||
<string name="pref_developer_refresh_after_switch">モデムに更新コマンドを送信</string>
|
<string name="pref_developer_refresh_after_switch">モデムに更新コマンドを送信</string>
|
||||||
<string name="pref_developer_isdr_aid_list">ISD-R AID リストのカスタマイズ</string>
|
<string name="pref_developer_isdr_aid_list">ISD-R AID リストのカスタマイズ</string>
|
||||||
<string name="reset">リセット</string>
|
<string name="reset">リセット</string>
|
||||||
|
|
|
@ -163,8 +163,6 @@
|
||||||
<string name="euicc_memory_reset_hint_text">请在此处输入「%s」以确认</string>
|
<string name="euicc_memory_reset_hint_text">请在此处输入「%s」以确认</string>
|
||||||
<string name="euicc_memory_reset_confirm_text">我确认擦除 EID 以 %s 结尾的芯片,并了解此操作不可逆</string>
|
<string name="euicc_memory_reset_confirm_text">我确认擦除 EID 以 %s 结尾的芯片,并了解此操作不可逆</string>
|
||||||
<string name="euicc_memory_reset_invoke_button">擦除</string>
|
<string name="euicc_memory_reset_invoke_button">擦除</string>
|
||||||
<string name="pref_developer_euicc_memory_reset">允许擦除 eUICC</string>
|
|
||||||
<string name="pref_developer_euicc_memory_reset_desc">此操作是默认隐藏的危险操作。作为替代方案,您可以手动删除所有配置文件。</string>
|
|
||||||
<string name="pref_developer_refresh_after_switch">向基带发送刷新命令</string>
|
<string name="pref_developer_refresh_after_switch">向基带发送刷新命令</string>
|
||||||
<string name="pref_developer_isdr_aid_list">自定义 ISD-R AID 列表</string>
|
<string name="pref_developer_isdr_aid_list">自定义 ISD-R AID 列表</string>
|
||||||
<string name="reset">重置</string>
|
<string name="reset">重置</string>
|
||||||
|
|
|
@ -163,8 +163,6 @@
|
||||||
<string name="euicc_memory_reset_hint_text">請在此輸入「%s」以確認</string>
|
<string name="euicc_memory_reset_hint_text">請在此輸入「%s」以確認</string>
|
||||||
<string name="euicc_memory_reset_confirm_text">我確認擦除 EID 以 %s 結尾的晶片,並了解此操作不可逆</string>
|
<string name="euicc_memory_reset_confirm_text">我確認擦除 EID 以 %s 結尾的晶片,並了解此操作不可逆</string>
|
||||||
<string name="euicc_memory_reset_invoke_button">擦除</string>
|
<string name="euicc_memory_reset_invoke_button">擦除</string>
|
||||||
<string name="pref_developer_euicc_memory_reset">允許擦除 eUICC</string>
|
|
||||||
<string name="pref_developer_euicc_memory_reset_desc">此操作是預設隱藏的危險操作。作為替代方案,您可以手動刪除所有設定檔。</string>
|
|
||||||
<string name="pref_developer_refresh_after_switch">向基帶發送刷新命令</string>
|
<string name="pref_developer_refresh_after_switch">向基帶發送刷新命令</string>
|
||||||
<string name="pref_developer_isdr_aid_list">自訂 ISD-R AID 列表</string>
|
<string name="pref_developer_isdr_aid_list">自訂 ISD-R AID 列表</string>
|
||||||
<string name="reset">重置</string>
|
<string name="reset">重置</string>
|
||||||
|
|
|
@ -195,8 +195,6 @@
|
||||||
<string name="pref_developer_unfiltered_profile_list_desc">Include non-production profiles in the list</string>
|
<string name="pref_developer_unfiltered_profile_list_desc">Include non-production profiles in the list</string>
|
||||||
<string name="pref_developer_ignore_tls_certificate">Ignore SM-DP+ TLS certificate</string>
|
<string name="pref_developer_ignore_tls_certificate">Ignore SM-DP+ TLS certificate</string>
|
||||||
<string name="pref_developer_ignore_tls_certificate_desc">Accept any TLS certificate used by the RSP server</string>
|
<string name="pref_developer_ignore_tls_certificate_desc">Accept any TLS certificate used by the RSP server</string>
|
||||||
<string name="pref_developer_euicc_memory_reset">Allow erasing eUICC</string>
|
|
||||||
<string name="pref_developer_euicc_memory_reset_desc">This is a dangerous operation and hidden by default. As an alternative, you can delete all profiles manually.</string>
|
|
||||||
<string name="pref_developer_isdr_aid_list">Customize ISD-R AID list</string>
|
<string name="pref_developer_isdr_aid_list">Customize ISD-R AID list</string>
|
||||||
<string name="pref_developer_isdr_aid_list_desc">Some brands of removable eUICCs may use their own non-standard ISD-R AID, rendering them inaccessible to third-party apps. We can attempt to use non-standard AIDs added in this list, but there is no guarantee that they will work.</string>
|
<string name="pref_developer_isdr_aid_list_desc">Some brands of removable eUICCs may use their own non-standard ISD-R AID, rendering them inaccessible to third-party apps. We can attempt to use non-standard AIDs added in this list, but there is no guarantee that they will work.</string>
|
||||||
<string name="pref_info">Info</string>
|
<string name="pref_info">Info</string>
|
||||||
|
|
|
@ -75,12 +75,6 @@
|
||||||
app:summary="@string/pref_developer_ignore_tls_certificate_desc"
|
app:summary="@string/pref_developer_ignore_tls_certificate_desc"
|
||||||
app:title="@string/pref_developer_ignore_tls_certificate" />
|
app:title="@string/pref_developer_ignore_tls_certificate" />
|
||||||
|
|
||||||
<CheckBoxPreference
|
|
||||||
app:iconSpaceReserved="false"
|
|
||||||
app:key="pref_developer_euicc_memory_reset"
|
|
||||||
app:summary="@string/pref_developer_euicc_memory_reset_desc"
|
|
||||||
app:title="@string/pref_developer_euicc_memory_reset" />
|
|
||||||
|
|
||||||
<Preference
|
<Preference
|
||||||
app:iconSpaceReserved="false"
|
app:iconSpaceReserved="false"
|
||||||
app:key="pref_developer_isdr_aid_list"
|
app:key="pref_developer_isdr_aid_list"
|
||||||
|
|
Loading…
Add table
Reference in a new issue