新增:Telegram允许指定请求方式(POST/GET)
This commit is contained in:
parent
798790b7cf
commit
c34133b45b
|
@ -1022,6 +1022,7 @@ public class SenderActivity extends AppCompatActivity {
|
||||||
|
|
||||||
final EditText editTextTelegramApiToken = view1.findViewById(R.id.editTextTelegramApiToken);
|
final EditText editTextTelegramApiToken = view1.findViewById(R.id.editTextTelegramApiToken);
|
||||||
final EditText editTextTelegramChatId = view1.findViewById(R.id.editTextTelegramChatId);
|
final EditText editTextTelegramChatId = view1.findViewById(R.id.editTextTelegramChatId);
|
||||||
|
final RadioGroup radioGroupTelegramMethod = view1.findViewById(R.id.radioGroupTelegramMethod);
|
||||||
|
|
||||||
final RadioGroup radioGroupProxyType = view1.findViewById(R.id.radioGroupProxyType);
|
final RadioGroup radioGroupProxyType = view1.findViewById(R.id.radioGroupProxyType);
|
||||||
final EditText editTextProxyHost = view1.findViewById(R.id.editTextProxyHost);
|
final EditText editTextProxyHost = view1.findViewById(R.id.editTextProxyHost);
|
||||||
|
@ -1058,6 +1059,7 @@ public class SenderActivity extends AppCompatActivity {
|
||||||
if (telegramSettingVo != null) {
|
if (telegramSettingVo != null) {
|
||||||
editTextTelegramApiToken.setText(telegramSettingVo.getApiToken());
|
editTextTelegramApiToken.setText(telegramSettingVo.getApiToken());
|
||||||
editTextTelegramChatId.setText(telegramSettingVo.getChatId());
|
editTextTelegramChatId.setText(telegramSettingVo.getChatId());
|
||||||
|
radioGroupTelegramMethod.check(telegramSettingVo.getMethodCheckId());
|
||||||
|
|
||||||
radioGroupProxyType.check(telegramSettingVo.getProxyTypeCheckId());
|
radioGroupProxyType.check(telegramSettingVo.getProxyTypeCheckId());
|
||||||
layoutProxyAuthenticator.setVisibility(telegramSettingVo.getProxyAuthenticator() ? View.VISIBLE : View.GONE);
|
layoutProxyAuthenticator.setVisibility(telegramSettingVo.getProxyAuthenticator() ? View.VISIBLE : View.GONE);
|
||||||
|
@ -1102,7 +1104,8 @@ public class SenderActivity extends AppCompatActivity {
|
||||||
editTextProxyPort.getText().toString().trim(),
|
editTextProxyPort.getText().toString().trim(),
|
||||||
switchProxyAuthenticator.isChecked(),
|
switchProxyAuthenticator.isChecked(),
|
||||||
editTextProxyUsername.getText().toString().trim(),
|
editTextProxyUsername.getText().toString().trim(),
|
||||||
editTextProxyPassword.getText().toString().trim()
|
editTextProxyPassword.getText().toString().trim(),
|
||||||
|
(radioGroupTelegramMethod.getCheckedRadioButtonId() == R.id.radioTelegramMethodGet ? "GET" : "POST")
|
||||||
|
|
||||||
);
|
);
|
||||||
newSenderModel.setJsonSetting(JSON.toJSONString(telegramSettingVoNew));
|
newSenderModel.setJsonSetting(JSON.toJSONString(telegramSettingVoNew));
|
||||||
|
@ -1121,7 +1124,8 @@ public class SenderActivity extends AppCompatActivity {
|
||||||
editTextProxyPort.getText().toString().trim(),
|
editTextProxyPort.getText().toString().trim(),
|
||||||
switchProxyAuthenticator.isChecked(),
|
switchProxyAuthenticator.isChecked(),
|
||||||
editTextProxyUsername.getText().toString().trim(),
|
editTextProxyUsername.getText().toString().trim(),
|
||||||
editTextProxyPassword.getText().toString().trim()
|
editTextProxyPassword.getText().toString().trim(),
|
||||||
|
(radioGroupTelegramMethod.getCheckedRadioButtonId() == R.id.radioTelegramMethodGet ? "GET" : "POST")
|
||||||
);
|
);
|
||||||
senderModel.setJsonSetting(JSON.toJSONString(telegramSettingVoNew));
|
senderModel.setJsonSetting(JSON.toJSONString(telegramSettingVoNew));
|
||||||
SenderUtil.updateSender(senderModel);
|
SenderUtil.updateSender(senderModel);
|
||||||
|
@ -1153,9 +1157,10 @@ public class SenderActivity extends AppCompatActivity {
|
||||||
editTextProxyPort.getText().toString().trim(),
|
editTextProxyPort.getText().toString().trim(),
|
||||||
switchProxyAuthenticator.isChecked(),
|
switchProxyAuthenticator.isChecked(),
|
||||||
editTextProxyUsername.getText().toString().trim(),
|
editTextProxyUsername.getText().toString().trim(),
|
||||||
editTextProxyPassword.getText().toString().trim()
|
editTextProxyPassword.getText().toString().trim(),
|
||||||
|
(radioGroupTelegramMethod.getCheckedRadioButtonId() == R.id.radioTelegramMethodGet ? "GET" : "POST")
|
||||||
);
|
);
|
||||||
SenderTelegramMsg.sendMsg(0, handler, telegramSettingVoNew, getString(R.string.test_phone_num), getString(R.string.test_sms));
|
SenderTelegramMsg.sendMsg(0, handler, telegramSettingVoNew, getString(R.string.test_phone_num), getString(R.string.test_sms), telegramSettingVoNew.getMethod());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Toast.makeText(SenderActivity.this, getString(R.string.failed_to_fwd) + e.getMessage(), Toast.LENGTH_LONG).show();
|
Toast.makeText(SenderActivity.this, getString(R.string.failed_to_fwd) + e.getMessage(), Toast.LENGTH_LONG).show();
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|
|
@ -17,6 +17,7 @@ public class TelegramSettingVo implements Serializable {
|
||||||
private Boolean proxyAuthenticator = false;
|
private Boolean proxyAuthenticator = false;
|
||||||
private String proxyUsername;
|
private String proxyUsername;
|
||||||
private String proxyPassword;
|
private String proxyPassword;
|
||||||
|
private String method;
|
||||||
|
|
||||||
public TelegramSettingVo() {
|
public TelegramSettingVo() {
|
||||||
}
|
}
|
||||||
|
@ -25,9 +26,10 @@ public class TelegramSettingVo implements Serializable {
|
||||||
this.apiToken = apiToken;
|
this.apiToken = apiToken;
|
||||||
this.chatId = chatId;
|
this.chatId = chatId;
|
||||||
this.proxyType = Proxy.Type.DIRECT;
|
this.proxyType = Proxy.Type.DIRECT;
|
||||||
|
this.method = "POST";
|
||||||
}
|
}
|
||||||
|
|
||||||
public TelegramSettingVo(String apiToken, String chatId, int proxyTypeId, String proxyHost, String proxyPort, boolean proxyAuthenticator, String proxyUsername, String proxyPassword) {
|
public TelegramSettingVo(String apiToken, String chatId, int proxyTypeId, String proxyHost, String proxyPort, boolean proxyAuthenticator, String proxyUsername, String proxyPassword, String method) {
|
||||||
this.apiToken = apiToken;
|
this.apiToken = apiToken;
|
||||||
this.chatId = chatId;
|
this.chatId = chatId;
|
||||||
if (proxyTypeId == R.id.btnProxyHttp) {
|
if (proxyTypeId == R.id.btnProxyHttp) {
|
||||||
|
@ -42,6 +44,7 @@ public class TelegramSettingVo implements Serializable {
|
||||||
this.proxyAuthenticator = proxyAuthenticator;
|
this.proxyAuthenticator = proxyAuthenticator;
|
||||||
this.proxyUsername = proxyUsername;
|
this.proxyUsername = proxyUsername;
|
||||||
this.proxyPassword = proxyPassword;
|
this.proxyPassword = proxyPassword;
|
||||||
|
this.method = method;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getProxyTypeCheckId() {
|
public int getProxyTypeCheckId() {
|
||||||
|
@ -53,4 +56,12 @@ public class TelegramSettingVo implements Serializable {
|
||||||
return R.id.btnProxyNone;
|
return R.id.btnProxyNone;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getMethodCheckId() {
|
||||||
|
if (method == null || method.equals("POST")) {
|
||||||
|
return R.id.radioTelegramMethodPost;
|
||||||
|
} else {
|
||||||
|
return R.id.radioTelegramMethodGet;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -225,7 +225,7 @@ public class SendUtil {
|
||||||
TelegramSettingVo telegramSettingVo = JSON.parseObject(senderModel.getJsonSetting(), TelegramSettingVo.class);
|
TelegramSettingVo telegramSettingVo = JSON.parseObject(senderModel.getJsonSetting(), TelegramSettingVo.class);
|
||||||
if (telegramSettingVo != null) {
|
if (telegramSettingVo != null) {
|
||||||
try {
|
try {
|
||||||
SenderTelegramMsg.sendMsg(logId, handError, telegramSettingVo, smsVo.getMobile(), smsVo.getSmsVoForSend(smsTemplate, regexReplace));
|
SenderTelegramMsg.sendMsg(logId, handError, telegramSettingVo, smsVo.getMobile(), smsVo.getSmsVoForSend(smsTemplate, regexReplace), telegramSettingVo.getMethod());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LogUtil.updateLog(logId, 0, e.getMessage());
|
LogUtil.updateLog(logId, 0, e.getMessage());
|
||||||
Log.e(TAG, "senderSendMsg: SenderTelegramMsg error " + e.getMessage());
|
Log.e(TAG, "senderSendMsg: SenderTelegramMsg error " + e.getMessage());
|
||||||
|
|
|
@ -37,7 +37,7 @@ public class SenderTelegramMsg extends SenderBaseMsg {
|
||||||
|
|
||||||
static final String TAG = "SenderTelegramMsg";
|
static final String TAG = "SenderTelegramMsg";
|
||||||
|
|
||||||
public static void sendMsg(final long logId, final Handler handError, TelegramSettingVo telegramSettingVo, String from, String text) throws Exception {
|
public static void sendMsg(final long logId, final Handler handError, TelegramSettingVo telegramSettingVo, final String from, final String text, final String method) throws Exception {
|
||||||
Log.i(TAG, "sendMsg telegramSettingVo:" + telegramSettingVo.toString() + " text:" + text);
|
Log.i(TAG, "sendMsg telegramSettingVo:" + telegramSettingVo.toString() + " text:" + text);
|
||||||
|
|
||||||
String apiToken = telegramSettingVo.getApiToken();
|
String apiToken = telegramSettingVo.getApiToken();
|
||||||
|
@ -47,15 +47,14 @@ public class SenderTelegramMsg extends SenderBaseMsg {
|
||||||
}
|
}
|
||||||
|
|
||||||
//特殊处理避免标题重复
|
//特殊处理避免标题重复
|
||||||
text = text.replaceAll("#", "井").trim();
|
final String finalText = text.replaceAll("#", "井").trim();
|
||||||
|
|
||||||
if (!apiToken.startsWith("http")) {
|
if (!apiToken.startsWith("http")) {
|
||||||
apiToken = "https://api.telegram.org/bot" + apiToken + "/sendMessage";
|
apiToken = "https://api.telegram.org/bot" + apiToken + "/sendMessage";
|
||||||
}
|
}
|
||||||
|
|
||||||
final String requestUrl = apiToken;
|
final String requestUrl = apiToken;
|
||||||
Log.i(TAG, "requestUrl:" + requestUrl);
|
Log.i(TAG, "requestUrl:" + requestUrl);
|
||||||
String finalText = text;
|
|
||||||
Log.i(TAG, "requestMsg:" + finalText);
|
|
||||||
|
|
||||||
//代理相关
|
//代理相关
|
||||||
final Proxy.Type proxyType = telegramSettingVo.getProxyType();
|
final Proxy.Type proxyType = telegramSettingVo.getProxyType();
|
||||||
|
@ -101,9 +100,27 @@ public class SenderTelegramMsg extends SenderBaseMsg {
|
||||||
.connectionPool(new ConnectionPool(5, 1, TimeUnit.SECONDS)).build();
|
.connectionPool(new ConnectionPool(5, 1, TimeUnit.SECONDS)).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
final Request request = new Request.Builder()
|
final Request request;
|
||||||
.url(requestUrl + "?chat_id=" + chatId + "&text=" + finalText)
|
if (method.equals("GET")) {
|
||||||
.build();
|
request = new Request.Builder()
|
||||||
|
.url(requestUrl + "?chat_id=" + chatId + "&text=" + finalText)
|
||||||
|
.build();
|
||||||
|
} else {
|
||||||
|
Map bodyMap = new HashMap();
|
||||||
|
bodyMap.put("chat_id", chatId);
|
||||||
|
bodyMap.put("text", finalText);
|
||||||
|
bodyMap.put("parse_mode", "HTML");
|
||||||
|
|
||||||
|
String requestMsg = JSON.toJSONString(bodyMap);
|
||||||
|
Log.i(TAG, "requestMsg:" + requestMsg);
|
||||||
|
|
||||||
|
RequestBody requestBody = RequestBody.create(MediaType.parse("application/json;charset=utf-8"), requestMsg);
|
||||||
|
request = new Request.Builder()
|
||||||
|
.url(requestUrl)
|
||||||
|
.addHeader("Content-Type", "application/json; charset=utf-8")
|
||||||
|
.post(requestBody)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
client.newCall(request).enqueue(new Callback() {
|
client.newCall(request).enqueue(new Callback() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -127,7 +144,7 @@ public class SenderTelegramMsg extends SenderBaseMsg {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LogUtil.updateLog(logId, 0, e.getMessage());
|
LogUtil.updateLog(logId, 0, e.getMessage());
|
||||||
Log.e(TAG, e.getMessage(), e);
|
Log.e(TAG, e.getMessage(), e);
|
||||||
|
|
|
@ -58,6 +58,44 @@
|
||||||
tools:ignore="LabelFor" />
|
tools:ignore="LabelFor" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
|
android:layout_marginRight="10dp"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingTop="5dp"
|
||||||
|
android:text="@string/Method"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<RadioGroup
|
||||||
|
android:id="@+id/radioGroupTelegramMethod"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="3dp"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<RadioButton
|
||||||
|
android:id="@+id/radioTelegramMethodPost"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:checked="true"
|
||||||
|
android:text="@string/post" />
|
||||||
|
|
||||||
|
<RadioButton
|
||||||
|
android:id="@+id/radioTelegramMethodGet"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/get" />
|
||||||
|
|
||||||
|
</RadioGroup>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
|
|
@ -1,177 +1,177 @@
|
||||||
<?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"
|
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">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical">
|
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_marginLeft="10dp"
|
android:layout_marginLeft="10dp"
|
||||||
android:layout_marginRight="10dp"
|
android:layout_marginRight="10dp"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/set_name" />
|
android:text="@string/set_name" />
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
android:id="@+id/editTextWebNotifyName"
|
android:id="@+id/editTextWebNotifyName"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="3dp"
|
android:layout_marginStart="3dp"
|
||||||
android:autofillHints=""
|
android:autofillHints=""
|
||||||
android:ems="11"
|
android:ems="11"
|
||||||
android:inputType="text"
|
android:inputType="text"
|
||||||
android:text=""
|
android:text=""
|
||||||
tools:ignore="LabelFor" />
|
tools:ignore="LabelFor" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginLeft="10dp"
|
android:layout_marginLeft="10dp"
|
||||||
android:layout_marginRight="10dp"
|
android:layout_marginRight="10dp"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingTop="5dp"
|
android:paddingTop="5dp"
|
||||||
android:text="@string/WebNotifyMethod" />
|
android:text="@string/Method" />
|
||||||
|
|
||||||
<RadioGroup
|
<RadioGroup
|
||||||
android:id="@+id/radioGroupWebNotifyMethod"
|
android:id="@+id/radioGroupWebNotifyMethod"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="3dp"
|
android:layout_marginStart="3dp"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<RadioButton
|
<RadioButton
|
||||||
android:id="@+id/radioWebNotifyMethodPost"
|
android:id="@+id/radioWebNotifyMethodPost"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:checked="true"
|
android:checked="true"
|
||||||
android:text="@string/post" />
|
android:text="@string/post" />
|
||||||
|
|
||||||
<RadioButton
|
<RadioButton
|
||||||
android:id="@+id/radioWebNotifyMethodGet"
|
android:id="@+id/radioWebNotifyMethodGet"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/get" />
|
android:text="@string/get" />
|
||||||
|
|
||||||
</RadioGroup>
|
</RadioGroup>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginLeft="10dp"
|
android:layout_marginLeft="10dp"
|
||||||
android:layout_marginRight="10dp"
|
android:layout_marginRight="10dp"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/WebNotifyWebServer" />
|
android:text="@string/WebNotifyWebServer" />
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
android:id="@+id/editTextWebNotifyWebServer"
|
android:id="@+id/editTextWebNotifyWebServer"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:autofillHints=""
|
android:autofillHints=""
|
||||||
android:ems="14"
|
android:ems="14"
|
||||||
android:inputType="text"
|
android:inputType="text"
|
||||||
android:text=""
|
android:text=""
|
||||||
tools:ignore="LabelFor" />
|
tools:ignore="LabelFor" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginLeft="10dp"
|
android:layout_marginLeft="10dp"
|
||||||
android:layout_marginRight="10dp"
|
android:layout_marginRight="10dp"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text='@string/WebNotifyWebParams' />
|
android:text='@string/WebNotifyWebParams' />
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
android:id="@+id/editTextWebNotifyWebParams"
|
android:id="@+id/editTextWebNotifyWebParams"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:autofillHints=""
|
android:autofillHints=""
|
||||||
android:ems="14"
|
android:ems="14"
|
||||||
android:inputType="text"
|
android:inputType="text"
|
||||||
android:text=""
|
android:text=""
|
||||||
tools:ignore="LabelFor" />
|
tools:ignore="LabelFor" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginLeft="10dp"
|
android:layout_marginLeft="10dp"
|
||||||
android:layout_marginRight="10dp"
|
android:layout_marginRight="10dp"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/WebNotifySecret" />
|
android:text="@string/WebNotifySecret" />
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
android:id="@+id/editTextWebNotifySecret"
|
android:id="@+id/editTextWebNotifySecret"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:autofillHints=""
|
android:autofillHints=""
|
||||||
android:ems="14"
|
android:ems="14"
|
||||||
android:inputType="textPassword"
|
android:inputType="textPassword"
|
||||||
android:text=""
|
android:text=""
|
||||||
tools:ignore="LabelFor" />
|
tools:ignore="LabelFor" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<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:layout_margin="10dp"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/buttonWebNotifyTest"
|
android:id="@+id/buttonWebNotifyTest"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="5dp"
|
android:layout_marginStart="5dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:text="@string/test"
|
android:text="@string/test"
|
||||||
tools:ignore="ButtonStyle,NestedWeights" />
|
tools:ignore="ButtonStyle,NestedWeights" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/buttonWebNotifyDel"
|
android:id="@+id/buttonWebNotifyDel"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="5dp"
|
android:layout_marginStart="5dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:text="@string/del"
|
android:text="@string/del"
|
||||||
tools:ignore="ButtonStyle,NestedWeights" />
|
tools:ignore="ButtonStyle,NestedWeights" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/buttonWebNotifyOk"
|
android:id="@+id/buttonWebNotifyOk"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:text="@string/ok"
|
android:text="@string/ok"
|
||||||
tools:ignore="ButtonStyle,NestedWeights" />
|
tools:ignore="ButtonStyle,NestedWeights" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</ScrollView>
|
</ScrollView>
|
|
@ -147,7 +147,7 @@
|
||||||
<string name="ServerChanSendKey">ServerChan\'s SendKey</string>
|
<string name="ServerChanSendKey">ServerChan\'s SendKey</string>
|
||||||
<string name="TelegramApiToken">ApiToken or Custom address</string>
|
<string name="TelegramApiToken">ApiToken or Custom address</string>
|
||||||
<string name="TelegramChatId">ChatId</string>
|
<string name="TelegramChatId">ChatId</string>
|
||||||
<string name="WebNotifyMethod">Method</string>
|
<string name="Method">Method</string>
|
||||||
<string name="WebNotifyWebServer">WebServer e.g. https://a.b.com/msg?token=xyz</string>
|
<string name="WebNotifyWebServer">WebServer e.g. https://a.b.com/msg?token=xyz</string>
|
||||||
<string name="WebNotifyWebParams">WebParams e.g. payload=%7B%22text%22%3A%22[msg]%22%7D [msg] will be replaced with text message content. \nSupport Json format, for example: {"text":[MSG]}.\n Note: MSG is automatically utF-8 encoded in addition to JSON format</string>
|
<string name="WebNotifyWebParams">WebParams e.g. payload=%7B%22text%22%3A%22[msg]%22%7D [msg] will be replaced with text message content. \nSupport Json format, for example: {"text":[MSG]}.\n Note: MSG is automatically utF-8 encoded in addition to JSON format</string>
|
||||||
<string name="WebNotifySecret">Secret (sign is not counted if left blank)</string>
|
<string name="WebNotifySecret">Secret (sign is not counted if left blank)</string>
|
||||||
|
|
|
@ -147,7 +147,7 @@
|
||||||
<string name="ServerChanSendKey">设置Server酱·Turbo版的SendKey</string>
|
<string name="ServerChanSendKey">设置Server酱·Turbo版的SendKey</string>
|
||||||
<string name="TelegramApiToken">设置Telegram机器人的ApiToken 或 自定义地址(http开头)</string>
|
<string name="TelegramApiToken">设置Telegram机器人的ApiToken 或 自定义地址(http开头)</string>
|
||||||
<string name="TelegramChatId">设置被通知人(或群组)的ChatId</string>
|
<string name="TelegramChatId">设置被通知人(或群组)的ChatId</string>
|
||||||
<string name="WebNotifyMethod">请求方式</string>
|
<string name="Method">请求方式</string>
|
||||||
<string name="WebNotifyWebServer">设置WebServer:例如:https://a.b.com/msg?token=xyz</string>
|
<string name="WebNotifyWebServer">设置WebServer:例如:https://a.b.com/msg?token=xyz</string>
|
||||||
<string name="WebNotifyWebParams">设置WebParams:例如:payload=%7B%22text%22%3A%22[msg]%22%7D [msg]将被替换成短信内容。\n支持Json格式,例如:{"text":[msg]}。\n注意:除JSON格式外,msg会自动进行UTF-8编码</string>
|
<string name="WebNotifyWebParams">设置WebParams:例如:payload=%7B%22text%22%3A%22[msg]%22%7D [msg]将被替换成短信内容。\n支持Json格式,例如:{"text":[msg]}。\n注意:除JSON格式外,msg会自动进行UTF-8编码</string>
|
||||||
<string name="WebNotifySecret">设置Secret:置空则不计算sign</string>
|
<string name="WebNotifySecret">设置Secret:置空则不计算sign</string>
|
||||||
|
|
Loading…
Reference in New Issue