diff --git a/app/src/main/java/foundation/e/apps/install/splitinstall/SplitInstallBinder.kt b/app/src/main/java/foundation/e/apps/install/splitinstall/SplitInstallBinder.kt index aad39a2d7f6c87baf28036110e0bc3e2bd7a8c6c..0a95cdbede55312f17f6edf1a91e8dabde74e043 100644 --- a/app/src/main/java/foundation/e/apps/install/splitinstall/SplitInstallBinder.kt +++ b/app/src/main/java/foundation/e/apps/install/splitinstall/SplitInstallBinder.kt @@ -18,22 +18,13 @@ package foundation.e.apps.install.splitinstall -import android.Manifest -import android.app.NotificationChannel -import android.app.NotificationManager -import android.app.PendingIntent import android.content.BroadcastReceiver import android.content.Context import android.content.Intent -import android.content.pm.PackageManager -import android.os.Build -import androidx.core.app.ActivityCompat -import androidx.core.app.NotificationCompat import androidx.core.app.NotificationManagerCompat import androidx.core.content.pm.PackageInfoCompat import foundation.e.apps.ISplitInstallService import foundation.e.apps.MainActivity -import foundation.e.apps.R import foundation.e.apps.data.DownloadManager import foundation.e.apps.data.application.ApplicationRepository import foundation.e.apps.data.login.AuthenticatorRepository @@ -60,7 +51,6 @@ class SplitInstallBinder( companion object { const val TAG = "SplitInstallerBinder" const val AUTH_DATA_ERROR_MESSAGE = "Could not get auth data" - const val NOTIFICATION_CHANNEL = "Dynamic module install" const val NOTIFICATION_ID_KEY = "notification_id_key" const val PACKAGE_NAME_KEY = "package_name_key" const val PREFERENCES_FILE_NAME = "packages_to_ignore" @@ -75,7 +65,6 @@ class SplitInstallBinder( if (authenticatorRepository.gplayAuth == null) { Timber.w(AUTH_DATA_ERROR_MESSAGE) - handleError(packageName) return } @@ -84,111 +73,9 @@ class SplitInstallBinder( } } catch (exception: GPlayLoginException) { Timber.w("$AUTH_DATA_ERROR_MESSAGE $exception") - handleError(packageName) } } - private fun handleError(packageName: String) { - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) { - return - } - - createNotificationChannel(context) - showErrorNotification(context, packageName) - } - - private fun createNotificationChannel(context: Context) { - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) { - return - } - - val descriptionText = context.getString(R.string.notification_channel_desc) - val notificationChannel = NotificationChannel( - NOTIFICATION_CHANNEL, - NOTIFICATION_CHANNEL, - NotificationManager.IMPORTANCE_LOW - ).apply { - description = descriptionText - } - - val notificationManager = - context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager - - notificationManager.createNotificationChannel(notificationChannel) - } - - private fun showErrorNotification(context: Context, packageName: String) { - if (ActivityCompat.checkSelfPermission(context, Manifest.permission.POST_NOTIFICATIONS) - != PackageManager.PERMISSION_GRANTED - ) { - return - } - - val preferences = context.getSharedPreferences(PREFERENCES_FILE_NAME, Context.MODE_PRIVATE) - val ignoreList = preferences.getStringSet(PACKAGES_LIST_KEY, Collections.emptySet()) - if (ignoreList != null && packageName in ignoreList) return - - val appInfo = context.packageManager.getPackageInfo(packageName, 0).applicationInfo - val appLabel = context.packageManager.getApplicationLabel(appInfo) - val callerUid = appInfo.uid - val contentText = context.getString( - R.string.split_install_warning_text, - appLabel - ) - - val notificationBuilder = NotificationCompat.Builder(context, NOTIFICATION_CHANNEL) - .setSmallIcon(R.drawable.app_lounge_notification_icon) - .setContentTitle(context.getString(R.string.split_install_warning_title, appLabel)) - .setContentText(contentText) - .setStyle(NotificationCompat.BigTextStyle().bigText(contentText)) - .addAction( - NotificationCompat.Action.Builder( - null, - context.getString(R.string.sign_in), - buildSignInPendingIntent(callerUid) - ).build() - ) - .addAction( - NotificationCompat.Action.Builder( - null, - context.getString(R.string.ignore), - buildIgnorePendingIntent(callerUid, packageName) - ).build() - ) - - with(NotificationManagerCompat.from(context)) { - notify(callerUid, notificationBuilder.build()) - } - } - - private fun buildIgnorePendingIntent(callerUid: Int, packageName: String): PendingIntent { - - val ignoreIntent = Intent(context, IgnoreReceiver::class.java).apply { - putExtra(NOTIFICATION_ID_KEY, callerUid) - putExtra(PACKAGE_NAME_KEY, packageName) - } - - return PendingIntent.getBroadcast( - context, - callerUid, - ignoreIntent, - PendingIntent.FLAG_MUTABLE - ) - } - - private fun buildSignInPendingIntent(callerUid: Int): PendingIntent { - val signInIntent = Intent(context, SignInReceiver::class.java).apply { - putExtra(NOTIFICATION_ID_KEY, callerUid) - } - - return PendingIntent.getBroadcast( - context, - callerUid, - signInIntent, - PendingIntent.FLAG_MUTABLE - ) - } - fun setService(service: foundation.e.splitinstall.ISplitInstallService) { splitInstallSystemService = service installPendingModules() diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 4cb3a2fd6de00cec172ece2e0f2bf82755dcc179..4b3a8341c267b5b32bb1185c18d49291a71e8a50 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -170,11 +170,4 @@ Das anonyme Konto, das von Ihnen genutzt wird, ist nicht verfügbar. Bitte erneuern (refresh) Sie die Sitzung, um ein neues anonymes Konto zu erhalten. SITZUNG ERNEUERN Bitte etwas Platz auf dem Telefon freimachen, damit die App Lounge ordnungsgemäß funktionieren kann. - - - Warnung bezüglich %s - %s möchte zusätzliche Module installieren. Sie müssen sich erneut bei AppLounge anmelden, um sie installieren zu können. - Split-Installationskanal - Einloggen - Ignorieren - \ 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 39c336b1240d4d535a68875d775a90aa5a4f781f..8f20b9eff5839de146b0cb83208fd890e3a1760c 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -156,11 +156,6 @@ O mostrar sólo Libera %1$s en tu teléfono para recibir las últimas actualizaciones. Por favor, libera algo de espacio en tu teléfono para que App Lounge funcione correctamente. - Advertencia sobre %s - %s quiere instalar módulos adicionales. Debes iniciar sesión en AppLounge nuevamente para poder instalarlos. - Canal de instalación dividido - Iniciar sesión - Ignorar Descargando… Comprobando actualizaciones... Actualizar aplicaciones instaladas por otras tiendas @@ -177,4 +172,4 @@ \n\t- mitigar el microtargeting \n - limitar el impacto en caso de que esta cuenta sea restringida por Google." Archivo adicional para %s - \ No newline at end of file + diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 77d6840b6b0410d8f63feff9e2fd229a2ae514b3..cab017eee336b46abb5a8bbbb8358b03c394e563 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -168,9 +168,4 @@ Libérez %1$s sur votre téléphone afin de bénéficier des dernières mises à jour. Merci de libérer de l\'espace sur votre téléphone pour qu\'App Lounge puisse fonctionner correctement. Vérification des mises à jour... - Avertissement concernant %s - %s souhaite installer des modules supplémentaires. Vous devez vous reconnecter à AppLounge pour pouvoir les installer. - Canal d\'installation fractionnée - Connexion - Ignorer - \ No newline at end of file + diff --git a/app/src/main/res/values-is/strings.xml b/app/src/main/res/values-is/strings.xml index 7784682628780f05ed484ac960ed7c02096a592f..63f559f7d0a60e6b668cc7c8aea4f79d66db6763 100644 --- a/app/src/main/res/values-is/strings.xml +++ b/app/src/main/res/values-is/strings.xml @@ -171,9 +171,4 @@ Losaðu um %1$s pláss á símanum þínum til að fá nýjustu uppfærslur. Athuga með uppfærslur... Losaðu um svolítið pláss á símanum þínum svo App Lounge geti virkað eðlilega. - Hunsa - Skipta upp uppsetningarás - Aðvörun viðkomandi %s - %s vill fá að setja upp viðbótareiningar.Þú þarft að skrá þig aftur inn í AppLounge til að geta sett þær inn. - Skrá inn - \ 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 a06fe7b42faa9db276a51b336c27dc4cbcb6a4d6..666c770a448fbf85ee0a25473c0ef5bac109799d 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -167,14 +167,9 @@ \n\t• limitare l\'impatto nel caso in cui l\'account venga bloccato da Google Per poter scaricare l\'aggiornamento, devi liberare %1$s di spazio sullo smartphone. Se non liberi un pò di spazio sullo smartphone, App Lounge non può funzionare correttamente. - Avviso riguardante %s - %s vuole installare moduli aggiuntivi. Per poterlo fare, devi accedere nuovamente ad AppLounge. - Canale d\'installazione frazionata - Accedi - Ignora Verifico Aggiornamenti... Richiedi report ad Exodus Toccando su \"%1$s\" verrà aperto un tab sul tuo browser con il nome del pacchetto app preimpostato.<br /><br />Tocca su \"Perform analysis\" per aviare l\'analisi da parte di Exodus.<br /><br />Quando verrò mostrato il pulsante \"See the report\" (potrebbe volerci un pò di tempo, a seconda dell\'app scelta) puoi chiudere il tab e tornare alla descrizione app su %2$s dove dovresti vedere il Punteggio Privacy. A volte Exodus non riesce ad analizzare l\'app.<br /><br />NB: potresti dover aspettare anche 10 min per poter vedere il punteggio nella descrizione app. L\'account anonimo che stai utilizzando non è disponibile. Agiorna la sessione per ottenerne un altro. AGGIORNA SESSIONE - \ 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 d127090b66c3f0b1e02a77709a4f548f026bca5f..2c4be100892bf090e028ed8f4bff72b35e1ae92e 100644 --- a/app/src/main/res/values-nb-rNO/strings.xml +++ b/app/src/main/res/values-nb-rNO/strings.xml @@ -171,9 +171,4 @@ Frigjør %1$s på telefonen for å kunne få de nyeste oppdateringene. Vennligst frigjør litt plass på telefonen din slik at App Lounge kan fungere som den skal. Ved å klikke på \"%1$s\" åpnes det en fane i nettleseren din med applikasjonens pakkenavn forhåndsutfylt.<br /><br />Klikk på \"Utfør analyse\" for å starte analysen i Exodus.<br /><br />Når knappen \"Se rapport\" vises (det kan ta en stund avhengig av applikasjon) kan du lukke fanen og gå tilbake til appbeskrivelsen i %2$s hvor du skulle se personvernscoren. Noen ganger kan Exodus mislykkes i å analysere applikasjonen.<br /><br />Merk: det kan ta opptil 10 minutter før personvernscoren vises i appbeskrivelsen. - Ignorer - Delt installasjonskanal - Advarsel angående %s - %s vil installere ekstra moduler. Du må logge inn på App Lounge på nytt for å kunne installere dem. - Logg inn - \ No newline at end of file + diff --git a/app/src/main/res/values-sv/strings.xml b/app/src/main/res/values-sv/strings.xml index b1eb1f3f183af4cf35404055caa24bb5d0a06971..ab2a1146a8c6897bea0a123120f23f634f527963 100644 --- a/app/src/main/res/values-sv/strings.xml +++ b/app/src/main/res/values-sv/strings.xml @@ -171,9 +171,4 @@ \n\t• minska effekten om detta konto skulle begränsas av Google Att tvinga en installation tillåter dig att hämta och installera men det är inte garanterat att fungera.

Försök att installera appar som inte stöds kan orsaka krascher eller göra systemet långsammare.

Vi arbetar med att göra det mer kompatibelt med denna applikation i en nära framtid.
Genom att trycka på \"%1$s\" kommer en flik öppnas i din webbläsare med appens paketnamn förifyllt.<br /><br />Tryck på \"Perform analysis\" för att starta analysen av Exodus.<br /><br /> När knappen \"See the report\" visas (det kan ta ett tag beroende på appen) kan du stänga fliken och gå tillbaka till appbeskrivningen i %2$s där du bör se integritetspoängen. Ibland kan Exodus misslyckas med att analysera appen. <br /><br />OBS! Det kan ta upp till 10 min innan poängen visas i appbeskrivningen. - Ignorera - Kanal för delad installation - Varning gällande %s - %s vill installera extra moduler. Du måste logga in till AppLounge igen för att kunna installera dom. - Logga in - \ No newline at end of file + diff --git a/app/src/main/res/values-uk/strings.xml b/app/src/main/res/values-uk/strings.xml index 88eac496b13ae03a67c777ba98dcea99962226b8..12b9d97a85f886257937dbd1a718503b890f2d37 100644 --- a/app/src/main/res/values-uk/strings.xml +++ b/app/src/main/res/values-uk/strings.xml @@ -155,5 +155,4 @@ Це може бути тому, що токен не міг бути згенерований / підтверджений, або за інших причин. \n \nНатисніть «Повторити спробу» щоб спробувати знову. - Зареєструватися \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index aeb2e0597e9d5c5724e582f904f09e7f209ed972..4825fd0ed983cad0a6149a6e3b47e68d6233cfad 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -213,10 +213,4 @@ Clicking on \"%1$s\" will open a tab in your browser with the app\'s package name prefilled.<br /><br />Click on \"Perform analysis\" to start the analysis by Exodus.<br /><br />When the button \"See the report\" is displayed (it can take a while depending on the app) you can close the tab and go back to the app description in %2$s where you should see the Privacy Score. Sometimes Exodus can fail to analyze the app.<br /><br />NB: it can take up to 10 min for the score to be displayed in the app description. Free up %1$s on your phone to get the latest updates. Please free up some space on your phone so App Lounge can work properly. - - Warning regarding %s - %s wants to install extra modules. You must sign in again to AppLounge to be able to install them. - Split Install channel - Sign in - Ignore \ No newline at end of file