导航菜单

页面标题

页面副标题

PrestMan MX v1.0.0 - i.java 源代码

正在查看: PrestMan MX v1.0.0 应用的 i.java JAVA 源代码文件

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


package com.datavisorobfus;

import android.app.Activity;
import android.app.KeyguardManager;
import android.bluetooth.BluetoothAdapter;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.hardware.Sensor;
import android.hardware.SensorManager;
import android.hardware.display.DisplayManager;
import android.location.Location;
import android.location.LocationManager;
import android.media.AudioManager;
import android.media.MediaDrm;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.wifi.ScanResult;
import android.net.wifi.WifiManager;
import android.opengl.GLSurfaceView;
import android.os.BatteryManager;
import android.os.Build;
import android.os.Environment;
import android.os.Handler;
import android.os.Process;
import android.os.SystemClock;
import android.provider.Settings;
import android.telephony.TelephonyManager;
import android.util.DisplayMetrics;
import android.view.Display;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.view.accessibility.AccessibilityManager;
import android.view.inputmethod.InputMethodInfo;
import android.view.inputmethod.InputMethodManager;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.widget.FrameLayout;
import com.datavisor.vangogh.bridge.crypto;
import com.datavisorobfus.h;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileFilter;
import java.io.FileReader;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.net.InetAddress;
import java.net.NetworkInterface;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.Enumeration;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.TimeZone;
import java.util.UUID;
import java.util.regex.Pattern;
import javax.microedition.khronos.egl.EGLConfig;
import javax.microedition.khronos.opengles.GL10;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

public class i {

    private static i f8251e = new i();

    public static String f8252f = m.f8317a;

    private final Object f8253a = new Object();

    private final Object f8254b = new Object();

    private final Object f8255c = new Object();

    private final Object f8256d = new Object();

    class a implements Comparator<JSONArray> {
        a(i iVar) {
        }

        @Override
        public int compare(JSONArray jSONArray, JSONArray jSONArray2) {
            try {
                int i5 = jSONArray.getInt(2);
                int i6 = jSONArray2.getInt(2);
                if (i5 < i6) {
                    return 1;
                }
                return i5 == i6 ? 0 : -1;
            } catch (JSONException unused) {
                return 0;
            }
        }
    }

    class b implements FileFilter {
        b(i iVar) {
        }

        @Override
        public boolean accept(File file) {
            try {
                return Pattern.matches("cpu[0-9]", file.getName());
            } catch (Throwable th) {
                com.datavisor.vangogh.util.f.a(th);
                return false;
            }
        }
    }

    class c implements Runnable {

        final Context f8257a;

        final com.datavisorobfus.h[] f8258b;

        final String[] f8259c;

        class a implements h.c {
            a() {
            }

            @Override
            public void a(String str) {
                c cVar = c.this;
                cVar.f8259c[0] = str;
                synchronized (i.this.f8254b) {
                    try {
                        i.this.f8254b.notifyAll();
                    } finally {
                    }
                }
            }
        }

        c(Context context, com.datavisorobfus.h[] hVarArr, String[] strArr) {
            this.f8257a = context;
            this.f8258b = hVarArr;
            this.f8259c = strArr;
        }

        @Override
        public void run() {
            if (i.h0(this.f8257a)) {
                this.f8258b[0] = new com.datavisorobfus.h(this.f8257a, new a());
                return;
            }
            com.datavisor.vangogh.util.f.a("WebView unavailable");
            this.f8258b[0] = null;
            this.f8259c[0] = "not_supported";
            synchronized (i.this.f8254b) {
                try {
                    i.this.f8254b.notifyAll();
                } finally {
                }
            }
        }
    }

    class d implements Runnable {

        final com.datavisorobfus.h[] f8262a;

        d(i iVar, com.datavisorobfus.h[] hVarArr) {
            this.f8262a = hVarArr;
        }

        @Override
        public void run() {
            com.datavisorobfus.h hVar;
            try {
                com.datavisorobfus.h[] hVarArr = this.f8262a;
                if (hVarArr == null || (hVar = hVarArr[0]) == null) {
                    return;
                }
                hVar.a();
                this.f8262a[0] = null;
            } catch (Throwable unused) {
            }
        }
    }

    class e implements GLSurfaceView.Renderer {

        final JSONObject f8263a;

        final Context f8264b;

        final View f8265c;

        final GLSurfaceView f8266d;

        class a implements Runnable {
            a() {
            }

            @Override
            public void run() {
                try {
                    e eVar = e.this;
                    ((ViewGroup) eVar.f8265c).removeView(eVar.f8266d);
                } catch (Throwable th) {
                    com.datavisor.vangogh.util.f.a(th);
                }
            }
        }

        e(JSONObject jSONObject, Context context, View view, GLSurfaceView gLSurfaceView) {
            this.f8263a = jSONObject;
            this.f8264b = context;
            this.f8265c = view;
            this.f8266d = gLSurfaceView;
        }

        @Override
        public void onDrawFrame(GL10 gl10) {
        }

        @Override
        public void onSurfaceChanged(GL10 gl10, int i5, int i6) {
        }

        @Override
        public void onSurfaceCreated(GL10 gl10, EGLConfig eGLConfig) {
            try {
                try {
                    String glGetString = gl10.glGetString(7936);
                    if (glGetString == null) {
                        glGetString = "";
                    }
                    String glGetString2 = gl10.glGetString(7937);
                    if (glGetString2 == null) {
                        glGetString2 = "";
                    }
                    com.datavisor.vangogh.util.f.a("strVendor:  " + glGetString + "    strRenderer:  " + glGetString2);
                    this.f8263a.put("vendor", glGetString);
                    this.f8263a.put("renderer", glGetString2);
                    synchronized (i.this.f8253a) {
                        try {
                            i.this.f8253a.notifyAll();
                        } finally {
                            new Handler(this.f8264b.getMainLooper()).post(new a());
                        }
                    }
                    new Handler(this.f8264b.getMainLooper()).post(new a());
                } catch (Throwable th) {
                    try {
                        com.datavisor.vangogh.util.f.a(th);
                        new Handler(this.f8264b.getMainLooper()).post(new a());
                    } catch (Throwable th2) {
                        try {
                            new Handler(this.f8264b.getMainLooper()).post(new a());
                        } catch (Throwable th3) {
                            com.datavisor.vangogh.util.f.a(th3);
                        }
                        throw th2;
                    }
                }
            } catch (Throwable th4) {
                com.datavisor.vangogh.util.f.a(th4);
            }
        }
    }

    class f implements Runnable {

        final View f8269a;

        final GLSurfaceView f8270b;

        f(i iVar, View view, GLSurfaceView gLSurfaceView) {
            this.f8269a = view;
            this.f8270b = gLSurfaceView;
        }

        @Override
        public void run() {
            try {
                ((ViewGroup) this.f8269a).addView(this.f8270b, 0);
            } catch (Throwable th) {
                com.datavisor.vangogh.util.f.a(th);
            }
        }
    }

    class g implements s {

        final String[] f8271a;

        final boolean[] f8272b;

        g(String[] strArr, boolean[] zArr) {
            this.f8271a = strArr;
            this.f8272b = zArr;
        }

        @Override
        public void a(String str) {
            this.f8271a[0] = str;
            synchronized (i.this.f8255c) {
                this.f8272b[0] = true;
                try {
                    i.this.f8255c.notifyAll();
                } catch (Throwable th) {
                    com.datavisor.vangogh.util.f.a(th);
                }
            }
        }
    }

