Tristan-Hou / roottools

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

isAccessGiven() returns false when Superuser (com.noshufou.android.su) is installed #37

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Install Superuser (com.noshufou.android.su), an no other SU apps
2. Call isAccessGiven()
3. Observe lack of root permission dialog

What is the expected output? What do you see instead?
Expected popup dialog asking for root permission when calling isAccessGiven(). 
Instead, no popup and isAccessGiven() returns false.

What version of the product are you using? On what operating system?
Android 4.2.2, Galaxy Nexus, stock, rooted.

Please provide any additional information below.
If I uninstall com.noshufou.android.su and instead use 
com.koushikdutta.superuser, everything works as expected. I have a user "in the 
wild" that is experiencing the same issue.

Here's the logcat output from when isAccessGiven() fails:

06-28 10:20:56.735: D/RootTools v2.6(22101): Checking for Root access
06-28 10:20:56.735: D/RootTools v2.6(22101): Starting Root Shell!
06-28 10:20:56.735: D/RootTools v2.6(22101): Starting shell: su
06-28 10:20:56.829: W/System.err(22101): 
com.stericson.RootTools.exceptions.RootDeniedException: Root Access Denied
06-28 10:20:56.844: W/System.err(22101):    at 
com.stericson.RootTools.execution.Shell.<init>(Shell.java:78)
06-28 10:20:56.844: W/System.err(22101):    at 
com.stericson.RootTools.execution.Shell.startRootShell(Shell.java:309)
06-28 10:20:56.844: W/System.err(22101):    at 
com.stericson.RootTools.execution.Shell.startRootShell(Shell.java:291)
06-28 10:20:56.852: W/System.err(22101):    at 
com.stericson.RootTools.internal.RootToolsInternalMethods.isAccessGiven(RootTool
sInternalMethods.java:841)
06-28 10:20:56.852: W/System.err(22101):    at 
com.stericson.RootTools.RootTools.isAccessGiven(RootTools.java:636)
06-28 10:20:56.852: W/System.err(22101):    at 
com.benhirashima.unlocker.common.StateChanger.requestRoot(StateChanger.java:100)
06-28 10:20:56.852: W/System.err(22101):    at 
com.benhirashima.unlocker.common.SetupIntro.next(SetupIntro.java:123)
06-28 10:20:56.852: W/System.err(22101):    at 
com.benhirashima.unlocker.common.SetupIntro.onActivityResult(SetupIntro.java:110
)
06-28 10:20:56.852: W/System.err(22101):    at 
android.app.Activity.dispatchActivityResult(Activity.java:5293)
06-28 10:20:56.852: W/System.err(22101):    at 
android.app.ActivityThread.deliverResults(ActivityThread.java:3315)
06-28 10:20:56.852: W/System.err(22101):    at 
android.app.ActivityThread.handleSendResult(ActivityThread.java:3362)
06-28 10:20:56.852: W/System.err(22101):    at 
android.app.ActivityThread.access$1100(ActivityThread.java:141)
06-28 10:20:56.852: W/System.err(22101):    at 
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1282)
06-28 10:20:56.852: W/System.err(22101):    at 
android.os.Handler.dispatchMessage(Handler.java:99)
06-28 10:20:56.852: W/System.err(22101):    at 
android.os.Looper.loop(Looper.java:137)
06-28 10:20:56.852: W/System.err(22101):    at 
android.app.ActivityThread.main(ActivityThread.java:5041)
06-28 10:20:56.852: W/System.err(22101):    at 
java.lang.reflect.Method.invokeNative(Native Method)
06-28 10:20:56.860: W/System.err(22101):    at 
java.lang.reflect.Method.invoke(Method.java:511)
06-28 10:20:56.860: W/System.err(22101):    at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
06-28 10:20:56.860: W/System.err(22101):    at 
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
06-28 10:20:56.860: W/System.err(22101):    at 
dalvik.system.NativeStart.main(Native Method)

Original issue reported on code.google.com by benhiras...@gmail.com on 28 Jun 2013 at 5:30

GoogleCodeExporter commented 8 years ago
i should add that i have the android.permission.ACCESS_SUPERUSER permission in 
my manifest, as the developer of com.noshufou.android.su suggests. adding it 
didn't make a difference.

i should also add that isAccessGiven() did work properly with 
com.noshufou.android.su at one point in the past. then i uninstalled 
com.noshufou.android.su, installed com.koushikdutta.superuser, uninstalled 
com.koushikdutta.superuser, and reinstalled com.noshufou.android.su. that's 
when the trouble started. i've tried reinstalling com.noshufou.android.su 
numerous times since then, but isAccessGiven() is still misbehaving.

Original comment by benhiras...@gmail.com on 28 Jun 2013 at 5:38

GoogleCodeExporter commented 8 years ago
it looks like com.koushikdutta.superuser replaced the su binary. this could be 
the cause of the problem.

Original comment by benhiras...@gmail.com on 28 Jun 2013 at 5:59

GoogleCodeExporter commented 8 years ago
Yes, if the su binary is for Koush's Superuser application then it will not 
work with ChainsDD's application and you will get the Root Access Denied.

Your users needs to have the su binary provided by ChainsDD's application.

Original comment by Stericso...@gmail.com on 28 Jun 2013 at 6:03

GoogleCodeExporter commented 8 years ago
got it. thanks!

Original comment by benhiras...@gmail.com on 28 Jun 2013 at 6:32

GoogleCodeExporter commented 8 years ago
no problem, let me know if you have any further issues.

