revanced-patches-template
revanced-patches-template copied to clipboard
bug: Cannot apply `hide-shorts-button` to 17.32.35
Type
Error while patching
Bug description
After bump to 17.33.42, hide-shorts-button
cannot be applied to 17.32.35.
It works correctly on 17.33.42, but on that version I'm not able to see the playlists when adding a video to them with general-ads
mod enabled, while on 17.32.35 I can (dunno if it is thanks to client-spoof
or not, but on 17.33.42 I cannot make playlists appear with or without client-spoof
and the only solution is to disable general-ads
mod), so I wanted to stay on 17.32.35 for the moment.
Steps to reproduce
Step 1 - Try to patch 17.32.35 with hide-shorts-button
enabled
Step 2 - The patch crashes
Relevant log output
[builder] SEVERE: hide-shorts-button failed:
[builder] app.revanced.patcher.patch.PatchResultError: class org.jf.dexlib2.builder.instruction.BuilderInstruction3rc cannot be cast to class org.jf.dexlib2.iface.instruction.OneRegisterInstruction (org.jf.dexlib2.builder.instruction.BuilderInstruction3rc and org.jf.dexlib2.iface.instruction.OneRegisterInstruction are in unnamed module of loader 'app')
[builder] at app.revanced.patcher.Patcher.applyPatch(Patcher.kt:309) at app.revanced.patcher.Patcher.access$applyPatch(Patcher.kt:44)
[builder] at app.revanced.patcher.Patcher$applyPatches$1.invokeSuspend(Patcher.kt:325) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlin.sequences.SequenceBuilderIterator.hasNext(SequenceBuilder.kt:127) at app.revanced.utils.patcher.PatcherKt.applyPatchesVerbose(Patcher.kt:92) at app.revanced.cli.patcher.Patcher.start$revanced_cli(Patcher.kt:22) at app.revanced.cli.command.MainCommand.run(MainCommand.kt:160) at picocli.CommandLine.executeUserObject(CommandLine.java:1939) at picocli.CommandLine.access$1300(CommandLine.java:145) at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2358) at picocli.CommandLine$RunLast.handle(CommandLine.java:2352) at picocli.CommandLine$RunLast.handle(CommandLine.java:2314) at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179)
[builder] at picocli.CommandLine$RunLast.execute(CommandLine.java:2316) at picocli.CommandLine.execute(CommandLine.java:2078) at app.revanced.cli.main.MainKt.main(Main.kt:7)
[builder] Caused by: java.lang.ClassCastException: class org.jf.dexlib2.builder.instruction.BuilderInstruction3rc cannot be cast to class org.jf.dexlib2.iface.instruction.OneRegisterInstruction (org.jf.dexlib2.builder.instruction.BuilderInstruction3rc and org.jf.dexlib2.iface.instruction.OneRegisterInstruction are in unnamed module of loader 'app') at app.revanced.patches.youtube.layout.shorts.button.patch.ShortsButtonRemoverPatch.execute(ShortsButtonRemoverPatch.kt:71) at app.revanced.patches.youtube.layout.shorts.button.patch.ShortsButtonRemoverPatch.execute(ShortsButtonRemoverPatch.kt:23) at app.revanced.patcher.Patcher.applyPatch(Patcher.kt:304) ... 16 more
Screenshots or videos
No response
Solution
The problem is that now it applies a -7 offset instead of -6 (is it an offset? I'm not sure), one solution could be adding a try - catch and apply the -6 if the -7 make it crash, but I'm sure there's a better solution for this, I was just checking the commit and trying to understand what changed.
Additional context
No response
Oh, it seems that for some reason playlists are now shown also on 17.33.42, so I'm good, but I leave this bug opened, so that you guys can decide what to do with it :)
Noticing the same with 17.33.42