我想hook queryShareTypes函数中的形参,Xposed如果写,我这样写会报错?
[Java] 纯文本查看 复制代码 XposedHelpers.findAndHookMethod(hookclass, "queryShareTypes", t.class,a.class, r.class, new XC_MethodHook() {
@Override
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
// 获取方法的参数
Object tVar = param.args[0];
Object aVar = param.args[1];
Object rVar = param.args[2];
// 打印参数
if (tVar != null && aVar != null && rVar != null) {
// 做一些日志记录或其他操作
System.out.println("queryShareTypes 入参 tVar: " + tVar.toString());
System.out.println("queryShareTypes 入参 aVar: " + aVar.toString());
System.out.println("queryShareTypes 入参 rVar: " + rVar.toString());
}
}
});
[Java] 纯文本查看 复制代码 public void queryShareTypes(final t tVar, final a aVar, final r<JSONObject> rVar) {
if (tVar.f20800a != null && !TextUtils.isEmpty(tVar.f20800a.toString())) {
HttpCall.Builder builder = new HttpCall.Builder();
builder.url(com.xunmeng.pinduoduo.aj.b.a(NewBaseApplication.b) + "/api/flow/audience/share/types").header(com.xunmeng.pinduoduo.aj.c.b()).method("POST").params(tVar.f20800a.toString()).callbackOnMain(true).callback(new CommonCallback<JSONObject>() { // from class: com.xunmeng.pinduoduo.share.web.WebShare.3
[url=home.php?mod=space&uid=1892347]@Override[/url] // com.xunmeng.pinduoduo.basekit.http.callback.CommonCallback
/* renamed from: e */
public void onResponseSuccess(int i, JSONObject jSONObject) {
Logger.logI(com.pushsdk.a.d, "\u0005\u00074SL\u0005\u0007%s", "0", jSONObject);
WebShare.this.handleTypeResponse(aVar.a(), tVar.e("page_sn"), jSONObject, rVar);
}
@Override // com.xunmeng.pinduoduo.basekit.http.callback.BaseCallback
public void onResponseError(int i, HttpError httpError) {
Logger.logE(com.pushsdk.a.d, "\u0005\u00074Tg\u0005\u0007%d\u0005\u0007%s", "0", Integer.valueOf(i), httpError);
u.a(8);
rVar.a(60009, null);
}
{
WebShare.this = this;
}
@Override // com.xunmeng.pinduoduo.basekit.http.callback.BaseCallback
public void onFailure(Exception exc) {
Logger.e("AppShare.WebShare", "types onFailure", exc);
u.a(8);
rVar.a(60009, null);
}
}).build().execute();
com.xunmeng.pinduoduo.share.c.b.a(tVar.e("page_sn"), tVar.e("scene_id"));
return;
}
Logger.logE(com.pushsdk.a.d, "\u0005\u00074Uh", "0");
u.a(16);
rVar.a(60003, null);
}
[Java] 纯文本查看 复制代码 public class t {
/* renamed from: a reason: collision with root package name */
public final JSONObject f20800a;
public String e(String str) {
return d(str, null);
}
public int g(String str) {
return f(str, 0);
}
public JSONObject b(String str) {
JSONObject jSONObject = this.f20800a;
if (jSONObject == null) {
return null;
}
return jSONObject.optJSONObject(str);
}
public JSONArray c(String str) {
JSONObject jSONObject = this.f20800a;
if (jSONObject == null) {
return null;
}
return jSONObject.optJSONArray(str);
}
public String d(String str, String str2) {
JSONObject jSONObject = this.f20800a;
if (jSONObject != null) {
return jSONObject.optString(str, str2);
}
return str2;
}
public int f(String str, int i) {
JSONObject jSONObject = this.f20800a;
if (jSONObject != null) {
return jSONObject.optInt(str, i);
}
return i;
}
public boolean h(String str, boolean z) {
JSONObject jSONObject = this.f20800a;
if (jSONObject != null) {
return jSONObject.optBoolean(str, z);
}
return z;
}
public String toString() {
JSONObject jSONObject = this.f20800a;
if (jSONObject == null) {
return com.pushsdk.a.d;
}
return jSONObject.toString();
}
public t(JSONObject jSONObject) {
this.f20800a = jSONObject;
}
}
[Asm] 纯文本查看 复制代码 public interface a {
Context a();
String b();
r<JSONObject> c(String str);
r<JSONObject> d(JSONObject jSONObject, String str);
}
[Java] 纯文本查看 复制代码 public interface r<T> {
void a(int i, T t);
} |