湘游汇 v1.0版本的 MD5 值为:85338391d88b5d57da66e240ece801c7

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


package com.b;

import android.content.Context;
import android.content.SharedPreferences;
import android.net.Uri;
import android.os.Build;
import android.os.SystemClock;
import android.text.TextUtils;
import com.b.ef;
import java.net.Inet4Address;
import java.net.Inet6Address;
import java.net.InetAddress;
import java.net.InterfaceAddress;
import java.net.NetworkInterface;
import java.net.URLDecoder;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Vector;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicInteger;
import javax.crypto.Cipher;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import org.cocos2dx.lib.BuildConfig;
import org.json.JSONObject;
public final class eb {
    public static int f587a = -1;
    public static String b = "";
    public static Context c = null;
    private static volatile boolean e = true;
    private static Vector<e> f = new Vector<>();
    private static Map<String, Integer> g = new HashMap();
    private static String h = null;
    private static long i = 0;
    public static volatile boolean d = false;
    private static volatile ConcurrentHashMap<String, Long> j = new ConcurrentHashMap<>(8);
    private static volatile ConcurrentHashMap<String, Long> k = new ConcurrentHashMap<>(8);
    private static volatile ConcurrentHashMap<String, d> l = new ConcurrentHashMap<>(8);

    public interface a {
        void a(b bVar);
    }

    public static class b {
        @Deprecated
        public JSONObject f589a;
        @Deprecated
        public JSONObject b;
        public String c;
        public int d = -1;
        public long e = 0;
        public JSONObject f;
        public a g;
        public C0035b h;
        private boolean i;

        public static class a {
            public boolean f590a;
            public boolean b;
            public JSONObject c;
        }

        public static class C0035b {
            public boolean f591a;
        }
    }

    public static class c extends r {
        private String f;
        private Map<String, String> g;
        private boolean h;
        private String i;
        private String j;
        private String k;

        c(Context context, ej ejVar, String str, String str2, String str3, String str4) {
            super(context, ejVar);
            this.f = str;
            this.g = null;
            this.h = Build.VERSION.SDK_INT != 19;
            this.i = str2;
            this.j = str3;
            this.k = str4;
        }

        @Override
        public final Map<String, String> a() {
            if (TextUtils.isEmpty(this.k)) {
                return null;
            }
            HashMap hashMap = new HashMap();
            hashMap.put("host", this.k);
            return hashMap;
        }

        @Override
        public final String c() {
            String str = this.h ? "https://restsdk.amap.com/v3/iasdkauth" : "http://restsdk.amap.com/v3/iasdkauth";
            try {
                return !TextUtils.isEmpty(this.i) ? str.replace("restsdk.amap.com", this.i) : str;
            } catch (Throwable unused) {
                return str;
            }
        }

        @Override
        protected final String g() {
            return "3.0";
        }

        @Override
        public final byte[] h() {
            return null;
        }

        @Override
        public final byte[] i() {
            String w = ed.w(this.f624a);
            if (!TextUtils.isEmpty(w)) {
                w = eh.a(new StringBuilder(w).reverse().toString());
            }
            HashMap hashMap = new HashMap();
            hashMap.put("authkey", TextUtils.isEmpty(this.f) ? BuildConfig.FLAVOR : this.f);
            hashMap.put("plattype", "android");
            hashMap.put("product", this.b.a());
            hashMap.put("version", this.b.b());
            hashMap.put("output", "json");
            StringBuilder sb = new StringBuilder();
            sb.append(Build.VERSION.SDK_INT);
            hashMap.put("androidversion", sb.toString());
            hashMap.put("deviceId", w);
            hashMap.put("manufacture", Build.MANUFACTURER);
            if (this.g != null && !this.g.isEmpty()) {
                hashMap.putAll(this.g);
            }
            hashMap.put("abitype", ek.a(this.f624a));
            hashMap.put("ext", this.b.d());
            return ek.a(ek.a(hashMap));
        }

