Guide

Hooking and instrumentation detection solution guide

Evaluate hooking and instrumentation detection by mechanism, app flow and policy: test injection and interception on signed builds, validate before enforcing.

  • Three mechanisms

    Injected libraries, intercepted functions and framework artefacts are different problems. Test each one on its own.

  • Tied to a flow

    Detection matters where money or identity moves. Name the flow and the event your server should see.

  • Observe, then enforce

    Start each flow in observe with your own SDKs and diagnostics in the build. Enforce once the clean baseline stays quiet.

A mobile security team should evaluate hooking and instrumentation detection against the three ways code gets changed while an app runs: libraries injected into the process, functions intercepted on their way in or out, and the traces instrumentation frameworks leave behind. Tie every test to a sensitive flow and to the signal your server should receive. Then validate the policy in observe mode, with your own diagnostic tools and legitimate SDKs in the build, before you enforce it. Scope Android and iOS separately, because their runtimes and techniques differ. Everything here assumes authorised testing on builds you own.

The product view is covered on mobile app hooking detection. The wider runtime picture is covered on mobile RASP.

Know the mechanism

Ask the supplier which mechanisms each check addresses. A single answer for “hooking” hides the detail that matters.

Injected libraries

Code that your build never contained appears in the process. On Android this can happen through process injection on a rooted device or through a library added to a repackaged APK; on iOS it can come from a jailbreak’s injection facility or from a load command added to a re-signed copy.

Function interception

Existing code is redirected. Techniques include patching the first instructions of a native function, changing import table entries, replacing Java methods inside the Android runtime and swapping Objective-C method implementations on iOS.

Framework artefacts

Instrumentation frameworks leave marks: unexpected listening ports, named threads, mapped files and agent code in memory. Attackers rename and relocate these marks, so artefact checks work best alongside checks on the code itself.

MechanismAndroid exampleiOS exampleWhat a check looks at
Injected libraryLibrary loaded from outside the APKDynamic library not in the app bundleLoaded module list against the build
Native interceptionPatched function prologuePatched function prologueCode bytes against the shipped release
Managed interceptionReplaced Java methodSwapped Objective-C methodMethod tables and implementations
Framework artefactAgent thread or portAgent thread or portProcess and memory state

How Otukan answers. Otukan checks every mechanism in this table, with separate checks built for Android and for iOS. It compares the libraries loaded into your process with the set your release expects, verifies that protected native functions still match the shipped code and that calls to system and library functions resolve to their genuine addresses, and detects changes to Java and Kotlin method dispatch on Android and Objective-C method replacement on iOS. It also looks for the threads, components and communication channels instrumentation toolkits add. The checks are layered, repeated through the session and hidden by obfuscation, so removing one still leaves the others running.

Define the execution context

Detection only helps if it runs where the risk is and produces something your backend can act on.

The sensitive flow

  • Which flows would an attacker instrument: login, one-time code entry, payment confirmation, reward redemption?
  • Which functions in those flows carry the decision, and are they in native, managed, Dart or JavaScript code?
  • In Flutter and React Native apps, does the decision sit in framework code, in a native plugin, or in both?

Timing

  • Do checks run only at launch, or also at authentication and before each sensitive action?
  • What happens if instrumentation attaches after the app has started?

The observable signal

  • What does your server receive when a check fires, and with which request?
  • Can the signal name the check that fired, so your team knows the mechanism?

How Otukan answers. Otukan runs its checks at launch, at authentication and again before the sensitive actions you mark, so instrumentation that attaches late is caught before the step that matters. In Flutter and React Native apps it covers the native layer and the framework runtime. The signal travels to your backend with the login or transaction request and names the layer and the protected function involved, so your analysts can group sessions by technique.

Validate the policy

The fastest way to lose trust in a control is to block your own users. Validate in stages.

Clean baseline

  • Run the protected release build on unmodified Android and iOS devices through every key journey, with every flow set to observe.
  • Confirm that analytics, crash reporting, performance and accessibility SDKs do not raise detections. Some legitimately swap methods or wrap functions.

Authorised attack runs

Test caseSetupExpected detectionExpected response
Library injectionRooted or jailbroken lab deviceInjected module reportedAs set for the flow
Method replacementLab device with a method-swapping moduleManaged interception reportedFlow restricted
Native patchLab device with debugger accessCode change reportedSession ended
Late attachInstrumentation after launchDetection before the next sensitive stepStep-up or refusal

Enforcement

  • Which flows move from observe to restrict or terminate, and who signs off?
  • How are diagnostics handled, given that debug builds used by your engineers differ from the release build?

How Otukan answers. Otukan lets you start each flow in observe and move it to warn, restrict or terminate once your baseline is clean. Our engineers validate the checks with yours against the SDKs and diagnostic tools your release build actually contains, record the libraries it is expected to load, test with assistive features switched on and reproduce each attack case in your authorised lab.

Emulator checks are covered on emulator detection.

Common questions

  • Which hooking mechanisms does Otukan check?

    Injected libraries, native function interception, managed method replacement and framework artefacts, with separate checks built for Android and iOS. Otukan compares loaded libraries with the set your release expects, verifies protected native functions against the shipped code, and detects method dispatch changes on Android and Objective-C method replacement on iOS.

  • Can hooking detection pick up instrumentation that attaches after launch?

    Yes. Otukan runs its checks at launch, at authentication and again before the sensitive actions you mark, so late instrumentation can be detected before the step that matters. The signal travels to your backend with the login or transaction request and names the layer and protected function involved.

  • Will our own SDKs trigger hooking detection?

    Some analytics, crash reporting, performance and accessibility SDKs legitimately swap methods or wrap functions, so this needs testing. Run the protected release build on unmodified devices with every flow in observe. Otukan’s engineers validate the checks against the SDKs your release build contains and test with assistive features switched on.

  • What happens if an attacker removes one hooking check?

    The others keep running. Otukan’s hooking checks are layered, repeated through the session and hidden by obfuscation, so removing one still leaves the rest in place. Artefact checks work alongside checks on the code itself, because attackers rename and relocate the marks instrumentation frameworks leave.

  • Does hooking detection cover Flutter and React Native apps?

    Yes. In Flutter and React Native apps, Otukan covers the native layer and the framework runtime. The guide asks you to confirm whether each decision sits in framework code, in a native plugin or in both, and to scope Android and iOS separately.

Catch tampering while your app runs

Tell us your platforms, the framework the app uses and the flow you most need to shield from runtime tampering. Do not send builds, keys or live credentials; we never need them to start.

Or request a technical demo