热汗舞蹈 v1.24.1.0版本的 MD5 值为:f1dc6ef07903515a73f51f41f372123e

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


package com.unicom.xiaowo.account.shield.d;

import android.net.Network;
import android.text.TextUtils;
import cn.jpush.android.local.JPushConstants;
import com.huawei.hms.common.internal.RequestManager;
import com.unicom.xiaowo.account.shield.e.f;
import com.unicom.xiaowo.account.shield.e.g;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.security.SecureRandom;
import java.util.HashMap;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSession;
import org.json.JSONObject;
public class b {
    private String a(InputStream inputStream) {
        ByteArrayOutputStream byteArrayOutputStream;
        Throwable th;
        try {
            byteArrayOutputStream = new ByteArrayOutputStream();
            try {
                byte[] bArr = new byte[1024];
                while (true) {
                    int read = inputStream.read(bArr);
                    if (read == -1) {
                        break;
                    }
                    byteArrayOutputStream.write(bArr, 0, read);
                }
                String str = new String(byteArrayOutputStream.toByteArray());
                try {
                    byteArrayOutputStream.close();
                    inputStream.close();
                } catch (Exception unused) {
                }
                return str;
            } catch (Exception unused2) {
                if (byteArrayOutputStream != null) {
                    try {
                        byteArrayOutputStream.close();
                    } catch (Exception unused3) {
                        return null;
                    }
                }
                if (inputStream != null) {
                    inputStream.close();
                }
                return null;
            } catch (Throwable th2) {
                th = th2;
                if (byteArrayOutputStream != null) {
                    try {
                        byteArrayOutputStream.close();
                    } catch (Exception unused4) {
                        throw th;
                    }
                }
                if (inputStream != null) {
                    inputStream.close();
                }
                throw th;
            }
        } catch (Exception unused5) {
            byteArrayOutputStream = null;
        } catch (Throwable th3) {
            byteArrayOutputStream = null;
            th = th3;
        }
    }

    public String a(String str, HashMap<String, String> hashMap, Network network) {
        String str2;
        f.a("url:" + str);
        try {
            URL url = new URL(str);
            str2 = JPushConstants.HTTPS_PRE + url.getHost();
        } catch (MalformedURLException e10) {
            e10.printStackTrace();
            str2 = "";
        }
        g.c(str);
        try {
            URL url2 = new URL(str);
            HttpsURLConnection httpsURLConnection = (HttpsURLConnection) (network != null ? network.openConnection(url2) : url2.openConnection());
            httpsURLConnection.setDoInput(true);
            httpsURLConnection.setDoOutput(false);
            httpsURLConnection.setUseCaches(false);
            httpsURLConnection.setInstanceFollowRedirects(false);
            httpsURLConnection.setReadTimeout(30000);
            httpsURLConnection.setConnectTimeout(30000);
            httpsURLConnection.setRequestMethod("GET");
            httpsURLConnection.setHostnameVerifier(new HostnameVerifier() {
                @Override
                public boolean verify(String str3, SSLSession sSLSession) {
                    f.a("HostnameVerifier:" + str3);
                    if (TextUtils.isEmpty(str3)) {
                        return false;
                    }
                    return str3.equals("opencloud.wostore.cn") || str3.contains("10010.com");
                }
            });
            if (hashMap != null) {
                for (String str3 : hashMap.keySet()) {
                    httpsURLConnection.setRequestProperty(str3, hashMap.get(str3));
                }
            }
            httpsURLConnection.addRequestProperty("Connection", str.startsWith("https://opencloud.wostore.cn/openapi/netauth/precheck/wp?") ? "Keep-Alive" : "close");
            httpsURLConnection.connect();
            if (httpsURLConnection.getResponseCode() == 200) {
                String a10 = a(httpsURLConnection.getInputStream());
                if (TextUtils.isEmpty(a10)) {
                    JSONObject jSONObject = new JSONObject();
                    jSONObject.put("code", RequestManager.NOTIFY_CONNECT_FAILED);
                    jSONObject.put("msg", "10012");
                    jSONObject.put("data", str2);
                    return jSONObject.toString();
                }
                return a10;
            } else if (httpsURLConnection.getResponseCode() != 302) {
                JSONObject jSONObject2 = new JSONObject();
                jSONObject2.put("code", 10010);
                jSONObject2.put("msg", "https状态码" + httpsURLConnection.getResponseCode());
                jSONObject2.put("data", str2);
                return jSONObject2.toString();
            } else {
                String headerField = httpsURLConnection.getHeaderField("Location");
                if (!TextUtils.isEmpty(headerField)) {
                    return headerField.startsWith("https") ? a(headerField, null, network) : b(headerField, null, network);
                }
                JSONObject jSONObject3 = new JSONObject();
                jSONObject3.put("code", RequestManager.NOTIFY_CONNECT_SUSPENDED);
                jSONObject3.put("msg", "无跳转地址");
                jSONObject3.put("data", str2);
                return jSONObject3.toString();
            }
        } catch (Exception e11) {
            e11.printStackTrace();
            try {
                JSONObject jSONObject4 = new JSONObject();
                jSONObject4.put("code", RequestManager.NOTIFY_CONNECT_SUCCESS);
                jSONObject4.put("msg", "https异常" + e11.getMessage());
                jSONObject4.put("data", str2);
                return jSONObject4.toString();
            } catch (Exception unused) {
                return null;
            }
        }
    }

