导航菜单

页面标题

页面副标题

MT Manager v2.13.3 - C8241.java 源代码

正在查看: MT Manager v2.13.3 应用的 C8241.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package l;

import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.Build;
import android.os.Bundle;
import android.text.TextUtils;
import java.io.ByteArrayOutputStream;
import java.io.CharConversionException;
import java.io.EOFException;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.InvalidClassException;
import java.io.InvalidObjectException;
import java.io.NotActiveException;
import java.io.NotSerializableException;
import java.io.OptionalDataException;
import java.io.StreamCorruptedException;
import java.io.SyncFailedException;
import java.io.UTFDataFormatException;
import java.io.UnsupportedEncodingException;
import java.io.WriteAbortedException;
import java.net.BindException;
import java.net.ConnectException;
import java.net.HttpRetryException;
import java.net.MalformedURLException;
import java.net.NoRouteToHostException;
import java.net.PortUnreachableException;
import java.net.ProtocolException;
import java.net.SocketTimeoutException;
import java.net.UnknownHostException;
import java.net.UnknownServiceException;
import java.nio.channels.ClosedChannelException;
import java.nio.channels.FileLockInterruptionException;
import java.nio.charset.MalformedInputException;
import java.nio.charset.UnmappableCharacterException;
import java.util.InvalidPropertiesFormatException;
import java.util.zip.GZIPInputStream;
import java.util.zip.ZipException;
import javax.net.ssl.SSLHandshakeException;
import javax.net.ssl.SSLKeyException;
import javax.net.ssl.SSLPeerUnverifiedException;
import javax.net.ssl.SSLProtocolException;
import org.apache.http.ConnectionClosedException;
import org.apache.http.Header;
import org.apache.http.HttpHost;
import org.apache.http.HttpResponse;
import org.apache.http.HttpVersion;
import org.apache.http.MalformedChunkCodingException;
import org.apache.http.NoHttpResponseException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.HttpResponseException;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.conn.ConnectTimeoutException;
import org.apache.http.conn.scheme.PlainSocketFactory;
import org.apache.http.conn.scheme.Scheme;
import org.apache.http.conn.scheme.SchemeRegistry;
import org.apache.http.conn.ssl.SSLSocketFactory;
import org.apache.http.entity.ByteArrayEntity;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager;
import org.apache.http.params.BasicHttpParams;
import org.apache.http.params.HttpConnectionParams;
import org.apache.http.params.HttpProtocolParams;

public final class C8241 {
    public static org.json.JSONObject m20012(l.۫ۢ۫ۗ r11, android.content.Context r12, java.lang.String r13, android.os.Bundle r14, java.lang.String r15) {
        throw new UnsupportedOperationException("Method not decompiled: l.C8241.m20012(l.۫ۢ۫ۗ, android.content.Context, java.lang.String, android.os.Bundle, java.lang.String):org.json.JSONObject");
    }

    public static void m20013(۫ۢ۫ۗ r9, Context context, String str, Bundle bundle, String str2, C7428 c7428) {
        ۦۥ۫ۗ.ۛ("openSDK_LOG.HttpUtils", "OpenApi requestAsync");
        new C0575(r9, context, str, bundle, str2, c7428).start();
    }

