mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-08-20 08:47:32 +00:00
Updated configuration to hold data when necessary
This commit is contained in:

committed by
John Wu

parent
12e00c3054
commit
b3d777bb6c
@@ -26,7 +26,7 @@ open class CompoundDownloadService : SubstrateDownloadService() {
|
|||||||
file: File,
|
file: File,
|
||||||
subject: DownloadSubject.Magisk
|
subject: DownloadSubject.Magisk
|
||||||
) = when (subject.configuration) {
|
) = when (subject.configuration) {
|
||||||
Configuration.FLASH -> FlashActivity.flash(this, file)
|
Configuration.Flash -> FlashActivity.flash(this, file)
|
||||||
else -> Unit
|
else -> Unit
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@ open class CompoundDownloadService : SubstrateDownloadService() {
|
|||||||
file: File,
|
file: File,
|
||||||
subject: DownloadSubject.Module
|
subject: DownloadSubject.Module
|
||||||
) = when (subject.configuration) {
|
) = when (subject.configuration) {
|
||||||
Configuration.FLASH -> FlashActivity.install(this, file)
|
Configuration.Flash -> FlashActivity.install(this, file)
|
||||||
else -> Unit
|
else -> Unit
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -52,7 +52,7 @@ open class CompoundDownloadService : SubstrateDownloadService() {
|
|||||||
file: File,
|
file: File,
|
||||||
subject: DownloadSubject.Magisk
|
subject: DownloadSubject.Magisk
|
||||||
) = when (subject.configuration) {
|
) = when (subject.configuration) {
|
||||||
Configuration.FLASH -> setContentIntent(FlashActivity.flashIntent(context, file))
|
Configuration.Flash -> setContentIntent(FlashActivity.flashIntent(context, file))
|
||||||
else -> this
|
else -> this
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,7 +60,7 @@ open class CompoundDownloadService : SubstrateDownloadService() {
|
|||||||
file: File,
|
file: File,
|
||||||
subject: DownloadSubject.Module
|
subject: DownloadSubject.Module
|
||||||
) = when (subject.configuration) {
|
) = when (subject.configuration) {
|
||||||
Configuration.FLASH -> setContentIntent(FlashActivity.installIntent(context, file))
|
Configuration.Flash -> setContentIntent(FlashActivity.installIntent(context, file))
|
||||||
else -> this
|
else -> this
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,5 +1,21 @@
|
|||||||
package com.topjohnwu.magisk.model.entity.internal
|
package com.topjohnwu.magisk.model.entity.internal
|
||||||
|
|
||||||
enum class Configuration {
|
import android.net.Uri
|
||||||
FLASH, DOWNLOAD, UNINSTALL, PATCH
|
import android.os.Parcelable
|
||||||
|
import kotlinx.android.parcel.Parcelize
|
||||||
|
|
||||||
|
sealed class Configuration : Parcelable {
|
||||||
|
|
||||||
|
@Parcelize
|
||||||
|
object Flash : Configuration()
|
||||||
|
|
||||||
|
@Parcelize
|
||||||
|
object Download : Configuration()
|
||||||
|
|
||||||
|
@Parcelize
|
||||||
|
object Uninstall : Configuration()
|
||||||
|
|
||||||
|
@Parcelize
|
||||||
|
data class Patch(val fileUri: Uri) : Configuration()
|
||||||
|
|
||||||
}
|
}
|
Reference in New Issue
Block a user