正在查看: Cantique de Louanges v12 应用的 FullscreenActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Cantique de Louanges v12 应用的 FullscreenActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.appnext.ads.fullscreen;
import android.app.Fragment;
import android.app.FragmentManager;
import android.app.FragmentTransaction;
import android.content.Intent;
import android.content.res.Configuration;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.widget.RelativeLayout;
import com.applovin.mediation.MaxReward;
import com.appnext.R;
import com.appnext.core.Ad;
import com.appnext.core.AppnextActivity;
import com.appnext.core.AppnextAd;
import com.appnext.core.AppnextError;
import com.appnext.core.SettingsManager;
import com.appnext.core.callbacks.OnAdClicked;
import com.appnext.core.callbacks.OnAdClosed;
import com.appnext.core.callbacks.OnAdError;
import com.appnext.core.callbacks.OnAdOpened;
import com.appnext.core.f;
import com.appnext.core.n;
import com.appnext.core.p;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Locale;
import java.util.Random;
public class FullscreenActivity extends AppnextActivity implements h, i, j, f.a {
private ArrayList<AppnextAd> ads;
private SettingsManager f11492g;
private AppnextAd f11494i;
private AppnextAd f11495j;
private HashMap<String, Integer> f11496k;
private Video f11497l;
private Handler mHandler;
private int type;
private boolean f11493h = true;
private boolean finished = false;
private int f11498m = 0;
Runnable f11499n = new Runnable() {
@Override
public final void run() {
if (((AppnextActivity) FullscreenActivity.this).userAction != null) {
((AppnextActivity) FullscreenActivity.this).userAction.d(FullscreenActivity.this.f11494i);
}
FullscreenActivity.this.report("impression_event", "S2");
}
};
Runnable f11500o = new Runnable() {
@Override
public final void run() {
FullscreenActivity fullscreenActivity = FullscreenActivity.this;
fullscreenActivity.a(fullscreenActivity.f11494i, (f.a) null);
FullscreenActivity.this.report("vta_event", "S2");
}
};
@Override
public void closeClicked() {
try {
if (this.f11498m == 1 && !isRewarded() && Integer.parseInt(getConfig().t("clickType_a")) > new Random(System.nanoTime()).nextInt(100)) {
installClicked(getSelectedAd());
} else {
a();
finish();
}
} catch (Throwable th) {
com.appnext.base.a.a("FullscreenActivity$closeClicked", th);
}
}
@Override
public long closeDelay() {
try {
if (b() instanceof FullScreenVideo) {
return ((FullScreenVideo) b()).getCloseDelay();
}
return 0L;
} catch (Throwable th) {
com.appnext.base.a.a("FullscreenActivity$closeDelay", th);
return 0L;
}
}
@Override
public void error(String str) {
S();
report("error_resolve_timeout");
}
@Override
public int getCaptionTextTime() {
try {
return b().getRollCaptionTime();
} catch (Throwable th) {
com.appnext.base.a.a("FullscreenActivity$getCaptionTextTime", th);
return 0;
}
}
@Override
protected final SettingsManager getConfig() {
if (this.f11492g == null) {
if (this.type == 1) {
this.f11492g = c.h();
} else {
this.f11492g = f.o();
}
}
return this.f11492g;
}
@Override
public SettingsManager getConfigManager() {
return getConfig();
}
@Override
public String getCtaText() {
try {
String buttonText = new FullscreenAd(this.f11494i).getButtonText();
String str = "existing";
if (this.f11494i != null && buttonText.equals(MaxReward.DEFAULT_LABEL)) {
return isInstalled() ? com.appnext.core.a.a.n(this).a(this.f11497l.getLanguage(), "existing", "Open") : com.appnext.core.a.a.n(this).a(this.f11497l.getLanguage(), "new", "Install");
}
com.appnext.core.a.a n4 = com.appnext.core.a.a.n(this);
String language = this.f11497l.getLanguage();
if (!isInstalled()) {
str = "new";
}
return n4.a(language, str, buttonText);
} catch (Throwable th) {
com.appnext.base.a.a("FullscreenActivity$getCtaText", th);
return MaxReward.DEFAULT_LABEL;
}
}
@Override
public String getLanguage() {
return this.f11497l.getLanguage();
}
@Override
public boolean getMute() {
return b().getMute();
}
@Override
public ArrayList<AppnextAd> getPostRollAds() {
return this.ads;
}
@Override
public ArrayList<AppnextAd> getPreRollAds() {
if (this.ads == null) {
this.ads = b.f().e(b());
}
ArrayList<AppnextAd> arrayList = new ArrayList<>();
AppnextAd a5 = a(this.ads, this.placementID, MaxReward.DEFAULT_LABEL);
arrayList.add(a5);
AppnextAd a6 = a(this.ads, this.placementID, a5.getBannerID());
if (a6 != null && !a6.getBannerID().equals(arrayList.get(0).getBannerID())) {
arrayList.add(a6);
}
return arrayList;
}
@Override
public AppnextAd getSelectedAd() {
return this.f11494i;
}
@Override
public Uri getSelectedVideoUri() {
String str;
String videoUrl = b.getVideoUrl(this.f11494i, b().getVideoLength());
String b5 = b.b(videoUrl);
if (Video.getCacheVideo()) {
str = getFilesDir().getAbsolutePath() + "/data/appnext/videos/";
} else {
str = getFilesDir().getAbsolutePath() + "/data/appnext/videos/tmp/vid" + b().rnd + "/";
}
File file = new File(str + b5);
if (!file.exists()) {
Uri parse = Uri.parse(videoUrl);
file.getAbsolutePath();
return parse;
}
Uri parse2 = Uri.parse(str + b5);
parse2.getPath();
return parse2;
}
@Override
public int getTemplate(String str) {
if (this.f11496k == null) {
this.f11496k = new HashMap<>();
}
if (!this.f11496k.containsKey(str)) {
String a5 = com.appnext.ads.a.a(getConfig().t(str));
int identifier = getResources().getIdentifier("apnxt_" + a5, "layout", getPackageName());
if (identifier == 0) {
identifier = getResources().getIdentifier("apnxt_" + str.toLowerCase() + "t1", "layout", getPackageName());
}
this.f11496k.put(str, Integer.valueOf(identifier));
}
return this.f11496k.get(str).intValue();
}
@Override
public void installClicked(AppnextAd appnextAd) {
if (this.f11498m == 1 && !isRewarded()) {
a(this.cv, getResources().getDrawable(R.drawable.apnxt_loader));
}
b(appnextAd, this);
}
@Override
public boolean isInstalled() {
try {
return com.appnext.core.g.b(this, this.f11494i.getAdPackage());
} catch (Throwable unused) {
return false;
}
}
@Override
public boolean isRewarded() {
return b() instanceof RewardedVideo;
}
@Override
public void onBackPressed() {
if (b().isBackButtonCanClose()) {
a();
super.onBackPressed();
}
}
@Override
protected void onCreate(Bundle bundle) {
char c5;
Fragment gVar;
if (bundle != null) {
try {
this.f11496k = (HashMap) bundle.getSerializable("templates");
this.f11498m = bundle.getInt("state");
} catch (Throwable th) {
com.appnext.base.a.a("FullscreenActivity$onCreate", th);
return;
}
}
Configuration configuration = getResources().getConfiguration();
configuration.setLayoutDirection(new Locale("en"));
getResources().updateConfiguration(configuration, getResources().getDisplayMetrics());
super.onCreate(bundle);
Video video = Video.currentAd;
if (video == null) {
onError(AppnextError.NO_ADS);
finish();
return;
}
if (video instanceof RewardedVideo) {
this.f11497l = new RewardedVideo(this, (RewardedVideo) Video.currentAd);
} else {
this.f11497l = new FullScreenVideo(this, (FullScreenVideo) Video.currentAd);
}
String orientation = b().getOrientation();
switch (orientation.hashCode()) {
case 729267099:
if (orientation.equals(Ad.ORIENTATION_PORTRAIT)) {
c5 = 3;
break;
}
c5 = 65535;
break;
case 1430647483:
if (orientation.equals(Ad.ORIENTATION_LANDSCAPE)) {
c5 = 2;
break;
}
c5 = 65535;
break;
case 1673671211:
if (orientation.equals(Ad.ORIENTATION_AUTO)) {
c5 = 1;
break;
}
c5 = 65535;
break;
case 2129065206:
if (orientation.equals(Ad.ORIENTATION_DEFAULT)) {
c5 = 0;
break;
}
c5 = 65535;
break;
default:
c5 = 65535;
break;
}
if (c5 == 0 || c5 == 1) {
if (getResources().getConfiguration().orientation == 2) {
setRequestedOrientation(6);
} else {
setRequestedOrientation(7);
}
} else if (c5 == 2) {
setRequestedOrientation(6);
} else if (c5 == 3) {
setRequestedOrientation(7);
}
this.mHandler = new Handler();
this.placementID = getIntent().getExtras().getString("id");
int i5 = getIntent().getExtras().getInt("type");
this.type = i5;
if (i5 == 1) {
this.f11492g = c.h();
} else {
this.f11492g = f.o();
}
this.f11493h = Boolean.parseBoolean(this.f11492g.t("can_close"));
if (b() instanceof FullScreenVideo) {
this.f11493h = ((FullScreenVideo) b()).isBackButtonCanClose();
}
String str = MaxReward.DEFAULT_LABEL;
if (bundle == null) {
ArrayList<AppnextAd> e5 = b.f().e(b());
this.ads = e5;
if (e5 == null) {
onError(AppnextError.NO_ADS);
finish();
return;
}
this.f11494i = a(e5, this.placementID, MaxReward.DEFAULT_LABEL);
} else {
this.ads = (ArrayList) bundle.getSerializable("ads");
this.f11494i = (AppnextAd) bundle.getSerializable("currentAd");
}
if (this.f11494i == null) {
onError(AppnextError.NO_ADS);
finish();
return;
}
setContentView(R.layout.apnxt_video_activity);
if (bundle == null) {
Bundle bundle2 = new Bundle();
if (b() instanceof RewardedVideo) {
str = ((RewardedVideo) b()).getMode();
}
if (str.equals(RewardedVideo.VIDEO_MODE_DEFAULT)) {
str = getConfig().t("default_mode");
}
if (this.type == 2 && str.equals(RewardedVideo.VIDEO_MODE_MULTI)) {
gVar = new e();
bundle2.putInt("time", ((RewardedVideo) b()).getMultiTimerLength());
report(RewardedVideo.VIDEO_MODE_MULTI);
} else {
if (this.type == 2) {
report(RewardedVideo.VIDEO_MODE_NORMAL);
}
gVar = new g();
bundle2.putBoolean("showCta", b().isShowCta());
this.f11498m = 1;
}
gVar.setArguments(bundle2);
FragmentTransaction beginTransaction = getFragmentManager().beginTransaction();
beginTransaction.add(R.id.ll, gVar, "fragment");
try {
beginTransaction.commit();
} catch (Exception unused) {
finish();
return;
}
} else {
this.finished = bundle.getBoolean("finished", true);
}
this.cv = (RelativeLayout) findViewById(R.id.ll);
this.userAction = new p(this, new p.a() {
@Override
public final Ad c() {
return Video.currentAd;
}
@Override
public final AppnextAd d() {
return FullscreenActivity.this.f11495j;
}
@Override
public final SettingsManager e() {
return FullscreenActivity.this.getConfig();
}
@Override
public final void report(String str2) {
try {
FullscreenActivity.this.report(str2);
} catch (Throwable unused2) {
}
}
});
}
@Override
protected void onDestroy() {
super.onDestroy();
try {
com.appnext.core.g.a(new File(getFilesDir().getAbsolutePath() + "/data/appnext/videos/tmp/vid" + b().rnd + "/"));
} catch (Throwable th) {
com.appnext.base.a.a("FullscreenActivity$onDestroy", th);
}
try {
Handler handler = this.mHandler;
if (handler != null) {
handler.removeCallbacksAndMessages(null);
}
this.mHandler = null;
this.f11495j = null;
this.f11494i = null;
} catch (Throwable th2) {
com.appnext.base.a.a("FullscreenActivity$onDestroy", th2);
}
}
@Override
protected final void onError(String str) {
OnAdError onAdErrorCallback;
try {
if (b() == null || (onAdErrorCallback = b().getOnAdErrorCallback()) == null) {
return;
}
onAdErrorCallback.adError(str);
} catch (Throwable th) {
com.appnext.base.a.a("FullscreenActivity$onError", th);
}
}
@Override
public void onMarket(String str) {
S();
this.finished = true;
Collections.shuffle(this.ads, new Random(System.nanoTime()));
this.ads.remove(this.f11494i);
this.ads.add(0, this.f11494i);
d dVar = new d();
this.f11498m = 2;
FragmentTransaction beginTransaction = getFragmentManager().beginTransaction();
beginTransaction.replace(R.id.ll, dVar, "fragment");
try {
beginTransaction.commit();
} catch (Throwable th) {
com.appnext.base.a.a("FullscreenActivity$onMarket", th);
finish();
}
}
@Override
protected void onPause() {
super.onPause();
this.mHandler.removeCallbacks(this.f11499n);
this.mHandler.removeCallbacks(this.f11500o);
}
@Override
protected void onRestoreInstanceState(Bundle bundle) {
super.onRestoreInstanceState(bundle);
this.finished = bundle.getBoolean("finished", true);
this.type = bundle.getInt("type");
this.f11496k = (HashMap) bundle.getSerializable("templates");
}
@Override
protected void onResume() {
super.onResume();
try {
getWindow().getDecorView().setSystemUiVisibility(getWindow().getDecorView().getSystemUiVisibility() | 2 | 4 | 4096);
} catch (Throwable unused) {
}
}
@Override
protected void onSaveInstanceState(Bundle bundle) {
bundle.putBoolean("finished", this.finished);
bundle.putInt("type", this.type);
bundle.putSerializable("templates", this.f11496k);
bundle.putSerializable("ads", this.ads);
bundle.putInt("state", this.f11498m);
bundle.putSerializable("currentAd", this.f11494i);
super.onSaveInstanceState(bundle);
}
@Override
public void privacyClicked() {
try {
Intent intent = new Intent("android.intent.action.VIEW", Uri.parse(com.appnext.core.g.e(this.f11494i)));
intent.setFlags(268435456);
startActivity(intent);
} catch (Throwable th) {
com.appnext.base.a.a("FullscreenActivity$privacyClicked", th);
}
}
@Override
public void report(String str, String str2) {
a(str, getResources().getResourceEntryName(getTemplate(str2)));
}
@Override
public boolean showClose() {
return (b() instanceof FullScreenVideo) && ((FullScreenVideo) b()).isShowClose();
}
@Override
public void videoEnded() {
this.f11498m = 2;
this.finished = true;
if (b() != null && b().getOnVideoEndedCallback() != null) {
b().getOnVideoEndedCallback().videoEnded();
}
n.aa().a(new Runnable() {
@Override
public final void run() {
RewardedServerSidePostback rewardedServerSidePostback;
if (!(FullscreenActivity.this.b() instanceof RewardedVideo) || (rewardedServerSidePostback = ((RewardedVideo) FullscreenActivity.this.b()).getRewardedServerSidePostback()) == null) {
return;
}
HashMap<String, String> n4 = rewardedServerSidePostback.n();
n4.put("placementId", ((AppnextActivity) FullscreenActivity.this).placementID);
try {
com.appnext.core.g.a(FullscreenActivity.this, "https://admin.appnext.com/adminService.asmx/SetRewards", n4);
} catch (IOException unused) {
}
}
});
Collections.shuffle(this.ads, new Random(System.nanoTime()));
this.ads.remove(this.f11494i);
this.ads.add(0, this.f11494i);
d dVar = new d();
this.f11498m = 2;
FragmentTransaction beginTransaction = getFragmentManager().beginTransaction();
beginTransaction.replace(R.id.ll, dVar, "fragment");
try {
beginTransaction.commit();
AppnextAd appnextAd = this.f11495j;
if (appnextAd != null) {
super.b(appnextAd, this);
report("roll_store_opened");
} else {
report("roll_click_cta_none");
if (Integer.parseInt(getConfig().t("clickType_b")) > new Random(System.nanoTime()).nextInt(100)) {
installClicked(getSelectedAd());
}
}
} catch (Exception unused) {
finish();
}
}
@Override
public void videoSelected(AppnextAd appnextAd) {
this.f11494i = appnextAd;
g gVar = new g();
FragmentManager fragmentManager = getFragmentManager();
Bundle bundle = new Bundle();
bundle.putBoolean("showCta", b().isShowCta());
gVar.setArguments(bundle);
FragmentTransaction beginTransaction = fragmentManager.beginTransaction();
beginTransaction.replace(R.id.ll, gVar, "fragment");
try {
beginTransaction.commit();
} catch (Throwable th) {
com.appnext.base.a.a("FullscreenActivity$videoSelected", th);
finish();
}
}
@Override
public void videoStarted() {
OnAdOpened onAdOpenedCallback;
n.aa().a(new Runnable() {
@Override
public final void run() {
try {
if (FullscreenActivity.this.f11494i == null || FullscreenActivity.this.f11497l == null) {
return;
}
com.appnext.core.adswatched.a.l(FullscreenActivity.this).j(FullscreenActivity.this.f11494i.getBannerID(), FullscreenActivity.this.f11497l.getAUID());
} catch (Throwable unused) {
}
}
});
this.mHandler.postDelayed(this.f11499n, Long.parseLong(this.f11492g.t("postpone_impression_sec")) * 1000);
if (Boolean.parseBoolean(this.f11492g.t("pview"))) {
this.mHandler.postDelayed(this.f11500o, Long.parseLong(this.f11492g.t("postpone_vta_sec")) * 1000);
}
if (b() == null || (onAdOpenedCallback = b().getOnAdOpenedCallback()) == null) {
return;
}
onAdOpenedCallback.adOpened();
}
public void report(String str) {
try {
a(str, getResources().getResourceEntryName(getTemplate("S" + (this.f11498m + 1))));
} catch (Throwable th) {
com.appnext.base.a.a("FullscreenActivity$report", th);
}
}
@Override
protected final void a(AppnextAd appnextAd, f.a aVar) {
super.a(appnextAd, new f.a() {
@Override
public final void error(String str) {
}
@Override
public final void onMarket(String str) {
}
});
}
@Override
protected final void b(AppnextAd appnextAd, f.a aVar) {
OnAdClicked onAdClickedCallback;
if (appnextAd == null) {
return;
}
this.f11495j = appnextAd;
Video b5 = b();
if (b5 != null && (onAdClickedCallback = b5.getOnAdClickedCallback()) != null) {
onAdClickedCallback.adClicked();
}
if (this.finished || !(b() instanceof RewardedVideo)) {
super.b(appnextAd, aVar);
}
}
private void a() {
OnAdClosed onAdClosedCallback;
try {
b.f().a(this, this.f11494i.getBannerID(), b());
if (b() != null && (onAdClosedCallback = b().getOnAdClosedCallback()) != null) {
onAdClosedCallback.onAdClosed();
}
Video.currentAd = null;
} catch (Throwable th) {
com.appnext.base.a.a("FullscreenActivity$onClose", th);
}
}
public Video b() {
Video video = Video.currentAd;
return video != null ? video : this.f11497l;
}
protected final AppnextAd a(ArrayList<AppnextAd> arrayList, String str, String str2) {
try {
Iterator<AppnextAd> it = arrayList.iterator();
while (it.hasNext()) {
AppnextAd next = it.next();
if (a(next)) {
next.getBannerID();
if (!next.getBannerID().equals(str2)) {
return next;
}
}
}
Iterator<AppnextAd> it2 = arrayList.iterator();
while (it2.hasNext()) {
AppnextAd next2 = it2.next();
if (a(next2)) {
next2.getBannerID();
return next2;
}
}
return null;
} catch (Throwable th) {
com.appnext.base.a.a("FullscreenActivity$getFirst", th);
return null;
}
}
private static boolean a(AppnextAd appnextAd) {
try {
if (appnextAd.getVideoUrlHigh().equals(MaxReward.DEFAULT_LABEL)) {
return !appnextAd.getVideoUrlHigh30Sec().equals(MaxReward.DEFAULT_LABEL);
}
return true;
} catch (Throwable th) {
com.appnext.base.a.a("FullscreenActivity$hasHiResVideo", th);
return false;
}
}
private void a(String str, String str2) {
try {
String tid = b().getTID();
String vid = b().getVID();
String auid = b().getAUID();
String str3 = this.placementID;
String sessionId = b().getSessionId();
AppnextAd appnextAd = this.f11494i;
String bannerID = appnextAd != null ? appnextAd.getBannerID() : MaxReward.DEFAULT_LABEL;
AppnextAd appnextAd2 = this.f11494i;
com.appnext.core.g.a(this, tid, vid, auid, str3, sessionId, str, str2, bannerID, appnextAd2 != null ? appnextAd2.getCampaignID() : MaxReward.DEFAULT_LABEL);
} catch (Throwable th) {
com.appnext.base.a.a("FullscreenActivity$sendReport", th);
}
}
}