From f094b0361b0c67698c8961570b9e5c58ddb39f44 Mon Sep 17 00:00:00 2001 From: Mygod Date: Sat, 30 May 2020 20:11:21 -0400 Subject: [PATCH] Update private API documentation --- README.md | 15 ++++++++++----- .../java/be/mygod/vpnhotspot/net/TetherType.kt | 2 +- .../be/mygod/vpnhotspot/net/TetheringManager.kt | 13 ++----------- 3 files changed, 13 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index e09999e6..6c8fcbec 100644 --- a/README.md +++ b/README.md @@ -139,14 +139,15 @@ Greylisted APIs or internal constants: (some constants are hardcoded or implicit * [`Landroid/net/wifi/p2p/WifiP2pManager;->WIFI_P2P_PERSISTENT_GROUPS_CHANGED_ACTION:Ljava/lang/String;,greylist-max-o`](https://android.googlesource.com/platform/prebuilts/runtime/+/3d07e5c/appcompat/hiddenapi-flags.csv#134686) * [`Landroid/net/wifi/p2p/WifiP2pManager;->startWps(Landroid/net/wifi/p2p/WifiP2pManager$Channel;Landroid/net/wifi/WpsInfo;Landroid/net/wifi/p2p/WifiP2pManager$ActionListener;)V,greylist`](https://android.googlesource.com/platform/prebuilts/runtime/+/3d07e5c/appcompat/hiddenapi-flags.csv#134738) * (since API 28) [`Landroid/provider/Settings$Global;->SOFT_AP_TIMEOUT_ENABLED:Ljava/lang/String;,greylist-max-o`](https://android.googlesource.com/platform/prebuilts/runtime/+/3d07e5c/appcompat/hiddenapi-flags.csv#158307) -* `Lcom/android/internal/R$array;->config_tether_bluetooth_regexs:I,greylist-max-q` -* `Lcom/android/internal/R$array;->config_tether_usb_regexs:I,greylist-max-q` -* (since API 30) `Lcom/android/internal/R$array;->config_tether_wifi_p2p_regexs:I,blacklist` -* `Lcom/android/internal/R$array;->config_tether_wifi_regexs:I,greylist-max-q` +* (prior to API 30) `Lcom/android/internal/R$array;->config_tether_bluetooth_regexs:I,greylist-max-q` +* (prior to API 30) `Lcom/android/internal/R$array;->config_tether_usb_regexs:I,greylist-max-q` +* (prior to API 30) `Lcom/android/internal/R$array;->config_tether_wifi_regexs:I,greylist-max-q` * (since API 28) [`Lcom/android/internal/R$integer;->config_wifi_framework_soft_ap_timeout_delay:I,greylist-max-o`](https://android.googlesource.com/platform/prebuilts/runtime/+/3d07e5c/appcompat/hiddenapi-flags.csv#245007) * [`Lcom/android/internal/R$string;->config_ethernet_iface_regex:I,greylist-max-o`](https://android.googlesource.com/platform/prebuilts/runtime/+/3d07e5c/appcompat/hiddenapi-flags.csv#245611) * (since API 27) `Lcom/android/server/connectivity/tethering/OffloadHardwareInterface;->DEFAULT_TETHER_OFFLOAD_DISABLED:I` * (since API 30) `Lcom/android/server/SystemServer;->TETHERING_CONNECTOR_CLASS:Ljava/lang/String;` +* (since API 26) [`Ljava/lang/invoke/MethodHandles$Lookup;->(Ljava/lang/Class;I)V,greylist`](https://android.googlesource.com/platform/prebuilts/runtime/+/3d07e5c/appcompat/hiddenapi-flags.csv#333141) +* (since API 26) [`Ljava/lang/invoke/MethodHandles$Lookup;->ALL_MODES:I,greylist-max-o`](https://android.googlesource.com/platform/prebuilts/runtime/+/3d07e5c/appcompat/hiddenapi-flags.csv#333142) * (prior to API 29) [`Ljava/net/InetAddress;->parseNumericAddress(Ljava/lang/String;)Ljava/net/InetAddress;,core-platform-api,greylist-max-p`](https://android.googlesource.com/platform/prebuilts/runtime/+/3d07e5c/appcompat/hiddenapi-flags.csv#335306) Hidden whitelisted APIs: (same catch as above, however, things in this list are less likely to be broken) @@ -200,7 +201,11 @@ Hidden whitelisted APIs: (same catch as above, however, things in this list are Nonexported system resources: * `@android:array/config_tether_wimax_regexs` -* (since API 30) `@android:array/config_tether_ncm_regexs` +* (since API 30) `@com.android.networkstack.tethering:array/config_tether_bluetooth_regexs` +* (since API 30) `@com.android.networkstack.tethering:array/config_tether_ncm_regexs` +* (since API 30) `@com.android.networkstack.tethering:array/config_tether_usb_regexs` +* (since API 30) `@com.android.networkstack.tethering:array/config_tether_wifi_p2p_regexs` +* (since API 30) `@com.android.networkstack.tethering:array/config_tether_wifi_regexs` Other: diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/net/TetherType.kt b/mobile/src/main/java/be/mygod/vpnhotspot/net/TetherType.kt index f0842986..3811fa8e 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/net/TetherType.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/net/TetherType.kt @@ -48,7 +48,7 @@ enum class TetherType { @RequiresApi(30) private fun updateRegexs() { requiresUpdate = false - val tethering = TetheringManager.PACKAGE to app.packageManager.getResourcesForApplication( + val tethering = "com.android.networkstack.tethering" to app.packageManager.getResourcesForApplication( TetheringManager.resolvedService.serviceInfo.applicationInfo) usbRegexs = tethering.getRegexs("config_tether_usb_regexs") wifiRegexs = tethering.getRegexs("config_tether_wifi_regexs") diff --git a/mobile/src/main/java/be/mygod/vpnhotspot/net/TetheringManager.kt b/mobile/src/main/java/be/mygod/vpnhotspot/net/TetheringManager.kt index d70aab38..412d35c7 100644 --- a/mobile/src/main/java/be/mygod/vpnhotspot/net/TetheringManager.kt +++ b/mobile/src/main/java/be/mygod/vpnhotspot/net/TetheringManager.kt @@ -63,9 +63,6 @@ object TetheringManager { @RequiresApi(30) const val TETHERING_SERVICE = "tethering" - @RequiresApi(30) - const val PACKAGE = "com.android.networkstack.tethering" - @RequiresApi(30) private const val TETHERING_CONNECTOR_CLASS = "android.net.ITetheringConnector" @@ -287,14 +284,8 @@ object TetheringManager { if (args.isNotEmpty()) Timber.w("Unexpected args for ${method.name}: $args") @Suppress("NAME_SHADOWING") val callback = reference.get() when (method.name) { - "onTetheringStarted" -> { - callback?.onTetheringStarted() - null - } - "onTetheringFailed" -> { - callback?.onTetheringFailed() - null - } + "onTetheringStarted" -> callback?.onTetheringStarted() + "onTetheringFailed" -> callback?.onTetheringFailed() else -> ProxyBuilder.callSuper(proxy, method, args) } }