正在查看: Fancy Optimizer v4.6.3 应用的 b.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Fancy Optimizer v4.6.3 应用的 b.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.mbridge.msdk.foundation.controller;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.text.TextUtils;
import com.iab.omid.library.mmadbridge.Omid;
import com.mbridge.msdk.MBridgeConstans;
import com.mbridge.msdk.MBridgeSDK;
import com.mbridge.msdk.foundation.controller.a;
import com.mbridge.msdk.foundation.entity.k;
import com.mbridge.msdk.foundation.same.b.c;
import com.mbridge.msdk.foundation.same.b.e;
import com.mbridge.msdk.foundation.same.net.n;
import com.mbridge.msdk.foundation.same.report.d;
import com.mbridge.msdk.foundation.tools.FastKV;
import com.mbridge.msdk.foundation.tools.q;
import com.mbridge.msdk.foundation.tools.r;
import com.mbridge.msdk.foundation.tools.t;
import com.mbridge.msdk.foundation.tools.v;
import com.mbridge.msdk.foundation.tools.y;
import com.mbridge.msdk.interstitialvideo.out.MBInterstitialVideoHandler;
import com.mbridge.msdk.out.Frame;
import com.mbridge.msdk.out.MBRewardVideoHandler;
import com.mbridge.msdk.out.MBridgeSDKFactory;
import java.io.File;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicBoolean;
public final class b {
private static b h;
private Context i;
private String j;
private String k;
private String l;
private String m;
private com.mbridge.msdk.b.a o;
private String p;
private Map<String, Object> t;
private int u;
private boolean n = false;
public final int a = 1;
public final int b = 2;
public final int c = 3;
public final int d = 4;
public final int e = 5;
public final int f = 6;
private boolean q = false;
private AtomicBoolean r = null;
private FastKV s = null;
Handler g = new Handler() {
@Override
public final void handleMessage(Message message) {
List list;
try {
int i = message.what;
if (i == 2) {
Object obj = message.obj;
if (!(obj instanceof List) || (list = (List) obj) == null || list.size() <= 0) {
return;
}
d dVar = new d(b.this.i, 0);
for (int i10 = 0; i10 < list.size(); i10++) {
k kVar = (k) list.get(i10);
Boolean bool = Boolean.FALSE;
if (i10 == list.size() - 1) {
bool = Boolean.TRUE;
}
dVar.a(kVar, bool);
}
return;
}
if (i == 3) {
File file = (File) message.obj;
if (file != null) {
String a = t.a(file);
if (TextUtils.isEmpty(a)) {
return;
}
String[] split = a.split("====");
if (split.length > 0) {
new d(b.this.i).a(split[0], file);
return;
}
return;
}
return;
}
if (i == 4) {
String str = (String) message.obj;
if (TextUtils.isEmpty(str)) {
return;
}
if (com.mbridge.msdk.foundation.same.report.b.a().c()) {
com.mbridge.msdk.foundation.same.report.b.a().a(str);
return;
} else {
new d(b.this.i, 0).a("click_duration", str, (String) null, (Frame) null);
return;
}
}
if (i == 5) {
String str2 = (String) message.obj;
if (TextUtils.isEmpty(str2)) {
return;
}
if (com.mbridge.msdk.foundation.same.report.b.a().c()) {
com.mbridge.msdk.foundation.same.report.b.a().a(str2);
return;
} else {
new d(b.this.i, 0).a("load_duration", str2, (String) null, (Frame) null);
return;
}
}
if (i != 6) {
if (i == 9 && ((com.mbridge.msdk.c.a) message.obj).H() == 1) {
com.mbridge.msdk.foundation.same.report.b.a.a(b.this.i).a();
return;
}
return;
}
Object obj2 = message.obj;
if (obj2 == null || !(obj2 instanceof String)) {
return;
}
String str3 = (String) obj2;
if (TextUtils.isEmpty(str3)) {
return;
}
if (com.mbridge.msdk.foundation.same.report.b.a().c()) {
com.mbridge.msdk.foundation.same.report.b.a().a(str3);
} else {
new d(b.this.i, 0).a("device_data", str3, (String) null, (Frame) null);
}
} catch (Exception e) {
v.d("SDKController", e.getMessage());
}
}
};
private b() {
}
public void e() {
try {
com.mbridge.msdk.d.b.class.getDeclaredMethod("start", new Class[0]).invoke(com.mbridge.msdk.d.b.class.getMethod("getInstance", new Class[0]).invoke(null, new Object[0]), new Object[0]);
} catch (Throwable th) {
v.a("SDKController", th.getMessage(), th);
}
}
public final boolean d() {
Context context = this.i;
if (context != null && this.r == null) {
int i = context.getSharedPreferences("mb_optimization_setting", 0).getInt("use_thread_pool", 0);
AtomicBoolean atomicBoolean = new AtomicBoolean(true);
this.r = atomicBoolean;
atomicBoolean.set(i == 0);
}
AtomicBoolean atomicBoolean2 = this.r;
if (atomicBoolean2 != null) {
return atomicBoolean2.get();
}
return true;
}
public static synchronized b a() {
b bVar;
synchronized (b.class) {
if (h == null) {
h = new b();
}
bVar = h;
}
return bVar;
}
public final void b() {
Handler handler = this.g;
if (handler != null) {
handler.removeCallbacksAndMessages(null);
}
}
public final void c() {
new Thread(new Runnable() {
@Override
public final void run() {
throw new UnsupportedOperationException("Method not decompiled: com.mbridge.msdk.foundation.controller.b.AnonymousClass5.run():void");
}
}).start();
}
public final void a(Map map, final Context context) {
String str;
String str2;
List<com.mbridge.msdk.foundation.entity.a> b;
Object newInstance;
Object newInstance2;
String str3 = "";
if (context != null) {
if (map.containsKey("mbridge_appid")) {
this.k = (String) map.get("mbridge_appid");
}
this.i = context.getApplicationContext();
a.d().b(this.i);
try {
String str4 = (String) map.get("mbridge_appid");
if (!TextUtils.isEmpty(str4)) {
com.mbridge.msdk.foundation.a.a.a.a().a("sdk_app_id", str4);
}
} catch (Exception e) {
e.printStackTrace();
} catch (Throwable th) {
th.printStackTrace();
}
try {
n.a(this.i);
} catch (Exception unused) {
}
if (this.n) {
new d(context).a();
return;
}
r.n(context);
if (map.containsKey("mbridge_appid")) {
this.k = (String) map.get("mbridge_appid");
}
if (map.containsKey("mbridge_appkey")) {
this.l = (String) map.get("mbridge_appkey");
}
if (map.containsKey("mbridge_wx_appid")) {
this.m = (String) map.get("mbridge_wx_appid");
}
if (map.containsKey("applicationID")) {
this.p = (String) map.get("applicationID");
}
if (map.containsKey("mbridge_appstartupcarsh")) {
this.j = (String) map.get("mbridge_appstartupcarsh");
}
try {
com.mbridge.msdk.c.a b10 = com.mbridge.msdk.c.b.a().b(a.d().g());
if (b10 != null && (b = b10.b()) != null && b.size() > 0) {
for (com.mbridge.msdk.foundation.entity.a aVar : b) {
if (aVar.a() == 287) {
if (this.i != null && (newInstance = MBInterstitialVideoHandler.class.getConstructor(String.class, String.class).newInstance("", aVar.b())) != null) {
MBInterstitialVideoHandler.class.getMethod("loadFormSelfFilling", new Class[0]).invoke(newInstance, new Object[0]);
}
} else if (aVar.a() == 94 && (newInstance2 = MBRewardVideoHandler.class.getConstructor(String.class, String.class).newInstance("", aVar.b())) != null) {
MBRewardVideoHandler.class.getMethod("loadFormSelfFilling", new Class[0]).invoke(newInstance2, new Object[0]);
}
}
}
} catch (Throwable th2) {
if (MBridgeConstans.DEBUG) {
th2.printStackTrace();
}
}
a.d().b(this.k);
a.d().d(this.l);
a.d().c(this.m);
a.d().a(this.p);
a.d().a(new a.b() {
}, this.g);
Context applicationContext = this.i.getApplicationContext();
try {
Omid.activate(applicationContext);
if (!Omid.isActive()) {
new d(applicationContext, 0).a("", "", "", "", "activate om failed");
}
} catch (IllegalArgumentException e10) {
v.a("SDKController", e10.getMessage(), e10);
}
Context applicationContext2 = this.i.getApplicationContext();
try {
if (d() && this.s == null) {
try {
this.s = new FastKV.Builder(e.b(c.MBRIDGE_700_CONFIG), q.b("H+tU+FeXHM==")).build();
} catch (Exception unused2) {
this.s = null;
}
}
FastKV fastKV = this.s;
if (fastKV != null) {
try {
str = fastKV.getString(q.b("H+tU+bfPhM=="), "");
try {
str3 = this.s.getString(q.b("H+tU+Fz8"), "");
} catch (Exception unused3) {
}
} catch (Exception unused4) {
str = "";
}
if (TextUtils.isEmpty(com.mbridge.msdk.foundation.same.a.k) && TextUtils.isEmpty(com.mbridge.msdk.foundation.same.a.l)) {
com.mbridge.msdk.foundation.same.a.k = com.mbridge.msdk.foundation.a.a.a.a().b("b");
com.mbridge.msdk.foundation.same.a.l = com.mbridge.msdk.foundation.a.a.a.a().b(com.mbridge.msdk.foundation.db.c.a);
}
if (TextUtils.isEmpty(str) && TextUtils.isEmpty(str3)) {
if (!TextUtils.isEmpty(com.mbridge.msdk.foundation.same.a.k) || !TextUtils.isEmpty(com.mbridge.msdk.foundation.same.a.l)) {
try {
this.s.putString(q.b("H+tU+bfPhM=="), com.mbridge.msdk.foundation.same.a.k);
this.s.putString(q.b("H+tU+Fz8"), com.mbridge.msdk.foundation.same.a.l);
} catch (Exception unused5) {
}
}
} else {
com.mbridge.msdk.foundation.same.a.k = str;
com.mbridge.msdk.foundation.same.a.l = str3;
com.mbridge.msdk.foundation.a.a.a.a().a("b", com.mbridge.msdk.foundation.same.a.k);
com.mbridge.msdk.foundation.a.a.a.a().a(com.mbridge.msdk.foundation.db.c.a, com.mbridge.msdk.foundation.same.a.l);
}
} else {
SharedPreferences sharedPreferences = applicationContext2.getSharedPreferences(q.b("H+tU+FeXHM=="), 0);
if (sharedPreferences != null) {
str2 = sharedPreferences.getString(q.b("H+tU+bfPhM=="), "");
str3 = sharedPreferences.getString(q.b("H+tU+Fz8"), "");
} else {
str2 = "";
}
if (TextUtils.isEmpty(com.mbridge.msdk.foundation.same.a.k) && TextUtils.isEmpty(com.mbridge.msdk.foundation.same.a.l)) {
com.mbridge.msdk.foundation.same.a.k = com.mbridge.msdk.foundation.a.a.a.a().b("b");
com.mbridge.msdk.foundation.same.a.l = com.mbridge.msdk.foundation.a.a.a.a().b(com.mbridge.msdk.foundation.db.c.a);
}
if (TextUtils.isEmpty(str2) && TextUtils.isEmpty(str3)) {
if ((!TextUtils.isEmpty(com.mbridge.msdk.foundation.same.a.k) || !TextUtils.isEmpty(com.mbridge.msdk.foundation.same.a.l)) && sharedPreferences != null) {
SharedPreferences.Editor edit = sharedPreferences.edit();
edit.putString(q.b("H+tU+bfPhM=="), com.mbridge.msdk.foundation.same.a.k);
edit.putString(q.b("H+tU+Fz8"), com.mbridge.msdk.foundation.same.a.l);
edit.apply();
}
} else {
com.mbridge.msdk.foundation.same.a.k = str2;
com.mbridge.msdk.foundation.same.a.l = str3;
com.mbridge.msdk.foundation.a.a.a.a().a("b", com.mbridge.msdk.foundation.same.a.k);
com.mbridge.msdk.foundation.a.a.a.a().a(com.mbridge.msdk.foundation.db.c.a, com.mbridge.msdk.foundation.same.a.l);
}
}
} catch (Throwable th3) {
v.a("SDKController", th3.getMessage(), th3);
}
try {
if (MBridgeConstans.INIT_UA_IN) {
com.mbridge.msdk.foundation.same.f.b.a().execute(new Runnable() {
@Override
public final void run() {
Looper.prepare();
b.this.e();
b bVar = b.this;
b.a(bVar, bVar.k);
Looper.loop();
}
});
} else if (Looper.myLooper() == Looper.getMainLooper()) {
com.mbridge.msdk.foundation.same.f.b.a().execute(new Runnable() {
@Override
public final void run() {
Looper.prepare();
b.this.e();
Looper.loop();
}
});
} else {
e();
}
} catch (Exception e11) {
v.d("SDKController", e11.getMessage());
}
c();
y.a(this.i);
this.n = true;
long h10 = com.mbridge.msdk.c.b.a().g(this.k).h();
if (h10 != 1300) {
new Handler().postDelayed(new Runnable() {
@Override
public final void run() {
r.m(context);
}
}, h10);
}
}
}
public final void a(Map<String, Object> map, int i) {
if (MBridgeSDKFactory.getMBridgeSDK().getStatus() != MBridgeSDK.PLUGIN_LOAD_STATUS.COMPLETED) {
return;
}
this.t = map;
this.u = i;
a.d().g();
if (map != null) {
if (this.o == null) {
this.o = new com.mbridge.msdk.b.a();
}
try {
Map<String, Object> map2 = this.t;
if (map2 != null && map2.size() > 0 && this.t.containsKey("layout_type") && ((Integer) this.t.get("layout_type")).intValue() == 0) {
Map<String, Object> map3 = this.t;
int i10 = this.u;
try {
com.mbridge.msdk.mbnative.e.a.class.getMethod("preload", Map.class, Integer.TYPE).invoke(com.mbridge.msdk.mbnative.e.a.class.newInstance(), map3, Integer.valueOf(i10));
} catch (Exception e) {
e.printStackTrace();
}
}
} catch (Exception e10) {
e10.printStackTrace();
}
}
}
public static void a(b bVar, String str) {
if (com.mbridge.msdk.c.b.a() == null) {
return;
}
com.mbridge.msdk.c.b a = com.mbridge.msdk.c.b.a();
if (a != null) {
com.mbridge.msdk.c.a b = a.b(str);
if (b != null) {
MBridgeConstans.OMID_JS_SERVICE_URL = b.at();
MBridgeConstans.OMID_JS_H5_URL = b.as();
if (!TextUtils.isEmpty(b.z())) {
com.mbridge.msdk.foundation.same.net.f.d.a().c = b.z();
com.mbridge.msdk.foundation.same.net.f.d.a().e();
}
if (!TextUtils.isEmpty(b.A())) {
com.mbridge.msdk.foundation.same.net.f.d.a().d = b.A();
com.mbridge.msdk.foundation.same.net.f.d.a().f();
}
} else {
MBridgeConstans.OMID_JS_SERVICE_URL = "https://cdn-adn-https.rayjump.com/cdn-adn/v2/portal/19/08/20/11/06/5d5b63cb457e2.js";
MBridgeConstans.OMID_JS_H5_URL = "https://mtg-native.rayjump.com/omsdk/omsdkjs_common_js.txt";
}
}
if (com.mbridge.msdk.c.b.a().a(str) && com.mbridge.msdk.c.b.a().a(str, 1, (String) null)) {
new com.mbridge.msdk.c.c().a(bVar.i, str, bVar.l);
} else {
new d(bVar.i).a();
}
}
}