消灭砖块 v1.0版本的 MD5 值为:d95cd8f25e3b6cbcaea370c627b9b26e

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


package com.lyhtgh.pay;

import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.InetSocketAddress;
import java.net.Proxy;
import java.net.URL;
public class g {
    private Context a;
    private HttpURLConnection b;

    public g(Context context) {
        this.a = context;
    }

    public void a() {
        try {
            if (this.b != null) {
                this.b.disconnect();
                this.b = null;
            }
        } catch (Exception e) {
        }
    }

    public Proxy b() {
        Proxy proxy;
        if (this.a == null) {
            return null;
        }
        NetworkInfo activeNetworkInfo = ((ConnectivityManager) this.a.getSystemService("connectivity")).getActiveNetworkInfo();
        if (activeNetworkInfo != null && activeNetworkInfo.isAvailable() && activeNetworkInfo.getType() == 0) {
            String defaultHost = android.net.Proxy.getDefaultHost();
            int defaultPort = android.net.Proxy.getDefaultPort();
            if (defaultHost != null) {
                proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(defaultHost, defaultPort));
                return proxy;
            }
        }
        proxy = null;
        return proxy;
    }

    public String a(String str) {
        if (str == null) {
            return null;
        }
        if (str.indexOf("http://") != -1) {
            return str.substring("http://".length(), str.indexOf("/", "http://".length()));
        }
        return str.substring(0, str.indexOf("/"));
    }

    public String b(String str) {
        if (str == null) {
            return null;
        }
        if (str.indexOf("http://") != -1) {
            return str.substring(str.indexOf("/", "http://".length()), str.length());
        }
        return str.substring(str.indexOf("/"), str.length());
    }

    public void a(String str, String str2, String str3, String str4, int i) {
        OutputStream outputStream;
        String str5;
        URL url;
        OutputStream outputStream2 = null;
        a();
        try {
            Proxy b = b();
            if (b == null || b.toString().indexOf("10.0.0.172") == -1) {
                str5 = null;
            } else {
                String a = a(str3);
                str3 = "http:/" + b.address().toString() + b(str3);
                str5 = a;
            }
            if ("GET".equals(str4) && str != null) {
                url = new URL(String.valueOf(str3) + "?" + str);
            } else {
                url = new URL(str3);
            }
            this.b = (HttpURLConnection) url.openConnection();
            this.b.setRequestMethod(str4);
            this.b.setConnectTimeout(25000);
            this.b.setReadTimeout(i);
            if ("POST".equals(str4)) {
                this.b.setDoOutput(true);
                this.b.setDoInput(true);
            }
            if (b != null && str5 != null && b.toString().indexOf("10.0.0.172") != -1) {
                this.b.setRequestProperty("X-Online-Host", str5);
            }
            this.b.setRequestProperty("Charset", com.umeng.common.b.e.f);
            this.b.setRequestProperty("Content-type", str2);
            this.b.connect();
            if ("POST".equals(str4)) {
                outputStream = this.b.getOutputStream();
                try {
                    outputStream.write(str.getBytes(com.umeng.common.b.e.f));
                    outputStream.flush();
                } catch (Exception e) {
                    if (outputStream != null) {
                        try {
                            outputStream.close();
                        } catch (Exception e2) {
                        }
                    }
                    a();
                    return;
                } catch (Throwable th) {
                    outputStream2 = outputStream;
                    th = th;
                    if (outputStream2 != null) {
                        try {
                            outputStream2.close();
                        } catch (Exception e3) {
                        }
                    }
                    a();
                    throw th;
                }
            } else {
                outputStream = null;
            }
            this.b.getInputStream();
            if (outputStream != null) {
                try {
                    outputStream.close();
                } catch (Exception e4) {
                }
            }
            a();
        } catch (Exception e5) {
            outputStream = null;
        } catch (Throwable th2) {
            th = th2;
        }
    }
}