Skip to content
This repository was archived by the owner on Dec 8, 2022. It is now read-only.

Commit 53deedb

Browse files
committed
Merge pull request #471 from nelenkov/master
preparing for maintenance release
2 parents 5d1a5ce + a5454be commit 53deedb

File tree

6 files changed

+10
-38
lines changed

6 files changed

+10
-38
lines changed

AndroidManifest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
xmlns:tools="http://schemas.android.com/tools"
44
package="com.github.andlyticsproject"
55
android:installLocation="auto"
6-
android:versionCode="231"
7-
android:versionName="2.5.4" >
6+
android:versionCode="233"
7+
android:versionName="2.5.5" >
88

99
<uses-permission android:name="android.permission.INTERNET" />
1010
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

res/raw/changelog.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414
</head>
1515
<body>
1616
<ul id="changelog">
17+
<li>v2.5.5
18+
<ul>
19+
<li>API update</li>
20+
</ul>
21+
</li>
1722
<li>v2.5.4
1823
<ul>
1924
<li>API update</li>

src/com/github/andlyticsproject/console/v2/AccountManagerAuthenticator.java

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
import org.apache.http.HttpEntity;
77
import org.apache.http.HttpResponse;
88
import org.apache.http.HttpStatus;
9-
import org.apache.http.client.CookieStore;
109
import org.apache.http.client.methods.HttpGet;
11-
import org.apache.http.cookie.Cookie;
1210
import org.apache.http.impl.client.DefaultHttpClient;
1311
import org.apache.http.util.EntityUtils;
1412

@@ -173,18 +171,6 @@ private SessionCredentials authenticateInternal(Activity activity, boolean inval
173171
Log.d(TAG, "Response: " + responseStr);
174172
}
175173

176-
CookieStore cookieStore = httpClient.getCookieStore();
177-
List<Cookie> cookies = cookieStore.getCookies();
178-
String adCookie = findAdCookie(cookies);
179-
if (DEBUG) {
180-
Log.d(TAG, "AD cookie " + adCookie);
181-
}
182-
if (adCookie == null) {
183-
debugAuthFailure(activity, responseStr);
184-
185-
throw new AuthenticationException("Couldn't get AD cookie.");
186-
}
187-
188174
DeveloperConsoleAccount[] developerAccounts = findDeveloperAccounts(responseStr);
189175
if (developerAccounts == null) {
190176
debugAuthFailure(activity, responseStr);
@@ -203,7 +189,7 @@ private SessionCredentials authenticateInternal(Activity activity, boolean inval
203189

204190
SessionCredentials result = new SessionCredentials(accountName, xsrfToken,
205191
developerAccounts);
206-
result.addCookies(cookies);
192+
result.addCookies(httpClient.getCookieStore().getCookies());
207193
result.addWhitelistedFeatures(whitelistedFeatures);
208194

209195
return result;

src/com/github/andlyticsproject/console/v2/BaseAuthenticator.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import java.util.regex.Pattern;
88

99
import org.apache.commons.lang3.StringEscapeUtils;
10-
import org.apache.http.cookie.Cookie;
1110

1211
import com.github.andlyticsproject.model.DeveloperConsoleAccount;
1312

@@ -29,15 +28,6 @@ protected BaseAuthenticator(String accountName) {
2928
this.accountName = accountName;
3029
}
3130

32-
protected String findAdCookie(List<Cookie> cookies) {
33-
for (Cookie c : cookies) {
34-
if ("AD".equals(c.getName())) {
35-
return c.getValue();
36-
}
37-
}
38-
return null;
39-
}
40-
4131
protected String findXsrfToken(String responseStr) {
4232
Matcher m = XSRF_TOKEN_PATTERN.matcher(responseStr);
4333
if (m.find()) {

src/com/github/andlyticsproject/console/v2/DevConsoleV2Protocol.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public class DevConsoleV2Protocol {
3636
+ "\"params\":{\"1\":[\"%1$s\"]},\"xsrf\":\"%2$s\"}";
3737
// 1$: package name, 2$: start, 3$: num comments to fetch, 4$: display locale, 5$ XSRF
3838
static final String GET_REVIEWS_TEMPLATE = "{\"method\":\"getReviews\","
39-
+ "\"params\":{\"1\":\"%1$s\",\"2\":%2$d,\"3\":%3$d,\"8\":%4$s},\"xsrf\":\"%5$s\"}";
39+
+ "\"params\":{\"1\":\"%1$s\",\"2\":%2$d,\"3\":%3$d,\"8\":\"%4$s\"},\"xsrf\":\"%5$s\"}";
4040
// 1$: package name, 2$: stats type, 3$: stats by, 4$: XSRF
4141
static final String GET_COMBINED_STATS_TEMPLATE = "{\"method\":\"getCombinedStats\","
4242
+ "\"params\":{\"1\":\"%1$s\",\"2\":1,\"3\":%2$d,\"4\":[%3$d]},\"xsrf\":\"%4$s\"}";

src/com/github/andlyticsproject/console/v2/PasswordAuthenticator.java

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,6 @@ private SessionCredentials authenticate() throws AuthenticationException {
9090
throw new AuthenticationException("Auth error: " + response.getStatusLine());
9191
}
9292

93-
cookies = cookieStore.getCookies();
94-
String adCookie = findAdCookie(cookies);
95-
if (DEBUG) {
96-
Log.d(TAG, "AD cookie " + adCookie);
97-
}
98-
if (adCookie == null) {
99-
throw new AuthenticationException("Couldn't get AD cookie.");
100-
}
101-
10293
String responseStr = EntityUtils.toString(response.getEntity());
10394
if (DEBUG) {
10495
Log.d(TAG, "Response: " + responseStr);
@@ -117,7 +108,7 @@ private SessionCredentials authenticate() throws AuthenticationException {
117108

118109
SessionCredentials result = new SessionCredentials(accountName, xsrfToken,
119110
developerAccounts);
120-
result.addCookies(cookies);
111+
result.addCookies(cookieStore.getCookies());
121112
result.addWhitelistedFeatures(whitelistedFeatures);
122113

123114
return result;

0 commit comments

Comments
 (0)