Skip to content

Commit fd89814

Browse files
committed
initial commit
0 parents  commit fd89814

95 files changed

Lines changed: 3315 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Miscellaneous
2+
*.class
3+
*.log
4+
*.pyc
5+
*.swp
6+
.DS_Store
7+
.atom/
8+
.buildlog/
9+
.history
10+
.svn/
11+
migrate_working_dir/
12+
13+
# IntelliJ related
14+
*.iml
15+
*.ipr
16+
*.iws
17+
.idea/
18+
19+
# The .vscode folder contains launch configuration and tasks you configure in
20+
# VS Code which you may wish to be included in version control, so this line
21+
# is commented out by default.
22+
#.vscode/
23+
24+
# Flutter/Dart/Pub related
25+
# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock.
26+
/pubspec.lock
27+
**/doc/api/
28+
.dart_tool/
29+
build/

.metadata

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# This file tracks properties of this Flutter project.
2+
# Used by Flutter tool to assess capabilities and perform upgrades etc.
3+
#
4+
# This file should be version controlled and should not be manually edited.
5+
6+
version:
7+
revision: "ba393198430278b6595976de84fe170f553cc728"
8+
channel: "stable"
9+
10+
project_type: plugin
11+
12+
# Tracks metadata for the flutter migrate command
13+
migration:
14+
platforms:
15+
- platform: root
16+
create_revision: ba393198430278b6595976de84fe170f553cc728
17+
base_revision: ba393198430278b6595976de84fe170f553cc728
18+
- platform: android
19+
create_revision: ba393198430278b6595976de84fe170f553cc728
20+
base_revision: ba393198430278b6595976de84fe170f553cc728
21+
- platform: ios
22+
create_revision: ba393198430278b6595976de84fe170f553cc728
23+
base_revision: ba393198430278b6595976de84fe170f553cc728
24+
25+
# User provided section
26+
27+
# List of Local paths (relative to this file) that should be
28+
# ignored by the migrate tool.
29+
#
30+
# Files that are not part of the templates will be ignored by default.
31+
unmanaged_files:
32+
- 'lib/main.dart'
33+
- 'ios/Runner.xcodeproj/project.pbxproj'

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
## [1.0.0] - 2024-09-30
6+
7+
### Added
8+
- Initial release of the `screenshot_detection` package.
9+
- Screenshot detection on Android using native code.
10+
- Screenshot detection on iOS using Swift.
11+
- Flutter integration with a stream for listening to screenshot events.
12+
- Basic documentation and platform setup instructions for iOS and Android.
13+

LICENSE

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Copyright (c) 2024 SNCF CONNECT
2+
3+
All rights reserved.
4+
5+
This software and associated documentation files (the "Software") are intended solely for use by authorized individuals. Any unauthorized use, reproduction, modification, distribution, or sale of the Software, in whole or in part, is strictly prohibited.
6+
7+
The Software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, and non-infringement. In no event shall the authors or copyright holders be liable for any claim, damages, or other liability, whether in an action of contract, tort, or otherwise, arising from, out of, or in connection with the Software or the use or other dealings in the Software.
8+
9+
Authorized users must obtain permission from the copyright holder before redistributing the Software in any form.

README.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Screenshot Detection Package
2+
3+
This is a private Flutter package designed to detect screenshots taken on native Swift (iOS) and Android platforms and notify the Flutter layer.
4+
5+
## Features
6+
7+
- Detects screenshots on iOS (using Swift) and Android (using native code).
8+
- Provides screenshot detection information to Flutter for further handling.
9+
10+
## Installation
11+
12+
Add the package to your `pubspec.yaml` under `dependencies`:
13+
14+
```yaml
15+
dependencies:
16+
screenshot_detection:
17+
git:
18+
url: git@your_private_repository_url.git
19+
ref: main # Replace with the correct branch or tag
20+
```
21+
22+
Run flutter pub get to install the package.
23+
24+
# Usage
25+
26+
## Listen for Screenshot Events
27+
The package provides a stream that allows you to listen for screenshot events.
28+
29+
```dart
30+
ScreenshotDetector.instance.startListening.listen(() {
31+
// Handle screenshot event
32+
print("Screenshot detected!");
33+
});
34+
35+
```
36+
## Listen for Screenshot Events
37+
The package provides a stream that allows you to listen for screenshot events.
38+
39+
```dart
40+
ScreenShotDetectorWrapper(
41+
replaceChild: const Text('Screenshot Detected'),
42+
child: TextButton(
43+
onPressed: () => {},
44+
child: const Text(
45+
'Share',
46+
),
47+
),
48+
)
49+
```
50+
# Contributions
51+
This is a private package. Contributions are welcome only from authorized members.
52+
53+
# License
54+
This package is under a private license. Distribution or usage outside authorized channels is prohibited.

analysis_options.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
include: package:flutter_lints/flutter.yaml
2+
3+
# Additional information about this file can be found at
4+
# https://dart.dev/guides/language/analysis-options

android/.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
*.iml
2+
.gradle
3+
/local.properties
4+
/.idea/workspace.xml
5+
/.idea/libraries
6+
.DS_Store
7+
/build
8+
/captures
9+
.cxx

android/build.gradle

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
group 'sncf_connect.screenshot_detector'
2+
version '1.0-SNAPSHOT'
3+
4+
buildscript {
5+
ext.kotlin_version = '1.7.10'
6+
repositories {
7+
google()
8+
mavenCentral()
9+
}
10+
11+
dependencies {
12+
classpath 'com.android.tools.build:gradle:7.3.0'
13+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
14+
}
15+
}
16+
17+
allprojects {
18+
repositories {
19+
google()
20+
mavenCentral()
21+
}
22+
}
23+
24+
apply plugin: 'com.android.library'
25+
apply plugin: 'kotlin-android'
26+
27+
android {
28+
if (project.android.hasProperty("namespace")) {
29+
namespace 'sncf_connect.screenshot_detector'
30+
}
31+
32+
compileSdk 34
33+
34+
compileOptions {
35+
sourceCompatibility JavaVersion.VERSION_1_8
36+
targetCompatibility JavaVersion.VERSION_1_8
37+
}
38+
39+
kotlinOptions {
40+
jvmTarget = '1.8'
41+
}
42+
43+
sourceSets {
44+
main.java.srcDirs += 'src/main/kotlin'
45+
test.java.srcDirs += 'src/test/kotlin'
46+
}
47+
48+
defaultConfig {
49+
minSdkVersion 19
50+
}
51+
52+
dependencies {
53+
testImplementation 'org.jetbrains.kotlin:kotlin-test'
54+
testImplementation 'org.mockito:mockito-core:5.0.0'
55+
}
56+
57+
testOptions {
58+
unitTests.all {
59+
useJUnitPlatform()
60+
61+
testLogging {
62+
events "passed", "skipped", "failed", "standardOut", "standardError"
63+
outputs.upToDateWhen {false}
64+
showStandardStreams = true
65+
}
66+
}
67+
}
68+
}
59.3 KB
Binary file not shown.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
4+
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)