        @Override
        public final String n() {
            return !TextUtils.isEmpty(this.k) ? this.k : super.n();
        }

        @Override
        public final String p() {
            try {
                String str = this.h ? "https://restsdk.amap.com/v3/iasdkauth" : "http://restsdk.amap.com/v3/iasdkauth";
                try {
                    if (!TextUtils.isEmpty(this.j)) {
                        return str.replace("restsdk.amap.com", this.j);
                    }
                } catch (Throwable unused) {
                }
                Uri parse = Uri.parse(str);
                Uri.Builder buildUpon = parse.buildUpon();
                return buildUpon.authority("dualstack-" + parse.getAuthority()).build().toString();
            } catch (Throwable unused2) {
                return null;
            }
        }

        public final boolean r() {
            return this.h;
        }
    }

    public static class d {
        ej f592a;
        String b;
        a c;

        private d() {
        }

        d(byte b) {
            this();
        }
    }

    public static class e {
        private String f593a;
        private String b;
        private AtomicInteger c;

        public e(String str, String str2, int i) {
            this.f593a = str;
            this.b = str2;
            this.c = new AtomicInteger(i);
        }

        public static e b(String str) {
            if (TextUtils.isEmpty(str)) {
                return null;
            }
            try {
                JSONObject jSONObject = new JSONObject(str);
                return new e(jSONObject.optString("a"), jSONObject.optString(ep.i), jSONObject.optInt(ep.g));
            } catch (Throwable unused) {
                return null;
            }
        }

        public final int a() {
            if (this.c == null) {
                return 0;
            }
            return this.c.get();
        }

        public final void a(String str) {
            this.b = str;
        }

        public final String b() {
            try {
                JSONObject jSONObject = new JSONObject();
                jSONObject.put("a", this.f593a);
                jSONObject.put(ep.i, this.b);
                jSONObject.put(ep.g, this.c.get());
                return jSONObject.toString();
            } catch (Throwable unused) {
                return BuildConfig.FLAVOR;
            }
        }
    }

    public static class f {
        public static boolean f594a = true;
        public static boolean b = false;
        public static boolean c = true;
        public static int d = 0;
        public static boolean e = false;
        public static int f;
    }

    public static b a(Context context, ej ejVar, String str, String str2, String str3, String str4) {
        return b(context, ejVar, str, str2, str3, str4);
    }

    public static void a(int i2) {
        if (i2 != 2) {
            return;
        }
        try {
            e b2 = b(c, "IPV6_CONFIG_NAME");
            String a2 = ek.a(System.currentTimeMillis(), "yyyyMMdd");
            if (!a2.equals(b2.b)) {
                b2.a(a2);
                b2.c.set(0);
            }
            b2.c.incrementAndGet();
            Context context = c;
            if (b2 != null && !TextUtils.isEmpty(b2.f593a)) {
                String b3 = b2.b();
                if (TextUtils.isEmpty(b3) || context == null) {
                    return;
                }
                new en("IPV6_CONFIG_NAME").a(context, "i", b3);
            }
        } catch (Throwable unused) {
        }
    }

    public static void a(Context context) {
        if (context != null) {
            c = context.getApplicationContext();
        }
    }

    private static void a(Context context, ej ejVar, String str) {
        HashMap hashMap = new HashMap();
        hashMap.put("amap_sdk_auth_fail", "1");
        hashMap.put("amap_sdk_auth_fail_type", str);
        hashMap.put("amap_sdk_name", ejVar.a());
        hashMap.put("amap_sdk_version", ejVar.c());
        String jSONObject = new JSONObject(hashMap).toString();
        if (TextUtils.isEmpty(jSONObject)) {
            return;
        }
        try {
            ab abVar = new ab(context, "core", BuildConfig.VERSION_NAME, "O001");
            abVar.a(jSONObject);
            ac.a(abVar, context);
        } catch (dz unused) {
        }
    }

    public static synchronized void a(Context context, ej ejVar, String str, a aVar) {
        synchronized (eb.class) {
            if (context == null || ejVar == null) {
                return;
            }
            try {
                if (c == null) {
                    c = context.getApplicationContext();
                }
                String a2 = ejVar.a();
                if (TextUtils.isEmpty(a2)) {
                    return;
                }
                a(ejVar);
                if (l == null) {
                    l = new ConcurrentHashMap<>(8);
                }
                if (k == null) {
                    k = new ConcurrentHashMap<>(8);
                }
                if (j == null) {
                    j = new ConcurrentHashMap<>(8);
                }
                if (!l.containsKey(a2)) {
                    d dVar = new d((byte) 0);
                    dVar.f592a = ejVar;
                    dVar.b = str;
                    dVar.c = aVar;
                    l.put(a2, dVar);
                    j.put(a2, Long.valueOf(en.c(c, "open_common", a2)));
                }
            } catch (Throwable th) {
                eo.b(th, "at", "rglc");
            }
        }
    }

    private static void a(Context context, ej ejVar, String str, b bVar, JSONObject jSONObject) {
        boolean a2;
        b.a aVar = new b.a();
        aVar.f590a = false;
        aVar.b = false;
        bVar.g = aVar;
        try {
            String[] split = str.split(";");
            if (split != null && split.length > 0) {
                for (String str2 : split) {
                    if (jSONObject.has(str2)) {
                        bVar.f.putOpt(str2, jSONObject.get(str2));
                    }
                }
            }
        } catch (Throwable th) {
            eo.b(th, "at", "co");
        }
        if (ek.a(jSONObject, "16H")) {
            try {
                bVar.i = a(jSONObject.getJSONObject("16H").optString("able"), false);
            } catch (Throwable th2) {
                eo.b(th2, "AuthConfigManager", "load 16H");
            }
        }
        if (ek.a(jSONObject, "11K")) {
            try {
                JSONObject jSONObject2 = jSONObject.getJSONObject("11K");
                aVar.f590a = a(jSONObject2.getString("able"), false);
                if (jSONObject2.has("off")) {
                    aVar.c = jSONObject2.getJSONObject("off");
                }
            } catch (Throwable th3) {
                eo.b(th3, "AuthConfigManager", "load 11K");
            }
        }
        if (ek.a(jSONObject, "145")) {
            try {
                bVar.f589a = jSONObject.getJSONObject("145");
            } catch (Throwable th4) {
                eo.b(th4, "AuthConfigManager", "load 145");
            }
        }
        if (ek.a(jSONObject, "14D")) {
            try {
                bVar.b = jSONObject.getJSONObject("14D");
            } catch (Throwable th5) {
                eo.b(th5, "AuthConfigManager", "load 14D");
            }
        }
        if (ek.a(jSONObject, "151")) {
            try {
                JSONObject jSONObject3 = jSONObject.getJSONObject("151");
                b.C0035b c0035b = new b.C0035b();
                if (jSONObject3 != null) {
                    c0035b.f591a = a(jSONObject3.optString("able"), false);
                }
                bVar.h = c0035b;
            } catch (Throwable th6) {
                eo.b(th6, "AuthConfigManager", "load 151");
            }
        }
        if (ek.a(jSONObject, "17S")) {
            try {
                JSONObject jSONObject4 = jSONObject.getJSONObject("17S");
                if (jSONObject4 != null && (a2 = a(jSONObject4.optString("able"), false)) != e) {
                    e = a2;
                    if (context != null) {
                        SharedPreferences.Editor b2 = en.b(context, "open_common");
                        en.a(b2, "a2", a2);
                        en.a(b2);
                    }
                }
            } catch (Throwable th7) {
                eo.b(th7, "AuthConfigManager", "load 17S");
            }
        }
        if (ek.a(jSONObject, "15K")) {
            try {
                JSONObject jSONObject5 = jSONObject.getJSONObject("15K");
                if (jSONObject5 != null) {
                    boolean a3 = a(jSONObject5.optString("ucf"), f.f594a);
                    boolean a4 = a(jSONObject5.optString("fsv2"), f.b);
                    boolean a5 = a(jSONObject5.optString("usc"), f.c);
                    int optInt = jSONObject5.optInt("umv", f.d);
                    boolean a6 = a(jSONObject5.optString("ust"), f.e);
                    int optInt2 = jSONObject5.optInt("ustv", f.f);
                    if (a3 != f.f594a || a4 != f.b || a5 != f.c || optInt != f.d || a6 != f.e || optInt2 != f.d) {
                        f.f594a = a3;
                        f.b = a4;
                        f.c = a5;
                        f.d = optInt;
                        f.e = a6;
                        f.f = optInt2;
                        try {
                            SharedPreferences.Editor b3 = en.b(context, "open_common");
                            en.a(b3, "ucf", f.f594a);
                            en.a(b3, "fsv2", f.b);
                            en.a(b3, "usc", f.c);
                            en.a(b3, "umv", f.d);
                            en.a(b3, "ust", f.e);
                            en.a(b3, "ustv", f.f);
                            en.a(b3);
                        } catch (Throwable unused) {
                        }
                    }
                }
            } catch (Throwable th8) {
                eo.b(th8, "AuthConfigManager", "load 15K");
            }
        }
        if (ek.a(jSONObject, "183")) {
            try {
                s.a(ejVar, jSONObject.getJSONObject("183"));
            } catch (Throwable th9) {
                eo.b(th9, "AuthConfigManager", "load 183");
            }
        }
    }

