forked from ReVanced/revanced-patches-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(YouTube): Restore functionality of
Old video quality menu
and `…
…Custom speeds` on tablets (ReVanced#2999)
- Loading branch information
1 parent
50733f5
commit 238bed1
Showing
7 changed files
with
67 additions
and
80 deletions.
There are no files selected for viewing
13 changes: 0 additions & 13 deletions
13
...vanced/patches/youtube/misc/bottomsheet/hook/fingerprints/CreateBottomSheetFingerprint.kt
This file was deleted.
Oops, something went wrong.
39 changes: 0 additions & 39 deletions
39
...n/kotlin/app/revanced/patches/youtube/misc/bottomsheet/hook/patch/BottomSheetHookPatch.kt
This file was deleted.
Oops, something went wrong.
19 changes: 0 additions & 19 deletions
19
.../app/revanced/patches/youtube/misc/bottomsheet/hook/patch/BottomSheetHookResourcePatch.kt
This file was deleted.
Oops, something went wrong.
21 changes: 21 additions & 0 deletions
21
...es/youtube/misc/recyclerviewtree/hook/fingerprints/RecyclerViewTreeObserverFingerprint.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,21 @@ | ||
package app.revanced.patches.youtube.misc.recyclerviewtree.hook.fingerprints | ||
|
||
import app.revanced.patcher.extensions.or | ||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint | ||
import com.android.tools.smali.dexlib2.AccessFlags | ||
import com.android.tools.smali.dexlib2.Opcode | ||
|
||
object RecyclerViewTreeObserverFingerprint : MethodFingerprint( | ||
returnType = "V", | ||
accessFlags = AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, | ||
opcodes = listOf( | ||
Opcode.NEW_INSTANCE, | ||
Opcode.INVOKE_DIRECT, | ||
Opcode.IPUT_OBJECT, | ||
Opcode.IGET_BOOLEAN, | ||
Opcode.IF_NEZ, | ||
Opcode.INVOKE_VIRTUAL_RANGE, | ||
Opcode.MOVE_RESULT_OBJECT | ||
), | ||
strings = listOf("LithoRVSLCBinder") | ||
) |
37 changes: 37 additions & 0 deletions
37
...pp/revanced/patches/youtube/misc/recyclerviewtree/hook/patch/RecyclerViewTreeHookPatch.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,37 @@ | ||
package app.revanced.patches.youtube.misc.recyclerviewtree.hook.patch | ||
|
||
import app.revanced.extensions.exception | ||
import app.revanced.patcher.data.BytecodeContext | ||
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction | ||
import app.revanced.patcher.patch.BytecodePatch | ||
import app.revanced.patcher.patch.annotations.DependsOn | ||
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch | ||
import app.revanced.patches.youtube.misc.recyclerviewtree.hook.fingerprints.RecyclerViewTreeObserverFingerprint | ||
|
||
@DependsOn([IntegrationsPatch::class]) | ||
class RecyclerViewTreeHookPatch : BytecodePatch( | ||
listOf(RecyclerViewTreeObserverFingerprint) | ||
) { | ||
override fun execute(context: BytecodeContext) { | ||
|
||
RecyclerViewTreeObserverFingerprint.result?.let { | ||
it.mutableMethod.apply { | ||
val insertIndex = it.scanResult.patternScanResult!!.startIndex + 5 | ||
val recyclerViewParameter = 2 | ||
|
||
addHook = { classDescriptor -> | ||
addInstruction( | ||
insertIndex, | ||
"invoke-static/range { p$recyclerViewParameter .. p$recyclerViewParameter }, $classDescriptor->onFlyoutMenuCreate(Landroid/support/v7/widget/RecyclerView;)V" | ||
) | ||
} | ||
} | ||
} ?: throw RecyclerViewTreeObserverFingerprint.exception | ||
|
||
} | ||
|
||
internal companion object { | ||
internal lateinit var addHook: (String) -> Unit | ||
private set | ||
} | ||
} |
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
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