Skip to content

Commit f7feaf0

Browse files
authored
chore: update activity in android, release 4.2.2 (#118)
1 parent 896c236 commit f7feaf0

File tree

3 files changed

+19
-5
lines changed

3 files changed

+19
-5
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,22 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [4.2.2] - 2025-08-21
9+
10+
- iOS SDK version: 6.12.1
11+
- Android SDK version: 16.0.1
12+
13+
### React Native
14+
15+
#### Changed
16+
17+
- Replaced deprecated `getCurrentActivity()` call on Android (compatibility with RN 0.81+)
18+
819
## [4.2.1] - 2025-08-05
920

21+
- iOS SDK version: 6.12.1
22+
- Android SDK version: 16.0.1
23+
1024
### React Native
1125

1226
#### Fixed

android/src/main/java/com/freeraspreactnative/FreeraspReactNativeModule.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ class FreeraspReactNativeModule(private val reactContext: ReactApplicationContex
3333
private val lifecycleListener = object : LifecycleEventListener {
3434
override fun onHostResume() {
3535
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
36-
currentActivity?.let { ScreenProtector.register(it) }
36+
reactContext.currentActivity?.let { ScreenProtector.register(it) }
3737
}
3838
}
3939

4040
override fun onHostPause() {
4141
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
42-
currentActivity?.let { ScreenProtector.unregister(it) }
42+
reactContext.currentActivity?.let { ScreenProtector.unregister(it) }
4343
}
4444
}
4545

@@ -71,7 +71,7 @@ class FreeraspReactNativeModule(private val reactContext: ReactApplicationContex
7171
mainHandler.post {
7272
talsecStarted = true
7373
// This code must be called only AFTER Talsec.start
74-
currentActivity?.let { activity ->
74+
reactContext.currentActivity?.let { activity ->
7575
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
7676
ScreenProtector.register(activity)
7777
}
@@ -154,7 +154,7 @@ class FreeraspReactNativeModule(private val reactContext: ReactApplicationContex
154154
*/
155155
@ReactMethod
156156
fun blockScreenCapture(enable: Boolean, promise: Promise) {
157-
val activity = currentActivity ?: run {
157+
val activity = reactContext.currentActivity ?: run {
158158
promise.reject(
159159
"NativePluginError", "Cannot block screen capture, activity is null."
160160
)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "freerasp-react-native",
3-
"version": "4.2.1",
3+
"version": "4.2.2",
44
"description": "React Native plugin for improving app security and threat monitoring on Android and iOS mobile devices.",
55
"main": "lib/commonjs/index",
66
"module": "lib/module/index",

0 commit comments

Comments
 (0)