    private static void a(Context context, ej ejVar, Throwable th) {
        a(context, ejVar, th.getMessage());
    }

    public static void a(Context context, String str) {
        ea.a(context, str);
    }

    private static void a(ej ejVar) {
        if (ejVar != null) {
            try {
                if (TextUtils.isEmpty(ejVar.a())) {
                    return;
                }
                String c2 = ejVar.c();
                if (TextUtils.isEmpty(c2)) {
                    c2 = ejVar.b();
                }
                if (TextUtils.isEmpty(c2)) {
                    return;
                }
                el.a(ejVar.a(), c2);
            } catch (Throwable unused) {
            }
        }
    }

    public static synchronized void a(final String str, boolean z, final String str2, final String str3, final String str4) {
        synchronized (eb.class) {
            try {
                if (TextUtils.isEmpty(str)) {
                    return;
                }
                if (k == null) {
                    k = new ConcurrentHashMap<>(8);
                }
                k.put(str, Long.valueOf(SystemClock.elapsedRealtime()));
                if (l == null) {
                    return;
                }
                if (l.containsKey(str)) {
                    if (TextUtils.isEmpty(str)) {
                        return;
                    }
                    if (z) {
                        s.a(true, str);
                    }
                    com.b.b.d().submit(new Runnable() {
                        @Override
                        public final void run() {
                            d dVar = (d) eb.l.get(str);
                            if (dVar == null) {
                                return;
                            }
                            a aVar = dVar.c;
                            b a2 = eb.a(eb.c, dVar.f592a, dVar.b, str2, str3, str4);
                            if (a2 == null || aVar == null) {
                                return;
                            }
                            aVar.a(a2);
                        }
                    });
                }
            } catch (Throwable th) {
                eo.b(th, "at", "lca");
            }
        }
    }