    public String b(String str, HashMap<String, String> hashMap, Network network) {
        String str2;
        HttpURLConnection httpURLConnection;
        try {
            URL url = new URL(str);
            str2 = JPushConstants.HTTP_PRE + url.getHost();
        } catch (MalformedURLException e10) {
            e10.printStackTrace();
            str2 = str;
        }
        g.c(str);
        f.a(str);
        HttpURLConnection httpURLConnection2 = null;
        try {
            URL url2 = new URL(str);
            HttpURLConnection httpURLConnection3 = (HttpURLConnection) (network != null ? network.openConnection(url2) : url2.openConnection());
            try {
                httpURLConnection3.setDoInput(true);
                httpURLConnection3.setDoOutput(false);
                httpURLConnection3.setUseCaches(false);
                httpURLConnection3.setInstanceFollowRedirects(false);
                httpURLConnection3.setReadTimeout(30000);
                httpURLConnection3.setConnectTimeout(30000);
                httpURLConnection3.setRequestMethod("GET");
                if (hashMap != null) {
                    for (String str3 : hashMap.keySet()) {
                        httpURLConnection3.setRequestProperty(str3, hashMap.get(str3));
                    }
                }
                httpURLConnection3.addRequestProperty("Connection", "close");
                httpURLConnection3.connect();
                if (httpURLConnection3.getResponseCode() == 200) {
                    String a10 = a(httpURLConnection3.getInputStream());
                    if (!TextUtils.isEmpty(a10)) {
                        httpURLConnection3.disconnect();
                        return a10;
                    }
                    JSONObject jSONObject = new JSONObject();
                    jSONObject.put("code", RequestManager.NOTIFY_CONNECT_FAILED);
                    jSONObject.put("msg", "10012");
                    jSONObject.put("data", str2);
                    String jSONObject2 = jSONObject.toString();
                    httpURLConnection3.disconnect();
                    return jSONObject2;
                } else if (httpURLConnection3.getResponseCode() != 302) {
                    JSONObject jSONObject3 = new JSONObject();
                    jSONObject3.put("code", 10010);
                    jSONObject3.put("msg", "https状态码" + httpURLConnection3.getResponseCode());
                    jSONObject3.put("data", str2);
                    String jSONObject4 = jSONObject3.toString();
                    httpURLConnection3.disconnect();
                    return jSONObject4;
                } else {
                    String headerField = httpURLConnection3.getHeaderField("Location");
                    if (TextUtils.isEmpty(headerField)) {
                        JSONObject jSONObject5 = new JSONObject();
                        jSONObject5.put("code", RequestManager.NOTIFY_CONNECT_SUSPENDED);
                        jSONObject5.put("msg", "无跳转地址");
                        jSONObject5.put("data", str2);
                        String jSONObject6 = jSONObject5.toString();
                        httpURLConnection3.disconnect();
                        return jSONObject6;
                    } else if (headerField.startsWith("https")) {
                        String a11 = a(headerField, null, network);
                        httpURLConnection3.disconnect();
                        return a11;
                    } else {
                        String b10 = b(headerField, null, network);
                        httpURLConnection3.disconnect();
                        return b10;
                    }
                }
            } catch (Exception e11) {
                httpURLConnection = httpURLConnection3;
                e = e11;
                try {
                    e.printStackTrace();
                    try {
                        JSONObject jSONObject7 = new JSONObject();
                        jSONObject7.put("code", 10024);
                        jSONObject7.put("msg", "http异常" + e.getMessage());
                        jSONObject7.put("data", str2);
                        String jSONObject8 = jSONObject7.toString();
                        if (httpURLConnection != null) {
                            httpURLConnection.disconnect();
                        }
                        return jSONObject8;
                    } catch (Exception unused) {
                        if (httpURLConnection != null) {
                            httpURLConnection.disconnect();
                        }
                        return null;
                    }
                } catch (Throwable th) {
                    th = th;
                    httpURLConnection2 = httpURLConnection;
                    if (httpURLConnection2 != null) {
                        httpURLConnection2.disconnect();
                    }
                    throw th;
                }
            } catch (Throwable th2) {
                httpURLConnection2 = httpURLConnection3;
                th = th2;
                if (httpURLConnection2 != null) {
                }
                throw th;
            }
        } catch (Exception e12) {
            e = e12;
            httpURLConnection = null;
        } catch (Throwable th3) {
            th = th3;
        }
    }

