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
33 changes: 33 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,39 @@ 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).

## [9.1.0] - 2026-11-20

- Android SDK version: 20.0.1
- iOS SDK version: 9.0.0

### Flutter

#### Changed

- `RaspExecutionStateCallback.onCriticalChecksFinished` and `RaspExecutionStateCallback.onPostponedChecksFinished`, with matching `RaspExecutionState` values, are now also triggered on iOS
- On iOS, `onFastChecksFinished` is triggered when the fast checks are completed, while the postponed checks may still run, the same as on Android

### iOS

#### Added

- Improved app integrity detection.

#### Changed

- Improved jailbreak detection.
- Updated CA bundle.
- Updated `OpenSSL` dependency to `3.5.8`.
- Updated `curl` dependency to `8.22.0`.
- Reduced the SDK size.

#### Fixed

- Fixed crash in frida port scanning.
- Fixed stack overflow crash when `blockScreenCapture` is enabled.
- Fixed missing app integrity detection details in logs for builds with a provisioning profile.
- Fixed placement of app integrity certificate details in logs.

## [9.0.0] - 2026-11-11

- Android SDK version: 20.0.1
Expand Down
20 changes: 12 additions & 8 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -226,17 +226,21 @@ class _HomePageState extends ConsumerState<HomePage> {
),
],
ListTile(
title: const Text('Check Rounds Completed'),
title: const Text('Critical Checks Completed'),
trailing: SafetyIcon(
isDetected: !threatState.criticalChecksPassed,
),
),
ListTile(
title: const Text('Fast Checks Completed'),
trailing: SafetyIcon(isDetected: !threatState.allChecksPassed),
),
if (Platform.isAndroid) ...[
ListTile(
title: const Text('Postponed Checks Completed'),
trailing: SafetyIcon(
isDetected: !threatState.postponedChecksPassed,
),
ListTile(
title: const Text('Postponed Checks Completed'),
trailing: SafetyIcon(
isDetected: !threatState.postponedChecksPassed,
),
],
),
Expanded(
child: ThreatListView(
threats: threatState.detectedThreats,
Expand Down
5 changes: 5 additions & 0 deletions example/lib/threat_notifier.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class ThreatNotifier extends AutoDisposeNotifier<ThreatState> {
);

final raspExecutionStateCallback = RaspExecutionStateCallback(
onCriticalChecksFinished: _updateCriticalChecksStatus,
onFastChecksFinished: _updateChecksStatus,
onPostponedChecksFinished: _updatePostponedChecksStatus,
);
Expand All @@ -56,6 +57,10 @@ class ThreatNotifier extends AutoDisposeNotifier<ThreatState> {
state = state.copyWith(detectedMalware: malware);
}

void _updateCriticalChecksStatus() {
state = state.copyWith(criticalChecksPassed: true);
}

void _updateChecksStatus() {
state = state.copyWith(allChecksPassed: true);
}
Expand Down
5 changes: 5 additions & 0 deletions example/lib/threat_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ class ThreatState {
factory ThreatState.initial() => const ThreatState._(
detectedThreats: {},
detectedMalware: [],
criticalChecksPassed: false,
allChecksPassed: false,
postponedChecksPassed: false,
callState: null,
Expand All @@ -14,20 +15,23 @@ class ThreatState {
const ThreatState._({
required this.detectedThreats,
required this.detectedMalware,
required this.criticalChecksPassed,
required this.allChecksPassed,
required this.postponedChecksPassed,
required this.callState,
});

final Set<Threat> detectedThreats;
final List<SuspiciousAppInfo> detectedMalware;
final bool criticalChecksPassed;
final bool allChecksPassed;
final bool postponedChecksPassed;
final CallState? callState;

ThreatState copyWith({
Set<Threat>? detectedThreats,
List<SuspiciousAppInfo>? detectedMalware,
bool? criticalChecksPassed,
bool? allChecksPassed,
bool? postponedChecksPassed,
CallState? callState,
Expand All @@ -36,6 +40,7 @@ class ThreatState {
detectedThreats: detectedThreats ?? this.detectedThreats,
detectedMalware:
detectedMalware?.nonNulls.toList() ?? this.detectedMalware,
criticalChecksPassed: criticalChecksPassed ?? this.criticalChecksPassed,
allChecksPassed: allChecksPassed ?? this.allChecksPassed,
postponedChecksPassed:
postponedChecksPassed ?? this.postponedChecksPassed,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import Foundation

class ExecutionStateDispatcher {
static let shared = ExecutionStateDispatcher()
private var cache: Set<RaspExecutionStates> = []
// Ordered, so a listener attached late still receives the states in the order they occurred
private var cache: [RaspExecutionStates] = []
private let lock = NSLock()

var listener: ((RaspExecutionStates) -> Void)? {
Expand All @@ -19,8 +20,8 @@ class ExecutionStateDispatcher {

if let listener = listener {
listener(event)
} else {
cache.insert(event)
} else if !cache.contains(event) {
cache.append(event)
}
}

Expand Down
2 changes: 2 additions & 0 deletions ios/freerasp/Sources/Models/RaspExecutionStates.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
enum RaspExecutionStates: Int {
case fastChecksFinished = 187429
case criticalChecksFinished = 614702
case postponedChecksFinished = 952318
}
12 changes: 8 additions & 4 deletions ios/freerasp/Sources/SwiftFreeraspPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -137,22 +137,26 @@ public class SwiftFreeraspPlugin: NSObject, FlutterPlugin, FlutterStreamHandler
}
}

/// Stores the external ID in user defaults.
/// Stores the external ID through the Talsec SDK. A missing value removes it.
///
/// - Parameters:
/// - data: The data to be stored.
/// - result: The `FlutterResult` object to be returned to the caller.
private func storeExternalId(data: String?, result: @escaping FlutterResult){
UserDefaults.standard.set(data, forKey: "app.talsec.externalid")
if let data = data {
Talsec.storeExternalId(externalId: data)
} else {
Talsec.removeExternalId()
}
result(nil)
}

/// Removes the external ID from user defaults.
/// Removes the external ID through the Talsec SDK.
///
/// - Parameters:
/// - result: The `FlutterResult` object to be returned to the caller.
private func removeExternalId(result: @escaping FlutterResult){
UserDefaults.standard.removeObject(forKey: "app.talsec.externalid")
Talsec.removeExternalId()
result(nil)
}

Expand Down
11 changes: 9 additions & 2 deletions ios/freerasp/Sources/TalsecHandlers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,17 @@ extension SecurityThreatCenter: SecurityThreatHandler, TalsecRuntime.RaspExecuti
ThreatDispatcher.shared.dispatch(threat: securityThreat)
}

// The iOS SDK reports its standard checks as a single "all checks" event, which maps to fastChecksFinished.
public func onAllChecksFinished() {
public func onCriticalChecksFinished() {
ExecutionStateDispatcher.shared.dispatch(event: .criticalChecksFinished)
}

public func onFastChecksFinished() {
ExecutionStateDispatcher.shared.dispatch(event: .fastChecksFinished)
}

public func onPostponedChecksFinished() {
ExecutionStateDispatcher.shared.dispatch(event: .postponedChecksFinished)
}
}

/// An extension to unify callback names with Flutter ones.
Expand Down
10 changes: 5 additions & 5 deletions ios/freerasp/TalsecRuntime.xcframework/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,32 @@
<key>BinaryPath</key>
<string>TalsecRuntime.framework/TalsecRuntime</string>
<key>LibraryIdentifier</key>
<string>ios-arm64_x86_64-simulator</string>
<string>ios-arm64</string>
<key>LibraryPath</key>
<string>TalsecRuntime.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>BinaryPath</key>
<string>TalsecRuntime.framework/TalsecRuntime</string>
<key>LibraryIdentifier</key>
<string>ios-arm64</string>
<string>ios-arm64_x86_64-simulator</string>
<key>LibraryPath</key>
<string>TalsecRuntime.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
</array>
<key>CFBundlePackageType</key>
Expand Down
Binary file not shown.
Loading
Loading