mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-05-08 10:34:33 +02:00
fix(sponsorblock): wrong video-id-hook
patch used https://github.com/inotia00/ReVanced_Extended/issues/777
This commit is contained in:
parent
9e96f5d398
commit
b1a4b1c91e
@ -9,14 +9,14 @@ import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patches.shared.annotation.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.misc.playercontrols.patch.PlayerControlsPatch
|
||||
import app.revanced.patches.youtube.misc.videoid.mainstream.patch.MainstreamVideoIdPatch
|
||||
import app.revanced.patches.youtube.misc.videoid.legacy.patch.LegacyVideoIdPatch
|
||||
import app.revanced.util.integrations.Constants.BUTTON_PATH
|
||||
|
||||
@Name("overlay-buttons-bytecode-patch")
|
||||
@DependsOn(
|
||||
dependencies = [
|
||||
PlayerControlsPatch::class,
|
||||
MainstreamVideoIdPatch::class
|
||||
LegacyVideoIdPatch::class
|
||||
]
|
||||
)
|
||||
@YouTubeCompatibility
|
||||
|
@ -17,6 +17,7 @@ import app.revanced.patches.youtube.misc.playercontrols.patch.PlayerControlsPatc
|
||||
import app.revanced.patches.youtube.misc.resourceid.patch.SharedResourceIdPatch
|
||||
import app.revanced.patches.youtube.misc.sponsorblock.bytecode.fingerprints.*
|
||||
import app.revanced.patches.youtube.misc.timebar.patch.HookTimebarPatch
|
||||
import app.revanced.patches.youtube.misc.videoid.legacy.patch.LegacyVideoIdPatch
|
||||
import app.revanced.patches.youtube.misc.videoid.mainstream.patch.MainstreamVideoIdPatch
|
||||
import app.revanced.util.bytecode.BytecodeHelper.injectInit
|
||||
import app.revanced.util.bytecode.BytecodeHelper.updatePatchStatus
|
||||
@ -31,6 +32,7 @@ import org.jf.dexlib2.iface.reference.MethodReference
|
||||
@Name("sponsorblock-bytecode-patch")
|
||||
@DependsOn(
|
||||
[
|
||||
LegacyVideoIdPatch::class,
|
||||
MainstreamVideoIdPatch::class,
|
||||
OverrideSpeedHookPatch::class,
|
||||
PlayerControlsPatch::class,
|
||||
@ -54,12 +56,16 @@ class SponsorBlockBytecodePatch : BytecodePatch(
|
||||
INTEGRATIONS_PLAYER_CONTROLLER_CLASS_DESCRIPTOR,
|
||||
"setVideoTime"
|
||||
)
|
||||
onCreateHook(
|
||||
INTEGRATIONS_PLAYER_CONTROLLER_CLASS_DESCRIPTOR,
|
||||
"initialize"
|
||||
)
|
||||
}
|
||||
|
||||
/*
|
||||
* Inject VideoIdPatch
|
||||
*/
|
||||
MainstreamVideoIdPatch.injectCall("$INTEGRATIONS_PLAYER_CONTROLLER_CLASS_DESCRIPTOR->setCurrentVideoId(Ljava/lang/String;)V")
|
||||
LegacyVideoIdPatch.injectCall("$INTEGRATIONS_PLAYER_CONTROLLER_CLASS_DESCRIPTOR->setCurrentVideoId(Ljava/lang/String;)V")
|
||||
|
||||
|
||||
/*
|
||||
|
@ -12,6 +12,7 @@ import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||
import app.revanced.patches.shared.annotation.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.misc.videoid.legacy.fingerprint.LegacyVideoIdFingerprint
|
||||
import app.revanced.util.integrations.Constants.VIDEO_PATH
|
||||
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
|
||||
@Name("video-id-hook-legacy")
|
||||
@ -35,10 +36,13 @@ class LegacyVideoIdPatch : BytecodePatch(
|
||||
offset++ // offset so setCurrentVideoId is called before any injected call
|
||||
} ?: return LegacyVideoIdFingerprint.toErrorResult()
|
||||
|
||||
injectCall("$INTEGRATIONS_CLASS_DESCRIPTOR->setVideoId(Ljava/lang/String;)V")
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val INTEGRATIONS_CLASS_DESCRIPTOR = "$VIDEO_PATH/VideoInformation;"
|
||||
private var offset = 2
|
||||
|
||||
private var insertIndex: Int = 0
|
||||
|
@ -164,9 +164,6 @@ class MainstreamVideoIdPatch : BytecodePatch(
|
||||
offset++ // offset so setVideoId is called before any injected call
|
||||
} ?: return MainstreamVideoIdFingerprint.toErrorResult()
|
||||
|
||||
|
||||
injectCall("$INTEGRATIONS_CLASS_DESCRIPTOR->setVideoId(Ljava/lang/String;)V")
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user