Skip to content

Commit 590a6f2

Browse files
committed
Fixing a security issue which is banned by google play.
1 parent 34a23f8 commit 590a6f2

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

library/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ apply plugin: 'com.android.library'
22

33
android {
44
compileSdkVersion 23
5-
buildToolsVersion '23.0.1'
5+
buildToolsVersion '23.0.3'
66

77
defaultConfig {
8-
minSdkVersion 3
8+
minSdkVersion 9
99
targetSdkVersion 23
1010
consumerProguardFiles 'proguard.txt'
1111
}

library/src/main/java/com/loopj/android/http/PersistentCookieStore.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public void addCookie(Cookie cookie) {
9797
SharedPreferences.Editor prefsWriter = cookiePrefs.edit();
9898
prefsWriter.putString(COOKIE_NAME_STORE, TextUtils.join(",", cookies.keySet()));
9999
prefsWriter.putString(COOKIE_NAME_PREFIX + name, encodeCookie(new SerializableCookie(cookie)));
100-
prefsWriter.commit();
100+
prefsWriter.apply();
101101
}
102102

103103
@Override
@@ -108,7 +108,7 @@ public void clear() {
108108
prefsWriter.remove(COOKIE_NAME_PREFIX + name);
109109
}
110110
prefsWriter.remove(COOKIE_NAME_STORE);
111-
prefsWriter.commit();
111+
prefsWriter.apply();
112112

113113
// Clear cookies from local store
114114
cookies.clear();
@@ -138,7 +138,7 @@ public boolean clearExpired(Date date) {
138138
if (clearedAny) {
139139
prefsWriter.putString(COOKIE_NAME_STORE, TextUtils.join(",", cookies.keySet()));
140140
}
141-
prefsWriter.commit();
141+
prefsWriter.apply();
142142

143143
return clearedAny;
144144
}
@@ -168,7 +168,7 @@ public void deleteCookie(Cookie cookie) {
168168
cookies.remove(name);
169169
SharedPreferences.Editor prefsWriter = cookiePrefs.edit();
170170
prefsWriter.remove(COOKIE_NAME_PREFIX + name);
171-
prefsWriter.commit();
171+
prefsWriter.apply();
172172
}
173173

174174
/**

sample/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@ repositories {
99

1010
android {
1111
compileSdkVersion 23
12-
buildToolsVersion '23.0.1'
12+
buildToolsVersion '23.0.3'
1313

1414
defaultConfig {
15-
minSdkVersion 3
15+
minSdkVersion 9
1616
targetSdkVersion 23
1717
}
1818

1919
productFlavors {
2020
standard {
2121
}
2222
withLeakCanary {
23-
minSdkVersion 8
23+
minSdkVersion 9
2424
targetSdkVersion 23
2525
}
2626
}

0 commit comments

Comments
 (0)