generated from ReVanced/revanced-patches-template
-
-
Notifications
You must be signed in to change notification settings - Fork 226
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(youtube/custom-video-speed): don not implicitly depend on `old-vi…
…deo-quality-menu` patch
- Loading branch information
Showing
4 changed files
with
26 additions
and
7 deletions.
There are no files selected for viewing
4 changes: 2 additions & 2 deletions
4
...vanced/patches/youtube/misc/bottomsheet/hook/fingerprints/CreateBottomSheetFingerprint.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
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 | ||
|
||
object CreateBottomSheetFingerprint : LiteralValueFingerprint( | ||
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, | ||
parameters = listOf("L"), | ||
returnType = "Landroid/widget/LinearLayout;", | ||
literal = OldVideoQualityMenuResourcePatch.bottomSheetMargins | ||
literal = BottomSheetHookResourcePatch.bottomSheetMargins | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
.../app/revanced/patches/youtube/misc/bottomsheet/hook/patch/BottomSheetHookResourcePatch.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters