build(Needs bump): Bump dependencies
This commit is contained in:
@ -1,9 +1,10 @@
|
||||
package app.revanced.extensions
|
||||
|
||||
import app.revanced.patcher.extensions.MethodFingerprintExtensions.name
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||
import app.revanced.patcher.extensions.MethodFingerprintExtensions.name
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import app.revanced.patcher.patch.PatchResultError
|
||||
import app.revanced.patcher.patch.PatchException
|
||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableClass
|
||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||
import app.revanced.patches.shared.mapping.misc.patch.ResourceMappingPatch
|
||||
@ -13,13 +14,12 @@ import com.android.tools.smali.dexlib2.iface.instruction.WideLiteralInstruction
|
||||
import com.android.tools.smali.dexlib2.util.MethodUtil
|
||||
import org.w3c.dom.Node
|
||||
|
||||
// TODO: populate this to all patches
|
||||
/**
|
||||
* Convert a [MethodFingerprint] to a [PatchResultError].
|
||||
* Return [PatchException] from a [MethodFingerprint].
|
||||
*
|
||||
* @return A [PatchResultError] for the [MethodFingerprint].
|
||||
* @return The [PatchException] for the [MethodFingerprint].
|
||||
*/
|
||||
internal fun MethodFingerprint.toErrorResult() = PatchResultError("Failed to resolve $name")
|
||||
internal fun MethodFingerprint.toErrorResult() = PatchException("Failed to resolve $name")
|
||||
|
||||
/**
|
||||
* Find the [MutableMethod] from a given [Method] in a [MutableClass].
|
||||
@ -82,3 +82,16 @@ fun Method.indexOfFirstConstantInstructionValue(constantValue: Long): Int {
|
||||
fun Method.containsConstantInstructionValue(constantValue: Long): Boolean {
|
||||
return indexOfFirstConstantInstructionValue(constantValue) >= 0
|
||||
}
|
||||
|
||||
/**
|
||||
* traverse the class hierarchy starting from the given root class
|
||||
*
|
||||
* @param targetClass the class to start traversing the class hierarchy from
|
||||
* @param callback function that is called for every class in the hierarchy
|
||||
*/
|
||||
fun BytecodeContext.traverseClassHierarchy(targetClass: MutableClass, callback: MutableClass.() -> Unit) {
|
||||
callback(targetClass)
|
||||
this.findClass(targetClass.superclass ?: return)?.mutableClass?.let {
|
||||
traverseClassHierarchy(it, callback)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user