导航菜单

页面标题

页面副标题

Fix Locker v1.5 - LockTestService.java 源代码

正在查看: Fix Locker v1.5 应用的 LockTestService.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.Intent;
import android.content.pm.ResolveInfo;
import android.os.Build;
import android.os.Handler;
import android.os.IBinder;
import android.os.SystemClock;
import android.util.Log;
import androidx.core.app.NotificationCompat;
import com.user.a4keygen.R;
import com.user.a4keygen.activity.LockingActvity;
import com.user.a4keygen.constants.WebServiceUrlConstant;
import com.user.a4keygen.util.Config;
import com.user.a4keygen.webutil.WebClientService;
import java.util.List;
import java.util.Timer;
import java.util.TimerTask;
import org.bouncycastle.asn1.cmp.PKIFailureInfo;

public class LockTestService extends Service {
    static final boolean $assertionsDisabled = false;
    public static final long NOTIFY_INTERVAL = 1000;
    private Handler mHandler = new Handler();
    private Timer mTimer = null;

    @Override
    public IBinder onBind(Intent intent) {
        return null;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        System.out.println("LockTestService called = ");
        startInForeground();
        Timer timer = new Timer();
        this.mTimer = timer;
        timer.scheduleAtFixedRate(new TimeDisplayTimerTask(), 5L, 1000L);
    }

    private void startInForeground() {
        Log.e("TAG", "startInForeground executed");
        if (Build.VERSION.SDK_INT >= 26) {
            createNotificationChannel(Config.CHANNEL_ID, "MyService");
            Notification.Builder contentIntent = new Notification.Builder(this, Config.CHANNEL_ID).setContentTitle(getString(R.string.lblCompanyName)).setAutoCancel(false).setSmallIcon(WebClientService.getWebServiceUrl().equals(WebServiceUrlConstant.GMM_WEB_SERVICE_URL) ? R.mipmap.ic_app_gmm : R.mipmap.ic_app).setContentIntent(PendingIntent.getActivity(getApplicationContext(), 0, new Intent(getApplicationContext(), (Class<?>) LockingActvity.class), 33554432));
            contentIntent.setOngoing(true);
            Notification build = contentIntent.build();
            build.flags |= 98;
            startForeground(1112, build);
            return;
        }
        startForeground(18, new NotificationCompat.Builder(this).setContentTitle(getString(R.string.lblCompanyName)).setPriority(0).setAutoCancel(false).build());
    }

    private void createNotificationChannel(String str, String str2) {
        try {
            Log.e("TAG", "createNotificationChannel executed");
            if (Build.VERSION.SDK_INT >= 26) {
                Log.e("TAG", "createNotificationChannel inside if");
                NotificationChannel notificationChannel = new NotificationChannel(str, str2, 0);
                notificationChannel.setLightColor(-16776961);
                notificationChannel.setLockscreenVisibility(0);
                ((NotificationManager) getSystemService("notification")).createNotificationChannel(notificationChannel);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    private java.lang.String printForegroundTask() {
        throw new UnsupportedOperationException("Method not decompiled: com.user.a4keygen.services.LockTestService.printForegroundTask():java.lang.String");
    }

    public void LockApps() {
        System.out.println("querySettingPkgName() = " + querySettingPkgName());
        if (printForegroundTask().equalsIgnoreCase(querySettingPkgName())) {
            System.out.println("printForegroundTask() inside if = " + printForegroundTask());
        }
    }

    private String querySettingPkgName() {
        List<ResolveInfo> queryIntentActivities = getPackageManager().queryIntentActivities(new Intent("android.settings.SETTINGS"), PKIFailureInfo.notAuthorized);
        return (queryIntentActivities == null || queryIntentActivities.size() == 0) ? "" : queryIntentActivities.get(0).activityInfo.packageName;
    }

    @Override
    public void onTaskRemoved(Intent intent) {
        super.onTaskRemoved(intent);
        Intent intent2 = new Intent(getApplicationContext(), getClass());
        intent2.setPackage(getPackageName());
        ((AlarmManager) getApplicationContext().getSystemService("alarm")).set(3, SystemClock.elapsedRealtime() + 1000, PendingIntent.getService(getApplicationContext(), 1, intent2, 33554432));
        Log.e("Service_Auto_Restart", "ON");
    }

    class TimeDisplayTimerTask extends TimerTask {
        TimeDisplayTimerTask() {
        }

        @Override
        public void run() {
            LockTestService.this.mHandler.post(new Runnable() {
                @Override
                public void run() {
                    LockTestService.this.LockApps();
                }
            });
        }
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        stopSelf();
    }
}