工作空间 v3.6.5.2版本的 MD5 值为:58e65af156c65a63bf64ed2e64960853

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


package com.loc;

import android.content.ContentResolver;
import android.content.Context;
import android.database.Cursor;
import android.net.Proxy;
import android.net.Uri;
import android.os.Build;
import android.text.TextUtils;
import java.net.InetSocketAddress;
import java.net.Proxy;
import java.net.ProxySelector;
import java.net.URI;
import java.util.List;
import java.util.Locale;
public final class pb {
    private static String a() {
        String str;
        try {
            str = Proxy.getDefaultHost();
        } catch (Throwable th) {
            C0417d.b(th, "pe", "gdh");
            str = null;
        }
        return str == null ? "null" : str;
    }

    public static java.net.Proxy a(Context context) {
        try {
            return Build.VERSION.SDK_INT >= 11 ? a(context, new URI("http://restapi.amap.com")) : b(context);
        } catch (Throwable th) {
            C0417d.b(th, "pu", "gp");
            return null;
        }
    }

    private static java.net.Proxy a(Context context, URI uri) {
        java.net.Proxy proxy;
        if (c(context)) {
            try {
                List<java.net.Proxy> select = ProxySelector.getDefault().select(uri);
                if (select == null || select.isEmpty() || (proxy = select.get(0)) == null) {
                    return null;
                }
                if (proxy.type() == Proxy.Type.DIRECT) {
                    return null;
                }
                return proxy;
            } catch (Throwable th) {
                C0417d.b(th, "pu", "gpsc");
            }
        }
        return null;
    }

    private static int b() {
        try {
            return android.net.Proxy.getDefaultPort();
        } catch (Throwable th) {
            C0417d.b(th, "pu", "gdp");
            return -1;
        }
    }

