Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,22 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [4.2.2] - 2025-08-21

- iOS SDK version: 6.12.1
- Android SDK version: 16.0.1

### React Native

#### Changed

- Replaced deprecated `getCurrentActivity()` call on Android (compatibility with RN 0.81+)

## [4.2.1] - 2025-08-05

- iOS SDK version: 6.12.1
- Android SDK version: 16.0.1

### React Native

#### Fixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ class FreeraspReactNativeModule(private val reactContext: ReactApplicationContex
private val lifecycleListener = object : LifecycleEventListener {
override fun onHostResume() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
currentActivity?.let { ScreenProtector.register(it) }
reactContext.currentActivity?.let { ScreenProtector.register(it) }
}
}

override fun onHostPause() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
currentActivity?.let { ScreenProtector.unregister(it) }
reactContext.currentActivity?.let { ScreenProtector.unregister(it) }
}
}

Expand Down Expand Up @@ -71,7 +71,7 @@ class FreeraspReactNativeModule(private val reactContext: ReactApplicationContex
mainHandler.post {
talsecStarted = true
// This code must be called only AFTER Talsec.start
currentActivity?.let { activity ->
reactContext.currentActivity?.let { activity ->
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
ScreenProtector.register(activity)
}
Expand Down Expand Up @@ -154,7 +154,7 @@ class FreeraspReactNativeModule(private val reactContext: ReactApplicationContex
*/
@ReactMethod
fun blockScreenCapture(enable: Boolean, promise: Promise) {
val activity = currentActivity ?: run {
val activity = reactContext.currentActivity ?: run {
promise.reject(
"NativePluginError", "Cannot block screen capture, activity is null."
)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "freerasp-react-native",
"version": "4.2.1",
"version": "4.2.2",
"description": "React Native plugin for improving app security and threat monitoring on Android and iOS mobile devices.",
"main": "lib/commonjs/index",
"module": "lib/module/index",
Expand Down
Loading