导航菜单

页面标题

页面副标题

哔哩哔哩 v1.6.6 - afm2.java 源代码

正在查看: 哔哩哔哩 v1.6.6 应用的 afm2.java JAVA 源代码文件

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


package bl;

import android.net.ConnectivityManager;
import android.net.Network;
import android.opengl.GLSurfaceView;
import android.os.Build;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import bl.qa;
import com.bilibili.tv.MainApplication;
import java.lang.reflect.Method;
import java.net.InetAddress;
import java.util.concurrent.Callable;
import java.util.concurrent.Executors;
import javax.microedition.khronos.egl.EGLConfig;
import javax.microedition.khronos.opengles.GL10;
import kotlin.TypeCastException;
import org.json.JSONObject;
import tv.danmaku.android.log.BLog;

public final class afm2 extends adt {
    public static final a Companion = new a(null);
    private TextView c;

    @Override
    public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        bbi.b(layoutInflater, "inflater");
        return layoutInflater.inflate(2131361847, viewGroup, false);
    }

    @Override
    public void onViewCreated(View view, Bundle bundle) {
        bbi.b(view, "view");
        super.onViewCreated(view, bundle);
        if (view.findViewById(2131230868) == null) {
            throw new TypeCastException("null cannot be cast to non-null type android.widget.FrameLayout");
        }
        this.c = (TextView) a(view, 2131230908);
        try {
            renderInfo();
        } catch (Throwable th) {
            att.a(th);
            BLog.e(azy.a.toString());
            lr.b(MainApplication.a(), "HOHO");
        }
    }

    public final void renderInfo() {
        if (this.c != null && isAdded()) {
            try {
                JSONObject jSONObject = (JSONObject) Executors.newSingleThreadExecutor().submit(new Callable<JSONObject>() {
                    @Override
                    public JSONObject call() {
                        return ((Response) pz.a(new qa.a(Response.class).a("https://api.bilibili.com/x/resource/ip").a(true).a(new qb()).a(), "GET")).e();
                    }
                }).get();
                String optString = jSONObject.optString("addr");
                String str = jSONObject.optString(u.aly.au.G) + " " + jSONObject.optString("province") + " " + jSONObject.optString("city");
                String optString2 = jSONObject.optString("isp");
                StringBuilder sb = new StringBuilder();
                if (Build.VERSION.SDK_INT < 26) {
                    Method method = Class.forName("android.os.SystemProperties").getMethod("get", String.class);
                    for (String str2 : new String[]{"net.dns1", "net.dns2", "net.dns3", "net.dns4"}) {
                        String str3 = (String) method.invoke(null, str2);
                        if (str3 != null && !"".equals(str3) && !sb.toString().contains(str3) && sb.length() > 0) {
                            sb.append(", ");
                        }
                        sb.append(str3);
                    }
                } else {
                    ConnectivityManager connectivityManager = (ConnectivityManager) MainApplication.a().getSystemService("connectivity");
                    if (connectivityManager != null) {
                        for (Network network : connectivityManager.getAllNetworks()) {
                            if (connectivityManager.getNetworkInfo(network).isConnected()) {
                                for (InetAddress inetAddress : connectivityManager.getLinkProperties(network).getDnsServers()) {
                                    if (sb.length() > 0) {
                                        sb.append(", ");
                                    }
                                    sb.append(inetAddress.getHostAddress());
                                }
                            }
                        }
                    }
                }
                this.c.setText(((("IP: " + optString) + "\n归属地: " + str) + "\n运营商: " + optString2) + "\nDNS: " + sb.toString());
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }

    public static class Response extends qe {
        public JSONObject e() {
            try {
                if (a()) {
                    JSONObject optJSONObject = new JSONObject(new String(this.b)).optJSONObject("data");
                    if (optJSONObject != null) {
                        return optJSONObject;
                    }
                }
                return null;
            } catch (Exception e) {
                return null;
            }
        }
    }

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

        public a(bbg bbgVar) {
            this();
        }

        public final afm2 a() {
            return new afm2();
        }
    }

    public final class b implements GLSurfaceView.Renderer {
        private String b = "N/A";
        private String c = "";
        private String d = "";

        @Override
        public void onDrawFrame(GL10 gl10) {
            bbi.b(gl10, "gl");
        }

        @Override
        public void onSurfaceChanged(GL10 gl10, int i, int i2) {
            bbi.b(gl10, "gl");
        }

        public b() {
        }

        public final String a() {
            return this.b;
        }

        @Override
        public void onSurfaceCreated(GL10 gl10, EGLConfig eGLConfig) {
            bbi.b(gl10, "gl");
            bbi.b(eGLConfig, "config");
            String glGetString = gl10.glGetString(7937);
            bbi.a((Object) glGetString, "gl.glGetString(GL10.GL_RENDERER)");
            this.b = glGetString;
            String glGetString2 = gl10.glGetString(7936);
            bbi.a((Object) glGetString2, "gl.glGetString(GL10.GL_VENDOR)");
            this.c = glGetString2;
            String glGetString3 = gl10.glGetString(7938);
            bbi.a((Object) glGetString3, "gl.glGetString(GL10.GL_VERSION)");
            this.d = glGetString3;
            FragmentActivity activity = afm2.this.getActivity();
            if (activity != null) {
                activity.runOnUiThread(new a());
            }
        }

        final class a implements Runnable {
            a() {
            }

            @Override
            public final void run() {
                afm2.this.renderInfo();
            }
        }
    }
}