1- package app.revanced.patches.tiktok.interaction.clearmode
1+ package app.revanced.patches.tiktok.interaction.cleardisplay
22
33import app.revanced.patcher.data.BytecodeContext
44import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
@@ -8,72 +8,72 @@ import app.revanced.patcher.patch.BytecodePatch
88import app.revanced.patcher.patch.annotation.CompatiblePackage
99import app.revanced.patcher.patch.annotation.Patch
1010import app.revanced.patcher.util.smali.ExternalLabel
11- import app.revanced.patches.tiktok.interaction.clearmode .fingerprints.OnClearModeEventFingerprint
12- import app.revanced.patches.tiktok.interaction.clearmode .fingerprints.OnRenderFirstFrameFingerprint
11+ import app.revanced.patches.tiktok.interaction.cleardisplay .fingerprints.OnClearDisplayEventFingerprint
12+ import app.revanced.patches.tiktok.interaction.cleardisplay .fingerprints.OnRenderFirstFrameFingerprint
1313import app.revanced.util.exception
1414import app.revanced.util.indexOfFirstInstruction
1515import com.android.tools.smali.dexlib2.Opcode
1616import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction22c
1717
1818@Patch(
19- name = " Remember clear mode " ,
20- description = " Remembers the clear mode configurations in between videos." ,
19+ name = " Remember clear display " ,
20+ description = " Remembers the clear display configurations in between videos." ,
2121 compatiblePackages = [
2222 CompatiblePackage (" com.ss.android.ugc.trill" , [" 32.5.3" ]),
2323 CompatiblePackage (" com.zhiliaoapp.musically" , [" 32.5.3" ])
2424 ]
2525)
2626@Suppress(" unused" )
27- object RememberClearModePatch : BytecodePatch(
27+ object RememberClearDisplayPatch : BytecodePatch(
2828 setOf(
29- OnClearModeEventFingerprint ,
29+ OnClearDisplayEventFingerprint ,
3030 OnRenderFirstFrameFingerprint
3131 )
3232) {
3333 override fun execute (context : BytecodeContext ) {
34- OnClearModeEventFingerprint .result?.mutableMethod?.let {
35- // region Hook the "Clear mode " configuration save event to remember the state of clear mode .
34+ OnClearDisplayEventFingerprint .result?.mutableMethod?.let {
35+ // region Hook the "Clear display " configuration save event to remember the state of clear display .
3636
3737 val isEnabledIndex = it.indexOfFirstInstruction { opcode == Opcode .IGET_BOOLEAN } + 1
3838 val isEnabledRegister = it.getInstruction<Instruction22c >(isEnabledIndex - 1 ).registerA
3939
4040 it.addInstructions(
4141 isEnabledIndex,
4242 " invoke-static { v$isEnabledRegister }, " +
43- " Lapp/revanced/tiktok/clearmode/RememberClearModePatch ;->rememberClearModeState (Z)V"
43+ " Lapp/revanced/tiktok/cleardisplay/RememberClearDisplayPatch ;->rememberClearDisplayState (Z)V"
4444 )
4545
4646 // endregion
4747
48- // region Override the "Clear mode " configuration load event to load the state of clear mode .
48+ // region Override the "Clear display " configuration load event to load the state of clear display .
4949
50- val clearModeEventClass = it.parameters[0 ].type
50+ val clearDisplayEventClass = it.parameters[0 ].type
5151 OnRenderFirstFrameFingerprint .result?.mutableMethod?.apply {
5252 addInstructionsWithLabels(
5353 0 ,
5454 """
55- # Create a new clearModeEvent and post it to the EventBus (https://github.com/greenrobot/EventBus)
55+ # Create a new clearDisplayEvent and post it to the EventBus (https://github.com/greenrobot/EventBus)
5656
57- # The state of clear mode .
58- invoke-static { }, Lapp/revanced/tiktok/clearmode/RememberClearModePatch ;->getClearModeState ()Z
57+ # The state of clear display .
58+ invoke-static { }, Lapp/revanced/tiktok/cleardisplay/RememberClearDisplayPatch ;->getClearDisplayState ()Z
5959 move-result v3
60- if-eqz v3, :clear_mode_disabled
60+ if-eqz v3, :clear_display_disabled
6161
62- # Clear mode type such as 0 = LONG_PRESS, 1 = SCREEN_RECORD etc.
62+ # Clear display type such as 0 = LONG_PRESS, 1 = SCREEN_RECORD etc.
6363 const/4 v1, 0x0
6464
65- # Name of the clear mode type which is equivalent to the clear mode type.
65+ # Name of the clear display type which is equivalent to the clear display type.
6666 const-string v2, "long_press"
6767
68- new-instance v0, $clearModeEventClass
69- invoke-direct { v0, v1, v2, v3 }, $clearModeEventClass -><init>(ILjava/lang/String;Z)V
70- invoke-virtual { v0 }, $clearModeEventClass ->post()Lcom/ss/android/ugc/governance/eventbus/IEvent;
68+ new-instance v0, $clearDisplayEventClass
69+ invoke-direct { v0, v1, v2, v3 }, $clearDisplayEventClass -><init>(ILjava/lang/String;Z)V
70+ invoke-virtual { v0 }, $clearDisplayEventClass ->post()Lcom/ss/android/ugc/governance/eventbus/IEvent;
7171 """ ,
72- ExternalLabel (" clear_mode_disabled " , getInstruction(0 ))
72+ ExternalLabel (" clear_display_disabled " , getInstruction(0 ))
7373 )
7474 } ? : throw OnRenderFirstFrameFingerprint .exception
7575
7676 // endregion
77- } ? : throw OnClearModeEventFingerprint .exception
77+ } ? : throw OnClearDisplayEventFingerprint .exception
7878 }
7979}
0 commit comments