SHARE
TWEET

libgdx desktop project proguard enabled

a guest Sep 10th, 2014 177 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. *** Download ProGuard from http://proguard.sourceforge.net/
  2.  
  3. *** Base your config on this (taken from https://github.com/dschneider/libgdx-proguard-test/blob/master/utils/desktop.pro)
  4. *** change the "keep Main" entires to your main class
  5.  
  6.  
  7. -injars       ../libgdx-proguard-desktop/bin/libgdxpro.jar
  8. -outjars      ../libgdx-proguard-desktop/bin/libgdxpro-guarded.jar
  9. -libraryjars  <java.home>/../jre/lib/rt.jar
  10.  
  11. -dontoptimize
  12. -dontusemixedcaseclassnames
  13. -dontskipnonpubliclibraryclasses
  14. -dontpreverify
  15. -verbose
  16. -dontshrink
  17. -keepattributes SourceFile,LineNumberTable
  18.  
  19. -keeppackagenames java.**,java.security.**,java.lang.reflect.**
  20.  
  21. -keep class com.badlogic.gdx.backends.lwjgl.LwjglApplication.**
  22. -keep class org.apache.**
  23. -keep class box2dLight
  24. -keep class de.matthiasmann.**
  25. -keep class com.jcraft.**
  26. -keep class java.lang.**
  27. -keep class com.badlogic.**
  28. -keep class com.badlogic.backends.**
  29. -keep class * implements com.badlogic.gdx.utils.Json*
  30. -keep class javax.**
  31. -keep class org.objectweb.**
  32. -keep class com.jcraft.**
  33. -keep class com.jcraft.jorbis.**
  34. -keep class org.xmlpull.**
  35. -keep class org.objenesis.**
  36. -keep class org.lwjgl.**
  37. -keep class org.apache.**
  38. -keep class com.esotericsoftware.**
  39. -keep class javazoom.jl.**
  40. -keep class shaders.**
  41. -keep class com.sun.**
  42. -keep class moo.**
  43. -keep class javax.xml.**
  44. -keep class com.google.**
  45. -keep class org.json.**
  46. -keep class java.**
  47. -keep class java.security.**
  48. -keep class java.lang.reflection.**
  49.  
  50. -dontnote
  51. -dontwarn de.matthiasmann.**
  52. -dontwarn com.esotericsoftware.**
  53. -dontwarn javax.xml.**
  54. -dontwarn box2dLight.**
  55. -dontwarn shaders.**
  56. -dontwarn moo.**
  57. -dontwarn org.xmlpull.**
  58. -dontwarn javazoom.jl.**
  59. -dontwarn com.sun.**
  60. -dontwarn org.json.**
  61. -dontwarn org.apache.**
  62. -dontwarn org.objectweb.**
  63. -dontwarn org.objenesis.**
  64. -dontwarn com.jcraft.**
  65. -dontwarn com.badlogic.**
  66. -dontwarn org.lwjgl.**
  67.  
  68. -keep public class com.libgdxproguard.test.Main { *; }
  69. -keep public class com.libgdxproguard.test.ProguardTeset { *; }
  70. -keep public class java.lang.** { *; }
  71.  
  72. -keepclasseswithmembernames class java.lang.* {
  73.     native <methods>;
  74. }
  75.  
  76. -keepclasseswithmembernames class * {
  77.   native <methods>;
  78. }
  79.  
  80. -keepclassmembers enum * {
  81.   public static **[] values();
  82.   public static ** valueOf(java.lang.String);
  83. }
  84.  
  85. -keep public class com.libgdxproguard.test.Main{
  86.   public static void main(java.lang.String[]);
  87. }
  88.  
  89.  
  90. *** Open ProGuard GUI
  91. *** On first tab load the config file above
  92. *** Follow the instructions on http://www.8bitrobot.com/2012/07/07/How-to-obfuscate-and-package-a-libgdx-app-for-distribution/ exactly!
  93. *** Not sure if the rt.jar is needed.. I just changed it to the correct java path
  94.  
  95. *** If you got special stuff and third party libs You will probably need to mess around with the config file
  96.  
  97. *** Ponder if there isn't a easier way to make this happen (from eclipse with gradle) and share the solution :)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top