多宝语音 v1.5.0版本的 MD5 值为:dcfcdc4e4f0a662eb0256f88e60f66b1

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


package xn;

import android.content.Context;
import android.os.SystemClock;
import android.util.Base64;
import androidx.exifinterface.media.ExifInterface;
import com.cmic.gen.sdk.auth.GenAuthnHelper;
import com.cmic.gen.sdk.auth.GenTokenListener;
import com.netease.lava.nertc.foreground.Authenticate;
import java.util.concurrent.ExecutorService;
import org.json.JSONObject;

public class m {

    public static boolean f49149e = false;

    public static volatile m f49150f;

    public Context f49151a;

    public GenAuthnHelper f49152b;

    public c f49153c;

    public String f49154d;

    public class a implements Runnable {

        public final boolean f49155b;

        public final String f49156c;

        public final long f49157d;

        public final long f49158e;

        public a(boolean z11, String str, long j11, long j12) {
            this.f49155b = z11;
            this.f49156c = str;
            this.f49157d = j11;
            this.f49158e = j12;
        }

        @Override
        public void run() {
            char c11;
            rn.b.f43910p = SystemClock.uptimeMillis();
            long uptimeMillis = SystemClock.uptimeMillis();
            try {
                yn.n.c("ProcessShanYanLogger", "startOpenLoginAuth isFinish", Boolean.valueOf(this.f49155b));
                m.this.q();
                String str = this.f49156c;
                int hashCode = str.hashCode();
                if (hashCode != 2078865) {
                    if (hashCode == 2079826 && str.equals("CUCC")) {
                        c11 = 0;
                        if (c11 != 0) {
                            m.this.n(this.f49156c, this.f49155b, uptimeMillis, this.f49157d, this.f49158e);
                            return;
                        } else if (c11 != 1) {
                            m.this.r(this.f49156c, this.f49155b, uptimeMillis, this.f49157d, this.f49158e);
                            return;
                        } else {
                            m.this.f(this.f49156c, this.f49155b, uptimeMillis, this.f49157d, this.f49158e);
                            return;
                        }
                    }
                    c11 = 65535;
                    if (c11 != 0) {
                    }
                } else {
                    if (str.equals("CTCC")) {
                        c11 = 1;
                        if (c11 != 0) {
                        }
                    }
                    c11 = 65535;
                    if (c11 != 0) {
                    }
                }
            } catch (Exception e11) {
                rn.b.f43914t.getAndSet(true);
                e11.printStackTrace();
                yn.n.d("ExceptionShanYanTask", "startOpenLoginAuth Exception_e=", e11);
                m.this.b(1014, this.f49156c, yn.e.a(1014, e11.getClass().getSimpleName(), "startOpenLoginAuth--Exception_e=" + e11.toString()), 3, "1014", e11.getClass().getSimpleName(), uptimeMillis, this.f49157d, this.f49158e);
            }
        }
    }

    public class b implements GenTokenListener {

        public final String f49160a;

        public final boolean f49161b;

        public final long f49162c;

        public final long f49163d;

        public final long f49164e;

        public b(String str, boolean z11, long j11, long j12, long j13) {
            this.f49160a = str;
            this.f49161b = z11;
            this.f49162c = j11;
            this.f49163d = j12;
            this.f49164e = j13;
        }

