正在查看: Namma Yatri v3.3.7 应用的 MyFirebaseMessagingService.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Namma Yatri v3.3.7 应用的 MyFirebaseMessagingService.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.mobility.movingtech;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Handler;
import android.os.Looper;
import com.facebook.react.A;
import com.facebook.react.bridge.Arguments;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.bridge.WritableMap;
import com.facebook.react.modules.core.DeviceEventManagerModule;
import com.facebook.react.x;
import com.google.firebase.messaging.FirebaseMessagingService;
import com.google.firebase.messaging.RemoteMessage;
import java.util.Map;
import kotlin.jvm.internal.DefaultConstructorMarker;
import org.json.JSONObject;
public final class MyFirebaseMessagingService extends FirebaseMessagingService {
public static final a f = new a(null);
private static ReactApplicationContext g;
private final String a = "GENERAL_NOTIFIACTION";
private final Handler b = new Handler(Looper.getMainLooper());
private final long c = 10000;
private final int d = 10;
private int e;
public static final class a {
public a(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
public final void a(ReactApplicationContext context) {
kotlin.jvm.internal.m.i(context, "context");
MyFirebaseMessagingService.g = context;
}
private a() {
}
}
public static final class b implements A {
final WritableMap a;
b(WritableMap writableMap) {
this.a = writableMap;
}
public void a(ReactContext context) {
kotlin.jvm.internal.m.i(context, "context");
context.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class).emit("onFCMReceived", this.a);
}
}
private final void i(final WritableMap writableMap) {
DeviceEventManagerModule.RCTDeviceEventEmitter jSModule;
ReactApplicationContext reactApplicationContext = g;
StringBuilder sb2 = new StringBuilder();
sb2.append("reactContext val: ");
sb2.append(reactApplicationContext);
ReactApplicationContext reactApplicationContext2 = g;
if (reactApplicationContext2 != null) {
kotlin.jvm.internal.m.f(reactApplicationContext2);
if (reactApplicationContext2.hasActiveReactInstance()) {
ReactApplicationContext reactApplicationContext3 = g;
if (reactApplicationContext3 == null || (jSModule = reactApplicationContext3.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)) == null) {
return;
}
jSModule.emit("onFCMReceived", writableMap);
return;
}
}
ReactApplicationContext reactApplicationContext4 = g;
if (reactApplicationContext4 != null) {
Context applicationContext = reactApplicationContext4 != null ? reactApplicationContext4.getApplicationContext() : null;
kotlin.jvm.internal.m.g(applicationContext, "null cannot be cast to non-null type com.facebook.react.ReactApplication");
((x) applicationContext).a().o().q(new b(writableMap));
return;
}
StringBuilder sb3 = new StringBuilder();
sb3.append("this got called reactContext val: ");
sb3.append(reactApplicationContext4);
int i = this.e;
if (i < this.d) {
this.e = i + 1;
this.b.postDelayed(new Runnable() {
@Override
public final void run() {
MyFirebaseMessagingService.j(MyFirebaseMessagingService.this, writableMap);
}
}, this.c);
}
}
public static final void j(MyFirebaseMessagingService this$0, WritableMap params) {
kotlin.jvm.internal.m.i(this$0, "this$0");
kotlin.jvm.internal.m.i(params, "$params");
this$0.i(params);
}
private final boolean k(JSONObject jSONObject, String str) {
try {
return jSONObject.getBoolean(str);
} catch (Exception unused) {
return false;
}
}
private final String l(JSONObject jSONObject, String str) {
try {
String string = jSONObject.getString(str);
kotlin.jvm.internal.m.f(string);
return string;
} catch (Exception unused) {
return "{}";
}
}
public void onMessageReceived(RemoteMessage remoteMessage) {
kotlin.jvm.internal.m.i(remoteMessage, "remoteMessage");
String.valueOf(g);
Map k0 = remoteMessage.k0();
StringBuilder sb2 = new StringBuilder();
sb2.append("Message data payload 1: ");
sb2.append(k0);
WritableMap createMap = Arguments.createMap();
Map k02 = remoteMessage.k0();
kotlin.jvm.internal.m.h(k02, "getData(...)");
StringBuilder sb3 = new StringBuilder();
sb3.append("dataMap: ");
sb3.append(k02);
String jSONObject = new JSONObject(k02).toString();
kotlin.jvm.internal.m.h(jSONObject, "toString(...)");
JSONObject jSONObject2 = new JSONObject(jSONObject);
String l = l(jSONObject2, "notification_json");
String l2 = l(jSONObject2, "notification_type");
String l3 = l(jSONObject2, "entity_ids");
String l4 = l(jSONObject2, "entity_type");
String l5 = l(jSONObject2, "entity_data");
JSONObject jSONObject3 = new JSONObject(l(jSONObject2, "notification_json"));
l(jSONObject3, "title");
l(jSONObject3, "body");
String valueOf = String.valueOf(k(jSONObject2, "show_notification"));
createMap.putString("notification_json", l);
createMap.putString("notification_type", l2);
createMap.putString("entity_ids", l3);
createMap.putString("entity_type", l4);
createMap.putString("entity_data", l5);
createMap.putString("show_notification", valueOf);
createMap.putString("driver_notification_payload", l(jSONObject2, "driver_notification_payload"));
in.juspay.mobility.app.MyFirebaseMessagingService.onMessageReceived(getApplicationContext(), remoteMessage);
kotlin.jvm.internal.m.f(createMap);
i(createMap);
Map k03 = remoteMessage.k0();
StringBuilder sb4 = new StringBuilder();
sb4.append("Message data payload: ");
sb4.append(k03);
}
public void onNewToken(String token) {
kotlin.jvm.internal.m.i(token, "token");
StringBuilder sb2 = new StringBuilder();
sb2.append("Refreshed token: ");
sb2.append(token);
in.juspay.mobility.app.MyFirebaseMessagingService.onNewToken(getApplicationContext(), token);
SharedPreferences.Editor edit = getApplicationContext().getSharedPreferences("RN_ENCRYPTED_STORAGE_SHARED_PREF", 0).edit();
edit.putString("fcm_token", token);
edit.apply();
}
}