fix(ManifestPatcher): rewrite package name in custom permissions
On some older devices this is necessary otherwise a permission conflict will occur and prevent the app from being installed.
This commit is contained in:
parent
9f3eed2aa7
commit
961cd93a6a
1 changed files with 13 additions and 4 deletions
|
|
@ -86,6 +86,18 @@ object ManifestPatcher {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
"permission" -> object : NodeVisitor(nv) {
|
||||||
|
override fun attr(ns: String?, name: String, resourceId: Int, type: Int, value: Any?) {
|
||||||
|
super.attr(
|
||||||
|
ns, name, resourceId, type,
|
||||||
|
when (name) {
|
||||||
|
"name" -> (value as String).replace("com.discord", packageName)
|
||||||
|
else -> value
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
"application" -> object : ReplaceAttrsVisitor(
|
"application" -> object : ReplaceAttrsVisitor(
|
||||||
nv,
|
nv,
|
||||||
mapOf(
|
mapOf(
|
||||||
|
|
@ -129,10 +141,7 @@ object ManifestPatcher {
|
||||||
"provider" -> object : NodeVisitor(visitor) {
|
"provider" -> object : NodeVisitor(visitor) {
|
||||||
override fun attr(ns: String?, name: String, resourceId: Int, type: Int, value: Any?) {
|
override fun attr(ns: String?, name: String, resourceId: Int, type: Int, value: Any?) {
|
||||||
super.attr(
|
super.attr(
|
||||||
ns,
|
ns, name, resourceId, type,
|
||||||
name,
|
|
||||||
resourceId,
|
|
||||||
type,
|
|
||||||
if (name == "authorities") {
|
if (name == "authorities") {
|
||||||
(value as String).replace("com.discord", packageName)
|
(value as String).replace("com.discord", packageName)
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue