diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index dd7699b..757942a 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -5,7 +5,6 @@ - @@ -18,6 +17,7 @@ android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" + android:networkSecurityConfig="@xml/network_security_config" android:theme="@style/AppTheme"> + + + teach.ustb.edu.cn + elearning.ustb.edu.cn + e.ustb.edu.cn + h.ustb.edu.cn + 202.204.48.82 + 202.204.48.66 + zhiyuan.ustb.edu.cn + lib.ustb.edu.cn + lib1.ustb.edu.cn + connect.rom.miui.com + + diff --git a/http-ustb/build.gradle b/http-ustb/build.gradle index df36e76..93f5069 100644 --- a/http-ustb/build.gradle +++ b/http-ustb/build.gradle @@ -7,7 +7,7 @@ tasks.withType(JavaCompile) { dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) - compile 'com.squareup.okhttp3:okhttp:3.10.0' + compile 'com.squareup.okhttp3:okhttp:4.0.0' compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" } sourceCompatibility = "1.7" diff --git a/http-ustb/src/main/java/me/gensh/helloustb/http/portal/WifiPortal.kt b/http-ustb/src/main/java/me/gensh/helloustb/http/portal/WifiPortal.kt index 180ef16..cb82eef 100644 --- a/http-ustb/src/main/java/me/gensh/helloustb/http/portal/WifiPortal.kt +++ b/http-ustb/src/main/java/me/gensh/helloustb/http/portal/WifiPortal.kt @@ -28,12 +28,12 @@ class WifiPortal { try { val response: Response = client.newCall(request).execute() val status = Status() - if (response.code() == 200) { //not 204. + if (response.code == 200) { //not 204. status.needAuth = true // try to resolve html content. // - if (response.body() != null) { - val body = response.body()!!.string() + if (response.body != null) { + val body = response.body !!.string() if (body.contains(REDIRECT_URL1) || body.contains(REDIRECT_URL2)) { status.isInnerNet = true }