mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-05-28 12:50:19 +02:00
remove deprecated permission
This commit is contained in:
parent
8a23742991
commit
7d4d34a206
@ -4,7 +4,6 @@ import app.revanced.patcher.data.ResourceContext
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.ResourcePatch
|
||||
import app.revanced.util.resources.ResourceHelper
|
||||
import app.revanced.util.resources.ResourceUtils
|
||||
import app.revanced.util.resources.ResourceUtils.copyResources
|
||||
import app.revanced.util.resources.ResourceUtils.copyXmlNode
|
||||
@ -13,34 +12,22 @@ import app.revanced.util.resources.ResourceUtils.copyXmlNode
|
||||
* Abstract settings resource patch
|
||||
*
|
||||
* @param sourceDirectory Source directory to copy the preference template from
|
||||
* @param sourcehostDirectory Source directory to copy the preference template from
|
||||
* @param sourceHostDirectory Source directory to copy the preference template from
|
||||
*/
|
||||
abstract class AbstractSettingsResourcePatch(
|
||||
private val sourceDirectory: String,
|
||||
private val sourcehostDirectory: String,
|
||||
private val sourceHostDirectory: String,
|
||||
private val isYouTube: Boolean,
|
||||
) : ResourcePatch {
|
||||
override fun execute(context: ResourceContext): PatchResult {
|
||||
/*
|
||||
* Copy strings
|
||||
*/
|
||||
context.copyXmlNode(sourcehostDirectory, "values/strings.xml", "resources")
|
||||
context.copyXmlNode(sourceHostDirectory, "values/strings.xml", "resources")
|
||||
|
||||
/* initialize ReVanced Settings */
|
||||
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")
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
if (isYouTube)
|
||||
context.copyResources(sourceDirectory, ResourceUtils.ResourceGroup("xml", "revanced_prefs.xml"))
|
||||
}
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user