OurPlay v5.5.9版本的 MD5 值为:d4e139798f4c2243a1145c8af5e21046
以下内容为反编译后的 a.java 源代码,内容仅作参考
package com.excelliance.kxqp.gs.ui.mine.v2;
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.fragment.app.FragmentActivity;
import androidx.lifecycle.LifecycleOwner;
import androidx.lifecycle.Observer;
import com.excean.ggspace.main.R;
import com.excelliance.kxqp.api.ApiManager;
import com.excelliance.kxqp.api.c;
import com.excelliance.kxqp.bean.WXconfig;
import com.excelliance.kxqp.gs.appstore.model.ResponseData;
import com.excelliance.kxqp.gs.bean.HasIconBean;
import com.excelliance.kxqp.gs.bean.VipNotice;
import com.excelliance.kxqp.gs.thpool.tp;
import com.excelliance.kxqp.gs.ui.mine.b;
import com.excelliance.kxqp.gs.util.af;
import com.excelliance.kxqp.gs.util.as;
import com.excelliance.kxqp.gs.util.az;
import com.excelliance.kxqp.gs.util.bd;
import com.excelliance.kxqp.gs.util.bx;
import com.excelliance.kxqp.gs.util.by;
import com.excelliance.kxqp.gs.util.cd;
import com.excelliance.kxqp.gs.util.cg;
import com.excelliance.kxqp.util.ai;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.zero.support.core.task.Response;
import java.util.List;
import org.json.JSONObject;
public class a implements b.c {
b.a f10650a;
private Context f10651b;
private Handler c;
@Override
public void initData() {
}
public a(Context context, b.a aVar) {
this.f10651b = context;
this.f10650a = aVar;
HandlerThread handlerThread = new HandlerThread("MinePresenter", 10);
handlerThread.start();
this.c = new Handler(handlerThread.getLooper());
}
public void a() {
this.c.getLooper().quit();
this.f10650a = null;
this.f10651b = null;
}
public void b() {
this.c.post(new Runnable() {
@Override
public void run() {
try {
c cVar = new c(a.this.f10651b);
cVar.a(ApiManager.getInstance().a(a.this.f10651b, 15000L, 15000L, "https://api.ourplay.com.cn/").f());
final ResponseData b2 = cVar.b();
az.d("MinePresenter", "run: getUserMedal::" + b2.data);
if (b2.data != 0) {
tp.i(new Runnable() {
@Override
public void run() {
if (a.this.f10650a != null) {
a.this.f10650a.a(((HasIconBean) b2.data).has);
}
}
});
}
} catch (Exception e) {
e.printStackTrace();
Log.d("MinePresenter", "run: " + e.toString());
}
}
});
}
public void c() {
tp.f(new Runnable() {
@Override
public void run() {
as.h(a.this.f10651b, 4);
}
});
}
public void d() {
try {
((com.excelliance.kxqp.api.b) com.zero.support.core.api.a.a(com.excelliance.kxqp.api.b.class)).a(WXconfig.typeToKey(12)).d().observe((LifecycleOwner) this.f10650a, new Observer<Response<WXconfig>>() {
@Override
public void onChanged(Response<WXconfig> response) {
az.d("MinePresenter", "run: getWxConfig::" + response.d());
if (response.d() == null || response.f() != 1 || a.this.f10650a == null) {
return;
}
a.this.f10650a.a(response.d());
}
});
} catch (Exception e) {
e.printStackTrace();
Log.d("MinePresenter", "run: " + e.toString());
}
}
public void e() {
af.a((FragmentActivity) this.f10651b, (List<VipNotice>) new Gson().a(by.a(this.f10651b, "sp_config").b("sp_key_vip_notice", ""), new TypeToken<List<VipNotice>>() {
}.getType()), 2);
}
public void a(final String str, final String str2) {
this.c.post(new Runnable() {
@Override
public void run() {
try {
String a2 = bx.a().a(a.this.f10651b);
JSONObject jSONObject = new JSONObject();
jSONObject.put("rid", a2);
jSONObject.put("aid", com.excelliance.kxqp.util.a.b.e(a.this.f10651b));
jSONObject.put("name", str);
jSONObject.put("idCard", str2);
String c = bd.c("https://api.ourplay.com.cn/user/verify", jSONObject.toString());
if (TextUtils.isEmpty(c)) {
a.this.a(false, "", false);
ai.a().a(a.this.f10651b, "我的页面", a.this.f10651b.getResources().getString(R.string.network_error_retry));
return;
}
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) {
a.this.a(true, optString, true);
SharedPreferences sharedPreferences = a.this.f10651b.getSharedPreferences("USERINFO", 0);
bx a3 = bx.a();
a3.a(sharedPreferences, "USER_REAL_NAME_VERIFY", 1);
a3.a(sharedPreferences, "USER_IS_ADULT", optInt2);
a3.b(sharedPreferences, "USER_REAL_NAME", str);
a3.b(sharedPreferences, "USER_ID_NUMBER", str2);
if (!bx.a().b(a.this.f10651b)) {
a3.a(sharedPreferences, "DEVICE_ID_VERIFY", 1);
a3.b(sharedPreferences, "DEVICE_REAL_NAME", str);
a3.b(sharedPreferences, "DEVICE_ID_NUMBER", str2);
a3.a(sharedPreferences, "DEVICE_IS_ADULT", optInt2);
}
ai.a();
ai.b(a.this.f10651b);
return;
}
a.this.a(false, optString, true);
if (cd.a(optString)) {
return;
}
ai.a().a(a.this.f10651b, "我的页面", optString);
} catch (Exception e) {
e.printStackTrace();
a.this.a(false, "", false);
ai.a().a(a.this.f10651b, "我的页面", a.this.f10651b.getResources().getString(R.string.network_error_retry));
}
}
});
}
public void f() {
if (this.f10650a != null) {
this.f10650a.a(this.f10651b.getString(R.string.requesting));
}
this.c.post(new Runnable() {
@Override
public void run() {
try {
c cVar = new c(a.this.f10651b);
cVar.a(ApiManager.getInstance().a(a.this.f10651b, 15000L, 15000L, "https://api.ourplay.com.cn/").g());
ResponseData b2 = cVar.b();
az.d("MinePresenter", "run: cancel verify::" + b2.code);
if (b2.code == 1) {
bx a2 = bx.a();
SharedPreferences sharedPreferences = a.this.f10651b.getSharedPreferences("USERINFO", 0);
a2.a(sharedPreferences, "DEVICE_ID_VERIFY", 0);
a2.b(sharedPreferences, "DEVICE_REAL_NAME", "");
a2.b(sharedPreferences, "DEVICE_ID_NUMBER", "");
a2.a(sharedPreferences, "DEVICE_IS_ADULT", 0);
a2.a(sharedPreferences, "USER_REAL_NAME_VERIFY", 0);
a2.b(sharedPreferences, "USER_REAL_NAME", "");
a2.b(sharedPreferences, "USER_ID_NUMBER", "");
a2.a(sharedPreferences, "USER_IS_ADULT", 0);
if (a.this.f10650a != null) {
tp.i(new Runnable() {
@Override
public void run() {
a.this.f10650a.b();
a.this.f10650a.a();
}
});
}
cg.a(a.this.f10651b, a.this.f10651b.getString(R.string.cancel_real_name_verify_success));
return;
}
} catch (Exception e) {
e.printStackTrace();
Log.d("MinePresenter", "run: " + e.toString());
}
if (a.this.f10650a != null) {
tp.i(new Runnable() {
@Override
public void run() {
a.this.f10650a.b();
}
});
}
cg.a(a.this.f10651b, a.this.f10651b.getString(R.string.cancel_real_name_verify_fail));
}
});
}
public void a(final boolean z, final String str, final boolean z2) {
tp.i(new Runnable() {
@Override
public void run() {
if (a.this.f10650a != null) {
a.this.f10650a.a(z, str, z2);
}
}
});
}
}