This repository was archived by the owner on Mar 19, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +14
-12
lines changed
src/main/java/com/owncloud/android/lib/common Expand file tree Collapse file tree 5 files changed +14
-12
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,8 @@ dependencies {
7
7
implementation " org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion "
8
8
api ' com.gitlab.ownclouders:dav4android:oc_support_2.1.5'
9
9
api ' com.github.AppDevNext.Logcat:LogcatCore:2.2.2'
10
+ debugImplementation ' com.facebook.stetho:stetho:1.5.1'
11
+ debugImplementation ' com.facebook.stetho:stetho-okhttp3:1.5.1'
10
12
11
13
// Moshi
12
14
implementation(" com.squareup.moshi:moshi-kotlin:$moshiVersion " ) {
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ class ConnectionValidator (
21
21
var validationRetryCount = 0
22
22
val client = OwnCloudClient (baseClient.baseUri, null , false )
23
23
if (clearCookiesOnValidation) {
24
- client.clearCookies()
24
+ client.clearCookies();
25
25
} else {
26
26
client.cookiesForBaseUri = baseClient.cookiesForBaseUri
27
27
}
@@ -84,7 +84,7 @@ class ConnectionValidator (
84
84
}
85
85
86
86
private fun triggerAuthRefresh (): OwnCloudCredentials {
87
- // TODO: Implement me
87
+ Timber .d( " !!!!!!!!!!!!!!!!!!!!!!!!!!!! need to reauthenticate !!!!!!!!!!!!!!!!!!!!!!!!!! " )
88
88
return OwnCloudCredentialsFactory .getAnonymousCredentials()
89
89
}
90
90
Original file line number Diff line number Diff line change @@ -340,10 +340,6 @@ public List<Cookie> getCookiesForBaseUri() {
340
340
HttpUrl .parse (mBaseUri .toString ()));
341
341
}
342
342
343
- public void clearCookies () {
344
- setCookiesForBaseUri (new ArrayList <>());
345
- }
346
-
347
343
public OwnCloudVersion getOwnCloudVersion () {
348
344
return mVersion ;
349
345
}
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ import okhttp3.CookieJar
28
28
import okhttp3.HttpUrl
29
29
30
30
class CookieJarImpl (
31
- private val sCookieStore : HashMap <String , List <Cookie >>
31
+ private val cookieStore : HashMap <String , List <Cookie >>
32
32
) : CookieJar {
33
33
34
34
fun containsCookieWithName (cookies : List <Cookie >, name : String ): Boolean {
@@ -52,12 +52,11 @@ class CookieJarImpl(
52
52
53
53
override fun saveFromResponse (url : HttpUrl , cookies : List <Cookie >) {
54
54
// Avoid duplicated cookies but update
55
- val currentCookies: List <Cookie > = sCookieStore [url.host] ? : ArrayList ()
55
+ val currentCookies: List <Cookie > = cookieStore [url.host] ? : ArrayList ()
56
56
val updatedCookies: List <Cookie > = getUpdatedCookies(currentCookies, cookies)
57
- sCookieStore [url.host] = updatedCookies
57
+ cookieStore [url.host] = updatedCookies
58
58
}
59
59
60
60
override fun loadForRequest (url : HttpUrl ) =
61
- sCookieStore[url.host] ? : ArrayList ()
62
-
63
- }
61
+ cookieStore[url.host] ? : ArrayList ()
62
+ }
Original file line number Diff line number Diff line change 26
26
27
27
import android .content .Context ;
28
28
29
+ import com .facebook .stetho .okhttp3 .StethoInterceptor ;
29
30
import com .owncloud .android .lib .common .network .AdvancedX509TrustManager ;
30
31
import com .owncloud .android .lib .common .network .NetworkUtils ;
31
32
import okhttp3 .Cookie ;
@@ -139,4 +140,8 @@ public Context getContext() {
139
140
public static void setContext (Context context ) {
140
141
sContext = context ;
141
142
}
143
+
144
+ public void clearCookies () {
145
+ sCookieStore .clear ();
146
+ }
142
147
}
You can’t perform that action at this time.
0 commit comments