• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[APP][XPOSED][6.0+] XPrivacyLua - Android privacy manager

Search This thread
Aug 26, 2021
15
0
I've tried both ru.andr7e.deviceinfohw and com.redphx.deviceid and neither of them displays my MAC address.
I've attached screenshots of which hooks were used.
In your screenshot, the hooks are blocking everything except the MAC address. You can make sure the MAC address is visible under "NET" in Device Info HW. Just don't forget to turn on WiFi before you do that. Yes, you have the network name, local ip and ip v6 addresses hidden, by the way, so do I, but not the MAC hidden.

If I'm wrong, could you attach a screenshot from the "NET" section where the MAC address field will be empty or there will be a fake MAC?
 

Fif_

Senior Member
Jun 5, 2013
1,107
1,139
Google Nexus 10
Google Nexus 4
As in my testing its will give classnotfound exp in logs are you sure its working for you?
That's odd because both the stock hook and my version use "Optional", so it shouldn't error out at all.
Care to share that log?
In your screenshot, the hooks are blocking everything except the MAC address. You can make sure the MAC address is visible under "NET" in Device Info HW. Just don't forget to turn on WiFi before you do that. Yes, you have the network name, local ip and ip v6 addresses hidden, by the way, so do I, but not the MAC hidden.

If I'm wrong, could you attach a screenshot from the "NET" section where the MAC address field will be empty or there will be a fake MAC?
I don't see a MAC address field in the "Net" tab. At least on Android 11.
Screenshot_20210910-181346.png
 

Fif_

Senior Member
Jun 5, 2013
1,107
1,139
Google Nexus 10
Google Nexus 4
  • Like
Reactions: TiTiB
Aug 26, 2021
15
0
Edit: unsurprisingly, it's NetworkInterface.getHardwareAddress, available in the repo.
Yes, I have that hook installed too. It blocks MAC, but not in all applications. For example it blocks in vtechnotm.com.deviceid, but it does not work for Device Info HW... Please tell me, do you have the "random MAC address when connecting to WiFi" option enabled in the developer settings?
 

Fif_

Senior Member
Jun 5, 2013
1,107
1,139
Google Nexus 10
Google Nexus 4
Yes, I have that hook installed too. It blocks MAC, but not in all applications. For example it blocks in vtechnotm.com.deviceid, but it does not work for Device Info HW... Please tell me, do you have the "random MAC address when connecting to WiFi" option enabled in the developer settings?
It works for me, sorry I cannot help any further. The MAC address did show up in Device Info HW when I disabled the NetworkInterface.getHardwareAddress hook.
I did not have random MAC address on the network I was using during the test.
 
Aug 26, 2021
15
0
It works for me, sorry I cannot help any further. The MAC address did show up in Device Info HW when I disabled the NetworkInterface.getHardwareAddress hook.
I did not have random MAC address on the network I was using during the test.
Okay... In general, the system dynamic MAC more or less helps. Surprisingly, you even have the WiFi encryption standard hidden.
You asked about ADid, I can tell you that applications still see it. The gservices version is 21.30.16. I hope this information will be useful to you.
 

Fif_

Senior Member
Jun 5, 2013
1,107
1,139
Google Nexus 10
Google Nexus 4
You asked about ADid, I can tell you that applications still see it. The gservices version is 21.30.16. I hope this information will be useful to you.
Yeah, I can see the problem now.
It seems to depend on which SDK revision the app targets. With old SDKs, the existing hooks work. With apps targeting newer SDKs, the hooks cannot find the com.google.android.gms.ads.identifier.AdvertisingIdClient class. Probably some tricky delayed loading of GMS.
Sadly, again, nothing much can be done here.

Well I have a bash script that I automatically run everyday to reset the advertising id. It needs to be ran as root obviously. I've attached it.
Edit: you'll need bash and probably busybox (may run with the system toybox, but I haven't tested that).
 

Attachments

  • reset-google-advertising-id.zip
    882 bytes · Views: 23
Aug 26, 2021
15
0
No, it does the same thing. But it can be automated.
Okay. Very good.

By the way, I have a couple of questions about MAC.
1) Can I somehow determine myself which request Device Info HW uses to get MAC and block it myself?
2) In your screenshot, even the WiFi encryption method is hidden (e.g. 802.11ac). What hook hides it?
3) Is there any way to try your whole set of hooks? I might be doing something wrong. Is there any way to make a backup of your privacy set so I can restore it to myself? At least in theory?

Sorry for the nerdiness, I can't accept this as fact and want to get to the bottom of this issue.
 

AndroidX

Senior Member
Sep 28, 2016
136
63
Xposed Modules
Yeah, I can see the problem now.
It seems to depend on which SDK revision the app targets. With old SDKs, the existing hooks work. With apps targeting newer SDKs, the hooks cannot find the com.google.android.gms.ads.identifier.AdvertisingIdClient class. Probably some tricky delayed loading of GMS.
Sadly, again, nothing much can be done here.

Well I have a bash script that I automatically run everyday to reset the advertising id. It needs to be ran as root obviously. I've attached it.
Edit: you'll need bash and probably busybox (may run with the system toybox, but I haven't tested that).
Thats what i was saying its give classnotfoundexpecation maybe coz of abstract method or maybe it could be possible if gms classes obsfucate thats why hooked can't find classes you can check it yourself by go in xposed logs
 

Fif_

Senior Member
Jun 5, 2013
1,107
1,139
Google Nexus 10
Google Nexus 4
Is there any way to try your whole set of hooks? I might be doing something wrong. Is there any way to make a backup of your privacy set so I can restore it to myself? At least in theory?
I use all the stock hooks, everything in the Fif collection in the repo except:
  • PowerManager.*Wakelock* (2 hooks, fixes a hardware problem),
  • FingerprintManager.isHardwareDetected (hides fingerprint reader),
  • PowerManager.isPowerSaveMode (pretends power save is never engaged),
  • the two *PlayGames* hooks (these have stopped working).
On top of stock hooks and the Fif hooks, add from the repo:
  • BluetoothAdapter.getName from A200K,
  • NetworkInterface.getHardwareAddress from M66B,
  • NetworkInfo.createFromParcel from M66B,
  • FlurryAgent.* (several hooks) from M66B.
Thats what i was saying its give classnotfoundexpecation maybe coz of abstract method or maybe it could be possible if gms classes obsfucate thats why hooked can't find classes you can check it yourself by go in xposed logs
I tried to hook the constructor of the Info inner class and the enclosing class, and they were both not found.
Probably lazy loading of GMS Ad libraries, I don't think they can get away with changing the class names. The odd thing is that the existing repo hook works on some apps, but not others. I suspect target SDK, but not confirmed.
 

sm1996

New member
Mar 27, 2020
2
0
Hey... First of all thanks to developer for this amazing module. I am using it to pass Safetynet in my custom rom. It works perfectly, however there is one issue. I am unable to backup anything on google. In below screenshot you can see it says 'unknown device' on backup screen.

I only ticked 'use tracking'for Google Play Services in XPrivacyLua,as it helps me passing safetynet. Any fix for this issue?
Screenshot_20210904-223507_Google_Play_services.png
Screenshot_20210904-223638627.jpg
Screenshot_20210904-223652_LSPosed.png
 

TiTiB

Senior Member
Jun 19, 2015
890
666
Earth, for now
I sure am glad I 'watch' this thread.

Reading the recent exchanges about MAC addresses caused me to relook at my setup, and Wow was it inadequate! For whatever reason (probably something to do with having trouble with one particular app some time in the past), I had 'let my guard' down, so to speak. It had been so long since I worked with XPL that I had to refamiliarize myself with how to do stuff.

So, thanks to all who are participating and keeping this Very Important tool alive, especially @Fif_, who, I just discovered, is still creating new hooks for the repository.

I also want to thank @Fif_ for the clear and complete explanations and instructions for those hooks; I've learned a *lot* about how to use XPL/PRO from the work @Fif_ has shared with the community. And, of course, thanks to @M66B for creating XPL.
 

Fif_

