星辰影院解锁vip v1.0.4版本的 MD5 值为:3d99bbcbb0d5d5e568b9f6134424c24e

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


package f.d.a.a.e.a;

import android.annotation.TargetApi;
import android.text.TextUtils;
import f.d.a.a.g.q;
import java.io.Closeable;
import java.io.EOFException;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.Map;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLHandshakeException;

public class a implements b {
    private void b(Closeable closeable) {
        if (closeable != null) {
            try {
                closeable.close();
            } catch (IOException e2) {
                e2.printStackTrace();
            }
        }
    }

    private void c(HttpURLConnection httpURLConnection, f.d.a.a.b bVar, String str) {
        String a;
        if (!(httpURLConnection instanceof HttpsURLConnection) || bVar.k("CLOSE_CERT_VERIFY", true) || str.contains("https://config.cmpassport.com/client/uniConfig")) {
            return;
        }
        f.d.a.a.g.c.b("ConnectionInterceptor", "开启证书校验");
        if (str.contains("getAuthToken")) {
            a = q.a(q.l());
        } else {
            a = q.a(q.m());
        }
        f.d.a.a.g.c.b("ConnectionInterceptor", "cer: " + a);
        if (TextUtils.isEmpty(a)) {
            return;
        }
        ((HttpsURLConnection) httpURLConnection).setSSLSocketFactory(new f.d.a.a.e.f.a(a).a().getSocketFactory());
    }

