mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-06-12 13:17:46 +02:00
add enable-swipe-gesture-brightness-in-hdr-patch
This commit is contained in:
@ -0,0 +1,8 @@
|
||||
package app.revanced.patches.youtube.swipe.swipebrightnessinhdr.bytecode.fingerprints
|
||||
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
|
||||
object HDRVideoFingerprint : MethodFingerprint(
|
||||
returnType = "V",
|
||||
strings = listOf("mediaViewambientBrightnessSensor")
|
||||
)
|
@ -0,0 +1,40 @@
|
||||
package app.revanced.patches.youtube.swipe.swipebrightnessinhdr.bytecode.patch
|
||||
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.annotation.Version
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.addInstructions
|
||||
import app.revanced.patcher.extensions.instruction
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.util.smali.ExternalLabel
|
||||
import app.revanced.patches.youtube.swipe.swipebrightnessinhdr.bytecode.fingerprints.HDRVideoFingerprint
|
||||
import app.revanced.shared.annotation.YouTubeCompatibility
|
||||
import app.revanced.shared.extensions.toErrorResult
|
||||
import app.revanced.shared.util.integrations.Constants.SWIPE_PATH
|
||||
|
||||
@Name("enable-swipe-gesture-brightness-in-hdr-patch")
|
||||
@YouTubeCompatibility
|
||||
@Version("0.0.1")
|
||||
class SwipeGestureBrightnessInHDRPatch : BytecodePatch(
|
||||
listOf(
|
||||
HDRVideoFingerprint
|
||||
)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
|
||||
HDRVideoFingerprint.result?.mutableMethod?.let {
|
||||
it.addInstructions(
|
||||
0, """
|
||||
invoke-static {}, $SWIPE_PATH/EnableSwipeGestureBrightnessInHDRPatch;->enableSwipeGestureBrightnessInHDR()Z
|
||||
move-result v0
|
||||
if-eqz v0, :default
|
||||
return-void
|
||||
""", listOf(ExternalLabel("default", it.instruction(0)))
|
||||
)
|
||||
} ?: return HDRVideoFingerprint.toErrorResult()
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
@ -5,7 +5,8 @@ internal object Constants {
|
||||
const val PATCHES_PATH = "$INTEGRATIONS_PATH/patches"
|
||||
|
||||
const val ADS_PATH = "$PATCHES_PATH/ads"
|
||||
const val BUTTON_PATH = "$PATCHES_PATH/button"
|
||||
|
||||
const val SWIPE_PATH = "$PATCHES_PATH/swipe"
|
||||
|
||||
const val GENERAL_LAYOUT = "$PATCHES_PATH/layout/GeneralLayoutPatch;"
|
||||
const val PLAYER_LAYOUT = "$PATCHES_PATH/layout/PlayerLayoutPatch;"
|
||||
@ -13,9 +14,12 @@ internal object Constants {
|
||||
const val FLYOUTPANEL_LAYOUT = "$PATCHES_PATH/layout/FlyoutPanelLayoutPatch;"
|
||||
const val SEEKBAR_LAYOUT = "$PATCHES_PATH/layout/SeekbarLayoutPatch;"
|
||||
|
||||
const val EXTENDED_PATH = "$PATCHES_PATH/extended"
|
||||
const val MISC_PATH = "$PATCHES_PATH/misc"
|
||||
|
||||
const val BUTTON_PATH = "$PATCHES_PATH/button"
|
||||
const val VIDEO_PATH = "$PATCHES_PATH/video"
|
||||
const val EXTENDED_PATH = "$PATCHES_PATH/extended"
|
||||
|
||||
const val UTILS_PATH = "$PATCHES_PATH/utils"
|
||||
|
||||
const val MUSIC_SETTINGS_PATH = "$INTEGRATIONS_PATH/settings/MusicSettings;"
|
||||
|
Reference in New Issue
Block a user