From 4a171739c2817c9dc61a96a4fa031b69eacba657 Mon Sep 17 00:00:00 2001 From: Sayantan Roychowdhury Date: Tue, 17 Jan 2023 16:12:33 +0530 Subject: [PATCH 1/2] Rename LoginApiRepository.kt to GPlayLoginApiRepository.kt --- .../foundation/e/apps/login/LoginSourceGPlay.kt | 16 ++++++++-------- ...iRepository.kt => GPlayLoginApiRepository.kt} | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) rename app/src/main/java/foundation/e/apps/login/api/{LoginApiRepository.kt => GPlayLoginApiRepository.kt} (99%) diff --git a/app/src/main/java/foundation/e/apps/login/LoginSourceGPlay.kt b/app/src/main/java/foundation/e/apps/login/LoginSourceGPlay.kt index c48081ddb..a11fcbbee 100644 --- a/app/src/main/java/foundation/e/apps/login/LoginSourceGPlay.kt +++ b/app/src/main/java/foundation/e/apps/login/LoginSourceGPlay.kt @@ -25,7 +25,7 @@ import foundation.e.apps.api.ResultSupreme import foundation.e.apps.login.api.GPlayApiFactory import foundation.e.apps.login.api.GPlayLoginInterface import foundation.e.apps.login.api.GoogleLoginApi -import foundation.e.apps.login.api.LoginApiRepository +import foundation.e.apps.login.api.GPlayLoginApiRepository import foundation.e.apps.utils.enums.User import foundation.e.apps.utils.exceptions.GPlayValidationException import java.util.Locale @@ -54,8 +54,8 @@ class LoginSourceGPlay @Inject constructor( private val gPlayLoginInterface: GPlayLoginInterface get() = gPlayApiFactory.getGPlayApi(user) - private val loginApiRepository: LoginApiRepository - get() = LoginApiRepository(gPlayLoginInterface, user) + private val gPlayLoginApiRepository: GPlayLoginApiRepository + get() = GPlayLoginApiRepository(gPlayLoginInterface, user) private val locale: Locale get() = context.resources.configuration.locales[0] @@ -148,7 +148,7 @@ class LoginSourceGPlay @Inject constructor( * Get AuthData for ANONYMOUS mode. */ private suspend fun getAuthData(): ResultSupreme { - return loginApiRepository.fetchAuthData("", "", locale).run { + return gPlayLoginApiRepository.fetchAuthData("", "", locale).run { if (isSuccess()) ResultSupreme.Success(formattedAuthData(this.data!!)) else this } @@ -168,13 +168,13 @@ class LoginSourceGPlay @Inject constructor( * Use it to fetch auth data. */ if (aasToken.isNotBlank()) { - return loginApiRepository.fetchAuthData(email, aasToken, locale) + return gPlayLoginApiRepository.fetchAuthData(email, aasToken, locale) } /* * If aasToken is not yet saved / made, fetch it from email and oauthToken. */ - val aasTokenResponse = loginApiRepository.getAasToken( + val aasTokenResponse = gPlayLoginApiRepository.getAasToken( gPlayLoginInterface as GoogleLoginApi, email, oauthToken @@ -199,7 +199,7 @@ class LoginSourceGPlay @Inject constructor( * Finally save the aasToken and create auth data. */ loginDataStore.saveAasToken(aasTokenFetched) - return loginApiRepository.fetchAuthData(email, aasTokenFetched, locale).run { + return gPlayLoginApiRepository.fetchAuthData(email, aasTokenFetched, locale).run { if (isSuccess()) ResultSupreme.Success(formattedAuthData(this.data!!)) else this } @@ -217,7 +217,7 @@ class LoginSourceGPlay @Inject constructor( val formattedAuthData = formattedAuthData(authData) formattedAuthData.locale = locale - val validityResponse = loginApiRepository.login(formattedAuthData) + val validityResponse = gPlayLoginApiRepository.login(formattedAuthData) /* * Send the email as payload. This is sent to ecloud in case of failure. diff --git a/app/src/main/java/foundation/e/apps/login/api/LoginApiRepository.kt b/app/src/main/java/foundation/e/apps/login/api/GPlayLoginApiRepository.kt similarity index 99% rename from app/src/main/java/foundation/e/apps/login/api/LoginApiRepository.kt rename to app/src/main/java/foundation/e/apps/login/api/GPlayLoginApiRepository.kt index fa8602834..afa28e4e9 100644 --- a/app/src/main/java/foundation/e/apps/login/api/LoginApiRepository.kt +++ b/app/src/main/java/foundation/e/apps/login/api/GPlayLoginApiRepository.kt @@ -37,7 +37,7 @@ import java.util.Locale * * Issue: https://gitlab.e.foundation/e/backlog/-/issues/5680 */ -class LoginApiRepository constructor( +class GPlayLoginApiRepository constructor( private val gPlayLoginInterface: GPlayLoginInterface, private val user: User, ) { -- GitLab From c8856ca9c90bd3645c66eb93824199da114c58fd Mon Sep 17 00:00:00 2001 From: Sayantan Roychowdhury Date: Wed, 18 Jan 2023 18:03:41 +0530 Subject: [PATCH 2/2] remove fetching gplay lib using ci token --- settings.gradle | 46 ---------------------------------------------- 1 file changed, 46 deletions(-) diff --git a/settings.gradle b/settings.gradle index 3d4996984..9dc040aee 100644 --- a/settings.gradle +++ b/settings.gradle @@ -5,52 +5,6 @@ dependencyResolutionManagement { mavenCentral() maven { url 'https://jitpack.io' } maven { url 'https://gitlab.e.foundation/api/v4/groups/9/-/packages/maven'} - - // Gitlab repository configuration for gplayapi dependency - def ciJobToken = System.getenv("CI_JOB_TOKEN") - def ciApiV4Url = System.getenv("CI_API_V4_URL") - - if (ciJobToken != null) { - // Build on CI - maven { - url "https://gitlab.e.foundation/api/v4/projects/1269/packages/maven" - name "GitLab" - credentials(HttpHeaderCredentials) { - name = 'Job-Token' - value = ciJobToken - } - authentication { - header(HttpHeaderAuthentication) - } - } - } else { - // Build locally - // To build locally, you should set the gitLabPrivateToken variable with - // your Gitlab Private Token in your ./local.properties file: - // - // gitLabPrivateToken=YOUR_TOKEN - // - // To create a Private Token, go to: - // https://gitlab.e.foundation/e/os/gplayapi/-/settings/access_tokens - // and tick "api" as scope. - - def localProperties = new Properties() - localProperties.load(new FileInputStream(rootProject.projectDir.path + "/local.properties")) - - maven { - url "https://gitlab.e.foundation/api/v4/projects/1269/packages/maven" - name "GitLab" - - credentials(HttpHeaderCredentials) { - name = 'Private-Token' - value = localProperties['gitLabPrivateToken'] - } - authentication { - header(HttpHeaderAuthentication) - } - } - } - } } rootProject.name = "App Lounge" -- GitLab