    public static void a(String str, boolean z, boolean z2, boolean z3, long j2) {
        if (TextUtils.isEmpty(str) || c == null) {
            return;
        }
        HashMap hashMap = new HashMap();
        hashMap.put("url", str);
        hashMap.put("downLevel", String.valueOf(z2));
        hashMap.put("ant", ed.q(c) == 0 ? "0" : "1");
        hashMap.put("type", z ? "6" : "4");
        hashMap.put("status", z3 ? "0" : "1");
        hashMap.put("duration", String.valueOf(j2));
        String jSONObject = new JSONObject(hashMap).toString();
        if (TextUtils.isEmpty(jSONObject)) {
            return;
        }
        try {
            ab abVar = new ab(c, "core", BuildConfig.VERSION_NAME, "O002");
            abVar.a(jSONObject);
            ac.a(abVar, c);
        } catch (dz unused) {
        }
    }

    public static boolean a() {
        Map<String, Integer> map;
        String str;
        Integer valueOf;
        e b2;
        if (c != null) {
            try {
            } catch (Throwable th) {
                eo.b(th, "at", "ipstack");
            }
            if (c != null) {
                String v = ed.v(c);
                if (TextUtils.isEmpty(h) || TextUtils.isEmpty(v) || !h.equals(v) || System.currentTimeMillis() - i >= 60000) {
                    if (!TextUtils.isEmpty(v)) {
                        h = v;
                    }
                } else if (!c()) {
                    return false;
                } else {
                    if (b()) {
                        return true;
                    }
                }
            } else if (System.currentTimeMillis() - i < 10000) {
                if (!c()) {
                }
            }
            i = System.currentTimeMillis();
            g.clear();
            Iterator it = Collections.list(NetworkInterface.getNetworkInterfaces()).iterator();
            while (it.hasNext()) {
                NetworkInterface networkInterface = (NetworkInterface) it.next();
                if (!networkInterface.getInterfaceAddresses().isEmpty()) {
                    String displayName = networkInterface.getDisplayName();
                    int i2 = 0;
                    for (InterfaceAddress interfaceAddress : networkInterface.getInterfaceAddresses()) {
                        InetAddress address = interfaceAddress.getAddress();
                        if (address instanceof Inet6Address) {
                            if (!a((Inet6Address) address)) {
                                i2 |= 2;
                            }
                        } else if (address instanceof Inet4Address) {
                            Inet4Address inet4Address = (Inet4Address) address;
                            if (!a(inet4Address) && !inet4Address.getHostAddress().startsWith(ek.c("FMTkyLjE2OC40My4"))) {
                                i2 |= 1;
                            }
                        }
                    }
                    if (i2 != 0) {
                        if (displayName != null && displayName.startsWith("wlan")) {
                            map = g;
                            str = "WIFI";
                            valueOf = Integer.valueOf(i2);
                        } else if (displayName != null && displayName.startsWith("rmnet")) {
                            map = g;
                            str = "MOBILE";
                            valueOf = Integer.valueOf(i2);
                        }
                        map.put(str, valueOf);
                    }
                }
            }
            if (!c()) {
            }
        }
        return e && (b2 = b(c, "IPV6_CONFIG_NAME")) != null && b2.a() < 5;
    }

    public static synchronized boolean a(String str) {
        synchronized (eb.class) {
            try {
            } finally {
                return false;
            }
            if (TextUtils.isEmpty(str)) {
                return false;
            }
            if (l == null) {
                return false;
            }
            if (k == null) {
                k = new ConcurrentHashMap<>(8);
            }
            if (l.containsKey(str) && !k.containsKey(str)) {
                k.put(str, Long.valueOf(SystemClock.elapsedRealtime()));
                return true;
            }
            return false;
        }
    }

    public static synchronized boolean a(String str, long j2) {
        synchronized (eb.class) {
            boolean z = false;
            if (TextUtils.isEmpty(str)) {
                return false;
            }
            if (j2 > c(str)) {
                long j3 = 0;
                if (k != null && k.containsKey(str)) {
                    j3 = k.get(str).longValue();
                }
                if (SystemClock.elapsedRealtime() - j3 > 30000) {
                    z = true;
                }
            }
            return z;
        }
    }

