Skip to content

Not possible to change implementation of a function called Process #34

@securityMB

Description

@securityMB

It seems that it is not possible to override implementation of a Java function called Process. For example:

Java.perform(() => {
    const cls = Java.use('com.some.class.here');
    cls.Process.implementation = function () { return false; }
});

After trying to execute the code, you'll get an error in class-factory.js in line 1125 that Process.getCurrentThreadId() is not a function.

This happens because the function is called Process overriding the default Process object in the global namespace.

Perhaps the quick (and dirty) fix is to just make the function anonymous?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions