Skip to content

Commit

Permalink
fix(dependency): update okhttp version to 4.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
genshen committed Jul 11, 2019
1 parent 3c78eb9 commit 1e1bbc3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 0 additions & 2 deletions app/src/main/java/me/gensh/service/CampusNetworkTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@
*/

public class CampusNetworkTest extends IntentService implements HttpRequestTask.OnTaskFinished {
final String TEST_URL = "http://www.sohu.com";
final String TEST_TAG = "test connection";
final static String INTENT_EXTRA_SSID = "ssid";
final int NETWORK_SING_IN_NOTIFY_ID = 10;
final int AUTO_SIGN_IN_ERROR_NOTIFY_ID = 12;
Expand Down
2 changes: 1 addition & 1 deletion http-ustb/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
// <html><head><script type="text/javascript">location.href="http://202.204.48.66"</script></head><body><a href="http://202.204.48.66"></a></body></html>
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
}
Expand Down

0 comments on commit 1e1bbc3

Please sign in to comment.