agentleFS
Rudra-raviRudra-ravi/frida-skills/frida-android-hooks/SKILL.md

frida-android-hooks

Skill3 starsChanged 6 months agoMITView on GitHub

Create and debug Frida hooks for Android apps, including Java.perform, overloads, constructors, class loaders, Kotlin, JNI, pinning, spawn, and Gadget.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 4 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use this skill when instrumenting Android Java/Kotlin/JNI behavior.

    line 8
  2. Distinctive:

    Verify host and device versions match:

    line 12
  3. Distinctive:

    Use spawn for early initialization:

    line 18
  4. Distinctive:

    Use attach for behavior reachable after app startup:

    line 22
  5. Very specific:

    Always hook inside Java.perform() unless only native APIs are used.

    line 43
  6. Very specific:

    If a class is not found, inspect class loaders and set Java.classFactory.loader to the app loader that can see it.

    line 47
  7. Distinctive:

    Treat public bypass snippets as reconnaissance, not final proof.

    line 85
  8. Very specific:

    Read references/android-patterns.md for overload, constructor, class-loader, JNI, OkHttp, WebView, and spawn timing patterns.

    line 92

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Frida Android Hooks

Use this skill when instrumenting Android Java/Kotlin/JNI behavior.

Setup Checks

  1. Verify host and device versions match:
    frida --version
    adb shell /data/local/tmp/frida-server --version
    frida-ps -Uai
  2. Use spawn for early initialization:
    frida -U -f com.example.app -l agent.js --no-pause
  3. Use attach for behavior reachable after app startup:
    frida -U -n com.example.app -l agent.js

Java Hook Pattern

Java.perform(() => {
  const Target = Java.use("com.example.Target");
  Target.method.overload("java.lang.String").implementation = function (value) {
    console.log("[Target.method]", value);
    const result = this.method(value);
    console.log("[Target.method] ->", result);
    return result;
  };
});

Android Rules

  • Always hook inside Java.perform() unless only native APIs are used.
  • Resolve overloads explicitly. Do not rely on ambiguous method names.
  • Hook constructors through $init.
  • For Kotlin, expect companion classes, synthetic methods, default-argument helpers, and obfuscated names.
  • If a class is not found, inspect class loaders and set Java.classFactory.loader to the app loader that can see it.
  • For native methods, bridge to frida-native-hooks after identifying the loaded .so and JNI symbol.

Practitioner Patterns

  • For obfuscated code, hook meaningful platform boundaries first: URL/request builders, JSON parsers, Base64, crypto, SharedPreferences, keystore, file I/O, WebView, class loading, and native library loading.
  • Log Java stack traces on high-signal hooks to find the app-owned caller before writing app-specific hooks.
  • Convert byte arrays deliberately. Print both hex and UTF-8/ASCII only when valid; binary crypto material is often not text.
  • Hook reflection and dynamic loading when classes appear late: Class.forName, ClassLoader.loadClass, DexClassLoader, PathClassLoader, and Runtime.loadLibrary*.
  • For TLS/pinning, identify the actual stack before bypassing: OkHttp/CertificatePinner, TrustManager, Conscrypt, WebView, Flutter/BoringSSL, or native custom validation.
  • For root/emulator/integrity bypasses, avoid blind mega-scripts as the final answer. Use them to reveal checks, then keep the smallest hooks that change the target behavior.

Discovery Snippets

Java.perform(() => {
  const groups = Java.enumerateMethods("*crypto*!*/isu");
  console.log(JSON.stringify(groups, null, 2));
});
Java.perform(() => {
  Java.enumerateClassLoaders({
    onMatch(loader) {
      try {
        Java.classFactory.loader = loader;
        Java.use("com.example.Target");
        console.log("loader:", loader);
      } catch (_) {}
    },
    onComplete() {}
  });
});

Pinning and Auth Work

  • Treat public bypass snippets as reconnaissance, not final proof.
  • Identify the actual trust path: platform trust manager, OkHttp, Conscrypt, WebView, native TLS, custom signature, or backend challenge.
  • Log inputs/outputs before replacing trust decisions.
  • Preserve evidence: hooked class, stack trace, endpoint, certificate or hash material observed, and app version.

References

Read references/android-patterns.md for overload, constructor, class-loader, JNI, OkHttp, WebView, and spawn timing patterns.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.