mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-05-09 11:04:36 +02:00
chore: disable Change YouTube header
setting if current header is YouTube (Minimal header)
This commit is contained in:
parent
29f4e06f75
commit
3a8e6760a3
@ -3,13 +3,16 @@ package app.revanced.patches.youtube.layout.header
|
|||||||
import app.revanced.patcher.data.ResourceContext
|
import app.revanced.patcher.data.ResourceContext
|
||||||
import app.revanced.patcher.patch.options.PatchOption.PatchExtensions.stringPatchOption
|
import app.revanced.patcher.patch.options.PatchOption.PatchExtensions.stringPatchOption
|
||||||
import app.revanced.patches.youtube.utils.compatibility.Constants
|
import app.revanced.patches.youtube.utils.compatibility.Constants
|
||||||
|
import app.revanced.patches.youtube.utils.integrations.Constants.PATCH_STATUS_CLASS_DESCRIPTOR
|
||||||
import app.revanced.patches.youtube.utils.settings.ResourceUtils
|
import app.revanced.patches.youtube.utils.settings.ResourceUtils
|
||||||
|
import app.revanced.patches.youtube.utils.settings.SettingsBytecodePatch
|
||||||
import app.revanced.util.ResourceGroup
|
import app.revanced.util.ResourceGroup
|
||||||
import app.revanced.util.Utils.trimIndentMultiline
|
import app.revanced.util.Utils.trimIndentMultiline
|
||||||
import app.revanced.util.copyFile
|
import app.revanced.util.copyFile
|
||||||
import app.revanced.util.copyResources
|
import app.revanced.util.copyResources
|
||||||
import app.revanced.util.patch.BaseResourcePatch
|
import app.revanced.util.patch.BaseResourcePatch
|
||||||
import app.revanced.util.underBarOrThrow
|
import app.revanced.util.underBarOrThrow
|
||||||
|
import app.revanced.util.updatePatchStatus
|
||||||
import java.io.File
|
import java.io.File
|
||||||
import java.nio.file.Files
|
import java.nio.file.Files
|
||||||
import kotlin.io.path.copyTo
|
import kotlin.io.path.copyTo
|
||||||
@ -136,6 +139,10 @@ object ChangeHeaderPatch : BaseResourcePatch(
|
|||||||
context.copyResources("youtube/branding/$customBrandingIconType/header", it)
|
context.copyResources("youtube/branding/$customBrandingIconType/header", it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (customBrandingIconType == "youtube_minimal_header") {
|
||||||
|
SettingsBytecodePatch.contexts.updatePatchStatus(PATCH_STATUS_CLASS_DESCRIPTOR, "MinimalHeader")
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
println(warnings)
|
println(warnings)
|
||||||
return
|
return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user