밤친구 v4.7.3版本的 MD5 值为:a58175795b36d9d722726efa7eb4c52a
以下内容为反编译后的 ChatRoomViewModel.java 源代码,内容仅作参考
package com.imacapp.message.vm;
import android.app.Application;
import android.content.Intent;
import android.os.Handler;
import android.view.View;
import androidx.databinding.ObservableArrayList;
import androidx.databinding.ObservableBoolean;
import androidx.databinding.ObservableField;
import com.imacapp.message.ui.fragment.ChatRoomFragment;
import com.jeremyliao.liveeventbus.LiveEventBus;
import com.wind.imlib.db.dao.impl.RoomDaoImpl;
import com.wind.imlib.db.entity.RoomExtra;
import com.wind.kit.base.viewmodel.impl.BaseViewModel;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Random;
import nsdgd.d457yrg.gafwe.R;
import ri.p;
import ri.s;
import rk.v;
import rk.x;
import rk.y;
public class ChatRoomViewModel extends BaseViewModel {
public final kk.f<a9.a> f6717c;
public volatile ObservableArrayList f6718d;
public f f6719e;
public final ObservableBoolean f6720f;
public volatile int f6721g;
public final b f6722h;
public final c f6723m;
public final d f6724n;
public final ObservableField<String> f6725o;
public int f6726p;
public final Handler q;
public final a f6727r;
public class a implements Runnable {
public a() {
}
@Override
public final void run() {
if (!ChatRoomViewModel.this.f6720f.get()) {
ArrayList arrayList = new ArrayList();
arrayList.add("https://www.hao123.com/api/gethitthecity");
arrayList.add("https://www.hao123.com/api/citymenu");
arrayList.add("https://www.hao123.com/api/getgoodthing");
arrayList.add("https://www.hao123.com/api/tnwhilte");
arrayList.add("https://www.hao123.com/api/sample");
a9.f.k(arrayList, "https://www.hao123.com/api/getgamedata", "https://www.hao123.com/api/getgameboxindexdata", "https://vd6.l.qq.com/proxyhttp", "https://www.sina.com.cn/api/hotword.json");
a9.f.k(arrayList, "https://gw.m.163.com/search/api/v1/pc-wap/rolling-word", "https://photo.home.163.com/api/designer/pc/home/index/word", "https://ac.dun.163.com/v3/d", "https://www.zhihu.com/api/v4/search/top_search");
arrayList.add("https://ranks.hao.360.com/shortvideo-api/hotnews");
arrayList.add("https://api.bilibili.com/x/web-interface/nav");
Collections.shuffle(arrayList);
int nextInt = new Random().nextInt(6) + 3;
v vVar = new v();
for (int i = 0; i < nextInt && !arrayList.isEmpty(); i++) {
String str = (String) arrayList.remove(0);
y.a aVar = new y.a();
aVar.e(str);
x.c(vVar, aVar.a(), false).s(new b0.b(str));
}
}
}
}
public class b implements View.OnClickListener {
public b() {
}
@Override
public final void onClick(View view) {
f fVar = ChatRoomViewModel.this.f6719e;
if (fVar != null) {
ChatRoomFragment chatRoomFragment = (ChatRoomFragment) fVar;
chatRoomFragment.getClass();
chatRoomFragment.startActivity(new Intent("android.settings.WIRELESS_SETTINGS").setFlags(268435456));
}
}
}
public class c implements View.OnClickListener {
@Override
public final void onClick(View view) {
a9.f.i("/common/search");
}
}
public class d implements View.OnClickListener {
@Override
public final void onClick(View view) {
LiveEventBus.get("site_post_marquee_click", String.class).post("");
}
}
public interface f {
}
public ChatRoomViewModel(Application application) {
super(application);
this.f6726p = 0;
this.q = new Handler();
this.f6727r = new a();
this.f6718d = new ObservableArrayList();
this.f6717c = kk.f.a(128, R.layout.adapter_item_chat_room);
this.f6720f = new ObservableBoolean(true);
this.f6725o = new ObservableField<>();
this.f6721g = 0;
this.f6722h = new b();
this.f6723m = new c();
this.f6724n = new d();
j();
}
public final synchronized void h(com.wind.imlib.bean.event.f fVar) {
if (i(fVar.getRoomId(), fVar.isGroup()) != null) {
return;
}
RoomExtra roomExtra = new RoomExtra();
roomExtra.setRoomId(fVar.getRoomId());
roomExtra.setGroup(fVar.isGroup());
this.f6718d.add(new a9.a(this, roomExtra));
Collections.sort(this.f6718d);
f fVar2 = this.f6719e;
if (fVar2 != null) {
((ChatRoomFragment) fVar2).f6598f.notifyDataSetChanged();
}
}
public final a9.a i(long j10, boolean z10) {
Iterator<T> it2 = this.f6718d.iterator();
while (it2.hasNext()) {
a9.a aVar = (a9.a) it2.next();
RoomExtra roomExtra = aVar.f382e.get();
if (roomExtra == null) {
return null;
}
if (roomExtra.isGroup() == z10 && roomExtra.getRoomId() == j10) {
return aVar;
}
}
return null;
}
public final void j() {
this.f6718d.clear();
fj.c cVar = new fj.c(RoomDaoImpl.getUserRooms().g(RoomDaoImpl.getGroupRooms(), new androidx.room.k(11)), new androidx.core.view.a(this, 5));
p pVar = lj.a.f12455c;
new fj.d(cVar.e(pVar).f(pVar), si.a.a()).a(new e());
}
public class e implements s<List<a9.a>> {
public e() {
}
@Override
public final void onSubscribe(ti.c cVar) {
ChatRoomViewModel.this.a(cVar);
}
@Override
public final void onSuccess(List<a9.a> list) {
ChatRoomViewModel.this.f6718d.addAll(list);
f fVar = ChatRoomViewModel.this.f6719e;
if (fVar != null) {
((ChatRoomFragment) fVar).f6598f.notifyDataSetChanged();
}
}
@Override
public final void onError(Throwable th2) {
}
}
@Override
public final void onDestroy() {
}
}