From f0b9852b39193981883f3d3e8c362d401fcc54eb Mon Sep 17 00:00:00 2001 From: Jonathan Klee Date: Mon, 10 Mar 2025 11:52:41 +0100 Subject: [PATCH 1/3] Remove Exodus Privacy fetch from search feature for now --- .../ApplicationListRVAdapter.kt | 53 ------------------- .../e/apps/ui/search/SearchFragment.kt | 4 -- .../main/res/layout/application_list_item.xml | 15 +++--- app/src/main/res/layout/fragment_search.xml | 8 --- app/src/main/res/values-de/strings.xml | 3 +- app/src/main/res/values-es/strings.xml | 1 - app/src/main/res/values-fr/strings.xml | 1 - app/src/main/res/values-is/strings.xml | 3 +- app/src/main/res/values-it/strings.xml | 3 +- app/src/main/res/values-nb-rNO/strings.xml | 1 - app/src/main/res/values-nl/strings.xml | 3 +- app/src/main/res/values-ru/strings.xml | 1 - app/src/main/res/values-sv/strings.xml | 3 +- app/src/main/res/values-tr/strings.xml | 1 - app/src/main/res/values/strings.xml | 1 - 15 files changed, 14 insertions(+), 87 deletions(-) diff --git a/app/src/main/java/foundation/e/apps/ui/applicationlist/ApplicationListRVAdapter.kt b/app/src/main/java/foundation/e/apps/ui/applicationlist/ApplicationListRVAdapter.kt index 7ffbeecdf..b782362a4 100644 --- a/app/src/main/java/foundation/e/apps/ui/applicationlist/ApplicationListRVAdapter.kt +++ b/app/src/main/java/foundation/e/apps/ui/applicationlist/ApplicationListRVAdapter.kt @@ -131,15 +131,11 @@ class ApplicationListRVAdapter( } holder.binding.apply { - if (searchApp.privacyScore == -1) { - hidePrivacyScore() - } applicationList.setOnClickListener { handleAppItemClick(searchApp, view) } updateAppInfo(searchApp) updateRating(searchApp) - updatePrivacyScore(searchApp, view) updateSourceTag(searchApp) setAppIcon(searchApp, shimmerDrawable) removeIsPurchasedObserver(holder) @@ -154,7 +150,6 @@ class ApplicationListRVAdapter( } } - showPrivacyScoreAfterFetching(searchApp, view) } } @@ -225,22 +220,6 @@ class ApplicationListRVAdapter( } } - private fun ApplicationListItemBinding.updatePrivacyScore( - searchApp: Application, - view: View - ) { - if (searchApp.isSystemApp) { - appPrivacyScoreLayout.isVisible = false - return - } - if (searchApp.hasExodusPrivacyRating() && searchApp.ratings.privacyScore != -1.0) { - appPrivacyScore.text = view.context.getString( - R.string.privacy_rating_out_of, - searchApp.ratings.privacyScore.toInt().toString() - ) - } - } - private fun ApplicationListItemBinding.updateSourceTag(searchApp: Application) { sourceTag.visibility = View.INVISIBLE val tag = searchApp.source.toString() @@ -398,38 +377,6 @@ class ApplicationListRVAdapter( progressBarInstall.visibility = View.GONE } - private fun ApplicationListItemBinding.showPrivacyScoreAfterFetching( - searchApp: Application, - view: View - ) { - if (lifecycleOwner == null) { - return - } - privacyInfoViewModel.getAppPrivacyInfoLiveData(searchApp).observe(lifecycleOwner!!) { - showPrivacyScore() - val calculatedScore = privacyInfoViewModel.getPrivacyScore(searchApp) - searchApp.privacyScore = calculatedScore - if (it.isSuccess() && calculatedScore != -1) { - appPrivacyScore.text = view.context.getString( - R.string.privacy_rating_out_of, - searchApp.privacyScore.toString() - ) - } else { - appPrivacyScore.text = view.context.getString(R.string.not_available) - } - } - } - - private fun ApplicationListItemBinding.hidePrivacyScore() { - progressBar.visibility = View.VISIBLE - appPrivacyScore.visibility = View.GONE - } - - private fun ApplicationListItemBinding.showPrivacyScore() { - progressBar.visibility = View.GONE - appPrivacyScore.visibility = View.VISIBLE - } - private fun ApplicationListItemBinding.handleInstalling() { installButton.apply { disableInstallButton() diff --git a/app/src/main/java/foundation/e/apps/ui/search/SearchFragment.kt b/app/src/main/java/foundation/e/apps/ui/search/SearchFragment.kt index 8799a7a9d..b05fcb277 100644 --- a/app/src/main/java/foundation/e/apps/ui/search/SearchFragment.kt +++ b/app/src/main/java/foundation/e/apps/ui/search/SearchFragment.kt @@ -96,7 +96,6 @@ class SearchFragment : private var searchHintLayout: LinearLayout? = null private var noAppsFoundLayout: LinearLayout? = null - lateinit var filterChipNoTrackers: Chip lateinit var filterChipOpenSource: Chip lateinit var filterChipPWA: Chip @@ -118,7 +117,6 @@ class SearchFragment : searchHintLayout = binding.searchHintLayout.root noAppsFoundLayout = binding.noAppsFoundLayout.root - filterChipNoTrackers = binding.filterChipNoTrackers filterChipOpenSource = binding.filterChipOpenSource filterChipPWA = binding.filterChipPWA @@ -293,7 +291,6 @@ class SearchFragment : val listener = OnCheckedChangeListener { _, _ -> showLoadingUI() searchViewModel.setFilterFlags( - flagNoTrackers = filterChipNoTrackers.isChecked, flagOpenSource = filterChipOpenSource.isChecked, flagPWA = filterChipPWA.isChecked, ) @@ -301,7 +298,6 @@ class SearchFragment : recyclerView?.scrollToPosition(0) } - filterChipNoTrackers.setOnCheckedChangeListener(listener) filterChipOpenSource.setOnCheckedChangeListener(listener) filterChipPWA.setOnCheckedChangeListener(listener) } diff --git a/app/src/main/res/layout/application_list_item.xml b/app/src/main/res/layout/application_list_item.xml index 9223c9c56..e9f1e36a0 100644 --- a/app/src/main/res/layout/application_list_item.xml +++ b/app/src/main/res/layout/application_list_item.xml @@ -132,20 +132,21 @@ style="@style/InstallButtonStyle" android:layout_width="wrap_content" android:layout_height="40dp" + android:lines="1" android:text="@string/install" android:textAllCaps="true" - android:visibility="invisible" - app:autoSizeTextType="uniform" app:autoSizeMinTextSize="5sp" - android:lines="1" + app:autoSizeTextType="uniform" app:cornerRadius="4dp" + app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="@+id/app_title" - tools:text="@string/installing"/> + tools:text="@string/installing" /> + android:visibility="invisible" + /> + android:visibility="invisible" /> diff --git a/app/src/main/res/layout/fragment_search.xml b/app/src/main/res/layout/fragment_search.xml index c0aa781eb..8d6a4022b 100644 --- a/app/src/main/res/layout/fragment_search.xml +++ b/app/src/main/res/layout/fragment_search.xml @@ -55,14 +55,6 @@ android:layout_width="match_parent" android:layout_height="wrap_content"> - - Ignorieren Konto nicht verfügbar Teilen - Keine Verfolger [%1$s] Beschränkte App Du bist zu jung, um %1$s installieren zu können. Bitte sprich mit deinen Eltern, ob die Altersbeschränkung korrekt ist, oder lasse sie die Elternkontrolle deaktivieren, damit diese App installiert werden kann. Diese App kann unangemessene Inhalte enthalten. @@ -202,4 +201,4 @@ Quelloffene Apps und PWA nicht verfügbar Beim Laden der allgemeinen Apps ist ein Fehler aufgetreten. Nur quelloffene Apps und PWA sind momentan verfügbar. Beim Laden von PWA und quelloffenen Apps ist ein Fehler aufgetreten. Nur allgemeine Apps sind momentan verfügbar. - \ No newline at end of file + diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 7335eb45c..2a7dc5d19 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -188,7 +188,6 @@ Archivo adicional para %s Cuenta no disponible Compartir - Sin rastreadores [%1$s] Aplicación restringida Eres demasiado joven para instalar %1$s. Por favor, comprueba con tus padres que tu grupo de edad es correcto o desactiva el control parental para poder instalar. Esta aplicación puede tener contenido inapropiado. diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 218ccb33a..31ab8a7e0 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -184,7 +184,6 @@ Ignorer Compte indisponible Partager - Aucun pisteurs Le compte anonyme que vous êtes en train d\'utiliser est indisponible. Merci de renouveler la session pour en obtenir un autre. Cette application peut inclure du contenu inapproprié. Avertissement sur le contenu diff --git a/app/src/main/res/values-is/strings.xml b/app/src/main/res/values-is/strings.xml index 8df24cfb4..e21390c37 100644 --- a/app/src/main/res/values-is/strings.xml +++ b/app/src/main/res/values-is/strings.xml @@ -187,7 +187,6 @@ Skrá inn Reikningur ekki í boði Deila - Engir rekjarar [%1$s] takmarkað forrit Þetta forrit gæti innihaldið óviðeigandi efni. Aðvörun vegna efnis @@ -200,4 +199,4 @@ Algeng forrit óaðgengileg Villa kom upp við að hlaða inn algengum forritum. Aðeins forrit með opnum grunnkóða og PWA eru tiltæk í augnablikinu. App Lounge verður lokað af kerfinu á meðan það uppfærir sjálft sig. Vertu helst ekki að gera neitt annað þangað til uppfærslu App Lounge er lokið. Það verður svo aðgengilegt aftur eftir örfáar mínútur. - \ No newline at end of file + diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 1775605a5..17eb88d6f 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -188,7 +188,6 @@ AGGIORNA SESSIONE Account non disponibile Condividere - Nessun tracciamento [%1$s] app con restrizioni Sei troppo giovane per poter installare %1$s. Per favore controlla con i tuoi genitori se la fascia d\'età è corretta o disabilita il controllo parentale per poter effettuare l\'installazione. Questa app potrebbe avere contenuti inappropriati. @@ -202,4 +201,4 @@ Si è verificato un errore durante il caricamento delle app PWA e Open Source. Solo le app comuni sono disponibili per ora. Sto raccogliendo la valutazione di tutte le app che hai installato. L\'applicazione potrebbe contenere nudità, bestemmie, insulti, violenza, estrema sessualità, politicamente scorretto o altri argomenti potenzialmente disturbanti. Questo è rilevante specialmente in ambienti tipo lavoro, scuola, ambienti religiosi e familiari. - \ No newline at end of file + diff --git a/app/src/main/res/values-nb-rNO/strings.xml b/app/src/main/res/values-nb-rNO/strings.xml index a9f81be3d..7c5747466 100644 --- a/app/src/main/res/values-nb-rNO/strings.xml +++ b/app/src/main/res/values-nb-rNO/strings.xml @@ -187,7 +187,6 @@ Logg inn Kontoen er ikke tilgjengelig Del - Ingen sporere [%1$s] Begrenset applikasjon Du er for ung til å kunne installere %1$s. Vennligst sjekk med foreldrene dine om aldersgruppen din er riktig, eller deaktiver foreldrekontroll for å kunne installere det. Denne applikasjonen kan inneholde upassende innhold. diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index 48a5246db..3044732d4 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -174,7 +174,6 @@ Negeren Controleren op updates... %s wil extra modules installeren. Je moet terug inloggen in App Lounge om die te kunnen installeren. - Geen trackers Ga verder naar Google-aanmelden Update apps geïnstalleerd door andere app stores. \nEr zal geprobeerd worden om dergelijke apps te updates van de \"algemene\" en \"open source\" categorie. @@ -200,4 +199,4 @@ Er is een fout opgetreden tijdens het laden van de algemene apps. Enkel opensource apps en PWA\'s zijn beschikbaar. Er is een fout opgetreden tijdens het laden van PWA en opensource apps. Enkel algemene apps zijn beschikbaar. App Lounge zal afgesloten worden tijdens de update. Voer a.u.b. geen andere taken uit totdat de update is voltooid (download + installatie). Binnen maximum enkele minuten zal je terug toegang hebben. - \ No newline at end of file + diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 969ca3f66..e2a6adfe7 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -166,7 +166,6 @@ Выйти из системы Аккаунт недоступен Поделиться - Нет трекеров Зарегистрироваться [%1$s] Ограниченное приложение Вы слишком молоды, чтобы иметь возможность установить %1$s. Пожалуйста, уточните у родителей, правильно ли выбрана ваша возрастная группа, или отключите родительский контроль, чтобы иметь возможность установить эту игру. diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index c119bdc50..559031682 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -187,7 +187,6 @@ Logga in Konto otillgängligt Dela - Inga spårare Denna app kan innehålla olämpligt innehåll. Samlar in innehållsbetyg för alla appar som du installerat. Innehållsvarning @@ -200,4 +199,4 @@ Appar med öppen källkod och PWA-appar är inte tillgängliga Ett fil uppstod vid inläsning av vanliga appar. Endast appar med öppen källkod och PWA-appar är tillgängliga just nu. App Lounge kommer stängas under dess uppdatering. Undvik att göra något i App Lounge till dess att uppdateringen (hämtning + installation) är färdig. Du kommer få åtkomst om några minuter. - \ No newline at end of file + diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index 996cb301e..ccb2d21ae 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -103,7 +103,6 @@ Ayarlar Bir uygulama arayın Uygulama bulunamadı… - Takipçi Yok Oyunlar Kullanılabilir güncellemeleri göster Çıkış yapıldı diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 861231246..5cc09a634 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -29,7 +29,6 @@ Search for an app No apps found… - No Trackers Applications -- GitLab From e8cd6c52d90024d4fcf08cc5fd11b39ded31b76c Mon Sep 17 00:00:00 2001 From: Jonathan Klee Date: Mon, 10 Mar 2025 14:25:34 +0100 Subject: [PATCH 2/3] Remove useless post for liveData This was triggering an extra useless call to Exodus Privacy --- .../e/apps/ui/application/ApplicationViewModel.kt | 7 ------- 1 file changed, 7 deletions(-) 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 2fe48755a..4bcdbc11b 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 @@ -169,16 +169,9 @@ class ApplicationViewModel @Inject constructor( val ratingWithId = playStoreRepository.getContentRatingWithId(packageName, contentRating) - // Later, update with a new rating; no visual change in the UI val updatedContentRating = contentRating.copy(id = ratingWithId.id) _appContentRatingState.update { updatedContentRating } - - applicationLiveData.value?.copy()?.let { - val application = it.first - application.contentRating = updatedContentRating - applicationLiveData.postValue(it) - } } private fun updateShareVisibilityState(shareUri: String) { -- GitLab From 7f5d63f6645c5fd6cb1e8d9d66a1907e4091cb35 Mon Sep 17 00:00:00 2001 From: Jonathan Klee Date: Mon, 10 Mar 2025 14:55:20 +0100 Subject: [PATCH 3/3] Fix leak of a response body --- .../exodus/repositories/AppPrivacyInfoRepositoryImpl.kt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/foundation/e/apps/data/exodus/repositories/AppPrivacyInfoRepositoryImpl.kt b/app/src/main/java/foundation/e/apps/data/exodus/repositories/AppPrivacyInfoRepositoryImpl.kt index e5338ab91..593b1861a 100644 --- a/app/src/main/java/foundation/e/apps/data/exodus/repositories/AppPrivacyInfoRepositoryImpl.kt +++ b/app/src/main/java/foundation/e/apps/data/exodus/repositories/AppPrivacyInfoRepositoryImpl.kt @@ -77,10 +77,11 @@ class AppPrivacyInfoRepositoryImpl @Inject constructor( return withContext(Dispatchers.IO) { var result: List = emptyList() try { - val response = okHttpClient.newCall(request).execute() - if (response.isSuccessful) { - val responseBody = response.body?.string() - result = parseReports(responseBody ?: "") + okHttpClient.newCall(request).execute().use { response -> + if (response.isSuccessful) { + val responseBody = response.body?.string() + result = parseReports(responseBody ?: "") + } } } catch (exception: Exception) { exception.printStackTrace() -- GitLab