mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-06-12 13:17:46 +02:00
feat(YouTube): Disable update screen
patch has been integrated into Hide layout components
patch
This commit is contained in:
@ -12,6 +12,7 @@ import app.revanced.patches.youtube.general.components.fingerprints.AccountListF
|
||||
import app.revanced.patches.youtube.general.components.fingerprints.AccountListParentFingerprint
|
||||
import app.revanced.patches.youtube.general.components.fingerprints.AccountMenuFingerprint
|
||||
import app.revanced.patches.youtube.general.components.fingerprints.AccountSwitcherAccessibilityLabelFingerprint
|
||||
import app.revanced.patches.youtube.general.components.fingerprints.AppBlockingCheckResultToStringFingerprint
|
||||
import app.revanced.patches.youtube.general.components.fingerprints.BottomUiContainerFingerprint
|
||||
import app.revanced.patches.youtube.general.components.fingerprints.FloatingMicrophoneFingerprint
|
||||
import app.revanced.patches.youtube.general.components.fingerprints.PiPNotificationFingerprint
|
||||
@ -36,6 +37,7 @@ import com.android.tools.smali.dexlib2.Opcode
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
|
||||
import com.android.tools.smali.dexlib2.util.MethodUtil
|
||||
|
||||
@Suppress("unused")
|
||||
object LayoutComponentsPatch : BaseBytecodePatch(
|
||||
@ -52,6 +54,7 @@ object LayoutComponentsPatch : BaseBytecodePatch(
|
||||
AccountListParentFingerprint,
|
||||
AccountMenuParentFingerprint,
|
||||
AccountSwitcherAccessibilityLabelFingerprint,
|
||||
AppBlockingCheckResultToStringFingerprint,
|
||||
BottomUiContainerFingerprint,
|
||||
FloatingMicrophoneFingerprint,
|
||||
PiPNotificationFingerprint,
|
||||
@ -94,6 +97,18 @@ object LayoutComponentsPatch : BaseBytecodePatch(
|
||||
|
||||
// endregion
|
||||
|
||||
// region patch for disable update screen
|
||||
|
||||
AppBlockingCheckResultToStringFingerprint.resultOrThrow().mutableClass.methods.first { method ->
|
||||
MethodUtil.isConstructor(method)
|
||||
&& method.parameters == listOf("Landroid/content/Intent;", "Z")
|
||||
}.addInstructions(
|
||||
1,
|
||||
"const/4 p1, 0x0"
|
||||
)
|
||||
|
||||
// endregion
|
||||
|
||||
// region patch for hide account menu
|
||||
|
||||
// for you tab
|
||||
|
@ -1,4 +1,4 @@
|
||||
package app.revanced.patches.youtube.misc.updatescreen.fingerprints
|
||||
package app.revanced.patches.youtube.general.components.fingerprints
|
||||
|
||||
import app.revanced.patcher.fingerprint.MethodFingerprint
|
||||
|
@ -1,31 +0,0 @@
|
||||
package app.revanced.patches.youtube.misc.updatescreen
|
||||
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||
import app.revanced.patches.youtube.misc.updatescreen.fingerprints.AppBlockingCheckResultToStringFingerprint
|
||||
import app.revanced.patches.youtube.utils.compatibility.Constants.COMPATIBLE_PACKAGE
|
||||
import app.revanced.patches.youtube.utils.settings.SettingsPatch
|
||||
import app.revanced.util.patch.BaseBytecodePatch
|
||||
import app.revanced.util.resultOrThrow
|
||||
import com.android.tools.smali.dexlib2.util.MethodUtil
|
||||
|
||||
@Suppress("unused")
|
||||
object UpdateScreenPatch : BaseBytecodePatch(
|
||||
name = "Disable update screen",
|
||||
description = "Disable the \"Update your app\" screen that appears when using an outdated client.",
|
||||
dependencies = setOf(SettingsPatch::class),
|
||||
compatiblePackages = COMPATIBLE_PACKAGE,
|
||||
fingerprints = setOf(AppBlockingCheckResultToStringFingerprint)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext) {
|
||||
AppBlockingCheckResultToStringFingerprint.resultOrThrow().mutableClass.methods.first { method ->
|
||||
MethodUtil.isConstructor(method)
|
||||
&& method.parameters == listOf("Landroid/content/Intent;", "Z")
|
||||
}.addInstructions(
|
||||
1,
|
||||
"const/4 p1, 0x0"
|
||||
)
|
||||
|
||||
SettingsPatch.updatePatchStatus(this)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user