diff --git a/app/src/main/java/dev/ukanth/ufirewall/Api.java b/app/src/main/java/dev/ukanth/ufirewall/Api.java index 5a1e92fe..ddc15bbd 100644 --- a/app/src/main/java/dev/ukanth/ufirewall/Api.java +++ b/app/src/main/java/dev/ukanth/ufirewall/Api.java @@ -1675,7 +1675,7 @@ private static boolean packagesExistForUserUid(HashMap pkgs, int public static HashMap getPackagesForUser(List userProfile) { HashMap listApps = new HashMap<>(); for(Integer integer: userProfile) { - Shell.Result result = Shell.cmd("pm list packages -u --user " + integer).exec(); + Shell.Result result = Shell.cmd("pm list packages -U --user " + integer).exec(); List out = result.getOut(); Matcher matcher; for (String item : out) { @@ -2189,7 +2189,7 @@ public static boolean isPackageExists(PackageManager pm, String targetPackage) { public static PackageInfo getPackageDetails(Context ctx, HashMap listMaps, int uid) { try { final PackageManager pm = ctx.getPackageManager(); - if (listMaps.containsKey(uid)) { + if (listMaps != null && listMaps.containsKey(uid)) { return pm.getPackageInfo(listMaps.get(uid), PackageManager.GET_META_DATA); } else { return null;