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 c48081ddbc68e46e2950bbf62231739b114f2782..a11fcbbeede6220c2239f88636210604f23822d9 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 fa8602834c93a3df03245bee9a51d1f1589a5917..afa28e4e988f5e0aac5c110c418a662efe4ff474 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, ) { diff --git a/settings.gradle b/settings.gradle index 3d49969840669e17c8b646d3688d13faf1f4620f..9dc040aee9a07ce14909871a9a8593e20ce41661 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"