mirror of
https://github.com/pppscn/SmsForwarder
synced 2025-08-03 09:27:41 +08:00
Bark增加支持分组(发送方名称作为分组名称)
This commit is contained in:
parent
143c0ea8c9
commit
c9409082ea
@ -87,6 +87,8 @@ dependencies {
|
|||||||
|
|
||||||
//EmailKit
|
//EmailKit
|
||||||
implementation 'com.github.mailhu:emailkit:4.2.2'
|
implementation 'com.github.mailhu:emailkit:4.2.2'
|
||||||
|
implementation 'androidx.test.ext:junit-ktx:1.1.2'
|
||||||
|
testImplementation 'junit:junit:4.12'
|
||||||
|
|
||||||
//Lombok
|
//Lombok
|
||||||
compileOnly 'org.projectlombok:lombok:1.18.20'
|
compileOnly 'org.projectlombok:lombok:1.18.20'
|
||||||
|
@ -554,7 +554,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(0, handler, barkServer, "19999999999", "【京东】验证码为387481(切勿将验证码告知他人),请在页面中输入完成验证,如有问题请点击 ihelp.jd.com 联系京东客服");
|
SenderBarkMsg.sendMsg(0, 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();
|
||||||
|
@ -143,7 +143,7 @@ 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(logId, handError, barkSettingVo.getServer(), smsVo.getMobile(), smsVo.getSmsVoForSend());
|
SenderBarkMsg.sendMsg(logId, handError, barkSettingVo.getServer(), smsVo.getMobile(), smsVo.getSmsVoForSend(), senderModel.getName());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LogUtil.updateLog(logId, 0, e.getMessage());
|
LogUtil.updateLog(logId, 0, e.getMessage());
|
||||||
Log.e(TAG, "senderSendMsg: SenderBarkMsg error " + e.getMessage());
|
Log.e(TAG, "senderSendMsg: SenderBarkMsg error " + e.getMessage());
|
||||||
|
@ -24,7 +24,7 @@ public class SenderBarkMsg {
|
|||||||
|
|
||||||
static String TAG = "SenderBarkMsg";
|
static String TAG = "SenderBarkMsg";
|
||||||
|
|
||||||
public static void sendMsg(final long logId, final Handler handError, String barkServer, String from, String content) throws Exception {
|
public static void sendMsg(final long logId, final Handler handError, String barkServer, String from, String content, String groupName) throws Exception {
|
||||||
Log.i(TAG, "sendMsg barkServer:" + barkServer + " from:" + from + " content:" + content);
|
Log.i(TAG, "sendMsg barkServer:" + barkServer + " from:" + from + " content:" + content);
|
||||||
|
|
||||||
if (barkServer == null || barkServer.isEmpty()) {
|
if (barkServer == null || barkServer.isEmpty()) {
|
||||||
@ -37,6 +37,7 @@ public class SenderBarkMsg {
|
|||||||
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"; //自动保存
|
||||||
|
barkServer += "&group=" + URLEncoder.encode(groupName, "UTF-8"); //增加支持分组
|
||||||
int isCode = content.indexOf("验证码");
|
int isCode = content.indexOf("验证码");
|
||||||
int isPassword = content.indexOf("动态密码");
|
int isPassword = content.indexOf("动态密码");
|
||||||
if (isCode != -1 || isPassword != -1) {
|
if (isCode != -1 || isPassword != -1) {
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="设置名称" />
|
android:text="设置分组名称" />
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
android:id="@+id/editTextBarkName"
|
android:id="@+id/editTextBarkName"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user