导航菜单

页面标题

页面副标题

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

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

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


package f1;

import K3.u;
import Q3.p;
import Q3.q;
import android.app.ActivityManager;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.media.MediaDrm;
import android.net.ConnectivityManager;
import android.net.Network;
import android.net.NetworkCapabilities;
import android.net.NetworkInfo;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
import android.os.Build;
import android.os.SystemClock;
import android.provider.Settings;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
import android.util.Log;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.InetAddress;
import java.net.NetworkInterface;
import java.net.SocketException;
import java.net.URL;
import java.net.URLConnection;
import java.security.MessageDigest;
import java.util.Arrays;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.UUID;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import x3.r;

public final class l {

    public static final a f9333b = new a(null);

    private static final String f9334c = "javaClass";

    private final Context f9335a;

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

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

    static final class b extends K3.l implements J3.l {

        final J3.l f9337c;

        b(J3.l lVar) {
            super(1);
            this.f9337c = lVar;
        }

        public final void a(String str) {
            K3.k.e(str, "gaid");
            HashMap hashMap = new HashMap();
            hashMap.put("IMEI", l.this.T());
            hashMap.put("MEID", l.this.X());
            hashMap.put("IMSI", l.this.U());
            hashMap.put("ICCID", l.this.S());
            hashMap.put("SN", l.this.d0());
            hashMap.put("AndroidId", l.this.F());
            hashMap.put("serialNumber", l.this.e0());
            hashMap.put("simOperator", l.this.f0());
            hashMap.put("networkType", l.this.c0());
            hashMap.put("dataNetworkType", l.this.L());
            hashMap.put("isRoot", l.this.k0());
            hashMap.put("macAddress", l.this.Y());
            hashMap.put("devicePublicIp", l.this.O());
            hashMap.put("systemLanguage", l.this.W());
            hashMap.put("systemVersion", l.this.i0());
            hashMap.put("deviceModel", l.this.b0());
            hashMap.put("deviceMaker", l.this.M());
            hashMap.put("deviceBrand", l.this.I());
            hashMap.put("deviceBoard", l.this.H());
            hashMap.put("deviceManufacturer", l.this.Z());
            String[] K4 = l.this.K();
            hashMap.put("wifiInfo", K4[0]);
            hashMap.put("wifiMacAddress", K4[1]);
            hashMap.put("availableMemory", l.this.G());
            hashMap.put("totalMemory", l.this.g0());
            hashMap.put("clipBoard", l.this.J());
            hashMap.put("GAID", str);
            hashMap.put("factoryTime", l.this.P());
            hashMap.put("turnOnTime", l.this.h0());
            hashMap.put("mediaDrmId", l.this.a0());
            hashMap.put("ipAddress", l.this.V());
            Log.i(l.f9334c, "getDeviceInfo: " + hashMap);
            this.f9337c.h(hashMap);
        }

        @Override
        public Object h(Object obj) {
            a((String) obj);
            return r.f13648a;
        }
    }

    public l(Context context) {
        K3.k.e(context, "context");
        this.f9335a = context;
    }

    private final String D(byte[] bArr) {
        char[] charArray = "0123456789ABCDEF".toCharArray();
        K3.k.d(charArray, "toCharArray(...)");
        char[] cArr = new char[bArr.length * 2];
        int length = bArr.length;
        for (int i5 = 0; i5 < length; i5++) {
            byte b5 = bArr[i5];
            int i6 = i5 * 2;
            cArr[i6] = charArray[(b5 & 255) >>> 4];
            cArr[i6 + 1] = charArray[b5 & 15];
        }
        return new String(cArr);
    }

    public final String F() {
        return E(this.f9335a);
    }

    public final String G() {
        Object systemService = this.f9335a.getSystemService("activity");
        K3.k.c(systemService, "null cannot be cast to non-null type android.app.ActivityManager");
        ActivityManager.MemoryInfo memoryInfo = new ActivityManager.MemoryInfo();
        ((ActivityManager) systemService).getMemoryInfo(memoryInfo);
        return String.valueOf(memoryInfo.availMem);
    }

    public final String H() {
        String str = Build.BOARD;
        K3.k.d(str, "BOARD");
        return str;
    }

    public final String I() {
        String str = Build.BRAND;
        K3.k.d(str, "BRAND");
        return str;
    }

    public final String J() {
        ClipData.Item itemAt;
        try {
            Object systemService = this.f9335a.getSystemService("clipboard");
            K3.k.c(systemService, "null cannot be cast to non-null type android.content.ClipboardManager");
            ClipData primaryClip = ((ClipboardManager) systemService).getPrimaryClip();
            if (primaryClip == null || primaryClip.getItemCount() <= 0 || (itemAt = primaryClip.getItemAt(0)) == null) {
                return "";
            }
            String obj = itemAt.getText().toString();
            if (obj.length() < 512) {
                return obj;
            }
            String substring = obj.substring(0, 512);
            K3.k.d(substring, "substring(...)");
            return substring;
        } catch (Exception e5) {
            e5.printStackTrace();
            return "";
        }
    }

    public final String[] K() {
        String g5;
        String g6;
        String g7;
        String g8;
        String[] strArr = {"err", "err"};
        try {
            Object systemService = this.f9335a.getApplicationContext().getSystemService("wifi");
            K3.k.c(systemService, "null cannot be cast to non-null type android.net.wifi.WifiManager");
            WifiManager wifiManager = (WifiManager) systemService;
            if (wifiManager.isWifiEnabled()) {
                WifiInfo connectionInfo = wifiManager.getConnectionInfo();
                String ssid = connectionInfo.getSSID();
                K3.k.d(ssid, "wifiInfo.ssid");
                g5 = p.g(ssid, "\"", "", false, 4, null);
                g6 = p.g(g5, "\"", "", false, 4, null);
                strArr[0] = g6;
                String bssid = connectionInfo.getBSSID();
                K3.k.d(bssid, "wifiInfo.bssid");
                g7 = p.g(bssid, "\"", "", false, 4, null);
                g8 = p.g(g7, "\"", "", false, 4, null);
                strArr[1] = g8;
                if (K3.k.a("02:00:00:00:00:00", g8)) {
                    strArr[1] = Y();
                }
            }
        } catch (Exception e5) {
            e5.printStackTrace();
        }
        Log.d(f9334c, "getConnectWifiInfo:" + strArr[0] + ',' + strArr[1]);
        return strArr;
    }

    public final String L() {
        int dataNetworkType;
        if (androidx.core.content.a.a(this.f9335a, "android.permission.ACCESS_NETWORK_STATE") != 0) {
            return "";
        }
        try {
            Object systemService = this.f9335a.getSystemService("phone");
            K3.k.c(systemService, "null cannot be cast to non-null type android.telephony.TelephonyManager");
            TelephonyManager telephonyManager = (TelephonyManager) systemService;
            if (Build.VERSION.SDK_INT < 24) {
                return "";
            }
            dataNetworkType = telephonyManager.getDataNetworkType();
            switch (dataNetworkType) {
            }
            return "";
        } catch (Exception e5) {
            e5.printStackTrace();
            return "";
        }
    }

    public final String M() {
        String str = Build.DEVICE;
        K3.k.d(str, "DEVICE");
        return str;
    }

