News
MobShield: Open-Source Runtime Protection for Android and iOS, Built Around Signals Instead of Verdicts
A modular, Apache-2.0 RASP library that reports what it sees and leaves the decision to your app.

Mobile apps run on devices their publishers don't control. A banking app can find itself on a rooted phone with Frida attached, a game can be repackaged and resold, and a healthcare app can be debugged by someone with a laptop and a USB cable. Runtime application self-protection (RASP) is the layer that lets an app notice these conditions while it is running.
MobShield is a new open-source RASP library for Android and iOS, released under the Apache-2.0 license. It detects root and jailbreak, hooking frameworks, debuggers, emulators and app tampering. Its main design choice is that it does not hand the developer a single pass/fail answer. It produces weighted, scored signals and lets the app decide what to do about them.
From checks to signals to threats #
Every detection in MobShield is a check that emits a Signal: a name, a weight from 0 to 100 describing how serious the finding is, and a confidence from 0 to 100 describing how sure the check is. A pure aggregation function then combines the signals for each threat type:
score = min(100, sum(weight x confidence / 100))
The score maps to a severity (informational, low, medium, high or critical) using per-threat thresholds, and the app receives a ThreatEvent through a listener.
A worked example from the documented Android defaults: the Frida port probe has a default weight of 85 and a confidence of 95. A hit contributes about 81 points to the hook-framework score, which is above that threat's critical threshold of 65. A weak signal behaves differently. Finding a su path on its own (weight 25, confidence 35) adds under 9 points to the root score, which stays below the warning threshold of 40. A single noisy check does not escalate by itself, but several corroborating ones do.
All weights and thresholds are tunable. Developers can override a signal's weight by name, and they can change the thresholds that turn a score into a severity.
What it detects #
The Android and iOS libraries share the same model (signals, aggregation, thresholds, listener) and the same module split, but each has its own native checks for its platform.
Android #
Root and jailbreak. On Android, MobShield looks for artifacts of modern root tooling: differences between the init process's mount namespace and the app's, Magisk's abstract Unix domain socket, overlay and tmpfs mounts over system paths, Zygisk loader entries in /proc/self/maps, and KernelSU traces. It also checks classic indicators such as su files, known root-manager packages and anomalous system properties.
Hooking and instrumentation. Frida is checked from several angles: scans of loaded memory maps, a probe of the default Frida ports on 127.0.0.1, thread names, and a comparison of libc function prologues against a baseline to spot trampolines. Xposed and LSPosed are checked through class loading, the runtime's own artifacts and stack-trace leaks.
Debuggers. TracerPid in /proc/self/status, a ptrace self-attach test, timing anomalies, the debuggable flag in release builds, and whether the Java debugger is attached or the app is waiting for one.
Emulators and automation. QEMU properties and devices, Goldfish CPU markers, build fingerprint heuristics, sensor counts, and UI-automation frameworks such as Appium and UiAutomator. Weights are deliberately moderate, so a developer's stock emulator stays below the critical threshold under the default configuration.
Integrity. The signing certificate (v2 and v3 scheme digests), the APK checksum through the platform's checksum API on Android 12 and later, the checksum of MobShield's own native library, and the installer's origin.
iOS #
Jailbreak. The iOS jailbreak module targets current tooling, including Dopamine, palera1n, unc0ver, checkra1n and rootless jailbreaks. Its checks look at suspicious libraries among the loaded dyld images, probe the file system for known jailbreak paths with stat() and access(), test whether the app can write outside its sandbox or fork a process, check whether the process is being traced through sysctl, and look for package-manager URL schemes. That last check is a weak signal and is weighted accordingly (25 with a confidence of 40), while the file-system probe carries 85 with a confidence of 90.
Hooking. Frida, Substrate and ElleKit are covered. The checks include dyld image names such as FridaGadget, readable-writable-executable anonymous memory regions, the first bytes of native functions compared against a baseline, DYLD_INSERT_LIBRARIES and DYLD_FORCE_FLAT_NAMESPACE, and Objective-C method swizzling detected by comparing method implementations. The Frida port probe exists on iOS too, but it is weighted low (30 with a confidence of 50) on purpose, because the port is easy to change. The documentation lists, for each signal, which evasions defeat it.
Debugger, environment and integrity. Debugger checks use ptrace, sysctl and Mach exception ports. The environment module detects the Simulator and automation, and the integrity module validates the app's code signature through SecCode along with a build anchor.
Each iOS module maps to the same OWASP MASVS-RESILIENCE controls as its Android counterpart.
Designed to be adopted carefully #
Several decisions are aimed at teams that have to justify a security dependency to their own reviewers.
- Detect-only by default. MobShield reports. It terminates the process only if the developer opts in with a termination policy, such as exiting on a critical threat.
- Modular. A core module provides the API and aggregation. Root, hooks, debugger, environment and integrity detection are separate modules, so an app takes only what it needs.
- No telemetry. The library has no account, no backend and no outbound network calls. The only socket use is the Frida check, which connects to the loopback address on the device. Reports stay in the app. If a team wants a signed posture report for its own server, the library can produce one.
- Auditable. Every signal, its technique and its default weight are documented, along with a validation matrix that lists what each module should report on a clean device and on a compromised one. A mapping to the OWASP MASVS-RESILIENCE controls shows which signals support which control, and which controls (such as anti-static analysis) MobShield does not address.
- Permissive license. The whole project, including native code, is Apache-2.0.
Getting started #
Android #
MobShield is on Maven Central under the io.github.inforaam group:
dependencies {
implementation("io.github.inforaam:mobshield-core:1.0.10")
implementation("io.github.inforaam:mobshield-detect-root:1.0.10")
implementation("io.github.inforaam:mobshield-detect-hooks:1.0.10")
}
Registering the detectors and starting a scan takes a few lines:
val listener = object : MobShieldListener {
override fun onThreat(event: ThreatEvent) {
Log.w("MobShield", "threat: ${event.type} ${event.severity} score=${event.score}")
}
override fun onAllChecksFinished(events: List<ThreatEvent>) {
Log.i("MobShield", "scan finished: ${events.size} threat(s)")
}
}
val config = MobShieldConfig() // detect-only by default
RootDetectionRegistrar.register(context, config)
HookDetectionRegistrar.register(context, config)
MobShield.start(context, config, listener)
The current posture is available at any time through MobShield.getState(), which exposes a risk level and the active threats.
iOS #
The iOS library requires iOS 15 or later and Xcode 15 or later. It is available now through Swift Package Manager:
dependencies: [
.package(url: "https://github.com/Inforaam/MobShield-iOS", from: "1.1.2"),
]
Then add MobShieldCore and the detector products you want (MobShieldDetectJailbreak, MobShieldDetectHooks, MobShieldDetectDebugger, MobShieldDetectEnvironment, MobShieldDetectIntegrity) to your target. Starting a scan mirrors the Android flow:
final class MyListener: MobShieldListener {
func onThreat(_ event: ThreatEvent) {
print("MobShield threat:", event.type, event.severity, "score:", event.score)
}
func onAllChecksFinished(_ events: [ThreatEvent]) {
print("MobShield scan finished:", events.count, "threat(s)")
}
}
let listener = MyListener() // keep a strong reference for the lifetime of the run
Task {
let config = MobShieldConfig() // detect-only by default
await JailbreakDetectionRegistrar.register(config: config)
await HookDetectionRegistrar.register(config: config)
MobShield.shared.start(config: config, listener: listener)
}
CocoaPods support is coming soon. The podspec is ready, and the pod will be published to the CocoaPods trunk in an upcoming release. Until then, Swift Package Manager is the supported way to install the iOS library.
What it can't do #
MobShield is client-side software, and the device it runs on belongs to its owner. An attacker with enough control over a device can tamper with, hook or disable any client-side detector, including this one. Several of MobShield's checks read /proc and probe the runtime, which is the same ground an attacker's tools work on, so expect an ongoing game of detection and evasion.
The project is explicit about this. It positions detection as one layer in a defense-in-depth design. Anything that matters should be verified on the server, for example with a platform attestation service such as Play Integrity. It treats a detection bypass as a normal bug to be reported and fixed, and the security policy invites reports of them.
The validation work follows the same honesty. Unit tests cannot root a device or attach Frida to it, so they prove that detectors do not crash or raise false alarms on a clean environment, but not that they fire on a compromised one. Confirming positive detection needs real compromised devices. The project provides a harness and an expected-results matrix to make that check repeatable, and it asks for false-positive reports from real devices, including vendor ROMs and work profiles.
Where it fits #
Other options exist, including freeRASP and RootBeer, and teams will choose according to what they need to audit, tune and host. MobShield's bet is on transparency: scored signals, documented techniques, no data leaving the device, and a license that lets security teams read, test and fork the code.
Links #
- Android: https://github.com/Inforaam/MobShield-Android
- iOS: https://github.com/Inforaam/MobShield-iOS
- Maven Central:
io.github.inforaam:mobshield-core - Swift Package Manager:
https://github.com/Inforaam/MobShield-iOS(CocoaPods coming soon) - Detection notes and the OWASP MASVS mapping are in the
docsfolders of the repositories.
The authors welcome feedback, particularly false positives on real devices, reproducible bypasses and missing detections. They ask that security vulnerabilities be reported privately through each repository's security policy.
Sources
- MobShield for Android on GitHub, Inforaam
- MobShield for iOS on GitHub, Inforaam