提交 d98d6d46 authored 作者: yueweilu's avatar yueweilu

1、防截屏录屏

上级 e68a6ef4
......@@ -4,5 +4,5 @@ keyPassword=123456
keyAlias=zijing
#storeFile=/Users/apple/zijiing_key.jks
storeFile=zijiing_key.jks
\ No newline at end of file
storeFile=/Users/apple/zijiing_key.jks
#storeFile=zijiing_key.jks
\ No newline at end of file
......@@ -43,6 +43,10 @@ PODS:
- permission_handler_apple (9.1.1):
- Flutter
- ReachabilitySwift (5.0.0)
- screen_protector (1.2.1):
- Flutter
- ScreenProtectorKit (~> 1.3.1)
- ScreenProtectorKit (1.3.1)
- shared_preferences_foundation (0.0.1):
- Flutter
- FlutterMacOS
......@@ -72,6 +76,7 @@ DEPENDENCIES:
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
- permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
- screen_protector (from `.symlinks/plugins/screen_protector/ios`)
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
- sqflite (from `.symlinks/plugins/sqflite/darwin`)
- tobias (from `.symlinks/plugins/tobias/ios`)
......@@ -81,6 +86,7 @@ SPEC REPOS:
- flutter_sound_core
- OrderedSet
- ReachabilitySwift
- ScreenProtectorKit
- WechatOpenSDK-XCFramework
EXTERNAL SOURCES:
......@@ -114,6 +120,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/path_provider_foundation/darwin"
permission_handler_apple:
:path: ".symlinks/plugins/permission_handler_apple/ios"
screen_protector:
:path: ".symlinks/plugins/screen_protector/ios"
shared_preferences_foundation:
:path: ".symlinks/plugins/shared_preferences_foundation/darwin"
sqflite:
......@@ -140,6 +148,8 @@ SPEC CHECKSUMS:
path_provider_foundation: 3784922295ac71e43754bd15e0653ccfd36a147c
permission_handler_apple: e76247795d700c14ea09e3a2d8855d41ee80a2e6
ReachabilitySwift: 985039c6f7b23a1da463388634119492ff86c825
screen_protector: 6f92086bd2f2f4b54f54913289b9d1310610140b
ScreenProtectorKit: 83a6281b02c7a5902ee6eac4f5045f674e902ae4
shared_preferences_foundation: b4c3b4cddf1c21f02770737f147a3f5da9d39695
sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec
tobias: 22f69183b14af82a2ac8ff698af084c352744e5f
......
......@@ -96,6 +96,7 @@ class ReadController extends FullLifeCycleController with GetSingleTickerProvide
initTts();
netStatus = await Tools.checkCurrentNetStatus();
discussTitleFocusNode.addListener(_onCommentFocusChanged);
await ScreenProtector.preventScreenshotOn();
super.onInit();
}
......@@ -125,7 +126,7 @@ class ReadController extends FullLifeCycleController with GetSingleTickerProvide
}
@override
void onClose() {
void onClose() async {
// 上报阅读结束时间
_addReadTime(type: 'close');
discussTitleFocusNode.removeListener(_onCommentFocusChanged);
......@@ -134,6 +135,7 @@ class ReadController extends FullLifeCycleController with GetSingleTickerProvide
contentInput.dispose();
flutterTts.stop();
searchInput.dispose();
await ScreenProtector.preventScreenshotOff();
super.onClose();
}
///------------------------------------------ 页面 生命周期--------------------------------------------------------
......
......@@ -26,6 +26,7 @@ import 'package:just_audio/just_audio.dart' as just_audio;
import 'package:path_provider/path_provider.dart';
import 'dart:async';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';
import 'package:screen_protector/screen_protector.dart';
import 'package:sqflite/sqflite.dart';
import '../../apis/index.dart';
......
......@@ -38,7 +38,7 @@ abstract class Tools {
static Future<String> getDirectory() async {
// getTemporaryDirectory
final directory = await getExternalStorageDirectory();
final directory = await getApplicationSupportDirectory();
return directory!.path;
}
......
......@@ -857,10 +857,18 @@ packages:
dependency: transitive
description:
name: rxdart
sha256: "0c7c0cedd93788d996e33041ffecda924cc54389199cde4e6a34b440f50044cb"
sha256: "2ef8b4e91cb3b55d155e0e34eeae0ac7107974e451495c955ac04ddee8cc21fd"
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.27.7"
version: "0.26.0"
screen_protector:
dependency: "direct main"
description:
name: screen_protector
sha256: "541bdcd341de1e38026b5b94cc2a74cd95299d2c51150735165c4b445fa0209a"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.4.2"
scrollable_positioned_list:
dependency: transitive
description:
......
......@@ -119,6 +119,9 @@ dependencies:
device_info_plus: ^9.1.2
# 安卓
android_id: ^0.3.6
# 防止截屏
# secure_application: ^3.8.0
screen_protector: ^1.4.2
dev_dependencies:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论