build(Needs bump): Bump dependencies

This commit is contained in:
oSumAtrIX
2023-08-23 05:01:09 +02:00
parent 3072412c79
commit 1817dbd10c
214 changed files with 473 additions and 1271 deletions
@@ -5,8 +5,6 @@ import app.revanced.patcher.annotation.Name
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.shared.settings.preference.impl.StringResource
@@ -27,7 +25,7 @@ import com.android.tools.smali.dexlib2.iface.reference.FieldReference
class HDRBrightnessPatch : BytecodePatch(
listOf(HDRBrightnessFingerprint)
) {
override fun execute(context: BytecodeContext): PatchResult {
override fun execute(context: BytecodeContext) {
SettingsPatch.PreferenceScreen.VIDEO.addPreferences(
SwitchPreference(
"revanced_hdr_auto_brightness",
@@ -55,7 +53,5 @@ class HDRBrightnessPatch : BytecodePatch(
"""
)
}
return PatchResultSuccess()
}
}
@@ -4,15 +4,12 @@ import app.revanced.extensions.toErrorResult
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.data.toMethodWalker
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod.Companion.toMutable
@@ -44,7 +41,7 @@ class VideoInformationPatch : BytecodePatch(
OnPlaybackSpeedItemClickFingerprint,
)
) {
override fun execute(context: BytecodeContext): PatchResult {
override fun execute(context: BytecodeContext) {
with(PlayerInitFingerprint.result!!) {
playerInitMethod = mutableClass.methods.first { MethodUtil.isConstructor(it) }
@@ -136,11 +133,9 @@ class VideoInformationPatch : BytecodePatch(
getReference(speedSelectionMethodInstructions, 1, Opcode.IGET)
setPlaybackSpeedMethodReference =
getReference(speedSelectionMethodInstructions, 2, Opcode.IGET)
} ?: return OnPlaybackSpeedItemClickFingerprint.toErrorResult()
} ?: throw OnPlaybackSpeedItemClickFingerprint.toErrorResult()
userSelectedPlaybackSpeedHook(INTEGRATIONS_CLASS_DESCRIPTOR, "userSelectedPlaybackSpeed")
return PatchResultSuccess()
}
companion object {
@@ -9,9 +9,7 @@ import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultError
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.PatchException
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.shared.settings.preference.impl.ArrayResource
@@ -42,7 +40,7 @@ class RememberVideoQualityPatch : BytecodePatch(
NewVideoQualityChangedFingerprint
)
) {
override fun execute(context: BytecodeContext): PatchResult {
override fun execute(context: BytecodeContext) {
// This is bloated as each value has it's own String key/value
// ideally the entries would be raw values (and not a key to a String resource)
val entries = listOf(
@@ -119,7 +117,7 @@ class RememberVideoQualityPatch : BytecodePatch(
// Inject a call to set the remembered quality once a video loads.
VideoQualitySetterFingerprint.result?.also {
if (!SetQualityByIndexMethodClassFieldReferenceFingerprint.resolve(context, it.classDef))
return PatchResultError("Could not resolve fingerprint to find setQualityByIndex method")
throw PatchException("Could not resolve fingerprint to find setQualityByIndex method")
}?.let {
// This instruction refers to the field with the type that contains the setQualityByIndex method.
val instructions = SetQualityByIndexMethodClassFieldReferenceFingerprint.result!!
@@ -139,7 +137,7 @@ class RememberVideoQualityPatch : BytecodePatch(
// Get the name of the setQualityByIndex method.
val setQualityByIndexMethod = setQualityByIndexMethodClass.methods
.find { method -> method.parameterTypes.first() == "I" }
?: return PatchResultError("Could not find setQualityByIndex method")
?: throw PatchException("Could not find setQualityByIndex method")
it.mutableMethod.addInstructions(
0,
@@ -160,7 +158,7 @@ class RememberVideoQualityPatch : BytecodePatch(
move-result p2
""",
)
} ?: return VideoQualitySetterFingerprint.toErrorResult()
} ?: throw VideoQualitySetterFingerprint.toErrorResult()
// Inject a call to remember the selected quality.
@@ -174,8 +172,8 @@ class RememberVideoQualityPatch : BytecodePatch(
0,
"invoke-static {p$listItemIndexParameter}, $INTEGRATIONS_CLASS_DESCRIPTOR->userChangedQuality(I)V"
)
} ?: return PatchResultError("Failed to find onItemClick method")
} ?: return VideoQualityItemOnClickParentFingerprint.toErrorResult()
} ?: throw PatchException("Failed to find onItemClick method")
} ?: throw VideoQualityItemOnClickParentFingerprint.toErrorResult()
// Remember video quality if not using old layout menu.
@@ -189,10 +187,8 @@ class RememberVideoQualityPatch : BytecodePatch(
"invoke-static {v$qualityRegister}, $INTEGRATIONS_CLASS_DESCRIPTOR->userChangedQualityInNewFlyout(I)V"
)
}
} ?: return NewVideoQualityChangedFingerprint.toErrorResult()
} ?: throw NewVideoQualityChangedFingerprint.toErrorResult()
return PatchResultSuccess()
}
private companion object {
@@ -4,8 +4,6 @@ import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.youtube.video.speed.custom.patch.CustomPlaybackSpeedPatch
@@ -17,7 +15,6 @@ import app.revanced.patches.youtube.video.speed.remember.patch.RememberPlaybackS
@DependsOn([CustomPlaybackSpeedPatch::class, RememberPlaybackSpeedPatch::class])
@PlaybackSpeedCompatibility
class PlaybackSpeed : BytecodePatch() {
override fun execute(context: BytecodeContext): PatchResult {
return PatchResultSuccess() // All patches this patch depends on succeed.
override fun execute(context: BytecodeContext) { // All patches this patch depends on succeed.
}
}
@@ -11,9 +11,7 @@ import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint.Companion.resolve
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultError
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.PatchException
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.util.proxy.mutableTypes.MutableField.Companion.toMutable
import app.revanced.patches.shared.settings.preference.impl.InputType
@@ -44,7 +42,7 @@ class CustomPlaybackSpeedPatch : BytecodePatch(
)
) {
override fun execute(context: BytecodeContext): PatchResult {
override fun execute(context: BytecodeContext) {
SettingsPatch.PreferenceScreen.VIDEO.addPreferences(
TextPreference(
key = "revanced_custom_playback_speeds",
@@ -66,7 +64,7 @@ class CustomPlaybackSpeedPatch : BytecodePatch(
val sizeCallIndex = arrayGenMethodImpl.instructions
.indexOfFirst { ((it as? ReferenceInstruction)?.reference as? MethodReference)?.name == "size" }
if (sizeCallIndex == -1) return PatchResultError("Couldn't find call to size()")
if (sizeCallIndex == -1) throw PatchException("Couldn't find call to size()")
val sizeCallResultRegister =
(arrayGenMethodImpl.instructions.elementAt(sizeCallIndex + 1) as OneRegisterInstruction).registerA
@@ -173,12 +171,10 @@ class CustomPlaybackSpeedPatch : BytecodePatch(
invoke-virtual { v0 }, $showOldPlaybackSpeedMenuMethod
"""
)
} ?: return ShowOldPlaybackSpeedMenuIntegrationsFingerprint.toErrorResult()
} ?: return GetOldPlaybackSpeedsFingerprint.toErrorResult()
} ?: throw ShowOldPlaybackSpeedMenuIntegrationsFingerprint.toErrorResult()
} ?: throw GetOldPlaybackSpeedsFingerprint.toErrorResult()
// endregion
return PatchResultSuccess()
}
private companion object {
@@ -7,8 +7,6 @@ import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.util.smali.ExternalLabel
import app.revanced.patches.shared.settings.preference.impl.ArrayResource
@@ -30,7 +28,7 @@ class RememberPlaybackSpeedPatch : BytecodePatch(
InitializePlaybackSpeedValuesFingerprint
)
) {
override fun execute(context: BytecodeContext): PatchResult {
override fun execute(context: BytecodeContext) {
SettingsPatch.PreferenceScreen.VIDEO.addPreferences(
SwitchPreference(
"revanced_remember_playback_speed_last_selected",
@@ -105,9 +103,7 @@ class RememberPlaybackSpeedPatch : BytecodePatch(
""".trimIndent(),
ExternalLabel("do_not_override", mutableMethod.getInstruction(0))
)
} ?: return InitializePlaybackSpeedValuesFingerprint.toErrorResult()
return PatchResultSuccess()
} ?: throw InitializePlaybackSpeedValuesFingerprint.toErrorResult()
}
private companion object {
@@ -8,8 +8,6 @@ import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
@@ -25,7 +23,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
class VideoIdPatch : BytecodePatch(
listOf(VideoIdFingerprint, VideoIdFingerprintBackgroundPlay)
) {
override fun execute(context: BytecodeContext): PatchResult {
override fun execute(context: BytecodeContext) {
/**
* Supplies the method and register index of the video id register.
*
@@ -53,8 +51,6 @@ class VideoIdPatch : BytecodePatch(
backgroundPlaybackInsertIndex = insertIndex
backgroundPlaybackVideoIdRegister = videoIdRegister
}
return PatchResultSuccess()
}
companion object {
@@ -6,8 +6,6 @@ import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.youtube.misc.bottomsheet.hook.patch.BottomSheetHookPatch
@@ -30,7 +28,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
class OldVideoQualityMenuPatch : BytecodePatch(
listOf(VideoQualityMenuViewInflateFingerprint)
) {
override fun execute(context: BytecodeContext): PatchResult {
override fun execute(context: BytecodeContext) {
// region Patch for the old type of the video quality menu.
VideoQualityMenuViewInflateFingerprint.result?.let {
@@ -57,8 +55,6 @@ class OldVideoQualityMenuPatch : BytecodePatch(
LithoFilterPatch.addFilter(FILTER_CLASS_DESCRIPTOR)
// endregion
return PatchResultSuccess()
}
private companion object {
@@ -1,9 +1,7 @@
package app.revanced.patches.youtube.video.videoqualitymenu.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.PatchException
import app.revanced.patcher.patch.ResourcePatch
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patches.shared.mapping.misc.patch.ResourceMappingPatch
@@ -13,7 +11,7 @@ import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
@DependsOn([SettingsPatch::class, ResourceMappingPatch::class])
class OldVideoQualityMenuResourcePatch : ResourcePatch {
override fun execute(context: ResourceContext): PatchResult {
override fun execute(context: ResourceContext) {
SettingsPatch.PreferenceScreen.VIDEO.addPreferences(
SwitchPreference(
"revanced_show_old_video_quality_menu",
@@ -24,12 +22,10 @@ class OldVideoQualityMenuResourcePatch : ResourcePatch {
)
fun findResource(name: String) = ResourceMappingPatch.resourceMappings.find { it.name == name }?.id
?: throw PatchResultError("Could not find resource")
?: throw PatchException("Could not find resource")
// Used for the old type of the video quality menu.
videoQualityBottomSheetListFragmentTitle = findResource("video_quality_bottom_sheet_list_fragment_title")
return PatchResultSuccess()
}
internal companion object {