琉璃水城 v2.1.5版本的 MD5 值为:000028611e9de8a8b372a1eb9e3a384d

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


package com.aispeech;

import android.content.Context;
import android.text.TextUtils;
import com.aispeech.common.Util;
import java.io.File;
import org.json.JSONException;
import org.json.JSONObject;

public final class b {
    private static boolean c = true;
    private d a;
    private boolean b;
    private com.aispeech.b.b d;
    private JSONObject e;
    private Context f;
    private String g;
    private String h;
    private c i;
    private String j;
    private boolean k;
    private String l;
    private boolean m;
    private String n;
    private boolean o;
    private String p;
    private int q;
    private int r;
    private String s;

    public b(Context context, String str) {
        this.b = false;
        this.d = null;
        this.e = null;
        this.g = "";
        this.h = "";
        this.j = "";
        this.k = false;
        this.l = "http://log.aispeech.com/sdk-monitor/sdklog";
        this.m = false;
        this.n = "";
        this.o = true;
        this.p = "http://s.api.aispeech.com/api/v3.0/score";
        this.q = 20;
        this.r = 60;
        this.f = context;
        this.i = new c();
        try {
            JSONObject jSONObject = new JSONObject(str);
            this.g = jSONObject.optString("appKey", "");
            this.h = jSONObject.optString("secretKey", "");
            this.j = jSONObject.optString("serialNumber", "");
            String optString = jSONObject.optString("provision", "");
            if (this.i != null) {
                this.i.a(this.f, optString);
            }
            if (jSONObject.has("prof")) {
                this.m = jSONObject.getJSONObject("prof").optBoolean("enable", false);
                this.n = jSONObject.getJSONObject("prof").optString("output", Util.getAvaiableExternalDataDir(context) + File.separator + "aiengine.log");
            }
            if (jSONObject.has("vad")) {
                a(new d(jSONObject.optJSONObject("vad").toString()));
            }
            if (jSONObject.has("log")) {
                this.k = jSONObject.getJSONObject("log").optBoolean("enable", true);
                this.l = jSONObject.getJSONObject("log").optString("server", "http://log.aispeech.com/sdk-monitor/sdklog");
            }
            if (jSONObject.has("cloud")) {
                this.q = jSONObject.getJSONObject("cloud").optInt("connectTimeout", 20);
                this.r = jSONObject.getJSONObject("cloud").optInt("serverTimeout", 60);
                this.p = jSONObject.getJSONObject("cloud").optString("server", "http://s.api.aispeech.com/api/v3.0/score");
            }
            if (jSONObject.has("native")) {
                this.e = jSONObject.getJSONObject("native");
            }
            if (jSONObject.has("extra")) {
                this.s = jSONObject.getJSONObject("extra").optString("pkgName", null);
            }
        } catch (JSONException e) {
            e.printStackTrace();
        }
    }

    public b(boolean z) {
        this.b = false;
        this.d = null;
        this.e = null;
        this.g = "";
        this.h = "";
        this.j = "";
        this.k = false;
        this.l = "http://log.aispeech.com/sdk-monitor/sdklog";
        this.m = false;
        this.n = "";
        this.o = true;
        this.p = "http://s.api.aispeech.com/api/v3.0/score";
        this.q = 20;
        this.r = 60;
        this.f = null;
        if (z) {
            a(new d());
        }
        this.i = new c();
    }

    private void a(d dVar) {
        if (dVar != null && !TextUtils.isEmpty(dVar.a())) {
            this.a = dVar;
            dVar.a(1);
        } else if (dVar != null) {
            dVar.a(0);
        }
    }

    public static boolean k() {
        return c;
    }

    private JSONObject l() {
        JSONObject jSONObject = new JSONObject();
        c.a(jSONObject, "enable", Integer.valueOf(this.m ? 1 : 0));
        c.a(jSONObject, "output", this.n);
        return jSONObject;
    }

    private JSONObject m() {
        JSONObject jSONObject = new JSONObject();
        c.a(jSONObject, "enable", Integer.valueOf(this.k ? 1 : 0));
        c.a(jSONObject, "server", this.l);
        return jSONObject;
    }

    private JSONObject n() {
        JSONObject jSONObject = new JSONObject();
        c.a(jSONObject, "enable", Integer.valueOf(this.o ? 1 : 0));
        c.a(jSONObject, "server", this.p);
        c.a(jSONObject, "serverTimeout", Integer.valueOf(this.r));
        c.a(jSONObject, "connectTimeout", Integer.valueOf(this.q));
        return jSONObject;
    }

    private JSONObject o() {
        JSONObject jSONObject = new JSONObject();
        c.a(jSONObject, "pkgName", this.s);
        return jSONObject;
    }

    public final JSONObject a() {
        JSONObject jSONObject = new JSONObject();
        c.a(jSONObject, "appKey", this.g);
        c.a(jSONObject, "secretKey", this.h);
        c.a(jSONObject, "provision", this.i.b(this.f));
        c.a(jSONObject, "serialNumber", this.j);
        if (this.d != null) {
            this.o = false;
        }
        if (this.d != null) {
            JSONObject a = this.d.a();
            c.a(a, "enable", 1);
            c.a(jSONObject, "native", a);
        } else if (this.e != null) {
            c.a(jSONObject, "native", this.e);
        }
        if (this.a != null) {
            c.a(jSONObject, "vad", this.a.c());
        }
        if (this.o) {
            c.a(jSONObject, "cloud", n());
        }
        if (this.k) {
            c.a(jSONObject, "log", m());
        }
        if (this.m) {
            c.a(jSONObject, "prof", l());
        }
        c.a(jSONObject, "extra", o());
        return jSONObject;
    }

    public final void a(Context context) {
        this.f = context;
    }

    public final void a(com.aispeech.b.b bVar) {
        this.d = bVar;
    }

    public final void a(String str) {
        if (TextUtils.equals(str, "i am a partner of aispeech")) {
            this.m = true;
            this.n = Util.getAvaiableExternalDataDir(this.f) + File.separator + "aiengine.log";
            com.aispeech.common.a.a = true;
            com.aispeech.common.a.a(this.f, "android.log");
        }
    }

    public final void a(boolean z) {
        this.b = z;
    }

    public final Context b() {
        return this.f;
    }

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

    public final void b(boolean z) {
        if (this.a != null) {
            this.a.a(z ? 1 : 0);
        }
    }

    public final d c() {
        return this.a;
    }

    public final void c(String str) {
        this.h = str;
    }

    public final com.aispeech.b.b d() {
        return this.d;
    }

    public final void d(String str) {
        this.j = str;
    }

    public final void e(String str) {
        this.p = str;
    }

    public final boolean e() {
        return this.b;
    }

    public final String f() {
        return this.g;
    }

    public final void f(String str) {
        this.s = str;
    }

    public final String g() {
        return this.h;
    }

    public final c h() {
        return this.i;
    }

    public final boolean i() {
        return this.a != null && this.a.b() == 1;
    }

    public final String j() {
        return this.p;
    }

    public final String toString() {
        return a().toString();
    }
}