diff --git a/README.md b/README.md
index 65769ea4..3743b933 100644
--- a/README.md
+++ b/README.md
@@ -46,6 +46,7 @@ Android手机监听短信并根据指定规则转发到其他手机、钉钉机
- [x] 清理缓存
- [x] 兼容6.xx、7.xx、8.xx、9.xx、10.xx
- [x] 支持双卡手机,增加卡槽标识/运营商/手机号(如果能获取的话)
+- [x] 支持多重匹配规则
### 使用流程:
1. 在Android手机上安装SmsForwarder 本APP后点击应用图标打开
@@ -74,11 +75,14 @@ Android手机监听短信并根据指定规则转发到其他手机、钉钉机
| ![添加编辑发送方网页通知](pic/sendersetwebnotify.png "添加编辑发送方网页通知") | ![添加编辑发送方企业微信群机器人](pic/sendersetqywechat.png "添加编辑发送方企业微信群机器人") |
| ![状态栏运行状态](pic/taskbar.png "状态栏运行状态") | ![应用设置](pic/setting.png "应用设置") |
| ![在线升级](pic/update.png "在线升级") | ![增加卡槽标识](pic/siminfo.png "增加卡槽标识") |
+| ![多重匹配规则](pic/multimatch.png "多重匹配规则") | |
--------
## 更新记录:
+> [v1.4.0](app/release/SmsForwarder_release_20210304_1.4.0.apk) 支持多重匹配规则
+
> [v1.3.0](app/release/SmsForwarder_release_20210303_1.3.0.apk) 支持双卡手机,增加卡槽标识/运营商/手机号(如果能获取的话)
> [v1.2.3](app/release/SmsForwarder_release_20210302_1.2.3.apk) 【预发布】转发日志列表/详情增加卡槽标识(SIM1 或 SIM2)
diff --git a/app/build.gradle b/app/build.gradle
index 56991702..2bc65169 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -14,8 +14,8 @@ android {
applicationId "com.idormy.sms.forwarder"
minSdkVersion 23
targetSdkVersion 28
- versionCode 10
- versionName "1.3.0"
+ versionCode 11
+ versionName "1.4.0"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
}
signingConfigs {
diff --git a/app/release/SmsForwarder_release_20210304_1.4.0.apk b/app/release/SmsForwarder_release_20210304_1.4.0.apk
new file mode 100644
index 00000000..18726731
Binary files /dev/null and b/app/release/SmsForwarder_release_20210304_1.4.0.apk differ
diff --git a/app/release/output-metadata.json b/app/release/output-metadata.json
index 15be158b..3563ee2a 100644
--- a/app/release/output-metadata.json
+++ b/app/release/output-metadata.json
@@ -10,9 +10,9 @@
{
"type": "SINGLE",
"filters": [],
- "versionCode": 10,
- "versionName": "1.3.0",
- "outputFile": "SmsForwarder_release_20210303_1.3.0.apk"
+ "versionCode": 11,
+ "versionName": "1.4.0",
+ "outputFile": "SmsForwarder_release_20210304_1.4.0.apk"
}
]
}
\ No newline at end of file
diff --git a/app/src/main/java/com/idormy/sms/forwarder/RuleActivity.java b/app/src/main/java/com/idormy/sms/forwarder/RuleActivity.java
index 5bee327e..31668f4a 100644
--- a/app/src/main/java/com/idormy/sms/forwarder/RuleActivity.java
+++ b/app/src/main/java/com/idormy/sms/forwarder/RuleActivity.java
@@ -9,6 +9,7 @@ import android.view.View;
import android.widget.AdapterView;
import android.widget.Button;
import android.widget.EditText;
+import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.RadioButton;
import android.widget.RadioGroup;
@@ -157,13 +158,16 @@ public class RuleActivity extends AppCompatActivity {
editTextRuleValue.setText(ruleModel.getValue());
//当更新选择的字段的时候,更新之下各个选项的状态
- refreshSelectRadioGroupRuleFiled(radioGroupRuleFiled, radioGroupRuleCheck, editTextRuleValue, tv_mu_rule_tips);
+ 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);
Button buttonruleok = view1.findViewById(R.id.buttonruleok);
Button buttonruledel = view1.findViewById(R.id.buttonruledel);
Button buttonruletest = view1.findViewById(R.id.buttonruletest);
alertDialog71
.setTitle(R.string.setrule)
+ //.setIcon(R.drawable.ic_sms_forwarder)
.setView(view1)
.create();
final AlertDialog show = alertDialog71.show();
@@ -236,7 +240,6 @@ public class RuleActivity extends AppCompatActivity {
}
-
}
}
@@ -247,19 +250,21 @@ public class RuleActivity extends AppCompatActivity {
//当更新选择的字段的时候,更新之下各个选项的状态
// 如果设置了转发全部,禁用选择模式和匹配值输入
// 如果设置了多重规则,选择模式置为是
- private void refreshSelectRadioGroupRuleFiled(RadioGroup radioGroupRuleFiled, final RadioGroup radioGroupRuleCheck, final EditText editTextRuleValue, final TextView tv_mu_rule_tips) {
- refreshSelectRadioGroupRuleFiledAction(radioGroupRuleFiled.getCheckedRadioButtonId(), radioGroupRuleCheck, editTextRuleValue, tv_mu_rule_tips);
+ 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);
radioGroupRuleFiled.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(RadioGroup group, int checkedId) {
- refreshSelectRadioGroupRuleFiledAction(checkedId, radioGroupRuleCheck, editTextRuleValue, tv_mu_rule_tips);
+ refreshSelectRadioGroupRuleFiledAction(checkedId, radioGroupRuleCheck, editTextRuleValue, tv_mu_rule_tips, matchTypeLayout, matchValueLayout);
}
});
}
- private void refreshSelectRadioGroupRuleFiledAction(int checkedRuleFiledId, final RadioGroup radioGroupRuleCheck, final EditText editTextRuleValue, final TextView tv_mu_rule_tips) {
+ private void refreshSelectRadioGroupRuleFiledAction(int checkedRuleFiledId, final RadioGroup radioGroupRuleCheck, 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);
switch (checkedRuleFiledId) {
case R.id.btnTranspondAll:
@@ -267,12 +272,15 @@ public class RuleActivity extends AppCompatActivity {
((RadioButton) radioGroupRuleCheck.getChildAt(i)).setEnabled(false);
}
editTextRuleValue.setEnabled(false);
+ matchTypeLayout.setVisibility(View.GONE);
+ matchValueLayout.setVisibility(View.GONE);
break;
case R.id.btnMultiMatch:
for (int i = 0; i < radioGroupRuleCheck.getChildCount(); i++) {
((RadioButton) radioGroupRuleCheck.getChildAt(i)).setEnabled(false);
}
editTextRuleValue.setEnabled(true);
+ matchTypeLayout.setVisibility(View.GONE);
tv_mu_rule_tips.setVisibility(View.VISIBLE);
break;
default:
diff --git a/app/src/main/res/layout/activity_alter_dialog_setview_rule.xml b/app/src/main/res/layout/activity_alter_dialog_setview_rule.xml
index 44060656..ffc581b7 100644
--- a/app/src/main/res/layout/activity_alter_dialog_setview_rule.xml
+++ b/app/src/main/res/layout/activity_alter_dialog_setview_rule.xml
@@ -18,7 +18,8 @@
+ android:text="设置匹配的字段"
+ android:textStyle="bold" />
+ android:text="短信内容" />
-
+ android:text="设置匹配的模式"
+ android:textStyle="bold" />
+ android:text="设置匹配的值"
+ android:textStyle="bold" />
+
+
+ android:text="设置发送方"
+ android:textStyle="bold" />