Skip to content

ResulSilay/Sentinel

Repository files navigation

Logo

Security Toolkit Gradle Version

KMP Android iOS

Sentinel is a lightweight, modular Kotlin Multiplatform security toolkit designed to analyze runtime environments and detect potential security threats in real time on both Android and iOS.

Note: This library is currently under active development. Some features, especially on iOS may be incomplete or experimental.

image

Android iOS
Sentinel Android Demo Sentinel iOS Demo

Why Sentinel?

Most mobile apps rely only on server-side security, but attacks happen on the client.

Sentinel provides real-time, on-device threat detection with minimal performance overhead.

☑️️ Detect compromised devices (root / jailbreak)
☑️️ Detect runtime manipulation (Frida, Xposed)
☑️️ Detect app tampering & reverse engineering
☑️️ Detect emulators & unsafe environments
☑️️ Designed for Kotlin Multiplatform (KMP)

Features

♦️ Modular Detector Architecture: Easily enable, disable, or extend security checks.
♦️ Smart Risk Aggregation: Weighted category scoring to prevent artificial risk inflation.
♦️ Configurable Threat Threshold: Set your own critical risk level to control app behavior.
♦️ DSL-Based Configuration: Use a clean and expressive API for configuration.
♦️ Detailed Security Reports: Get a full breakdown of detected threats.
♦️ Lightweight & High Performance: Minimal runtime overhead for optimal performance.
♦️ Kotlin Multiplatform: Works on Android and iOS with a single codebase.

Supported Threats by Platform

Threat / Feature Android iOS
Root / Jailbreak
App Tampering
Hooking Frameworks
Emulator / Simulator Detection
Debugging Detection
Mock Location Abuse

Quick Start

implementation("io.github.resulsilay:sentinel:1.1.0-alpha4")

Android Usage

val sentinel = Sentinel.configure(context = context) {
    config {
        this.appId = Sentinel.Identity.appId.toByteList()
        this.signature = Sentinel.Identity.signature?.toByteList()
        this.threshold = 90
        this.isLoggingEnabled = true
    }

    all()
    // root()
    // tamper()
    // hook()
    // emulator()
    // debug()
    // location()
}

iOS Usage

val sentinel = Sentinel.configure {
    config {
        this.appId = Sentinel.Identity.appId.toByteList()
        this.threshold = 90
        this.isLoggingEnabled = true
    }

    all()
    // jailbreak()
    // simulator()
    // debug()
}

Running Inspection

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.

val report = sentinel.inspect()

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.

println("Risk Level: ${report.riskLevel}")
println("Total Risk Score: ${report.severity} / ${report.threshold}")
println("Threat Count: ${report.threats.size}")
println("Timestamp: ${report.timestamp}")

if (report.isRooted) println("Root detected")
if (report.isJailbroken) println("Jailbreak detected")
if (report.isTampered) println("App tampering detected")
if (report.isHooked) println("Hooking detected")
if (report.isEmulator) println("Emulator detected")
if (report.isSimulator) println("Simulator detected")
if (report.isDebugged) println("Debugger detected")
if (report.isMockLocation) println("Mock location detected")

if (report.isSafe()) {
    println("Device is secure")
} else {
    println("Security risks detected!")
}

if (report.isCritical()) {
    println("Block app usage.")
}

You can optionally log the report to the console / logcat for debugging purposes:

sentinel.log(report = report)

Samples

Risk Scoring

Sentinel does NOT simply sum threats.

Instead:

  • Groups threats by category
  • Takes the highest severity per category
  • Produces a realistic risk score

License

MIT License

Copyright (c) 2026 Resul Silay

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

About

Sentinel is a lightweight and modular Kotlin multiplatform security toolkit designed to analyze operating environments and detect potential security threats in real time.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors