正在查看: Fix Locker v1.5 应用的 BootReceiver.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Fix Locker v1.5 应用的 BootReceiver.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.user.a4keygen;
import android.app.admin.DevicePolicyManager;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.IBinder;
import android.os.Process;
import android.os.UserHandle;
import com.user.a4keygen.common.Util;
import com.user.a4keygen.comp.BindDeviceAdminServiceHelper;
import com.user.a4keygen.comp.DeviceOwnerService;
import com.user.a4keygen.comp.IDeviceOwnerService;
import com.user.a4keygen.comp.OnServiceConnectedListener;
import com.user.a4keygen.comp.ServiceInterfaceConverter;
import com.user.a4keygen.webutil.WebClientService;
public class BootReceiver extends BroadcastReceiver {
private DevicePolicyManager dpm;
@Override
public void onReceive(Context context, Intent intent) {
if ("android.intent.action.BOOT_COMPLETED".equals(intent.getAction()) && Util.isProfileOwner(context) && Util.getBindDeviceAdminTargetUsers(context).size() != 0) {
createBindDeviceOwnerServiceHelper(context, Util.getBindDeviceAdminTargetUsers(context).get(0)).crossUserCall(new OnServiceConnectedListener() {
@Override
public final void onServiceConnected(Object obj) {
((IDeviceOwnerService) obj).notifyUserIsUnlocked(Process.myUserHandle());
}
});
this.dpm = (DevicePolicyManager) context.getSystemService("device_policy");
if (WebClientService.isActiveAdmin(context)) {
this.dpm.lockNow();
}
}
}
private BindDeviceAdminServiceHelper<IDeviceOwnerService> createBindDeviceOwnerServiceHelper(Context context, UserHandle userHandle) {
return new BindDeviceAdminServiceHelper<>(context, DeviceOwnerService.class, new ServiceInterfaceConverter() {
@Override
public final Object convert(IBinder iBinder) {
return IDeviceOwnerService.Stub.asInterface(iBinder);
}
}, userHandle);
}
}