Rooting the OUYA

So, I just wanted to clarify... It is ok to root the OUYA, right? I know Julie (keep up the good work!) mentioned it in the kickstarter video, but could it lead to bricking my console? I'm still quite new to the Android platform, so I don't want to do anything to jeopardize my console haha.

Btw, the reason for me to root my console is to find out where in the filesystem my APK is being held. I'm reading up on articles on how to use libzip to read the contents of my game's APK so I can finally start loading assets without needing to re-word all my filenames and extensions. Seems really messy if you're aiming for multi-platform development.

Comments

  • Rabid1Rabid1 Posts: 39Member
    The rooting process is pretty simple but the chances of bricking are always there no matter how slim. There is an apk available on XDa that does it from the device ala Gingerbreak or z4root on tablets.
  • ShushShush Posts: 178Member
    edited August 2013
    There's a guide for rooting your OUYA somewhere on this site, but you shouldn't need to do that to your OUYA just to access your APK.

    In my Java wrapper I can do this:

    private AssetManager assetManager;

    @Override protected void onCreate(Bundle icicle)
    {
        ...

        Context context = _view.getContext();
        String pathToApk = context.getPackageResourcePath();
        savePathToApk(pathToApk); // JNI
           
        assetManager = context.getResources().getAssets();
        saveAssetManager(assetManager); // JNI
    }

    There should be equivalent native functionality, check out this link as well: http://stackoverflow.com/questions/2651816/reading-resource-files-from-my-own-apk-in-android-native-environment/2663962#2663962


    Post edited by Shush on
  • Bob_the_HamsterBob_the_Hamster Posts: 39Member
    edited August 2013
    Unless I am misunderstanding what you mean by "rooting", the OUYA comes rooted by default.

    Connect your OUYA to your computer. run

      adb shell

    And you will have a shell on the OUYA. Now type

      su

    And you will become root. (on android devices that are NOT rooted, the su command is missing, or demands a password)

    Post edited by Bob_the_Hamster on
  • TRUEtravTRUEtrav Posts: 57Member
    Ok, I get it now, and that makes way more sense. I was thinking that because I couldn't see the all the way down to the "root" of my OUYA's file system with the Android File Viewer that maybe I had to root it haha. I was able to figure out what I was after though.

    If anything, I should be able to view the entire file system from the root directory in the shell, right? That'll be good enough for my purposes.
  • ShushShush Posts: 178Member
    Yup you can and I thought at one stage su was missing from the updates and made a comeback? Hence why so many people were coming up with guides for "rooting your OUYA", which was really just adding 3rd party su's into bin.

    Anyway even if you don't have access to su on your OUYA, your apk still has access to certain parts of the file system, (/data/data for private read/write and /sdcard for public read/write).
  • TRUEtravTRUEtrav Posts: 57Member
    I see, so rooting means to obtain "root" access via su haha. Nothing gets past me! lol

    That's good info. I've got some setup code that makes reading/writing to the current game's private directory easy to do now. Reading files from the APK are also transparent now. Using a method, it's like reading a file from 
Sign In or Register to comment.