    class h implements s {

        final String[] f8274a;

        final boolean[] f8275b;

        h(String[] strArr, boolean[] zArr) {
            this.f8274a = strArr;
            this.f8275b = zArr;
        }

        @Override
        public void a(String str) {
            this.f8274a[0] = str;
            synchronized (i.this.f8256d) {
                this.f8275b[0] = true;
                try {
                    i.this.f8256d.notifyAll();
                } catch (Throwable th) {
                    com.datavisor.vangogh.util.f.a(th);
                }
            }
        }
    }

    private String C() {
        try {
            BluetoothAdapter defaultAdapter = BluetoothAdapter.getDefaultAdapter();
            if (defaultAdapter == null) {
                return null;
            }
            String address = defaultAdapter.isEnabled() ? defaultAdapter.getAddress() : null;
            if (address == null || address.endsWith("00:00:00:00:00")) {
                address = a(defaultAdapter);
            }
            if (com.datavisor.vangogh.util.h.a(address)) {
                return null;
            }
            return address;
        } catch (Throwable th) {
            com.datavisor.vangogh.util.f.a(th);
            return null;
        }
    }

    private Activity D() {
        try {
            Class<?> cls = Class.forName("android.app.ActivityThread");
            Object invoke = cls.getMethod("currentActivityThread", new Class[0]).invoke(null, new Object[0]);
            Field declaredField = cls.getDeclaredField("mActivities");
            declaredField.setAccessible(true);
            for (Object obj : ((Map) declaredField.get(invoke)).values()) {
                Class<?> cls2 = obj.getClass();
                Field declaredField2 = cls2.getDeclaredField("paused");
                declaredField2.setAccessible(true);
                if (!declaredField2.getBoolean(obj)) {
                    Field declaredField3 = cls2.getDeclaredField("activity");
                    declaredField3.setAccessible(true);
                    return (Activity) declaredField3.get(obj);
                }
            }
            return null;
        } catch (Throwable th) {
            com.datavisor.vangogh.util.f.a(th);
            return null;
        }
    }

    public static i E() {
        return f8251e;
    }

    private String F() {
        String str;
        try {
            new FileReader("/sys/block/mmcblk0/device/type");
            str = "/sys/block/mmcblk0/device/";
        } catch (Throwable unused) {
            str = null;
        }
        try {
            new FileReader("/sys/block/mmcblk1/device/type");
            str = "/sys/block/mmcblk1/device/";
        } catch (Throwable unused2) {
        }
        try {
            new FileReader("/sys/block/mmcblk2/device/type");
            return "/sys/block/mmcblk2/device/";
        } catch (Throwable unused3) {
            return str;
        }
    }

    private String f0(Context context) {
        byte[] hardwareAddress;
        if (b(context, "android.permission.ACCESS_WIFI_STATE")) {
            com.datavisor.vangogh.util.f.a(f8252f, "no permission ACCESS_WIFI_STATE");
            return "no_permission";
        }
        try {
            String a5 = k.d().a(context);
            if (com.datavisor.vangogh.util.h.a(a5) || (hardwareAddress = NetworkInterface.getByInetAddress(InetAddress.getByName(a5)).getHardwareAddress()) == null) {
                return "empty";
            }
            StringBuilder sb = new StringBuilder();
            for (byte b5 : hardwareAddress) {
                sb.append(String.format("%02X:", Integer.valueOf(b5 & 255)));
            }
            if (sb.length() > 0) {
                sb.deleteCharAt(sb.length() - 1);
            }
            if (!sb.toString().equals("02:00:00:00:00:00") && !sb.toString().equals("00:00:00:00:00:00")) {
                return sb.toString();
            }
            return "empty";
        } catch (Throwable th) {
            com.datavisor.vangogh.util.f.a(th);
            return "exception";
        }
    }

    private WindowManager g0(Context context) {
        Object systemService;
        try {
            if (Build.VERSION.SDK_INT > 30) {
                systemService = context.getSystemService((Class<Object>) DisplayManager.class);
                context = context.createDisplayContext(((DisplayManager) systemService).getDisplay(0)).createWindowContext(2038, null);
            }
            return (WindowManager) context.getSystemService("window");
        } catch (Throwable th) {
            com.datavisor.vangogh.util.f.a(th);
            return null;
        }
    }

    public static boolean h0(Context context) {
        try {
            new WebView(context).destroy();
            return true;
        } catch (Throwable th) {
            com.datavisor.vangogh.util.f.a("WebView Unavailable: ", th);
            return false;
        }
    }

    public String A() {
        try {
            String displayName = TimeZone.getDefault().getDisplayName(false, 0);
            return com.datavisor.vangogh.util.h.a(displayName) ? "empty" : displayName;
        } catch (Throwable th) {
            com.datavisor.vangogh.util.f.a(th);
            return "exception";
        }
    }

    public String B() {
        try {
            byte[] propertyByteArray = new MediaDrm(new UUID(-1301668207276963122L, -6645017420763422227L)).getPropertyByteArray("deviceUniqueId");
            StringBuilder sb = new StringBuilder();
            for (byte b5 : propertyByteArray) {
                sb.append(String.format("%02x", Byte.valueOf(b5)));
            }
            return sb.toString();
        } catch (Throwable th) {
            com.datavisor.vangogh.util.f.a(th);
            return "exception";
        }
    }

    public String G(Context context) {
        try {
            if (b(context, "android.permission.READ_PHONE_STATE")) {
                com.datavisor.vangogh.util.f.a(f8252f, "no permission READ_PHONE_STATE");
                return "no_permission";
            }
            if (context == null) {
                com.datavisor.vangogh.util.f.a(f8252f, "context is null");
                return "para_err";
            }
            String simOperator = ((TelephonyManager) context.getSystemService("phone")).getSimOperator();
            return com.datavisor.vangogh.util.h.a(simOperator) ? "empty" : simOperator;
        } catch (Throwable th) {
            com.datavisor.vangogh.util.f.a(th);
            return "exception";
        }
    }

    public String H(Context context) {
        try {
            if (b(context, "android.permission.READ_PHONE_STATE")) {
                com.datavisor.vangogh.util.f.a(f8252f, "no permission READ_PHONE_STATE");
                return "no_permission";
            }
            if (context == null) {
                com.datavisor.vangogh.util.f.a(f8252f, "context is null");
                return "para_err";
            }
            String networkOperatorName = ((TelephonyManager) context.getSystemService("phone")).getNetworkOperatorName();
            return com.datavisor.vangogh.util.h.a(networkOperatorName) ? "empty" : networkOperatorName;
        } catch (Throwable th) {
            com.datavisor.vangogh.util.f.a(th);
            return "exception";
        }
    }

    public String I(Context context) {
        boolean isMock;
        try {
            if (b(context, "android.permission.ACCESS_COARSE_LOCATION") && b(context, "android.permission.ACCESS_FINE_LOCATION")) {
                return "no_permission";
            }
            JSONObject jSONObject = new JSONObject();
            LocationManager locationManager = (LocationManager) context.getSystemService("location");
            for (String str : locationManager.getProviders(true)) {
                Location lastKnownLocation = locationManager.getLastKnownLocation(str);
                if (lastKnownLocation != null) {
                    JSONArray jSONArray = new JSONArray();
                    int i5 = Build.VERSION.SDK_INT;
                    jSONArray.put(lastKnownLocation.isFromMockProvider() ? "1" : "0");
                    if (i5 >= 31) {
                        isMock = lastKnownLocation.isMock();
                        jSONArray.put(isMock ? "1" : "0");
                    } else {
                        jSONArray.put("empty");
                    }
                    jSONObject.put(str, jSONArray);
                }
            }
            return jSONObject.toString();
        } catch (Throwable th) {
            com.datavisor.vangogh.util.f.a(th);
            return "exception";
        }
    }

