mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-05-29 05:10:20 +02:00
feat(YouTube): add Disable update screen
patch
This commit is contained in:
parent
522211215b
commit
5cd1f88fd8
@ -0,0 +1,79 @@
|
||||
package app.revanced.patches.youtube.misc.updatescreen
|
||||
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patcher.util.smali.ExternalLabel
|
||||
import app.revanced.patches.youtube.misc.updatescreen.fingerprints.AppBlockingCheckResultToStringFingerprint
|
||||
import app.revanced.patches.youtube.utils.integrations.Constants.MISC_PATH
|
||||
import app.revanced.patches.youtube.utils.settings.SettingsPatch
|
||||
import app.revanced.util.exception
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction
|
||||
import com.android.tools.smali.dexlib2.util.MethodUtil
|
||||
|
||||
@Patch(
|
||||
name = "Disable update screen",
|
||||
description = "Adds an option to disable the \"Update your app\" screen that appears when using an outdated client.",
|
||||
dependencies = [SettingsPatch::class],
|
||||
compatiblePackages = [
|
||||
CompatiblePackage(
|
||||
"com.google.android.youtube",
|
||||
[
|
||||
"18.25.40",
|
||||
"18.27.36",
|
||||
"18.29.38",
|
||||
"18.30.37",
|
||||
"18.31.40",
|
||||
"18.32.39",
|
||||
"18.33.40",
|
||||
"18.34.38",
|
||||
"18.35.36",
|
||||
"18.36.39",
|
||||
"18.37.36",
|
||||
"18.38.44",
|
||||
"18.39.41",
|
||||
"18.40.34",
|
||||
"18.41.39",
|
||||
"18.42.41",
|
||||
"18.43.45",
|
||||
"18.44.41",
|
||||
"18.45.43"
|
||||
]
|
||||
)
|
||||
]
|
||||
)
|
||||
@Suppress("unused")
|
||||
object UpdateScreenPatch : BytecodePatch(
|
||||
setOf(AppBlockingCheckResultToStringFingerprint)
|
||||
) {
|
||||
private const val INTEGRATIONS_CLASS_DESCRIPTOR =
|
||||
"$MISC_PATH/UpdateScreenPatch;"
|
||||
|
||||
override fun execute(context: BytecodeContext) {
|
||||
AppBlockingCheckResultToStringFingerprint.result?.mutableClass?.methods?.first { method ->
|
||||
MethodUtil.isConstructor(method)
|
||||
&& method.parameters == listOf("Landroid/content/Intent;", "Z")
|
||||
}?.addInstructions(
|
||||
1, """
|
||||
invoke-static {}, $INTEGRATIONS_CLASS_DESCRIPTOR->disableUpdateScreen(Landroid/content/Intent;)Landroid/content/Intent;
|
||||
move-result-object p1
|
||||
"""
|
||||
) ?: throw AppBlockingCheckResultToStringFingerprint.exception
|
||||
|
||||
/**
|
||||
* Add settings
|
||||
*/
|
||||
SettingsPatch.addPreference(
|
||||
arrayOf(
|
||||
"SETTINGS: DISABLE_UPDATE_SCREEN"
|
||||
)
|
||||
)
|
||||
|
||||
SettingsPatch.updatePatchStatus("Disable update screen")
|
||||
}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
package app.revanced.patches.youtube.misc.updatescreen.fingerprints
|
||||
|
||||
import app.revanced.patcher.fingerprint.MethodFingerprint
|
||||
|
||||
object AppBlockingCheckResultToStringFingerprint : MethodFingerprint(
|
||||
returnType = "Ljava/lang/String;",
|
||||
strings = listOf("AppBlockingCheckResult{intent=")
|
||||
)
|
@ -136,6 +136,8 @@ Note: Disabling the speed overlay restores the 'Slide to seek' behavior of the o
|
||||
<string name="revanced_disable_startup_shorts_player_summary_off">Shorts player is enabled at app startup.</string>
|
||||
<string name="revanced_disable_startup_shorts_player_summary_on">Shorts player is disabled at app startup.</string>
|
||||
<string name="revanced_disable_startup_shorts_player_title">Disable shorts player at app startup</string>
|
||||
<string name="revanced_disable_update_screen_summary">Disables the \"Update your app\" screen that appears when using an outdated client.</string>
|
||||
<string name="revanced_disable_update_screen_title">Disable update screen</string>
|
||||
<string name="revanced_double_back_timeout_summary">The amount of seconds the double press back to exit.</string>
|
||||
<string name="revanced_double_back_timeout_title">Double back timeout</string>
|
||||
<string name="revanced_enable_bottom_player_gestures_summary_off">Entering fullscreen when swiping down below the video player is disabled.</string>
|
||||
|
@ -315,6 +315,9 @@
|
||||
<SwitchPreference android:title="@string/revanced_bypass_ambient_mode_restrictions_title" android:key="revanced_bypass_ambient_mode_restrictions" android:defaultValue="false" android:summaryOn="@string/revanced_bypass_ambient_mode_restrictions_summary_on" android:summaryOff="@string/revanced_bypass_ambient_mode_restrictions_summary_off" />
|
||||
<SwitchPreference android:title="@string/revanced_disable_ambient_mode_title" android:key="revanced_disable_ambient_mode" android:defaultValue="false" android:summary="@string/revanced_disable_ambient_mode_summary" />SETTINGS: AMBIENT_MODE_SWITCH -->
|
||||
|
||||
<!-- SETTINGS: DISABLE_UPDATE_SCREEN
|
||||
<SwitchPreference android:title="@string/revanced_disable_update_screen_title" android:key="revanced_disable_update_screen" android:defaultValue="true" android:summary="@string/revanced_disable_update_screen_summary" />SETTINGS: DISABLE_UPDATE_SCREEN -->
|
||||
|
||||
<!-- SETTINGS: DOUBLE_BACK_TIMEOUT
|
||||
<ListPreference android:title="@string/revanced_double_back_timeout_title" android:summary="@string/revanced_double_back_timeout_summary" android:key="revanced_double_back_timeout" android:entries="@array/revanced_double_back_timeout_entry" android:defaultValue="2" android:entryValues="@array/revanced_double_back_timeout_value" />SETTINGS: DOUBLE_BACK_TIMEOUT -->
|
||||
|
||||
@ -443,6 +446,7 @@
|
||||
<Preference android:title=" " android:selectable="false" android:summary="@string/revanced_misc" />
|
||||
<Preference android:title="Ambient mode switch" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
||||
<Preference android:title="Disable QUIC protocol" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
||||
<Preference android:title="Disable update screen" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
||||
<Preference android:title="Enable debug logging" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
||||
<Preference android:title="Enable external browser" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
||||
<Preference android:title="Enable language switch" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
||||
|
Loading…
x
Reference in New Issue
Block a user