mirror of
https://github.com/ReVanced/revanced-library.git
synced 2026-01-18 08:53:57 +00:00
fix: Map dependencies from KClass into String to fix serialization
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
package app.revanced.library
|
package app.revanced.library
|
||||||
|
|
||||||
import app.revanced.patcher.PatchClass
|
|
||||||
import app.revanced.patcher.PatchSet
|
import app.revanced.patcher.PatchSet
|
||||||
import app.revanced.patcher.patch.Patch
|
import app.revanced.patcher.patch.Patch
|
||||||
import app.revanced.patcher.patch.options.PatchOption
|
import app.revanced.patcher.patch.options.PatchOption
|
||||||
@@ -31,7 +30,7 @@ object PatchUtils {
|
|||||||
"Use getMostCommonCompatibleVersions instead.",
|
"Use getMostCommonCompatibleVersions instead.",
|
||||||
ReplaceWith(
|
ReplaceWith(
|
||||||
"getMostCommonCompatibleVersions(patches, setOf(packageName))" +
|
"getMostCommonCompatibleVersions(patches, setOf(packageName))" +
|
||||||
".entries.firstOrNull()?.value?.keys?.firstOrNull()",
|
".entries.firstOrNull()?.value?.keys?.firstOrNull()",
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
fun getMostCommonCompatibleVersion(
|
fun getMostCommonCompatibleVersion(
|
||||||
@@ -149,7 +148,7 @@ object PatchUtils {
|
|||||||
val name: String?,
|
val name: String?,
|
||||||
val description: String?,
|
val description: String?,
|
||||||
val compatiblePackages: Set<Patch.CompatiblePackage>?,
|
val compatiblePackages: Set<Patch.CompatiblePackage>?,
|
||||||
val dependencies: Set<PatchClass>?,
|
val dependencies: Set<String>?,
|
||||||
val use: Boolean,
|
val use: Boolean,
|
||||||
var requiresIntegrations: Boolean,
|
var requiresIntegrations: Boolean,
|
||||||
val options: Map<String, FullJsonPatchOption<*>>,
|
val options: Map<String, FullJsonPatchOption<*>>,
|
||||||
@@ -160,7 +159,7 @@ object PatchUtils {
|
|||||||
patch.name,
|
patch.name,
|
||||||
patch.description,
|
patch.description,
|
||||||
patch.compatiblePackages,
|
patch.compatiblePackages,
|
||||||
patch.dependencies,
|
buildSet { patch.dependencies?.forEach { add(it.toString()) } },
|
||||||
patch.use,
|
patch.use,
|
||||||
patch.requiresIntegrations,
|
patch.requiresIntegrations,
|
||||||
patch.options.mapValues { FullJsonPatchOption.fromPatchOption(it.value) },
|
patch.options.mapValues { FullJsonPatchOption.fromPatchOption(it.value) },
|
||||||
|
|||||||
Reference in New Issue
Block a user