    public String c(String str, HashMap<String, String> hashMap, Network network) {
        String str2;
        f.a("url:" + str);
        try {
            URL url = new URL(str);
            str2 = JPushConstants.HTTPS_PRE + url.getHost();
        } catch (MalformedURLException e10) {
            e10.printStackTrace();
            str2 = "";
        }
        g.c(str);
        try {
            SSLContext sSLContext = SSLContext.getInstance("TLS");
            sSLContext.init(null, null, new SecureRandom());
            c cVar = new c(sSLContext.getSocketFactory());
            URL url2 = new URL(str);
            HttpsURLConnection httpsURLConnection = (HttpsURLConnection) (network != null ? network.openConnection(url2) : url2.openConnection());
            httpsURLConnection.setDoInput(true);
            httpsURLConnection.setDoOutput(false);
            httpsURLConnection.setUseCaches(false);
            httpsURLConnection.setInstanceFollowRedirects(false);
            httpsURLConnection.setReadTimeout(30000);
            httpsURLConnection.setConnectTimeout(30000);
            httpsURLConnection.setRequestMethod("GET");
            httpsURLConnection.setSSLSocketFactory(cVar);
            httpsURLConnection.setHostnameVerifier(new HostnameVerifier() {
                @Override
                public boolean verify(String str3, SSLSession sSLSession) {
                    f.a("HostnameVerifier:" + str3);
                    if (TextUtils.isEmpty(str3)) {
                        return false;
                    }
                    return str3.equals("opencloud.wostore.cn") || str3.contains("10010.com");
                }
            });
            if (hashMap != null) {
                for (String str3 : hashMap.keySet()) {
                    httpsURLConnection.setRequestProperty(str3, hashMap.get(str3));
                }
            }
            httpsURLConnection.addRequestProperty("Connection", str.startsWith("https://opencloud.wostore.cn/openapi/netauth/precheck/wp?") ? "Keep-Alive" : "close");
            httpsURLConnection.connect();
            if (httpsURLConnection.getResponseCode() == 200) {
                String a10 = a(httpsURLConnection.getInputStream());
                if (TextUtils.isEmpty(a10)) {
                    JSONObject jSONObject = new JSONObject();
                    jSONObject.put("code", RequestManager.NOTIFY_CONNECT_FAILED);
                    jSONObject.put("msg", "10012");
                    jSONObject.put("data", str2);
                    return jSONObject.toString();
                }
                return a10;
            } else if (httpsURLConnection.getResponseCode() != 302) {
                JSONObject jSONObject2 = new JSONObject();
                jSONObject2.put("code", 10010);
                jSONObject2.put("msg", "https状态码" + httpsURLConnection.getResponseCode());
                jSONObject2.put("data", str2);
                return jSONObject2.toString();
            } else {
                String headerField = httpsURLConnection.getHeaderField("Location");
                if (!TextUtils.isEmpty(headerField)) {
                    return headerField.startsWith("https") ? a(headerField, null, network) : b(headerField, null, network);
                }
                JSONObject jSONObject3 = new JSONObject();
                jSONObject3.put("code", RequestManager.NOTIFY_CONNECT_SUSPENDED);
                jSONObject3.put("msg", "无跳转地址");
                jSONObject3.put("data", str2);
                return jSONObject3.toString();
            }
        } catch (Exception e11) {
            e11.printStackTrace();
            try {
                JSONObject jSONObject4 = new JSONObject();
                jSONObject4.put("code", RequestManager.NOTIFY_CONNECT_SUCCESS);
                jSONObject4.put("msg", "https异常" + e11.getMessage());
                jSONObject4.put("data", str2);
                return jSONObject4.toString();
            } catch (Exception unused) {
                return null;
            }
        }
    }
}