Apk Done v1.0版本的 MD5 值为:44cfb8e1ce639995aa7f0de6a3a6388b
以下内容为反编译后的 TTRewardVideoActivity.java 源代码,内容仅作参考
package com.bytedance.sdk.openadsdk.activity;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import com.bykv.vk.openvk.component.video.api.d.c;
import com.bytedance.sdk.component.f.e;
import com.bytedance.sdk.component.f.g;
import com.bytedance.sdk.component.utils.l;
import com.bytedance.sdk.component.utils.t;
import com.bytedance.sdk.openadsdk.TTAdConstant;
import com.bytedance.sdk.openadsdk.TTRewardVideoAd;
import com.bytedance.sdk.openadsdk.c.b.a.a;
import com.bytedance.sdk.openadsdk.c.b.b.o;
import com.bytedance.sdk.openadsdk.core.f.j;
import com.bytedance.sdk.openadsdk.core.f.n;
import com.bytedance.sdk.openadsdk.core.o;
import com.bytedance.sdk.openadsdk.core.p;
import com.bytedance.sdk.openadsdk.core.q;
import com.bytedance.sdk.openadsdk.core.r;
import com.bytedance.sdk.openadsdk.core.w;
import com.bytedance.sdk.openadsdk.core.widget.a;
import com.bytedance.sdk.openadsdk.multipro.b;
import com.ironsource.mediationsdk.utils.IronSourceConstants;
import com.yandex.metrica.YandexMetricaDefaultValues;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.atomic.AtomicBoolean;
import org.json.JSONObject;
public class TTRewardVideoActivity extends TTBaseVideoActivity {
private static final String T = t.a(o.a(), "tt_reward_msg");
private static final String U = t.a(o.a(), "tt_msgPlayable");
private static final String V = t.a(o.a(), "tt_negtiveBtnBtnText");
private static final String W = t.a(o.a(), "tt_postiveBtnText");
private static final String X = t.a(o.a(), "tt_postiveBtnTextPlayable");
private static TTRewardVideoAd.RewardAdInteractionListener ac;
protected int Q;
protected int R;
protected TTRewardVideoAd.RewardAdInteractionListener S;
private String Y;
private int Z;
private String aa;
private String ab;
private AtomicBoolean ad = new AtomicBoolean(false);
private int ae = -1;
public void O() {
o.a aVar = new o.a();
aVar.a(this.m.s());
aVar.c(this.m.u());
aVar.b(this.m.j());
aVar.e(3);
aVar.f(this.m.r());
a.a(this.m.c(), aVar, this.m.a());
this.m.m();
r.c(this.t);
this.m.a("skip", (Map<String, Object>) null);
if (h()) {
a(true);
if (j.a(this.c)) {
}
if (!b.c()) {
b("onSkippedVideo");
return;
}
TTRewardVideoAd.RewardAdInteractionListener rewardAdInteractionListener = this.S;
if (rewardAdInteractionListener != null) {
rewardAdInteractionListener.onSkippedVideo();
return;
}
return;
}
finish();
if (!b.c()) {
}
}
private JSONObject P() {
JSONObject jSONObject = new JSONObject();
int v = (int) this.m.v();
try {
jSONObject.put("oversea_version_type", 1);
jSONObject.put("reward_name", this.Y);
jSONObject.put("reward_amount", this.Z);
jSONObject.put("network", com.bytedance.sdk.component.utils.o.c(this.b));
jSONObject.put("sdk_version", "4.2.5.2");
int C = this.c.C();
String str = "unKnow";
if (C == 2) {
str = com.bytedance.sdk.openadsdk.l.r.a();
} else if (C == 1) {
str = com.bytedance.sdk.openadsdk.l.r.b();
}
jSONObject.put("user_agent", str);
jSONObject.put("extra", new JSONObject(this.c.Y()));
jSONObject.put("media_extra", this.aa);
jSONObject.put("video_duration", this.c.G().e());
jSONObject.put("play_start_ts", this.Q);
jSONObject.put("play_end_ts", this.R);
jSONObject.put(IronSourceConstants.EVENTS_DURATION, v);
jSONObject.put("user_id", this.ab);
jSONObject.put("trans_id", UUID.randomUUID().toString().replace("-", ""));
return jSONObject;
} catch (Throwable unused) {
return null;
}
}
private void Q() {
if (this.G) {
return;
}
this.G = true;
if (b.c()) {
b("onAdClose");
return;
}
TTRewardVideoAd.RewardAdInteractionListener rewardAdInteractionListener = this.S;
if (rewardAdInteractionListener != null) {
rewardAdInteractionListener.onAdClose();
}
}
public void a(final String str, final boolean z, final int i, final String str2, final int i2, final String str3) {
e.b(new g("Reward_executeMultiProcessCallback") {
@Override
public void run() {
try {
TTRewardVideoActivity.this.a(0).executeRewardVideoCallback(TTRewardVideoActivity.this.d, str, z, i, str2, i2, str3);
} catch (Throwable th) {
l.c("TTRewardVideoActivity", "executeRewardVideoCallback execute throw Exception : ", th);
}
}
}, 5);
}
public void b(final boolean z, final boolean z2) {
com.bytedance.sdk.openadsdk.core.widget.a a;
String str;
if (!com.bytedance.sdk.openadsdk.core.o.h().d(String.valueOf(this.t))) {
if (!z) {
O();
return;
}
if (!z2) {
if (b.c()) {
b("onSkippedVideo");
} else {
TTRewardVideoAd.RewardAdInteractionListener rewardAdInteractionListener = this.S;
if (rewardAdInteractionListener != null) {
rewardAdInteractionListener.onSkippedVideo();
}
}
}
finish();
} else if (this.ad.get()) {
if (!z) {
O();
return;
}
if (!z2) {
if (b.c()) {
b("onSkippedVideo");
} else {
TTRewardVideoAd.RewardAdInteractionListener rewardAdInteractionListener2 = this.S;
if (rewardAdInteractionListener2 != null) {
rewardAdInteractionListener2.onSkippedVideo();
}
}
}
finish();
} else {
this.A.set(true);
this.m.o();
if (z) {
y();
}
final com.bytedance.sdk.openadsdk.core.widget.a aVar = new com.bytedance.sdk.openadsdk.core.widget.a(this);
this.B = aVar;
com.bytedance.sdk.openadsdk.core.widget.a aVar2 = this.B;
if (z) {
a = aVar2.a(U);
str = X;
} else {
a = aVar2.a(T);
str = W;
}
a.b(str).c(V);
this.B.a(new a.InterfaceC0118a() {
@Override
public void a() {
TTRewardVideoActivity.this.m.n();
if (z) {
TTRewardVideoActivity.this.z();
}
aVar.dismiss();
TTRewardVideoActivity.this.A.set(false);
}
@Override
public void b() {
aVar.dismiss();
TTRewardVideoActivity.this.A.set(false);
TTRewardVideoActivity.this.p.d(Integer.MAX_VALUE);
if (z) {
TTRewardVideoActivity.this.s();
if (!z2) {
if (b.c()) {
TTRewardVideoActivity.this.b("onSkippedVideo");
} else if (TTRewardVideoActivity.this.S != null) {
TTRewardVideoActivity.this.S.onSkippedVideo();
}
}
TTRewardVideoActivity.this.finish();
return;
}
TTRewardVideoActivity.this.O();
}
}).show();
}
}
private boolean b(Bundle bundle) {
String stringExtra;
if (b.c()) {
Intent intent = getIntent();
if (intent != null && (stringExtra = intent.getStringExtra(TTAdConstant.MULTI_PROCESS_MATERIALMETA)) != null) {
try {
this.c = com.bytedance.sdk.openadsdk.core.b.a(new JSONObject(stringExtra));
} catch (Exception e) {
l.c("TTRewardVideoActivity", "TTRewardVideoActivity MultiGlobalInfo throw ", e);
}
}
} else {
this.c = w.a().c();
this.S = w.a().d();
}
if (!b.c()) {
w.a().g();
}
if (bundle != null) {
if (this.S == null) {
this.S = ac;
ac = null;
}
try {
this.c = com.bytedance.sdk.openadsdk.core.b.a(new JSONObject(bundle.getString("material_meta")));
this.w.set(bundle.getBoolean("has_show_skip_btn"));
if (this.w.get()) {
this.k.d(true);
this.k.a((String) null, com.bytedance.sdk.openadsdk.core.j.e.c);
this.k.e(true);
}
} catch (Throwable unused) {
}
}
if (this.c == null) {
l.e("TTRewardVideoActivity", "mMaterialMeta is null , no data to display ,the TTRewardVideoActivity finished !!");
finish();
return false;
}
this.n.a(this.c, this.a);
this.n.a();
this.c.a(this.c.d(), 7);
return true;
}
@Override
protected void A() {
int i = com.bytedance.sdk.openadsdk.core.o.h().m(String.valueOf(this.t)).f;
boolean z = true;
boolean z2 = false;
if (n.j(this.c)) {
double C = this.m.C();
double d = this.s;
Double.isNaN(d);
} else {
boolean z3 = (1.0f - (((float) this.p.k()) / ((float) this.c.ap()))) * 100.0f >= ((float) i);
int a = com.bytedance.sdk.openadsdk.core.o.h().a(String.valueOf(this.t));
if (a == 0) {
if (z3) {
}
z = false;
z2 = z;
} else if (a == 1) {
z2 = z3;
}
}
if (z2) {
f(YandexMetricaDefaultValues.DEFAULT_MAX_REPORTS_COUNT_UPPER_BOUND);
}
}
@Override
protected void H() {
View k = this.i.k();
if (k != null) {
k.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
TTRewardVideoActivity.this.o.r();
TTRewardVideoActivity.this.s();
if (n.i(TTRewardVideoActivity.this.c)) {
TTRewardVideoActivity.this.b(true, true);
} else {
TTRewardVideoActivity.this.finish();
}
}
});
}
this.k.a(new com.bytedance.sdk.openadsdk.component.reward.top.b() {
@Override
public void a(View view) {
TTRewardVideoActivity tTRewardVideoActivity = TTRewardVideoActivity.this;
tTRewardVideoActivity.b(n.i(tTRewardVideoActivity.c), false);
}
@Override
public void b(View view) {
if (TTRewardVideoActivity.this.L != null && TTRewardVideoActivity.this.L.a() != null) {
TTRewardVideoActivity.this.L.a().a(TTRewardVideoActivity.this.r);
}
TTRewardVideoActivity tTRewardVideoActivity = TTRewardVideoActivity.this;
tTRewardVideoActivity.r = !tTRewardVideoActivity.r;
l.b("TTRewardVideoActivity", "will set is Mute " + TTRewardVideoActivity.this.r + " mLastVolume=" + TTRewardVideoActivity.this.E.b());
TTRewardVideoActivity.this.m.b(TTRewardVideoActivity.this.r);
if (!n.j(TTRewardVideoActivity.this.c) || TTRewardVideoActivity.this.v.get()) {
if (n.a(TTRewardVideoActivity.this.c)) {
TTRewardVideoActivity.this.E.a(TTRewardVideoActivity.this.r, true);
}
TTRewardVideoActivity.this.o.d(TTRewardVideoActivity.this.r);
}
}
@Override
public void c(View view) {
TTRewardVideoActivity.this.G();
}
});
}
@Override
public boolean I() {
return true;
}
@Override
public void K() {
if (b.c()) {
b("onAdShow");
return;
}
TTRewardVideoAd.RewardAdInteractionListener rewardAdInteractionListener = this.S;
if (rewardAdInteractionListener != null) {
rewardAdInteractionListener.onAdShow();
}
}
@Override
public void L() {
if (b.c()) {
b("onAdVideoBarClick");
return;
}
TTRewardVideoAd.RewardAdInteractionListener rewardAdInteractionListener = this.S;
if (rewardAdInteractionListener != null) {
rewardAdInteractionListener.onAdVideoBarClick();
}
}
public void M() {
if (this.ad.get()) {
return;
}
this.ad.set(true);
if (!com.bytedance.sdk.openadsdk.core.o.h().l(String.valueOf(this.t))) {
com.bytedance.sdk.openadsdk.core.o.f().a(P(), new p.b() {
@Override
public void a(int i, String str) {
if (b.c()) {
TTRewardVideoActivity.this.a("onRewardVerify", false, 0, "", i, str);
} else if (TTRewardVideoActivity.this.S != null) {
TTRewardVideoActivity.this.S.onRewardVerify(false, 0, "", i, str);
}
}
@Override
public void a(final q.b bVar) {
final int a = bVar.c.a();
final String b = bVar.c.b();
if (b.c()) {
TTRewardVideoActivity.this.a("onRewardVerify", bVar.b, a, b, 0, "");
} else {
TTRewardVideoActivity.this.q.post(new Runnable() {
@Override
public void run() {
if (TTRewardVideoActivity.this.S != null) {
TTRewardVideoActivity.this.S.onRewardVerify(bVar.b, a, b, 0, "");
}
}
});
}
}
});
} else if (b.c()) {
a("onRewardVerify", true, this.Z, this.Y, 0, "");
} else {
this.q.post(new Runnable() {
@Override
public void run() {
if (TTRewardVideoActivity.this.S != null) {
TTRewardVideoActivity.this.S.onRewardVerify(true, TTRewardVideoActivity.this.Z, TTRewardVideoActivity.this.Y, 0, "");
}
}
});
}
}
public void N() {
if (b.c()) {
b("onVideoComplete");
return;
}
TTRewardVideoAd.RewardAdInteractionListener rewardAdInteractionListener = this.S;
if (rewardAdInteractionListener != null) {
rewardAdInteractionListener.onVideoComplete();
}
}
public void a(long j, long j2) {
if (this.ae == -1) {
this.ae = com.bytedance.sdk.openadsdk.core.o.h().m(String.valueOf(this.t)).f;
}
if (j2 <= 0) {
return;
}
if (j2 >= 30000 && j >= 27000) {
M();
} else if (((float) (j * 100)) / ((float) j2) >= this.ae) {
M();
}
}
@Override
public void a(Intent intent) {
super.a(intent);
if (intent == null) {
return;
}
this.Y = intent.getStringExtra("reward_name");
this.Z = intent.getIntExtra("reward_amount", 0);
this.aa = intent.getStringExtra("media_extra");
this.ab = intent.getStringExtra("user_id");
}
public boolean a(long j, boolean z) {
HashMap hashMap;
com.bytedance.sdk.openadsdk.c.j jVar = new com.bytedance.sdk.openadsdk.c.j();
jVar.a(System.currentTimeMillis(), 1.0f);
this.m.a(this.i.h(), this.c, this.a, I(), jVar);
if (TextUtils.isEmpty(this.D)) {
hashMap = null;
} else {
hashMap = new HashMap();
hashMap.put("rit_scene", this.D);
}
this.m.a(hashMap);
c.a aVar = new c.a() {
@Override
public void a(long j2, int i) {
TTRewardVideoActivity.this.q.removeMessages(300);
TTRewardVideoActivity.this.E();
TTRewardVideoActivity.this.N();
TTRewardVideoActivity.this.N.set(true);
if (TTRewardVideoActivity.this.h()) {
TTRewardVideoActivity.this.a(false);
} else {
TTRewardVideoActivity.this.finish();
}
TTRewardVideoActivity.this.R = (int) (System.currentTimeMillis() / 1000);
TTRewardVideoActivity.this.M();
}
@Override
public void b(long j2, int i) {
TTRewardVideoActivity.this.q.removeMessages(300);
if (b.c()) {
TTRewardVideoActivity.this.b("onVideoError");
} else if (TTRewardVideoActivity.this.S != null) {
TTRewardVideoActivity.this.S.onVideoError();
}
TTRewardVideoActivity.this.D();
if (TTRewardVideoActivity.this.m.b()) {
return;
}
TTRewardVideoActivity.this.E();
TTRewardVideoActivity.this.m.m();
TTRewardVideoActivity.this.M();
if (TTRewardVideoActivity.this.h()) {
TTRewardVideoActivity.this.a(false, true);
} else {
TTRewardVideoActivity.this.finish();
}
TTRewardVideoActivity.this.m.a(1 ^ TTRewardVideoActivity.this.m.B(), 2);
}
@Override
public void a() {
TTRewardVideoActivity.this.q.removeMessages(300);
TTRewardVideoActivity.this.E();
if (TTRewardVideoActivity.this.h()) {
TTRewardVideoActivity.this.a(false, true);
} else {
TTRewardVideoActivity.this.finish();
}
TTRewardVideoActivity.this.m.a(!TTRewardVideoActivity.this.m.B(), 1 ^ TTRewardVideoActivity.this.m.B());
TTRewardVideoActivity.this.m.m();
}
@Override
public void a(long j2, long j3) {
if (!TTRewardVideoActivity.this.H && TTRewardVideoActivity.this.m.b()) {
TTRewardVideoActivity.this.m.o();
}
if (TTRewardVideoActivity.this.v.get()) {
return;
}
TTRewardVideoActivity.this.q.removeMessages(300);
if (j2 != TTRewardVideoActivity.this.m.f()) {
TTRewardVideoActivity.this.E();
}
TTRewardVideoActivity.this.m.a(j2);
TTRewardVideoActivity tTRewardVideoActivity = TTRewardVideoActivity.this;
double C = tTRewardVideoActivity.m.C();
long j4 = j2 / 1000;
double d = j4;
Double.isNaN(d);
tTRewardVideoActivity.s = (int) (C - d);
if (TTRewardVideoActivity.this.s >= 0) {
TTRewardVideoActivity.this.k.a(String.valueOf(TTRewardVideoActivity.this.s), (CharSequence) null);
}
TTRewardVideoActivity tTRewardVideoActivity2 = TTRewardVideoActivity.this;
double C2 = tTRewardVideoActivity2.m.C();
Double.isNaN(d);
tTRewardVideoActivity2.s = (int) (C2 - d);
int i = (int) j4;
int f = com.bytedance.sdk.openadsdk.core.o.h().f(String.valueOf(TTRewardVideoActivity.this.t));
boolean z2 = f >= 0;
if ((TTRewardVideoActivity.this.A.get() || TTRewardVideoActivity.this.y.get()) && TTRewardVideoActivity.this.m.b()) {
TTRewardVideoActivity.this.m.o();
}
TTRewardVideoActivity.this.i.c(i);
TTRewardVideoActivity.this.a(j2, j3);
if (TTRewardVideoActivity.this.s > 0) {
TTRewardVideoActivity.this.k.d(true);
if (z2 && i >= f) {
TTRewardVideoActivity.this.w.getAndSet(true);
TTRewardVideoActivity.this.k.a(String.valueOf(TTRewardVideoActivity.this.s), com.bytedance.sdk.openadsdk.core.j.e.c);
TTRewardVideoActivity.this.k.e(true);
return;
}
TTRewardVideoActivity.this.k.a(String.valueOf(TTRewardVideoActivity.this.s), (CharSequence) null);
} else if (j.c(TTRewardVideoActivity.this.c) || j.b(TTRewardVideoActivity.this.c)) {
TTRewardVideoActivity.this.a(false);
} else if (j.a(TTRewardVideoActivity.this.c) && !TTRewardVideoActivity.this.g.get()) {
TTRewardVideoActivity.this.w.getAndSet(true);
TTRewardVideoActivity.this.k.d(true);
TTRewardVideoActivity.this.k.e(true);
} else if (TTRewardVideoActivity.this.h()) {
TTRewardVideoActivity.this.a(false);
} else {
TTRewardVideoActivity.this.finish();
}
}
};
this.m.a(aVar);
this.m.a(aVar);
if (this.i.w != null) {
this.i.w.a(aVar);
}
boolean a = a(j, z, hashMap);
if (a && !z) {
this.Q = (int) (System.currentTimeMillis() / 1000);
}
return a;
}
public void b(String str) {
a(str, false, 0, "", 0, "");
}
@Override
public void f(int i) {
if (i == 10000) {
M();
} else if (i == 10001) {
N();
}
}
protected void finalize() throws Throwable {
super.finalize();
ac = null;
}
@Override
public void finish() {
Q();
super.finish();
}
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
if (b(bundle)) {
t();
u();
d();
a();
}
}
@Override
public void onDestroy() {
super.onDestroy();
if (this.l != null) {
this.l.f();
}
Q();
if (b.c()) {
b("recycleRes");
}
this.S = null;
}
@Override
public void onRewardBarClick(View view) {
if (b.c()) {
b("onAdVideoBarClick");
return;
}
TTRewardVideoAd.RewardAdInteractionListener rewardAdInteractionListener = this.S;
if (rewardAdInteractionListener != null) {
rewardAdInteractionListener.onAdVideoBarClick();
}
}
@Override
public void onSaveInstanceState(Bundle bundle) {
if (bundle == null) {
bundle = new Bundle();
}
ac = this.S;
super.onSaveInstanceState(bundle);
}
}