导航菜单

页面标题

页面副标题

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

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

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


package com.datavisorobfus;

import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.wifi.WifiManager;
import com.datavisor.vangogh.bridge.crypto;
import com.datavisor.vangogh.bridge.storage;
import java.net.Inet4Address;
import java.net.Inet6Address;
import java.net.InetAddress;
import java.net.InterfaceAddress;
import java.net.NetworkInterface;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Enumeration;
import java.util.Iterator;
import org.json.JSONArray;

public class k {

    private static k f8292a = new k();

    public static k d() {
        return f8292a;
    }

    public String a() {
        String str;
        try {
            JSONArray jSONArray = new JSONArray();
            ArrayList<NetworkInterface> list = Collections.list(NetworkInterface.getNetworkInterfaces());
            if (list != null) {
                for (NetworkInterface networkInterface : list) {
                    if (networkInterface != null && com.datavisor.vangogh.util.h.b(networkInterface.getName())) {
                        byte[] hardwareAddress = networkInterface.getHardwareAddress();
                        String str2 = null;
                        if (hardwareAddress != null) {
                            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);
                            }
                            str = sb.toString();
                        } else {
                            str = null;
                        }
                        Enumeration<InetAddress> inetAddresses = networkInterface.getInetAddresses();
                        while (true) {
                            if (!inetAddresses.hasMoreElements()) {
                                break;
                            }
                            InetAddress nextElement = inetAddresses.nextElement();
                            if (nextElement instanceof Inet4Address) {
                                str2 = nextElement.getHostAddress();
                                break;
                            }
                        }
                        if (com.datavisor.vangogh.util.h.a(str)) {
                            str = "empty";
                        }
                        if (com.datavisor.vangogh.util.h.a(str2)) {
                            str2 = "empty";
                        }
                        JSONArray jSONArray2 = new JSONArray();
                        jSONArray2.put(networkInterface.getName());
                        jSONArray2.put(str2);
                        jSONArray2.put(str);
                        jSONArray.put(jSONArray2);
                    }
                }
            }
            return jSONArray.toString();
        } catch (Throwable th) {
            com.datavisor.vangogh.util.f.a(th);
            return "exception";
        }
    }

    public String b() {
        try {
            String property = System.getProperty("http.proxyHost");
            String property2 = System.getProperty("http.proxyPort");
            if (com.datavisor.vangogh.util.h.a(property) && com.datavisor.vangogh.util.h.a(property2)) {
                return "empty";
            }
            if (com.datavisor.vangogh.util.h.a(property)) {
                property = "empty";
            }
            if (com.datavisor.vangogh.util.h.a(property2)) {
                property2 = "empty";
            }
            return property + ":" + property2;
        } catch (Throwable th) {
            com.datavisor.vangogh.util.f.a(th);
            return "exception";
        }
    }

    public String c() {
        String str;
        try {
            Iterator it = Collections.list(NetworkInterface.getNetworkInterfaces()).iterator();
            while (true) {
                if (!it.hasNext()) {
                    break;
                }
                NetworkInterface networkInterface = (NetworkInterface) it.next();
                if (networkInterface != null && com.datavisor.vangogh.util.h.b(networkInterface.getName()) && networkInterface.getName().toLowerCase().equals(crypto.convert("K8yOmQ=="))) {
                    byte[] hardwareAddress = networkInterface.getHardwareAddress();
                    if (hardwareAddress != null) {
                        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);
                        }
                        str = sb.toString();
                    }
                }
            }
            str = null;
            if (!com.datavisor.vangogh.util.h.a(str) && !str.equals("02:00:00:00:00:00")) {
                if (!str.equals("00:00:00:00:00:00")) {
                    return str;
                }
            }
            return "empty";
        } catch (Throwable th) {
            com.datavisor.vangogh.util.f.a(th);
            return "exception";
        }
    }

    public String e(Context context) {
        try {
            NetworkInfo activeNetworkInfo = ((ConnectivityManager) context.getSystemService("connectivity")).getActiveNetworkInfo();
            String str = "default";
            if (activeNetworkInfo != null && activeNetworkInfo.isAvailable() && activeNetworkInfo.getType() == 1) {
                Enumeration<NetworkInterface> networkInterfaces = NetworkInterface.getNetworkInterfaces();
                while (networkInterfaces.hasMoreElements()) {
                    NetworkInterface nextElement = networkInterfaces.nextElement();
                    if (nextElement.getName().toLowerCase().equals("wlan0")) {
                        Enumeration<InetAddress> inetAddresses = nextElement.getInetAddresses();
                        while (true) {
                            if (inetAddresses.hasMoreElements()) {
                                InetAddress nextElement2 = inetAddresses.nextElement();
                                if ((nextElement2 instanceof Inet6Address) && !nextElement2.isLoopbackAddress()) {
                                    str = nextElement2.getHostAddress().split("%")[0];
                                    break;
                                }
                            }
                        }
                    }
                }
            }
            return str;
        } catch (Throwable th) {
            com.datavisor.vangogh.util.f.a(th);
            return "exception";
        }
    }

    public String f(Context context) {
        try {
            NetworkInfo activeNetworkInfo = ((ConnectivityManager) context.getSystemService("connectivity")).getActiveNetworkInfo();
            if (activeNetworkInfo == null || !activeNetworkInfo.isAvailable() || activeNetworkInfo.getType() != 1) {
                return "empty";
            }
            String b5 = b(((WifiManager) context.getSystemService("wifi")).getDhcpInfo().gateway);
            storage.globalSet(crypto.convert("H6ih/XXMmO4KRLN/BOo="), b5, 0);
            return b5;
        } catch (Throwable th) {
            com.datavisor.vangogh.util.f.a(th);
            return "exception";
        }
    }

    public String g(Context context) {
        try {
            NetworkInfo activeNetworkInfo = ((ConnectivityManager) context.getSystemService("connectivity")).getActiveNetworkInfo();
            String str = null;
            if (activeNetworkInfo != null && activeNetworkInfo.isAvailable() && activeNetworkInfo.getType() == 1) {
                Enumeration<NetworkInterface> networkInterfaces = NetworkInterface.getNetworkInterfaces();
                while (networkInterfaces.hasMoreElements()) {
                    NetworkInterface nextElement = networkInterfaces.nextElement();
                    if (nextElement.getName().toLowerCase().equals("wlan0")) {
                        for (InterfaceAddress interfaceAddress : nextElement.getInterfaceAddresses()) {
                            if (interfaceAddress.getAddress() instanceof Inet4Address) {
                                str = a(interfaceAddress.getNetworkPrefixLength());
                            }
                        }
                    }
                }
            }
            return com.datavisor.vangogh.util.h.a(str) ? "empty" : str;
        } catch (Throwable th) {
            com.datavisor.vangogh.util.f.a(th);
            return "exception";
        }
    }

    private String a(int i5) {
        if (i5 > 32) {
            return "";
        }
        int i6 = (-1) << (32 - i5);
        int[] iArr = new int[4];
        for (int i7 = 0; i7 < 4; i7++) {
            iArr[3 - i7] = (i6 >> (i7 * 8)) & 255;
        }
        String str = "" + iArr[0];
        for (int i8 = 1; i8 < 4; i8++) {
            str = str + "." + iArr[i8];
        }
        return str;
    }

    private String b(int i5) {
        return (i5 & 255) + "." + ((i5 >> 8) & 255) + "." + ((i5 >> 16) & 255) + "." + ((i5 >> 24) & 255);
    }

    public String c(Context context) {
        String a5 = a(context);
        return com.datavisor.vangogh.util.a.b(a5) ? a5 : "empty";
    }

    public String d(Context context) {
        try {
            NetworkInfo activeNetworkInfo = ((ConnectivityManager) context.getSystemService("connectivity")).getActiveNetworkInfo();
            if (activeNetworkInfo == null || !activeNetworkInfo.isAvailable() || activeNetworkInfo.getType() != 0) {
                return "empty";
            }
            Enumeration<NetworkInterface> networkInterfaces = NetworkInterface.getNetworkInterfaces();
            while (networkInterfaces.hasMoreElements()) {
                NetworkInterface nextElement = networkInterfaces.nextElement();
                Enumeration<InetAddress> inetAddresses = nextElement.getInetAddresses();
                while (true) {
                    if (inetAddresses.hasMoreElements()) {
                        InetAddress nextElement2 = inetAddresses.nextElement();
                        if (!nextElement2.isLoopbackAddress() && !nextElement2.isLinkLocalAddress() && (nextElement2 instanceof Inet4Address)) {
                            Enumeration<InetAddress> inetAddresses2 = nextElement.getInetAddresses();
                            while (inetAddresses2.hasMoreElements()) {
                                InetAddress nextElement3 = inetAddresses2.nextElement();
                                if ((nextElement3 instanceof Inet6Address) && !nextElement3.isLoopbackAddress()) {
                                    String str = nextElement3.getHostAddress().split("%")[0];
                                    if (str.length() > 15) {
                                        return str;
                                    }
                                }
                            }
                        }
                    }
                }
            }
            return "empty";
        } catch (Throwable th) {
            com.datavisor.vangogh.util.f.a(th);
            return "exception";
        }
    }

    public String a(Context context) {
        try {
            NetworkInfo activeNetworkInfo = ((ConnectivityManager) context.getSystemService("connectivity")).getActiveNetworkInfo();
            if (activeNetworkInfo != null && activeNetworkInfo.isAvailable()) {
                if (activeNetworkInfo.getType() == 0) {
                    Enumeration<NetworkInterface> networkInterfaces = NetworkInterface.getNetworkInterfaces();
                    while (networkInterfaces.hasMoreElements()) {
                        Enumeration<InetAddress> inetAddresses = networkInterfaces.nextElement().getInetAddresses();
                        while (inetAddresses.hasMoreElements()) {
                            InetAddress nextElement = inetAddresses.nextElement();
                            if (!nextElement.isLoopbackAddress() && !nextElement.isLinkLocalAddress() && (nextElement instanceof Inet4Address)) {
                                return nextElement.getHostAddress();
                            }
                        }
                    }
                } else if (activeNetworkInfo.getType() == 1) {
                    return b(((WifiManager) context.getSystemService("wifi")).getConnectionInfo().getIpAddress());
                }
            }
        } catch (Throwable unused) {
        }
        return null;
    }

    public String b(Context context) {
        try {
            NetworkInfo activeNetworkInfo = ((ConnectivityManager) context.getSystemService("connectivity")).getActiveNetworkInfo();
            if (activeNetworkInfo == null || !activeNetworkInfo.isAvailable() || activeNetworkInfo.getType() != 1) {
                return null;
            }
            String a5 = a(context);
            if (com.datavisor.vangogh.util.h.b(a5)) {
                return NetworkInterface.getByInetAddress(InetAddress.getByName(a5)).getName().toLowerCase();
            }
            return null;
        } catch (Throwable th) {
            com.datavisor.vangogh.util.f.a(th);
            return null;
        }
    }
}