Loading app/src/main/java/foundation/e/apps/data/DownloadManager.kt +6 −3 Original line number Diff line number Diff line Loading @@ -173,12 +173,15 @@ class DownloadManager @Inject constructor( } } fun isDownloadSuccessful(downloadId: Long): Boolean { return getDownloadStatus(downloadId) == DownloadManager.STATUS_SUCCESSFUL fun isDownloadSuccessful(downloadId: Long): Pair<Boolean, Int> { val downloadStatus = getDownloadStatus(downloadId) val isSuccessFul = downloadStatus == DownloadManager.STATUS_SUCCESSFUL return Pair(isSuccessFul, downloadStatus) } fun hasDownloadFailed(downloadId: Long): Boolean { return getDownloadStatus(downloadId) == DownloadManager.STATUS_FAILED val downloadStatus = getDownloadStatus(downloadId) return downloadStatus == DownloadManager.STATUS_FAILED } fun getSizeRequired(downloadId: Long): Long { Loading app/src/main/java/foundation/e/apps/data/cleanapk/RetrofitModule.kt +1 −1 Original line number Diff line number Diff line Loading @@ -185,7 +185,7 @@ object RetrofitModule { ): Response { Timber.e("buildErrorResponse: ${e.localizedMessage}") return Response.Builder() .code(999) .code(403) .message(e.localizedMessage ?: "Unknown error") .request(chain.request()) .protocol(Protocol.HTTP_1_1) Loading app/src/main/java/foundation/e/apps/install/download/DownloadManagerUtils.kt +11 −3 Original line number Diff line number Diff line Loading @@ -106,10 +106,18 @@ class DownloadManagerUtils @Inject constructor( numberOfDownloadedItems: Int, fusedDownload: FusedDownload, downloadId: Long ) = downloadManager.isDownloadSuccessful(downloadId) && areAllFilesDownloaded( ): Boolean { val isDownloadSuccessful = downloadManager.isDownloadSuccessful(downloadId) if (isDownloadSuccessful.second == -1) { handleDownloadFailed(fusedDownload, downloadId) } return isDownloadSuccessful.first && areAllFilesDownloaded( numberOfDownloadedItems, fusedDownload ) && checkCleanApkSignatureOK(fusedDownload) } private fun areAllFilesDownloaded( numberOfDownloadedItems: Int, fusedDownload: FusedDownload Loading Loading
app/src/main/java/foundation/e/apps/data/DownloadManager.kt +6 −3 Original line number Diff line number Diff line Loading @@ -173,12 +173,15 @@ class DownloadManager @Inject constructor( } } fun isDownloadSuccessful(downloadId: Long): Boolean { return getDownloadStatus(downloadId) == DownloadManager.STATUS_SUCCESSFUL fun isDownloadSuccessful(downloadId: Long): Pair<Boolean, Int> { val downloadStatus = getDownloadStatus(downloadId) val isSuccessFul = downloadStatus == DownloadManager.STATUS_SUCCESSFUL return Pair(isSuccessFul, downloadStatus) } fun hasDownloadFailed(downloadId: Long): Boolean { return getDownloadStatus(downloadId) == DownloadManager.STATUS_FAILED val downloadStatus = getDownloadStatus(downloadId) return downloadStatus == DownloadManager.STATUS_FAILED } fun getSizeRequired(downloadId: Long): Long { Loading
app/src/main/java/foundation/e/apps/data/cleanapk/RetrofitModule.kt +1 −1 Original line number Diff line number Diff line Loading @@ -185,7 +185,7 @@ object RetrofitModule { ): Response { Timber.e("buildErrorResponse: ${e.localizedMessage}") return Response.Builder() .code(999) .code(403) .message(e.localizedMessage ?: "Unknown error") .request(chain.request()) .protocol(Protocol.HTTP_1_1) Loading
app/src/main/java/foundation/e/apps/install/download/DownloadManagerUtils.kt +11 −3 Original line number Diff line number Diff line Loading @@ -106,10 +106,18 @@ class DownloadManagerUtils @Inject constructor( numberOfDownloadedItems: Int, fusedDownload: FusedDownload, downloadId: Long ) = downloadManager.isDownloadSuccessful(downloadId) && areAllFilesDownloaded( ): Boolean { val isDownloadSuccessful = downloadManager.isDownloadSuccessful(downloadId) if (isDownloadSuccessful.second == -1) { handleDownloadFailed(fusedDownload, downloadId) } return isDownloadSuccessful.first && areAllFilesDownloaded( numberOfDownloadedItems, fusedDownload ) && checkCleanApkSignatureOK(fusedDownload) } private fun areAllFilesDownloaded( numberOfDownloadedItems: Int, fusedDownload: FusedDownload Loading