Senior Member
Jun 5, 2013
1,107
1,139
Google Nexus 10
Google Nexus 4
Hey... First of all thanks to developer for this amazing module. I am using it to pass Safetynet in my custom rom. It works perfectly, however there is one issue. I am unable to backup anything on google. In below screenshot you can see it says 'unknown device' on backup screen.

I only ticked 'use tracking'for Google Play Services in XPrivacyLua,as it helps me passing safetynet. Any fix for this issue?
It's a side effect of using XPL to pass SafetyNet. XPL fakes the device name to "Unknown" or "Private". That makes the device pass SafetyNet, but breaks other parts of Play Services, like backups.
You may have a better chance with Universal SafetyNet Fix 2.1.0: https://forum.xda-developers.com/t/magisk-module-universal-safetynet-fix-1-1-0.4217823/
You should still use XPL anyways, but not for passing SN. 😜
 
  • Like
Reactions: TiTiB

Fif_

Senior Member
Jun 5, 2013
1,107
1,139
Google Nexus 10
Google Nexus 4
@Fif_ it seems the AdvertisingIdClient$Info.getId hook gets obsolete now, since you can delete your advertising id and get it replaced by a string of zeros, like @M66B's original hook did.

Indeed, deleting your advertising id on Android 12 will be equivalent to having M66B's version of the hook active (returning all zeroes).
The hooks are still useful on Android 11 and earlier.
I tend to prefer my version because I like to mess with advertisers. 😜
 

christantoan

Senior Member
Oct 9, 2015
213
92
OnePlus 3T
OnePlus 7 Pro
Hi,

I need help with restricting location access for this app as it requires location access all the time to be used. I've tried restricting access to this app and Google Play Service (GPS) as I thought it maybe gets location from GPS however it still doesn't work.

I'm using:
OnePlus 7 Pro running OxygenOS 11.0.2.1.GM21BA
Magisk 23.0 (23000) (21)
LSPosed v1.5.3 (5984)


I'm an idiot. Sorry for the alarm.
I forgot to check the app on LSPosed app because I thought it will be automatically enabled there as XPL is listed in the Module repository.

Thank you!
 
Last edited:

heinhuiz

Senior Member
Nov 26, 2011
861
365
Your XPrivacyLua SQLite database looks corrupted.
  1. Uninstall XPrivacyLua (Pro can stay)
  2. Reboot
  3. With a root file manager, navigate to /data/system.
  4. Remove the directory named xlua. Or rename it to xlua.backup.
  5. Reinstall XPrivacyLua.
  6. Activate the module in LSP/EdXposed/Xposed manager.
  7. Reboot.
  8. Restore from backup if needed.
This should take care of it.
I had a similar problem with XPL 'suddenly' not working anymore, but for me the solution was to reinstall EdXposed. It probably occurred after installing and uninstalling an outdated module in EdXposed. Strange thing was that the other modules seemed to work flawlessly, which made it hard to find the cause.

Of course I first tried the above method, and I'm glad I took your advice to rename the xlua directory instead of deleting it, because that saved me from losing all the settings in the app after reinstalling it again.
 
Last edited:
  • Like
Reactions: TiTiB and Fif_