        @Override
        public void onGetTokenComplete(int i11, JSONObject jSONObject) {
            GenAuthnHelper genAuthnHelper;
            m mVar;
            String str;
            String str2;
            boolean z11;
            long j11;
            long j12;
            long j13;
            try {
                if (jSONObject != null) {
                    if (jSONObject.has(com.taobao.agoo.a.a.b.JSON_ERRORCODE)) {
                        int optInt = jSONObject.optInt(com.taobao.agoo.a.a.b.JSON_ERRORCODE);
                        if (jSONObject.has("token") && optInt == 103000) {
                            String optString = jSONObject.optString("token");
                            if (yn.e.c(optString)) {
                                if (1 == yn.t.e(m.this.f49151a, "cmccSwitch", 1)) {
                                    mVar = m.this;
                                    str = this.f49160a;
                                    str2 = "1";
                                    z11 = this.f49161b;
                                    j11 = this.f49162c;
                                    j12 = this.f49163d;
                                    j13 = this.f49164e;
                                } else {
                                    mVar = m.this;
                                    str = this.f49160a;
                                    str2 = "5";
                                    z11 = this.f49161b;
                                    j11 = this.f49162c;
                                    j12 = this.f49163d;
                                    j13 = this.f49164e;
                                }
                                mVar.e(str, str2, optString, z11, j11, j12, j13);
                                return;
                            }
                            m.this.b(com.alipay.sdk.m.o0.b.f10283d, this.f49160a, yn.e.a(optInt, yn.a.b(jSONObject), "loginAuth()" + jSONObject.toString()), 4, optInt + "", yn.a.b(jSONObject), this.f49162c, this.f49163d, this.f49164e);
                            return;
                        }
                        if (optInt != 102101 && optInt != 102102 && optInt != 102103 && optInt != 200025 && optInt != 102507) {
                            if (optInt != 200020) {
                                m.this.b(com.alipay.sdk.m.o0.b.f10283d, this.f49160a, yn.e.a(optInt, yn.a.b(jSONObject), "loginAuth()" + jSONObject.toString()), 4, optInt + "", yn.a.b(jSONObject), this.f49162c, this.f49163d, this.f49164e);
                                if (this.f49161b && m.this.f49152b != null) {
                                    genAuthnHelper = m.this.f49152b;
                                } else {
                                    return;
                                }
                            } else {
                                return;
                            }
                        }
                        m.this.b(1007, this.f49160a, yn.e.a(optInt, yn.a.b(jSONObject), "loginAuth()" + jSONObject.toString()), 4, optInt + "", yn.a.b(jSONObject), this.f49162c, this.f49163d, this.f49164e);
                        if (this.f49161b && m.this.f49152b != null) {
                            genAuthnHelper = m.this.f49152b;
                        } else {
                            return;
                        }
                    } else {
                        m.this.b(com.alipay.sdk.m.o0.b.f10283d, this.f49160a, yn.e.a(com.alipay.sdk.m.o0.b.f10283d, yn.a.b(jSONObject), "loginAuth()" + jSONObject.toString()), 4, "1003", yn.a.b(jSONObject), this.f49162c, this.f49163d, this.f49164e);
                        if (this.f49161b && m.this.f49152b != null) {
                            genAuthnHelper = m.this.f49152b;
                        } else {
                            return;
                        }
                    }
                } else {
                    m.this.b(com.alipay.sdk.m.o0.b.f10283d, this.f49160a, yn.e.a(com.alipay.sdk.m.o0.b.f10283d, "SDK获取token失败", "SDK获取token失败"), 4, "1003", "SDK获取token失败", this.f49162c, this.f49163d, this.f49164e);
                    if (this.f49161b && m.this.f49152b != null) {
                        genAuthnHelper = m.this.f49152b;
                    } else {
                        return;
                    }
                }
                genAuthnHelper.quitAuthActivity();
            } catch (Exception e11) {
                e11.printStackTrace();
                yn.n.d("ExceptionShanYanTask", "mCMCCLoginMethod--Exception_e=" + e11.toString());
                m.this.b(1014, this.f49160a, yn.e.a(1014, e11.getClass().getSimpleName(), "mCMCCLoginMethod--Exception_e=" + e11.toString()), 4, "1014", e11.getClass().getSimpleName(), this.f49162c, this.f49163d, this.f49164e);
                if (this.f49161b && m.this.f49152b != null) {
                    m.this.f49152b.quitAuthActivity();
                }
            }
        }
    }

    public interface c {
        void a();

        void a(int i11, String str, String str2, String str3, long j11, long j12, long j13);

        void b(int i11, String str, String str2, int i12, String str3, String str4, long j11, long j12, long j13);
    }

    public static m a() {
        if (f49150f == null) {
            synchronized (m.class) {
                if (f49150f == null) {
                    f49150f = new m();
                }
            }
        }
        return f49150f;
    }

    public void b(int i11, String str, String str2, int i12, String str3, String str4, long j11, long j12, long j13) {
        c cVar = this.f49153c;
        if (cVar != null) {
            cVar.b(i11, str, str2, i12, str3, str4, j11, j12, j13);
        }
    }

    public void c(int i11, String str, String str2, String str3, long j11, long j12, long j13) {
        c cVar = this.f49153c;
        if (cVar != null) {
            cVar.a(i11, str, str2, str3, j11, j12, j13);
        }
    }

    public void d(Context context, GenAuthnHelper genAuthnHelper, String str) {
        this.f49151a = context;
        this.f49152b = genAuthnHelper;
        this.f49154d = str;
    }

    public final void e(String str, String str2, String str3, boolean z11, long j11, long j12, long j13) {
        GenAuthnHelper genAuthnHelper;
        String str4;
        GenAuthnHelper genAuthnHelper2;
        try {
            String g11 = yn.t.g(this.f49151a, "appId", "");
            String g12 = yn.t.g(this.f49151a, "accountFlag", "");
            JSONObject jSONObject = new JSONObject();
            jSONObject.put("ap", g11);
            jSONObject.put("tk", str3);
            jSONObject.put("dd", yn.t.g(this.f49151a, "DID", ""));
            jSONObject.put("ud", yn.t.g(this.f49151a, "uuid", ""));
            jSONObject.put("vs", "2.3.5.3");
            jSONObject.put("tp", "0");
            String a11 = yn.b.a(this.f49154d);
            String encodeToString = Base64.encodeToString(yn.b.e(jSONObject.toString().getBytes("utf-8"), a11.substring(0, 16), a11.substring(16)), 11);
            JSONObject jSONObject2 = new JSONObject();
            if (yn.e.c(g12) && "1".equals(g12)) {
                str4 = ExifInterface.GPS_MEASUREMENT_IN_PROGRESS + str2 + g11 + Authenticate.kRtcDot + encodeToString;
            } else {
                str4 = ExifInterface.GPS_MEASUREMENT_IN_PROGRESS + str2 + Authenticate.kRtcDot + encodeToString;
            }
            jSONObject2.put("token", str4);
            yn.t.b(this.f49151a, "timeend", 0L);
            c(1000, str, jSONObject2.toString(), str3, j11, j12, j13);
            if (z11 && (genAuthnHelper2 = this.f49152b) != null) {
                genAuthnHelper2.quitAuthActivity();
            }
        } catch (Exception e11) {
            yn.n.d("ExceptionShanYanTask", "getMobileNum Exception_e=", e11);
            b(1014, str, yn.e.a(1014, e11.getClass().getSimpleName(), "getMobileNum--Exception_e=" + e11.toString()), 3, "1014", e11.getClass().getSimpleName(), j11, j12, j13);
            if (z11 && (genAuthnHelper = this.f49152b) != null) {
                genAuthnHelper.quitAuthActivity();
            }
        }
    }

    public final void f(String str, boolean z11, long j11, long j12, long j13) {
        String g11 = yn.t.g(this.f49151a, "ctcc_number", "");
        String g12 = yn.t.g(this.f49151a, "ctcc_accessCode", "");
        String g13 = yn.t.g(this.f49151a, "ctcc_gwAuth", "");
        if (yn.e.c(g11) && yn.e.c(g12) && yn.e.c(g13)) {
            un.a.c().D();
            yn.a.d(this.f49151a, "CTCC", g12, g11, g13, z11, j11, j12, j13);
        } else {
            un.a.c().k(3, "CTCC", j12, j13);
        }
    }

    public void g(ExecutorService executorService, boolean z11, String str, long j11, long j12) {
        if (rn.b.f43914t.getAndSet(false)) {
            executorService.execute(new a(z11, str, j11, j12));
        }
    }

    public void h(c cVar) {
        this.f49153c = cVar;
    }

    public void m() {
        char c11;
        if (this.f49151a != null) {
            long uptimeMillis = SystemClock.uptimeMillis();
            long currentTimeMillis = System.currentTimeMillis();
            try {
                yn.n.c("ProcessShanYanLogger", "openLoginAuthMethod start ");
                if (yn.o.a(this.f49151a) && rn.b.f43914t.get()) {
                    rn.b.f43905k = SystemClock.uptimeMillis();
                    rn.b.f43904j = System.currentTimeMillis();
                    un.a.c().k(3, null, uptimeMillis, currentTimeMillis);
                    rn.b.f43913s = false;
                } else {
                    c11 = 1;
                    try {
                        b(1031, g.b().a(this.f49151a), yn.e.a(1031, "拉起授权页请求频繁", "拉起授权页请求频繁"), 3, "1031", "拉起授权页请求频繁", SystemClock.uptimeMillis(), uptimeMillis, currentTimeMillis);
                    } catch (Exception e11) {
                        e = e11;
                        e.printStackTrace();
                        Object[] objArr = new Object[2];
                        objArr[0] = "openLoginAuthMethod Exception_e=";
                        objArr[c11] = e;
                        yn.n.d("ExceptionShanYanTask", objArr);
                        b(1014, g.b().a(this.f49151a), yn.e.a(1014, e.getClass().getSimpleName(), "openLoginAuthMethod--Exception_e=" + e.toString()), 3, "1014", e.getClass().getSimpleName(), SystemClock.uptimeMillis(), uptimeMillis, currentTimeMillis);
                    }
                }
            } catch (Exception e12) {
                e = e12;
                c11 = 1;
            }
        } else {
            un.a.c().j(1014, "Unknown_Operator", 3, "1", "0", yn.e.a(1014, "未初始化", "未初始化"), System.currentTimeMillis() + "", 0L, 0L, "1014", "未初始化", true, true);
        }
    }

    public final void n(String str, boolean z11, long j11, long j12, long j13) {
        String g11 = yn.t.g(this.f49151a, "cucc_fakeMobile", "");
        String g12 = yn.t.g(this.f49151a, "cucc_accessCode", "");
        if (yn.e.c(g11) && yn.e.c(g12)) {
            un.a.c().D();
            yn.a.d(this.f49151a, "CUCC", g12, g11, "", z11, j11, j12, j13);
        } else {
            un.a.c().k(3, "CUCC", j12, j13);
        }
    }

    public final void q() {
        c cVar = this.f49153c;
        if (cVar != null) {
            cVar.a();
        }
    }

    public final void r(String str, boolean z11, long j11, long j12, long j13) {
        un.a.c().D();
        t(str, z11, j11, j12, j13);
    }

    public final void t(String str, boolean z11, long j11, long j12, long j13) {
        this.f49152b.setOverTime(yn.t.e(this.f49151a, "openLoginAuthTimeOut", 4) * 1000);
        this.f49152b.loginAuth(yn.t.g(this.f49151a, "cmccAppid", new String()), yn.t.g(this.f49151a, "cmccAppkey", new String()), new b(str, z11, j11, j12, j13));
    }
}