Skip to content

Commit 67d2116

Browse files
GalaxyWearable: disable nearby wifi devices permission
1 parent ee56364 commit 67d2116

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

GalaxyWearable/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ This is an Xposed variant of [`Linux4/GalaxyWearable`](https://github.com/Linux4
77
Additional features:
88
* Disable the forced app update prompt when opening the app
99
* Disable the required phone permission
10+
* Disable nearby WiFi devices permission
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
com.programminghoch10.GalaxyWearable.DisableForcedUpdateHook
22
com.programminghoch10.GalaxyWearable.DisableManufacturerCheckHook
3+
com.programminghoch10.GalaxyWearable.DisableNearbyWifiDevicesPermissionHook
34
com.programminghoch10.GalaxyWearable.DisableTelephonyPermissionHook
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package com.programminghoch10.GalaxyWearable;
2+
3+
import java.util.ArrayList;
4+
5+
import de.robv.android.xposed.IXposedHookLoadPackage;
6+
import de.robv.android.xposed.XposedHelpers;
7+
import de.robv.android.xposed.callbacks.XC_LoadPackage;
8+
9+
public class DisableNearbyWifiDevicesPermissionHook implements IXposedHookLoadPackage {
10+
/*
11+
I don't know what this app needs nearby WiFi devices for...
12+
*/
13+
14+
@SuppressWarnings("unchecked")
15+
@Override
16+
public void handleLoadPackage(XC_LoadPackage.LoadPackageParam lpparam) throws Throwable {
17+
if (!lpparam.packageName.equals("com.samsung.android.app.watchmanager")) return;
18+
Class<?> PermissionsUtilsClass =
19+
XposedHelpers.findClass("com.samsung.android.app.watchmanager.setupwizard.permission.PermissionUtils", lpparam.classLoader);
20+
ArrayList<String> INITIAL_PERMISSION = (ArrayList<String>) XposedHelpers.getStaticObjectField(PermissionsUtilsClass, "INITIAL_PERMISSION");
21+
INITIAL_PERMISSION.remove("android.permission.NEARBY_WIFI_DEVICES");
22+
}
23+
}

0 commit comments

Comments
 (0)