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?