mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-05-27 20:30:19 +02:00
fix(YouTube/Old quality layout · Old speed layout): old quality layout / custom playback speed not working in certain situations
This commit is contained in:
parent
719113881c
commit
64758d5178
@ -7,6 +7,7 @@ import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.youtube.flyoutpanel.recyclerview.BottomSheetRecyclerViewPatch
|
||||
import app.revanced.patches.youtube.utils.fingerprints.QualityMenuViewInflateFingerprint
|
||||
import app.revanced.patches.youtube.utils.fingerprints.RecyclerViewTreeObserverFingerprint
|
||||
import app.revanced.patches.youtube.utils.litho.LithoFilterPatch
|
||||
@ -20,6 +21,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
name = "Enable old quality layout",
|
||||
description = "Enables the original quality flyout menu.",
|
||||
dependencies = [
|
||||
BottomSheetRecyclerViewPatch::class,
|
||||
LithoFilterPatch::class,
|
||||
SettingsPatch::class,
|
||||
SharedResourceIdPatch::class
|
||||
|
@ -12,6 +12,7 @@ import app.revanced.patcher.util.proxy.mutableTypes.MutableField.Companion.toMut
|
||||
import app.revanced.patches.youtube.flyoutpanel.oldspeedlayout.fingerprints.CustomPlaybackSpeedIntegrationsFingerprint
|
||||
import app.revanced.patches.youtube.flyoutpanel.oldspeedlayout.fingerprints.PlaybackRateBottomSheetBuilderFingerprint
|
||||
import app.revanced.patches.youtube.flyoutpanel.oldspeedlayout.fingerprints.PlaybackRateBottomSheetClassFingerprint
|
||||
import app.revanced.patches.youtube.flyoutpanel.recyclerview.BottomSheetRecyclerViewPatch
|
||||
import app.revanced.patches.youtube.utils.fingerprints.RecyclerViewTreeObserverFingerprint
|
||||
import app.revanced.patches.youtube.utils.litho.LithoFilterPatch
|
||||
import app.revanced.util.integrations.Constants.PATCHES_PATH
|
||||
@ -19,7 +20,13 @@ import app.revanced.util.integrations.Constants.VIDEO_PATH
|
||||
import com.android.tools.smali.dexlib2.AccessFlags
|
||||
import com.android.tools.smali.dexlib2.immutable.ImmutableField
|
||||
|
||||
@Patch(dependencies = [LithoFilterPatch::class])
|
||||
@Patch(
|
||||
dependencies =
|
||||
[
|
||||
BottomSheetRecyclerViewPatch::class,
|
||||
LithoFilterPatch::class
|
||||
]
|
||||
)
|
||||
object OldSpeedLayoutPatch : BytecodePatch(
|
||||
setOf(
|
||||
CustomPlaybackSpeedIntegrationsFingerprint,
|
||||
|
@ -0,0 +1,36 @@
|
||||
package app.revanced.patches.youtube.flyoutpanel.recyclerview
|
||||
|
||||
import app.revanced.extensions.exception
|
||||
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.patches.youtube.flyoutpanel.recyclerview.fingerprints.BottomSheetRecyclerViewBuilderFingerprint
|
||||
import app.revanced.util.bytecode.getWide32LiteralIndex
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
|
||||
object BottomSheetRecyclerViewPatch : BytecodePatch(
|
||||
setOf(BottomSheetRecyclerViewBuilderFingerprint)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext) {
|
||||
|
||||
/**
|
||||
* If this value is false, OldQualityLayoutPatch and OldSpeedLayoutPatch will not work.
|
||||
* This value is usually true so this patch is not strictly necessary,
|
||||
* But in very rare cases this value may be false.
|
||||
* Therefore, we need to force this to be true.
|
||||
*/
|
||||
BottomSheetRecyclerViewBuilderFingerprint.result?.let {
|
||||
it.mutableMethod.apply {
|
||||
val targetIndex = getWide32LiteralIndex(45382015) + 2
|
||||
val targetRegister = getInstruction<OneRegisterInstruction>(targetIndex).registerA
|
||||
|
||||
addInstruction(
|
||||
targetIndex + 1,
|
||||
"const/4 v$targetRegister, 0x1"
|
||||
)
|
||||
}
|
||||
} ?: throw BottomSheetRecyclerViewBuilderFingerprint.exception
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
package app.revanced.patches.youtube.flyoutpanel.recyclerview.fingerprints
|
||||
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import app.revanced.util.bytecode.isWide32LiteralExists
|
||||
|
||||
object BottomSheetRecyclerViewBuilderFingerprint : MethodFingerprint(
|
||||
customFingerprint = { methodDef, _ -> methodDef.isWide32LiteralExists(45382015) }
|
||||
)
|
Loading…
x
Reference in New Issue
Block a user