package com.bytedance.sdk.openadsdk.core.lb;

import android.util.SparseArray;
import android.view.MotionEvent;
import com.bytedance.sdk.openadsdk.api.reward.BackupConstant;
import com.bytedance.sdk.openadsdk.core.gof;
import com.bytedance.sdk.openadsdk.core.lb.lb;

/* JADX INFO: loaded from: classes2.dex */
public class ajl {
    public static int vt = 8;
    public float fm = -1.0f;
    public float ro = -1.0f;

    /* JADX INFO: renamed from: lb, reason: collision with root package name */
    public float f7146lb = -1.0f;
    public float yz = -1.0f;
    public long jnr = -1;
    public long ajl = -1;
    public int wsy = -1;
    public int wu = BackupConstant.UNFINISHED_FAIL_CODE;

    /* JADX INFO: renamed from: ef, reason: collision with root package name */
    public int f7145ef = -1;
    public boolean ku = true;
    public SparseArray<lb.fm> duv = new SparseArray<>();
    private float dsz = 0.0f;
    private float onz = 0.0f;
    private float fhx = 0.0f;
    private float irt = 0.0f;
    private long qhl = 0;
    private int gof = 0;
    private int gqi = 0;

    static {
        if (gof.fm() != null) {
            vt = gof.ro();
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:19:0x0072  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public void fm(MotionEvent motionEvent) {
        int i10;
        this.wu = motionEvent.getDeviceId();
        int i11 = 0;
        this.wsy = motionEvent.getToolType(0);
        this.f7145ef = motionEvent.getSource();
        int actionMasked = motionEvent.getActionMasked();
        int i12 = 1;
        if (actionMasked != 0) {
            i10 = 3;
            if (actionMasked == 1) {
                this.f7146lb = motionEvent.getRawX();
                this.yz = motionEvent.getRawY();
                this.ajl = System.currentTimeMillis();
                if (Math.abs(this.f7146lb - this.gof) >= vt || Math.abs(this.yz - this.gqi) >= vt) {
                    this.ku = false;
                }
            } else if (actionMasked != 2) {
                i11 = actionMasked != 3 ? -1 : 4;
            } else {
                this.fhx = Math.abs(motionEvent.getX() - this.dsz) + this.fhx;
                this.irt = Math.abs(motionEvent.getY() - this.onz) + this.irt;
                this.dsz = motionEvent.getX();
                this.onz = motionEvent.getY();
                if (System.currentTimeMillis() - this.qhl > 200) {
                    float f10 = this.fhx;
                    int i13 = vt;
                    if (f10 <= i13 && this.irt <= i13) {
                        i12 = 2;
                    }
                    this.f7146lb = motionEvent.getRawX();
                    this.yz = motionEvent.getRawY();
                    if (Math.abs(this.f7146lb - this.gof) >= vt || Math.abs(this.yz - this.gqi) >= vt) {
                        this.ku = false;
                    }
                    i10 = i12;
                }
            }
            this.duv.put(motionEvent.getActionMasked(), new lb.fm(i10, motionEvent.getSize(), motionEvent.getPressure(), System.currentTimeMillis()));
        }
        this.gof = (int) motionEvent.getRawX();
        this.gqi = (int) motionEvent.getRawY();
        this.fm = motionEvent.getRawX();
        this.ro = motionEvent.getRawY();
        this.jnr = System.currentTimeMillis();
        this.wsy = motionEvent.getToolType(0);
        this.wu = motionEvent.getDeviceId();
        this.f7145ef = motionEvent.getSource();
        this.fhx = 0.0f;
        this.irt = 0.0f;
        this.qhl = System.currentTimeMillis();
        this.ku = true;
        this.dsz = motionEvent.getX();
        this.onz = motionEvent.getY();
        i10 = i11;
        this.duv.put(motionEvent.getActionMasked(), new lb.fm(i10, motionEvent.getSize(), motionEvent.getPressure(), System.currentTimeMillis()));
    }
}
