优化获取SIM信息(兼容高版本Android) & 自动填写设备备注 & 自动填充卡槽信息到SIM1备注/SIM2备注 & 支持卡槽匹配规则 & 支持正则匹配规则

pull/67/head 1.6.0
pppscn 3 years ago
parent 23c51a59f9
commit 560cfae7e6

@ -91,9 +91,10 @@ Android手机监听短信并根据指定规则转发到其他手机钉钉机
| ![添加/编辑发送方网页通知](pic/sendersetwebnotify.jpg "添加/编辑发送方网页通知") | ![添加/编辑发送方企业微信群机器人](pic/sendersetqywechat.jpg "添加/编辑发送方企业微信群机器人") |
| 添加/编辑发送方企业微信应用 | 应用设置 |
| ![添加/编辑发送方企业微信应用](pic/sendersetqywxapp.jpg "添加/编辑发送方企业微信应用") | ![应用设置](pic/setting.jpg "应用设置") |
| 关于/在线升级 | 转发短信模板增加卡槽标识 |
| ![在线升级](pic/update.jpg "在线升级") | ![转发短信模板增加卡槽标识](pic/siminfo.jpg "转发短信模板增加卡槽标识") |
| 关于/在线升级 | 支持正则匹配规则 & 支持卡槽匹配规则 |
| ![在线升级](pic/update.jpg "在线升级") | ![支持正则匹配规则 & 支持卡槽匹配规则](pic/regex.jpg "支持正则匹配规则 & 支持卡槽匹配规则") |
| 转发短信模板增加卡槽标识 | |
| ![转发短信模板增加卡槽标识](pic/siminfo.jpg "转发短信模板增加卡槽标识") | |
--------
@ -114,15 +115,19 @@ Android手机监听短信并根据指定规则转发到其他手机钉钉机
+ [v1.5.0](app/release/SmsForwarder_release_20210305_1.5.0.apk) 新增转发到企业微信应用消息
+ [v1.5.1](app/release/SmsForwarder_release_20210310_1.5.1.apk) 解决Android 9.xx、10.xx收不到广播问题
+ [v1.5.2](app/release/SmsForwarder_release_20210311_1.5.2.apk) 支持标注卡槽号码(优先使用)、设备信息;自定义转发信息模版
+ [v1.6.0](app/release/SmsForwarder_release_20210312_1.6.0.apk) 优化获取SIM信息兼容高版本Android & 自动填写设备备注 & 自动填充卡槽信息到SIM1备注/SIM2备注 & 支持卡槽匹配规则 & 支持正则匹配规则
--------
## 反馈与建议:
+ 提交issues 或 pr
+ 加入交流群
| | |
| ---- | ---- |
| QQ交流群562854376 | 提交issues 或 pr |
| ![QQ交流群562854376](pic/qqgroup.jpg "QQ交流群562854376") | ![QQ交流群562854376](pic/about.jpg "QQ交流群562854376") |
| QQ交流群562854376 | 微信交流群 |
| ![QQ交流群562854376](pic/qqgroup.jpg "QQ交流群562854376") | ![微信交流群](pic/wechat.jpg "微信交流群") |
## LICENSE

@ -10,9 +10,9 @@
{
"type": "SINGLE",
"filters": [],
"versionCode": 15,
"versionName": "1.5.2",
"outputFile": "SmsForwarder_release_20210311_1.5.2.apk"
"versionCode": 16,
"versionName": "1.6.0",
"outputFile": "SmsForwarder_release_20210312_1.6.0.apk"
}
]
}