    public static int m20008(IOException iOException) {
        if (iOException instanceof CharConversionException) {
            return -20;
        }
        if (iOException instanceof MalformedInputException) {
            return -21;
        }
        if (iOException instanceof UnmappableCharacterException) {
            return -22;
        }
        if (iOException instanceof HttpResponseException) {
            return -23;
        }
        if (iOException instanceof ClosedChannelException) {
            return -24;
        }
        if (iOException instanceof ConnectionClosedException) {
            return -25;
        }
        if (iOException instanceof EOFException) {
            return -26;
        }
        if (iOException instanceof FileLockInterruptionException) {
            return -27;
        }
        if (iOException instanceof FileNotFoundException) {
            return -28;
        }
        if (iOException instanceof HttpRetryException) {
            return -29;
        }
        if (iOException instanceof ConnectTimeoutException) {
            return -7;
        }
        if (iOException instanceof SocketTimeoutException) {
            return -8;
        }
        if (iOException instanceof InvalidPropertiesFormatException) {
            return -30;
        }
        if (iOException instanceof MalformedChunkCodingException) {
            return -31;
        }
        if (iOException instanceof MalformedURLException) {
            return -3;
        }
        if (iOException instanceof NoHttpResponseException) {
            return -32;
        }
        if (iOException instanceof InvalidClassException) {
            return -33;
        }
        if (iOException instanceof InvalidObjectException) {
            return -34;
        }
        if (iOException instanceof NotActiveException) {
            return -35;
        }
        if (iOException instanceof NotSerializableException) {
            return -36;
        }
        if (iOException instanceof OptionalDataException) {
            return -37;
        }
        if (iOException instanceof StreamCorruptedException) {
            return -38;
        }
        if (iOException instanceof WriteAbortedException) {
            return -39;
        }
        if (iOException instanceof ProtocolException) {
            return -40;
        }
        if (iOException instanceof SSLHandshakeException) {
            return -41;
        }
        if (iOException instanceof SSLKeyException) {
            return -42;
        }
        if (iOException instanceof SSLPeerUnverifiedException) {
            return -43;
        }
        if (iOException instanceof SSLProtocolException) {
            return -44;
        }
        if (iOException instanceof BindException) {
            return -45;
        }
        if (iOException instanceof ConnectException) {
            return -46;
        }
        if (iOException instanceof NoRouteToHostException) {
            return -47;
        }
        if (iOException instanceof PortUnreachableException) {
            return -48;
        }
        if (iOException instanceof SyncFailedException) {
            return -49;
        }
        if (iOException instanceof UTFDataFormatException) {
            return -50;
        }
        if (iOException instanceof UnknownHostException) {
            return -51;
        }
        if (iOException instanceof UnknownServiceException) {
            return -52;
        }
        if (iOException instanceof UnsupportedEncodingException) {
            return -53;
        }
        return iOException instanceof ZipException ? -54 : -2;
    }

