OurPlay v5.5.9版本的 MD5 值为:d4e139798f4c2243a1145c8af5e21046
以下内容为反编译后的 e.java 源代码,内容仅作参考
package com.excelliance.kxqp.gs.l;
import a.q;
import android.app.Application;
import android.util.Log;
import androidx.annotation.NonNull;
import androidx.room.Room;
import com.excelliance.kxqp.api.ApiManager;
import com.excelliance.kxqp.bean.CircleMsgBean;
import com.excelliance.kxqp.database.CircleMsgDatabase;
import com.excelliance.kxqp.gs.appstore.model.ResponseData;
import com.excelliance.kxqp.gs.util.ay;
import com.excelliance.kxqp.gs.util.bx;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
public class e extends com.excelliance.kxqp.community.repository.b {
private final Application c;
private final CircleMsgDatabase d;
private long e;
public e(@NonNull Application application) {
this(application, 10);
}
public e(@NonNull Application application, int i) {
super(i);
this.e = -1L;
this.c = application;
this.d = (CircleMsgDatabase) Room.databaseBuilder(application, CircleMsgDatabase.class, "circle-msg-db").addMigrations(CircleMsgDatabase.f3635a).build();
}
public List<CircleMsgBean> a(boolean z) {
int a2 = ay.a(bx.a().a(this.c), 0);
if (z) {
this.e = -1L;
a();
a(a2);
}
try {
List<CircleMsgBean> a3 = this.d.a().a(this.e, a2);
if (a3 != null && !a3.isEmpty()) {
this.e = a3.get(a3.size() - 1).id;
}
return a3;
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
private void a(int i) {
try {
com.excelliance.kxqp.api.c cVar = new com.excelliance.kxqp.api.c(this.c);
cVar.a(ApiManager.getInstance().a(this.c, 15000L, 15000L, "https://gapi.ourplay.com.cn/").H(new q.a().a("pkgName", this.c.getPackageName()).a()));
ResponseData b2 = cVar.b();
List<CircleMsgBean> list = b2 == null ? null : (List) b2.data;
if (list == null || list.isEmpty()) {
return;
}
Collections.reverse(list);
Iterator<CircleMsgBean> it = list.iterator();
HashSet hashSet = new HashSet();
while (it.hasNext()) {
CircleMsgBean next = it.next();
next.msg_owner_rid = i;
if (hashSet.contains(Long.valueOf(next.push_msgid))) {
it.remove();
} else {
hashSet.add(Long.valueOf(next.push_msgid));
}
}
this.d.a().a(list);
} catch (Exception e) {
Log.e("GameForumMsgRepo", "syncRemoteData: " + e.getMessage());
}
}
}