正在查看: Online Loans v421.2.42 应用的 MobileMessagingCloudService.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Online Loans v421.2.42 应用的 MobileMessagingCloudService.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package org.infobip.mobile.messaging.cloud;
import android.content.Context;
import android.content.Intent;
import android.text.TextUtils;
import androidx.annotation.NonNull;
import org.infobip.mobile.messaging.Message;
import org.infobip.mobile.messaging.cloud.firebase.FirebaseAppProvider;
import org.infobip.mobile.messaging.dal.bundle.MessageBundleMapper;
import org.infobip.mobile.messaging.logging.MobileMessagingLogger;
import org.infobip.mobile.messaging.platform.JobIntentService;
import org.infobip.mobile.messaging.platform.MobileMessagingJob;
import org.infobip.mobile.messaging.platform.Platform;
public class MobileMessagingCloudService extends JobIntentService {
public class a implements Runnable {
public final Context a;
public final Intent b;
public a(Context context, Intent intent) {
this.a = context;
this.b = intent;
}
@Override
public void run() {
Platform.mobileMessagingCloudHandler.get(this.a).handleWork(this.a, this.b);
}
}
public static void enqueueNewMessage(Context context, @NonNull Message message) {
g(context, new Intent("org.infobip.mobile.messaging.cloud.MESSAGE_RECEIVE").putExtras(MessageBundleMapper.messageToBundle(message)));
}
public static void enqueueNewToken(Context context, String str) {
if (TextUtils.isEmpty(str)) {
MobileMessagingLogger.e("Cannot process new token, token is empty");
} else {
g(context, new Intent("org.infobip.mobile.messaging.cloud.NEW_TOKEN").putExtra("org.infobip.mobile.messaging.cloud.TOKEN", str));
}
}
public static void enqueueTokenAcquisition(Context context, FirebaseAppProvider firebaseAppProvider) {
firebaseAppProvider.getFirebaseApp();
g(context, new Intent("org.infobip.mobile.messaging.cloud.TOKEN_ACQUIRE"));
}
public static void enqueueTokenCleanup(Context context, FirebaseAppProvider firebaseAppProvider) {
firebaseAppProvider.getFirebaseApp();
g(context, new Intent("org.infobip.mobile.messaging.cloud.TOKEN_CLEANUP"));
}
public static void enqueueTokenReset(Context context, FirebaseAppProvider firebaseAppProvider) {
firebaseAppProvider.getFirebaseApp();
g(context, new Intent("org.infobip.mobile.messaging.cloud.TOKEN_RESET"));
}
public static void f(Context context, Intent intent) {
Platform.executeInBackground(new a(context, intent));
}
public static void g(Context context, Intent intent) {
if (h(context)) {
JobIntentService.enqueueWork(context, MobileMessagingCloudService.class, MobileMessagingJob.getScheduleId(context, 2), intent.setPackage(context.getPackageName()));
return;
}
MobileMessagingLogger.w("Enqueuing " + intent.getAction() + " without WAKE_LOCK permission");
f(context, intent);
}
public static boolean h(Context context) {
return Platform.sdkInt >= 26 || M.a.a(context, "android.permission.WAKE_LOCK") == 0;
}
@Override
public void onHandleWork(@NonNull Intent intent) {
Platform.mobileMessagingCloudHandler.get(this).handleWork(this, intent);
}
}