refactor(youtube/hide-timestamp): use better descriptions

Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
This commit is contained in:
oSumAtrIX 2023-02-26 23:10:36 +01:00
parent 8f33b110fa
commit 743e215fc1
No known key found for this signature in database
GPG key ID: A9B3094ACDB604B4

View file

@ -19,11 +19,11 @@ import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
@Patch @Patch
@DependsOn([IntegrationsPatch::class, SettingsPatch::class]) @DependsOn([IntegrationsPatch::class, SettingsPatch::class])
@Name("hide-time") @Name("hide-timestamp")
@Description("Hides the videos time.") @Description("Hides timestamp in video player.")
@HideTimeCompatibility @HideTimeCompatibility
@Version("0.0.1") @Version("0.0.1")
class HideTimePatch : BytecodePatch( class HideTimestampPatch : BytecodePatch(
listOf( listOf(
TimeCounterFingerprint TimeCounterFingerprint
) )
@ -31,17 +31,17 @@ class HideTimePatch : BytecodePatch(
override fun execute(context: BytecodeContext): PatchResult { override fun execute(context: BytecodeContext): PatchResult {
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences( SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
SwitchPreference( SwitchPreference(
"revanced_hide_time", "revanced_hide_timestamp",
StringResource("revanced_hide_time_title", "Hide time"), StringResource("revanced_hide_timestamp_title", "Hide video timestamp"),
false, false,
StringResource("revanced_hide_time_summary_on", "Time is hidden"), StringResource("revanced_hide_timestamp_summary_on", "Timestamp is hidden"),
StringResource("revanced_hide_time_summary_off", "Time is shown") StringResource("revanced_hide_timestamp_summary_off", "Timestamp is shown")
) )
) )
TimeCounterFingerprint.result!!.mutableMethod.addInstructions( TimeCounterFingerprint.result!!.mutableMethod.addInstructions(
0, """ 0, """
invoke-static { }, Lapp/revanced/integrations/patches/HideTimePatch;->hideTime()Z invoke-static { }, Lapp/revanced/integrations/patches/HideTimestampPatch;->hideTimestamp()Z
move-result v0 move-result v0
if-eqz v0, :hide_time if-eqz v0, :hide_time
return-void return-void