Class ClassFactory

Hierarchy

  • ClassFactory

Constructors

Properties

cacheDir: string

Path to cache directory currently being used. For the default class factory this is updated by the first call to Java.perform().

loader: null | Wrapper<{}>

Class loader currently being used. For the default class factory this is updated by the first call to Java.perform().

tempFileNaming: TempFileNaming

Naming convention to use for temporary files.

Defaults to { prefix: "frida", suffix: "dat" }.

Methods

  • Creates a Java array with elements of the specified type, from a JavaScript array elements. The resulting Java array behaves like a JS array, but can be passed by reference to Java APIs in order to allow them to modify its contents.

    Parameters

    • type: string

      Type name of elements.

    • elements: any[]

      Array of JavaScript values to use for constructing the Java array.

    Returns any[]

  • Creates a JavaScript wrapper given the existing instance at handle of given class klass as returned from Java.use().

    Type Parameters

    Parameters

    Returns Wrapper<To>

  • Enumerates live instances of the className class by scanning the Java VM's heap.

    Parameters

    • className: string

      Name of class to enumerate instances of.

    • callbacks: ChooseCallbacks<{}>

      Object with callbacks.

    Returns void

  • Opens the .dex file at filePath.

    Parameters

    • filePath: string

      Path to .dex to open.

    Returns DexFile

  • Duplicates a JavaScript wrapper for later use outside replacement method.

    Type Parameters

    Parameters

    • obj: Wrapper<T>

      An existing wrapper retrieved from this in replacement method.

    Returns Wrapper<T>

  • Dynamically generates a JavaScript wrapper for className that you can instantiate objects from by calling $new() on to invoke a constructor. Call $dispose() on an instance to clean it up explicitly, or wait for the JavaScript object to get garbage-collected, or script to get unloaded. Static and non-static methods are available, and you can even replace method implementations.

    Type Parameters

    Parameters

    • className: string

      Canonical class name to get a wrapper for.

    Returns Wrapper<T>

  • Gets the class factory instance for a given class loader, or the default factory when passing null.

    The default class factory used behind the scenes only interacts with the application's main class loader. Other class loaders can be discovered through APIs such as Java.enumerateMethods() and Java.enumerateClassLoaders(), and subsequently interacted with through this API.

    Parameters

    Returns ClassFactory

Generated using TypeDoc