ProGuard on Pro Version

Was curious about this as well.  Is ProGuard enabled for Pro (or Basic or Starter) users?

No.  Corona Simulator built APKs do not use ProGuard, but that’s okay, because all it would do is obfuscate CoronaLabs’ Java code.  The main intent of the ProGuard tool is to prevent end-users from reverse engineering an app’s Java code.  ProGuard would do nothing to protect your code which is written in Lua.  Now, if you build your APK with your own keystore, then the Corona Simulator would then compile all of your Lua scripts into byte code with all of the debug symbols stripped out (ie: variable and functions names are lost), which would be very difficult for someone to reverse engineer.  If you build your app with Corona’s “debug.keystore”, then the debug symbols are preserved so that the stack trace provide by a Lua runtime error would help you debug your application.

Thank you for the information, Joshua.  Appreciate it.

Was curious about this as well.  Is ProGuard enabled for Pro (or Basic or Starter) users?

No.  Corona Simulator built APKs do not use ProGuard, but that’s okay, because all it would do is obfuscate CoronaLabs’ Java code.  The main intent of the ProGuard tool is to prevent end-users from reverse engineering an app’s Java code.  ProGuard would do nothing to protect your code which is written in Lua.  Now, if you build your APK with your own keystore, then the Corona Simulator would then compile all of your Lua scripts into byte code with all of the debug symbols stripped out (ie: variable and functions names are lost), which would be very difficult for someone to reverse engineer.  If you build your app with Corona’s “debug.keystore”, then the debug symbols are preserved so that the stack trace provide by a Lua runtime error would help you debug your application.

Thank you for the information, Joshua.  Appreciate it.

We need Proguard to reduce size of APK. Is it possible to do that in Corona SDK?

Thanks in advance!

You can only use ProGuard via Corona Enterprise.

But that said, ProGuard will *not* significantly reduce the APK file size anyways.

You see, the main intention of ProGuard is to obfuscate Java code to make it difficult for hackers to reverse engineer the code.  It does happen to reduce the size of the compiled Java binary a bit as well by renaming class/method/variable names with shorter obfuscated names, but that’s more out of consequence of code obfuscation.  But that said, ProGuard does nothing with the C/C++ libraries (ie: the *.so library files) or with any of your asset files (ie: your Corona project files such as *.lua, *.png, *.jpg, etc.)… and asset files make up the largest portion of your APK.  The Java portion of the APK is insignificant compared to everything else.

Thanks @Joshua!

Well we used PNG compression software to reduce size of our PNG files, but we also thought that Proguard 

will also help us to decrease size of apk a little bit more :slight_smile:

If you’re targeting the Google Play store, then you can use Google’s “expansion file” feature to go beyond the 50 MB limit.  Instructions on how to set this up in Corona can be found here…

   http://docs.coronalabs.com/guide/distribution/buildSettings/index.html#expansion-files

Note that Google’s “expansion file” feature also requires you to use Google’s LVL licensing feature as well.  Details on how to set this up in Corona can be found here…

   http://docs.coronalabs.com/guide/basics/configSettings/index.html#app-licensing

I hope this helps!

This will definitively help us in future, for some other game! Thank you!

Size of our appilcation was 21MB. Then we used compression software for PNG files(since our application has a lot of images) and converted our audio files.

So currently, size of our application is 17MB which is, I supose, acceptable for the users.

Hi Joshua, can I just confirm that I’ve read this correctly?

You said that “Now, if you build your APK with your own keystore, then the Corona Simulator would then compile all of your Lua scripts into byte code with all of the debug symbols stripped out (ie: variable and functions names are lost), which would be very difficult for someone to reverse engineer

but you also said:

the main intention of ProGuard is to obfuscate Java code…__But that said, ProGuard does nothing with the C/C++ libraries (ie: the *.so library files) or with any of your asset files (ie: your Corona project files such as *.lua , *.png, *.jpg, etc.)

