佳GO v3.0.0版本的 MD5 值为:febdbe251c5346d8ea051b2f02d4ce89

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


package com.ehking.sdk.wepay.utlis;

import android.os.AsyncTask;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;

public class CheckWifiLoginTask extends AsyncTask<Integer, Integer, Boolean> {
    public ICheckWifiCallBack mCallBack;

    public interface ICheckWifiCallBack {
        void portalNetWork(boolean z);
    }

    public CheckWifiLoginTask(ICheckWifiCallBack iCheckWifiCallBack) {
        this.mCallBack = iCheckWifiCallBack;
    }

    public static void checkWifi(ICheckWifiCallBack iCheckWifiCallBack) {
        new CheckWifiLoginTask(iCheckWifiCallBack).execute(new Integer[0]);
    }

    private boolean isWifiSetPortal() {
        HttpURLConnection httpURLConnection;
        HttpURLConnection httpURLConnection2 = null;
        try {
            httpURLConnection = (HttpURLConnection) new URL("http://g.cn/generate_204").openConnection();
        } catch (IOException unused) {
        } catch (Throwable th) {
            th = th;
        }
        try {
            httpURLConnection.setInstanceFollowRedirects(false);
            httpURLConnection.setConnectTimeout(10000);
            httpURLConnection.setReadTimeout(10000);
            httpURLConnection.setUseCaches(false);
            httpURLConnection.getInputStream();
            boolean z = httpURLConnection.getResponseCode() != 204;
            httpURLConnection.disconnect();
            return z;
        } catch (IOException unused2) {
            httpURLConnection2 = httpURLConnection;
            if (httpURLConnection2 != null) {
                httpURLConnection2.disconnect();
            }
            return false;
        } catch (Throwable th2) {
            th = th2;
            httpURLConnection2 = httpURLConnection;
            if (httpURLConnection2 != null) {
                httpURLConnection2.disconnect();
            }
            throw th;
        }
    }

    @Override
    public Boolean doInBackground(Integer... numArr) {
        return Boolean.valueOf(isWifiSetPortal());
    }

    @Override
    public void onPostExecute(Boolean bool) {
        ICheckWifiCallBack iCheckWifiCallBack = this.mCallBack;
        if (iCheckWifiCallBack != null) {
            iCheckWifiCallBack.portalNetWork(bool.booleanValue());
        }
    }
}