3

I had created an app using corona and installed in my phone; And it is working but some how I missed the original files (My system was crashed and I lost my code).

But i have apk file in my phone. So is there any way to export lua files from apk file.

That code was developed by my developer account on corona.

Kabir
  • 2,126
  • 5
  • 21
  • 24
  • 5
    According to [Wikipedia](http://en.wikipedia.org/wiki/APK_(file_format)), an apk file is just a zip file, so renaming it to `foo.zip` may allow you to open it and recover its contents. OTOH, Corona may precompile Lua scripts, in which case you may be out of luck. – lhf Aug 23 '13 at 13:02
  • 1
    @kabir let this be a lesson to back your stuff up? ;) – greatwolf Aug 23 '13 at 22:19
  • 1
    @Kabir Always remember the wise programmer's motto - "There are only two types of data: those you made a backup of and those you haven't lost yet!" ;-) – LorenzoDonati4Ukraine-OnStrike Aug 23 '13 at 22:47
  • @Kabir Also have a cloud server for backups – NaviRamyle Aug 25 '13 at 13:39

2 Answers2

1

You may convert your .apk file to a .zip file but when you do, you will see that all of your lua files will already be compiled so there is no way to access your lua files through an apk. I ran into a similar problem once and discovered I couldn't recover my lua files.

You can then try to decompile the lua files using luadec. If you're on 5.1 then this works: https://github.com/sztupy/luadec51/wiki Note that depending on you've scripted it not all lua files will compile to the right text, and definitely not all lua files will decompile correctly. You will have to go through each lua files and check for decompilation errors (they are commented when decompiled)

In the future, consider saving all your project files in a Dropbox directory AND use version control. If you use hosted version control (Assembla, GitHub, Bitbucket), then that is better too. This means you get local copies, multiple copies of copies in Dropbox and hosted copies at your service.

Good luck!

qaisjp
  • 722
  • 8
  • 31
0

@Kabir you may convert your .apk file to a .zip file but when you do, you will see that all of your lua files will already be compiled so there is no way to access your lua files through an apk. I ran into a similar problem once and discovered I couldn't recover my lua files.

--- Moksh Jawa

Moksh Jawa
  • 76
  • 1
  • 5