导航菜单

页面标题

页面副标题

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

正在查看: 管控平台 v5.2.3.0. 应用的 MediaFileService.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.ContentResolver;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.provider.MediaStore;
import androidx.annotation.Nullable;
import com.iflytek.mdmcommon.LogUtil;
import com.iflytek.mdmcommon.SpHelper;
import com.iflytek.mdmcommon.constant.MDMConstants;
import com.iflytek.mdmservice.R$drawable;
import com.iflytek.mdmservice.db.entity.DetectionBean;
import com.iflytek.mdmservice.k.d0;
import java.io.File;

public class MediaFileService extends IntentService {

    private static final String f496a = MediaFileService.class.getSimpleName();

    class a implements d0.w {

        final long f497a;

        final int f498b;

        final long f499c;
        final int d;

        a(MediaFileService mediaFileService, long j, int i, long j2, int i2) {
            this.f497a = j;
            this.f498b = i;
            this.f499c = j2;
            this.d = i2;
        }

        @Override
        public void a(String str) {
        }

        @Override
        public void onException(Exception exc) {
        }

        @Override
        public void onSuccess(String str) {
            SpHelper.putLong("mdm_record_media_data", System.currentTimeMillis());
            SpHelper.putLong("mdm_record_image_size", this.f497a);
            SpHelper.putInt("mdm_record_image_count", this.f498b);
            SpHelper.putLong("mdm_record_video_size", this.f499c);
            SpHelper.putInt("mdm_record_video_count", this.d);
        }
    }

    public MediaFileService() {
        this(f496a);
    }

    private void a(String str, int i) {
        String str2;
        Uri uri;
        File file = new File(str);
        if (file.exists()) {
            boolean delete = file.delete();
            String str3 = f496a;
            StringBuilder sb = new StringBuilder();
            sb.append("删除:");
            sb.append(str);
            sb.append(delete ? "成功" : "失败");
            LogUtil.c(str3, sb.toString());
            try {
                ContentResolver contentResolver = getContentResolver();
                if (i == 0) {
                    uri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI;
                    str2 = "_data='" + str + "'";
                } else if (i == 1) {
                    uri = MediaStore.Video.Media.EXTERNAL_CONTENT_URI;
                    str2 = "_data='" + str + "'";
                } else {
                    str2 = null;
                    uri = null;
                }
                contentResolver.delete(uri, str2, null);
            } catch (Exception e) {
                LogUtil.ce(f496a, e.getMessage());
            }
            Intent intent = new Intent("android.intent.action.MEDIA_SCANNER_SCAN_FILE");
            intent.setData(Uri.fromFile(file));
            sendBroadcast(intent);
        }
    }

    private void b(java.util.Map<java.lang.String, java.lang.Object> r31) {
        throw new UnsupportedOperationException("Method not decompiled: com.iflytek.mdmservice.service.MediaFileService.b(java.util.Map):void");
    }

    public static boolean c(DetectionBean detectionBean) {
        if (detectionBean == null) {
            return false;
        }
        if (detectionBean.getTfAnimeScore().floatValue() > 0.5d) {
            return true;
        }
        return detectionBean.getTfAnimeScore().floatValue() > detectionBean.getTfLandscapeScore().floatValue() && detectionBean.getTfAnimeScore().floatValue() > detectionBean.getTfClassroomScore().floatValue() && detectionBean.getTfAnimeScore().floatValue() > detectionBean.getTfFlowerScore().floatValue() && detectionBean.getTfAnimeScore().floatValue() > detectionBean.getTfPersonScore().floatValue() && detectionBean.getTfAnimeScore().floatValue() > detectionBean.getTfPersonsScore().floatValue() && detectionBean.getTfAnimeScore().floatValue() > detectionBean.getTfCarScore().floatValue() && detectionBean.getTfAnimeScore().floatValue() > detectionBean.getTfWorkPlaceScore().floatValue() && detectionBean.getTfAnimeScore().floatValue() > detectionBean.getTfSnowSceneScore().floatValue() && detectionBean.getTfAnimeScore().floatValue() > detectionBean.getTfArticleScore().floatValue() && detectionBean.getTfAnimeScore().floatValue() > detectionBean.getTfAnimalScore().floatValue() && detectionBean.getTfAnimeScore().floatValue() > detectionBean.getTfTextScore().floatValue() && detectionBean.getTfAnimeScore().floatValue() > detectionBean.getTfBuildingScore().floatValue();
    }

    private boolean d(Intent intent, long j, int i, long j2, int i2) {
        if (intent.getBooleanExtra("isImagesChange", false)) {
            return false;
        }
        return (j == SpHelper.getLong("mdm_record_image_size", 0L) && i == SpHelper.getInt("mdm_record_image_count", 0) && j2 == SpHelper.getLong("mdm_record_video_size", 0L) && i2 == SpHelper.getInt("mdm_record_video_count", 0)) ? false : true;
    }

    public static boolean e(DetectionBean detectionBean) {
        if (detectionBean == null || detectionBean.getNsfwScore().floatValue() <= MDMConstants.NSFW_THRESHOLD.floatValue()) {
            return false;
        }
        if (g(detectionBean) || c(detectionBean)) {
            return true;
        }
        LogUtil.d("Detection", "nsfw评分大于0.7 但分类不是人物和动漫图片");
        return false;
    }

