mirror of
https://github.com/revanced/revanced-patches
synced 2024-08-28 18:15:17 +02:00
fix(youtube/custom-video-speed): don not implicitly depend on old-video-quality-menu
patch
This commit is contained in:
parent
3e78b8380e
commit
acfda46bce
@ -1,7 +1,7 @@
|
||||
package app.revanced.patches.youtube.misc.bottomsheet.hook.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patches.youtube.video.videoqualitymenu.patch.OldVideoQualityMenuResourcePatch
|
||||
import app.revanced.patches.youtube.misc.bottomsheet.hook.patch.BottomSheetHookResourcePatch
|
||||
import app.revanced.util.patch.LiteralValueFingerprint
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
|
||||
@ -9,5 +9,5 @@ object CreateBottomSheetFingerprint : LiteralValueFingerprint(
|
||||
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||
parameters = listOf("L"),
|
||||
returnType = "Landroid/widget/LinearLayout;",
|
||||
literal = OldVideoQualityMenuResourcePatch.bottomSheetMargins
|
||||
literal = BottomSheetHookResourcePatch.bottomSheetMargins
|
||||
)
|
@ -12,7 +12,7 @@ import app.revanced.patches.youtube.misc.bottomsheet.hook.fingerprints.CreateBot
|
||||
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
||||
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
|
||||
@DependsOn([IntegrationsPatch::class])
|
||||
@DependsOn([IntegrationsPatch::class, BottomSheetHookResourcePatch::class])
|
||||
class BottomSheetHookPatch : BytecodePatch(
|
||||
listOf(CreateBottomSheetFingerprint)
|
||||
) {
|
||||
|
@ -0,0 +1,23 @@
|
||||
package app.revanced.patches.youtube.misc.bottomsheet.hook.patch
|
||||
|
||||
import app.revanced.patcher.data.ResourceContext
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultError
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.ResourcePatch
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patches.shared.mapping.misc.patch.ResourceMappingPatch
|
||||
|
||||
@DependsOn([ResourceMappingPatch::class])
|
||||
class BottomSheetHookResourcePatch : ResourcePatch {
|
||||
override fun execute(context: ResourceContext): PatchResult {
|
||||
bottomSheetMargins = ResourceMappingPatch.resourceMappings.find { it.name == "bottomSheetMargins" }?.id
|
||||
?: return PatchResultError("Could not find resource")
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
|
||||
internal companion object {
|
||||
var bottomSheetMargins = -1L
|
||||
}
|
||||
}
|
@ -29,14 +29,10 @@ class OldVideoQualityMenuResourcePatch : ResourcePatch {
|
||||
// Used for the old type of the video quality menu.
|
||||
videoQualityBottomSheetListFragmentTitle = findResource("video_quality_bottom_sheet_list_fragment_title")
|
||||
|
||||
// Used for the new type of the video quality menu.
|
||||
bottomSheetMargins = findResource("bottom_sheet_margins")
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
|
||||
internal companion object {
|
||||
var videoQualityBottomSheetListFragmentTitle = -1L
|
||||
var bottomSheetMargins = -1L
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user