build(Needs bump): Bump dependencies
This commit is contained in:
@ -5,9 +5,7 @@ import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultError
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.PatchException
|
||||
import app.revanced.patches.shared.integrations.patch.AbstractIntegrationsPatch.IntegrationsFingerprint.RegisterResolver
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
||||
import com.android.tools.smali.dexlib2.iface.ClassDef
|
||||
@ -40,7 +38,7 @@ abstract class AbstractIntegrationsPatch(
|
||||
strings,
|
||||
customFingerprint
|
||||
) {
|
||||
fun invoke(integrationsDescriptor: String): PatchResult {
|
||||
fun invoke(integrationsDescriptor: String) {
|
||||
result?.mutableMethod?.let { method ->
|
||||
val contextRegister = contextRegisterResolver(method)
|
||||
|
||||
@ -49,9 +47,7 @@ abstract class AbstractIntegrationsPatch(
|
||||
"sput-object v$contextRegister, " +
|
||||
"$integrationsDescriptor->context:Landroid/content/Context;"
|
||||
)
|
||||
} ?: return PatchResultError("Could not find hook target fingerprint.")
|
||||
|
||||
return PatchResultSuccess()
|
||||
} ?: throw PatchException("Could not find hook target fingerprint.")
|
||||
}
|
||||
|
||||
interface RegisterResolver : (Method) -> Int {
|
||||
@ -59,20 +55,11 @@ abstract class AbstractIntegrationsPatch(
|
||||
}
|
||||
}
|
||||
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
if (context.findClass(integrationsDescriptor) == null) return MISSING_INTEGRATIONS
|
||||
|
||||
for (hook in hooks) hook.invoke(integrationsDescriptor).let {
|
||||
if (it is PatchResultError) return it
|
||||
}
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
|
||||
private companion object {
|
||||
val MISSING_INTEGRATIONS = PatchResultError(
|
||||
"Integrations have not been merged yet. " +
|
||||
"This patch can not succeed without merging the integrations."
|
||||
override fun execute(context: BytecodeContext) {
|
||||
if (context.findClass(integrationsDescriptor) == null) throw PatchException(
|
||||
"Integrations have not been merged yet. This patch can not succeed without merging the integrations."
|
||||
)
|
||||
|
||||
for (hook in hooks) hook.invoke(integrationsDescriptor)
|
||||
}
|
||||
}
|
@ -1,8 +1,6 @@
|
||||
package app.revanced.patches.shared.mapping.misc.patch
|
||||
|
||||
import app.revanced.patcher.data.ResourceContext
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.ResourcePatch
|
||||
import org.w3c.dom.Element
|
||||
import java.util.*
|
||||
@ -19,7 +17,7 @@ class ResourceMappingPatch : ResourcePatch {
|
||||
private val threadPoolExecutor = Executors.newFixedThreadPool(THREAD_COUNT)
|
||||
}
|
||||
|
||||
override fun execute(context: ResourceContext): PatchResult {
|
||||
override fun execute(context: ResourceContext) {
|
||||
// save the file in memory to concurrently read from
|
||||
val resourceXmlFile = context["res/values/public.xml"].readBytes()
|
||||
|
||||
@ -59,8 +57,6 @@ class ResourceMappingPatch : ResourcePatch {
|
||||
.awaitTermination(Long.MAX_VALUE, TimeUnit.SECONDS)
|
||||
|
||||
resourceMappings = mappings
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6,8 +6,6 @@ import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patches.shared.misc.fix.verticalscroll.annotations.VerticalScrollCompatibility
|
||||
import app.revanced.patches.shared.misc.fix.verticalscroll.fingerprints.CanScrollVerticallyFingerprint
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
@ -17,7 +15,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
class VerticalScrollPatch : BytecodePatch(
|
||||
listOf(CanScrollVerticallyFingerprint)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
override fun execute(context: BytecodeContext) {
|
||||
CanScrollVerticallyFingerprint.result?.let {
|
||||
it.mutableMethod.apply {
|
||||
val moveResultIndex = it.scanResult.patternScanResult!!.endIndex
|
||||
@ -29,8 +27,6 @@ class VerticalScrollPatch : BytecodePatch(
|
||||
"const/4 v$moveResultRegister, 0x0"
|
||||
)
|
||||
}
|
||||
} ?: return CanScrollVerticallyFingerprint.toErrorResult()
|
||||
|
||||
return PatchResultSuccess()
|
||||
} ?: throw CanScrollVerticallyFingerprint.toErrorResult()
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,8 @@
|
||||
package app.revanced.patches.shared.settings.resource.patch
|
||||
|
||||
import app.revanced.patcher.data.DomFileEditor
|
||||
import app.revanced.patcher.data.ResourceContext
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.ResourcePatch
|
||||
import app.revanced.patcher.util.DomFileEditor
|
||||
import app.revanced.patches.shared.settings.preference.BasePreference
|
||||
import app.revanced.patches.shared.settings.preference.BaseResource
|
||||
import app.revanced.patches.shared.settings.preference.addPreference
|
||||
@ -26,7 +24,7 @@ abstract class AbstractSettingsResourcePatch(
|
||||
private val preferenceFileName: String,
|
||||
private val sourceDirectory: String,
|
||||
) : ResourcePatch, Closeable {
|
||||
override fun execute(context: ResourceContext): PatchResult {
|
||||
override fun execute(context: ResourceContext) {
|
||||
/*
|
||||
* used for self-restart
|
||||
* TODO: do this only, when necessary
|
||||
@ -51,8 +49,6 @@ abstract class AbstractSettingsResourcePatch(
|
||||
stringsEditor = context.xmlEditor["res/values/strings.xml"]
|
||||
arraysEditor = context.xmlEditor["res/values/arrays.xml"]
|
||||
revancedPreferencesEditor = context.xmlEditor["res/xml/$preferenceFileName.xml"]
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
|
||||
internal companion object {
|
||||
|
Reference in New Issue
Block a user