FORUMS

Please help

1 posts
Thanks Meter: 0
 
By [email protected], Junior Member on 25th March 2020, 07:47 PM
Post Reply Email Thread
this is my xposed code:
XposedHelpers.findAndHookMethod(InetAddress.class, "getHostName", new XC_MethodHook() {
@override
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
super.afterHookedMethod(param);
if(param.thisObject instanceof Inet4Address)
param.setResult(StringUtils.getIpFromInt(info.wifi ScanInfo.ip));
Log.i("MyLog->GetHostName3ddd","why?");
}
});
XposedHelpers.findAndHookMethod(InetAddress.class, "getHostAddress", new XC_MethodHook() {
@override
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
super.beforeHookedMethod(param);
Log.i("MyLog->getHostAddress","why not work?"+param.getResult());
}

@override
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
super.afterHookedMethod(param);

//if(param.thisObject instanceof Inet4Address) {
// param.setResult(StringUtils.getIpFromInt(info.wifi ScanInfo.ip));
//}
Log.i("MyLog->getHostAddress2","why not work"+param.getResult());
}

});
when I run this code:

Log.i("MyLog->InetAddress:","getHostName="+addr.getHostName()+" ,HostAddress="+addr.getHostAddress()+",CanonicalHo stName="+addr.getCanonicalHostName()+",Address="+S tringUtils.getStringFromBytes(addr.getAddress()));

I got this log:
2020-03-25 14:43:19.801 6839-8422/com.test I/MyLog->GetHostName: why not work
2020-03-25 14:43:19.810 6839-8422/com.test I/MyLog->getCanonicalHostName: why not work?192.168.99.243
2020-03-25 14:43:19.811 6839-8422/com.test I/MyLog->InetAddress:: getHostName=192.168.1.55,HostAddress=192.168.99.24 3,CanonicalHostName=192.168.99.243,Address=-64,-88,99,-13
2020-03-25 14:43:19.867 6839-8421/com.test I/MyLog->GetHostName: why not work

Question:
why getHostAddress and getAddress method not hook.
EdXposed Framework Info:
EdXpsed 90.0
v0.4.6.1(YAHFA)
v4.5.5(45510)
Android 10(Q,API 29)
Samsung SM-G970F

My Englisth is not good,so please help and Thank you
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes