OurPlay v5.5.9版本的 MD5 值为:d4e139798f4c2243a1145c8af5e21046
以下内容为反编译后的 b.java 源代码,内容仅作参考
package com.excelliance.kxqp.gs.lygames;
import a.t;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.os.Handler;
import android.os.HandlerThread;
import android.os.Looper;
import android.text.TextUtils;
import android.util.Log;
import android.view.ViewGroup;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.fragment.app.FragmentManager;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import com.android.admodule.c.f;
import com.excean.bytedancebi.bean.BiEventAd;
import com.excean.ggspace.main.ApkDownDialogActivity;
import com.excean.ggspace.main.R;
import com.excelliance.kxqp.api.ApiManager;
import com.excelliance.kxqp.api.c;
import com.excelliance.kxqp.avds.AvdSplashCallBack;
import com.excelliance.kxqp.avds.AvdSplashCallBackImp;
import com.excelliance.kxqp.avds.AvdsFactory;
import com.excelliance.kxqp.avds.SplashAvd;
import com.excelliance.kxqp.community.ui.AppDetailActivity;
import com.excelliance.kxqp.gs.appstore.model.ResponseData;
import com.excelliance.kxqp.gs.ui.combine_recomend.model.CombineRecommendBean;
import com.excelliance.kxqp.gs.ui.combine_recomend.model.SplashLyBean;
import com.excelliance.kxqp.gs.ui.question.WebNoVideoActivity;
import com.excelliance.kxqp.gs.util.az;
import com.excelliance.kxqp.info.DataInfo;
import com.excelliance.kxqp.sdk.StatisticsBuilder;
import java.util.HashMap;
import java.util.Map;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
public class b extends SplashAvd {
private static Handler f7194a;
private static CombineRecommendBean.SubBean e;
private Handler f7195b;
private String c;
private ViewGroup d;
private AdvertisementFragment f;
private SharedPreferences g;
private String h;
private a i;
private Runnable j;
public b(AvdsFactory avdsFactory) {
super(avdsFactory);
this.i = new a() {
@Override
public void a() {
Log.d("LySplashAd", "onSkip: " + b.this.f);
b.this.g();
}
@Override
public void b() {
if (com.excean.ab_builder.c.a.af(b.this.context)) {
if (b.e == null || TextUtils.isEmpty(b.e.packageName)) {
return;
}
if (b.e.jumpType != 0 || b.e.isPopup != 1) {
b.this.h();
return;
} else if (TextUtils.equals(b.this.h, "com.excean.splay")) {
b.this.h();
return;
} else {
b.this.i();
return;
}
}
b.this.h();
}
@Override
public void c() {
Log.d("LySplashAd", "onClickJumpToRankDetai: ");
b.this.e();
}
@Override
public void d() {
Log.d("LySplashAd", "onADExposure: ");
b.this.d();
if (b.this.callBack == null || !(b.this.callBack instanceof AvdSplashCallBackImp)) {
return;
}
HashMap hashMap = new HashMap();
hashMap.put("adId", b.this.c);
hashMap.put(AvdSplashCallBackImp.KEY_AD_PLAT, Integer.valueOf(b.this.rootFactory.getAdPlatId()));
hashMap.put(AvdSplashCallBackImp.KEY_AD_VIEW, b.this.d);
((AvdSplashCallBackImp) b.this.callBack).onAdHandle(1006, hashMap);
}
};
this.j = new Runnable() {
@Override
public void run() {
Log.d("LySplashAd", "mdismissRunnable run: ");
if (!com.excelliance.kxqp.gs.download.b.a().a(b.e.buttonStatus)) {
b.this.e();
} else {
b.a();
}
b.this.g();
}
};
Log.d("LySplashAd", "LySplashAd: ");
this.isSupportNewCallBack = true;
HandlerThread handlerThread = new HandlerThread("HomePresenterWorker", 10);
handlerThread.start();
this.f7195b = new Handler(handlerThread.getLooper());
f7194a = new Handler(Looper.getMainLooper());
}
@Override
public void applySplashAd(Context context, AvdSplashCallBack avdSplashCallBack, ViewGroup viewGroup) {
applySplashAd(context, avdSplashCallBack, viewGroup, null);
}
@Override
public void applySplashAd(final Context context, AvdSplashCallBack avdSplashCallBack, ViewGroup viewGroup, Map<String, Object> map) {
Object obj;
super.applySplashAd(context, avdSplashCallBack, viewGroup, map);
setContext(context);
setCallBack(avdSplashCallBack);
this.h = context.getPackageName();
this.g = context.getSharedPreferences("ad_ly_data", 0);
if (map != null && (obj = map.get("adId")) != null) {
this.c = String.valueOf(obj);
}
Log.d("LySplashAd", "applySplashAd splashId = " + this.c + ", " + this.rootFactory.getAdPlatId());
this.f = new AdvertisementFragment();
a(context, 1, this.rootFactory.getAdPlatId());
if (this.callBack != null && (this.callBack instanceof AvdSplashCallBackImp)) {
HashMap hashMap = new HashMap();
hashMap.put("adId", this.c);
hashMap.put(AvdSplashCallBackImp.KEY_AD_PLAT, Integer.valueOf(this.rootFactory.getAdPlatId()));
((AvdSplashCallBackImp) this.callBack).onAdHandle(1000, hashMap);
}
this.d = viewGroup;
this.f7195b.post(new Runnable() {
@Override
public void run() {
c cVar = new c(context);
long j = b.this.g.getLong("lastTime", 0L);
Log.d("LySplashAd", "applySplashAd: lastTime = " + j);
if (j > 0) {
if (j > System.currentTimeMillis()) {
j = System.currentTimeMillis();
}
boolean a2 = f.a(j, 2);
Log.d("LySplashAd", "applySplashAd: afterSomeDays = " + a2);
if (a2) {
b.this.g.edit().remove("idShowTimes").apply();
}
}
String string = b.this.g.getString("idShowTimes", "");
Log.d("LySplashAd", "applySplashAd: idShowTimes = " + string);
retrofit2.b<ResponseData<SplashLyBean>> a3 = ApiManager.getInstance().a(context, 15000L, 15000L, "https://gapi.ourplay.com.cn/").a(b.this.rootFactory.getAdPlatId(), string);
StringBuilder sb = new StringBuilder();
sb.append("applySplashAd: url = ");
t tVar = null;
if (a3 != null && a3.e() != null) {
tVar = a3.e().a();
}
sb.append(tVar);
Log.d("LySplashAd", sb.toString());
cVar.a(a3);
ResponseData b2 = cVar.b();
az.d("LySplashAd", "applySplashAd responseData:" + b2);
if (b2 != null && b2.data != 0 && ((SplashLyBean) b2.data).index != null) {
b.this.a(context, 2, b.this.rootFactory.getAdPlatId());
CombineRecommendBean.SubBean unused = b.e = ((SplashLyBean) b2.data).index;
b.this.c = String.valueOf(b.e.adId);
Log.d("LySplashAd", "applySplashAd: splashId = " + b.this.c);
b.this.f.a(b.e);
b.f7194a.post(new Runnable() {
@Override
public void run() {
if (b.this.callBack == null || !(b.this.callBack instanceof AvdSplashCallBackImp)) {
return;
}
HashMap hashMap2 = new HashMap();
hashMap2.put("adId", b.this.c);
hashMap2.put(AvdSplashCallBackImp.KEY_AD_PLAT, Integer.valueOf(b.this.rootFactory.getAdPlatId()));
hashMap2.put(AvdSplashCallBackImp.KEY_AD_VIEW, b.this.d);
((AvdSplashCallBackImp) b.this.callBack).onAdHandle(1001, hashMap2);
}
});
return;
}
b.this.a(context, 3, b.this.rootFactory.getAdPlatId());
b.f7194a.post(new Runnable() {
@Override
public void run() {
b.this.a("request failed", -1);
}
});
}
});
}
@Override
public void destory() {
super.destory();
Log.d("LySplashAd", "destory: ");
if (this.f7195b != null) {
this.f7195b.getLooper().quit();
}
}
public void a(String str, int i) {
if (this.callBack == null || !(this.callBack instanceof AvdSplashCallBackImp)) {
return;
}
HashMap hashMap = new HashMap();
hashMap.put("adId", this.c);
hashMap.put(AvdSplashCallBackImp.KEY_AD_PLAT, Integer.valueOf(this.rootFactory.getAdPlatId()));
hashMap.put(AvdSplashCallBackImp.KEY_AD_ERROR_MSG, str + "_" + i);
((AvdSplashCallBackImp) this.callBack).onAdHandle(1002, hashMap);
Log.d("LySplashAd", "onErrorWithFailed: set callback null " + this.callBack);
}
@Override
public void showAd(ViewGroup viewGroup) {
super.showAd(viewGroup);
Log.d("LySplashAd", "showAd: " + viewGroup + ", adConfigBean = " + e);
StatisticsBuilder.getInstance().builder().setDescription("displaySplashGameAds").setPriKey1(148000).setPriKey2(21).setIntKey0().build(this.context);
Bundle bundle = new Bundle();
bundle.putInt("splash_ad_plat_id", this.rootFactory.getAdPlatId());
this.f.setArguments(bundle);
this.f.a(this.i);
FragmentManager supportFragmentManager = ((FragmentActivity) this.context).getSupportFragmentManager();
Fragment findFragmentByTag = supportFragmentManager.findFragmentByTag("AdvertisementFragment");
Log.d("LySplashAd", "showAd: fragment = " + findFragmentByTag);
if (findFragmentByTag == null) {
supportFragmentManager.beginTransaction().replace(R.id.fl_content, this.f, "AdvertisementFragment").commitAllowingStateLoss();
} else if (findFragmentByTag instanceof AdvertisementFragment) {
this.f = (AdvertisementFragment) findFragmentByTag;
this.f.setArguments(bundle);
}
if (this.callBack == null || !(this.callBack instanceof AvdSplashCallBackImp)) {
return;
}
HashMap hashMap = new HashMap();
hashMap.put("adId", this.c);
hashMap.put(AvdSplashCallBackImp.KEY_AD_PLAT, Integer.valueOf(this.rootFactory.getAdPlatId()));
hashMap.put(AvdSplashCallBackImp.KEY_AD_VIEW, this.d);
((AvdSplashCallBackImp) this.callBack).onAdHandle(1004, hashMap);
}
public void d() {
String jSONArray;
int i;
String str = null;
String string = this.g.getString("idShowTimes", null);
Log.d("LySplashAd", "rememberShowTimes: " + string);
try {
if (!TextUtils.isEmpty(string)) {
JSONArray jSONArray2 = new JSONArray(string);
int i2 = -1;
boolean z = false;
int i3 = 0;
while (true) {
if (i3 >= jSONArray2.length()) {
i = 0;
break;
}
JSONObject optJSONObject = jSONArray2.optJSONObject(i3);
if (optJSONObject.toString().contains(this.c)) {
int optInt = optJSONObject.optInt(this.c);
Log.d("LySplashAd", "rememberShowTimes: showTimes = " + optInt + ", " + this.c);
i2 = i3;
i = optInt;
z = true;
break;
}
i3++;
}
Log.d("LySplashAd", "showAd: isContains = " + z + ", " + i2 + ", " + i);
if (!z) {
JSONObject jSONObject = new JSONObject();
jSONObject.put(this.c, 1);
jSONArray2.put(jSONObject);
jSONArray = jSONArray2.toString();
} else {
jSONArray2.remove(i2);
JSONObject jSONObject2 = new JSONObject();
jSONObject2.put(this.c, i + 1);
jSONArray2.put(jSONObject2);
jSONArray = jSONArray2.toString();
}
} else {
JSONObject jSONObject3 = new JSONObject();
jSONObject3.put(this.c, 1);
JSONArray jSONArray3 = new JSONArray();
jSONArray3.put(jSONObject3);
jSONArray = jSONArray3.toString();
}
str = jSONArray;
} catch (JSONException e2) {
e2.printStackTrace();
} catch (Exception e3) {
e3.printStackTrace();
}
Log.d("LySplashAd", "rememberShowTimes: end " + str);
this.g.edit().putString("idShowTimes", str).putLong("lastTime", System.currentTimeMillis()).apply();
}
private void b(Context context, int i, int i2) {
Log.d("LySplashAd", "reportAction: " + i + ", " + i2);
HashMap hashMap = new HashMap();
hashMap.put("stringKey1", com.android.admodule.c.c.a().b().a(AvdSplashCallBackImp.KEY_AD_TYPE, (Object) 1).a(AvdSplashCallBackImp.KEY_AD_PLAT, Integer.valueOf(i2)).a("action", Integer.valueOf(i)).c());
}
public void a(Context context, int i, int i2) {
Log.d("LySplashAd", "actionCallback: " + i + ", " + i2);
if (i == 1) {
b(context, 1000, i2);
a("开始请求", (String) null, i2);
} else if (i == 3) {
b(context, 1002, i2);
a("失败", "请求", i2);
}
}
private void a(String str, String str2, int i) {
BiEventAd biEventAd = new BiEventAd();
biEventAd.current_page = "开屏页";
biEventAd.is_request_successfully = str;
biEventAd.current_situation = str2;
biEventAd.platform_ad = i + "";
com.excelliance.kxqp.gs.g.c.a().a(biEventAd);
}
public void e() {
Log.d("LySplashAd", "actionClickJumpToRankDetai: " + e);
f();
}
private void f() {
Log.d("LySplashAd", "onClickJumpRankDetail: " + e + ", isMainUIRegister = " + DataInfo.isMainUIRegister());
if (this.callBack != null && (this.callBack instanceof AvdSplashCallBackImp)) {
HashMap hashMap = new HashMap();
hashMap.put("adId", this.c);
hashMap.put(AvdSplashCallBackImp.KEY_AD_PLAT, Integer.valueOf(this.rootFactory.getAdPlatId()));
((AvdSplashCallBackImp) this.callBack).onAdHandle(1005, hashMap);
}
if (e == null || TextUtils.isEmpty(e.packageName)) {
return;
}
AppDetailActivity.a(this.context, e.packageName, "fromSplashRecommend");
}
public void g() {
Log.d("LySplashAd", "actionSkip: " + this.f);
if (this.f == null) {
return;
}
if (this.f != null) {
((FragmentActivity) this.context).getSupportFragmentManager().beginTransaction().remove(this.f);
this.f = null;
}
if (this.callBack != null) {
this.callBack.onAdDismissed();
}
}
public void h() {
Log.d("LySplashAd", "actionClickAd: " + e);
if (this.callBack != null && (this.callBack instanceof AvdSplashCallBackImp)) {
HashMap hashMap = new HashMap();
hashMap.put("adId", this.c);
hashMap.put(AvdSplashCallBackImp.KEY_AD_PLAT, Integer.valueOf(this.rootFactory.getAdPlatId()));
((AvdSplashCallBackImp) this.callBack).onAdHandle(1005, hashMap);
}
if (e == null || TextUtils.isEmpty(e.packageName)) {
return;
}
switch (e.jumpType) {
case 0:
if (TextUtils.equals(this.h, "com.excean.splay")) {
g();
return;
} else {
a();
return;
}
case 1:
AppDetailActivity.a(this.context, e.packageName, "fromSplashRecommend");
return;
case 2:
if (TextUtils.isEmpty(e.jumpUrl)) {
return;
}
WebNoVideoActivity.startActivity(this.context, e.jumpUrl);
return;
default:
return;
}
}
public static void a() {
Log.d("LySplashAd", "onSendAdDownload: " + DataInfo.isMainUIRegister());
if (f7194a == null) {
return;
}
long j = DataInfo.isMainUIRegister() ? 100L : 500L;
Log.d("LySplashAd", "onSendAdDownload: delayTime = " + j);
f7194a.postDelayed(new Runnable() {
@Override
public void run() {
Log.d("LySplashAd", "onSendAdDownloadrun: isMainUIRegister = " + DataInfo.isMainUIRegister());
try {
Intent intent = new Intent("action.start.download.after.click.ad");
Bundle bundle = new Bundle();
bundle.putParcelable("ad_detail", b.e);
intent.putExtra("splash_ad_detail", bundle);
LocalBroadcastManager.getInstance(DataInfo.getApplicationContext()).sendBroadcast(intent);
} catch (Exception e2) {
e2.printStackTrace();
}
}
}, j);
}
public void i() {
Log.d("LySplashAd", "showDownloadDialog: ");
if (e != null) {
ApkDownDialogActivity.a(this.context, e, this.j);
}
}
}