    private static java.net.Proxy b(Context context) {
        String str;
        Cursor cursor;
        Throwable th;
        ?? r10;
        int i;
        Throwable th2;
        String r;
        boolean z;
        boolean z2;
        boolean z3;
        String str2;
        String c2;
        boolean z4;
        String str3;
        if (!c(context)) {
            return null;
        }
        Uri parse = Uri.parse("content://telephony/carriers/preferapn");
        ContentResolver contentResolver = context.getContentResolver();
        String str4 = null;
        int i2 = 80;
        boolean z5 = false;
        try {
            try {
                cursor = contentResolver.query(parse, null, null, null, null);
            } catch (Throwable th3) {
                th = th3;
                r10 = contentResolver;
                if (r10 != 0) {
                    try {
                        r10.close();
                    } catch (Throwable th4) {
                        C0417d.b(th4, "ProxyUtil", "getHostProxy2");
                    }
                }
                throw th;
            }
        } catch (SecurityException e2) {
            e = e2;
            cursor = null;
        } catch (Throwable th5) {
            th = th5;
            str = null;
            cursor = null;
        }
        if (cursor != null) {
            try {
            } catch (SecurityException e3) {
                e = e3;
                i = -1;
                str4 = null;
                C0417d.b(e, "pu", "ghp");
                r = mb.r(context);
                if (r != null) {
                    String lowerCase = r.toLowerCase(Locale.US);
                    String a2 = a();
                    int b2 = b();
                    if (lowerCase.indexOf("ctwap") != -1) {
                        if (TextUtils.isEmpty(a2) || a2.equals("null")) {
                            a2 = str4;
                            z2 = false;
                        } else {
                            z2 = true;
                        }
                        if (!z2) {
                            a2 = sb.c("QMTAuMC4wLjIwMA==");
                        }
                        if (b2 == -1) {
                            str = a2;
                        } else {
                            str = a2;
                            i2 = b2;
                        }
                    } else if (lowerCase.indexOf("wap") != -1) {
                        if (TextUtils.isEmpty(a2) || a2.equals("null")) {
                            a2 = str4;
                            z = false;
                        } else {
                            z = true;
                        }
                        if (!z) {
                            a2 = sb.c("QMTAuMC4wLjE3Mg==");
                        }
                        str = a2;
                    } else {
                        str = str4;
                        i2 = b2;
                    }
                } else {
                    i2 = i;
                    str = str4;
                }
                if (cursor != null) {
                    try {
                        cursor.close();
                    } catch (Throwable th6) {
                        th2 = th6;
                        C0417d.b(th2, "ProxyUtil", "getHostProxy2");
                        int i3 = i2;
                        if (str != null) {
                        }
                        if (z5) {
                        }
                    }
                }
                int i32 = i2;
                if (str != null) {
                }
                if (z5) {
                }
            } catch (Throwable th7) {
                th = th7;
                str = null;
                i2 = -1;
                C0417d.b(th, "ProxyUtil", "getHostProxy1");
                th.printStackTrace();
                if (cursor != null) {
                    try {
                        cursor.close();
                    } catch (Throwable th8) {
                        th2 = th8;
                        C0417d.b(th2, "ProxyUtil", "getHostProxy2");
                        int i322 = i2;
                        if (str != null) {
                        }
                        if (z5) {
                        }
                    }
                }
                int i3222 = i2;
                if (str != null) {
                }
                if (z5) {
                }
            }
            if (cursor.moveToFirst()) {
                String string = cursor.getString(cursor.getColumnIndex("apn"));
                i = parse;
                if (string != null) {
                    Locale locale = Locale.US;
                    string = string.toLowerCase(locale);
                    i = locale;
                }
                try {
                    try {
                    } catch (SecurityException e4) {
                        e = e4;
                        str4 = null;
                        C0417d.b(e, "pu", "ghp");
                        r = mb.r(context);
                        if (r != null) {
                        }
                        if (cursor != null) {
                        }
                        int i32222 = i2;
                        if (str != null) {
                        }
                        if (z5) {
                        }
                    } catch (Throwable th9) {
                        th = th9;
                        i2 = i;
                        str = null;
                        C0417d.b(th, "ProxyUtil", "getHostProxy1");
                        th.printStackTrace();
                        if (cursor != null) {
                        }
                        int i322222 = i2;
                        if (str != null) {
                        }
                        if (z5) {
                        }
                    }
                } catch (SecurityException e5) {
                    e = e5;
                    C0417d.b(e, "pu", "ghp");
                    r = mb.r(context);
                    if (r != null) {
                    }
                    if (cursor != null) {
                    }
                    int i3222222 = i2;
                    if (str != null) {
                    }
                    if (z5) {
                    }
                } catch (Throwable th10) {
                    th = th10;
                    i2 = i;
                    str = null;
                    C0417d.b(th, "ProxyUtil", "getHostProxy1");
                    th.printStackTrace();
                    if (cursor != null) {
                    }
                    int i32222222 = i2;
                    if (str != null) {
                    }
                    if (z5) {
                    }
                }
                if (string != null && string.contains("ctwap")) {
                    String a3 = a();
                    int b3 = b();
                    if (TextUtils.isEmpty(a3) || a3.equals("null")) {
                        z4 = false;
                        str3 = null;
                    } else {
                        str3 = a3;
                        z4 = true;
                    }
                    c2 = !z4 ? sb.c("QMTAuMC4wLjIwMA==") : str3;
                    if (b3 != -1) {
                        i2 = b3;
                    }
                } else if (string != null && string.contains("wap")) {
                    String a4 = a();
                    int b4 = b();
                    if (TextUtils.isEmpty(a4) || a4.equals("null")) {
                        z3 = false;
                        str2 = null;
                    } else {
                        str2 = a4;
                        z3 = true;
                    }
                    c2 = !z3 ? sb.c("QMTAuMC4wLjE3Mg==") : str2;
                    if (b4 != -1) {
                        str = c2;
                        i2 = b4;
                        if (cursor != null) {
                            try {
                                cursor.close();
                            } catch (Throwable th11) {
                                th2 = th11;
                                C0417d.b(th2, "ProxyUtil", "getHostProxy2");
                                int i322222222 = i2;
                                if (str != null) {
                                }
                                if (z5) {
                                }
                            }
                        }
                        int i3222222222 = i2;
                        if (str != null) {
                            try {
                                if (str.length() > 0 && i3222222222 != -1) {
                                    z5 = true;
                                }
                            } catch (Throwable th12) {
                                vb.a(th12, "pu", "gp2");
                                th12.printStackTrace();
                                return null;
                            }
                        }
                        if (z5) {
                            return null;
                        }
                        return new java.net.Proxy(Proxy.Type.HTTP, InetSocketAddress.createUnresolved(str, i3222222222));
                    }
                }
                str = c2;
                if (cursor != null) {
                }
                int i32222222222 = i2;
                if (str != null) {
                }
                if (z5) {
                }
            }
        }
        str = null;
        i2 = -1;
        if (cursor != null) {
        }
        int i322222222222 = i2;
        if (str != null) {
        }
        if (z5) {
        }
    }

    private static boolean c(Context context) {
        return mb.p(context) == 0;
    }
}