    public static boolean f(DetectionBean detectionBean) {
        return detectionBean != null && h(detectionBean) && detectionBean.getNsfwScore().floatValue() >= MDMConstants.NSFW_THRESHOLD.floatValue();
    }

    public static boolean g(DetectionBean detectionBean) {
        if (detectionBean == null) {
            return false;
        }
        float floatValue = detectionBean.getTfPersonScore().floatValue() + detectionBean.getTfPersonsScore().floatValue();
        if (floatValue > 0.5d) {
            return true;
        }
        return floatValue > detectionBean.getTfLandscapeScore().floatValue() && floatValue > detectionBean.getTfClassroomScore().floatValue() && floatValue > detectionBean.getTfFlowerScore().floatValue() && floatValue > detectionBean.getTfTextScore().floatValue() && floatValue > detectionBean.getTfCarScore().floatValue() && floatValue > detectionBean.getTfWorkPlaceScore().floatValue() && floatValue > detectionBean.getTfSnowSceneScore().floatValue() && floatValue > detectionBean.getTfArticleScore().floatValue() && floatValue > detectionBean.getTfAnimalScore().floatValue() && floatValue > detectionBean.getTfAnimeScore().floatValue() && floatValue > detectionBean.getTfBuildingScore().floatValue();
    }

    public static boolean h(DetectionBean detectionBean) {
        return detectionBean != null && ((double) (detectionBean.getTfPersonScore().floatValue() + detectionBean.getTfPersonsScore().floatValue())) >= 0.5d;
    }

    public static boolean i(DetectionBean detectionBean) {
        if (detectionBean == null) {
            return false;
        }
        if (detectionBean.getTfTextScore().floatValue() > 0.5d) {
            return true;
        }
        return detectionBean.getTfTextScore().floatValue() > detectionBean.getTfLandscapeScore().floatValue() && detectionBean.getTfTextScore().floatValue() > detectionBean.getTfClassroomScore().floatValue() && detectionBean.getTfTextScore().floatValue() > detectionBean.getTfFlowerScore().floatValue() && detectionBean.getTfTextScore().floatValue() > detectionBean.getTfPersonScore().floatValue() && detectionBean.getTfTextScore().floatValue() > detectionBean.getTfPersonsScore().floatValue() && detectionBean.getTfTextScore().floatValue() > detectionBean.getTfCarScore().floatValue() && detectionBean.getTfTextScore().floatValue() > detectionBean.getTfWorkPlaceScore().floatValue() && detectionBean.getTfTextScore().floatValue() > detectionBean.getTfSnowSceneScore().floatValue() && detectionBean.getTfTextScore().floatValue() > detectionBean.getTfArticleScore().floatValue() && detectionBean.getTfTextScore().floatValue() > detectionBean.getTfAnimalScore().floatValue() && detectionBean.getTfTextScore().floatValue() > detectionBean.getTfAnimeScore().floatValue() && detectionBean.getTfTextScore().floatValue() > detectionBean.getTfBuildingScore().floatValue();
    }

    private boolean j(Intent intent) {
        return intent.getBooleanExtra("isUseridChange", false);
    }

    @Override
    public void onCreate() {
        super.onCreate();
        if (Build.VERSION.SDK_INT >= 26) {
            NotificationManager notificationManager = (NotificationManager) getSystemService(com.igexin.push.core.b.l);
            NotificationChannel notificationChannel = new NotificationChannel("MediaFileService", "多媒体文件服务", 2);
            notificationChannel.enableLights(false);
            notificationChannel.setShowBadge(false);
            notificationChannel.setDescription("多媒体文件服务正在后台运行,请勿停用此服务!");
            notificationManager.createNotificationChannel(notificationChannel);
            startForeground(1200, new Notification.Builder(this, "MediaFileService").setContentTitle("正在进行多媒体文件扫描").setContentText("多媒体文件服务正在后台运行,请勿停用此服务!").setWhen(System.currentTimeMillis()).setSmallIcon(R$drawable.ic_notification_mdm).build());
        }
    }

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

    @Override
    public int onStartCommand(@Nullable Intent intent, int i, int i2) {
        if (Build.VERSION.SDK_INT >= 26) {
            NotificationManager notificationManager = (NotificationManager) getSystemService(com.igexin.push.core.b.l);
            NotificationChannel notificationChannel = new NotificationChannel("MediaFileService", "多媒体文件服务", 2);
            notificationChannel.enableLights(false);
            notificationChannel.setShowBadge(false);
            notificationChannel.setDescription("多媒体文件服务正在后台运行,请勿停用此服务!");
            notificationManager.createNotificationChannel(notificationChannel);
            startForeground(1200, new Notification.Builder(this, "MediaFileService").setContentTitle("正在进行多媒体文件扫描").setContentText("多媒体文件服务正在后台运行,请勿停用此服务!").setWhen(System.currentTimeMillis()).setSmallIcon(R$drawable.ic_notification_mdm).build());
        }
        return super.onStartCommand(intent, i, i2);
    }

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