Retrieving Program Code from

I wrote the beginnings of a game in Corona a few years back, and uploaded an early alpha test version to an old Android phone (see photo). 

Since then the hard drive that had my code crashed. I’m now getting back to Corona.

I connected the phone to a Mac in USB mode to see if could see the app and retrieve it, but don’t see it.

Do I need an Android IDE, or SDK? (I lost my notes as well!).  I know there’s an .apk file – but even if I could download that, would it get me the Lua files? 

I’m downloading the Android SDK … hmm, tells me I need to install Java. What version should I install? JDK 6,7,8? Or just the JRE?  I’m on Mac with OS X 10.10.5.  

Thanks!

I believe all of your lua stuff is stored in byte code when it’s compiled, so unfortunately it’s not accessible.

@eric - Alex is right.  The code in the binary is stored in bytecode.  Your original source is well and truly gone.

The original is gone, but you might be able to salvage some of the structure with a 5.1 decompiler, e.g. luadec or one of these others.

Bytecode, OK. Too bad. 

All I need then is $700 or so to recover the hard drive. 

I also remember I had it compiled online at Corona’s servers. I don’t suppose Corona would have a copy from like 2012, LOL…  

Ah well, it was a simple game that I didn’t get real far with, though I did figure out how to do some tricky things with. I need to re-learn anyway. But A much of the basics of Lua and Corona are still in my (human brain) memory, more or less.

Thanks 

We never store your code.

Rob

For the future, what I do is use Google Drive with the desktop/mac app.  This creates a folder that’s linked to your Drive and automatically syncs with every file change.   Then I store all my current and past Corona projects in this folder.  Code will never be lost (unless Google dies)

I’d highly recommend using some kind of version control in future (like git or mercurial). That way you can not only retrieve your code, but also track changes and retrieve code from certain points in time (e.g. get code from a point before you added a bug).

There are plenty of free tools out there like SourceTree to make it easier, and everything can be stored for free on github or bitbucket.

Thanks for all the ideas guys. Version control is a good idea, but I wonder of it’s worth it for one person (not a team) as far as the time, learning, complexity overhead.  

Keeping a copy of code online is definitely something I will want to do. I already use Dropbox for other things. 

The initial setup might take 30 mins or so, but day to day use doesn’t really add much complexity.  

I use it for my own personal projects, just because it is extremely useful to be able to roll back to a certain point if I really I’m on the wrong track, and also so I can see previously made changes. Sometimes I remember changing a bit of code, but don’t remember what the old code was, and suddenly need to use the old functionality elsewhere. Using git means I can easily look and see what the change was.

The alternative is to have lots of duplicate folders (v1, v2, v3 etc) in dropbox but that will eat up space, and all without having the advantages that git has.

Up to you obviously, but I’d still highly recommend using git. 

@eric81, in my opinion, learning to use verison control is an extremely important, fundamental building block in your programming career.

It will save you time, and a lot of headaches down the line.

My two recommendations would be:

  1. BitBucket to host your code. It supports private repositories for free (up to a certain number of team members) and you can use git or mercurial.

  2. SourceTree is a visual source control management tool. It supports Windows and Mac. It’s also free.

Best of luck!

Danny, Alan – Thanks, I’m looking into Bitbucket and SourceTree. 

Another question – about these forums:

So as I start working at learning and programming this educational (and a business app) app that is my current projects, and come up against puzzlements and problems, being a newbie as it were, is this “General Questions/Discussion” forum the best forum to post my questions in? I’m sure I’ll have lots of them (about Lua and how to get things done in Corona). 

Thanks!

Yes.  I would recommend using the search feature first before posting. 

I believe all of your lua stuff is stored in byte code when it’s compiled, so unfortunately it’s not accessible.

@eric - Alex is right.  The code in the binary is stored in bytecode.  Your original source is well and truly gone.

The original is gone, but you might be able to salvage some of the structure with a 5.1 decompiler, e.g. luadec or one of these others.

Bytecode, OK. Too bad. 

All I need then is $700 or so to recover the hard drive. 

I also remember I had it compiled online at Corona’s servers. I don’t suppose Corona would have a copy from like 2012, LOL…  

Ah well, it was a simple game that I didn’t get real far with, though I did figure out how to do some tricky things with. I need to re-learn anyway. But A much of the basics of Lua and Corona are still in my (human brain) memory, more or less.

Thanks 

We never store your code.

Rob

For the future, what I do is use Google Drive with the desktop/mac app.  This creates a folder that’s linked to your Drive and automatically syncs with every file change.   Then I store all my current and past Corona projects in this folder.  Code will never be lost (unless Google dies)

I’d highly recommend using some kind of version control in future (like git or mercurial). That way you can not only retrieve your code, but also track changes and retrieve code from certain points in time (e.g. get code from a point before you added a bug).

There are plenty of free tools out there like SourceTree to make it easier, and everything can be stored for free on github or bitbucket.