diff --git a/app/src/main/java/foundation/e/apps/data/NetworkHandler.kt b/app/src/main/java/foundation/e/apps/data/NetworkHandler.kt index 6cadc578db541174723e19e4625c6003c54cbd11..edf5d6146f19346362d4ef44b425441a84965d35 100644 --- a/app/src/main/java/foundation/e/apps/data/NetworkHandler.kt +++ b/app/src/main/java/foundation/e/apps/data/NetworkHandler.kt @@ -46,6 +46,8 @@ suspend fun handleNetworkResult(call: suspend () -> T): ResultSupreme { handleSocketTimeoutException(e) } catch (e: GplayHttpRequestException) { resultSupremeGplayHttpRequestException(e) + } catch (e: IllegalStateException) { + throw e } catch (e: Exception) { handleOthersException(e) } diff --git a/app/src/main/java/foundation/e/apps/data/application/ApplicationRepository.kt b/app/src/main/java/foundation/e/apps/data/application/ApplicationRepository.kt index 9e32ed8171b02fedb71971da981719f9410a2b80..126b589d59405d3ac8c8d26b62ed70188979b8da 100644 --- a/app/src/main/java/foundation/e/apps/data/application/ApplicationRepository.kt +++ b/app/src/main/java/foundation/e/apps/data/application/ApplicationRepository.kt @@ -62,23 +62,21 @@ class ApplicationRepository @Inject constructor( suspend fun getApplicationDetails( packageNameList: List, - authData: AuthData, origin: Origin ): Pair, ResultStatus> { - return appsApi.getApplicationDetails(packageNameList, authData, origin) + return appsApi.getApplicationDetails(packageNameList, origin) } - suspend fun getAppFilterLevel(application: Application, authData: AuthData?): FilterLevel { - return appsApi.getAppFilterLevel(application, authData) + suspend fun getAppFilterLevel(application: Application): FilterLevel { + return appsApi.getAppFilterLevel(application) } suspend fun getApplicationDetails( id: String, packageName: String, - authData: AuthData, origin: Origin ): Pair { - return appsApi.getApplicationDetails(id, packageName, authData, origin) + return appsApi.getApplicationDetails(id, packageName, origin) } suspend fun getCleanapkAppDetails(packageName: String): Pair { diff --git a/app/src/main/java/foundation/e/apps/data/application/apps/AppsApi.kt b/app/src/main/java/foundation/e/apps/data/application/apps/AppsApi.kt index 72f5eb4d6badd69d5472a3d51f579c9f53450413..067646e8f9500f755133726b4e5fbd6b5706fab5 100644 --- a/app/src/main/java/foundation/e/apps/data/application/apps/AppsApi.kt +++ b/app/src/main/java/foundation/e/apps/data/application/apps/AppsApi.kt @@ -36,14 +36,12 @@ interface AppsApi { suspend fun getApplicationDetails( packageNameList: List, - authData: AuthData, origin: Origin ): Pair, ResultStatus> suspend fun getApplicationDetails( id: String, packageName: String, - authData: AuthData, origin: Origin ): Pair @@ -55,7 +53,7 @@ interface AppsApi { */ fun getFusedAppInstallationStatus(application: Application): Status - suspend fun getAppFilterLevel(application: Application, authData: AuthData?): FilterLevel + suspend fun getAppFilterLevel(application: Application): FilterLevel /** * @return returns true if there is changes in data, otherwise false diff --git a/app/src/main/java/foundation/e/apps/data/application/apps/AppsApiImpl.kt b/app/src/main/java/foundation/e/apps/data/application/apps/AppsApiImpl.kt index 9aa108c64630d5d3a8933191adee1d59ff496217..f98e6c1542f0b7efa1ea3ca2d754078c19bf7708 100644 --- a/app/src/main/java/foundation/e/apps/data/application/apps/AppsApiImpl.kt +++ b/app/src/main/java/foundation/e/apps/data/application/apps/AppsApiImpl.kt @@ -78,7 +78,6 @@ class AppsApiImpl @Inject constructor( override suspend fun getApplicationDetails( packageNameList: List, - authData: AuthData, origin: Origin ): Pair, ResultStatus> { val list = mutableListOf() @@ -87,7 +86,7 @@ class AppsApiImpl @Inject constructor( if (origin == Origin.CLEANAPK) { getAppDetailsListFromCleanApk(packageNameList) } else { - getAppDetailsListFromGPlay(packageNameList, authData) + getAppDetailsListFromGPlay(packageNameList) } response.first.forEach { @@ -123,13 +122,12 @@ class AppsApiImpl @Inject constructor( private suspend fun getAppDetailsListFromGPlay( packageNameList: List, - authData: AuthData, ): Pair, ResultStatus> { val applicationList = mutableListOf() val result = handleNetworkResult { appSources.gplayRepo.getAppsDetails(packageNameList).forEach { app -> - handleFilteredApps(app, authData, applicationList) + handleFilteredApps(app, applicationList) } } @@ -144,7 +142,6 @@ class AppsApiImpl @Inject constructor( */ private suspend fun handleFilteredApps( app: App, - authData: AuthData, applicationList: MutableList ) { val application = app.toApplication(context) @@ -185,7 +182,6 @@ class AppsApiImpl @Inject constructor( override suspend fun getApplicationDetails( id: String, packageName: String, - authData: AuthData, origin: Origin ): Pair { var application: Application @@ -215,7 +211,6 @@ class AppsApiImpl @Inject constructor( override suspend fun getAppFilterLevel( application: Application, - authData: AuthData? ): FilterLevel { return applicationDataManager.getAppFilterLevel(application) } diff --git a/app/src/main/java/foundation/e/apps/data/application/search/SearchApiImpl.kt b/app/src/main/java/foundation/e/apps/data/application/search/SearchApiImpl.kt index 9c2fa1356b2ed0c84b6da8098d01716ae1de04ac..ead91ecce866b15f1c78a6a6779959ca8b30a38d 100644 --- a/app/src/main/java/foundation/e/apps/data/application/search/SearchApiImpl.kt +++ b/app/src/main/java/foundation/e/apps/data/application/search/SearchApiImpl.kt @@ -191,7 +191,7 @@ class SearchApiImpl @Inject constructor( val result = handleNetworkResult { if (appLoungePreference.isGplaySelected()) { - gplayPackageResult = getGplayPackagResult(query, authData) + gplayPackageResult = getGplayPackageResult(query) } if (appLoungePreference.isOpenSourceSelected()) { @@ -257,11 +257,10 @@ class SearchApiImpl @Inject constructor( return null } - private suspend fun getGplayPackagResult( + private suspend fun getGplayPackageResult( query: String, - authData: AuthData, ): Application? { - appsApi.getApplicationDetails(query, query, authData, Origin.GPLAY).let { + appsApi.getApplicationDetails(query, query, Origin.GPLAY).let { if (it.second == ResultStatus.OK && it.first.package_name.isNotEmpty()) { return it.first } diff --git a/app/src/main/java/foundation/e/apps/data/playstore/PlayStoreRepository.kt b/app/src/main/java/foundation/e/apps/data/playstore/PlayStoreRepository.kt index 41d0ce4d3d1aa2959e12da9740e4126f87e1fda3..9977924a97e165fb4e867fe5c73fd2f760b3bf1d 100644 --- a/app/src/main/java/foundation/e/apps/data/playstore/PlayStoreRepository.kt +++ b/app/src/main/java/foundation/e/apps/data/playstore/PlayStoreRepository.kt @@ -31,7 +31,6 @@ import com.aurora.gplayapi.helpers.ContentRatingHelper import com.aurora.gplayapi.helpers.PurchaseHelper import com.aurora.gplayapi.helpers.contracts.TopChartsContract.Chart import com.aurora.gplayapi.helpers.contracts.TopChartsContract.Type -import com.aurora.gplayapi.helpers.web.WebAppDetailsHelper import com.aurora.gplayapi.helpers.web.WebCategoryHelper import com.aurora.gplayapi.helpers.web.WebCategoryStreamHelper import com.aurora.gplayapi.helpers.web.WebSearchHelper @@ -149,32 +148,34 @@ class PlayStoreRepository @Inject constructor( override suspend fun getAppDetails(packageNameOrId: String): Application { var appDetails: GplayApp? - val appDetailsHelper = try { + val appDetailsHelper = AppDetailsHelper(authenticatorRepository.getGPlayAuthOrThrow()).using(gPlayHttpClient) - } catch (exception: Exception) { - WebAppDetailsHelper().using(gPlayHttpClient) - } withContext(Dispatchers.IO) { appDetails = appDetailsHelper.getAppByPackageName(packageNameOrId) } + if (appDetails?.versionCode == 0) { + throw IllegalStateException("App version code cannot be 0") + } + return appDetails?.toApplication(context) ?: Application() } suspend fun getAppsDetails(packageNamesOrIds: List): List { val appDetailsList = mutableListOf() - val appDetailsHelper = try { + val appDetailsHelper = AppDetailsHelper(authenticatorRepository.getGPlayAuthOrThrow()).using(gPlayHttpClient) - } catch (exception: Exception) { - WebAppDetailsHelper().using(gPlayHttpClient) - } withContext(Dispatchers.IO) { appDetailsList.addAll(appDetailsHelper.getAppByPackageName(packageNamesOrIds)) } + if (appDetailsList.first().versionCode == 0) { + throw IllegalStateException("App version code cannot be 0") + } + return appDetailsList } diff --git a/app/src/main/java/foundation/e/apps/data/updates/UpdatesManagerImpl.kt b/app/src/main/java/foundation/e/apps/data/updates/UpdatesManagerImpl.kt index 89628886b514083d3ab2b3b4cd1b1c8c26f3c1a0..d6cd28ffa5f728e6df0dfd494756aabbc7b5854a 100644 --- a/app/src/main/java/foundation/e/apps/data/updates/UpdatesManagerImpl.kt +++ b/app/src/main/java/foundation/e/apps/data/updates/UpdatesManagerImpl.kt @@ -35,8 +35,11 @@ import foundation.e.apps.data.application.search.SearchApi.Companion.APP_TYPE_AN import foundation.e.apps.data.application.data.Application import foundation.e.apps.data.gitlab.SystemAppsUpdatesRepository import foundation.e.apps.data.handleNetworkResult +import foundation.e.apps.data.login.AuthObject import foundation.e.apps.data.preference.AppLoungePreference import foundation.e.apps.install.pkg.AppLoungePackageManager +import foundation.e.apps.utils.eventBus.AppEvent +import foundation.e.apps.utils.eventBus.EventBus import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.async import kotlinx.coroutines.awaitAll @@ -100,7 +103,6 @@ class UpdatesManagerImpl @Inject constructor( status = getUpdatesFromApi({ applicationRepository.getApplicationDetails( openSourceInstalledApps, - authData, Origin.CLEANAPK ) }, updateList) @@ -156,7 +158,6 @@ class UpdatesManagerImpl @Inject constructor( status = getUpdatesFromApi({ applicationRepository.getApplicationDetails( openSourceInstalledApps, - AuthData("", ""), Origin.CLEANAPK ) }, updateList) @@ -286,7 +287,6 @@ class UpdatesManagerImpl @Inject constructor( applicationRepository.getApplicationDetails( "", packageName, - authData, Origin.GPLAY ) } diff --git a/app/src/main/java/foundation/e/apps/install/workmanager/AppInstallProcessor.kt b/app/src/main/java/foundation/e/apps/install/workmanager/AppInstallProcessor.kt index 2c929ce8f64870b11d441fc880a25341f4433756..099f1f8c431885c2b600eeb933548caf0e0810b3 100644 --- a/app/src/main/java/foundation/e/apps/install/workmanager/AppInstallProcessor.kt +++ b/app/src/main/java/foundation/e/apps/install/workmanager/AppInstallProcessor.kt @@ -31,6 +31,7 @@ import foundation.e.apps.data.application.UpdatesDao import foundation.e.apps.data.application.data.Application import foundation.e.apps.data.enums.Origin import foundation.e.apps.data.install.models.AppInstall +import foundation.e.apps.data.login.AuthObject import foundation.e.apps.data.playstore.utils.GplayHttpRequestException import foundation.e.apps.data.preference.AppLoungeDataStore import foundation.e.apps.domain.ValidateAppAgeLimitUseCase @@ -185,6 +186,8 @@ class AppInstallProcessor @Inject constructor( e ) return false + } catch (e: IllegalStateException) { + EventBus.invokeEvent(AppEvent.InvalidAuthEvent(AuthObject.GPlayAuth::class.java.simpleName)) } catch (e: Exception) { handleUpdateDownloadError( appInstall, diff --git a/app/src/main/java/foundation/e/apps/ui/MainActivityViewModel.kt b/app/src/main/java/foundation/e/apps/ui/MainActivityViewModel.kt index 1de9812272def31dbaf2812842b3b8341b1f5f63..a91df34c0a14aa75496fabec647149c8157d8f99 100644 --- a/app/src/main/java/foundation/e/apps/ui/MainActivityViewModel.kt +++ b/app/src/main/java/foundation/e/apps/ui/MainActivityViewModel.kt @@ -179,11 +179,10 @@ class MainActivityViewModel @Inject constructor( */ fun verifyUiFilter(application: Application, method: () -> Unit) { viewModelScope.launch { - val authData = gPlayAuthData if (application.filterLevel.isInitialized()) { method() } else { - applicationRepository.getAppFilterLevel(application, authData).run { + applicationRepository.getAppFilterLevel(application).run { if (isInitialized()) { application.filterLevel = this method() diff --git a/app/src/main/java/foundation/e/apps/ui/application/ApplicationViewModel.kt b/app/src/main/java/foundation/e/apps/ui/application/ApplicationViewModel.kt index 4e72c47f8790749b2b19bc38929fff9ed93f2d98..d22258c37ab6c9e42d5571d1449a946a82d12093 100644 --- a/app/src/main/java/foundation/e/apps/ui/application/ApplicationViewModel.kt +++ b/app/src/main/java/foundation/e/apps/ui/application/ApplicationViewModel.kt @@ -34,8 +34,6 @@ import foundation.e.apps.data.enums.Status import foundation.e.apps.data.install.AppManagerWrapper import foundation.e.apps.data.install.models.AppInstall import foundation.e.apps.data.login.AuthObject -import foundation.e.apps.data.login.exceptions.CleanApkException -import foundation.e.apps.data.login.exceptions.GPlayException import foundation.e.apps.data.parentalcontrol.fdroid.FDroidAntiFeatureRepository import foundation.e.apps.data.playstore.PlayStoreRepository import foundation.e.apps.install.download.data.DownloadProgress @@ -43,6 +41,8 @@ import foundation.e.apps.install.download.data.DownloadProgressLD import foundation.e.apps.ui.application.ShareButtonVisibilityState.Hidden import foundation.e.apps.ui.application.ShareButtonVisibilityState.Visible import foundation.e.apps.ui.parentFragment.LoadingViewModel +import foundation.e.apps.utils.eventBus.AppEvent +import foundation.e.apps.utils.eventBus.EventBus import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.asStateFlow @@ -106,7 +106,6 @@ class ApplicationViewModel @Inject constructor( params.appId, params.packageName, params.isPurchased, - authData, params.origin ) return@onLoadData @@ -117,7 +116,6 @@ class ApplicationViewModel @Inject constructor( params.appId, params.packageName, params.isPurchased, - AuthData("", ""), params.origin ) return@onLoadData @@ -125,47 +123,30 @@ class ApplicationViewModel @Inject constructor( }, retryBlock) } - fun getApplicationDetails( + private fun getApplicationDetails( id: String, packageName: String, isPurchased: Boolean, - authData: AuthData, origin: Origin ) { viewModelScope.launch(Dispatchers.IO) { try { - val appData = + val result = applicationRepository.getApplicationDetails( id, packageName, - authData, origin ) - appData.first.isPurchased = isPurchased - applicationLiveData.postValue(appData) + result.first.isPurchased = isPurchased + applicationLiveData.postValue(result) - updateShareVisibilityState(appData.first.shareUri.toString()) - updateAppContentRatingState(packageName, appData.first.contentRating) - - val status = appData.second - - if (appData.second != ResultStatus.OK) { - val exception = - if (authData.aasToken.isNotBlank() || authData.authToken.isNotBlank()) - GPlayException( - appData.second == ResultStatus.TIMEOUT, - status.message.ifBlank { "Data load error" } - ) - else CleanApkException( - appData.second == ResultStatus.TIMEOUT, - status.message.ifBlank { "Data load error" } - ) - - exceptionsList.add(exception) - exceptionsLiveData.postValue(exceptionsList) - } + updateShareVisibilityState(result.first.shareUri.toString()) + updateAppContentRatingState(packageName, result.first.contentRating) } catch (e: InternalException.AppNotFound) { _errorMessageLiveData.postValue(R.string.app_not_found) + } catch (exception: IllegalStateException) { + exception.printStackTrace() + EventBus.invokeEvent(AppEvent.InvalidAuthEvent(AuthObject.GPlayAuth::class.java.simpleName)) } catch (e: Exception) { _errorMessageLiveData.postValue(R.string.unknown_error) } diff --git a/app/src/main/java/foundation/e/apps/ui/home/HomeFragment.kt b/app/src/main/java/foundation/e/apps/ui/home/HomeFragment.kt index 11685cc0918094d95cf64b2a309b4a62bc567a41..b349adb42a2038267b47dc9b0a4acab6caa28a80 100644 --- a/app/src/main/java/foundation/e/apps/ui/home/HomeFragment.kt +++ b/app/src/main/java/foundation/e/apps/ui/home/HomeFragment.kt @@ -69,10 +69,6 @@ class HomeFragment : TimeoutFragment(R.layout.fragment_home), ApplicationInstall @Inject lateinit var pwaManager: PwaManager - companion object { - private const val SCROLL_DELAY_IN_MILLIS = 500L - } - override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) _binding = FragmentHomeBinding.bind(view) @@ -97,12 +93,6 @@ class HomeFragment : TimeoutFragment(R.layout.fragment_home), ApplicationInstall } homeParentRVAdapter?.setData(it.data!!) - - // scrolling to top 500 ms later to give time UI elements to be rendered - viewLifecycleOwner.lifecycleScope.launch { - delay(SCROLL_DELAY_IN_MILLIS) - binding.parentRV.scrollToPosition(0) - } } } @@ -266,8 +256,6 @@ class HomeFragment : TimeoutFragment(R.layout.fragment_home), ApplicationInstall appProgressViewModel.downloadProgress.observe(viewLifecycleOwner) { updateProgressOfDownloadingAppItemViews(homeParentRVAdapter, it) } - - homeViewModel.checkAnyChangeInAppStatus() } override fun onPause() { diff --git a/app/src/main/java/foundation/e/apps/ui/home/HomeViewModel.kt b/app/src/main/java/foundation/e/apps/ui/home/HomeViewModel.kt index 861527a7379b5d5a800fc978a9bc93a931a4d893..455a9e30445000d21b5996617ea5380e0c2c75d0 100644 --- a/app/src/main/java/foundation/e/apps/ui/home/HomeViewModel.kt +++ b/app/src/main/java/foundation/e/apps/ui/home/HomeViewModel.kt @@ -181,39 +181,4 @@ class HomeViewModel @Inject constructor( return false } - - fun checkAnyChangeInAppStatus() { - if (this.currentHomes == null) { - return - } - - val fusedHomes: MutableList = mutableListOf() - checkForChangesInAppStatus(fusedHomes) - - if (fusedHomes.isNotEmpty() && hasAnyChange(fusedHomes)) { - homeScreenData.value = ResultSupreme.Success(fusedHomes) - currentHomes = fusedHomes - } - } - - private fun checkForChangesInAppStatus(fusedHomes: MutableList) { - var home: Home? = null - this.currentHomes?.forEach { - - it.list.forEach { application -> - val status = - applicationRepository.getFusedAppInstallationStatus(application) - - if (application.status != status) { - application.status = status - home = it.copy() - // Setting a new id, so that recyclerview can find that this item is changed - home?.id = UUID.randomUUID().toString() - } - } - - fusedHomes.add(home ?: it) - home = null - } - } } diff --git a/app/src/test/java/foundation/e/apps/UpdateManagerImptTest.kt b/app/src/test/java/foundation/e/apps/UpdateManagerImptTest.kt index eb5c7090f75e990c4e81b66afd6ae49a76037d6a..06ad1b1a48aa9b240c3f336bff576cdd341351fc 100644 --- a/app/src/test/java/foundation/e/apps/UpdateManagerImptTest.kt +++ b/app/src/test/java/foundation/e/apps/UpdateManagerImptTest.kt @@ -372,7 +372,6 @@ class UpdateManagerImptTest { ) { Mockito.`when`( applicationRepository.getApplicationDetails( - any(), any(), eq(Origin.CLEANAPK) ) @@ -386,7 +385,6 @@ class UpdateManagerImptTest { if (gplayUpdates.first.isNotEmpty()) { Mockito.`when`( applicationRepository.getApplicationDetails( - any(), any(), any(), eq(Origin.GPLAY) @@ -398,7 +396,6 @@ class UpdateManagerImptTest { } else { Mockito.`when`( applicationRepository.getApplicationDetails( - any(), any(), any(), eq(Origin.GPLAY) diff --git a/app/src/test/java/foundation/e/apps/apps/AppsApiTest.kt b/app/src/test/java/foundation/e/apps/apps/AppsApiTest.kt index 8cda6e3cff0d20e7da276b0d901644618b302273..e76fa0a5a2607031989186db37f17e257c168c43 100644 --- a/app/src/test/java/foundation/e/apps/apps/AppsApiTest.kt +++ b/app/src/test/java/foundation/e/apps/apps/AppsApiTest.kt @@ -92,10 +92,6 @@ class AppsApiTest { private lateinit var formatterMocked: MockedStatic - companion object { - private val AUTH_DATA = AuthData("e@e.email", "AtadyMsIAtadyM") - } - @Before fun setup() { MockitoAnnotations.openMocks(this) @@ -429,7 +425,7 @@ class AppsApiTest { latest_version_code = 123, ) - val filterLevel = appsApi.getAppFilterLevel(application, AUTH_DATA) + val filterLevel = appsApi.getAppFilterLevel(application) assertEquals("getAppFilterLevel", FilterLevel.UNKNOWN, filterLevel) } @@ -437,7 +433,7 @@ class AppsApiTest { fun `getAppFilterLevel when app is CleanApk`() = runTest { val fusedApp = getFusedAppForFilterLevelTest() - val filterLevel = appsApi.getAppFilterLevel(fusedApp, AUTH_DATA) + val filterLevel = appsApi.getAppFilterLevel(fusedApp) assertEquals("getAppFilterLevel", FilterLevel.NONE, filterLevel) } @@ -456,7 +452,7 @@ class AppsApiTest { fun `getAppFilterLevel when Authdata is NULL`() = runTest { val fusedApp = getFusedAppForFilterLevelTest() - val filterLevel = appsApi.getAppFilterLevel(fusedApp, null) + val filterLevel = appsApi.getAppFilterLevel(fusedApp) assertEquals("getAppFilterLevel", FilterLevel.NONE, filterLevel) } @@ -467,7 +463,7 @@ class AppsApiTest { this.restriction = Constants.Restriction.UNKNOWN } - val filterLevel = appsApi.getAppFilterLevel(fusedApp, AUTH_DATA) + val filterLevel = appsApi.getAppFilterLevel(fusedApp) assertEquals("getAppFilterLevel", FilterLevel.UI, filterLevel) } @@ -478,7 +474,7 @@ class AppsApiTest { this.restriction = Constants.Restriction.NOT_RESTRICTED } - val filterLevel = appsApi.getAppFilterLevel(fusedApp, AUTH_DATA) + val filterLevel = appsApi.getAppFilterLevel(fusedApp) assertEquals("getAppFilterLevel", FilterLevel.UI, filterLevel) } @@ -501,7 +497,7 @@ class AppsApiTest { ) ).thenReturn(listOf()) - val filterLevel = appsApi.getAppFilterLevel(fusedApp, AUTH_DATA) + val filterLevel = appsApi.getAppFilterLevel(fusedApp) assertEquals("getAppFilterLevel", FilterLevel.NONE, filterLevel) } @@ -521,7 +517,7 @@ class AppsApiTest { ) ).thenReturn(listOf()) - val filterLevel = appsApi.getAppFilterLevel(fusedApp, AUTH_DATA) + val filterLevel = appsApi.getAppFilterLevel(fusedApp) assertEquals("getAppFilterLevel", FilterLevel.DATA, filterLevel) } @@ -541,7 +537,7 @@ class AppsApiTest { ) ).thenThrow(RuntimeException()) - val filterLevel = appsApi.getAppFilterLevel(fusedApp, AUTH_DATA) + val filterLevel = appsApi.getAppFilterLevel(fusedApp) assertEquals("getAppFilterLevel", FilterLevel.UI, filterLevel) } } diff --git a/app/src/test/java/foundation/e/apps/installProcessor/AppInstallProcessorTest.kt b/app/src/test/java/foundation/e/apps/installProcessor/AppInstallProcessorTest.kt index 25edd4c73b4103957d2757983584795d419448ea..a11efa092d2ec44beca293c126d1421b503004ee 100644 --- a/app/src/test/java/foundation/e/apps/installProcessor/AppInstallProcessorTest.kt +++ b/app/src/test/java/foundation/e/apps/installProcessor/AppInstallProcessorTest.kt @@ -20,7 +20,6 @@ package foundation.e.apps.installProcessor import android.content.Context import androidx.arch.core.executor.testing.InstantTaskExecutorRule -import com.aurora.gplayapi.data.models.AuthData import foundation.e.apps.data.ResultSupreme import foundation.e.apps.data.enums.Status import foundation.e.apps.data.fdroid.FDroidRepository @@ -120,7 +119,6 @@ class AppInstallProcessorTest { ): AppInstall { val fusedDownload = createFusedDownload(packageName, downloadUrlList) fakeFusedDownloadDAO.addDownload(fusedDownload) - Mockito.`when`(appLoungeDataStore.getAuthData()).thenReturn(AuthData("", "")) return fusedDownload }