From 2b956afd382d2ccc027a8e827b684beba855b1ca Mon Sep 17 00:00:00 2001 From: danthe1st Date: Mon, 1 Aug 2022 21:42:38 +0200 Subject: [PATCH] fix: exception trying to parcel PatchClass on activity save --- app/build.gradle.kts | 1 + .../manager/ui/screens/mainsubscreens/PatcherSubscreen.kt | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 6ac5a983fd..8bc8fd0dbd 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -6,6 +6,7 @@ plugins { id("com.android.application") id("org.jetbrains.kotlin.android") id("com.google.devtools.ksp") + id("org.jetbrains.kotlin.android.extensions") kotlin("plugin.serialization") version "1.7.10" } diff --git a/app/src/main/java/app/revanced/manager/ui/screens/mainsubscreens/PatcherSubscreen.kt b/app/src/main/java/app/revanced/manager/ui/screens/mainsubscreens/PatcherSubscreen.kt index 73e1806960..22c67de7d0 100644 --- a/app/src/main/java/app/revanced/manager/ui/screens/mainsubscreens/PatcherSubscreen.kt +++ b/app/src/main/java/app/revanced/manager/ui/screens/mainsubscreens/PatcherSubscreen.kt @@ -2,6 +2,7 @@ package app.revanced.manager.ui.screens.mainsubscreens import android.app.Application import android.content.pm.PackageManager +import android.os.Parcelable import android.util.Log import androidx.activity.ComponentActivity import androidx.compose.foundation.layout.Column @@ -41,6 +42,7 @@ import app.revanced.patcher.util.patch.implementation.DexPatchBundle import com.ramcosta.composedestinations.annotation.Destination import com.ramcosta.composedestinations.annotation.RootNavGraph import dalvik.system.DexClassLoader +import kotlinx.android.parcel.Parcelize import kotlinx.coroutines.flow.first import kotlinx.coroutines.flow.map import kotlinx.coroutines.launch @@ -127,10 +129,11 @@ fun PatcherSubscreen( } } +@Parcelize data class PatchClass( val patch: Class>, val unsupported: Boolean, -) +) : Parcelable class PatcherViewModel(val app: Application) : AndroidViewModel(app) { private val bundleCacheDir = app.filesDir.resolve("bundle-cache").also { it.mkdirs() }