Skip to content

Commit a5bdef8

Browse files
fix NetworkAuth and separate YourSpot
1 parent ff239d2 commit a5bdef8

25 files changed

+81
-54
lines changed

liberator/src/main/kotlin/de/binarynoise/liberator/Liberator.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ class Liberator(
161161

162162

163163
val solver: PortalLiberator? = allPortalLiberators.firstOrNull { solver ->
164-
solver.canSolve(locationUrl)
164+
solver.canSolve(locationUrl, response)
165165
}
166166

167167
if (solver == null) {

liberator/src/main/kotlin/de/binarynoise/liberator/PortalLiberator.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ interface UnIndexedPortalLiberator {
2222
* This is typically the URL where the captive portal login page is hosted.
2323
* @return true if this liberator knows this captive portal and can solve it, false otherwise.
2424
*/
25-
fun canSolve(locationUrl: HttpUrl): Boolean
25+
fun canSolve(locationUrl: HttpUrl, response: Response): Boolean
2626

2727
/**
2828
* Attempts to solve the captive portal by performing the necessary authentication actions.

liberator/src/main/kotlin/de/binarynoise/liberator/portals/AenaES.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import org.json.JSONObject
2323
@Suppress("SpellCheckingInspection", "GrazieInspection", "LocalVariableName", "RedundantSuppression")
2424
@SSID("AIRPORT FREE WIFI AENA")
2525
object AenaES : PortalLiberator {
26-
override fun canSolve(locationUrl: HttpUrl): Boolean {
26+
override fun canSolve(locationUrl: HttpUrl, response: Response): Boolean {
2727
return PortalLiberatorConfig.experimental && "freewifi.aena.es" == locationUrl.host
2828
}
2929

liberator/src/main/kotlin/de/binarynoise/liberator/portals/BinarynoisePortalProxy.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import okhttp3.Response
1212

1313
@Suppress("SpellCheckingInspection", "GrazieInspection", "LocalVariableName", "RedundantSuppression")
1414
object BinarynoisePortalProxy : PortalLiberator {
15-
override fun canSolve(locationUrl: HttpUrl): Boolean {
15+
override fun canSolve(locationUrl: HttpUrl, response: Response): Boolean {
1616
return PortalLiberatorConfig.experimental && locationUrl.host == "binarynoise.de" && locationUrl.port == 8000
1717
}
1818

liberator/src/main/kotlin/de/binarynoise/liberator/portals/CloudWifiDE.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import okhttp3.Response
2020
@Suppress("SpellCheckingInspection", "GrazieInspection", "LocalVariableName", "RedundantSuppression")
2121
@SSID("-free Milaneo Stuttgart")
2222
object CloudWifiDE : PortalLiberator {
23-
override fun canSolve(locationUrl: HttpUrl): Boolean {
23+
override fun canSolve(locationUrl: HttpUrl, response: Response): Boolean {
2424
return "start.cloudwifi.de" == locationUrl.host
2525
}
2626

@@ -66,8 +66,8 @@ object CloudWifiDE : PortalLiberator {
6666

6767
@SSID("-free Koenigsbau Passagen", "-Free -Thier Galerie Dortmund")
6868
object SomethingDotCloudWifiDE : PortalLiberator {
69-
override fun canSolve(locationUrl: HttpUrl): Boolean {
70-
return locationUrl.host.endsWith(".cloudwifi.de") && !CloudWifiDE.canSolve(locationUrl)
69+
override fun canSolve(locationUrl: HttpUrl, response: Response): Boolean {
70+
return locationUrl.host.endsWith(".cloudwifi.de") && !CloudWifiDE.canSolve(locationUrl, response)
7171
}
7272

7373
override fun solve(locationUrl: HttpUrl, client: OkHttpClient, response: Response, cookies: Set<Cookie>) {

liberator/src/main/kotlin/de/binarynoise/liberator/portals/Commerzbank.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import okhttp3.Response
1010

1111
@Suppress("SpellCheckingInspection", "GrazieInspection", "LocalVariableName", "RedundantSuppression")
1212
object Commerzbank : PortalLiberator {
13-
override fun canSolve(locationUrl: HttpUrl): Boolean {
13+
override fun canSolve(locationUrl: HttpUrl, response: Response): Boolean {
1414
return "wifiaccess.co" == locationUrl.host && locationUrl.pathSegments.lastOrNull() == "portal"
1515
}
1616

liberator/src/main/kotlin/de/binarynoise/liberator/portals/Conn4.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import org.json.JSONObject
2020
// Kaufland, Rewe
2121
@Suppress("SpellCheckingInspection", "GrazieInspection", "LocalVariableName", "RedundantSuppression")
2222
object Conn4 : PortalLiberator {
23-
override fun canSolve(locationUrl: HttpUrl): Boolean {
23+
override fun canSolve(locationUrl: HttpUrl, response: Response): Boolean {
2424
return PortalLiberatorConfig.experimental && locationUrl.host.endsWith(".conn4.com") && locationUrl.firstPathSegment == "ident"
2525
}
2626

liberator/src/main/kotlin/de/binarynoise/liberator/portals/DBWifi.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ object DBWifi : PortalLiberator {
2525
"wifi.bahn.de",
2626
)
2727

28-
override fun canSolve(locationUrl: HttpUrl): Boolean {
28+
override fun canSolve(locationUrl: HttpUrl, response: Response): Boolean {
2929
return locationUrl.host in domains
3030
}
3131

liberator/src/main/kotlin/de/binarynoise/liberator/portals/Dokom21Hotspot.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import okhttp3.Response
1818
@Suppress("SpellCheckingInspection", "GrazieInspection", "LocalVariableName", "RedundantSuppression")
1919
@SSID("DSW21-WLAN", "Hotspot Westfalenhallen")
2020
object Dokom21Hotspot : PortalLiberator {
21-
override fun canSolve(locationUrl: HttpUrl): Boolean {
21+
override fun canSolve(locationUrl: HttpUrl, response: Response): Boolean {
2222
return "hotspot.dokom21.de" == locationUrl.host && "/([^/]+)/Index".toRegex().matches(locationUrl.encodedPath)
2323
}
2424

liberator/src/main/kotlin/de/binarynoise/liberator/portals/FritzBox.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import okhttp3.Response
1111

1212
@Suppress("SpellCheckingInspection", "GrazieInspection", "LocalVariableName", "RedundantSuppression")
1313
object FritzBox : PortalLiberator {
14-
override fun canSolve(locationUrl: HttpUrl): Boolean {
14+
override fun canSolve(locationUrl: HttpUrl, response: Response): Boolean {
1515
return "untrusted_guest.lua" == locationUrl.firstPathSegment
1616
}
1717

0 commit comments

Comments
 (0)