Loading app/src/main/java/foundation/e/apps/data/gitlab/SystemAppDefinitionApi.kt→app/src/main/java/foundation/e/apps/data/gitlab/GitlabReleaseApi.kt +1 −3 Original line number Diff line number Diff line Loading @@ -26,10 +26,8 @@ import retrofit2.http.Path /* Those API method client must fit with gitlab releases API https://docs.gitlab.com/ee/api/releases/#download-a-release-asset TODO Option to consider at the end of the implementation: Can we rename this interface into: GitlabReleaseApi ? */ interface SystemAppDefinitionApi { interface GitlabReleaseApi { companion object { const val BASE_URL = Loading app/src/main/java/foundation/e/apps/data/gitlab/SystemAppsUpdatesRepository.kt +4 −4 Original line number Diff line number Diff line Loading @@ -37,7 +37,7 @@ import timber.log.Timber class SystemAppsUpdatesRepository @Inject constructor( @ApplicationContext private val context: Context, private val updatableSystemAppsApi: UpdatableSystemAppsApi, private val systemAppDefinitionApi: SystemAppDefinitionApi, private val gitlabReleaseApi: GitlabReleaseApi, private val applicationDataManager: ApplicationDataManager, private val appLoungePackageManager: AppLoungePackageManager, ) { Loading Loading @@ -137,10 +137,10 @@ class SystemAppsUpdatesRepository @Inject constructor( return null } systemAppDefinitionApi.getSystemAppUpdateInfoByTag(projectId, releaseType, latestRelease.tagName) gitlabReleaseApi.getSystemAppUpdateInfoByTag(projectId, releaseType, latestRelease.tagName) } else { systemAppDefinitionApi.getLatestSystemAppUpdateInfo(projectId, releaseType) gitlabReleaseApi.getLatestSystemAppUpdateInfo(projectId, releaseType) } return if (response.isSuccessful ) { Loading @@ -152,7 +152,7 @@ class SystemAppsUpdatesRepository @Inject constructor( } private suspend fun getLatestReleaseByAndroidVersion(projectId: Int): GitlabReleaseInfo? { val gitlabReleaseList = systemAppDefinitionApi.getSystemAppReleases(projectId).body() val gitlabReleaseList = gitlabReleaseApi.getSystemAppReleases(projectId).body() return gitlabReleaseList?.filter { it.tagName.contains("api$androidVersionCode-") Loading app/src/main/java/foundation/e/apps/di/network/RetrofitApiModule.kt +4 −4 Original line number Diff line number Diff line Loading @@ -30,7 +30,7 @@ import foundation.e.apps.data.ecloud.EcloudApiInterface import foundation.e.apps.data.exodus.ExodusTrackerApi import foundation.e.apps.data.fdroid.FdroidApiInterface import foundation.e.apps.data.gitlab.UpdatableSystemAppsApi import foundation.e.apps.data.gitlab.SystemAppDefinitionApi import foundation.e.apps.data.gitlab.GitlabReleaseApi import foundation.e.apps.data.parentalcontrol.fdroid.FDroidMonitorApi import foundation.e.apps.data.parentalcontrol.googleplay.AgeGroupApi import foundation.e.apps.di.network.NetworkModule.getYamlFactory Loading Loading @@ -152,13 +152,13 @@ class RetrofitApiModule { fun provideSystemAppDefinitionApi( okHttpClient: OkHttpClient, moshi: Moshi, ): SystemAppDefinitionApi { ): GitlabReleaseApi { return Retrofit.Builder() .baseUrl(SystemAppDefinitionApi.BASE_URL) .baseUrl(GitlabReleaseApi.BASE_URL) .client(okHttpClient) .addConverterFactory(MoshiConverterFactory.create(moshi)) .build() .create(SystemAppDefinitionApi::class.java) .create(GitlabReleaseApi::class.java) } } Loading
app/src/main/java/foundation/e/apps/data/gitlab/SystemAppDefinitionApi.kt→app/src/main/java/foundation/e/apps/data/gitlab/GitlabReleaseApi.kt +1 −3 Original line number Diff line number Diff line Loading @@ -26,10 +26,8 @@ import retrofit2.http.Path /* Those API method client must fit with gitlab releases API https://docs.gitlab.com/ee/api/releases/#download-a-release-asset TODO Option to consider at the end of the implementation: Can we rename this interface into: GitlabReleaseApi ? */ interface SystemAppDefinitionApi { interface GitlabReleaseApi { companion object { const val BASE_URL = Loading
app/src/main/java/foundation/e/apps/data/gitlab/SystemAppsUpdatesRepository.kt +4 −4 Original line number Diff line number Diff line Loading @@ -37,7 +37,7 @@ import timber.log.Timber class SystemAppsUpdatesRepository @Inject constructor( @ApplicationContext private val context: Context, private val updatableSystemAppsApi: UpdatableSystemAppsApi, private val systemAppDefinitionApi: SystemAppDefinitionApi, private val gitlabReleaseApi: GitlabReleaseApi, private val applicationDataManager: ApplicationDataManager, private val appLoungePackageManager: AppLoungePackageManager, ) { Loading Loading @@ -137,10 +137,10 @@ class SystemAppsUpdatesRepository @Inject constructor( return null } systemAppDefinitionApi.getSystemAppUpdateInfoByTag(projectId, releaseType, latestRelease.tagName) gitlabReleaseApi.getSystemAppUpdateInfoByTag(projectId, releaseType, latestRelease.tagName) } else { systemAppDefinitionApi.getLatestSystemAppUpdateInfo(projectId, releaseType) gitlabReleaseApi.getLatestSystemAppUpdateInfo(projectId, releaseType) } return if (response.isSuccessful ) { Loading @@ -152,7 +152,7 @@ class SystemAppsUpdatesRepository @Inject constructor( } private suspend fun getLatestReleaseByAndroidVersion(projectId: Int): GitlabReleaseInfo? { val gitlabReleaseList = systemAppDefinitionApi.getSystemAppReleases(projectId).body() val gitlabReleaseList = gitlabReleaseApi.getSystemAppReleases(projectId).body() return gitlabReleaseList?.filter { it.tagName.contains("api$androidVersionCode-") Loading
app/src/main/java/foundation/e/apps/di/network/RetrofitApiModule.kt +4 −4 Original line number Diff line number Diff line Loading @@ -30,7 +30,7 @@ import foundation.e.apps.data.ecloud.EcloudApiInterface import foundation.e.apps.data.exodus.ExodusTrackerApi import foundation.e.apps.data.fdroid.FdroidApiInterface import foundation.e.apps.data.gitlab.UpdatableSystemAppsApi import foundation.e.apps.data.gitlab.SystemAppDefinitionApi import foundation.e.apps.data.gitlab.GitlabReleaseApi import foundation.e.apps.data.parentalcontrol.fdroid.FDroidMonitorApi import foundation.e.apps.data.parentalcontrol.googleplay.AgeGroupApi import foundation.e.apps.di.network.NetworkModule.getYamlFactory Loading Loading @@ -152,13 +152,13 @@ class RetrofitApiModule { fun provideSystemAppDefinitionApi( okHttpClient: OkHttpClient, moshi: Moshi, ): SystemAppDefinitionApi { ): GitlabReleaseApi { return Retrofit.Builder() .baseUrl(SystemAppDefinitionApi.BASE_URL) .baseUrl(GitlabReleaseApi.BASE_URL) .client(okHttpClient) .addConverterFactory(MoshiConverterFactory.create(moshi)) .build() .create(SystemAppDefinitionApi::class.java) .create(GitlabReleaseApi::class.java) } }