|
@@ -40,5 +40,32 @@ public class HookSystem extends BaseHook {
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ try {
|
|
|
|
|
+ Class<?> WifiServiceImpl = XposedHelpers.findClass("com.android.server.wifi.WifiServiceImpl", lpparam.classLoader);
|
|
|
|
|
+ XposedHelpers.findAndHookMethod(WifiServiceImpl, "getFactoryMacAddresses", new XC_MethodHook() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ protected void afterHookedMethod(MethodHookParam param) throws Throwable {
|
|
|
|
|
+ String[] macs = new String[]{getProperty(PROP_MAC, "")};
|
|
|
|
|
+ log("spoof getFactoryMacAddresses: " + macs[0]);
|
|
|
|
|
+ param.setResult(macs);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ XposedHelpers.findAndHookMethod(WifiServiceImpl, "getConnectionInfo", String.class, String.class, new XC_MethodHook() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ protected void afterHookedMethod(MethodHookParam param) throws Throwable {
|
|
|
|
|
+ String mac = getProperty(PROP_MAC, "");
|
|
|
|
|
+ String bssid = getProperty(PROP_BSSID, "");
|
|
|
|
|
+ log("spoof getConnectionInfo: " + mac + " " + bssid);
|
|
|
|
|
+ param.setResult(mac);
|
|
|
|
|
+ XposedHelpers.setObjectField(param.getResult(), "macAddress", mac);
|
|
|
|
|
+ XposedHelpers.setObjectField(param.getResult(), "mBSSID", bssid);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ e.printStackTrace();
|
|
|
|
|
+ log("SystemProperties not found");
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|