GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Merge pull request #1258 from firebase/version-3.3.1 · albz657/FirebaseUI-Android@4bedc0f

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • .travis.yml
  • README.md
  • auth
    • README.md
    • auth-proguard.pro
    • src
      • main
        • java/com/firebase/ui/auth
          • AuthUI.java
          • data
            • model
              • FlowParameters.java
              • Resource.java
            • remote
              • FacebookSignInHandler.java
              • SignInKickstarter.java
              • TwitterSignInHandler.java
          • ui
            • AppCompatBase.java
            • FragmentBase.java
            • HelperActivityBase.java
            • credentials
              • CredentialSaveActivity.java
            • email
              • CheckEmailFragment.java
              • CheckEmailHandler.java
              • EmailActivity.java
              • RecoverPasswordActivity.java
              • RegisterEmailFragment.java
              • WelcomeBackPasswordPrompt.java
            • idp
              • AuthMethodPickerActivity.java
              • SingleSignInActivity.java
            • phone
              • VerifyPhoneNumberFragment.java
          • util
            • CredentialUtils.java
            • CredentialsUtil.java
            • ExtraConstants.java
            • data
              • ProviderUtils.java
            • ui
              • FlowUtils.java
          • viewmodel
            • FlowHolder.java
            • ResourceObserver.java
            • VoidResourceObserver.java
            • idp
              • EmailProviderResponseHandler.java
              • SocialProviderResponseHandler.java
            • smartlock
              • SmartLockHandler.java
        • res
          • values-ar
            • strings.xml
          • values-b+es+419
            • strings.xml
          • values-bg
            • strings.xml
          • values-bn
            • strings.xml
          • values-ca
            • strings.xml
          • values-cs
            • strings.xml
          • values-da
            • strings.xml
          • values-de-rAT
            • strings.xml
          • values-de-rCH
            • strings.xml
          • values-de
            • strings.xml
          • values-el
            • strings.xml
          • values-en-rAU
            • strings.xml
          • values-en-rCA
            • strings.xml
          • values-en-rGB
            • strings.xml
          • values-en-rIE
            • strings.xml
          • values-en-rIN
            • strings.xml
          • values-en-rSG
            • strings.xml
          • values-en-rZA
            • strings.xml
          • values-es-rAR
            • strings.xml
          • values-es-rBO
            • strings.xml
          • values-es-rCL
            • strings.xml
          • values-es-rCO
            • strings.xml
          • values-es-rCR
            • strings.xml
          • values-es-rDO
            • strings.xml
          • values-es-rEC
            • strings.xml
          • values-es-rGT
            • strings.xml
          • values-es-rHN
            • strings.xml
          • values-es-rMX
            • strings.xml
          • values-es-rNI
            • strings.xml
          • values-es-rPA
            • strings.xml
          • values-es-rPE
            • strings.xml
          • values-es-rPR
            • strings.xml
          • values-es-rPY
            • strings.xml
          • values-es-rSV
            • strings.xml
          • values-es-rUS
            • strings.xml
          • values-es-rUY
            • strings.xml
          • values-es-rVE
            • strings.xml
          • values-es
            • strings.xml
          • values-fa
            • strings.xml
          • values-fil
            • strings.xml
          • values-fi
            • strings.xml
          • values-fr-rCH
            • strings.xml
          • values-fr
            • strings.xml
          • values-gsw
            • strings.xml
          • values-gu
            • strings.xml
          • values-hi
            • strings.xml
          • values-hr
            • strings.xml
          • values-hu
            • strings.xml
          • values-in
            • strings.xml
          • values-it
            • strings.xml
          • values-iw
            • strings.xml
          • values-ja
            • strings.xml
          • values-kn
            • strings.xml
          • values-ko
            • strings.xml
          • values-ln
            • strings.xml
          • values-lt
            • strings.xml
          • values-lv
            • strings.xml
          • values-mo
            • strings.xml
          • values-mr
            • strings.xml
          • values-ms
            • strings.xml
          • values-nb
            • strings.xml
          • values-nl
            • strings.xml
          • values-no
            • strings.xml
          • values-pl
            • strings.xml
          • values-pt-rBR
            • strings.xml
          • values-pt-rPT
            • strings.xml
          • values-pt
            • strings.xml
          • values-ro
            • strings.xml
          • values-ru
            • strings.xml
          • values-sk
            • strings.xml
          • values-sl
            • strings.xml
          • values-sr
            • strings.xml
          • values-sv
            • strings.xml
          • values-ta
            • strings.xml
          • values-th
            • strings.xml
          • values-tl
            • strings.xml
          • values-tr
            • strings.xml
          • values-uk
            • strings.xml
          • values-ur
            • strings.xml
          • values-vi
            • strings.xml
          • values-zh-rCN
            • strings.xml
          • values-zh-rHK
            • strings.xml
          • values-zh-rTW
            • strings.xml
          • values-zh
            • strings.xml
          • values
            • strings.xml
      • test/java/com/firebase/ui/auth
        • testhelpers
          • AutoCompleteTask.java
        • ui/email
          • EmailActivityTest.java
          • WelcomeBackPasswordPromptTest.java
        • viewmodel
          • SmartLockHandlerTest.java
          • SocialProviderResponseHandlerTest.java
  • build.gradle
  • constants.gradle
  • proguard-tests
    • build.gradle
    • src/main
      • AndroidManifest.xml
  • settings.gradle

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎.travis.yml‎