    public String J(Context context) {
        String str;
        String str2;
        if (b(context, "android.permission.CHANGE_WIFI_STATE")) {
            str = f8252f;
            str2 = "no permission CHANGE_WIFI_STATE";
        } else if (b(context, "android.permission.ACCESS_WIFI_STATE")) {
            str = f8252f;
            str2 = "no permission ACCESS_WIFI_STATE";
        } else if (b(context, "android.permission.ACCESS_NETWORK_STATE")) {
            str = f8252f;
            str2 = "no permission ACCESS_NETWORK_STATE";
        } else {
            if (!b(context, "android.permission.ACCESS_FINE_LOCATION")) {
                try {
                    JSONArray jSONArray = new JSONArray();
                    WifiManager wifiManager = (WifiManager) context.getSystemService("wifi");
                    wifiManager.startScan();
                    for (ScanResult scanResult : wifiManager.getScanResults()) {
                        JSONArray jSONArray2 = new JSONArray();
                        jSONArray2.put(scanResult.SSID);
                        jSONArray2.put(scanResult.BSSID);
                        jSONArray2.put(scanResult.level);
                        jSONArray.put(jSONArray2);
                    }
                    ArrayList arrayList = new ArrayList();
                    for (int i5 = 0; i5 < jSONArray.length(); i5++) {
                        arrayList.add((JSONArray) jSONArray.get(i5));
                    }
                    Collections.sort(arrayList, new a(this));
                    JSONArray jSONArray3 = new JSONArray();
                    for (int i6 = 0; i6 < Math.min(arrayList.size(), 10); i6++) {
                        jSONArray3.put(arrayList.get(i6));
                    }
                    return jSONArray3.toString();
                } catch (Throwable th) {
                    com.datavisor.vangogh.util.f.a(th);
                    return "exception";
                }
            }
            str = f8252f;
            str2 = "no permission ACCESS_FINE_LOCATION";
        }
        com.datavisor.vangogh.util.f.a(str, str2);
        return "no_permission";
    }

    public String K(Context context) {
        NetworkInfo activeNetworkInfo;
        if (context == null) {
            com.datavisor.vangogh.util.f.a(f8252f, "context is null");
            return "para_err";
        }
        if (b(context, "android.permission.ACCESS_NETWORK_STATE")) {
            com.datavisor.vangogh.util.f.a(f8252f, "no ACCESS_NETWORK_STATE");
            return "no_permission";
        }
        try {
            ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService("connectivity");
            if (connectivityManager == null || (activeNetworkInfo = connectivityManager.getActiveNetworkInfo()) == null || !activeNetworkInfo.isAvailable()) {
                return "-1";
            }
            return activeNetworkInfo.getType() + "";
        } catch (Throwable th) {
            com.datavisor.vangogh.util.f.a(th);
            return "exception";
        }
    }

    public synchronized String L(Context context) {
        String[] strArr;
        strArr = new String[]{"empty"};
        boolean[] zArr = {false};
        r.b(context, new g(strArr, zArr));
        synchronized (this.f8255c) {
            try {
                if (!zArr[0]) {
                    try {
                        this.f8255c.wait(50L);
                    } catch (Throwable th) {
                        com.datavisor.vangogh.util.f.a(th);
                    }
                }
            } catch (Throwable th2) {
                throw th2;
            }
        }
        com.datavisor.vangogh.util.f.a("getOAID getOAID getOAID getOAID:       " + strArr[0]);
        return strArr[0];
    }

    public String M(Context context) {
        return com.datavisor.vangogh.util.g.a(context);
    }

    public String N(Context context) {
        return com.datavisor.vangogh.util.g.b(context);
    }

    public String O(Context context) {
        if (!b(context, "android.permission.READ_PHONE_STATE")) {
            return com.datavisor.vangogh.util.g.c(context);
        }
        com.datavisor.vangogh.util.f.a(f8252f, "no permission READ_PHONE_STATE");
        return "no_permission";
    }

    public String P(Context context) {
        if (!b(context, "android.permission.READ_PHONE_STATE")) {
            return com.datavisor.vangogh.util.g.d(context);
        }
        com.datavisor.vangogh.util.f.a(f8252f, "no permission READ_PHONE_STATE");
        return "no_permission";
    }

    public String Q(Context context) {
        if (!b(context, "android.permission.READ_PHONE_STATE")) {
            return com.datavisor.vangogh.util.g.e(context);
        }
        com.datavisor.vangogh.util.f.a(f8252f, "no permission READ_PHONE_STATE");
        return "no_permission";
    }

    public String R(Context context) {
        String str;
        if (b(context, "android.permission.READ_PHONE_STATE")) {
            com.datavisor.vangogh.util.f.a(f8252f, "no permission READ_PHONE_STATE");
            return "no_permission";
        }
        if (context == null) {
            com.datavisor.vangogh.util.f.a(f8252f, "context is null");
            return "para_err";
        }
        try {
            TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService("phone");
            str = telephonyManager != null ? telephonyManager.getSimSerialNumber() : "default";
        } catch (Throwable th) {
            com.datavisor.vangogh.util.f.a(th);
            str = "exception";
        }
        return com.datavisor.vangogh.util.h.a(str) ? "empty" : str;
    }

    public String S(Context context) {
        try {
            WindowManager g02 = g0(context);
            if (g02 == null) {
                return "empty";
            }
            DisplayMetrics displayMetrics = new DisplayMetrics();
            g02.getDefaultDisplay().getRealMetrics(displayMetrics);
            return "" + displayMetrics.heightPixels;
        } catch (Throwable th) {
            com.datavisor.vangogh.util.f.a(th);
            return "exception";
        }
    }

    public String T(Context context) {
        try {
            if (context == null) {
                com.datavisor.vangogh.util.f.a("getScreenSharingStatus context is null");
                return "empty";
            }
            Display[] displays = ((DisplayManager) context.getSystemService("display")).getDisplays();
            if (displays == null) {
                return "empty";
            }
            com.datavisor.vangogh.util.f.a("Current screen num: " + displays.length);
            return displays.length > 1 ? "1" : "0";
        } catch (Throwable th) {
            com.datavisor.vangogh.util.f.a(th);
            return "exception";
        }
    }

    public String U(Context context) {
        try {
            WindowManager g02 = g0(context);
            if (g02 == null) {
                return "empty";
            }
            DisplayMetrics displayMetrics = new DisplayMetrics();
            g02.getDefaultDisplay().getRealMetrics(displayMetrics);
            return "" + displayMetrics.widthPixels;
        } catch (Throwable th) {
            com.datavisor.vangogh.util.f.a(th);
            return "exception";
        }
    }