@ -1,5 +1,6 @@
package com.idormy.sms.forwarder;
import android.annotation.SuppressLint;
import android.content.DialogInterface;
import android.os.Bundle;
import android.os.Handler;
@ -144,7 +145,15 @@ public class RuleActivity extends AppCompatActivity {
if (ruleModel != null) radioGroupRuleFiled.check(ruleModel.getRuleFiledCheckId());
final RadioGroup radioGroupRuleCheck = (RadioGroup) view1.findViewById(R.id.radioGroupRuleCheck);
if (ruleModel != null) radioGroupRuleCheck.check(ruleModel.getRuleCheckCheckId());
final RadioGroup radioGroupRuleCheck2 = (RadioGroup) view1.findViewById(R.id.radioGroupRuleCheck2);
if (ruleModel != null) {
int ruleCheckCheckId = ruleModel.getRuleCheckCheckId();
if (ruleCheckCheckId == R.id.btnIs || ruleCheckCheckId == R.id.btnNotIs || ruleCheckCheckId == R.id.btnContain) {
radioGroupRuleCheck.check(ruleCheckCheckId);
} else {
radioGroupRuleCheck2.check(ruleCheckCheckId);
}
}
final RadioGroup radioGroupSimSlot = (RadioGroup) view1.findViewById(R.id.radioGroupSimSlot);
if (ruleModel != null) radioGroupSimSlot.check(ruleModel.getRuleSimSlotCheckId());
@ -174,7 +183,7 @@ public class RuleActivity extends AppCompatActivity {
//当更新选择的字段的时候,更新之下各个选项的状态
final LinearLayout matchTypeLayout = (LinearLayout) view1.findViewById(R.id.matchTypeLayout);
final LinearLayout matchValueLayout = (LinearLayout) view1.findViewById(R.id.matchValueLayout);
refreshSelectRadioGroupRuleFiled(radioGroupRuleFiled, radioGroupRuleCheck, editTextRuleValue, tv_mu_rule_tips, matchTypeLayout, matchValueLayout);
refreshSelectRadioGroupRuleFiled(radioGroupRuleFiled, radioGroupRuleCheck, radioGroupRuleCheck2, editTextRuleValue, tv_mu_rule_tips, matchTypeLayout, matchValueLayout);
Button buttonruleok = view1.findViewById(R.id.buttonruleok);
Button buttonruledel = view1.findViewById(R.id.buttonruledel);
@ -189,10 +198,12 @@ public class RuleActivity extends AppCompatActivity {
@Override
public void onClick(View view) {
Object senderId = ruleSenderTv.getTag();
int radioGroupRuleCheckId = Math.max(radioGroupRuleCheck.getCheckedRadioButtonId(), radioGroupRuleCheck2.getCheckedRadioButtonId());
Log.d(TAG, "XXXX " + radioGroupRuleCheck.getCheckedRadioButtonId() + " " + radioGroupRuleCheck2.getCheckedRadioButtonId() + " " + radioGroupRuleCheckId);
if (ruleModel == null) {
RuleModel newRuleModel = new RuleModel();
newRuleModel.setFiled(RuleModel.getRuleFiledFromCheckId(radioGroupRuleFiled.getCheckedRadioButtonId()));
newRuleModel.setCheck(RuleModel.getRuleCheckFromCheckId(radioGroupRuleCheck.getCheckedRadioButtonId()));
newRuleModel.setCheck(RuleModel.getRuleCheckFromCheckId(radioGroupRuleCheckId));
newRuleModel.setSimSlot(RuleModel.getRuleSimSlotFromCheckId(radioGroupSimSlot.getCheckedRadioButtonId()));
newRuleModel.setValue(editTextRuleValue.getText().toString());
if (senderId != null) {
@ -203,7 +214,7 @@ public class RuleActivity extends AppCompatActivity {
adapter.add(ruleModels);
} else {
ruleModel.setFiled(RuleModel.getRuleFiledFromCheckId(radioGroupRuleFiled.getCheckedRadioButtonId()));
ruleModel.setCheck(RuleModel.getRuleCheckFromCheckId(radioGroupRuleCheck.getCheckedRadioButtonId()));
ruleModel.setCheck(RuleModel.getRuleCheckFromCheckId(radioGroupRuleCheckId));
ruleModel.setSimSlot(RuleModel.getRuleSimSlotFromCheckId(radioGroupSimSlot.getCheckedRadioButtonId()));
ruleModel.setValue(editTextRuleValue.getText().toString());
if (senderId != null) {
@ -237,10 +248,11 @@ public class RuleActivity extends AppCompatActivity {
if (senderId == null) {
Toast.makeText(RuleActivity.this, "请先创建选择发送方", Toast.LENGTH_LONG).show();
} else {
int radioGroupRuleCheckId = Math.max(radioGroupRuleCheck.getCheckedRadioButtonId(), radioGroupRuleCheck2.getCheckedRadioButtonId());
if (ruleModel == null) {
RuleModel newRuleModel = new RuleModel();
newRuleModel.setFiled(RuleModel.getRuleFiledFromCheckId(radioGroupRuleFiled.getCheckedRadioButtonId()));
newRuleModel.setCheck(RuleModel.getRuleCheckFromCheckId(radioGroupRuleCheck.getCheckedRadioButtonId()));
newRuleModel.setCheck(RuleModel.getRuleCheckFromCheckId(radioGroupRuleCheckId));
newRuleModel.setSimSlot(RuleModel.getRuleSimSlotFromCheckId(radioGroupSimSlot.getCheckedRadioButtonId()));
newRuleModel.setValue(editTextRuleValue.getText().toString());
newRuleModel.setSenderId(Long.valueOf(senderId.toString()));
@ -248,7 +260,7 @@ public class RuleActivity extends AppCompatActivity {
testRule(newRuleModel, Long.valueOf(senderId.toString()));
} else {
ruleModel.setFiled(RuleModel.getRuleFiledFromCheckId(radioGroupRuleFiled.getCheckedRadioButtonId()));
ruleModel.setCheck(RuleModel.getRuleCheckFromCheckId(radioGroupRuleCheck.getCheckedRadioButtonId()));
ruleModel.setCheck(RuleModel.getRuleCheckFromCheckId(radioGroupRuleCheckId));
ruleModel.setSimSlot(RuleModel.getRuleSimSlotFromCheckId(radioGroupSimSlot.getCheckedRadioButtonId()));
ruleModel.setValue(editTextRuleValue.getText().toString());
ruleModel.setSenderId(Long.valueOf(senderId.toString()));
@ -264,18 +276,57 @@ public class RuleActivity extends AppCompatActivity {
//当更新选择的字段的时候,更新之下各个选项的状态
// 如果设置了转发全部,禁用选择模式和匹配值输入
// 如果设置了多重规则,选择模式置为是
private void refreshSelectRadioGroupRuleFiled(RadioGroup radioGroupRuleFiled, final RadioGroup radioGroupRuleCheck, final EditText editTextRuleValue, final TextView tv_mu_rule_tips, final LinearLayout matchTypeLayout, final LinearLayout matchValueLayout) {
refreshSelectRadioGroupRuleFiledAction(radioGroupRuleFiled.getCheckedRadioButtonId(), radioGroupRuleCheck, editTextRuleValue, tv_mu_rule_tips, matchTypeLayout, matchValueLayout);
private void refreshSelectRadioGroupRuleFiled(RadioGroup radioGroupRuleFiled, final RadioGroup radioGroupRuleCheck, final RadioGroup radioGroupRuleCheck2, final EditText editTextRuleValue, final TextView tv_mu_rule_tips, final LinearLayout matchTypeLayout, final LinearLayout matchValueLayout) {
refreshSelectRadioGroupRuleFiledAction(radioGroupRuleFiled.getCheckedRadioButtonId(), radioGroupRuleCheck, radioGroupRuleCheck2, editTextRuleValue, tv_mu_rule_tips, matchTypeLayout, matchValueLayout);
radioGroupRuleCheck.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
@SuppressLint("ResourceType")
@Override
public void onCheckedChanged(RadioGroup group, int checkedId) {
Log.d(TAG, String.valueOf(group));
Log.d(TAG, String.valueOf(checkedId));
if (group != null && checkedId > 0) {
if (group == radioGroupRuleCheck) {
radioGroupRuleCheck2.clearCheck();
} else if (group == radioGroupRuleCheck2) {
radioGroupRuleCheck.clearCheck();
}
group.check(checkedId);
}
}
});
radioGroupRuleCheck2.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
@SuppressLint("ResourceType")
@Override
public void onCheckedChanged(RadioGroup group, int checkedId) {
Log.d(TAG, String.valueOf(group));
Log.d(TAG, String.valueOf(checkedId));
if (group != null && checkedId > 0) {
if (group == radioGroupRuleCheck) {
radioGroupRuleCheck2.clearCheck();
} else if (group == radioGroupRuleCheck2) {
radioGroupRuleCheck.clearCheck();
}
group.check(checkedId);
}
}
});
radioGroupRuleFiled.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(RadioGroup group, int checkedId) {
refreshSelectRadioGroupRuleFiledAction(checkedId, radioGroupRuleCheck, editTextRuleValue, tv_mu_rule_tips, matchTypeLayout, matchValueLayout);
Log.d(TAG, String.valueOf(group));
Log.d(TAG, String.valueOf(checkedId));
if (group == radioGroupRuleCheck) {
radioGroupRuleCheck2.clearCheck();
} else if (group == radioGroupRuleCheck2) {
radioGroupRuleCheck.clearCheck();
}
refreshSelectRadioGroupRuleFiledAction(checkedId, radioGroupRuleCheck, radioGroupRuleCheck2, editTextRuleValue, tv_mu_rule_tips, matchTypeLayout, matchValueLayout);
}
});
}
private void refreshSelectRadioGroupRuleFiledAction(int checkedRuleFiledId, final RadioGroup radioGroupRuleCheck, final EditText editTextRuleValue, final TextView tv_mu_rule_tips, final LinearLayout matchTypeLayout, final LinearLayout matchValueLayout) {
private void refreshSelectRadioGroupRuleFiledAction(int checkedRuleFiledId, final RadioGroup radioGroupRuleCheck, final RadioGroup radioGroupRuleCheck2, final EditText editTextRuleValue, final TextView tv_mu_rule_tips, final LinearLayout matchTypeLayout, final LinearLayout matchValueLayout) {
tv_mu_rule_tips.setVisibility(View.GONE);
matchTypeLayout.setVisibility(View.VISIBLE);
matchValueLayout.setVisibility(View.VISIBLE);
@ -285,6 +336,9 @@ public class RuleActivity extends AppCompatActivity {
for (int i = 0; i < radioGroupRuleCheck.getChildCount(); i++) {
((RadioButton) radioGroupRuleCheck.getChildAt(i)).setEnabled(false);
}
for (int i = 0; i < radioGroupRuleCheck2.getChildCount(); i++) {
((RadioButton) radioGroupRuleCheck2.getChildAt(i)).setEnabled(false);
}
editTextRuleValue.setEnabled(false);
matchTypeLayout.setVisibility(View.GONE);
matchValueLayout.setVisibility(View.GONE);
@ -293,6 +347,9 @@ public class RuleActivity extends AppCompatActivity {
for (int i = 0; i < radioGroupRuleCheck.getChildCount(); i++) {
((RadioButton) radioGroupRuleCheck.getChildAt(i)).setEnabled(false);
}
for (int i = 0; i < radioGroupRuleCheck2.getChildCount(); i++) {
((RadioButton) radioGroupRuleCheck2.getChildAt(i)).setEnabled(false);
}
editTextRuleValue.setEnabled(true);
matchTypeLayout.setVisibility(View.GONE);
tv_mu_rule_tips.setVisibility(MyApplication.showHelpTip ? View.VISIBLE : View.GONE);
@ -301,6 +358,9 @@ public class RuleActivity extends AppCompatActivity {
for (int i = 0; i < radioGroupRuleCheck.getChildCount(); i++) {
((RadioButton) radioGroupRuleCheck.getChildAt(i)).setEnabled(true);
}
for (int i = 0; i < radioGroupRuleCheck2.getChildCount(); i++) {
((RadioButton) radioGroupRuleCheck2.getChildAt(i)).setEnabled(true);
}
editTextRuleValue.setEnabled(true);
break;
}

@ -42,6 +42,7 @@ public class RuleModel {
CHECK_MAP.put("startwith", "开头是");
CHECK_MAP.put("endwith", "结尾是");
CHECK_MAP.put("notis", "不是");
CHECK_MAP.put("regex", "正则匹配");
}
static {

@ -111,7 +111,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="开源地址" />
android:text="更新日志" />
<TextView
android:id="@+id/linkweb"
@ -120,7 +120,7 @@
android:layout_weight="3"
android:autoLink="web"
android:gravity="right"
android:text="https://github.com/pppscn/SmsForwarder"
android:text="https://github.com/pppscn/SmsForwarder/releases"
android:textSize="14sp" />
</LinearLayout>

@ -24,32 +24,24 @@
<RadioGroup
android:id="@+id/radioGroupSimSlot"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="left|center_vertical"
style="@style/rg_style"
android:orientation="horizontal">
<RadioButton
android:id="@+id/btnSimSlotAll"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/rg_rb_style"
android:checked="true"
android:text="全部"
android:textSize="13sp" />
android:text="全部" />
<RadioButton
android:id="@+id/btnSimSlot1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="SIM1"
android:textSize="13sp" />
style="@style/rg_rb_style"
android:text="SIM1" />
<RadioButton
android:id="@+id/btnSimSlot2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="SIM2"
android:textSize="13sp" />
style="@style/rg_rb_style"
android:text="SIM2" />
</RadioGroup>
</LinearLayout>
@ -70,38 +62,29 @@
<RadioGroup
android:id="@+id/radioGroupRuleFiled"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/rg_style"
android:orientation="horizontal">
<RadioButton
android:id="@+id/btnTranspondAll"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/rg_rb_style"
android:checked="true"
android:text="全部"
android:textSize="13sp" />
android:text="全部" />
<RadioButton
android:id="@+id/btnPhone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="手机号"
android:textSize="13sp" />
style="@style/rg_rb_style"
android:text="手机号" />
<RadioButton
android:id="@+id/btnContent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="内容"
android:textSize="13sp" />
style="@style/rg_rb_style"
android:text="内容" />
<RadioButton
android:id="@+id/btnMultiMatch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="多重匹配"
android:textSize="13sp" />
style="@style/rg_rb_style"
android:text="多重匹配" />
</RadioGroup>
</LinearLayout>
@ -123,53 +106,45 @@
<RadioGroup
android:id="@+id/radioGroupRuleCheck"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="left|center_vertical"
style="@style/rg_style"
android:orientation="horizontal">
<RadioButton
android:id="@+id/btnIs"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/rg_rb_style"
android:checked="true"
android:text="是"
android:textSize="13sp" />
android:text="是   " />
<RadioButton
android:id="@+id/btnNotIs"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="不是"
android:textSize="13sp" />
style="@style/rg_rb_style"
android:text="不是  " />
<RadioButton
android:id="@+id/btnContain"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="包含"
android:textSize="13sp" />
style="@style/rg_rb_style"
android:text="包含  " />
</RadioGroup>
<RadioGroup
android:id="@+id/radioGroupRuleCheck2"
style="@style/rg_style"
android:orientation="horizontal">
<RadioButton
android:id="@+id/btnStartWith"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="开头"
android:textSize="13sp" />
style="@style/rg_rb_style"
android:text="开头  " />
<RadioButton
android:id="@+id/btnEndWith"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="结尾"
android:textSize="13sp" />
style="@style/rg_rb_style"
android:text="结尾  " />
<RadioButton
android:id="@+id/btnRegex"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="正则"
android:textSize="13sp" />
style="@style/rg_rb_style"
android:text="正则匹配" />
</RadioGroup>
</LinearLayout>

@ -8,4 +8,15 @@
<item name="colorAccent">@color/colorAccent</item>
</style>
<style name="rg_style">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
</style>
<style name="rg_rb_style">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_weight">1</item>
</style>
</resources>

@ -1,4 +1,4 @@
ext {
appVersionCode = 15
appVersionName = "1.5.2"
appVersionCode = 16
appVersionName = "1.6.0"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 304 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 256 KiB

After

Width:  |  Height:  |  Size: 239 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 KiB

Loading…
Cancel
Save