Skip to content

Commit

Permalink
Fix UsersAndGroupsSearchProvider causing SecurityException on non-van…
Browse files Browse the repository at this point in the history
…illa builds

Signed-off-by: ZetaTom <[email protected]>
  • Loading branch information
ZetaTom committed Feb 28, 2024
1 parent 3b3b2fd commit 538ed53
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ public class UsersAndGroupsSearchProvider extends ContentProvider {

public static final String CONTENT = "content";

private String AUTHORITY;
private String DATA_USER;
private String DATA_GROUP;
private String DATA_ROOM;
Expand All @@ -128,7 +129,7 @@ public static ShareType getShareType(String authority) {
}

private static void setActionShareWith(@NonNull Context context) {
ACTION_SHARE_WITH = context.getResources().getString(R.string.users_and_groups_share_with);
ACTION_SHARE_WITH = context.getString(R.string.users_and_groups_share_with);
}

@Nullable
Expand All @@ -146,7 +147,7 @@ public boolean onCreate() {
return false;
}

String AUTHORITY = getContext().getResources().getString(R.string.users_and_groups_search_authority);
AUTHORITY = getContext().getString(R.string.users_and_groups_search_authority);
setActionShareWith(getContext());
DATA_USER = AUTHORITY + ".data.user";
DATA_GROUP = AUTHORITY + ".data.group";
Expand Down Expand Up @@ -311,9 +312,7 @@ private Cursor searchForUsersOrGroups(Uri uri) {
displayName = userName;
subline = (status.getMessage() == null || status.getMessage().isEmpty()) ? null :
status.getMessage();
Uri.Builder builder =
Uri.parse("content://com.nextcloud.android.providers.UsersAndGroupsSearchProvider/icon")
.buildUpon();
Uri.Builder builder = Uri.parse("content://" + AUTHORITY + "/icon").buildUpon();

builder.appendQueryParameter("shareWith", shareWith);
builder.appendQueryParameter("displayName", displayName);
Expand Down

0 comments on commit 538ed53

Please sign in to comment.