mirror of
https://github.com/revanced/revanced-patches
synced 2024-12-02 23:42:55 +01:00
refactor: move classes to correct places and fix their access
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
This commit is contained in:
parent
439343ab9d
commit
e29be7c6d4
@ -20,14 +20,14 @@ internal class JsonGenerator : PatchesFileGenerator {
|
|||||||
it.version ?: "0.0.0",
|
it.version ?: "0.0.0",
|
||||||
!it.include,
|
!it.include,
|
||||||
it.options?.map { option ->
|
it.options?.map { option ->
|
||||||
Option(
|
JsonPatch.Option(
|
||||||
option.key,
|
option.key,
|
||||||
option.title,
|
option.title,
|
||||||
option.description,
|
option.description,
|
||||||
option.required,
|
option.required,
|
||||||
option.let { lo ->
|
option.let { listOption ->
|
||||||
if (lo is PatchOption.ListOption<*>) {
|
if (listOption is PatchOption.ListOption<*>) {
|
||||||
lo.options.toMutableList().toTypedArray()
|
listOption.options.toMutableList().toTypedArray()
|
||||||
} else null
|
} else null
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
@ -36,7 +36,7 @@ internal class JsonGenerator : PatchesFileGenerator {
|
|||||||
dep.java.patchName
|
dep.java.patchName
|
||||||
}?.toTypedArray() ?: emptyArray(),
|
}?.toTypedArray() ?: emptyArray(),
|
||||||
it.compatiblePackages?.map { pkg ->
|
it.compatiblePackages?.map { pkg ->
|
||||||
CompatiblePackage(pkg.name, pkg.versions)
|
JsonPatch.CompatiblePackage(pkg.name, pkg.versions)
|
||||||
}?.toTypedArray() ?: emptyArray()
|
}?.toTypedArray() ?: emptyArray()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@ -45,7 +45,7 @@ internal class JsonGenerator : PatchesFileGenerator {
|
|||||||
json.writeText(GsonBuilder().serializeNulls().create().toJson(patches))
|
json.writeText(GsonBuilder().serializeNulls().create().toJson(patches))
|
||||||
}
|
}
|
||||||
|
|
||||||
data class JsonPatch(
|
private class JsonPatch(
|
||||||
val name: String,
|
val name: String,
|
||||||
val description: String,
|
val description: String,
|
||||||
val version: String,
|
val version: String,
|
||||||
@ -53,18 +53,18 @@ internal class JsonGenerator : PatchesFileGenerator {
|
|||||||
val options: Array<Option>,
|
val options: Array<Option>,
|
||||||
val dependencies: Array<String>,
|
val dependencies: Array<String>,
|
||||||
val compatiblePackages: Array<CompatiblePackage>,
|
val compatiblePackages: Array<CompatiblePackage>,
|
||||||
)
|
) {
|
||||||
|
class CompatiblePackage(
|
||||||
|
val name: String,
|
||||||
|
val versions: Array<String>,
|
||||||
|
)
|
||||||
|
|
||||||
data class CompatiblePackage(
|
class Option(
|
||||||
val name: String,
|
val key: String,
|
||||||
val versions: Array<String>,
|
val title: String,
|
||||||
)
|
val description: String,
|
||||||
|
val required: Boolean,
|
||||||
data class Option(
|
val choices: Array<*>?,
|
||||||
val key: String,
|
)
|
||||||
val title: String,
|
}
|
||||||
val description: String,
|
|
||||||
val required: Boolean,
|
|
||||||
val choices: Array<*>?,
|
|
||||||
)
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user