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:02:16 +02:00
parent d975eeafb7
commit 47eac14f03
No known key found for this signature in database
GPG key ID: A9B3094ACDB604B4
91 changed files with 259 additions and 247 deletions

View file

@ -1,6 +1,6 @@
package app.revanced.util.microg
import app.revanced.extensions.toErrorResult
import app.revanced.extensions.exception
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
@ -237,7 +237,7 @@ internal object MicroGBytecodeHelper {
result.mutableMethod.addInstructions(
0, stringInstructions
)
} ?: throw fingerprint.toErrorResult()
} ?: throw fingerprint.exception
}
}
}

View file

@ -12,6 +12,7 @@ internal object ResourceUtils {
/**
* Merge strings. This manages [StringResource]s automatically.
*
* @param host The hosting xml resource. Needs to be a valid strings.xml resource.
*/
internal fun ResourceContext.mergeStrings(host: String) {