Skip to content
This repository has been archived by the owner on Sep 6, 2019. It is now read-only.

Commit

Permalink
Added restriction Srv_getCurrentSyncsAsUser
Browse files Browse the repository at this point in the history
Refs #1757
  • Loading branch information
M66B committed Dec 15, 2014
1 parent 16f84e1 commit 157b4cb
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Changelog
* Added restrictions *IpPrefix.getAddress* and *IpPrefix.getRawAddress* ([issue](/../../issues/1757))
* Added restrictions for [LinkProperties](http://developer.android.com/reference/android/net/LinkProperties.html)
* Added restrictions *InetAddress.getAllByNameOnNet* and *InetAddress.getByNameOnNet* ([issue](/../../issues/1757))
* Added restriction *Srv_getCurrentSyncsAsUser* ([issue](/../../issues/1757))

[Open issues](https://github.com/M66B/XPrivacy/issues?state=open)

Expand Down
1 change: 1 addition & 0 deletions res/values/functions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<string name="accounts_Srv_getAccountsForPackage" translatable="false"><![CDATA[<a href="https://developer.android.com/reference/android/accounts/AccountManager.html#getAccountsByTypeForPackage(java.lang.String,%20java.lang.String)">Google documentation</a>]]></string>
<string name="accounts_Srv_getSharedAccountsAsUser" translatable="false"><![CDATA[<a href="https://developer.android.com/reference/android/accounts/AccountManager.html#getAccounts()">Google documentation</a>]]></string>
<string name="accounts_Srv_getCurrentSyncs" translatable="false"><![CDATA[<a href="https://developer.android.com/reference/android/content/ContentResolver.html#getCurrentSyncs()">Google documentation</a>]]></string>
<string name="accounts_Srv_getCurrentSyncsAsUser" translatable="false"><![CDATA[<a href="https://developer.android.com/reference/android/content/ContentResolver.html#getCurrentSyncs()">Google documentation</a>]]></string>

<!-- browser -->
<string name="browser_BrowserProvider2" translatable="false"><![CDATA[Will restrict access to the browser bookmarks and browser history]]></string>
Expand Down
1 change: 1 addition & 0 deletions src/biz/bokhorst/xprivacy/Meta.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ public static List<Hook> get() {
mListHook.add(new Hook("accounts", "Srv_getAccountsForPackage", "GET_ACCOUNTS", 19, "3.5.6", null).AOSP(19));
mListHook.add(new Hook("accounts", "Srv_getSharedAccountsAsUser", "GET_ACCOUNTS", 19, "2.99", null).AOSP(19));
mListHook.add(new Hook("accounts", "Srv_getCurrentSyncs", "READ_SYNC_SETTINGS", 19, "2.99", "getCurrentSyncs").AOSP(19));
mListHook.add(new Hook("accounts", "Srv_getCurrentSyncsAsUser", "READ_SYNC_SETTINGS", 21, "3.5.6", null).AOSP(21));

mListHook.add(new Hook("browser", "BrowserProvider2", "com.android.browser.permission.READ_HISTORY_BOOKMARKS,GLOBAL_SEARCH", 1, null, null));
mListHook.add(new Hook("browser", "Downloads", "ACCESS_DOWNLOAD_MANAGER,ACCESS_DOWNLOAD_MANAGER_ADVANCED,ACCESS_ALL_DOWNLOADS", 1, "1.99.43", null).dangerous());
Expand Down
7 changes: 6 additions & 1 deletion src/biz/bokhorst/xprivacy/XContentResolver.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ public String getClassName() {
// public void registerContentObserver(android.net.Uri uri, boolean notifyForDescendants, android.database.IContentObserver observer, int userHandle)
// public void unregisterContentObserver(android.database.IContentObserver observer)
// http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/4.2.2_r1/android/content/ContentService.java
// public List<android.content.SyncInfo> getCurrentSyncsAsUser(int userId)
// http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/5.0.0_r1/android/content/IContentService.java

// public Bundle call(String method, String request, Bundle args)
// http://developer.android.com/reference/android/provider/Settings.html
Expand All @@ -103,7 +105,7 @@ private enum Methods {
getCurrentSync, getCurrentSyncs, getSyncAdapterTypes,
openAssetFile, openFile, openAssetFileDescriptor, openFileDescriptor, openInputStream, openOutputStream, openTypedAssetFileDescriptor,
query, Srv_call, Srv_query,
Srv_getCurrentSyncs
Srv_getCurrentSyncs, Srv_getCurrentSyncsAsUser
};
// @formatter:on

Expand Down Expand Up @@ -189,6 +191,7 @@ public static List<XHook> getInstances(String className) {
listHook.add(new XContentResolver(Methods.Srv_query, null, "com.android.internal.telephony.IccProvider"));

listHook.add(new XContentResolver(Methods.Srv_getCurrentSyncs, PrivacyManager.cAccounts, null));
listHook.add(new XContentResolver(Methods.Srv_getCurrentSyncsAsUser, PrivacyManager.cAccounts, null));
} else {
if ("com.android.providers.settings.SettingsProvider".equals(className))
listHook.add(new XContentResolver(Methods.Srv_call, null, className));
Expand Down Expand Up @@ -224,6 +227,7 @@ protected void before(XParam param) throws Throwable {
break;

case Srv_getCurrentSyncs:
case Srv_getCurrentSyncsAsUser:
// Do nothing
break;
}
Expand Down Expand Up @@ -271,6 +275,7 @@ protected void after(XParam param) throws Throwable {
break;

case Srv_getCurrentSyncs:
case Srv_getCurrentSyncsAsUser:
if (param.getResult() != null)
if (isRestricted(param)) {
int uid = Binder.getCallingUid();
Expand Down

0 comments on commit 157b4cb

Please sign in to comment.