Copy file name to clipboardExpand all lines: .travis.yml
+4-2Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@ android:
2222
# https://github.com/travis-ci/travis-ci/issues/6040#issuecomment-219367943
2323
- tools
2424
- tools
25-
before_script: mv library/google-services.json app/google-services.json
26-
script: ./gradlew clean assembleDebug check
25+
before_script:
26+
- cp library/google-services.json app/google-services.json
27+
- cp library/google-services.json proguard-tests/google-services.json
28+
script: ./gradlew clean assembleDebug proguard-tests:build check
2729
after_success: ./scripts/artifactory.sh
2830
after_failure:
2931
# tests
Collapse file

‎README.md‎

Copy file name to clipboardExpand all lines: README.md
+5-13Lines changed: 5 additions & 13 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,16 @@ libraries.
4747
```groovy
4848
dependencies {
4949
// FirebaseUI for Firebase Realtime Database
50-
implementation 'com.firebaseui:firebase-ui-database:3.3.0'
50+
implementation 'com.firebaseui:firebase-ui-database:3.3.1'
5151
5252
// FirebaseUI for Cloud Firestore
53-
implementation 'com.firebaseui:firebase-ui-firestore:3.3.0'
53+
implementation 'com.firebaseui:firebase-ui-firestore:3.3.1'
5454
5555
// FirebaseUI for Firebase Auth
56-
implementation 'com.firebaseui:firebase-ui-auth:3.3.0'
56+
implementation 'com.firebaseui:firebase-ui-auth:3.3.1'
5757
5858
// FirebaseUI for Cloud Storage
59-
implementation 'com.firebaseui:firebase-ui-storage:3.3.0'
59+
implementation 'com.firebaseui:firebase-ui-storage:3.3.1'
6060
}
6161
```
6262

@@ -103,21 +103,13 @@ For convenience, here are some recent examples:
103103

104104
| FirebaseUI Version | Firebase/Play Services Version |
105105
|--------------------|--------------------------------|
106+
| 3.3.1 | 15.0.0 |
106107
| 3.3.0 | 12.0.1 |
107108
| 3.2.2 | 11.8.0 |
108109
| 3.1.3 | 11.8.0 |
109-
| 3.1.2 | 11.6.2 |
110-
| 3.1.0 | 11.4.2 |
111110
| 3.0.0 | 11.4.2 |
112111
| 2.4.0 | 11.4.0 |
113-
| 2.3.0 | 11.0.4 |
114-
| 2.2.0 | 11.0.4 |
115-
| 2.1.1 | 11.0.2 |
116-
| 2.0.1 | 11.0.1 |
117-
| 1.2.0 | 10.2.0 |
118112
| 1.1.1 | 10.0.0 or 10.0.1 |
119-
| 1.0.1 | 10.0.0 or 10.0.1 |
120-
| 1.0.0 | 9.8.0 |
121113

122114

123115
### Upgrading dependencies
Collapse file

‎auth/README.md‎

