4399游戏盒 v7.2.1.31版本的 MD5 值为:951717f45e3fda95c8a358caf4ca93e1

以下内容为反编译后的 a.java 源代码,内容仅作参考


package com.m4399.gamecenter.plugin.main.manager.stnu.b;

import com.framework.config.Config;
import com.framework.config.SysConfigKey;
import com.framework.manager.network.NetworkStatusManager;
import com.huawei.hms.support.hianalytics.HiAnalyticsConstant;
import com.loopj.android.http.AsyncHttpClient;
import com.loopj.android.http.RequestParams;
import com.m4399.gamecenter.plugin.main.manager.stnu.a.b;
import java.io.Closeable;
import java.io.PrintWriter;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.HashMap;
import java.util.Map;
import org.json.JSONException;
import org.json.JSONObject;
import timber.log.Timber;
import tv.danmaku.ijk.media.player.IjkMediaPlayer;

public class a {
    private static String dgU = "POST";
    private b dgs;

    public void setDiscoveryInfo(b bVar) {
        this.dgs = bVar;
    }

    public void loadData() {
        HttpURLConnection httpURLConnection;
        PrintWriter printWriter;
        if (this.dgs == null) {
            return;
        }
        Map<String, String> hashMap = new HashMap<>();
        hashMap.put("mID", (String) Config.getValue(SysConfigKey.APP_UDID));
        hashMap.put("type", this.dgs.getNetWorkType());
        hashMap.put(IjkMediaPlayer.OnNativeInvokeListener.ARG_IP, this.dgs.getPublicIP() != null ? this.dgs.getPublicIP().getHostAddress() : "");
        hashMap.put(HiAnalyticsConstant.BI_KEY_NET_TYPE, NetworkStatusManager.getCurrentNetwork().getNetworkTypeName());
        String jSONObject = w(hashMap).toString();
        Timber.d("uploadStr " + jSONObject, new Object[0]);
        Closeable closeable = null;
        try {
            httpURLConnection = (HttpURLConnection) new URL("http://42.62.106.40:3000/stat").openConnection();
            try {
                httpURLConnection.setDoInput(true);
                httpURLConnection.setDoOutput(true);
                httpURLConnection.setUseCaches(false);
                httpURLConnection.setInstanceFollowRedirects(true);
                httpURLConnection.setRequestMethod(dgU);
                httpURLConnection.setRequestProperty(AsyncHttpClient.HEADER_CONTENT_TYPE, RequestParams.APPLICATION_JSON);
                httpURLConnection.setRequestProperty("Connection", "Close");
                httpURLConnection.setConnectTimeout(30000);
                httpURLConnection.setReadTimeout(30000);
                httpURLConnection.setFixedLengthStreamingMode(jSONObject.length());
                httpURLConnection.connect();
                printWriter = new PrintWriter(httpURLConnection.getOutputStream());
            } catch (Throwable th) {
                th = th;
            }
        } catch (Throwable th2) {
            th = th2;
            httpURLConnection = null;
        }
        try {
            printWriter.write(jSONObject);
            printWriter.flush();
            int responseCode = httpURLConnection.getResponseCode();
            if (responseCode != 200) {
                Timber.d("responseCode ( " + responseCode + ")", new Object[0]);
            }
            close(printWriter);
        } catch (Throwable th3) {
            th = th3;
            closeable = printWriter;
            try {
                Timber.d("responseCode ( " + th.getMessage() + ")", new Object[0]);
                close(closeable);
                d(httpURLConnection);
            } catch (Throwable th4) {
                close(closeable);
                d(httpURLConnection);
                throw th4;
            }
        }
        d(httpURLConnection);
    }

    private JSONObject w(Map<String, String> map) {
        JSONObject jSONObject = new JSONObject();
        try {
        } catch (Exception unused) {
            Timber.d("json Exception", new Object[0]);
        }
        for (Map.Entry<String, String> entry : map.entrySet()) {
            String key = entry.getKey();
            if (key == null) {
                throw new NullPointerException("key == null");
            }
            try {
                jSONObject.put(key, entry.getValue());
            } catch (JSONException unused2) {
                Timber.d("json Exception", new Object[0]);
            }
            Timber.d("json Exception", new Object[0]);
            return jSONObject;
        }
        return jSONObject;
    }

    private void d(HttpURLConnection httpURLConnection) {
        if (httpURLConnection != null) {
            try {
                httpURLConnection.disconnect();
            } catch (Exception unused) {
            }
        }
    }

    private void close(Closeable closeable) {
        if (closeable != null) {
            try {
                closeable.close();
            } catch (Exception unused) {
            }
        }
    }
}