Skip to content
This repository has been archived by the owner on Sep 6, 2019. It is now read-only.

RuntimeException when access to content provider from Command Prompt #739

Closed
Dzakus opened this issue Nov 10, 2013 · 5 comments
Closed

RuntimeException when access to content provider from Command Prompt #739

Dzakus opened this issue Nov 10, 2013 · 5 comments

Comments

@Dzakus
Copy link
Contributor

Dzakus commented Nov 10, 2013

When type

root@mako:/ # content query --uri content://com.google.android.gsf.gservices

on logcat I get

I/Xposed  (32001): java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
I/Xposed  (32001):      at android.os.Handler.<init>(Handler.java:197)
I/Xposed  (32001):      at android.os.Handler.<init>(Handler.java:111)
I/Xposed  (32001):      at android.widget.Toast$TN.<init>(Toast.java:324)
I/Xposed  (32001):      at android.widget.Toast.<init>(Toast.java:91)
I/Xposed  (32001):      at android.widget.Toast.makeText(Toast.java:238)
I/Xposed  (32001):      at biz.bokhorst.xprivacy.XPrivacy.report(XPrivacy.java:264)
I/Xposed  (32001):      at biz.bokhorst.xprivacy.XPrivacy.access$0(XPrivacy.java:261)
I/Xposed  (32001):      at biz.bokhorst.xprivacy.XPrivacy$1.afterHookedMethod(XPrivacy.java:210)
I/Xposed  (32001):      at de.robv.android.xposed.XposedBridge.handleHookedMethod(XposedBridge.java:494)
I/Xposed  (32001):      at com.google.android.gsf.gservices.GservicesProvider.query(Native Method)
I/Xposed  (32001):      at android.content.ContentProvider.query(ContentProvider.java:744)
I/Xposed  (32001):      at android.content.ContentProvider$Transport.query(ContentProvider.java:199)
I/Xposed  (32001):      at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:114)
I/Xposed  (32001):      at android.os.Binder.execTransact(Binder.java:388)
I/Xposed  (32001):      at dalvik.system.NativeStart.run(Native Method)
@M66B
Copy link
Owner

M66B commented Nov 10, 2013

Without su I get on the command line:

google.android.gsf.gservices                                                  <
Error while accessing provider:com.google.android.gsf.gservices
java.lang.SecurityException: Permission Denial: opening provider com.google.android.gsf.gservices.GservicesProvider from (null) (pid=3876, uid=2000) requires com.google.android.providers.gsf.permission.READ_GSERVICES or com.google.android.providers.gsf.permission.WRITE_GSERVICES
    at android.os.Parcel.readException(Parcel.java:1425)
    at android.os.Parcel.readException(Parcel.java:1379)
    at android.app.ActivityManagerProxy.getContentProviderExternal(ActivityManagerNative.java:2373)
    at com.android.commands.content.Content$Command.execute(Content.java:313)
    at com.android.commands.content.Content.main(Content.java:444)
    at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
    at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:235)
    at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:117)
    at dalvik.system.NativeStart.main(Native Method)

With su I get in the logcat:

E/XPrivacy(  786): java.lang.NullPointerException
W/System.err(  786): java.lang.NullPointerException
W/System.err(  786):    at java.util.Arrays$ArrayList.<init>(Arrays.java:38)
W/System.err(  786):    at java.util.Arrays.asList(Arrays.java:154)
W/System.err(  786):    at biz.bokhorst.xprivacy.XContentProvider.after(XContentProvider.java:142)
W/System.err(  786):    at biz.bokhorst.xprivacy.XPrivacy$1.afterHookedMethod(XPrivacy.java:220)
W/System.err(  786):    at de.robv.android.xposed.XposedBridge.handleHookedMethod(XposedBridge.java:494)
W/System.err(  786):    at com.google.android.gsf.gservices.GservicesProvider.query(Native Method)
W/System.err(  786):    at android.content.ContentProvider.query(ContentProvider.java:652)
W/System.err(  786):    at android.content.ContentProvider$Transport.query(ContentProvider.java:189)
W/System.err(  786):    at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:113)
W/System.err(  786):    at android.os.Binder.execTransact(Binder.java:367)
W/System.err(  786):    at dalvik.system.NativeStart.run(Native Method)

In your case reporting an exception fails, so we cannot see the real cause.

@M66B
Copy link
Owner

M66B commented Nov 10, 2013

Looking at the code, XPrivacy should have logged the real problem before the exception you mention, so please try again and post the logging before too.

M66B pushed a commit that referenced this issue Nov 10, 2013
@M66B
Copy link
Owner

M66B commented Nov 10, 2013

My best guess is that you will find the same null pointer exception, which will be fixed in the next release.

@Dzakus
Copy link
Contributor Author

Dzakus commented Nov 11, 2013

