fix: only add QUERY_ALL_PACKAGES permission when useManager is true (#195)

This commit is contained in:
Js0n 2023-05-10 22:50:51 +08:00 committed by GitHub
parent e4657377b5
commit 3acc9086b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -331,7 +331,8 @@ public class LSPatch {
property.addApplicationAttribute(new AttributeItem("appComponentFactory", PROXY_APP_COMPONENT_FACTORY));
property.addMetaData(new ModificationProperty.MetaData("lspatch", metadata));
// TODO: replace query_all with queries -> manager
property.addUsesPermission("android.permission.QUERY_ALL_PACKAGES");
if (useManager)
property.addUsesPermission("android.permission.QUERY_ALL_PACKAGES");
var os = new ByteArrayOutputStream();
(new ManifestEditor(is, os, property)).processManifest();