frida请问这种是用j6吗
#### 情况说明这是我的尝试hook的代码,但是没反应,试过log(“hello”)也没有输出,是不是hook错了呢?
小白初次hook。提示注入成功。
package为: com.qidian.QDReader
我翻来翻去觉得确实是这里的问题,觉得可能是我的hook方式错误了。
因为我是安装了autoxjs后就提示环境异常。只能阅读5章之后的,最新5章都会提示环境异常。
翻看了autox包发现有大量包名为 org.autojs.autojs
想过直接改包名 但是我的as老报错。
#### 我的具体hook代码
~~~
jsHook = """
Java.perform(function () {
// 包.类
let h = Java.use("j6.h");
// Hook,替换
h["c"].implementation = function (context, iVar) {
console.log('c is called' + ', ' + 'context: ' + context + ', ' + 'iVar: ' + iVar);
let ret = this.c(context, iVar);
console.log('c ret value is ' + ret);
return ret;
};
});
"""
~~~
#### 中间的一个类和要hook的函数
头部
~~~
package j6;
import android.content.Context;
import android.content.pm.PackageInfo;
import android.text.TextUtils;
import com.qq.e.comm.constants.Constants;
import com.tencent.imsdk.BaseConstants;
import com.tencent.qcloud.core.util.IOUtils;
import java.io.File;
import java.util.Locale;
import kotlin.Triple;
/* compiled from: VirtualApkCheckUtil.java */
/* loaded from: classes3.dex */
public class h {
/* renamed from: breason: collision with root package name */
private static volatile h f51607b;
/* renamed from: areason: collision with root package name */
private String[] f51608a = {"com.bly.dkplat", "com.by.chaos", "com.lbe.parallel", "com.excelliance.dualaid", "com.lody.virtual", "com.qihoo.magic"};
private h() {
}
~~~
要hook的函数
~~~
public Triple<Boolean, Boolean, Boolean> c(Context context, i iVar) {
boolean z8;
try {
if (context != null) {
String packageName = context.getPackageName();
int i10 = 0;
boolean z10 = false;
z8 = false;
for (PackageInfo packageInfo : b6.e.F().E(context)) {
try {
if (packageName.equals(packageInfo.packageName)) {
i10++;
}
if (packageInfo.packageName.equals("io.va.exposed")) {
z10 = true;
}
if (packageInfo.packageName.contains("org.autojs.autojs")) {
z8 = true;
}
} catch (Exception unused) {
r0 = z10;
return new Triple<>(Boolean.FALSE, Boolean.valueOf(r0), Boolean.valueOf(z8));
}
}
if (i10 > 1 && iVar != null) {
iVar.a();
}
return new Triple<>(Boolean.valueOf(i10 > 1), Boolean.valueOf(z10), Boolean.valueOf(z8));
}
throw new IllegalArgumentException("you have to set context first");
} catch (Exception unused2) {
z8 = false;
}
}
~~~
页:
[1]