Apk Done v1.0版本的 MD5 值为:44cfb8e1ce639995aa7f0de6a3a6388b
以下内容为反编译后的 p.java 源代码,内容仅作参考
package com.appnext.core;
import android.content.Context;
import android.content.Intent;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.Uri;
import android.os.Handler;
import android.os.Looper;
import android.os.Process;
import android.text.TextUtils;
import com.appnext.core.f;
import java.io.IOException;
import java.util.HashMap;
public class p {
private f click;
private Context context;
private a dC;
private String ct = "";
private String guid = "";
private String banner = "";
private f.a dD = new f.a() {
@Override
public final void onMarket(String str) {
AppnextAd d = p.this.dC.d();
Ad c = p.this.dC.c();
if (c == null || d == null || p.this.context == null) {
return;
}
if (!g.b(p.this.context, d.getAdPackage())) {
try {
if (str.startsWith("market://details?id=" + d.getAdPackage()) || str.startsWith("http")) {
return;
}
p.this.a(g.e("admin.appnext.com", "applink"), d.getBannerID(), c.getPlacementID(), c.getTID(), str, "SetROpenV1");
} catch (Throwable th) {
com.appnext.base.a.a("UserAction$onMarket", th);
}
} else if (str.startsWith("market://")) {
try {
Intent launchIntentForPackage = p.this.context.getPackageManager().getLaunchIntentForPackage(d.getAdPackage());
launchIntentForPackage.addFlags(268435456);
p.this.context.startActivity(launchIntentForPackage);
} catch (Throwable unused) {
p.this.dC.report("error_no_market");
}
} else {
try {
p.this.openLink(str);
} catch (Throwable unused2) {
p.this.dC.report("error_no_market");
}
}
}
@Override
public final void error(String str) {
try {
p.this.a(g.e("admin.appnext.com", "applink"), p.this.dC.d().getBannerID(), p.this.dC.c().getPlacementID(), p.this.dC.c().getTID(), str, "SetDOpenV1");
} catch (Throwable th) {
com.appnext.base.a.a("UserAction$error", th);
}
try {
if (!Boolean.parseBoolean(p.this.dC.e().t("urlApp_protection"))) {
if (str == null) {
return;
}
p.this.openLink(str);
return;
}
p pVar = p.this;
pVar.openLink("market://details?id=" + p.this.dC.d().getAdPackage());
} catch (Throwable th2) {
com.appnext.base.a.a("UserAction$error", th2);
}
}
};
public interface a {
Ad c();
AppnextAd d();
SettingsManager e();
void report(String str);
}
public p(Context context, a aVar) {
this.context = context;
this.click = f.b(context);
this.dC = aVar;
}
public final void a(final String str, final String str2, final String str3, final String str4, final String str5, final String str6) {
final f fVar = this.click;
if (fVar == null) {
return;
}
n.aa().a(new Runnable() {
@Override
public final void run() {
try {
HashMap hashMap = new HashMap();
hashMap.put("guid", str);
hashMap.put("bannerId", str2);
hashMap.put("placementId", str3);
hashMap.put("vid", str4);
hashMap.put("url", str5);
Context context = fVar.context;
g.a(context, "https://admin.appnext.com/AdminService.asmx/" + str6, hashMap);
} catch (Throwable th) {
com.appnext.base.a.a("AppnextCK$serverNotify", th);
}
}
});
}
public final void a(final AppnextAd appnextAd, String str, f.a aVar) {
final f fVar = this.click;
if (fVar == null) {
return;
}
n.aa().a(new Runnable() {
@Override
public final void run() {
try {
Context context = fVar.context;
g.a(context, appnextAd.getImpressionURL() + "&device=" + g.V() + "&ox=0", null);
} catch (Throwable th) {
com.appnext.base.a.a("AppnextCK$adVta", th);
}
}
});
}
public final void c(AppnextAd appnextAd, f.a aVar) {
this.click.a(appnextAd.getMarketUrl(), aVar);
}
public final void a(AppnextAd appnextAd, final String str, String str2, final f.a aVar) {
try {
if (!ac()) {
new Handler(Looper.getMainLooper()).post(new Runnable() {
@Override
public final void run() {
try {
f.a aVar2 = p.this.dD;
aVar2.error(str + "&device=" + g.V());
if (aVar != null) {
f.a aVar3 = aVar;
aVar3.error(str + "&device=" + g.V());
}
} catch (Throwable unused) {
}
}
});
} else if (appnextAd == null) {
} else {
if (!TextUtils.isEmpty(this.ct) && this.ct.contains(appnextAd.getAdPackage())) {
g.a(this.context, "https://admin.appnext.com/AdminService.asmx/SetRL?guid=" + this.guid + "&bid=" + this.banner + "&pid=" + str2, null);
this.dD.onMarket(this.ct);
if (aVar != null) {
aVar.onMarket(this.ct);
}
this.ct = "";
return;
}
new StringBuilder("click url ").append(str);
String str3 = str + "&device=" + g.V();
String webview = appnextAd.getWebview();
char c = 65535;
switch (webview.hashCode()) {
case 48:
if (webview.equals("0")) {
c = 2;
break;
}
break;
case 49:
if (webview.equals("1")) {
c = 1;
break;
}
break;
case 50:
if (webview.equals("2")) {
c = 0;
break;
}
break;
}
if (c == 0) {
this.dD.onMarket(str3);
if (aVar != null) {
aVar.onMarket(str3);
}
} else if (c == 1) {
Intent intent = new Intent(this.context, ResultActivity.class);
intent.putExtra("url", str3);
intent.putExtra("title", appnextAd.getAdTitle());
intent.addFlags(268435456);
this.context.startActivity(intent);
if (aVar != null) {
aVar.onMarket(str3);
}
} else if (this.click == null) {
} else {
this.click.a(appnextAd.getAppURL(), appnextAd.getMarketUrl(), str3, appnextAd.getBannerID(), new f.a() {
@Override
public final void onMarket(String str4) {
p.this.dD.onMarket(str4);
f.a aVar2 = aVar;
if (aVar2 != null) {
aVar2.onMarket(str4);
}
}
@Override
public final void error(String str4) {
p.this.dD.error(str4);
f.a aVar2 = aVar;
if (aVar2 != null) {
aVar2.error(str4);
}
}
}, Long.parseLong(this.dC.e().t("resolve_timeout")) * 1000);
}
}
} catch (Throwable th) {
com.appnext.base.a.a("UserAction$doClick", th);
}
}
public void openLink(String str) {
Intent intent = new Intent("android.intent.action.VIEW");
intent.setData(Uri.parse(str));
intent.addFlags(268435456);
this.context.startActivity(intent);
}
public final void d(AppnextAd appnextAd) {
try {
if (this.click != null) {
this.click.d(appnextAd);
}
} catch (Throwable th) {
com.appnext.base.a.a("UserAction$adImpression", th);
}
}
protected final boolean ac() {
try {
if (this.context.checkPermission("android.permission.ACCESS_NETWORK_STATE", Process.myPid(), Process.myUid()) != 0) {
g.a(this.context, "http://www.appnext.com/myid.html", null);
return true;
}
NetworkInfo activeNetworkInfo = ((ConnectivityManager) this.context.getSystemService("connectivity")).getActiveNetworkInfo();
if (activeNetworkInfo == null || !activeNetworkInfo.isConnected()) {
throw new IOException();
}
return true;
} catch (Throwable th) {
com.appnext.base.a.a("UserAction$checkConnection", th);
return false;
}
}
public final void destroy() {
this.context = null;
if (this.click != null) {
this.click = null;
}
}
}