    public String V(Context context) {
        try {
            JSONArray jSONArray = new JSONArray();
            for (Sensor sensor : ((SensorManager) context.getSystemService("sensor")).getSensorList(-1)) {
                JSONArray jSONArray2 = new JSONArray();
                jSONArray2.put(sensor.getName());
                jSONArray2.put(sensor.getType() + "");
                jSONArray2.put(sensor.getVendor());
                jSONArray.put(jSONArray2);
            }
            return jSONArray.toString();
        } catch (Throwable th) {
            com.datavisor.vangogh.util.f.a(th);
            return "exception";
        }
    }

    public String W(Context context) {
        try {
            return "" + ((SensorManager) context.getSystemService("sensor")).getSensorList(-1).size();
        } catch (Throwable th) {
            com.datavisor.vangogh.util.f.a(th);
            return "exception";
        }
    }

    public String X(Context context) {
        try {
            if (b(context, "android.permission.READ_PHONE_STATE")) {
                com.datavisor.vangogh.util.f.a(f8252f, "no permission READ_PHONE_STATE");
                return "no_permission";
            }
            if (context == null) {
                com.datavisor.vangogh.util.f.a(f8252f, "context is null");
                return "para_err";
            }
            TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService("phone");
            if (telephonyManager == null) {
                return "empty";
            }
            return "" + telephonyManager.getSimState();
        } catch (Throwable th) {
            com.datavisor.vangogh.util.f.a(th);
            return "exception";
        }
    }

    public String Y(Context context) {
        try {
            WindowManager g02 = g0(context);
            if (g02 == null) {
                return "empty";
            }
            DisplayMetrics displayMetrics = new DisplayMetrics();
            g02.getDefaultDisplay().getRealMetrics(displayMetrics);
            int i5 = displayMetrics.widthPixels;
            int i6 = displayMetrics.heightPixels;
            return Math.max(i5, i6) + "*" + Math.min(i5, i6);
        } catch (Throwable th) {
            com.datavisor.vangogh.util.f.a(th);
            return "exception";
        }
    }

    public String Z(Context context) {
        try {
            String defaultUserAgent = WebSettings.getDefaultUserAgent(context);
            if (com.datavisor.vangogh.util.h.a(defaultUserAgent)) {
                defaultUserAgent = System.getProperty("http.agent");
            }
            if (com.datavisor.vangogh.util.h.a(defaultUserAgent)) {
                return "empty";
            }
            StringBuilder sb = new StringBuilder();
            int length = defaultUserAgent.length();
            for (int i5 = 0; i5 < length; i5++) {
                char charAt = defaultUserAgent.charAt(i5);
                if (charAt > 31 && charAt < 127) {
                    sb.append(charAt);
                }
                sb.append(String.format("\\u%04x", Integer.valueOf(charAt)));
            }
            return sb.toString();
        } catch (Throwable th) {
            com.datavisor.vangogh.util.f.a(th);
            return "exception";
        }
    }

    public String a0(Context context) {
        if (context == null) {
            com.datavisor.vangogh.util.f.a(f8252f, "context is null");
            return "para_err";
        }
        try {
            JSONObject jSONObject = new JSONObject();
            AudioManager audioManager = (AudioManager) context.getSystemService("audio");
            int i5 = audioManager.getRingerMode() == 0 ? 1 : 0;
            int streamVolume = audioManager.getStreamVolume(0);
            int streamVolume2 = audioManager.getStreamVolume(1);
            int streamVolume3 = audioManager.getStreamVolume(2);
            int streamVolume4 = audioManager.getStreamVolume(3);
            int streamVolume5 = audioManager.getStreamVolume(4);
            jSONObject.put("ringermode", "" + i5);
            jSONObject.put("call", "" + streamVolume);
            jSONObject.put("system", "" + streamVolume2);
            jSONObject.put("ring", "" + streamVolume3);
            jSONObject.put("music", "" + streamVolume4);
            jSONObject.put("alarm", "" + streamVolume5);
            return jSONObject.toString();
        } catch (Throwable th) {
            com.datavisor.vangogh.util.f.a(th);
            return "exception";
        }
    }

    public int b(Context context) {
        NetworkInfo activeNetworkInfo;
        if (context == null || b(context, "android.permission.ACCESS_NETWORK_STATE")) {
            return -1;
        }
        try {
            ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService("connectivity");
            if (connectivityManager != null && (activeNetworkInfo = connectivityManager.getActiveNetworkInfo()) != null && activeNetworkInfo.isAvailable()) {
                return activeNetworkInfo.getType();
            }
        } catch (Throwable unused) {
        }
        return -1;
    }

    public String b0(Context context) {
        try {
            String[] strArr = {"default"};
            Handler handler = new Handler(context.getMainLooper());
            com.datavisorobfus.h[] hVarArr = new com.datavisorobfus.h[1];
            handler.post(new c(context, hVarArr, strArr));
            synchronized (this.f8254b) {
                try {
                    this.f8254b.wait(1000L);
                } finally {
                    com.datavisor.vangogh.util.f.a("now wait for webrtc finished");
                    handler.post(new d(this, hVarArr));
                    return strArr[0];
                }
            }
            com.datavisor.vangogh.util.f.a("now wait for webrtc finished");
            handler.post(new d(this, hVarArr));
            return strArr[0];
        } catch (Throwable unused) {
            return "exception";
        }
    }

    public String c0(Context context) {
        String str;
        String str2;
        String str3;
        if (b(context, "android.permission.ACCESS_WIFI_STATE")) {
            str2 = f8252f;
            str3 = "no ACCESS_WIFI_STATE";
        } else {
            if (!b(context, "android.permission.ACCESS_COARSE_LOCATION")) {
                if (context == null) {
                    com.datavisor.vangogh.util.f.a(f8252f, "context is null");
                    return "para_err";
                }
                try {
                    WifiManager wifiManager = (WifiManager) context.getSystemService("wifi");
                    str = wifiManager.isWifiEnabled() ? wifiManager.getConnectionInfo().getBSSID() : "default";
                } catch (Throwable th) {
                    com.datavisor.vangogh.util.f.a(th);
                    str = "exception";
                }
                return (com.datavisor.vangogh.util.h.a(str) || str.equals("02:00:00:00:00:00") || str.equals("00:00:00:00:00:00")) ? "empty" : str;
            }
            str2 = f8252f;
            str3 = "no ACCESS_COARSE_LOCATION";
        }
        com.datavisor.vangogh.util.f.a(str2, str3);
        return "no_permission";
    }

    public String d0(Context context) {
        if (b(context, "android.permission.ACCESS_WIFI_STATE")) {
            com.datavisor.vangogh.util.f.a(f8252f, "no ACCESS_WIFI_STATE");
            return "no_permission";
        }
        if (context == null) {
            com.datavisor.vangogh.util.f.a(f8252f, "context is null");
            return "para_err";
        }
        try {
            WifiManager wifiManager = (WifiManager) context.getSystemService("wifi");
            String ssid = wifiManager.isWifiEnabled() ? wifiManager.getConnectionInfo().getSSID() : null;
            if (com.datavisor.vangogh.util.h.b(ssid) && ssid.equals("<unknown ssid>")) {
                ssid = ((ConnectivityManager) context.getSystemService("connectivity")).getActiveNetworkInfo().getExtraInfo();
            }
            if (!com.datavisor.vangogh.util.h.a(ssid)) {
                if (ssid.length() < 2 || !ssid.startsWith("\"") || !ssid.endsWith("\"")) {
                    return ssid;
                }
                String substring = ssid.substring(1, ssid.length() - 1);
                if (!com.datavisor.vangogh.util.h.a(substring)) {
                    return substring;
                }
            }
            return "empty";
        } catch (Throwable th) {
            com.datavisor.vangogh.util.f.a(th);
            return "exception";
        }
    }

