Run App as Root?

Discussion in 'Android' started by gudenau, Dec 12, 2015.

?

Good idea?

  1. Yes

    0 vote(s)
    0.0%
  2. No

    0 vote(s)
    0.0%
  3. Turnip

    4 vote(s)
    100.0%
  1. gudenau
    OP

    gudenau Never a unique idea

    Member
    3,257
    1,224
    Jul 7, 2010
    United States
    /dev/random
    I was wondering if you can use root access to relaunch an app as the root user? Say launch->check root->user->relaunch as root->check root->start root activity. This could be useful to prevent toast spam.
     
  2. Pleng

    Pleng GBAtemp Advanced Maniac

    Member
    1,669
    825
    Sep 14, 2011
    Thailand
    No I don't think it's possible. I'm pretty sure apps can only be launched in user space and from there you have to shell-out to root.

    How would this prevent toast spam anyway? And how on earth do you end up suffering from toast spam? If an app abuses toast, just uninstall it and find an alternative
     
  3. gudenau
    OP

    gudenau Never a unique idea

    Member
    3,257
    1,224
    Jul 7, 2010
    United States
    /dev/random
    If you can get root in your app, you might be able to relaunch as root. But if you are doing a lot of small operations with su you will get a toast message saying the app got root. I have had them last for minutes.
     
  4. Pleng

    Pleng GBAtemp Advanced Maniac

    Member
    1,669
    825
    Sep 14, 2011
    Thailand
    You can disable those notifications in SuperUser application settings
     
  5. gudenau
    OP

    gudenau Never a unique idea

    Member
    3,257
    1,224
    Jul 7, 2010
    United States
    /dev/random
    How would I be able to do that with an app though? That sounds like a huge problem. I mainly want to create a sample application for future use, and for others to use.
     
  6. Pleng

    Pleng GBAtemp Advanced Maniac

    Member
    1,669
    825
    Sep 14, 2011
    Thailand
    You can change the toast notification setting either globally, or on a per-app basis from within the SuperUser app.

    You're trying to reinvent the wheel with tools that don't exist.
     
  7. gudenau
    OP

    gudenau Never a unique idea

    Member
    3,257
    1,224
    Jul 7, 2010
    United States
    /dev/random
    I wanted to make the tools.
     
  8. Pleng

    Pleng GBAtemp Advanced Maniac

    Member
    1,669
    825
    Sep 14, 2011
    Thailand
    Then you need to build a custom ROM which enables Android to launch apps as root.

    I doubt it will stop the toast issues, anyway, as apps that request root always shell out to SU.... None of them are expecting to be launched as root.

    Probably best to just disable notifications in your SuperUser app. The only issue is that the setting gets reset when the app is updated. But you can see why that's a good thing from the security viewpoint.