gcd,xpose检测
This commit is contained in:
parent
2575c8fda3
commit
407892e0d7
|
@ -176,6 +176,16 @@ public class Entry {
|
|||
//collector.checkAndParse(param);
|
||||
}
|
||||
});*/
|
||||
XSHelpers.findAndHookMethod("com.secneo.apkwrapper.H", loader, "gha", "java.lang.String", new XC_MethodHook() {
|
||||
|
||||
@Override
|
||||
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
|
||||
super.afterHookedMethod(param);
|
||||
param.setResult(0);
|
||||
Object name=param.args[0];
|
||||
Log.e(TAG,"apkwrapper gha 检测:"+name+"修改完成");
|
||||
}
|
||||
});
|
||||
|
||||
XSHelpers.findAndHookMethod(URL.class, "openConnection", new XC_MethodHook() {
|
||||
@Override
|
||||
|
@ -198,9 +208,6 @@ public class Entry {
|
|||
Uri uri=Uri.parse(urlStr);
|
||||
String app_id = uri.getQueryParameter("app_id");
|
||||
String buildnumber=uri.getQueryParameter("buildnumber");
|
||||
// if (urlStr.contains("conversions") || urlStr.contains("gcd") || urlStr.contains("inapps")){
|
||||
//
|
||||
// }
|
||||
logLong(TAG,"发送数据:afdata="+afdata);
|
||||
MyLogger.e(TAG,"发送数据:afdata="+afdata);
|
||||
MyLogger.e(TAG,"发送数据:app_id="+app_id);
|
||||
|
@ -416,7 +423,31 @@ public class Entry {
|
|||
@Override
|
||||
public Object getContent(Class[] classes) throws IOException { return _orgConn.getContent(classes); }
|
||||
@Override
|
||||
public InputStream getInputStream() throws IOException { return _orgConn.getInputStream(); }
|
||||
public InputStream getInputStream() throws IOException {
|
||||
InputStream is = _orgConn.getInputStream();
|
||||
String url = _orgConn.getURL().toString();
|
||||
|
||||
if (url.contains("gcdsdk")) {
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
|
||||
byte[] buffer = new byte[1024];
|
||||
int len;
|
||||
while ((len = is.read(buffer)) != -1) {
|
||||
baos.write(buffer, 0, len);
|
||||
}
|
||||
|
||||
byte[] responseBytes = baos.toByteArray();
|
||||
String responseStr = new String(responseBytes, StandardCharsets.UTF_8);
|
||||
|
||||
MyLogger.e("Hook", "gcdsdk 返回包内容:\n" + responseStr);
|
||||
|
||||
// 返回一个新的 InputStream,不影响调用者继续读取
|
||||
return new ByteArrayInputStream(responseBytes);
|
||||
}
|
||||
|
||||
// 如果不是目标 URL,正常返回原始 InputStream
|
||||
return is;
|
||||
}
|
||||
@Override
|
||||
public String toString() { return _orgConn.toString(); }
|
||||
@Override
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue