diff --git a/src/main/kotlin/app/revanced/patches/shared/patch/settings/AbstractSettingsResourcePatch.kt b/src/main/kotlin/app/revanced/patches/shared/patch/settings/AbstractSettingsResourcePatch.kt index 5e74bbec1..ac22e76a7 100644 --- a/src/main/kotlin/app/revanced/patches/shared/patch/settings/AbstractSettingsResourcePatch.kt +++ b/src/main/kotlin/app/revanced/patches/shared/patch/settings/AbstractSettingsResourcePatch.kt @@ -21,24 +21,24 @@ abstract class AbstractSettingsResourcePatch( private val isYouTube: Boolean, ) : ResourcePatch { override fun execute(context: ResourceContext): PatchResult { - /* - * used for self-restart - */ - context.xmlEditor["AndroidManifest.xml"].use { editor -> - editor.file.getElementsByTagName("manifest").item(0).also { - it.appendChild(it.ownerDocument.createElement("uses-permission").also { element -> - element.setAttribute("android:name", "android.permission.SCHEDULE_EXACT_ALARM") - }) - } - } - /* * Copy strings */ context.copyXmlNode(sourcehostDirectory, "values/strings.xml", "resources") /* initialize ReVanced Settings */ - if (isYouTube == true) { + if (isYouTube) { + /* + * used for self-restart + */ + context.xmlEditor["AndroidManifest.xml"].use { editor -> + editor.file.getElementsByTagName("manifest").item(0).also { + it.appendChild(it.ownerDocument.createElement("uses-permission").also { element -> + element.setAttribute("android:name", "android.permission.SCHEDULE_EXACT_ALARM") + }) + } + } + context.copyResources(sourceDirectory, ResourceUtils.ResourceGroup("xml", "revanced_prefs.xml")) }