New games every week!
Monkey-X to OUYA : Signing and Stuff
17th October 2015  
First thing's first, please be aware that I'm not compiling with sales in mind.
With sales/IAPs, you'll need to do all manner of extra stuff like managing purchasable items and ensuring your code handles them correctly.
This might break if you have IAPs!!! Untested!!!

1. Select OUYA target, and compile.

2. Head into build_folder/android_ouya/res/drawable-xhdpi
Here you'll find the regular icon, and the OUYA Dashboard icon.
Replace/doodle as necessary.

3. Compile again.

4. Head into build_folder/android_ouya/bin/

5. Create a temp/ folder in here, and copy MonkeyGame-debug.apk into that folder.

6. Head into there, and open MonkeyGame-debug.apk with a decent archive tool. (WinRAR is my tool of choice)
From there, delete the META-INF folder.

7. Grab this.. : KeyShite.bat

Open the .bat into notepad.
Change the filenames of the Java exes and Android exes to wherever you've installed them.
Be sure you've got Java v6 installed, as when I tried it with anything above that, it didn't work correctly.
(You can install multiple editions of Java!!)
There's a few references to "c:android-sdk-windowsmyKeystore.keystore" .. The file doesn't exist yet, and will be created by the tools, so make sure it's a viable location.
You'll also need easy access to the files (this .bat and the .keystore) for backup purposes, too.

8. Copy KeyShite.bat to the temp folder (Leave the original somewhere safe, and handy, probably in c:/android-sdk-windows/ or such) because each time you recompile, it'll delete the temp folder!)

9. Run the KeyShite.bat and follow the instructions.
A. Give the game a Project ID, WITH NO SPACES, regular Ascii safe for a Filename, and make a note for future reference.
B. Give your keystore a password.
C. Fill in the details.
For Name, anything seems to go..
For Name of Organisational Unit, I had no idea wtf this was, so left it blank.
For Name of Organisation, you'll want your main domain name, or something similar.
For City, anything goes. .. BUT.. I've had issues with spaces. Remove all spaces!
For State or Province, same as above, remove all spaces.
For Two Letter Country Code, I use GB for "Great Britain"..

D. You'll want to retype your password another three times, and then it should

After all of that, it should (*should*) go through and sign and rezip the thing, leaving you with four .apk files, and an out.txt
Open the out.txt and check that it's created valid certificates (every 4th line or so should say "Certificate is valid")

10. Assuming all went well, "MonkeyGame-debug.apk" or "YourGamesTitle-signed-zipped.apk" should be your working .apk for uploading and whatnot.
If all didn't go well, delete the temp folder completely and head back step 5.
Any future recompile, you'll have to do everything again from step 5.

Once all is done, be sure to grab "c:android-sdk-windowsmyKeystore.keystore" (or wherever you set it to be) and KEEP IT BACKED UP.
This should be in your daily backup folder, or however else you handle backups.

ALL of your games certificates will be added into this keystore file, and it'll grow and grow, but if you ever need to update any of the games, you WILL need to have this at hand, so that it uses the same certificate in future.

As always, test before uploading!!
You might need to delete the previous edition from your OUYA, as it'll have a new signature.

WARNING : Your game's controller code will probably not be compatible with the new Razer Forge, at this point.
I'm currently working on a replacement "Android-NewYA/" target, which features an overhauled amount of controller code.. But it's not done yet!

Views 14, Upvotes 0
Daily Blog
New games every week!
Site credits : Jayenkai, one crazy fool who has far too much time on his hands.
(c) Jayenkai 2017 and onwards, site design Rychan. RSS feed
Blog - Monkey-X to OUYA : Signing and Stuff - AGameAWeek