搜索插件、代码仓与 APP 分类

插件详情v1.0.1

screen_capture_utils

一个用于处理 Android 和 iOS 设备上屏幕捕获事件的插件

AndroidiOS
近 30 天下载
11
喜欢数
18
Pub 分数
150

安装插件

flutter pub add screen_capture_utils

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

一个 Flutter 插件,可在 Android 和 iOS 设备上启用屏幕捕获事件的检测和处理。它允许应用程序在用户截屏或录制屏幕时做出响应,这对于保护敏感内容非常有用。该插件提供了一个简单的 API 来监听这些事件,并触发相应的操作,例如显示警告或禁用某些功能。它支持两大主流移动平台,并可无缝集成到现有的 Flutter 项目中。

适合场景

  • 保护敏感的UI内容
  • 检测未经授权的截图
  • 实现类似DRM的行为
  • 增强应用安全性
  • 监控屏幕录制活动

主要特点

  • 跨平台支持(Android 和 iOS)
  • 屏幕捕获事件监听器
  • 与 Flutter 的简单集成
  • 实时捕获检测
  • 所需设置最少

适合对象

  • 注重安全的应用程序
  • 内容保护应用
  • 包含机密数据的应用程序
  • 教育或企业软件
  • 数字版权管理实现

使用建议

  • 仅限检测捕获事件,无法防止它们
  • 行为可能因设备制造商而异
  • 无法控制系统级捕获工具
  • Android 需要权限处理
  • iOS 后台监控的限制

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

Screen Capture Utils

A plugin to handle screen capture events on android and ios

🚀 Initialize SDK
  late ScreenCaptureUtils screenCaptureUtils;
  
  ...   
    
  screenCaptureUtils = ScreenCaptureUtils(
      // Path returns empty on iOS
      onScreenCaptured: (_) {
          print('Captured: $_');
      },
    
      /// Only on Android !!!
      isGuarding: (bool val) {
        print(val);
      },
    
      /// Only on Android !!!
      onScreenCapturedWithDeniedPermission: () {
        print('onScreenCapturedWithDeniedPermission');
      },
  )..intialize();
️🔐 Screen Guarding (Android Only)
Guard
   /// Guard Screen
  screenCaptureUtils.guard();
  • This function will apply the FLAG_SECURE to the MainActivity of your app.
UnGuard
   /// Unguard Screen
  screenCaptureUtils.unGuard();
  • This function will remove/clear the FLAG_SECURE from the MainActivity of your app.

✨ Contribution

Lots of PR's would be needed to improve this plugin. So lots of suggestions and PRs are welcome.

所属分类

源码仓库

使用此插件的项目

暂无相关数据。