FORUMS

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

20,962 posts
Thanks Meter: 43,993
 
By M66B, Recognized Developer on 5th January 2018, 04:32 PM
Post Reply Email Thread
19th February 2020, 02:27 PM |#5051  
Member
Thanks Meter: 3
 
More
Quote:
Originally Posted by Fif_

Try the new repo hooks for ProcessBuilder.start and Runtime.exec* (Fif variants).
That loophole is now closed.

Thanks for your work!
I used two different apps to test it. Tasker can't get imei using shell command now. But Terminal Emulator can still get that without root. Both of them are restricted with "Use shell" in XPL. Should I worry about it?
The Following User Says Thank You to John Chu For This Useful Post: [ View ] Gift John Chu Ad-Free
19th February 2020, 04:06 PM |#5052  
Member
Thanks Meter: 12
 
More
When opening the Hulu app (even before signing in), I get a notification: Error in Fif.BlockGuardOs.Open.

I have never encountered an error in the Fif.BlockGuardOs.Open module with any other app.

I have encountered and ignored this error for at least a year or so on three different Android versions on two different phones.

OnePlus 7 Pro
Android 10
Magisk 20.3
EdXposed Framework v0.4.6.1 (4504)-tdgptedc (YAHFA)
XPrivacyLua 1.27
Fif.BlockGuardOs.open v10

Code:
Fif.BlockGuardOs.open

Exception:
org.luaj.vm2.LuaError: script:25 vm error: java.lang.NegativeArraySizeException: -1
at org.luaj.vm2.LuaClosure.execute(SourceFile:157)
at org.luaj.vm2.LuaClosure.onInvoke(SourceFile:4)

... (removed most of stack trace) 

at org.luaj.vm2.LuaClosure.execute(SourceFile:144)
... 24 more


Package:
com.hulu.plus:10180

Method:
before public java.io.FileDescriptor libcore.io.BlockGuardOs.open(java.lang.String,int,int) throws android.system.ErrnoException

Arguments:
0: /data/user/0/com.hulu.plus/files/.Fabric/com.crashlytics.sdk.android.crashlytics-core/log-files/crashlytics-userlog-5E4D56F500D1-0001-3DB6-C79B05B1F39C.temp (java.lang.String)
1: 66 (java.lang.Integer)
2: 384 (java.lang.Integer)

Return:
null
The Following User Says Thank You to sdz2 For This Useful Post: [ View ] Gift sdz2 Ad-Free
20th February 2020, 07:17 AM |#5053  
Senior Member
Thanks Meter: 950
 
More
Quote:
Originally Posted by John Chu

Thanks for your work!
I used two different apps to test it. Tasker can't get imei using shell command now. But Terminal Emulator can still get that without root. Both of them are restricted with "Use shell" in XPL. Should I worry about it?

Not too much. Terminal Emulator launches the shell via compiled code which is out of reach of Xposed.
That's a well-known limitation.

Quote:
Originally Posted by sdz2

When opening the Hulu app (even before signing in), I get a notification: Error in Fif.BlockGuardOs.Open.

I have never encountered an error in the Fif.BlockGuardOs.Open module with any other app.

I have encountered and ignored this error for at least a year or so on three different Android versions on two different phones.

From a cursory look, the Hulu app is doing funky things. @M66B, XPL dies on the third line of this code:
Code:
function before(hook, param)
        local context = param:getApplicationContext()
        local ai = context:getApplicationInfo()
with an invalid index (-1) exception.
There no reason why this would fail, with such an error.

I'm afraid you can consider that Hulu is incompatible with the Fif.File.mkdir/mkdirs and Fif.BlockGuardOs.open, the paths whitelist cannot be easily computed without ApplicationInfo.
The Following User Says Thank You to Fif_ For This Useful Post: [ View ] Gift Fif_ Ad-Free
20th February 2020, 07:14 PM |#5054  
M66B's Avatar
OP Recognized Developer
Thanks Meter: 43,993
 
More
Quote:
Originally Posted by Fif_

From a cursory look, the Hulu app is doing funky things. @M66B, XPL dies on the third line of this code:

Code:
function before(hook, param)
        local context = param:getApplicationContext()
        local ai = context:getApplicationInfo()
with an invalid index (-1) exception.
There no reason why this would fail, with such an error.

It could be that context is null ...
20th February 2020, 07:32 PM |#5055  
Senior Member
Thanks Meter: 950
 
