正在查看: Rilo v2.0.21 应用的 LudoGameService.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Rilo v2.0.21 应用的 LudoGameService.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.vdx.sud.service;
import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.Service;
import android.content.Intent;
import android.os.Build;
import android.os.IBinder;
import androidx.core.app.NotificationCompat;
import androidx.core.app.ServiceCompat;
import com.vdx.sud.R;
import com.vdx.sud.SudGameActivity;
import kotlin.Metadata;
import kotlin.jvm.internal.Intrinsics;
import timber.log.Timber;
@Metadata(d1 = {"\u0000F\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0002\b\u0003\n\u0002\u0010\b\n\u0000\n\u0002\u0010\t\n\u0002\b\u0004\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0006\u0018\u00002\u00020\u0001B\u0005¢\u0006\u0002\u0010\u0002J\b\u0010\u0011\u001a\u00020\u0012H\u0002J\b\u0010\u0013\u001a\u00020\u0012H\u0002J\u0014\u0010\u0014\u001a\u0004\u0018\u00010\u00152\b\u0010\u0016\u001a\u0004\u0018\u00010\u0017H\u0016J\b\u0010\u0018\u001a\u00020\u0019H\u0016J\b\u0010\u001a\u001a\u00020\u0019H\u0016J\"\u0010\u001b\u001a\u00020\b2\b\u0010\u0016\u001a\u0004\u0018\u00010\u00172\u0006\u0010\u001c\u001a\u00020\b2\u0006\u0010\u001d\u001a\u00020\bH\u0016J\b\u0010\u001e\u001a\u00020\u0019H\u0002R\u000e\u0010\u0003\u001a\u00020\u0004X\u0082D¢\u0006\u0002\n\u0000R\u000e\u0010\u0005\u001a\u00020\u0004X\u0082D¢\u0006\u0002\n\u0000R\u000e\u0010\u0006\u001a\u00020\u0004X\u0082D¢\u0006\u0002\n\u0000R\u000e\u0010\u0007\u001a\u00020\bX\u0082D¢\u0006\u0002\n\u0000R\u0012\u0010\t\u001a\u0004\u0018\u00010\nX\u0082\u000e¢\u0006\u0004\n\u0002\u0010\u000bR\u0010\u0010\f\u001a\u0004\u0018\u00010\u0004X\u0082\u000e¢\u0006\u0002\n\u0000R\u0010\u0010\r\u001a\u0004\u0018\u00010\u0004X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u000e\u001a\u00020\u000fX\u0082\u000e¢\u0006\u0002\n\u0000R\u0010\u0010\u0010\u001a\u0004\u0018\u00010\u0004X\u0082\u000e¢\u0006\u0002\n\u0000¨\u0006\u001f"}, d2 = {"Lcom/vdx/sud/service/LudoGameService;", "Landroid/app/Service;", "()V", "CHANNEL_DESCRIPTION", "", "CHANNEL_ID", "CHANNEL_NAME", "NOTIFICATION_ID", "", "gameId", "", "Ljava/lang/Long;", "gameRoomId", "sessionToken", "showNotification", "", "userId", "createForegroundNotification", "Landroid/app/Notification;", "createPlaceholderNotification", "onBind", "Landroid/os/IBinder;", "intent", "Landroid/content/Intent;", "onCreate", "", "onDestroy", "onStartCommand", "flags", "startId", "startForegroundService", "sud_release"}, k = 1, mv = {1, 8, 0}, xi = 48)
public final class LudoGameService extends Service {
private Long gameId;
private String gameRoomId;
private String sessionToken;
private boolean showNotification;
private String userId;
private final int NOTIFICATION_ID = 88;
private final String CHANNEL_ID = "app.game.service";
private final String CHANNEL_NAME = "Ludo Game Notifications";
private final String CHANNEL_DESCRIPTION = "Notifications related to Ludo game events";
@Override
public IBinder onBind(Intent intent) {
return null;
}
@Override
public void onCreate() {
super.onCreate();
if (Build.VERSION.SDK_INT >= 26) {
NotificationChannel notificationChannel = new NotificationChannel(this.CHANNEL_ID, this.CHANNEL_NAME, 4);
notificationChannel.setDescription(this.CHANNEL_DESCRIPTION);
notificationChannel.enableLights(true);
notificationChannel.setLightColor(-65536);
notificationChannel.enableVibration(true);
Object systemService = getSystemService("notification");
Intrinsics.checkNotNull(systemService, "null cannot be cast to non-null type android.app.NotificationManager");
((NotificationManager) systemService).createNotificationChannel(notificationChannel);
}
}
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
Timber.d("Show Notification: " + this.showNotification, new Object[0]);
if (intent != null) {
this.showNotification = intent.getBooleanExtra("showNotification", false);
this.gameRoomId = intent.getStringExtra("gameRoomId");
this.gameId = Long.valueOf(intent.getLongExtra("gameId", -1L));
this.userId = intent.getStringExtra("userId");
this.sessionToken = intent.getStringExtra("sessionToken");
Timber.d("Show Notification: " + this.showNotification, new Object[0]);
Timber.d("Room ID: " + this.gameRoomId + ", Game ID: " + this.gameId + ", User ID: " + this.userId + ", Session Token: " + this.sessionToken, new Object[0]);
}
startForegroundService();
return 1;
}
private final void startForegroundService() {
Notification createForegroundNotification = this.showNotification ? createForegroundNotification() : createPlaceholderNotification();
if (Build.VERSION.SDK_INT >= 34) {
ServiceCompat.startForeground(this, this.NOTIFICATION_ID, createForegroundNotification, 4);
} else {
startForeground(this.NOTIFICATION_ID, createForegroundNotification);
}
}
private final Notification createForegroundNotification() {
LudoGameService ludoGameService = this;
Intent intent = new Intent(ludoGameService, (Class<?>) SudGameActivity.class);
intent.putExtra("gameId", this.gameId);
intent.putExtra("roomId", this.gameRoomId);
intent.putExtra("userId", this.userId);
intent.putExtra("sessionToken", this.sessionToken);
PendingIntent activity = PendingIntent.getActivity(ludoGameService, 0, intent, 201326592);
Intrinsics.checkNotNullExpressionValue(activity, "getActivity(\n …G_IMMUTABLE\n )");
Notification build = new NotificationCompat.Builder(ludoGameService, this.CHANNEL_ID).setContentTitle("Ludo game started").setContentText("Tap to play").setSmallIcon(R.drawable.ludo).setPriority(1).setOngoing(true).setContentIntent(activity).build();
Intrinsics.checkNotNullExpressionValue(build, "Builder(this, CHANNEL_ID…ent)\n .build()");
return build;
}
private final Notification createPlaceholderNotification() {
Notification build = new NotificationCompat.Builder(this, this.CHANNEL_ID).setContentTitle("Ludo").setContentText("Finding Match").setSmallIcon(R.drawable.ludo).setPriority(1).setOngoing(true).build();
Intrinsics.checkNotNullExpressionValue(build, "Builder(this, CHANNEL_ID…rue)\n .build()");
return build;
}
@Override
public void onDestroy() {
super.onDestroy();
stopForeground(2);
stopSelf();
}
}