mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-06-12 05:07:41 +02:00
slightly better patch method
This commit is contained in:
@ -6,10 +6,10 @@ import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.addInstructions
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.shared.annotation.YouTubeCompatibility
|
||||
import app.revanced.shared.extensions.findMutableMethodOf
|
||||
import app.revanced.shared.extensions.toResult
|
||||
import app.revanced.shared.patches.mapping.ResourceMappingPatch
|
||||
import app.revanced.shared.util.integrations.Constants.SEEKBAR_LAYOUT
|
||||
import org.jf.dexlib2.Opcode
|
||||
@ -27,6 +27,7 @@ class OldSeekbarColorBytecodePatch : BytecodePatch() {
|
||||
).map { name ->
|
||||
ResourceMappingPatch.resourceMappings.single { it.name == name }.id
|
||||
}
|
||||
private var patchSuccessArray = Array(resourceIds.size) {false}
|
||||
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
context.classes.forEach { classDef ->
|
||||
@ -49,6 +50,8 @@ class OldSeekbarColorBytecodePatch : BytecodePatch() {
|
||||
move-result v$viewRegister
|
||||
"""
|
||||
)
|
||||
|
||||
patchSuccessArray[0] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -58,6 +61,6 @@ class OldSeekbarColorBytecodePatch : BytecodePatch() {
|
||||
}
|
||||
}
|
||||
}
|
||||
return PatchResultSuccess()
|
||||
return toResult(patchSuccessArray.indexOf(false))
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user