导航菜单

页面标题

页面副标题

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

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

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


package com.iflytek.mdmservice.service;

import a.b.b.a;
import android.app.IntentService;
import android.content.ComponentName;
import android.content.Intent;
import android.content.ServiceConnection;
import android.os.IBinder;
import android.os.RemoteException;
import android.util.Log;
import androidx.annotation.Nullable;
import com.iflytek.mdmcommon.LogUtil;
import com.iflytek.mdmcommon.SpHelper;
import com.iflytek.mdmservice.MDMApp;

public class DetectionDeviceService extends IntentService {

    private static final Object f466c = new Object();

    private a.b.b.a f467a;

    private ServiceConnection f468b;

    class a implements ServiceConnection {
        a() {
        }

        @Override
        public void onServiceConnected(ComponentName componentName, IBinder iBinder) {
            LogUtil.c("Detection", "bind DetectionService successfully");
            DetectionDeviceService.this.f467a = a.a.G(iBinder);
        }

        @Override
        public void onServiceDisconnected(ComponentName componentName) {
            LogUtil.c("Detection", "unbind DetectionService service");
            DetectionDeviceService.this.f467a = null;
        }
    }

    public DetectionDeviceService() {
        super("DetectionDeviceService");
        this.f468b = new a();
    }

    private void b() {
        Intent intent = new Intent();
        intent.setComponent(new ComponentName("com.iflytek.mdmdetection", "com.iflytek.mdmdetection.service.DetectionService"));
        LogUtil.c("Detection", "bind DetectionService result: " + bindService(intent, this.f468b, 1));
    }

    public static void c() {
        MDMApp.j().startService(new Intent(MDMApp.j(), (Class<?>) DetectionDeviceService.class));
    }

    @Override
    public void onCreate() {
        super.onCreate();
        b();
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        ServiceConnection serviceConnection = this.f468b;
        if (serviceConnection != null) {
            unbindService(serviceConnection);
        }
    }

    @Override
    protected void onHandleIntent(@Nullable Intent intent) {
        long currentTimeMillis = System.currentTimeMillis();
        while (this.f467a == null && System.currentTimeMillis() - currentTimeMillis < 3000) {
            synchronized (f466c) {
                try {
                    f466c.wait(100L);
                } catch (InterruptedException e) {
                    LogUtil.e(e.getMessage());
                    Thread.currentThread().interrupt();
                }
            }
        }
        a.b.b.a aVar = this.f467a;
        if (aVar != null) {
            try {
                aVar.o();
                SpHelper.putLong("check_photo_nsfw_time", System.currentTimeMillis());
            } catch (RemoteException e2) {
                LogUtil.c("Detection", "bind DetectionService failed " + Log.getStackTraceString(e2));
            }
        }
    }
}