导航菜单

页面标题

页面副标题

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

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

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


package com.iflytek.mdmservice.service;

import android.app.IntentService;
import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.content.Intent;
import android.graphics.BitmapFactory;
import android.os.Build;
import android.os.Handler;
import androidx.annotation.Nullable;
import com.iflytek.mdmcommon.FileUtils;
import com.iflytek.mdmcommon.LogUtil;
import com.iflytek.mdmcommon.SpHelper;
import com.iflytek.mdmservice.R$drawable;
import java.util.ArrayList;
import java.util.List;
import net.sqlcipher.BuildConfig;

public class BackgroundService extends IntentService {

    private static final String[] f444c = {"android.permission.ACCESS_FINE_LOCATION", "android.permission.ACCESS_COARSE_LOCATION", "android.permission.READ_PHONE_STATE", "android.permission.READ_EXTERNAL_STORAGE", "android.permission.WRITE_EXTERNAL_STORAGE"};

    private Handler f445a;

    private List<String> f446b;

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

    public void a() {
        SpHelper.getInstances().init(getApplicationContext());
        if (!FileUtils.existsFile(FileUtils.SET_TIME_FLAG_PATH) && SpHelper.getBoolean("set_default_time", false)) {
            FileUtils.writeStringToSd(BuildConfig.FLAVOR, ".settimeflag");
        }
        if (!FileUtils.existsFile(FileUtils.RESET_NETWORK_FLAG_PATH) && SpHelper.getBoolean("reset_network", false)) {
            FileUtils.writeStringToSd(BuildConfig.FLAVOR, ".resetnetworkflag");
        }
        if (FileUtils.existsFile(FileUtils.SHOW_FLAG_PATH) || SpHelper.getBoolean("spShowTipDialogFlag", false)) {
        }
    }

    private void c() {
        if ("iFLYTEK".equalsIgnoreCase(Build.BRAND)) {
            this.f445a.postDelayed(new Runnable() {
                @Override
                public final void run() {
                    BackgroundService.this.a();
                }
            }, 3000L);
        } else {
            a();
        }
    }

    @Override
    public void onCreate() {
        super.onCreate();
        LogUtil.i("iFlytekMDM", "BackgroundService.onCreate");
        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(1110, new Notification.Builder(this, packageName).setContentTitle("正在进行设备管控").setContentText("管控平台正在后台运行,请勿停用此服务!").setWhen(System.currentTimeMillis()).setSmallIcon(R$drawable.ic_notification_mdm).setLargeIcon(BitmapFactory.decodeResource(getResources(), R$drawable.ic_notification_mdm)).build());
        }
    }

    @Override
    public void onDestroy() {
        LogUtil.i("BlueBlue", "BackgroundService.onDestroy");
        super.onDestroy();
    }

    @Override
    protected void onHandleIntent(@androidx.annotation.Nullable android.content.Intent r9) {
        throw new UnsupportedOperationException("Method not decompiled: com.iflytek.mdmservice.service.BackgroundService.onHandleIntent(android.content.Intent):void");
    }

    @Override
    public int onStartCommand(@Nullable Intent intent, int i, int i2) {
        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(1110, new Notification.Builder(this, packageName).setContentTitle("正在进行设备管控").setContentText("管控平台正在后台运行,请勿停用此服务!").setWhen(System.currentTimeMillis()).setSmallIcon(R$drawable.ic_notification_mdm).setLargeIcon(BitmapFactory.decodeResource(getResources(), R$drawable.ic_notification_mdm)).build());
        }
        return super.onStartCommand(intent, i, i2);
    }

    public BackgroundService(String str) {
        super(str);
        this.f445a = new Handler();
        this.f446b = new ArrayList();
    }
}