流利说-英语 v8.47.26版本的 MD5 值为:0079dce5ff96e6cdbc95c261b3f51387

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


package com.geetest.onelogin.l;

import android.app.Application;
import android.content.Context;
import android.os.Build;
import android.os.Message;
import android.text.TextUtils;
import com.geetest.onelogin.p.f;
import com.geetest.onelogin.p.h;
import com.geetest.onelogin.p.j;
import com.geetest.onelogin.t.ac;
import com.geetest.onelogin.t.k;
import com.geetest.onelogin.t.m;
import com.geetest.onelogin.t.s;
import com.geetest.onelogin.t.x;
import com.geetest.onelogin.t.y;
import java.util.concurrent.TimeUnit;
import org.json.JSONException;
import org.json.JSONObject;

public class b extends a {

    private boolean f1190b = false;

    public void a(com.geetest.onelogin.p.e eVar, h hVar) {
        this.f1190b = false;
        if (eVar == com.geetest.onelogin.p.e.EMPTY) {
            c(hVar);
            return;
        }
        if (eVar == com.geetest.onelogin.p.e.FAILURE) {
            a(hVar);
            return;
        }
        if (eVar == com.geetest.onelogin.p.e.SUCCESS) {
            b(hVar);
            return;
        }
        if (eVar == com.geetest.onelogin.p.e.RUNNING) {
            k.a("当前节点: " + com.geetest.onelogin.p.d.GET_OP_CONFIG + ", 前置节点 RUNNING: " + com.geetest.onelogin.p.d.GET_OP_CONFIG);
        }
    }

    public void c(final h hVar) {
        if (!this.f1190b) {
            this.f1189a = com.geetest.onelogin.p.e.RUNNING;
        }
        k.b("GetOpConfigNode enter");
        d(hVar);
        y.a().a("PRE_GET_TOKEN:G");
        final j c = hVar.c();
        if (TextUtils.isEmpty(f.a().b())) {
            this.f1189a = com.geetest.onelogin.p.e.FAILURE;
            k.b("appId is empty,not request op info");
            return;
        }
        String a2 = s.a();
        String a3 = s.a(a2);
        c.d(a2);
        c.e(a2);
        c.c(a3);
        a();
        com.geetest.onelogin.o.b.a().a(com.geetest.onelogin.o.a.c.a(hVar.a(), c), new com.geetest.onelogin.o.c<com.geetest.onelogin.p.b>() {
            @Override
            public void a(int i, String str, com.geetest.onelogin.p.b bVar) {
                if (c.h()) {
                    k.b("请求被关闭");
                    return;
                }
                if (i == 200) {
                    y.a().b("PRE_GET_TOKEN:G");
                    com.geetest.onelogin.t.d.b("PreGetTokenTask onPostExecute configOpFinished = " + c.i().e());
                    y.a().a("PRE_GET_TOKEN:O");
                    b.this.f1189a = com.geetest.onelogin.p.e.SUCCESS;
                    int d = c.i().d();
                    if (d > 0) {
                        b.this.c(c);
                        long j = d;
                        c.b(x.a().a(new Runnable() {
                            @Override
                            public void run() {
                                b.this.f1190b = true;
                                b.this.c(hVar);
                            }
                        }, j, j, TimeUnit.SECONDS));
                    }
                    if (!b.this.f1190b) {
                        b.this.e(hVar);
                    }
                } else if (i == -1) {
                    b.this.f1189a = com.geetest.onelogin.p.e.FAILURE;
                    k.d("Current network is unavailable");
                    hVar.b(c, "-20200", "Current network is unavailable");
                } else if (i == -2) {
                    b.this.f1189a = com.geetest.onelogin.p.e.FAILURE;
                    hVar.b(c, "-50100", "Currently pre_get_token request error");
                } else if (i == -3) {
                    b.this.f1189a = com.geetest.onelogin.p.e.FAILURE;
                    hVar.b(c, "-50101", b.this.b(str));
                } else if (i == -4) {
                    b.this.f1189a = com.geetest.onelogin.p.e.FAILURE;
                    hVar.c(c, "-50100", str);
                } else {
                    b.this.f1189a = com.geetest.onelogin.p.e.FAILURE;
                    JSONObject jSONObject = null;
                    try {
                        jSONObject = new JSONObject(str);
                    } catch (JSONException e) {
                        e.printStackTrace();
                    }
                    hVar.a(c, "-50100", jSONObject, true);
                }
                k.b("GetOpConfigNode leave");
            }
        });
    }