    public String e() {
        try {
            return new File("/sys/devices/system/cpu/").listFiles(new b(this)).length + "";
        } catch (Throwable th) {
            com.datavisor.vangogh.util.f.a(th);
            return "exception";
        }
    }

    public boolean e0(Context context) {
        try {
            if (b(context, "android.permission.ACCESS_NETWORK_STATE")) {
                com.datavisor.vangogh.util.f.a(f8252f, "no ACCESS_NETWORK_STATE");
                return true;
            }
            if (context == null) {
                com.datavisor.vangogh.util.f.a(f8252f, "context is null");
                return true;
            }
            NetworkInfo activeNetworkInfo = ((ConnectivityManager) context.getSystemService("connectivity")).getActiveNetworkInfo();
            return activeNetworkInfo != null && activeNetworkInfo.isAvailable();
        } catch (Throwable unused) {
            return true;
        }
    }

    public String f() {
        try {
            String e5 = m0.e("/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq");
            return com.datavisor.vangogh.util.h.a(e5) ? "empty" : e5;
        } catch (Throwable th) {
            com.datavisor.vangogh.util.f.a(th);
            return "exception";
        }
    }

    public String g() {
        try {
            String b5 = m0.b("Processor");
            return com.datavisor.vangogh.util.h.a(b5) ? "empty" : b5;
        } catch (Throwable th) {
            com.datavisor.vangogh.util.f.a(th);
            return "exception";
        }
    }

    public String h() {
        try {
            String b5 = m0.b("Hardware");
            return com.datavisor.vangogh.util.h.a(b5) ? "empty" : b5;
        } catch (Throwable th) {
            com.datavisor.vangogh.util.f.a(th);
            return "exception";
        }
    }

    public String i() {
        return Build.BRAND;
    }

    public String j() {
        try {
            String c5 = m0.c(crypto.convert("KZHQy23Vq8RBVph/BuAb"));
            return com.datavisor.vangogh.util.h.a(c5) ? "" : c5;
        } catch (Throwable th) {
            com.datavisor.vangogh.util.f.a(th);
            return "exception";
        }
    }

    public String k() {
        return Build.MANUFACTURER;
    }

    public String l() {
        return Build.DEVICE;
    }

    public String m() {
        return Build.HARDWARE;
    }

    public String n() {
        try {
            String locale = Locale.getDefault().toString();
            return com.datavisor.vangogh.util.h.a(locale) ? "empty" : locale;
        } catch (Throwable th) {
            com.datavisor.vangogh.util.f.a(th);
            return "exception";
        }
    }

    public String o() {
        try {
            return new SimpleDateFormat("yyyy/MM/dd HH:mm:ss").format(new Date(System.currentTimeMillis()));
        } catch (Throwable th) {
            com.datavisor.vangogh.util.f.a(th);
            return "exception";
        }
    }

    public String p() {
        return "" + System.currentTimeMillis();
    }

    public String q() {
        BufferedReader bufferedReader;
        FileReader fileReader;
        FileReader fileReader2 = null;
        try {
            FileReader fileReader3 = new FileReader("/proc/meminfo");
            try {
                BufferedReader bufferedReader2 = new BufferedReader(fileReader3, 8192);
                try {
                    String readLine = bufferedReader2.readLine();
                    if (readLine == null) {
                        try {
                            fileReader3.close();
                        } catch (Throwable unused) {
                        }
                        try {
                            bufferedReader2.close();
                            return "empty";
                        } catch (Throwable unused2) {
                            return "empty";
                        }
                    }
                    String str = "" + Long.valueOf(Long.parseLong(readLine.split("\\s+")[1]));
                    try {
                        fileReader3.close();
                    } catch (Throwable unused3) {
                    }
                    try {
                        bufferedReader2.close();
                    } catch (Throwable unused4) {
                    }
                    return str;
                } catch (Throwable th) {
                    fileReader = fileReader3;
                    bufferedReader = bufferedReader2;
                    th = th;
                    fileReader2 = fileReader;
                    try {
                        com.datavisor.vangogh.util.f.a(th);
                        if (fileReader2 != null) {
                            try {
                                fileReader2.close();
                            } catch (Throwable unused5) {
                            }
                        }
                        if (bufferedReader == null) {
                            return "exception";
                        }
                        try {
                            bufferedReader.close();
                            return "exception";
                        } catch (Throwable unused6) {
                            return "exception";
                        }
                    } finally {
                    }
                }
            } catch (Throwable th2) {
                th = th2;
                fileReader = fileReader3;
                bufferedReader = null;
            }
        } catch (Throwable th3) {
            th = th3;
            bufferedReader = null;
        }
    }

    public String r() {
        return Build.MODEL;
    }

    public String s() {
        try {
            return Process.myPid() + "";
        } catch (Throwable th) {
            com.datavisor.vangogh.util.f.a(th);
            return "exception";
        }
    }

    public String t() {
        String F4 = F();
        if (F4 == null) {
            return "empty";
        }
        try {
            return new BufferedReader(new FileReader(F4 + "csd")).readLine();
        } catch (Throwable unused) {
            return "exception";
        }
    }

    public String u() {
        String F4 = F();
        if (F4 == null) {
            return "empty";
        }
        try {
            return new BufferedReader(new FileReader(F4 + "cid")).readLine();
        } catch (Throwable th) {
            com.datavisor.vangogh.util.f.a(th);
            return "exception";
        }
    }

    public String v() {
        String F4 = F();
        if (F4 == null) {
            return "empty";
        }
        try {
            return new BufferedReader(new FileReader(F4 + "name")).readLine();
        } catch (Throwable unused) {
            return "exception";
        }
    }

    public String w() {
        String F4 = F();
        if (F4 == null) {
            return "empty";
        }
        try {
            return new BufferedReader(new FileReader(F4 + "serial")).readLine();
        } catch (Throwable th) {
            com.datavisor.vangogh.util.f.a(th);
            return "exception";
        }
    }

    public String x() {
        try {
            String a5 = l0.a(Build.BOARD + Build.BRAND + Build.CPU_ABI + Build.DEVICE + Build.DISPLAY + Build.HOST + Build.ID + Build.MANUFACTURER + Build.MODEL + Build.PRODUCT + Build.TAGS + Build.TYPE + Build.USER);
            return com.datavisor.vangogh.util.h.a(a5) ? "empty" : a5;
        } catch (Throwable th) {
            com.datavisor.vangogh.util.f.a(th);
            return "exception";
        }
    }

    public String y() {
        try {
            return SystemClock.elapsedRealtime() + "";
        } catch (Throwable th) {
            com.datavisor.vangogh.util.f.a(th);
            return "exception";
        }
    }

    public String z() {
        try {
            return "" + (System.currentTimeMillis() - SystemClock.elapsedRealtime());
        } catch (Throwable th) {
            com.datavisor.vangogh.util.f.a(th);
            return "exception";
        }
    }

