forked from inotia00/revanced-patches
-
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 Music/Player components):
Remember shuffle state
settin…
…g does not remember the correct state
- Loading branch information
Showing
5 changed files
with
102 additions
and
183 deletions.
There are no files selected for viewing
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
40 changes: 0 additions & 40 deletions
40
...revanced/patches/music/player/components/fingerprints/ShuffleClassReferenceFingerprint.kt
This file was deleted.
Oops, something went wrong.
30 changes: 30 additions & 0 deletions
30
...in/app/revanced/patches/music/player/components/fingerprints/ShuffleOnClickFingerprint.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,30 @@ | ||
package app.revanced.patches.music.player.components.fingerprints | ||
|
||
import app.revanced.patcher.extensions.or | ||
import app.revanced.patcher.fingerprint.MethodFingerprint | ||
import app.revanced.patches.music.player.components.fingerprints.ShuffleOnClickFingerprint.indexOfAccessibilityInstruction | ||
import app.revanced.util.containsWideLiteralInstructionValue | ||
import app.revanced.util.getReference | ||
import app.revanced.util.indexOfFirstInstruction | ||
import com.android.tools.smali.dexlib2.AccessFlags | ||
import com.android.tools.smali.dexlib2.Opcode | ||
import com.android.tools.smali.dexlib2.iface.Method | ||
import com.android.tools.smali.dexlib2.iface.reference.MethodReference | ||
|
||
internal object ShuffleOnClickFingerprint : MethodFingerprint( | ||
returnType = "V", | ||
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, | ||
parameters = listOf("Landroid/view/View;"), | ||
customFingerprint = { methodDef, _ -> | ||
methodDef.containsWideLiteralInstructionValue(45468) && | ||
methodDef.name == "onClick" && | ||
indexOfAccessibilityInstruction(methodDef) >= 0 | ||
} | ||
) { | ||
fun indexOfAccessibilityInstruction(methodDef: Method) = | ||
methodDef.indexOfFirstInstruction { | ||
opcode == Opcode.INVOKE_VIRTUAL && | ||
getReference<MethodReference>()?.name == "announceForAccessibility" | ||
} | ||
} | ||
|
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