瀏覽代碼

hook douyin

Alex 1 年之前
父節點
當前提交
c14026d0b0
共有 1 個文件被更改,包括 14 次插入7 次删除
  1. 14 7
      agent/HookDY.js

+ 14 - 7
agent/HookDY.js

@@ -7,7 +7,7 @@ export let HOOK_DY = {
             // 重写 setOnClickListener
             View.setOnClickListener.implementation = function (listener) {
                 // 检查 this 是否是 TextView 的实例
-                console.log("type of this: " + this.getClass().getName());
+                // console.log("type of this: " + this.getClass().getName());
                 if (this.getClass().getName().includes("TextView")) {
                     try { // 安全地转换 this 为 TextView
                         var textView = Java.cast(this, TextView);
@@ -40,12 +40,19 @@ export let HOOK_DY = {
                 this.setOnClickListener(listener);
             };
 
-            //监听Toast.makeText
-            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);
-            };
+            //hook X.0mSO
+            setTimeout(function (){
+                let use = Java.use("X.0mSO");
+                if (use!==null){
+                    console.log("hook java")
+                    use.LIZJ.overload().implementation=function () {
+                        let lizj = this.LIZJ();
+                        console.log("call lizj:",lizj);
+                        return lizj;
+                    }
+                }
+
+            },5000);
         });
     }
 }