    public static C0536 m20010(Context context, String str, String str2, Bundle bundle) {
        HttpGet httpGet;
        int i;
        int i2;
        ConnectivityManager connectivityManager;
        NetworkInfo activeNetworkInfo;
        if (context != null && (connectivityManager = (ConnectivityManager) context.getSystemService("connectivity")) != null && ((activeNetworkInfo = connectivityManager.getActiveNetworkInfo()) == null || !activeNetworkInfo.isAvailable())) {
            throw new C7542();
        }
        Bundle bundle2 = bundle != null ? new Bundle(bundle) : new Bundle();
        String string = bundle2.getString("appid_for_getting_config");
        bundle2.remove("appid_for_getting_config");
        HttpClient m20011 = m20011(context, string);
        if (str2.equals("GET")) {
            String m20009 = m20009(bundle2);
            i = m20009.length() + 0;
            ۦۥ۫ۗ.ۖ("openSDK_LOG.HttpUtils", "-->openUrl2 before url =" + str);
            String concat = str.indexOf("?") == -1 ? str.concat("?") : str.concat("&");
            ۦۥ۫ۗ.ۛ("openSDK_LOG.HttpUtils", "-->openUrl2 encodedParam =" + m20009 + " -- url = " + concat);
            StringBuilder sb = new StringBuilder();
            sb.append(concat);
            sb.append(m20009);
            httpGet = new HttpGet(sb.toString());
            httpGet.addHeader("Accept-Encoding", "gzip");
        } else if (str2.equals("POST")) {
            HttpPost httpPost = new HttpPost(str);
            httpPost.addHeader("Accept-Encoding", "gzip");
            Bundle bundle3 = new Bundle();
            for (String str3 : bundle2.keySet()) {
                Object obj = bundle2.get(str3);
                if (obj instanceof byte[]) {
                    bundle3.putByteArray(str3, (byte[]) obj);
                }
            }
            if (!bundle2.containsKey("method")) {
                bundle2.putString("method", str2);
            }
            httpPost.setHeader("Content-Type", "multipart/form-data; boundary=3i2ndDfv2rTHiSisAbouNdArYfORhtTPEefj3q2f");
            httpPost.setHeader("Connection", "Keep-Alive");
            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
            byteArrayOutputStream.write(ۘۦ۫ۗ.ۘ("--3i2ndDfv2rTHiSisAbouNdArYfORhtTPEefj3q2f\r\n"));
            StringBuilder sb2 = new StringBuilder();
            int size = bundle2.size();
            int i3 = -1;
            for (String str4 : bundle2.keySet()) {
                i3++;
                Object obj2 = bundle2.get(str4);
                if (obj2 instanceof String) {
                    StringBuilder sb3 = ۬ۢ.ۗ("Content-Disposition: form-data; name=\"", str4, "\"\r\n\r\n");
                    sb3.append((String) obj2);
                    sb2.append(sb3.toString());
                    if (i3 < size - 1) {
                        sb2.append("\r\n--3i2ndDfv2rTHiSisAbouNdArYfORhtTPEefj3q2f\r\n");
                    }
                }
            }
            byteArrayOutputStream.write(ۘۦ۫ۗ.ۘ(sb2.toString()));
            if (!bundle3.isEmpty()) {
                int size2 = bundle3.size();
                byteArrayOutputStream.write(ۘۦ۫ۗ.ۘ("\r\n--3i2ndDfv2rTHiSisAbouNdArYfORhtTPEefj3q2f\r\n"));
                int i4 = -1;
                for (String str5 : bundle3.keySet()) {
                    i4++;
                    byteArrayOutputStream.write(ۘۦ۫ۗ.ۘ("Content-Disposition: form-data; name=\"" + str5 + "\"; filename=\"" + str5 + "\"\r\n"));
                    byteArrayOutputStream.write(ۘۦ۫ۗ.ۘ("Content-Type: content/unknown\r\n\r\n"));
                    byte[] byteArray = bundle3.getByteArray(str5);
                    if (byteArray != null) {
                        byteArrayOutputStream.write(byteArray);
                    }
                    if (i4 < size2 - 1) {
                        byteArrayOutputStream.write(ۘۦ۫ۗ.ۘ("\r\n--3i2ndDfv2rTHiSisAbouNdArYfORhtTPEefj3q2f\r\n"));
                    }
                }
            }
            byteArrayOutputStream.write(ۘۦ۫ۗ.ۘ("\r\n--3i2ndDfv2rTHiSisAbouNdArYfORhtTPEefj3q2f--\r\n"));
            byte[] byteArray2 = byteArrayOutputStream.toByteArray();
            int length = byteArray2.length + 0;
            byteArrayOutputStream.close();
            httpPost.setEntity(new ByteArrayEntity(byteArray2));
            httpGet = httpPost;
            i = length;
        } else {
            httpGet = null;
            i = 0;
        }
        HttpResponse execute = m20011.execute(httpGet);
        int statusCode = execute.getStatusLine().getStatusCode();
        ۦۥ۫ۗ.ۛ("openSDK_LOG.HttpUtils", "-->openUrl2 response cdoe =" + statusCode);
        if (statusCode != 200) {
            throw new C1977(۟۠ۥ.ۗ("http status code error:", statusCode));
        }
        InputStream content = execute.getEntity().getContent();
        ByteArrayOutputStream byteArrayOutputStream2 = new ByteArrayOutputStream();
        Header firstHeader = execute.getFirstHeader("Content-Encoding");
        if (firstHeader != null) {
            i2 = -1;
            if (firstHeader.getValue().toLowerCase().indexOf("gzip") > -1) {
                content = new GZIPInputStream(content);
            }
        } else {
            i2 = -1;
        }
        byte[] bArr = new byte[C1048.f3056];
        while (true) {
            int read = content.read(bArr);
            if (read == i2) {
                String str6 = new String(byteArrayOutputStream2.toByteArray(), "UTF-8");
                content.close();
                return new C0536(str6, i);
            }
            byteArrayOutputStream2.write(bArr, 0, read);
        }
    }

