refactor: integrations (#44)

This commit is contained in:
Joey Peter
2022-06-24 00:17:49 +02:00
committed by GitHub
parent e1f37bf7c7
commit a8f17948ac
12 changed files with 18 additions and 19 deletions

View File

@ -30,7 +30,7 @@ class HideCastButtonPatch : BytecodePatch(listOf()) {
setVisibilityMethod.addInstructions(
0, """
invoke-static {p1}, Lfi/razerman/youtube/XGlobals;->getCastButtonOverrideV2(I)I
invoke-static {p1}, Lapp/revanced/integrations/patches/HideCastButtonPatch;->getCastButtonOverrideV2(I)I
move-result p1
"""
)

View File

@ -54,8 +54,8 @@ class CreateButtonRemoverPatch : BytecodePatch(
// Hide the button view via proxy by passing it to the hideCreateButton method
result.method.addInstruction(
moveResultIndex + 1,
"invoke-static { v${moveResultInstruction.registerA} }, Lfi/razerman/youtube/XAdRemover;->hideCreateButton(Landroid/view/View;)V"
result.scanResult.endIndex + 1,
"invoke-static { v$moveResultInstruction.registerA }, Lapp/revanced/integrations/patches/HideCreateButtonPatch;->hideCreateButton(Landroid/view/View;)V"
)
return PatchResultSuccess()

View File

@ -58,7 +58,7 @@ class OldQualityLayoutPatch : BytecodePatch(
implementation.addInstruction(5, jmpInstruction)
result.method.addInstructions(
0, """
invoke-static { }, Lfi/razerman/youtube/XGlobals;->useOldStyleQualitySettings()Z
invoke-static { }, Lapp/revanced/integrations/patches/OldStyleQualityPatch;->useOldStyleQualitySettings()Z
move-result v0
"""
)

View File

@ -28,7 +28,7 @@ class HideReelsPatch : BytecodePatch(
// so we pass the view to the HideReel method
result.method.addInstruction(
result.scanResult.endIndex,
"invoke-static { v2 }, Lfi/razerman/youtube/XAdRemover;->HideReel(Landroid/view/View;)V"
"invoke-static { v2 }, Lapp/revanced/integrations/patches/HideReelsPatch;->HideReel(Landroid/view/View;)V"
)
return PatchResultSuccess()

View File

@ -41,16 +41,16 @@ class ShortsButtonRemoverPatch : BytecodePatch(
// Save the tab enum in XGlobals to avoid smali/register workarounds
result1.method.addInstruction(
result1.scanResult.endIndex + 1,
"sput-object v$enumRegister, Lfi/razerman/youtube/XGlobals;->lastPivotTab:Ljava/lang/Enum;"
"sput-object v$enumRegister, Lapp/revanced/integrations/patches/HideShortsButtonPatch;->lastPivotTab:Ljava/lang/Enum;"
)
// Hide the button view via proxy by passing it to the hideShortsButton method
// It only hides it if the last tab name is "TAB_SHORTS"
result2.method.addInstruction(
result2.scanResult.endIndex + 2,
"invoke-static { v$viewRegister }, Lfi/razerman/youtube/XAdRemover;->hideShortsButton(Landroid/view/View;)V"
"invoke-static { v$viewRegister }, Lapp/revanced/integrations/patches/HideShortsButtonPatch;->hideShortsButton(Landroid/view/View;)V"
)
return PatchResultSuccess()
}
}
}

View File

@ -42,4 +42,4 @@ object PivotBarButtonTabenumSignature : MethodSignature(
Opcode.INVOKE_STATIC, // SomeEnum.fromValue(tabOrdinal)
Opcode.MOVE_RESULT_OBJECT
)
)
)