M66B / XPrivacy

XPrivacy - The ultimate, yet easy to use, privacy manager

Home Page:http://forum.xda-developers.com/xposed/modules/xprivacy-ultimate-android-privacy-app-t2320783

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Skype fails to connect with Xprivacy enabled.

cobaltdr opened this issue · comments

Originally reported by Tassos_i on xda.

Reproduced on stock rooted Galaxy S3 4.1.2 with Skype 3.2.0.6673 (current version), with Xprivacy 0.26 and 0.27.

Can't supply a logcat at the moment or for the next week, but I have a lovely screenshot.
screenshot_2013-06-21-21-33-05

Exit kills the process, sign in ends with the same screen.

I cannot reproduce this problem, so please provide a logcat.
Which ROM/device are you using?

Stock rooted Galaxy S3 4.1.2 GT-I9300 baseband i9300xxemc2.

Logcat is gonna be a problem... I left it on for the 15s that I needed to reproduce the issue. It's 1.8Mb. I need to figure out what's spamming my logs. And maybe get you some relevant information. Won't likely be able to do that before I get back, I'll keep looking and update. In the meantime, I wonder if anyone else can logcat this.

This may be relevant:

I/XPrivacy/XRuntime(21042): get 10137/load shell=false # D/dalvikvm(21042): Trying to load lib /data/data/com.skype.raider/lib//libnvomxadaptor.so 0x40cbf568 I/Xposed (21042): java.lang.UnsatisfiedLinkError: Cannot load library: link_image[1892]: 1917 could not load needed library 'libsurfaceflinger_client.so' for 'libnvomxadaptor.so' (load_library[1094]: Library 'libsurfaceflinger_client.so' not found) I/Xposed (21042): at java.lang.Runtime.load(Runtime.java:340) I/Xposed (21042): at java.lang.Runtime.load(Runtime.java:328) I/Xposed (21042): at de.robv.android.xposed.XposedBridge.invokeOriginalMethodNative(Native Method) I/Xposed (21042): at de.robv.android.xposed.XposedBridge.invokeOriginalMethod(XposedBridge.java:624) I/Xposed (21042): at de.robv.android.xposed.XposedBridge.handleHookedMethod(XposedBridge.java:455) I/Xposed (21042): at java.lang.Runtime.load(Native Method) I/Xposed (21042): at com.skype.AndroidVideoHost.Core.VideoHost.a(Unknown Source) I/Xposed (21042): at com.skype.AndroidVideoHost.Core.VideoHost.a(Unknown Source) I/Xposed (21042): at skype.raider.n.<init>(Unknown Source) I/Xposed (21042): at com.skype.data.kitabstract.VideoHostFactory.a(VideoHostFactory.java:75) I/Xposed (21042): at com.skype.data.kitabstract.c.b(Loader.java:265) I/Xposed (21042): at com.skype.data.kitmodel.d.run(LoginRunnable.java:53) I/Xposed (21042): at skype.raider.af$1.run(AppThreads.java:92) I/Xposed (21042): at android.os.Handler.handleCallback(Handler.java:615) I/Xposed (21042): at android.os.Handler.dispatchMessage(Handler.java:92) I/Xposed (21042): at android.os.Looper.loop(Looper.java:137) I/Xposed (21042): at android.os.HandlerThread.run(HandlerThread.java:60) E/VH_VideoHost(21042): Failure: java.lang.UnsatisfiedLinkError: Cannot load library: link_image[1892]: 1917 could not load needed library 'libsurfaceflinger_client.so' for 'libnvomxadaptor.so' (load_library[1094]: Library 'libsurfaceflinger_client.so' not found) I/XPrivacy/XRuntime(21042): Queue usage data=10137/shell/loadLibrary size=2 I/XPrivacy/XRuntime(21042): get 10137/loadLibrary shell=false #14 I/Xposed (21042): java.lang.UnsatisfiedLinkError: Couldn't load nvomxadaptor: findLibrary returned null I/Xposed (21042): at java.lang.Runtime.loadLibrary(Runtime.java:365) I/Xposed (21042): at java.lang.Runtime.loadLibrary(Runtime.java:355) I/Xposed (21042): at de.robv.android.xposed.XposedBridge.invokeOriginalMethodNative(Native Method) I/Xposed (21042): at de.robv.android.xposed.XposedBridge.invokeOriginalMethod(XposedBridge.java:624) I/Xposed (21042): at de.robv.android.xposed.XposedBridge.handleHookedMethod(XposedBridge.java:455) I/Xposed (21042): at java.lang.Runtime.loadLibrary(Native Method) I/Xposed (21042): at com.skype.AndroidVideoHost.Core.VideoHost.a(Unknown Source) I/Xposed (21042): at com.skype.AndroidVideoHost.Core.VideoHost.a(Unknown Source) I/Xposed (21042): at skype.raider.n.<init>(Unknown Source) I/Xposed (21042): at com.skype.data.kitabstract.VideoHostFactory.a(VideoHostFactory.java:75) I/Xposed (21042): at com.skype.data.kitabstract.c.b(Loader.java:265) I/Xposed (21042): at com.skype.data.kitmodel.d.run(LoginRunnable.java:53) I/Xposed (21042): at skype.raider.af$1.run(AppThreads.java:92) I/Xposed (21042): at android.os.Handler.handleCallback(Handler.java:615) I/Xposed (21042): at android.os.Handler.dispatchMessage(Handler.java:92) I/Xposed (21042): at android.os.Looper.loop(Looper.java:137) I/Xposed (21042): at android.os.HandlerThread.run(HandlerThread.java:60) E/VH_VideoHost(21042): Failure: java.lang.UnsatisfiedLinkError: Couldn't load nvomxadaptor: findLibrary returned null I/XPrivacy/XRuntime(21042): Replacing usage data=10137/shell/load I/XPrivacy/XRuntime(21042): Queue usage data=10137/shell/load size=2 I/XPrivacy/XRuntime(21042): get 10137/load shell=false #

Long logcat's are normal.
XPrivacy adds logging too and it will not slow down your device.

This may be caused by a bug in Xposed.
Could you please try this test version of XPrivacy and let me know if the problem still occurs?
http://www.faircode.eu/xprivacy/XPrivacy_0.29.1.apk

Just checked it myself,
The problem disappears after removing those 2 hooks.
Pretty weird..

Also, I don't seem to have the file 'libsurfaceflinger_client.so
Only:

./system/lib/libsurfaceflinger.so
./system/lib/libsurfaceflinger_ddmconnection.so

Thanks, vipere.
If you like to chat, please send me a PM.

In any case we now know the cause.
I will look into this tomorrow further.

My best guess is that something that is done here causes this, although I have no idea yet what and why:
https://github.com/M66B/XPrivacy/blob/master/src/biz/bokhorst/xprivacy/XRestriction.java#L302

0.29.1 solves the issue. I wonder why you could not reproduce it.

I couldn't see what in getRestricted(...) would cause this since the log doesn't show denied access to the shell.
So I figured I'd try something else - adding a dummy hook to the function "load"

findAndHookMethod(java.lang.Runtime.class, "load", String.class, new XC_MethodHook() {
    @Override
    protected void afterHookedMethod(MethodHookParam param) throws Throwable {}
});

After this, the problem returns:

D/dalvikvm( 3030): Trying to load lib /data/app-lib/com.skype.raider-1//libnvomxadaptor.so 0x40a82d78
E/dalvikvm( 3030): dlopen("/data/app-lib/com.skype.raider-1//libnvomxadaptor.so") failed: Cannot load library: soinfo_link_image(linker.cpp:1673): could not load library "libsurfaceflinger_client.so" needed by "libnvomxadaptor.so"; caused by load_library(linker.cpp:771): library "libsurfaceflinger_client.so" not found
E/VH_VideoHost( 3030): Failure: java.lang.UnsatisfiedLinkError: Cannot load library: soinfo_link_image(linker.cpp:1673): could not load library "libsurfaceflinger_client.so" needed by "libnvomxadaptor.so"; caused by load_library(linker.cpp:771): library "libsurfaceflinger_client.so" not found

Looks like a bug in Xposed, or perhaps a limitation since java.lang.Runtime is some internal stuff.

Just to confirm that on my I9505, v 0.29.1 resolves the skype issue. Should I keep it, or is it really a test version ?

@Tassos-i could your please try this test version:

http://www.faircode.eu/xprivacy/XPrivacy_0.29.2.apk

You can keep the test versions and upgrade later to 0.30+

What changed between 0.29.1 and 0.29.2?

See the latest commit a little bit up.
(second "Attempt to fix 50")

Unfortunately, 0.29.2 brings back he skype issue!

I can confirm. Problem recurs with 0.29.2. However, as stated above, 0.29.1 works fine.

@rovo89 could you please take a look at this.
Simply hooking Runtime.load or Runtime.loadLibrary leads to this problem.
(even without any code in the hook itself)
http://developer.android.com/reference/java/lang/Runtime.html

I think this is because these methods check the calling method:

public void load(String pathName) {
    load(pathName, VMStack.getCallingClassLoader());
}

public void loadLibrary(String libName) {
    loadLibrary(libName, VMStack.getCallingClassLoader());
}

The caller is not the Skype package but the boot class loader (including XposedBridge.jar) when the methods are hooked. I can't think of a way to resolve this, but you should be able to work around it by hooking the methods with two arguments (String and ClassLoader).

Solved by hooking the private methods and skipping checks when uid=0.