支持标注卡槽号码(优先使用)、设备信息;自定义转发信息模版
16
README.md
@ -52,8 +52,9 @@ Android手机监听短信并根据指定规则转发到其他手机:钉钉机
|
|||||||
- [x] 兼容6.xx、7.xx、8.xx、9.xx、10.xx
|
- [x] 兼容6.xx、7.xx、8.xx、9.xx、10.xx
|
||||||
- [x] 支持双卡手机,增加卡槽标识/运营商/手机号(如果能获取的话)
|
- [x] 支持双卡手机,增加卡槽标识/运营商/手机号(如果能获取的话)
|
||||||
- [x] 支持多重匹配规则
|
- [x] 支持多重匹配规则
|
||||||
|
- [x] 支持标注卡槽号码(优先使用)、设备信息;自定义转发信息模版
|
||||||
- [ ] 支持正则匹配规则
|
- [ ] 支持正则匹配规则
|
||||||
- [ ] 支持卡槽号码标注与匹配规则
|
- [ ] 支持卡槽匹配规则
|
||||||
- [ ] 转发规则、发送方配置导出与导入
|
- [ ] 转发规则、发送方配置导出与导入
|
||||||
|
|
||||||
### 使用流程:
|
### 使用流程:
|
||||||
@ -80,7 +81,7 @@ Android手机监听短信并根据指定规则转发到其他手机:钉钉机
|
|||||||
|  |  |
|
|  |  |
|
||||||
| 转发规则 | 转发详情 |
|
| 转发规则 | 转发详情 |
|
||||||
|  |  |
|
|  |  |
|
||||||
| 添加/编辑转发规则 | 多重匹配规则 |
|
| 添加/编辑转发规则测试 | 多重匹配规则 |
|
||||||
|  | |
|
|  | |
|
||||||
| 支持以下转发方式(发送方) | 添加/编辑发送方钉钉 |
|
| 支持以下转发方式(发送方) | 添加/编辑发送方钉钉 |
|
||||||
|  |  |
|
|  |  |
|
||||||
@ -90,7 +91,7 @@ Android手机监听短信并根据指定规则转发到其他手机:钉钉机
|
|||||||
|  |  |
|
|  |  |
|
||||||
| 添加/编辑发送方企业微信应用 | 应用设置 |
|
| 添加/编辑发送方企业微信应用 | 应用设置 |
|
||||||
|  |  |
|
|  |  |
|
||||||
| 在线升级 | 转发短信模板增加卡槽标识 |
|
| 关于/在线升级 | 转发短信模板增加卡槽标识 |
|
||||||
|  |  |
|
|  |  |
|
||||||
|
|
||||||
|
|
||||||
@ -112,14 +113,17 @@ Android手机监听短信并根据指定规则转发到其他手机:钉钉机
|
|||||||
+ [v1.4.1](app/release/SmsForwarder_release_20210304_1.4.1.apk) 设置中允许关闭页面帮助/表单填写提示
|
+ [v1.4.1](app/release/SmsForwarder_release_20210304_1.4.1.apk) 设置中允许关闭页面帮助/表单填写提示
|
||||||
+ [v1.5.0](app/release/SmsForwarder_release_20210305_1.5.0.apk) 新增转发到企业微信应用消息
|
+ [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.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) 支持标注卡槽号码(优先使用)、设备信息;自定义转发信息模版
|
||||||
|
|
||||||
--------
|
--------
|
||||||
|
|
||||||
## 反馈与建议:
|
## 反馈与建议:
|
||||||
|
|
||||||
+ QQ交流群:562854376
|
| | |
|
||||||

