导航菜单

页面标题

页面副标题

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

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

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


package com.iflytek.mdmservice.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.text.TextUtils;
import android.util.Log;
import com.iflytek.mdmcommon.LogUtil;
import com.iflytek.mdmlibrary.MdmSdk;
import java.util.ArrayList;

public class InstallSourceControlReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        if (intent == null || TextUtils.isEmpty(intent.getAction())) {
            return;
        }
        Log.i("service", "received broadcast com.iflytek.mdm.intent.INSTALL_SOURCE_CONTROL ");
        if (intent.getAction().equals("com.iflytek.mdm.intent.INSTALL_SOURCE_CONTROL")) {
            if (intent.getIntExtra("enable_install_source", 1) != 0) {
                MdmSdk.disableInstallSource();
                return;
            }
            ArrayList arrayList = new ArrayList();
            arrayList.add("com.iflytek.mdmservice");
            arrayList.add("com.iflytek.mdmstore");
            arrayList.add("com.android.iflylauncher3");
            arrayList.add("com.iflytek.iflylogin");
            arrayList.add("com.iflytek.mdmadmin");
            MdmSdk.enableInstallSource(arrayList);
            return;
        }
        if (intent.getAction().equals("com.iflytek.mdm.intent.FREEZE_APP_CONTROL")) {
            LogUtil.c("adapter_harmony", "收到冻结解冻应用广播");
            ArrayList arrayList2 = new ArrayList();
            String str = Build.BRAND;
            String str2 = Build.MODEL;
            if ("HiteVision".equalsIgnoreCase(str)) {
                arrayList2.add("com.android.calculator2");
                arrayList2.add("com.android.documentsui");
            } else if ("HUAWEI".equalsIgnoreCase(str) || "HONOR".equalsIgnoreCase(str)) {
                if ("AGM3-W09HN".equals(str2)) {
                    arrayList2.add("com.hihonor.calculator");
                    arrayList2.add("com.huawei.filemanager");
                    arrayList2.add("com.android.documentsui");
                } else {
                    arrayList2.add("com.huawei.hidisk");
                    arrayList2.add("com.android.documentsui");
                    if (com.iflytek.mdmbase.b.a.a(str2) || com.iflytek.mdmbase.b.a.b(str2)) {
                        arrayList2.add("com.huawei.calculator");
                    } else {
                        arrayList2.add("com.android.calculator2");
                    }
                }
            } else if ("HITV101C".equalsIgnoreCase(str2)) {
                arrayList2.add("com.android.calculator2");
                arrayList2.add("com.hmct.FileManager.Activity");
                arrayList2.add("com.android.documentsui");
            }
            if (intent.getIntExtra("freeze_app", 0) == 1) {
                MdmSdk.addDisallowedRunningApp(arrayList2);
            } else {
                MdmSdk.removeDisallowedRunningApp(arrayList2);
            }
        }
    }
}