OurPlay v5.5.9版本的 MD5 值为:d4e139798f4c2243a1145c8af5e21046
以下内容为反编译后的 b.java 源代码,内容仅作参考
package com.excean.lysdk.c;
import android.annotation.SuppressLint;
import android.app.Application;
import android.content.Context;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.util.Log;
import android.widget.Toast;
import com.android.spush.util.WebActionRouter;
import com.excean.bytedancebi.bean.BiEventDialogShow;
import com.excean.lysdk.LYUser;
import com.excean.lysdk.R;
import com.excean.lysdk.e.d;
import com.excean.lysdk.e.f;
import com.excean.lysdk.engine.StubRequest;
import com.excelliance.kxqp.gs.util.av;
import java.util.Calendar;
import java.util.HashMap;
import java.util.Map;
public class b {
public static long f1510a = 900000;
private long f1511b;
private long c;
private long d;
private long e;
private int f;
private com.excean.lysdk.d.c g;
private boolean h;
private boolean i;
private boolean j;
private boolean k;
private Handler l;
private StubRequest m;
private boolean n;
private boolean o;
private final d p;
private class a extends Handler {
public a(Looper looper) {
super(looper);
}
@Override
public void handleMessage(Message message) {
super.handleMessage(message);
if (message.what == 1) {
b.this.b();
}
}
}
public void b() {
this.n = false;
if (this.m != null) {
Map<String, String> map = this.m.getDefault();
map.put("openId", this.m.getOpenId());
new com.excean.lysdk.d.b<String>("plat/logout-count", map) {
}.execute(this.p);
}
}
public b(StubRequest stubRequest) {
this.f = 1;
this.n = true;
boolean z = false;
this.o = false;
this.p = new d();
this.m = stubRequest;
this.g = com.excean.lysdk.d.d().a(this.m.getOpenId(), this.m.getPackageName());
if (stubRequest.getVirtualMachine() && stubRequest.getSdkVersion() <= 3) {
z = true;
}
this.o = z;
if (this.o) {
this.l = new a(Looper.getMainLooper());
this.l.sendEmptyMessageDelayed(1, 130000L);
}
c();
}
public b(String str, String str2) {
this.f = 1;
this.n = true;
this.o = false;
this.p = new d();
this.g = com.excean.lysdk.d.d().a(str, str2);
c();
}
private void c() {
this.f1511b = this.g.getLong("totalLeftTime", 0L);
this.e = this.g.getLong("usedTime", 0L);
this.d = this.g.getLong("serverLeftTime", 0L);
this.c = this.g.getLong("startTime", System.currentTimeMillis());
this.j = this.g.getBoolean("fifteenWarning", false);
this.k = this.g.getBoolean("finishReported", false);
this.h = this.g.getBoolean("verifyIdentity", false);
this.i = this.g.getBoolean("mAdult", false);
}
public synchronized void update(boolean z, boolean z2, long j, long j2) {
this.h = z;
this.i = z2;
this.f1511b = j2 * 60 * 1000;
this.d = j * 60 * 1000;
this.e = 0L;
if (this.d > 0 && this.k) {
this.k = false;
this.j = false;
}
d();
}
public synchronized void a(boolean z, boolean z2, long j, long j2) {
this.h = z;
this.i = z2;
this.f1511b = j2 * 60 * 1000;
this.d = j * 60 * 1000;
this.e = 0L;
this.c = System.currentTimeMillis();
this.j = false;
this.k = false;
d();
}
public synchronized c a(StubRequest stubRequest, long j) {
String str;
final Application c = com.excean.lysdk.d.c();
if (this.g.a()) {
c();
}
int i = 1;
if (this.o && !this.n) {
this.n = true;
Map<String, String> map = stubRequest.getDefault();
map.put("openId", stubRequest.getOpenId());
new com.excean.lysdk.d.b<String>("plat/login-count", map) {
}.execute(this.p);
}
boolean isFromOurPlay = stubRequest.isFromOurPlay();
if (a()) {
if (isFromOurPlay) {
LYUser e = com.excean.lysdk.d.e();
HashMap hashMap = new HashMap();
hashMap.put("rid", e.e());
hashMap.put(WebActionRouter.KEY_PKG, stubRequest.getPackageName());
hashMap.put("aid", av.a().a(com.excean.lysdk.d.c()));
com.excean.lysdk.e.c<com.excean.lysdk.data.c> cVar = new com.excean.lysdk.d.b<com.excean.lysdk.data.c>("https://api.ourplay.com.cn/user/anti-addic", hashMap, i) {
}.execute(com.excean.lysdk.e.a.b()).get();
if (cVar.b()) {
com.excean.lysdk.data.b a2 = a(cVar.c());
a(a2.c(), a2.b(), a2.f1543b, a2.c);
}
} else {
com.excean.lysdk.e.c<com.excean.lysdk.data.b> cVar2 = new com.excean.lysdk.d.b<com.excean.lysdk.data.b>("plat/get-game-time", stubRequest.getDefault()) {
}.execute(com.excean.lysdk.e.a.b()).get();
if (cVar2.b()) {
com.excean.lysdk.data.b c2 = cVar2.c();
a(c2.c(), c2.b(), c2.f1543b, c2.c);
}
}
}
int i2 = Calendar.getInstance().get(11);
str = null;
if (i2 >= 20 && i2 <= 21) {
this.e += j;
Log.d("IndulgenceEntry", "report: mUsedTime " + this.e + " mServerLeftTime" + this.d);
if (this.e >= this.d) {
if (this.h) {
this.f = 4;
str = c.getString(R.string.lysdk_run_night_limit);
BiEventDialogShow biEventDialogShow = new BiEventDialogShow();
biEventDialogShow.current_page = "游戏内";
biEventDialogShow.dialog_type = "弹窗";
biEventDialogShow.dialog_name = "防沉迷倒计时结束弹窗";
com.excelliance.kxqp.gs.g.c.a().a(biEventDialogShow);
} else if (isFromOurPlay) {
this.f = 4;
} else {
this.f = 5;
str = c.getString(R.string.lysdk_run_one_hour_without_verify_identity);
}
if (!this.k) {
if (isFromOurPlay) {
LYUser e2 = com.excean.lysdk.d.e();
HashMap hashMap2 = new HashMap();
hashMap2.put("time", String.valueOf((this.e / 1000) / 60));
hashMap2.put("rid", e2.e());
hashMap2.put(WebActionRouter.KEY_PKG, stubRequest.getPackageName());
com.excean.lysdk.e.c<String> cVar3 = new com.excean.lysdk.d.b<String>("https://api.ourplay.com.cn/user/play-time", hashMap2, i) {
}.execute(com.excean.lysdk.e.a.b()).get();
Log.d("IndulgenceEntry", "mFinishReported: ");
if (!cVar3.b()) {
cVar3.a();
Log.d("IndulgenceEntry", "report error " + cVar3);
} else {
this.k = true;
}
} else {
this.k = true;
}
}
} else if (this.d - this.e <= f1510a && !this.j) {
this.j = true;
if (isFromOurPlay) {
this.f = 1;
f.getMainHandler().post(new Runnable() {
@Override
public void run() {
Context context = c;
String string = c.getString(R.string.lysdk_run_fifteen_warning);
Object[] objArr = new Object[1];
objArr[0] = Long.valueOf(((b.this.d - b.this.e) / 60) / 1000 > 0 ? ((b.this.d - b.this.e) / 60) / 1000 : 0L);
Toast.makeText(context, String.format(string, objArr), 1).show();
}
});
BiEventDialogShow biEventDialogShow2 = new BiEventDialogShow();
biEventDialogShow2.toast_name = "防沉迷剩余15分钟toast";
biEventDialogShow2.current_page = "游戏内";
biEventDialogShow2.dialog_type = "toast";
com.excelliance.kxqp.gs.g.c.a().a(biEventDialogShow2);
} else {
this.f = 2;
String string = c.getString(R.string.lysdk_run_fifteen_warning);
Object[] objArr = new Object[1];
objArr[0] = Long.valueOf(((this.d - this.e) / 60) / 1000 > 0 ? ((this.d - this.e) / 60) / 1000 : 0L);
str = String.format(string, objArr);
}
} else {
this.f = 1;
}
d();
Log.d("IndulgenceEntry", "report: " + this);
Log.d("IndulgenceEntry", "report mLevel : " + this.f);
if (this.o) {
this.l.postDelayed(new Runnable() {
@Override
public void run() {
}
}, 2000L);
this.l.removeMessages(1);
this.l.sendEmptyMessageDelayed(1, 130000L);
}
}
if (!this.h && !isFromOurPlay) {
this.f = 5;
str = c.getString(R.string.lysdk_run_one_hour_without_verify_identity);
} else {
this.f = 4;
str = c.getString(R.string.lysdk_run_night_limit);
BiEventDialogShow biEventDialogShow3 = new BiEventDialogShow();
biEventDialogShow3.current_page = "游戏内";
biEventDialogShow3.dialog_type = "弹窗";
biEventDialogShow3.dialog_name = "防沉迷不在可玩时间内提醒弹窗";
com.excelliance.kxqp.gs.g.c.a().a(biEventDialogShow3);
}
d();
Log.d("IndulgenceEntry", "report: " + this);
Log.d("IndulgenceEntry", "report mLevel : " + this.f);
if (this.o) {
}
return new c(str, this.f);
}
public boolean a() {
Calendar calendar = Calendar.getInstance();
int i = calendar.get(6);
calendar.setTimeInMillis(this.c);
return i != calendar.get(6);
}
public String toString() {
return "IndulgenceEntry{mTotalLeftTime=" + this.f1511b + ", mStartTime=" + this.c + ", mUsedTime=" + this.e + ", mServerLeftTime=" + this.d + ", mLevel=" + this.f + ", mVerifyIdentity=" + this.h + ", mAdult=" + this.i + ", mFifteenWarning=" + this.j + ", mFinishReported=" + this.k + '}';
}
@SuppressLint({"ApplySharedPref"})
private void d() {
this.g.edit().putLong("startTime", this.c).putLong("usedTime", this.e).putLong("totalLeftTime", this.f1511b).putLong("level", this.f).putLong("serverLeftTime", this.d).putBoolean("verifyIdentity", this.h).putBoolean("adult", this.i).putBoolean("fifteenWarning", this.j).putBoolean("finishReported", this.k).commit();
}
private com.excean.lysdk.data.b a(com.excean.lysdk.data.c cVar) {
com.excean.lysdk.data.b bVar = new com.excean.lysdk.data.b();
bVar.f1542a = cVar.c;
bVar.d = cVar.c >= 18 ? 1 : 0;
bVar.f = 1;
bVar.f1543b = cVar.f1545b;
bVar.e = cVar.f1544a ? 1 : 0;
bVar.c = cVar.d == 1 ? 180L : 90L;
return bVar;
}
}