Quick Start
Sentinel is a lightweight, modular security toolkit designed specifically for Kotlin Multiplatform (KMP). It empowers mobile developers to analyze runtime environments and detect potential security threats in real-time across both Android and iOS applications from a single codebase.
Dependency
implementation("co.rexiox:sentinel:{version}")Configuration
You can use the following method to print the appId and appIntegrity values required for your security or configuration processes and assign them to the relevant fields within the config as a ByteList:
appId: Package name for Android, Bundle Identifier for iOSappIntegrity: Package signature for Android, unique digital fingerprint of the Provisioning Profile file for iOS
SentinelLogger.print(tag = "APP_ID", msg = Sentinel.Identity.appId.toByteList())
SentinelLogger.print(tag = "APP_INTEGRITY", msg = Sentinel.Identity.appIntegrity.toByteList())Android Setup
val sentinel = Sentinel.configure(context = context) {
config {
appId = listOf<Byte>()
appIntegrity = listOf<Byte>()
threshold = 90
isLoggingEnabled = true
}
all()
// root()
// tamper()
// hook()
// emulator()
// debug()
// location()
}iOS Setup
Instead of basic checks, Sentinel performs a thorough inspection of the environment and provides a detailed report based on threat severity.
inspect()is a suspend function and must be executed within a coroutine scope.
Report
After the inspection completes, Sentinel returns a SecurityReport. This report aggregates all detected threats and provides a unified severity score and risk level for the current runtime environment.
Last updated