91重口 v1.4.7版本的 MD5 值为:b580d7e8a501ee704e75352ed0f5eb0d
以下内容为反编译后的 SplashActivity.java 源代码,内容仅作参考
package com.grass.mh;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.KeyEvent;
import android.view.View;
import androidx.appcompat.app.AppCompatActivity;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModelProvider;
import c.l.d;
import c.o.a.n;
import com.androidjks.kstv.d1711186961359174241.R;
import com.androidx.lv.base.BaseApp;
import com.androidx.lv.base.bean.AdInfoBean;
import com.androidx.lv.base.bean.AdListBean;
import com.androidx.lv.base.bean.UserInfo;
import com.androidx.lv.base.bean.event.LoginEvent;
import com.androidx.lv.base.dialog.DialogLoading;
import com.androidx.lv.base.http.BaseRes;
import com.androidx.lv.base.model.LoginModel;
import com.androidx.lv.base.model.UserInfoModel;
import com.androidx.lv.base.service.AdClickService;
import com.androidx.lv.base.utils.AccountCacheUtils;
import com.androidx.lv.base.utils.AdUtils;
import com.androidx.lv.base.utils.BuildConfigUtils;
import com.androidx.lv.base.utils.DeviceIDUtils;
import com.androidx.lv.base.utils.LogUtils;
import com.androidx.lv.base.utils.NetUtil;
import com.androidx.lv.base.utils.SpUtils;
import com.androidx.lv.base.utils.ToastUtils;
import com.androidx.lv.base.utils.UiUtils;
import com.grass.mh.MainActivity;
import com.grass.mh.SplashActivity;
import com.grass.mh.databinding.ActivitySplashLayoutBinding;
import com.grass.mh.ui.community.OnlineServiceChannelActivity;
import com.grass.mh.utils.M3u8CopyUtil;
import com.gyf.immersionbar.ImmersionBar;
import com.lzy.okgo.cache.CacheMode;
import com.lzy.okgo.cookie.SerializableCookie;
import com.lzy.okgo.model.HttpHeaders;
import com.lzy.okgo.request.GetRequest;
import com.lzy.okgo.request.PostRequest;
import com.tbruyelle.rxpermissions2.RxPermissions;
import e.c.a.a.d.c;
import e.f.c.i;
import e.g.a.a0;
import e.g.a.b0;
import e.g.a.g0.q;
import e.g.a.x;
import e.g.a.y;
import e.g.a.z;
import g.a.b0.g;
import g.a.b0.h;
import g.a.o;
import io.reactivex.internal.functions.Functions;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.security.NoSuchAlgorithmException;
import java.util.Calendar;
import java.util.Date;
import java.util.Objects;
import java.util.Random;
import java.util.UUID;
import java.util.concurrent.atomic.AtomicInteger;
import m.b.a.l;
import okhttp3.Request;
import org.greenrobot.eventbus.ThreadMode;
import org.json.JSONArray;
import org.json.JSONObject;
public class SplashActivity extends AppCompatActivity {
public static String[] f4499d = {"android.permission.READ_EXTERNAL_STORAGE", "android.permission.WRITE_EXTERNAL_STORAGE"};
public ActivitySplashLayoutBinding f4500h;
public g.a.z.b f4501l;
public LoginModel f4502m;
public UserInfoModel o;
public DialogLoading p;
public String s;
public boolean f4503n = false;
public String[] q = {"https://ks.uuwn2k.xyz", "https://ks.uxrz5j.xyz", "https://ks.v1uea0.xyz"};
public boolean r = true;
public class a extends e.c.a.a.d.d.a<BaseRes<AdListBean>> {
public a(String str) {
super(str);
}
@Override
public void onLvSuccess(Object obj) {
BaseRes baseRes = (BaseRes) obj;
ActivitySplashLayoutBinding activitySplashLayoutBinding = SplashActivity.this.f4500h;
if (activitySplashLayoutBinding == null) {
return;
}
activitySplashLayoutBinding.f4976h.setVisibility(8);
if (baseRes.getCode() == 200) {
AdUtils.getInstance().putAdBean((AdListBean) baseRes.getData());
AdInfoBean splash = AdUtils.getInstance().getSplash();
if (splash == null) {
SplashActivity splashActivity = SplashActivity.this;
Objects.requireNonNull(splashActivity);
splashActivity.startActivity(new Intent(splashActivity, MainActivity.class));
SplashActivity.this.finish();
return;
}
final SplashActivity splashActivity2 = SplashActivity.this;
final int adId = splash.getAdId();
String str = SpUtils.getInstance().getString(SerializableCookie.DOMAIN) + splash.getAdImage();
final String adJump = splash.getAdJump();
Objects.requireNonNull(splashActivity2);
if (!TextUtils.isEmpty(str)) {
e.c.a.a.c.b.w(str, splashActivity2.f4500h.f4975d);
}
splashActivity2.f4500h.f4975d.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
SplashActivity splashActivity3 = SplashActivity.this;
String str2 = adJump;
int i2 = adId;
Objects.requireNonNull(splashActivity3);
try {
Intent intent = new Intent();
intent.setAction("android.intent.action.VIEW");
intent.setData(Uri.parse(str2));
splashActivity3.startActivity(intent);
} catch (Exception e2) {
e2.printStackTrace();
}
Intent intent2 = new Intent(splashActivity3, AdClickService.class);
intent2.putExtra("adId", i2);
splashActivity3.startService(intent2);
}
});
splashActivity2.f4500h.p.setVisibility(0);
splashActivity2.f4500h.q.setVisibility(8);
splashActivity2.f4500h.p.setClickable(false);
splashActivity2.f4500h.q.setClickable(false);
new b0(splashActivity2, 5000L, 1000L).start();
splashActivity2.f4500h.q.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
SplashActivity splashActivity3 = SplashActivity.this;
if (splashActivity3.f4503n) {
splashActivity3.startActivity(new Intent(splashActivity3, MainActivity.class));
splashActivity3.finish();
}
}
});
return;
}
AdUtils.getInstance().deleteALL();
SplashActivity splashActivity3 = SplashActivity.this;
Objects.requireNonNull(splashActivity3);
splashActivity3.startActivity(new Intent(splashActivity3, MainActivity.class));
SplashActivity.this.finish();
}
}
public class b implements g<String> {
public b() {
}
@Override
public void accept(String str) {
String str2 = str;
Objects.requireNonNull(SplashActivity.this);
SplashActivity splashActivity = SplashActivity.this;
if (splashActivity == null || splashActivity.f4500h == null || TextUtils.isEmpty(str2)) {
return;
}
e.c.a.a.d.c cVar = c.b.a;
cVar.a = str2;
SpUtils.getInstance().put("baseUrl", cVar.a);
SplashActivity.this.d();
g.a.z.b bVar = SplashActivity.this.f4501l;
if (bVar != null) {
bVar.dispose();
SplashActivity.this.f4501l = null;
}
SplashActivity.this.b();
}
}
public class c implements h<String, String> {
public c(SplashActivity splashActivity) {
}
@Override
public String apply(String str) {
int i2;
String str2 = str;
try {
i2 = n.L0().newCall(new Request.Builder().url(e.a.a.a.a.x(str2, "/api/sys/live")).build()).execute().code();
} catch (Exception e2) {
e2.printStackTrace();
i2 = 0;
}
return i2 == 200 ? str2 : "";
}
}
public void a() {
this.f4500h.f4976h.setVisibility(0);
this.p.show();
M3u8CopyUtil.copyAssetsToDst(this);
new Thread(new Runnable() {
@Override
public final void run() {
final SplashActivity splashActivity = SplashActivity.this;
Objects.requireNonNull(splashActivity);
final AtomicInteger atomicInteger = new AtomicInteger();
final String[] choiceLines = BuildConfigUtils.getChoiceLines();
for (final String str : choiceLines) {
final String x = e.a.a.a.a.x(str, "/api/sys/live");
new Thread(new Runnable() {
@Override
public final void run() {
int i2;
SplashActivity splashActivity2 = SplashActivity.this;
String str2 = x;
String str3 = str;
AtomicInteger atomicInteger2 = atomicInteger;
String[] strArr = choiceLines;
Objects.requireNonNull(splashActivity2);
try {
i2 = c.o.a.n.L0().newCall(new Request.Builder().url(str2).addHeader(HttpHeaders.HEAD_KEY_USER_AGENT, c.o.a.n.f3080h).build()).execute().code();
} catch (Exception e2) {
e2.printStackTrace();
i2 = 0;
}
if (200 == i2) {
if (splashActivity2.r) {
splashActivity2.r = false;
e.c.a.a.d.c cVar = c.b.a;
cVar.a = str3;
SpUtils.getInstance().put("baseUrl", cVar.a);
LogUtils.e("okgo", "success lines[i]==" + str3);
splashActivity2.d();
splashActivity2.b();
return;
}
return;
}
atomicInteger2.getAndIncrement();
LogUtils.e("okgo", "failNum==" + atomicInteger2 + "====" + str3);
if (atomicInteger2.get() == strArr.length) {
LogUtils.e("okgo", "RetryEvent");
m.b.a.c.b().f(new e.g.a.g0.q());
}
}
}).start();
}
}
}).start();
}
public final void b() {
try {
DialogLoading dialogLoading = this.p;
if (dialogLoading != null && dialogLoading.isShowing()) {
this.p.dismiss();
}
} catch (Exception unused) {
} catch (Throwable th) {
this.p = null;
throw th;
}
this.p = null;
}
public void c() {
String n2 = e.a.a.a.a.n(c.b.a, new StringBuilder(), "/api/sys/advertisement/list");
a aVar = new a("AdList");
((GetRequest) ((GetRequest) ((GetRequest) new GetRequest(n2).tag(aVar.getTag())).cacheKey(n2)).cacheMode(CacheMode.NO_CACHE)).execute(aVar);
}
public final void d() {
String loadCache = AccountCacheUtils.loadCache();
if (TextUtils.isEmpty(loadCache)) {
try {
loadCache = DeviceIDUtils.toMD5(String.valueOf(System.currentTimeMillis() + UUID.randomUUID().getLeastSignificantBits()));
} catch (NoSuchAlgorithmException e2) {
e2.printStackTrace();
}
AccountCacheUtils.saveCache(loadCache);
}
SpUtils.getInstance().put("DeviceIDUtils", loadCache);
if (!NetUtil.isNetworkAvailable()) {
ToastUtils.getInstance().showWrong(UiUtils.getString(R.string.hit_no_net));
} else if (TextUtils.isEmpty(SpUtils.getInstance().getString("token"))) {
String uniqueId = DeviceIDUtils.getUniqueId(this);
String clipData = UiUtils.getClipData();
LoginModel loginModel = this.f4502m;
Objects.requireNonNull(loginModel);
JSONObject c2 = e.c.a.a.d.b.b().c(uniqueId, clipData);
String n2 = e.a.a.a.a.n(c.b.a, new StringBuilder(), "/api/user/traveler");
e.c.a.a.f.a aVar = new e.c.a.a.f.a(loginModel, "travelerLogin");
((PostRequest) ((PostRequest) e.a.a.a.a.e(c2, e.a.a.a.a.K(n2, "_"), (PostRequest) new PostRequest(n2).tag(aVar.getTag()))).m20upJson(c2).cacheMode(CacheMode.NO_CACHE)).execute(aVar);
} else {
this.o.a(this);
}
}
public void g(UserInfo userInfo) {
SpUtils.getInstance().setUserInfo(userInfo);
if (!TextUtils.isEmpty(userInfo.getToken())) {
SpUtils.getInstance().put("token", userInfo.getToken());
}
SpUtils.getInstance().put(SerializableCookie.DOMAIN, userInfo.getImgDomain());
c();
e.c.a.a.d.c cVar = c.b.a;
String u = cVar.u();
a0 a0Var = new a0(this, "getHotSearch");
CacheMode cacheMode = CacheMode.NO_CACHE;
((GetRequest) ((GetRequest) ((GetRequest) new GetRequest(u).tag(a0Var.getTag())).cacheKey(u)).cacheMode(cacheMode)).execute(a0Var);
SpUtils.getInstance().setAiEntranceConfig(null);
String n2 = e.a.a.a.a.n(cVar, new StringBuilder(), "/api/aibox/entranceConfig");
z zVar = new z(this, "");
((GetRequest) ((GetRequest) ((GetRequest) new GetRequest(n2).tag(zVar.getTag())).cacheKey(n2)).cacheMode(cacheMode)).execute(zVar);
}
@l(threadMode = ThreadMode.MAIN)
public void loginEventListener(LoginEvent loginEvent) {
c();
}
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
if (!isTaskRoot() && getIntent().hasCategory("android.intent.category.LAUNCHER") && getIntent().getAction() != null && getIntent().getAction().equals("android.intent.action.MAIN")) {
finish();
return;
}
getWindow().addFlags(128);
ActivitySplashLayoutBinding activitySplashLayoutBinding = (ActivitySplashLayoutBinding) d.e(this, R.layout.activity_splash_layout);
this.f4500h = activitySplashLayoutBinding;
activitySplashLayoutBinding.setLifecycleOwner(this);
System.currentTimeMillis();
BaseApp.f3435l = 0;
getWindow().addFlags(1024);
m.b.a.c.b().j(this);
this.f4502m = (LoginModel) new ViewModelProvider(this).a(LoginModel.class);
DialogLoading dialogLoading = new DialogLoading(this);
this.p = dialogLoading;
dialogLoading.setTvHint("選線中,請稍後...");
if (Build.VERSION.SDK_INT >= 23) {
new RxPermissions(this).request(f4499d).i(new g() {
@Override
public final void accept(Object obj) {
SplashActivity splashActivity = SplashActivity.this;
Objects.requireNonNull(splashActivity);
if (((Boolean) obj).booleanValue()) {
if (NetUtil.isNetworkAvailable()) {
splashActivity.a();
return;
} else {
ToastUtils.getInstance().showWrong(UiUtils.getString(R.string.hit_no_net));
return;
}
}
ToastUtils.getInstance().showSigh("請允許許可權,否則無法進入app");
}
}, Functions.f12604e, Functions.f12602c, Functions.f12603d);
} else {
a();
}
LoginModel loginModel = this.f4502m;
if (loginModel.f3440b == null) {
loginModel.f3440b = new MutableLiveData<>();
}
loginModel.f3440b.e(this, new x(this));
UserInfoModel userInfoModel = (UserInfoModel) new ViewModelProvider(this).a(UserInfoModel.class);
this.o = userInfoModel;
if (userInfoModel.a == null) {
userInfoModel.a = new MutableLiveData<>();
}
userInfoModel.a.e(this, new y(this));
Date date = new Date();
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
calendar.get(7);
i iVar = App.o;
ImmersionBar.with(this).titleBar(this.f4500h.f4977l).init();
final String str = this.q[new Random().nextInt(3)];
e.a.a.a.a.e0("若进不去点我重新安装:", str, this.f4500h.o);
this.f4500h.o.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
SplashActivity splashActivity = SplashActivity.this;
String str2 = str;
Objects.requireNonNull(splashActivity);
try {
Intent intent = new Intent();
intent.setAction("android.intent.action.VIEW");
intent.setData(Uri.parse(str2));
splashActivity.startActivity(intent);
} catch (Exception e2) {
e2.printStackTrace();
}
}
});
this.f4500h.f4979n.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
SplashActivity splashActivity = SplashActivity.this;
Objects.requireNonNull(splashActivity);
if (!TextUtils.isEmpty(c.b.a.j())) {
splashActivity.startActivity(new Intent(splashActivity, OnlineServiceChannelActivity.class));
splashActivity.finish();
return;
}
ToastUtils.getInstance().showWrong("备用域名访问失败,请稍后重试联系客服");
}
});
}
@Override
public void onDestroy() {
DialogLoading dialogLoading = this.p;
if (dialogLoading != null && dialogLoading.isShowing()) {
this.p.dismiss();
}
m.b.a.c.b().l(this);
super.onDestroy();
g.a.z.b bVar = this.f4501l;
if (bVar != null) {
bVar.dispose();
this.f4501l = null;
}
}
@Override
public boolean onKeyDown(int i2, KeyEvent keyEvent) {
if (i2 == 4 || i2 == 3) {
return true;
}
return super.onKeyDown(i2, keyEvent);
}
@l(threadMode = ThreadMode.BACKGROUND)
public void retryNet(q qVar) {
try {
HttpURLConnection httpURLConnection = (HttpURLConnection) new URL("https://d2pecyfr9ihskt.cloudfront.net/ks.json").openConnection();
httpURLConnection.setRequestMethod("GET");
httpURLConnection.connect();
if (httpURLConnection.getResponseCode() == 200) {
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(httpURLConnection.getInputStream(), "utf-8"));
while (true) {
String readLine = bufferedReader.readLine();
if (readLine == null) {
break;
}
this.s += readLine;
}
JSONArray jSONArray = new JSONArray(this.s.replace("null", ""));
String[] strArr = new String[jSONArray.length()];
for (int i2 = 0; i2 < jSONArray.length(); i2++) {
strArr[i2] = jSONArray.getString(i2);
}
this.f4501l = o.d(strArr).g(new c(this)).k(g.a.f0.a.f12458b).h(g.a.y.a.a.a()).i(new b(), new g() {
@Override
public final void accept(Object obj) {
SplashActivity splashActivity = SplashActivity.this;
Throwable th = (Throwable) obj;
if (splashActivity.f4500h == null) {
return;
}
splashActivity.b();
}
}, new g.a.b0.a() {
@Override
public final void run() {
SplashActivity splashActivity = SplashActivity.this;
if (splashActivity.f4500h == null) {
return;
}
splashActivity.b();
ToastUtils.getInstance().showWeak("连线失败!");
splashActivity.f4500h.f4978m.setText("连线失败");
}
}, Functions.f12603d);
}
} catch (Exception e2) {
e2.printStackTrace();
}
}
}