13Poker by gametower unlimited gems v0.4版本的 MD5 值为:51324fc0f195c34821074948ab266846
以下内容为反编译后的 HtmlAd.java 源代码,内容仅作参考
package com.startapp.android.publish;
import android.app.ActivityManager;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ResolveInfo;
import com.adeco.adsdk.net.ServerCommunicationException;
import com.startapp.android.publish.b.g;
import com.startapp.android.publish.d.k;
import com.startapp.android.publish.model.AdPreferences;
import java.util.List;
public class HtmlAd extends Ad {
private static String launcherName = null;
private String adId;
public List<a> apps;
private int height;
private String html;
public boolean smartRedirect;
private String trackingUrl;
private int width;
public HtmlAd(Context context) {
super(context);
this.smartRedirect = true;
this.html = "";
this.trackingUrl = null;
this.adId = null;
if (launcherName == null) {
initDefaultLauncherName();
}
}
private void initDefaultLauncherName() {
Intent intent = new Intent();
intent.setAction("android.intent.action.MAIN");
intent.addCategory("android.intent.category.HOME");
ResolveInfo resolveActivity = this.context.getPackageManager().resolveActivity(intent, 0);
if (resolveActivity == null || resolveActivity.activityInfo == null) {
return;
}
launcherName = resolveActivity.activityInfo.packageName;
if (launcherName != null) {
launcherName = launcherName.toLowerCase();
}
}
public boolean doHome() {
boolean z;
List<ActivityManager.RunningTaskInfo> runningTasks = ((ActivityManager) this.context.getSystemService("activity")).getRunningTasks(ServerCommunicationException.ERROR_CODE_UNKNOWN);
if (runningTasks.size() > 0) {
String lowerCase = runningTasks.get(0).baseActivity.toShortString().toLowerCase();
if ((launcherName != null && lowerCase.contains(launcherName)) || lowerCase.contains("com.android.internal.app") || lowerCase.contains("com.android.systemui.recent")) {
z = true;
if (z) {
return false;
}
if (k.a(this.context.getApplicationContext()) && isReady()) {
Intent intent = new Intent(this.context, AppWallActivity.class);
intent.putExtra("fileUrl", "exit.html");
intent.putExtra("smartRedirect", this.smartRedirect);
intent.putExtra("overlay", true);
intent.addFlags(343932928);
this.context.startActivity(intent);
d dVar = new d(this.context.getApplicationContext());
dVar.setUrl("file:///" + this.context.getFilesDir().getAbsolutePath() + "/exit.html");
String a2 = this.apps.size() >= 1 ? this.apps.get(this.apps.size() - 1).a() : null;
if (a2 != null) {
a2 = a2 + "&position=home";
}
dVar.setTrackingUrl(a2);
dVar.setSmartRedirect(this.smartRedirect);
dVar.b();
return true;
}
return false;
}
}
z = false;
if (z) {
}
}
public int getHeight() {
return this.height;
}
public String getHtml() {
return this.html;
}
public String getTrackingUrl() {
if (this.trackingUrl == null) {
this.trackingUrl = k.a(getHtml(), "@tracking@", "@tracking@");
}
return this.trackingUrl;
}
public int getWidth() {
return this.width;
}
public String gtAdId() {
if (this.adId == null) {
this.adId = k.a(getHtml(), "@adId@", "@adId@");
}
return this.adId;
}
@Override
public boolean load(AdPreferences adPreferences, AdEventListener adEventListener) {
if (super.load(adPreferences, adEventListener)) {
loadAd(adPreferences, adEventListener);
return true;
}
return false;
}
protected void loadAd(AdPreferences adPreferences, AdEventListener adEventListener) {
new g(this.context, this, adPreferences, adEventListener).execute(new Void[0]);
}
public void setHeight(int i) {
this.height = i;
}
public void setHtml(String str) {
this.html = str;
}
public void setSize(int i, int i2) {
setWidth(i);
setHeight(i2);
}
public void setWidth(int i) {
this.width = i;
}
public boolean show() {
if (k.a(this.context) && isReady()) {
new com.startapp.android.publish.b.a(this.context, this.apps).execute(new Void[0]);
Intent intent = new Intent(this.context, AppWallActivity.class);
intent.putExtra("fileUrl", "exit.html");
String a2 = this.apps.size() >= 1 ? this.apps.get(this.apps.size() - 1).a() : null;
intent.putExtra("tracking", a2 != null ? new String[]{a2 + "&position=back"} : null);
intent.putExtra("smartRedirect", new boolean[]{this.smartRedirect});
intent.addFlags(344457216);
this.context.startActivity(intent);
return true;
}
return false;
}
}