fix: getting the SSID via shell (#494)

This commit is contained in:
Marko Zajc 2024-12-14 16:18:35 +00:00 committed by GitHub
parent 68865843dc
commit b81f43c7cf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -84,8 +84,8 @@ fun Config.toWgQuickString(): String {
fun RootShell.getCurrentWifiName(): String? {
val response = mutableListOf<String>()
this.run(response, "dumpsys wifi | grep -o \"SSID: [^,]*\" | cut -d ' ' -f2- | tr -d '\"'")
return response.lastOrNull()
this.run(response, "dumpsys wifi | grep 'Supplicant state: COMPLETED' | grep -o 'SSID: [^,]*' | cut -d ' ' -f2- | tr -d '\"'")
return response.firstOrNull()
}
fun Backend.BackendState.asBackendState(): BackendState {