xiaodi8 v1.0.0版本的 MD5 值为:6b857c57f508176c5ba1afb422bbb5a9

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


package com.bslyun.app.component.quicklogin;

import android.app.Activity;
import android.content.Context;
import android.text.TextUtils;
import android.view.ViewGroup;
import com.bslyun.app.browser.JavaScriptUtils;
import com.bslyun.app.g.a;
import com.bslyun.app.modes.LoginPhone;
import com.bslyun.app.modes.MYResult;
import com.bslyun.app.utils.m0;
import com.google.gson.Gson;
import com.google.gson.JsonObject;
import com.kseuay.kziwmts.R;
import e.b0;
import e.v;
import h.b;
import h.d;
import h.l;
import h.m;
import io.github.inflationx.calligraphy3.BuildConfig;
import java.lang.reflect.InvocationTargetException;
import java.util.HashMap;
import java.util.Map;

public class QuickLoginComponent {
    private static Gson gson = new Gson();

    public static void checkSMS(Context context, ViewGroup viewGroup, String str, String str2, String str3) {
        HashMap hashMap = new HashMap();
        hashMap.put("tel", str);
        try {
            Class.forName("com.gxc.quicklogin.QuickLogion").getMethod("checkSMS", String.class).invoke(null, mapToJson(hashMap));
        } catch (ClassNotFoundException e2) {
            e2.printStackTrace();
        } catch (IllegalAccessException e3) {
            e3.printStackTrace();
        } catch (NoSuchMethodException e4) {
            e4.printStackTrace();
        } catch (InvocationTargetException e5) {
            e5.printStackTrace();
        }
    }

    public static void getLoginPhone(final Context context, String str, final ViewGroup viewGroup, final String str2) {
        final MYResult mYResult = (MYResult) gson.fromJson(str, MYResult.class);
        if (!TextUtils.isEmpty(mYResult.getAccess_token())) {
            long currentTimeMillis = System.currentTimeMillis();
            String g0 = m0.g0(context.getResources().getString(R.string.my_master_secret) + currentTimeMillis);
            HashMap hashMap = new HashMap();
            hashMap.put("app_id", context.getResources().getString(R.string.my_app_id));
            hashMap.put("sign", g0);
            hashMap.put("time_stamp", currentTimeMillis + BuildConfig.FLAVOR);
            hashMap.put("request_id", System.currentTimeMillis() + BuildConfig.FLAVOR);
            hashMap.put("access_token", mYResult.getAccess_token());
            getManager("http://my.wlwx.com:6006").c(b0.c(v.c("application/json"), mapToJson(hashMap))).x(new d<LoginPhone>() {
                @Override
                public void onFailure(b<LoginPhone> bVar, Throwable th) {
                    QuickLoginComponent.sendOut(context, BuildConfig.FLAVOR, mYResult.getCode(), viewGroup, str2);
                }

                @Override
                public void onResponse(b<LoginPhone> bVar, l<LoginPhone> lVar) {
                    if (lVar == null || !lVar.a().getCode().equals("00000")) {
                        return;
                    }
                    QuickLoginComponent.sendOut(context, lVar.a().getObject().getTel(), mYResult.getCode(), viewGroup, str2);
                }
            });
            return;
        }
        sendOut(context, BuildConfig.FLAVOR, mYResult.getCode(), viewGroup, str2);
    }

    private static a getManager(String str) {
        m.b bVar = new m.b();
        bVar.b(str);
        bVar.a(h.p.a.a.d());
        return (a) bVar.d().d(a.class);
    }

    public static void login(int i) {
        try {
            Class.forName("com.gxc.quicklogin.QuickLogion").getMethod("login", Integer.TYPE).invoke(null, Integer.valueOf(i));
        } catch (ClassNotFoundException e2) {
            e2.printStackTrace();
        } catch (IllegalAccessException e3) {
            e3.printStackTrace();
        } catch (NoSuchMethodException e4) {
            e4.printStackTrace();
        } catch (InvocationTargetException e5) {
            e5.printStackTrace();
        }
    }

    public static void loginInit(Activity activity) {
        HashMap hashMap = new HashMap();
        hashMap.put("app_id", activity.getResources().getString(R.string.my_app_id));
        hashMap.put("app_secret", activity.getResources().getString(R.string.my_app_secret));
        try {
            Class.forName("com.gxc.quicklogin.QuickLogion").getMethod("loginInit", Activity.class, String.class).invoke(null, activity, mapToJson(hashMap));
        } catch (ClassNotFoundException e2) {
            e2.printStackTrace();
        } catch (IllegalAccessException e3) {
            e3.printStackTrace();
        } catch (NoSuchMethodException e4) {
            e4.printStackTrace();
        } catch (InvocationTargetException e5) {
            e5.printStackTrace();
        }
    }

    private static String mapToJson(Map<String, String> map) {
        return gson.toJson(map);
    }

    public static void sendOut(Context context, String str, String str2, ViewGroup viewGroup, String str3) {
        HashMap hashMap = new HashMap();
        hashMap.put("phone", str);
        hashMap.put("code", str2);
        JavaScriptUtils.postJsInWebView(context, viewGroup, JavaScriptUtils.geneciCallbackFunction(str3, gson.toJson(hashMap)));
    }

    public static void sendSMS(Context context, ViewGroup viewGroup, String str, String str2, String str3) {
        HashMap hashMap = new HashMap();
        hashMap.put("tel", str);
        try {
            Class.forName("com.gxc.quicklogin.QuickLogion").getMethod("sendSMS", String.class).invoke(null, mapToJson(hashMap));
        } catch (ClassNotFoundException e2) {
            e2.printStackTrace();
        } catch (IllegalAccessException e3) {
            e3.printStackTrace();
        } catch (NoSuchMethodException e4) {
            e4.printStackTrace();
        } catch (InvocationTargetException e5) {
            e5.printStackTrace();
        }
    }

    private static void sendServer(final Context context, final ViewGroup viewGroup, String str, String str2, final String str3) {
        getManager("http://auth.appbsl.com").a(str, b0.c(v.c("application/json"), str2)).x(new d<JsonObject>() {
            @Override
            public void onFailure(b<JsonObject> bVar, Throwable th) {
            }

            @Override
            public void onResponse(b<JsonObject> bVar, l<JsonObject> lVar) {
                ViewGroup viewGroup2;
                String jsonElement = lVar.a().toString();
                if (TextUtils.isEmpty(str3) || (viewGroup2 = viewGroup) == null) {
                    return;
                }
                JavaScriptUtils.postJsInWebView(context, viewGroup2, JavaScriptUtils.geneciCallbackFunction(str3, jsonElement));
            }
        });
    }
}