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

## Unreleased

### Flutter

#### Changed

- Updated the internal handling of ExternalIdResult on Android (for `storeExternalId()` method)

## [7.4.0] - 2026-02-10
- Android SDK version: 18.0.2
- iOS SDK version: 6.13.0
Expand Down
15 changes: 15 additions & 0 deletions android/src/main/kotlin/com/aheaditec/freerasp/Extensions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.aheaditec.freerasp
import android.content.Context
import android.content.pm.PackageInfo
import android.os.Build
import com.aheaditec.talsec_security.security.api.ExternalIdResult
import com.aheaditec.talsec_security.security.api.SuspiciousAppInfo
import io.flutter.plugin.common.MethodChannel
import com.aheaditec.freerasp.generated.PackageInfo as FlutterPackageInfo
Expand Down Expand Up @@ -68,3 +69,17 @@ internal fun PackageInfo.getVersionString(): String {
@Suppress("DEPRECATION")
return versionCode.toString()
}

/**
* Resolves the result of a storeExternalId operation and sends it back to the Flutter side.
* If the [ExternalIdResult] is [ExternalIdResult.Success], it sends the result using success.
* If the [ExternalIdResult] is [ExternalIdResult.Error], it sends the result using error.
*
* @param result The [MethodChannel.Result] handler to send the result/error to.
*/
internal fun ExternalIdResult.resolve(result: MethodChannel.Result) {
when (this) {
is ExternalIdResult.Success -> result.success(null)
is ExternalIdResult.Error -> result.error("external-id-failure", this.errorMsg, null)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import androidx.lifecycle.LifecycleEventObserver
import androidx.lifecycle.LifecycleOwner
import com.aheaditec.freerasp.Utils
import com.aheaditec.freerasp.generated.TalsecPigeonApi
import com.aheaditec.freerasp.resolve
import com.aheaditec.freerasp.runResultCatching
import com.aheaditec.freerasp.toPigeon
import com.aheaditec.talsec_security.security.api.SuspiciousAppInfo
Expand Down Expand Up @@ -216,8 +217,7 @@ internal class MethodCallHandler : MethodCallHandler, LifecycleEventObserver {
runResultCatching(result) {
context?.let {
val data = call.argument<String>("data") ?: throw NullPointerException("External ID data cannot be null.")
Talsec.storeExternalId(it, data)
result.success(null)
Talsec.storeExternalId(it, data).resolve(result)
return@runResultCatching
}
throw IllegalStateException("Unable to store external ID - context is null")
Expand Down