re-add enable-old-layout patch

This commit is contained in:
inotia00
2023-02-22 20:04:05 +09:00
parent b41f13e00e
commit 115e91f26a
3 changed files with 19 additions and 3 deletions

View File

@ -9,13 +9,18 @@ import app.revanced.patcher.extensions.addInstructions
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.patcher.patch.annotations.Patch
import app.revanced.patches.shared.annotation.YouTubeCompatibility
import app.revanced.patches.youtube.misc.oldlayout.fingerprints.OldLayoutFingerprint
import app.revanced.patches.youtube.misc.settings.resource.patch.SettingsPatch
import app.revanced.util.integrations.Constants.MISC_PATH
import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
@Patch
@Name("enable-old-layout")
@Description("Spoof the YouTube client version to use the old layout.")
@DependsOn([SettingsPatch::class])
@YouTubeCompatibility
@Version("0.0.1")
class OldLayoutPatch : BytecodePatch(
@ -39,6 +44,17 @@ class OldLayoutPatch : BytecodePatch(
}
} ?: return OldLayoutFingerprint.toErrorResult()
/*
* Add settings
*/
SettingsPatch.addPreference(
arrayOf(
"SETTINGS: ENABLE_OLD_LAYOUT"
)
)
SettingsPatch.updatePatchStatus("enable-old-layout")
return PatchResultSuccess()
}
}

View File

@ -12,7 +12,6 @@ import app.revanced.patches.shared.annotation.YouTubeCompatibility
import app.revanced.patches.shared.patch.options.PatchOptions
import app.revanced.patches.shared.patch.settings.AbstractSettingsResourcePatch
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
import app.revanced.patches.youtube.misc.oldlayout.patch.OldLayoutPatch
import app.revanced.patches.youtube.misc.resourceid.patch.SharedResourcdIdPatch
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsBytecodePatch
import app.revanced.util.resources.ResourceHelper.addPreference
@ -28,7 +27,6 @@ import org.w3c.dom.Element
@DependsOn(
[
IntegrationsPatch::class,
OldLayoutPatch::class,
PatchOptions::class,
SharedResourcdIdPatch::class,
SettingsBytecodePatch::class