Skip to content

josephv7/XPrivacy

Repository files navigation

XPrivacy

The ultimate, yet easy to use, privacy manager for Android

Index

Description

XPrivacy can prevent applications (including associated background services and content providers) from leaking privacy sensitive data. XPrivacy can restrict the categories of data an application can access. This is done by feeding an application with no or fake data. There are several data categories which can be restricted, for example contacts or location. For example, if you restrict access to contacts for an application, this will result in sending an empty contact list to the application if it requests access to your contacts. Similarly, restricting an application's access to your location will result in a random location being sent to the application.

XPrivacy doesn't revoke (i.e. block) permissions from an application, which means that most applications will continue to work as before and won't force close. There are two exceptions to this, access to the internet and to external storage (typically an SD card) is restricted by denying access (revoking permissions). There is no other way to realize this, since these permissions are handled by Android in a special way. Android delegates handling of these permission to the underlying Linux network/file system.

If restricting a category of data for an application results in problems for that application, it is possible to allow access to the data category again.

By default, all newly-installed applications will have no access to any data category at all, to prevent a new application from leaking sensitive data after installation. Shortly after installing a new application, XPrivacy will ask which data categories you want the new application to have access to. XPrivacy comes with a category browser, which allows you to quickly enable or disable applications' access to a particular data category (i.e. to view and control all access to the camera, for example).

To help you identify potential data leaks, XPrivacy will monitor attempts made by all applications to access sensitive data. XPrivacy will highlight (with a yellow triangle) a data category for an application (or an application name in the category browser) as soon as data of the data category has been used. XPrivacy will also display if an application has internet access, indicating that the application poses a risk of sharing the data it obtains with an external server. If an application has requested Android permissions to access data in a data category, it will also be displayed (with a green tick), but this will only be shown when looking at an individual application, since checking permissions for all applications is quite slow.

XPrivacy is built using the Xposed framework. XPrivacy taps into a number of selected functions of Android through the Xposed framework. Depending on the function, XPrivacy conditionally skips execution of the original function (for example when an application tries to set a proximity alert) or alters the result of the original function (for example to return empty calendar data).

XPrivacy has been tested with CyanogenMod 10 and 10.1 (Android 4.1 and 4.2), and will likely work with any Android version 4.1 or 4.2 variant, including stock ROMs. Root access is needed to install the Xposed framework. Because of a bug in the Xposed framework, XPrivacy currently needs a fixed Xposed binary, which is provided as download for both Android version 4.1 and 4.2.

Realizing XPrivacy was a lot of work, so please support this project

Donate a few dollars for the pro version or

Flattr

Using XPrivacy is entirely at your own risk

Xposed Applications Application Help Settings

Features

  • Simple to use
  • No need to patch anything (no source, no smali or anything else)
  • For any (stock) variant of Android version 4.1 or 4.2 (JellyBean)
  • Newly installed applications are restricted by default
  • Displays data actually used by an application
  • Open source

Restricted data

  • Accounts (including auth token)
  • APN data
  • Application data (list of installed apps)
  • Browser (bookmarks, search history)
  • Calendar
  • Contacts
  • Identification (Android ID, serial number)
  • Location (coarse/fine, cell location/info)
  • Messages (SMS/MMS, including ICC SMS stored on SIM)
  • Network (IPs, MACs, BSSID, SSID)
  • Phone (call log, own/in/outgoing/voicemail number, phone/subscriber ID, SIM info, ISIM, IMPI, IMPU, MSISDN, network info)
  • Recording audio (including microphone)
  • Taking photos
  • Recording video
  • Voicemail untested

Restricted actions

  • Calling untested
  • Sending SMS
  • Sending MMS untested
  • Opening links in the browser
  • Internet (revoke permission: no usage data)
  • External storage (SD card) (revoke permission: no usage data)

Limitations

  • Android can be restricted, but there will be no usage data available (orange triangles)

