diff --git a/app/src/main/java/com/topjohnwu/magisk/data/repository/MagiskRepository.kt b/app/src/main/java/com/topjohnwu/magisk/data/repository/MagiskRepository.kt index e8d8adcf4..869a3c031 100644 --- a/app/src/main/java/com/topjohnwu/magisk/data/repository/MagiskRepository.kt +++ b/app/src/main/java/com/topjohnwu/magisk/data/repository/MagiskRepository.kt @@ -3,6 +3,7 @@ package com.topjohnwu.magisk.data.repository import android.content.Context import android.content.pm.PackageManager import com.topjohnwu.magisk.App +import com.topjohnwu.magisk.Config import com.topjohnwu.magisk.KConfig import com.topjohnwu.magisk.data.database.base.su import com.topjohnwu.magisk.data.database.base.suRaw @@ -52,6 +53,17 @@ class MagiskRepository( KConfig.UpdateChannel.CANARY_DEBUG -> apiRaw.fetchCanaryDebugConfig() KConfig.UpdateChannel.CUSTOM -> apiRaw.fetchCustomConfig(KConfig.customUpdateChannel) } + .doOnSuccess { + Config.remoteMagiskVersionCode = it.magisk.versionCode.toIntOrNull() ?: 0 + Config.magiskLink = it.magisk.link + Config.magiskNoteLink = it.magisk.note + Config.magiskMD5 = it.magisk.hash + Config.remoteManagerVersionCode = it.app.versionCode.toIntOrNull() ?: 0 + Config.remoteManagerVersionString = it.app.version + Config.managerLink = it.app.link + Config.managerNoteLink = it.app.note + Config.uninstallerLink = it.uninstaller.link + } fun fetchMagiskVersion(): Single = Single.zip(