|
| ---- | ---- |
|
||||||
+ 提交issues 或 pr
|
| QQ交流群:562854376 | 提交issues 或 pr |
|
||||||
|
|  |  |
|
||||||
|
|
||||||
|
|
||||||
## LICENSE
|
## LICENSE
|
||||||
BSD
|
BSD
|
||||||
|
BIN
app/release/SmsForwarder_release_20210311_1.5.2.apk
Normal file
@ -10,9 +10,9 @@
|
|||||||
{
|
{
|
||||||
"type": "SINGLE",
|
"type": "SINGLE",
|
||||||
"filters": [],
|
"filters": [],
|
||||||
"versionCode": 14,
|
"versionCode": 15,
|
||||||
"versionName": "1.5.1",
|
"versionName": "1.5.2",
|
||||||
"outputFile": "SmsForwarder_release_20210310_1.5.1.apk"
|
"outputFile": "SmsForwarder_release_20210311_1.5.2.apk"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
@ -10,6 +10,7 @@ import android.util.Log;
|
|||||||
import com.idormy.sms.forwarder.MyApplication;
|
import com.idormy.sms.forwarder.MyApplication;
|
||||||
import com.idormy.sms.forwarder.model.vo.SmsVo;
|
import com.idormy.sms.forwarder.model.vo.SmsVo;
|
||||||
import com.idormy.sms.forwarder.sender.SendUtil;
|
import com.idormy.sms.forwarder.sender.SendUtil;
|
||||||
|
import com.idormy.sms.forwarder.utils.SettingUtil;
|
||||||
import com.idormy.sms.forwarder.utils.SimUtil;
|
import com.idormy.sms.forwarder.utils.SimUtil;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -35,12 +36,19 @@ public class SmsForwarderBroadcastReceiver extends BroadcastReceiver {
|
|||||||
if (object != null) {
|
if (object != null) {
|
||||||
|
|
||||||
//获取接收手机号
|
//获取接收手机号
|
||||||
String phoneNumber = "";
|
String simInfo = "";
|
||||||
try {
|
try {
|
||||||
|
//获取卡槽ID
|
||||||
String simInfoId = String.valueOf(SimUtil.getSimId(extras));
|
String simInfoId = String.valueOf(SimUtil.getSimId(extras));
|
||||||
Map<String, String> sim = MyApplication.SimInfo.get(simInfoId);
|
Map<String, String> sim = MyApplication.SimInfo.get(simInfoId);
|
||||||
int sim_id = Integer.parseInt(sim.get("sim_id")) + 1;
|
int sim_id = Integer.parseInt(sim.get("sim_id")) + 1;
|
||||||
phoneNumber = "SIM" + sim_id + "_" + sim.get("carrier_name") + "_" + sim.get("phone_number");
|
|
||||||
|
simInfo = sim_id == 2 ? SettingUtil.getAddExtraSim2() : SettingUtil.getAddExtraSim1();
|
||||||
|
if (!simInfo.isEmpty()) {
|
||||||
|
simInfo = "SIM" + sim_id + "_" + simInfo;
|
||||||
|
} else {
|
||||||
|
simInfo = "SIM" + sim_id + "_" + sim.get("carrier_name") + "_" + sim.get("phone_number");
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.e(TAG, "获取接收手机号失败:" + e.getMessage());
|
Log.e(TAG, "获取接收手机号失败:" + e.getMessage());
|
||||||
}
|
}
|
||||||
@ -67,7 +75,7 @@ public class SmsForwarderBroadcastReceiver extends BroadcastReceiver {
|
|||||||
|
|
||||||
}
|
}
|
||||||
for (String mobile : mobileToContent.keySet()) {
|
for (String mobile : mobileToContent.keySet()) {
|
||||||
smsVoList.add(new SmsVo(mobile, mobileToContent.get(mobile), date, phoneNumber));
|
smsVoList.add(new SmsVo(mobile, mobileToContent.get(mobile), date, simInfo));
|
||||||
}
|
}
|
||||||
Log.d(TAG, "短信:" + smsVoList);
|
Log.d(TAG, "短信:" + smsVoList);
|
||||||
SendUtil.send_msg_list(context, smsVoList);
|
SendUtil.send_msg_list(context, smsVoList);
|
||||||
|
@ -1,14 +1,11 @@
|
|||||||
package com.idormy.sms.forwarder;
|
package com.idormy.sms.forwarder;
|
||||||
|
|
||||||
import android.Manifest;
|
import android.Manifest;
|
||||||
import android.content.ContentResolver;
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.IntentFilter;
|
import android.content.IntentFilter;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.database.Cursor;
|
|
||||||
import android.net.Uri;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.telephony.TelephonyManager;
|
import android.telephony.TelephonyManager;
|
||||||
@ -29,13 +26,12 @@ import com.idormy.sms.forwarder.BroadCastReceiver.SmsForwarderBroadcastReceiver;
|
|||||||
import com.idormy.sms.forwarder.adapter.LogAdapter;
|
import com.idormy.sms.forwarder.adapter.LogAdapter;
|
||||||
import com.idormy.sms.forwarder.model.vo.LogVo;
|
import com.idormy.sms.forwarder.model.vo.LogVo;
|
||||||
import com.idormy.sms.forwarder.utils.LogUtil;
|
import com.idormy.sms.forwarder.utils.LogUtil;
|
||||||
|
import com.idormy.sms.forwarder.utils.SimUtil;
|
||||||
import com.idormy.sms.forwarder.utils.aUtil;
|
import com.idormy.sms.forwarder.utils.aUtil;
|
||||||
import com.umeng.analytics.MobclickAgent;
|
import com.umeng.analytics.MobclickAgent;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class MainActivity extends AppCompatActivity implements ReFlashListView.IReflashListener {
|
public class MainActivity extends AppCompatActivity implements ReFlashListView.IReflashListener {
|
||||||
|
|
||||||
@ -67,9 +63,8 @@ public class MainActivity extends AppCompatActivity implements ReFlashListView.I
|
|||||||
}
|
}
|
||||||
|
|
||||||
//获取SIM卡信息
|
//获取SIM卡信息
|
||||||
getSimInfo(Line1Number);
|
MyApplication appContext = ((MyApplication) getApplicationContext());
|
||||||
//MyApplication appContext = ((MyApplication) getApplicationContext());
|
SimUtil.getSimInfo(appContext, Line1Number);
|
||||||
//appContext.setSimInfo(SimInfo);
|
|
||||||
|
|
||||||
setContentView(R.layout.activity_main);
|
setContentView(R.layout.activity_main);
|
||||||
LogUtil.init(this);
|
LogUtil.init(this);
|
||||||
@ -303,37 +298,4 @@ public class MainActivity extends AppCompatActivity implements ReFlashListView.I
|
|||||||
MobclickAgent.onPause(this);
|
MobclickAgent.onPause(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
//获取SIM卡信息
|
|
||||||
private void getSimInfo(String Line1Number) {
|
|
||||||
try {
|
|
||||||
Uri uri = Uri.parse("content://telephony/siminfo"); //访问raw_contacts表
|
|
||||||
MyApplication appContext = ((MyApplication) getApplicationContext());
|
|
||||||
ContentResolver resolver = appContext.getContentResolver();
|
|
||||||
Cursor cursor = resolver.query(uri, new String[]{"_id", "icc_id", "sim_id", "display_name", "carrier_name", "name_source", "color", "number", "display_number_format", "data_roaming", "mcc", "mnc"}, "sim_id >= 0", null, "_id");
|
|
||||||
if (cursor != null) {
|
|
||||||
while (cursor.moveToNext()) {
|
|
||||||
Log.d(TAG, "_id: " + cursor.getString(cursor.getColumnIndex("_id")));
|
|
||||||
Log.d(TAG, "sim_id: " + cursor.getString(cursor.getColumnIndex("sim_id")));
|
|
||||||
Log.d(TAG, "carrier_name: " + cursor.getString(cursor.getColumnIndex("carrier_name")));
|
|
||||||
Log.d(TAG, "display_name: " + cursor.getString(cursor.getColumnIndex("display_name")));
|
|
||||||
Map<String, String> sim = new HashMap();
|
|
||||||
String id = cursor.getString(cursor.getColumnIndex("_id"));
|
|
||||||
sim.put("_id", id);
|
|
||||||
sim.put("sim_id", cursor.getString(cursor.getColumnIndex("sim_id")));
|
|
||||||
sim.put("carrier_name", cursor.getString(cursor.getColumnIndex("carrier_name")));
|
|
||||||
sim.put("display_name", cursor.getString(cursor.getColumnIndex("display_name")));
|
|
||||||
sim.put("phone_number", Line1Number);
|
|
||||||
if (Line1Number != "Unknown") {
|
|
||||||
Line1Number = "Unknown";
|
|
||||||
}
|
|
||||||
MyApplication.SimInfo.put(id, sim);
|
|
||||||
}
|
|
||||||
cursor.close();
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
Log.e(TAG, "getSimInfo fail:" + e.getMessage());
|
|
||||||
Toast.makeText(MainActivity.this, "获取SIM卡信息失败:请先手动设置", Toast.LENGTH_LONG).show();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -26,6 +26,7 @@ import com.idormy.sms.forwarder.model.vo.SmsVo;
|
|||||||
import com.idormy.sms.forwarder.sender.SendUtil;
|
import com.idormy.sms.forwarder.sender.SendUtil;
|
||||||
import com.idormy.sms.forwarder.sender.SenderUtil;
|
import com.idormy.sms.forwarder.sender.SenderUtil;
|
||||||
import com.idormy.sms.forwarder.utils.RuleUtil;
|
import com.idormy.sms.forwarder.utils.RuleUtil;
|
||||||
|
import com.idormy.sms.forwarder.utils.SettingUtil;
|
||||||
import com.umeng.analytics.MobclickAgent;
|
import com.umeng.analytics.MobclickAgent;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -332,7 +333,7 @@ public class RuleActivity extends AppCompatActivity {
|
|||||||
Button buttonruletest = view.findViewById(R.id.buttonruletest);
|
Button buttonruletest = view.findViewById(R.id.buttonruletest);
|
||||||
AlertDialog.Builder ad1 = new AlertDialog.Builder(RuleActivity.this);
|
AlertDialog.Builder ad1 = new AlertDialog.Builder(RuleActivity.this);
|
||||||
ad1.setTitle("测试规则");
|
ad1.setTitle("测试规则");
|
||||||
ad1.setIcon(android.R.drawable.ic_dialog_info);
|
ad1.setIcon(android.R.drawable.ic_dialog_email);
|
||||||
ad1.setView(view);
|
ad1.setView(view);
|
||||||
buttonruletest.setOnClickListener(new View.OnClickListener() {
|
buttonruletest.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
@ -342,7 +343,8 @@ public class RuleActivity extends AppCompatActivity {
|
|||||||
Log.i("editTextTestMsgContent", editTextTestMsgContent.getText().toString());
|
Log.i("editTextTestMsgContent", editTextTestMsgContent.getText().toString());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
SmsVo testSmsVo = new SmsVo(editTextTestPhone.getText().toString(), editTextTestMsgContent.getText().toString(), new Date(), editTextTestPhone.getText().toString());
|
String simInfo = "SIM1_" + SettingUtil.getAddExtraSim1();
|
||||||
|
SmsVo testSmsVo = new SmsVo(editTextTestPhone.getText().toString(), editTextTestMsgContent.getText().toString(), new Date(), simInfo);
|
||||||
SendUtil.sendMsgByRuleModelSenderId(handler, ruleModel, testSmsVo, senderId);
|
SendUtil.sendMsgByRuleModelSenderId(handler, ruleModel, testSmsVo, senderId);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Toast.makeText(RuleActivity.this, e.getMessage(), Toast.LENGTH_LONG).show();
|
Toast.makeText(RuleActivity.this, e.getMessage(), Toast.LENGTH_LONG).show();
|
||||||
|
@ -516,7 +516,7 @@ public class SenderActivity extends AppCompatActivity {
|
|||||||
String barkServer = editTextBarkServer.getText().toString();
|
String barkServer = editTextBarkServer.getText().toString();
|
||||||
if (!barkServer.isEmpty()) {
|
if (!barkServer.isEmpty()) {
|
||||||
try {
|
try {
|
||||||
SenderBarkMsg.sendMsg(handler, barkServer, "19999999999", "【京东】验证码为387481(切勿将验证码告知他人),请在页面中输入完成验证,如有问题请点击 ihelp.jd.com 联系京东客服", "18888888888");
|
SenderBarkMsg.sendMsg(handler, barkServer, "19999999999", "【京东】验证码为387481(切勿将验证码告知他人),请在页面中输入完成验证,如有问题请点击 ihelp.jd.com 联系京东客服");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Toast.makeText(SenderActivity.this, "发送失败:" + e.getMessage(), Toast.LENGTH_LONG).show();
|
Toast.makeText(SenderActivity.this, "发送失败:" + e.getMessage(), Toast.LENGTH_LONG).show();
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
@ -4,8 +4,10 @@ import android.os.Bundle;
|
|||||||
import android.text.Editable;
|
import android.text.Editable;
|
||||||
import android.text.TextWatcher;
|
import android.text.TextWatcher;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
import android.view.View;
|
||||||
import android.widget.CompoundButton;
|
import android.widget.CompoundButton;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
import android.widget.Switch;
|
import android.widget.Switch;
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
@ -33,6 +35,12 @@ public class SettingActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
EditText et_add_extra_sim2 = (EditText) findViewById(R.id.et_add_extra_sim2);
|
EditText et_add_extra_sim2 = (EditText) findViewById(R.id.et_add_extra_sim2);
|
||||||
editAddExtraSim2(et_add_extra_sim2);
|
editAddExtraSim2(et_add_extra_sim2);
|
||||||
|
|
||||||
|
Switch switch_sms_template = (Switch) findViewById(R.id.switch_sms_template);
|
||||||
|
switchSmsTemplate(switch_sms_template);
|
||||||
|
|
||||||
|
EditText textSmsTemplate = (EditText) findViewById(R.id.text_sms_template);
|
||||||
|
editSmsTemplate(textSmsTemplate);
|
||||||
}
|
}
|
||||||
|
|
||||||
//设置转发附加信息
|
//设置转发附加信息
|
||||||
@ -66,7 +74,6 @@ public class SettingActivity extends AppCompatActivity {
|
|||||||
@Override
|
@Override
|
||||||
public void afterTextChanged(Editable s) {
|
public void afterTextChanged(Editable s) {
|
||||||
SettingUtil.setAddExtraDeviceMark(et_add_extra_device_mark.getText().toString());
|
SettingUtil.setAddExtraDeviceMark(et_add_extra_device_mark.getText().toString());
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -89,7 +96,6 @@ public class SettingActivity extends AppCompatActivity {
|
|||||||
@Override
|
@Override
|
||||||
public void afterTextChanged(Editable s) {
|
public void afterTextChanged(Editable s) {
|
||||||
SettingUtil.setAddExtraSim1(et_add_extra_sim1.getText().toString());
|
SettingUtil.setAddExtraSim1(et_add_extra_sim1.getText().toString());
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -112,10 +118,80 @@ public class SettingActivity extends AppCompatActivity {
|
|||||||
@Override
|
@Override
|
||||||
public void afterTextChanged(Editable s) {
|
public void afterTextChanged(Editable s) {
|
||||||
SettingUtil.setAddExtraSim2(et_add_extra_sim2.getText().toString());
|
SettingUtil.setAddExtraSim2(et_add_extra_sim2.getText().toString());
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//设置转发时启用自定义模版
|
||||||
|
private void switchSmsTemplate(Switch switch_sms_template) {
|
||||||
|
boolean isOn = SettingUtil.getSwitchSmsTemplate();
|
||||||
|
switch_sms_template.setChecked(isOn);
|
||||||
|
|
||||||
|
final LinearLayout layout_sms_template = (LinearLayout) findViewById(R.id.layout_sms_template);
|
||||||
|
layout_sms_template.setVisibility(isOn ? View.VISIBLE : View.GONE);
|
||||||
|
final EditText textSmsTemplate = (EditText) findViewById(R.id.text_sms_template);
|
||||||
|
|
||||||
|
switch_sms_template.setOnCheckedChangeListener(new Switch.OnCheckedChangeListener() {
|
||||||
|
@Override
|
||||||
|
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||||
|
Log.d(TAG, "onCheckedChanged:" + isChecked);
|
||||||
|
layout_sms_template.setVisibility(isChecked ? View.VISIBLE : View.GONE);
|
||||||
|
SettingUtil.switchSmsTemplate(isChecked);
|
||||||
|
if (!isChecked) {
|
||||||
|
textSmsTemplate.setText("{{来源号码}}\n{{短信内容}}\n{{卡槽信息}}\n{{接收时间}}\n{{设备名称}}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//设置转发附加信息devicemark
|
||||||
|
private void editSmsTemplate(final EditText textSmsTemplate) {
|
||||||
|
textSmsTemplate.setText(SettingUtil.getSmsTemplate());
|
||||||
|
|
||||||
|
textSmsTemplate.addTextChangedListener(new TextWatcher() {
|
||||||
|
@Override
|
||||||
|
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void afterTextChanged(Editable s) {
|
||||||
|
SettingUtil.setSmsTemplate(textSmsTemplate.getText().toString());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//插入标签
|
||||||
|
public void toInsertLabel(View v) {
|
||||||
|
EditText textSmsTemplate = (EditText) findViewById(R.id.text_sms_template);
|
||||||
|
textSmsTemplate.setFocusable(true);
|
||||||
|
textSmsTemplate.requestFocus();
|
||||||
|
switch (v.getId()) {
|
||||||
|
case R.id.bt_insert_sender:
|
||||||
|
textSmsTemplate.append("{{来源号码}}");
|
||||||
|
return;
|
||||||
|
/*case R.id.bt_insert_receiver:
|
||||||
|
textSmsTemplate.append("{{接收号码}}");
|
||||||
|
return;*/
|
||||||
|
case R.id.bt_insert_content:
|
||||||
|
textSmsTemplate.append("{{短信内容}}");
|
||||||
|
return;
|
||||||
|
case R.id.bt_insert_extra:
|
||||||
|
textSmsTemplate.append("{{卡槽信息}}");
|
||||||
|
return;
|
||||||
|
case R.id.bt_insert_time:
|
||||||
|
textSmsTemplate.append("{{接收时间}}");
|
||||||
|
case R.id.bt_insert_device_name:
|
||||||
|
textSmsTemplate.append("{{设备名称}}");
|
||||||
|
return;
|
||||||
|
default:
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
package com.idormy.sms.forwarder.model.vo;
|
package com.idormy.sms.forwarder.model.vo;
|
||||||
|
|
||||||
|
import com.idormy.sms.forwarder.utils.SettingUtil;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
@ -8,16 +10,16 @@ public class SmsVo implements Serializable {
|
|||||||
String mobile;
|
String mobile;
|
||||||
String content;
|
String content;
|
||||||
Date date;
|
Date date;
|
||||||
String phoneNumber = "本机号码:未知";
|
String simInfo = "本机号码:未知";
|
||||||
|
|
||||||
public SmsVo() {
|
public SmsVo() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public SmsVo(String mobile, String content, Date date, String phoneNumber) {
|
public SmsVo(String mobile, String content, Date date, String simInfo) {
|
||||||
this.mobile = mobile;
|
this.mobile = mobile;
|
||||||
this.content = content;
|
this.content = content;
|
||||||
this.date = date;
|
this.date = date;
|
||||||
this.phoneNumber = phoneNumber;
|
this.simInfo = simInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getMobile() {
|
public String getMobile() {
|
||||||
@ -44,19 +46,32 @@ public class SmsVo implements Serializable {
|
|||||||
this.date = date;
|
this.date = date;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getPhoneNumber() {
|
public String getSimInfo() {
|
||||||
return phoneNumber;
|
return simInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPhoneNumber(String phoneNumber) {
|
public void setSimInfo(String simInfo) {
|
||||||
this.phoneNumber = phoneNumber;
|
this.simInfo = simInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getSmsVoForSend() {
|
public String getSmsVoForSend() {
|
||||||
return mobile + "\n" +
|
boolean switchAddExtra = SettingUtil.getSwitchAddExtra();
|
||||||
content + "\n" +
|
boolean switchSmsTemplate = SettingUtil.getSwitchSmsTemplate();
|
||||||
new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(date) + "\n" +
|
String smsTemplate = SettingUtil.getSmsTemplate().trim();
|
||||||
phoneNumber;
|
String deviceMark = SettingUtil.getAddExtraDeviceMark().trim();
|
||||||
|
if (!switchAddExtra) {
|
||||||
|
smsTemplate = smsTemplate.replace("{{卡槽信息}}\n", "").replace("{{卡槽信息}}", "");
|
||||||
|
}
|
||||||
|
if (!switchSmsTemplate) {
|
||||||
|
smsTemplate = "{{来源号码}}\n{{短信内容}}\n{{卡槽信息}}\n{{接收时间}}\n{{设备名称}}";
|
||||||
|
}
|
||||||
|
|
||||||
|
return smsTemplate.replace("{{来源号码}}", mobile)
|
||||||
|
.replace("{{短信内容}}", content)
|
||||||
|
.replace("{{卡槽信息}}", simInfo)
|
||||||
|
.replace("{{接收时间}}", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(date))
|
||||||
|
.replace("{{设备名称}}", deviceMark)
|
||||||
|
.trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -65,7 +80,7 @@ public class SmsVo implements Serializable {
|
|||||||
"mobile='" + mobile + '\'' +
|
"mobile='" + mobile + '\'' +
|
||||||
", content='" + content + '\'' +
|
", content='" + content + '\'' +
|
||||||
", date=" + date +
|
", date=" + date +
|
||||||
", phoneNumber=" + phoneNumber +
|
", simInfo=" + simInfo +
|
||||||
'}';
|
'}';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -68,7 +68,7 @@ public class SendUtil {
|
|||||||
List<SenderModel> senderModels = SenderUtil.getSender(ruleModel.getSenderId(), null);
|
List<SenderModel> senderModels = SenderUtil.getSender(ruleModel.getSenderId(), null);
|
||||||
for (SenderModel senderModel : senderModels
|
for (SenderModel senderModel : senderModels
|
||||||
) {
|
) {
|
||||||
LogUtil.addLog(new LogModel(smsVo.getMobile(), smsVo.getContent(), smsVo.getPhoneNumber(), senderModel.getId()));
|
LogUtil.addLog(new LogModel(smsVo.getMobile(), smsVo.getContent(), smsVo.getSimInfo(), senderModel.getId()));
|
||||||
SendUtil.senderSendMsgNoHandError(smsVo, senderModel);
|
SendUtil.senderSendMsgNoHandError(smsVo, senderModel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -117,7 +117,6 @@ public class SendUtil {
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.e(TAG, "senderSendMsg: dingding error " + e.getMessage());
|
Log.e(TAG, "senderSendMsg: dingding error " + e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -133,7 +132,6 @@ public class SendUtil {
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.e(TAG, "senderSendMsg: SenderMailMsg error " + e.getMessage());
|
Log.e(TAG, "senderSendMsg: SenderMailMsg error " + e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -144,11 +142,10 @@ public class SendUtil {
|
|||||||
BarkSettingVo barkSettingVo = JSON.parseObject(senderModel.getJsonSetting(), BarkSettingVo.class);
|
BarkSettingVo barkSettingVo = JSON.parseObject(senderModel.getJsonSetting(), BarkSettingVo.class);
|
||||||
if (barkSettingVo != null) {
|
if (barkSettingVo != null) {
|
||||||
try {
|
try {
|
||||||
SenderBarkMsg.sendMsg(handError, barkSettingVo.getServer(), smsVo.getMobile(), smsVo.getContent(), smsVo.getPhoneNumber());
|
SenderBarkMsg.sendMsg(handError, barkSettingVo.getServer(), smsVo.getMobile(), smsVo.getSmsVoForSend());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.e(TAG, "senderSendMsg: SenderBarkMsg error " + e.getMessage());
|
Log.e(TAG, "senderSendMsg: SenderBarkMsg error " + e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -163,7 +160,6 @@ public class SendUtil {
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.e(TAG, "senderSendMsg: SenderWebNotifyMsg error " + e.getMessage());
|
Log.e(TAG, "senderSendMsg: SenderWebNotifyMsg error " + e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -178,7 +174,6 @@ public class SendUtil {
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.e(TAG, "senderSendMsg: SenderQyWxGroupRobotMsg error " + e.getMessage());
|
Log.e(TAG, "senderSendMsg: SenderQyWxGroupRobotMsg error " + e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -193,7 +188,6 @@ public class SendUtil {
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.e(TAG, "senderSendMsg: qywx_app error " + e.getMessage());
|
Log.e(TAG, "senderSendMsg: qywx_app error " + e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -22,14 +22,16 @@ public class SenderBarkMsg {
|
|||||||
|
|
||||||
static String TAG = "SenderBarkMsg";
|
static String TAG = "SenderBarkMsg";
|
||||||
|
|
||||||
public static void sendMsg(final Handler handError, String barkServer, String from, String content, String phoneNumber) throws Exception {
|
public static void sendMsg(final Handler handError, String barkServer, String from, String content) throws Exception {
|
||||||
Log.i(TAG, "sendMsg barkServer:" + barkServer + " from:" + from + " content:" + content + " phoneNumber:" + phoneNumber);
|
Log.i(TAG, "sendMsg barkServer:" + barkServer + " from:" + from + " content:" + content);
|
||||||
|
|
||||||
if (barkServer == null || barkServer.isEmpty()) {
|
if (barkServer == null || barkServer.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
content += "\n[" + phoneNumber + "]";
|
//特殊处理避免标题重复
|
||||||
|
content = content.replaceFirst("^" + from + "(.*)", "").trim();
|
||||||
|
|
||||||
barkServer += URLEncoder.encode(from, "UTF-8");
|
barkServer += URLEncoder.encode(from, "UTF-8");
|
||||||
barkServer += "/" + URLEncoder.encode(content, "UTF-8");
|
barkServer += "/" + URLEncoder.encode(content, "UTF-8");
|
||||||
barkServer += "?isArchive=1"; //自动保存
|
barkServer += "?isArchive=1"; //自动保存
|
||||||
|
@ -9,6 +9,8 @@ public class Define {
|
|||||||
public static String SP_MSG_KEY_STRING_ADD_EXTRA_DEVICE_MARK = "tsms_msg_key_string_add_extra_device_mark";
|
public static String SP_MSG_KEY_STRING_ADD_EXTRA_DEVICE_MARK = "tsms_msg_key_string_add_extra_device_mark";
|
||||||
public static String SP_MSG_KEY_STRING_ADD_EXTRA_SIM1 = "tsms_msg_key_string_add_extra_sim1";
|
public static String SP_MSG_KEY_STRING_ADD_EXTRA_SIM1 = "tsms_msg_key_string_add_extra_sim1";
|
||||||
public static String SP_MSG_KEY_STRING_ADD_EXTRA_SIM2 = "tsms_msg_key_string_add_extra_sim2";
|
public static String SP_MSG_KEY_STRING_ADD_EXTRA_SIM2 = "tsms_msg_key_string_add_extra_sim2";
|
||||||
|
public static String SP_MSG_KEY_SWITCH_SMS_TEMPLATE = "tsms_msg_key_switch_sms_template";
|
||||||
|
public static String SP_MSG_KEY_STRING_SMS_TEMPLATE = "tsms_msg_key_string_sms_template";
|
||||||
|
|
||||||
public static String SP_MSG = "forwarder_msg";
|
public static String SP_MSG = "forwarder_msg";
|
||||||
public static String SP_MSG_SET_KEY = "forwarder_msg_set_key";
|
public static String SP_MSG_SET_KEY = "forwarder_msg_set_key";
|
||||||
|
@ -32,6 +32,17 @@ public class SettingUtil {
|
|||||||
return sp_setting.getBoolean(Define.SP_MSG_KEY_SWITCH_ADD_EXTRA, false);
|
return sp_setting.getBoolean(Define.SP_MSG_KEY_SWITCH_ADD_EXTRA, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void switchSmsTemplate(Boolean switchSmsTemplate) {
|
||||||
|
Log.d(TAG, "switchSmsTemplate :" + switchSmsTemplate);
|
||||||
|
sp_setting.edit()
|
||||||
|
.putBoolean(Define.SP_MSG_KEY_SWITCH_SMS_TEMPLATE, switchSmsTemplate)
|
||||||
|
.apply();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean getSwitchSmsTemplate() {
|
||||||
|
return sp_setting.getBoolean(Define.SP_MSG_KEY_SWITCH_SMS_TEMPLATE, false);
|
||||||
|
}
|
||||||
|
|
||||||
public static String getAddExtraDeviceMark() {
|
public static String getAddExtraDeviceMark() {
|
||||||
return sp_setting.getString(Define.SP_MSG_KEY_STRING_ADD_EXTRA_DEVICE_MARK, "");
|
return sp_setting.getString(Define.SP_MSG_KEY_STRING_ADD_EXTRA_DEVICE_MARK, "");
|
||||||
}
|
}
|
||||||
@ -43,6 +54,17 @@ public class SettingUtil {
|
|||||||
.apply();
|
.apply();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String getSmsTemplate() {
|
||||||
|
return sp_setting.getString(Define.SP_MSG_KEY_STRING_SMS_TEMPLATE, "{{来源号码}}\n{{短信内容}}\n{{卡槽信息}}\n{{接收时间}}\n{{设备名称}}");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setSmsTemplate(String textSmsTemplate) {
|
||||||
|
Log.d(TAG, "textSmsTemplate :" + textSmsTemplate);
|
||||||
|
sp_setting.edit()
|
||||||
|
.putString(Define.SP_MSG_KEY_STRING_SMS_TEMPLATE, textSmsTemplate)
|
||||||
|
.apply();
|
||||||
|
}
|
||||||
|
|
||||||
public static String getAddExtraSim1() {
|
public static String getAddExtraSim1() {
|
||||||
return sp_setting.getString(Define.SP_MSG_KEY_STRING_ADD_EXTRA_SIM1, "");
|
return sp_setting.getString(Define.SP_MSG_KEY_STRING_ADD_EXTRA_SIM1, "");
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,16 @@
|
|||||||
package com.idormy.sms.forwarder.utils;
|
package com.idormy.sms.forwarder.utils;
|
||||||
|
|
||||||
|
import android.content.ContentResolver;
|
||||||
|
import android.database.Cursor;
|
||||||
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
|
import com.idormy.sms.forwarder.MyApplication;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
public class SimUtil {
|
public class SimUtil {
|
||||||
private static String TAG = "SimUtil";
|
private static String TAG = "SimUtil";
|
||||||
@ -41,4 +49,37 @@ public class SimUtil {
|
|||||||
Log.d(TAG, " Slot Number " + whichSIM);
|
Log.d(TAG, " Slot Number " + whichSIM);
|
||||||
return whichSIM;
|
return whichSIM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//获取SIM卡信息
|
||||||
|
public static void getSimInfo(MyApplication appContext, String Line1Number) {
|
||||||
|
try {
|
||||||
|
Uri uri = Uri.parse("content://telephony/siminfo"); //访问raw_contacts表
|
||||||
|
ContentResolver resolver = appContext.getContentResolver();
|
||||||
|
Cursor cursor = resolver.query(uri, new String[]{"_id", "icc_id", "sim_id", "display_name", "carrier_name", "name_source", "color", "number", "display_number_format", "data_roaming", "mcc", "mnc"}, "sim_id >= 0", null, "_id");
|
||||||
|
if (cursor != null) {
|
||||||
|
while (cursor.moveToNext()) {
|
||||||
|
Log.d(TAG, "_id: " + cursor.getString(cursor.getColumnIndex("_id")));
|
||||||
|
Log.d(TAG, "sim_id: " + cursor.getString(cursor.getColumnIndex("sim_id")));
|
||||||
|
Log.d(TAG, "carrier_name: " + cursor.getString(cursor.getColumnIndex("carrier_name")));
|
||||||
|
Log.d(TAG, "display_name: " + cursor.getString(cursor.getColumnIndex("display_name")));
|
||||||
|
Map<String, String> sim = new HashMap();
|
||||||
|
String id = cursor.getString(cursor.getColumnIndex("_id"));
|
||||||
|
sim.put("_id", id);
|
||||||
|
sim.put("sim_id", cursor.getString(cursor.getColumnIndex("sim_id")));
|
||||||
|
sim.put("carrier_name", cursor.getString(cursor.getColumnIndex("carrier_name")));
|
||||||
|
sim.put("display_name", cursor.getString(cursor.getColumnIndex("display_name")));
|
||||||
|
sim.put("phone_number", Line1Number);
|
||||||
|
if (Line1Number != "Unknown") {
|
||||||
|
Line1Number = "Unknown";
|
||||||
|
}
|
||||||
|
MyApplication.SimInfo.put(id, sim);
|
||||||
|
}
|
||||||
|
cursor.close();
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
Log.e(TAG, "getSimInfo fail:" + e.getMessage());
|
||||||
|
//Toast.makeText(MainActivity.this, "获取SIM卡信息失败:请先手动设置", Toast.LENGTH_LONG).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -111,7 +111,7 @@
|
|||||||
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:text="作者网站" />
|
android:text="开源地址" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/linkweb"
|
android:id="@+id/linkweb"
|
||||||
@ -120,8 +120,8 @@
|
|||||||
android:layout_weight="3"
|
android:layout_weight="3"
|
||||||
android:autoLink="web"
|
android:autoLink="web"
|
||||||
android:gravity="right"
|
android:gravity="right"
|
||||||
android:text="idormy.com"
|
android:text="https://github.com/pppscn/SmsForwarder"
|
||||||
android:textSize="18sp" />
|
android:textSize="14sp" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
@ -8,31 +9,6 @@
|
|||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:background="@android:color/white"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:padding="15dp">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="3"
|
|
||||||
android:text="转发时附加卡槽信息"
|
|
||||||
android:textStyle="bold" />
|
|
||||||
|
|
||||||
<Switch
|
|
||||||
android:id="@+id/switch_add_extra"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_weight="3"
|
|
||||||
android:gravity="end"
|
|
||||||
android:textSize="18sp" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@ -137,6 +113,31 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@android:color/white"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:padding="15dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="3"
|
||||||
|
android:text="转发时附加卡槽信息"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<Switch
|
||||||
|
android:id="@+id/switch_add_extra"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="3"
|
||||||
|
android:gravity="end"
|
||||||
|
android:textSize="18sp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@ -163,16 +164,124 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<EditText
|
<LinearLayout
|
||||||
android:id="@+id/text_sms_template"
|
android:id="@+id/layout_sms_template"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="15dp"
|
android:layout_marginTop="2dp"
|
||||||
android:ems="16"
|
android:background="@android:color/white"
|
||||||
android:inputType=""
|
android:gravity="center_vertical"
|
||||||
android:maxLines="5"
|
android:orientation="vertical"
|
||||||
android:text="" />
|
android:padding="15dp"
|
||||||
|
android:visibility="gone">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="转发信息模版"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="5dp"
|
||||||
|
android:text="Tip:按需插入内容标签;留空使用默认模版"
|
||||||
|
android:textSize="11dp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/text_sms_template"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:inputType=""
|
||||||
|
android:text="" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/bt_insert_sender"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="25dp"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
android:layout_marginBottom="5dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@color/colorPrimary"
|
||||||
|
android:onClick="toInsertLabel"
|
||||||
|
android:text="来源号码"
|
||||||
|
tools:ignore="NestedWeights" />
|
||||||
|
|
||||||
|
<!--<Button
|
||||||
|
android:id="@+id/bt_insert_receiver"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="25dp"
|
||||||
|
android:layout_marginLeft="5dp"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
android:layout_marginBottom="5dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@color/colorPrimary"
|
||||||
|
android:onClick="toInsertLabel"
|
||||||
|
android:text="接收号码"
|
||||||
|
tools:ignore="NestedWeights" />-->
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/bt_insert_content"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="25dp"
|
||||||
|
android:layout_marginLeft="5dp"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
android:layout_marginBottom="5dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@color/colorPrimary"
|
||||||
|
android:onClick="toInsertLabel"
|
||||||
|
android:text="短信内容" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/bt_insert_extra"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="25dp"
|
||||||
|
android:layout_marginLeft="5dp"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
android:layout_marginBottom="5dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@color/colorPrimary"
|
||||||
|
android:onClick="toInsertLabel"
|
||||||
|
android:text="卡槽信息" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/bt_insert_time"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="25dp"
|
||||||
|
android:layout_marginLeft="5dp"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
android:layout_marginBottom="5dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@color/colorPrimary"
|
||||||
|
android:onClick="toInsertLabel"
|
||||||
|
android:text="接收时间" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/bt_insert_device_name"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="25dp"
|
||||||
|
android:layout_marginLeft="5dp"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
android:layout_marginBottom="5dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@color/colorPrimary"
|
||||||
|
android:onClick="toInsertLabel"
|
||||||
|
android:text="设备名称" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</ScrollView>
|
</ScrollView>
|
@ -1,51 +1,51 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent">
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:layout_margin="10dp"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<TextView
|
<LinearLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
android:layout_margin="3dp"
|
android:orientation="vertical">
|
||||||
android:text="测试模拟的手机号" />
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_margin="3dp"
|
||||||
|
android:text="测试模拟的手机号" />
|
||||||
|
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
android:id="@+id/editTextTestPhone"
|
android:id="@+id/editTextTestPhone"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="3dp"
|
android:layout_margin="3dp"
|
||||||
android:ems="10"
|
android:ems="10"
|
||||||
android:inputType=""
|
android:inputType=""
|
||||||
android:text="" />
|
android:text="" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="3dp"
|
android:layout_margin="3dp"
|
||||||
android:text="测试模拟的短信内容" />
|
android:text="测试模拟的短信内容" />
|
||||||
|
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
android:id="@+id/editTextTestMsgContent"
|
android:id="@+id/editTextTestMsgContent"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="3dp"
|
android:layout_margin="3dp"
|
||||||
android:ems="10"
|
android:ems="10"
|
||||||
android:inputType=""
|
android:inputType=""
|
||||||
android:text="" />
|
android:text="" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/buttonruletest"
|
android:id="@+id/buttonruletest"
|
||||||
@ -57,4 +57,4 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</ScrollView>
|
BIN
pic/about.jpg
Normal file
After Width: | Height: | Size: 162 KiB |
BIN
pic/main.jpg
Before Width: | Height: | Size: 481 KiB After Width: | Height: | Size: 243 KiB |
Before Width: | Height: | Size: 289 KiB After Width: | Height: | Size: 161 KiB |
Before Width: | Height: | Size: 417 KiB After Width: | Height: | Size: 330 KiB |
BIN
pic/rule.jpg
Before Width: | Height: | Size: 322 KiB After Width: | Height: | Size: 273 KiB |
BIN
pic/ruleset.jpg
Before Width: | Height: | Size: 109 KiB After Width: | Height: | Size: 238 KiB |
BIN
pic/sender.jpg
Before Width: | Height: | Size: 206 KiB After Width: | Height: | Size: 153 KiB |
Before Width: | Height: | Size: 239 KiB After Width: | Height: | Size: 198 KiB |
Before Width: | Height: | Size: 311 KiB After Width: | Height: | Size: 272 KiB |
Before Width: | Height: | Size: 248 KiB After Width: | Height: | Size: 206 KiB |
Before Width: | Height: | Size: 257 KiB After Width: | Height: | Size: 216 KiB |
Before Width: | Height: | Size: 274 KiB After Width: | Height: | Size: 233 KiB |
Before Width: | Height: | Size: 247 KiB After Width: | Height: | Size: 206 KiB |
BIN
pic/setting.jpg
Before Width: | Height: | Size: 154 KiB After Width: | Height: | Size: 256 KiB |
BIN
pic/update.jpg
Before Width: | Height: | Size: 210 KiB After Width: | Height: | Size: 195 KiB |