SuspiciousBehaviorConfig class
Constructors
-
SuspiciousBehaviorConfig({int checkInterval = 5, double stillDeviceThreshold = 0.01, double preFilterThreshold = 0.02, double fastFilterThreshold = 0.9, double pixelPerfectThreshold = 0.4, double rectangleDriftDelta = 0.01, double similarityThreshold = 0.003, double minimumConfidence = 0.1, double minimumAspectRatio = 0.3, double riskThreshold = 45.0, double visualSimilarityWeight = 35.0, double motionAnomaliesWeight = 30.0, double spatialConsistencyWeight = 20.0, double temporalPatternsWeight = 15.0, bool treatMissingSensorsAsSuspicious = true, double missingSensorRiskScore = 25.0, bool enableSpatialAnalysis = true, double spatialSuspicionThreshold = 0.5, int spatialGridSize = 4, int temporalWindowSize = 30, double timingVarianceThreshold = 0.001, bool enableDebugLogging = false})
-
const
-
SuspiciousBehaviorConfig.forAndroid({int checkInterval = 4, double stillDeviceThreshold = 0.08, double preFilterThreshold = 0.02, double fastFilterThreshold = 0.9, double pixelPerfectThreshold = 0.4})
-
Creates a configuration optimized for Android platform
factory
-
SuspiciousBehaviorConfig.forIOS({int checkInterval = 5, double stillDeviceThreshold = 0.01, double rectangleDriftDelta = 0.01, double similarityThreshold = 0.003, double minimumConfidence = 0.1, double minimumAspectRatio = 0.3, double riskThreshold = 45.0, double visualSimilarityWeight = 35.0, double motionAnomaliesWeight = 30.0, double spatialConsistencyWeight = 20.0, double temporalPatternsWeight = 15.0, bool treatMissingSensorsAsSuspicious = true, double missingSensorRiskScore = 25.0, bool enableSpatialAnalysis = true, double spatialSuspicionThreshold = 0.5, int spatialGridSize = 4, int temporalWindowSize = 30, double timingVarianceThreshold = 0.001, bool enableDebugLogging = false})
-
Creates a configuration optimized for iOS platform
factory
-
SuspiciousBehaviorConfig.fromMap(Map<String, dynamic> map)
-
Creates a configuration from a map (for platform channel communication)
factory
Properties
-
checkInterval
→ int
-
The number of frames to collect before performing a suspicious behavior check.
Analyzes ALL frames in the interval for comprehensive detection.
final
-
enableDebugLogging
→ bool
-
iOS: Enable verbose debug logging for troubleshooting detection issues.
final
-
enableSpatialAnalysis
→ bool
-
iOS: Enable spatial pattern analysis (4×4 grid detection).
final
-
fastFilterThreshold
→ double
-
Android: The maximum allowable distance between two image feature prints
to consider them as similar. Lower values indicate stricter comparison.
final
-
hashCode
→ int
-
The hash code for this object.
no setterinherited
-
minimumAspectRatio
→ double
-
iOS: Specifies the minimum aspect ratio of the rectangle(s) to look for, range
0.0, 1.0
final
-
minimumConfidence
→ double
-
iOS: Specifies a minimum confidence score of the rectangle(s) to look for, range
0.0, 1.0.
Any rectangles with a lower confidence score will not be returned.
final
-
missingSensorRiskScore
→ double
-
iOS: Risk score assigned when sensors are missing/unavailable (0–30 points).
final
-
motionAnomaliesWeight
→ double
-
iOS: Weight for the motion anomalies component (0–30 points max).
final
-
pixelPerfectThreshold
→ double
-
Android: Specifies a minimum confidence score of the rectangle(s) to look for, range
0.0, 1.0.
Any rectangles with a lower confidence score will not be returned.
final
-
preFilterThreshold
→ double
-
Android: The maximum change in detected rectangle position between frames allowed
before it is considered as "drifting". Higher values allow more drift tolerance.
final
-
rectangleDriftDelta
→ double
-
iOS: The maximum change in detected rectangle position between frames allowed
before it is considered as "drifting". Higher values allow more drift tolerance.
final
-
riskThreshold
→ double
-
iOS: Overall risk threshold for determining suspicious behavior (0–100 scale).
Lower values are more sensitive; higher values are more tolerant.
final
-
runtimeType
→ Type
-
A representation of the runtime type of the object.
no setterinherited
-
similarityThreshold
→ double
-
iOS: The maximum allowable distance between two image feature prints
to consider them as similar. Lower values indicate stricter comparison.
Default updated to 0.003 (was 0.009) for stricter security.
final
-
spatialConsistencyWeight
→ double
-
iOS: Weight for the spatial consistency component (0–20 points max).
final
-
spatialGridSize
→ int
-
iOS: Grid size for spatial analysis (NxN regions). Default 4 (4×4 = 16 regions).
final
-
spatialSuspicionThreshold
→ double
-
iOS: Suspicion threshold for spatial patterns (0.0–1.0).
Higher values = more tolerant (fewer false positives).
final
-
stillDeviceThreshold
→ double
-
The maximum acceptable device motion (gyroscope rotation rate) to consider the device as still.
If the absolute rotation rate on any axis exceeds this threshold, the device is considered moving.
final
-
temporalPatternsWeight
→ double
-
iOS: Weight for the temporal patterns component (0–15 points max).
final
-
temporalWindowSize
→ int
-
iOS: Number of frames to keep in temporal fingerprint window (~1 second at 30 fps).
final
-
timingVarianceThreshold
→ double
-
iOS: Threshold for frame timing variance (seconds).
Values below this are considered unnaturally regular (screen recording detection).
final
-
treatMissingSensorsAsSuspicious
→ bool
-
iOS: Treat missing/unavailable sensors (gyro) as suspicious.
Recommended
true to detect emulators and virtual cameras.
final
-
visualSimilarityWeight
→ double
-
iOS: Weight for the visual similarity component (0–40 points max).
final
Methods
-
noSuchMethod(Invocation invocation)
→ dynamic
-
Invoked when a nonexistent method or property is accessed.
inherited
-
toMap()
→ Map<String, dynamic>
-
Converts the configuration to a map for platform channel communication
-
toString()
→ String
-
A string representation of this object.
override