Compare commits
No commits in common. "79a246cbd60bbf60e9ecd0dd75dea20962064e7b" and "ac624c70b2e5ade4e0f9af4a881030a4d8ec551a" have entirely different histories.
79a246cbd6
...
ac624c70b2
|
|
@ -4,16 +4,14 @@ public class DeviceInfo {
|
|||
private String deviceBrand;
|
||||
private String deviceModel;
|
||||
private String androidVersion;
|
||||
private String SN;
|
||||
|
||||
public DeviceInfo() {
|
||||
}
|
||||
|
||||
public DeviceInfo(String deviceBrand, String deviceModel, String androidVersion,String SN) {
|
||||
public DeviceInfo(String deviceBrand, String deviceModel, String androidVersion) {
|
||||
this.deviceBrand = deviceBrand;
|
||||
this.deviceModel = deviceModel;
|
||||
this.androidVersion = androidVersion;
|
||||
this.SN = SN;
|
||||
}
|
||||
|
||||
public String getDeviceBrand() {
|
||||
|
|
@ -40,21 +38,12 @@ public class DeviceInfo {
|
|||
this.androidVersion = androidVersion;
|
||||
}
|
||||
|
||||
public String getSN() {
|
||||
return SN;
|
||||
}
|
||||
|
||||
public void setSN(String SN) {
|
||||
this.SN = SN;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "DeviceInfo{" +
|
||||
"deviceBrand='" + deviceBrand + '\'' +
|
||||
", deviceModel='" + deviceModel + '\'' +
|
||||
", androidVersion='" + androidVersion + '\'' +
|
||||
", SN='" + SN + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@ import timber.log.Timber;
|
|||
public class HeartbeatWorker extends Worker {
|
||||
private final Context context;
|
||||
private String accessToken;
|
||||
private String SN;
|
||||
|
||||
|
||||
public HeartbeatWorker(@NonNull Context context, @NonNull WorkerParameters workerParams) {
|
||||
|
|
@ -67,13 +66,11 @@ public class HeartbeatWorker extends Worker {
|
|||
}
|
||||
|
||||
private <T>Request buildRequest(String apiUrl){
|
||||
SN = context.getResources().getString(R.string.SN);
|
||||
accessToken = context.getResources().getString(R.string.access_token);
|
||||
DeviceInfo deviceInfo = new DeviceInfo();
|
||||
deviceInfo.setDeviceBrand(DeviceInfoUtils.getDeviceBrand());
|
||||
deviceInfo.setDeviceModel(DeviceInfoUtils.getDeviceModel());
|
||||
deviceInfo.setAndroidVersion("Android " + DeviceInfoUtils.getDeviceAndroidVersion());
|
||||
deviceInfo.setSN(SN);
|
||||
deviceInfo.setAndroidVersion(DeviceInfoUtils.getDeviceAndroidVersion());
|
||||
Gson gson = new Gson();
|
||||
// 将对象转换为JSON字符串
|
||||
String json = gson.toJson(deviceInfo);
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
<string name="call_api_url">https://api.kimgo.cn/api/call</string>
|
||||
<string name="message_api_url">https://api.kimgo.cn/api/sms</string>
|
||||
<string name="heart_beat_url">https://api.kimgo.cn/heartbeat</string>
|
||||
<string name="SN">XCCS3IK75OCM</string>
|
||||
<string name="access_token">gKGCDSgWV82XbU0H</string>
|
||||
<string name="notification_title">监控服务运行中</string>
|
||||
<string name="notification_text">EchoLink正在运行</string>
|
||||
|
|
|
|||
Loading…
Reference in New Issue