그늘 v4.6.9版本的 MD5 值为:45bd3dac9e441bb87fea09c92b437adc
以下内容为反编译后的 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 k0.p;
import qi.s;
import qk.u;
import qk.w;
import qk.x;
public class ChatRoomViewModel extends BaseViewModel {
public final jk.f<z8.a> f4182c;
public volatile ObservableArrayList f4183d;
public f f4184e;
public final ObservableBoolean f4185f;
public volatile int f4186g;
public final b f4187h;
public final c f4188m;
public final d f4189n;
public final ObservableField<String> f4190o;
public int f4191p;
public final Handler q;
public final a f4192r;
public class a implements Runnable {
public a() {
}
@Override
public final void run() {
if (!ChatRoomViewModel.this.f4185f.get()) {
ArrayList arrayList = new ArrayList();
arrayList.add("https://www.baidu.com");
arrayList.add("https://www.weibo.com");
Collections.shuffle(arrayList);
new Random().nextInt(2);
u uVar = new u();
if (!arrayList.isEmpty()) {
String str = (String) arrayList.remove(0);
x.a aVar = new x.a();
aVar.e(str);
w.c(uVar, aVar.a(), false).u(new com.fk.b(str));
}
}
}
}
public class b implements View.OnClickListener {
public b() {
}
@Override
public final void onClick(View view) {
f fVar = ChatRoomViewModel.this.f4184e;
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) {
androidx.appcompat.graphics.drawable.a.k("/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 class e implements s<List<z8.a>> {
public e() {
}
@Override
public final void onError(Throwable th2) {
}
@Override
public final void onSubscribe(si.c cVar) {
ChatRoomViewModel.this.a(cVar);
}
@Override
public final void onSuccess(List<z8.a> list) {
ChatRoomViewModel.this.f4183d.addAll(list);
f fVar = ChatRoomViewModel.this.f4184e;
if (fVar != null) {
((ChatRoomFragment) fVar).f4063f.notifyDataSetChanged();
}
}
}
public interface f {
}
public ChatRoomViewModel(Application application) {
super(application);
this.f4191p = 0;
this.q = new Handler();
this.f4192r = new a();
this.f4183d = new ObservableArrayList();
this.f4182c = jk.f.a(128, 2131558503);
this.f4185f = new ObservableBoolean(true);
this.f4190o = new ObservableField<>();
this.f4186g = 0;
this.f4187h = new b();
this.f4188m = new c();
this.f4189n = 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.f4183d.add(new z8.a(this, roomExtra));
Collections.sort(this.f4183d);
f fVar2 = this.f4184e;
if (fVar2 != null) {
((ChatRoomFragment) fVar2).f4063f.notifyDataSetChanged();
}
}
public final z8.a i(long j10, boolean z10) {
Iterator<T> it2 = this.f4183d.iterator();
while (it2.hasNext()) {
z8.a aVar = (z8.a) it2.next();
RoomExtra roomExtra = aVar.f16171e.get();
if (roomExtra == null) {
return null;
}
if (roomExtra.isGroup() == z10 && roomExtra.getRoomId() == j10) {
return aVar;
}
}
return null;
}
public final void j() {
this.f4183d.clear();
ej.c cVar = new ej.c(RoomDaoImpl.getUserRooms().g(RoomDaoImpl.getGroupRooms(), new androidx.room.g(9)), new p(this));
qi.p pVar = kj.a.f9548c;
new ej.d(cVar.e(pVar).f(pVar), ri.a.a()).a(new e());
}
@Override
public final void onDestroy() {
}
}