正在查看: 凤凰之城 v1.0.3 应用的 o.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: 凤凰之城 v1.0.3 应用的 o.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.octopus.ad.internal;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.Application;
import android.content.Context;
import android.os.Build;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.DisplayMetrics;
import android.util.Log;
import android.webkit.WebSettings;
import com.octopus.ad.Octopus;
import com.octopus.ad.TransparentActivity;
import com.octopus.ad.internal.a.h;
import com.octopus.ad.internal.activity.BrowserAdActivity;
import com.octopus.ad.internal.k;
import com.octopus.ad.internal.utilities.HaoboLog;
import com.octopus.ad.internal.utilities.SPUtils;
import com.octopus.ad.model.c;
import com.octopus.ad.utils.OctUtil;
import com.octopus.ad.utils.ThreadUtils;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.json.JSONObject;
public class o {
private static boolean O = false;
public static String k = null;
public static String l = "";
public static String m = "";
public static int q = 1000;
public static int r = 1000;
public static long s = 7200000;
private static o t = null;
private static boolean w = false;
private float F;
private DisplayMetrics H;
private com.octopus.ad.internal.a.h M;
private long N;
public int a;
public String e;
public String f;
public String i;
public Context n;
public float o;
public float p;
private String u;
private String v;
private Boolean y;
private int x = 0;
public boolean b = true;
public boolean c = false;
public boolean d = false;
public ConcurrentHashMap<String, com.octopus.ad.model.a> g = new ConcurrentHashMap<>();
public boolean h = false;
public HashMap<String, String> j = new HashMap<>();
private HashSet<String> z = new HashSet<>();
private HashSet<String> A = new HashSet<>();
private HashSet<String> B = new HashSet<>();
private HashSet<String> C = new HashSet<>();
private HashSet<String> D = new HashSet<>();
private HashSet<String> E = new HashSet<>();
private boolean G = true;
private boolean I = false;
private boolean J = false;
private boolean K = false;
private boolean L = false;
public static int a(o oVar) {
int i = oVar.x;
oVar.x = i + 1;
return i;
}
public static int b(o oVar) {
int i = oVar.x;
oVar.x = i - 1;
return i;
}
private com.octopus.ad.internal.a.h u() {
Context context = this.n;
if (context == null) {
return null;
}
try {
return new h.a(context).a(536870912L).a();
} catch (Exception unused) {
return null;
}
}
@SuppressLint({"SoonBlockedPrivateApi"})
private void v() {
try {
Class.forName("android.content.pm.PackageParser$Package").getDeclaredConstructor(String.class).setAccessible(true);
} catch (Throwable unused) {
}
try {
Class<?> cls = Class.forName("android.app.ActivityThread");
Method declaredMethod = cls.getDeclaredMethod("currentActivityThread", new Class[0]);
declaredMethod.setAccessible(true);
Object invoke = declaredMethod.invoke(null, new Object[0]);
Field declaredField = cls.getDeclaredField("mHiddenApiWarningShown");
declaredField.setAccessible(true);
declaredField.setBoolean(invoke, true);
} catch (Throwable unused2) {
}
}
public void a(String str, boolean z) {
}
public void d() {
if (this.K || !this.L) {
return;
}
this.K = true;
ThreadUtils.runOnUIThread(new Runnable() {
@Override
public void run() {
try {
OctUtil.a().call(new OctUtil.C() {
@Override
public String e(String str) {
Map.Entry<String, com.octopus.ad.model.a> next;
com.octopus.ad.model.a value;
try {
com.octopus.ad.utils.b.f.a("OctopusAd", "scheme:" + str);
ConcurrentHashMap<String, com.octopus.ad.model.a> concurrentHashMap = o.a().g;
if (concurrentHashMap.isEmpty() || TextUtils.isEmpty(str)) {
return null;
}
Iterator<Map.Entry<String, com.octopus.ad.model.a>> it = concurrentHashMap.entrySet().iterator();
while (it.hasNext() && (value = (next = it.next()).getValue()) != null) {
if (!TextUtils.isEmpty(value.k())) {
for (String str2 : value.k().split(",")) {
if (str.equals(str2)) {
o.this.b(value);
return "";
}
}
} else if (str.equals(next.getKey()) || "octdpopen".equals(next.getKey())) {
boolean a = com.octopus.ad.utils.b.i.a(value.c());
String d = value.d();
if (a && !TextUtils.isEmpty(d)) {
o.this.a(value);
concurrentHashMap.remove(next.getKey());
if (!value.f() || TextUtils.isEmpty(value.e())) {
return d;
}
return d + ";;;" + value.e();
}
}
}
return null;
} catch (Exception e) {
com.octopus.ad.utils.b.f.a("OctopusAd", "An Exception Caught", e);
return null;
}
}
});
} catch (Throwable th) {
com.octopus.ad.utils.b.f.a("OctopusAd", "A Throwable Caught", th);
}
}
});
}
public boolean e() {
return this.L;
}
public float f() {
return this.F;
}
public boolean g() {
return this.G;
}
public String h() {
return k;
}
public String i() {
return this.u;
}
public String j() {
return this.v;
}
public Context k() {
return this.n;
}
public synchronized String l() {
if (TextUtils.isEmpty(this.i)) {
try {
this.i = WebSettings.getDefaultUserAgent(this.n);
} catch (Exception e) {
com.octopus.ad.utils.b.f.a("OctopusAd", "An Exception Caught", e);
}
if (TextUtils.isEmpty(this.i)) {
this.i = "Mozilla/5.0 (Linux; Android " + Build.VERSION.RELEASE + "; " + Build.MODEL + " Build/UP1A.231005.007; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/116.0.0.0 Mobile Safari/537.36";
}
}
return this.i;
}
public String m() {
if (!TextUtils.isEmpty(this.e)) {
return this.e;
}
String replace = this.c ? "http://sdk.zhangyuyidong.cn".replace("http:", "https:") : "http://sdk.zhangyuyidong.cn";
return this.d ? replace.replace("sdk.", "sdk6.") : replace;
}
public String n() {
if (!TextUtils.isEmpty(this.f)) {
return this.f;
}
String replace = this.c ? "http://sdklog.zhangyuyidong.cn".replace("http:", "https:") : "http://sdklog.zhangyuyidong.cn";
return this.d ? replace.replace("sdklog.", "sdklog6.") : replace;
}
public float o() {
return this.o;
}
public float p() {
return this.p;
}
public float q() {
return Math.max(this.o, this.p);
}
public DisplayMetrics r() {
return this.H;
}
public HashSet<String> s() {
return this.E;
}
public boolean t() {
return O;
}
public void c() {
if (this.J) {
return;
}
this.J = true;
try {
OctUtil.a().init(this.n);
} catch (Exception e) {
com.octopus.ad.utils.b.f.a("OctopusAd", "An Exception Caught", e);
} catch (Throwable th) {
com.octopus.ad.utils.b.f.a("OctopusAd", "A Throwable Caught", th);
}
}
public com.octopus.ad.internal.a.h b() {
if (this.n == null) {
return null;
}
com.octopus.ad.internal.a.h hVar = this.M;
if (hVar != null) {
return hVar;
}
com.octopus.ad.internal.a.h u = u();
this.M = u;
return u;
}
public void b(final com.octopus.ad.model.a aVar) {
new Thread(new Runnable() {
@Override
public void run() {
try {
JSONObject jSONObject = new JSONObject();
jSONObject.put("slotId", aVar.l());
jSONObject.put("reqId", aVar.a());
jSONObject.put("dpForbid", aVar.k());
String a = com.octopus.ad.utils.b.a.a(com.octopus.ad.utils.b.e.a(), jSONObject.toString());
if (a != null) {
com.octopus.ad.utils.b.d.a(o.a().n() + "/sdk/dpForbid", a.getBytes());
}
} catch (Exception e) {
com.octopus.ad.utils.b.f.a("OctopusAd", "An Exception Caught", e);
}
}
}).start();
}
public static o a() {
o oVar;
synchronized (o.class) {
if (t == null) {
t = new o();
}
oVar = t;
}
return oVar;
}
public void c(String str) {
try {
if (TextUtils.isEmpty(str)) {
return;
}
if (str.contains("track=oct")) {
str = str + "&opt=13&result=0&wait=" + (com.octopus.ad.utils.b.i.c() - this.N);
}
new i(str).execute();
} catch (Exception e) {
com.octopus.ad.utils.b.f.a("OctopusAd", "An Exception Caught", e);
}
}
public void b(String str) {
this.v = str;
}
public String b(boolean z) {
Boolean bool = this.y;
return m() + ((bool == null || bool.booleanValue()) ? z ? "/api/zysdksd?isEncrypt=2" : "/api/zysdk?isEncrypt=2" : z ? "/api/zysdksd?isEncrypt=0" : "/api/zysdk?isEncrypt=0");
}
public void a(Context context, String str) {
synchronized (o.class) {
try {
if (context != null) {
Log.i("OctopusAd", "SDK_VERSION:1.6.4.6");
this.n = context.getApplicationContext();
try {
ThreadUtils.runOnThreadPool(new Runnable() {
@Override
public void run() {
o.this.l();
}
});
this.L = com.octopus.ad.utils.b.i.b("com.octopus.ad.utils.OctUtil$C");
this.b = SPUtils.getBoolean(this.n, "getBootId");
this.d = SPUtils.getBoolean(this.n, "ipv6");
this.c = SPUtils.getBoolean(this.n, "ssl");
this.e = SPUtils.getString(this.n, "sdk");
this.f = SPUtils.getString(this.n, "sdklog");
this.y = (Boolean) SPUtils.getFromGroupSdk(this.n, "encrypt", Boolean.TRUE);
m1.a.b().c(this.n);
m1.a.b().h();
ThreadUtils.runOnThreadPool(new com.octopus.ad.utils.b.b(this.n));
Long l4 = (Long) SPUtils.get(this.n, "duration", 86400L);
String str2 = (String) SPUtils.get(this.n, "version", "1686041703212");
Long l5 = (Long) SPUtils.get(this.n, "lastReqTime", 0L);
if (l4 != null && str2 != null && l5 != null && com.octopus.ad.utils.b.i.c() - l5.longValue() > l4.longValue()) {
new l(m() + "/sdk/config?version=" + str2 + "&appId=" + str + "&os=android").execute();
}
((Application) this.n).registerActivityLifecycleCallbacks(new Application.ActivityLifecycleCallbacks() {
@Override
public void onActivityCreated(Activity activity, Bundle bundle) {
}
@Override
public void onActivityDestroyed(Activity activity) {
}
@Override
public void onActivityPaused(Activity activity) {
}
@Override
public void onActivityResumed(Activity activity) {
}
@Override
public void onActivitySaveInstanceState(Activity activity, Bundle bundle) {
}
@Override
public void onActivityStarted(Activity activity) {
o.a(o.this);
if ((activity instanceof BrowserAdActivity) || (activity instanceof TransparentActivity)) {
return;
}
k.a().a("AppSelfForeground");
}
@Override
public void onActivityStopped(Activity activity) {
o.b(o.this);
if (o.this.x < 0) {
o.this.x = 0;
}
if (o.this.x == 0) {
k.a().a("AppBackground");
}
}
});
} catch (Exception e) {
com.octopus.ad.utils.b.f.a("OctopusAd", "An Exception Caught", e);
}
if (Octopus.getCustomController() == null || Octopus.getCustomController().isCanUseOaid()) {
com.octopus.ad.utils.a.b.a((Application) this.n);
}
HaoboLog.setErrorContext(this.n);
k = str;
DisplayMetrics displayMetrics = this.n.getResources().getDisplayMetrics();
this.H = displayMetrics;
int i = displayMetrics.widthPixels;
int i4 = displayMetrics.heightPixels;
if (i < i4) {
this.o = i / 720.0f;
this.p = i4 / 1280.0f;
} else {
this.o = i4 / 720.0f;
this.p = i / 1280.0f;
}
if (!this.I) {
com.octopus.ad.utils.g.a(this.n).a(new com.octopus.ad.utils.f() {
@Override
public void a(long j, long j4) {
com.octopus.ad.utils.b.f.a("OctopusAd", "在线时长:" + (j4 - j));
SPUtils.put(o.this.n, "startTime", Long.valueOf(j));
SPUtils.put(o.this.n, "endTime", Long.valueOf(j4));
}
@Override
public void a() {
com.octopus.ad.utils.b.f.a("OctopusAd", "上报活跃量");
}
});
}
this.I = true;
if (Build.VERSION.SDK_INT >= 28) {
v();
}
} else {
throw new IllegalArgumentException("Context cannot be null.");
}
} catch (Throwable th) {
throw th;
}
}
}
public void c(boolean z) {
O = z;
}
public void a(com.octopus.ad.model.a aVar) {
final List<c.i> i;
if (aVar == null || (i = aVar.i()) == null) {
return;
}
for (int i4 = 0; i4 < i.size(); i4++) {
c.i iVar = i.get(i4);
if (iVar != null && !TextUtils.isEmpty(iVar.a())) {
String a = iVar.a();
if (a.contains("track=oct")) {
a = a + "&opt=13";
}
new i(a).execute();
}
}
com.octopus.ad.utils.e.a(new Runnable() {
@Override
public void run() {
for (int i5 = 0; i5 < i.size(); i5++) {
try {
c.i iVar2 = (c.i) i.get(i5);
if (iVar2 != null && !TextUtils.isEmpty(iVar2.b())) {
String b = iVar2.b();
if (b.contains("track=oct")) {
b = b + "&opt=13";
}
new i(b).execute();
}
if (iVar2 != null && !TextUtils.isEmpty(iVar2.c())) {
final String c = iVar2.c();
o.this.N = com.octopus.ad.utils.b.i.c();
k.a().a(new k.a() {
@Override
public void a(String str) {
if ("AppBackground".equals(str)) {
o.this.c(c);
k.a().b(this);
}
}
});
}
} catch (Throwable th) {
com.octopus.ad.utils.b.f.a("OctopusAd", "A Throwable Caught", th);
return;
}
}
}
}, aVar.h());
}
public void a(float f) {
u.a(com.sigmob.sdk.base.blurkit.c.d <= f && f <= 1.0f, "The app volume must be a value between 0 and 1 inclusive.");
u.a(k, (Object) "Octopus.initialize() must be called prior to setting the app volume.");
this.F = f;
}
public void a(boolean z) {
u.a(k, (Object) "Octopus.initialize() must be called prior to setting the app volume.");
this.G = z;
}
public void a(String str) {
this.u = str;
}
public void a(int i) {
q = i;
r = i;
}
}