OurPlay v5.5.9版本的 MD5 值为:d4e139798f4c2243a1145c8af5e21046
以下内容为反编译后的 AccelerateViewModel.java 源代码,内容仅作参考
package com.excelliance.kxqp.gs.ui.accelerate;
import android.app.Application;
import android.content.Context;
import androidx.annotation.NonNull;
import androidx.lifecycle.AndroidViewModel;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import com.excelliance.kxqp.bean.AppExtraBean;
import com.excelliance.kxqp.gs.game.GameAttributesHelper;
import com.excelliance.kxqp.gs.k.b.b;
import com.excelliance.kxqp.gs.k.b.d;
import com.excelliance.kxqp.gs.k.b.e;
import com.excelliance.kxqp.gs.thpool.tp;
import com.excelliance.kxqp.gs.util.as;
import com.excelliance.kxqp.gs.util.au;
import com.excelliance.kxqp.gs.util.ay;
import com.excelliance.kxqp.gs.util.az;
import com.excelliance.kxqp.gs.util.bm;
import com.excelliance.kxqp.gs.util.ce;
import com.excelliance.kxqp.platforms.ExcellianceAppInfo;
import com.excelliance.kxqp.widget.a;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
public class AccelerateViewModel extends AndroidViewModel {
private final MutableLiveData<b> f8427a;
private final MutableLiveData<c> f8428b;
private final MutableLiveData<b.c> c;
private final MutableLiveData<List<a.C0603a>> d;
public AccelerateViewModel(@NonNull Application application) {
super(application);
this.f8427a = new MutableLiveData<>();
this.f8428b = new MutableLiveData<>();
this.c = new MutableLiveData<>();
this.d = new MutableLiveData<>();
}
public LiveData<b> a() {
return this.f8427a;
}
public LiveData<c> b() {
return this.f8428b;
}
public MutableLiveData<b.c> c() {
return this.c;
}
public MutableLiveData<List<a.C0603a>> d() {
return this.d;
}
public void a(c cVar) {
this.f8428b.postValue(cVar);
}
public void a(ExcellianceAppInfo excellianceAppInfo) {
if (excellianceAppInfo == null) {
return;
}
if (com.excelliance.kxqp.gs.util.b.bx(getApplication()) && au.a().u(excellianceAppInfo.getAppPackageName())) {
bm.b(getApplication());
} else if (com.excelliance.kxqp.gs.util.b.ce(getApplication())) {
com.excelliance.kxqp.gs.router.a.a.c.stopAccelerator(getApplication(), "", excellianceAppInfo.getAppPackageName(), false);
} else {
bm.a(getApplication());
}
if (com.excean.ab_builder.c.a.at(getApplication()) && excellianceAppInfo.apkFrom == 2) {
bm.b(getApplication());
}
com.excelliance.kxqp.wr.a.a().a(0, excellianceAppInfo.getAppPackageName());
this.f8428b.postValue(c.HALT);
}
public LiveData<AppExtraBean> a(String str) {
MutableLiveData mutableLiveData = new MutableLiveData();
mutableLiveData.setValue(GameAttributesHelper.getInstance().getAppExtraBeanFromCache(str));
return mutableLiveData;
}
public void a(final String str, final int i) {
b b2 = a.a().b(str);
if (b2 != null) {
this.f8428b.setValue(c.RESUME);
this.f8427a.setValue(b2);
} else {
this.f8428b.setValue(c.PREPARE);
tp.f(new Runnable() {
@Override
public void run() {
Random random = new Random();
b bVar = new b();
float a2 = ce.a("www.baidu.com", 1) * 1.1f;
if (i == 0) {
int nextInt = random.nextInt(11) + 80;
bVar.a(nextInt);
bVar.b(random.nextInt(2) + 0);
bVar.a((a2 * nextInt) / 100.0f);
} else if (i == 1) {
int nextInt2 = random.nextInt(16) + 60;
bVar.a(nextInt2);
bVar.b(0);
bVar.a((a2 * nextInt2) / 100.0f);
}
if (bVar.b() > 50.0f) {
bVar.a(50.0f);
}
AccelerateViewModel.this.f8427a.postValue(bVar);
a.a().a(str, bVar);
}
});
}
}
public void a(final AppExtraBean appExtraBean, final ExcellianceAppInfo excellianceAppInfo, final Context context) {
az.d("AccelerateViewModel", "switchRewardVipProxy enter appExtra:" + appExtraBean + " appInfo:" + excellianceAppInfo);
tp.d(new Runnable() {
@Override
public void run() {
if (excellianceAppInfo == null || appExtraBean == null) {
az.d("AccelerateViewModel", "switchRewardVipProxy pkg == appExtra:" + appExtraBean + " appInfo:" + excellianceAppInfo);
AccelerateViewModel.this.c.postValue(new b.c.a().a());
return;
}
b.C0251b a2 = new b.C0251b.a().a(context.getApplicationContext()).a(appExtraBean).a(excellianceAppInfo).a(context).a();
ArrayList arrayList = new ArrayList();
arrayList.add(new com.excelliance.kxqp.gs.k.b.a());
arrayList.add(new e());
arrayList.add(new d());
AccelerateViewModel.this.c.postValue(new com.excelliance.kxqp.gs.k.b.c(arrayList, 0, a2).a(a2));
}
});
}
public void a(final Context context) {
tp.f(new Runnable() {
@Override
public void run() {
List<com.excelliance.kxqp.gs.ui.gaccount.b> b2 = ay.a(context, as.h(context)).b();
ArrayList arrayList = new ArrayList();
for (int i = 0; i < b2.size(); i++) {
com.excelliance.kxqp.gs.ui.gaccount.b bVar = b2.get(i);
arrayList.add(new a.C0603a(bVar.d(), bVar.e(), bVar.g(), bVar.f9261a));
}
AccelerateViewModel.this.d.postValue(arrayList);
}
});
}
}