Frida Docs Unified
    Preparing search index...

    Type Alias Wrapper<T>

    Wrapper: {
        [K in keyof T]: T[K] extends default.Field<infer Value>
            ? default.Field<Value, T>
            : MethodDispatcher<T>
    } & {
        $alloc: MethodDispatcher<T>;
        $className: string;
        $dispose(): void;
        $init: MethodDispatcher<T>;
        $new: MethodDispatcher<T>;
        $ownMembers: string[];
        $super: Wrapper;
        class: Wrapper;
        [name: string]: any;
    }

    Dynamically generated wrapper for any Java class, instance, or interface.

    Type Parameters

    Type Declaration

    • [name: string]: any

      Methods and fields.

    • $alloc: MethodDispatcher<T>

      Allocates a new instance without initializing it.

      Call $init() to initialize it.

    • $className: string

      Canonical name of class being wrapped.

    • $dispose: function
      • Eagerly deletes the underlying JNI global reference without having to wait for the object to become unreachable and the JavaScript runtime's garbage collector to kick in (or script to be unloaded).

        Useful when a lot of short-lived objects are created in a loop and there's a risk of running out of global handles.

        Returns void

    • $init: MethodDispatcher<T>

      Initializes an instance that was allocated but not yet initialized. This wraps the constructor(s).

      Replace the implementation property to hook a given constructor.

    • $new: MethodDispatcher<T>

      Allocates and initializes a new instance of the given class.

      Use this to create a new instance.

    • $ownMembers: string[]

      Method and field names exposed by this object’s class, not including parent classes.

    • $super: Wrapper

      Instance used for chaining up to super-class method implementations.

    • class: Wrapper

      Retrieves a java.lang.Class wrapper for the current class.