和通讯录 v4.2.0版本的 MD5 值为:f213fa766dccbfebde0dd8add5534518

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


package com.aspire.strangecallssdk.g;

import android.annotation.SuppressLint;
import com.aspire.strangecallssdk.h.i;
import com.google.android.mms.pdu.EncodedStringValue;
import com.huawei.tep.component.net.http.HttpConstant;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.io.OutputStreamWriter;
import java.net.URL;
import java.security.SecureRandom;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManager;

@SuppressLint({"TrulyRandom"})
public class b {

    private String f664b = "";
    private HttpsURLConnection c = null;

    TrustManager[] f663a = {new c(this)};

    private void b(String str, String str2, boolean z) {
        try {
            if (com.aspire.strangecallssdk.c.b.d) {
                str = str.replace("https://a.cytxl.com.cn/pim/jsonrpc_api.php", "https://a1.cytxl.com.cn/pim/jsonrpc_api.php");
            }
            HttpsURLConnection.setDefaultHostnameVerifier(new d(this, null));
            SSLContext sSLContext = SSLContext.getInstance("TLS");
            sSLContext.init(null, this.f663a, new SecureRandom());
            HttpsURLConnection.setDefaultSSLSocketFactory(sSLContext.getSocketFactory());
            this.c = (HttpsURLConnection) new URL(str).openConnection();
            this.c.setDoOutput(true);
            this.c.setDoInput(true);
            this.c.setConnectTimeout(30000);
            this.c.setReadTimeout(40000);
            this.c.setRequestMethod(HttpConstant.Method.POST);
            this.c.setUseCaches(false);
            if (!z) {
                this.c.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
            } else {
                this.c.setRequestProperty("content-Type", "application/json;charset=utf-8");
            }
            this.c.connect();
            OutputStreamWriter outputStreamWriter = new OutputStreamWriter(this.c.getOutputStream(), EncodedStringValue.StringEncoding.UTF_8);
            i.a("aspire", "post request jason:" + str2);
            if (str2 != null) {
                outputStreamWriter.write(str2);
            }
            outputStreamWriter.flush();
            outputStreamWriter.close();
        } catch (Exception e) {
            i.a("aspire", "post request error:" + e);
            e.printStackTrace();
        }
    }

    public String a(String str, String str2, boolean z) {
        try {
            try {
                b(str, str2, z);
                InputStream inputStream = this.c.getInputStream();
                ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
                byte[] bArr = new byte[4096];
                while (true) {
                    int read = inputStream.read(bArr);
                    if (read == -1) {
                        break;
                    }
                    byteArrayOutputStream.write(bArr, 0, read);
                }
                byte[] byteArray = byteArrayOutputStream.toByteArray();
                byteArrayOutputStream.close();
                inputStream.close();
                this.f664b = new String(byteArray);
                i.a("aspire", "response data:" + this.f664b);
            } catch (Exception e) {
                i.a("aspire", "response error:" + e);
                e.printStackTrace();
                this.f664b = null;
                try {
                    this.c.disconnect();
                } catch (Exception e2) {
                    e2.printStackTrace();
                }
            }
            return this.f664b;
        } finally {
            try {
                this.c.disconnect();
            } catch (Exception e3) {
                e3.printStackTrace();
            }
        }
    }
}