Android12 ——修改字符串

文章展示了在Android软件开发中修改字符串的过程,特别是在alps/vendor/mediatek/proprietary/packages/apps/MtkSettings应用的资源文件中。代码差异显示了如何针对不同语言环境调整字符串,以及注意DirectBoot情况下应用启动的限制。修改涉及AccessibilityServices的功能提示和设备重启后的行为。
摘要由CSDN通过智能技术生成

代码分析

修改字符串是做android 软件开发相对比较简单的,我们只需要grep到要改的字符串,对应的修改就可以了,注意修改语言不止中英文,看客户具体需求。

代码位置

alps/vendor/mediatek/proprietary/packages/apps/MtkSettings/res/values/strings.xml
alps/vendor/mediatek/proprietary/packages/apps/MtkSettings/res/values-zh-rCN/strings.xml    

具体代码

diff --git a/alps/vendor/mediatek/proprietary/packages/apps/MtkSettings/res/values/strings.xml b/alps/vendor/mediatek/proprietary/packages/apps/MtkSettings/res/values/strings.xml
index 50b409d..49de6c7 100755 (executable)
--- a/alps/vendor/mediatek/proprietary/packages/apps/MtkSettings/res/values/strings.xml
+++ b/alps/vendor/mediatek/proprietary/packages/apps/MtkSettings/res/values/strings.xml
@@ -10185,7 +10185,7 @@ dnd, schedule, notifications, block, silence, sleep, work, focus, sound, mute, d
     <string name="encrypt_talkback_dialog_message_password">When you enter your password to start this device, accessibility services like <xliff:g id="service" example="TalkBack">%1$s</xliff:g> won\u2019t yet be available.</string>
 
     <!-- [CHAR LIMIT=NONE] Dialog body explaining that the app just selected by the user will not work after a reboot until until after the user enters their credentials, such as a PIN or password. -->
-    <string name="direct_boot_unaware_dialog_message">Note: If you restart your phone and have a screen lock set, this app can\'t start until you unlock your phone</string>
+    <string name="direct_boot_unaware_dialog_message">Note: If you restart your tablet and have a screen lock set, this app can\'t start until you unlock your tablet</string>
 
     <!-- Title and summary for SIM Status -->
     <string name="imei_information_title">IMEI information</string>

diff --git a/alps/vendor/mediatek/proprietary/packages/apps/MtkSettings/res/values-zh-rCN/strings.xml b/alps/vendor/mediatek/proprietary/packages/apps/MtkSettings/res/values-zh-rCN/strings.xml
index f2618db..3786114 100755 (executable)
--- a/alps/vendor/mediatek/proprietary/packages/apps/MtkSettings/res/values-zh-rCN/strings.xml
+++ b/alps/vendor/mediatek/proprietary/packages/apps/MtkSettings/res/values-zh-rCN/strings.xml
@@ -4229,7 +4229,7 @@ name="zen_mode_restrict_notifications_hide_footer" product="tablet">"您的平
     <string name="encrypt_talkback_dialog_message_pin" msgid="4482887117824444481">"当您输入 PIN 码以启动此设备时,<xliff:g id="SERVICE">%1$s</xliff:g>等无障碍服务还未开启。"</string>
     <string name="encrypt_talkback_dialog_message_pattern" msgid="5156321541636018756">"当您绘制解锁图案以启动此设备时,<xliff:g id="SERVICE">%1$s</xliff:g>等无障碍服务还未开启。"</string>
     <string name="encrypt_talkback_dialog_message_password" msgid="1917287751192953034">"当您输入密码以启动此设备时,<xliff:g id="SERVICE">%1$s</xliff:g>等无障碍服务还未开启。"</string>
-    <string name="direct_boot_unaware_dialog_message" msgid="5766006106305996844">"注意:如果您重启手机并设置了屏幕锁定,则必须将手机解锁才能运行此应用"</string>
+    <string name="direct_boot_unaware_dialog_message" msgid="5766006106305996844">"注意:如果您重启平板并设置了屏幕锁定,则必须将平板解锁才能运行此应用"</string>
     <string name="imei_information_title" msgid="8703564992893669514">"IMEI 信息"</string>
     <string name="imei_information_summary" msgid="4763358372990258786">"IMEI相关信息"</string>
     <string name="slot_number" msgid="2663789411468530397">"(插槽<xliff:g id="SLOT_NUM">%1$d</xliff:g>)"</string>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值