正在查看: Minits v4.9.3.32 应用的 AppForegroundService.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Minits v4.9.3.32 应用的 AppForegroundService.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.xone.android.framework.services;
import A0.b;
import C1.c;
import C9.e;
import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.net.Uri;
import android.os.Build;
import android.os.IBinder;
import android.text.TextUtils;
import com.xone.android.framework.AbstractC0568j;
import com.xone.android.framework.receivers.AppForegroundServiceClickReceiver;
import com.xone.android.utils.Utils;
import ha.t;
import java.util.Random;
import q3.f;
import q3.i;
import z0.r;
public final class AppForegroundService extends Service {
public static void a(Context context, String str, String str2) {
Context applicationContext = context.getApplicationContext();
SharedPreferences.Editor edit = applicationContext.getSharedPreferences("AppForegroundService", 0).edit();
edit.putString("notification_title", str);
edit.putString("notification_text", str2);
edit.apply();
Intent intent = new Intent();
intent.setClass(applicationContext, AppForegroundService.class);
if (Utils.H2(applicationContext) < 34 || Build.VERSION.SDK_INT < 34 || e.o(applicationContext, "android.permission.FOREGROUND_SERVICE_DATA_SYNC")) {
b.s(applicationContext, intent);
} else {
applicationContext.startService(intent);
}
}
public static void b(Context context) {
Context applicationContext = context.getApplicationContext();
Intent intent = new Intent();
intent.setClass(applicationContext, AppForegroundService.class);
applicationContext.stopService(intent);
}
@Override
public IBinder onBind(Intent intent) {
return null;
}
@Override
public void onCreate() {
super.onCreate();
SharedPreferences sharedPreferences = getSharedPreferences("AppForegroundService", 0);
String string = sharedPreferences.getString("notification_title", " ");
String string2 = sharedPreferences.getString("notification_text", " ");
Context applicationContext = getApplicationContext();
PendingIntent activity = PendingIntent.getActivity(applicationContext, 0, new Intent(), Utils.l2(false, 0));
int i = Build.VERSION.SDK_INT;
if (i >= 26) {
String string3 = TextUtils.isEmpty(string2) ? getString(AbstractC0568j.b) : string2;
NotificationManager notificationManager = (NotificationManager) c.a(applicationContext, NotificationManager.class);
NotificationChannel a = i.a("AppForegroundService2", string3, 0);
a.setShowBadge(false);
a.setLockscreenVisibility(-1);
f.a(notificationManager, a);
}
Notification c = new r.e(applicationContext, "AppForegroundService2").y(t.a).m(string).l(string2).k(activity).D((long[]) null).z((Uri) null).w(-2).k(PendingIntent.getBroadcast(applicationContext, new Random().nextInt(), new Intent(applicationContext, (Class<?>) AppForegroundServiceClickReceiver.class), Utils.l2(true, 134217728))).c();
if (Utils.H2(applicationContext) < 34 || i < 34) {
startForeground(19149, c);
} else if (e.o(applicationContext, "android.permission.FOREGROUND_SERVICE_DATA_SYNC")) {
startForeground(19149, c, 1);
} else {
Utils.g4(applicationContext, "FOREGROUND_SERVICE_DATA_SYNC is not declared. Foreground service cannot be launched");
}
}
@Override
public void onDestroy() {
stopForeground(true);
super.onDestroy();
}
public void onTimeout(int i, int i2) {
stopSelf();
super.onTimeout(i, i2);
}
}