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:
rushiiMachine 2025-05-31 10:23:00 -07:00
parent 9f3eed2aa7
commit 961cd93a6a
No known key found for this signature in database
GPG key ID: DCBE5952BB3B6420

View file

@ -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(
nv,
mapOf(
@ -129,10 +141,7 @@ object ManifestPatcher {
"provider" -> object : NodeVisitor(visitor) {
override fun attr(ns: String?, name: String, resourceId: Int, type: Int, value: Any?) {
super.attr(
ns,
name,
resourceId,
type,
ns, name, resourceId, type,
if (name == "authorities") {
(value as String).replace("com.discord", packageName)
} else {