Loading app/src/main/java/foundation/e/apps/install/download/DownloadManagerUtils.kt +5 −3 Original line number Diff line number Diff line Loading @@ -44,7 +44,7 @@ class DownloadManagerUtils @Inject constructor( @ApplicationContext private val context: Context, private val fusedManagerRepository: FusedManagerRepository, private val downloadManager: DownloadManager, private val storageNotificationManager: StorageNotificationManager, private val storageNotificationManager: StorageNotificationManager ) { private val mutex = Mutex() Loading Loading @@ -107,7 +107,8 @@ class DownloadManagerUtils @Inject constructor( fusedDownload: FusedDownload, downloadId: Long ) = downloadManager.isDownloadSuccessful(downloadId) && areAllFilesDownloaded( numberOfDownloadedItems, fusedDownload numberOfDownloadedItems, fusedDownload ) && checkCleanApkSignatureOK(fusedDownload) private fun areAllFilesDownloaded( Loading @@ -126,7 +127,8 @@ class DownloadManagerUtils @Inject constructor( private suspend fun checkCleanApkSignatureOK(fusedDownload: FusedDownload): Boolean { if (fusedDownload.origin != Origin.CLEANAPK || fusedManagerRepository.isFdroidApplicationSigned( context, fusedDownload context, fusedDownload ) ) { Timber.d("Apk signature is OK") Loading app/src/main/java/foundation/e/apps/install/notification/StorageNotificationManager.kt +1 −2 Original line number Diff line number Diff line Loading @@ -35,14 +35,13 @@ import javax.inject.Inject class StorageNotificationManager @Inject constructor( @ApplicationContext private val context: Context, private val downloadManager: DownloadManager, private val downloadManager: DownloadManager ) { companion object { const val NOT_ENOUGH_SPACE_NOTIFICATION_ID = 7874 } fun showNotEnoughSpaceNotification(fusedDownload: FusedDownload, downloadId: Long? = null) { with(NotificationManagerCompat.from(context)) { if (ActivityCompat.checkSelfPermission(context, Manifest.permission.POST_NOTIFICATIONS) != PackageManager.PERMISSION_GRANTED Loading app/src/main/java/foundation/e/apps/install/workmanager/AppInstallProcessor.kt +8 −4 Original line number Diff line number Diff line Loading @@ -164,7 +164,8 @@ class AppInstallProcessor @Inject constructor( EventBus.invokeEvent( AppEvent.UpdateEvent( ResultSupreme.WorkError( ResultStatus.UNKNOWN, fusedDownload ResultStatus.UNKNOWN, fusedDownload ) ) ) Loading @@ -177,7 +178,8 @@ class AppInstallProcessor @Inject constructor( fusedDownload: FusedDownload ) { fusedAPIRepository.updateFusedDownloadWithDownloadingInfo( fusedDownload.origin, fusedDownload fusedDownload.origin, fusedDownload ) } Loading Loading @@ -257,7 +259,8 @@ class AppInstallProcessor @Inject constructor( private suspend fun isUpdateCompleted(): Boolean { val downloadListWithoutAnyIssue = fusedDownloadRepository.getDownloadList().filter { !listOf( Status.INSTALLATION_ISSUE, Status.PURCHASE_NEEDED Status.INSTALLATION_ISSUE, Status.PURCHASE_NEEDED ).contains(it.status) } Loading Loading @@ -353,7 +356,8 @@ class AppInstallProcessor @Inject constructor( else -> { Timber.wtf( TAG, "===> ${fusedDownload.name} is in wrong state ${fusedDownload.status}" TAG, "===> ${fusedDownload.name} is in wrong state ${fusedDownload.status}" ) finishInstallation(fusedDownload) } Loading Loading
app/src/main/java/foundation/e/apps/install/download/DownloadManagerUtils.kt +5 −3 Original line number Diff line number Diff line Loading @@ -44,7 +44,7 @@ class DownloadManagerUtils @Inject constructor( @ApplicationContext private val context: Context, private val fusedManagerRepository: FusedManagerRepository, private val downloadManager: DownloadManager, private val storageNotificationManager: StorageNotificationManager, private val storageNotificationManager: StorageNotificationManager ) { private val mutex = Mutex() Loading Loading @@ -107,7 +107,8 @@ class DownloadManagerUtils @Inject constructor( fusedDownload: FusedDownload, downloadId: Long ) = downloadManager.isDownloadSuccessful(downloadId) && areAllFilesDownloaded( numberOfDownloadedItems, fusedDownload numberOfDownloadedItems, fusedDownload ) && checkCleanApkSignatureOK(fusedDownload) private fun areAllFilesDownloaded( Loading @@ -126,7 +127,8 @@ class DownloadManagerUtils @Inject constructor( private suspend fun checkCleanApkSignatureOK(fusedDownload: FusedDownload): Boolean { if (fusedDownload.origin != Origin.CLEANAPK || fusedManagerRepository.isFdroidApplicationSigned( context, fusedDownload context, fusedDownload ) ) { Timber.d("Apk signature is OK") Loading
app/src/main/java/foundation/e/apps/install/notification/StorageNotificationManager.kt +1 −2 Original line number Diff line number Diff line Loading @@ -35,14 +35,13 @@ import javax.inject.Inject class StorageNotificationManager @Inject constructor( @ApplicationContext private val context: Context, private val downloadManager: DownloadManager, private val downloadManager: DownloadManager ) { companion object { const val NOT_ENOUGH_SPACE_NOTIFICATION_ID = 7874 } fun showNotEnoughSpaceNotification(fusedDownload: FusedDownload, downloadId: Long? = null) { with(NotificationManagerCompat.from(context)) { if (ActivityCompat.checkSelfPermission(context, Manifest.permission.POST_NOTIFICATIONS) != PackageManager.PERMISSION_GRANTED Loading
app/src/main/java/foundation/e/apps/install/workmanager/AppInstallProcessor.kt +8 −4 Original line number Diff line number Diff line Loading @@ -164,7 +164,8 @@ class AppInstallProcessor @Inject constructor( EventBus.invokeEvent( AppEvent.UpdateEvent( ResultSupreme.WorkError( ResultStatus.UNKNOWN, fusedDownload ResultStatus.UNKNOWN, fusedDownload ) ) ) Loading @@ -177,7 +178,8 @@ class AppInstallProcessor @Inject constructor( fusedDownload: FusedDownload ) { fusedAPIRepository.updateFusedDownloadWithDownloadingInfo( fusedDownload.origin, fusedDownload fusedDownload.origin, fusedDownload ) } Loading Loading @@ -257,7 +259,8 @@ class AppInstallProcessor @Inject constructor( private suspend fun isUpdateCompleted(): Boolean { val downloadListWithoutAnyIssue = fusedDownloadRepository.getDownloadList().filter { !listOf( Status.INSTALLATION_ISSUE, Status.PURCHASE_NEEDED Status.INSTALLATION_ISSUE, Status.PURCHASE_NEEDED ).contains(it.status) } Loading Loading @@ -353,7 +356,8 @@ class AppInstallProcessor @Inject constructor( else -> { Timber.wtf( TAG, "===> ${fusedDownload.name} is in wrong state ${fusedDownload.status}" TAG, "===> ${fusedDownload.name} is in wrong state ${fusedDownload.status}" ) finishInstallation(fusedDownload) } Loading