feat: Use an extension property to create new exception when failing to resolve a fingerprint

This commit adds the extension property to the public API
This commit is contained in:
oSumAtrIX
2023-08-25 00:05:30 +02:00
parent 31b5d506a5
commit a471605db7
91 changed files with 259 additions and 247 deletions
@@ -1,6 +1,6 @@
package app.revanced.patches.duolingo.unlocksuper.patch
import app.revanced.extensions.toErrorResult
import app.revanced.extensions.exception
import app.revanced.patcher.annotation.Compatibility
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
@@ -38,7 +38,7 @@ class UnlockDuolingoSuperPatch : BytecodePatch(
?.filterIsInstance<BuilderInstruction22c>()
?.firstOrNull { it.opcode == Opcode.IGET_BOOLEAN }
?.reference
?: throw IsUserSuperMethodFingerprint.toErrorResult()
?: throw IsUserSuperMethodFingerprint.exception
// Patch the instruction that assigns isUserSuper to true.
UserSerializationMethodFingerprint
@@ -50,7 +50,7 @@ class UnlockDuolingoSuperPatch : BytecodePatch(
"const/4 v2, 0x1"
)
}
?: throw UserSerializationMethodFingerprint.toErrorResult()
?: throw UserSerializationMethodFingerprint.exception
}
private companion object {