    public static boolean a(String str, boolean z) {
        try {
            if (TextUtils.isEmpty(str)) {
                return z;
            }
            String[] split = URLDecoder.decode(str).split("/");
            return split[split.length - 1].charAt(4) % 2 == 1;
        } catch (Throwable unused) {
            return z;
        }
    }

    private static boolean a(InetAddress inetAddress) {
        return inetAddress.isLoopbackAddress() || inetAddress.isLinkLocalAddress() || inetAddress.isAnyLocalAddress();
    }

    private static b b(Context context, ej ejVar, String str, String str2, String str3, String str4) {
        String str5;
        String str6;
        w wVar;
        byte[] bArr;
        String str7;
        String str8;
        boolean isEmpty;
        StringBuilder sb;
        List<String> list;
        b bVar = new b();
        bVar.f = new JSONObject();
        ef.a.f601a.a(context);
        b(context);
        if (context != null) {
            c = context.getApplicationContext();
        }
        String str9 = null;
        try {
            try {
                a(ejVar);
                new q();
                isEmpty = TextUtils.isEmpty(str);
            } catch (IllegalBlockSizeException e2) {
                e = e2;
            }
            try {
                if (isEmpty) {
                    str6 = str;
                } else {
                    try {
                        sb = new StringBuilder();
                        str5 = str;
                    } catch (dz e3) {
                        e = e3;
                        str5 = str;
                    } catch (Throwable unused) {
                        str5 = str;
                    }
                    try {
                        sb.append(str5);
                        sb.append(";15K;16H;17I;17S;183");
                        str6 = sb.toString();
                    } catch (dz e4) {
                        e = e4;
                        try {
                            throw e;
                        } catch (dz e5) {
                            e = e5;
                            str6 = str5;
                            wVar = null;
                            bArr = null;
                            bVar.c = e.a();
                            a(context, ejVar, e.a());
                            com.b.b.a(ejVar, "/v3/iasdkauth", e);
                            if (bArr != null) {
                            }
                        } catch (Throwable th) {
                            e = th;
                            str6 = str5;
                            wVar = null;
                            bArr = null;
                            com.b.b.a(e, "at", "lc");
                            a(context, ejVar, e);
                            if (bArr != null) {
                            }
                        }
                    } catch (Throwable unused2) {
                        str6 = str5;
                        try {
                            throw new dz("未知的错误");
                        } catch (dz e6) {
                            e = e6;
                            wVar = null;
                            bArr = null;
                            bVar.c = e.a();
                            a(context, ejVar, e.a());
                            com.b.b.a(ejVar, "/v3/iasdkauth", e);
                            if (bArr != null) {
                            }
                        } catch (Throwable th2) {
                            e = th2;
                            wVar = null;
                            bArr = null;
                            com.b.b.a(e, "at", "lc");
                            a(context, ejVar, e);
                            if (bArr != null) {
                            }
                        }
                    }
                }
            } catch (IllegalBlockSizeException e7) {
                e = e7;
                str6 = str;
                wVar = null;
                bArr = null;
                a(context, ejVar, e);
                if (bArr != null) {
                }
            }
        } catch (dz e8) {
            e = e8;
            str5 = str;
        } catch (Throwable th3) {
            e = th3;
            str5 = str;
        }
        try {
            try {
                c cVar = new c(context, ejVar, str6, str2, str3, str4);
                wVar = q.a(cVar, cVar.r());
            } catch (dz e9) {
                e = e9;
                str5 = str6;
                throw e;
            } catch (Throwable unused3) {
                throw new dz("未知的错误");
            }
        } catch (IllegalBlockSizeException e10) {
            e = e10;
            wVar = null;
            bArr = null;
            a(context, ejVar, e);
            if (bArr != null) {
            }
        }
        if (isEmpty) {
            return bVar;
        }
        if (wVar != null) {
            try {
                bArr = wVar.f634a;
                try {
                    Map<String, List<String>> map = wVar.b;
                    if (map != null && map.containsKey("lct") && (list = map.get("lct")) != null && list.size() > 0) {
                        String str10 = list.get(0);
                        if (!TextUtils.isEmpty(str10)) {
                            bVar.e = Long.valueOf(str10).longValue();
                            if (ejVar != null && bVar.e != 0) {
                                String a2 = ejVar.a();
                                if (!TextUtils.isEmpty(a2)) {
                                    b(a2, bVar.e);
                                }
                            }
                        }
                    }
                }
            } catch (dz e11) {
                e = e11;
                bArr = null;
                bVar.c = e.a();
                a(context, ejVar, e.a());
                com.b.b.a(ejVar, "/v3/iasdkauth", e);
                if (bArr != null) {
                }
            } catch (IllegalBlockSizeException e12) {
                e = e12;
                bArr = null;
                a(context, ejVar, e);
                if (bArr != null) {
                }
            } catch (Throwable th4) {
                e = th4;
                bArr = null;
                com.b.b.a(e, "at", "lc");
                a(context, ejVar, e);
                if (bArr != null) {
                }
            }
        } else {
            bArr = null;
        }
        byte[] bArr2 = new byte[16];
        byte[] bArr3 = new byte[bArr.length - 16];
        System.arraycopy(bArr, 0, bArr2, 0, 16);
        System.arraycopy(bArr, 16, bArr3, 0, bArr.length - 16);
        SecretKeySpec secretKeySpec = new SecretKeySpec(bArr2, ek.c("EQUVT"));
        Cipher cipher = Cipher.getInstance(ek.c("CQUVTL0NCQy9QS0NTNVBhZGRpbmc"));
        cipher.init(2, secretKeySpec, new IvParameterSpec(ek.c()));
        str9 = ek.a(cipher.doFinal(bArr3));
        if (bArr != null) {
            return bVar;
        }
        if (TextUtils.isEmpty(str9)) {
            str9 = ek.a(bArr);
        }
        if (TextUtils.isEmpty(str9)) {
            a(context, ejVar, "result is null");
        }
        try {
            JSONObject jSONObject = new JSONObject(str9);
            if (jSONObject.has("status")) {
                int i2 = jSONObject.getInt("status");
                if (i2 == 1) {
                    f587a = 1;
                } else if (i2 == 0) {
                    if (wVar != null) {
                        str7 = wVar.c;
                        str8 = wVar.d;
                    } else {
                        str7 = "authcsid";
                        str8 = "authgsid";
                    }
                    ek.a(context, str7, str8, jSONObject);
                    f587a = 0;
                    if (jSONObject.has("info")) {
                        b = jSONObject.getString("info");
                    }
                    String str11 = BuildConfig.FLAVOR;
                    if (jSONObject.has("infocode")) {
                        str11 = jSONObject.getString("infocode");
                    }
                    com.b.b.a(ejVar, "/v3/iasdkauth", b, str8, str7, str11);
                    if (f587a == 0) {
                        bVar.c = b;
                        return bVar;
                    }
                }
                if (jSONObject.has("ver")) {
                    bVar.d = jSONObject.getInt("ver");
                }
                if (ek.a(jSONObject, "result")) {
                    JSONObject jSONObject2 = jSONObject.getJSONObject("result");
                    a(context, ejVar, str6, bVar, jSONObject2);
                    if (ek.a(jSONObject2, "17I")) {
                        JSONObject jSONObject3 = jSONObject2.getJSONObject("17I");
                        boolean a3 = a(jSONObject3.optString("na"), false);
                        boolean a4 = a(jSONObject3.optString("aa"), false);
                        el.d = a3;
                        el.e = a4;
                    }
                    try {
                        JSONObject jSONObject4 = jSONObject2.getJSONObject("15K");
                        boolean a5 = a(jSONObject4.optString("isTargetAble"), false);
                        if (a(jSONObject4.optString("able"), false)) {
                            ef.a.f601a.a(context, a5);
                        } else {
                            ef efVar = ef.a.f601a;
                            ef.b(context);
                        }
                    } catch (Throwable unused4) {
                    }
                }
            }
        } catch (Throwable th5) {
            eo.b(th5, "at", "lc");
        }
        return bVar;
    }