    private void d(final h hVar) {
        if (hVar.c().p()) {
            return;
        }
        hVar.c().d(true);
        com.geetest.onelogin.i.b.a(hVar.a());
        x.a().a(new Runnable() {
            @Override
            public void run() {
                com.geetest.onelogin.a.c.a();
                com.geetest.onelogin.h.a.a(hVar.a());
                com.geetest.onelogin.q.a.b();
            }
        });
        y.a().a(false);
        com.geetest.onelogin.t.d.a(1);
        com.geetest.onelogin.h.c.b(hVar.a());
        k.b("SDK 版本为: 2.8.7.1, Android 版本为: " + Build.VERSION.RELEASE);
        if (!com.geetest.onelogin.i.b.d()) {
            k.e("请尽量只在主进程初始化 OneLogin SDK");
        } else {
            com.geetest.onelogin.i.a.a().a((Application) hVar.a());
            m.b().c();
        }
    }

    private void a() {
        String b2 = com.geetest.onelogin.config.b.b("reset", "teser");
        k.b("prepareNetwork tag :" + b2);
        if (TextUtils.equals(b2, "teser") && ac.a().a(com.geetest.onelogin.i.b.a())) {
            k.b("needResetNetwork");
            com.geetest.onelogin.config.b.a("reset", "reset");
            ac.a().b(com.geetest.onelogin.i.b.a());
            a(f.a().c());
            ac.a().c(com.geetest.onelogin.i.b.a());
        }
    }

    private void a(String str) {
        com.geetest.onelogin.o.b.a().a(com.geetest.onelogin.o.a.d.a(com.geetest.onelogin.i.b.a(), str), null);
    }

    public String b(String str) {
        try {
            JSONObject jSONObject = new JSONObject(str);
            if (jSONObject.has("status") && jSONObject.has("error_msg")) {
                int i = jSONObject.getInt("status");
                String string = jSONObject.getString("error_msg");
                Context a2 = com.geetest.onelogin.i.b.a();
                String b2 = f.a().b();
                String packageName = a2.getPackageName();
                String a3 = com.geetest.onelogin.e.f.a(a2);
                if (i == 11100) {
                    k.d(string + "(APP_ID 用错了), 当前产品ID APP_ID:" + b2 + ", 包名 pkgName:" + packageName + ", 包签名 Sign:" + a3);
                    StringBuilder sb = new StringBuilder();
                    sb.append("The pkgName ");
                    sb.append(packageName);
                    sb.append(" and APP_ID ");
                    sb.append(b2);
                    sb.append(" is not matched, the APP_ID is wrong");
                    jSONObject.put("msg", sb.toString());
                } else if (i == 11102) {
                    k.d(string + "(应用包名与管理后台配置的包名不一致), 当前产品ID APP_ID:" + b2 + ", 包名 pkgName:" + packageName + ", 包签名 Sign:" + a3);
                    StringBuilder sb2 = new StringBuilder();
                    sb2.append("The pkgName ");
                    sb2.append(packageName);
                    sb2.append(" and APP_ID ");
                    sb2.append(b2);
                    sb2.append(" is not matched, the pkgName is wrong");
                    jSONObject.put("msg", sb2.toString());
                }
                return jSONObject.toString();
            }
        } catch (Exception e) {
            k.d("checkAppId got exception:" + e.toString() + "\nresult:" + str);
        }
        return str;
    }

    public void a(h hVar) {
        c(hVar);
    }

    public void b(h hVar) {
        e(hVar);
    }

    public void e(h hVar) {
        Message obtain = Message.obtain();
        obtain.what = com.geetest.onelogin.p.d.GET_OP_CONFIG.value;
        obtain.arg1 = com.geetest.onelogin.p.e.SUCCESS.value;
        hVar.b().sendMessage(obtain);
    }
}