superuser permissions -app inventor


Last Updated:

  1. T2noob

    T2noob Well-Known Member This Topic's Starter

    Joined:
    Jan 16, 2010
    Messages:
    471
    Likes Received:
    98
    Well I've been messing with app inventor and I'm comfortable with it now and would like to make an app that uses superuser permissions. To add to plainjane. But haven't found out how to call the su app let alone how to implement it with app inventor.
    Does anyone know how to call and maybe how to implement it to app inventor?
    Any help would be greatly appreciated.
     

    Advertisement
  2. scary alien

    scary alien not really so scary Moderator

    Joined:
    Mar 5, 2010
    Messages:
    21,664
    Likes Received:
    22,019
    T2,

    I don't know specifically about App Inventor (I only played with my invite for a short time), but I can check/lookup on some info tonight when I get home that might be of help.

    "I'll be back" ;)...thanks.

    P.S. a Gscript script might be an alternative if you want to go that way...works pretty well, and the su infrastructure is already built-in.
     
  3. T2noob

    T2noob Well-Known Member This Topic's Starter

    Joined:
    Jan 16, 2010
    Messages:
    471
    Likes Received:
    98
    Well the reason I'm using app inventor is to learn how to code. I build them take tthem apart to look at the code. And I've got the part about making your own defnitions and stuff down this is just something to do keep me busy for a while. So I want to know if I. Can build it in app inventor, then maybe try programming it from scratch a program that uses su in a different way. I don't even know if ill release another plainjane bbecause I haven't touched since I got my droid. Like I said its just something to keep me busy during holiday break that's comibg up.
     
  4. scary alien

    scary alien not really so scary Moderator

    Joined:
    Mar 5, 2010
    Messages:
    21,664
    Likes Received:
    22,019
    I got ya...no problem... I'll send you some info. this evening when I get home.

    Cheers!
     
  5. scary alien

    scary alien not really so scary Moderator

    Joined:
    Mar 5, 2010
    Messages:
    21,664
    Likes Received:
    22,019
    T2,

    Okay, here's what I (think I :p) know:

    Normally, you would launch the sh (shell) program to run/interpret commands and there are a couple of ways you can do this (I'll use the "date" command as the example program you might want to run):

    1. Piping:

    echo "date" | sh

    2. Redirection:

    echo "date" > cmd.txt
    sh < cmd.txt


    Here's the actual test session:

    $ echo "date" | sh
    echo "date" | sh
    Mon Nov 29 19:57:13 EST 2010
    $ echo "date" > cmd.txt
    echo "date" > cmd.txt
    $ sh < cmd.txt
    sh < cmd.txt
    Mon Nov 29 19:57:31 EST 2010

    You should be able to substitute the su (superuser) program in place of the sh program for executing commands:

    $ echo "date" | su
    echo "date" | su
    Mon Nov 29 19:59:37 EST 2010
    $ su < cmd.txt
    su < cmd.txt
    Mon Nov 29 19:59:54 EST 2010

    with the only difference being that you'll get prompted by the SuperUser whitelist app for permission to run root-only commands.

    Also, if you want to save/capture the output, you'll probably have to redirect the command's output to a file for subsequent parsing:

    $ su < cmd.txt > cmd.out
    su < cmd.txt > cmd.out
    $ cat cmd.out
    cat cmd.out
    Mon Nov 29 20:05:15 EST 2010

    So, I don't know exactly how App Inventor might allow you to implement running programs, but if you format your commands correctly, this should work.

    Additionally, if you get to the point of using Java, you could check out these helpful threads:

    Help with something easy. - Droid Forum - Verizon Droid & the Motorola Droid Forum

    Android: Requesting root access in your app | Stealthcopter.com

    Hope this helps. Cheers!
     

Share This Page

Loading...