OurPlay v5.5.9版本的 MD5 值为:d4e139798f4c2243a1145c8af5e21046

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


package com.excelliance.kxqp;

import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Handler;
import android.os.HandlerThread;
import android.text.TextUtils;
import android.util.Log;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;
import com.android.spush.util.WebActionRouter;
import com.excean.ggspace.main.R;
import com.excelliance.kxqp.api.ApiManager;
import com.excelliance.kxqp.bean.AntiAddictionInfo;
import com.excelliance.kxqp.gs.appstore.model.ResponseData;
import com.excelliance.kxqp.gs.thpool.tp;
import com.excelliance.kxqp.gs.util.av;
import com.excelliance.kxqp.gs.util.bd;
import com.excelliance.kxqp.gs.util.bx;
import com.excelliance.kxqp.gs.util.cd;
import com.excelliance.kxqp.gs.util.cf;
import com.excelliance.kxqp.util.ai;
import java.util.HashMap;
import org.json.JSONObject;

public class ShortCutViewModel extends ViewModel {

    private final MutableLiveData<AntiAddictionInfo> f2323a = new MutableLiveData<>();

    private Handler f2324b;

    public ShortCutViewModel() {
        HandlerThread handlerThread = new HandlerThread("LaunchWorkThread", 10);
        handlerThread.start();
        this.f2324b = new Handler(handlerThread.getLooper());
    }

    public void a(final String str, final Context context) {
        this.f2324b.post(new Runnable() {
            @Override
            public void run() {
                HashMap hashMap = new HashMap();
                hashMap.put("rid", bx.a().a(context));
                hashMap.put(WebActionRouter.KEY_PKG, str);
                hashMap.put("aid", av.a().a(context));
                Log.d("ShortCutViewModel", "subscribe: requestBody:" + hashMap);
                com.excelliance.kxqp.api.c cVar = new com.excelliance.kxqp.api.c(context);
                cVar.a(ApiManager.getInstance().a(context, 15000L, 15000L, "https://api.ourplay.com.cn/").a(hashMap));
                ResponseData b2 = cVar.b();
                Log.d("ShortCutViewModel", "responseData: " + b2);
                if (b2 != null && b2.code == 0) {
                    ShortCutViewModel.this.f2323a.postValue(b2.data);
                    return;
                }
                cf.a(context, R.string.server_error, 0);
                if (context instanceof Activity) {
                    ((Activity) context).finish();
                }
            }
        });
    }

    public void a(final Activity activity, final String str, final String str2, final Runnable runnable) {
        this.f2324b.post(new Runnable() {
            @Override
            public void run() {
                try {
                    bx a2 = bx.a();
                    String a3 = a2.a(activity);
                    JSONObject jSONObject = new JSONObject();
                    jSONObject.put("rid", a3);
                    jSONObject.put("name", str);
                    jSONObject.put("idCard", str2);
                    jSONObject.put("aid", av.a().a(activity));
                    String c = bd.c("https://api.ourplay.com.cn/user/verify", jSONObject.toString());
                    Log.d("ShortCutViewModel", "run: response:" + c);
                    if (!TextUtils.isEmpty(c)) {
                        JSONObject jSONObject2 = new JSONObject(c);
                        int optInt = jSONObject2.optInt("code");
                        String optString = jSONObject2.optString("msg");
                        int optInt2 = jSONObject2.optJSONObject("data").optInt("isAdult");
                        if (optInt == 0) {
                            tp.i(new Runnable() {
                                @Override
                                public void run() {
                                    runnable.run();
                                }
                            });
                            if (a2.b(activity)) {
                                SharedPreferences sharedPreferences = activity.getSharedPreferences("USERINFO", 0);
                                bx a4 = bx.a();
                                a4.a(sharedPreferences, "USER_REAL_NAME_VERIFY", 1);
                                a4.b(sharedPreferences, "USER_REAL_NAME", str);
                                a4.b(sharedPreferences, "USER_ID_NUMBER", str2);
                                a4.a(sharedPreferences, "USER_IS_ADULT", optInt2);
                            } else {
                                SharedPreferences sharedPreferences2 = activity.getSharedPreferences("USERINFO", 0);
                                bx a5 = bx.a();
                                a5.a(sharedPreferences2, "DEVICE_ID_VERIFY", 1);
                                a5.b(sharedPreferences2, "DEVICE_REAL_NAME", str);
                                a5.b(sharedPreferences2, "DEVICE_ID_NUMBER", str2);
                                a5.a(sharedPreferences2, "DEVICE_IS_ADULT", optInt2);
                            }
                            ai.a();
                            ai.b(activity);
                            return;
                        }
                        ai.a().a(activity, optString);
                        if (cd.a(optString)) {
                            ai.a().a((Context) activity, "快捷方式");
                            return;
                        } else {
                            ai.a().a(activity, "快捷方式", optString);
                            return;
                        }
                    }
                    ai.a().a(activity, "");
                    ai.a().a((Context) activity, "快捷方式");
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        });
    }

    public MutableLiveData<AntiAddictionInfo> a() {
        return this.f2323a;
    }
}