From 249c935f449f94778911218d79ec92737d907999 Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Wed, 2 Dec 2015 23:55:47 -0800 Subject: [PATCH] Update Auth API --- extern/GmsApi | 2 +- .../src/main/AndroidManifest.xml | 4 +-- .../java/org/microg/gms/auth/AuthManager.java | 9 +++++- .../gms/auth/AuthManagerServiceImpl.java | 29 ++++++++++++++----- .../org/microg/gms/auth/AuthResponse.java | 26 +++++++++++++++++ 5 files changed, 59 insertions(+), 11 deletions(-) diff --git a/extern/GmsApi b/extern/GmsApi index 5ed675a9..a55281ec 160000 --- a/extern/GmsApi +++ b/extern/GmsApi @@ -1 +1 @@ -Subproject commit 5ed675a90b0d9831b06845ba2b95d7de3433acf6 +Subproject commit a55281ec5d48681e071b85290fc020ea56af482c diff --git a/play-services-core/src/main/AndroidManifest.xml b/play-services-core/src/main/AndroidManifest.xml index 3c1fd1b8..d43ace4e 100644 --- a/play-services-core/src/main/AndroidManifest.xml +++ b/play-services-core/src/main/AndroidManifest.xml @@ -17,8 +17,8 @@ + android:versionCode="8489238" + android:versionName="8.4.89 (microG v0.02)"> getScopes(String scope) { + if (!scope.startsWith("oauth2:")) return null; + String[] strings = scope.substring(7).split(" "); + List res = new ArrayList(); + for (String string : strings) { + res.add(new Scope(string)); + } + return res; } private static CharSequence getPackageLabel(String packageName, PackageManager pm) { diff --git a/play-services-core/src/main/java/org/microg/gms/auth/AuthResponse.java b/play-services-core/src/main/java/org/microg/gms/auth/AuthResponse.java index 24fb4c64..af585964 100644 --- a/play-services-core/src/main/java/org/microg/gms/auth/AuthResponse.java +++ b/play-services-core/src/main/java/org/microg/gms/auth/AuthResponse.java @@ -92,4 +92,30 @@ public class AuthResponse { } return response; } + + @Override + public String toString() { + final StringBuilder sb = new StringBuilder("AuthResponse{"); + sb.append("auth='").append(auth).append('\''); + if (Sid != null) sb.append(", Sid='").append(Sid).append('\''); + if (LSid != null) sb.append(", LSid='").append(LSid).append('\''); + if (token != null) sb.append(", token='").append(token).append('\''); + if (email != null) sb.append(", email='").append(email).append('\''); + if (services != null) sb.append(", services='").append(services).append('\''); + if (isGooglePlusUpgrade) sb.append(", isGooglePlusUpgrade=").append(isGooglePlusUpgrade); + if (picasaUserName != null) sb.append(", picasaUserName='").append(picasaUserName).append('\''); + if (ropText != null) sb.append(", ropText='").append(ropText).append('\''); + if (ropRevision != 0) sb.append(", ropRevision=").append(ropRevision); + if (firstName != null) sb.append(", firstName='").append(firstName).append('\''); + if (lastName != null) sb.append(", lastName='").append(lastName).append('\''); + if (issueAdvice != null) sb.append(", issueAdvice='").append(issueAdvice).append('\''); + if (accountId != null) sb.append(", accountId='").append(accountId).append('\''); + if (expiry != -1) sb.append(", expiry=").append(expiry); + if (!storeConsentRemotely) sb.append(", storeConsentRemotely=").append(storeConsentRemotely); + if (permission != null) sb.append(", permission='").append(permission).append('\''); + if (scopeConsentDetails != null) sb.append(", scopeConsentDetails='").append(scopeConsentDetails).append('\''); + if (consentDataBase64 != null) sb.append(", consentDataBase64='").append(consentDataBase64).append('\''); + sb.append('}'); + return sb.toString(); + } }