Skip to content

Commit ceba461

Browse files
committed
DisableResumingShortsOnStartup: Support YouTube 20.47.59
1 parent 730cafc commit ceba461

File tree

1 file changed

+44
-5
lines changed
  • app/src/main/java/io/github/chsbuffer/revancedxposed/youtube/layout/startupshortsreset

1 file changed

+44
-5
lines changed

app/src/main/java/io/github/chsbuffer/revancedxposed/youtube/layout/startupshortsreset/Fingerprints.kt

Lines changed: 44 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,53 @@
11
package io.github.chsbuffer.revancedxposed.youtube.layout.startupshortsreset
22

33
import io.github.chsbuffer.revancedxposed.AccessFlags
4+
import io.github.chsbuffer.revancedxposed.Opcode
5+
import io.github.chsbuffer.revancedxposed.accessFlags
46
import io.github.chsbuffer.revancedxposed.findMethodDirect
57
import io.github.chsbuffer.revancedxposed.fingerprint
8+
import io.github.chsbuffer.revancedxposed.opcodes
9+
import io.github.chsbuffer.revancedxposed.parameters
10+
import io.github.chsbuffer.revancedxposed.returns
611

7-
val userWasInShortsFingerprint = fingerprint {
8-
returns("V")
9-
accessFlags(AccessFlags.PUBLIC, AccessFlags.FINAL)
10-
parameters("Ljava/lang/Object;")
11-
strings("userIsInShorts: ")
12+
val userWasInShortsFingerprint = findMethodDirect {
13+
runCatching {
14+
fingerprint {
15+
returns("V")
16+
accessFlags(AccessFlags.PUBLIC, AccessFlags.FINAL)
17+
parameters("Ljava/lang/Object;")
18+
strings("userIsInShorts: ")
19+
}
20+
}.getOrElse {
21+
findMethod {
22+
matcher {
23+
returns("V")
24+
accessFlags(AccessFlags.PUBLIC, AccessFlags.FINAL)
25+
parameters("Ljava/lang/Object;")
26+
opcodes(
27+
Opcode.INVOKE_INTERFACE, // userWasInShortsProtoStoreProvider
28+
Opcode.MOVE_RESULT_OBJECT,
29+
Opcode.CHECK_CAST,
30+
Opcode.NEW_INSTANCE,
31+
Opcode.INVOKE_DIRECT, // userWasInShortsBuilder
32+
Opcode.INVOKE_INTERFACE,
33+
Opcode.RETURN_VOID,
34+
)
35+
}
36+
}.findMethod {
37+
matcher {
38+
opcodes(
39+
Opcode.CHECK_CAST, // p1, Ljava/lang/Boolean; // userIsInShorts
40+
Opcode.INVOKE_VIRTUAL, // Ljava/lang/Boolean;->booleanValue()Z
41+
Opcode.MOVE_RESULT,
42+
Opcode.IGET_OBJECT,
43+
Opcode.MOVE_OBJECT,
44+
Opcode.CHECK_CAST,
45+
Opcode.IGET_OBJECT,
46+
Opcode.INVOKE_INTERFACE, // userWasInShortsProtoStoreProvider
47+
)
48+
}
49+
}.single()
50+
}
1251
}
1352

1453
val userWasInShortsBuilderFingerprint = findMethodDirect {

0 commit comments

Comments
 (0)