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

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

Search This thread

magedkathom

Member
Apr 16, 2011
48
0
hi there...
can I make a costumed return list to be a fack result for xprivacylua hook PakageManager.getPackagInfoAsUser
sorry for my bad English.
 
Last edited:

Fif_

Senior Member
Jun 5, 2013
1,164
1,252
Google Nexus 10
Google Nexus 4
hi there...
can I make a costumed return list to be a fack result for xprivacylua hook PakageManager.getPackagInfoAsUser
sorry for my bad English.
Yes you can certainly return a custom, fake list of apps for PackageManager.getInstalledPackages. You'll also want to hook PackageManager.getInstalledApplications.
PackageManager.getPackageInfoAsUser doesn't return a list.
 

magedkathom

Member
Apr 16, 2011
48
0
Yes you can certainly return a custom, fake list of apps for PackageManager.getInstalledPackages. You'll also want to hook PackageManager.getInstalledApplications.
PackageManager.getPackageInfoAsUser doesn't return a list.
thanks for your reply...
could you please tell me how to do that.
I am just a newbie
 

nIMa_aZx

Member
Dec 15, 2012
39
8
Tehran
Yes you can certainly return a custom, fake list of apps for PackageManager.getInstalledPackages. You'll also want to hook PackageManager.getInstalledApplications.
PackageManager.getPackageInfoAsUser doesn't return a list.
thanks.
two weeks ago I could fix it. I edited default hooks code that are related to installed app in XprivacyPro in privacy package.
interesting part is that I did not need using "getInstalledApplications" in hook list and my codes. As the developer (Marcel Bokhorst) did not use.

now I have another weird problem in "tracking hooks".
I'm sure the code is ok , because I wrote two these of hooks "Board - Model" and replace it to Privacy collection and worked. If it is needed I upload my JSON code.

All of these hooks have same template.

Code:
-- This file is part of XPrivacyLua.

-- 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 <http://www.gnu.org/licenses/>.

-- Copyright 2017-2019 Marcel Bokhorst (M66B)

function after(hook, param)
    local result = param:getResult()
    local name = hook:getName()
    local filtered = false
    
    if result == nil then
        return false
    end

    local fake = ''
    if name == 'Build.BOARD' then
        filtered=true
        fake='msm8960'
    elseif name == 'Build.BRAND' then
        filtered=true
        fake='xiaomi'
    elseif name== 'Build.DEVICE' then
        filtered=true
        fake='ken'
    elseif name == 'Build.PRODUCT' then
        filtered=true
        fake='hav_mido'
    elseif name== 'Build.BOOTLOADER' then
        filtered=true
        fake='unknown'
    elseif name== 'Build.ID' or 'Build.DISPLAY' then
        filtered=true
        fake='MRRM'
    elseif name== 'Build.FINGERPRINT' then
        filtered=true
        fake='Xiaomi/kenzo/kenzo:40.1/MMB29MK/V3.8.1.1.MHUCNDL:user/release-keys'
    elseif name== 'Build.ID' then
        filtered=true
        fake='PZQ1.110204.231'
    elseif name=='Build.MODEL' then
        filtered=true
        fake='Redmi Note 3'
    elseif name=='Build.PRODUCT' then
        filtered=true
        fake='mido'
    elseif name=='Build.DEBUG' then
        filtered=true
        fake='user'
    elseif name== 'Build.USER' then
        filtered=true
        fake='zeelog'
    elseif name== 'Build.TIME' then
        filtered=true
        fake='1698066734736'
    elseif name == 'WifiInfo.getSSID' then
        filtered=true
        fake='Irancell_Portable_4G'
    elseif name == 'WifiInfo.getBSSID' then
        filtered=true
        fake='99:c2:3e:48:31:ec'
    elseif name == 'Networkinterface.getHardwareAddress' then
        filtered=true
        fake='56:43:14:e4:38:7a'
    elseif name == 'Build.Hardware' then
        filtered=true
        fake='ken'
    end
  
        if filtered==true then
        param:setResult(fake)
        return true, result, fake
        end
end



I am so happy to join this grate job
by the way is there any documentation may help me to do that

You need understanding programming concepts at first . the language of programing is LUA.
Source : https://www.lua.org/pil/contents.html
then read them :

for writing custom hook:

for importing your customized script , you need pro version of Xprivacy.
in my opinion it is a bit harder to code LUA for hooking purpose without programming background.