    private static synchronized e b(Context context, String str) {
        e eVar;
        synchronized (eb.class) {
            if (!TextUtils.isEmpty(str)) {
                for (int i2 = 0; i2 < f.size(); i2++) {
                    eVar = f.get(i2);
                    if (eVar != null && str.equals(eVar.f593a)) {
                        break;
                    }
                }
            }
            eVar = null;
            if (eVar != null) {
                return eVar;
            }
            if (context == null) {
                return null;
            }
            e b2 = e.b(new en(str).a(context, "i"));
            String a2 = ek.a(System.currentTimeMillis(), "yyyyMMdd");
            if (b2 == null) {
                b2 = new e("IPV6_CONFIG_NAME", a2, 0);
            }
            if (!a2.equals(b2.b)) {
                b2.a(a2);
                b2.c.set(0);
            }
            f.add(b2);
            return b2;
        }
    }

    public static void b(Context context) {
        if (context == null) {
            return;
        }
        e = en.a(context, "open_common", "a2", true);
    }

    public static synchronized void b(String str) {
        synchronized (eb.class) {
            if (k == null) {
                return;
            }
            if (k.containsKey(str)) {
                k.remove(str);
            }
        }
    }

    private static synchronized void b(String str, long j2) {
        synchronized (eb.class) {
            try {
                if (l != null && l.containsKey(str)) {
                    if (j == null) {
                        j = new ConcurrentHashMap<>(8);
                    }
                    j.put(str, Long.valueOf(j2));
                    if (c != null) {
                        SharedPreferences.Editor b2 = en.b(c, "open_common");
                        en.a(b2, str, j2);
                        en.a(b2);
                    }
                }
            } catch (Throwable th) {
                eo.b(th, "at", "ucut");
            }
        }
    }