More
Quote:
Originally Posted by M66B

From a cursory look, the Hulu app is doing funky things. @M66B, XPL dies on the third line of this code:

It could be that context is null ...

I checked for that, it's not the case, context has lua type userdata (as expected) and is not nil/null.
But calling context:getApplicationData throws this exception.
On that topic, are there any ways to catch a java exception with Lua? It does not seem possible, and any java exception thrown from java functions called within a hook will cause the hook to fail.
20th February 2020, 07:41 PM |#5056  
M66B's Avatar
OP Recognized Developer
Thanks Meter: 43,993
 
More
Quote:
Originally Posted by Fif_

I checked for that, it's not the case, context has lua type userdata (as expected) and is not nil/null.
But calling context:getApplicationData throws this exception.
On that topic, are there any ways to catch a java exception with Lua? It does not seem possible, and any java exception thrown from java functions called within a hook will cause the hook to fail.

Maybe getApplicationInfo throws an exception?
Else this might be caused by another Lua peculiarity.

It is not possible to catch exceptions with Lua.
20th February 2020, 08:51 PM |#5057  
Senior Member
Thanks Meter: 950
 
More
Quote:
Originally Posted by M66B

Maybe getApplicationInfo throws an exception?
Else this might be caused by another Lua peculiarity.

It is not possible to catch exceptions with Lua.

Yes, getApplicationInfo throws a NegativeArraySizeException. No idea why, except if maybe the app overrides that method, confusing lua.

So, the LuaJ interpreter in XPL doesn't support pcall()?
https://www.lua.org/pil/8.4.html
20th February 2020, 10:02 PM |#5058  
M66B's Avatar
OP Recognized Developer
Thanks Meter: 43,993
 
More
Quote:
Originally Posted by Fif_

Yes, getApplicationInfo throws a NegativeArraySizeException. No idea why, except if maybe the app overrides that method, confusing lua.

So, the LuaJ interpreter in XPL doesn't support pcall()?
https://www.lua.org/pil/8.4.html

I am not sure if LuaJ supports pcall. It looks like it does, but I have never tried it.
The Following 3 Users Say Thank You to M66B For This Useful Post: [ View ]
21st February 2020, 05:39 AM |#5059  
Senior Member
Thanks Meter: 950
 
More
Quote:
Originally Posted by M66B

I am not sure if LuaJ supports pcall. It looks like it does, but I have never tried it.

LuaJ does support pcall(), but it won't catch Java exceptions. Would you consider a patch to add that functionality?
Anyhow, it wouldn't help with Hulu misbehaving, I've tried to access ApplicationInfo through other ways (context:getPackageManager():getApplicationInfo(co ntext:getPackageName(), 0)) and PackageManager:getApplicationInfo() throws the exact same error. @sdz2, I won't bother any further, sorry. I'll take a patch for BlockGuardOS.open if you figure it out. :-/
21st February 2020, 07:32 AM |#5060  
Member
Thanks Meter: 3
 
More
I have 3 questions(requests):
1. my phone model is relatively rare and my User-agent is rare enough to be tracked in some way. So is it possible block or cheat chrome from accessing my user agent? (I tried to apply chrome with all restrictions but it didn't work)
2. Is there some way to restrict apps from reading my device fingerprint? I found that it is still accessible. for example with this app:

3. There's an app which can still read my phone model(which i dont want to reveal) when it's completely restricted. It also happened in the past with XPrivacy app, and it couldn't read after i restricted it from reading /proc and /system/build.prop. So i'm wondering where can i found these two restrictions in XPrivacyLua app or in its repo?
21st February 2020, 08:11 AM |#5061  
M66B's Avatar
OP Recognized Developer
Thanks Meter: 43,993
 
More
Quote:
Originally Posted by Fif_

LuaJ does support pcall(), but it won't catch Java exceptions. Would you consider a patch to add that functionality?
Anyhow, it wouldn't help with Hulu misbehaving, I've tried to access ApplicationInfo through other ways (context:getPackageManager():getApplicationInfo(co ntext:getPackageName(), 0)) and PackageManager:getApplicationInfo() throws the exact same error. @sdz2, I won't bother any further, sorry. I'll take a patch for BlockGuardOS.open if you figure it out. :-/

Looking into the source code, it seems to me that LuaJ's pcall catches Java exceptions too:

https://github.com/M66B/XPrivacyLua/...eLib.java#L219
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes