Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Issue #4] Bug in the implementation of Api.GetApps() leading to users with id 0 getting ignored. #1339

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/src/main/java/dev/ukanth/ufirewall/Api.java
Original file line number Diff line number Diff line change
Expand Up @@ -1422,7 +1422,7 @@ public static List<PackageInfoData> getApps(Context ctx, GetAppList appList) {
Matcher m = p.matcher(user.toString());
if (m.find() && m.groupCount() > 0) {
int id = Integer.parseInt(m.group(1));
if (id > 0) {
if (id >= 0) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uid 0 is root . That's handled separately. We don't need to add it here.

Copy link
Author

@amaa-99 amaa-99 Jul 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got the issue that at least in one of my (rooted) dev devices (I believe the one running LineageOS 18.1 (i.e. Android 11)) the only user reported at that point is the one with id 0...
If the user with id 0 is intended to be handled elsewhere, then probably the problem lies there.
Could you point me in that direction?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p.s. I've dropped the other commits (there are individual pulls for each of those).

Copy link
Owner

@ukanth ukanth Aug 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the affected devices the listOfUids will always be empty, and therefore the packagesForUser list will empty too:

            if(G.supportDual()) {
                packagesForUser  = getPackagesForUser(listOfUids);
            }

listOfUids.add(id);
}
}
Expand Down