-
Notifications
You must be signed in to change notification settings - Fork 31
release: freeRASP 7.4.0 #192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
e25e7f6
feat: init update
tompsota 0385211
fix: xcframework
tompsota 94f2dbf
revert xcframework update
tompsota 065a3a7
fix: xcframework
tompsota 49009b3
fix handler
tompsota 3d8d9eb
fix: android
tompsota f90a0eb
fix: android
tompsota 5c7ac7e
update ios
tompsota 5a3fe06
fix: ios
tompsota 649f6ce
fix: format
tompsota dc96794
fix: format
tompsota 5c2daee
update PluginThreatHandler
tompsota 835bc5a
update TalsecThreatHandler
tompsota 3b0b7b8
fix: issues
tompsota 6c9ca33
fix: dart listener
tompsota c64a8f3
chore: update changelog
tompsota 10e3e7c
chore: update files
tompsota dfa9dc8
chore: update example app
tompsota 5fb03bd
chore: update example app
tompsota 7f2b5b4
chore: update example app
tompsota 5a089b0
update lock handling
tompsota 2052f11
handle execution state sink on events
tompsota 8c373b6
update example app
tompsota d32b2f2
update example app
tompsota File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
android/src/main/kotlin/com/aheaditec/freerasp/RaspExecutionStateEvent.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| package com.aheaditec.freerasp | ||
|
|
||
| internal sealed class RaspExecutionStateEvent(val value: Int) { | ||
| object AllChecksFinished : RaspExecutionStateEvent(187429) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
android/src/main/kotlin/com/aheaditec/freerasp/dispatchers/ExecutionStateDispatcher.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| package com.aheaditec.freerasp.dispatchers | ||
|
|
||
| import com.aheaditec.freerasp.RaspExecutionStateEvent | ||
| import io.flutter.plugin.common.EventChannel.EventSink | ||
|
|
||
| internal class ExecutionStateDispatcher { | ||
| private val eventCache = mutableSetOf<RaspExecutionStateEvent>() | ||
|
|
||
| var eventSink: EventSink? = null | ||
| set(value) { | ||
| field = value | ||
| if (value != null) { | ||
| flushCache(value) | ||
| } | ||
| } | ||
|
|
||
| fun dispatch(event: RaspExecutionStateEvent) { | ||
| val sink = synchronized(eventCache) { | ||
| val currentSink = eventSink | ||
| if (currentSink != null) { | ||
| currentSink | ||
| } else { | ||
| eventCache.add(event) | ||
| null | ||
| } | ||
| } | ||
| sink?.success(event.value) | ||
| } | ||
|
|
||
| private fun flushCache(sink: EventSink) { | ||
| val events = synchronized(eventCache) { | ||
| val snapshot = eventCache.toSet() | ||
| eventCache.clear() | ||
| snapshot | ||
| } | ||
| events.forEach { sink.success(it.value) } | ||
| } | ||
| } |
73 changes: 73 additions & 0 deletions
73
android/src/main/kotlin/com/aheaditec/freerasp/dispatchers/ThreatDispatcher.kt
tompsota marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| package com.aheaditec.freerasp.dispatchers | ||
|
|
||
| import com.aheaditec.freerasp.Threat | ||
| import com.aheaditec.freerasp.handlers.MethodCallHandler | ||
| import com.aheaditec.talsec_security.security.api.SuspiciousAppInfo | ||
| import io.flutter.plugin.common.EventChannel.EventSink | ||
|
|
||
| internal class ThreatDispatcher { | ||
| private val threatCache = mutableSetOf<Threat>() | ||
| private val malwareCache = mutableListOf<SuspiciousAppInfo>() | ||
|
|
||
| var eventSink: EventSink? = null | ||
| set(value) { | ||
| field = value | ||
| if (value != null) { | ||
| flushThreatCache(value) | ||
| } | ||
| } | ||
|
|
||
| var methodSink: MethodCallHandler.MethodSink? = null | ||
| set(value) { | ||
| field = value | ||
| if (value != null) { | ||
| flushMalwareCache(value) | ||
| } | ||
| } | ||
|
|
||
| fun dispatchThreat(threat: Threat) { | ||
| val sink = synchronized(threatCache) { | ||
| val currentSink = eventSink | ||
| if (currentSink != null) { | ||
| currentSink | ||
| } else { | ||
| threatCache.add(threat) | ||
| null | ||
| } | ||
| } | ||
| sink?.success(threat.value) | ||
| } | ||
|
|
||
| fun dispatchMalware(apps: List<SuspiciousAppInfo>) { | ||
| val sink = synchronized(malwareCache) { | ||
| val currentSink = methodSink | ||
| if (currentSink != null) { | ||
| currentSink | ||
| } else { | ||
| malwareCache.addAll(apps) | ||
| null | ||
| } | ||
| } | ||
| sink?.onMalwareDetected(apps) | ||
| } | ||
|
|
||
| private fun flushThreatCache(sink: EventSink) { | ||
| val threats = synchronized(threatCache) { | ||
| val snapshot = threatCache.toSet() | ||
| threatCache.clear() | ||
| snapshot | ||
| } | ||
| threats.forEach { sink.success(it.value) } | ||
| } | ||
|
|
||
| private fun flushMalwareCache(sink: MethodCallHandler.MethodSink) { | ||
| val malware = synchronized(malwareCache) { | ||
| val snapshot = malwareCache.toMutableList() | ||
| malwareCache.clear() | ||
| snapshot | ||
| } | ||
| if (malware.isNotEmpty()) { | ||
| sink.onMalwareDetected(malware) | ||
| } | ||
| } | ||
| } |
53 changes: 0 additions & 53 deletions
53
android/src/main/kotlin/com/aheaditec/freerasp/generated/RaspExecutionState.kt
This file was deleted.
Oops, something went wrong.
43 changes: 43 additions & 0 deletions
43
android/src/main/kotlin/com/aheaditec/freerasp/handlers/ExecutionStateStreamHandler.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| package com.aheaditec.freerasp.handlers | ||
|
|
||
| import io.flutter.Log | ||
| import io.flutter.plugin.common.BinaryMessenger | ||
| import io.flutter.plugin.common.EventChannel | ||
|
|
||
| /** | ||
| * A stream handler that creates and manages an [EventChannel] for freeRASP execution state events. | ||
| */ | ||
| internal class ExecutionStateStreamHandler : EventChannel.StreamHandler { | ||
|
|
||
| private var eventChannel: EventChannel? = null | ||
|
|
||
| companion object { | ||
| private const val CHANNEL_NAME: String = "talsec.app/freerasp/execution_state" | ||
| } | ||
|
|
||
| internal fun createEventChannel(messenger: BinaryMessenger) { | ||
| if (eventChannel != null) { | ||
| Log.i("ExecStateStreamHandler", "Tried to create channel without disposing old one.") | ||
| destroyEventChannel() | ||
| } | ||
| eventChannel = EventChannel(messenger, CHANNEL_NAME).also { | ||
| it.setStreamHandler(this) | ||
| } | ||
| } | ||
|
|
||
| internal fun destroyEventChannel() { | ||
| eventChannel?.setStreamHandler(null) | ||
| eventChannel = null | ||
| TalsecThreatHandler.detachExecutionStateSink() | ||
| } | ||
|
|
||
| override fun onListen(arguments: Any?, events: EventChannel.EventSink?) { | ||
| events?.let { | ||
| TalsecThreatHandler.attachExecutionStateSink(it) | ||
| } | ||
| } | ||
|
|
||
| override fun onCancel(arguments: Any?) { | ||
| TalsecThreatHandler.detachExecutionStateSink() | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.