generated from ReVanced/revanced-patches-template
-
-
Notifications
You must be signed in to change notification settings - Fork 236
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(youtube/return-youtube-dislike): support older UI layouts (#2031)
- Loading branch information
1 parent
1135c03
commit c82ccb5
Showing
4 changed files
with
60 additions
and
9 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
.../youtube/layout/returnyoutubedislike/fingerprints/DislikesOldLayoutTextViewFingerprint.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,28 @@ | ||
package app.revanced.patches.youtube.layout.returnyoutubedislike.fingerprints | ||
|
||
import app.revanced.patcher.extensions.or | ||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint | ||
import app.revanced.patches.youtube.layout.returnyoutubedislike.resource.patch.ReturnYouTubeDislikeResourcePatch | ||
import org.jf.dexlib2.AccessFlags | ||
import org.jf.dexlib2.Opcode | ||
import org.jf.dexlib2.iface.instruction.WideLiteralInstruction | ||
|
||
object DislikesOldLayoutTextViewFingerprint : MethodFingerprint( | ||
returnType = "V", | ||
parameters = listOf("L"), | ||
access = AccessFlags.PUBLIC or AccessFlags.FINAL, | ||
opcodes = listOf( | ||
Opcode.CONST, // resource identifier register | ||
Opcode.INVOKE_VIRTUAL, | ||
Opcode.INVOKE_VIRTUAL, | ||
Opcode.IGET_OBJECT, | ||
Opcode.IF_NEZ, // textview register | ||
Opcode.GOTO, | ||
), | ||
customFingerprint = { methodDef -> | ||
methodDef.implementation?.instructions?.any { instruction -> | ||
instruction.opcode.ordinal == Opcode.CONST.ordinal && | ||
(instruction as? WideLiteralInstruction)?.wideLiteral == ReturnYouTubeDislikeResourcePatch.oldUIDislikeId | ||
} == true | ||
} | ||
) |
5 changes: 1 addition & 4 deletions
5
.../app/revanced/patches/youtube/layout/returnyoutubedislike/fingerprints/LikeFingerprint.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 |
---|---|---|
@@ -1,11 +1,8 @@ | ||
package app.revanced.patches.youtube.layout.returnyoutubedislike.fingerprints | ||
|
||
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod | ||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint | ||
|
||
|
||
@FuzzyPatternScanMethod(2) | ||
object LikeFingerprint : MethodFingerprint( | ||
"V", | ||
strings = listOf("like/like") | ||
strings = listOf("like/like") | ||
) |
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