react-native-frame-capture 1.0.1 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/FrameCapture.podspec +21 -21
- package/LICENSE +20 -20
- package/README.md +159 -158
- package/android/build.gradle +77 -77
- package/android/gradle.properties +5 -5
- package/android/src/main/AndroidManifest.xml +20 -20
- package/android/src/main/java/com/framecapture/CaptureManager.kt +1013 -831
- package/android/src/main/java/com/framecapture/Constants.kt +205 -196
- package/android/src/main/java/com/framecapture/ErrorHandler.kt +165 -165
- package/android/src/main/java/com/framecapture/FrameCaptureModule.kt +653 -653
- package/android/src/main/java/com/framecapture/OverlayRenderer.kt +423 -423
- package/android/src/main/java/com/framecapture/PermissionHandler.kt +150 -150
- package/android/src/main/java/com/framecapture/ScreenCaptureService.kt +366 -366
- package/android/src/main/java/com/framecapture/StorageManager.kt +221 -221
- package/android/src/main/java/com/framecapture/capture/BitmapProcessor.kt +157 -157
- package/android/src/main/java/com/framecapture/capture/CaptureEventEmitter.kt +150 -120
- package/android/src/main/java/com/framecapture/capture/ChangeDetector.kt +191 -0
- package/android/src/main/java/com/framecapture/models/CaptureModels.kt +343 -302
- package/android/src/main/java/com/framecapture/models/EnumsAndExtensions.kt +67 -60
- package/android/src/main/java/com/framecapture/models/OverlayModels.kt +154 -154
- package/android/src/main/java/com/framecapture/service/CaptureNotificationManager.kt +286 -286
- package/android/src/main/java/com/framecapture/storage/StorageStrategies.kt +317 -317
- package/android/src/main/java/com/framecapture/utils/ValidationUtils.kt +379 -379
- package/ios/FrameCapture.h +5 -5
- package/ios/FrameCapture.mm +21 -21
- package/lib/module/NativeFrameCapture.js.map +1 -1
- package/lib/module/constants.js +45 -0
- package/lib/module/constants.js.map +1 -1
- package/lib/module/normalize.js +10 -1
- package/lib/module/normalize.js.map +1 -1
- package/lib/module/types.js +9 -0
- package/lib/module/types.js.map +1 -1
- package/lib/module/validation.js +86 -9
- package/lib/module/validation.js.map +1 -1
- package/lib/typescript/src/NativeFrameCapture.d.ts +7 -0
- package/lib/typescript/src/NativeFrameCapture.d.ts.map +1 -1
- package/lib/typescript/src/constants.d.ts +33 -0
- package/lib/typescript/src/constants.d.ts.map +1 -1
- package/lib/typescript/src/normalize.d.ts +8 -2
- package/lib/typescript/src/normalize.d.ts.map +1 -1
- package/lib/typescript/src/types.d.ts +29 -5
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/lib/typescript/src/validation.d.ts.map +1 -1
- package/package.json +199 -196
- package/src/NativeFrameCapture.ts +8 -0
- package/src/constants.ts +45 -0
- package/src/normalize.ts +23 -3
- package/src/types.ts +30 -2
- package/src/validation.ts +132 -13
- package/plugin/build/index.js +0 -48
package/FrameCapture.podspec
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
require "json"
|
|
2
|
-
|
|
3
|
-
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
|
|
4
|
-
|
|
5
|
-
Pod::Spec.new do |s|
|
|
6
|
-
s.name = "FrameCapture"
|
|
7
|
-
s.version = package["version"]
|
|
8
|
-
s.summary = package["description"]
|
|
9
|
-
s.homepage = package["homepage"]
|
|
10
|
-
s.license = package["license"]
|
|
11
|
-
s.authors = package["author"]
|
|
12
|
-
|
|
13
|
-
s.platforms = { :ios => min_ios_version_supported }
|
|
14
|
-
s.source = { :git => "https://github.com/nasyx-rakeeb/react-native-frame-capture.git", :tag => "#{s.version}" }
|
|
15
|
-
|
|
16
|
-
s.source_files = "ios/**/*.{h,m,mm,cpp}"
|
|
17
|
-
s.private_header_files = "ios/**/*.h"
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
install_modules_dependencies(s)
|
|
21
|
-
end
|
|
1
|
+
require "json"
|
|
2
|
+
|
|
3
|
+
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
|
|
4
|
+
|
|
5
|
+
Pod::Spec.new do |s|
|
|
6
|
+
s.name = "FrameCapture"
|
|
7
|
+
s.version = package["version"]
|
|
8
|
+
s.summary = package["description"]
|
|
9
|
+
s.homepage = package["homepage"]
|
|
10
|
+
s.license = package["license"]
|
|
11
|
+
s.authors = package["author"]
|
|
12
|
+
|
|
13
|
+
s.platforms = { :ios => min_ios_version_supported }
|
|
14
|
+
s.source = { :git => "https://github.com/nasyx-rakeeb/react-native-frame-capture.git", :tag => "#{s.version}" }
|
|
15
|
+
|
|
16
|
+
s.source_files = "ios/**/*.{h,m,mm,cpp}"
|
|
17
|
+
s.private_header_files = "ios/**/*.h"
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
install_modules_dependencies(s)
|
|
21
|
+
end
|
package/LICENSE
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 Nasyx Rakeeb
|
|
4
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
6
|
-
in the Software without restriction, including without limitation the rights
|
|
7
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
9
|
-
furnished to do so, subject to the following conditions:
|
|
10
|
-
|
|
11
|
-
The above copyright notice and this permission notice shall be included in all
|
|
12
|
-
copies or substantial portions of the Software.
|
|
13
|
-
|
|
14
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
17
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
19
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Nasyx Rakeeb
|
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
6
|
+
in the Software without restriction, including without limitation the rights
|
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
9
|
+
furnished to do so, subject to the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be included in all
|
|
12
|
+
copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
17
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
19
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,158 +1,159 @@
|
|
|
1
|
-
# React Native Frame Capture
|
|
2
|
-
|
|
3
|
-
[](https://www.npmjs.com/package/react-native-frame-capture)
|
|
4
|
-
[](https://www.npmjs.com/package/react-native-frame-capture)
|
|
5
|
-
[](https://github.com/nasyx-rakeeb/react-native-frame-capture/blob/main/LICENSE)
|
|
6
|
-
[](https://www.android.com/)
|
|
7
|
-
|
|
8
|
-
Reliable screen capture for React Native Android. Capture frames at intervals with customizable overlays and storage options.
|
|
9
|
-
|
|
10
|
-
## Features
|
|
11
|
-
|
|
12
|
-
- 📸 **Interval-based capture** - Capture frames at configurable intervals (100ms - 60s)
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
- **
|
|
39
|
-
- **
|
|
40
|
-
- **
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
-
|
|
48
|
-
- Android
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
npx expo
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
import
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
- **[
|
|
131
|
-
- **[
|
|
132
|
-
- **[
|
|
133
|
-
- **[
|
|
134
|
-
- **[
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
|
140
|
-
|
|
|
141
|
-
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
- **
|
|
147
|
-
- **
|
|
148
|
-
- **
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
1
|
+
# React Native Frame Capture
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/react-native-frame-capture)
|
|
4
|
+
[](https://www.npmjs.com/package/react-native-frame-capture)
|
|
5
|
+
[](https://github.com/nasyx-rakeeb/react-native-frame-capture/blob/main/LICENSE)
|
|
6
|
+
[](https://www.android.com/)
|
|
7
|
+
|
|
8
|
+
Reliable screen capture for React Native Android. Capture frames at intervals or when screen content changes, with customizable overlays and storage options.
|
|
9
|
+
|
|
10
|
+
## Features
|
|
11
|
+
|
|
12
|
+
- 📸 **Interval-based capture** - Capture frames at configurable intervals (100ms - 60s)
|
|
13
|
+
- 🔍 **Change detection mode** - Capture only when screen content changes (NEW!)
|
|
14
|
+
- 🎨 **Customizable overlays** - Add text and image overlays with template variables
|
|
15
|
+
- 💾 **Flexible storage** - Save to app-specific, public, or custom directories
|
|
16
|
+
- 🔄 **Background capture** - Continues capturing when app is minimized (foreground service)
|
|
17
|
+
- ⚡ **High performance** - Built with Kotlin and TurboModule architecture
|
|
18
|
+
- 🎯 **Precise control** - Pause, resume, and stop capture on demand
|
|
19
|
+
- 📊 **Real-time events** - Get notified for every captured frame
|
|
20
|
+
- 🔧 **Highly configurable** - Image quality, format, resolution scaling, and more
|
|
21
|
+
- 📱 **Expo compatible** - Works with Expo through config plugin
|
|
22
|
+
- 🎭 **Custom regions** - Capture specific screen areas
|
|
23
|
+
- 🚫 **Status bar exclusion** - Optionally exclude status bar from captures
|
|
24
|
+
|
|
25
|
+
## How It Works
|
|
26
|
+
|
|
27
|
+
React Native Frame Capture uses Android's **MediaProjection API** to capture screen content at regular intervals. Here's the flow:
|
|
28
|
+
|
|
29
|
+
1. **Request Permission** - User grants screen capture permission via system dialog
|
|
30
|
+
2. **Start Foreground Service** - Ensures capture continues in background
|
|
31
|
+
3. **Create Virtual Display** - Mirrors screen content to an ImageReader
|
|
32
|
+
4. **Capture Frames** - Grabs frames at your specified interval (e.g., every 1 second)
|
|
33
|
+
5. **Process & Save** - Converts to bitmap, applies overlays, saves to storage
|
|
34
|
+
6. **Emit Events** - Notifies your app with frame info (path, size, timestamp)
|
|
35
|
+
|
|
36
|
+
**Key Components:**
|
|
37
|
+
|
|
38
|
+
- **MediaProjection** - Android API for screen capture (no root required)
|
|
39
|
+
- **Foreground Service** - Keeps capture running when app is minimized
|
|
40
|
+
- **ImageReader** - Efficiently captures screen pixels
|
|
41
|
+
- **TurboModule** - Fast native-to-JS communication
|
|
42
|
+
|
|
43
|
+
**Why Foreground Service?** Android kills background processes aggressively. The foreground service (with notification) ensures reliable capture even when your app isn't visible.
|
|
44
|
+
|
|
45
|
+
## Requirements
|
|
46
|
+
|
|
47
|
+
- React Native >= 0.74
|
|
48
|
+
- Android minSdkVersion >= 21 (Android 5.0)
|
|
49
|
+
- Android compileSdkVersion >= 34
|
|
50
|
+
|
|
51
|
+
## Installation
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
npm install react-native-frame-capture
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
or
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
yarn add react-native-frame-capture
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Expo
|
|
64
|
+
|
|
65
|
+
Add the config plugin to your `app.json` or `app.config.js`:
|
|
66
|
+
|
|
67
|
+
```json
|
|
68
|
+
{
|
|
69
|
+
"expo": {
|
|
70
|
+
"plugins": ["react-native-frame-capture"]
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Then rebuild your app:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
npx expo prebuild
|
|
79
|
+
npx expo run:android
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Quick Start
|
|
83
|
+
|
|
84
|
+
```typescript
|
|
85
|
+
import * as FrameCapture from 'react-native-frame-capture';
|
|
86
|
+
import { Platform, PermissionsAndroid } from 'react-native';
|
|
87
|
+
|
|
88
|
+
// 1. Request notification permission (Android 13+)
|
|
89
|
+
if (Platform.OS === 'android' && Platform.Version >= 33) {
|
|
90
|
+
await PermissionsAndroid.request(
|
|
91
|
+
PermissionsAndroid.PERMISSIONS.POST_NOTIFICATIONS
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// 2. Request screen capture permission
|
|
96
|
+
const permissionStatus = await FrameCapture.requestPermission();
|
|
97
|
+
|
|
98
|
+
if (permissionStatus === FrameCapture.PermissionStatus.GRANTED) {
|
|
99
|
+
// 3. Start capturing
|
|
100
|
+
await FrameCapture.startCapture({
|
|
101
|
+
capture: {
|
|
102
|
+
interval: 1000, // Capture every second
|
|
103
|
+
},
|
|
104
|
+
image: {
|
|
105
|
+
quality: 80,
|
|
106
|
+
format: 'jpeg',
|
|
107
|
+
},
|
|
108
|
+
storage: {
|
|
109
|
+
saveFrames: true,
|
|
110
|
+
location: 'private',
|
|
111
|
+
},
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
// 4. Listen for captured frames
|
|
115
|
+
const subscription = FrameCapture.addListener(
|
|
116
|
+
FrameCapture.CaptureEventType.FRAME_CAPTURED,
|
|
117
|
+
(event) => {
|
|
118
|
+
console.log('Frame captured:', event.filePath);
|
|
119
|
+
}
|
|
120
|
+
);
|
|
121
|
+
|
|
122
|
+
// 5. Stop capturing when done
|
|
123
|
+
await FrameCapture.stopCapture();
|
|
124
|
+
subscription.remove();
|
|
125
|
+
}
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## Documentation
|
|
129
|
+
|
|
130
|
+
- **[API Reference](docs/api-reference.md)** - Complete API documentation
|
|
131
|
+
- **[Configuration](docs/configuration.md)** - Configuration options and interfaces
|
|
132
|
+
- **[Events](docs/events.md)** - Event types and handling
|
|
133
|
+
- **[Usage Examples](docs/usage-examples.md)** - Practical examples for common use cases
|
|
134
|
+
- **[Storage](docs/storage.md)** - Storage behavior and options
|
|
135
|
+
- **[Permissions](docs/permissions.md)** - Permission requirements and setup
|
|
136
|
+
|
|
137
|
+
## Platform Support
|
|
138
|
+
|
|
139
|
+
| Platform | Supported | Version |
|
|
140
|
+
| -------- | --------- | ------- |
|
|
141
|
+
| Android | ✅ Yes | 5.0+ |
|
|
142
|
+
| iOS | ❌ No | N/A |
|
|
143
|
+
|
|
144
|
+
## Architecture
|
|
145
|
+
|
|
146
|
+
- **TurboModule:** New Architecture compatible
|
|
147
|
+
- **Foreground Service:** Reliable background capture
|
|
148
|
+
- **Kotlin:** Native Android implementation
|
|
149
|
+
- **TypeScript:** Type-safe JavaScript API
|
|
150
|
+
|
|
151
|
+
## Contributing
|
|
152
|
+
|
|
153
|
+
See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.
|
|
154
|
+
|
|
155
|
+
## License
|
|
156
|
+
|
|
157
|
+
MIT © [Nasyx Rakeeb](https://github.com/nasyx-rakeeb)
|
|
158
|
+
|
|
159
|
+
Made with ❤️ using [create-react-native-library](https://github.com/callstack/react-native-builder-bob)
|
package/android/build.gradle
CHANGED
|
@@ -1,77 +1,77 @@
|
|
|
1
|
-
buildscript {
|
|
2
|
-
ext.getExtOrDefault = {name ->
|
|
3
|
-
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['FrameCapture_' + name]
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
repositories {
|
|
7
|
-
google()
|
|
8
|
-
mavenCentral()
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
dependencies {
|
|
12
|
-
classpath "com.android.tools.build:gradle:8.7.2"
|
|
13
|
-
// noinspection DifferentKotlinGradleVersion
|
|
14
|
-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${getExtOrDefault('kotlinVersion')}"
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
apply plugin: "com.android.library"
|
|
20
|
-
apply plugin: "kotlin-android"
|
|
21
|
-
|
|
22
|
-
apply plugin: "com.facebook.react"
|
|
23
|
-
|
|
24
|
-
def getExtOrIntegerDefault(name) {
|
|
25
|
-
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["FrameCapture_" + name]).toInteger()
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
android {
|
|
29
|
-
namespace "com.framecapture"
|
|
30
|
-
|
|
31
|
-
compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
|
|
32
|
-
|
|
33
|
-
defaultConfig {
|
|
34
|
-
minSdkVersion getExtOrIntegerDefault("minSdkVersion")
|
|
35
|
-
targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
buildFeatures {
|
|
39
|
-
buildConfig true
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
buildTypes {
|
|
43
|
-
release {
|
|
44
|
-
minifyEnabled false
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
lintOptions {
|
|
49
|
-
disable "GradleCompatible"
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
compileOptions {
|
|
53
|
-
sourceCompatibility JavaVersion.VERSION_1_8
|
|
54
|
-
targetCompatibility JavaVersion.VERSION_1_8
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
sourceSets {
|
|
58
|
-
main {
|
|
59
|
-
java.srcDirs += [
|
|
60
|
-
"generated/java",
|
|
61
|
-
"generated/jni"
|
|
62
|
-
]
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
repositories {
|
|
68
|
-
mavenCentral()
|
|
69
|
-
google()
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
def kotlin_version = getExtOrDefault("kotlinVersion")
|
|
73
|
-
|
|
74
|
-
dependencies {
|
|
75
|
-
implementation "com.facebook.react:react-android"
|
|
76
|
-
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
77
|
-
}
|
|
1
|
+
buildscript {
|
|
2
|
+
ext.getExtOrDefault = {name ->
|
|
3
|
+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['FrameCapture_' + name]
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
repositories {
|
|
7
|
+
google()
|
|
8
|
+
mavenCentral()
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
dependencies {
|
|
12
|
+
classpath "com.android.tools.build:gradle:8.7.2"
|
|
13
|
+
// noinspection DifferentKotlinGradleVersion
|
|
14
|
+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${getExtOrDefault('kotlinVersion')}"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
apply plugin: "com.android.library"
|
|
20
|
+
apply plugin: "kotlin-android"
|
|
21
|
+
|
|
22
|
+
apply plugin: "com.facebook.react"
|
|
23
|
+
|
|
24
|
+
def getExtOrIntegerDefault(name) {
|
|
25
|
+
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["FrameCapture_" + name]).toInteger()
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
android {
|
|
29
|
+
namespace "com.framecapture"
|
|
30
|
+
|
|
31
|
+
compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
|
|
32
|
+
|
|
33
|
+
defaultConfig {
|
|
34
|
+
minSdkVersion getExtOrIntegerDefault("minSdkVersion")
|
|
35
|
+
targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
buildFeatures {
|
|
39
|
+
buildConfig true
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
buildTypes {
|
|
43
|
+
release {
|
|
44
|
+
minifyEnabled false
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
lintOptions {
|
|
49
|
+
disable "GradleCompatible"
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
compileOptions {
|
|
53
|
+
sourceCompatibility JavaVersion.VERSION_1_8
|
|
54
|
+
targetCompatibility JavaVersion.VERSION_1_8
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
sourceSets {
|
|
58
|
+
main {
|
|
59
|
+
java.srcDirs += [
|
|
60
|
+
"generated/java",
|
|
61
|
+
"generated/jni"
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
repositories {
|
|
68
|
+
mavenCentral()
|
|
69
|
+
google()
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
def kotlin_version = getExtOrDefault("kotlinVersion")
|
|
73
|
+
|
|
74
|
+
dependencies {
|
|
75
|
+
implementation "com.facebook.react:react-android"
|
|
76
|
+
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
77
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
FrameCapture_kotlinVersion=2.0.21
|
|
2
|
-
FrameCapture_minSdkVersion=24
|
|
3
|
-
FrameCapture_targetSdkVersion=34
|
|
4
|
-
FrameCapture_compileSdkVersion=35
|
|
5
|
-
FrameCapture_ndkVersion=27.1.12297006
|
|
1
|
+
FrameCapture_kotlinVersion=2.0.21
|
|
2
|
+
FrameCapture_minSdkVersion=24
|
|
3
|
+
FrameCapture_targetSdkVersion=34
|
|
4
|
+
FrameCapture_compileSdkVersion=35
|
|
5
|
+
FrameCapture_ndkVersion=27.1.12297006
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
|
2
|
-
<!-- Foreground service permissions -->
|
|
3
|
-
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
|
4
|
-
<uses-permission
|
|
5
|
-
android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PROJECTION"
|
|
6
|
-
android:minSdkVersion="34" />
|
|
7
|
-
|
|
8
|
-
<!-- Notification permission for API 33+ -->
|
|
9
|
-
<uses-permission
|
|
10
|
-
android:name="android.permission.POST_NOTIFICATIONS"
|
|
11
|
-
android:minSdkVersion="33" />
|
|
12
|
-
|
|
13
|
-
<application>
|
|
14
|
-
<!-- Screen Capture Foreground Service -->
|
|
15
|
-
<service
|
|
16
|
-
android:name="com.framecapture.ScreenCaptureService"
|
|
17
|
-
android:exported="false"
|
|
18
|
-
android:foregroundServiceType="mediaProjection" />
|
|
19
|
-
</application>
|
|
20
|
-
</manifest>
|
|
1
|
+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
|
2
|
+
<!-- Foreground service permissions -->
|
|
3
|
+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
|
4
|
+
<uses-permission
|
|
5
|
+
android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PROJECTION"
|
|
6
|
+
android:minSdkVersion="34" />
|
|
7
|
+
|
|
8
|
+
<!-- Notification permission for API 33+ -->
|
|
9
|
+
<uses-permission
|
|
10
|
+
android:name="android.permission.POST_NOTIFICATIONS"
|
|
11
|
+
android:minSdkVersion="33" />
|
|
12
|
+
|
|
13
|
+
<application>
|
|
14
|
+
<!-- Screen Capture Foreground Service -->
|
|
15
|
+
<service
|
|
16
|
+
android:name="com.framecapture.ScreenCaptureService"
|
|
17
|
+
android:exported="false"
|
|
18
|
+
android:foregroundServiceType="mediaProjection" />
|
|
19
|
+
</application>
|
|
20
|
+
</manifest>
|