From 8cf70f89a110bc0b487841d3ead217f7c6f1da4b Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Fri, 6 Nov 2026 10:52:04 +0100 Subject: [PATCH] refactor: Use patch() and remove the type argument of Patch (#75) --- gradle/libs.versions.toml | 2 +- .../main/kotlin/app/template/patches/example/ExamplePatch.kt | 4 ++-- .../main/kotlin/app/template/patches/example/InternalPatch.kt | 4 ++-- patches/src/main/kotlin/util/PatchListGenerator.kt | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index b81d2b311..15336d6d2 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,5 +1,5 @@ [versions] -morphe-patcher = "2.2.0" +morphe-patcher = "2.3.0" #noinspection GradleDependency smali = "4220ae75f7" gson = "2.15.0" diff --git a/patches/src/main/kotlin/app/template/patches/example/ExamplePatch.kt b/patches/src/main/kotlin/app/template/patches/example/ExamplePatch.kt index e9eba9f5f..c49b8e9d0 100644 --- a/patches/src/main/kotlin/app/template/patches/example/ExamplePatch.kt +++ b/patches/src/main/kotlin/app/template/patches/example/ExamplePatch.kt @@ -1,13 +1,13 @@ package app.template.patches.example import app.morphe.patcher.extensions.InstructionExtensions.addInstructions -import app.morphe.patcher.patch.bytecodePatch +import app.morphe.patcher.patch.patch import app.template.patches.shared.Constants.COMPATIBILITY_EXAMPLE private const val EXTENSION_CLASS = "Lapp/template/extension/ExamplePatch;" @Suppress("unused") -val examplePatch = bytecodePatch( +val examplePatch = patch( name = "Example Patch", description = "Example patch to start with.", default = true diff --git a/patches/src/main/kotlin/app/template/patches/example/InternalPatch.kt b/patches/src/main/kotlin/app/template/patches/example/InternalPatch.kt index 10d216f14..37b2632a6 100644 --- a/patches/src/main/kotlin/app/template/patches/example/InternalPatch.kt +++ b/patches/src/main/kotlin/app/template/patches/example/InternalPatch.kt @@ -2,11 +2,11 @@ package app.template.patches.example import app.morphe.patcher.Fingerprint import app.morphe.patcher.extensions.InstructionExtensions.addInstruction -import app.morphe.patcher.patch.bytecodePatch +import app.morphe.patcher.patch.patch // Internal patch that is not shown in Morphe Manager or CLI patch list, // but this patch is required for other patches to function. -val internalPatch = bytecodePatch { +val internalPatch = patch { execute { Fingerprint( /** diff --git a/patches/src/main/kotlin/util/PatchListGenerator.kt b/patches/src/main/kotlin/util/PatchListGenerator.kt index de9aa58f2..0b920ff48 100644 --- a/patches/src/main/kotlin/util/PatchListGenerator.kt +++ b/patches/src/main/kotlin/util/PatchListGenerator.kt @@ -37,7 +37,7 @@ fun main() { } @Suppress("DEPRECATION") -private fun generatePatchList(version: String, patches: Set>) { +private fun generatePatchList(version: String, patches: Set) { val listJson = File("../patches-list.json") val patchesMap = patches.sortedBy { it.name }.map { patch ->