Does that mean that if we are building with Enterprise our lua scripts are not compiled into byte code, and ProGuard won’t help with that either? Or does Enterprise still strip out all of the debug symbols from the lua scripts?

Thanks

ProGuard only works with Java.  It does not support any other language.

   http://proguard.sourceforge.net/

   http://developer.android.com/tools/help/proguard.html

The Corona Simulator and Corona Enterprise *always* compiles your Lua scripts into byte code.  All of the compiled Lua byte code files (*.lu files) are then bundled into a single “resource.car” file, which is kind of like a tar ball (*.tar file)… and that is what’s put into the APK.

Regarding Corona Enterprise builds, if you build a “debug” version via ant/AndroidSDK/Eclipse, then the debug symbols are preserved in the compiled Lua scripts.  If you build a “release” version, then the debug symbols are stripped out and your Lua stack traces won’t be of much help anymore.

We need Proguard to reduce size of APK. Is it possible to do that in Corona SDK?

Thanks in advance!

You can only use ProGuard via Corona Enterprise.

But that said, ProGuard will *not* significantly reduce the APK file size anyways.

You see, the main intention of ProGuard is to obfuscate Java code to make it difficult for hackers to reverse engineer the code.  It does happen to reduce the size of the compiled Java binary a bit as well by renaming class/method/variable names with shorter obfuscated names, but that’s more out of consequence of code obfuscation.  But that said, ProGuard does nothing with the C/C++ libraries (ie: the *.so library files) or with any of your asset files (ie: your Corona project files such as *.lua, *.png, *.jpg, etc.)… and asset files make up the largest portion of your APK.  The Java portion of the APK is insignificant compared to everything else.

Thanks @Joshua!

Well we used PNG compression software to reduce size of our PNG files, but we also thought that Proguard 

will also help us to decrease size of apk a little bit more :slight_smile:

If you’re targeting the Google Play store, then you can use Google’s “expansion file” feature to go beyond the 50 MB limit.  Instructions on how to set this up in Corona can be found here…

   http://docs.coronalabs.com/guide/distribution/buildSettings/index.html#expansion-files

Note that Google’s “expansion file” feature also requires you to use Google’s LVL licensing feature as well.  Details on how to set this up in Corona can be found here…

   http://docs.coronalabs.com/guide/basics/configSettings/index.html#app-licensing

I hope this helps!

This will definitively help us in future, for some other game! Thank you!

Size of our appilcation was 21MB. Then we used compression software for PNG files(since our application has a lot of images) and converted our audio files.

So currently, size of our application is 17MB which is, I supose, acceptable for the users.

Hi Joshua, can I just confirm that I’ve read this correctly?

You said that “Now, if you build your APK with your own keystore, then the Corona Simulator would then compile all of your Lua scripts into byte code with all of the debug symbols stripped out (ie: variable and functions names are lost), which would be very difficult for someone to reverse engineer

but you also said:

the main intention of ProGuard is to obfuscate Java code…__But that said, ProGuard does nothing with the C/C++ libraries (ie: the *.so library files) or with any of your asset files (ie: your Corona project files such as *.lua , *.png, *.jpg, etc.)

Does that mean that if we are building with Enterprise our lua scripts are not compiled into byte code, and ProGuard won’t help with that either? Or does Enterprise still strip out all of the debug symbols from the lua scripts?

Thanks

ProGuard only works with Java.  It does not support any other language.

   http://proguard.sourceforge.net/

   http://developer.android.com/tools/help/proguard.html

The Corona Simulator and Corona Enterprise *always* compiles your Lua scripts into byte code.  All of the compiled Lua byte code files (*.lu files) are then bundled into a single “resource.car” file, which is kind of like a tar ball (*.tar file)… and that is what’s put into the APK.

Regarding Corona Enterprise builds, if you build a “debug” version via ant/AndroidSDK/Eclipse, then the debug symbols are preserved in the compiled Lua scripts.  If you build a “release” version, then the debug symbols are stripped out and your Lua stack traces won’t be of much help anymore.