From a1d9fdb7164a1eb88b995df0c42e5ffe019d752d Mon Sep 17 00:00:00 2001 From: Manuel del Olmo Pomares Date: Mon, 3 Feb 2020 11:06:57 +0100 Subject: [PATCH] Bum auth-lib and update keystore configuration in sample-auth --- app-remote-sample/build.gradle | 2 +- auth-lib/CHANGELOG.md | 4 ++++ auth-lib/README.md | 2 +- auth-sample/build.gradle | 17 +++++++++++++++-- auth-sample/keystore/example.keystore | Bin 0 -> 2259 bytes .../authentication/sample/MainActivity.java | 13 ++++++------- 6 files changed, 27 insertions(+), 11 deletions(-) create mode 100644 auth-sample/keystore/example.keystore diff --git a/app-remote-sample/build.gradle b/app-remote-sample/build.gradle index c5f0442..41ce007 100644 --- a/app-remote-sample/build.gradle +++ b/app-remote-sample/build.gradle @@ -21,8 +21,8 @@ description = 'Public App Remote SDK demo app' */ apply plugin: 'com.android.application' -apply plugin: 'kotlin-android-extensions' apply plugin: 'kotlin-android' +apply plugin: 'kotlin-android-extensions' android { diff --git a/auth-lib/CHANGELOG.md b/auth-lib/CHANGELOG.md index d9db3bd..316574a 100644 --- a/auth-lib/CHANGELOG.md +++ b/auth-lib/CHANGELOG.md @@ -1,5 +1,9 @@ Change Log ========== +## Version 1.2.3 +* Stability fixes on WebView based auth +* Set LoginActivity launch mode to CLEAR_TOP but not SINGLE_TOP, so the activity will be recreated + ## Version 1.2.2 * Remove custom-tabs handling due to issues diff --git a/auth-lib/README.md b/auth-lib/README.md index 31209cf..2107464 100644 --- a/auth-lib/README.md +++ b/auth-lib/README.md @@ -10,7 +10,7 @@ that can subsequently be used to play music or in requests to the [Spotify Web A To add this library to your project add the reference to its `build.gradle` file: ```gradle -implementation 'com.spotify.android:auth:1.2.2' +implementation 'com.spotify.android:auth:1.2.3' ``` To learn more about working with authentication see the diff --git a/auth-sample/build.gradle b/auth-sample/build.gradle index 12fc016..faf192e 100644 --- a/auth-sample/build.gradle +++ b/auth-sample/build.gradle @@ -26,6 +26,15 @@ android { buildToolsVersion androidBuildTools compileSdkVersion androidCompileSdk.toString().toInteger() + signingConfigs { + debug { + storeFile file('keystore/example.keystore') + storePassword 'example' + keyAlias 'example_alias' + keyPassword 'example' + } + } + defaultConfig { applicationId "com.spotify.sdk.android.authentication.sample" @@ -39,6 +48,10 @@ android { } buildTypes { + debug { + debuggable true + signingConfig signingConfigs.debug + } release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt') @@ -61,8 +74,8 @@ android { } dependencies { - //implementation files('../auth-lib/spotify-auth-release-1.2.2.aar') // Optional as local aar file dependency - implementation 'com.spotify.android:auth:1.2.2' // Maven dependency + //implementation files('../auth-lib/spotify-auth-release-1.2.3.aar') // Optional as local aar file dependency + implementation 'com.spotify.android:auth:1.2.3' // Maven dependency implementation "androidx.appcompat:appcompat:$appCompatVersion" implementation 'com.google.android.material:material:1.0.0' implementation 'com.squareup.okhttp3:okhttp:3.12.3' diff --git a/auth-sample/keystore/example.keystore b/auth-sample/keystore/example.keystore new file mode 100644 index 0000000000000000000000000000000000000000..38164a04c1ab78e2b5af0350e95e5128eb7eeb5e GIT binary patch literal 2259 zcmc&#={wX58~)8=ti#xuj6_0YeuE+MT26L4$rzy!S+Zni42M!^BE+#Il6@IvNzzzD zP1%aEmP7WkL}RBEnvUM(y3T*_ez-r}_jP}GuKRhe`{68emH_~O?gR2~AicueFOvhj z+}s0v-KqO3aWXwp1^~FAAPvp|1rdCz2nZZ<6eRjQh~1*F~2#yEeiHTanSI+z|_$+f!gA z4wX45w8K7CWuh$2wzAq_dI>kK=XCz%3SfI$Tj2*KlVoQ~?L^;^@Iv?EiiLpcm1?!v zbxxe{w?pT##%tNy^5IK}tLYw2(G$7m&Szq*!%dnyZks->B`_^F{ zX{7h5c4}|Wco?0@Pj&0%jSY8wa9VGck4^k8yAfX0ZLS8Hj|5jE(_1J)D#obLPn=RC0|xQ>_MOCt zvYQ1-1$vWTM1>QA&&8)S8#d&-ygsvjkKk0-HgT&Q40KZ!SCwD?TwCK5S~&2k@2am{ z$fI(}i;h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wYtP_G| ze*bFB`Dcjxx3wQ41aOsE${fvCXZti6gvH%2_;?@{<3OwLZ|6OVs@<9`D_2hbT<_?5 zzMS)ozZ;3__I|11(4$k%QR>x>s?tES2IyT}R-%f#$#}*oON&=-`1sQemIt%E6W!Tg zLmf{ROV))nP^go8q{WMmqSrvD_%4@@alEu(M`mr;;+|)`j$Y_SX?$=^oPbvgMBo&#CVGG~YI1xC3XP9@u*O@x3?dp&~ht zCeKD&F$S>niW}DR8e=Y&iy>v#c#f1OL}Y$uEBEBL)Ym1xPB`Y;>~B+CM|0L2t6G(5SPe<2foc%=|WWU51#EYVA|6)6ste**-E;{N~u literal 0 HcmV?d00001 diff --git a/auth-sample/src/main/java/com/spotify/sdk/android/authentication/sample/MainActivity.java b/auth-sample/src/main/java/com/spotify/sdk/android/authentication/sample/MainActivity.java index 25d6040..617d987 100644 --- a/auth-sample/src/main/java/com/spotify/sdk/android/authentication/sample/MainActivity.java +++ b/auth-sample/src/main/java/com/spotify/sdk/android/authentication/sample/MainActivity.java @@ -127,7 +127,9 @@ private AuthorizationRequest getAuthenticationRequest(AuthorizationResponse.Type protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); final AuthorizationResponse response = AuthorizationClient.getResponse(resultCode, data); - + if (response.getError() != null && response.getError().isEmpty()) { + setResponse(response.getError()); + } if (requestCode == AUTH_TOKEN_REQUEST_CODE) { mAccessToken = response.getAccessToken(); updateTokenView(); @@ -138,12 +140,9 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) { } private void setResponse(final String text) { - runOnUiThread(new Runnable() { - @Override - public void run() { - final TextView responseView = findViewById(R.id.response_text_view); - responseView.setText(text); - } + runOnUiThread(() -> { + final TextView responseView = findViewById(R.id.response_text_view); + responseView.setText(text); }); }