|
1 | 1 | package io.github.chsbuffer.revancedxposed.youtube.layout.startupshortsreset |
2 | 2 |
|
3 | 3 | import io.github.chsbuffer.revancedxposed.AccessFlags |
| 4 | +import io.github.chsbuffer.revancedxposed.Opcode |
| 5 | +import io.github.chsbuffer.revancedxposed.accessFlags |
4 | 6 | import io.github.chsbuffer.revancedxposed.findMethodDirect |
5 | 7 | 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 |
6 | 11 |
|
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 | + } |
12 | 51 | } |
13 | 52 |
|
14 | 53 | val userWasInShortsBuilderFingerprint = findMethodDirect { |
|
0 commit comments