    public final String O() {
        try {
            URLConnection openConnection = new URL("https://pv.sohu.com/cityjson?ie=utf-8").openConnection();
            K3.k.c(openConnection, "null cannot be cast to non-null type java.net.HttpURLConnection");
            HttpURLConnection httpURLConnection = (HttpURLConnection) openConnection;
            httpURLConnection.setConnectTimeout(5000);
            httpURLConnection.setReadTimeout(5000);
            httpURLConnection.setRequestMethod("GET");
            httpURLConnection.connect();
            if (httpURLConnection.getResponseCode() == 200) {
                BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(httpURLConnection.getInputStream(), "UTF-8"));
                StringBuilder sb = new StringBuilder();
                while (true) {
                    String readLine = bufferedReader.readLine();
                    if (readLine == null) {
                        break;
                    }
                    sb.append(readLine);
                }
                bufferedReader.close();
                Matcher matcher = Pattern.compile("((?:(?:25[0-5]|2[0-4]\\d|((1\\d{2})|([1-9]?\\d)))\\.){3}(?:25[0-5]|2[0-4]\\d|((1\\d{2})|([1-9]?\\d))))").matcher(sb.toString());
                if (matcher.find()) {
                    String group = matcher.group();
                    K3.k.d(group, "matcher.group()");
                    return group;
                }
            }
        } catch (Exception e5) {
            Log.e(f9334c, "Error while getting public IP address: " + e5.getMessage());
        }
        return "err";
    }

    public final String P() {
        List H4;
        String g5;
        boolean l4;
        boolean l5;
        StringBuilder sb = new StringBuilder();
        try {
            InputStream inputStream = new ProcessBuilder((String[]) Arrays.copyOf(new String[]{"/system/bin/stat", "/cache"}, 2)).start().getInputStream();
            byte[] bArr = new byte[24];
            while (inputStream.read(bArr) != -1) {
                sb.append(new String(bArr, Q3.c.f2245b));
            }
            inputStream.close();
        } catch (Exception unused) {
            System.out.println((Object) "SystemTest Exception happen to get factory time");
        }
        String sb2 = sb.toString();
        K3.k.d(sb2, "result.toString()");
        H4 = q.H(sb2, new String[]{"\n"}, false, 0, 6, null);
        String[] strArr = (String[]) H4.toArray(new String[0]);
        StringBuilder sb3 = new StringBuilder();
        for (String str : strArr) {
            l4 = q.l(str, "Access:", false, 2, null);
            if (l4) {
                l5 = q.l(str, "Uid:", false, 2, null);
                if (!l5) {
                    char[] charArray = str.toCharArray();
                    K3.k.d(charArray, "toCharArray(...)");
                    for (char c5 : charArray) {
                        if (Character.isDigit(c5)) {
                            sb3.append(c5);
                        }
                    }
                }
            }
        }
        if (K3.k.a(sb3.toString(), "19700101080000000000000")) {
            return "";
        }
        String sb4 = sb3.toString();
        K3.k.d(sb4, "time.toString()");
        g5 = p.g(sb4, "000000000", "", false, 4, null);
        return g5;
    }

    private final void Q(final J3.l lVar) {
        new Thread(new Runnable() {
            @Override
            public final void run() {
                l.R(l.this, lVar);
            }
        }).start();
    }

    public static final void R(f1.l r1, J3.l r2) {
        throw new UnsupportedOperationException("Method not decompiled: f1.l.R(f1.l, J3.l):void");
    }

    public final String S() {
        try {
            if (androidx.core.content.a.a(this.f9335a, "android.permission.READ_PHONE_STATE") != 0) {
                return "permission error";
            }
            Object systemService = this.f9335a.getSystemService("phone");
            K3.k.c(systemService, "null cannot be cast to non-null type android.telephony.TelephonyManager");
            String simSerialNumber = ((TelephonyManager) systemService).getSimSerialNumber();
            K3.k.d(simSerialNumber, "{\n                val te…erialNumber\n            }");
            return simSerialNumber;
        } catch (Exception e5) {
            e5.printStackTrace();
            return "";
        }
    }

    public final String T() {
        try {
            if (androidx.core.content.a.a(this.f9335a, "android.permission.READ_PHONE_STATE") != 0) {
                return "permission error";
            }
            Object systemService = this.f9335a.getSystemService("phone");
            K3.k.c(systemService, "null cannot be cast to non-null type android.telephony.TelephonyManager");
            TelephonyManager telephonyManager = (TelephonyManager) systemService;
            String imei = Build.VERSION.SDK_INT >= 26 ? telephonyManager.getImei() : telephonyManager.getDeviceId();
            K3.k.d(imei, "{\n                val te…          }\n            }");
            return imei;
        } catch (Exception e5) {
            e5.printStackTrace();
            return "err";
        }
    }

    public final String U() {
        try {
            if (androidx.core.content.a.a(this.f9335a, "android.permission.READ_PHONE_STATE") != 0) {
                return "permission error";
            }
            Object systemService = this.f9335a.getSystemService("phone");
            K3.k.c(systemService, "null cannot be cast to non-null type android.telephony.TelephonyManager");
            String subscriberId = ((TelephonyManager) systemService).getSubscriberId();
            K3.k.d(subscriberId, "{\n                val te…ubscriberId\n            }");
            return subscriberId;
        } catch (Exception e5) {
            e5.printStackTrace();
            return "err";
        }
    }

    public final String W() {
        String language = Locale.getDefault().getLanguage();
        K3.k.d(language, "getDefault().language");
        return language;
    }

    public final String X() {
        try {
            if (androidx.core.content.a.a(this.f9335a, "android.permission.READ_PHONE_STATE") != 0) {
                return "permission error";
            }
            Object systemService = this.f9335a.getSystemService("phone");
            K3.k.c(systemService, "null cannot be cast to non-null type android.telephony.TelephonyManager");
            String meid = Build.VERSION.SDK_INT >= 26 ? ((TelephonyManager) systemService).getMeid() : "";
            K3.k.d(meid, "{\n                val te…          }\n            }");
            return meid;
        } catch (Exception e5) {
            e5.printStackTrace();
            return "err";
        }
    }

    public final String Y() {
        String str = "err";
        try {
            Enumeration<NetworkInterface> networkInterfaces = NetworkInterface.getNetworkInterfaces();
            while (networkInterfaces.hasMoreElements()) {
                byte[] hardwareAddress = networkInterfaces.nextElement().getHardwareAddress();
                if (hardwareAddress != null && hardwareAddress.length != 0) {
                    StringBuilder sb = new StringBuilder();
                    for (byte b5 : hardwareAddress) {
                        u uVar = u.f1151a;
                        String format = String.format("%02x:", Arrays.copyOf(new Object[]{Byte.valueOf(b5)}, 1));
                        K3.k.d(format, "format(...)");
                        sb.append(format);
                    }
                    if (sb.length() > 0) {
                        sb.deleteCharAt(sb.length() - 1);
                    }
                    String sb2 = sb.toString();
                    K3.k.d(sb2, "builder.toString()");
                    str = sb2;
                }
            }
        } catch (Exception e5) {
            e5.printStackTrace();
            Log.e(f9334c, "Error while getting mac address: " + e5.getMessage());
        }
        return str;
    }

    public final String Z() {
        String str = Build.MANUFACTURER;
        K3.k.d(str, "MANUFACTURER");
        return str;
    }

    public final String a0() {
        String str;
        MediaDrm mediaDrm;
        MediaDrm mediaDrm2 = null;
        MediaDrm mediaDrm3 = null;
        try {
            try {
                mediaDrm = new MediaDrm(new UUID(-1301668207276963122L, -6645017420763422227L));
            } catch (Throwable th) {
                th = th;
            }
        } catch (Exception unused) {
        }
        try {
            byte[] propertyByteArray = mediaDrm.getPropertyByteArray("deviceUniqueId");
            K3.k.d(propertyByteArray, "mediaDrm.getPropertyByte…ROPERTY_DEVICE_UNIQUE_ID)");
            MessageDigest messageDigest = MessageDigest.getInstance("SHA-256");
            messageDigest.update(propertyByteArray);
            byte[] digest = messageDigest.digest();
            K3.k.d(digest, "md.digest()");
            str = D(digest);
            int i5 = Build.VERSION.SDK_INT;
            mediaDrm.release();
            mediaDrm2 = i5;
        } catch (Exception unused2) {
            mediaDrm3 = mediaDrm;
            Log.d(f9334c, "find getWidevineId getWidevineSN.WIDEVINE is not available");
            if (Build.VERSION.SDK_INT < 28 ? mediaDrm3 != null : mediaDrm3 != null) {
                mediaDrm3.release();
            }
            str = "";
            mediaDrm2 = mediaDrm3;
            return str;
        } catch (Throwable th2) {
            th = th2;
            mediaDrm2 = mediaDrm;
            if (Build.VERSION.SDK_INT < 28 ? mediaDrm2 != null : mediaDrm2 != null) {
                mediaDrm2.release();
            }
            throw th;
        }
        return str;
    }

    public final String b0() {
        String str = Build.MODEL;
        K3.k.d(str, "MODEL");
        return str;
    }

    public final String c0() {
        Network activeNetwork;
        NetworkCapabilities networkCapabilities;
        if (Build.VERSION.SDK_INT >= 23) {
            Object systemService = this.f9335a.getSystemService("connectivity");
            K3.k.c(systemService, "null cannot be cast to non-null type android.net.ConnectivityManager");
            ConnectivityManager connectivityManager = (ConnectivityManager) systemService;
            activeNetwork = connectivityManager.getActiveNetwork();
            return (activeNetwork == null || (networkCapabilities = connectivityManager.getNetworkCapabilities(activeNetwork)) == null) ? "" : networkCapabilities.hasTransport(1) ? "WIFI" : networkCapabilities.hasTransport(0) ? "MOBILE" : "OTHER";
        }
        Object systemService2 = this.f9335a.getSystemService("connectivity");
        K3.k.c(systemService2, "null cannot be cast to non-null type android.net.ConnectivityManager");
        NetworkInfo activeNetworkInfo = ((ConnectivityManager) systemService2).getActiveNetworkInfo();
        if (activeNetworkInfo == null) {
            return "";
        }
        int type = activeNetworkInfo.getType();
        return type != 0 ? type != 1 ? "OTHER" : "WIFI" : "MOBILE";
    }

    public final String d0() {
        String str = Build.SERIAL;
        try {
            if (androidx.core.content.a.a(this.f9335a, "android.permission.READ_PHONE_STATE") != 0) {
                str = "permission error";
            } else if (Build.VERSION.SDK_INT >= 27) {
                str = Build.getSerial();
            }
        } catch (Exception e5) {
            e5.printStackTrace();
        }
        K3.k.d(str, "sn");
        return str;
    }

    public final String e0() {
        String str;
        try {
            Class<?> cls = Class.forName("android.os.SystemProperties");
            Object invoke = cls.getMethod("get", String.class).invoke(cls, "ro.serialno");
            K3.k.c(invoke, "null cannot be cast to non-null type kotlin.String");
            str = (String) invoke;
        } catch (Exception e5) {
            e5.printStackTrace();
            str = "";
        }
        if (!TextUtils.isEmpty(str)) {
            return str;
        }
        try {
            Class<?> cls2 = Class.forName("android.os.SystemProperties");
            Object invoke2 = cls2.getMethod("get", String.class).invoke(cls2, "ro.serialnocustom");
            K3.k.c(invoke2, "null cannot be cast to non-null type kotlin.String");
            return (String) invoke2;
        } catch (Exception e6) {
            e6.printStackTrace();
            return str;
        }
    }

    public final String f0() {
        if (androidx.core.content.a.a(this.f9335a, "android.permission.READ_PHONE_STATE") != 0) {
            return "";
        }
        Object systemService = this.f9335a.getSystemService("phone");
        K3.k.c(systemService, "null cannot be cast to non-null type android.telephony.TelephonyManager");
        String simOperator = ((TelephonyManager) systemService).getSimOperator();
        return simOperator == null ? "" : simOperator;
    }

    public final String g0() {
        Object systemService = this.f9335a.getSystemService("activity");
        K3.k.c(systemService, "null cannot be cast to non-null type android.app.ActivityManager");
        ActivityManager.MemoryInfo memoryInfo = new ActivityManager.MemoryInfo();
        ((ActivityManager) systemService).getMemoryInfo(memoryInfo);
        return String.valueOf(memoryInfo.totalMem);
    }

    public final String h0() {
        return (SystemClock.elapsedRealtime() / 1000) + "";
    }

    public final String i0() {
        String str = Build.VERSION.RELEASE;
        K3.k.d(str, "RELEASE");
        return str;
    }

    private final boolean j0(String str) {
        Process process = null;
        try {
            try {
                process = Runtime.getRuntime().exec("ls -l " + str);
                String readLine = new BufferedReader(new InputStreamReader(process.getInputStream())).readLine();
                if (readLine != null && readLine.length() >= 4) {
                    char charAt = readLine.charAt(3);
                    if (charAt == 's' || charAt == 'x') {
                        process.destroy();
                        return true;
                    }
                }
            } catch (IOException e5) {
                e5.printStackTrace();
                if (process == null) {
                    return false;
                }
            }
            process.destroy();
            return false;
        } catch (Throwable th) {
            if (process != null) {
                process.destroy();
            }
            throw th;
        }
    }

    public final String k0() {
        try {
            if (new File("/system/bin/su").exists() && j0("/system/bin/su")) {
                return "ROOT";
            }
            if (new File("/system/xbin/su").exists()) {
                if (j0("/system/xbin/su")) {
                    return "ROOT";
                }
            }
            return "";
        } catch (Exception e5) {
            e5.printStackTrace();
            return "err";
        }
    }

    public final String E(Context context) {
        K3.k.e(context, "context");
        try {
            String string = Settings.Secure.getString(context.getContentResolver(), "android_id");
            if (string != null) {
                if (string.length() == 0) {
                }
                Log.d(f9334c, "find android id:" + string);
                K3.k.d(string, "androidId");
                return string;
            }
            string = Settings.System.getString(context.getContentResolver(), "android_id");
            Log.d(f9334c, "find android id:" + string);
            K3.k.d(string, "androidId");
            return string;
        } catch (Exception e5) {
            e5.printStackTrace();
            return "err";
        }
    }

    public final void N(J3.l lVar) {
        K3.k.e(lVar, "onResult");
        Q(new b(lVar));
    }

    public final String V() {
        Enumeration<NetworkInterface> enumeration;
        try {
            enumeration = NetworkInterface.getNetworkInterfaces();
        } catch (SocketException e5) {
            System.out.println((Object) ("SystemTest Create NetworkInterface occur Exception e" + e5.getMessage()));
            enumeration = null;
        }
        if (enumeration != null) {
            while (enumeration.hasMoreElements()) {
                Enumeration<InetAddress> inetAddresses = enumeration.nextElement().getInetAddresses();
                while (inetAddresses.hasMoreElements()) {
                    InetAddress nextElement = inetAddresses.nextElement();
                    if (!nextElement.isLoopbackAddress() && !nextElement.isAnyLocalAddress() && !nextElement.isLinkLocalAddress()) {
                        String hostAddress = nextElement.getHostAddress();
                        K3.k.d(hostAddress, "inetAddress.hostAddress");
                        Locale locale = Locale.US;
                        K3.k.d(locale, "US");
                        String upperCase = hostAddress.toUpperCase(locale);
                        K3.k.d(upperCase, "toUpperCase(...)");
                        return upperCase;
                    }
                }
            }
        }
        try {
            Object systemService = this.f9335a.getApplicationContext().getSystemService("wifi");
            K3.k.c(systemService, "null cannot be cast to non-null type android.net.wifi.WifiManager");
            int ipAddress = ((WifiManager) systemService).getConnectionInfo().getIpAddress();
            u uVar = u.f1151a;
            String format = String.format(Locale.getDefault(), "%d.%d.%d.%d", Arrays.copyOf(new Object[]{Integer.valueOf(ipAddress & 255), Integer.valueOf((ipAddress >> 8) & 255), Integer.valueOf((ipAddress >> 16) & 255), Integer.valueOf((ipAddress >> 24) & 255)}, 4));
            K3.k.d(format, "format(...)");
            return format;
        } catch (Exception e6) {
            System.out.println((Object) ("SystemTest Get IP address from wifi manager exception " + e6.getMessage()));
            return "";
        }
    }
}