    public String A(Context context) {
        List<InputMethodInfo> inputMethodList;
        try {
            JSONArray jSONArray = new JSONArray();
            JSONArray jSONArray2 = new JSONArray();
            InputMethodManager inputMethodManager = (InputMethodManager) context.getSystemService("input_method");
            Object obj = "empty";
            if (inputMethodManager != null && (inputMethodList = inputMethodManager.getInputMethodList()) != null) {
                for (int i5 = 0; i5 < inputMethodList.size(); i5++) {
                    InputMethodInfo inputMethodInfo = inputMethodList.get(i5);
                    String packageName = inputMethodInfo.getPackageName();
                    String charSequence = inputMethodInfo.loadLabel(context.getPackageManager()).toString();
                    if (com.datavisor.vangogh.util.h.b(packageName)) {
                        if (com.datavisor.vangogh.util.h.a(charSequence)) {
                            charSequence = "empty";
                        }
                        JSONArray jSONArray3 = new JSONArray();
                        jSONArray3.put(packageName);
                        jSONArray3.put(charSequence);
                        jSONArray2.put(jSONArray3);
                    }
                }
            }
            String string = Settings.Secure.getString(context.getContentResolver(), "enabled_input_methods");
            if (com.datavisor.vangogh.util.h.a(string)) {
                string = "empty";
            }
            String string2 = Settings.Secure.getString(context.getContentResolver(), "default_input_method");
            if (!com.datavisor.vangogh.util.h.a(string2)) {
                obj = string2;
            }
            jSONArray.put(jSONArray2);
            jSONArray.put(string);
            jSONArray.put(obj);
            return jSONArray.toString();
        } catch (Throwable th) {
            com.datavisor.vangogh.util.f.a(th);
            return "exception";
        }
    }

    public String B(Context context) {
        if (b(context, "android.permission.ACCESS_WIFI_STATE")) {
            com.datavisor.vangogh.util.f.a(f8252f, "no permission ACCESS_WIFI_STATE");
            return "no_permission";
        }
        if (context == null) {
            com.datavisor.vangogh.util.f.a(f8252f, "context is null");
            return "para_err";
        }
        try {
            String macAddress = ((WifiManager) context.getSystemService("wifi")).getConnectionInfo().getMacAddress();
            return (com.datavisor.vangogh.util.h.a(macAddress) || macAddress.equals("02:00:00:00:00:00")) ? "empty" : macAddress.equals("00:00:00:00:00:00") ? "empty" : macAddress;
        } catch (Throwable unused) {
            return "exception";
        }
    }

    public String C(Context context) {
        if (b(context, "android.permission.ACCESS_WIFI_STATE")) {
            com.datavisor.vangogh.util.f.a(f8252f, "no permission ACCESS_WIFI_STATE");
            return "no_permission";
        }
        if (context == null) {
            com.datavisor.vangogh.util.f.a(f8252f, "context is null");
            return "para_err";
        }
        try {
            String macAddress = ((WifiManager) context.getSystemService("wifi")).getConnectionInfo().getMacAddress();
            if (!com.datavisor.vangogh.util.h.a(macAddress) && !macAddress.equals("02:00:00:00:00:00") && !macAddress.equals("00:00:00:00:00:00")) {
                return macAddress;
            }
            return a(context, "wlan0");
        } catch (Throwable unused) {
            com.datavisor.vangogh.util.f.a(f8252f, "throw Exce");
            return "exception";
        }
    }

    public String D(Context context) {
        try {
            return b(context) == 0 ? f0(context) : "empty";
        } catch (Throwable th) {
            com.datavisor.vangogh.util.f.a(th);
            return "exception";
        }
    }

    public String E(Context context) {
        try {
            return b(context) == 1 ? f0(context) : "empty";
        } catch (Throwable th) {
            com.datavisor.vangogh.util.f.a(th);
            return "exception";
        }
    }

    public String F(Context context) {
        if (b(context, "android.permission.READ_PHONE_STATE")) {
            com.datavisor.vangogh.util.f.a(f8252f, "no permission READ_PHONE_STATE");
            return "no_permission";
        }
        try {
            TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService("phone");
            String str = (String) telephonyManager.getClass().getMethod("getDeviceId", Integer.TYPE).invoke(telephonyManager, 2);
            return a(str) ? "empty" : str;
        } catch (Throwable th) {
            com.datavisor.vangogh.util.f.a(th);
            return "exception";
        }
    }

    public String a() {
        try {
            long freeSpace = Environment.getDataDirectory().getFreeSpace();
            if (freeSpace == 0) {
                return "default";
            }
            return freeSpace + "";
        } catch (Throwable th) {
            com.datavisor.vangogh.util.f.a(th);
            return "exception";
        }
    }

    public String c() {
        return Build.VERSION.RELEASE;
    }

    public String d() {
        return Build.CPU_ABI;
    }

    public String e(Context context) {
        try {
            Map<String, Integer> a5 = m0.a();
            if (a5 == null) {
                return "empty";
            }
            return "" + a5.get("userid").intValue();
        } catch (Throwable unused) {
            return "exception";
        }
    }

    public String f(Context context) {
        try {
            String b5 = l0.b(context.getPackageManager().getPackageInfo(context.getPackageName(), 64).signatures[0].toByteArray());
            return com.datavisor.vangogh.util.h.a(b5) ? "empty" : b5;
        } catch (Throwable unused) {
            return "exception";
        }
    }

    public String g(Context context) {
        try {
            return "" + ((Double) Class.forName("com.android.internal.os.PowerProfile").getMethod("getBatteryCapacity", new Class[0]).invoke(Class.forName("com.android.internal.os.PowerProfile").getConstructor(Context.class).newInstance(context), new Object[0])).doubleValue();
        } catch (Throwable unused) {
            return "exception";
        }
    }

    public synchronized String h(Context context) {
        try {
            int intProperty = ((BatteryManager) context.getSystemService("batterymanager")).getIntProperty(4);
            if (intProperty == 0) {
                if (context.getApplicationInfo().targetSdkVersion < 28) {
                    return "not_supported";
                }
                return intProperty + "";
            }
            if (Integer.MIN_VALUE == intProperty) {
                return "not_supported";
            }
            return intProperty + "";
        } catch (Throwable th) {
            com.datavisor.vangogh.util.f.a(th);
            return "exception";
        }
    }

    public synchronized String i(Context context) {
        try {
            if (Build.VERSION.SDK_INT < 26) {
                return "empty";
            }
            return ((BatteryManager) context.getSystemService("batterymanager")).getIntProperty(6) + "";
        } catch (Throwable th) {
            com.datavisor.vangogh.util.f.a(th);
            return "exception";
        }
    }

    public String j(Context context) {
        try {
            Intent registerReceiver = context.registerReceiver(null, new IntentFilter("android.intent.action.BATTERY_CHANGED"));
            if (registerReceiver == null) {
                return "empty";
            }
            int intExtra = registerReceiver.getIntExtra("voltage", -10000);
            if (intExtra == -10000) {
                return "default";
            }
            return "" + intExtra;
        } catch (Throwable unused) {
            return "exception";
        }
    }

    public java.lang.String k(android.content.Context r6) {
        throw new UnsupportedOperationException("Method not decompiled: com.datavisorobfus.i.k(android.content.Context):java.lang.String");
    }

    public String l(Context context) {
        if (context == null) {
            return "empty";
        }
        try {
            return Settings.System.getInt(context.getContentResolver(), "screen_brightness") + "";
        } catch (Throwable th) {
            com.datavisor.vangogh.util.f.a(th);
            return "exception";
        }
    }

