导航菜单

页面标题

页面副标题

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

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

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


package com.iflytek.mdmservice.service;

import android.app.AlarmManager;
import android.app.IntentService;
import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.os.Build;
import androidx.annotation.Nullable;
import com.iflytek.mdmcommon.LogUtil;
import com.iflytek.mdmcommon.SpHelper;
import com.iflytek.mdmlibrary.MdmSdk;
import com.iflytek.mdmservice.R$drawable;
import com.iflytek.mdmservice.ui.OpenActivity;
import net.sqlcipher.database.SQLiteDatabase;

public class InitMdmService extends IntentService {

    private static final String f483b = InitMdmService.class.getSimpleName();

    private AlarmManager f484a;

    public InitMdmService() {
        this("InitMdmService");
    }

    private int a() {
        try {
            return getPackageManager().getPackageInfo(getPackageName(), 0).versionCode;
        } catch (PackageManager.NameNotFoundException e) {
            LogUtil.e(f483b, e.getMessage());
            return 0;
        }
    }

    private void b() {
        Intent intent = new Intent(this, (Class<?>) InitAppService.class);
        Intent intent2 = new Intent(this, (Class<?>) BackgroundService.class);
        if (Build.VERSION.SDK_INT >= 26) {
            startForegroundService(intent);
            startForegroundService(intent2);
        } else {
            startService(intent);
            startService(intent2);
        }
    }

    private void c() {
        throw new UnsupportedOperationException("Method not decompiled: com.iflytek.mdmservice.service.InitMdmService.c():void");
    }

    private boolean d() {
        return a() > SpHelper.getInt("version_code", 0);
    }

    private void e() {
    }

    @Override
    public void onCreate() {
        super.onCreate();
        LogUtil.i(f483b, "onCreate");
        this.f484a = (AlarmManager) getSystemService("alarm");
        if (Build.VERSION.SDK_INT >= 26) {
            String packageName = getPackageName();
            NotificationManager notificationManager = (NotificationManager) getSystemService(com.igexin.push.core.b.l);
            NotificationChannel notificationChannel = new NotificationChannel(packageName, "主服务", 4);
            notificationChannel.enableLights(true);
            notificationChannel.setLightColor(-65536);
            notificationChannel.setShowBadge(true);
            notificationChannel.setDescription("管控平台正在后台运行,请勿停用此服务!");
            notificationChannel.setLockscreenVisibility(-1);
            notificationManager.createNotificationChannel(notificationChannel);
            startForeground(1114, new Notification.Builder(this, packageName).setContentTitle("正在进行设备管控").setContentText("管控平台正在后台运行,请勿停用此服务!").setWhen(System.currentTimeMillis()).setSmallIcon(R$drawable.ic_notification_mdm).build());
        }
    }

    @Override
    protected void onHandleIntent(@Nullable Intent intent) {
        if (com.iflytek.mdmbase.b.a.b(Build.MODEL) && MdmSdk.getControlMode() == 2) {
            return;
        }
        c();
        b();
        if (com.iflytek.mdmbase.b.a.a(Build.MODEL) || com.iflytek.mdmbase.b.a.b(Build.MODEL)) {
            Intent intent2 = new Intent(getBaseContext(), (Class<?>) OpenActivity.class);
            intent2.addFlags(SQLiteDatabase.CREATE_IF_NECESSARY);
            getApplication().startActivity(intent2);
        }
    }

    @Override
    public int onStartCommand(@Nullable Intent intent, int i, int i2) {
        LogUtil.i(f483b, "onStartCommand");
        if (Build.VERSION.SDK_INT >= 26) {
            String packageName = getPackageName();
            NotificationManager notificationManager = (NotificationManager) getSystemService(com.igexin.push.core.b.l);
            NotificationChannel notificationChannel = new NotificationChannel(packageName, "主服务", 4);
            notificationChannel.enableLights(true);
            notificationChannel.setLightColor(-65536);
            notificationChannel.setShowBadge(true);
            notificationChannel.setDescription("管控平台正在后台运行,请勿停用此服务!");
            notificationChannel.setLockscreenVisibility(-1);
            notificationManager.createNotificationChannel(notificationChannel);
            startForeground(1114, new Notification.Builder(this, packageName).setContentTitle("正在进行设备管控").setContentText("管控平台正在后台运行,请勿停用此服务!").setWhen(System.currentTimeMillis()).setSmallIcon(R$drawable.ic_notification_mdm).build());
        }
        return super.onStartCommand(intent, i, i2);
    }

    public InitMdmService(String str) {
        super(str);
    }
}