Skip to content

Commit

Permalink
pff: permission spoofing - calendar (Instances) - cleanup
Browse files Browse the repository at this point in the history
Change-Id: I43ce5b07b5e5aca5f12c9f5986d5df45884b9e2b
  • Loading branch information
guhl committed Feb 2, 2014
1 parent dbaa56d commit 6bdd866
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions core/java/android/content/ContentProvider.java
Expand Up @@ -219,7 +219,6 @@ public Cursor query(String callingPkg, Uri uri, String[] projection,
if (res == PERMISSION_SPOOFED){
if (pff_dbg_level>=1) {Log.d(PFF_LOG_TAG, "query: permission "+componentPerm+" spoofed!");}
if (pff_dbg_level>=2) {Log.d(PFF_LOG_TAG, "query: uri was: "+uri);}
Uri.Builder builder = uri.buildUpon();
String limit = uri.getQueryParameter("limit");
String authority = uri.getAuthority();
if (pff_dbg_level>=3) {Log.d(PFF_LOG_TAG, "query: uri, path="+path+
Expand All @@ -231,13 +230,13 @@ public Cursor query(String callingPkg, Uri uri, String[] projection,
if (authority.equals(CalendarContract.AUTHORITY)){
if (pff_dbg_level>=3) {Log.d(PFF_LOG_TAG, "query: authority.equals(CalendarContract.AUTHORITY)");}
if (path.contains("/instances")){
builder = CalendarContract.Instances.CONTENT_URI.buildUpon();
Uri.Builder builder = CalendarContract.Instances.CONTENT_URI.buildUpon();
int JD = Time.getJulianMondayFromWeeksSinceEpoch(1);
ContentUris.appendId(builder, JD);
ContentUris.appendId(builder, JD);
uri=builder.build();
} else {
builder = uri.buildUpon();
Uri.Builder builder = uri.buildUpon();
if (limit!=null){
builder.clearQuery();
if (pff_dbg_level>=3) {Log.d(PFF_LOG_TAG, "query: builder.clearQuery() -> builder.build()="+builder.build());}
Expand All @@ -246,9 +245,9 @@ public Cursor query(String callingPkg, Uri uri, String[] projection,
uri=builder.build();
}
}
if (pff_dbg_level>=2) {Log.d(PFF_LOG_TAG, "query: uri is: "+uri);}
}
}
}
if (pff_dbg_level>=2) {Log.d(PFF_LOG_TAG, "query: uri is: "+uri);}
}
}

Cursor cur = ContentProvider.this.query(uri, projection, selection, selectionArgs, sortOrder,
Expand Down

0 comments on commit 6bdd866

Please sign in to comment.