ehanp88 / roottools

Automatically exported from code.google.com/p/roottools
0 stars 0 forks source link

isAccessGiven() timeout #27

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What?

Trying to verify that access was given;
I have a TextView and a button.
When the button is pressed I'm using isAccessGiven() to check for root.

---
        this.btnCheckRoot = (Button) findViewById(R.id.btnGetInfo);
        this.btnCheckRoot.setOnClickListener(new OnClickListener() {
            public void onClick(View v) {

                if(RootTools.isAccessGiven()) {
                    tv1.setText("oh yeah");
                } else {
                    tv1.setText("no root yet");
                }
            }
        });

---

LogCat:

12-07 17:21:40.614: W/System.err(2974): java.util.concurrent.TimeoutException: 
Broken pipe
12-07 17:21:40.614: W/System.err(2974):     at 
com.stericson.RootTools.Shell.<init>(Shell.java:71)
12-07 17:21:40.614: W/System.err(2974):     at 
com.stericson.RootTools.Shell.startRootShell(Shell.java:107)
12-07 17:21:40.614: W/System.err(2974):     at 
com.stericson.RootTools.InternalMethods.isAccessGiven(InternalMethods.java:771)
12-07 17:21:40.614: W/System.err(2974):     at 
com.stericson.RootTools.RootTools.isAccessGiven(RootTools.java:530)
12-07 17:21:40.614: W/System.err(2974):     at 
com.island51.gotroot.MainActivity$1.onClick(MainActivity.java:70)
12-07 17:21:40.614: W/System.err(2974):     at 
android.view.View.performClick(View.java:2485)
12-07 17:21:40.614: W/System.err(2974):     at 
android.view.View$PerformClick.run(View.java:9080)
12-07 17:21:40.614: W/System.err(2974):     at 
android.os.Handler.handleCallback(Handler.java:587)
12-07 17:21:40.614: W/System.err(2974):     at 
android.os.Handler.dispatchMessage(Handler.java:92)
12-07 17:21:40.614: W/System.err(2974):     at 
android.os.Looper.loop(Looper.java:123)
12-07 17:21:40.614: W/System.err(2974):     at 
android.app.ActivityThread.main(ActivityThread.java:3683)
12-07 17:21:40.614: W/System.err(2974):     at 
java.lang.reflect.Method.invokeNative(Native Method)
12-07 17:21:40.614: W/System.err(2974):     at 
java.lang.reflect.Method.invoke(Method.java:507)
12-07 17:21:40.614: W/System.err(2974):     at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
12-07 17:21:40.614: W/System.err(2974):     at 
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
12-07 17:21:40.614: W/System.err(2974):     at 
dalvik.system.NativeStart.main(Native Method)
12-07 17:21:40.614: D/AndroidRuntime(2974): Shutting down VM
12-07 17:21:40.614: W/dalvikvm(2974): threadid=1: thread exiting with uncaught 
exception (group=0x40015560)
12-07 17:21:40.624: E/AndroidRuntime(2974): FATAL EXCEPTION: main
12-07 17:21:40.624: E/AndroidRuntime(2974): java.lang.NullPointerException
12-07 17:21:40.624: E/AndroidRuntime(2974):     at 
com.island51.gotroot.MainActivity$1.onClick(MainActivity.java:73)
12-07 17:21:40.624: E/AndroidRuntime(2974):     at 
android.view.View.performClick(View.java:2485)
12-07 17:21:40.624: E/AndroidRuntime(2974):     at 
android.view.View$PerformClick.run(View.java:9080)
12-07 17:21:40.624: E/AndroidRuntime(2974):     at 
android.os.Handler.handleCallback(Handler.java:587)
12-07 17:21:40.624: E/AndroidRuntime(2974):     at 
android.os.Handler.dispatchMessage(Handler.java:92)
12-07 17:21:40.624: E/AndroidRuntime(2974):     at 
android.os.Looper.loop(Looper.java:123)
12-07 17:21:40.624: E/AndroidRuntime(2974):     at 
android.app.ActivityThread.main(ActivityThread.java:3683)
12-07 17:21:40.624: E/AndroidRuntime(2974):     at 
java.lang.reflect.Method.invokeNative(Native Method)
12-07 17:21:40.624: E/AndroidRuntime(2974):     at 
java.lang.reflect.Method.invoke(Method.java:507)
12-07 17:21:40.624: E/AndroidRuntime(2974):     at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
12-07 17:21:40.624: E/AndroidRuntime(2974):     at 
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
12-07 17:21:40.624: E/AndroidRuntime(2974):     at 
dalvik.system.NativeStart.main(Native Method)

---

The weird thing, is that whenever I remove the
else {tv1.setText("no root yet");}

the error goes away. Error occures when pressing the button.

Original issue reported on code.google.com by nsten...@gmail.com on 7 Dec 2012 at 4:26

GoogleCodeExporter commented 9 years ago
fixed: typo :/

Original comment by nsten...@gmail.com on 8 Dec 2012 at 1:31

GoogleCodeExporter commented 9 years ago
You have a nullpointer going on, something in your code. I imagine it is 
something with your textview.

12-07 17:21:40.624: E/AndroidRuntime(2974):     at 
com.island51.gotroot.MainActivity$1.onClick(MainActivity.java:73)

The library is doing what it should and is timing out.

Original comment by Stericso...@gmail.com on 29 Jan 2013 at 9:43