123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- export let HOOK_DY = {
- hookTextViewClick: function () {
- Java.perform(function () {
- var View = Java.use("android.view.View");
- var TextView = Java.use("android.widget.TextView");
-
- View.setOnClickListener.implementation = function (listener) {
-
- console.log("type of this: " + this.getClass().getName());
- if (this.getClass().getName().includes("TextView")) {
- try {
- var textView = Java.cast(this, TextView);
- let text = textView.getText();
- console.log("id: " + textView.getId(), "\t\t >>> \t\t" + text)
- if (text.toString().includes("***")) {
-
-
-
-
-
- console.log("1111")
- var jThrowable = Java.use("java.lang.Throwable");
- console.log("2222")
- var jStackTrace = jThrowable.$new().getStackTrace();
- console.log("Stack trace:");
- jStackTrace.forEach(function (stackTraceElement) {
- console.log("\t" + stackTraceElement.toString());
- });
- console.log("33333")
- }
- } catch (e) {
- console.log("报错:",e);
- }
- } else {
-
- }
-
- this.setOnClickListener(listener);
- };
-
- var Toast = Java.use("android.widget.Toast");
- Toast.makeText.overload('android.content.Context', 'java.lang.CharSequence', 'int').implementation = function (context, text, duration) {
- console.log("Toast.makeText:", text);
- return this.makeText(context, text, duration);
- };
- });
- }
- }
|