整理:英文语言包&界面布局微调

优化:界面布局&用户体验优化
This commit is contained in:
pppscn 2022-01-24 22:38:34 +08:00
parent c6a4f4ccdc
commit 3ef7b7dc5b
32 changed files with 363 additions and 253 deletions

View File

@ -92,7 +92,7 @@ public class AppListActivity extends AppCompatActivity {
ClipData mClipData = ClipData.newPlainText("pkgName", appInfo.getPkgName()); ClipData mClipData = ClipData.newPlainText("pkgName", appInfo.getPkgName());
cm.setPrimaryClip(mClipData); cm.setPrimaryClip(mClipData);
Toast.makeText(AppListActivity.this, "已复制包名:" + appInfo.getPkgName(), Toast.LENGTH_LONG).show(); Toast.makeText(AppListActivity.this, getString(R.string.package_name_copied) + appInfo.getPkgName(), Toast.LENGTH_LONG).show();
}); });
listView.setOnItemLongClickListener((parent, view, position, id) -> { listView.setOnItemLongClickListener((parent, view, position, id) -> {
AppInfo appInfo = appInfoList.get(position); AppInfo appInfo = appInfoList.get(position);
@ -112,7 +112,7 @@ public class AppListActivity extends AppCompatActivity {
Message msg = new Message(); Message msg = new Message();
msg.what = NOTIFY; msg.what = NOTIFY;
Bundle bundle = new Bundle(); Bundle bundle = new Bundle();
bundle.putString("DATA", "user".equals(currentType) ? "正在加载用户应用,请稍候..." : "正在加载系统应用,请稍候..."); bundle.putString("DATA", "user".equals(currentType) ? getString(R.string.loading_user_app) : getString(R.string.loading_system_app));
msg.setData(bundle); msg.setData(bundle);
handler.sendMessage(msg); handler.sendMessage(msg);

View File

@ -99,7 +99,7 @@ public class CrashHandler implements UncaughtExceptionHandler {
@Override @Override
public void run() { public void run() {
Looper.prepare(); Looper.prepare();
Toast.makeText(mContext, "很抱歉,程序出现异常,即将退出.", Toast.LENGTH_LONG).show(); Toast.makeText(mContext, R.string.crash_tip, Toast.LENGTH_LONG).show();
Looper.loop(); Looper.loop();
} }
}.start(); }.start();

View File

@ -110,7 +110,7 @@ public class MainActivity extends AppCompatActivity implements RefreshListView.I
try { try {
HttpServer.update(); HttpServer.update();
} catch (Exception e) { } catch (Exception e) {
Log.e(TAG, "启用HttpServer:", e); Log.e(TAG, "Start HttpServer:", e);
} }
} }
@ -354,9 +354,9 @@ public class MainActivity extends AppCompatActivity implements RefreshListView.I
builder.setTitle(R.string.details); builder.setTitle(R.string.details);
String simInfo = logVo.getSimInfo(); String simInfo = logVo.getSimInfo();
if (simInfo != null) { if (simInfo != null) {
builder.setMessage("来源:" + logVo.getFrom() + "\n\n" + "消息:" + logVo.getContent() + "\n\n" + "卡槽:" + logVo.getSimInfo() + "\n\n" + "规则:" + logVo.getRule() + "\n\n" + "时间:" + TimeUtil.utc2Local(logVo.getTime()) + "\n\n转发结果\n" + logVo.getForwardResponse()); builder.setMessage(getString(R.string.from) + logVo.getFrom() + "\n\n" + getString(R.string.msg) + logVo.getContent() + "\n\n" + getString(R.string.slot) + logVo.getSimInfo() + "\n\n" + getString(R.string.rule) + logVo.getRule() + "\n\n" + getString(R.string.time) + TimeUtil.utc2Local(logVo.getTime()) + getString(R.string.result) + logVo.getForwardResponse());
} else { } else {
builder.setMessage("来源:" + logVo.getFrom() + "\n\n" + "消息:" + logVo.getContent() + "\n\n" + "规则:" + logVo.getRule() + "\n\n" + "时间:" + TimeUtil.utc2Local(logVo.getTime()) + "\n\n转发结果\n" + logVo.getForwardResponse()); builder.setMessage(getString(R.string.from) + logVo.getFrom() + "\n\n" + getString(R.string.msg) + logVo.getContent() + "\n\n" + getString(R.string.rule) + logVo.getRule() + "\n\n" + getString(R.string.time) + TimeUtil.utc2Local(logVo.getTime()) + getString(R.string.result) + logVo.getForwardResponse());
} }
//删除 //删除
builder.setNegativeButton(R.string.del, (dialog, which) -> { builder.setNegativeButton(R.string.del, (dialog, which) -> {
@ -377,7 +377,7 @@ public class MainActivity extends AppCompatActivity implements RefreshListView.I
}); });
//对于发送失败的消息添加重发按钮 //对于发送失败的消息添加重发按钮
if (logVo.getForwardStatus() != 2) { if (logVo.getForwardStatus() != 2) {
builder.setPositiveButton("重发消息", (dialog, which) -> { builder.setPositiveButton(R.string.resend, (dialog, which) -> {
Toast.makeText(MainActivity.this, R.string.resend_toast, Toast.LENGTH_SHORT).show(); Toast.makeText(MainActivity.this, R.string.resend_toast, Toast.LENGTH_SHORT).show();
SendUtil.resendMsgByLog(MainActivity.this, handler, logVo); SendUtil.resendMsgByLog(MainActivity.this, handler, logVo);
dialog.dismiss(); dialog.dismiss();

View File

@ -381,49 +381,49 @@ public class RuleActivity extends AppCompatActivity {
buttonInsertSender.setOnClickListener(view -> { buttonInsertSender.setOnClickListener(view -> {
textSmsTemplate.setFocusable(true); textSmsTemplate.setFocusable(true);
textSmsTemplate.requestFocus(); textSmsTemplate.requestFocus();
CommonUtil.insertOrReplaceText2Cursor(textSmsTemplate, "{{来源号码}}"); CommonUtil.insertOrReplaceText2Cursor(textSmsTemplate, getString(R.string.tag_from));
}); });
Button buttonInsertContent = view1.findViewById(R.id.bt_insert_content); Button buttonInsertContent = view1.findViewById(R.id.bt_insert_content);
buttonInsertContent.setOnClickListener(view -> { buttonInsertContent.setOnClickListener(view -> {
textSmsTemplate.setFocusable(true); textSmsTemplate.setFocusable(true);
textSmsTemplate.requestFocus(); textSmsTemplate.requestFocus();
CommonUtil.insertOrReplaceText2Cursor(textSmsTemplate, "{{短信内容}}"); CommonUtil.insertOrReplaceText2Cursor(textSmsTemplate, getString(R.string.tag_sms));
}); });
Button buttonInsertSenderApp = view1.findViewById(R.id.bt_insert_sender_app); Button buttonInsertSenderApp = view1.findViewById(R.id.bt_insert_sender_app);
buttonInsertSenderApp.setOnClickListener(view -> { buttonInsertSenderApp.setOnClickListener(view -> {
textSmsTemplate.setFocusable(true); textSmsTemplate.setFocusable(true);
textSmsTemplate.requestFocus(); textSmsTemplate.requestFocus();
CommonUtil.insertOrReplaceText2Cursor(textSmsTemplate, "{{APP包名}}"); CommonUtil.insertOrReplaceText2Cursor(textSmsTemplate, getString(R.string.tag_package_name));
}); });
Button buttonInsertContentApp = view1.findViewById(R.id.bt_insert_content_app); Button buttonInsertContentApp = view1.findViewById(R.id.bt_insert_content_app);
buttonInsertContentApp.setOnClickListener(view -> { buttonInsertContentApp.setOnClickListener(view -> {
textSmsTemplate.setFocusable(true); textSmsTemplate.setFocusable(true);
textSmsTemplate.requestFocus(); textSmsTemplate.requestFocus();
CommonUtil.insertOrReplaceText2Cursor(textSmsTemplate, "{{通知内容}}"); CommonUtil.insertOrReplaceText2Cursor(textSmsTemplate, getString(R.string.tag_msg));
}); });
Button buttonInsertExtra = view1.findViewById(R.id.bt_insert_extra); Button buttonInsertExtra = view1.findViewById(R.id.bt_insert_extra);
buttonInsertExtra.setOnClickListener(view -> { buttonInsertExtra.setOnClickListener(view -> {
textSmsTemplate.setFocusable(true); textSmsTemplate.setFocusable(true);
textSmsTemplate.requestFocus(); textSmsTemplate.requestFocus();
CommonUtil.insertOrReplaceText2Cursor(textSmsTemplate, "{{卡槽信息}}"); CommonUtil.insertOrReplaceText2Cursor(textSmsTemplate, getString(R.string.tag_card_slot));
}); });
Button buttonInsertTime = view1.findViewById(R.id.bt_insert_time); Button buttonInsertTime = view1.findViewById(R.id.bt_insert_time);
buttonInsertTime.setOnClickListener(view -> { buttonInsertTime.setOnClickListener(view -> {
textSmsTemplate.setFocusable(true); textSmsTemplate.setFocusable(true);
textSmsTemplate.requestFocus(); textSmsTemplate.requestFocus();
CommonUtil.insertOrReplaceText2Cursor(textSmsTemplate, "{{接收时间}}"); CommonUtil.insertOrReplaceText2Cursor(textSmsTemplate, getString(R.string.tag_receive_time));
}); });
Button buttonInsertDeviceName = view1.findViewById(R.id.bt_insert_device_name); Button buttonInsertDeviceName = view1.findViewById(R.id.bt_insert_device_name);
buttonInsertDeviceName.setOnClickListener(view -> { buttonInsertDeviceName.setOnClickListener(view -> {
textSmsTemplate.setFocusable(true); textSmsTemplate.setFocusable(true);
textSmsTemplate.requestFocus(); textSmsTemplate.requestFocus();
CommonUtil.insertOrReplaceText2Cursor(textSmsTemplate, "{{设备名称}}"); CommonUtil.insertOrReplaceText2Cursor(textSmsTemplate, getString(R.string.tag_device_name));
}); });
//正则替换 //正则替换

View File

@ -655,28 +655,28 @@ public class SenderActivity extends AppCompatActivity {
buttonInsertSender.setOnClickListener(view -> { buttonInsertSender.setOnClickListener(view -> {
editTextEmailTitle.setFocusable(true); editTextEmailTitle.setFocusable(true);
editTextEmailTitle.requestFocus(); editTextEmailTitle.requestFocus();
CommonUtil.insertOrReplaceText2Cursor(editTextEmailTitle, "{{来源号码}}"); CommonUtil.insertOrReplaceText2Cursor(editTextEmailTitle, getString(R.string.tag_from));
}); });
Button buttonInsertExtra = view1.findViewById(R.id.bt_insert_extra); Button buttonInsertExtra = view1.findViewById(R.id.bt_insert_extra);
buttonInsertExtra.setOnClickListener(view -> { buttonInsertExtra.setOnClickListener(view -> {
editTextEmailTitle.setFocusable(true); editTextEmailTitle.setFocusable(true);
editTextEmailTitle.requestFocus(); editTextEmailTitle.requestFocus();
CommonUtil.insertOrReplaceText2Cursor(editTextEmailTitle, "{{卡槽信息}}"); CommonUtil.insertOrReplaceText2Cursor(editTextEmailTitle, getString(R.string.tag_card_slot));
}); });
Button buttonInsertTime = view1.findViewById(R.id.bt_insert_time); Button buttonInsertTime = view1.findViewById(R.id.bt_insert_time);
buttonInsertTime.setOnClickListener(view -> { buttonInsertTime.setOnClickListener(view -> {
editTextEmailTitle.setFocusable(true); editTextEmailTitle.setFocusable(true);
editTextEmailTitle.requestFocus(); editTextEmailTitle.requestFocus();
CommonUtil.insertOrReplaceText2Cursor(editTextEmailTitle, "{{接收时间}}"); CommonUtil.insertOrReplaceText2Cursor(editTextEmailTitle, getString(R.string.tag_receive_time));
}); });
Button buttonInsertDeviceName = view1.findViewById(R.id.bt_insert_device_name); Button buttonInsertDeviceName = view1.findViewById(R.id.bt_insert_device_name);
buttonInsertDeviceName.setOnClickListener(view -> { buttonInsertDeviceName.setOnClickListener(view -> {
editTextEmailTitle.setFocusable(true); editTextEmailTitle.setFocusable(true);
editTextEmailTitle.requestFocus(); editTextEmailTitle.requestFocus();
CommonUtil.insertOrReplaceText2Cursor(editTextEmailTitle, "{{设备名称}}"); CommonUtil.insertOrReplaceText2Cursor(editTextEmailTitle, getString(R.string.tag_device_name));
}); });
} }
@ -1770,28 +1770,28 @@ public class SenderActivity extends AppCompatActivity {
buttonInsertSender.setOnClickListener(view -> { buttonInsertSender.setOnClickListener(view -> {
editTextPushPlusTitle.setFocusable(true); editTextPushPlusTitle.setFocusable(true);
editTextPushPlusTitle.requestFocus(); editTextPushPlusTitle.requestFocus();
CommonUtil.insertOrReplaceText2Cursor(editTextPushPlusTitle, "{{来源号码}}"); CommonUtil.insertOrReplaceText2Cursor(editTextPushPlusTitle, getString(R.string.tag_from));
}); });
Button buttonInsertExtra = view1.findViewById(R.id.bt_insert_extra); Button buttonInsertExtra = view1.findViewById(R.id.bt_insert_extra);
buttonInsertExtra.setOnClickListener(view -> { buttonInsertExtra.setOnClickListener(view -> {
editTextPushPlusTitle.setFocusable(true); editTextPushPlusTitle.setFocusable(true);
editTextPushPlusTitle.requestFocus(); editTextPushPlusTitle.requestFocus();
CommonUtil.insertOrReplaceText2Cursor(editTextPushPlusTitle, "{{卡槽信息}}"); CommonUtil.insertOrReplaceText2Cursor(editTextPushPlusTitle, getString(R.string.tag_card_slot));
}); });
Button buttonInsertTime = view1.findViewById(R.id.bt_insert_time); Button buttonInsertTime = view1.findViewById(R.id.bt_insert_time);
buttonInsertTime.setOnClickListener(view -> { buttonInsertTime.setOnClickListener(view -> {
editTextPushPlusTitle.setFocusable(true); editTextPushPlusTitle.setFocusable(true);
editTextPushPlusTitle.requestFocus(); editTextPushPlusTitle.requestFocus();
CommonUtil.insertOrReplaceText2Cursor(editTextPushPlusTitle, "{{接收时间}}"); CommonUtil.insertOrReplaceText2Cursor(editTextPushPlusTitle, getString(R.string.tag_receive_time));
}); });
Button buttonInsertDeviceName = view1.findViewById(R.id.bt_insert_device_name); Button buttonInsertDeviceName = view1.findViewById(R.id.bt_insert_device_name);
buttonInsertDeviceName.setOnClickListener(view -> { buttonInsertDeviceName.setOnClickListener(view -> {
editTextPushPlusTitle.setFocusable(true); editTextPushPlusTitle.setFocusable(true);
editTextPushPlusTitle.requestFocus(); editTextPushPlusTitle.requestFocus();
CommonUtil.insertOrReplaceText2Cursor(editTextPushPlusTitle, "{{设备名称}}"); CommonUtil.insertOrReplaceText2Cursor(editTextPushPlusTitle, getString(R.string.tag_device_name));
}); });
} }
@ -1915,28 +1915,28 @@ public class SenderActivity extends AppCompatActivity {
buttonInsertSender.setOnClickListener(view -> { buttonInsertSender.setOnClickListener(view -> {
editTextGotifyTitle.setFocusable(true); editTextGotifyTitle.setFocusable(true);
editTextGotifyTitle.requestFocus(); editTextGotifyTitle.requestFocus();
CommonUtil.insertOrReplaceText2Cursor(editTextGotifyTitle, "{{来源号码}}"); CommonUtil.insertOrReplaceText2Cursor(editTextGotifyTitle, getString(R.string.tag_from));
}); });
Button buttonInsertExtra = view1.findViewById(R.id.bt_insert_extra); Button buttonInsertExtra = view1.findViewById(R.id.bt_insert_extra);
buttonInsertExtra.setOnClickListener(view -> { buttonInsertExtra.setOnClickListener(view -> {
editTextGotifyTitle.setFocusable(true); editTextGotifyTitle.setFocusable(true);
editTextGotifyTitle.requestFocus(); editTextGotifyTitle.requestFocus();
CommonUtil.insertOrReplaceText2Cursor(editTextGotifyTitle, "{{卡槽信息}}"); CommonUtil.insertOrReplaceText2Cursor(editTextGotifyTitle, getString(R.string.tag_card_slot));
}); });
Button buttonInsertTime = view1.findViewById(R.id.bt_insert_time); Button buttonInsertTime = view1.findViewById(R.id.bt_insert_time);
buttonInsertTime.setOnClickListener(view -> { buttonInsertTime.setOnClickListener(view -> {
editTextGotifyTitle.setFocusable(true); editTextGotifyTitle.setFocusable(true);
editTextGotifyTitle.requestFocus(); editTextGotifyTitle.requestFocus();
CommonUtil.insertOrReplaceText2Cursor(editTextGotifyTitle, "{{接收时间}}"); CommonUtil.insertOrReplaceText2Cursor(editTextGotifyTitle, getString(R.string.tag_receive_time));
}); });
Button buttonInsertDeviceName = view1.findViewById(R.id.bt_insert_device_name); Button buttonInsertDeviceName = view1.findViewById(R.id.bt_insert_device_name);
buttonInsertDeviceName.setOnClickListener(view -> { buttonInsertDeviceName.setOnClickListener(view -> {
editTextGotifyTitle.setFocusable(true); editTextGotifyTitle.setFocusable(true);
editTextGotifyTitle.requestFocus(); editTextGotifyTitle.requestFocus();
CommonUtil.insertOrReplaceText2Cursor(editTextGotifyTitle, "{{设备名称}}"); CommonUtil.insertOrReplaceText2Cursor(editTextGotifyTitle, getString(R.string.tag_device_name));
}); });
} }

View File

@ -150,7 +150,7 @@ public class SettingActivity extends AppCompatActivity {
switch_enable_phone.setOnCheckedChangeListener((buttonView, isChecked) -> { switch_enable_phone.setOnCheckedChangeListener((buttonView, isChecked) -> {
if (isChecked && !SettingUtil.getSwitchCallType1() && !SettingUtil.getSwitchCallType2() && !SettingUtil.getSwitchCallType3()) { if (isChecked && !SettingUtil.getSwitchCallType1() && !SettingUtil.getSwitchCallType2() && !SettingUtil.getSwitchCallType3()) {
Toast.makeText(context, "必选选择一个通话类型,才能开启通话记录转发!", Toast.LENGTH_SHORT).show(); Toast.makeText(context, R.string.enable_phone_fw_tips, Toast.LENGTH_SHORT).show();
SettingUtil.switchEnablePhone(false); SettingUtil.switchEnablePhone(false);
return; return;
} }
@ -163,7 +163,7 @@ public class SettingActivity extends AppCompatActivity {
check_box_call_type_1.setOnCheckedChangeListener((buttonView, isChecked) -> { check_box_call_type_1.setOnCheckedChangeListener((buttonView, isChecked) -> {
SettingUtil.switchCallType1(isChecked); SettingUtil.switchCallType1(isChecked);
if (!isChecked && !SettingUtil.getSwitchCallType1() && !SettingUtil.getSwitchCallType2() && !SettingUtil.getSwitchCallType3()) { if (!isChecked && !SettingUtil.getSwitchCallType1() && !SettingUtil.getSwitchCallType2() && !SettingUtil.getSwitchCallType3()) {
Toast.makeText(context, "必选选择一个通话类型,才能开启通话记录转发!", Toast.LENGTH_SHORT).show(); Toast.makeText(context, R.string.enable_phone_fw_tips, Toast.LENGTH_SHORT).show();
SettingUtil.switchEnablePhone(false); SettingUtil.switchEnablePhone(false);
} }
}); });
@ -171,7 +171,7 @@ public class SettingActivity extends AppCompatActivity {
check_box_call_type_2.setOnCheckedChangeListener((buttonView, isChecked) -> { check_box_call_type_2.setOnCheckedChangeListener((buttonView, isChecked) -> {
SettingUtil.switchCallType2(isChecked); SettingUtil.switchCallType2(isChecked);
if (!isChecked && !SettingUtil.getSwitchCallType1() && !SettingUtil.getSwitchCallType2() && !SettingUtil.getSwitchCallType3()) { if (!isChecked && !SettingUtil.getSwitchCallType1() && !SettingUtil.getSwitchCallType2() && !SettingUtil.getSwitchCallType3()) {
Toast.makeText(context, "必选选择一个通话类型,才能开启通话记录转发!", Toast.LENGTH_SHORT).show(); Toast.makeText(context, R.string.enable_phone_fw_tips, Toast.LENGTH_SHORT).show();
SettingUtil.switchEnablePhone(false); SettingUtil.switchEnablePhone(false);
} }
}); });
@ -179,7 +179,7 @@ public class SettingActivity extends AppCompatActivity {
check_box_call_type_3.setOnCheckedChangeListener((buttonView, isChecked) -> { check_box_call_type_3.setOnCheckedChangeListener((buttonView, isChecked) -> {
SettingUtil.switchCallType3(isChecked); SettingUtil.switchCallType3(isChecked);
if (!isChecked && !SettingUtil.getSwitchCallType1() && !SettingUtil.getSwitchCallType2() && !SettingUtil.getSwitchCallType3()) { if (!isChecked && !SettingUtil.getSwitchCallType1() && !SettingUtil.getSwitchCallType2() && !SettingUtil.getSwitchCallType3()) {
Toast.makeText(context, "必选选择一个通话类型,才能开启通话记录转发!", Toast.LENGTH_SHORT).show(); Toast.makeText(context, R.string.enable_phone_fw_tips, Toast.LENGTH_SHORT).show();
SettingUtil.switchEnablePhone(false); SettingUtil.switchEnablePhone(false);
} }
}); });
@ -199,10 +199,10 @@ public class SettingActivity extends AppCompatActivity {
if (isChecked) { if (isChecked) {
if (!CommonUtil.isNotificationListenerServiceEnabled(this)) { if (!CommonUtil.isNotificationListenerServiceEnabled(this)) {
CommonUtil.openNotificationAccess(this); CommonUtil.openNotificationAccess(this);
Toast.makeText(this, "请先授予《短信转发器》通知使用权否则无法转发APP通知开启失败!", Toast.LENGTH_LONG).show(); Toast.makeText(this, R.string.tips_notification_listener, Toast.LENGTH_LONG).show();
return; return;
} else { } else {
Toast.makeText(this, "通知服务已开启", Toast.LENGTH_LONG).show(); Toast.makeText(this, R.string.notification_service_is_on, Toast.LENGTH_LONG).show();
CommonUtil.toggleNotificationListenerService(this); CommonUtil.toggleNotificationListenerService(this);
} }
} }
@ -252,7 +252,7 @@ public class SettingActivity extends AppCompatActivity {
switch_enable_send_sms.setOnCheckedChangeListener((buttonView, isChecked) -> { switch_enable_send_sms.setOnCheckedChangeListener((buttonView, isChecked) -> {
String webServer = editText_text_send_sms.getText().trim(); String webServer = editText_text_send_sms.getText().trim();
if (isChecked && !CommonUtil.checkUrl(webServer, false)) { if (isChecked && !CommonUtil.checkUrl(webServer, false)) {
HttpUtil.Toast(TAG, "url为空或不正确无法启用"); HttpUtil.Toast(TAG, getString(R.string.invalid_webserver));
switch_enable_send_sms.setChecked(false); switch_enable_send_sms.setChecked(false);
return; return;
} }
@ -340,7 +340,7 @@ public class SettingActivity extends AppCompatActivity {
cb_battery_level_alarm_once.setOnCheckedChangeListener((buttonView, isChecked) -> { cb_battery_level_alarm_once.setOnCheckedChangeListener((buttonView, isChecked) -> {
SettingUtil.switchBatteryLevelAlarmOnce(isChecked); SettingUtil.switchBatteryLevelAlarmOnce(isChecked);
if (isChecked && 0 == SettingUtil.getBatteryLevelAlarmMin() && 0 == SettingUtil.getBatteryLevelAlarmMax()) { if (isChecked && 0 == SettingUtil.getBatteryLevelAlarmMin() && 0 == SettingUtil.getBatteryLevelAlarmMax()) {
Toast.makeText(context, "【注意】电量预警阈值上下限都是0持续提醒不起作用", Toast.LENGTH_SHORT).show(); Toast.makeText(context, R.string.tips_battery_level_alarm_once, Toast.LENGTH_SHORT).show();
SettingUtil.switchEnablePhone(false); SettingUtil.switchEnablePhone(false);
} }
}); });
@ -493,7 +493,7 @@ public class SettingActivity extends AppCompatActivity {
//跳转自启动页面 //跳转自启动页面
public static void startToAutoStartSetting(Context context) { public static void startToAutoStartSetting(Context context) {
Log.e("Util", "******************当前手机型号为:" + Build.MANUFACTURER); Log.e("Util", "******************The current phone model is:" + Build.MANUFACTURER);
Set<Map.Entry<String, List<String>>> entries = hashMap.entrySet(); Set<Map.Entry<String, List<String>>> entries = hashMap.entrySet();
boolean has = false; boolean has = false;
@ -524,7 +524,7 @@ public class SettingActivity extends AppCompatActivity {
} }
} }
if (!has) { if (!has) {
Toast.makeText(context, "兼容方案", Toast.LENGTH_SHORT).show(); Toast.makeText(context, R.string.tips_compatible_solution, Toast.LENGTH_SHORT).show();
try { try {
Intent intent = new Intent(); Intent intent = new Intent();
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
@ -686,7 +686,7 @@ public class SettingActivity extends AppCompatActivity {
} }
//设置转发时启用自定义模版 //设置转发时启用自定义模版
@SuppressLint("UseSwitchCompatOrMaterialCode") @SuppressLint({"UseSwitchCompatOrMaterialCode", "SetTextI18n"})
private void switchSmsTemplate(Switch switch_sms_template) { private void switchSmsTemplate(Switch switch_sms_template) {
boolean isOn = SettingUtil.getSwitchSmsTemplate(); boolean isOn = SettingUtil.getSwitchSmsTemplate();
switch_sms_template.setChecked(isOn); switch_sms_template.setChecked(isOn);
@ -700,7 +700,11 @@ public class SettingActivity extends AppCompatActivity {
layout_sms_template.setVisibility(isChecked ? View.VISIBLE : View.GONE); layout_sms_template.setVisibility(isChecked ? View.VISIBLE : View.GONE);
SettingUtil.switchSmsTemplate(isChecked); SettingUtil.switchSmsTemplate(isChecked);
if (!isChecked) { if (!isChecked) {
textSmsTemplate.setText("{{来源号码}}\n{{短信内容}}\n{{卡槽信息}}\n{{接收时间}}\n{{设备名称}}"); textSmsTemplate.setText(getString(R.string.tag_from) + "\n" +
getString(R.string.tag_sms) + "\n" +
getString(R.string.tag_card_slot) + "\n" +
getString(R.string.tag_receive_time) + "\n" +
getString(R.string.tag_device_name));
} }
}); });
} }
@ -735,19 +739,19 @@ public class SettingActivity extends AppCompatActivity {
textSmsTemplate.requestFocus(); textSmsTemplate.requestFocus();
switch (v.getId()) { switch (v.getId()) {
case R.id.bt_insert_sender: case R.id.bt_insert_sender:
CommonUtil.insertOrReplaceText2Cursor(textSmsTemplate, "{{来源号码}}"); CommonUtil.insertOrReplaceText2Cursor(textSmsTemplate, getString(R.string.tag_from));
return; return;
case R.id.bt_insert_content: case R.id.bt_insert_content:
CommonUtil.insertOrReplaceText2Cursor(textSmsTemplate, "{{短信内容}}"); CommonUtil.insertOrReplaceText2Cursor(textSmsTemplate, getString(R.string.tag_sms));
return; return;
case R.id.bt_insert_extra: case R.id.bt_insert_extra:
CommonUtil.insertOrReplaceText2Cursor(textSmsTemplate, "{{卡槽信息}}"); CommonUtil.insertOrReplaceText2Cursor(textSmsTemplate, getString(R.string.tag_card_slot));
return; return;
case R.id.bt_insert_time: case R.id.bt_insert_time:
CommonUtil.insertOrReplaceText2Cursor(textSmsTemplate, "{{接收时间}}"); CommonUtil.insertOrReplaceText2Cursor(textSmsTemplate, getString(R.string.tag_receive_time));
return; return;
case R.id.bt_insert_device_name: case R.id.bt_insert_device_name:
CommonUtil.insertOrReplaceText2Cursor(textSmsTemplate, "{{设备名称}}"); CommonUtil.insertOrReplaceText2Cursor(textSmsTemplate, getString(R.string.tag_device_name));
return; return;
default: default:
} }

View File

@ -5,6 +5,7 @@ import android.util.Log;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import com.idormy.sms.forwarder.MyApplication;
import com.idormy.sms.forwarder.R; import com.idormy.sms.forwarder.R;
import com.idormy.sms.forwarder.model.vo.SmsVo; import com.idormy.sms.forwarder.model.vo.SmsVo;
import com.idormy.sms.forwarder.utils.RuleLineUtils; import com.idormy.sms.forwarder.utils.RuleLineUtils;
@ -44,32 +45,32 @@ public class RuleModel {
public static final Map<String, String> TYPE_MAP = new HashMap<>(); public static final Map<String, String> TYPE_MAP = new HashMap<>();
static { static {
TYPE_MAP.put("sms", "短信"); TYPE_MAP.put("sms", getString(R.string.rule_sms));
TYPE_MAP.put("call", "来电"); TYPE_MAP.put("call", getString(R.string.rule_call));
TYPE_MAP.put("app", "应用"); TYPE_MAP.put("app", getString(R.string.rule_app));
} }
static { static {
FILED_MAP.put("transpond_all", "全部转发"); FILED_MAP.put("transpond_all", getString(R.string.rule_transpond_all));
FILED_MAP.put("phone_num", "手机号"); FILED_MAP.put("phone_num", getString(R.string.rule_phone_num));
FILED_MAP.put("msg_content", "内容"); FILED_MAP.put("msg_content", getString(R.string.rule_msg_content));
FILED_MAP.put("multi_match", "多重匹配"); FILED_MAP.put("multi_match", getString(R.string.rule_multi_match));
FILED_MAP.put("package_name", "APP包名"); FILED_MAP.put("package_name", getString(R.string.rule_package_name));
FILED_MAP.put("inform_content", "通知内容"); FILED_MAP.put("inform_content", getString(R.string.rule_inform_content));
} }
static { static {
CHECK_MAP.put("is", ""); CHECK_MAP.put("is", getString(R.string.rule_is));
CHECK_MAP.put("notis", "不是"); CHECK_MAP.put("notis", getString(R.string.rule_notis));
CHECK_MAP.put("contain", "包含"); CHECK_MAP.put("contain", getString(R.string.rule_contain));
CHECK_MAP.put("startwith", "开头是"); CHECK_MAP.put("startwith", getString(R.string.rule_startwith));
CHECK_MAP.put("endwith", "结尾是"); CHECK_MAP.put("endwith", getString(R.string.rule_endwith));
CHECK_MAP.put("notcontain", "不包含"); CHECK_MAP.put("notcontain", getString(R.string.rule_notcontain));
CHECK_MAP.put("regex", "正则匹配"); CHECK_MAP.put("regex", getString(R.string.rule_regex));
} }
static { static {
SIM_SLOT_MAP.put("ALL", "全部"); SIM_SLOT_MAP.put("ALL", getString(R.string.rule_all));
SIM_SLOT_MAP.put("SIM1", "SIM1"); SIM_SLOT_MAP.put("SIM1", "SIM1");
SIM_SLOT_MAP.put("SIM2", "SIM2"); SIM_SLOT_MAP.put("SIM2", "SIM2");
} }
@ -90,11 +91,11 @@ public class RuleModel {
private int status; private int status;
public static String getRuleMatch(String filed, String check, String value, String simSlot) { public static String getRuleMatch(String filed, String check, String value, String simSlot) {
String SimStr = SIM_SLOT_MAP.get(simSlot) + ""; String SimStr = SIM_SLOT_MAP.get(simSlot) + getString(R.string.rule_card);
if (filed == null || filed.equals(FILED_TRANSPOND_ALL)) { if (filed == null || filed.equals(FILED_TRANSPOND_ALL)) {
return SimStr + "全部 转发到 "; return SimStr + getString(R.string.rule_all_fw_to);
} else { } else {
return SimStr + "" + FILED_MAP.get(filed) + " " + CHECK_MAP.get(check) + " " + value + " 转发到 "; return SimStr + getString(R.string.rule_when) + FILED_MAP.get(filed) + " " + CHECK_MAP.get(check) + " " + value + getString(R.string.rule_fw_to);
} }
} }
@ -242,11 +243,11 @@ public class RuleModel {
} }
public String getRuleMatch() { public String getRuleMatch() {
String SimStr = "app".equals(type) ? "" : SIM_SLOT_MAP.get(simSlot) + ""; String SimStr = "app".equals(type) ? "" : SIM_SLOT_MAP.get(simSlot) + getString(R.string.rule_card);
if (filed == null || filed.equals(FILED_TRANSPOND_ALL)) { if (filed == null || filed.equals(FILED_TRANSPOND_ALL)) {
return SimStr + "全部 转发到 "; return SimStr + getString(R.string.rule_all_fw_to);
} else { } else {
return SimStr + "" + FILED_MAP.get(filed) + " " + CHECK_MAP.get(check) + " " + value + " 转发到 "; return SimStr + getString(R.string.rule_when) + FILED_MAP.get(filed) + " " + CHECK_MAP.get(check) + " " + value + getString(R.string.rule_fw_to);
} }
} }
@ -334,6 +335,10 @@ public class RuleModel {
} }
} }
private static String getString(int resId) {
return MyApplication.getContext().getString(resId);
}
@NonNull @NonNull
@Override @Override
public String toString() { public String toString() {

View File

@ -1,5 +1,6 @@
package com.idormy.sms.forwarder.model.vo; package com.idormy.sms.forwarder.model.vo;
import com.idormy.sms.forwarder.MyApplication;
import com.idormy.sms.forwarder.R; import com.idormy.sms.forwarder.R;
import lombok.Data; import lombok.Data;
@ -56,8 +57,12 @@ public class LogVo {
} }
public String getForwardResponse() { public String getForwardResponse() {
if (this.forwardStatus == 1) return "处理中..."; if (this.forwardStatus == 1) return getString(R.string.processing);
return forwardResponse; return forwardResponse;
} }
private static String getString(int resId) {
return MyApplication.getContext().getString(resId);
}
} }

View File

@ -5,6 +5,8 @@ import android.util.Log;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import com.idormy.sms.forwarder.MyApplication;
import com.idormy.sms.forwarder.R;
import com.idormy.sms.forwarder.utils.SettingUtil; import com.idormy.sms.forwarder.utils.SettingUtil;
import java.io.Serializable; import java.io.Serializable;
@ -43,16 +45,19 @@ public class SmsVo implements Serializable {
@SuppressLint("SimpleDateFormat") @SuppressLint("SimpleDateFormat")
public String getTitleForSend(String titleTemplate, String regexReplace) { public String getTitleForSend(String titleTemplate, String regexReplace) {
if (titleTemplate == null || titleTemplate.isEmpty()) titleTemplate = "{{来源号码}}"; if (titleTemplate == null || titleTemplate.isEmpty()) titleTemplate = getString(R.string.tag_from);
String deviceMark = SettingUtil.getAddExtraDeviceMark().trim(); String deviceMark = SettingUtil.getAddExtraDeviceMark().trim();
String versionName = SettingUtil.getVersionName(); String versionName = SettingUtil.getVersionName();
String titleForSend = titleTemplate.replace("{{来源号码}}", mobile).replace("{{APP包名}}", mobile) String titleForSend = titleTemplate.replace(getString(R.string.tag_from), mobile)
.replace("{{短信内容}}", content).replace("{{通知内容}}", content) .replace(getString(R.string.tag_package_name), mobile)
.replace("{{卡槽信息}}", simInfo).replace("{{通知标题}}", simInfo) .replace(getString(R.string.tag_sms), content)
.replace("{{接收时间}}", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(date)) .replace(getString(R.string.tag_msg), content)
.replace("{{设备名称}}", deviceMark) .replace(getString(R.string.tag_card_slot), simInfo)
.replace("{{当前应用版本号}}", versionName) .replace(getString(R.string.tag_title), simInfo)
.replace(getString(R.string.tag_receive_time), new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(date))
.replace(getString(R.string.tag_device_name), deviceMark)
.replace(getString(R.string.tag_app_version), versionName)
.trim(); .trim();
return RegexReplace(regexReplace, titleForSend); return RegexReplace(regexReplace, titleForSend);
@ -71,7 +76,11 @@ public class SmsVo implements Serializable {
@SuppressLint("SimpleDateFormat") @SuppressLint("SimpleDateFormat")
public String getSmsVoForSend(String ruleSmsTemplate, String regexReplace) { public String getSmsVoForSend(String ruleSmsTemplate, String regexReplace) {
String deviceMark = SettingUtil.getAddExtraDeviceMark().trim(); String deviceMark = SettingUtil.getAddExtraDeviceMark().trim();
String customSmsTemplate = "{{来源号码}}\n{{短信内容}}\n{{卡槽信息}}\n{{接收时间}}\n{{设备名称}}"; String customSmsTemplate = getString(R.string.tag_from) + "\n" +
getString(R.string.tag_sms) + "\n" +
getString(R.string.tag_card_slot) + "\n" +
getString(R.string.tag_receive_time) + "\n" +
getString(R.string.tag_device_name);
//优先取转发规则的自定义模板留空则取全局设置 //优先取转发规则的自定义模板留空则取全局设置
if (!ruleSmsTemplate.isEmpty()) { if (!ruleSmsTemplate.isEmpty()) {
@ -85,12 +94,15 @@ public class SmsVo implements Serializable {
} }
String versionName = SettingUtil.getVersionName(); String versionName = SettingUtil.getVersionName();
String smsVoForSend = customSmsTemplate.replace("{{来源号码}}", mobile).replace("{{APP包名}}", mobile) String smsVoForSend = customSmsTemplate.replace(getString(R.string.tag_from), mobile)
.replace("{{短信内容}}", content).replace("{{通知内容}}", content) .replace(getString(R.string.tag_package_name), mobile)
.replace("{{卡槽信息}}", simInfo).replace("{{通知标题}}", simInfo) .replace(getString(R.string.tag_sms), content)
.replace("{{接收时间}}", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(date)) .replace(getString(R.string.tag_msg), content)
.replace("{{设备名称}}", deviceMark) .replace(getString(R.string.tag_card_slot), simInfo)
.replace("{{当前应用版本号}}", versionName) .replace(getString(R.string.tag_title), simInfo)
.replace(getString(R.string.tag_receive_time), new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(date))
.replace(getString(R.string.tag_device_name), deviceMark)
.replace(getString(R.string.tag_app_version), versionName)
.trim(); .trim();
return RegexReplace(regexReplace, smsVoForSend); return RegexReplace(regexReplace, smsVoForSend);
@ -113,11 +125,15 @@ public class SmsVo implements Serializable {
} }
return newContent; return newContent;
} catch (Exception e) { } catch (Exception e) {
Log.e("RegexReplace", "获取接收手机号失败:" + e.getMessage()); Log.e("RegexReplace", "Failed to get the receiving phone number:" + e.getMessage());
return Content; return Content;
} }
} }
private static String getString(int resId) {
return MyApplication.getContext().getString(resId);
}
@NonNull @NonNull
@Override @Override
public String toString() { public String toString() {
@ -128,4 +144,5 @@ public class SmsVo implements Serializable {
", simInfo=" + simInfo + ", simInfo=" + simInfo +
'}'; '}';
} }
} }

View File

@ -14,14 +14,22 @@ import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.servlet.ServletContextHandler;
import org.eclipse.jetty.servlet.ServletHolder; import org.eclipse.jetty.servlet.ServletHolder;
import java.io.*; import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.Reader;
import java.util.List; import java.util.List;
import javax.servlet.MultipartConfigElement; import javax.servlet.MultipartConfigElement;
import javax.servlet.ServletOutputStream; import javax.servlet.ServletOutputStream;
import javax.servlet.annotation.MultipartConfig; import javax.servlet.annotation.MultipartConfig;
import javax.servlet.annotation.WebServlet; import javax.servlet.annotation.WebServlet;
import javax.servlet.http.*; import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet @WebServlet
@MultipartConfig @MultipartConfig
@ -107,7 +115,7 @@ public class BaseServlet extends HttpServlet {
BufferedReader reader = req.getReader(); BufferedReader reader = req.getReader();
try { try {
String read = read(reader); String read = read(reader);
Log.i(TAG, "请求内容:" + read); Log.i(TAG, "Request message:" + read);
List<SmsHubVo> smsHubVos = JSON.parseArray(read, SmsHubVo.class); List<SmsHubVo> smsHubVos = JSON.parseArray(read, SmsHubVo.class);
if (smsHubVos.size() == 1 && SmsHubVo.Action.heartbeat.code().equals(smsHubVos.get(0).getAction())) { if (smsHubVos.size() == 1 && SmsHubVo.Action.heartbeat.code().equals(smsHubVos.get(0).getAction())) {
smsHubVos.clear(); smsHubVos.clear();
@ -141,7 +149,7 @@ public class BaseServlet extends HttpServlet {
} }
private void printErrMsg(HttpServletResponse resp, PrintWriter writer, Exception e) { private void printErrMsg(HttpServletResponse resp, PrintWriter writer, Exception e) {
String text = "服务器内部错误:" + e.getMessage(); String text = "Internal server error: " + e.getMessage();
Log.e(TAG, text); Log.e(TAG, text);
resp.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); resp.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
writer.println(text); writer.println(text);
@ -160,7 +168,7 @@ public class BaseServlet extends HttpServlet {
} }
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
String text = "服务器内部错误:" + e.getMessage(); String text = "Internal server error: " + e.getMessage();
Log.e(TAG, text); Log.e(TAG, text);
resp.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); resp.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
} finally { } finally {

View File

@ -44,7 +44,7 @@ public class PhoneStateReceiver extends BroadcastReceiver {
(TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
} }
int state = mTelephonyManager.getCallState(); int state = mTelephonyManager.getCallState();
Log.d(TAG, "来电信息:state=" + state + " phoneNumber = " + phoneNumber); Log.d(TAG, "Caller information: state=" + state + " phoneNumber = " + phoneNumber);
switch (state) { switch (state) {
//包括响铃第三方来电等待 //包括响铃第三方来电等待
case TelephonyManager.CALL_STATE_RINGING: case TelephonyManager.CALL_STATE_RINGING:
@ -80,7 +80,7 @@ public class PhoneStateReceiver extends BroadcastReceiver {
if ((callInfo.getType() == 1 && !SettingUtil.getSwitchCallType1()) if ((callInfo.getType() == 1 && !SettingUtil.getSwitchCallType1())
|| (callInfo.getType() == 2 && !SettingUtil.getSwitchCallType2()) || (callInfo.getType() == 2 && !SettingUtil.getSwitchCallType2())
|| (callInfo.getType() == 3 && !SettingUtil.getSwitchCallType3())) { || (callInfo.getType() == 3 && !SettingUtil.getSwitchCallType3())) {
Log.d(TAG, "未启用该类型的通话记录转发,不做处理!"); Log.w(TAG, "Call record forwarding of this type is not enabled, no processing will be done!");
return; return;
} }
@ -105,7 +105,7 @@ public class PhoneStateReceiver extends BroadcastReceiver {
String currHash = CommonUtil.MD5(phoneNumber + simInfo + time); String currHash = CommonUtil.MD5(phoneNumber + simInfo + time);
Log.d(TAG, "prevHash=" + prevHash + " currHash=" + currHash); Log.d(TAG, "prevHash=" + prevHash + " currHash=" + currHash);
if (prevHash != null && prevHash.equals(currHash)) { if (prevHash != null && prevHash.equals(currHash)) {
Log.w(TAG, "同一卡槽同一秒的重复未接来电广播不再重复处理(部分机型会收到两条广播)"); Log.w(TAG, "Repeated missed call broadcasts of the same card slot in the same second are no longer processed repeatedly (some models will receive two broadcasts)");
return; return;
} }
SettingUtil.setPrevNoticeHash(phoneNumber, currHash); SettingUtil.setPrevNoticeHash(phoneNumber, currHash);

View File

@ -58,7 +58,7 @@ public class SmsBroadcastReceiver extends BroadcastReceiver {
simInfo = simId == 2 ? SettingUtil.getAddExtraSim2() : SettingUtil.getAddExtraSim1(); simInfo = simId == 2 ? SettingUtil.getAddExtraSim2() : SettingUtil.getAddExtraSim1();
simInfo = "SIM" + simId + "_" + simInfo; simInfo = "SIM" + simId + "_" + simInfo;
} catch (Exception e) { } catch (Exception e) {
Log.e(TAG, "获取接收手机号失败:" + e.getMessage()); Log.e(TAG, "Failed to get the receiving phone number:" + e.getMessage());
} }
List<SmsVo> smsVoList = new ArrayList<>(); List<SmsVo> smsVoList = new ArrayList<>();
@ -87,7 +87,7 @@ public class SmsBroadcastReceiver extends BroadcastReceiver {
smsVoList.add(new SmsVo(mobile, mobileToContent.get(mobile), date, simInfo)); smsVoList.add(new SmsVo(mobile, mobileToContent.get(mobile), date, simInfo));
} }
Log.d(TAG, "短信:" + smsVoList); Log.d(TAG, "SMS: " + smsVoList);
SendUtil.send_msg_list(context, smsVoList, simId, "sms"); SendUtil.send_msg_list(context, smsVoList, simId, "sms");
//SmsHubApi //SmsHubApi
@ -101,7 +101,7 @@ public class SmsBroadcastReceiver extends BroadcastReceiver {
} }
} catch (Throwable throwable) { } catch (Throwable throwable) {
Log.e(TAG, "解析短信失败:" + throwable.getMessage()); Log.e(TAG, "Parsing SMS failed: " + throwable.getMessage());
} }
} }

View File

@ -58,7 +58,7 @@ public class HttpServer {
} }
long l = System.currentTimeMillis(); long l = System.currentTimeMillis();
if (l - ts < 3000 && asRunning()) { if (l - ts < 3000 && asRunning()) {
Toast.makeText(context, "点击启动后请等待3秒", Toast.LENGTH_SHORT).show(); Toast.makeText(context, R.string.tips_wait_3_seconds, Toast.LENGTH_SHORT).show();
return false; return false;
} }
if (asRunning().equals(SettingUtil.getSwitchEnableHttpServer())) { if (asRunning().equals(SettingUtil.getSwitchEnableHttpServer())) {

View File

@ -44,7 +44,8 @@ public class SenderBarkMsg extends SenderBaseMsg {
} }
int isCode = content.indexOf("验证码"); int isCode = content.indexOf("验证码");
int isPassword = content.indexOf("动态密码"); int isPassword = content.indexOf("动态密码");
if (isCode != -1 || isPassword != -1) { int isPassword2 = content.indexOf("短信密码");
if (isCode != -1 || isPassword != -1 || isPassword2 != -1) {
Pattern p = Pattern.compile("(\\d{4,6})"); Pattern p = Pattern.compile("(\\d{4,6})");
Matcher m = p.matcher(content); Matcher m = p.matcher(content);
if (m.find()) { if (m.find()) {

View File

@ -14,6 +14,7 @@ import com.idormy.sms.forwarder.utils.LogUtil;
import java.io.IOException; import java.io.IOException;
import java.net.InetSocketAddress; import java.net.InetSocketAddress;
import java.net.Proxy; import java.net.Proxy;
import java.net.URLEncoder;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.Objects; import java.util.Objects;
@ -89,7 +90,7 @@ public class SenderTelegramMsg extends SenderBaseMsg {
final Request request; final Request request;
if (method.equals("GET")) { if (method.equals("GET")) {
request = new Request.Builder() request = new Request.Builder()
.url(requestUrl + "?chat_id=" + chatId + "&text=" + finalText) .url(requestUrl + "?chat_id=" + chatId + "&text=" + URLEncoder.encode(finalText, "UTF-8"))
.build(); .build();
} else { } else {
Map bodyMap = new HashMap(); Map bodyMap = new HashMap();

View File

@ -8,6 +8,9 @@ import android.content.pm.PackageManager;
import android.preference.PreferenceManager; import android.preference.PreferenceManager;
import android.util.Log; import android.util.Log;
import com.idormy.sms.forwarder.MyApplication;
import com.idormy.sms.forwarder.R;
@SuppressWarnings({"SynchronizeOnNonFinalField", "unused"}) @SuppressWarnings({"SynchronizeOnNonFinalField", "unused"})
public class SettingUtil { public class SettingUtil {
static Boolean hasInit = false; static Boolean hasInit = false;
@ -111,7 +114,12 @@ public class SettingUtil {
} }
public static String getSmsTemplate() { public static String getSmsTemplate() {
return sp_setting.getString(Define.SP_MSG_KEY_STRING_SMS_TEMPLATE, "{{来源号码}}\n{{短信内容}}\n{{卡槽信息}}\n{{接收时间}}\n{{设备名称}}"); return sp_setting.getString(Define.SP_MSG_KEY_STRING_SMS_TEMPLATE,
getString(R.string.tag_from) + "\n" +
getString(R.string.tag_sms) + "\n" +
getString(R.string.tag_card_slot) + "\n" +
getString(R.string.tag_receive_time) + "\n" +
getString(R.string.tag_device_name));
} }
public static void setSmsTemplate(String textSmsTemplate) { public static void setSmsTemplate(String textSmsTemplate) {
@ -272,4 +280,8 @@ public class SettingUtil {
return ""; return "";
} }
} }
private static String getString(int resId) {
return MyApplication.getContext().getString(resId);
}
} }

View File

@ -27,7 +27,7 @@
android:layout_marginStart="5dp" android:layout_marginStart="5dp"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:layout_marginEnd="5dp" android:layout_marginEnd="5dp"
android:gravity="bottom" android:gravity="center_vertical"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
@ -116,7 +116,7 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="25dp"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal"> android:orientation="horizontal">
@ -242,7 +242,7 @@
android:layout_marginStart="5dp" android:layout_marginStart="5dp"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:layout_marginEnd="5dp" android:layout_marginEnd="5dp"
android:gravity="bottom" android:gravity="center_vertical"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
@ -357,7 +357,7 @@
android:layout_marginStart="5dp" android:layout_marginStart="5dp"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:layout_marginEnd="5dp" android:layout_marginEnd="5dp"
android:gravity="bottom" android:gravity="center_vertical"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
@ -426,7 +426,7 @@
android:padding="15dp"> android:padding="15dp">
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="110dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical">
@ -508,8 +508,8 @@
android:id="@+id/cb_battery_level_alarm_once" android:id="@+id/cb_battery_level_alarm_once"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:scaleX="0.8" android:scaleX="0.7"
android:scaleY="0.8" android:scaleY="0.7"
android:text="@string/keep_reminding" /> android:text="@string/keep_reminding" />
</LinearLayout> </LinearLayout>
@ -520,7 +520,7 @@
android:layout_marginStart="5dp" android:layout_marginStart="5dp"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:layout_marginEnd="5dp" android:layout_marginEnd="5dp"
android:gravity="bottom" android:gravity="center_vertical"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
@ -657,7 +657,7 @@
android:padding="15dp"> android:padding="15dp">
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="120dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical">
@ -733,7 +733,7 @@
android:layout_marginStart="5dp" android:layout_marginStart="5dp"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:layout_marginEnd="5dp" android:layout_marginEnd="5dp"
android:gravity="bottom" android:gravity="center_vertical"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView

View File

@ -25,23 +25,20 @@
<EditText <EditText
android:id="@+id/editTextBarkName" android:id="@+id/editTextBarkName"
android:layout_width="wrap_content" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="3dp" android:layout_weight="1"
android:autofillHints="" android:importantForAutofill="no"
android:ems="9"
android:inputType="text" android:inputType="text"
android:text="" android:singleLine="true"
tools:ignore="LabelFor" /> tools:ignore="LabelFor" />
<Switch <Switch
android:id="@+id/switchBarkEnable" android:id="@+id/switchBarkEnable"
android:layout_width="0dp" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1"
android:checked="true" android:checked="true"
android:ems="14" android:textSize="14sp"
android:gravity="end"
tools:ignore="UseSwitchCompatOrMaterialXml" /> tools:ignore="UseSwitchCompatOrMaterialXml" />
</LinearLayout> </LinearLayout>

View File

@ -25,23 +25,20 @@
<EditText <EditText
android:id="@+id/editTextDingdingName" android:id="@+id/editTextDingdingName"
android:layout_width="wrap_content" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="3dp" android:layout_weight="1"
android:autofillHints="" android:importantForAutofill="no"
android:ems="10"
android:inputType="text" android:inputType="text"
android:text="" android:singleLine="true"
tools:ignore="LabelFor" /> tools:ignore="LabelFor" />
<Switch <Switch
android:id="@+id/switchDingdingEnable" android:id="@+id/switchDingdingEnable"
android:layout_width="0dp" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1"
android:checked="true" android:checked="true"
android:ems="14" android:textSize="14sp"
android:gravity="end"
tools:ignore="UseSwitchCompatOrMaterialXml" /> tools:ignore="UseSwitchCompatOrMaterialXml" />
</LinearLayout> </LinearLayout>
@ -77,7 +74,6 @@
app:textSize="15sp" /> app:textSize="15sp" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"

View File

@ -24,24 +24,20 @@
<EditText <EditText
android:id="@+id/editTextEmailName" android:id="@+id/editTextEmailName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="3dp"
android:autofillHints=""
android:ems="10"
android:inputType="text"
android:maxLines="1"
android:text=""
tools:ignore="LabelFor,TextFields" />
<Switch
android:id="@+id/switchEmailEnable"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:importantForAutofill="no"
android:inputType="text"
android:singleLine="true"
tools:ignore="LabelFor" />
<Switch
android:id="@+id/switchEmailEnable"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true" android:checked="true"
android:ems="14" android:textSize="14sp"
android:gravity="end"
tools:ignore="UseSwitchCompatOrMaterialXml" /> tools:ignore="UseSwitchCompatOrMaterialXml" />
</LinearLayout> </LinearLayout>
@ -217,16 +213,15 @@
<EditText <EditText
android:id="@+id/editTextEmailPort" android:id="@+id/editTextEmailPort"
android:layout_width="wrap_content" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="3dp" android:layout_marginStart="3dp"
android:autofillHints="" android:layout_weight="1"
android:digits="0123456789" android:digits="0123456789"
android:ems="5" android:importantForAutofill="no"
android:inputType="number" android:inputType="number"
android:maxLength="5" android:maxLength="5"
android:maxLines="1" android:singleLine="true"
android:text=""
tools:ignore="LabelFor,TextFields" /> tools:ignore="LabelFor,TextFields" />
<TextView <TextView

View File

@ -25,23 +25,20 @@
<EditText <EditText
android:id="@+id/editTextFeishuName" android:id="@+id/editTextFeishuName"
android:layout_width="wrap_content" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="3dp" android:layout_weight="1"
android:autofillHints="" android:importantForAutofill="no"
android:ems="10"
android:inputType="text" android:inputType="text"
android:text="" android:singleLine="true"
tools:ignore="LabelFor" /> tools:ignore="LabelFor" />
<Switch <Switch
android:id="@+id/switchFeishuEnable" android:id="@+id/switchFeishuEnable"
android:layout_width="0dp" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1"
android:checked="true" android:checked="true"
android:ems="14" android:textSize="14sp"
android:gravity="end"
tools:ignore="UseSwitchCompatOrMaterialXml" /> tools:ignore="UseSwitchCompatOrMaterialXml" />
</LinearLayout> </LinearLayout>

View File

@ -25,24 +25,20 @@
<EditText <EditText
android:id="@+id/editTextGotifyName" android:id="@+id/editTextGotifyName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="3dp"
android:autofillHints=""
android:ems="10"
android:inputType="text"
android:maxLines="1"
android:text=""
tools:ignore="LabelFor,TextFields" />
<Switch
android:id="@+id/switchGotifyEnable"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:importantForAutofill="no"
android:inputType="text"
android:singleLine="true"
tools:ignore="LabelFor" />
<Switch
android:id="@+id/switchGotifyEnable"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true" android:checked="true"
android:ems="14" android:textSize="14sp"
android:gravity="end"
tools:ignore="UseSwitchCompatOrMaterialXml" /> tools:ignore="UseSwitchCompatOrMaterialXml" />
</LinearLayout> </LinearLayout>

View File

@ -25,23 +25,20 @@
<EditText <EditText
android:id="@+id/editTextPushPlusName" android:id="@+id/editTextPushPlusName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="3dp"
android:autofillHints=""
android:ems="10"
android:inputType="text"
android:text=""
tools:ignore="LabelFor,TextFields" />
<Switch
android:id="@+id/switchPushPlusEnable"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:importantForAutofill="no"
android:inputType="text"
android:singleLine="true"
tools:ignore="LabelFor" />
<Switch
android:id="@+id/switchPushPlusEnable"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true" android:checked="true"
android:ems="14" android:textSize="14sp"
android:gravity="end"
tools:ignore="UseSwitchCompatOrMaterialXml" /> tools:ignore="UseSwitchCompatOrMaterialXml" />
</LinearLayout> </LinearLayout>

View File

@ -26,23 +26,20 @@
<EditText <EditText
android:id="@+id/editTextQYWXAppName" android:id="@+id/editTextQYWXAppName"
android:layout_width="wrap_content" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="5dp" android:layout_weight="1"
android:autofillHints="" android:importantForAutofill="no"
android:ems="9"
android:inputType="text" android:inputType="text"
android:text="" android:singleLine="true"
tools:ignore="LabelFor" /> tools:ignore="LabelFor" />
<Switch <Switch
android:id="@+id/switchQYWXAppEnable" android:id="@+id/switchQYWXAppEnable"
android:layout_width="0dp" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1"
android:checked="true" android:checked="true"
android:ems="14" android:textSize="14sp"
android:gravity="end"
tools:ignore="UseSwitchCompatOrMaterialXml" /> tools:ignore="UseSwitchCompatOrMaterialXml" />
</LinearLayout> </LinearLayout>

View File

@ -25,23 +25,20 @@
<EditText <EditText
android:id="@+id/editTextQYWXGroupRobotName" android:id="@+id/editTextQYWXGroupRobotName"
android:layout_width="wrap_content" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="3dp" android:layout_weight="1"
android:autofillHints="" android:importantForAutofill="no"
android:ems="10"
android:inputType="text" android:inputType="text"
android:text="" android:singleLine="true"
tools:ignore="LabelFor" /> tools:ignore="LabelFor" />
<Switch <Switch
android:id="@+id/switchQYWXGroupRobotEnable" android:id="@+id/switchQYWXGroupRobotEnable"
android:layout_width="0dp" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1"
android:checked="true" android:checked="true"
android:ems="14" android:textSize="14sp"
android:gravity="end"
tools:ignore="UseSwitchCompatOrMaterialXml" /> tools:ignore="UseSwitchCompatOrMaterialXml" />
</LinearLayout> </LinearLayout>

View File

@ -25,23 +25,20 @@
<EditText <EditText
android:id="@+id/editTextServerChanName" android:id="@+id/editTextServerChanName"
android:layout_width="wrap_content" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="3dp" android:layout_weight="1"
android:autofillHints="" android:importantForAutofill="no"
android:ems="10"
android:inputType="text" android:inputType="text"
android:text="" android:singleLine="true"
tools:ignore="LabelFor" /> tools:ignore="LabelFor" />
<Switch <Switch
android:id="@+id/switchServerChanEnable" android:id="@+id/switchServerChanEnable"
android:layout_width="0dp" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1"
android:checked="true" android:checked="true"
android:ems="14" android:textSize="14sp"
android:gravity="end"
tools:ignore="UseSwitchCompatOrMaterialXml" /> tools:ignore="UseSwitchCompatOrMaterialXml" />
</LinearLayout> </LinearLayout>

View File

@ -24,23 +24,20 @@
<EditText <EditText
android:id="@+id/editTextSmsName" android:id="@+id/editTextSmsName"
android:layout_width="wrap_content" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="3dp" android:layout_weight="1"
android:autofillHints="" android:importantForAutofill="no"
android:ems="10"
android:inputType="text" android:inputType="text"
android:text="" android:singleLine="true"
tools:ignore="LabelFor" /> tools:ignore="LabelFor" />
<Switch <Switch
android:id="@+id/switchSmsEnable" android:id="@+id/switchSmsEnable"
android:layout_width="0dp" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1"
android:checked="true" android:checked="true"
android:ems="14" android:textSize="14sp"
android:gravity="end"
tools:ignore="UseSwitchCompatOrMaterialXml" /> tools:ignore="UseSwitchCompatOrMaterialXml" />
</LinearLayout> </LinearLayout>

View File

@ -25,23 +25,20 @@
<EditText <EditText
android:id="@+id/editTextTelegramName" android:id="@+id/editTextTelegramName"
android:layout_width="wrap_content" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="3dp" android:layout_weight="1"
android:autofillHints="" android:importantForAutofill="no"
android:ems="10"
android:inputType="text" android:inputType="text"
android:text="" android:singleLine="true"
tools:ignore="LabelFor" /> tools:ignore="LabelFor" />
<Switch <Switch
android:id="@+id/switchTelegramEnable" android:id="@+id/switchTelegramEnable"
android:layout_width="0dp" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1"
android:checked="true" android:checked="true"
android:ems="14" android:textSize="14sp"
android:gravity="end"
tools:ignore="UseSwitchCompatOrMaterialXml" /> tools:ignore="UseSwitchCompatOrMaterialXml" />
</LinearLayout> </LinearLayout>

View File

@ -25,23 +25,20 @@
<EditText <EditText
android:id="@+id/editTextWebNotifyName" android:id="@+id/editTextWebNotifyName"
android:layout_width="wrap_content" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="3dp" android:layout_weight="1"
android:autofillHints="" android:importantForAutofill="no"
android:ems="10"
android:inputType="text" android:inputType="text"
android:text="" android:singleLine="true"
tools:ignore="LabelFor" /> tools:ignore="LabelFor" />
<Switch <Switch
android:id="@+id/switchWebNotifyEnable" android:id="@+id/switchWebNotifyEnable"
android:layout_width="0dp" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1"
android:checked="true" android:checked="true"
android:ems="14" android:textSize="14sp"
android:gravity="end"
tools:ignore="UseSwitchCompatOrMaterialXml" /> tools:ignore="UseSwitchCompatOrMaterialXml" />
</LinearLayout> </LinearLayout>

View File

@ -116,7 +116,7 @@
<string name="invalid_webcom_app_parm">CronID, AgentID and Secret cannot be blank</string> <string name="invalid_webcom_app_parm">CronID, AgentID and Secret cannot be blank</string>
<string name="invalid_phone_num">Phone number cannot be blank</string> <string name="invalid_phone_num">Phone number cannot be blank</string>
<string name="new_sender">New Sender</string> <string name="new_sender">New Sender</string>
<string name="set_bark_name">Bark Group Name/Status</string> <string name="set_bark_name">GroupName/Status</string>
<string name="set_bark_server">Bark-Server</string> <string name="set_bark_server">Bark-Server</string>
<string name="set_bark_server_tips"> e.g. https://day.app/XXXXXXXX/</string> <string name="set_bark_server_tips"> e.g. https://day.app/XXXXXXXX/</string>
<string name="set_bark_icon">Bark-Icon (optional)</string> <string name="set_bark_icon">Bark-Icon (optional)</string>
@ -168,11 +168,11 @@
<string name="device_name">Device name</string> <string name="device_name">Device name</string>
<string name="sim1_remark" tools:ignore="Typos">SIM1 Label</string> <string name="sim1_remark" tools:ignore="Typos">SIM1 Label</string>
<string name="sim2_remark" tools:ignore="Typos">SIM2 Label</string> <string name="sim2_remark" tools:ignore="Typos">SIM2 Label</string>
<string name="carrier_mobile">Label of SIM, eg.: "CMCC", "13800138000", etc.</string> <string name="carrier_mobile" tools:ignore="Typos">Label of SIM,\neg. SIM1_AT&amp;T_88888888</string>
<string name="low_power_alarm_threshold">Low power alarm threshold</string> <string name="low_power_alarm_threshold">Low power alarm</string>
<string name="low_power_alarm_threshold_tips">Value range: 0100. Left blank or 0 is disabled</string> <string name="low_power_alarm_threshold_tips">Value range: 0100.\nLeft blank or 0 is disabled</string>
<string name="retry_interval">Retry interval (seconds)</string> <string name="retry_interval">Retry interval</string>
<string name="retry_interval_tips">Disabled when times = 0, the interval is incremented</string> <string name="retry_interval_tips">Disabled when times = 0,\nthe interval is incremented</string>
<string name="forward_sms">Forward sms</string> <string name="forward_sms">Forward sms</string>
<string name="forward_sms_tips">Main switch, requires permissions to read and sned SMS messages, especially verification SMS texts.</string> <string name="forward_sms_tips">Main switch, requires permissions to read and sned SMS messages, especially verification SMS texts.</string>
<string name="forward_missed_calls">Forward calls log</string> <string name="forward_missed_calls">Forward calls log</string>
@ -180,7 +180,7 @@
<string name="forward_app_notify">Forward app Ntf.</string> <string name="forward_app_notify">Forward app Ntf.</string>
<string name="forward_app_notify_tips">Main switch, requires permission to read notification.</string> <string name="forward_app_notify_tips">Main switch, requires permission to read notification.</string>
<string name="cancel_app_notify">Auto close Ntf.</string> <string name="cancel_app_notify">Auto close Ntf.</string>
<string name="enable_custom_templates">Global custom template</string> <string name="enable_custom_templates">Global Custom Template</string>
<string name="enable_custom_templates_tips">Priority: custom template for forwarding rules > Global custom template > System default</string> <string name="enable_custom_templates_tips">Priority: custom template for forwarding rules > Global custom template > System default</string>
<string name="enable_regex_replace">Enable regular replacement content</string> <string name="enable_regex_replace">Enable regular replacement content</string>
<string name="enable_regex_replace_tips">Format: RegularExpression===ReplacementResult,One rule per line.\ne.g. (\\d{3})\\d+(\\d{4})===$1****$2</string> <string name="enable_regex_replace_tips">Format: RegularExpression===ReplacementResult,One rule per line.\ne.g. (\\d{3})\\d+(\\d{4})===$1****$2</string>
@ -261,9 +261,9 @@
<string name="account">✱Account</string> <string name="account">✱Account</string>
<string name="servers">✱Servers</string> <string name="servers">✱Servers</string>
<string name="email_settings">✱Email</string> <string name="email_settings">✱Email</string>
<string name="below">below</string> <string name="below"><![CDATA[≤]]></string>
<string name="percent">%</string> <string name="percent">%</string>
<string name="above">above</string> <string name="above"><![CDATA[≥]]></string>
<string name="zero">0</string> <string name="zero">0</string>
<string name="monitor_battery_status_changes">Monitor battery status changes</string> <string name="monitor_battery_status_changes">Monitor battery status changes</string>
<string name="battery_status_changes_tips">Notify when charging status changes (charging/discharging/uncharged/fully charged)</string> <string name="battery_status_changes_tips">Notify when charging status changes (charging/discharging/uncharged/fully charged)</string>
@ -282,7 +282,7 @@
<string name="agree">Agree</string> <string name="agree">Agree</string>
<string name="disagree">Disagree</string> <string name="disagree">Disagree</string>
<string name="privacy_policy_text">SmsForwarder (the "Application/App"), is 100\% free and open source, and is compliled and released basing on repository hosted on GitHub. The App will not collect any of your privacy data!\n\n Version information of the App will be sent in the following situations: \n 1. As startup, version information will be sent to "Umeng +· U-APP Mobile Statistics" for user retention analyze and crash stats;\n 2. Manual update check triggered by user;\n The App collects no any other data!!\n\n The App collects and uses version information only in accordance with the Privacy Policy, and will not collect any other information as an abuse of users\' consent to the Privacy Policy;</string> <string name="privacy_policy_text">SmsForwarder (the "Application/App"), is 100\% free and open source, and is compliled and released basing on repository hosted on GitHub. The App will not collect any of your privacy data!\n\n Version information of the App will be sent in the following situations: \n 1. As startup, version information will be sent to "Umeng +· U-APP Mobile Statistics" for user retention analyze and crash stats;\n 2. Manual update check triggered by user;\n The App collects no any other data!!\n\n The App collects and uses version information only in accordance with the Privacy Policy, and will not collect any other information as an abuse of users\' consent to the Privacy Policy;</string>
<string name="GotifyWebServer">Setting the WebServer</string> <string name="GotifyWebServer">WebServer</string>
<string name="GotifyWebServerTips"><![CDATA[eg.: https://push.ppps.cn/message?token=<apptoken>]]></string> <string name="GotifyWebServerTips"><![CDATA[eg.: https://push.ppps.cn/message?token=<apptoken>]]></string>
<string name="title_template">Title Template</string> <string name="title_template">Title Template</string>
<string name="priority">Priority1 9</string> <string name="priority">Priority1 9</string>
@ -313,10 +313,10 @@
<string name="todo">TODO</string> <string name="todo">TODO</string>
<string name="forwarding_function">Forwarding Function</string> <string name="forwarding_function">Forwarding Function</string>
<string name="forwarding_function_tips">Main switch: Enable the forwarding function as required</string> <string name="forwarding_function_tips">Main switch: Enable the forwarding function as required</string>
<string name="mandatory_type">Mandatory type:</string> <string name="mandatory_type">Call type:</string>
<string name="missed_call">Missed call</string> <string name="missed_call">Missed</string>
<string name="received_call">Received call</string> <string name="received_call">Received</string>
<string name="local_outgoing_call">Local outgoing call</string> <string name="local_outgoing_call">Call out</string>
<string name="optional_action">Optional action:</string> <string name="optional_action">Optional action:</string>
<string name="active_request">Active request</string> <string name="active_request">Active request</string>
<string name="active_request_tips">Obtain instructions through passive reception or active polling to operate the machine</string> <string name="active_request_tips">Obtain instructions through passive reception or active polling to operate the machine</string>
@ -328,11 +328,58 @@
<string name="keep_alive_tips">It is recommended to open each authorization or setting, do not disable the notification bar, to avoid the APP service being killed</string> <string name="keep_alive_tips">It is recommended to open each authorization or setting, do not disable the notification bar, to avoid the APP service being killed</string>
<string name="custom_settings">Custom settings</string> <string name="custom_settings">Custom settings</string>
<string name="custom_settings_tips">If the automatic acquisition fails, please fill in the remarks manually; after clearing, it will be automatically acquired again!</string> <string name="custom_settings_tips">If the automatic acquisition fails, please fill in the remarks manually; after clearing, it will be automatically acquired again!</string>
<string name="times">times</string> <string name="times">,</string>
<string name="interval">Interval</string> <string name="interval">Interval</string>
<string name="seconds">seconds</string> <string name="seconds">sec</string>
<string name="retry">Retry</string> <string name="retry">Retry</string>
<string name="test_sender_sms">[Test Channel] Congratulations, the sending channel test is successful, please continue to add forwarding rules!</string> <string name="test_sender_sms">[Test Channel] Congratulations, the sending channel test is successful, please continue to add forwarding rules!</string>
<string name="test_sim_info" tools:ignore="Typos">SIM1_TestOperator_18888888888</string> <string name="test_sim_info" tools:ignore="Typos">SIM1_TestOperator_18888888888</string>
<string name="keep_reminding">Keep reminding</string> <string name="keep_reminding">Continued</string>
<string name="resend">RESEND</string>
<string name="from">From: </string>
<string name="msg">Msg: </string>
<string name="slot">Slot: </string>
<string name="rule">Rule: </string>
<string name="time">Time: </string>
<string name="result">\n\nResult: \n</string>
<string name="processing">In the processing…</string>
<string name="tag_from">{{FROM}}</string>
<string name="tag_sms">{{SMS}}</string>
<string name="tag_package_name">{{PACKAGE_NAME}}</string>
<string name="tag_msg">{{MSG}}</string>
<string name="tag_card_slot">{{CARD_SLOT}}</string>
<string name="tag_receive_time">{{RECEIVE_TIME}}</string>
<string name="tag_device_name">{{DEVICE_NAME}}</string>
<string name="tag_app_version">{{APP_VERSION}}</string>
<string name="tag_title">{{TITLE}}</string>
<string name="rule_sms">SMS</string>
<string name="rule_call">CALL</string>
<string name="rule_app">APP</string>
<string name="rule_all">ALL</string>
<string name="rule_transpond_all">Transpond All</string>
<string name="rule_phone_num">Phone Num</string>
<string name="rule_msg_content">Msg Content</string>
<string name="rule_multi_match">Multi Match</string>
<string name="rule_package_name">Package Name</string>
<string name="rule_inform_content">Inform Content</string>
<string name="rule_card">&#160;Card&#160;</string>
<string name="rule_when">&#160;When&#160;</string>
<string name="rule_fw_to">&#160;Fw.&#160;To&#160;</string>
<string name="rule_all_fw_to">&#160;All&#160;Fw.&#160;To&#160;</string>
<string name="rule_is">IS</string>
<string name="rule_notis">NOTIS</string>
<string name="rule_contain">CONTAIN</string>
<string name="rule_startwith">STARTWITH</string>
<string name="rule_endwith">ENDWITH</string>
<string name="rule_notcontain">NOTCONTAIN</string>
<string name="rule_regex">REGEX</string>
<string name="package_name_copied">Package name copied:</string>
<string name="loading_user_app">Loading user app, please wait…</string>
<string name="loading_system_app">Loading system app, please wait…</string>
<string name="crash_tip">Very sorry! The program has an exception and is about to exit…</string>
<string name="enable_phone_fw_tips">A call type must be selected to enable call log forwarding!</string>
<string name="notification_service_is_on">Notification service is on</string>
<string name="tips_battery_level_alarm_once">[Note] The upper and lower limits of the battery warning threshold are 0, and the continuous warning does not work.</string>
<string name="tips_compatible_solution">Compatible solution</string>
<string name="tips_wait_3_seconds">Please wait 3 seconds after clicking start</string>
</resources> </resources>

View File

@ -32,12 +32,15 @@
<item name="android:layout_height">wrap_content</item> <item name="android:layout_height">wrap_content</item>
<item name="android:layout_marginLeft">5dip</item> <item name="android:layout_marginLeft">5dip</item>
<item name="android:layout_marginRight">5dip</item> <item name="android:layout_marginRight">5dip</item>
<item name="android:paddingLeft">10dip</item>
<item name="android:paddingRight">10dip</item>
<item name="android:paddingTop">5dip</item> <item name="android:paddingTop">5dip</item>
<item name="android:paddingBottom">5dip</item> <item name="android:paddingBottom">5dip</item>
<item name="android:background">@drawable/select_selector</item> <item name="android:background">@drawable/select_selector</item>
<item name="android:button">@null</item> <item name="android:button">@null</item>
<item name="android:gravity">center</item> <item name="android:gravity">center</item>
<item name="android:textSize">13sp</item> <item name="android:textSize">13sp</item>
<item name="android:letterSpacing">0.1</item>
<item name="android:textColor">@drawable/txt_select_selector</item> <item name="android:textColor">@drawable/txt_select_selector</item>
</style> </style>

View File

@ -312,7 +312,7 @@
<string name="todo">TODO</string> <string name="todo">TODO</string>
<string name="forwarding_function">转发功能</string> <string name="forwarding_function">转发功能</string>
<string name="forwarding_function_tips">总开关,请根据实际需要,启用对应的转发功能</string> <string name="forwarding_function_tips">总开关,请根据实际需要,启用对应的转发功能</string>
<string name="mandatory_type">必选类型:</string> <string name="mandatory_type">通话类型:</string>
<string name="missed_call">未接来电</string> <string name="missed_call">未接来电</string>
<string name="received_call">已接来电</string> <string name="received_call">已接来电</string>
<string name="local_outgoing_call">本机去电</string> <string name="local_outgoing_call">本机去电</string>
@ -334,4 +334,51 @@
<string name="test_sender_sms">【测试通道】恭喜您,该发送通道测试成功,请继续添加转发规则!</string> <string name="test_sender_sms">【测试通道】恭喜您,该发送通道测试成功,请继续添加转发规则!</string>
<string name="test_sim_info" tools:ignore="Typos">SIM1_测试运营商_18888888888</string> <string name="test_sim_info" tools:ignore="Typos">SIM1_测试运营商_18888888888</string>
<string name="keep_reminding">持续提醒</string> <string name="keep_reminding">持续提醒</string>
<string name="resend">重发消息</string>
<string name="from">来源:</string>
<string name="msg">消息:</string>
<string name="slot">卡槽:</string>
<string name="rule">规则:</string>
<string name="time">时间:</string>
<string name="result">\n\n转发结果\n</string>
<string name="processing">处理中…</string>
<string name="tag_from">{{来源号码}}</string>
<string name="tag_sms">{{短信内容}}</string>
<string name="tag_package_name">{{APP包名}}</string>
<string name="tag_msg">{{通知内容}}</string>
<string name="tag_card_slot">{{卡槽信息}}</string>
<string name="tag_receive_time">{{接收时间}}</string>
<string name="tag_device_name">{{设备名称}}</string>
<string name="tag_app_version">{{当前应用版本号}}</string>
<string name="tag_title">{{通知标题}}</string>
<string name="rule_sms">短信</string>
<string name="rule_call">来电</string>
<string name="rule_app">应用</string>
<string name="rule_all">全部</string>
<string name="rule_transpond_all">全部转发</string>
<string name="rule_phone_num">手机号</string>
<string name="rule_msg_content">内容</string>
<string name="rule_multi_match">多重匹配</string>
<string name="rule_package_name">APP包名</string>
<string name="rule_inform_content">通知内容</string>
<string name="rule_card">&#8194;&#8194;</string>
<string name="rule_when">&#8194;&#8194;</string>
<string name="rule_fw_to">&#8194;转发到&#8194;</string>
<string name="rule_all_fw_to">&#8194;全部&#8194;转发到&#8194;</string>
<string name="rule_is"></string>
<string name="rule_notis">不是</string>
<string name="rule_contain">包含</string>
<string name="rule_startwith">开头是</string>
<string name="rule_endwith">结尾是</string>
<string name="rule_notcontain">不包含</string>
<string name="rule_regex">正则匹配</string>
<string name="package_name_copied">已复制包名:</string>
<string name="loading_user_app">正在加载用户应用,请稍候…</string>
<string name="loading_system_app">正在加载系统应用,请稍候…</string>
<string name="crash_tip">很抱歉!程序出现异常,即将退出…</string>
<string name="enable_phone_fw_tips">必须选择一个通话类型,才能开启通话记录转发!</string>
<string name="notification_service_is_on">通知服务已开启</string>
<string name="tips_battery_level_alarm_once">【注意】电量预警阈值上下限都是0持续提醒不起作用</string>
<string name="tips_compatible_solution">兼容方案</string>
<string name="tips_wait_3_seconds">点击启动后请等待3秒</string>
</resources> </resources>