Installation

  1. Requirement: Android 4.1+ (JellyBean), check with System Settings > About phone > Android version
  2. Root your device, the procedure varies depending on the brand and model of your device
  3. Make a backup
  4. Enabled System settings > Security > Unknown sources
  5. Install the Xposed framework, including the disabler (MIUI is not supported by Xposed)
  6. Install XPrivacy from here
  7. Enable XPrivacy from the Xposed installer
  8. Reboot into recovery
  9. Flash the Xposed fix for your Android version from here
  10. Reboot

I do not recommend using XPrivacy in combination with any of the similar solutions, because it will most probably result in conflicts (with as possible consequence data leakage).

Upgrading

  • Install the new version (replacing the previous version)
  • Reboot your device

Usage

  • Start XPrivacy
  • Select an application
  • Set data restrictions

To see it in action: try restricting the category Identification for Android Id Info or try restriction the category Contacts for the Contacts application (the Contacts application will continue to show a spinner, which is actually a bug in the Contacts application).

Applying some restrictions requires restarting applications and/or your device

If an application requested Android permissions for a data category, the category will be marked with a green check mark icon. If an application used/tried to use data, the data category will be marked with an orange triangle icon. These icons are just a guideline, because an application can access privacy sensitive data without Android permissions, for example the serial number of your device and because is not possible to monitor data usage in each and every situation, for example not for access to the internet or the external storage.

Enabling internet or storage restriction means blocking access to the internet or to the external storage (typically the SD card). This may result in error messages and even in forced closes of the application.

Tricks:

  • Click the application icon in the data category browser to go to the application restriction settings
  • Click the orange triangle to see the actual Android functions that were used by the application

Using XPrivacy is entirely at your own risk

Permissions

XPrivacy asks for the following Android permissions:

  • Internet: to check for updates (only manual from the menu)
  • Storage: to export settings to the SD card (only pro version)

If you don't like this, you can always restrict XPrivacy itself ...

Frequently asked questions

(1) Will XPrivacy make my device slower?

Maybe a little bit, but it will probably not be noticeable.

(2) Does XPrivacy use a lot of memory or battery?

Almost nothing.

(3) Can you help me with rooting my device?

There are already enough guides to help you to root your device. Use your favorite search engine to find one.

(4) Do I really need to install the Xposed fix?

If you like to have all data restricted, yes. The current Xposed version cannot hook all functions with the same name having different parameters, like requestLocationUpdates of LocationManager.

(5) How can I reset all XPrivacy settings?

Manage apps > XPrivacy > Clear data

(6) Can I backup XPrivacy and settings?

Yes, you can, for example with Titanium backup, but you can only restore onto the same device. Exporting/importing settings will work across devices. To export/import settings you will need the pro version.

(7) What is expert mode?

In expert mode you can block applications from starting at device boot time (except content providers) and you will be able to restrict system applications, including Android itself. Be careful!

(8) Will you block the iptables command or force online state?

Maybe in a later stage.

(9) Will you make it possible to enter fake data?

Maybe in a later stage. For now I like to keep things as simple as possible for maximum stability. Since version 0.21 you can enter a fake location.

(10) Which functions are exactly restricted?

Many, see here for all details.

(11) What did you fix in the Xposed framework?

See here.

(12) How safe is XPrivacy?

Great care is taken to develop XPrivacy, nevertheless data could leak, although nobody has reported any data leak so far.

(13) Why is XPrivacy not in the Play store?

Google will probably remove XPrivacy from the Play store eventually, since it will be able to block advertisements (for example by revoking internet permissions).

(14) I get 'No context for ...' !

A check of XPrivacy failed, resulting in potential data leakage. Please report the exact message in the XDA thread, stating the device and ROM you are using.

(15) Do I need to install Xposed/the fix again when I install an update of my ROM? Yes, mostly you have to. XPrivacy will warn you when Xposed isn't installed, the wrong version of Xposed is installed or when the XPrivacy is not enabled in Xposed.

Support

If you encounter any bug or data leakage please report an issue, preferably including a logcat (use pastebin or a similar service).

If you have a feature request, please create an issue, but check if there doesn´t already exist a similar request.

If you have any question, you can leave a message in the XDA XPrivacy forum thread.

Changelog

Version 0.23 (in development)

  • Location range check
  • Other location input method
  • Simplified user interface
  • Added Hebrew translation

Version 0.22

  • Renamed category Actions to Calling again
  • Moved opening links to new category View
  • Export/import settings, like expert, location (pro version only)

Version 0.21

  • Settings for latitude/longitude (Christmas Island is at latitude -10.5, longitude 105.667)
  • Undo existing restrictions for apps when importing restrictions (only for apps with exported settings)

Version 0.20

  • Consider XPrivacy as system app (for expert mode)
  • Fixed category browser (bug, fix)
  • Notify when new application installed (feature request)
  • Notify when new system application is installed in expert mode (default allow)

Version 0.19

  • More environment checks when starting
  • More privacy (fallback procedure when low memory)

Version 0.18

  • Basic check for updates (manually)
  • Link to pro version
  • Renamed category Calling to Actions and moved opening browsers links into this category

Version 0.17

  • User interface improvements
  • Display system apps in expert mode only
  • Restrict opening links (issue)
  • Restrict serial number (system/build properties)
  • Export/import (issue) (pro version only)

Version 0.16

  • Removed XPrivacy from Manage apps
  • Added application list to XPrivacy

Version 0.15

  • Restrict Android (expert mode)
  • Restrict Google Service Framework (see also limitations)
  • Restrict Wi-Fi BSSID, IP and SSID
  • Restrict network info
  • No default deny for updated apps

Version 0.14

  • Restrict calling (untested)
  • Restrict sending SMS
  • Restrict sending MMS (untested)
  • Fix setting restrictions in the app list

Version 0.13

  • Internet restriction (revoke permission)
  • Remove restrictions/audit trail when uninstalling an app
  • Custom write permission for privacy provider
  • Restriction caching (Play store installed app browse should be fast again)

Version 0.12

  • Android version check
  • Check if XPrivacy is enabled
  • Async app list fetch
  • Several user interface improvements
  • Expert mode: prevent app start
  • Added Dutch/Flemish translation
  • Added Bulgarian translation, thanks borislavba
  • Added German translation, thanks NosferatuAlucard
  • Added Greek translation, thanks mikeNG
  • Added Slovenian translation, thanks kv1dr

Similar solutions

The PDroid family provides fake or no data, more or less in the same way as XPrivacy does. A difference is that you need to patch Android and that there is (therefore) only limited stock ROM support. The PDroid family is open source.

LBE Privacy Guard revokes permissions, which will make some applications unusable. LBE Privacy Guard also features malware protecting and data traffic control. Some consider the closed source code of Chinese origin as a problem.

The members of the PDroid family and XPrivacy hardly use memory, but LBE Privacy Guard does.

The CyanogenMod Incognito Mode seems not to be fine grained and provides only privacy for personal data, if the associated content provider chooses to do so.

Contributing

Translations:

Restrict new data:

  • Find the package/class/method that exposes the data (look into the Android documentation/sources)
  • Figure out a way to get a context (see existing code for examples)
  • Create a class that extends XHook
  • Hook the method in XPrivacy
  • Write a before and/or after method to restrict the data
  • Do a pull request if you want to contribute

License

GNU General Public License version 3

Copyright (c) 2013 Marcel Bokhorst (M66B)

This file is part of XPrivacy.

XPrivacy is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

XPrivacy is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with XPrivacy. If not, see http://www.gnu.org/licenses/.

Packages

No packages published

Languages

  • Java 96.8%
  • PHP 3.2%