mirror of
https://github.com/whyorean/AuroraStore.git
synced 2026-06-16 11:42:16 -04:00
Fixed token not being used right after log in.
This commit is contained in:
@@ -3,14 +3,14 @@ apply plugin: 'com.google.protobuf'
|
||||
|
||||
android {
|
||||
compileSdkVersion 25
|
||||
buildToolsVersion "25.0.1"
|
||||
buildToolsVersion "25.0.2"
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.github.yeriomin.yalpstore"
|
||||
minSdkVersion 10
|
||||
targetSdkVersion 25
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
versionName "0.1"
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
|
||||
@@ -89,14 +89,8 @@ class ThrottledHttpClient extends DefaultHttpClient {
|
||||
HttpResponse response = this.execute(request);
|
||||
this.lastRequestTime = System.currentTimeMillis();
|
||||
int statusCode = response.getStatusLine().getStatusCode();
|
||||
boolean isProtobuf = response.containsHeader("Content-Type")
|
||||
&& response.getHeaders("Content-Type")[0].getValue().contains("protobuf");
|
||||
byte[] content = readAll(response.getEntity().getContent());
|
||||
|
||||
if (!isProtobuf) {
|
||||
throw new GooglePlayException(String.valueOf(statusCode) + " Thats not even protobuf: " + new String(content), statusCode);
|
||||
}
|
||||
|
||||
if (statusCode >= 400) {
|
||||
throw new GooglePlayException(String.valueOf(statusCode) + " Probably an auth error: " + new String(content), statusCode);
|
||||
}
|
||||
|
||||
@@ -112,20 +112,18 @@ public class PlayStoreApiWrapper {
|
||||
gsfId = api.getGsfId();
|
||||
prefsEditor.putString(AppListActivity.PREFERENCE_GSF_ID, gsfId);
|
||||
prefsEditor.commit();
|
||||
} else {
|
||||
api.setGsfId(gsfId);
|
||||
System.out.println("new gsfId " + gsfId);
|
||||
}
|
||||
System.out.println("new gsfId " + gsfId);
|
||||
api.setGsfId(gsfId);
|
||||
if (token.isEmpty()) {
|
||||
token = api.getToken();
|
||||
prefsEditor.putString(AppListActivity.PREFERENCE_EMAIL, email);
|
||||
prefsEditor.putString(AppListActivity.PREFERENCE_PASSWORD, password);
|
||||
prefsEditor.putString(AppListActivity.PREFERENCE_AUTH_TOKEN, token);
|
||||
prefsEditor.commit();
|
||||
} else {
|
||||
api.setToken(token);
|
||||
System.out.println("new token " + token);
|
||||
}
|
||||
System.out.println("new token " + token);
|
||||
api.setToken(token);
|
||||
} catch (GooglePlayException e) {
|
||||
int code = e.getCode();
|
||||
// auth/checkin requests answer with 401/403 when credentials are incorrect
|
||||
|
||||
Reference in New Issue
Block a user