Skip to content

feat!: unify the public API with the other freeRASP plugins - #66

Merged
tompsota merged 4 commits into
chore/android-sdk-20.0.1from
feat/unified-api
Nov 12, 2026
Merged

tompsota merged 4 commits into
chore/android-sdk-20.0.1from
feat/unified-api

Conversation

@tompsota

Copy link
Copy Markdown
Member

What's new

Unifies the public API with the other freeRASP plugins (Flutter, React Native, Cordova) for the 4.0.0 major release. Stacked on #64 (chore/android-sdk-20.0.1).

Breaking changes

  • iOS config: TalsecIosConfig.appBundleId: string is replaced by appBundleIds: string[], which the iOS SDK accepts directly (TalsecConfig(appBundleIds:)). The Swift side now reads the array instead of wrapping a single id.
  • Return values: methods that resolved with a constant now resolve to void: startFreeRASP (was { started: boolean }), addToWhitelist, blockScreenCapture, blockScreenControl, startOngoingCallDetection, stopOngoingCallDetection, storeExternalId, removeExternalId. isScreenCaptureBlocked, isScreenControlBlocked, isOverlayWindowsBlocked and blockOverlayWindows keep returning a meaningful boolean; getAppIcon keeps returning the icon.
  • Errors: every method now rejects only with the new exported TalsecError, whose code is one of talsec-failure, unsupported-platform, configuration-exception, external-id-failure, malware-failure. These are the same codes as Flutter's TalsecException. Android-only methods called on iOS reject with unsupported-platform instead of a plain string.
  • Exports: onInvalidCallback is no longer exported; abortApp remains the way to terminate the app. It now lives in an internal module.

No stop() method is exposed. Android Kotlin sources are untouched.

Testing

  • ESLint and Prettier pass; npm run build regenerated dist/
  • dist/esm/index.d.ts exports TalsecError, TalsecErrorCode and abortApp, but not onInvalidCallback
  • Example app updated to the new config and return types; the web build compiles and the Android build succeeds
  • Edited Swift passes swiftc -parse
  • Not run on a device or emulator; iOS not built

🤖 Generated with Claude Code

tompsota and others added 2 commits November 11, 2026 19:03
- TalsecIosConfig.appBundleId (string) is now appBundleIds (string[]), as the
  iOS SDK accepts several bundle ids
- startFreeRASP and the action methods resolve to void instead of status
  values; meaningful booleans (is*Blocked, blockOverlayWindows) stay
- every method rejects with TalsecError and a stable code instead of native
  errors or plain strings
- onInvalidCallback is no longer exported; abortApp stays

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The native bridge type is internal; apps use the exported functions. Its
addListener signature now uses Capacitor's PluginListenerHandle.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tompsota

Copy link
Copy Markdown
Member Author

Added in 41c6311: the TalsecPlugin native-bridge interface moved into the internal api/nativeModules.ts and is no longer exported (listed under Breaking in the changelog). Its addListener is now typed with Capacitor's PluginListenerHandle instead of any. dist/ rebuilt; ESLint and the build pass.

tompsota and others added 2 commits November 12, 2026 09:05
… void

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tompsota

Copy link
Copy Markdown
Member Author

Threat and RASP execution state actions are now typed () => void instead of () => any (async handlers still type-check). I also merged the latest chore/android-sdk-20.0.1 into this branch so the changelog no longer conflicts with the new background-mode entry.

@tompsota
tompsota merged commit 1f7ff57 into chore/android-sdk-20.0.1 Nov 12, 2026
@tompsota
tompsota deleted the feat/unified-api branch November 12, 2026 09:28
tompsota added a commit that referenced this pull request Nov 13, 2026
* release: freeRASP 3.4.0 (Android SDK 20.0.1)

Bump the Android SDK to 20.0.1 (app.talsec.rasp:TalsecRasp-Community-Capacitor)
and expose its new features:

- ongoing call detection: ongoingCall threat action with CallState,
  startOngoingCallDetection/stopOngoingCallDetection
- screen control blocking: blockScreenControl/isScreenControlBlocked
- overlay windows hiding: blockOverlayWindows/isOverlayWindowsBlocked
- criticalChecksFinished/postponedChecksFinished execution states

The new threat and execution-state identifiers and the call-state channel
key are Android only; the TypeScript lists are branched per platform so the
iOS identifier counts stay unchanged.

allChecksFinished is now driven by the SDK's onFastChecksFinished, which
fires where the removed onAllChecksFinished used to. SDK 20.0.1 also narrowed
onMalware's parameter from MutableList to List.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs: reword the Maven coordinates changelog entry

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat!: rename allChecksFinished to fastChecksFinished

The execution state that fires when the fast (standard) checks complete is
renamed on all platforms to match the Android SDK's onFastChecksFinished. On
iOS it is driven by the SDK's onAllChecksFinished. This is a breaking change,
so the package major version is bumped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs: drop Breaking markers from Android SDK changes absorbed by the plugin

The plugin hides these native API changes from its users, so they move from
the Android Breaking Changes section to Changed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs: drop Android changelog entries already listed in the plugin section

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* example: show the ongoing call state (Not detected, Started, Ongoing, Stopped)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(ios): send placeholder threat channel keys for Android-only payloads

iOS now sends placeholder keys for malware and ongoing call, so the threat
channel data has the same length on both platforms and the JS check no longer
branches by platform.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat(android): start Talsec in background mode

Talsec.start now uses TalsecMode.BACKGROUND, as the React Native plugin
already does, so the SDK initializes off the calling thread.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refactor(android): move plugin to the app.talsec.rasp.capacitor namespace (#65)

* refactor(android): move plugin to the app.talsec.rasp namespace

Align the Android package of the plugin with the Android SDK's app.talsec.rasp,
adding the platform as the last segment.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refactor(android): update package names to app.talsec.rasp

Completes the move of the plugin sources: package declarations, imports,
Gradle namespace and build configuration.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

* docs(changelog): note that freeRASP starts in background mode on Android

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat!: unify the public API with the other freeRASP plugins (#66)

* feat!: unify the public API with the other freeRASP plugins

- TalsecIosConfig.appBundleId (string) is now appBundleIds (string[]), as the
  iOS SDK accepts several bundle ids
- startFreeRASP and the action methods resolve to void instead of status
  values; meaningful booleans (is*Blocked, blockOverlayWindows) stay
- every method rejects with TalsecError and a stable code instead of native
  errors or plain strings
- onInvalidCallback is no longer exported; abortApp stays

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refactor: stop exporting the TalsecPlugin bridge interface

The native bridge type is internal; apps use the exported functions. Its
addListener signature now uses Capacitor's PluginListenerHandle.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refactor(types): type threat and execution state actions as returning void

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant