use of com.lody.virtual.client.hook.delegate.PhoneInfoDelegate in project VirtualApp by asLody.
the class WifiManagerPatch method onBindHooks.
@Override
protected void onBindHooks() {
super.onBindHooks();
addHook(new StaticHook("getConnectionInfo") {
@Override
public Object call(Object who, Method method, Object... args) throws Throwable {
WifiInfo info = (WifiInfo) method.invoke(who, args);
PhoneInfoDelegate delegate = VirtualCore.get().getPhoneInfoDelegate();
if (info != null && delegate != null) {
String oldMac = info.getMacAddress();
if (oldMac != null) {
String newMac = delegate.getMacAddress(oldMac, getAppUserId());
if (!TextUtils.equals(oldMac, newMac)) {
mirror.android.net.wifi.WifiInfo.mMacAddress.set(info, newMac);
}
}
}
return info;
}
});
}
Aggregations