mirror of
https://github.com/revanced/revanced-patches
synced 2024-12-02 21:12:57 +01:00
refactor(youtube/hide-reels): remove dead code
Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
This commit is contained in:
parent
c74c77d125
commit
fb070d8e95
@ -1,10 +0,0 @@
|
||||
package app.revanced.patches.youtube.layout.reels.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
|
||||
object HideReelsFingerprint : MethodFingerprint(
|
||||
access = AccessFlags.PROTECTED or AccessFlags.FINAL, parameters = listOf("L", "L"),
|
||||
strings = listOf("multiReelDismissalCallback", "reelItemRenderers", "reelDismissalInfo")
|
||||
)
|
@ -1,51 +0,0 @@
|
||||
package app.revanced.patches.youtube.layout.reels.patch
|
||||
|
||||
import app.revanced.patcher.annotation.Description
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.annotation.Version
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.addInstruction
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patches.youtube.layout.reels.annotations.HideReelsCompatibility
|
||||
import app.revanced.patches.youtube.layout.reels.fingerprints.HideReelsFingerprint
|
||||
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
|
||||
//@Patch TODO: this is currently in the general-bytecode-ads patch due to the integrations having a preference for including reels or not. Move it here.
|
||||
@Name("hide-reels")
|
||||
@Description("Hides reels on the home page.")
|
||||
@DependsOn([SettingsPatch::class])
|
||||
@HideReelsCompatibility
|
||||
@Version("0.0.1")
|
||||
class HideReelsPatch : BytecodePatch(
|
||||
listOf(
|
||||
HideReelsFingerprint
|
||||
)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_hide_reel_button",
|
||||
StringResource("revanced_hide_reel_button_title", "Hide reels button"),
|
||||
true,
|
||||
StringResource("revanced_hide_reel_button_summary_on", "Reels button is hidden"),
|
||||
StringResource("revanced_hide_reel_button_summary_off", "Reels button is shown")
|
||||
)
|
||||
)
|
||||
|
||||
val result = HideReelsFingerprint.result!!
|
||||
|
||||
// HideReel will hide the reel view before it is being used,
|
||||
// so we pass the view to the HideReel method
|
||||
result.mutableMethod.addInstruction(
|
||||
result.scanResult.patternScanResult!!.endIndex,
|
||||
"invoke-static { v2 }, Lapp/revanced/integrations/patches/HideReelsPatch;->HideReel(Landroid/view/View;)V"
|
||||
)
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user