美文网首页
Android逆向 单手手柄事件分析

Android逆向 单手手柄事件分析

作者: LiuJP | 来源:发表于2020-07-04 14:31 被阅读0次

    北通左游 KNIFE_SERVER 全log

    package com.coffee.injectmotionevent.e;
    
    import android.net.LocalServerSocket;
    import android.net.LocalSocket;
    import com.coffee.injectmotionevent.bean.DeviceInfo;
    import com.coffee.injectmotionevent.d.e;
    import com.coffee.injectmotionevent.f.a;
    import com.coffee.injectmotionevent.f.b;
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.io.PrintWriter;
    import java.math.BigDecimal;
    
    public class Socket_server_java_1227 {
        private LocalSocket Local_Socket;
        private LocalServerSocket Local_Server_Socket;
        private BufferedReader c;
        private PrintWriter d;
        private DeviceInfo[] e;
        private static final Socket_server_java_1227 f;
    
        static {
            Socket_server_java_1227.f = new Socket_server_java_1227();
        }
    
        private Socket_server_java_1227() {
            super();
            this.Local_Socket = null;
            this.Local_Server_Socket = null;
            this.c = null;
            this.e = new DeviceInfo[10];
        }
    
        public static Socket_server_java_1227 a() {
            return Socket_server_java_1227.f;
        }
    
        public void a(String arg3) {
            if(this.d != null) {
                try {
                    this.d.print(arg3);
                    this.d.flush();
                    b.b("InjectCClient send success:" + arg3);
                }
                catch(Exception v0) {
                    v0.printStackTrace();
                    b.b("InjectCClient send success:" + arg3);
                }
            }
        }
    
        public void a(boolean arg2) {
            String v0 = arg2 ? "injectMode=1" : "injectMode=0";
            this.a(v0);
        }
    
        public void b() {
            String[] v3;
            int v0_1;
            char[] v2 = new char[0x1000];
            try {
                this.Local_Server_Socket = new LocalServerSocket("server_java_1227");
                do {
                    this.Local_Socket = this.Local_Server_Socket.accept();
                    this.c = new BufferedReader(new InputStreamReader(this.Local_Socket.getInputStream()));
                    this.d = new PrintWriter(this.Local_Socket.getOutputStream());
                label_22:
                    v0_1 = this.c.read(v2);
                    if(v0_1 <= 0) {
                        continue;
                    }
    
                    break;
                }
                while(true);
            }
            catch(Throwable v0) {
                goto label_56;
            }
            catch(Throwable v0) {
                goto label_78;
            }
    
            try {
                v3 = new String(v2, 0, v0_1).split("#");
                int v4 = v3.length;
                v0_1 = 0;
            }
            catch(Throwable v0) {
                goto label_46;
            }
            catch(Throwable v0) {
                goto label_78;
            }
    
            while(true) {
                if(v0_1 >= v4) {
                    goto label_22;
                }
    
                String v5 = v3[v0_1];
                try {
                    if(v5.startsWith("code")) {
                        this.b(v5);
                    }
                    else if(v5.startsWith("dev")) {
                        this.c(v5);
                    }
    
                    ++v0_1;
                    continue;
                }
                catch(Throwable v0) {
                }
                catch(Throwable v0) {
                    try {
                    label_46:
                        b.a("InjectCClient" + v0.toString());
                        goto label_22;
                    }
                    catch(Throwable v0) {
                        try {
                        label_78:
                            if(this.c != null) {
                                this.c.close();
                            }
    
                            if(this.d != null) {
                                this.d.close();
                            }
    
                            if(this.Local_Socket != null) {
                                this.Local_Socket.close();
                            }
    
                            if(this.Local_Server_Socket == null) {
                                goto label_94;
                            }
    
                            this.Local_Server_Socket.close();
                        }
                        catch(IOException v1) {
                            v1.printStackTrace();
                        }
    
                    label_94:
                        throw v0;
                    }
                    catch(Throwable v0) {
                        try {
                        label_56:
                            v0.printStackTrace();
                        }
                        catch(Throwable v0) {
                            goto label_78;
                        }
    
                        try {
                            if(this.c != null) {
                                this.c.close();
                            }
    
                            if(this.d != null) {
                                this.d.close();
                            }
    
                            if(this.Local_Socket != null) {
                                this.Local_Socket.close();
                            }
    
                            if(this.Local_Server_Socket == null) {
                                return;
                            }
    
                            this.Local_Server_Socket.close();
                        }
                        catch(IOException v0_2) {
                            v0_2.printStackTrace();
                        }
    
                        return;
                    }
                }
            }
        }
    
        private void b(String arg8) {
            int v6 = 4;
            int v5 = 3;
            int v3 = 2;
            String[] v0 = arg8.split("\\|");
            if(v0.length >= 6) {
                int v1 = Integer.parseInt(v0[1]);
                if(v1 < this.e.length) {
                    e.a().a(this.e[v1], Integer.parseInt(v0[v3]), Integer.parseInt(v0[v5]), Float.parseFloat(v0[v6]), Float.parseFloat(v0[5]));
                }
            }
            else if(v0.length >= v6) {
                e.a().a(null, Integer.parseInt(v0[v3]), Integer.parseInt(v0[v5]), 0f, 0f);
            }
        }
    
        public void b(boolean arg2) {
            String v0 = arg2 ? "inGame" : "disGame";
            this.a(v0);
        }
    
        private void c(String arg13) {
            float v6;
            float v0 = 1f;
            int v11 = 2;
            int v10 = 4;
            float v5 = 0f;
            String[] v4 = arg13.split("\\|");
            if(v4.length >= 5) {
                int v1 = Integer.parseInt(v4[1]);
                int v2 = Integer.parseInt(v4[v11]);
                if(v2 == v10 && v1 < this.e.length) {
                    int v3 = Integer.parseInt(v4[3]);
                    int v4_1 = Integer.parseInt(v4[v10]);
                    if(a.f == 0 || a.g == 0) {
                        v6 = 0f;
                    }
                    else {
                        float v7 = new BigDecimal(((double)((((float)v3)) / (((float)a.g))))).setScale(v11, v10).floatValue();
                        v6 = new BigDecimal(((double)((((float)v4_1)) / (((float)a.f))))).setScale(v11, v10).floatValue();
                        if(v7 == 0f) {
                            v7 = v0;
                        }
    
                        if(v6 == 0f) {
                            v6 = v0;
                            v5 = v7;
                            goto label_51;
                        }
    
                        v5 = v7;
                    }
    
                label_51:
                    DeviceInfo v0_1 = new DeviceInfo(v1, v2, v3, v4_1, v5, v6);
                    this.e[v1] = v0_1;
                    b.b("initDeviceInfo " + v0_1);
                }
            }
        }
    
        public void c() {
            int v11 = 4;
            int v10 = 2;
            float v9 = 1f;
            DeviceInfo[] v1 = this.e;
            int v2 = v1.length;
            int v0;
            for(v0 = 0; v0 < v2; ++v0) {
                DeviceInfo v3 = v1[v0];
                if(v3 != null) {
                    v3.absXScale = new BigDecimal(((double)((((float)v3.absXMax)) / (((float)a.g))))).setScale(v10, v11).floatValue();
                    v3.absYScale = new BigDecimal(((double)((((float)v3.absYMax)) / (((float)a.f))))).setScale(v10, v11).floatValue();
                    if(v3.absXScale == 0f) {
                        v3.absXScale = v9;
                    }
    
                    if(v3.absYScale == 0f) {
                        v3.absYScale = v9;
                    }
    
                    b.b("convertAbsScale " + v3);
                }
            }
        }
    }
    

    仁魔游戏厅 的motionEvent

    injectInputEvent:  MotionEvent { action=ACTION_DOWN, actionButton=0, id[0]=0, x[0]=396.0, y[0]=569.0, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, classification=NONE, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=270124074, downTime=270124074, deviceId=7, source=0x1002, displayId=0 } 0
    30933
    30918
    injectInputEvent:  MotionEvent { action=ACTION_UP, actionButton=0, id[0]=0, x[0]=396.0, y[0]=569.0, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, classification=NONE, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=270124203, downTime=270124074, deviceId=7, source=0x1002, displayId=0 } 0
    30933
    30918
    injectInputEvent:  MotionEvent { action=ACTION_DOWN, actionButton=0, id[0]=0, x[0]=2518.0, y[0]=467.0, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, classification=NONE, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=270124655, downTime=270124655, deviceId=7, source=0x1002, displayId=0 } 0
    30942
    30918
    injectInputEvent:  MotionEvent { action=ACTION_UP, actionButton=0, id[0]=0, x[0]=2518.0, y[0]=467.0, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, classification=NONE, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=270124697, downTime=270124655, deviceId=7, source=0x1002, displayId=0 } 0
    30942
    30918
    
    
    action 1
    count 1
    propertiesandroid.view.MotionEvent$PointerProperties@100
    coords x: 216
    coords y: 605
    coords pressure 1
    coords size 0
    coords touchMajor 0
    coords touchMinor 0
    coords toolMajor 7
    coords toolMinor 7
    coords orientation -1.5707963705062866
    meta 0
    button 0
    xP 1
    yP 1
    devId 7
    edgeflag 0
    source 4098
    flag 0
    injectInputEvent:  MotionEvent { action=ACTION_DOWN, actionButton=0, id[0]=0, x[0]=2474.0, y[0]=571.0, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, classification=NONE, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=270160578, downTime=270160578, deviceId=7, source=0x1002, displayId=0 } 0
    30942
    30918
    injectInputEvent:  MotionEvent { action=ACTION_POINTER_DOWN(1), actionButton=0, id[0]=0, x[0]=2474.0, y[0]=571.0, toolType[0]=TOOL_TYPE_FINGER, id[1]=1, x[1]=397.0, y[1]=576.0, toolType[1]=TOOL_TYPE_FINGER, buttonState=0, classification=NONE, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=2, historySize=0, eventTime=270160637, downTime=270160578, deviceId=7, source=0x1002, displayId=0 } 0
    30933
    30918
    injectInputEvent:  MotionEvent { action=ACTION_MOVE, actionButton=0, id[0]=0, x[0]=2474.0, y[0]=571.0, toolType[0]=TOOL_TYPE_FINGER, id[1]=1, x[1]=397.0, y[1]=576.0, toolType[1]=TOOL_TYPE_FINGER, buttonState=0, classification=NONE, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=2, historySize=0, eventTime=270160791, downTime=270160578, deviceId=7, source=0x1002, displayId=0 } 0
    30942
    30918
    injectInputEvent:  MotionEvent { action=ACTION_MOVE, actionButton=0, id[0]=0, x[0]=2474.0, y[0]=571.0, toolType[0]=TOOL_TYPE_FINGER, id[1]=1, x[1]=397.0, y[1]=576.0, toolType[1]=TOOL_TYPE_FINGER, buttonState=0, classification=NONE, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=2, historySize=0, eventTime=270160833, downTime=270160578, deviceId=7, source=0x1002, displayId=0 } 0
    30933
    30918
    injectInputEvent:  MotionEvent { action=ACTION_MOVE, actionButton=0, id[0]=0, x[0]=2474.0, y[0]=571.0, toolType[0]=TOOL_TYPE_FINGER, id[1]=1, x[1]=397.0, y[1]=576.0, toolType[1]=TOOL_TYPE_FINGER, buttonState=0, classification=NONE, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=2, historySize=0, eventTime=270161519, downTime=270160578, deviceId=7, source=0x1002, displayId=0 } 0
    30942
    30918
    injectInputEvent:  MotionEvent { action=ACTION_POINTER_UP(0), actionButton=0, id[0]=0, x[0]=2474.0, y[0]=571.0, toolType[0]=TOOL_TYPE_FINGER, id[1]=1, x[1]=397.0, y[1]=576.0, toolType[1]=TOOL_TYPE_FINGER, buttonState=0, classification=NONE, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=2, historySize=0, eventTime=270162331, downTime=270160578, deviceId=7, source=0x1002, displayId=0 } 0
    30942
    30918
    injectInputEvent:  MotionEvent { action=ACTION_UP, actionButton=0, id[0]=1, x[0]=397.0, y[0]=576.0, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, classification=NONE, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=270162353, downTime=270160578, deviceId=7, source=0x1002, displayId=0 } 0
    30933
    30918
    

    飞智

    injectInputEvent:  MotionEvent { action=ACTION_DOWN, actionButton=0, id[0]=0, x[0]=365.0, y[0]=590.0, toolType[0]=TOOL_TYPE_UNKNOWN, buttonState=0, classification=NONE, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=270267397, downTime=270267397, deviceId=0, source=0x1002, displayId=0 } 0
    5367
    5367
    injectInputEvent:  MotionEvent { action=ACTION_POINTER_DOWN(1), actionButton=0, id[0]=0, x[0]=365.0, y[0]=590.0, toolType[0]=TOOL_TYPE_UNKNOWN, id[1]=1, x[1]=2647.0, y[1]=721.0, toolType[1]=TOOL_TYPE_UNKNOWN, buttonState=0, classification=NONE, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=2, historySize=0, eventTime=270268188, downTime=270268188, deviceId=0, source=0x1002, displayId=0 } 0
    5367
    5367
    injectInputEvent:  MotionEvent { action=ACTION_POINTER_UP(1), actionButton=0, id[0]=0, x[0]=365.0, y[0]=590.0, toolType[0]=TOOL_TYPE_UNKNOWN, id[1]=1, x[1]=2647.0, y[1]=721.0, toolType[1]=TOOL_TYPE_UNKNOWN, buttonState=0, classification=NONE, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=2, historySize=0, eventTime=270268970, downTime=270268970, deviceId=0, source=0x1002, displayId=0 } 0
    5367
    5367
    action 1
    count 1
    propertiesandroid.view.MotionEvent$PointerProperties@1
    coords x: 365
    coords y: 590
    coords pressure 0
    coords size 0
    coords touchMajor 0
    coords touchMinor 0
    coords toolMajor 0
    coords toolMinor 0
    coords orientation 0
    meta 0
    button 0
    xP 0
    yP 0
    devId 0
    edgeflag 0
    source 0
    flag 0
    injectInputEvent:  MotionEvent { action=ACTION_UP, actionButton=0, id[0]=0, x[0]=365.0, y[0]=590.0, toolType[0]=TOOL_TYPE_UNKNOWN, buttonState=0, classification=NONE, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=270269434, downTime=270269434, deviceId=0, source=0x1002, displayId=0 } 0
    5367
    5367
    
    

    北通左游

    injectInputEvent:  MotionEvent { action=ACTION_DOWN, actionButton=0, id[0]=0, x[0]=371.0, y[0]=723.0, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, classification=NONE, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=270465714, downTime=270465714, deviceId=0, source=0x1002, displayId=0 } 0
    8080
    7684
    injectInputEvent:  MotionEvent { action=ACTION_MOVE, actionButton=0, id[0]=0, x[0]=371.0, y[0]=723.0, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, classification=NONE, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=270465761, downTime=270465714, deviceId=0, source=0x1002, displayId=0 } 0
    8080
    7684
    action 2
    count 1
    propertiesandroid.view.MotionEvent$PointerProperties@100
    coords x: 371
    coords y: 723
    coords pressure 0
    coords size 0
    coords touchMajor 0
    coords touchMinor 0
    coords toolMajor 0
    coords toolMinor 0
    coords orientation 0
    meta 0
    button 0
    xP 0
    yP 0
    devId 0
    edgeflag 0
    source 4098
    flag 0
    injectInputEvent:  MotionEvent { action=ACTION_MOVE, actionButton=0, id[0]=0, x[0]=371.0, y[0]=723.0, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, classification=NONE, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=270465782, downTime=270465714, deviceId=0, source=0x1002, displayId=0 } 0
    8080
    7684
    injectInputEvent:  MotionEvent { action=ACTION_POINTER_DOWN(1), actionButton=0, id[0]=0, x[0]=371.0, y[0]=723.0, toolType[0]=TOOL_TYPE_FINGER, id[1]=1, x[1]=2607.0, y[1]=514.0, toolType[1]=TOOL_TYPE_FINGER, buttonState=0, classification=NONE, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=2, historySize=0, eventTime=270467641, downTime=270465714, deviceId=0, source=0x1002, displayId=0 } 0
    8080
    7684
    injectInputEvent:  MotionEvent { action=ACTION_MOVE, actionButton=0, id[0]=0, x[0]=371.0, y[0]=723.0, toolType[0]=TOOL_TYPE_FINGER, id[1]=1, x[1]=2607.0, y[1]=514.0, toolType[1]=TOOL_TYPE_FINGER, buttonState=0, classification=NONE, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=2, historySize=0, eventTime=270467663, downTime=270465714, deviceId=0, source=0x1002, displayId=0 } 0
    8080
    7684
    injectInputEvent:  MotionEvent { action=ACTION_MOVE, actionButton=0, id[0]=0, x[0]=371.0, y[0]=723.0, toolType[0]=TOOL_TYPE_FINGER, id[1]=1, x[1]=2607.0, y[1]=514.0, toolType[1]=TOOL_TYPE_FINGER, buttonState=0, classification=NONE, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=2, historySize=0, eventTime=270467709, downTime=270465714, deviceId=0, source=0x1002, displayId=0 } 0
    8080
    7684
    injectInputEvent:  MotionEvent { action=ACTION_MOVE, actionButton=0, id[0]=0, x[0]=371.0, y[0]=723.0, toolType[0]=TOOL_TYPE_FINGER, id[1]=1, x[1]=2607.0, y[1]=514.0, toolType[1]=TOOL_TYPE_FINGER, buttonState=0, classification=NONE, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=2, historySize=0, eventTime=270469001, downTime=270465714, deviceId=0, source=0x1002, displayId=0 } 0
    8080
    7684
    injectInputEvent:  MotionEvent { action=ACTION_POINTER_UP(1), actionButton=0, id[0]=0, x[0]=371.0, y[0]=723.0, toolType[0]=TOOL_TYPE_FINGER, id[1]=1, x[1]=2607.0, y[1]=514.0, toolType[1]=TOOL_TYPE_FINGER, buttonState=0, classification=NONE, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=2, historySize=0, eventTime=270469012, downTime=270465714, deviceId=0, source=0x1002, displayId=0 } 0
    8080
    7684
    injectInputEvent:  MotionEvent { action=ACTION_MOVE, actionButton=0, id[0]=0, x[0]=371.0, y[0]=723.0, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, classification=NONE, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=270469037, downTime=270465714, deviceId=0, source=0x1002, displayId=0 } 0
    8080
    7684
    injectInputEvent:  MotionEvent { action=ACTION_MOVE, actionButton=0, id[0]=0, x[0]=371.0, y[0]=723.0, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, classification=NONE, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=270469102, downTime=270465714, deviceId=0, source=0x1002, displayId=0 } 0
    8080
    7684
    injectInputEvent:  MotionEvent { action=ACTION_UP, actionButton=0, id[0]=0, x[0]=371.0, y[0]=723.0, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, classification=NONE, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=270469109, downTime=270465714, deviceId=0, source=0x1002, displayId=0 } 0
    8080
    7684
    

    相关文章

      网友评论

          本文标题:Android逆向 单手手柄事件分析

          本文链接:https://www.haomeiwen.com/subject/yrsuqktx.html