小源钱包 v1.0.0版本的 MD5 值为:2fddb51fa9867693f901004082511bea

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


package com.loc;

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 y1 {
    private static String a() {
        String str;
        try {
            str = Proxy.getDefaultHost();
        } catch (Throwable th) {
            j.m(th, "pu", "gdh");
            str = null;
        }
        return str == null ? "null" : str;
    }

    private static String b(String str) {
        return a2.u(str);
    }

    public static java.net.Proxy c(Context context) {
        try {
            return Build.VERSION.SDK_INT >= 11 ? d(context, new URI("http://restsdk.amap.com")) : f(context);
        } catch (Throwable th) {
            j.m(th, "pu", "gp");
            return null;
        }
    }

    private static java.net.Proxy d(Context context, URI uri) {
        java.net.Proxy proxy;
        if (g(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) {
                j.m(th, "pu", "gpsc");
            }
        }
        return null;
    }

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

    private static java.net.Proxy f(Context context) {
        Cursor cursor;
        int i10;
        String P;
        int i11;
        Throwable th;
        boolean z10;
        boolean z11;
        int e10;
        boolean z12;
        boolean z13;
        if (g(context)) {
            Uri parse = Uri.parse("content://telephony/carriers/preferapn");
            ?? contentResolver = context.getContentResolver();
            String str = null;
            boolean z14 = false;
            try {
                try {
                    cursor = contentResolver.query(parse, null, null, null, null);
                } catch (Throwable th2) {
                    if (contentResolver != 0) {
                        try {
                            contentResolver.close();
                        } catch (Throwable th3) {
                            j.m(th3, "pu", "gPx2");
                        }
                    }
                    throw th2;
                }
            } catch (SecurityException e11) {
                e = e11;
                cursor = null;
                str = null;
            } catch (Throwable th4) {
                th = th4;
                cursor = null;
                str = null;
            }
            if (cursor != null) {
                try {
                } catch (SecurityException e12) {
                    e = e12;
                    str = null;
                    i10 = -1;
                    j.m(e, "pu", "ghp");
                    P = s1.P(context);
                    if (P != null) {
                    }
                    if (cursor != null) {
                    }
                    i10 = i11;
                    if (str != null) {
                    }
                    if (z14) {
                    }
                    return null;
                } catch (Throwable th5) {
                    th = th5;
                    str = null;
                    i10 = -1;
                    j.m(th, "pu", "gPx1");
                    th.printStackTrace();
                    if (cursor != null) {
                    }
                    if (str != null) {
                    }
                    if (z14) {
                    }
                    return null;
                }
                if (cursor.moveToFirst()) {
                    String string = cursor.getString(cursor.getColumnIndex("apn"));
                    i10 = parse;
                    if (string != null) {
                        Locale locale = Locale.US;
                        string = string.toLowerCase(locale);
                        i10 = locale;
                    }
                    try {
                        try {
                            if (string != null && string.contains("ctwap")) {
                                String a10 = a();
                                e10 = e();
                                if (TextUtils.isEmpty(a10) || a10.equals("null")) {
                                    str = null;
                                    z13 = false;
                                } else {
                                    str = a10;
                                    z13 = true;
                                }
                                if (!z13) {
                                    str = b("QMTAuMC4wLjIwMA==");
                                }
                            } else if (string != null && string.contains("wap")) {
                                String a11 = a();
                                e10 = e();
                                if (TextUtils.isEmpty(a11) || a11.equals("null")) {
                                    str = null;
                                    z12 = false;
                                } else {
                                    str = a11;
                                    z12 = true;
                                }
                                if (!z12) {
                                    str = b("QMTAuMC4wLjE3Mg==");
                                }
                            }
                            if (cursor != null) {
                                try {
                                    cursor.close();
                                } catch (Throwable th6) {
                                    th = th6;
                                    j.m(th, "pu", "gPx2");
                                    i10 = i11;
                                    if (str != null) {
                                    }
                                    if (z14) {
                                    }
                                    return null;
                                }
                            }
                        } catch (SecurityException e13) {
                            e = e13;
                            str = null;
                            j.m(e, "pu", "ghp");
                            P = s1.P(context);
                            if (P != null) {
                                String lowerCase = P.toLowerCase(Locale.US);
                                String a12 = a();
                                int e14 = e();
                                if (lowerCase.indexOf("ctwap") != -1) {
                                    if (TextUtils.isEmpty(a12) || a12.equals("null")) {
                                        z11 = false;
                                    } else {
                                        str = a12;
                                        z11 = true;
                                    }
                                    if (!z11) {
                                        str = b("QMTAuMC4wLjIwMA==");
                                    }
                                } else {
                                    if (lowerCase.indexOf("wap") != -1) {
                                        if (TextUtils.isEmpty(a12) || a12.equals("null")) {
                                            z10 = false;
                                        } else {
                                            str = a12;
                                            z10 = true;
                                        }
                                        if (!z10) {
                                            str = b("QMTAuMC4wLjE3Mg==");
                                        }
                                        i11 = 80;
                                    }
                                    i11 = e14;
                                }
                            } else {
                                i11 = i10;
                            }
                            if (cursor != null) {
                                try {
                                    cursor.close();
                                } catch (Throwable th7) {
                                    th = th7;
                                    j.m(th, "pu", "gPx2");
                                    i10 = i11;
                                    if (str != null) {
                                    }
                                    if (z14) {
                                    }
                                    return null;
                                }
                            }
                            i10 = i11;
                            if (str != null) {
                            }
                            if (z14) {
                            }
                            return null;
                        } catch (Throwable th8) {
                            th = th8;
                            str = null;
                            j.m(th, "pu", "gPx1");
                            th.printStackTrace();
                            if (cursor != null) {
                                try {
                                    cursor.close();
                                } catch (Throwable th9) {
                                    j.m(th9, "pu", "gPx2");
                                }
                            }
                            if (str != null) {
                            }
                            if (z14) {
                            }
                            return null;
                        }
                    } catch (SecurityException e15) {
                        e = e15;
                        j.m(e, "pu", "ghp");
                        P = s1.P(context);
                        if (P != null) {
                        }
                        if (cursor != null) {
                        }
                        i10 = i11;
                        if (str != null) {
                        }
                        if (z14) {
                        }
                        return null;
                    } catch (Throwable th10) {
                        th = th10;
                        j.m(th, "pu", "gPx1");
                        th.printStackTrace();
                        if (cursor != null) {
                        }
                        if (str != null) {
                        }
                        if (z14) {
                        }
                        return null;
                    }
                    i10 = i11;
                    if (str != null) {
                        try {
                            if (str.length() > 0 && i10 != -1) {
                                z14 = true;
                            }
                        } catch (Throwable th11) {
                            p6.l.e(th11, "pu", "gp2");
                            th11.printStackTrace();
                        }
                    }
                    if (z14) {
                        return new java.net.Proxy(Proxy.Type.HTTP, InetSocketAddress.createUnresolved(str, i10));
                    }
                }
            }
            str = null;
            i11 = -1;
            if (cursor != null) {
            }
            i10 = i11;
            if (str != null) {
            }
            if (z14) {
            }
        }
        return null;
    }

    private static boolean g(Context context) {
        return s1.L(context) == 0;
    }
}