From 65e792535164aae7aeda1eac8527f8226f22f695 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaroslav=20Novotn=C3=BD?= <62177414+yardexx@users.noreply.github.com> Date: Tue, 25 Feb 2025 13:08:27 +0100 Subject: [PATCH 1/3] chore: raise version + CHANGELOG --- CHANGELOG.md | 10 ++++++++++ pubspec.yaml | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 90b818a..187ac7a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,16 @@ 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). +## [6.12.0] - 2025-02-25 + +- iOS SDK version: 6.8.0 +- Android SDK version: 14.0.1 + +### Flutter + +#### Fixed +- ARN issue when application launched when recording active + ## [6.12.0] - 2025-02-18 - iOS SDK version: 6.8.0 diff --git a/pubspec.yaml b/pubspec.yaml index b796de3..cdb1b95 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: freerasp description: Flutter library for improving app security and threat monitoring on Android and iOS mobile devices. Learn more about provided features on the freeRASP's homepage first. -version: 6.12.0 +version: 6.12.1 homepage: https://www.talsec.app/freerasp-in-app-protection-security-talsec repository: https://github.com/talsec/Free-RASP-Flutter From 30abe8910fb10c346a8fd88f005fd045b9816102 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaroslav=20Novotn=C3=BD?= <62177414+yardexx@users.noreply.github.com> Date: Tue, 25 Feb 2025 13:08:50 +0100 Subject: [PATCH 2/3] fix: detection when app launched during active recording --- .../main/kotlin/com/aheaditec/freerasp/FreeraspPlugin.kt | 3 +-- .../main/kotlin/com/aheaditec/freerasp/ScreenProtector.kt | 1 + .../com/aheaditec/freerasp/handlers/MethodCallHandler.kt | 7 +++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/android/src/main/kotlin/com/aheaditec/freerasp/FreeraspPlugin.kt b/android/src/main/kotlin/com/aheaditec/freerasp/FreeraspPlugin.kt index ae3effa..ef9c004 100644 --- a/android/src/main/kotlin/com/aheaditec/freerasp/FreeraspPlugin.kt +++ b/android/src/main/kotlin/com/aheaditec/freerasp/FreeraspPlugin.kt @@ -16,9 +16,9 @@ import io.flutter.embedding.engine.plugins.lifecycle.FlutterLifecycleAdapter /** FreeraspPlugin */ class FreeraspPlugin : FlutterPlugin, ActivityAware, LifecycleEventObserver { private var streamHandler: StreamHandler = StreamHandler() - private var methodCallHandler: MethodCallHandler = MethodCallHandler() private var screenProtector: ScreenProtector? = if (Build.VERSION.SDK_INT >= 34) ScreenProtector() else null + private var methodCallHandler: MethodCallHandler = MethodCallHandler(screenProtector) private var context: Context? = null private var lifecycle: Lifecycle? = null @@ -26,7 +26,6 @@ class FreeraspPlugin : FlutterPlugin, ActivityAware, LifecycleEventObserver { override fun onAttachedToEngine(flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) { val messenger = flutterPluginBinding.binaryMessenger context = flutterPluginBinding.applicationContext - screenProtector?.enable() methodCallHandler.createMethodChannel(messenger, flutterPluginBinding.applicationContext) streamHandler.createEventChannel(messenger) } diff --git a/android/src/main/kotlin/com/aheaditec/freerasp/ScreenProtector.kt b/android/src/main/kotlin/com/aheaditec/freerasp/ScreenProtector.kt index 51759e7..a9e417a 100644 --- a/android/src/main/kotlin/com/aheaditec/freerasp/ScreenProtector.kt +++ b/android/src/main/kotlin/com/aheaditec/freerasp/ScreenProtector.kt @@ -36,6 +36,7 @@ internal class ScreenProtector : DefaultLifecycleObserver { internal fun enable() { if (isEnabled) return isEnabled = true + activity?.let { register(it) } } override fun onStart(owner: LifecycleOwner) { diff --git a/android/src/main/kotlin/com/aheaditec/freerasp/handlers/MethodCallHandler.kt b/android/src/main/kotlin/com/aheaditec/freerasp/handlers/MethodCallHandler.kt index 408d087..139c764 100644 --- a/android/src/main/kotlin/com/aheaditec/freerasp/handlers/MethodCallHandler.kt +++ b/android/src/main/kotlin/com/aheaditec/freerasp/handlers/MethodCallHandler.kt @@ -8,9 +8,10 @@ import android.os.Looper import androidx.lifecycle.Lifecycle import androidx.lifecycle.LifecycleEventObserver import androidx.lifecycle.LifecycleOwner -import com.aheaditec.freerasp.runResultCatching +import com.aheaditec.freerasp.ScreenProtector import com.aheaditec.freerasp.Utils import com.aheaditec.freerasp.generated.TalsecPigeonApi +import com.aheaditec.freerasp.runResultCatching import com.aheaditec.freerasp.toPigeon import com.aheaditec.talsec_security.security.api.SuspiciousAppInfo import com.aheaditec.talsec_security.security.api.Talsec @@ -23,7 +24,8 @@ import io.flutter.plugin.common.MethodChannel.MethodCallHandler /** * A method handler that creates and manages an [MethodChannel] for freeRASP methods. */ -internal class MethodCallHandler : MethodCallHandler, LifecycleEventObserver { +internal class MethodCallHandler(private val screenProtector: ScreenProtector?) : MethodCallHandler, + LifecycleEventObserver { private var context: Context? = null private var methodChannel: MethodChannel? = null private var pigeonApi: TalsecPigeonApi? = null @@ -137,6 +139,7 @@ internal class MethodCallHandler : MethodCallHandler, LifecycleEventObserver { val talsecConfig = Utils.toTalsecConfigThrowing(config) context?.let { TalsecThreatHandler.start(it, talsecConfig) + screenProtector?.enable() } ?: throw IllegalStateException("Unable to run Talsec - context is null") result.success(null) } From 5aeed27e6823efe78ad3a473ea06153daa7c513f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaroslav=20Novotn=C3=BD?= <62177414+yardexx@users.noreply.github.com> Date: Tue, 4 Mar 2025 10:56:57 +0100 Subject: [PATCH 3/3] fix: detection when app launched during active recording --- CHANGELOG.md | 2 +- pubspec.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 187ac7a..571bb05 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ 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). -## [6.12.0] - 2025-02-25 +## [6.13.0] - 2025-03-04 - iOS SDK version: 6.8.0 - Android SDK version: 14.0.1 diff --git a/pubspec.yaml b/pubspec.yaml index cdb1b95..56bf87d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: freerasp description: Flutter library for improving app security and threat monitoring on Android and iOS mobile devices. Learn more about provided features on the freeRASP's homepage first. -version: 6.12.1 +version: 6.13.0 homepage: https://www.talsec.app/freerasp-in-app-protection-security-talsec repository: https://github.com/talsec/Free-RASP-Flutter