Skip to content

Commit

Permalink
Proper use of param for multiuser + uid
Browse files Browse the repository at this point in the history
  • Loading branch information
ukanth committed Aug 14, 2023
1 parent d1aa4af commit 317205d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/src/main/java/dev/ukanth/ufirewall/Api.java
Original file line number Diff line number Diff line change
Expand Up @@ -1675,7 +1675,7 @@ private static boolean packagesExistForUserUid(HashMap<Integer,String> pkgs, int
public static HashMap<Integer, String> getPackagesForUser(List<Integer> userProfile) {
HashMap<Integer,String> 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<String> out = result.getOut();
Matcher matcher;
for (String item : out) {
Expand Down Expand Up @@ -2189,7 +2189,7 @@ public static boolean isPackageExists(PackageManager pm, String targetPackage) {
public static PackageInfo getPackageDetails(Context ctx, HashMap<Integer, String> 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;
Expand Down

0 comments on commit 317205d

Please sign in to comment.