--------- beginning of /dev/log/main
D/Xposed  (11258): Starting Xposed binary version 42, compiled for SDK 16
D/Xposed  (11258): Phone: Nexus 4 (LGE), Android version 4.3.1 (SDK 18)
D/Xposed  (11258): ROM: cm_mako-userdebug 4.3.1 JLS36I 8011229d24 test-keys
I/Xposed  (11258): -----------------
I/Xposed  (11258): Added Xposed (/data/data/de.robv.android.xposed.installer/bin/XposedBridge.jar) to CLASSPATH.
D/AndroidRuntime(11258): 
D/AndroidRuntime(11258): >>>>>> AndroidRuntime START de.robv.android.xposed.XposedBridge <<<<<<
D/AndroidRuntime(11258): CheckJNI is OFF
D/dalvikvm(11258): Trying to load lib libjavacore.so 0x0
D/dalvikvm(11258): Added shared lib libjavacore.so 0x0
D/dalvikvm(11258): Trying to load lib libnativehelper.so 0x0
D/dalvikvm(11258): Added shared lib libnativehelper.so 0x0
D/Xposed  (11258): Using structure member offsets for mode WITH_JIT
I/Xposed  (11258): Found Xposed class 'de/robv/android/xposed/XposedBridge', now initializing
I/Xposed  (11258): -----------------
I/Xposed  (11258): 11 lis 2013 01:12:45 UTC
I/Xposed  (11258): Loading Xposed (for com.android.commands.content.Content)...
I/Xposed  (11258): Loading modules from /data/app/biz.bokhorst.xprivacy-2.apk
I/Xposed  (11258):   Loading class biz.bokhorst.xprivacy.XPrivacy
D/AndroidRuntime(11258): Calling main entry com.android.commands.content.Content
D/dalvikvm(11258): Note: class Landroid/app/ActivityManagerNative; has 164 unimplemented (abstract) methods
E/XPrivacy( 5664): java.lang.NullPointerException: storage == null
W/System.err( 5664): java.lang.NullPointerException: storage == null
W/System.err( 5664):    at java.util.Arrays$ArrayList.<init>(Arrays.java:38)
W/System.err( 5664):    at java.util.Arrays.asList(Arrays.java:154)
W/System.err( 5664):    at biz.bokhorst.xprivacy.XContentProvider.after(XContentProvider.java:142)
W/System.err( 5664):    at biz.bokhorst.xprivacy.XPrivacy$1.afterHookedMethod(XPrivacy.java:207)
W/System.err( 5664):    at de.robv.android.xposed.XposedBridge.handleHookedMethod(XposedBridge.java:494)
W/System.err( 5664):    at com.google.android.gsf.gservices.GservicesProvider.query(Native Method)
W/System.err( 5664):    at android.content.ContentProvider.query(ContentProvider.java:744)
W/System.err( 5664):    at android.content.ContentProvider$Transport.query(ContentProvider.java:199)
W/System.err( 5664):    at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:114)
W/System.err( 5664):    at android.os.Binder.execTransact(Binder.java:388)
W/System.err( 5664):    at dalvik.system.NativeStart.run(Native Method)
I/Xposed  ( 5664): java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
I/Xposed  ( 5664):  at android.os.Handler.<init>(Handler.java:197)
I/Xposed  ( 5664):  at android.os.Handler.<init>(Handler.java:111)
I/Xposed  ( 5664):  at android.widget.Toast$TN.<init>(Toast.java:324)
I/Xposed  ( 5664):  at android.widget.Toast.<init>(Toast.java:91)
I/Xposed  ( 5664):  at android.widget.Toast.makeText(Toast.java:238)
I/Xposed  ( 5664):  at biz.bokhorst.xprivacy.XPrivacy.report(XPrivacy.java:264)
I/Xposed  ( 5664):  at biz.bokhorst.xprivacy.XPrivacy.access$0(XPrivacy.java:261)
I/Xposed  ( 5664):  at biz.bokhorst.xprivacy.XPrivacy$1.afterHookedMethod(XPrivacy.java:210)
I/Xposed  ( 5664):  at de.robv.android.xposed.XposedBridge.handleHookedMethod(XposedBridge.java:494)
I/Xposed  ( 5664):  at com.google.android.gsf.gservices.GservicesProvider.query(Native Method)
I/Xposed  ( 5664):  at android.content.ContentProvider.query(ContentProvider.java:744)
I/Xposed  ( 5664):  at android.content.ContentProvider$Transport.query(ContentProvider.java:199)
I/Xposed  ( 5664):  at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:114)
I/Xposed  ( 5664):  at android.os.Binder.execTransact(Binder.java:388)
I/Xposed  ( 5664):  at dalvik.system.NativeStart.run(Native Method)
I/Xposed  ( 5664): java.lang.NullPointerException
I/Xposed  ( 5664):  at com.google.android.youtube.debug.Module$1.afterHookedMethod(Module.java:58)
I/Xposed  ( 5664):  at de.robv.android.xposed.XposedBridge.handleHookedMethod(XposedBridge.java:494)
I/Xposed  ( 5664):  at com.google.android.gsf.gservices.GservicesProvider.query(Native Method)
I/Xposed  ( 5664):  at android.content.ContentProvider.query(ContentProvider.java:744)
I/Xposed  ( 5664):  at android.content.ContentProvider$Transport.query(ContentProvider.java:199)
I/Xposed  ( 5664):  at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:114)
I/Xposed  ( 5664):  at android.os.Binder.execTransact(Binder.java:388)
I/Xposed  ( 5664):  at dalvik.system.NativeStart.run(Native Method)
D/AndroidRuntime(11258): Shutting down VM
D/jdwp    (11258): Got wake-up signal, bailing out of select
D/dalvikvm(11258): Debugger has detached; object registry had 1 entries

@M66B
Copy link
Owner

M66B commented Nov 11, 2013

Yes, same null pointer exception.
It will be fixed in the next version.
This exception is caused by a missing argument, which normally doesn't happen.
You can try this test version if you like: http://d-h.st/FuS

@M66B M66B closed this as completed Nov 11, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants