diff --git a/CHANGELOG.md b/CHANGELOG.md index 006184072..746e7fe8e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ Changelog * Fixed function name overlapping information icon * Clear all data will also clear local caches * Show parameters in usage data +* Added restriction for deprecated *contacts/people* [Open issues](https://github.com/M66B/XPrivacy/issues?state=open) diff --git a/src/biz/bokhorst/xprivacy/Meta.java b/src/biz/bokhorst/xprivacy/Meta.java index f63b5df00..54cf8da0d 100644 --- a/src/biz/bokhorst/xprivacy/Meta.java +++ b/src/biz/bokhorst/xprivacy/Meta.java @@ -52,6 +52,7 @@ public static List get() { mListHook.add(new Hook("contacts", "contacts/contacts", "READ_CONTACTS,WRITE_CONTACTS", 1, null, null)); mListHook.add(new Hook("contacts", "contacts/data", "READ_CONTACTS,WRITE_CONTACTS", 1, null, null)); + mListHook.add(new Hook("contacts", "contacts/people", "READ_CONTACTS,WRITE_CONTACTS", 1, "1.99.46", null)); mListHook.add(new Hook("contacts", "contacts/phone_lookup", "READ_CONTACTS,WRITE_CONTACTS", 1, null, null)); mListHook.add(new Hook("contacts", "contacts/profile", "READ_PROFILE,WRITE_PROFILE", 1, "1.99.38", null).dangerous()); mListHook.add(new Hook("contacts", "contacts/raw_contacts", "READ_CONTACTS,WRITE_CONTACTS", 1, null, null)); diff --git a/src/biz/bokhorst/xprivacy/XContentResolver.java b/src/biz/bokhorst/xprivacy/XContentResolver.java index cb29f1258..602138ee4 100644 --- a/src/biz/bokhorst/xprivacy/XContentResolver.java +++ b/src/biz/bokhorst/xprivacy/XContentResolver.java @@ -48,6 +48,7 @@ public String getClassName() { // http://developer.android.com/reference/android/content/ContentResolver.html // http://developer.android.com/reference/android/content/ContentProviderClient.html + // http://developer.android.com/reference/android/provider/Contacts.People.html // http://developer.android.com/reference/android/provider/ContactsContract.Contacts.html // http://developer.android.com/reference/android/provider/ContactsContract.Data.html // http://developer.android.com/reference/android/provider/ContactsContract.PhoneLookup.html @@ -113,6 +114,7 @@ private void handleUriBefore(MethodHookParam param) throws Throwable { if (param.args.length > 1 && param.args[0] instanceof Uri) { String uri = ((Uri) param.args[0]).toString().toLowerCase(); String[] projection = (param.args[1] instanceof String[] ? (String[]) param.args[1] : null); + Util.log(this, Log.INFO, "Before uri=" + uri); if (uri.startsWith("content://com.android.contacts/contacts") || uri.startsWith("content://com.android.contacts/data") @@ -147,6 +149,7 @@ private void handleUriAfter(MethodHookParam param) throws Throwable { if (param.args.length > 1 && param.args[0] instanceof Uri && param.getResult() != null) { String uri = ((Uri) param.args[0]).toString().toLowerCase(); Cursor cursor = (Cursor) param.getResult(); + Util.log(this, Log.INFO, "After uri=" + uri); if (uri.startsWith("content://applications")) { // Applications provider: allow selected applications @@ -238,6 +241,11 @@ else if (uri.startsWith("content://call_log")) { methodName = "CallLogProvider"; } + else if (uri.startsWith("content://contacts/people")) { + restrictionName = PrivacyManager.cContacts; + methodName = "contacts/people"; + } + else if (uri.startsWith("content://com.android.contacts/profile")) { restrictionName = PrivacyManager.cContacts; methodName = "contacts/profile";