Edited: I forgot to tell you , for better understanding codes , you can review default written code in pro version in "privacy" collection and see what happens in hooking.
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 14
    Marcel, we certainly look into each report - and if required we do the necessary. And it's not only me but many others like @andybones @Logix @Macusercom @mrjuniork @TNSMANI; I just can't name them all.

    Very personal remark: As a long time user of your fantastic applications I'd be extremely sorry to see if this projects ends. But it's certainly your and ony your call.
    I know there are many moderators, but it is mostly you moderating this thread, at least it seems like that.

    I have no plans to end the project at this moment. Although there are not many people using XPrivacyLua, it is still useful for the ones using it.
    10
    Please don't close this thread because the majority of post are privacy related, and if it is closed it would make it much, much more difficult to discuss appropriate matters of this very helpful app.
    You are right of course, and the thread won't be closed.
    6
    If you are concerned about this, feel free to report questionable comments yourself. A moderator, like @Oswald Boelcke will look into it and will probably do the necessary things.
    Marcel, we certainly look into each report - and if required we do the necessary. And it's not only me but many others like @andybones @Logix @Macusercom @mrjuniork @TNSMANI; I just can't name them all.

    Very personal remark: As a long time user of your fantastic applications I'd be extremely sorry to see if this projects ends. But it's certainly your and ony your call.
    6
    Yes you can certainly return a custom, fake list of apps for PackageManager.getInstalledPackages. You'll also want to hook PackageManager.getInstalledApplications.
    PackageManager.getPackageInfoAsUser doesn't return a list.
    thanks.
    two weeks ago I could fix it. I edited default hooks code that are related to installed app in XprivacyPro in privacy package.
    interesting part is that I did not need using "getInstalledApplications" in hook list and my codes. As the developer (Marcel Bokhorst) did not use.

    now I have another weird problem in "tracking hooks".
    I'm sure the code is ok , because I wrote two these of hooks "Board - Model" and replace it to Privacy collection and worked. If it is needed I upload my JSON code.

    All of these hooks have same template.

    Code:
    -- This file is part of XPrivacyLua.
    
    -- 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 <http://www.gnu.org/licenses/>.
    
    -- Copyright 2017-2019 Marcel Bokhorst (M66B)
    
    function after(hook, param)
        local result = param:getResult()
        local name = hook:getName()
        local filtered = false
        
        if result == nil then
            return false
        end
    
        local fake = ''
        if name == 'Build.BOARD' then
            filtered=true
            fake='msm8960'
        elseif name == 'Build.BRAND' then
            filtered=true
            fake='xiaomi'
        elseif name== 'Build.DEVICE' then
            filtered=true
            fake='ken'
        elseif name == 'Build.PRODUCT' then
            filtered=true
            fake='hav_mido'
        elseif name== 'Build.BOOTLOADER' then
            filtered=true
            fake='unknown'
        elseif name== 'Build.ID' or 'Build.DISPLAY' then
            filtered=true
            fake='MRRM'
        elseif name== 'Build.FINGERPRINT' then
            filtered=true
            fake='Xiaomi/kenzo/kenzo:40.1/MMB29MK/V3.8.1.1.MHUCNDL:user/release-keys'
        elseif name== 'Build.ID' then
            filtered=true
            fake='PZQ1.110204.231'
        elseif name=='Build.MODEL' then
            filtered=true
            fake='Redmi Note 3'
        elseif name=='Build.PRODUCT' then
            filtered=true
            fake='mido'
        elseif name=='Build.DEBUG' then
            filtered=true
            fake='user'
        elseif name== 'Build.USER' then
            filtered=true
            fake='zeelog'
        elseif name== 'Build.TIME' then
            filtered=true
            fake='1698066734736'
        elseif name == 'WifiInfo.getSSID' then
            filtered=true
            fake='Irancell_Portable_4G'
        elseif name == 'WifiInfo.getBSSID' then
            filtered=true
            fake='99:c2:3e:48:31:ec'
        elseif name == 'Networkinterface.getHardwareAddress' then
            filtered=true
            fake='56:43:14:e4:38:7a'
        elseif name == 'Build.Hardware' then
            filtered=true
            fake='ken'
        end
      
            if filtered==true then
            param:setResult(fake)
            return true, result, fake
            end
    end



    I am so happy to join this grate job
    by the way is there any documentation may help me to do that

    You need understanding programming concepts at first . the language of programing is LUA.
    Source : https://www.lua.org/pil/contents.html
    then read them :

    for writing custom hook:

    for importing your customized script , you need pro version of Xprivacy.
    in my opinion it is a bit harder to code LUA for hooking purpose without programming background.

    Edited: I forgot to tell you , for better understanding codes , you can review default written code in pro version in "privacy" collection and see what happens in hooking.
    5
    This is a resource, no maybe not.
    You can control this setting with GravityBox.

    I'd be less terse, but this is likely to be considered off-topic, and subject to deletion, so I don't see the point of wasting my time giving a more detailed answer.
    Discussions like this are allowed @Fif_ as long as it is not about hacking, cracking, cheating games, or anything else that can result in a notice and takedown request.
  • 305
    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.