diff --git a/app/src/main/java/app/revanced/all/connectivity/wifi/spoof/SpoofWifiPatch.java b/app/src/main/java/app/revanced/all/connectivity/wifi/spoof/SpoofWifiPatch.java index eb7e56c4..b102c4a4 100644 --- a/app/src/main/java/app/revanced/all/connectivity/wifi/spoof/SpoofWifiPatch.java +++ b/app/src/main/java/app/revanced/all/connectivity/wifi/spoof/SpoofWifiPatch.java @@ -330,6 +330,22 @@ public class SpoofWifiPatch { ); } + public static void unregisterNetworkCallback(ConnectivityManager connectivityManager, ConnectivityManager.NetworkCallback networkCallback) { + try { + connectivityManager.unregisterNetworkCallback(networkCallback); + } catch (IllegalArgumentException ignore) { + // ignore: NetworkCallback was not registered + } + } + + public static void unregisterNetworkCallback(ConnectivityManager connectivityManager, PendingIntent operation) { + try { + connectivityManager.unregisterNetworkCallback(operation); + } catch (IllegalArgumentException ignore) { + // ignore: PendingIntent was not registered + } + } + private static class Utils { private static class Option { private final T value;