Skip to content

Commit

Permalink
fix: add missing permission to reboot app (ReVanced#260)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheJeterLP authored Jul 31, 2022
1 parent 86f50a4 commit 6ced6df
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import app.revanced.patches.youtube.misc.settings.annotations.SettingsCompatibil
import app.revanced.util.resources.ResourceUtils
import app.revanced.util.resources.ResourceUtils.copyResources
import app.revanced.util.resources.ResourceUtils.copyXmlNode
import org.w3c.dom.Element

@Name("settings-resource-patch")
@SettingsCompatibility
Expand Down Expand Up @@ -55,6 +56,17 @@ class SettingsResourcePatch : ResourcePatch() {
data.copyResources("settings", resourceGroup)
}

data.xmlEditor["AndroidManifest.xml"].use {
val manifestNode = it
.file
.getElementsByTagName("manifest")
.item(0) as Element

val element = it.file.createElement("uses-permission")
element.setAttribute("android:name", "android.permission.SCHEDULE_EXACT_ALARM")
manifestNode.appendChild(element)
}

return PatchResultSuccess()
}
}

0 comments on commit 6ced6df

Please sign in to comment.