正在查看: Fancy Optimizer v4.6.3 应用的 TJPlacement.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Fancy Optimizer v4.6.3 应用的 TJPlacement.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.tapjoy;
import android.content.Context;
import android.content.Intent;
import android.os.SystemClock;
import android.text.TextUtils;
import com.tapjoy.TJAdUnitConstants;
import com.tapjoy.TapjoyErrorMessage;
import com.tapjoy.internal.fp;
import com.tapjoy.internal.fs;
import com.tapjoy.internal.fy;
import com.tapjoy.internal.gd;
import com.tapjoy.internal.gi;
import com.tapjoy.internal.gj;
import com.tapjoy.internal.hd;
import com.tapjoy.internal.hg;
import com.tapjoy.internal.hk;
import com.tapjoy.internal.hp;
import com.tapjoy.internal.hr;
import java.util.HashMap;
import java.util.UUID;
public class TJPlacement {
TJPlacementListener a;
private TJCorePlacement b;
private TJPlacementListener c;
private TJPlacementVideoListener d;
private String e;
public String pushId;
@Deprecated
public TJPlacement(Context context, String str, TJPlacementListener tJPlacementListener) {
TJCorePlacement a = TJPlacementManager.a(str);
a = a == null ? TJPlacementManager.a(str, "", "", false, false) : a;
a.setContext(context);
a(a, tJPlacementListener);
}
private void a(TJCorePlacement tJCorePlacement, TJPlacementListener tJPlacementListener) {
this.b = tJCorePlacement;
this.e = UUID.randomUUID().toString();
this.c = tJPlacementListener;
this.a = tJPlacementListener != null ? (TJPlacementListener) fp.a(tJPlacementListener, TJPlacementListener.class) : null;
FiveRocksIntegration.addPlacementCallback(getName(), this);
}
public static void dismissContent() {
TJPlacementManager.dismissContentShowing("true".equals(TapjoyConnectCore.getConnectFlagValue("TJC_OPTION_DISMISS_CONTENT_ALL")));
}
public String getGUID() {
return this.e;
}
public TJPlacementListener getListener() {
return this.c;
}
public String getName() {
return this.b.getPlacementData() != null ? this.b.getPlacementData().getPlacementName() : "";
}
public TJPlacementVideoListener getVideoListener() {
return this.d;
}
public boolean isContentAvailable() {
this.b.f.a(1);
return this.b.isContentAvailable();
}
public boolean isContentReady() {
boolean isContentReady = this.b.isContentReady();
fy fyVar = this.b.f;
if (isContentReady) {
fyVar.a(4);
} else {
fyVar.a(2);
}
return isContentReady;
}
public boolean isLimited() {
return this.b.isLimited();
}
public void requestContent() {
String name = getName();
TapjoyLog.i("TJPlacement", "requestContent() called for placement ".concat(String.valueOf(name)));
gj.a("TJPlacement.requestContent").a("placement", name).a("placement_type", this.b.c.getPlacementType());
if (gi.a() != null && TextUtils.isEmpty(gi.a().a)) {
TapjoyLog.w("TJPlacement", "[INFO] Your application calls requestContent without having previously called setUserConsent. You can review Tapjoy supported consent API here - https://dev.tapjoy.com/sdk-integration/#sdk11122_gdpr_release.");
}
boolean z = false;
if (!(!isLimited() ? TapjoyConnectCore.isConnected() : TapjoyConnectCore.isLimitedConnected())) {
gj.b("TJPlacement.requestContent").b("not connected").c();
a(new TJError(0, "SDK not connected -- connect must be called first with a successful callback"));
return;
}
if (this.b.getContext() == null) {
gj.b("TJPlacement.requestContent").b("no context").c();
a(new TJError(0, "Context is null -- TJPlacement requires a valid Context."));
return;
}
if (TextUtils.isEmpty(name)) {
gj.b("TJPlacement.requestContent").b("invalid name").c();
a(new TJError(0, "Invalid placement name -- TJPlacement requires a valid placement name."));
return;
}
try {
this.b.g.setSdkBeacon();
TJCorePlacement tJCorePlacement = this.b;
tJCorePlacement.a("REQUEST", this);
if (tJCorePlacement.e - SystemClock.elapsedRealtime() > 0) {
TapjoyLog.d(TJCorePlacement.a, "Content has not expired yet for " + tJCorePlacement.c.getPlacementName());
if (tJCorePlacement.l) {
gj.b("TJPlacement.requestContent").a("content_type", tJCorePlacement.b()).a("from", "cache").c();
tJCorePlacement.k = false;
tJCorePlacement.a(this);
tJCorePlacement.c();
} else {
gj.b("TJPlacement.requestContent").a("content_type", "none").a("from", "cache").c();
tJCorePlacement.a(this);
}
} else {
if (tJCorePlacement.l) {
gj.c("TJPlacement.requestContent").a("was_available", Boolean.TRUE);
}
if (tJCorePlacement.m) {
gj.c("TJPlacement.requestContent").a("was_ready", Boolean.TRUE);
}
if (!TextUtils.isEmpty(tJCorePlacement.p)) {
HashMap hashMap = new HashMap();
hashMap.put(TJAdUnitConstants.PARAM_PLACEMENT_MEDIATION_AGENT, tJCorePlacement.p);
hashMap.put(TJAdUnitConstants.PARAM_PLACEMENT_MEDIATION_ID, tJCorePlacement.q);
HashMap<String, String> hashMap2 = tJCorePlacement.r;
if (hashMap2 != null && !hashMap2.isEmpty()) {
z = true;
}
if (z) {
for (String str : tJCorePlacement.r.keySet()) {
hashMap.put(TJAdUnitConstants.AUCTION_PARAM_PREFIX.concat(String.valueOf(str)), tJCorePlacement.r.get(str));
}
tJCorePlacement.a(tJCorePlacement.c.getAuctionMediationURL(), hashMap);
} else {
tJCorePlacement.a(tJCorePlacement.c.getMediationURL(), hashMap);
}
} else {
tJCorePlacement.a();
}
}
} finally {
gj.d("TJPlacement.requestContent");
}
}
public void setAdapterVersion(String str) {
this.b.o = str;
}
public void setAuctionData(HashMap<String, String> hashMap) {
if (hashMap == null || hashMap.isEmpty()) {
TapjoyLog.d("TJPlacement", "auctionData can not be null or empty");
return;
}
TJCorePlacement tJCorePlacement = this.b;
tJCorePlacement.r = hashMap;
String e = tJCorePlacement.e();
if (TextUtils.isEmpty(e)) {
TapjoyLog.i(TJCorePlacement.a, "Placement auction data can not be set for a null app ID");
return;
}
tJCorePlacement.c.setAuctionMediationURL(TapjoyConnectCore.getPlacementURL() + "v1/apps/" + e + "/bid_content?");
}
public void setMediationId(String str) {
this.b.q = str;
}
public void setMediationName(String str) {
TapjoyLog.d("TJPlacement", "setMediationName=".concat(String.valueOf(str)));
if (TextUtils.isEmpty(str)) {
return;
}
TJCorePlacement tJCorePlacement = this.b;
Context context = tJCorePlacement != null ? tJCorePlacement.getContext() : null;
TJCorePlacement a = TJPlacementManager.a(getName(), str, "", false, isLimited());
this.b = a;
a.p = str;
a.n = str;
a.c.setPlacementType(str);
String e = a.e();
if (TextUtils.isEmpty(e)) {
TapjoyLog.i(TJCorePlacement.a, "Placement mediation name can not be set for a null app ID");
} else {
a.c.setMediationURL(TapjoyConnectCore.getPlacementURL() + "v1/apps/" + e + "/mediation_content?");
}
if (context != null) {
this.b.setContext(context);
}
}
public void setVideoListener(TJPlacementVideoListener tJPlacementVideoListener) {
this.d = tJPlacementVideoListener;
}
public void showContent() {
TapjoyLog.i("TJPlacement", "showContent() called for placement ".concat(String.valueOf(getName())));
if (gd.c) {
HashMap hashMap = new HashMap();
hashMap.put("contentReady", String.valueOf(isContentReady()));
this.b.getAdUnit().getTjBeacon().a(TJAdUnitConstants.String.BEACON_SHOW_PATH, hashMap);
}
TJCorePlacement tJCorePlacement = this.b;
gj.a("TJPlacement.showContent").a("placement", tJCorePlacement.c.getPlacementName()).a("placement_type", tJCorePlacement.c.getPlacementType()).a("content_type", tJCorePlacement.b());
fy fyVar = tJCorePlacement.f;
fyVar.a(8);
fs fsVar = fyVar.a;
if (fsVar != null) {
fsVar.a();
}
if (!this.b.isContentAvailable()) {
TapjoyLog.e("TJPlacement", new TapjoyErrorMessage(TapjoyErrorMessage.ErrorType.INTEGRATION_ERROR, "No placement content available. Can not show content for non-200 placement."));
gj.b("TJPlacement.showContent").b("no content").c();
return;
}
try {
final TJCorePlacement tJCorePlacement2 = this.b;
if (TapjoyConnectCore.isFullScreenViewOpen()) {
TapjoyLog.w(TJCorePlacement.a, "Only one view can be presented at a time.");
gj.b("TJPlacement.showContent").b("another content showing").c();
} else {
if (TapjoyConnectCore.isViewOpen()) {
TapjoyLog.w(TJCorePlacement.a, "Will close N2E content.");
TJPlacementManager.dismissContentShowing(false);
}
tJCorePlacement2.a("SHOW", this);
gj.a d = gj.d("TJPlacement.showContent");
if (tJCorePlacement2.g.isPrerendered()) {
d.a("prerendered", Boolean.TRUE);
}
if (tJCorePlacement2.isContentReady()) {
d.a("content_ready", Boolean.TRUE);
}
tJCorePlacement2.f.d = d;
final String uuid = UUID.randomUUID().toString();
hr hrVar = tJCorePlacement2.i;
if (hrVar != null) {
hrVar.f = uuid;
TapjoyConnectCore.viewWillOpen(uuid, hrVar == null ? 1 : hrVar instanceof hg ? 3 : hrVar instanceof hp ? 2 : 0);
tJCorePlacement2.i.e = new hd() {
public final void a(Context context, String str, String str2) {
if (str2 == null) {
TJCorePlacement.this.c.setRedirectURL(str);
} else {
TJCorePlacement.this.c.setBaseURL(str);
TJCorePlacement.this.c.setHttpResponse(str2);
}
TJCorePlacement.this.c.setHasProgressSpinner(true);
TJCorePlacement.this.c.setContentViewId(uuid);
Intent intent = new Intent(TJCorePlacement.this.b, (Class<?>) TJAdUnitActivity.class);
intent.putExtra(TJAdUnitConstants.EXTRA_TJ_PLACEMENT_DATA, TJCorePlacement.this.c);
intent.setFlags(268435456);
context.startActivity(intent);
}
};
hk.a(new Runnable() {
@Override
public final void run() {
TJCorePlacement.this.i.a(hk.a().o, TJCorePlacement.this.f);
}
});
} else {
tJCorePlacement2.c.setContentViewId(uuid);
Intent intent = new Intent(tJCorePlacement2.b, (Class<?>) TJAdUnitActivity.class);
intent.putExtra(TJAdUnitConstants.EXTRA_TJ_PLACEMENT_DATA, tJCorePlacement2.c);
intent.setFlags(268435456);
tJCorePlacement2.b.startActivity(intent);
}
tJCorePlacement2.e = 0L;
tJCorePlacement2.l = false;
tJCorePlacement2.m = false;
}
} finally {
gj.d("TJPlacement.showContent");
}
}
public TJPlacement(TJCorePlacement tJCorePlacement, TJPlacementListener tJPlacementListener) {
a(tJCorePlacement, tJPlacementListener);
}
private void a(TJError tJError) {
this.b.a(this, TapjoyErrorMessage.ErrorType.INTEGRATION_ERROR, tJError);
}
}