    public static synchronized void b(String str, boolean z) {
        synchronized (eb.class) {
            a(str, z, (String) null, (String) null, (String) null);
        }
    }

    public static boolean b() {
        Integer num;
        if (c == null) {
            return false;
        }
        String v = ed.v(c);
        return (TextUtils.isEmpty(v) || (num = g.get(v.toUpperCase())) == null || num.intValue() != 2) ? false : true;
    }

    public static synchronized long c(String str) {
        synchronized (eb.class) {
            try {
                if (j == null) {
                    j = new ConcurrentHashMap<>(8);
                }
                if (j.containsKey(str)) {
                    return j.get(str).longValue();
                }
            } finally {
                return 0L;
            }
            return 0L;
        }
    }

    public static boolean c() {
        Integer num;
        if (c == null) {
            return false;
        }
        String v = ed.v(c);
        return (TextUtils.isEmpty(v) || (num = g.get(v.toUpperCase())) == null || num.intValue() < 2) ? false : true;
    }

    public static void d() {
        if (d) {
            return;
        }
        try {
            d = true;
            Context context = c;
            if (context == null) {
                return;
            }
            ef.a.f601a.a(c);
            b(c);
            f.f594a = en.a(context, "open_common", "ucf", f.f594a);
            f.b = en.a(context, "open_common", "fsv2", f.b);
            f.c = en.a(context, "open_common", "usc", f.c);
            f.d = en.a(context, "open_common", "umv", f.d);
            f.e = en.a(context, "open_common", "ust", f.e);
            f.f = en.a(context, "open_common", "ustv", f.f);
        } catch (Throwable unused) {
        }
    }
}