From d26fb0e3093c87a07e3490d370fd605190af46b0 Mon Sep 17 00:00:00 2001 From: septs Date: Wed, 23 Jul 2025 19:50:41 +0800 Subject: [PATCH] chore: cleanup short string ids --- .../core/DefaultEuiccChannelFactory.kt | 4 +-- .../angry/openeuicc/ui/EuiccInfoActivity.kt | 12 ++++----- .../im/angry/openeuicc/ui/MainActivity.kt | 2 +- .../openeuicc/ui/NotificationsActivity.kt | 2 +- .../DownloadWizardSlotSelectFragment.kt | 5 ++-- .../java/im/angry/openeuicc/util/UiUtils.kt | 4 +-- .../main/res/menu/activity_isdr_aid_list.xml | 2 +- .../src/main/res/menu/activity_main.xml | 2 +- .../main/res/menu/activity_notifications.xml | 2 +- app-common/src/main/res/values-ja/strings.xml | 16 ++++++------ .../src/main/res/values-zh-rCN/strings.xml | 16 ++++++------ .../src/main/res/values-zh-rTW/strings.xml | 16 ++++++------ app-common/src/main/res/values/strings.xml | 25 +++++++++++-------- .../core/PrivilegedEuiccChannelFactory.kt | 3 +-- app/src/main/res/values-ja/strings.xml | 2 +- app/src/main/res/values-zh-rCN/strings.xml | 2 +- app/src/main/res/values-zh-rTW/strings.xml | 2 +- app/src/main/res/values/strings.xml | 2 +- 18 files changed, 60 insertions(+), 59 deletions(-) diff --git a/app-common/src/main/java/im/angry/openeuicc/core/DefaultEuiccChannelFactory.kt b/app-common/src/main/java/im/angry/openeuicc/core/DefaultEuiccChannelFactory.kt index 0de99b5..87a0eea 100644 --- a/app-common/src/main/java/im/angry/openeuicc/core/DefaultEuiccChannelFactory.kt +++ b/app-common/src/main/java/im/angry/openeuicc/core/DefaultEuiccChannelFactory.kt @@ -37,7 +37,7 @@ open class DefaultEuiccChannelFactory(protected val context: Context) : EuiccCha ) try { return EuiccChannelImpl( - context.getString(R.string.omapi), + context.getString(R.string.channel_type_omapi), port, intrinsicChannelName = null, OmapiApduInterface( @@ -69,7 +69,7 @@ open class DefaultEuiccChannelFactory(protected val context: Context) : EuiccCha ): EuiccChannel? { try { return EuiccChannelImpl( - context.getString(R.string.usb), + context.getString(R.string.channel_type_usb), FakeUiccPortInfoCompat(FakeUiccCardInfoCompat(EuiccChannelManager.USB_CHANNEL_ID)), intrinsicChannelName = ccidCtx.productName, UsbApduInterface( diff --git a/app-common/src/main/java/im/angry/openeuicc/ui/EuiccInfoActivity.kt b/app-common/src/main/java/im/angry/openeuicc/ui/EuiccInfoActivity.kt index 4a34edd..bfbcbd8 100644 --- a/app-common/src/main/java/im/angry/openeuicc/ui/EuiccInfoActivity.kt +++ b/app-common/src/main/java/im/angry/openeuicc/ui/EuiccInfoActivity.kt @@ -36,7 +36,7 @@ private val RE_SAS = Regex( class EuiccInfoActivity : BaseEuiccAccessActivity(), OpenEuiccContextMarker { companion object { - private val YES_NO = Pair(R.string.yes, R.string.no) + private val YES_NO = Pair(R.string.euicc_info_yes, R.string.euicc_info_no) } private lateinit var swipeRefresh: SwipeRefreshLayout @@ -69,7 +69,7 @@ class EuiccInfoActivity : BaseEuiccAccessActivity(), OpenEuiccContextMarker { logicalSlotId = intent.getIntExtra("logicalSlotId", 0) val channelTitle = if (logicalSlotId == EuiccChannelManager.USB_CHANNEL_ID) { - getString(R.string.usb) + getString(R.string.channel_type_usb) } else { appContainer.customizableTextProvider.formatInternalChannelName(logicalSlotId) } @@ -119,7 +119,7 @@ class EuiccInfoActivity : BaseEuiccAccessActivity(), OpenEuiccContextMarker { channel.lpa.euiccInfo2?.let { info -> add(Item(R.string.euicc_info_sgp22_version, info.sgp22Version.toString())) add(Item(R.string.euicc_info_firmware_version, info.euiccFirmwareVersion.toString())) - add(Item(R.string.euicc_info_globalplatform_version, info.globalPlatformVersion.toString())) + add(Item(R.string.euicc_info_gp_version, info.globalPlatformVersion.toString())) add(Item(R.string.euicc_info_pp_version, info.ppVersion.toString())) info.sasAccreditationNumber.trim().takeIf(RE_SAS::matches) ?.let { add(Item(R.string.euicc_info_sas_accreditation_number, it.uppercase())) } @@ -131,14 +131,14 @@ class EuiccInfoActivity : BaseEuiccAccessActivity(), OpenEuiccContextMarker { // FS.27 v2.0, Security Guidelines for UICC Profiles (Page 25 of 27, 2024-01-30) // https://www.gsma.com/solutions-and-impact/technologies/security/wp-content/uploads/2024/01/FS.27-Security-Guidelines-for-UICC-Credentials-v2.0-FINAL-23-July.pdf#page=25 val resId = when { - signers.isEmpty() -> R.string.unknown // the case is not mp, but it's is not common + signers.isEmpty() -> R.string.euicc_info_unknown // the case is not mp, but it's is not common PKID_GSMA_LIVE_CI.any(signers::contains) -> R.string.euicc_info_ci_gsma_live PKID_GSMA_TEST_CI.any(signers::contains) -> R.string.euicc_info_ci_gsma_test else -> R.string.euicc_info_ci_unknown } add(Item(R.string.euicc_info_ci_type, getString(resId))) } - val atr = channel.atr?.encodeHex() ?: getString(R.string.information_unavailable) + val atr = channel.atr?.encodeHex() ?: getString(R.string.euicc_info_unavailable) add(Item(R.string.euicc_info_atr, atr, copiedToastResId = R.string.toast_atr_copied)) } @@ -171,7 +171,7 @@ class EuiccInfoActivity : BaseEuiccAccessActivity(), OpenEuiccContextMarker { fun bind(item: Item) { copiedToastResId = item.copiedToastResId title.setText(item.titleResId) - content.text = item.content ?: getString(R.string.unknown) + content.text = item.content ?: getString(R.string.euicc_info_unknown) } } 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 01d0ab2..b42f4cf 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 @@ -174,7 +174,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 { - val productName = it.productName ?: getString(R.string.usb) + val productName = it.productName ?: getString(R.string.channel_type_usb) newPages.add(Page(EuiccChannelManager.USB_CHANNEL_ID, productName) { UsbCcidReaderFragment() }) 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 21a2d40..07d5f13 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 @@ -60,7 +60,7 @@ class NotificationsActivity: BaseEuiccAccessActivity(), OpenEuiccContextMarker { // 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 (logicalSlotId == EuiccChannelManager.USB_CHANNEL_ID) { - getString(R.string.usb) + getString(R.string.channel_type_usb) } else { appContainer.customizableTextProvider.formatInternalChannelName(logicalSlotId) } diff --git a/app-common/src/main/java/im/angry/openeuicc/ui/wizard/DownloadWizardSlotSelectFragment.kt b/app-common/src/main/java/im/angry/openeuicc/ui/wizard/DownloadWizardSlotSelectFragment.kt index 28bc9f0..8097058 100644 --- a/app-common/src/main/java/im/angry/openeuicc/ui/wizard/DownloadWizardSlotSelectFragment.kt +++ b/app-common/src/main/java/im/angry/openeuicc/ui/wizard/DownloadWizardSlotSelectFragment.kt @@ -19,7 +19,6 @@ import im.angry.openeuicc.util.* import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.toList import kotlinx.coroutines.launch -import net.typeblog.lpac_jni.LocalProfileInfo class DownloadWizardSlotSelectFragment : DownloadWizardActivity.DownloadWizardStepFragment() { companion object { @@ -187,12 +186,12 @@ class DownloadWizardSlotSelectFragment : DownloadWizardActivity.DownloadWizardSt } title.text = if (item.logicalSlotId == EuiccChannelManager.USB_CHANNEL_ID) { - item.intrinsicChannelName ?: root.context.getString(R.string.usb) + item.intrinsicChannelName ?: root.context.getString(R.string.channel_type_usb) } else { appContainer.customizableTextProvider.formatInternalChannelName(item.logicalSlotId) } eID.text = item.eID - activeProfile.text = item.enabledProfileName ?: root.context.getString(R.string.unknown) + activeProfile.text = item.enabledProfileName ?: root.context.getString(R.string.profile_no_enabled_profile) freeSpace.text = formatFreeSpace(item.freeSpace) checkBox.isChecked = adapter.currentSelectedIdx == idx } diff --git a/app-common/src/main/java/im/angry/openeuicc/util/UiUtils.kt b/app-common/src/main/java/im/angry/openeuicc/util/UiUtils.kt index a73d7fe..c7c859d 100644 --- a/app-common/src/main/java/im/angry/openeuicc/util/UiUtils.kt +++ b/app-common/src/main/java/im/angry/openeuicc/util/UiUtils.kt @@ -102,8 +102,8 @@ fun T.setupLogSaving( AlertDialog.Builder(context).apply { setMessage(R.string.logs_saved_message) - setNegativeButton(R.string.no) { _, _ -> } - setPositiveButton(R.string.yes) { _, _ -> + setNegativeButton(android.R.string.cancel) { _, _ -> } + setPositiveButton(android.R.string.ok) { _, _ -> val intent = Intent(Intent.ACTION_SEND).apply { type = "text/plain" clipData = ClipData.newUri(context.contentResolver, lastFileName, uri) diff --git a/app-common/src/main/res/menu/activity_isdr_aid_list.xml b/app-common/src/main/res/menu/activity_isdr_aid_list.xml index 32f178a..99492d6 100644 --- a/app-common/src/main/res/menu/activity_isdr_aid_list.xml +++ b/app-common/src/main/res/menu/activity_isdr_aid_list.xml @@ -9,7 +9,7 @@ \ No newline at end of file diff --git a/app-common/src/main/res/menu/activity_main.xml b/app-common/src/main/res/menu/activity_main.xml index 0e00292..c15663f 100644 --- a/app-common/src/main/res/menu/activity_main.xml +++ b/app-common/src/main/res/menu/activity_main.xml @@ -3,7 +3,7 @@ xmlns:app="http://schemas.android.com/apk/res-auto"> diff --git a/app-common/src/main/res/menu/activity_notifications.xml b/app-common/src/main/res/menu/activity_notifications.xml index 87f96a6..b80e06e 100644 --- a/app-common/src/main/res/menu/activity_notifications.xml +++ b/app-common/src/main/res/menu/activity_notifications.xml @@ -4,6 +4,6 @@ \ No newline at end of file diff --git a/app-common/src/main/res/values-ja/strings.xml b/app-common/src/main/res/values-ja/strings.xml index e631d52..946625f 100644 --- a/app-common/src/main/res/values-ja/strings.xml +++ b/app-common/src/main/res/values-ja/strings.xml @@ -2,10 +2,10 @@ このアプリでアクセスできるリムーバブル eUICC カードがデバイス上で検出されていません。互換性のあるカード挿入または USB リーダーを接続してください。 この eSIM にはプロファイルがありません。 - 不明 - 情報がありません - ヘルプ - スロットを再読み込み + 不明 + 情報がありません + ヘルプ + スロットを再読み込み 論理スロット %d 有効済み 無効済み @@ -110,7 +110,7 @@ 製品ファームウェアバージョン SGP.22 バージョン eUICC OS バージョン - グローバルプラットフォームのバージョン + グローバルプラットフォームのバージョン SAS 認定番号 保護されたプロファイルのバージョン NVRAM の空き容量 (eSIM プロファイルストレージ) @@ -118,8 +118,8 @@ GSMA ライブ CI GSMA テスト CI 不明な eSIM CI - はい - いいえ + はい + いいえ 保存 %s のログ 開発者になるまであと %d ステップです。 @@ -167,6 +167,6 @@ この操作は、デフォルトでは非表示になっている危険な操作です。代わりに、すべての構成ファイルを手動で削除することもできます。 モデムに更新コマンドを送信 ISD-R AID リストのカスタマイズ - リセット + リセット ISD-R AID リスト diff --git a/app-common/src/main/res/values-zh-rCN/strings.xml b/app-common/src/main/res/values-zh-rCN/strings.xml index b0938d3..e947c6a 100644 --- a/app-common/src/main/res/values-zh-rCN/strings.xml +++ b/app-common/src/main/res/values-zh-rCN/strings.xml @@ -2,9 +2,9 @@ 在此设备上未检测到此应用程序可访问的可插拔 eUICC 卡。请插入兼容卡或 USB 读卡器。 此 eSIM 上还没有配置文件 - 未知 - 帮助 - 重新加载卡槽 + 未知 + 帮助 + 重新加载卡槽 逻辑卡槽 %d 已启用 已禁用 @@ -132,7 +132,7 @@ 可插拔 SGP.22 版本 eUICC OS 版本 - GlobalPlatform 版本 + GlobalPlatform 版本 SAS 认证号码 Protected Profile 版本 NVRAM 剩余空间 (eSIM 存储容量) @@ -140,8 +140,8 @@ GSMA 生产环境 CI GSMA 测试 CI 未知 eSIM CI - - + + 还有 %d 步成为开发者 你现在是开发者了! 语言 @@ -152,7 +152,7 @@ 在配置文件列表中包括非生产环境的配置文件 无视 SM-DP+ 的 TLS 证书 允许 RSP 服务器使用任意证书 - 无信息 + 无信息 输入的确认文本不匹配 此芯片已被擦除 正在擦除 eSIM 芯片 @@ -167,6 +167,6 @@ 此操作是默认隐藏的危险操作。作为替代方案,您可以手动删除所有配置文件。 向基带发送刷新命令 自定义 ISD-R AID 列表 - 重置 + 重置 ISD-R AID 列表 \ No newline at end of file diff --git a/app-common/src/main/res/values-zh-rTW/strings.xml b/app-common/src/main/res/values-zh-rTW/strings.xml index e0334c6..88cc011 100644 --- a/app-common/src/main/res/values-zh-rTW/strings.xml +++ b/app-common/src/main/res/values-zh-rTW/strings.xml @@ -2,9 +2,9 @@ 在此裝置上未檢測到此應用程式可訪問的可插拔 eUICC 卡。請插入相容卡或 USB 晶片讀卡機。 此 eSIM 上還沒有設定檔 - 未知 - 幫助 - 重新載入卡槽 + 未知 + 幫助 + 重新載入卡槽 虛擬卡槽 %d 已啟用 已停用 @@ -132,7 +132,7 @@ 可插拔 SGP.22 版本 eUICC OS 版本 - GlobalPlatform 版本 + GlobalPlatform 版本 SAS 認證號碼 Protected Profile 版本 NVRAM 剩餘空間 (eSIM 儲存容量) @@ -140,8 +140,8 @@ GSMA 生產環境 CI GSMA 測試 CI 未知 eSIM CI - - + + 還有 %d 步成為開發者 您現在是開發者了! 語言 @@ -152,7 +152,7 @@ 在設定檔列表中包括非生產環境的設定檔 忽略 SM-DP+ 的 TLS 證書 允許 RSP 伺服器使用任意證書 - 無資訊 + 無資訊 輸入的確認文字不匹配 此晶片已被擦除 正在擦除 eSIM 晶片 @@ -167,6 +167,6 @@ 此操作是預設隱藏的危險操作。作為替代方案,您可以手動刪除所有設定檔。 向基帶發送刷新命令 自訂 ISD-R AID 列表 - 重置 + 重置 ISD-R AID 列表 \ No newline at end of file diff --git a/app-common/src/main/res/values/strings.xml b/app-common/src/main/res/values/strings.xml index d526238..e09da9f 100644 --- a/app-common/src/main/res/values/strings.xml +++ b/app-common/src/main/res/values/strings.xml @@ -2,14 +2,15 @@ No removable eUICC card accessible by this app is detected on this device. Insert a compatible card or a USB reader. No profiles (yet) on this eSIM. - Unknown - Information Unavailable - Help - Reload Slots + + Help + + Reload Slots + Unknown Logical Slot %d - USB - OpenMobile API (OMAPI) + USB + OpenMobile API (OMAPI) Enabled @@ -139,7 +140,7 @@ ISD-R AID SGP.22 Version eUICC OS Version - GlobalPlatform Version + GlobalPlatform Version SAS Accreditation Number Protected Profile Version Free NVRAM (eSIM profile storage) @@ -156,8 +157,11 @@ I CONFIRM TO ERASE THE CHIP WHOSE EID ENDS WITH %s AND UNDERSTAND THAT THIS IS IRREVERSIBLE Erase - Yes - No + + Yes + No + Unknown + Information Unavailable Save Logs at %s @@ -165,10 +169,9 @@ You are %d steps away from being a developer. You are now a developer! - Reset - ISD-R AID List Saved custom ISD-R AID list. + Reset Settings Notifications diff --git a/app/src/main/java/im/angry/openeuicc/core/PrivilegedEuiccChannelFactory.kt b/app/src/main/java/im/angry/openeuicc/core/PrivilegedEuiccChannelFactory.kt index 68eddef..978e886 100644 --- a/app/src/main/java/im/angry/openeuicc/core/PrivilegedEuiccChannelFactory.kt +++ b/app/src/main/java/im/angry/openeuicc/core/PrivilegedEuiccChannelFactory.kt @@ -2,7 +2,6 @@ package im.angry.openeuicc.core import android.content.Context import android.util.Log -import im.angry.openeuicc.OpenEuiccApplication import im.angry.openeuicc.R import im.angry.openeuicc.util.* import kotlinx.coroutines.flow.first @@ -32,7 +31,7 @@ class PrivilegedEuiccChannelFactory(context: Context) : DefaultEuiccChannelFacto ) try { return EuiccChannelImpl( - context.getString(R.string.telephony_manager), + context.getString(R.string.channel_type_telephony_manager), port, intrinsicChannelName = null, TelephonyManagerApduInterface( diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index acc1728..fbf5c53 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -1,7 +1,7 @@ このデバイスで eUICC が見つかりません。\nデバイスによってはアプリのメニューからデュアル SIM を有効化する必要があります。 - TelephonyManager (特権) + TelephonyManager (特権) デュアル SIM DSDS の状態が切り替わりました。モデムが再起動するまでお待ちください。 このスロットは MEP (Multiple Enabled Profiles) をサポートしています。この機能を有効化または無効化するには「スロットマッピングツール」を使用してください。 diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index d6befc2..acd9a61 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -16,7 +16,7 @@ 您的设备支持 eSIM。要连接到移动网络,请下载运营商发布的 eSIM,或插入物理 SIM 卡。 跳过 下载 eSIM - TelephonyManager (特权) + TelephonyManager (特权) 全局使用 TelephonyManager 在默认情况下,可移除 eUICC 将仅使用 OMAPI。这与非特权模式 (EasyEUICC) 一致。在某些设备上 OMAPI 可能存在问题 -- 选择此选项以强制使用 TelephonyManager。 \ No newline at end of file diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 10285d3..52b5aa8 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -16,7 +16,7 @@ 您的裝置支援 eSIM。要連線到行動網路,請下載電信業者釋出的 eSIM,或插入實體 SIM 卡。 跳過 下載 eSIM - TelephonyManager (特權) + TelephonyManager (特權) 全域使用 TelephonyManager 在預設情況下,可移除 eUICC 將僅使用 OMAPI。這與非特權模式 (EasyEUICC) 一致。在某些裝置上 OMAPI 可能有問題 -- 選擇此選項以強制使用 TelephonyManager。 \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index ddf17e4..2c26bc3 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,7 +1,7 @@ OpenEUICC No eUICC found on this device.\nOn some devices, you may need to enable dual SIM first in the menu of this app. - TelephonyManager (Privileged) + TelephonyManager (Privileged) Dual SIM -- 2.45.3