Top Liked Posts

  • There are no posts matching your filters.
  • 8
    Using XPrivacyLua for things other than privacy protection was never and is not supported. Discussions about anything else than privacy is not allowed here and can jeopardize the project. I am not waiting for a notice and take down request, are you?
    6
    Moderator Announcement

    On request of the threadowner @M66B posts edited respectively deleted in order to stay on topic in the thread. Please remember, XprivacyLua is meant to protect or enhance your privacy but not to cheat anybody.

    Regards
    Oswald Boelcke
    Senior Moderator
    2
    Just confirming one more time as I'm still unclear what "being restricted" means. In EdXPosed (or LSPosed, I assume), for the XPrivacyLua module, should I:
    1. Enable Activation Scope and
    2. Enable only
      1. "Android System" android
      2. "Settings Storage" com.android.providers.settings
    Confirmation (and maybe a clarification in the docs / FAQ?) would be a great help. Thanks for your help!
    Restricting in XPL linguo means having any red or gray ticked categories showing in XPL for an app. Restricted means that XPL is active for a given app.
    If you use LSP (or EdXposed in whitelist mode), you also must add any app that is restricted in XPL to XPL's scope (LSPosed) or to the whitelist (EdXposed).
    In addition, you must also have Settings Storage and System Framework in the XPL scope (LSPosed) or in the whitelist (EdXposed). This is required for basic XPL functionality. These two apps are automatically added to the XPL scope if you use LSPosed.
    2
    Just to confirm: by "in whitelist mode", do you mean what the EdXposed Manager's UI calls "Activation Scope Enabled for XPrivacyLua Module"?
    Sorry, I can't find that setting in EdXposed manager 4.6.2...
    I only want to restrict a few apps, so that whitelist approach sounds fine. For others reading this thread though, is there anything wrong with leaving EdXposed with the default "Activation Scope Disabled" which I guess means XPrivacyLua gets every app in its scope (at some memory or CPU penalty?)
    Ideally you'd want to have XPL active for every app in Xposed (whether it is LSPosed, EdXposed or rovo89's original Xposed).
    Then you can control which app is covered by XPL's privacy protection in the XPL app directly. If the app is unrestricted (white checkbox for all categories), then XPL will not hook that app, and it will proceed as if XPL wasn't there (except for a very short piece of code that's ran once at the app start-up).
    This is how things work with the original rovo89 Xposed, or with EdXposed in blacklist mode.
    I'm not familiar with what scopes mean in the context of EdXposed, I've only used whitelist and blacklist modes. I've been using LSPosed recently despite the annoyance that I must add newly installed apps to a few Xposed modules that I want to apply to every (user) app, amongst which is XPL.
    That was what confused me about the instructions saying "make sure that Android system ... are being restricted" since I assumed it was referring to the XPL user interface not EdXposed. Thank goodness for XPL's red warning saying "Don't restrict Android System or you might bootloop"
    You are right that is is confusing. For XPL to work, it needs to be able to hook into both System Framework and Settings Storage. That's why these two apps are in the recommended XPL scope in LSPosed. The XPL author recommends against restricting the Android System in XPL as it could cause bootloops and other serious issues.
    2
    I'm trying to use an app... then install it again and block the app from detecting I previously installed it.

    I understand XPrivacyLua will feed the app fake device identifiers. But is it possible to refresh/change the fake device identifiers?
    If you purchased the Pro features, yes. {snip}

    {Mod edited on request of threadowner to make the post on-topic - Oswald Boelcke, Moderator}
  • 304
    XPrivacyLua

    banner_play_store.png


    Really simple to use privacy manager for Android 6.0 Marshmallow and later (successor of XPrivacy).

    Revoking Android permissions from apps often let apps crash or malfunction. XPrivacyLua solves this by feeding apps fake data instead of real data.

    Features:

    • Simple to use
    • Manage any user or system app
    • Extensible
    • Multi-user support
    • Free and open source

    See here for all details, including installation instructions and download link.

    Please read the frequently asked questions before asking a question.

    This XDA thread is about using the latest version of XPrivacyLua. Off topic comments are allowed as long they are related to XPrivacyLua and are in the general interest of the followers of this thread, but anything not related to privacy is not allowed.

    If XPrivacyLua doesn't work and/or when "module not running or updated" is shown, this is almost always caused by an Xposed problem.

    Discussions about purchases are not allowed here, please contact me via here instead.

    XPrivacyLua is being maintained and supported, but new features won't be added anymore.

    Custom hook definitions will always be part of XPrivacyLua, but there will be community support only. This means that I won't respond to questions about defining custom hooks anymore. See this thread for the reasons.

    If you value your privacy, please consider to support this project with a donation or by purchasing pro features.

    XPrivacyLua is not a permission manager, but a privacy manager. XPrivacyLua doesn't block things and doesn't revoke permissions, but does replace real data by fake data. This means you can grant Android permissions to an app and still let XPrivacyLua prevent the app from seeing privacy sensitive data. Revoking permissions can result in an app refusing to work and/or to crash. However, replacing real by fake data generally doesn't let an app crash.

    Currently restrictions are quite crude because they mostly replace real data by no data. For example restricting the contacts app from getting contacts will result in an empty contact list. In the near future it might be made possible to select the data an app may see, for example just one group of contacts.

    About feature requests and bug reports:

    The goal is to have a tool that can properly protect the privacy of many in the near future. However, it isn't paid work, so I do whatever I like whenever I like it.

    You can request features in this XDA forum. I will read them, but I will not respond to them and they might or might not be implemented. If I know for sure something will not be implemented, I will let you know.

    You can report any problem you have here. There will be no issue tracker on GitHub.

    For now I have decided to not implement restrictions that are useful to prevent tracking only. There are simply too many data items that can be used for tracking and it would take too much time to develop restrictions for all these data items.

    The basic idea is to restrict only things that 'define' you, so which contacts you have, where you are, which apps you use, etc.

    Maybe we can widen the definition of things that the core of XPL covers to "What defines you, and what can be used to spie on you"? This would include camera/audio, but not tracking.

    XPrivacyLua is pretty feature complete and will be maintained and supported and when there is a need new hook definitions will be added to better protect your privacy. For the rest this FAQ applies:

    https://github.com/M66B/XPrivacyLua/blob/master/FAQ.md#FAQ4

    As said before, development will also depend on Xposed development, which is just minimal unfortunately.

    XDA thanks and donations are appreciated.

    XPrivacyLua is supported with Xposed only. There is no support for VirtualXposed and TaiChi.


    XDA:DevDB Information
    XPrivacyLua, Xposed for all devices (see above for details)

    Contributors
    M66B
    Source Code: https://github.com/M66B/XPrivacyLua

    Xposed Package Name: eu.faircode.xlua

    Version Information
    Status:
    Beta

    Created 2018-01-05
    Last Updated 2020-03-10
    68
    I have just released beta version 0.5 in the Xposed repository.

    The XPrivacyLua framework and user interface seems to be stable enough to call this a beta release.

    Besides several bug fixes and improvements two new restrictions were added:
    • Read account name, which mostly holds your e-mail address and will be replace by '[email protected]' when restricted
    • Read clipboard, which will be replaced by the text 'Private' when restricted

    Furthermore the ability to restrict Android system (be careful!) and to restrict system apps was added. It is possible to restrict all of these individually (XPrivacy could not do that).

    Be sure to take a look at the help page in the app again (use the ?-icon), since there were some useful hints added.

    If you appreciate what I am building here, please let me know by means of an XDA thanks and/or a donation, so that I don't get the feeling 'What am I doing this for?'.
    59
    I have just released alpha version 0.12 in the Xposed repository.

    This version has been redesigned for Android Oreo compatibility. The user interface and the restrictions work properly for me, but be aware that a lot has been changed on the inside ("it is bigger on the inside", lol), also for earlier Android versions. There is one thing I know of that needs improving and that is that the user interface might be updated too often with a lot of restrictions, which might cause delays and hangs. I will look into this tomorrow.

    This change was necessary, but it was a lot of work, so XDA thanks and donations are appreciated.
    56
    I have just released beta version 0.25 in the Xposed repository.

    Changelog:

    With this release XPrivacyLua restriction's can be compared with XPrivacy's. There are now over 100 restriction definitions!

    XDA thanks and donations are appreciated.
    53
    @CHEF-KOCH You have been given enough time to respond here. Now I just think it is pretty cowardly to write critical about XPrivacyLua, but not to tell what can actually be improved, especially because you were invited to do so.

    I still like to hear how XPrivacyLua can be improved, but I don't want to hear what is wrong with XPrivacyLua. You'll need to keep the scope of XPrivacyLua in mind (in short: privacy, not security), see the opening post and previous discussions about this for more information.

    Also, if you really know better, I like to see an original work from your hands to prove that. Actions speak louder than words.

    As it is now, you are discouraging one of the few people in the world who really did something substantial to improve privacy on Android. And don't go talking about VPNs, TOR, etc because your private information, like your contacts, will still leak.

    I also think you are pretty ungrateful for what I did so far.

    To others: if you see someone reference one of his blogs, please reference this comment in response.

    Edit: if you agree with this, please add an XDA thanks to this comment, so it will show up in the right column as a reference for others.