正在查看: Fix Locker v1.5 应用的 PreventUserService.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Fix Locker v1.5 应用的 PreventUserService.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.user.a4keygen.services;
import android.app.AlarmManager;
import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.Service;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Build;
import android.os.IBinder;
import android.os.SystemClock;
import android.util.Log;
import androidx.core.app.NotificationCompat;
import com.user.a4keygen.BuildConfig;
import com.user.a4keygen.R;
import com.user.a4keygen.constants.WebServiceUrlConstant;
import com.user.a4keygen.receiver.ActionReceiver;
import com.user.a4keygen.receiver.BootcompleteReceiver;
import com.user.a4keygen.receiver.ScreenStatusReceiver;
import com.user.a4keygen.webutil.WebClientService;
import java.util.Timer;
import java.util.TimerTask;
public class PreventUserService extends Service {
private ActionReceiver actionReceiver;
private BootcompleteReceiver bootcompleteReceiver;
Timer maintimer;
private BroadcastReceiver ssbroadcastReceiver;
Timer timer;
@Override
public IBinder onBind(Intent intent) {
return null;
}
@Override
public int onStartCommand(Intent intent, int i, int i2) {
return 1;
}
@Override
public void onCreate() {
super.onCreate();
startReceiver();
startInForeground(getApplicationContext());
}
private void startInForeground(Context context) {
Notification build = new NotificationCompat.Builder(context, "165").setSmallIcon(WebClientService.getWebServiceUrl().equals(WebServiceUrlConstant.GMM_WEB_SERVICE_URL) ? R.mipmap.ic_app_gmm : R.mipmap.ic_app).setContentTitle(getResources().getString(R.string.app_name)).setContentText("is running").setContentIntent(PendingIntent.getActivity(context, 0, new Intent(context, (Class<?>) PreventUserService.class), 33554432)).build();
if (Build.VERSION.SDK_INT >= 26) {
NotificationChannel notificationChannel = new NotificationChannel("165", "Overlay", 3);
notificationChannel.setDescription("A channel for Overlay");
((NotificationManager) context.getSystemService("notification")).createNotificationChannel(notificationChannel);
}
startForeground(1185, build);
}
private void startReceiver() {
try {
if (this.ssbroadcastReceiver != null) {
getApplicationContext().unregisterReceiver(this.ssbroadcastReceiver);
}
this.ssbroadcastReceiver = new ScreenStatusReceiver();
this.bootcompleteReceiver = new BootcompleteReceiver();
this.actionReceiver = new ActionReceiver();
IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction("android.intent.action.SCREEN_ON");
intentFilter.addAction("android.intent.action.SCREEN_OFF");
intentFilter.addAction("android.intent.action.USER_PRESENT");
IntentFilter intentFilter2 = new IntentFilter("android.intent.action.BOOT_COMPLETED");
IntentFilter intentFilter3 = new IntentFilter("com.user.a4keygen.receiver.ActionReceiver.ACTION_RECEIVER");
getApplicationContext().registerReceiver(this.ssbroadcastReceiver, intentFilter);
getApplicationContext().registerReceiver(this.bootcompleteReceiver, intentFilter2);
getApplicationContext().registerReceiver(this.actionReceiver, intentFilter3);
DayTask();
} catch (Exception e) {
e.printStackTrace();
}
}
private void DayTask() {
try {
Timer timer = this.maintimer;
if (timer != null) {
timer.cancel();
}
Timer timer2 = new Timer();
this.maintimer = timer2;
timer2.schedule(new TimerTask() {
@Override
public void run() {
PreventUserService.this.TimeTask();
}
}, 1L, 3600000L);
} catch (Exception e) {
e.printStackTrace();
}
}
public void TimeTask() {
Timer timer = this.timer;
if (timer != null) {
timer.cancel();
}
Timer timer2 = new Timer();
this.timer = timer2;
timer2.schedule(new TimerTask() {
@Override
public void run() {
}
}, 1L, 30000L);
}
@Override
public void onDestroy() {
super.onDestroy();
try {
Timer timer = this.maintimer;
if (timer != null) {
timer.cancel();
}
Timer timer2 = this.timer;
if (timer2 != null) {
timer2.cancel();
}
if (this.ssbroadcastReceiver != null) {
getApplicationContext().unregisterReceiver(this.ssbroadcastReceiver);
}
startReceiver();
Intent intent = new Intent(this, (Class<?>) PreventUserService.class);
if (Build.VERSION.SDK_INT >= 26) {
startForegroundService(intent);
} else {
startService(intent);
}
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
public void onTaskRemoved(Intent intent) {
super.onTaskRemoved(intent);
Log.e("onTaskonDestroy", "onTaskRemoved");
try {
Timer timer = this.maintimer;
if (timer != null) {
timer.cancel();
}
Timer timer2 = this.timer;
if (timer2 != null) {
timer2.cancel();
}
if (this.ssbroadcastReceiver != null) {
getApplicationContext().unregisterReceiver(this.ssbroadcastReceiver);
}
startReceiver();
Intent intent2 = new Intent(this, (Class<?>) PreventUserService.class);
if (Build.VERSION.SDK_INT >= 26) {
startForegroundService(intent2);
} else {
startService(intent2);
}
Intent intent3 = new Intent(getApplicationContext(), (Class<?>) PreventUserService.class);
intent3.setPackage(BuildConfig.APPLICATION_ID);
((AlarmManager) getApplicationContext().getSystemService("alarm")).set(3, SystemClock.elapsedRealtime() + 1000, PendingIntent.getService(getApplicationContext(), 1, intent3, 33554432));
} catch (Exception e) {
e.printStackTrace();
}
}
}