MCPcopy
hub / github.com/OWASP/mastg / getToStringMethodRef

Function getToStringMethodRef

demos/android/MASVS-CRYPTO/MASTG-DEMO-0072/script.js:15–25  ·  view source on GitHub ↗

* Initializes and returns the reflected Method object for Object.toString().

()

Source from the content-addressed store, hash-verified

13 * Initializes and returns the reflected Method object for Object.toString().
14 */
15 function getToStringMethodRef() {
16 try {
17 const Object = Java.use('java.lang.Object');
18 const toStringMethod = Object.class.getDeclaredMethod("toString", []);
19 toStringMethod.setAccessible(true);
20 return toStringMethod;
21 } catch (e) {
22 console.log("❌ CRITICAL SETUP ERROR: Failed to prepare toString reflection: " + e);
23 return null;
24 }
25 }
26
27 // Execute the reflection setup once at the start
28 const toStringMethodRef = getToStringMethodRef();

Callers 1

script.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected