mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-05-08 10:34:33 +02:00
fix(custom-seekbar-color): App crashes when playing YouTube videos from PlayStore
This commit is contained in:
parent
2975005213
commit
daf8c98e16
@ -0,0 +1,8 @@
|
|||||||
|
package app.revanced.patches.youtube.layout.seekbar.seekbarcolor.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
|
||||||
|
object ControlsOverlayFingerprint : MethodFingerprint(
|
||||||
|
returnType = "V",
|
||||||
|
customFingerprint = {it.name == "<init>"}
|
||||||
|
)
|
@ -0,0 +1,11 @@
|
|||||||
|
package app.revanced.patches.youtube.layout.seekbar.seekbarcolor.fingerprints
|
||||||
|
|
||||||
|
import app.revanced.patcher.extensions.or
|
||||||
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||||
|
import org.jf.dexlib2.AccessFlags
|
||||||
|
|
||||||
|
object ControlsOverlayParentFingerprint : MethodFingerprint(
|
||||||
|
returnType = "V",
|
||||||
|
access = AccessFlags.PRIVATE or AccessFlags.STATIC or AccessFlags.FINAL,
|
||||||
|
strings = listOf("Error screen presenter should be present")
|
||||||
|
)
|
@ -5,6 +5,7 @@ import app.revanced.patcher.annotation.Description
|
|||||||
import app.revanced.patcher.annotation.Name
|
import app.revanced.patcher.annotation.Name
|
||||||
import app.revanced.patcher.annotation.Version
|
import app.revanced.patcher.annotation.Version
|
||||||
import app.revanced.patcher.data.BytecodeContext
|
import app.revanced.patcher.data.BytecodeContext
|
||||||
|
import app.revanced.patcher.extensions.addInstruction
|
||||||
import app.revanced.patcher.extensions.addInstructions
|
import app.revanced.patcher.extensions.addInstructions
|
||||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
|
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
|
||||||
import app.revanced.patcher.patch.BytecodePatch
|
import app.revanced.patcher.patch.BytecodePatch
|
||||||
@ -14,10 +15,10 @@ import app.revanced.patcher.patch.annotations.DependsOn
|
|||||||
import app.revanced.patcher.patch.annotations.Patch
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
import app.revanced.patches.shared.annotation.YouTubeCompatibility
|
import app.revanced.patches.shared.annotation.YouTubeCompatibility
|
||||||
import app.revanced.patches.shared.fingerprints.ControlsOverlayStyleFingerprint
|
import app.revanced.patches.shared.fingerprints.ControlsOverlayStyleFingerprint
|
||||||
import app.revanced.patches.youtube.layout.seekbar.seekbarcolor.fingerprints.ProgressColorFingerprint
|
import app.revanced.patches.youtube.layout.seekbar.seekbarcolor.fingerprints.*
|
||||||
import app.revanced.patches.youtube.layout.seekbar.seekbarcolor.fingerprints.SeekbarColorFingerprint
|
|
||||||
import app.revanced.patches.youtube.misc.resourceid.patch.SharedResourceIdPatch
|
import app.revanced.patches.youtube.misc.resourceid.patch.SharedResourceIdPatch
|
||||||
import app.revanced.patches.youtube.misc.settings.resource.patch.SettingsPatch
|
import app.revanced.patches.youtube.misc.settings.resource.patch.SettingsPatch
|
||||||
|
import app.revanced.util.integrations.Constants.INTEGRATIONS_PATH
|
||||||
import app.revanced.util.integrations.Constants.SEEKBAR
|
import app.revanced.util.integrations.Constants.SEEKBAR
|
||||||
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
||||||
import org.jf.dexlib2.iface.instruction.WideLiteralInstruction
|
import org.jf.dexlib2.iface.instruction.WideLiteralInstruction
|
||||||
@ -35,6 +36,7 @@ import org.jf.dexlib2.iface.instruction.WideLiteralInstruction
|
|||||||
@Version("0.0.1")
|
@Version("0.0.1")
|
||||||
class SeekbarColorPatch : BytecodePatch(
|
class SeekbarColorPatch : BytecodePatch(
|
||||||
listOf(
|
listOf(
|
||||||
|
ControlsOverlayParentFingerprint,
|
||||||
ControlsOverlayStyleFingerprint,
|
ControlsOverlayStyleFingerprint,
|
||||||
SeekbarColorFingerprint
|
SeekbarColorFingerprint
|
||||||
)
|
)
|
||||||
@ -66,6 +68,13 @@ class SeekbarColorPatch : BytecodePatch(
|
|||||||
) ?: return ProgressColorFingerprint.toErrorResult()
|
) ?: return ProgressColorFingerprint.toErrorResult()
|
||||||
} ?: return ControlsOverlayStyleFingerprint.toErrorResult()
|
} ?: return ControlsOverlayStyleFingerprint.toErrorResult()
|
||||||
|
|
||||||
|
ControlsOverlayParentFingerprint.result?.let { parentResult ->
|
||||||
|
ControlsOverlayFingerprint.also { it.resolve(context, parentResult.classDef) }.result?.mutableMethod?.addInstruction(
|
||||||
|
0,
|
||||||
|
"sput-object p1, $INTEGRATIONS_PATH/utils/ReVancedUtils;->context:Landroid/content/Context;"
|
||||||
|
) ?: return ControlsOverlayFingerprint.toErrorResult()
|
||||||
|
} ?: return ControlsOverlayParentFingerprint.toErrorResult()
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Add settings
|
* Add settings
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user