导航菜单

页面标题

页面副标题

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

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

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


package com.iflytek.mdmlibrary.impl;

import android.annotation.SuppressLint;
import android.app.admin.DevicePolicyManager;
import android.app.mia.MiaMdmPolicyManager;
import android.content.ComponentName;
import android.content.Context;
import android.content.pm.PackageManager;
import android.os.Binder;
import android.provider.Settings;
import android.system.Os;
import android.system.OsConstants;
import android.util.Log;
import com.iflytek.mdmcommon.LogUtil;
import com.iflytek.mdmcommon.Utils;
import com.iflytek.mdmcommon.constant.LogTags;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class p extends com.iflytek.mdmbase.a.a implements com.iflytek.mdmbase.a.b {
    private static p f;
    protected static final int[] g = {OsConstants.AF_INET, OsConstants.AF_INET6};

    protected Context f980a;
    private ComponentName b;
    protected MiaMdmPolicyManager c;
    private DevicePolicyManager d;
    protected PackageManager e;

    protected p() {
    }

    public static synchronized p a(Context context) {
        p pVar;
        synchronized (p.class) {
            if (f == null) {
                f = new p(context);
            }
            pVar = f;
        }
        return pVar;
    }

    private void initDefaultConfig() {
        if (isMDMService()) {
            disallowedRunningApp();
            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");
            enableInstallSource(arrayList);
            setDefaultSettings();
        }
    }

    private boolean isWeaklyValidatedHostname(String str) {
        if (!str.matches("^[a-zA-Z0-9_.-]+$")) {
            return false;
        }
        for (int i : g) {
            if (Os.inet_pton(i, str) != null) {
                return false;
            }
        }
        return true;
    }

    @Override
    public void activeDeviceAdmin() {
    }

    @Override
    public void activeDeviceAdmin(Context context) {
    }

    @Override
    public void addDisallowedRunningApp(List<String> list) {
        try {
            for (String str : list) {
                if (Utils.isPackageInstalled(this.f980a, str)) {
                    this.c.controlApp(str, true);
                } else {
                    LogUtil.d("MiaMdm", str + "未安装, 跳过禁用设置");
                }
            }
        } catch (Throwable th) {
            LogUtil.ce("MiaMdm", "MiaMdm addDisallowedRunningApp 调用异常  " + Log.getStackTraceString(th));
        }
    }

    @Override
    public void addPersistentApp(String str) {
    }

    @Override
    public void callDeviceAdmin() {
    }

    @Override
    public void cleanNetworkAccessAppWhiteList() {
        try {
            this.c.ClearAppRules();
        } catch (Throwable th) {
            LogUtil.ce("MiaMdm", "MiaMdm cleanNetworkAccessAppWhiteList 调用异常  " + Log.getStackTraceString(th));
        }
    }

    @Override
    public boolean cleanNetworkAccessWhitelist() {
        try {
            return this.c.ClearURLListRules();
        } catch (Throwable th) {
            LogUtil.ce("MiaMdm", "MiaMdm cleanNetworkAccessWhitelist 调用异常  " + Log.getStackTraceString(th));
            return false;
        }
    }

    @Override
    public void cleanUrlWhiteList() {
        try {
            this.c.ClearURLListRules();
        } catch (Throwable th) {
            LogUtil.ce("MiaMdm", "MiaMdm cleanUrlWhiteList 调用异常  " + Log.getStackTraceString(th));
        }
    }

    @Override
    public void clearLauncherApp() {
    }

    @Override
    public void clearLockedScreenPassword() {
        try {
            this.c.deleteLockPattern(0);
        } catch (Throwable th) {
            LogUtil.ce("MiaMdm", "MiaMdm clearLockedScreenPassword 调用异常  " + Log.getStackTraceString(th));
        }
    }

    @Override
    public void clearPackageData(String str) {
    }

    @Override
    public void closeColorBlindnessMode() {
        try {
            this.c.writeSimulateColorSpaceMia(-1);
        } catch (Throwable th) {
            LogUtil.ce("MiaMdm", "MiaMdm closeColorBlindnessMode 调用异常  " + Log.getStackTraceString(th));
        }
    }

    public void closeEyeComfortMode() {
        try {
            this.c.setNightDisplay(false);
        } catch (Throwable th) {
            LogUtil.ce("MiaMdm", "MiaMdm closeEyeComfortMode 调用异常  " + Log.getStackTraceString(th));
        }
    }

    @Override
    public void disableApp(String str) {
        try {
            if (Utils.isPackageInstalled(this.f980a, str)) {
                this.c.controlApp(str, true);
                return;
            }
            LogUtil.d("MiaMdm", str + "未安装, 跳过禁用设置");
        } catch (Throwable th) {
            LogUtil.ce("MiaMdm", "MiaMdm disableApp 调用异常  " + Log.getStackTraceString(th));
        }
    }

    public void disableBack() {
        try {
            this.c.setBackKey(true);
        } catch (Throwable th) {
            LogUtil.ce("MiaMdm", "MiaMdm disableBack 调用异常  " + Log.getStackTraceString(th));
        }
    }

    @Override
    public void disableBluetooth() {
        try {
            this.c.allowBluetoothDataTransfer(false);
        } catch (Throwable th) {
            LogUtil.ce("MiaMdm", "MiaMdm disableBluetooth 调用异常  " + Log.getStackTraceString(th));
        }
    }

    @Override
    public void disableBrushProtect() {
    }

    @Override
    public void disableCamera() {
        try {
            this.c.setCamera(true);
        } catch (Throwable th) {
            LogUtil.ce("MiaMdm", "MiaMdm disableCamera 调用异常  " + Log.getStackTraceString(th));
        }
    }

    @Override
    public void disableFireWall() {
        try {
            this.c.urlSetEnable(false);
        } catch (Throwable th) {
            LogUtil.ce("MiaMdm", "MiaMdm disableFireWall 调用异常  " + Log.getStackTraceString(th));
        }
    }

    @Override
    public void disableGPS() {
        try {
            this.c.setGps(true);
        } catch (Throwable th) {
            LogUtil.ce("MiaMdm", "MiaMdm disableGPS 调用异常  " + Log.getStackTraceString(th));
        }
    }

    public void disableHome() {
        try {
            this.c.setHomeKey(true);
        } catch (Throwable th) {
            LogUtil.ce("MiaMdm", "MiaMdm disableHome 调用异常  " + Log.getStackTraceString(th));
        }
    }

    @Override
    public void disableInstallSource() {
        try {
            this.c.openInstallNonMarketApp(true);
            LogUtil.c("openInstallNonMarketApp", "openInstallNonMarketApp: true");
        } catch (Throwable th) {
            LogUtil.ce("MiaMdm", "MiaMdm enableInstallSource 调用异常  " + Log.getStackTraceString(th));
        }
    }

    @Override
    public void disableLongPressPower() {
        try {
            this.c.setPowerLongPressKey(true);
        } catch (Throwable th) {
            LogUtil.ce("MiaMdm", "MiaMdm disableLongPressPower 调用异常  " + Log.getStackTraceString(th));
        }
    }

    @Override
    public void disableMobileData() {
    }

    @Override
    public void disableNFC() {
    }

    @Override
    public void disableNavigation() {
        disableBack();
        disableHome();
        disableRecent();
    }

    @Override
    public void disableOTA() {
        try {
            this.c.setOTA(false);
        } catch (Throwable th) {
            LogUtil.ce("MiaMdm", "MiaMdm disableOTA 调用异常  " + Log.getStackTraceString(th));
        }
    }

    @Override
    public void disableOTG() {
    }

    @Override
    public void disablePrivateDns() {
        LogUtil.c(LogTags.PRIVATE_DNS, "disablePrivateDns caller PID: " + Binder.getCallingPid());
        long clearCallingIdentity = Binder.clearCallingIdentity();
        try {
            try {
                Settings.Global.putString(this.f980a.getContentResolver(), "private_dns_mode", "off");
            } catch (Exception e) {
                LogUtil.c(LogTags.PRIVATE_DNS, "set private dns off failed:" + Log.getStackTraceString(e));
            }
        } finally {
            Binder.restoreCallingIdentity(clearCallingIdentity);
        }
    }

    public void disableRecent() {
        try {
            this.c.setRecentKey(true);
        } catch (Throwable th) {
            LogUtil.ce("MiaMdm", "MiaMdm disableRecent 调用异常  " + Log.getStackTraceString(th));
        }
    }

    @Override
    public void disableScreenShot() {
    }

    @Override
    public void disableSdCard() {
        try {
            this.c.setTFcard(true);
        } catch (Throwable th) {
            LogUtil.ce("MiaMdm", "MiaMdm disableSdCard 调用异常  " + Log.getStackTraceString(th));
        }
    }

    @Override
    public void disableShortPressPower() {
        try {
            this.c.setPowerSingleClickKey(true);
        } catch (Throwable th) {
            LogUtil.ce("MiaMdm", "MiaMdm disableShortPressPower 调用异常  " + Log.getStackTraceString(th));
        }
    }

    @Override
    public void disableSimNetwork() {
    }

    @Override
    public void disableSimVoice() {
    }

    @Override
    public void disableSpeech() {
    }

    @Override
    public void disableUsb() {
        try {
            this.c.setUsbOnlyCharging(true);
        } catch (Throwable th) {
            LogUtil.ce("MiaMdm", "MiaMdm disableUsb 调用异常  " + Log.getStackTraceString(th));
        }
    }

    @Override
    public void disableVolume() {
        disableVolumeUp();
        disableVolumeDown();
    }

    public void disableVolumeDown() {
        try {
            this.c.setVolumedownKey(true);
        } catch (Throwable th) {
            LogUtil.ce("MiaMdm", "MiaMdm disableVolumeDown 调用异常  " + Log.getStackTraceString(th));
        }
    }

    public void disableVolumeUp() {
        try {
            this.c.setVolumeupKey(true);
        } catch (Throwable th) {
            LogUtil.ce("MiaMdm", "MiaMdm disableVolumeUp 调用异常  " + Log.getStackTraceString(th));
        }
    }

    @Override
    @SuppressLint({"MissingPermission"})
    public void disableWIFI() {
    }

    protected void disallowedRunningApp() {
        try {
            disableApp("com.android.contacts");
            disableApp("com.android.wallpaper.livepicker");
            disableApp("com.android.dreams.basic");
            disableApp("com.android.dreams.phototable");
            disableApp("com.android.calendar");
            disableApp("com.android.documentsui");
            disableApp("com.android.browser");
            disableApp("com.android.soundrecorder");
            disableApp("com.android.calculator2");
            disableApp("com.android.mediacenter");
        } catch (Throwable unused) {
            LogUtil.c(p.class.getName(), "禁用应用接口调用失败");
        }
    }

    @Override
    public void enableApp(String str) {
        try {
            if (Utils.isPackageInstalled(this.f980a, str)) {
                this.c.controlApp(str, false);
                return;
            }
            LogUtil.d("MiaMdm", str + "未安装, 跳过启用设置");
        } catch (Throwable th) {
            LogUtil.ce("MiaMdm", "MiaMdm enableApp 调用异常  " + Log.getStackTraceString(th));
        }
    }

    public void enableBack() {
        try {
            this.c.setBackKey(false);
        } catch (Throwable th) {
            LogUtil.ce("MiaMdm", "MiaMdm enableBack 调用异常  " + Log.getStackTraceString(th));
        }
    }

    @Override
    public void enableBluetooth() {
        try {
            this.c.allowBluetoothDataTransfer(true);
        } catch (Throwable th) {
            LogUtil.ce("MiaMdm", "MiaMdm enableBluetooth 调用异常  " + Log.getStackTraceString(th));
        }
    }

    @Override
    public void enableCamera() {
        try {
            this.c.setCamera(false);
        } catch (Throwable th) {
            LogUtil.ce("MiaMdm", "MiaMdm enableCamera 调用异常  " + Log.getStackTraceString(th));
        }
    }

    @Override
    public void enableEyesProtect(int i, boolean z) {
    }

    @Override
    public void enableFireWall() {
        try {
            this.c.urlSetEnable(true);
        } catch (Throwable th) {
            LogUtil.ce("MiaMdm", "MiaMdm enableFireWall 调用异常  " + Log.getStackTraceString(th));
        }
    }

    @Override
    public void enableGPS() {
        try {
            this.c.setGps(false);
        } catch (Throwable th) {
            LogUtil.ce("MiaMdm", "MiaMdm enableGPS 调用异常  " + Log.getStackTraceString(th));
        }
    }

    public void enableHome() {
        try {
            this.c.setHomeKey(false);
        } catch (Throwable th) {
            LogUtil.ce("MiaMdm", "MiaMdm enableHome 调用异常  " + Log.getStackTraceString(th));
        }
    }

    @Override
    public void enableInstallSource(List<String> list) {
        try {
            this.c.openInstallNonMarketApp(false);
            LogUtil.d("openInstallNonMarketApp", "openInstallNonMarketApp: false");
        } catch (Throwable th) {
            LogUtil.ce("MiaMdm", "MiaMdm enableInstallSource 调用异常  " + Log.getStackTraceString(th));
        }
    }

    @Override
    public void enableLongPressPower() {
        try {
            this.c.setPowerLongPressKey(false);
        } catch (Throwable th) {
            LogUtil.ce("MiaMdm", "MiaMdm enableLongPressPower 调用异常  " + Log.getStackTraceString(th));
        }
    }

    @Override
    public void enableMobileData() {
    }

    @Override
    public void enableNFC() {
    }

    @Override
    public void enableNavigation() {
        enableBack();
        enableHome();
        enableRecent();
    }

    @Override
    public void enableOTA() {
        try {
            this.c.setOTA(true);
        } catch (Throwable th) {
            LogUtil.ce("MiaMdm", "MiaMdm enableOTA 调用异常  " + Log.getStackTraceString(th));
        }
    }

    @Override
    public void enableOTG() {
    }

    @Override
    public void enablePrivateDns(String str) {
        LogUtil.c(LogTags.PRIVATE_DNS, "enablePrivateDns hostname: " + str + " caller PID: " + Binder.getCallingPid());
        long clearCallingIdentity = Binder.clearCallingIdentity();
        try {
            try {
                if (isWeaklyValidatedHostname(str)) {
                    Settings.Global.putString(this.f980a.getContentResolver(), "private_dns_specifier", str);
                    Settings.Global.putString(this.f980a.getContentResolver(), "private_dns_mode", "hostname");
                } else {
                    LogUtil.c(LogTags.PRIVATE_DNS, "hostname is not valid ,not set private dns");
                }
            } catch (Exception e) {
                LogUtil.c(LogTags.PRIVATE_DNS, "set private dns on failed:" + Log.getStackTraceString(e));
            }
        } finally {
            Binder.restoreCallingIdentity(clearCallingIdentity);
        }
    }

    public void enableRecent() {
        try {
            this.c.setRecentKey(false);
        } catch (Throwable th) {
            LogUtil.ce("MiaMdm", "MiaMdm enableRecent 调用异常  " + Log.getStackTraceString(th));
        }
    }

    @Override
    public void enableScreenShot() {
    }

    @Override
    public void enableSdCard() {
        try {
            this.c.setTFcard(false);
        } catch (Throwable th) {
            LogUtil.ce("MiaMdm", "MiaMdm enableSdCard 调用异常  " + Log.getStackTraceString(th));
        }
    }

    @Override
    public void enableShortPressPower() {
        try {
            this.c.setPowerSingleClickKey(false);
        } catch (Throwable th) {
            LogUtil.ce("MiaMdm", "MiaMdm enableShortPressPower 调用异常  " + Log.getStackTraceString(th));
        }
    }

    @Override
    public void enableSimNetwork() {
    }

    @Override
    public void enableSimVoice() {
    }

    @Override
    public void enableSpeech() {
    }

    @Override
    public void enableUsb() {
        try {
            this.c.setUsbOnlyCharging(false);
        } catch (Throwable th) {
            LogUtil.ce("MiaMdm", "MiaMdm enableUsb 调用异常  " + Log.getStackTraceString(th));
        }
    }

    @Override
    public void enableVolume() {
        enableVolumeUp();
        enableVolumeDown();
    }

    public void enableVolumeDown() {
        try {
            this.c.setVolumedownKey(false);
        } catch (Throwable th) {
            LogUtil.ce("MiaMdm", "MiaMdm enableVolumeDown 调用异常  " + Log.getStackTraceString(th));
        }
    }

    public void enableVolumeUp() {
        try {
            this.c.setVolumeupKey(false);
        } catch (Throwable th) {
            LogUtil.ce("MiaMdm", "MiaMdm enableVolumeUp 调用异常  " + Log.getStackTraceString(th));
        }
    }

    @Override
    @SuppressLint({"MissingPermission"})
    public void enableWIFI() {
    }

    @Override
    public void forceActivePre() {
    }

    @Override
    public int getBatteryProtectionEnabled() {
        return 0;
    }

    @Override
    public boolean getBrushProtectStatus() {
        return false;
    }

    @Override
    public int getControlMode() {
        return 1;
    }

    @Override
    public List<String> getDefaultUrlWhiteList() {
        List<String> defaultUrlWhiteList = super.getDefaultUrlWhiteList();
        defaultUrlWhiteList.add("ntp.org");
        defaultUrlWhiteList.add("redstone.net.cn");
        defaultUrlWhiteList.add("pushapi.lenovomm.com");
        defaultUrlWhiteList.add("ntp3.aliyun.com");
        defaultUrlWhiteList.add("api.bs.zui.com");
        defaultUrlWhiteList.add("psb.lenovomm.com");
        defaultUrlWhiteList.add("fus.lenovomm.com");
        defaultUrlWhiteList.add("59.61.88.219");
        defaultUrlWhiteList.add("sdac.lenovomm.com");
        defaultUrlWhiteList.add("ota.lenovomm.com");
        defaultUrlWhiteList.add("dev.surepush.cn");
        defaultUrlWhiteList.add("59.61.88.200");
        defaultUrlWhiteList.add("connectivitycheck.gstatic.com");
        defaultUrlWhiteList.add("captive.apple.com");
        defaultUrlWhiteList.add("developers.google.cn");
        defaultUrlWhiteList.add("clientservices.googleapis.com");
        defaultUrlWhiteList.add("play.googleapis.com");
        defaultUrlWhiteList.add("connect.rom.miui.com");
        return defaultUrlWhiteList;
    }

    @Override
    public List<String> getDisallowedRunningApp() {
        return null;
    }

    public List<String> getInstallPackageWhiteList() {
        return new ArrayList();
    }

    @Override
    public int getMaxUrlSize() {
        return 1000;
    }

    @Override
    public List<String> getNetworkAccessAppWhiteList() {
        try {
            return this.c.APPIPWhiteListRead();
        } catch (Throwable th) {
            LogUtil.ce("MiaMdm", "MiaMdm getNetworkAccessAppWhiteList 调用异常  " + Log.getStackTraceString(th));
            return null;
        }
    }

    @Override
    public List<String> getPersistentApps() {
        return null;
    }

    @Override
    public String getSerialNumber() {
        try {
            return this.c.getMiaBuildNumber();
        } catch (Throwable th) {
            LogUtil.ce("MiaMdm", "MiaMdm getSerialNumber 调用异常  " + Log.getStackTraceString(th));
            return null;
        }
    }

    @Override
    public String getTopAppPackageName() {
        return null;
    }

    public String getWifiMacAddress() {
        return null;
    }

    @Override
    public boolean grantPermission() {
        return true;
    }

    public void hideWifiAdvanced() {
        try {
            this.c.setWifiProxy(true);
        } catch (Throwable th) {
            LogUtil.ce("MiaMdm", "MiaMdm hideWifiAdvanced 调用异常  " + Log.getStackTraceString(th));
        }
    }

    @Override
    public void initConfig() {
    }

    @Override
    public boolean isAdbTurnOn() {
        return false;
    }

    @Override
    public boolean isChargingDisabled() {
        return false;
    }

    public boolean isDisableAdb() {
        return false;
    }

    @Override
    public boolean isDisableBluetooth() {
        return false;
    }

    @Override
    public boolean isDisableCamera() {
        try {
            return this.d.getCameraDisabled(this.b);
        } catch (Throwable th) {
            LogUtil.ce("MiaMdm", "MiaMdm isDisableCamera 调用异常  " + Log.getStackTraceString(th));
            return false;
        }
    }

    @Override
    public boolean isDisableGPS() {
        return false;
    }

    @Override
    public boolean isDisableNFC() {
        return false;
    }

    @Override
    public boolean isDisableSdCard() {
        return false;
    }

    @Override
    public boolean isDisableUsb() {
        return false;
    }

    @Override
    public boolean isDisableWifiAdvanced() {
        return false;
    }

    protected boolean isMDMService() {
        return "com.iflytek.mdmservice".equals(this.f980a.getPackageName());
    }

    @Override
    public void killApplicationProcess(String str) {
        try {
            this.c.killApplicationProcess(str);
        } catch (Throwable th) {
            LogUtil.ce("MiaMdm", "MiaMdm killApplicationProcess 调用异常  " + Log.getStackTraceString(th));
        }
    }

    @Override
    public boolean modifySystemTime(String str) {
        try {
            return this.c.updateSystemTime(str);
        } catch (Throwable th) {
            LogUtil.ce("MiaMdm", "MiaMdm modifySystemTime 调用异常  " + Log.getStackTraceString(th));
            return false;
        }
    }

    @Override
    public void openColorBlindnessMode() {
        try {
            this.c.writeSimulateColorSpaceMia(0);
        } catch (Throwable th) {
            LogUtil.ce("MiaMdm", "MiaMdm openColorBlindnessMode 调用异常  " + Log.getStackTraceString(th));
        }
    }

    public void openEyeComfortMode() {
        try {
            this.c.setNightDisplay(true);
        } catch (Throwable th) {
            LogUtil.ce("MiaMdm", "MiaMdm openEyeComfortMode 调用异常  " + Log.getStackTraceString(th));
        }
    }

    public void powerOff() {
        try {
            this.c.shutDown();
        } catch (Throwable th) {
            LogUtil.ce("MiaMdm", "MiaMdm powerOff 调用异常  " + Log.getStackTraceString(th));
        }
    }

    @Override
    public void recoverBrushProtect() {
    }

    @Override
    public void removeDisallowedRunningApp(List<String> list) {
        try {
            for (String str : list) {
                if (Utils.isPackageInstalled(this.f980a, str)) {
                    this.c.controlApp(str, false);
                } else {
                    LogUtil.d("MiaMdm", str + "未安装, 跳过启用设置");
                }
            }
        } catch (Throwable th) {
            LogUtil.ce("MiaMdm", "MiaMdm removeDisallowedRunningApp 调用异常  " + Log.getStackTraceString(th));
        }
    }

    @Override
    public void removeSuperWhiteApp(ArrayList<String> arrayList) {
    }

    public void resetFactory() {
        try {
            this.c.masterClearInbulitSD();
        } catch (Throwable th) {
            LogUtil.ce("MiaMdm", "MiaMdm resetFactory 调用异常  " + Log.getStackTraceString(th));
        }
    }

    public boolean resetNetworkSetting() {
        try {
            this.c.forgetWifiSsid();
            return true;
        } catch (Throwable th) {
            LogUtil.ce("MiaMdm", "MiaMdm resetNetworkSetting 调用异常  " + Log.getStackTraceString(th));
            return false;
        }
    }

    @Override
    public void resetSettings() {
    }

    @Override
    public void resetSuperWhiteApp(String str) {
    }

    @Override
    public void setBatteryProtectionEnabled(boolean z) {
    }

    @Override
    public void setBluetoothAndWifiStatus(int i, int i2) {
    }

    @Override
    public void setChargingDisabled(boolean z) {
    }

    @Override
    public void setControlMode(int i) {
    }

    protected void setDefaultSettings() {
        try {
            Settings.System.putFloat(this.f980a.getContentResolver(), "font_scale", Float.parseFloat("1.0"));
            LogUtil.d(h.class.getSimpleName(), "Hitv101cMdm setFontSize");
        } catch (Throwable th) {
            LogUtil.e(h.class.getSimpleName(), "Hitv101cMdm setFontSize  调用异常 " + Log.getStackTraceString(th));
        }
    }

    @Override
    public void setDeviceOwnerApp() {
    }

    public void setEyeComfortLevel(int i) {
        if (i < 0 || i > 32) {
            return;
        }
        try {
            this.c.setconvertTemperature((int) (i * 46.4375d));
        } catch (Throwable th) {
            LogUtil.ce("MiaMdm", "MiaMdm setEyeComfortLevel 调用异常  " + Log.getStackTraceString(th));
        }
    }

    public void setInstallPackageWhiteList(List<String> list) {
    }

    @Override
    public void setLauncherApp(String str, String str2) {
    }

    @Override
    public boolean setNetworkAccessAppWhiteList(String str) {
        try {
            return this.c.AddAppWhiteRule(str);
        } catch (Throwable th) {
            LogUtil.ce("MiaMdm", "MiaMdm setNetworkAccessAppWhiteList 调用异常  " + Log.getStackTraceString(th));
            return false;
        }
    }

    @Override
    public void setPersistentApps(List<String> list) {
    }

    @Override
    public void setScreenPassword(String str) {
        try {
            this.d.resetPassword(str, 1);
            this.d.lockNow();
        } catch (Throwable th) {
            LogUtil.ce("MiaMdm", "MiaMdm setScreenPassword 调用异常  " + Log.getStackTraceString(th));
        }
    }

    @Override
    public void setStorageUnmounted() {
    }

    @Override
    public void setSuperWhiteApp(ArrayList<String> arrayList) {
    }

    public void showWifiAdvanced() {
        try {
            this.c.setWifiProxy(false);
        } catch (Throwable th) {
            LogUtil.ce("MiaMdm", "MiaMdm showWifiAdvanced 调用异常  " + Log.getStackTraceString(th));
        }
    }

    @Override
    public void silentDowngrade() {
    }

    @Override
    public void silentInstall(String str) {
        try {
            this.c.silentInstall(str);
        } catch (Throwable th) {
            LogUtil.ce("MiaMdm", "MiaMdm silentInstall 调用异常  " + Log.getStackTraceString(th));
        }
    }

    @Override
    public void silentUninstall(String str) {
        try {
            if (this.e.getPackageInfo(str, 0) != null) {
                this.c.silentUnInstall(str);
            }
        } catch (Throwable th) {
            LogUtil.ce("MiaMdm", "MiaMdm silentUninstall 调用异常  " + Log.getStackTraceString(th));
        }
    }

    @Override
    public void silentUpgrade(String str) {
        try {
            this.c.silentInstall(str);
        } catch (Throwable th) {
            LogUtil.ce("MiaMdm", "MiaMdm silentUpgrade 调用异常  " + Log.getStackTraceString(th));
        }
    }

    public void turnOffAdb() {
    }

    public void turnOnAdb() {
    }

    @Override
    public List<String> urlBlackListRead() {
        try {
            return this.c.urlBlackListRead();
        } catch (Throwable th) {
            LogUtil.ce("MiaMdm", "MiaMdm urlBlackListRead 调用异常  " + Log.getStackTraceString(th));
            return null;
        }
    }

    @Override
    public void urlBlackListWrite(List<String> list) {
        try {
            this.c.urlBlackListWrite(list);
        } catch (Throwable th) {
            LogUtil.ce("MiaMdm", "MiaMdm urlBlackListWrite 调用异常  " + Log.getStackTraceString(th));
        }
    }

    @Override
    public List<String> urlWhiteListRead() {
        try {
            return this.c.urlWhiteListRead();
        } catch (Throwable th) {
            LogUtil.ce("MiaMdm", "MiaMdm urlWhiteListRead 调用异常  " + Log.getStackTraceString(th));
            return null;
        }
    }

    @Override
    public void urlWhiteListWrite(List<String> list) {
        try {
            this.c.urlWhiteListWrite(com.iflytek.mdmlibrary.a.b.a(list));
        } catch (Throwable th) {
            LogUtil.ce("MiaMdm", "MiaMdm urlWhiteListWrite 调用异常  " + Log.getStackTraceString(th));
        }
    }

    protected p(Context context) {
        this.f980a = context.getApplicationContext();
        this.b = new ComponentName(context, context.getPackageName() + ".receiver.AdminReceiver");
        this.e = context.getPackageManager();
        this.c = new MiaMdmPolicyManager(context);
        this.d = (DevicePolicyManager) context.getSystemService("device_policy");
        initDefaultConfig();
    }

    @Override
    public void killApplicationProcess(List<String> list) {
        if (list != null) {
            try {
                Iterator<String> it = list.iterator();
                while (it.hasNext()) {
                    this.c.killApplicationProcess(it.next());
                }
            } catch (Throwable th) {
                LogUtil.ce("MiaMdm", "MiaMdm killApplicationProcess 调用异常  " + Log.getStackTraceString(th));
            }
        }
    }

    @Override
    public boolean setNetworkAccessAppWhiteList(ArrayList<String> arrayList) {
        try {
            Iterator<String> it = arrayList.iterator();
            while (it.hasNext()) {
                this.c.AddAppWhiteRule(it.next());
            }
            return true;
        } catch (Throwable th) {
            LogUtil.ce("MiaMdm", "MiaMdm setNetworkAccessAppWhiteList 调用异常  " + Log.getStackTraceString(th));
            return false;
        }
    }
}