From a83b677f469204b5b1714912cca2274917e6af6a Mon Sep 17 00:00:00 2001 From: Marvin W Date: Sun, 6 Dec 2020 11:12:33 +0100 Subject: [PATCH] FirebaseAuth: Allow apps to not announce library version --- .../org/microg/gms/firebase/auth/FirebaseAuthService.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/firebase-auth-core/src/main/kotlin/org/microg/gms/firebase/auth/FirebaseAuthService.kt b/firebase-auth-core/src/main/kotlin/org/microg/gms/firebase/auth/FirebaseAuthService.kt index 18f9d9e3..dce30087 100644 --- a/firebase-auth-core/src/main/kotlin/org/microg/gms/firebase/auth/FirebaseAuthService.kt +++ b/firebase-auth-core/src/main/kotlin/org/microg/gms/firebase/auth/FirebaseAuthService.kt @@ -74,7 +74,7 @@ class FirebaseAuthService : BaseService(TAG, GmsService.FIREBASE_AUTH) { PackageUtils.getAndCheckCallingPackage(this, request.packageName) val apiKey = request.extras?.getString(Constants.EXTRA_API_KEY) val libraryVersion = request.extras?.getString(Constants.EXTRA_LIBRARY_VERSION) - if (apiKey == null || libraryVersion == null) { + if (apiKey == null) { callback.onPostInitComplete(CommonStatusCodes.DEVELOPER_ERROR, null, null) } else { callback.onPostInitComplete(0, FirebaseAuthServiceImpl(this, lifecycle, request.packageName, libraryVersion, apiKey).asBinder(), null) @@ -82,7 +82,7 @@ class FirebaseAuthService : BaseService(TAG, GmsService.FIREBASE_AUTH) { } } -class FirebaseAuthServiceImpl(private val context: Context, private val lifecycle: Lifecycle, private val packageName: String, private val libraryVersion: String, private val apiKey: String) : IFirebaseAuthService.Stub(), LifecycleOwner { +class FirebaseAuthServiceImpl(private val context: Context, private val lifecycle: Lifecycle, private val packageName: String, private val libraryVersion: String?, private val apiKey: String) : IFirebaseAuthService.Stub(), LifecycleOwner { private val client = IdentityToolkitClient(context, apiKey) private var authorizedDomain: String? = null