导航菜单

页面标题

页面副标题

xxxxx v3.2.8 - ZegoScreenCaptureService.java 源代码

正在查看: xxxxx v3.2.8 应用的 ZegoScreenCaptureService.java JAVA 源代码文件

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


package im.zego.internal.screencapture;

import android.app.Notification;
import android.app.NotificationManager;
import android.app.Service;
import android.content.Intent;
import android.os.Binder;
import android.os.Build;
import android.os.IBinder;
import com.gyf.xtfcactus.CactusHelp$;
import tv.danmaku.ijk.media.player.IjkMediaMeta;

public class ZegoScreenCaptureService extends Service {
    private boolean occurSecurityException = false;

    public class ZegoScreenCaptureLocalBinder extends Binder {
        public ZegoScreenCaptureLocalBinder() {
        }

        public ZegoScreenCaptureService getService() {
            return ZegoScreenCaptureService.this;
        }
    }

    public boolean occurSecurityException() {
        return this.occurSecurityException;
    }

    @Override
    public IBinder onBind(Intent intent) {
        createNotificationChannel();
        return new ZegoScreenCaptureLocalBinder();
    }

    @Override
    public boolean onUnbind(Intent intent) {
        stopForeground(true);
        return super.onUnbind(intent);
    }

    private void createNotificationChannel() {
        Notification.Builder builder = new Notification.Builder(getApplicationContext());
        if (Build.VERSION.SDK_INT >= 26) {
            builder.setChannelId("notification_id");
        }
        if (Build.VERSION.SDK_INT >= 26) {
            ((NotificationManager) getSystemService("notification")).createNotificationChannel(CactusHelp$.ExternalSyntheticApiModelOutline0.m("notification_id", "notification_name", 2));
        }
        Notification build = builder.build();
        build.defaults = 1;
        if (Build.VERSION.SDK_INT >= 29) {
            try {
                startForeground(IjkMediaMeta.FF_PROFILE_H264_HIGH_10, build, 32);
                return;
            } catch (SecurityException e) {
                e.printStackTrace();
                this.occurSecurityException = true;
                return;
            }
        }
        try {
            startForeground(IjkMediaMeta.FF_PROFILE_H264_HIGH_10, build);
        } catch (SecurityException e2) {
            e2.printStackTrace();
            this.occurSecurityException = true;
        }
    }
}