    public static HttpClient m20011(Context context, String str) {
        int i;
        int i2;
        ConnectivityManager connectivityManager;
        NetworkInfo activeNetworkInfo;
        int parseInt;
        SchemeRegistry schemeRegistry = new SchemeRegistry();
        schemeRegistry.register(new Scheme("http", PlainSocketFactory.getSocketFactory(), 80));
        try {
            if (Build.VERSION.SDK_INT >= 23) {
                SSLSocketFactory socketFactory = SSLSocketFactory.getSocketFactory();
                socketFactory.setHostnameVerifier(SSLSocketFactory.STRICT_HOSTNAME_VERIFIER);
                schemeRegistry.register(new Scheme("https", socketFactory, 443));
            } else {
                schemeRegistry.register(new Scheme("https", new ۨۦ۫ۗ(), 443));
            }
        } catch (Exception unused) {
            schemeRegistry.register(new Scheme("https", SSLSocketFactory.getSocketFactory(), 443));
        }
        BasicHttpParams basicHttpParams = new BasicHttpParams();
        ۬ۧ۫ۗ r2 = null;
        C2671 m7006 = context != null ? C2671.m7006(context, str) : null;
        if (m7006 != null) {
            i = m7006.m7012("Common_HttpConnectionTimeout");
            i2 = m7006.m7012("Common_SocketConnectionTimeout");
        } else {
            i = 0;
            i2 = 0;
        }
        if (i == 0) {
            i = 15000;
        }
        if (i2 == 0) {
            i2 = 30000;
        }
        HttpConnectionParams.setConnectionTimeout(basicHttpParams, i);
        HttpConnectionParams.setSoTimeout(basicHttpParams, i2);
        HttpProtocolParams.setVersion(basicHttpParams, HttpVersion.HTTP_1_1);
        HttpProtocolParams.setContentCharset(basicHttpParams, "UTF-8");
        HttpProtocolParams.setUserAgent(basicHttpParams, "AndroidSDK_" + Build.VERSION.SDK + "_" + Build.DEVICE + "_" + Build.VERSION.RELEASE);
        DefaultHttpClient defaultHttpClient = new DefaultHttpClient(new ThreadSafeClientConnManager(basicHttpParams, schemeRegistry), basicHttpParams);
        if (context != null && (connectivityManager = (ConnectivityManager) context.getSystemService("connectivity")) != null && (activeNetworkInfo = connectivityManager.getActiveNetworkInfo()) != null && activeNetworkInfo.getType() == 0) {
            String property = System.getProperty("http.proxyHost");
            String property2 = System.getProperty("http.proxyPort");
            if (!TextUtils.isEmpty(property2)) {
                try {
                    parseInt = Integer.parseInt(property2);
                } catch (NumberFormatException unused2) {
                }
                if (!TextUtils.isEmpty(property) && parseInt >= 0) {
                    r2 = new ۬ۧ۫ۗ(property, parseInt);
                }
            }
            parseInt = -1;
            if (!TextUtils.isEmpty(property)) {
                r2 = new ۬ۧ۫ۗ(property, parseInt);
            }
        }
        if (r2 != null) {
            defaultHttpClient.getParams().setParameter("http.route.default-proxy", new HttpHost(r2.ۗ, r2.ۨ));
        }
        return defaultHttpClient;
    }

    public static String m20009(Bundle bundle) {
        if (bundle == null) {
            return "";
        }
        StringBuilder sb = new StringBuilder();
        boolean z = true;
        for (String str : bundle.keySet()) {
            Object obj = bundle.get(str);
            if ((obj instanceof String) || (obj instanceof String[])) {
                if (obj instanceof String[]) {
                    if (z) {
                        z = false;
                    } else {
                        sb.append("&");
                    }
                    sb.append(ۦۛۧۗ.encode(str) + "=");
                    String[] stringArray = bundle.getStringArray(str);
                    if (stringArray != null) {
                        for (int i = 0; i < stringArray.length; i++) {
                            if (i == 0) {
                                sb.append(ۦۛۧۗ.encode(stringArray[i]));
                            } else {
                                sb.append(ۦۛۧۗ.encode("," + stringArray[i]));
                            }
                        }
                    }
                } else {
                    if (z) {
                        z = false;
                    } else {
                        sb.append("&");
                    }
                    sb.append(ۦۛۧۗ.encode(str) + "=" + ۦۛۧۗ.encode(bundle.getString(str)));
                }
            }
        }
        return sb.toString();
    }
}