Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

ProGuard on Pro Version
Started by unrealprojects Sep 20 2013 07:09 PM

10 replies to this topic
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

unrealprojects

[GLOBAL: userInfoPane.html]
unrealprojects
  • Pro
  • Pip
  • 3 posts
  • Newbie

How is ProGuard added to build Settings for Corona SDK?

 I already have project.properties enabled with ProGuard but not sure how to add it to build.settings ...

 

Any pointers helpful,

Thanks



[TOPIC: post.html]
#2

thegdog

[GLOBAL: userInfoPane.html]
thegdog
  • Pro
  • PipPipPipPipPipPip
  • 516 posts
  • Jedi

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



[TOPIC: post.html]
#3

Joshua Quick

[GLOBAL: userInfoPane.html]
Joshua Quick
  • Corona Staff
  • 2,556 posts
  • Jedi

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.



[TOPIC: post.html]
#4

thegdog

[GLOBAL: userInfoPane.html]
thegdog
  • Pro
  • PipPipPipPipPipPip
  • 516 posts
  • Jedi

Thank you for the information, Joshua.  Appreciate it.



[TOPIC: post.html]
#5

gotta.play.ltd

[GLOBAL: userInfoPane.html]
gotta.play.ltd
  • Basic
  • PipPip
  • 20 posts
  • Member

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

Thanks in advance!



[TOPIC: post.html]
#6

Joshua Quick

[GLOBAL: userInfoPane.html]
Joshua Quick
  • Corona Staff
  • 2,556 posts
  • Jedi

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.



[TOPIC: post.html]
#7

gotta.play.ltd

[GLOBAL: userInfoPane.html]
gotta.play.ltd
  • Basic
  • PipPip
  • 20 posts
  • Member

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 :)


[TOPIC: post.html]
#8

Joshua Quick

[GLOBAL: userInfoPane.html]
Joshua Quick
  • Corona Staff
  • 2,556 posts
  • Jedi

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!



[TOPIC: post.html]
#9

gotta.play.ltd

[GLOBAL: userInfoPane.html]
gotta.play.ltd
  • Basic
  • PipPip
  • 20 posts
  • Member

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.


[TOPIC: post.html]
#10

AlanPlantPot

[GLOBAL: userInfoPane.html]
AlanPlantPot
  • Starter
  • PipPipPipPipPipPip
  • 733 posts
  • Jedi

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



[TOPIC: post.html]
#11

Joshua Quick

[GLOBAL: userInfoPane.html]
Joshua Quick
  • Corona Staff
  • 2,556 posts
  • Jedi

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.




[topic_controls]
[/topic_controls]