- Added realracing3-community.apk (71.57 MB) - Removed 32-bit support (armeabi-v7a) - Only includes arm64-v8a libraries - Decompiled source code included - Added README-community.md with analysis
249 lines
9.8 KiB
Java
249 lines
9.8 KiB
Java
package com.mbridge.msdk.video.signal.communication;
|
|
|
|
import android.content.Context;
|
|
import android.text.TextUtils;
|
|
import android.util.Base64;
|
|
import com.mbridge.msdk.MBridgeConstans;
|
|
import com.mbridge.msdk.click.c;
|
|
import com.mbridge.msdk.foundation.tools.af;
|
|
import com.mbridge.msdk.foundation.tools.ak;
|
|
import com.mbridge.msdk.mbsignalcommon.communication.d;
|
|
import com.mbridge.msdk.mbsignalcommon.windvane.WindVaneWebView;
|
|
import com.mbridge.msdk.mbsignalcommon.windvane.g;
|
|
import com.mbridge.msdk.video.signal.a.k;
|
|
import com.mbridge.msdk.video.signal.factory.IJSFactory;
|
|
import com.unity3d.ads.core.domain.HandleInvocationsFromAdViewer;
|
|
import com.unity3d.services.ads.gmascar.bridges.mobileads.MobileAdsBridgeBase;
|
|
import org.json.JSONException;
|
|
import org.json.JSONObject;
|
|
|
|
/* loaded from: classes4.dex */
|
|
public class BaseRewardSignal extends BaseRewardSignalDiff {
|
|
protected BaseIRewardCommunication a;
|
|
|
|
@Override // com.mbridge.msdk.mbsignalcommon.windvane.h
|
|
public void initialize(Context context, WindVaneWebView windVaneWebView) {
|
|
super.initialize(context, windVaneWebView);
|
|
try {
|
|
try {
|
|
} catch (ClassNotFoundException e) {
|
|
e.printStackTrace();
|
|
}
|
|
if (IJSFactory.class.isInstance(context)) {
|
|
this.a = (BaseIRewardCommunication) BaseRewardSignalH5.class.newInstance();
|
|
BaseRewardSignalH5.class.getMethod(MobileAdsBridgeBase.initializeMethodName, Context.class, WindVaneWebView.class).invoke(this.a, context, windVaneWebView);
|
|
}
|
|
if (windVaneWebView.getObject() != null && (windVaneWebView.getObject() instanceof BaseIRewardCommunication)) {
|
|
this.a = (BaseIRewardCommunication) windVaneWebView.getObject();
|
|
}
|
|
} catch (Exception e2) {
|
|
if (MBridgeConstans.DEBUG) {
|
|
e2.printStackTrace();
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.mbsignalcommon.windvane.h
|
|
public void initialize(Object obj, WindVaneWebView windVaneWebView) {
|
|
super.initialize(obj, windVaneWebView);
|
|
try {
|
|
try {
|
|
} catch (ClassNotFoundException e) {
|
|
e.printStackTrace();
|
|
}
|
|
if (IJSFactory.class.isInstance(obj)) {
|
|
this.a = (BaseIRewardCommunication) BaseRewardSignalH5.class.newInstance();
|
|
BaseRewardSignalH5.class.getMethod(MobileAdsBridgeBase.initializeMethodName, Object.class, WindVaneWebView.class).invoke(this.a, obj, windVaneWebView);
|
|
}
|
|
if (windVaneWebView.getObject() != null && (windVaneWebView.getObject() instanceof BaseIRewardCommunication)) {
|
|
this.a = (BaseIRewardCommunication) windVaneWebView.getObject();
|
|
}
|
|
} catch (Exception e2) {
|
|
if (MBridgeConstans.DEBUG) {
|
|
e2.printStackTrace();
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.video.signal.communication.BaseIRewardCommunication
|
|
public void getEndScreenInfo(Object obj, String str) {
|
|
try {
|
|
BaseIRewardCommunication baseIRewardCommunication = this.a;
|
|
if (baseIRewardCommunication != null) {
|
|
baseIRewardCommunication.getEndScreenInfo(obj, str);
|
|
af.b("JS-Reward-Brigde", "getEndScreenInfo factory is true");
|
|
} else {
|
|
af.b("JS-Reward-Brigde", "getEndScreenInfo factory is null");
|
|
if (obj != null) {
|
|
WindVaneWebView windVaneWebView = ((com.mbridge.msdk.mbsignalcommon.windvane.a) obj).b;
|
|
if ((windVaneWebView instanceof WindVaneWebView) && windVaneWebView.getWebViewListener() != null) {
|
|
((com.mbridge.msdk.mbsignalcommon.b.a) windVaneWebView.getWebViewListener()).a(obj);
|
|
}
|
|
}
|
|
}
|
|
} catch (Throwable th) {
|
|
af.b("JS-Reward-Brigde", "getEndScreenInfo", th);
|
|
}
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.video.signal.communication.BaseIRewardCommunication
|
|
public void install(Object obj, String str) {
|
|
try {
|
|
BaseIRewardCommunication baseIRewardCommunication = this.a;
|
|
if (baseIRewardCommunication != null) {
|
|
baseIRewardCommunication.install(obj, str);
|
|
return;
|
|
}
|
|
if (TextUtils.isEmpty(str)) {
|
|
return;
|
|
}
|
|
if (obj != null) {
|
|
com.mbridge.msdk.mbsignalcommon.windvane.a aVar = (com.mbridge.msdk.mbsignalcommon.windvane.a) obj;
|
|
if (aVar.b.getObject() instanceof k) {
|
|
((k) aVar.b.getObject()).click(1, str);
|
|
af.b("JS-Reward-Brigde", "JSCommon install jump success");
|
|
}
|
|
}
|
|
af.b("JS-Reward-Brigde", "JSCommon install failed");
|
|
} catch (Throwable th) {
|
|
af.b("JS-Reward-Brigde", "install", th);
|
|
}
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.video.signal.communication.BaseIRewardCommunication
|
|
public void notifyCloseBtn(Object obj, String str) {
|
|
try {
|
|
if (this.a == null || TextUtils.isEmpty(str)) {
|
|
return;
|
|
}
|
|
this.a.notifyCloseBtn(obj, str);
|
|
} catch (Throwable th) {
|
|
af.b("JS-Reward-Brigde", "notifyCloseBtn", th);
|
|
}
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.video.signal.communication.BaseIRewardCommunication
|
|
public void toggleCloseBtn(Object obj, String str) {
|
|
try {
|
|
if (this.a == null || TextUtils.isEmpty(str)) {
|
|
return;
|
|
}
|
|
this.a.toggleCloseBtn(obj, str);
|
|
} catch (Throwable th) {
|
|
af.b("JS-Reward-Brigde", "toggleCloseBtn", th);
|
|
}
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.video.signal.communication.BaseIRewardCommunication
|
|
public void triggerCloseBtn(Object obj, String str) {
|
|
try {
|
|
if (this.a == null || TextUtils.isEmpty(str)) {
|
|
return;
|
|
}
|
|
this.a.triggerCloseBtn(obj, str);
|
|
} catch (Throwable th) {
|
|
af.b("JS-Reward-Brigde", "triggerCloseBtn", th);
|
|
g.a().a(obj, a(-1));
|
|
}
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.video.signal.communication.BaseIRewardCommunication
|
|
public void setOrientation(Object obj, String str) {
|
|
try {
|
|
if (this.a == null || TextUtils.isEmpty(str)) {
|
|
return;
|
|
}
|
|
this.a.setOrientation(obj, str);
|
|
} catch (Throwable th) {
|
|
af.b("JS-Reward-Brigde", "setOrientation", th);
|
|
}
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.video.signal.communication.BaseIRewardCommunication
|
|
public void handlerPlayableException(Object obj, String str) {
|
|
try {
|
|
if (this.a == null || TextUtils.isEmpty(str)) {
|
|
return;
|
|
}
|
|
this.a.handlerPlayableException(obj, str);
|
|
} catch (Throwable th) {
|
|
af.b("JS-Reward-Brigde", "handlerPlayableException", th);
|
|
}
|
|
}
|
|
|
|
private String a(int i) {
|
|
try {
|
|
JSONObject jSONObject = new JSONObject();
|
|
jSONObject.put("code", i);
|
|
String jSONObject2 = jSONObject.toString();
|
|
return !TextUtils.isEmpty(jSONObject2) ? Base64.encodeToString(jSONObject2.getBytes(), 2) : "";
|
|
} catch (Throwable unused) {
|
|
af.b("JS-Reward-Brigde", "code to string is error");
|
|
return "";
|
|
}
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.video.signal.communication.BaseIRewardCommunication
|
|
public void openURL(Object obj, String str) {
|
|
af.b("JS-Reward-Brigde", "openURL:" + str);
|
|
if (TextUtils.isEmpty(str)) {
|
|
d.a(obj, "params is null");
|
|
return;
|
|
}
|
|
if (TextUtils.isEmpty(str)) {
|
|
return;
|
|
}
|
|
try {
|
|
JSONObject jSONObject = new JSONObject(str);
|
|
String optString = jSONObject.optString("url");
|
|
int optInt = jSONObject.optInt("type");
|
|
if (optInt == 1) {
|
|
c.d(this.b, optString);
|
|
} else if (optInt == 2) {
|
|
c.f(this.b, optString);
|
|
}
|
|
} catch (JSONException e) {
|
|
af.b("JS-Reward-Brigde", e.getMessage());
|
|
} catch (Throwable th) {
|
|
af.b("JS-Reward-Brigde", th.getMessage());
|
|
}
|
|
}
|
|
|
|
@Override // com.mbridge.msdk.video.signal.communication.BaseIRewardCommunication
|
|
public void cai(Object obj, String str) {
|
|
if (TextUtils.isEmpty(str)) {
|
|
d.a(obj, "params is null");
|
|
return;
|
|
}
|
|
if (TextUtils.isEmpty(str)) {
|
|
return;
|
|
}
|
|
try {
|
|
try {
|
|
String optString = new JSONObject(str).optString(HandleInvocationsFromAdViewer.KEY_PACKAGE_NAME);
|
|
if (TextUtils.isEmpty(optString)) {
|
|
d.a(obj, "packageName is empty");
|
|
}
|
|
int i = ak.c(com.mbridge.msdk.foundation.controller.c.m().c(), optString) ? 1 : 2;
|
|
try {
|
|
JSONObject jSONObject = new JSONObject();
|
|
jSONObject.put("code", d.b);
|
|
JSONObject jSONObject2 = new JSONObject();
|
|
jSONObject2.put("result", i);
|
|
jSONObject.put("data", jSONObject2);
|
|
g.a().a(obj, Base64.encodeToString(jSONObject.toString().getBytes(), 2));
|
|
} catch (Exception e) {
|
|
d.a(obj, e.getMessage());
|
|
af.a("JS-Reward-Brigde", e.getMessage());
|
|
}
|
|
} catch (JSONException e2) {
|
|
d.a(obj, "exception: " + e2.getLocalizedMessage());
|
|
af.b("JS-Reward-Brigde", "cai", e2);
|
|
}
|
|
} catch (Throwable th) {
|
|
d.a(obj, "exception: " + th.getLocalizedMessage());
|
|
af.b("JS-Reward-Brigde", "cai", th);
|
|
}
|
|
}
|
|
}
|