Skip to content
This repository has been archived by the owner on Sep 6, 2019. It is now read-only.

Commit

Permalink
Fix WifiManager
Browse files Browse the repository at this point in the history
Refs #1757
  • Loading branch information
M66B committed Feb 14, 2015
1 parent 9e91860 commit f049200
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/biz/bokhorst/xprivacy/XWifiManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import android.net.wifi.WifiConfiguration;
import android.net.wifi.WifiInfo;
import android.os.Binder;
import android.os.Build;

public class XWifiManager extends XHook {
private Methods mMethod;
Expand Down Expand Up @@ -63,20 +64,24 @@ public static List<XHook> getInstances(String className) {
if (className == null)
className = cClassName;

String srvClassName;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
srvClassName = "com.android.server.wifi.WifiServiceImpl";
else
srvClassName = "com.android.server.wifi.WifiService";

for (Methods wifi : Methods.values())
if (wifi.name().startsWith("Srv_"))
listHook.add(new XWifiManager(wifi, PrivacyManager.cNetwork, "com.android.server.wifi.WifiService"));
listHook.add(new XWifiManager(wifi, PrivacyManager.cNetwork, srvClassName));
else
listHook.add(new XWifiManager(wifi, PrivacyManager.cNetwork, className));

listHook.add(new XWifiManager(Methods.getScanResults, PrivacyManager.cLocation, className));
listHook.add(new XWifiManager(Methods.Srv_getScanResults, PrivacyManager.cLocation,
"com.android.server.wifi.WifiService"));
listHook.add(new XWifiManager(Methods.Srv_getScanResults, PrivacyManager.cLocation, srvClassName));

// This is to fake "offline", no permission required
listHook.add(new XWifiManager(Methods.getConnectionInfo, PrivacyManager.cInternet, className));
listHook.add(new XWifiManager(Methods.Srv_getConnectionInfo, PrivacyManager.cInternet,
"com.android.server.wifi.WifiService"));
listHook.add(new XWifiManager(Methods.Srv_getConnectionInfo, PrivacyManager.cInternet, srvClassName));
}

return listHook;
Expand Down

0 comments on commit f049200

Please sign in to comment.