Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e209cc76 authored by Sayantan Roychowdhury's avatar Sayantan Roychowdhury
Browse files

other fixes for gitlab app definition

parent f7f8b05b
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -89,11 +89,15 @@ class FusedManagerImpl @Inject constructor(
    override suspend fun updateDownloadStatus(fusedDownload: FusedDownload, status: Status) {
        if (status == Status.INSTALLED) {
            fusedDownload.status = status
            if (fusedDownload.packageName != context.packageName) {
                flushOldDownload(fusedDownload.packageName)
            }
            fusedDownloadRepository.deleteDownload(fusedDownload)
        } else if (status == Status.INSTALLING) {
            fusedDownload.downloadIdMap.all { true }
            fusedDownload.status = status
            fusedDownload.status =
                if (fusedDownload.packageName == context.packageName) Status.INSTALLED
                else status
            fusedDownloadRepository.updateDownload(fusedDownload)
            installApp(fusedDownload)
        }
+1 −0
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ data class FusedDownload(
    val isFree: Boolean = true,
    var appSize: Long = 0,
    var files: List<File> = mutableListOf(),
    var isSystemApp: Boolean = false,
    var signature: String = String()
) {
    @Ignore
+4 −3
Original line number Diff line number Diff line
@@ -134,9 +134,10 @@ class DownloadManagerUtils @Inject constructor(
    }

    private suspend fun checkCleanApkSignatureOK(fusedDownload: FusedDownload): Boolean {
        if (fusedDownload.origin != Origin.CLEANAPK || fusedManagerRepository.isFdroidApplicationSigned(
                context, fusedDownload
            )
        if (
            fusedDownload.isSystemApp ||
            fusedDownload.origin != Origin.CLEANAPK ||
            fusedManagerRepository.isFdroidApplicationSigned(context, fusedDownload)
        ) {
            Timber.d("Apk signature is OK")
            return true
+7 −3
Original line number Diff line number Diff line
@@ -87,10 +87,11 @@ class AppInstallProcessor @Inject constructor(
            application.latest_version_code,
            application.offer_type,
            application.isFree,
            application.originalSize
            application.originalSize,
            isSystemApp = application.isSystemApp,
        )

        if (fusedDownload.type == Type.PWA) {
        if (fusedDownload.type == Type.PWA || application.isSystemApp) {
            fusedDownload.downloadURLList = mutableListOf(application.url)
        }

@@ -115,7 +116,10 @@ class AppInstallProcessor @Inject constructor(
                return
            }

            if (fusedDownload.type != Type.PWA && !updateDownloadUrls(fusedDownload)) return
            if (!fusedDownload.isSystemApp && fusedDownload.type != Type.PWA && !updateDownloadUrls(
                    fusedDownload
                )
            ) return

            val downloadAdded = fusedManagerRepository.addDownload(fusedDownload)
            if (!downloadAdded) {