mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-05-21 16:57:18 +02:00
feat(youtube): remove new-layout-alert-dialog
patch
This commit is contained in:
parent
885f9b19ff
commit
613e767d52
@ -1,26 +0,0 @@
|
||||
package app.revanced.patches.youtube.utils.alertdialog.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch.Companion.BottomSheetRecyclerView
|
||||
import app.revanced.util.bytecode.isWideLiteralExists
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import org.jf.dexlib2.Opcode
|
||||
|
||||
object BottomSheetRecyclerViewBuilderFingerprint : MethodFingerprint(
|
||||
returnType = "L",
|
||||
accessFlags = AccessFlags.PROTECTED or AccessFlags.FINAL,
|
||||
parameters = listOf(),
|
||||
opcodes = listOf(
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.IF_NEZ,
|
||||
Opcode.INVOKE_STATIC,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.RETURN_OBJECT,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.IF_EQZ
|
||||
),
|
||||
customFingerprint = { methodDef, _ -> methodDef.isWideLiteralExists(BottomSheetRecyclerView) }
|
||||
)
|
@ -1,49 +0,0 @@
|
||||
package app.revanced.patches.youtube.utils.alertdialog.patch
|
||||
|
||||
import app.revanced.extensions.toErrorResult
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.annotation.Version
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||
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.misc.spoofappversion.patch.SpoofAppVersionPatch
|
||||
import app.revanced.patches.youtube.utils.alertdialog.fingerprints.BottomSheetRecyclerViewBuilderFingerprint
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.utils.resourceid.patch.SharedResourceIdPatch
|
||||
import app.revanced.util.integrations.Constants.UTILS_PATH
|
||||
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
|
||||
@Name("new-layout-alert-dialog")
|
||||
@DependsOn(
|
||||
[
|
||||
SharedResourceIdPatch::class,
|
||||
SpoofAppVersionPatch::class
|
||||
]
|
||||
)
|
||||
@YouTubeCompatibility
|
||||
@Version("0.0.1")
|
||||
class NewLayoutAlertDialogPatch : BytecodePatch(
|
||||
listOf(BottomSheetRecyclerViewBuilderFingerprint)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
BottomSheetRecyclerViewBuilderFingerprint.result?.let {
|
||||
it.mutableMethod.apply {
|
||||
val contextIndex = it.scanResult.patternScanResult!!.startIndex + 3
|
||||
val contextRegister = getInstruction<OneRegisterInstruction>(contextIndex).registerA
|
||||
|
||||
val insertIndex = it.scanResult.patternScanResult!!.endIndex
|
||||
|
||||
addInstruction(
|
||||
insertIndex,
|
||||
"invoke-static {v$contextRegister}, $UTILS_PATH/NewPlayerFlyoutPanelsDetectPatch;->showAlertDialog(Landroid/content/Context;)V"
|
||||
)
|
||||
}
|
||||
} ?: return BottomSheetRecyclerViewBuilderFingerprint.toErrorResult()
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
@ -37,7 +37,6 @@ class SharedResourceIdPatch : ResourcePatch {
|
||||
var BarContainerHeight: Long = -1
|
||||
var BottomPanelOverlayText: Long = -1
|
||||
var BottomSheetMargins: Long = -1
|
||||
var BottomSheetRecyclerView: Long = -1
|
||||
var BottomUiContainerStub: Long = -1
|
||||
var ChannelListSubMenu: Long = -1
|
||||
var CompactLink: Long = -1
|
||||
@ -107,7 +106,6 @@ class SharedResourceIdPatch : ResourcePatch {
|
||||
BarContainerHeight = find(DIMEN, "bar_container_height")
|
||||
BottomPanelOverlayText = find(ID, "bottom_panel_overlay_text")
|
||||
BottomSheetMargins = find(DIMEN, "bottom_sheet_margins")
|
||||
BottomSheetRecyclerView = find(LAYOUT, "bottom_sheet_recycler_view")
|
||||
BottomUiContainerStub = find(ID, "bottom_ui_container_stub")
|
||||
ChannelListSubMenu = find(LAYOUT, "channel_list_sub_menu")
|
||||
CompactLink = find(LAYOUT, "compact_link")
|
||||
|
@ -14,12 +14,10 @@ import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patches.youtube.flyoutpanel.oldspeedlayout.patch.OldSpeedLayoutPatch
|
||||
import app.revanced.patches.youtube.utils.alertdialog.patch.NewLayoutAlertDialogPatch
|
||||
import app.revanced.patches.youtube.utils.annotations.YouTubeCompatibility
|
||||
import app.revanced.patches.youtube.utils.settings.resource.patch.SettingsPatch
|
||||
import app.revanced.patches.youtube.video.customspeed.fingerprints.SpeedArrayGeneratorFingerprint
|
||||
import app.revanced.patches.youtube.video.customspeed.fingerprints.SpeedLimiterFingerprint
|
||||
import app.revanced.util.bytecode.BytecodeHelper.updatePatchStatus
|
||||
import app.revanced.util.integrations.Constants.VIDEO_PATH
|
||||
import org.jf.dexlib2.Opcode
|
||||
import org.jf.dexlib2.iface.instruction.NarrowLiteralInstruction
|
||||
@ -33,7 +31,6 @@ import org.jf.dexlib2.iface.reference.MethodReference
|
||||
@Description("Adds more video speed options.")
|
||||
@DependsOn(
|
||||
[
|
||||
NewLayoutAlertDialogPatch::class,
|
||||
OldSpeedLayoutPatch::class,
|
||||
SettingsPatch::class
|
||||
]
|
||||
@ -123,8 +120,6 @@ class CustomVideoSpeedPatch : BytecodePatch(
|
||||
}
|
||||
} ?: return SpeedLimiterFingerprint.toErrorResult()
|
||||
|
||||
context.updatePatchStatus("CustomVideoSpeed")
|
||||
|
||||
/**
|
||||
* Add settings
|
||||
*/
|
||||
|
@ -500,10 +500,6 @@ Only available on YouTube v18.24.37+"</string>
|
||||
<string name="revanced_layout_title">Layout</string>
|
||||
<string name="revanced_misc">Miscellaneous</string>
|
||||
<string name="revanced_navigation">Navigation</string>
|
||||
<string name="revanced_new_player_flyout_panel_alert_dialog_message_footer" formatted="false">There is no valid resolution for this issue yet\nOnly spoofing the client version to %s can temporarily fix this issue\n\nSpoofing the client version to %s?</string>
|
||||
<string name="revanced_new_player_flyout_panel_alert_dialog_message_header">The following settings do not work in the new player flyout panel :</string>
|
||||
<string name="revanced_new_player_flyout_panel_alert_dialog_title">New player flyout panel detected</string>
|
||||
<string name="revanced_new_player_flyout_panel_notice">Does not work in the new player flyout panel</string>
|
||||
<string name="revanced_open_library_startup_summary_off">Library is not opened at app startup</string>
|
||||
<string name="revanced_open_library_startup_summary_on">Library is opened at app startup</string>
|
||||
<string name="revanced_open_library_startup_title">Open library on app startup</string>
|
||||
|
Loading…
x
Reference in New Issue
Block a user