    @Override
    @TargetApi(21)
    public void a(f.d.a.a.e.d.c cVar, f.d.a.a.e.e.c cVar2, f.d.a.a.b bVar) {
        String str;
        InputStream inputStream;
        StringBuilder sb;
        OutputStream outputStream;
        int i2;
        HttpURLConnection httpURLConnection;
        f.d.a.a.e.e.a aVar;
        int i3;
        HttpURLConnection httpURLConnection2;
        int responseCode;
        f.d.a.a.e.e.b bVar2;
        String str2 = "";
        f.d.a.a.g.c.b("ConnectionInterceptor", "请求地址: " + cVar.a());
        try {
            URL url = new URL(cVar.a());
            if (cVar.l() != null) {
                f.d.a.a.g.c.b("ConnectionInterceptor", "开始wifi下取号");
                httpURLConnection2 = (HttpURLConnection) cVar.l().openConnection(url);
            } else {
                f.d.a.a.g.c.b("ConnectionInterceptor", "使用当前网络环境发送请求");
                httpURLConnection2 = (HttpURLConnection) url.openConnection();
            }
            httpURLConnection = httpURLConnection2;
            try {
                Map<String, String> g2 = cVar.g();
                if (g2 != null) {
                    for (String str3 : g2.keySet()) {
                        httpURLConnection.addRequestProperty(str3, g2.get(str3));
                    }
                }
                c(httpURLConnection, bVar, cVar.a());
                httpURLConnection.setDoInput(true);
                httpURLConnection.setInstanceFollowRedirects(false);
                httpURLConnection.setConnectTimeout(5000);
                httpURLConnection.setReadTimeout(5000);
                httpURLConnection.setDefaultUseCaches(false);
                String i4 = cVar.i();
                httpURLConnection.setRequestMethod(i4);
                httpURLConnection.setDoOutput(true);
                httpURLConnection.connect();
                if (cVar instanceof f.d.a.a.e.d.b) {
                    ((f.d.a.a.e.d.b) cVar).q(bVar);
                }
                if (i4.endsWith("POST")) {
                    outputStream = httpURLConnection.getOutputStream();
                    try {
                        outputStream.write(cVar.h().getBytes("utf-8"));
                        outputStream.flush();
                    } catch (Exception e2) {
                        e = e2;
                        str = "";
                        inputStream = null;
                        sb = null;
                        i2 = -1;
                        try {
                            e.printStackTrace();
                            f.d.a.a.g.c.a("ConnectionInterceptor", "请求失败: " + cVar.a());
                            if (e instanceof SSLHandshakeException) {
                            }
                            f.d.a.a.f.a.a.add(e);
                            if (e instanceof EOFException) {
                            }
                            b(outputStream);
                            b(inputStream);
                            if (httpURLConnection != null) {
                            }
                            f.d.a.a.g.c.b("ConnectionInterceptor", "responseCode: " + i3);
                            StringBuilder sb2 = new StringBuilder();
                            sb2.append("responseResult: ");
                            sb2.append(TextUtils.isEmpty(sb) ? str : sb.toString());
                            f.d.a.a.g.c.b("ConnectionInterceptor", sb2.toString());
                            if (i3 == 200) {
                            }
                            cVar2.b(null);
                            return;
                        } catch (Throwable th) {
                            th = th;
                            b(outputStream);
                            b(inputStream);
                            if (httpURLConnection != null) {
                                httpURLConnection.disconnect();
                            }
                            f.d.a.a.g.c.b("ConnectionInterceptor", "responseCode: " + i2);
                            StringBuilder sb3 = new StringBuilder();
                            sb3.append("responseResult: ");
                            sb3.append(!TextUtils.isEmpty(sb) ? str : sb.toString());
                            f.d.a.a.g.c.b("ConnectionInterceptor", sb3.toString());
                            if (i2 == 200 && i2 != 301 && i2 != 302) {
                                cVar2.a(f.d.a.a.e.e.a.b(i2));
                            } else {
                                cVar2.b(null);
                            }
                            throw th;
                        }
                    } catch (Throwable th2) {
                        th = th2;
                        str = "";
                        inputStream = null;
                        sb = null;
                        i2 = -1;
                        b(outputStream);
                        b(inputStream);
                        if (httpURLConnection != null) {
                        }
                        f.d.a.a.g.c.b("ConnectionInterceptor", "responseCode: " + i2);
                        StringBuilder sb32 = new StringBuilder();
                        sb32.append("responseResult: ");
                        sb32.append(!TextUtils.isEmpty(sb) ? str : sb.toString());
                        f.d.a.a.g.c.b("ConnectionInterceptor", sb32.toString());
                        if (i2 == 200) {
                        }
                        cVar2.b(null);
                        throw th;
                    }
                } else {
                    outputStream = null;
                }
                responseCode = httpURLConnection.getResponseCode();
                try {
                    inputStream = httpURLConnection.getInputStream();
                    try {
                        byte[] bArr = new byte[2048];
                        sb = new StringBuilder();
                        while (true) {
                            try {
                                int read = inputStream.read(bArr);
                                if (read <= 0) {
                                    break;
                                }
                                str = str2;
                                try {
                                    sb.append(new String(bArr, 0, read, "utf-8"));
                                    str2 = str;
                                } catch (Exception e3) {
                                    e = e3;
                                    i2 = responseCode;
                                    e.printStackTrace();
                                    f.d.a.a.g.c.a("ConnectionInterceptor", "请求失败: " + cVar.a());
                                    if (e instanceof SSLHandshakeException) {
                                    }
                                    f.d.a.a.f.a.a.add(e);
                                    if (e instanceof EOFException) {
                                    }
                                    b(outputStream);
                                    b(inputStream);
                                    if (httpURLConnection != null) {
                                    }
                                    f.d.a.a.g.c.b("ConnectionInterceptor", "responseCode: " + i3);
                                    StringBuilder sb22 = new StringBuilder();
                                    sb22.append("responseResult: ");
                                    sb22.append(TextUtils.isEmpty(sb) ? str : sb.toString());
                                    f.d.a.a.g.c.b("ConnectionInterceptor", sb22.toString());
                                    if (i3 == 200) {
                                    }
                                    cVar2.b(null);
                                    return;
                                } catch (Throwable th3) {
                                    th = th3;
                                    i2 = responseCode;
                                    b(outputStream);
                                    b(inputStream);
                                    if (httpURLConnection != null) {
                                    }
                                    f.d.a.a.g.c.b("ConnectionInterceptor", "responseCode: " + i2);
                                    StringBuilder sb322 = new StringBuilder();
                                    sb322.append("responseResult: ");
                                    sb322.append(!TextUtils.isEmpty(sb) ? str : sb.toString());
                                    f.d.a.a.g.c.b("ConnectionInterceptor", sb322.toString());
                                    if (i2 == 200) {
                                    }
                                    cVar2.b(null);
                                    throw th;
                                }
                            } catch (Exception e4) {
                                e = e4;
                                str = str2;
                            } catch (Throwable th4) {
                                th = th4;
                                str = str2;
                            }
                        }
                        str = str2;
                        bVar2 = new f.d.a.a.e.e.b(responseCode, httpURLConnection.getHeaderFields(), sb.toString());
                        b(outputStream);
                        b(inputStream);
                        httpURLConnection.disconnect();
                        f.d.a.a.g.c.b("ConnectionInterceptor", "responseCode: " + responseCode);
                        StringBuilder sb4 = new StringBuilder();
                        sb4.append("responseResult: ");
                        sb4.append(TextUtils.isEmpty(sb) ? str : sb.toString());
                        f.d.a.a.g.c.b("ConnectionInterceptor", sb4.toString());
                    } catch (Exception e5) {
                        e = e5;
                        str = "";
                        i2 = responseCode;
                        sb = null;
                        e.printStackTrace();
                        f.d.a.a.g.c.a("ConnectionInterceptor", "请求失败: " + cVar.a());
                        if (e instanceof SSLHandshakeException) {
                            bVar.d("isNeedToGetCert", true);
                        }
                        f.d.a.a.f.a.a.add(e);
                        i3 = e instanceof EOFException ? 200050 : 102102;
                        b(outputStream);
                        b(inputStream);
                        if (httpURLConnection != null) {
                            httpURLConnection.disconnect();
                        }
                        f.d.a.a.g.c.b("ConnectionInterceptor", "responseCode: " + i3);
                        StringBuilder sb222 = new StringBuilder();
                        sb222.append("responseResult: ");
                        sb222.append(TextUtils.isEmpty(sb) ? str : sb.toString());
                        f.d.a.a.g.c.b("ConnectionInterceptor", sb222.toString());
                        if (i3 == 200 && i3 != 301 && i3 != 302) {
                            aVar = f.d.a.a.e.e.a.b(i3);
                            cVar2.a(aVar);
                        } else {
                            cVar2.b(null);
                            return;
                        }
                    } catch (Throwable th5) {
                        th = th5;
                        str = "";
                        i2 = responseCode;
                        sb = null;
                        b(outputStream);
                        b(inputStream);
                        if (httpURLConnection != null) {
                        }
                        f.d.a.a.g.c.b("ConnectionInterceptor", "responseCode: " + i2);
                        StringBuilder sb3222 = new StringBuilder();
                        sb3222.append("responseResult: ");
                        sb3222.append(!TextUtils.isEmpty(sb) ? str : sb.toString());
                        f.d.a.a.g.c.b("ConnectionInterceptor", sb3222.toString());
                        if (i2 == 200) {
                        }
                        cVar2.b(null);
                        throw th;
                    }
                } catch (Exception e6) {
                    e = e6;
                    str = "";
                    i2 = responseCode;
                    inputStream = null;
                } catch (Throwable th6) {
                    th = th6;
                    str = "";
                    i2 = responseCode;
                    inputStream = null;
                }
            } catch (Exception e7) {
                e = e7;
                str = "";
                inputStream = null;
                sb = null;
                outputStream = null;
            } catch (Throwable th7) {
                th = th7;
                str = "";
                inputStream = null;
                sb = null;
                outputStream = null;
            }
        } catch (Exception e8) {
            e = e8;
            str = "";
            inputStream = null;
            sb = null;
            outputStream = null;
            i2 = -1;
            httpURLConnection = null;
        } catch (Throwable th8) {
            th = th8;
            str = "";
            inputStream = null;
            sb = null;
            outputStream = null;
            i2 = -1;
            httpURLConnection = null;
        }
        if (responseCode != 200 && responseCode != 301 && responseCode != 302) {
            aVar = f.d.a.a.e.e.a.b(responseCode);
            cVar2.a(aVar);
        } else {
            cVar2.b(bVar2);
        }
    }
}