    public String m(Context context) {
        try {
            boolean b5 = o.a(context).b("uuid10");
            if (Build.VERSION.SDK_INT < 29 || !b5) {
                return "empty";
            }
            String absolutePath = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_MUSIC).getAbsolutePath(), "au_uu_SzH34yR2.mp3").getAbsolutePath();
            String a5 = com.datavisor.vangogh.storage.local.a.a(context, "au_uu_SzH34yR2");
            if (!com.datavisor.vangogh.util.h.a(a5)) {
                return crypto.geti(absolutePath) + "_" + a5;
            }
            if (com.datavisor.vangogh.util.e.a(absolutePath)) {
                return "empty";
            }
            String uuid = UUID.randomUUID().toString();
            if (!com.datavisor.vangogh.storage.local.a.a(context, "au_uu_SzH34yR2", uuid)) {
                return "empty";
            }
            return crypto.geti(absolutePath) + "_" + uuid;
        } catch (Throwable th) {
            com.datavisor.vangogh.util.f.a(th);
            return "exception";
        }
    }

    public String n(Context context) {
        try {
            String a5 = com.datavisor.vangogh.storage.local.b.a(".__psek.sys");
            if (com.datavisor.vangogh.util.h.a(a5)) {
                a5 = k0.e(context, "DVSPSEQ");
            }
            String str = ((com.datavisor.vangogh.util.h.b(a5) ? Integer.parseInt(a5) : 0) + 1) + "";
            com.datavisor.vangogh.storage.local.b.a(".__psek.sys", str);
            k0.a(context, "DVSPSEQ", str);
            return str;
        } catch (Throwable th) {
            com.datavisor.vangogh.util.f.a(th);
            return "exception";
        }
    }

    public synchronized String o(Context context) {
        String str;
        try {
            String a5 = com.datavisor.vangogh.storage.local.b.a(".__puuk.sys");
            String e5 = k0.e(context, "DVSPUUID");
            str = "";
            if (com.datavisor.vangogh.util.h.b(a5)) {
                str = a5;
            } else if (com.datavisor.vangogh.util.h.b(e5)) {
                str = e5;
            }
            if (com.datavisor.vangogh.util.h.a(str)) {
                str = UUID.randomUUID().toString();
            }
            if (com.datavisor.vangogh.util.h.a(a5)) {
                com.datavisor.vangogh.storage.local.b.a(".__puuk.sys", str);
            }
            if (com.datavisor.vangogh.util.h.a(e5)) {
                k0.a(context, "DVSPUUID", str);
            }
        } catch (Throwable th) {
            com.datavisor.vangogh.util.f.a(th);
            return "exception";
        }
        return str;
    }

    public String p(Context context) {
        return "empty";
    }

    public String q(Context context) {
        try {
            String a5 = com.datavisor.vangogh.storage.local.b.a(".__pfrk.sys");
            String e5 = k0.e(context, "DVSPFIRSTREPORTTIME");
            String str = com.datavisor.vangogh.util.h.b(a5) ? a5 : com.datavisor.vangogh.util.h.b(e5) ? e5 : "";
            if (com.datavisor.vangogh.util.h.a(str)) {
                str = System.currentTimeMillis() + "";
            }
            if (com.datavisor.vangogh.util.h.a(a5)) {
                com.datavisor.vangogh.storage.local.b.a(".__pfrk.sys", str);
            }
            if (com.datavisor.vangogh.util.h.a(e5)) {
                k0.a(context, "DVSPFIRSTREPORTTIME", str);
            }
            return str;
        } catch (Throwable th) {
            com.datavisor.vangogh.util.f.a(th);
            return "exception";
        }
    }

    public String r(Context context) {
        String optString;
        try {
            String d5 = k0.d(context, "DVSPOPENGL");
            if (com.datavisor.vangogh.util.h.b(d5)) {
                return d5;
            }
            Activity D4 = D();
            if (D4 == null) {
                return "empty";
            }
            JSONObject jSONObject = new JSONObject();
            View decorView = D4.getWindow().getDecorView();
            GLSurfaceView gLSurfaceView = new GLSurfaceView(D4);
            e eVar = new e(jSONObject, context, decorView, gLSurfaceView);
            gLSurfaceView.setEGLContextClientVersion(1);
            gLSurfaceView.setEGLConfigChooser(8, 8, 8, 8, 0, 0);
            gLSurfaceView.setRenderer(eVar);
            FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(1, 1);
            layoutParams.height = 1;
            layoutParams.width = 1;
            gLSurfaceView.setLayoutParams(layoutParams);
            new Handler(context.getMainLooper()).post(new f(this, decorView, gLSurfaceView));
            synchronized (this.f8253a) {
                try {
                    this.f8253a.wait(500L);
                } finally {
                    optString = jSONObject.optString("vendor");
                    String optString2 = jSONObject.optString("renderer");
                    return !com.datavisor.vangogh.util.h.b(optString) ? "empty" : "empty";
                }
            }
            optString = jSONObject.optString("vendor");
            String optString22 = jSONObject.optString("renderer");
            if (!com.datavisor.vangogh.util.h.b(optString) && com.datavisor.vangogh.util.h.b(optString22)) {
                String str = optString + "~" + optString22;
                k0.b(context, "DVSPOPENGL", str);
                return str;
            }
        } catch (Throwable unused) {
            return "exception";
        }
    }

    public synchronized String s(Context context) {
        String[] strArr;
        strArr = new String[]{"empty"};
        boolean[] zArr = {false};
        r.a(context, new h(strArr, zArr));
        synchronized (this.f8256d) {
            try {
                if (!zArr[0]) {
                    try {
                        this.f8256d.wait(50L);
                    } catch (Throwable th) {
                        com.datavisor.vangogh.util.f.a(th);
                    }
                }
            } catch (Throwable th2) {
                throw th2;
            }
        }
        com.datavisor.vangogh.util.f.a("getGoogleAdsId getGoogleAdsId getGoogleAdsId getGoogleAdsId:       " + strArr[0]);
        return strArr[0];
    }

    public String t(Context context) {
        try {
            KeyguardManager keyguardManager = (KeyguardManager) context.getSystemService("keyguard");
            return keyguardManager != null ? keyguardManager.isKeyguardSecure() ? "1" : "0" : "empty";
        } catch (Throwable th) {
            com.datavisor.vangogh.util.f.a(th);
            return "exception";
        }
    }

    public String u(Context context) {
        String str;
        if (b(context, "android.permission.READ_PHONE_STATE")) {
            com.datavisor.vangogh.util.f.a(f8252f, "no permission READ_PHONE_STATE");
            return "no_permission";
        }
        if (context == null) {
            com.datavisor.vangogh.util.f.a(f8252f, "context is null");
            return "para_err";
        }
        try {
            TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService("phone");
            str = telephonyManager != null ? telephonyManager.getDeviceId() : "default";
        } catch (Throwable th) {
            com.datavisor.vangogh.util.f.a(th);
            str = "exception";
        }
        return com.datavisor.vangogh.util.h.a(str) ? "empty" : str;
    }

    public String v(Context context) {
        if (b(context, "android.permission.READ_PHONE_STATE")) {
            com.datavisor.vangogh.util.f.a(f8252f, "no permission READ_PHONE_STATE");
            return "no_permission";
        }
        try {
            TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService("phone");
            String str = (String) telephonyManager.getClass().getMethod("getDeviceId", Integer.TYPE).invoke(telephonyManager, 1);
            return a(str) ? "empty" : str;
        } catch (Throwable th) {
            com.datavisor.vangogh.util.f.a(th);
            return "exception";
        }
    }

    public String w(Context context) {
        String str;
        if (b(context, "android.permission.READ_PHONE_STATE")) {
            com.datavisor.vangogh.util.f.a(f8252f, "no permission READ_PHONE_STATE");
            return "no_permission";
        }
        if (context == null) {
            com.datavisor.vangogh.util.f.a(f8252f, "context is null");
            return "para_err";
        }
        try {
            TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService("phone");
            str = telephonyManager != null ? telephonyManager.getSubscriberId() : "default";
        } catch (Throwable th) {
            com.datavisor.vangogh.util.f.a(th);
            str = "exception";
        }
        return com.datavisor.vangogh.util.h.a(str) ? "empty" : str;
    }

    public String x(Context context) {
        String string;
        if (context == null) {
            com.datavisor.vangogh.util.f.a("testMockLocation context is null");
            return "para_err";
        }
        try {
            if (Settings.Secure.getInt(context.getContentResolver(), "location_mode") != 0 && (string = Settings.Secure.getString(context.getContentResolver(), "location_providers_allowed")) != null) {
                if (string.length() == 0) {
                    return "1";
                }
            }
        } catch (Throwable th) {
            com.datavisor.vangogh.util.f.a(th);
        }
        return "0";
    }

    public String y(Context context) {
        try {
            return Settings.Secure.getInt(context.getContentResolver(), "adb_enabled", 0) > 0 ? "1" : "0";
        } catch (Throwable th) {
            com.datavisor.vangogh.util.f.a(th);
            return "exception";
        }
    }

    public String z(Context context) {
        try {
            return (context.getResources().getConfiguration().screenLayout & 15) >= 3 ? "1" : "0";
        } catch (Throwable th) {
            com.datavisor.vangogh.util.f.a(th);
            return "exception";
        }
    }

    private String a(BluetoothAdapter bluetoothAdapter) {
        Object obj;
        try {
            Field declaredField = BluetoothAdapter.class.getDeclaredField("mService");
            declaredField.setAccessible(true);
            obj = declaredField.get(bluetoothAdapter);
        } catch (Throwable unused) {
        }
        if (obj == null) {
            return null;
        }
        Method declaredMethod = obj.getClass().getDeclaredMethod("getAddress", new Class[0]);
        declaredMethod.setAccessible(true);
        Object invoke = declaredMethod.invoke(obj, new Object[0]);
        if (invoke != null && (invoke instanceof String)) {
            return (String) invoke;
        }
        return null;
    }

    public String b() {
        try {
            long totalSpace = Environment.getDataDirectory().getTotalSpace();
            if (totalSpace == 0) {
                return "default";
            }
            return "" + totalSpace;
        } catch (Throwable th) {
            com.datavisor.vangogh.util.f.a(th);
            return "exception";
        }
    }

    public String c(Context context) {
        try {
            if (context == null) {
                com.datavisor.vangogh.util.f.a("context is null");
                return "para_err";
            }
            AccessibilityManager accessibilityManager = (AccessibilityManager) context.getSystemService("accessibility");
            boolean isEnabled = accessibilityManager != null ? accessibilityManager.isEnabled() : false;
            String string = Settings.Secure.getString(context.getContentResolver(), "enabled_accessibility_services");
            if (string == null) {
                string = "";
            }
            try {
                JSONObject jSONObject = new JSONObject();
                jSONObject.put("on", isEnabled);
                jSONObject.put("value", string);
                return jSONObject.toString();
            } catch (Throwable th) {
                com.datavisor.vangogh.util.f.a(th);
                return "empty";
            }
        } catch (Throwable th2) {
            com.datavisor.vangogh.util.f.a(th2);
            return "exception";
        }
    }

    public String d(Context context) {
        if (context == null) {
            com.datavisor.vangogh.util.f.a(f8252f, "context is null");
            return "para_err";
        }
        try {
            String string = Settings.Secure.getString(context.getContentResolver(), "android_id");
            if (!com.datavisor.vangogh.util.h.a(string)) {
                return string;
            }
            com.datavisor.vangogh.util.f.a(f8252f, "androidId is null");
            return "empty";
        } catch (Throwable th) {
            com.datavisor.vangogh.util.f.a(th);
            return "exception";
        }
    }

    public static boolean b(Context context, String str) {
        return !c(context, str);
    }

    public static boolean c(Context context, String str) {
        try {
            return context.getPackageManager().checkPermission(str, context.getPackageName()) == 0;
        } catch (Throwable unused) {
            return false;
        }
    }

    public String a(Context context) {
        boolean z4;
        ConnectivityManager connectivityManager;
        NetworkInfo networkInfo;
        if (b(context, "android.permission.INTERNET")) {
            com.datavisor.vangogh.util.f.a(f8252f, "no permission INTERNET");
            return "no_permission";
        }
        boolean z5 = false;
        try {
            Enumeration<NetworkInterface> networkInterfaces = NetworkInterface.getNetworkInterfaces();
            if (networkInterfaces != null) {
                Iterator it = Collections.list(networkInterfaces).iterator();
                z4 = false;
                while (it.hasNext()) {
                    try {
                        NetworkInterface networkInterface = (NetworkInterface) it.next();
                        if (networkInterface.isUp() && networkInterface.getInterfaceAddresses().size() != 0 && ("tun0".equals(networkInterface.getName()) || "ppp0".equals(networkInterface.getName()) || "tap0".equals(networkInterface.getName()) || "ppp".equals(networkInterface.getName()) || "tun".equals(networkInterface.getName()) || "tap".equals(networkInterface.getName()))) {
                            z4 = true;
                        }
                    } catch (Throwable th) {
                        th = th;
                        com.datavisor.vangogh.util.f.a(th);
                        connectivityManager = (ConnectivityManager) context.getSystemService("connectivity");
                        if (connectivityManager != null) {
                            z5 = networkInfo.isConnectedOrConnecting();
                        }
                        if (z4) {
                        }
                    }
                }
            } else {
                z4 = false;
            }
        } catch (Throwable th2) {
            th = th2;
            z4 = false;
        }
        try {
            connectivityManager = (ConnectivityManager) context.getSystemService("connectivity");
            if (connectivityManager != null && (networkInfo = connectivityManager.getNetworkInfo(17)) != null) {
                z5 = networkInfo.isConnectedOrConnecting();
            }
        } catch (Throwable th3) {
            com.datavisor.vangogh.util.f.a(th3);
        }
        return (!z4 || z5) ? "1" : "0";
    }

    public java.lang.String a(android.content.Context r8, java.lang.String r9) {
        throw new UnsupportedOperationException("Method not decompiled: com.datavisorobfus.i.a(android.content.Context, java.lang.String):java.lang.String");
    }

    private boolean a(String str) {
        if (str != null) {
            if (!str.equals("") && !str.contains("unknown") && !str.contains("null") && !str.contains("nil") && !str.toLowerCase().contains("0123456789abcdef")) {
                int i5 = 0;
                int i6 = 0;
                while (i5 <= str.length() - 1) {
                    int i7 = i5 + 1;
                    if (str.substring(i5, i7).equals("0") && (i6 = i6 + 1) > str.length() / 2) {
                        return true;
                    }
                    i5 = i7;
                }
                return false;
            }
            return true;
        }
        return true;
    }
}