导航菜单

页面标题

页面副标题

Tasker v6.5.11 - MyDeviceAdminReceiver.java 源代码

正在查看: Tasker v6.5.11 应用的 MyDeviceAdminReceiver.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package net.dinglisch.android.taskerm;

import android.app.admin.DeviceAdminReceiver;
import android.app.admin.DevicePolicyManager;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.os.UserHandle;
import com.joaomgcd.taskerm.helper.HelperMonitorService;

public class MyDeviceAdminReceiver extends DeviceAdminReceiver {
    public static boolean a(Context context) {
        return ((DevicePolicyManager) oi.d(context, "device_policy", "MyDeviceAdminReceiver", "en")).isAdminActive(c(context));
    }

    public static com.joaomgcd.taskerm.util.s6 b(Context context) {
        return a(context) ? new com.joaomgcd.taskerm.util.v6() : new com.joaomgcd.taskerm.util.t6("No permission to be device admin");
    }

    public static ComponentName c(Context context) {
        return new ComponentName(context.getPackageName(), MyDeviceAdminReceiver.class.getName());
    }

    public static Intent d(Context context) {
        return new Intent("android.app.action.ADD_DEVICE_ADMIN").putExtra("android.app.extra.DEVICE_ADMIN", c(context));
    }

    public static boolean e(Context context) {
        try {
            ((DevicePolicyManager) oi.d(context, "device_policy", "MyDeviceAdminReceiver", c6.LOCK_LABEL)).lockNow();
            return true;
        } catch (NullPointerException e) {
            r7.l("MyDeviceAdminReceiver", "lockNow", e);
            return false;
        } catch (SecurityException unused) {
            r7.G("MyDeviceAdminReceiver", "lockNow: security exception");
            return false;
        }
    }

    @Override
    public void onPasswordChanged(Context context, Intent intent, UserHandle userHandle) {
        super.onPasswordChanged(context, intent, userHandle);
    }

    @Override
    public void onPasswordFailed(Context context, Intent intent, UserHandle userHandle) {
        super.onPasswordFailed(context, intent, userHandle);
        r7.f("MyDeviceAdminReceiver", "onPasswordFailed" + intent);
        com.joaomgcd.taskerm.helper.t tVar = new com.joaomgcd.taskerm.helper.t(context);
        tVar.I();
        HelperMonitorService.U1(context, tVar.e0());
        tVar.J();
    }
}