refactor: remove DependencyType.SOFT (#82)

BREAKING-CHANGE: DependencyType.SOFT has now been removed after it was deprecated. There is no direct replacement for this. Please look into Patch Options instead, which supersedes this.
This commit is contained in:
Sculas
2022-08-02 00:47:32 +02:00
committed by GitHub
parent 711b8a25a7
commit ec1d8a8fba
3 changed files with 2 additions and 14 deletions

View File

@@ -11,7 +11,6 @@ import app.revanced.patcher.patch.Patch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultError
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependencyType
import app.revanced.patcher.patch.impl.BytecodePatch
import app.revanced.patcher.patch.impl.ResourcePatch
import app.revanced.patcher.util.ListBackedSet
@@ -265,11 +264,6 @@ class Patcher(private val options: PatcherOptions) {
// recursively apply all dependency patches
patch.dependencies.forEach {
val dependency = it.patch.java
if ( // soft dependencies must be included manually.
it.type == DependencyType.SOFT && !data.patches.any { p ->
p.patchName == dependency.patchName
}
) return@forEach
val result = applyPatch(dependency, appliedPatches)
if (result.isSuccess()) return@forEach

View File

@@ -43,11 +43,5 @@ enum class DependencyType {
/**
* Enforces that the dependency is applied, even if it was not selected.
*/
HARD,
/**
* Applies the dependency only if it was selected.
*/
@Deprecated("Will be removed when Patch Options is implemented.")
SOFT
HARD
}

View File

@@ -38,7 +38,7 @@ import org.jf.dexlib2.util.Preconditions
@Description("Example demonstration of a bytecode patch.")
@ExampleResourceCompatibility
@Version("0.0.1")
@DependsOn(ExampleBytecodePatch::class, DependencyType.SOFT)
@DependsOn(ExampleBytecodePatch::class, DependencyType.HARD)
class ExampleBytecodePatch : BytecodePatch(listOf(ExampleFingerprint)) {
// This function will be executed by the patcher.
// You can treat it as a constructor