Copy file name to clipboardExpand all lines: auth/README.md
+1-1Lines changed: 1 addition & 1 deletion
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ Gradle, add the dependency:
6262
```groovy
6363
dependencies {
6464
// ...
65-
implementation 'com.firebaseui:firebase-ui-auth:3.3.0'
65+
implementation 'com.firebaseui:firebase-ui-auth:3.3.1'
6666
6767
// Required only if Facebook login support is required
6868
// Find the latest Facebook SDK releases here: https://goo.gl/Ce5L94
Collapse file

‎auth/auth-proguard.pro‎

Copy file name to clipboardExpand all lines: auth/auth-proguard.pro
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Twitter and Facebook are optional
2-
-dontwarn com.twitter.**
32
-dontwarn com.facebook.**
4-
-dontwarn com.firebase.ui.auth.provider.**
3+
-dontwarn com.twitter.**
54

65
# Don't note a bunch of dynamically referenced classes
76
-dontnote com.google.**
@@ -16,5 +15,6 @@
1615

1716
# Retrofit config
1817
-dontnote retrofit2.Platform
19-
-dontwarn retrofit2.Platform$Java8
18+
-dontwarn retrofit2.** # Also keeps Twitter at bay as long as they keep using Retrofit
19+
-dontwarn okio.**
2020
-keepattributes Exceptions
Collapse file

‎auth/src/main/java/com/firebase/ui/auth/AuthUI.java‎

Copy file name to clipboardExpand all lines: auth/src/main/java/com/firebase/ui/auth/AuthUI.java
+43-32Lines changed: 43 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import com.firebase.ui.auth.data.remote.FacebookSignInHandler;
3535
import com.firebase.ui.auth.data.remote.TwitterSignInHandler;
3636
import com.firebase.ui.auth.ui.idp.AuthMethodPickerActivity;
37+
import com.firebase.ui.auth.util.CredentialUtils;
3738
import com.firebase.ui.auth.util.ExtraConstants;
3839
import com.firebase.ui.auth.util.GoogleApiUtils;
3940
import com.firebase.ui.auth.util.Preconditions;
@@ -210,7 +211,11 @@ private AuthUI(FirebaseApp app) {
210211
mApp = app;
211212
mAuth = FirebaseAuth.getInstance(mApp);
212213

213-
mAuth.setFirebaseUIVersion(BuildConfig.VERSION_NAME);
214+
try {
215+
mAuth.setFirebaseUIVersion(BuildConfig.VERSION_NAME);
216+
} catch (Exception e) {
217+
Log.e(TAG, "Couldn't set the FUI version.", e);
218+
}
214219
mAuth.useAppLanguage();
215220
}
216221

@@ -272,32 +277,36 @@ public static int getDefaultTheme() {
272277
*/
273278
@NonNull
274279
public Task<Void> signOut(@NonNull Context context) {
275-
mAuth.signOut();
276-
277280
Task<Void> maybeDisableAutoSignIn = GoogleApiUtils.getCredentialsClient(context)
278281
.disableAutoSignIn()
279-
.continueWithTask(new Continuation<Void, Task<Void>>() {
282+
.continueWith(new Continuation<Void, Void>() {
280283
@Override
281-
public Task<Void> then(@NonNull Task<Void> task) {
284+
public Void then(@NonNull Task<Void> task) {
282285
// We want to ignore a specific exception, since it's not a good reason
283286
// to fail (see Issue 1156).
284-
if (!task.isSuccessful() && (task.getException() instanceof ApiException)) {
285-
ApiException ae = (ApiException) task.getException();
286-
if (ae.getStatusCode() == CommonStatusCodes.CANCELED) {
287-
Log.w(TAG, "Could not disable auto-sign in, maybe there are no " +
288-
"SmartLock accounts available?", ae);
289-
290-
return Tasks.forResult(null);
291-
}
287+
Exception e = task.getException();
288+
if (e instanceof ApiException
289+
&& ((ApiException) e).getStatusCode() == CommonStatusCodes.CANCELED) {
290+
Log.w(TAG, "Could not disable auto-sign in, maybe there are no " +
291+
"SmartLock accounts available?", e);
292+
return null;
292293
}
293294

294-
return task;
295+
return task.getResult();
295296
}
296297
});
297298

298299
return Tasks.whenAll(
299300
signOutIdps(context),
300-
maybeDisableAutoSignIn);
301+
maybeDisableAutoSignIn
302+
).continueWith(new Continuation<Void, Void>() {
303+
@Override
304+
public Void then(@NonNull Task<Void> task) {
305+
task.getResult(); // Propagate exceptions
306+
mAuth.signOut();
307+
return null;
308+
}
309+
});
301310
}
302311

303312
/**
@@ -322,12 +331,6 @@ public Task<Void> delete(@NonNull Context context) {
322331

323332
// Ensure the order in which tasks are executed properly destructures the user.
324333
return signOutIdps(context).continueWithTask(new Continuation<Void, Task<Void>>() {
325-
@Override
326-
public Task<Void> then(@NonNull Task<Void> task) {
327-
task.getResult(); // Propagate exception if there was one
328-
return currentUser.delete();
329-
}
330-
}).continueWithTask(new Continuation<Void, Task<Void>>() {
331334
@Override
332335
public Task<Void> then(@NonNull Task<Void> task) {
333336
task.getResult(); // Propagate exception if there was one
@@ -337,9 +340,9 @@ public Task<Void> then(@NonNull Task<Void> task) {
337340
credentialTasks.add(client.delete(credential));
338341
}
339342
return Tasks.whenAll(credentialTasks)
340-
.continueWithTask(new Continuation<Void, Task<Void>>() {
343+
.continueWith(new Continuation<Void, Void>() {
341344
@Override
342-
public Task<Void> then(@NonNull Task<Void> task) {
345+
public Void then(@NonNull Task<Void> task) {
343346
Exception e = task.getException();
344347
Throwable t = e == null ? null : e.getCause();
345348
if (!(t instanceof ApiException)
@@ -348,13 +351,19 @@ public Task<Void> then(@NonNull Task<Void> task) {
348351
// one. This can occur if we failed to save the credential or it
349352
// was deleted elsewhere. However, a lack of stored credential
350353
// doesn't mean fully deleting the user failed.
351-
task.getResult();
354+
return task.getResult();
352355
}
353356

354-
return Tasks.forResult(null);
357+
return null;
355358
}
356359
});
357360
}
361+
}).continueWithTask(new Continuation<Void, Task<Void>>() {
362+
@Override
363+
public Task<Void> then(@NonNull Task<Void> task) {
364+
task.getResult(); // Propagate exception if there was one
365+
return currentUser.delete();
366+
}
358367
});
359368
}
360369

@@ -384,11 +393,13 @@ private static List<Credential> getCredentialsFromFirebaseUser(@NonNull Firebase
384393
}
385394

386395
String type = ProviderUtils.providerIdToAccountType(userInfo.getProviderId());
387-
388-
credentials.add(new Credential.Builder(
389-
user.getEmail() == null ? user.getPhoneNumber() : user.getEmail())
390-
.setAccountType(type)
391-
.build());
396+
if (type == null) {
397+
// Since the account type is null, we've got an email credential. Adding a fake
398+
// password is the only way to tell Smart Lock that this is an email credential.
399+
credentials.add(CredentialUtils.buildCredentialOrThrow(user, "pass", null));
400+
} else {
401+
credentials.add(CredentialUtils.buildCredentialOrThrow(user, null, type));
402+
}
392403
}
393404

394405
return credentials;
@@ -623,8 +634,8 @@ public EmailBuilder setAllowNewAccounts(boolean allow) {
623634
}
624635

625636
/**
626-
* Configures the requirement for the user to enter first and last name
627-
* in the email sign up flow.
637+
* Configures the requirement for the user to enter first and last name in the email
638+
* sign up flow.
628639
* <p>
629640
* Name is required by default.
630641
*/
Collapse file

‎auth/src/main/java/com/firebase/ui/auth/data/model/FlowParameters.java‎

Copy file name to clipboardExpand all lines: auth/src/main/java/com/firebase/ui/auth/data/model/FlowParameters.java
-8Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
package com.firebase.ui.auth.data.model;
1515

1616
import android.content.Intent;
17-
import android.os.Bundle;
1817
import android.os.Parcel;
1918
import android.os.Parcelable;
2019
import android.support.annotation.DrawableRes;
@@ -84,13 +83,6 @@ public static FlowParameters fromIntent(Intent intent) {
8483
return intent.getParcelableExtra(ExtraConstants.FLOW_PARAMS);
8584
}
8685

87-
/**
88-
* Extract FlowParameters from a Bundle.
89-
*/
90-
public static FlowParameters fromBundle(Bundle bundle) {
91-
return bundle.getParcelable(ExtraConstants.FLOW_PARAMS);
92-
}
93-
9486
@Override
9587
public void writeToParcel(Parcel dest, int flags) {
9688
dest.writeString(appName);
Collapse file

‎auth/src/main/java/com/firebase/ui/auth/data/model/Resource.java‎

Copy file name to clipboardExpand all lines: auth/src/main/java/com/firebase/ui/auth/data/model/Resource.java
-8Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,6 @@ private Resource(State state, T value, Exception exception) {
2424
mException = exception;
2525
}
2626

27-
/**
28-
* Creates a successful, empty Resource.
29-
*/
30-
@NonNull
31-
public static Resource<Void> forVoidSuccess() {
32-
return new Resource<>(State.SUCCESS, null, null);
33-
}
34-
3527
/**
3628
* Creates a successful resource containing a value.
3729
*/
Collapse file

‎auth/src/main/java/com/firebase/ui/auth/data/remote/FacebookSignInHandler.java‎

Copy file name to clipboardExpand all lines: auth/src/main/java/com/firebase/ui/auth/data/remote/FacebookSignInHandler.java
+2-5Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import com.facebook.FacebookCallback;
1313
import com.facebook.FacebookException;
1414
import com.facebook.FacebookRequestError;
15-
import com.facebook.FacebookSdk;
1615
import com.facebook.GraphRequest;
1716
import com.facebook.GraphResponse;
1817
import com.facebook.WebDialog;
@@ -43,13 +42,11 @@ public class FacebookSignInHandler extends ProviderSignInBase<AuthUI.IdpConfig>
4342
static {
4443
boolean available;
4544
try {
46-
//noinspection unused to possibly throw
47-
Class c = FacebookSdk.class;
45+
Class.forName("com.facebook.login.LoginManager");
4846
available = true;
49-
} catch (NoClassDefFoundError e) {
47+
} catch (ClassNotFoundException e) {
5048
available = false;
5149
}
52-
//noinspection ConstantConditions IntelliJ is wrong
5350
IS_AVAILABLE = available;
5451
}
5552

Collapse file

‎auth/src/main/java/com/firebase/ui/auth/data/remote/SignInKickstarter.java‎

Copy file name to clipboardExpand all lines: auth/src/main/java/com/firebase/ui/auth/data/remote/SignInKickstarter.java
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ private void handleCredential(final Credential credential) {
192192
final IdpResponse response = new IdpResponse.Builder(
193193
new User.Builder(EmailAuthProvider.PROVIDER_ID, id).build()).build();
194194

195+
setResult(Resource.<IdpResponse>forLoading());
195196
getAuth().signInWithEmailAndPassword(id, password)
196197
.addOnSuccessListener(new OnSuccessListener<AuthResult>() {
197198
@Override
Collapse file

‎auth/src/main/java/com/firebase/ui/auth/data/remote/TwitterSignInHandler.java‎

Copy file name to clipboardExpand all lines: auth/src/main/java/com/firebase/ui/auth/data/remote/TwitterSignInHandler.java
+2-5Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,13 @@ public class TwitterSignInHandler extends ProviderSignInBase<Void> {
3535
static {
3636
boolean available;
3737
try {
38-
//noinspection unused to possibly throw
39-
Class c = TwitterCore.class;
38+
Class.forName("com.twitter.sdk.android.core.identity.TwitterAuthClient");
4039
available = true;
41-
} catch (NoClassDefFoundError e) {
40+
} catch (ClassNotFoundException e) {
4241
available = false;
4342
}
44-
//noinspection ConstantConditions IntelliJ is wrong
4543
IS_AVAILABLE = available;
4644

47-
//noinspection ConstantConditions IntelliJ is still wrong
4845
if (IS_AVAILABLE) {
4946
Context context = AuthUI.getApplicationContext();
5047
Twitter.initialize(new TwitterConfig.Builder(context)

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.