Skip to content

Conversation

@Diolor
Copy link
Collaborator

@Diolor Diolor commented Dec 12, 2025

Description

Improvements:

  1. Allow delayed hooking
  2. Allow change of classLoader (i.e. when the class in a different dex file)
  3. Allow globs in class and method declaration
  4. Allow prerequisite classes to be loaded before hooking the main class. This is not a "wait until" command, those classes will be loaded in memory explicitly.
  5. Allow arrays or singled objects in prerequisites and methods
const target = {
  delay: 1000, // optional delay
  hooks: [
    {
      class: "com.android.webview.chromium.*", // new: globs (* asterisks) can be added. Similar usage like frida-trace
      method: "deleteAllData",
      changeClassLoader: true,  // optional, change the classLoader of the class. See Frida's JS CLI: Java.classFactory 
      prerequisite: { // optional, can also be an array by setting a prerequisites (plural) value
        class: "android.webkit.WebStorage",
        method: "getInstance" // can also be an array by setting a methods (plural) value
      }
    }
  ]
}

Housekeeping:

  • Cluster similar functionality in methods
  • Convert some let to const
  • Make output summary print "overloads": [] instead of overloads: [{"args": []}] when args are empty.

For an actual example see #3558

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant