导航菜单

页面标题

页面副标题

管控平台 v5.2.3.0. - MdmEyeProtectReceiver.java 源代码

正在查看: 管控平台 v5.2.3.0. 应用的 MdmEyeProtectReceiver.java JAVA 源代码文件

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


package com.iflytek.mdmservice.receiver;

import android.content.Context;
import android.content.Intent;
import android.os.Build;
import com.iflytek.mdmcommon.LogUtil;
import com.iflytek.mdmcommon.SpHelper;
import com.iflytek.mdmlibrary.MdmSdk;
import com.iflytek.mdmservice.service.SensorService;

public class MdmEyeProtectReceiver extends MdmReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        super.onReceive(context, intent);
        String action = intent.getAction();
        String stringExtra = intent.getStringExtra("sign");
        String stringExtra2 = intent.getStringExtra("package");
        boolean booleanExtra = intent.getBooleanExtra("isNeedCheck", true);
        LogUtil.c("MDMApi", "action:" + action + ", packageName:" + stringExtra2);
        if (booleanExtra && !c(1019, stringExtra2, stringExtra)) {
            LogUtil.c("MDMApi", "action:" + action + ", packageName:" + stringExtra2 + " unauthorized");
            return;
        }
        int intExtra = intent.getIntExtra("eyesProtectType", -1);
        if (intExtra < 0 || intExtra > 2) {
            LogUtil.c("MDMApi", "action:" + action + ", packageName:" + stringExtra2 + " parameter error");
            return;
        }
        String str = Build.BRAND;
        if (SpHelper.getInstances().getContext() == null) {
            SpHelper.getInstances().init(context.getApplicationContext());
        }
        boolean z = ("Hisense".equalsIgnoreCase(str) || "HiteVision".equalsIgnoreCase(str)) && intExtra == 0;
        Intent intent2 = new Intent(context, (Class<?>) SensorService.class);
        if ("com.iflytek.mdm.intent.ACTION_ENABLE_EYE_PROTECT".equals(action)) {
            SpHelper.putBoolean("eye_distance_flag", true);
            MdmSdk.enableEyesProtect(intExtra, true);
            if (z) {
                intent2.putExtra("flag", true);
                if (Build.VERSION.SDK_INT >= 26) {
                    context.startForegroundService(intent2);
                    return;
                } else {
                    context.startService(intent2);
                    return;
                }
            }
            return;
        }
        if ("com.iflytek.mdm.intent.ACTION_DISABLE_EYE_PROTECT".equals(action)) {
            SpHelper.putBoolean("eye_distance_flag", false);
            MdmSdk.enableEyesProtect(intExtra, false);
            if (z) {
                intent2.putExtra("flag", false);
                if (Build.VERSION.SDK_INT >= 26) {
                    context.startForegroundService(intent2);
                } else {
                    context.startService(intent2);
                }
            }
        }
    }
}