Really simple to use privacy manager for Android 6 and later (successor of XPrivacy).
This is a maintained fork of XPrivacyLua by M66B, which is not supported anymore.
Revoking Android permissions from apps often let apps crash or malfunction. XPrivacyLua solves this by feeding apps fake data instead of real data.
- Simple to use
- Manage any user or system app
- Extensible
- Multi-user support
- Free and open source
- Determine activity (fake unknown activity, hide activity transitions, see here)
- Get applications (hide installed apps, launcher activities, broadcast receivers, widgets, usage statistics and events, keyboards and accessibility services of other apps, also for lookups by user, by user id, of activities, services and content providers, package contexts, launch intents and the shell command pm; the content providers, services, screens and broadcasts of hidden apps cannot be reached, so apps cannot ask each other for the account signed in)
- Get calendars (hide calendars)
- Get call log (hide call log)
- Get contacts (hide contacts, optionally except (non) starred contacts, hide blocked numbers)
- Get location (fake location, without the real altitude, speed and bearing, block NMEA messages and raw GNSS measurements)
- Get messages (hide MMS, SMS, SIM, voicemail)
- Get sensors (hide all available sensors)
- Read account name (fake name, mostly e-mail address)
- Read biometric sensors (no fingerprint sensor, face or iris unlock and no enrolled fingerprints; checks which include the screen lock stay)
- Read battery (level in steps of 10 percent, hide charge counter, current, energy, cycle count, voltage and temperature, battery saver appears off)
- Read clipboard (fake paste)
- Read debugging state (developer options and USB or wireless debugging appear off)
- Read memory and storage (total memory and storage rounded up to the sizes devices are sold with, free space rounded down to two digits)
- Read device settings (settings people change, like the window and transition animation scale, screen timeout, proxy, alarm sound and automatic time zone, have the values of a new device; not the font scale, the animator duration scale and whether accessibility is on, because the framework gives apps their real values anyway)
- Read identifiers (fake build serial number, Android ID, advertising ID, Privacy Sandbox ad ID, app set ID, GSF ID, limit ad tracking, random SD card ids on each start of the app, Wi-Fi, Bluetooth and network interface MAC addresses)
- Read notifications (fake status bar notifications)
- Read network data (hide cell info, also the cell of the service state, Wi-Fi networks, paired and connected Bluetooth devices, fake Wi-Fi network name, also in the text of Wi-Fi and network info, block Bluetooth scans, network service discovery (NsdManager) and Wi-Fi Direct and Wi-Fi Aware discovery)
- Read sync data (hide sync data)
- Read telephony data (fake IMEI, MEID, SIM serial number, phone number, voicemail number, type allocation code, etc)
- Read time zone (fake time zone, also the system property, setting value.timezone, default UTC)
- Read device features (hide all features but the ones listed in setting features.keep, also in the list of features and for the shell command pm; a name ending in * matches the features starting with it, like
android.hardware.camera*; WebView keeps its feature, it does not start without it; hide external input devices, like keyboards and game controllers) - Read VPN state (hide VPN transports, networks and interfaces)
- Record audio (prevent recording and speech recognition)
- Record video (prevent recording)
- Send messages (prevent sending MMS, SMS, data)
- Use analytics (Adjust, AppsFlyer, Facebook app events, Firebase Analytics, Firebase Crashlytics, Mixpanel, Segment)
- Use camera (fake camera not available, hide cameras)
- Use tracking (fake user agent for WebView only, Build properties including the security patch level, the same values for the system properties and the shell commands getprop, uname and /proc/version, network/SIM country/operator, device and Bluetooth name)
Use analytics and some hooks of other restrictions (the advertising ID of Google Play services and Huawei, the app set ID, activity recognition and geofences) hook libraries inside the target app, which will work only if the app was not obfuscated in a way that renamed these libraries. The other restrictions hook Android itself and will work always.
The Apps tab shows the apps by what needs attention: apps with a failed hook, user apps installed in the last week without restrictions (which can be restricted with one tap), apps restricted or restricting something in the last day, and all apps; tap a section to show or hide its apps.
Besides restricting apps, the tabs of the app offer:
- Light and dark theme, color themes and a pure black background for the dark theme (Settings)
- Fake values (Settings): values used for all apps, like the IMEI, Android ID, location and time zone; Fake values for this app on the screen of an app sets values for that app only
- Activity: which app triggered which restriction, when, with the real and the fake value, and hook errors, searchable by app or restriction; View log on the screen of an app shows the log of that app only
- Hooks: view, edit, enable, disable, add, import and export hook definitions, and install and remove definitions shared by others with Downloads
- Backup and restore of settings, custom hook definitions and restrictions (Settings)
The (no longer available) pro companion app is not needed anymore.
Hide or fake?
- Hide: return empty list
- Fake: return empty or fake value
It is possible to add custom restriction definitions, see this FAQ for details.
You can see all technical details here.
- Some apps will start the camera app to take pictures. This cannot be restricted and there is no need for this, because only you can take pictures in this scenario, not the app.
- Some apps will use OpenSL ES for Android to record audio, an example is WhatsApp. Xposed cannot hook into native code, so this cannot be prevented.
- The get applications restriction does not hide the app itself, apps sharing its user id and system apps (also updated ones) from lookups of single apps and from lists of components, like the activities for an intent, keyboards and accessibility services, because the Android code running in apps, like WebView, needs them. The lists of installed apps and packages and of running processes and services keep only the app itself and apps sharing its user id. The content providers, services, screens and broadcasts of hidden apps answer like the app is not installed, except for a content uri another app handed to the restricted app with a grant, like a shared photo, which it can still open.
- The network data restriction blocks discovery of devices in the local network through Android (network service discovery, Wi-Fi Direct and Wi-Fi Aware). Apps discovering devices with their own code over plain sockets, like with mDNS or SSDP, cannot be prevented from doing so.
- The telephony data restriction will result in apps seeing a fake IMEI. However, this doesn't change the IMEI address of your device.
XPrivacyLua is supported on Android 6.0 Marshmallow and later. For Android 4.0.3 Ice Cream Sandwich to Android 5.1.1 Lollipop you can use XPrivacy (unsupported though).
XPrivacyLua is supported for smartphones and tablets only.
- Install Magisk
- Android 6-7: download, install, and activate Xposed
- Android 8.1 and later: download, install, and activate LSPosed or a compatible fork
- Build XPrivacyLua from source (see Source code below), install, and activate it
XPrivacyLua uses the modern Xposed API (API 101 or later) when the framework provides it, and the legacy Xposed API otherwise, for example with Xposed or EdXposed.
LSPosed: the scope needs to include System Framework, which hosts the XPrivacyLua service in the settings provider, and any app you want to restrict, see here. With the legacy API, Settings Storage (com.android.providers.settings) needs to be in the scope too.
See here for a list of often asked questions.
XPrivacyLua with Island, etc is not supported.
Documentation
Contributions to this document and the frequently asked questions are prefered in the form of pull requests.
Translations
Translations are welcome as pull requests of app/src/main/res/values-xx/strings.xml (xx is the language code), translated from app/src/main/res/values/strings.xml.
Source code
Building XPrivacyLua from source code is straightforward with Android Studio or from the command line with JDK 17 or later and the Android SDK (platform 37):
./gradlew assembleDebug # debug build
./gradlew assembleRelease # release build, signed when keystore.properties exists
./gradlew testDebugUnitTest # validates the built-in hook definitions and Lua scripts
The release build is signed with the key described in keystore.properties (storeFile, storePassword, keyAlias, keyPassword). A build signed with another key than the official release needs to replace (uninstall) the official release.
It is expected that you can solve build problems yourself, so there is no support on building.
Source code contributions are prefered in the form of pull requests. Please open an issue first to tell what your plans are.
Please note that you agree to the license below by contributing, including the copyright.
XPrivacyLua uses:
- LuaJ. Copyright 2007-2013 LuaJ. All rights reserved. See license.
- Glide. Copyright 2014 Google, Inc. All rights reserved. See license.
- AndroidX. Copyright (C) 2011 The Android Open Source Project. See license.
- IBM Plex fonts. Copyright © 2017 IBM Corp. with Reserved Font Name "Plex". See license (SIL Open Font License 1.1).
- Material Symbols icons. Copyright Google LLC. See license (Apache License 2.0).
GNU General Public License version 3
Copyright (c) 2017-2021 Marcel Bokhorst. All rights reserved
XPrivacyLua 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.
XPrivacyLua 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 XPrivacyLua. If not, see https://www.gnu.org/licenses/.
Android is a trademark of Google Inc. Google Play is a trademark of Google Inc