Skip to content

Commit d3c36e7

Browse files
committed
added base
1 parent 82a34bc commit d3c36e7

File tree

2 files changed

+2
-37
lines changed

2 files changed

+2
-37
lines changed

app/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ android {
1717
applicationId = "com.pira.gnetp"
1818
minSdk = 23
1919
targetSdk = 36
20-
versionCode = 2
21-
versionName = "1.0.1"
20+
versionCode = 3
21+
versionName = "1.0.2"
2222

2323
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
2424
}

app/src/main/java/com/pira/gnetp/utils/NetworkUtils.kt

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -39,45 +39,10 @@ object NetworkUtils {
3939
Logger.e(TAG, "Error getting available IPs", ex)
4040
}
4141

42-
// Add hotspot IP as default if not already present
43-
val hotspotIp = getHotspotIpAddress()
44-
if (!ips.contains(hotspotIp)) {
45-
ips.add(0, hotspotIp)
46-
}
47-
4842
Logger.d(TAG, "Available IPs: $ips")
4943
return ips
5044
}
5145

52-
/**
53-
* Get the IP address of the device's WiFi hotspot
54-
*/
55-
fun getHotspotIpAddress(): String {
56-
try {
57-
val interfaces = Collections.list(NetworkInterface.getNetworkInterfaces())
58-
for (intf in interfaces) {
59-
if (!intf.name.contains("wlan", ignoreCase = true) &&
60-
!intf.name.contains("ap", ignoreCase = true)) continue
61-
62-
val addresses = Collections.list(intf.inetAddresses)
63-
for (addr in addresses) {
64-
if (addr is Inet4Address && !addr.isLoopbackAddress) {
65-
val ip = addr.hostAddress ?: continue
66-
// Hotspot IPs typically start with 192.168.x.x
67-
if (ip.startsWith("192.168.")) {
68-
Logger.d(TAG, "Found hotspot IP: $ip")
69-
return ip
70-
}
71-
}
72-
}
73-
}
74-
} catch (ex: Exception) {
75-
Logger.e(TAG, "Error getting hotspot IP address", ex)
76-
}
77-
Logger.d(TAG, "Using default hotspot IP: 192.168.43.1")
78-
return "192.168.43.1" // Default fallback
79-
}
80-
8146
/**
8247
* Check if the device is connected to a VPN
8348
*/

0 commit comments

Comments
 (0)