思特奇智慧酒店云平台 v0.0.5版本的 MD5 值为:dedb172bb322639d79d7e0e26262fb5c

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


package com.cmic.sso.sdk.b.b;

import android.content.Context;
import android.os.Bundle;
import com.cmic.sso.sdk.a;
import com.cmic.sso.sdk.auth.AuthnHelper;
import com.cmic.sso.sdk.b.a.a;
import com.cmic.sso.sdk.b.a.c;
import com.cmic.sso.sdk.utils.aa;
import com.cmic.sso.sdk.utils.d;
import com.cmic.sso.sdk.utils.f;
import com.cmic.sso.sdk.utils.i;
import com.cmic.sso.sdk.utils.l;
import com.cmic.sso.sdk.utils.m;
import com.cmic.sso.sdk.utils.o;
import com.cmic.sso.sdk.utils.p;
import com.cmic.sso.sdk.utils.t;
import com.cmic.sso.sdk.utils.v;
import com.cmic.sso.sdk.utils.x;
import com.cmic.sso.sdk.utils.y;
import com.cmic.sso.sdk.utils.z;
import org.json.JSONException;
import org.json.JSONObject;
public class a {
    public static a b;
    public Context a;

    public a() {
    }

    public static a a(Context context) {
        if (b == null) {
            synchronized (a.class) {
                if (b == null) {
                    b = new a(context);
                }
            }
        }
        return b;
    }

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

    public void a(boolean z, Bundle bundle, b bVar) {
        com.cmic.sso.sdk.b.a.b bVar2 = new com.cmic.sso.sdk.b.a.b();
        bVar2.a("1.0");
        bVar2.b("Android");
        bVar2.c(p.b("AID", ""));
        bVar2.d(z ? "1" : "0");
        bVar2.e(AuthnHelper.SDK_VERSION);
        bVar2.f(bundle.getString("appid"));
        bVar2.g(bVar2.b());
        a("https://config.cmpassport.com/client/uniConfig", bVar2, false, bundle, bVar);
    }

    public void a(Context context, Bundle bundle, b bVar) {
        int i = bundle.getInt("networkType");
        String string = bundle.getString("authtype", "");
        c cVar = new c();
        c.a aVar = new c.a();
        aVar.d("1.0");
        aVar.e(AuthnHelper.SDK_VERSION);
        aVar.f(bundle.getString("appid"));
        aVar.g(string);
        aVar.h(bundle.getString("smskey", ""));
        aVar.i(bundle.getString("imsi", ""));
        aVar.c(o.a(this.a).b());
        aVar.j(bundle.getString("operatorType"));
        aVar.k(i + "");
        aVar.l(t.a());
        aVar.m(t.b());
        aVar.n(t.c());
        aVar.o("0");
        aVar.p(z.a());
        aVar.q(v.a());
        aVar.r(bundle.getString("apppackage"));
        aVar.s(bundle.getString("appsign"));
        aVar.r(bundle.getString("apppackage"));
        aVar.s(bundle.getString("appsign"));
        aVar.t(aVar.u(bundle.getString("appkey")));
        cVar.a(bundle.getString(a.C0065a.a));
        cVar.b(m.a().a(bundle.getString(a.C0065a.a)));
        cVar.a(aVar);
        bundle.putString("interfacetype", bundle.getString("interfacetype", "") + "getPrePhonescrip;");
        bundle.putString("interfaceVersion", "7.0");
        bundle.putBoolean("isCloseIpv4", x.b());
        bundle.putBoolean("isCloseIpv6", x.c());
        String str = x.e() + "rs/getPrePhonescrip";
        if (i == 3 && string.equals("3")) {
            aa.a(context);
            f.b("BaseRequest", "使用wifi下取号" + i);
            a(str, cVar, true, bundle, bVar);
            return;
        }
        f.b("BaseRequest", "不使用wifi下取号" + i);
        a(str, cVar, false, bundle, bVar);
    }