Original comment by Stericso...@gmail.com on 28 Jun 2013 at 6:41

GoogleCodeExporter commented 8 years ago
CODE:
-------------------------------------------------------------------------
        if (RootTools.isRootAvailable()) 
        {                                  
            CommandCapture command = new CommandCapture(0, "chmod 777 /dev/pn*"); 
            try {
                RootTools.getShell(true).add(command).waitForFinish();
            } catch (InterruptedException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            } catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            } catch (TimeoutException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            } catch (RootDeniedException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        } 
        else 
        {   
            RootTools.offerSuperUser(DtaActivity.this);  
        }  

LOG:
-------------------------------------------------------------------------
10-02 22:43:56.810: D/RootTools v2.6(4701): Starting Root Shell!
10-02 22:43:56.810: D/RootTools v2.6(4701): Starting shell: su

10-02 22:43:56.850: W/System.err(4701): 
com.stericson.RootTools.exceptions.RootDeniedException: Root Access Denied
10-02 22:43:56.850: W/System.err(4701):     at 
com.stericson.RootTools.execution.Shell.<init>(Shell.java:77)
10-02 22:43:56.850: W/System.err(4701):     at 
com.stericson.RootTools.execution.Shell.startRootShell(Shell.java:294)
10-02 22:43:56.850: W/System.err(4701):     at 
com.stericson.RootTools.execution.Shell.startRootShell(Shell.java:280)
10-02 22:43:56.850: W/System.err(4701):     at 
com.stericson.RootTools.RootTools.getShell(RootTools.java:373)
10-02 22:43:56.850: W/System.err(4701):     at 
com.stericson.RootTools.RootTools.getShell(RootTools.java:389)
10-02 22:43:56.850: W/System.err(4701):     at 
com.stericson.RootTools.RootTools.getShell(RootTools.java:402)
10-02 22:43:56.850: W/System.err(4701):     at 
com.xiaohua.dta.DtaActivity.root(DtaActivity.java:190)
10-02 22:43:56.850: W/System.err(4701):     at 
com.xiaohua.dta.DtaActivity.onCreate(DtaActivity.java:112)
10-02 22:43:56.850: W/System.err(4701):     at 
android.app.Activity.performCreate(Activity.java:4465)
10-02 22:43:56.850: W/System.err(4701):     at 
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
10-02 22:43:56.850: W/System.err(4701):     at 
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1931)
10-02 22:43:56.850: W/System.err(4701):     at 
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1992)
10-02 22:43:56.850: W/System.err(4701):     at 
android.app.ActivityThread.access$600(ActivityThread.java:127)
10-02 22:43:56.850: W/System.err(4701):     at 
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1158)
10-02 22:43:56.850: W/System.err(4701):     at 
android.os.Handler.dispatchMessage(Handler.java:99)
10-02 22:43:56.850: W/System.err(4701):     at 
android.os.Looper.loop(Looper.java:137)
10-02 22:43:56.850: W/System.err(4701):     at 
android.app.ActivityThread.main(ActivityThread.java:4448)
10-02 22:43:56.850: W/System.err(4701):     at 
java.lang.reflect.Method.invokeNative(Native Method)
10-02 22:43:56.850: W/System.err(4701):     at 
java.lang.reflect.Method.invoke(Method.java:511)
10-02 22:43:56.850: W/System.err(4701):     at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:823)
10-02 22:43:56.850: W/System.err(4701):     at 
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:590)
10-02 22:43:56.850: W/System.err(4701):     at 
dalvik.system.NativeStart.main(Native Method)
--------------------------------------------------------------------------------
---
Hi,

Any comments of this issue? thanks!

Original comment by nfcsph...@gmail.com on 2 Oct 2013 at 2:50

GoogleCodeExporter commented 8 years ago
I've seen this happen before. Is Superuser prompting for access?

Original comment by Stericso...@gmail.com on 2 Oct 2013 at 2:52

GoogleCodeExporter commented 8 years ago
No, The funcation RootTools.isRootAvailable() return TRUE, 

BTW, Let me put few info as following,
- Same application is not problem at XIAOMI MI2A cell phone; happened at SONY 
test phone,
- Could work well based on ADB SHELL, likes adb root,adb remount, chmod...;

Original comment by nfcsph...@gmail.com on 2 Oct 2013 at 3:05

GoogleCodeExporter commented 8 years ago
Sounds like an issue with the Super User binary. Can you update your binary? I 
just had this happen with another user and this was the solution.

Original comment by Stericso...@gmail.com on 2 Oct 2013 at 3:12

GoogleCodeExporter commented 8 years ago
Already to try su version 3.0 and version 3.2, Both have problem ,

Original comment by nfcsph...@gmail.com on 2 Oct 2013 at 3:39

GoogleCodeExporter commented 8 years ago
Would you help to take look attach SU binary, this is SU3.2 ,
Is any problem with here? thanks!

Original comment by nfcsph...@gmail.com on 2 Oct 2013 at 3:45

Attachments:

GoogleCodeExporter commented 8 years ago
Hi,
Test Passed devices:
> XIAOMI MI2A
> HTC NEW ONE(HTC802W)

Otherwise:
*RootTools.isRootAvailable() = true
*RootTools.isAccessGiven() = false
> SONY sample
> Google Nexus 7
Under this case application will pop up menu show end user that how to change 
permission via ADB mode, I have cross checked the SU BIN the probelm shall be 
not here, and I am adding the issue in my watch list, thanks.

Original comment by nfcsph...@gmail.com on 8 Oct 2013 at 2:42