do this:
var s = Java.use('java.lang.String');
var ss2 = s.$new('str');
ss2.$dispose();
get the error info:
{u'columnNumber': 1, u'description': u'Error: Not allowed outside Java.perform() callback', u'fileName': u'frida/node_modules/frida-java/index.js', u'lineNumber': 79, u'type': u'error', u'stack': u'Error: Not allowed outside Java.perform() callback\n at d (frida/node_modules/frida-java/index.js:79)\n at frida/node_modules/frida-java/index.js:355\n at script2.js:29\n at call (native)\n at c (input:1)'}
Java.perform(function () {
var Activity = Java.use("android.app.Activity");
var Exception = Java.use("java.lang.Exception"); //ok
Activity.onResume.implementation = function () {
var Exception = Java.use("java.lang.Exception"); //error outside java.perform()
do this: var s = Java.use('java.lang.String'); var ss2 = s.$new('str'); ss2.$dispose();
get the error info: {u'columnNumber': 1, u'description': u'Error: Not allowed outside Java.perform() callback', u'fileName': u'frida/node_modules/frida-java/index.js', u'lineNumber': 79, u'type': u'error', u'stack': u'Error: Not allowed outside Java.perform() callback\n at d (frida/node_modules/frida-java/index.js:79)\n at frida/node_modules/frida-java/index.js:355\n at script2.js:29\n at call (native)\n at c (input:1)'}
Java.perform(function () { var Activity = Java.use("android.app.Activity"); var Exception = Java.use("java.lang.Exception"); //ok Activity.onResume.implementation = function () { var Exception = Java.use("java.lang.Exception"); //error outside java.perform()
});