    public void a(Bundle bundle, b bVar) {
        com.cmic.sso.sdk.b.a.a aVar = new com.cmic.sso.sdk.b.a.a();
        a.C0069a c0069a = new a.C0069a();
        aVar.f("0.1");
        aVar.i(bundle.getString("phonescrip"));
        aVar.h(bundle.getString("appid"));
        aVar.g(z.a());
        aVar.c(v.a());
        if ("2".equals(bundle.getString("authtype"))) {
            aVar.d("2.0");
        } else {
            aVar.d("6.0");
        }
        aVar.e(bundle.getString("userCapaid", "50"));
        aVar.a("0");
        aVar.b(bundle.getString("sourceid"));
        aVar.k(bundle.getString("authenticated_appid"));
        aVar.l(bundle.getString("genTokenByAppid"));
        aVar.j(aVar.m(bundle.getString("appkey")));
        c0069a.a(p.b("AID", ""));
        c0069a.b(t.c());
        c0069a.c(t.b());
        c0069a.d(t.a());
        c0069a.e(bundle.getString("operatorType", ""));
        c0069a.f("0");
        c0069a.g(t.a(this.a) + "");
        c0069a.h(y.a(true));
        c0069a.i(y.a(false, false));
        c0069a.j(x.h() ? "0" : "1");
        if (l.a()) {
            c0069a.k("1");
        } else {
            c0069a.k("0");
        }
        aVar.a(c0069a.a());
        com.cmic.sso.sdk.b.c.a.a(x.a(x.f()));
        bundle.putString("interfacetype", bundle.getString("interfacetype", "") + "getAuthToken;");
        bundle.putString("interfaceVersion", "6.0");
        a(x.f() + "api/getAuthToken", aVar, false, bundle, bVar);
    }

    public <T extends com.cmic.sso.sdk.b.a.f> void a(final String str, T t, boolean z, final Bundle bundle, final b bVar) {
        String string = bundle.getString("traceId");
        f.a("BaseRequest", "request https url : " + str + ">>>>>>> PARAMS : " + t.a().toString());
        if (t.a(this.a) == 0) {
            JSONObject jSONObject = new JSONObject();
            try {
                jSONObject.put("resultCode", "200022");
                jSONObject.put("desc", "网络未连接");
            } catch (JSONException e) {
                e.printStackTrace();
            }
            f.a("BaseRequest", "request failed , url : " + str + ">>>>>errorMsg : " + jSONObject.toString());
            if (bVar != null) {
                bVar.a("200022", "网络未连接", jSONObject);
                return;
            }
            return;
        }
        try {
            JSONObject jSONObject2 = new JSONObject();
            jSONObject2.put("timeOut", bundle.getString("timeOut"));
            jSONObject2.put("imsiState", bundle.getString("imsiState"));
        } catch (JSONException e2) {
            e2.printStackTrace();
        }
        new d().a(str, t, z, new d.a() {
            public boolean e = false;

            @Override
            public void a(String str2, String str3) {
                String string2;
                if (this.e) {
                    return;
                }
                this.e = true;
                f.a("BaseRequest", "request success , url : " + str + ">>>>result : " + str2);
                try {
                    JSONObject jSONObject3 = new JSONObject(str2);
                    if (jSONObject3.has("resultCode")) {
                        string2 = jSONObject3.getString("resultCode");
                    } else {
                        string2 = jSONObject3.getString("resultcode");
                    }
                    if (!i.a(bundle.getString("traceId")) || str.contains("Config")) {
                        bVar.a(string2, jSONObject3.optString("desc"), jSONObject3);
                    }
                } catch (Exception e3) {
                    e3.printStackTrace();
                    a("200021", "数据解析异常", str3);
                }
            }

            @Override
            public void a(String str2, String str3, String str4) {
                if (this.e) {
                    return;
                }
                this.e = true;
                JSONObject jSONObject3 = new JSONObject();
                try {
                    jSONObject3.put("resultCode", str2);
                    jSONObject3.put("desc", str3);
                } catch (JSONException e3) {
                    e3.printStackTrace();
                }
                f.a("BaseRequest", "request failed , url : " + str + ">>>>>errorMsg : " + jSONObject3.toString());
                if (bVar != null) {
                    if (!i.a(bundle.getString("traceId")) || str.contains("Config")) {
                        bVar.a(str2, str3, jSONObject3);
                    }
                }
            }
        }, "POST", string, bundle);
    }
}