diff --git a/CHANGELOG.md b/CHANGELOG.md index 44129137f..1fbfebe1f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ Test and beta releases will have experimental functions enabled by default. **Next release** +* Restrict access to Gmail information ([issue](https://github.com/M66B/XPrivacy/issues/1080)) * Updated Lithuanian translation * Updated Polish translation diff --git a/src/biz/bokhorst/xprivacy/Meta.java b/src/biz/bokhorst/xprivacy/Meta.java index b09bcb21d..7e88e9e93 100644 --- a/src/biz/bokhorst/xprivacy/Meta.java +++ b/src/biz/bokhorst/xprivacy/Meta.java @@ -41,6 +41,7 @@ public static List get() { listHook.add(new Hook("contacts", "contacts/profile", false, false, "READ_CONTACTS", 10, null, null)); listHook.add(new Hook("dictionary", "UserDictionary", false, false, "READ_USER_DICTIONARY", 10, null, null)); listHook.add(new Hook("email", "EMailProvider", false, false, "com.android.email.permission.ACCESS_PROVIDER", 10, null, null)); + listHook.add(new Hook("email", "GMailProvider", false, false, "com.google.android.gm.permission.READ_CONTENT_PROVIDER", 8, "1.99.20", null)); listHook.add(new Hook("identification", "%hostname", false, false, "", 10, null, null)); listHook.add(new Hook("identification", "%imei", false, false, "", 10, null, null)); listHook.add(new Hook("identification", "%macaddr", false, false, "", 10, null, null)); diff --git a/src/biz/bokhorst/xprivacy/Requirements.java b/src/biz/bokhorst/xprivacy/Requirements.java index 3c60eab6c..f06a8da15 100644 --- a/src/biz/bokhorst/xprivacy/Requirements.java +++ b/src/biz/bokhorst/xprivacy/Requirements.java @@ -16,6 +16,7 @@ import android.content.Intent; import android.content.pm.ApplicationInfo; import android.content.pm.PackageInfo; +import android.content.pm.PackageManager.NameNotFoundException; import android.net.Uri; import android.net.wifi.WifiInfo; import android.os.Build; @@ -143,8 +144,7 @@ public void onClick(DialogInterface dialog, int which) { AlertDialog alertDialog = alertDialogBuilder.create(); alertDialog.show(); - } catch (Throwable ex) { - Util.bug(null, ex); + } catch (NameNotFoundException ex) { } // Check activity thread diff --git a/src/biz/bokhorst/xprivacy/XContentProvider.java b/src/biz/bokhorst/xprivacy/XContentProvider.java index 0f55c00e6..f0b451087 100644 --- a/src/biz/bokhorst/xprivacy/XContentProvider.java +++ b/src/biz/bokhorst/xprivacy/XContentProvider.java @@ -40,6 +40,7 @@ public String getClassName() { // public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder, CancellationSignal cancellationSignal) // frameworks/base/core/java/android/content/ContentProvider.java // http://developer.android.com/reference/android/content/ContentProvider.html + // https://developers.google.com/gmail/android/ // packages/apps/Browser/src/com/android/browser/provider/BrowserProvider2.java // packages/providers/CalendarProvider/src/com/android/providers/calendar/CalendarProvider2.java @@ -107,6 +108,13 @@ else if (packageName.equals("com.android.email")) listHook.add(new XContentProvider(PrivacyManager.cEMail, "EMailProvider", "com.android.email.provider.EmailProvider")); + // Gmail provider + else if (packageName.equals("com.google.android.gm")) { + Util.log(null, Log.WARN, "Hooking Gmail"); + listHook.add(new XContentProvider(PrivacyManager.cEMail, "GMailProvider", + "com.google.android.gm.provider.PublicContentProvider")); + } + // Google services provider else if (packageName.equals("com.google.android.gsf")) listHook.add(new XContentProvider(PrivacyManager.cIdentification, "GservicesProvider",