sometsome 1.0.2 → 3.10.42

Sign up to get free protection for your applications and to get access to all the features.
Files changed (732) hide show
  1. checksums.yaml +4 -4
  2. data/lib/proguard4.7/README +33 -0
  3. data/lib/proguard4.7/bin/proguard.bat +14 -0
  4. data/lib/proguard4.7/bin/proguard.sh +11 -0
  5. data/lib/proguard4.7/bin/proguardgui.bat +14 -0
  6. data/lib/proguard4.7/bin/proguardgui.sh +15 -0
  7. data/lib/proguard4.7/bin/retrace.bat +14 -0
  8. data/lib/proguard4.7/bin/retrace.sh +12 -0
  9. data/lib/proguard4.7/build/build.sh +94 -0
  10. data/lib/proguard4.7/build/build.xml +171 -0
  11. data/lib/proguard4.7/build/makefile +94 -0
  12. data/lib/proguard4.7/docs/FAQ.html +253 -0
  13. data/lib/proguard4.7/docs/GPL.html +406 -0
  14. data/lib/proguard4.7/docs/GPL_exception.html +56 -0
  15. data/lib/proguard4.7/docs/acknowledgements.html +76 -0
  16. data/lib/proguard4.7/docs/alternatives.html +699 -0
  17. data/lib/proguard4.7/docs/checkmark.gif +0 -0
  18. data/lib/proguard4.7/docs/downloads.html +623 -0
  19. data/lib/proguard4.7/docs/drop1.gif +0 -0
  20. data/lib/proguard4.7/docs/drop2.gif +0 -0
  21. data/lib/proguard4.7/docs/drop3.gif +0 -0
  22. data/lib/proguard4.7/docs/favicon.ico +0 -0
  23. data/lib/proguard4.7/docs/feedback.html +120 -0
  24. data/lib/proguard4.7/docs/index.html +92 -0
  25. data/lib/proguard4.7/docs/license.html +60 -0
  26. data/lib/proguard4.7/docs/main.html +102 -0
  27. data/lib/proguard4.7/docs/manual/ant.html +634 -0
  28. data/lib/proguard4.7/docs/manual/attention.gif +0 -0
  29. data/lib/proguard4.7/docs/manual/examples.html +1504 -0
  30. data/lib/proguard4.7/docs/manual/gui.html +479 -0
  31. data/lib/proguard4.7/docs/manual/index.html +51 -0
  32. data/lib/proguard4.7/docs/manual/introduction.html +173 -0
  33. data/lib/proguard4.7/docs/manual/limitations.html +69 -0
  34. data/lib/proguard4.7/docs/manual/optimizations.html +172 -0
  35. data/lib/proguard4.7/docs/manual/refcard.html +486 -0
  36. data/lib/proguard4.7/docs/manual/retrace/examples.html +345 -0
  37. data/lib/proguard4.7/docs/manual/retrace/index.html +37 -0
  38. data/lib/proguard4.7/docs/manual/retrace/introduction.html +79 -0
  39. data/lib/proguard4.7/docs/manual/retrace/usage.html +127 -0
  40. data/lib/proguard4.7/docs/manual/sections.html +60 -0
  41. data/lib/proguard4.7/docs/manual/style.css +105 -0
  42. data/lib/proguard4.7/docs/manual/troubleshooting.html +729 -0
  43. data/lib/proguard4.7/docs/manual/usage.html +1243 -0
  44. data/lib/proguard4.7/docs/manual/wtk.html +70 -0
  45. data/lib/proguard4.7/docs/quality.html +56 -0
  46. data/lib/proguard4.7/docs/results.html +170 -0
  47. data/lib/proguard4.7/docs/saikoalogo.png +0 -0
  48. data/lib/proguard4.7/docs/screenshot_console.gif +0 -0
  49. data/lib/proguard4.7/docs/screenshot_console_small.gif +0 -0
  50. data/lib/proguard4.7/docs/screenshot_gui1.gif +0 -0
  51. data/lib/proguard4.7/docs/screenshot_gui2.gif +0 -0
  52. data/lib/proguard4.7/docs/screenshot_gui3.gif +0 -0
  53. data/lib/proguard4.7/docs/screenshot_gui4.gif +0 -0
  54. data/lib/proguard4.7/docs/screenshot_gui5.gif +0 -0
  55. data/lib/proguard4.7/docs/screenshot_gui6.gif +0 -0
  56. data/lib/proguard4.7/docs/screenshot_gui7.gif +0 -0
  57. data/lib/proguard4.7/docs/screenshot_gui8.gif +0 -0
  58. data/lib/proguard4.7/docs/screenshots.html +67 -0
  59. data/lib/proguard4.7/docs/screenshots_gui_small.gif +0 -0
  60. data/lib/proguard4.7/docs/sections.html +64 -0
  61. data/lib/proguard4.7/docs/sflogo.png +0 -0
  62. data/lib/proguard4.7/docs/steel.gif +0 -0
  63. data/lib/proguard4.7/docs/style.css +223 -0
  64. data/lib/proguard4.7/docs/testimonials.html +133 -0
  65. data/lib/proguard4.7/docs/title.gif +0 -0
  66. data/lib/proguard4.7/docs/title.html +17 -0
  67. data/lib/proguard4.7/examples/android.pro +149 -0
  68. data/lib/proguard4.7/examples/annotations/examples.pro +60 -0
  69. data/lib/proguard4.7/examples/annotations/examples/Applet.java +22 -0
  70. data/lib/proguard4.7/examples/annotations/examples/Application.java +20 -0
  71. data/lib/proguard4.7/examples/annotations/examples/Bean.java +56 -0
  72. data/lib/proguard4.7/examples/annotations/examples/NativeCallBack.java +44 -0
  73. data/lib/proguard4.7/examples/annotations/lib/annotations.jar +0 -0
  74. data/lib/proguard4.7/examples/annotations/lib/annotations.pro +118 -0
  75. data/lib/proguard4.7/examples/annotations/src/proguard/annotation/Keep.java +18 -0
  76. data/lib/proguard4.7/examples/annotations/src/proguard/annotation/KeepApplication.java +18 -0
  77. data/lib/proguard4.7/examples/annotations/src/proguard/annotation/KeepClassMemberNames.java +18 -0
  78. data/lib/proguard4.7/examples/annotations/src/proguard/annotation/KeepClassMembers.java +18 -0
  79. data/lib/proguard4.7/examples/annotations/src/proguard/annotation/KeepGettersSetters.java +18 -0
  80. data/lib/proguard4.7/examples/annotations/src/proguard/annotation/KeepImplementations.java +18 -0
  81. data/lib/proguard4.7/examples/annotations/src/proguard/annotation/KeepName.java +18 -0
  82. data/lib/proguard4.7/examples/annotations/src/proguard/annotation/KeepPublicClassMemberNames.java +18 -0
  83. data/lib/proguard4.7/examples/annotations/src/proguard/annotation/KeepPublicClassMembers.java +18 -0
  84. data/lib/proguard4.7/examples/annotations/src/proguard/annotation/KeepPublicGettersSetters.java +18 -0
  85. data/lib/proguard4.7/examples/annotations/src/proguard/annotation/KeepPublicImplementations.java +18 -0
  86. data/lib/proguard4.7/examples/annotations/src/proguard/annotation/KeepPublicProtectedClassMemberNames.java +18 -0
  87. data/lib/proguard4.7/examples/annotations/src/proguard/annotation/KeepPublicProtectedClassMembers.java +19 -0
  88. data/lib/proguard4.7/examples/ant/android-8.xml +177 -0
  89. data/lib/proguard4.7/examples/ant/applets.xml +88 -0
  90. data/lib/proguard4.7/examples/ant/applications1.xml +15 -0
  91. data/lib/proguard4.7/examples/ant/applications2.xml +74 -0
  92. data/lib/proguard4.7/examples/ant/applications3.xml +98 -0
  93. data/lib/proguard4.7/examples/ant/library.xml +102 -0
  94. data/lib/proguard4.7/examples/ant/midlets.xml +52 -0
  95. data/lib/proguard4.7/examples/ant/proguard.xml +78 -0
  96. data/lib/proguard4.7/examples/ant/servlets.xml +88 -0
  97. data/lib/proguard4.7/examples/applets.pro +69 -0
  98. data/lib/proguard4.7/examples/applications.pro +75 -0
  99. data/lib/proguard4.7/examples/dictionaries/compact.txt +18 -0
  100. data/lib/proguard4.7/examples/dictionaries/keywords.txt +58 -0
  101. data/lib/proguard4.7/examples/dictionaries/shakespeare.txt +23 -0
  102. data/lib/proguard4.7/examples/dictionaries/windows.txt +209 -0
  103. data/lib/proguard4.7/examples/library.pro +79 -0
  104. data/lib/proguard4.7/examples/midlets.pro +67 -0
  105. data/lib/proguard4.7/examples/proguard.pro +57 -0
  106. data/lib/proguard4.7/examples/proguardall.pro +62 -0
  107. data/lib/proguard4.7/examples/proguardgui.pro +50 -0
  108. data/lib/proguard4.7/examples/retrace.pro +43 -0
  109. data/lib/proguard4.7/examples/scala.pro +132 -0
  110. data/lib/proguard4.7/examples/servlets.pro +70 -0
  111. data/lib/proguard4.7/lib/proguard.jar +0 -0
  112. data/lib/proguard4.7/lib/proguardgui.jar +0 -0
  113. data/lib/proguard4.7/lib/retrace.jar +0 -0
  114. data/lib/proguard4.7/src/proguard/ArgumentWordReader.java +111 -0
  115. data/lib/proguard4.7/src/proguard/ClassPath.java +94 -0
  116. data/lib/proguard4.7/src/proguard/ClassPathEntry.java +282 -0
  117. data/lib/proguard4.7/src/proguard/ClassSpecification.java +259 -0
  118. data/lib/proguard4.7/src/proguard/ClassSpecificationVisitorFactory.java +503 -0
  119. data/lib/proguard4.7/src/proguard/Configuration.java +328 -0
  120. data/lib/proguard4.7/src/proguard/ConfigurationConstants.java +123 -0
  121. data/lib/proguard4.7/src/proguard/ConfigurationParser.java +1285 -0
  122. data/lib/proguard4.7/src/proguard/ConfigurationWriter.java +651 -0
  123. data/lib/proguard4.7/src/proguard/DataEntryReaderFactory.java +141 -0
  124. data/lib/proguard4.7/src/proguard/DataEntryWriterFactory.java +150 -0
  125. data/lib/proguard4.7/src/proguard/DescriptorKeepChecker.java +169 -0
  126. data/lib/proguard4.7/src/proguard/DuplicateClassPrinter.java +63 -0
  127. data/lib/proguard4.7/src/proguard/FileWordReader.java +55 -0
  128. data/lib/proguard4.7/src/proguard/FullyQualifiedClassNameChecker.java +191 -0
  129. data/lib/proguard4.7/src/proguard/GPL.java +197 -0
  130. data/lib/proguard4.7/src/proguard/Initializer.java +424 -0
  131. data/lib/proguard4.7/src/proguard/InputReader.java +233 -0
  132. data/lib/proguard4.7/src/proguard/KeepClassMemberChecker.java +87 -0
  133. data/lib/proguard4.7/src/proguard/KeepClassSpecification.java +137 -0
  134. data/lib/proguard4.7/src/proguard/LineWordReader.java +74 -0
  135. data/lib/proguard4.7/src/proguard/MANIFEST.MF +2 -0
  136. data/lib/proguard4.7/src/proguard/MemberSpecification.java +114 -0
  137. data/lib/proguard4.7/src/proguard/OutputWriter.java +296 -0
  138. data/lib/proguard4.7/src/proguard/ParseException.java +51 -0
  139. data/lib/proguard4.7/src/proguard/ProGuard.java +512 -0
  140. data/lib/proguard4.7/src/proguard/SeedPrinter.java +97 -0
  141. data/lib/proguard4.7/src/proguard/SubclassedClassFilter.java +62 -0
  142. data/lib/proguard4.7/src/proguard/Targeter.java +88 -0
  143. data/lib/proguard4.7/src/proguard/UpToDateChecker.java +232 -0
  144. data/lib/proguard4.7/src/proguard/WordReader.java +387 -0
  145. data/lib/proguard4.7/src/proguard/ant/ClassPathElement.java +191 -0
  146. data/lib/proguard4.7/src/proguard/ant/ClassSpecificationElement.java +258 -0
  147. data/lib/proguard4.7/src/proguard/ant/ConfigurationElement.java +53 -0
  148. data/lib/proguard4.7/src/proguard/ant/ConfigurationTask.java +441 -0
  149. data/lib/proguard4.7/src/proguard/ant/FilterElement.java +85 -0
  150. data/lib/proguard4.7/src/proguard/ant/KeepSpecificationElement.java +87 -0
  151. data/lib/proguard4.7/src/proguard/ant/MemberSpecificationElement.java +218 -0
  152. data/lib/proguard4.7/src/proguard/ant/ProGuardTask.java +352 -0
  153. data/lib/proguard4.7/src/proguard/ant/package.html +3 -0
  154. data/lib/proguard4.7/src/proguard/ant/task.properties +2 -0
  155. data/lib/proguard4.7/src/proguard/classfile/ClassConstants.java +316 -0
  156. data/lib/proguard4.7/src/proguard/classfile/ClassPool.java +152 -0
  157. data/lib/proguard4.7/src/proguard/classfile/Clazz.java +261 -0
  158. data/lib/proguard4.7/src/proguard/classfile/Field.java +32 -0
  159. data/lib/proguard4.7/src/proguard/classfile/LibraryClass.java +548 -0
  160. data/lib/proguard4.7/src/proguard/classfile/LibraryField.java +77 -0
  161. data/lib/proguard4.7/src/proguard/classfile/LibraryMember.java +108 -0
  162. data/lib/proguard4.7/src/proguard/classfile/LibraryMethod.java +83 -0
  163. data/lib/proguard4.7/src/proguard/classfile/Member.java +57 -0
  164. data/lib/proguard4.7/src/proguard/classfile/Method.java +32 -0
  165. data/lib/proguard4.7/src/proguard/classfile/ProgramClass.java +572 -0
  166. data/lib/proguard4.7/src/proguard/classfile/ProgramField.java +93 -0
  167. data/lib/proguard4.7/src/proguard/classfile/ProgramMember.java +168 -0
  168. data/lib/proguard4.7/src/proguard/classfile/ProgramMethod.java +99 -0
  169. data/lib/proguard4.7/src/proguard/classfile/VisitorAccepter.java +47 -0
  170. data/lib/proguard4.7/src/proguard/classfile/attribute/Attribute.java +142 -0
  171. data/lib/proguard4.7/src/proguard/classfile/attribute/BootstrapMethodInfo.java +89 -0
  172. data/lib/proguard4.7/src/proguard/classfile/attribute/BootstrapMethodsAttribute.java +95 -0
  173. data/lib/proguard4.7/src/proguard/classfile/attribute/CodeAttribute.java +202 -0
  174. data/lib/proguard4.7/src/proguard/classfile/attribute/ConstantValueAttribute.java +62 -0
  175. data/lib/proguard4.7/src/proguard/classfile/attribute/DeprecatedAttribute.java +66 -0
  176. data/lib/proguard4.7/src/proguard/classfile/attribute/EnclosingMethodAttribute.java +132 -0
  177. data/lib/proguard4.7/src/proguard/classfile/attribute/ExceptionInfo.java +100 -0
  178. data/lib/proguard4.7/src/proguard/classfile/attribute/ExceptionsAttribute.java +80 -0
  179. data/lib/proguard4.7/src/proguard/classfile/attribute/InnerClassesAttribute.java +80 -0
  180. data/lib/proguard4.7/src/proguard/classfile/attribute/InnerClassesInfo.java +119 -0
  181. data/lib/proguard4.7/src/proguard/classfile/attribute/LineNumberInfo.java +50 -0
  182. data/lib/proguard4.7/src/proguard/classfile/attribute/LineNumberTableAttribute.java +100 -0
  183. data/lib/proguard4.7/src/proguard/classfile/attribute/LocalVariableInfo.java +99 -0
  184. data/lib/proguard4.7/src/proguard/classfile/attribute/LocalVariableTableAttribute.java +79 -0
  185. data/lib/proguard4.7/src/proguard/classfile/attribute/LocalVariableTypeInfo.java +107 -0
  186. data/lib/proguard4.7/src/proguard/classfile/attribute/LocalVariableTypeTableAttribute.java +79 -0
  187. data/lib/proguard4.7/src/proguard/classfile/attribute/SignatureAttribute.java +100 -0
  188. data/lib/proguard4.7/src/proguard/classfile/attribute/SourceDirAttribute.java +62 -0
  189. data/lib/proguard4.7/src/proguard/classfile/attribute/SourceFileAttribute.java +62 -0
  190. data/lib/proguard4.7/src/proguard/classfile/attribute/SyntheticAttribute.java +66 -0
  191. data/lib/proguard4.7/src/proguard/classfile/attribute/UnknownAttribute.java +82 -0
  192. data/lib/proguard4.7/src/proguard/classfile/attribute/annotation/Annotation.java +143 -0
  193. data/lib/proguard4.7/src/proguard/classfile/attribute/annotation/AnnotationDefaultAttribute.java +73 -0
  194. data/lib/proguard4.7/src/proguard/classfile/attribute/annotation/AnnotationElementValue.java +76 -0
  195. data/lib/proguard4.7/src/proguard/classfile/attribute/annotation/AnnotationsAttribute.java +100 -0
  196. data/lib/proguard4.7/src/proguard/classfile/attribute/annotation/ArrayElementValue.java +82 -0
  197. data/lib/proguard4.7/src/proguard/classfile/attribute/annotation/ClassElementValue.java +95 -0
  198. data/lib/proguard4.7/src/proguard/classfile/attribute/annotation/ConstantElementValue.java +71 -0
  199. data/lib/proguard4.7/src/proguard/classfile/attribute/annotation/ElementValue.java +126 -0
  200. data/lib/proguard4.7/src/proguard/classfile/attribute/annotation/EnumConstantElementValue.java +99 -0
  201. data/lib/proguard4.7/src/proguard/classfile/attribute/annotation/ParameterAnnotationsAttribute.java +83 -0
  202. data/lib/proguard4.7/src/proguard/classfile/attribute/annotation/RuntimeInvisibleAnnotationsAttribute.java +70 -0
  203. data/lib/proguard4.7/src/proguard/classfile/attribute/annotation/RuntimeInvisibleParameterAnnotationsAttribute.java +62 -0
  204. data/lib/proguard4.7/src/proguard/classfile/attribute/annotation/RuntimeVisibleAnnotationsAttribute.java +70 -0
  205. data/lib/proguard4.7/src/proguard/classfile/attribute/annotation/RuntimeVisibleParameterAnnotationsAttribute.java +62 -0
  206. data/lib/proguard4.7/src/proguard/classfile/attribute/annotation/package.html +4 -0
  207. data/lib/proguard4.7/src/proguard/classfile/attribute/annotation/visitor/AllAnnotationVisitor.java +100 -0
  208. data/lib/proguard4.7/src/proguard/classfile/attribute/annotation/visitor/AnnotatedClassVisitor.java +62 -0
  209. data/lib/proguard4.7/src/proguard/classfile/attribute/annotation/visitor/AnnotationToMemberVisitor.java +62 -0
  210. data/lib/proguard4.7/src/proguard/classfile/attribute/annotation/visitor/AnnotationTypeFilter.java +102 -0
  211. data/lib/proguard4.7/src/proguard/classfile/attribute/annotation/visitor/AnnotationVisitor.java +40 -0
  212. data/lib/proguard4.7/src/proguard/classfile/attribute/annotation/visitor/ElementValueVisitor.java +51 -0
  213. data/lib/proguard4.7/src/proguard/classfile/attribute/annotation/visitor/package.html +3 -0
  214. data/lib/proguard4.7/src/proguard/classfile/attribute/package.html +3 -0
  215. data/lib/proguard4.7/src/proguard/classfile/attribute/preverification/DoubleType.java +66 -0
  216. data/lib/proguard4.7/src/proguard/classfile/attribute/preverification/FloatType.java +66 -0
  217. data/lib/proguard4.7/src/proguard/classfile/attribute/preverification/FullFrame.java +202 -0
  218. data/lib/proguard4.7/src/proguard/classfile/attribute/preverification/IntegerType.java +66 -0
  219. data/lib/proguard4.7/src/proguard/classfile/attribute/preverification/LessZeroFrame.java +103 -0
  220. data/lib/proguard4.7/src/proguard/classfile/attribute/preverification/LongType.java +66 -0
  221. data/lib/proguard4.7/src/proguard/classfile/attribute/preverification/MoreZeroFrame.java +161 -0
  222. data/lib/proguard4.7/src/proguard/classfile/attribute/preverification/NullType.java +66 -0
  223. data/lib/proguard4.7/src/proguard/classfile/attribute/preverification/ObjectType.java +107 -0
  224. data/lib/proguard4.7/src/proguard/classfile/attribute/preverification/SameOneFrame.java +115 -0
  225. data/lib/proguard4.7/src/proguard/classfile/attribute/preverification/SameZeroFrame.java +74 -0
  226. data/lib/proguard4.7/src/proguard/classfile/attribute/preverification/StackMapAttribute.java +91 -0
  227. data/lib/proguard4.7/src/proguard/classfile/attribute/preverification/StackMapFrame.java +117 -0
  228. data/lib/proguard4.7/src/proguard/classfile/attribute/preverification/StackMapTableAttribute.java +93 -0
  229. data/lib/proguard4.7/src/proguard/classfile/attribute/preverification/TopType.java +66 -0
  230. data/lib/proguard4.7/src/proguard/classfile/attribute/preverification/UninitializedThisType.java +66 -0
  231. data/lib/proguard4.7/src/proguard/classfile/attribute/preverification/UninitializedType.java +106 -0
  232. data/lib/proguard4.7/src/proguard/classfile/attribute/preverification/VerificationType.java +103 -0
  233. data/lib/proguard4.7/src/proguard/classfile/attribute/preverification/VerificationTypeFactory.java +112 -0
  234. data/lib/proguard4.7/src/proguard/classfile/attribute/preverification/visitor/StackMapFrameVisitor.java +40 -0
  235. data/lib/proguard4.7/src/proguard/classfile/attribute/preverification/visitor/VerificationTypeVisitor.java +65 -0
  236. data/lib/proguard4.7/src/proguard/classfile/attribute/visitor/AllAttributeVisitor.java +117 -0
  237. data/lib/proguard4.7/src/proguard/classfile/attribute/visitor/AllBootstrapMethodInfoVisitor.java +55 -0
  238. data/lib/proguard4.7/src/proguard/classfile/attribute/visitor/AllExceptionInfoVisitor.java +55 -0
  239. data/lib/proguard4.7/src/proguard/classfile/attribute/visitor/AllInnerClassesInfoVisitor.java +55 -0
  240. data/lib/proguard4.7/src/proguard/classfile/attribute/visitor/AttributeNameFilter.java +368 -0
  241. data/lib/proguard4.7/src/proguard/classfile/attribute/visitor/AttributeVisitor.java +90 -0
  242. data/lib/proguard4.7/src/proguard/classfile/attribute/visitor/BootstrapMethodInfoVisitor.java +40 -0
  243. data/lib/proguard4.7/src/proguard/classfile/attribute/visitor/ExceptionInfoVisitor.java +37 -0
  244. data/lib/proguard4.7/src/proguard/classfile/attribute/visitor/InnerClassesInfoVisitor.java +38 -0
  245. data/lib/proguard4.7/src/proguard/classfile/attribute/visitor/LineNumberInfoVisitor.java +38 -0
  246. data/lib/proguard4.7/src/proguard/classfile/attribute/visitor/LocalVariableInfoVisitor.java +38 -0
  247. data/lib/proguard4.7/src/proguard/classfile/attribute/visitor/LocalVariableTypeInfoVisitor.java +38 -0
  248. data/lib/proguard4.7/src/proguard/classfile/attribute/visitor/MultiAttributeVisitor.java +365 -0
  249. data/lib/proguard4.7/src/proguard/classfile/attribute/visitor/NonEmptyAttributeFilter.java +293 -0
  250. data/lib/proguard4.7/src/proguard/classfile/attribute/visitor/RequiredAttributeFilter.java +360 -0
  251. data/lib/proguard4.7/src/proguard/classfile/attribute/visitor/StackSizeComputer.java +378 -0
  252. data/lib/proguard4.7/src/proguard/classfile/attribute/visitor/package.html +3 -0
  253. data/lib/proguard4.7/src/proguard/classfile/constant/ClassConstant.java +105 -0
  254. data/lib/proguard4.7/src/proguard/classfile/constant/Constant.java +68 -0
  255. data/lib/proguard4.7/src/proguard/classfile/constant/DoubleConstant.java +82 -0
  256. data/lib/proguard4.7/src/proguard/classfile/constant/FieldrefConstant.java +71 -0
  257. data/lib/proguard4.7/src/proguard/classfile/constant/FloatConstant.java +82 -0
  258. data/lib/proguard4.7/src/proguard/classfile/constant/IntegerConstant.java +82 -0
  259. data/lib/proguard4.7/src/proguard/classfile/constant/InterfaceMethodrefConstant.java +71 -0
  260. data/lib/proguard4.7/src/proguard/classfile/constant/InvokeDynamicConstant.java +148 -0
  261. data/lib/proguard4.7/src/proguard/classfile/constant/LongConstant.java +82 -0
  262. data/lib/proguard4.7/src/proguard/classfile/constant/MethodHandleConstant.java +124 -0
  263. data/lib/proguard4.7/src/proguard/classfile/constant/MethodTypeConstant.java +93 -0
  264. data/lib/proguard4.7/src/proguard/classfile/constant/MethodrefConstant.java +71 -0
  265. data/lib/proguard4.7/src/proguard/classfile/constant/NameAndTypeConstant.java +119 -0
  266. data/lib/proguard4.7/src/proguard/classfile/constant/RefConstant.java +130 -0
  267. data/lib/proguard4.7/src/proguard/classfile/constant/StringConstant.java +135 -0
  268. data/lib/proguard4.7/src/proguard/classfile/constant/Utf8Constant.java +285 -0
  269. data/lib/proguard4.7/src/proguard/classfile/constant/visitor/AllConstantVisitor.java +53 -0
  270. data/lib/proguard4.7/src/proguard/classfile/constant/visitor/BootstrapMethodHandleTraveler.java +100 -0
  271. data/lib/proguard4.7/src/proguard/classfile/constant/visitor/ConstantTagFilter.java +86 -0
  272. data/lib/proguard4.7/src/proguard/classfile/constant/visitor/ConstantVisitor.java +49 -0
  273. data/lib/proguard4.7/src/proguard/classfile/constant/visitor/ExceptClassConstantFilter.java +69 -0
  274. data/lib/proguard4.7/src/proguard/classfile/constant/visitor/MethodrefTraveler.java +60 -0
  275. data/lib/proguard4.7/src/proguard/classfile/constant/visitor/package.html +3 -0
  276. data/lib/proguard4.7/src/proguard/classfile/editor/AccessFixer.java +180 -0
  277. data/lib/proguard4.7/src/proguard/classfile/editor/AnnotationAdder.java +153 -0
  278. data/lib/proguard4.7/src/proguard/classfile/editor/AnnotationsAttributeEditor.java +67 -0
  279. data/lib/proguard4.7/src/proguard/classfile/editor/AttributeAdder.java +457 -0
  280. data/lib/proguard4.7/src/proguard/classfile/editor/AttributeSorter.java +89 -0
  281. data/lib/proguard4.7/src/proguard/classfile/editor/AttributesEditor.java +269 -0
  282. data/lib/proguard4.7/src/proguard/classfile/editor/BridgeMethodFixer.java +117 -0
  283. data/lib/proguard4.7/src/proguard/classfile/editor/ClassEditor.java +255 -0
  284. data/lib/proguard4.7/src/proguard/classfile/editor/ClassElementSorter.java +52 -0
  285. data/lib/proguard4.7/src/proguard/classfile/editor/ClassMemberSorter.java +69 -0
  286. data/lib/proguard4.7/src/proguard/classfile/editor/ClassReferenceFixer.java +546 -0
  287. data/lib/proguard4.7/src/proguard/classfile/editor/CodeAttributeComposer.java +843 -0
  288. data/lib/proguard4.7/src/proguard/classfile/editor/CodeAttributeEditor.java +1104 -0
  289. data/lib/proguard4.7/src/proguard/classfile/editor/CodeAttributeEditorResetter.java +60 -0
  290. data/lib/proguard4.7/src/proguard/classfile/editor/ComparableConstant.java +249 -0
  291. data/lib/proguard4.7/src/proguard/classfile/editor/ConstantAdder.java +239 -0
  292. data/lib/proguard4.7/src/proguard/classfile/editor/ConstantPoolEditor.java +782 -0
  293. data/lib/proguard4.7/src/proguard/classfile/editor/ConstantPoolRemapper.java +662 -0
  294. data/lib/proguard4.7/src/proguard/classfile/editor/ConstantPoolShrinker.java +578 -0
  295. data/lib/proguard4.7/src/proguard/classfile/editor/ConstantPoolSorter.java +123 -0
  296. data/lib/proguard4.7/src/proguard/classfile/editor/ElementValueAdder.java +217 -0
  297. data/lib/proguard4.7/src/proguard/classfile/editor/ElementValuesEditor.java +238 -0
  298. data/lib/proguard4.7/src/proguard/classfile/editor/ExceptionAdder.java +65 -0
  299. data/lib/proguard4.7/src/proguard/classfile/editor/ExceptionInfoAdder.java +67 -0
  300. data/lib/proguard4.7/src/proguard/classfile/editor/ExceptionsAttributeEditor.java +68 -0
  301. data/lib/proguard4.7/src/proguard/classfile/editor/InnerClassesAccessFixer.java +83 -0
  302. data/lib/proguard4.7/src/proguard/classfile/editor/InstructionAdder.java +76 -0
  303. data/lib/proguard4.7/src/proguard/classfile/editor/InstructionWriter.java +278 -0
  304. data/lib/proguard4.7/src/proguard/classfile/editor/InterfaceAdder.java +62 -0
  305. data/lib/proguard4.7/src/proguard/classfile/editor/InterfaceSorter.java +152 -0
  306. data/lib/proguard4.7/src/proguard/classfile/editor/InterfacesEditor.java +122 -0
  307. data/lib/proguard4.7/src/proguard/classfile/editor/LineNumberInfoAdder.java +59 -0
  308. data/lib/proguard4.7/src/proguard/classfile/editor/LineNumberTableAttributeEditor.java +67 -0
  309. data/lib/proguard4.7/src/proguard/classfile/editor/LocalVariableInfoAdder.java +67 -0
  310. data/lib/proguard4.7/src/proguard/classfile/editor/LocalVariableTableAttributeEditor.java +67 -0
  311. data/lib/proguard4.7/src/proguard/classfile/editor/LocalVariableTypeInfoAdder.java +68 -0
  312. data/lib/proguard4.7/src/proguard/classfile/editor/LocalVariableTypeTableAttributeEditor.java +68 -0
  313. data/lib/proguard4.7/src/proguard/classfile/editor/MemberAdder.java +288 -0
  314. data/lib/proguard4.7/src/proguard/classfile/editor/MemberReferenceFixer.java +447 -0
  315. data/lib/proguard4.7/src/proguard/classfile/editor/MethodInvocationFixer.java +243 -0
  316. data/lib/proguard4.7/src/proguard/classfile/editor/NameAndTypeShrinker.java +188 -0
  317. data/lib/proguard4.7/src/proguard/classfile/editor/NamedAttributeDeleter.java +54 -0
  318. data/lib/proguard4.7/src/proguard/classfile/editor/ParameterAnnotationsAttributeEditor.java +71 -0
  319. data/lib/proguard4.7/src/proguard/classfile/editor/StackSizeUpdater.java +54 -0
  320. data/lib/proguard4.7/src/proguard/classfile/editor/SubclassAdder.java +59 -0
  321. data/lib/proguard4.7/src/proguard/classfile/editor/SubclassToAdder.java +60 -0
  322. data/lib/proguard4.7/src/proguard/classfile/editor/Utf8Shrinker.java +455 -0
  323. data/lib/proguard4.7/src/proguard/classfile/editor/VariableCleaner.java +267 -0
  324. data/lib/proguard4.7/src/proguard/classfile/editor/VariableEditor.java +130 -0
  325. data/lib/proguard4.7/src/proguard/classfile/editor/VariableRemapper.java +156 -0
  326. data/lib/proguard4.7/src/proguard/classfile/editor/VariableSizeUpdater.java +105 -0
  327. data/lib/proguard4.7/src/proguard/classfile/editor/package.html +3 -0
  328. data/lib/proguard4.7/src/proguard/classfile/instruction/BranchInstruction.java +180 -0
  329. data/lib/proguard4.7/src/proguard/classfile/instruction/ConstantInstruction.java +309 -0
  330. data/lib/proguard4.7/src/proguard/classfile/instruction/Instruction.java +920 -0
  331. data/lib/proguard4.7/src/proguard/classfile/instruction/InstructionConstants.java +449 -0
  332. data/lib/proguard4.7/src/proguard/classfile/instruction/InstructionFactory.java +300 -0
  333. data/lib/proguard4.7/src/proguard/classfile/instruction/InstructionUtil.java +67 -0
  334. data/lib/proguard4.7/src/proguard/classfile/instruction/LookUpSwitchInstruction.java +135 -0
  335. data/lib/proguard4.7/src/proguard/classfile/instruction/SimpleInstruction.java +255 -0
  336. data/lib/proguard4.7/src/proguard/classfile/instruction/SwitchInstruction.java +83 -0
  337. data/lib/proguard4.7/src/proguard/classfile/instruction/TableSwitchInstruction.java +139 -0
  338. data/lib/proguard4.7/src/proguard/classfile/instruction/VariableInstruction.java +372 -0
  339. data/lib/proguard4.7/src/proguard/classfile/instruction/package.html +9 -0
  340. data/lib/proguard4.7/src/proguard/classfile/instruction/visitor/AllInstructionVisitor.java +56 -0
  341. data/lib/proguard4.7/src/proguard/classfile/instruction/visitor/InstructionCounter.java +59 -0
  342. data/lib/proguard4.7/src/proguard/classfile/instruction/visitor/InstructionVisitor.java +42 -0
  343. data/lib/proguard4.7/src/proguard/classfile/instruction/visitor/MultiInstructionVisitor.java +131 -0
  344. data/lib/proguard4.7/src/proguard/classfile/instruction/visitor/package.html +3 -0
  345. data/lib/proguard4.7/src/proguard/classfile/io/LibraryClassReader.java +383 -0
  346. data/lib/proguard4.7/src/proguard/classfile/io/ProgramClassReader.java +919 -0
  347. data/lib/proguard4.7/src/proguard/classfile/io/ProgramClassWriter.java +735 -0
  348. data/lib/proguard4.7/src/proguard/classfile/io/RuntimeDataInput.java +223 -0
  349. data/lib/proguard4.7/src/proguard/classfile/io/RuntimeDataOutput.java +224 -0
  350. data/lib/proguard4.7/src/proguard/classfile/io/package.html +3 -0
  351. data/lib/proguard4.7/src/proguard/classfile/package.html +15 -0
  352. data/lib/proguard4.7/src/proguard/classfile/util/AccessUtil.java +105 -0
  353. data/lib/proguard4.7/src/proguard/classfile/util/ClassReferenceInitializer.java +559 -0
  354. data/lib/proguard4.7/src/proguard/classfile/util/ClassSubHierarchyInitializer.java +77 -0
  355. data/lib/proguard4.7/src/proguard/classfile/util/ClassSuperHierarchyInitializer.java +163 -0
  356. data/lib/proguard4.7/src/proguard/classfile/util/ClassUtil.java +1227 -0
  357. data/lib/proguard4.7/src/proguard/classfile/util/DescriptorClassEnumeration.java +236 -0
  358. data/lib/proguard4.7/src/proguard/classfile/util/DynamicClassReferenceInitializer.java +485 -0
  359. data/lib/proguard4.7/src/proguard/classfile/util/DynamicMemberReferenceInitializer.java +944 -0
  360. data/lib/proguard4.7/src/proguard/classfile/util/ExternalTypeEnumeration.java +106 -0
  361. data/lib/proguard4.7/src/proguard/classfile/util/InstructionSequenceMatcher.java +754 -0
  362. data/lib/proguard4.7/src/proguard/classfile/util/InternalTypeEnumeration.java +204 -0
  363. data/lib/proguard4.7/src/proguard/classfile/util/MemberFinder.java +197 -0
  364. data/lib/proguard4.7/src/proguard/classfile/util/MethodLinker.java +160 -0
  365. data/lib/proguard4.7/src/proguard/classfile/util/SimplifiedVisitor.java +834 -0
  366. data/lib/proguard4.7/src/proguard/classfile/util/StringReferenceInitializer.java +90 -0
  367. data/lib/proguard4.7/src/proguard/classfile/util/StringSharer.java +172 -0
  368. data/lib/proguard4.7/src/proguard/classfile/util/WarningPrinter.java +136 -0
  369. data/lib/proguard4.7/src/proguard/classfile/util/package.html +3 -0
  370. data/lib/proguard4.7/src/proguard/classfile/visitor/AllClassVisitor.java +47 -0
  371. data/lib/proguard4.7/src/proguard/classfile/visitor/AllFieldVisitor.java +55 -0
  372. data/lib/proguard4.7/src/proguard/classfile/visitor/AllMemberVisitor.java +57 -0
  373. data/lib/proguard4.7/src/proguard/classfile/visitor/AllMethodVisitor.java +55 -0
  374. data/lib/proguard4.7/src/proguard/classfile/visitor/BottomClassFilter.java +69 -0
  375. data/lib/proguard4.7/src/proguard/classfile/visitor/ClassAccessFilter.java +88 -0
  376. data/lib/proguard4.7/src/proguard/classfile/visitor/ClassCleaner.java +275 -0
  377. data/lib/proguard4.7/src/proguard/classfile/visitor/ClassCollector.java +58 -0
  378. data/lib/proguard4.7/src/proguard/classfile/visitor/ClassCounter.java +56 -0
  379. data/lib/proguard4.7/src/proguard/classfile/visitor/ClassHierarchyTraveler.java +91 -0
  380. data/lib/proguard4.7/src/proguard/classfile/visitor/ClassNameFilter.java +112 -0
  381. data/lib/proguard4.7/src/proguard/classfile/visitor/ClassPoolFiller.java +55 -0
  382. data/lib/proguard4.7/src/proguard/classfile/visitor/ClassPoolVisitor.java +37 -0
  383. data/lib/proguard4.7/src/proguard/classfile/visitor/ClassPresenceFilter.java +93 -0
  384. data/lib/proguard4.7/src/proguard/classfile/visitor/ClassPrinter.java +1011 -0
  385. data/lib/proguard4.7/src/proguard/classfile/visitor/ClassVersionFilter.java +85 -0
  386. data/lib/proguard4.7/src/proguard/classfile/visitor/ClassVersionSetter.java +83 -0
  387. data/lib/proguard4.7/src/proguard/classfile/visitor/ClassVisitor.java +36 -0
  388. data/lib/proguard4.7/src/proguard/classfile/visitor/ConcreteClassDownTraveler.java +100 -0
  389. data/lib/proguard4.7/src/proguard/classfile/visitor/DotClassClassVisitor.java +89 -0
  390. data/lib/proguard4.7/src/proguard/classfile/visitor/ExceptClassFilter.java +69 -0
  391. data/lib/proguard4.7/src/proguard/classfile/visitor/ExceptClassesFilter.java +90 -0
  392. data/lib/proguard4.7/src/proguard/classfile/visitor/ExceptionCounter.java +52 -0
  393. data/lib/proguard4.7/src/proguard/classfile/visitor/ExceptionExcludedOffsetFilter.java +64 -0
  394. data/lib/proguard4.7/src/proguard/classfile/visitor/ExceptionHandlerConstantVisitor.java +62 -0
  395. data/lib/proguard4.7/src/proguard/classfile/visitor/ExceptionHandlerFilter.java +70 -0
  396. data/lib/proguard4.7/src/proguard/classfile/visitor/ExceptionOffsetFilter.java +64 -0
  397. data/lib/proguard4.7/src/proguard/classfile/visitor/ExceptionRangeFilter.java +68 -0
  398. data/lib/proguard4.7/src/proguard/classfile/visitor/ImplementedClassConstantFilter.java +69 -0
  399. data/lib/proguard4.7/src/proguard/classfile/visitor/ImplementedClassFilter.java +71 -0
  400. data/lib/proguard4.7/src/proguard/classfile/visitor/ImplementingClassConstantFilter.java +70 -0
  401. data/lib/proguard4.7/src/proguard/classfile/visitor/LibraryClassFilter.java +60 -0
  402. data/lib/proguard4.7/src/proguard/classfile/visitor/LibraryMemberFilter.java +73 -0
  403. data/lib/proguard4.7/src/proguard/classfile/visitor/MemberAccessFilter.java +122 -0
  404. data/lib/proguard4.7/src/proguard/classfile/visitor/MemberClassAccessFilter.java +106 -0
  405. data/lib/proguard4.7/src/proguard/classfile/visitor/MemberCollector.java +59 -0
  406. data/lib/proguard4.7/src/proguard/classfile/visitor/MemberCounter.java +72 -0
  407. data/lib/proguard4.7/src/proguard/classfile/visitor/MemberDescriptorFilter.java +113 -0
  408. data/lib/proguard4.7/src/proguard/classfile/visitor/MemberNameFilter.java +113 -0
  409. data/lib/proguard4.7/src/proguard/classfile/visitor/MemberToClassVisitor.java +90 -0
  410. data/lib/proguard4.7/src/proguard/classfile/visitor/MemberVisitor.java +40 -0
  411. data/lib/proguard4.7/src/proguard/classfile/visitor/MethodImplementationFilter.java +70 -0
  412. data/lib/proguard4.7/src/proguard/classfile/visitor/MethodImplementationTraveler.java +128 -0
  413. data/lib/proguard4.7/src/proguard/classfile/visitor/MultiClassPoolVisitor.java +88 -0
  414. data/lib/proguard4.7/src/proguard/classfile/visitor/MultiClassVisitor.java +97 -0
  415. data/lib/proguard4.7/src/proguard/classfile/visitor/MultiMemberVisitor.java +113 -0
  416. data/lib/proguard4.7/src/proguard/classfile/visitor/NamedClassVisitor.java +49 -0
  417. data/lib/proguard4.7/src/proguard/classfile/visitor/NamedFieldVisitor.java +61 -0
  418. data/lib/proguard4.7/src/proguard/classfile/visitor/NamedMethodVisitor.java +61 -0
  419. data/lib/proguard4.7/src/proguard/classfile/visitor/ProgramClassFilter.java +60 -0
  420. data/lib/proguard4.7/src/proguard/classfile/visitor/ProgramMemberFilter.java +73 -0
  421. data/lib/proguard4.7/src/proguard/classfile/visitor/ReferencedClassVisitor.java +255 -0
  422. data/lib/proguard4.7/src/proguard/classfile/visitor/ReferencedMemberVisitor.java +73 -0
  423. data/lib/proguard4.7/src/proguard/classfile/visitor/SimilarMemberVisitor.java +125 -0
  424. data/lib/proguard4.7/src/proguard/classfile/visitor/SimpleClassPrinter.java +167 -0
  425. data/lib/proguard4.7/src/proguard/classfile/visitor/SubclassFilter.java +91 -0
  426. data/lib/proguard4.7/src/proguard/classfile/visitor/SubclassTraveler.java +60 -0
  427. data/lib/proguard4.7/src/proguard/classfile/visitor/VariableClassVisitor.java +78 -0
  428. data/lib/proguard4.7/src/proguard/classfile/visitor/VariableMemberVisitor.java +96 -0
  429. data/lib/proguard4.7/src/proguard/classfile/visitor/package.html +40 -0
  430. data/lib/proguard4.7/src/proguard/evaluation/BasicBranchUnit.java +126 -0
  431. data/lib/proguard4.7/src/proguard/evaluation/BasicInvocationUnit.java +425 -0
  432. data/lib/proguard4.7/src/proguard/evaluation/BranchUnit.java +63 -0
  433. data/lib/proguard4.7/src/proguard/evaluation/ClassConstantValueFactory.java +53 -0
  434. data/lib/proguard4.7/src/proguard/evaluation/ConstantValueFactory.java +113 -0
  435. data/lib/proguard4.7/src/proguard/evaluation/InvocationUnit.java +62 -0
  436. data/lib/proguard4.7/src/proguard/evaluation/Processor.java +908 -0
  437. data/lib/proguard4.7/src/proguard/evaluation/Stack.java +560 -0
  438. data/lib/proguard4.7/src/proguard/evaluation/TracedStack.java +342 -0
  439. data/lib/proguard4.7/src/proguard/evaluation/TracedVariables.java +199 -0
  440. data/lib/proguard4.7/src/proguard/evaluation/Variables.java +347 -0
  441. data/lib/proguard4.7/src/proguard/evaluation/value/Category1Value.java +41 -0
  442. data/lib/proguard4.7/src/proguard/evaluation/value/Category2Value.java +41 -0
  443. data/lib/proguard4.7/src/proguard/evaluation/value/ComparisonValue.java +69 -0
  444. data/lib/proguard4.7/src/proguard/evaluation/value/CompositeDoubleValue.java +81 -0
  445. data/lib/proguard4.7/src/proguard/evaluation/value/CompositeFloatValue.java +81 -0
  446. data/lib/proguard4.7/src/proguard/evaluation/value/CompositeIntegerValue.java +87 -0
  447. data/lib/proguard4.7/src/proguard/evaluation/value/CompositeLongValue.java +87 -0
  448. data/lib/proguard4.7/src/proguard/evaluation/value/ConvertedByteValue.java +64 -0
  449. data/lib/proguard4.7/src/proguard/evaluation/value/ConvertedCharacterValue.java +64 -0
  450. data/lib/proguard4.7/src/proguard/evaluation/value/ConvertedDoubleValue.java +64 -0
  451. data/lib/proguard4.7/src/proguard/evaluation/value/ConvertedFloatValue.java +64 -0
  452. data/lib/proguard4.7/src/proguard/evaluation/value/ConvertedIntegerValue.java +64 -0
  453. data/lib/proguard4.7/src/proguard/evaluation/value/ConvertedLongValue.java +64 -0
  454. data/lib/proguard4.7/src/proguard/evaluation/value/ConvertedShortValue.java +64 -0
  455. data/lib/proguard4.7/src/proguard/evaluation/value/DoubleValue.java +359 -0
  456. data/lib/proguard4.7/src/proguard/evaluation/value/FloatValue.java +359 -0
  457. data/lib/proguard4.7/src/proguard/evaluation/value/IdentifiedDoubleValue.java +67 -0
  458. data/lib/proguard4.7/src/proguard/evaluation/value/IdentifiedFloatValue.java +67 -0
  459. data/lib/proguard4.7/src/proguard/evaluation/value/IdentifiedIntegerValue.java +67 -0
  460. data/lib/proguard4.7/src/proguard/evaluation/value/IdentifiedLongValue.java +67 -0
  461. data/lib/proguard4.7/src/proguard/evaluation/value/IdentifiedReferenceValue.java +102 -0
  462. data/lib/proguard4.7/src/proguard/evaluation/value/IdentifiedValueFactory.java +75 -0
  463. data/lib/proguard4.7/src/proguard/evaluation/value/InstructionOffsetValue.java +307 -0
  464. data/lib/proguard4.7/src/proguard/evaluation/value/IntegerValue.java +1002 -0
  465. data/lib/proguard4.7/src/proguard/evaluation/value/LongValue.java +554 -0
  466. data/lib/proguard4.7/src/proguard/evaluation/value/NegatedDoubleValue.java +71 -0
  467. data/lib/proguard4.7/src/proguard/evaluation/value/NegatedFloatValue.java +71 -0
  468. data/lib/proguard4.7/src/proguard/evaluation/value/NegatedIntegerValue.java +71 -0
  469. data/lib/proguard4.7/src/proguard/evaluation/value/NegatedLongValue.java +71 -0
  470. data/lib/proguard4.7/src/proguard/evaluation/value/ParticularDoubleValue.java +216 -0
  471. data/lib/proguard4.7/src/proguard/evaluation/value/ParticularFloatValue.java +216 -0
  472. data/lib/proguard4.7/src/proguard/evaluation/value/ParticularIntegerValue.java +383 -0
  473. data/lib/proguard4.7/src/proguard/evaluation/value/ParticularLongValue.java +271 -0
  474. data/lib/proguard4.7/src/proguard/evaluation/value/ReferenceValue.java +540 -0
  475. data/lib/proguard4.7/src/proguard/evaluation/value/SpecificDoubleValue.java +186 -0
  476. data/lib/proguard4.7/src/proguard/evaluation/value/SpecificFloatValue.java +186 -0
  477. data/lib/proguard4.7/src/proguard/evaluation/value/SpecificIntegerValue.java +354 -0
  478. data/lib/proguard4.7/src/proguard/evaluation/value/SpecificLongValue.java +259 -0
  479. data/lib/proguard4.7/src/proguard/evaluation/value/SpecificValueFactory.java +97 -0
  480. data/lib/proguard4.7/src/proguard/evaluation/value/TopValue.java +79 -0
  481. data/lib/proguard4.7/src/proguard/evaluation/value/UnknownDoubleValue.java +125 -0
  482. data/lib/proguard4.7/src/proguard/evaluation/value/UnknownFloatValue.java +125 -0
  483. data/lib/proguard4.7/src/proguard/evaluation/value/UnknownIntegerValue.java +216 -0
  484. data/lib/proguard4.7/src/proguard/evaluation/value/UnknownLongValue.java +160 -0
  485. data/lib/proguard4.7/src/proguard/evaluation/value/Value.java +169 -0
  486. data/lib/proguard4.7/src/proguard/evaluation/value/ValueFactory.java +193 -0
  487. data/lib/proguard4.7/src/proguard/evaluation/value/package.html +3 -0
  488. data/lib/proguard4.7/src/proguard/gui/ClassPathPanel.java +441 -0
  489. data/lib/proguard4.7/src/proguard/gui/ClassSpecificationDialog.java +546 -0
  490. data/lib/proguard4.7/src/proguard/gui/ClassSpecificationsPanel.java +231 -0
  491. data/lib/proguard4.7/src/proguard/gui/ExtensionFileFilter.java +78 -0
  492. data/lib/proguard4.7/src/proguard/gui/FilterBuilder.java +208 -0
  493. data/lib/proguard4.7/src/proguard/gui/FilterDialog.java +320 -0
  494. data/lib/proguard4.7/src/proguard/gui/GUIResources.java +56 -0
  495. data/lib/proguard4.7/src/proguard/gui/GUIResources.properties +643 -0
  496. data/lib/proguard4.7/src/proguard/gui/KeepSpecificationsPanel.java +81 -0
  497. data/lib/proguard4.7/src/proguard/gui/ListPanel.java +341 -0
  498. data/lib/proguard4.7/src/proguard/gui/MANIFEST.MF +3 -0
  499. data/lib/proguard4.7/src/proguard/gui/MemberSpecificationDialog.java +509 -0
  500. data/lib/proguard4.7/src/proguard/gui/MemberSpecificationsPanel.java +304 -0
  501. data/lib/proguard4.7/src/proguard/gui/MessageDialogRunnable.java +90 -0
  502. data/lib/proguard4.7/src/proguard/gui/OptimizationsDialog.java +251 -0
  503. data/lib/proguard4.7/src/proguard/gui/ProGuardGUI.java +1777 -0
  504. data/lib/proguard4.7/src/proguard/gui/ProGuardRunnable.java +154 -0
  505. data/lib/proguard4.7/src/proguard/gui/ReTraceRunnable.java +149 -0
  506. data/lib/proguard4.7/src/proguard/gui/SwingUtil.java +82 -0
  507. data/lib/proguard4.7/src/proguard/gui/TabbedPane.java +229 -0
  508. data/lib/proguard4.7/src/proguard/gui/TextAreaOutputStream.java +81 -0
  509. data/lib/proguard4.7/src/proguard/gui/arrow.gif +0 -0
  510. data/lib/proguard4.7/src/proguard/gui/boilerplate.pro +410 -0
  511. data/lib/proguard4.7/src/proguard/gui/default.pro +318 -0
  512. data/lib/proguard4.7/src/proguard/gui/package.html +3 -0
  513. data/lib/proguard4.7/src/proguard/gui/splash/BufferedSprite.java +145 -0
  514. data/lib/proguard4.7/src/proguard/gui/splash/CircleSprite.java +74 -0
  515. data/lib/proguard4.7/src/proguard/gui/splash/ClipSprite.java +85 -0
  516. data/lib/proguard4.7/src/proguard/gui/splash/ColorSprite.java +65 -0
  517. data/lib/proguard4.7/src/proguard/gui/splash/CompositeSprite.java +56 -0
  518. data/lib/proguard4.7/src/proguard/gui/splash/ConstantColor.java +51 -0
  519. data/lib/proguard4.7/src/proguard/gui/splash/ConstantDouble.java +49 -0
  520. data/lib/proguard4.7/src/proguard/gui/splash/ConstantFont.java +46 -0
  521. data/lib/proguard4.7/src/proguard/gui/splash/ConstantInt.java +49 -0
  522. data/lib/proguard4.7/src/proguard/gui/splash/ConstantString.java +49 -0
  523. data/lib/proguard4.7/src/proguard/gui/splash/ConstantTiming.java +57 -0
  524. data/lib/proguard4.7/src/proguard/gui/splash/FontSprite.java +65 -0
  525. data/lib/proguard4.7/src/proguard/gui/splash/ImageSprite.java +76 -0
  526. data/lib/proguard4.7/src/proguard/gui/splash/LinearColor.java +72 -0
  527. data/lib/proguard4.7/src/proguard/gui/splash/LinearDouble.java +55 -0
  528. data/lib/proguard4.7/src/proguard/gui/splash/LinearInt.java +55 -0
  529. data/lib/proguard4.7/src/proguard/gui/splash/LinearTiming.java +55 -0
  530. data/lib/proguard4.7/src/proguard/gui/splash/OverrideGraphics2D.java +598 -0
  531. data/lib/proguard4.7/src/proguard/gui/splash/RectangleSprite.java +114 -0
  532. data/lib/proguard4.7/src/proguard/gui/splash/SawToothTiming.java +53 -0
  533. data/lib/proguard4.7/src/proguard/gui/splash/ShadowedSprite.java +109 -0
  534. data/lib/proguard4.7/src/proguard/gui/splash/SineTiming.java +53 -0
  535. data/lib/proguard4.7/src/proguard/gui/splash/SmoothTiming.java +66 -0
  536. data/lib/proguard4.7/src/proguard/gui/splash/SplashPanel.java +235 -0
  537. data/lib/proguard4.7/src/proguard/gui/splash/Sprite.java +41 -0
  538. data/lib/proguard4.7/src/proguard/gui/splash/TextSprite.java +89 -0
  539. data/lib/proguard4.7/src/proguard/gui/splash/TimeSwitchSprite.java +75 -0
  540. data/lib/proguard4.7/src/proguard/gui/splash/Timing.java +34 -0
  541. data/lib/proguard4.7/src/proguard/gui/splash/TypeWriterString.java +71 -0
  542. data/lib/proguard4.7/src/proguard/gui/splash/VariableColor.java +36 -0
  543. data/lib/proguard4.7/src/proguard/gui/splash/VariableDouble.java +34 -0
  544. data/lib/proguard4.7/src/proguard/gui/splash/VariableFont.java +36 -0
  545. data/lib/proguard4.7/src/proguard/gui/splash/VariableInt.java +34 -0
  546. data/lib/proguard4.7/src/proguard/gui/splash/VariableSizeFont.java +65 -0
  547. data/lib/proguard4.7/src/proguard/gui/splash/VariableString.java +34 -0
  548. data/lib/proguard4.7/src/proguard/gui/splash/package.html +4 -0
  549. data/lib/proguard4.7/src/proguard/gui/vtitle.png +0 -0
  550. data/lib/proguard4.7/src/proguard/io/CascadingDataEntryWriter.java +94 -0
  551. data/lib/proguard4.7/src/proguard/io/ClassFilter.java +59 -0
  552. data/lib/proguard4.7/src/proguard/io/ClassReader.java +115 -0
  553. data/lib/proguard4.7/src/proguard/io/ClassRewriter.java +80 -0
  554. data/lib/proguard4.7/src/proguard/io/DataEntry.java +62 -0
  555. data/lib/proguard4.7/src/proguard/io/DataEntryClassWriter.java +85 -0
  556. data/lib/proguard4.7/src/proguard/io/DataEntryCopier.java +247 -0
  557. data/lib/proguard4.7/src/proguard/io/DataEntryDirectoryFilter.java +40 -0
  558. data/lib/proguard4.7/src/proguard/io/DataEntryFilter.java +38 -0
  559. data/lib/proguard4.7/src/proguard/io/DataEntryNameFilter.java +54 -0
  560. data/lib/proguard4.7/src/proguard/io/DataEntryObfuscator.java +150 -0
  561. data/lib/proguard4.7/src/proguard/io/DataEntryParentFilter.java +51 -0
  562. data/lib/proguard4.7/src/proguard/io/DataEntryPump.java +43 -0
  563. data/lib/proguard4.7/src/proguard/io/DataEntryReader.java +38 -0
  564. data/lib/proguard4.7/src/proguard/io/DataEntryRenamer.java +104 -0
  565. data/lib/proguard4.7/src/proguard/io/DataEntryRewriter.java +148 -0
  566. data/lib/proguard4.7/src/proguard/io/DataEntryWriter.java +73 -0
  567. data/lib/proguard4.7/src/proguard/io/DirectoryFilter.java +58 -0
  568. data/lib/proguard4.7/src/proguard/io/DirectoryPump.java +78 -0
  569. data/lib/proguard4.7/src/proguard/io/DirectoryWriter.java +165 -0
  570. data/lib/proguard4.7/src/proguard/io/FileDataEntry.java +96 -0
  571. data/lib/proguard4.7/src/proguard/io/FilteredDataEntryReader.java +90 -0
  572. data/lib/proguard4.7/src/proguard/io/FilteredDataEntryWriter.java +125 -0
  573. data/lib/proguard4.7/src/proguard/io/Finisher.java +37 -0
  574. data/lib/proguard4.7/src/proguard/io/JarReader.java +75 -0
  575. data/lib/proguard4.7/src/proguard/io/JarWriter.java +235 -0
  576. data/lib/proguard4.7/src/proguard/io/ManifestRewriter.java +216 -0
  577. data/lib/proguard4.7/src/proguard/io/NameFilter.java +83 -0
  578. data/lib/proguard4.7/src/proguard/io/ParentDataEntryWriter.java +75 -0
  579. data/lib/proguard4.7/src/proguard/io/RenamedDataEntry.java +83 -0
  580. data/lib/proguard4.7/src/proguard/io/ZipDataEntry.java +98 -0
  581. data/lib/proguard4.7/src/proguard/io/package.html +4 -0
  582. data/lib/proguard4.7/src/proguard/obfuscate/AttributeShrinker.java +120 -0
  583. data/lib/proguard4.7/src/proguard/obfuscate/AttributeUsageMarker.java +71 -0
  584. data/lib/proguard4.7/src/proguard/obfuscate/ClassObfuscator.java +533 -0
  585. data/lib/proguard4.7/src/proguard/obfuscate/ClassRenamer.java +109 -0
  586. data/lib/proguard4.7/src/proguard/obfuscate/DictionaryNameFactory.java +189 -0
  587. data/lib/proguard4.7/src/proguard/obfuscate/MapCleaner.java +57 -0
  588. data/lib/proguard4.7/src/proguard/obfuscate/MappingKeeper.java +177 -0
  589. data/lib/proguard4.7/src/proguard/obfuscate/MappingPrinter.java +147 -0
  590. data/lib/proguard4.7/src/proguard/obfuscate/MappingProcessor.java +79 -0
  591. data/lib/proguard4.7/src/proguard/obfuscate/MappingReader.java +199 -0
  592. data/lib/proguard4.7/src/proguard/obfuscate/MemberNameCleaner.java +60 -0
  593. data/lib/proguard4.7/src/proguard/obfuscate/MemberNameCollector.java +106 -0
  594. data/lib/proguard4.7/src/proguard/obfuscate/MemberNameConflictFixer.java +159 -0
  595. data/lib/proguard4.7/src/proguard/obfuscate/MemberNameFilter.java +120 -0
  596. data/lib/proguard4.7/src/proguard/obfuscate/MemberObfuscator.java +230 -0
  597. data/lib/proguard4.7/src/proguard/obfuscate/MemberSpecialNameFilter.java +101 -0
  598. data/lib/proguard4.7/src/proguard/obfuscate/MultiMappingProcessor.java +96 -0
  599. data/lib/proguard4.7/src/proguard/obfuscate/NameFactory.java +34 -0
  600. data/lib/proguard4.7/src/proguard/obfuscate/NameFactoryResetter.java +59 -0
  601. data/lib/proguard4.7/src/proguard/obfuscate/NameMarker.java +166 -0
  602. data/lib/proguard4.7/src/proguard/obfuscate/NumericNameFactory.java +49 -0
  603. data/lib/proguard4.7/src/proguard/obfuscate/Obfuscator.java +445 -0
  604. data/lib/proguard4.7/src/proguard/obfuscate/ParameterNameMarker.java +128 -0
  605. data/lib/proguard4.7/src/proguard/obfuscate/SimpleNameFactory.java +156 -0
  606. data/lib/proguard4.7/src/proguard/obfuscate/SourceFileRenamer.java +84 -0
  607. data/lib/proguard4.7/src/proguard/obfuscate/SpecialNameFactory.java +83 -0
  608. data/lib/proguard4.7/src/proguard/obfuscate/package.html +3 -0
  609. data/lib/proguard4.7/src/proguard/optimize/BootstrapMethodArgumentShrinker.java +103 -0
  610. data/lib/proguard4.7/src/proguard/optimize/ChangedCodePrinter.java +297 -0
  611. data/lib/proguard4.7/src/proguard/optimize/ConstantMemberFilter.java +77 -0
  612. data/lib/proguard4.7/src/proguard/optimize/ConstantParameterFilter.java +79 -0
  613. data/lib/proguard4.7/src/proguard/optimize/DuplicateInitializerFixer.java +215 -0
  614. data/lib/proguard4.7/src/proguard/optimize/DuplicateInitializerInvocationFixer.java +161 -0
  615. data/lib/proguard4.7/src/proguard/optimize/KeepMarker.java +95 -0
  616. data/lib/proguard4.7/src/proguard/optimize/KeptClassFilter.java +69 -0
  617. data/lib/proguard4.7/src/proguard/optimize/KeptMemberFilter.java +88 -0
  618. data/lib/proguard4.7/src/proguard/optimize/MemberDescriptorSpecializer.java +138 -0
  619. data/lib/proguard4.7/src/proguard/optimize/MethodDescriptorShrinker.java +317 -0
  620. data/lib/proguard4.7/src/proguard/optimize/MethodStaticizer.java +87 -0
  621. data/lib/proguard4.7/src/proguard/optimize/OptimizationInfoMemberFilter.java +94 -0
  622. data/lib/proguard4.7/src/proguard/optimize/Optimizer.java +963 -0
  623. data/lib/proguard4.7/src/proguard/optimize/ParameterShrinker.java +146 -0
  624. data/lib/proguard4.7/src/proguard/optimize/TailRecursionSimplifier.java +356 -0
  625. data/lib/proguard4.7/src/proguard/optimize/WriteOnlyFieldFilter.java +65 -0
  626. data/lib/proguard4.7/src/proguard/optimize/evaluation/EvaluationShrinker.java +2082 -0
  627. data/lib/proguard4.7/src/proguard/optimize/evaluation/EvaluationSimplifier.java +973 -0
  628. data/lib/proguard4.7/src/proguard/optimize/evaluation/LivenessAnalyzer.java +526 -0
  629. data/lib/proguard4.7/src/proguard/optimize/evaluation/LoadingInvocationUnit.java +195 -0
  630. data/lib/proguard4.7/src/proguard/optimize/evaluation/PartialEvaluator.java +1282 -0
  631. data/lib/proguard4.7/src/proguard/optimize/evaluation/StoringInvocationUnit.java +207 -0
  632. data/lib/proguard4.7/src/proguard/optimize/evaluation/TracedBranchUnit.java +59 -0
  633. data/lib/proguard4.7/src/proguard/optimize/evaluation/VariableOptimizer.java +345 -0
  634. data/lib/proguard4.7/src/proguard/optimize/evaluation/package.html +4 -0
  635. data/lib/proguard4.7/src/proguard/optimize/info/AccessMethodMarker.java +202 -0
  636. data/lib/proguard4.7/src/proguard/optimize/info/BackwardBranchMarker.java +90 -0
  637. data/lib/proguard4.7/src/proguard/optimize/info/CatchExceptionMarker.java +69 -0
  638. data/lib/proguard4.7/src/proguard/optimize/info/CaughtClassFilter.java +63 -0
  639. data/lib/proguard4.7/src/proguard/optimize/info/CaughtClassMarker.java +64 -0
  640. data/lib/proguard4.7/src/proguard/optimize/info/ClassOptimizationInfo.java +165 -0
  641. data/lib/proguard4.7/src/proguard/optimize/info/ClassOptimizationInfoSetter.java +47 -0
  642. data/lib/proguard4.7/src/proguard/optimize/info/DotClassFilter.java +63 -0
  643. data/lib/proguard4.7/src/proguard/optimize/info/DotClassMarker.java +96 -0
  644. data/lib/proguard4.7/src/proguard/optimize/info/ExceptionInstructionChecker.java +193 -0
  645. data/lib/proguard4.7/src/proguard/optimize/info/FieldOptimizationInfo.java +204 -0
  646. data/lib/proguard4.7/src/proguard/optimize/info/InstanceofClassFilter.java +63 -0
  647. data/lib/proguard4.7/src/proguard/optimize/info/InstanceofClassMarker.java +93 -0
  648. data/lib/proguard4.7/src/proguard/optimize/info/InstantiationClassFilter.java +62 -0
  649. data/lib/proguard4.7/src/proguard/optimize/info/InstantiationClassMarker.java +93 -0
  650. data/lib/proguard4.7/src/proguard/optimize/info/MemberOptimizationInfoSetter.java +59 -0
  651. data/lib/proguard4.7/src/proguard/optimize/info/MethodInvocationMarker.java +107 -0
  652. data/lib/proguard4.7/src/proguard/optimize/info/MethodOptimizationInfo.java +302 -0
  653. data/lib/proguard4.7/src/proguard/optimize/info/NoSideEffectMethodMarker.java +91 -0
  654. data/lib/proguard4.7/src/proguard/optimize/info/NonPrivateMemberMarker.java +171 -0
  655. data/lib/proguard4.7/src/proguard/optimize/info/PackageVisibleMemberContainingClassMarker.java +85 -0
  656. data/lib/proguard4.7/src/proguard/optimize/info/PackageVisibleMemberInvokingClassMarker.java +129 -0
  657. data/lib/proguard4.7/src/proguard/optimize/info/ParameterUsageMarker.java +285 -0
  658. data/lib/proguard4.7/src/proguard/optimize/info/ReadWriteFieldMarker.java +163 -0
  659. data/lib/proguard4.7/src/proguard/optimize/info/SideEffectInstructionChecker.java +245 -0
  660. data/lib/proguard4.7/src/proguard/optimize/info/SideEffectMethodMarker.java +175 -0
  661. data/lib/proguard4.7/src/proguard/optimize/info/StaticInitializerContainingClassFilter.java +62 -0
  662. data/lib/proguard4.7/src/proguard/optimize/info/StaticInitializerContainingClassMarker.java +65 -0
  663. data/lib/proguard4.7/src/proguard/optimize/info/SuperInvocationMarker.java +93 -0
  664. data/lib/proguard4.7/src/proguard/optimize/info/VariableUsageMarker.java +96 -0
  665. data/lib/proguard4.7/src/proguard/optimize/info/package.html +4 -0
  666. data/lib/proguard4.7/src/proguard/optimize/package.html +4 -0
  667. data/lib/proguard4.7/src/proguard/optimize/peephole/BranchTargetFinder.java +687 -0
  668. data/lib/proguard4.7/src/proguard/optimize/peephole/ClassFinalizer.java +84 -0
  669. data/lib/proguard4.7/src/proguard/optimize/peephole/ClassMerger.java +576 -0
  670. data/lib/proguard4.7/src/proguard/optimize/peephole/GotoCommonCodeReplacer.java +266 -0
  671. data/lib/proguard4.7/src/proguard/optimize/peephole/GotoGotoReplacer.java +115 -0
  672. data/lib/proguard4.7/src/proguard/optimize/peephole/GotoReturnReplacer.java +115 -0
  673. data/lib/proguard4.7/src/proguard/optimize/peephole/HorizontalClassMerger.java +90 -0
  674. data/lib/proguard4.7/src/proguard/optimize/peephole/InstructionSequenceConstants.java +4424 -0
  675. data/lib/proguard4.7/src/proguard/optimize/peephole/InstructionSequenceReplacer.java +420 -0
  676. data/lib/proguard4.7/src/proguard/optimize/peephole/InstructionSequencesReplacer.java +138 -0
  677. data/lib/proguard4.7/src/proguard/optimize/peephole/MemberPrivatizer.java +103 -0
  678. data/lib/proguard4.7/src/proguard/optimize/peephole/MethodFinalizer.java +93 -0
  679. data/lib/proguard4.7/src/proguard/optimize/peephole/MethodInliner.java +597 -0
  680. data/lib/proguard4.7/src/proguard/optimize/peephole/NopRemover.java +89 -0
  681. data/lib/proguard4.7/src/proguard/optimize/peephole/PeepholeOptimizer.java +103 -0
  682. data/lib/proguard4.7/src/proguard/optimize/peephole/ReachableCodeMarker.java +262 -0
  683. data/lib/proguard4.7/src/proguard/optimize/peephole/RetargetedInnerClassAttributeRemover.java +170 -0
  684. data/lib/proguard4.7/src/proguard/optimize/peephole/TargetClassChanger.java +455 -0
  685. data/lib/proguard4.7/src/proguard/optimize/peephole/UnreachableCodeRemover.java +143 -0
  686. data/lib/proguard4.7/src/proguard/optimize/peephole/UnreachableExceptionRemover.java +163 -0
  687. data/lib/proguard4.7/src/proguard/optimize/peephole/VariableShrinker.java +129 -0
  688. data/lib/proguard4.7/src/proguard/optimize/peephole/VerticalClassMerger.java +88 -0
  689. data/lib/proguard4.7/src/proguard/optimize/peephole/package.html +3 -0
  690. data/lib/proguard4.7/src/proguard/package.html +5 -0
  691. data/lib/proguard4.7/src/proguard/preverify/CodePreverifier.java +611 -0
  692. data/lib/proguard4.7/src/proguard/preverify/CodeSubroutineInliner.java +406 -0
  693. data/lib/proguard4.7/src/proguard/preverify/Preverifier.java +73 -0
  694. data/lib/proguard4.7/src/proguard/preverify/SubroutineInliner.java +73 -0
  695. data/lib/proguard4.7/src/proguard/retrace/MANIFEST.MF +3 -0
  696. data/lib/proguard4.7/src/proguard/retrace/ReTrace.java +749 -0
  697. data/lib/proguard4.7/src/proguard/retrace/package.html +4 -0
  698. data/lib/proguard4.7/src/proguard/shrink/AnnotationUsageMarker.java +333 -0
  699. data/lib/proguard4.7/src/proguard/shrink/ClassShrinker.java +458 -0
  700. data/lib/proguard4.7/src/proguard/shrink/InnerUsageMarker.java +174 -0
  701. data/lib/proguard4.7/src/proguard/shrink/InterfaceUsageMarker.java +152 -0
  702. data/lib/proguard4.7/src/proguard/shrink/ShortestUsageMark.java +183 -0
  703. data/lib/proguard4.7/src/proguard/shrink/ShortestUsageMarker.java +277 -0
  704. data/lib/proguard4.7/src/proguard/shrink/ShortestUsagePrinter.java +210 -0
  705. data/lib/proguard4.7/src/proguard/shrink/Shrinker.java +181 -0
  706. data/lib/proguard4.7/src/proguard/shrink/UsageMarker.java +1036 -0
  707. data/lib/proguard4.7/src/proguard/shrink/UsagePrinter.java +177 -0
  708. data/lib/proguard4.7/src/proguard/shrink/UsedClassFilter.java +74 -0
  709. data/lib/proguard4.7/src/proguard/shrink/UsedMemberFilter.java +93 -0
  710. data/lib/proguard4.7/src/proguard/shrink/package.html +3 -0
  711. data/lib/proguard4.7/src/proguard/util/AndMatcher.java +49 -0
  712. data/lib/proguard4.7/src/proguard/util/ClassNameParser.java +216 -0
  713. data/lib/proguard4.7/src/proguard/util/ConstantMatcher.java +48 -0
  714. data/lib/proguard4.7/src/proguard/util/EmptyStringMatcher.java +36 -0
  715. data/lib/proguard4.7/src/proguard/util/ExtensionMatcher.java +63 -0
  716. data/lib/proguard4.7/src/proguard/util/FileNameParser.java +121 -0
  717. data/lib/proguard4.7/src/proguard/util/FixedStringMatcher.java +56 -0
  718. data/lib/proguard4.7/src/proguard/util/ListMatcher.java +69 -0
  719. data/lib/proguard4.7/src/proguard/util/ListParser.java +137 -0
  720. data/lib/proguard4.7/src/proguard/util/ListUtil.java +180 -0
  721. data/lib/proguard4.7/src/proguard/util/NameParser.java +106 -0
  722. data/lib/proguard4.7/src/proguard/util/NotMatcher.java +46 -0
  723. data/lib/proguard4.7/src/proguard/util/OrMatcher.java +49 -0
  724. data/lib/proguard4.7/src/proguard/util/SettableMatcher.java +46 -0
  725. data/lib/proguard4.7/src/proguard/util/StringMatcher.java +38 -0
  726. data/lib/proguard4.7/src/proguard/util/StringParser.java +35 -0
  727. data/lib/proguard4.7/src/proguard/util/VariableStringMatcher.java +126 -0
  728. data/lib/proguard4.7/src/proguard/util/package.html +3 -0
  729. data/lib/proguard4.7/src/proguard/wtk/ProGuardObfuscator.java +141 -0
  730. data/lib/proguard4.7/src/proguard/wtk/default.pro +114 -0
  731. data/lib/proguard4.7/src/proguard/wtk/package.html +3 -0
  732. metadata +960 -10
@@ -0,0 +1,1777 @@
1
+ /*
2
+ * ProGuard -- shrinking, optimization, obfuscation, and preverification
3
+ * of Java bytecode.
4
+ *
5
+ * Copyright (c) 2002-2011 Eric Lafortune (eric@graphics.cornell.edu)
6
+ *
7
+ * This program is free software; you can redistribute it and/or modify it
8
+ * under the terms of the GNU General Public License as published by the Free
9
+ * Software Foundation; either version 2 of the License, or (at your option)
10
+ * any later version.
11
+ *
12
+ * This program is distributed in the hope that it will be useful, but WITHOUT
13
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15
+ * more details.
16
+ *
17
+ * You should have received a copy of the GNU General Public License along
18
+ * with this program; if not, write to the Free Software Foundation, Inc.,
19
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20
+ */
21
+ package proguard.gui;
22
+
23
+ import proguard.*;
24
+ import proguard.classfile.util.ClassUtil;
25
+ import proguard.gui.splash.*;
26
+ import proguard.util.ListUtil;
27
+
28
+ import javax.swing.*;
29
+ import javax.swing.border.*;
30
+ import java.awt.*;
31
+ import java.awt.event.*;
32
+ import java.io.*;
33
+ import java.net.URL;
34
+ import java.util.*;
35
+ import java.util.List;
36
+
37
+
38
+ /**
39
+ * GUI for configuring and executing ProGuard and ReTrace.
40
+ *
41
+ * @author Eric Lafortune
42
+ */
43
+ public class ProGuardGUI extends JFrame
44
+ {
45
+ private static final String NO_SPLASH_OPTION = "-nosplash";
46
+
47
+ private static final String TITLE_IMAGE_FILE = "vtitle.png";
48
+ private static final String BOILERPLATE_CONFIGURATION = "boilerplate.pro";
49
+ private static final String DEFAULT_CONFIGURATION = "default.pro";
50
+
51
+ private static final String OPTIMIZATIONS_DEFAULT = "*";
52
+ private static final String KEEP_ATTRIBUTE_DEFAULT = "Exceptions,InnerClasses,Signature,Deprecated,SourceFile,LineNumberTable,LocalVariable*Table,*Annotation*,Synthetic,EnclosingMethod";
53
+ private static final String SOURCE_FILE_ATTRIBUTE_DEFAULT = "SourceFile";
54
+ private static final String ADAPT_RESOURCE_FILE_NAMES_DEFAULT = "**.properties";
55
+ private static final String ADAPT_RESOURCE_FILE_CONTENTS_DEFAULT = "**.properties,META-INF/MANIFEST.MF";
56
+
57
+ private static final Border BORDER = BorderFactory.createEtchedBorder(EtchedBorder.RAISED);
58
+
59
+ static boolean systemOutRedirected;
60
+
61
+ private final JFileChooser configurationChooser = new JFileChooser("");
62
+ private final JFileChooser fileChooser = new JFileChooser("");
63
+
64
+ private final SplashPanel splashPanel;
65
+
66
+ private final ClassPathPanel programPanel = new ClassPathPanel(this, true);
67
+ private final ClassPathPanel libraryPanel = new ClassPathPanel(this, false);
68
+
69
+ private KeepClassSpecification[] boilerplateKeep;
70
+ private final JCheckBox[] boilerplateKeepCheckBoxes;
71
+ private final JTextField[] boilerplateKeepTextFields;
72
+
73
+ private final KeepSpecificationsPanel additionalKeepPanel = new KeepSpecificationsPanel(this, true, false, false, false, false);
74
+
75
+ private KeepClassSpecification[] boilerplateKeepNames;
76
+ private final JCheckBox[] boilerplateKeepNamesCheckBoxes;
77
+ private final JTextField[] boilerplateKeepNamesTextFields;
78
+
79
+ private final KeepSpecificationsPanel additionalKeepNamesPanel = new KeepSpecificationsPanel(this, true, false, true, false, false);
80
+
81
+ private ClassSpecification[] boilerplateNoSideEffectMethods;
82
+ private final JCheckBox[] boilerplateNoSideEffectMethodCheckBoxes;
83
+
84
+ private final ClassSpecificationsPanel additionalNoSideEffectsPanel = new ClassSpecificationsPanel(this, false);
85
+
86
+ private final ClassSpecificationsPanel whyAreYouKeepingPanel = new ClassSpecificationsPanel(this, false);
87
+
88
+ private final JCheckBox shrinkCheckBox = new JCheckBox(msg("shrink"));
89
+ private final JCheckBox printUsageCheckBox = new JCheckBox(msg("printUsage"));
90
+
91
+ private final JCheckBox optimizeCheckBox = new JCheckBox(msg("optimize"));
92
+ private final JCheckBox allowAccessModificationCheckBox = new JCheckBox(msg("allowAccessModification"));
93
+ private final JCheckBox mergeInterfacesAggressivelyCheckBox = new JCheckBox(msg("mergeInterfacesAggressively"));
94
+ private final JLabel optimizationsLabel = new JLabel(msg("optimizations"));
95
+ private final JLabel optimizationPassesLabel = new JLabel(msg("optimizationPasses"));
96
+
97
+ private final JSpinner optimizationPassesSpinner = new JSpinner(new SpinnerNumberModel(1, 1, 9, 1));
98
+
99
+ private final JCheckBox obfuscateCheckBox = new JCheckBox(msg("obfuscate"));
100
+ private final JCheckBox printMappingCheckBox = new JCheckBox(msg("printMapping"));
101
+ private final JCheckBox applyMappingCheckBox = new JCheckBox(msg("applyMapping"));
102
+ private final JCheckBox obfuscationDictionaryCheckBox = new JCheckBox(msg("obfuscationDictionary"));
103
+ private final JCheckBox classObfuscationDictionaryCheckBox = new JCheckBox(msg("classObfuscationDictionary"));
104
+ private final JCheckBox packageObfuscationDictionaryCheckBox = new JCheckBox(msg("packageObfuscationDictionary"));
105
+ private final JCheckBox overloadAggressivelyCheckBox = new JCheckBox(msg("overloadAggressively"));
106
+ private final JCheckBox useUniqueClassMemberNamesCheckBox = new JCheckBox(msg("useUniqueClassMemberNames"));
107
+ private final JCheckBox useMixedCaseClassNamesCheckBox = new JCheckBox(msg("useMixedCaseClassNames"));
108
+ private final JCheckBox keepPackageNamesCheckBox = new JCheckBox(msg("keepPackageNames"));
109
+ private final JCheckBox flattenPackageHierarchyCheckBox = new JCheckBox(msg("flattenPackageHierarchy"));
110
+ private final JCheckBox repackageClassesCheckBox = new JCheckBox(msg("repackageClasses"));
111
+ private final JCheckBox keepAttributesCheckBox = new JCheckBox(msg("keepAttributes"));
112
+ private final JCheckBox keepParameterNamesCheckBox = new JCheckBox(msg("keepParameterNames"));
113
+ private final JCheckBox newSourceFileAttributeCheckBox = new JCheckBox(msg("renameSourceFileAttribute"));
114
+ private final JCheckBox adaptClassStringsCheckBox = new JCheckBox(msg("adaptClassStrings"));
115
+ private final JCheckBox adaptResourceFileNamesCheckBox = new JCheckBox(msg("adaptResourceFileNames"));
116
+ private final JCheckBox adaptResourceFileContentsCheckBox = new JCheckBox(msg("adaptResourceFileContents"));
117
+
118
+ private final JCheckBox preverifyCheckBox = new JCheckBox(msg("preverify"));
119
+ private final JCheckBox microEditionCheckBox = new JCheckBox(msg("microEdition"));
120
+ private final JCheckBox targetCheckBox = new JCheckBox(msg("target"));
121
+
122
+ private final JComboBox targetComboBox = new JComboBox(ListUtil.commaSeparatedList(msg("targets")).toArray());
123
+
124
+ private final JCheckBox verboseCheckBox = new JCheckBox(msg("verbose"));
125
+ private final JCheckBox noteCheckBox = new JCheckBox(msg("note"));
126
+ private final JCheckBox warnCheckBox = new JCheckBox(msg("warn"));
127
+ private final JCheckBox ignoreWarningsCheckBox = new JCheckBox(msg("ignoreWarnings"));
128
+ private final JCheckBox skipNonPublicLibraryClassesCheckBox = new JCheckBox(msg("skipNonPublicLibraryClasses"));
129
+ private final JCheckBox skipNonPublicLibraryClassMembersCheckBox = new JCheckBox(msg("skipNonPublicLibraryClassMembers"));
130
+ private final JCheckBox keepDirectoriesCheckBox = new JCheckBox(msg("keepDirectories"));
131
+ private final JCheckBox forceProcessingCheckBox = new JCheckBox(msg("forceProcessing"));
132
+ private final JCheckBox printSeedsCheckBox = new JCheckBox(msg("printSeeds"));
133
+ private final JCheckBox printConfigurationCheckBox = new JCheckBox(msg("printConfiguration"));
134
+ private final JCheckBox dumpCheckBox = new JCheckBox(msg("dump"));
135
+
136
+ private final JTextField printUsageTextField = new JTextField(40);
137
+ private final JTextField optimizationsTextField = new JTextField(40);
138
+ private final JTextField printMappingTextField = new JTextField(40);
139
+ private final JTextField applyMappingTextField = new JTextField(40);
140
+ private final JTextField obfuscationDictionaryTextField = new JTextField(40);
141
+ private final JTextField classObfuscationDictionaryTextField = new JTextField(40);
142
+ private final JTextField packageObfuscationDictionaryTextField = new JTextField(40);
143
+ private final JTextField keepPackageNamesTextField = new JTextField(40);
144
+ private final JTextField flattenPackageHierarchyTextField = new JTextField(40);
145
+ private final JTextField repackageClassesTextField = new JTextField(40);
146
+ private final JTextField keepAttributesTextField = new JTextField(40);
147
+ private final JTextField newSourceFileAttributeTextField = new JTextField(40);
148
+ private final JTextField adaptClassStringsTextField = new JTextField(40);
149
+ private final JTextField adaptResourceFileNamesTextField = new JTextField(40);
150
+ private final JTextField adaptResourceFileContentsTextField = new JTextField(40);
151
+ private final JTextField noteTextField = new JTextField(40);
152
+ private final JTextField warnTextField = new JTextField(40);
153
+ private final JTextField keepDirectoriesTextField = new JTextField(40);
154
+ private final JTextField printSeedsTextField = new JTextField(40);
155
+ private final JTextField printConfigurationTextField = new JTextField(40);
156
+ private final JTextField dumpTextField = new JTextField(40);
157
+
158
+ private final JTextArea consoleTextArea = new JTextArea(msg("processingInfo"), 3, 40);
159
+
160
+ private final JCheckBox reTraceVerboseCheckBox = new JCheckBox(msg("verbose"));
161
+ private final JTextField reTraceMappingTextField = new JTextField(40);
162
+ private final JTextArea stackTraceTextArea = new JTextArea(3, 40);
163
+ private final JTextArea reTraceTextArea = new JTextArea(msg("reTraceInfo"), 3, 40);
164
+
165
+
166
+ /**
167
+ * Creates a new ProGuardGUI.
168
+ */
169
+ public ProGuardGUI()
170
+ {
171
+ setTitle("ProGuard");
172
+ setDefaultCloseOperation(EXIT_ON_CLOSE);
173
+
174
+ // Create some constraints that can be reused.
175
+ GridBagConstraints constraints = new GridBagConstraints();
176
+ constraints.anchor = GridBagConstraints.WEST;
177
+ constraints.insets = new Insets(0, 4, 0, 4);
178
+
179
+ GridBagConstraints constraintsStretch = new GridBagConstraints();
180
+ constraintsStretch.fill = GridBagConstraints.HORIZONTAL;
181
+ constraintsStretch.weightx = 1.0;
182
+ constraintsStretch.anchor = GridBagConstraints.WEST;
183
+ constraintsStretch.insets = constraints.insets;
184
+
185
+ GridBagConstraints constraintsLast = new GridBagConstraints();
186
+ constraintsLast.gridwidth = GridBagConstraints.REMAINDER;
187
+ constraintsLast.anchor = GridBagConstraints.WEST;
188
+ constraintsLast.insets = constraints.insets;
189
+
190
+ GridBagConstraints constraintsLastStretch = new GridBagConstraints();
191
+ constraintsLastStretch.gridwidth = GridBagConstraints.REMAINDER;
192
+ constraintsLastStretch.fill = GridBagConstraints.HORIZONTAL;
193
+ constraintsLastStretch.weightx = 1.0;
194
+ constraintsLastStretch.anchor = GridBagConstraints.WEST;
195
+ constraintsLastStretch.insets = constraints.insets;
196
+
197
+ GridBagConstraints splashPanelConstraints = new GridBagConstraints();
198
+ splashPanelConstraints.gridwidth = GridBagConstraints.REMAINDER;
199
+ splashPanelConstraints.fill = GridBagConstraints.BOTH;
200
+ splashPanelConstraints.weightx = 1.0;
201
+ splashPanelConstraints.weighty = 0.02;
202
+ splashPanelConstraints.anchor = GridBagConstraints.NORTHWEST;
203
+ //splashPanelConstraints.insets = constraints.insets;
204
+
205
+ GridBagConstraints welcomePaneConstraints = new GridBagConstraints();
206
+ welcomePaneConstraints.gridwidth = GridBagConstraints.REMAINDER;
207
+ welcomePaneConstraints.fill = GridBagConstraints.NONE;
208
+ welcomePaneConstraints.weightx = 1.0;
209
+ welcomePaneConstraints.weighty = 0.01;
210
+ welcomePaneConstraints.anchor = GridBagConstraints.CENTER;//NORTHWEST;
211
+ welcomePaneConstraints.insets = new Insets(20, 40, 20, 40);
212
+
213
+ GridBagConstraints panelConstraints = new GridBagConstraints();
214
+ panelConstraints.gridwidth = GridBagConstraints.REMAINDER;
215
+ panelConstraints.fill = GridBagConstraints.HORIZONTAL;
216
+ panelConstraints.weightx = 1.0;
217
+ panelConstraints.anchor = GridBagConstraints.NORTHWEST;
218
+ panelConstraints.insets = constraints.insets;
219
+
220
+ GridBagConstraints stretchPanelConstraints = new GridBagConstraints();
221
+ stretchPanelConstraints.gridwidth = GridBagConstraints.REMAINDER;
222
+ stretchPanelConstraints.fill = GridBagConstraints.BOTH;
223
+ stretchPanelConstraints.weightx = 1.0;
224
+ stretchPanelConstraints.weighty = 1.0;
225
+ stretchPanelConstraints.anchor = GridBagConstraints.NORTHWEST;
226
+ stretchPanelConstraints.insets = constraints.insets;
227
+
228
+ GridBagConstraints glueConstraints = new GridBagConstraints();
229
+ glueConstraints.fill = GridBagConstraints.BOTH;
230
+ glueConstraints.weightx = 0.01;
231
+ glueConstraints.weighty = 0.01;
232
+ glueConstraints.anchor = GridBagConstraints.NORTHWEST;
233
+ glueConstraints.insets = constraints.insets;
234
+
235
+ GridBagConstraints bottomButtonConstraints = new GridBagConstraints();
236
+ bottomButtonConstraints.anchor = GridBagConstraints.SOUTHEAST;
237
+ bottomButtonConstraints.insets = new Insets(2, 2, 4, 6);
238
+ bottomButtonConstraints.ipadx = 10;
239
+ bottomButtonConstraints.ipady = 2;
240
+
241
+ GridBagConstraints lastBottomButtonConstraints = new GridBagConstraints();
242
+ lastBottomButtonConstraints.gridwidth = GridBagConstraints.REMAINDER;
243
+ lastBottomButtonConstraints.anchor = GridBagConstraints.SOUTHEAST;
244
+ lastBottomButtonConstraints.insets = bottomButtonConstraints.insets;
245
+ lastBottomButtonConstraints.ipadx = bottomButtonConstraints.ipadx;
246
+ lastBottomButtonConstraints.ipady = bottomButtonConstraints.ipady;
247
+
248
+ // Leave room for a growBox on Mac OS X.
249
+ if (System.getProperty("os.name").toLowerCase().startsWith("mac os x"))
250
+ {
251
+ lastBottomButtonConstraints.insets = new Insets(2, 2, 4, 6 + 16);
252
+ }
253
+
254
+ GridBagLayout layout = new GridBagLayout();
255
+
256
+ configurationChooser.addChoosableFileFilter(
257
+ new ExtensionFileFilter(msg("proExtension"), new String[] { ".pro" }));
258
+
259
+ // Create the opening panel.
260
+ Sprite splash =
261
+ new CompositeSprite(new Sprite[]
262
+ {
263
+ new ColorSprite(new ConstantColor(Color.gray),
264
+ new FontSprite(new ConstantFont(new Font("sansserif", Font.BOLD, 90)),
265
+ new TextSprite(new ConstantString("ProGuard"),
266
+ new ConstantInt(160),
267
+ new LinearInt(-10, 120, new SmoothTiming(500, 1000))))),
268
+
269
+ new ColorSprite(new ConstantColor(Color.white),
270
+ new FontSprite(new ConstantFont(new Font("sansserif", Font.BOLD, 45)),
271
+ new ShadowedSprite(new ConstantInt(3),
272
+ new ConstantInt(3),
273
+ new ConstantDouble(0.4),
274
+ new ConstantInt(1),
275
+ new CompositeSprite(new Sprite[]
276
+ {
277
+ new TextSprite(new ConstantString(msg("shrinking")),
278
+ new LinearInt(1000, 60, new SmoothTiming(1000, 2000)),
279
+ new ConstantInt(70)),
280
+ new TextSprite(new ConstantString(msg("optimization")),
281
+ new LinearInt(1000, 400, new SmoothTiming(1500, 2500)),
282
+ new ConstantInt(60)),
283
+ new TextSprite(new ConstantString(msg("obfuscation")),
284
+ new LinearInt(1000, 10, new SmoothTiming(2000, 3000)),
285
+ new ConstantInt(145)),
286
+ new TextSprite(new ConstantString(msg("preverification")),
287
+ new LinearInt(1000, 350, new SmoothTiming(2500, 3500)),
288
+ new ConstantInt(140)),
289
+ new FontSprite(new ConstantFont(new Font("sansserif", Font.BOLD, 30)),
290
+ new TextSprite(new TypeWriterString(msg("developed"), new LinearTiming(3500, 5500)),
291
+ new ConstantInt(250),
292
+ new ConstantInt(200))),
293
+ })))),
294
+ });
295
+ splashPanel = new SplashPanel(splash, 0.5, 5500L);
296
+ splashPanel.setPreferredSize(new Dimension(0, 200));
297
+
298
+ JEditorPane welcomePane = new JEditorPane("text/html", msg("proGuardInfo"));
299
+ welcomePane.setPreferredSize(new Dimension(640, 350));
300
+ // The constant HONOR_DISPLAY_PROPERTIES isn't present yet in JDK 1.4.
301
+ //welcomePane.putClientProperty(JEditorPane.HONOR_DISPLAY_PROPERTIES, Boolean.TRUE);
302
+ welcomePane.putClientProperty("JEditorPane.honorDisplayProperties", Boolean.TRUE);
303
+ welcomePane.setOpaque(false);
304
+ welcomePane.setEditable(false);
305
+ welcomePane.setBorder(new EmptyBorder(20, 20, 20, 20));
306
+ addBorder(welcomePane, "welcome");
307
+
308
+ JPanel proGuardPanel = new JPanel(layout);
309
+ proGuardPanel.add(splashPanel, splashPanelConstraints);
310
+ proGuardPanel.add(welcomePane, welcomePaneConstraints);
311
+
312
+ // Create the input panel.
313
+ // TODO: properly clone the ClassPath objects.
314
+ // This is awkward to implement in the generic ListPanel.addElements(...)
315
+ // method, since the Object.clone() method is not public.
316
+ programPanel.addCopyToPanelButton("moveToLibraries", "moveToLibrariesTip", libraryPanel);
317
+ libraryPanel.addCopyToPanelButton("moveToProgram", "moveToProgramTip", programPanel);
318
+
319
+ // Collect all buttons of these panels and make sure they are equally
320
+ // sized.
321
+ List panelButtons = new ArrayList();
322
+ panelButtons.addAll(programPanel.getButtons());
323
+ panelButtons.addAll(libraryPanel.getButtons());
324
+ setCommonPreferredSize(panelButtons);
325
+
326
+ addBorder(programPanel, "programJars" );
327
+ addBorder(libraryPanel, "libraryJars" );
328
+
329
+ JPanel inputOutputPanel = new JPanel(layout);
330
+ inputOutputPanel.add(tip(programPanel, "programJarsTip"), stretchPanelConstraints);
331
+ inputOutputPanel.add(tip(libraryPanel, "libraryJarsTip"), stretchPanelConstraints);
332
+
333
+ // Load the boiler plate options.
334
+ loadBoilerplateConfiguration();
335
+
336
+ // Create the boiler plate keep panels.
337
+ boilerplateKeepCheckBoxes = new JCheckBox[boilerplateKeep.length];
338
+ boilerplateKeepTextFields = new JTextField[boilerplateKeep.length];
339
+
340
+ JButton printUsageBrowseButton = createBrowseButton(printUsageTextField,
341
+ msg("selectUsageFile"));
342
+
343
+ JPanel shrinkingOptionsPanel = new JPanel(layout);
344
+ addBorder(shrinkingOptionsPanel, "options");
345
+
346
+ shrinkingOptionsPanel.add(tip(shrinkCheckBox, "shrinkTip"), constraintsLastStretch);
347
+ shrinkingOptionsPanel.add(tip(printUsageCheckBox, "printUsageTip"), constraints);
348
+ shrinkingOptionsPanel.add(tip(printUsageTextField, "outputFileTip"), constraintsStretch);
349
+ shrinkingOptionsPanel.add(tip(printUsageBrowseButton, "selectUsageFile"), constraintsLast);
350
+
351
+ JPanel shrinkingPanel = new JPanel(layout);
352
+
353
+ shrinkingPanel.add(shrinkingOptionsPanel, panelConstraints);
354
+ addClassSpecifications(extractClassSpecifications(boilerplateKeep),
355
+ shrinkingPanel,
356
+ boilerplateKeepCheckBoxes,
357
+ boilerplateKeepTextFields);
358
+
359
+ addBorder(additionalKeepPanel, "keepAdditional");
360
+ shrinkingPanel.add(tip(additionalKeepPanel, "keepAdditionalTip"), stretchPanelConstraints);
361
+
362
+ // Create the boiler plate keep names panels.
363
+ boilerplateKeepNamesCheckBoxes = new JCheckBox[boilerplateKeepNames.length];
364
+ boilerplateKeepNamesTextFields = new JTextField[boilerplateKeepNames.length];
365
+
366
+ JButton printMappingBrowseButton = createBrowseButton(printMappingTextField,
367
+ msg("selectPrintMappingFile"));
368
+ JButton applyMappingBrowseButton = createBrowseButton(applyMappingTextField,
369
+ msg("selectApplyMappingFile"));
370
+ JButton obfucationDictionaryBrowseButton = createBrowseButton(obfuscationDictionaryTextField,
371
+ msg("selectObfuscationDictionaryFile"));
372
+ JButton classObfucationDictionaryBrowseButton = createBrowseButton(classObfuscationDictionaryTextField,
373
+ msg("selectObfuscationDictionaryFile"));
374
+ JButton packageObfucationDictionaryBrowseButton = createBrowseButton(packageObfuscationDictionaryTextField,
375
+ msg("selectObfuscationDictionaryFile"));
376
+
377
+ JPanel obfuscationOptionsPanel = new JPanel(layout);
378
+ addBorder(obfuscationOptionsPanel, "options");
379
+
380
+ obfuscationOptionsPanel.add(tip(obfuscateCheckBox, "obfuscateTip"), constraintsLastStretch);
381
+ obfuscationOptionsPanel.add(tip(printMappingCheckBox, "printMappingTip"), constraints);
382
+ obfuscationOptionsPanel.add(tip(printMappingTextField, "outputFileTip"), constraintsStretch);
383
+ obfuscationOptionsPanel.add(tip(printMappingBrowseButton, "selectPrintMappingFile"), constraintsLast);
384
+ obfuscationOptionsPanel.add(tip(applyMappingCheckBox, "applyMappingTip"), constraints);
385
+ obfuscationOptionsPanel.add(tip(applyMappingTextField, "inputFileTip"), constraintsStretch);
386
+ obfuscationOptionsPanel.add(tip(applyMappingBrowseButton, "selectApplyMappingFile"), constraintsLast);
387
+ obfuscationOptionsPanel.add(tip(obfuscationDictionaryCheckBox, "obfuscationDictionaryTip"), constraints);
388
+ obfuscationOptionsPanel.add(tip(obfuscationDictionaryTextField, "inputFileTip"), constraintsStretch);
389
+ obfuscationOptionsPanel.add(tip(obfucationDictionaryBrowseButton, "selectObfuscationDictionaryFile"), constraintsLast);
390
+ obfuscationOptionsPanel.add(tip(classObfuscationDictionaryCheckBox, "classObfuscationDictionaryTip"), constraints);
391
+ obfuscationOptionsPanel.add(tip(classObfuscationDictionaryTextField, "inputFileTip"), constraintsStretch);
392
+ obfuscationOptionsPanel.add(tip(classObfucationDictionaryBrowseButton, "selectObfuscationDictionaryFile"), constraintsLast);
393
+ obfuscationOptionsPanel.add(tip(packageObfuscationDictionaryCheckBox, "packageObfuscationDictionaryTip"), constraints);
394
+ obfuscationOptionsPanel.add(tip(packageObfuscationDictionaryTextField, "inputFileTip"), constraintsStretch);
395
+ obfuscationOptionsPanel.add(tip(packageObfucationDictionaryBrowseButton, "selectObfuscationDictionaryFile"), constraintsLast);
396
+ obfuscationOptionsPanel.add(tip(overloadAggressivelyCheckBox, "overloadAggressivelyTip"), constraintsLastStretch);
397
+ obfuscationOptionsPanel.add(tip(useUniqueClassMemberNamesCheckBox, "useUniqueClassMemberNamesTip"), constraintsLastStretch);
398
+ obfuscationOptionsPanel.add(tip(useMixedCaseClassNamesCheckBox, "useMixedCaseClassNamesTip"), constraintsLastStretch);
399
+ obfuscationOptionsPanel.add(tip(keepPackageNamesCheckBox, "keepPackageNamesTip"), constraints);
400
+ obfuscationOptionsPanel.add(tip(keepPackageNamesTextField, "packageNamesTip"), constraintsLastStretch);
401
+ obfuscationOptionsPanel.add(tip(flattenPackageHierarchyCheckBox, "flattenPackageHierarchyTip"), constraints);
402
+ obfuscationOptionsPanel.add(tip(flattenPackageHierarchyTextField, "packageTip"), constraintsLastStretch);
403
+ obfuscationOptionsPanel.add(tip(repackageClassesCheckBox, "repackageClassesTip"), constraints);
404
+ obfuscationOptionsPanel.add(tip(repackageClassesTextField, "packageTip"), constraintsLastStretch);
405
+ obfuscationOptionsPanel.add(tip(keepAttributesCheckBox, "keepAttributesTip"), constraints);
406
+ obfuscationOptionsPanel.add(tip(keepAttributesTextField, "attributesTip"), constraintsLastStretch);
407
+ obfuscationOptionsPanel.add(tip(keepParameterNamesCheckBox, "keepParameterNamesTip"), constraintsLastStretch);
408
+ obfuscationOptionsPanel.add(tip(newSourceFileAttributeCheckBox, "renameSourceFileAttributeTip"), constraints);
409
+ obfuscationOptionsPanel.add(tip(newSourceFileAttributeTextField, "sourceFileAttributeTip"), constraintsLastStretch);
410
+ obfuscationOptionsPanel.add(tip(adaptClassStringsCheckBox, "adaptClassStringsTip"), constraints);
411
+ obfuscationOptionsPanel.add(tip(adaptClassStringsTextField, "classNamesTip"), constraintsLastStretch);
412
+ obfuscationOptionsPanel.add(tip(adaptResourceFileNamesCheckBox, "adaptResourceFileNamesTip"), constraints);
413
+ obfuscationOptionsPanel.add(tip(adaptResourceFileNamesTextField, "fileNameFilterTip"), constraintsLastStretch);
414
+ obfuscationOptionsPanel.add(tip(adaptResourceFileContentsCheckBox, "adaptResourceFileContentsTip"), constraints);
415
+ obfuscationOptionsPanel.add(tip(adaptResourceFileContentsTextField, "fileNameFilterTip"), constraintsLastStretch);
416
+
417
+ JPanel obfuscationPanel = new JPanel(layout);
418
+
419
+ obfuscationPanel.add(obfuscationOptionsPanel, panelConstraints);
420
+ addClassSpecifications(extractClassSpecifications(boilerplateKeepNames),
421
+ obfuscationPanel,
422
+ boilerplateKeepNamesCheckBoxes,
423
+ boilerplateKeepNamesTextFields);
424
+
425
+ addBorder(additionalKeepNamesPanel, "keepNamesAdditional");
426
+ obfuscationPanel.add(tip(additionalKeepNamesPanel, "keepNamesAdditionalTip"), stretchPanelConstraints);
427
+
428
+ // Create the boiler plate "no side effect methods" panels.
429
+ boilerplateNoSideEffectMethodCheckBoxes = new JCheckBox[boilerplateNoSideEffectMethods.length];
430
+
431
+ JPanel optimizationOptionsPanel = new JPanel(layout);
432
+ addBorder(optimizationOptionsPanel, "options");
433
+
434
+ JButton optimizationsButton =
435
+ createOptimizationsButton(optimizationsTextField);
436
+
437
+ optimizationOptionsPanel.add(tip(optimizeCheckBox, "optimizeTip"), constraintsLastStretch);
438
+ optimizationOptionsPanel.add(tip(allowAccessModificationCheckBox, "allowAccessModificationTip"), constraintsLastStretch);
439
+ optimizationOptionsPanel.add(tip(mergeInterfacesAggressivelyCheckBox, "mergeInterfacesAggressivelyTip"), constraintsLastStretch);
440
+ optimizationOptionsPanel.add(tip(optimizationsLabel, "optimizationsTip"), constraints);
441
+ optimizationOptionsPanel.add(tip(optimizationsTextField, "optimizationsFilterTip"), constraintsStretch);
442
+ optimizationOptionsPanel.add(tip(optimizationsButton, "optimizationsSelectTip"), constraintsLast);
443
+ optimizationOptionsPanel.add(tip(optimizationPassesLabel, "optimizationPassesTip"), constraints);
444
+ optimizationOptionsPanel.add(tip(optimizationPassesSpinner, "optimizationPassesTip"), constraintsLast);
445
+
446
+ JPanel optimizationPanel = new JPanel(layout);
447
+
448
+ optimizationPanel.add(optimizationOptionsPanel, panelConstraints);
449
+ addClassSpecifications(boilerplateNoSideEffectMethods,
450
+ optimizationPanel,
451
+ boilerplateNoSideEffectMethodCheckBoxes,
452
+ null);
453
+
454
+ addBorder(additionalNoSideEffectsPanel, "assumeNoSideEffectsAdditional");
455
+ optimizationPanel.add(tip(additionalNoSideEffectsPanel, "assumeNoSideEffectsAdditionalTip"), stretchPanelConstraints);
456
+
457
+ // Create the options panel.
458
+ JPanel preverificationOptionsPanel = new JPanel(layout);
459
+ addBorder(preverificationOptionsPanel, "preverificationAndTargeting");
460
+
461
+ preverificationOptionsPanel.add(tip(preverifyCheckBox, "preverifyTip"), constraintsLastStretch);
462
+ preverificationOptionsPanel.add(tip(microEditionCheckBox, "microEditionTip"), constraintsLastStretch);
463
+ preverificationOptionsPanel.add(tip(targetCheckBox, "targetTip"), constraints);
464
+ preverificationOptionsPanel.add(tip(targetComboBox, "targetTip"), constraintsLast);
465
+
466
+ JButton printSeedsBrowseButton =
467
+ createBrowseButton(printSeedsTextField, msg("selectSeedsFile"));
468
+
469
+ JButton printConfigurationBrowseButton =
470
+ createBrowseButton(printConfigurationTextField, msg( "selectConfigurationFile"));
471
+
472
+ JButton dumpBrowseButton =
473
+ createBrowseButton(dumpTextField, msg("selectDumpFile"));
474
+
475
+ // Select the most recent target by default.
476
+ targetComboBox.setSelectedIndex(targetComboBox.getItemCount() - 1);
477
+
478
+ JPanel consistencyPanel = new JPanel(layout);
479
+ addBorder(consistencyPanel, "consistencyAndCorrectness");
480
+
481
+ consistencyPanel.add(tip(verboseCheckBox, "verboseTip"), constraintsLastStretch);
482
+ consistencyPanel.add(tip(noteCheckBox, "noteTip"), constraints);
483
+ consistencyPanel.add(tip(noteTextField, "noteFilterTip"), constraintsLastStretch);
484
+ consistencyPanel.add(tip(warnCheckBox, "warnTip"), constraints);
485
+ consistencyPanel.add(tip(warnTextField, "warnFilterTip"), constraintsLastStretch);
486
+ consistencyPanel.add(tip(ignoreWarningsCheckBox, "ignoreWarningsTip"), constraintsLastStretch);
487
+ consistencyPanel.add(tip(skipNonPublicLibraryClassesCheckBox, "skipNonPublicLibraryClassesTip"), constraintsLastStretch);
488
+ consistencyPanel.add(tip(skipNonPublicLibraryClassMembersCheckBox, "skipNonPublicLibraryClassMembersTip"), constraintsLastStretch);
489
+ consistencyPanel.add(tip(keepDirectoriesCheckBox, "keepDirectoriesTip"), constraints);
490
+ consistencyPanel.add(tip(keepDirectoriesTextField, "directoriesTip"), constraintsLastStretch);
491
+ consistencyPanel.add(tip(forceProcessingCheckBox, "forceProcessingTip"), constraintsLastStretch);
492
+ consistencyPanel.add(tip(printSeedsCheckBox, "printSeedsTip"), constraints);
493
+ consistencyPanel.add(tip(printSeedsTextField, "outputFileTip"), constraintsStretch);
494
+ consistencyPanel.add(tip(printSeedsBrowseButton, "selectSeedsFile"), constraintsLast);
495
+ consistencyPanel.add(tip(printConfigurationCheckBox, "printConfigurationTip"), constraints);
496
+ consistencyPanel.add(tip(printConfigurationTextField, "outputFileTip"), constraintsStretch);
497
+ consistencyPanel.add(tip(printConfigurationBrowseButton, "selectConfigurationFile"), constraintsLast);
498
+ consistencyPanel.add(tip(dumpCheckBox, "dumpTip"), constraints);
499
+ consistencyPanel.add(tip(dumpTextField, "outputFileTip"), constraintsStretch);
500
+ consistencyPanel.add(tip(dumpBrowseButton, "selectDumpFile"), constraintsLast);
501
+
502
+ // Collect all components that are followed by text fields and make
503
+ // sure they are equally sized. That way the text fields start at the
504
+ // same horizontal position.
505
+ setCommonPreferredSize(Arrays.asList(new JComponent[] {
506
+ printMappingCheckBox,
507
+ applyMappingCheckBox,
508
+ flattenPackageHierarchyCheckBox,
509
+ repackageClassesCheckBox,
510
+ newSourceFileAttributeCheckBox,
511
+ }));
512
+
513
+ JPanel optionsPanel = new JPanel(layout);
514
+
515
+ optionsPanel.add(preverificationOptionsPanel, panelConstraints);
516
+ optionsPanel.add(consistencyPanel, panelConstraints);
517
+
518
+ addBorder(whyAreYouKeepingPanel, "whyAreYouKeeping");
519
+ optionsPanel.add(tip(whyAreYouKeepingPanel, "whyAreYouKeepingTip"), stretchPanelConstraints);
520
+
521
+ // Create the process panel.
522
+ consoleTextArea.setOpaque(false);
523
+ consoleTextArea.setEditable(false);
524
+ consoleTextArea.setLineWrap(false);
525
+ consoleTextArea.setWrapStyleWord(false);
526
+ JScrollPane consoleScrollPane = new JScrollPane(consoleTextArea);
527
+ consoleScrollPane.setBorder(new EmptyBorder(1, 1, 1, 1));
528
+ addBorder(consoleScrollPane, "processingConsole");
529
+
530
+ JPanel processPanel = new JPanel(layout);
531
+ processPanel.add(consoleScrollPane, stretchPanelConstraints);
532
+
533
+ // Create the load, save, and process buttons.
534
+ JButton loadButton = new JButton(msg("loadConfiguration"));
535
+ loadButton.addActionListener(new MyLoadConfigurationActionListener());
536
+
537
+ JButton viewButton = new JButton(msg("viewConfiguration"));
538
+ viewButton.addActionListener(new MyViewConfigurationActionListener());
539
+
540
+ JButton saveButton = new JButton(msg("saveConfiguration"));
541
+ saveButton.addActionListener(new MySaveConfigurationActionListener());
542
+
543
+ JButton processButton = new JButton(msg("process"));
544
+ processButton.addActionListener(new MyProcessActionListener());
545
+
546
+ // Create the ReTrace panel.
547
+ JPanel reTraceSettingsPanel = new JPanel(layout);
548
+ addBorder(reTraceSettingsPanel, "reTraceSettings");
549
+
550
+ JButton reTraceMappingBrowseButton = createBrowseButton(reTraceMappingTextField,
551
+ msg("selectApplyMappingFile"));
552
+
553
+ JLabel reTraceMappingLabel = new JLabel(msg("mappingFile"));
554
+ reTraceMappingLabel.setForeground(reTraceVerboseCheckBox.getForeground());
555
+
556
+ reTraceSettingsPanel.add(tip(reTraceVerboseCheckBox, "verboseTip"), constraintsLastStretch);
557
+ reTraceSettingsPanel.add(tip(reTraceMappingLabel, "mappingFileTip"), constraints);
558
+ reTraceSettingsPanel.add(tip(reTraceMappingTextField, "inputFileTip"), constraintsStretch);
559
+ reTraceSettingsPanel.add(tip(reTraceMappingBrowseButton, "selectApplyMappingFile"), constraintsLast);
560
+
561
+ stackTraceTextArea.setOpaque(true);
562
+ stackTraceTextArea.setEditable(true);
563
+ stackTraceTextArea.setLineWrap(false);
564
+ stackTraceTextArea.setWrapStyleWord(true);
565
+ JScrollPane stackTraceScrollPane = new JScrollPane(stackTraceTextArea);
566
+ addBorder(stackTraceScrollPane, "obfuscatedStackTrace");
567
+
568
+ reTraceTextArea.setOpaque(false);
569
+ reTraceTextArea.setEditable(false);
570
+ reTraceTextArea.setLineWrap(true);
571
+ reTraceTextArea.setWrapStyleWord(true);
572
+ JScrollPane reTraceScrollPane = new JScrollPane(reTraceTextArea);
573
+ reTraceScrollPane.setBorder(new EmptyBorder(1, 1, 1, 1));
574
+ addBorder(reTraceScrollPane, "deobfuscatedStackTrace");
575
+
576
+ JPanel reTracePanel = new JPanel(layout);
577
+ reTracePanel.add(reTraceSettingsPanel, panelConstraints);
578
+ reTracePanel.add(tip(stackTraceScrollPane, "obfuscatedStackTraceTip"), panelConstraints);
579
+ reTracePanel.add(reTraceScrollPane, stretchPanelConstraints);
580
+
581
+ // Create the load button.
582
+ JButton loadStackTraceButton = new JButton(msg("loadStackTrace"));
583
+ loadStackTraceButton.addActionListener(new MyLoadStackTraceActionListener());
584
+
585
+ JButton reTraceButton = new JButton(msg("reTrace"));
586
+ reTraceButton.addActionListener(new MyReTraceActionListener());
587
+
588
+ // Create the main tabbed pane.
589
+ TabbedPane tabs = new TabbedPane();
590
+ tabs.add(msg("proGuardTab"), proGuardPanel);
591
+ tabs.add(msg("inputOutputTab"), inputOutputPanel);
592
+ tabs.add(msg("shrinkingTab"), shrinkingPanel);
593
+ tabs.add(msg("obfuscationTab"), obfuscationPanel);
594
+ tabs.add(msg("optimizationTab"), optimizationPanel);
595
+ tabs.add(msg("informationTab"), optionsPanel);
596
+ tabs.add(msg("processTab"), processPanel);
597
+ tabs.add(msg("reTraceTab"), reTracePanel);
598
+ tabs.addImage(Toolkit.getDefaultToolkit().getImage(
599
+ this.getClass().getResource(TITLE_IMAGE_FILE)));
600
+
601
+ // Add the bottom buttons to each panel.
602
+ proGuardPanel .add(Box.createGlue(), glueConstraints);
603
+ proGuardPanel .add(tip(loadButton, "loadConfigurationTip"), bottomButtonConstraints);
604
+ proGuardPanel .add(createNextButton(tabs), lastBottomButtonConstraints);
605
+
606
+ inputOutputPanel .add(Box.createGlue(), glueConstraints);
607
+ inputOutputPanel .add(createPreviousButton(tabs), bottomButtonConstraints);
608
+ inputOutputPanel .add(createNextButton(tabs), lastBottomButtonConstraints);
609
+
610
+ shrinkingPanel .add(Box.createGlue(), glueConstraints);
611
+ shrinkingPanel .add(createPreviousButton(tabs), bottomButtonConstraints);
612
+ shrinkingPanel .add(createNextButton(tabs), lastBottomButtonConstraints);
613
+
614
+ obfuscationPanel .add(Box.createGlue(), glueConstraints);
615
+ obfuscationPanel .add(createPreviousButton(tabs), bottomButtonConstraints);
616
+ obfuscationPanel .add(createNextButton(tabs), lastBottomButtonConstraints);
617
+
618
+ optimizationPanel .add(Box.createGlue(), glueConstraints);
619
+ optimizationPanel .add(createPreviousButton(tabs), bottomButtonConstraints);
620
+ optimizationPanel .add(createNextButton(tabs), lastBottomButtonConstraints);
621
+
622
+ optionsPanel .add(Box.createGlue(), glueConstraints);
623
+ optionsPanel .add(createPreviousButton(tabs), bottomButtonConstraints);
624
+ optionsPanel .add(createNextButton(tabs), lastBottomButtonConstraints);
625
+
626
+ processPanel .add(Box.createGlue(), glueConstraints);
627
+ processPanel .add(createPreviousButton(tabs), bottomButtonConstraints);
628
+ processPanel .add(tip(viewButton, "viewConfigurationTip"), bottomButtonConstraints);
629
+ processPanel .add(tip(saveButton, "saveConfigurationTip"), bottomButtonConstraints);
630
+ processPanel .add(tip(processButton, "processTip"), lastBottomButtonConstraints);
631
+
632
+ reTracePanel .add(Box.createGlue(), glueConstraints);
633
+ reTracePanel .add(tip(loadStackTraceButton, "loadStackTraceTip"), bottomButtonConstraints);
634
+ reTracePanel .add(tip(reTraceButton, "reTraceTip"), lastBottomButtonConstraints);
635
+
636
+ // Initialize the GUI settings to reasonable defaults.
637
+ loadConfiguration(this.getClass().getResource(DEFAULT_CONFIGURATION));
638
+
639
+ // Add the main tabs to the frame and pack it.
640
+ getContentPane().add(tabs);
641
+ }
642
+
643
+
644
+ public void startSplash()
645
+ {
646
+ splashPanel.start();
647
+ }
648
+
649
+
650
+ public void skipSplash()
651
+ {
652
+ splashPanel.stop();
653
+ }
654
+
655
+
656
+ /**
657
+ * Loads the boilerplate keep class options from the boilerplate file
658
+ * into the boilerplate array.
659
+ */
660
+ private void loadBoilerplateConfiguration()
661
+ {
662
+ try
663
+ {
664
+ // Parse the boilerplate configuration file.
665
+ ConfigurationParser parser = new ConfigurationParser(
666
+ this.getClass().getResource(BOILERPLATE_CONFIGURATION));
667
+ Configuration configuration = new Configuration();
668
+
669
+ try
670
+ {
671
+ parser.parse(configuration);
672
+
673
+ // We're interested in the keep options.
674
+ boilerplateKeep =
675
+ extractKeepSpecifications(configuration.keep, false, false);
676
+
677
+ // We're interested in the keep options.
678
+ boilerplateKeepNames =
679
+ extractKeepSpecifications(configuration.keep, true, false);
680
+
681
+ // We're interested in the side effects options.
682
+ boilerplateNoSideEffectMethods = new ClassSpecification[configuration.assumeNoSideEffects.size()];
683
+ configuration.assumeNoSideEffects.toArray(boilerplateNoSideEffectMethods);
684
+ }
685
+ finally
686
+ {
687
+ parser.close();
688
+ }
689
+ }
690
+ catch (Exception ex)
691
+ {
692
+ ex.printStackTrace();
693
+ }
694
+ }
695
+
696
+
697
+ /**
698
+ * Returns an array containing the ClassSpecifications instances with
699
+ * matching flags.
700
+ */
701
+ private KeepClassSpecification[] extractKeepSpecifications(List keepSpecifications,
702
+ boolean allowShrinking,
703
+ boolean allowObfuscation)
704
+ {
705
+ List matches = new ArrayList();
706
+
707
+ for (int index = 0; index < keepSpecifications.size(); index++)
708
+ {
709
+ KeepClassSpecification keepClassSpecification = (KeepClassSpecification)keepSpecifications.get(index);
710
+ if (keepClassSpecification.allowShrinking == allowShrinking &&
711
+ keepClassSpecification.allowObfuscation == allowObfuscation)
712
+ {
713
+ matches.add(keepClassSpecification);
714
+ }
715
+ }
716
+
717
+ KeepClassSpecification[] matchingKeepClassSpecifications = new KeepClassSpecification[matches.size()];
718
+ matches.toArray(matchingKeepClassSpecifications);
719
+
720
+ return matchingKeepClassSpecifications;
721
+ }
722
+
723
+
724
+ /**
725
+ * Returns an array containing the ClassSpecification instances of the
726
+ * given array of KeepClassSpecification instances.
727
+ */
728
+ private ClassSpecification[] extractClassSpecifications(KeepClassSpecification[] keepClassSpecifications)
729
+ {
730
+ ClassSpecification[] classSpecifications = new ClassSpecification[keepClassSpecifications.length];
731
+
732
+ for (int index = 0; index < classSpecifications.length; index++)
733
+ {
734
+ classSpecifications[index] = keepClassSpecifications[index];
735
+ }
736
+
737
+ return classSpecifications;
738
+ }
739
+
740
+
741
+ /**
742
+ * Creates a panel with the given boiler plate class specifications.
743
+ */
744
+ private void addClassSpecifications(ClassSpecification[] boilerplateClassSpecifications,
745
+ JPanel classSpecificationsPanel,
746
+ JCheckBox[] boilerplateCheckBoxes,
747
+ JTextField[] boilerplateTextFields)
748
+ {
749
+ // Create some constraints that can be reused.
750
+ GridBagConstraints constraints = new GridBagConstraints();
751
+ constraints.anchor = GridBagConstraints.WEST;
752
+ constraints.insets = new Insets(0, 4, 0, 4);
753
+
754
+ GridBagConstraints constraintsLastStretch = new GridBagConstraints();
755
+ constraintsLastStretch.gridwidth = GridBagConstraints.REMAINDER;
756
+ constraintsLastStretch.fill = GridBagConstraints.HORIZONTAL;
757
+ constraintsLastStretch.weightx = 1.0;
758
+ constraintsLastStretch.anchor = GridBagConstraints.WEST;
759
+ constraintsLastStretch.insets = constraints.insets;
760
+
761
+ GridBagConstraints panelConstraints = new GridBagConstraints();
762
+ panelConstraints.gridwidth = GridBagConstraints.REMAINDER;
763
+ panelConstraints.fill = GridBagConstraints.HORIZONTAL;
764
+ panelConstraints.weightx = 1.0;
765
+ panelConstraints.anchor = GridBagConstraints.NORTHWEST;
766
+ panelConstraints.insets = constraints.insets;
767
+
768
+ GridBagLayout layout = new GridBagLayout();
769
+
770
+ String lastPanelName = null;
771
+ JPanel keepSubpanel = null;
772
+ for (int index = 0; index < boilerplateClassSpecifications.length; index++)
773
+ {
774
+ // The panel structure is derived from the comments.
775
+ String comments = boilerplateClassSpecifications[index].comments;
776
+ int dashIndex = comments.indexOf('-');
777
+ int periodIndex = comments.indexOf('.', dashIndex);
778
+ String panelName = comments.substring(0, dashIndex).trim();
779
+ String optionName = comments.substring(dashIndex + 1, periodIndex).replace('_', '.').trim();
780
+ String toolTip = comments.substring(periodIndex + 1);
781
+ if (keepSubpanel == null || !panelName.equals(lastPanelName))
782
+ {
783
+ // Create a new keep subpanel and add it.
784
+ keepSubpanel = new JPanel(layout);
785
+ keepSubpanel.setBorder(BorderFactory.createTitledBorder(BORDER, panelName));
786
+ classSpecificationsPanel.add(keepSubpanel, panelConstraints);
787
+
788
+ lastPanelName = panelName;
789
+ }
790
+
791
+ // Add the check box to the subpanel.
792
+ JCheckBox boilerplateCheckBox = new JCheckBox(optionName);
793
+ boilerplateCheckBox.setToolTipText(toolTip);
794
+ boilerplateCheckBoxes[index] = boilerplateCheckBox;
795
+ keepSubpanel.add(boilerplateCheckBox,
796
+ boilerplateTextFields != null ?
797
+ constraints :
798
+ constraintsLastStretch);
799
+
800
+ if (boilerplateTextFields != null)
801
+ {
802
+ // Add the text field to the subpanel.
803
+ boilerplateTextFields[index] = new JTextField(40);
804
+ keepSubpanel.add(tip(boilerplateTextFields[index], "classNamesTip"), constraintsLastStretch);
805
+ }
806
+ }
807
+ }
808
+
809
+
810
+ /**
811
+ * Adds a standard border with the title that corresponds to the given key
812
+ * in the GUI resources.
813
+ */
814
+ private void addBorder(JComponent component, String titleKey)
815
+ {
816
+ Border oldBorder = component.getBorder();
817
+ Border newBorder = BorderFactory.createTitledBorder(BORDER, msg(titleKey));
818
+
819
+ component.setBorder(oldBorder == null ?
820
+ newBorder :
821
+ new CompoundBorder(newBorder, oldBorder));
822
+ }
823
+
824
+
825
+ /**
826
+ * Creates a Previous button for the given tabbed pane.
827
+ */
828
+ private JButton createPreviousButton(final TabbedPane tabbedPane)
829
+ {
830
+ JButton browseButton = new JButton(msg("previous"));
831
+ browseButton.addActionListener(new ActionListener()
832
+ {
833
+ public void actionPerformed(ActionEvent e)
834
+ {
835
+ tabbedPane.previous();
836
+ }
837
+ });
838
+
839
+ return browseButton;
840
+ }
841
+
842
+
843
+ /**
844
+ * Creates a Next button for the given tabbed pane.
845
+ */
846
+ private JButton createNextButton(final TabbedPane tabbedPane)
847
+ {
848
+ JButton browseButton = new JButton(msg("next"));
849
+ browseButton.addActionListener(new ActionListener()
850
+ {
851
+ public void actionPerformed(ActionEvent e)
852
+ {
853
+ tabbedPane.next();
854
+ }
855
+ });
856
+
857
+ return browseButton;
858
+ }
859
+
860
+
861
+ /**
862
+ * Creates a browse button that opens a file browser for the given text field.
863
+ */
864
+ private JButton createBrowseButton(final JTextField textField,
865
+ final String title)
866
+ {
867
+ JButton browseButton = new JButton(msg("browse"));
868
+ browseButton.addActionListener(new ActionListener()
869
+ {
870
+ public void actionPerformed(ActionEvent e)
871
+ {
872
+ // Update the file chooser.
873
+ fileChooser.setDialogTitle(title);
874
+ fileChooser.setSelectedFile(new File(textField.getText()));
875
+
876
+ int returnVal = fileChooser.showDialog(ProGuardGUI.this, msg("ok"));
877
+ if (returnVal == JFileChooser.APPROVE_OPTION)
878
+ {
879
+ // Update the text field.
880
+ textField.setText(fileChooser.getSelectedFile().getPath());
881
+ }
882
+ }
883
+ });
884
+
885
+ return browseButton;
886
+ }
887
+
888
+
889
+ protected JButton createOptimizationsButton(final JTextField textField)
890
+ {
891
+ final OptimizationsDialog optimizationsDialog = new OptimizationsDialog(ProGuardGUI.this);
892
+
893
+ JButton optimizationsButton = new JButton(msg("select"));
894
+ optimizationsButton.addActionListener(new ActionListener()
895
+ {
896
+ public void actionPerformed(ActionEvent e)
897
+ {
898
+ // Update the dialog.
899
+ optimizationsDialog.setFilter(textField.getText());
900
+
901
+ int returnValue = optimizationsDialog.showDialog();
902
+ if (returnValue == OptimizationsDialog.APPROVE_OPTION)
903
+ {
904
+ // Update the text field.
905
+ textField.setText(optimizationsDialog.getFilter());
906
+ }
907
+ }
908
+ });
909
+
910
+ return optimizationsButton;
911
+ }
912
+
913
+
914
+ /**
915
+ * Sets the preferred sizes of the given components to the maximum of their
916
+ * current preferred sizes.
917
+ */
918
+ private void setCommonPreferredSize(List components)
919
+ {
920
+ // Find the maximum preferred size.
921
+ Dimension maximumSize = null;
922
+ for (int index = 0; index < components.size(); index++)
923
+ {
924
+ JComponent component = (JComponent)components.get(index);
925
+ Dimension size = component.getPreferredSize();
926
+ if (maximumSize == null ||
927
+ size.getWidth() > maximumSize.getWidth())
928
+ {
929
+ maximumSize = size;
930
+ }
931
+ }
932
+
933
+ // Set the size that we found as the preferred size for all components.
934
+ for (int index = 0; index < components.size(); index++)
935
+ {
936
+ JComponent component = (JComponent)components.get(index);
937
+ component.setPreferredSize(maximumSize);
938
+ }
939
+ }
940
+
941
+
942
+ /**
943
+ * Updates to GUI settings to reflect the given ProGuard configuration.
944
+ */
945
+ private void setProGuardConfiguration(Configuration configuration)
946
+ {
947
+ // Set up the input and output jars and directories.
948
+ programPanel.setClassPath(configuration.programJars);
949
+ libraryPanel.setClassPath(configuration.libraryJars);
950
+
951
+ // Set up the boilerplate keep options.
952
+ for (int index = 0; index < boilerplateKeep.length; index++)
953
+ {
954
+ String classNames =
955
+ findMatchingKeepSpecifications(boilerplateKeep[index],
956
+ configuration.keep);
957
+
958
+ boilerplateKeepCheckBoxes[index].setSelected(classNames != null);
959
+ boilerplateKeepTextFields[index].setText(classNames == null ? "*" : classNames);
960
+ }
961
+
962
+
963
+ // Set up the boilerplate keep names options.
964
+ for (int index = 0; index < boilerplateKeepNames.length; index++)
965
+ {
966
+ String classNames =
967
+ findMatchingKeepSpecifications(boilerplateKeepNames[index],
968
+ configuration.keep);
969
+
970
+ boilerplateKeepNamesCheckBoxes[index].setSelected(classNames != null);
971
+ boilerplateKeepNamesTextFields[index].setText(classNames == null ? "*" : classNames);
972
+ }
973
+
974
+ // Set up the additional keep options. Note that the matched boilerplate
975
+ // options have been removed from the list.
976
+ additionalKeepPanel.setClassSpecifications(filteredKeepSpecifications(configuration.keep,
977
+ false));
978
+
979
+ // Set up the additional keep options. Note that the matched boilerplate
980
+ // options have been removed from the list.
981
+ additionalKeepNamesPanel.setClassSpecifications(filteredKeepSpecifications(configuration.keep,
982
+ true));
983
+
984
+
985
+ // Set up the boilerplate "no side effect methods" options.
986
+ for (int index = 0; index < boilerplateNoSideEffectMethods.length; index++)
987
+ {
988
+ boolean found =
989
+ findClassSpecification(boilerplateNoSideEffectMethods[index],
990
+ configuration.assumeNoSideEffects);
991
+
992
+ boilerplateNoSideEffectMethodCheckBoxes[index].setSelected(found);
993
+ }
994
+
995
+ // Set up the additional keep options. Note that the matched boilerplate
996
+ // options have been removed from the list.
997
+ additionalNoSideEffectsPanel.setClassSpecifications(configuration.assumeNoSideEffects);
998
+
999
+ // Set up the "why are you keeping" options.
1000
+ whyAreYouKeepingPanel.setClassSpecifications(configuration.whyAreYouKeeping);
1001
+
1002
+ // Set up the other options.
1003
+ shrinkCheckBox .setSelected(configuration.shrink);
1004
+ printUsageCheckBox .setSelected(configuration.printUsage != null);
1005
+
1006
+ optimizeCheckBox .setSelected(configuration.optimize);
1007
+ allowAccessModificationCheckBox .setSelected(configuration.allowAccessModification);
1008
+ mergeInterfacesAggressivelyCheckBox .setSelected(configuration.mergeInterfacesAggressively);
1009
+ optimizationPassesSpinner.getModel() .setValue(new Integer(configuration.optimizationPasses));
1010
+
1011
+ obfuscateCheckBox .setSelected(configuration.obfuscate);
1012
+ printMappingCheckBox .setSelected(configuration.printMapping != null);
1013
+ applyMappingCheckBox .setSelected(configuration.applyMapping != null);
1014
+ obfuscationDictionaryCheckBox .setSelected(configuration.obfuscationDictionary != null);
1015
+ classObfuscationDictionaryCheckBox .setSelected(configuration.classObfuscationDictionary != null);
1016
+ packageObfuscationDictionaryCheckBox .setSelected(configuration.packageObfuscationDictionary != null);
1017
+ overloadAggressivelyCheckBox .setSelected(configuration.overloadAggressively);
1018
+ useUniqueClassMemberNamesCheckBox .setSelected(configuration.useUniqueClassMemberNames);
1019
+ useMixedCaseClassNamesCheckBox .setSelected(configuration.useMixedCaseClassNames);
1020
+ keepPackageNamesCheckBox .setSelected(configuration.keepPackageNames != null);
1021
+ flattenPackageHierarchyCheckBox .setSelected(configuration.flattenPackageHierarchy != null);
1022
+ repackageClassesCheckBox .setSelected(configuration.repackageClasses != null);
1023
+ keepAttributesCheckBox .setSelected(configuration.keepAttributes != null);
1024
+ keepParameterNamesCheckBox .setSelected(configuration.keepParameterNames);
1025
+ newSourceFileAttributeCheckBox .setSelected(configuration.newSourceFileAttribute != null);
1026
+ adaptClassStringsCheckBox .setSelected(configuration.adaptClassStrings != null);
1027
+ adaptResourceFileNamesCheckBox .setSelected(configuration.adaptResourceFileNames != null);
1028
+ adaptResourceFileContentsCheckBox .setSelected(configuration.adaptResourceFileContents != null);
1029
+
1030
+ preverifyCheckBox .setSelected(configuration.preverify);
1031
+ microEditionCheckBox .setSelected(configuration.microEdition);
1032
+ targetCheckBox .setSelected(configuration.targetClassVersion != 0);
1033
+
1034
+ verboseCheckBox .setSelected(configuration.verbose);
1035
+ noteCheckBox .setSelected(configuration.note == null || !configuration.note.isEmpty());
1036
+ warnCheckBox .setSelected(configuration.warn == null || !configuration.warn.isEmpty());
1037
+ ignoreWarningsCheckBox .setSelected(configuration.ignoreWarnings);
1038
+ skipNonPublicLibraryClassesCheckBox .setSelected(configuration.skipNonPublicLibraryClasses);
1039
+ skipNonPublicLibraryClassMembersCheckBox.setSelected(configuration.skipNonPublicLibraryClassMembers);
1040
+ keepDirectoriesCheckBox .setSelected(configuration.keepDirectories != null);
1041
+ forceProcessingCheckBox .setSelected(configuration.lastModified == Long.MAX_VALUE);
1042
+ printSeedsCheckBox .setSelected(configuration.printSeeds != null);
1043
+ printConfigurationCheckBox .setSelected(configuration.printConfiguration != null);
1044
+ dumpCheckBox .setSelected(configuration.dump != null);
1045
+
1046
+ printUsageTextField .setText(fileName(configuration.printUsage));
1047
+ optimizationsTextField .setText(configuration.optimizations ==
1048
+ null ?
1049
+ OPTIMIZATIONS_DEFAULT :
1050
+ ListUtil.commaSeparatedString(configuration.optimizations, true));
1051
+ printMappingTextField .setText(fileName(configuration.printMapping));
1052
+ applyMappingTextField .setText(fileName(configuration.applyMapping));
1053
+ obfuscationDictionaryTextField .setText(fileName(configuration.obfuscationDictionary));
1054
+ classObfuscationDictionaryTextField .setText(fileName(configuration.classObfuscationDictionary));
1055
+ packageObfuscationDictionaryTextField .setText(fileName(configuration.packageObfuscationDictionary));
1056
+ keepPackageNamesTextField .setText(configuration.keepPackageNames == null ? "" : ClassUtil.externalClassName(ListUtil.commaSeparatedString(configuration.keepPackageNames, true)));
1057
+ flattenPackageHierarchyTextField .setText(configuration.flattenPackageHierarchy);
1058
+ repackageClassesTextField .setText(configuration.repackageClasses);
1059
+ keepAttributesTextField .setText(configuration.keepAttributes == null ? KEEP_ATTRIBUTE_DEFAULT : ListUtil.commaSeparatedString(configuration.keepAttributes, true));
1060
+ newSourceFileAttributeTextField .setText(configuration.newSourceFileAttribute == null ? SOURCE_FILE_ATTRIBUTE_DEFAULT : configuration.newSourceFileAttribute);
1061
+ adaptClassStringsTextField .setText(configuration.adaptClassStrings == null ? "" : ClassUtil.externalClassName(ListUtil.commaSeparatedString(configuration.adaptClassStrings, true)));
1062
+ adaptResourceFileNamesTextField .setText(configuration.adaptResourceFileNames == null ? ADAPT_RESOURCE_FILE_NAMES_DEFAULT : ListUtil.commaSeparatedString(configuration.adaptResourceFileNames, true));
1063
+ adaptResourceFileContentsTextField .setText(configuration.adaptResourceFileContents == null ? ADAPT_RESOURCE_FILE_CONTENTS_DEFAULT : ListUtil.commaSeparatedString(configuration.adaptResourceFileContents, true));
1064
+ noteTextField .setText(ListUtil.commaSeparatedString(configuration.note, true));
1065
+ warnTextField .setText(ListUtil.commaSeparatedString(configuration.warn, true));
1066
+ keepDirectoriesTextField .setText(ListUtil.commaSeparatedString(configuration.keepDirectories, true));
1067
+ printSeedsTextField .setText(fileName(configuration.printSeeds));
1068
+ printConfigurationTextField .setText(fileName(configuration.printConfiguration));
1069
+ dumpTextField .setText(fileName(configuration.dump));
1070
+
1071
+ if (configuration.targetClassVersion != 0)
1072
+ {
1073
+ targetComboBox.setSelectedItem(ClassUtil.externalClassVersion(configuration.targetClassVersion));
1074
+ }
1075
+ else
1076
+ {
1077
+ targetComboBox.setSelectedIndex(targetComboBox.getItemCount() - 1);
1078
+ }
1079
+
1080
+ if (configuration.printMapping != null)
1081
+ {
1082
+ reTraceMappingTextField.setText(fileName(configuration.printMapping));
1083
+ }
1084
+ }
1085
+
1086
+
1087
+ /**
1088
+ * Returns the ProGuard configuration that reflects the current GUI settings.
1089
+ */
1090
+ private Configuration getProGuardConfiguration()
1091
+ {
1092
+ Configuration configuration = new Configuration();
1093
+
1094
+ // Get the input and output jars and directories.
1095
+ configuration.programJars = programPanel.getClassPath();
1096
+ configuration.libraryJars = libraryPanel.getClassPath();
1097
+
1098
+ List keep = new ArrayList();
1099
+
1100
+ // Collect the additional keep options.
1101
+ List additionalKeep = additionalKeepPanel.getClassSpecifications();
1102
+ if (additionalKeep != null)
1103
+ {
1104
+ keep.addAll(additionalKeep);
1105
+ }
1106
+
1107
+ // Collect the additional keep names options.
1108
+ List additionalKeepNames = additionalKeepNamesPanel.getClassSpecifications();
1109
+ if (additionalKeepNames != null)
1110
+ {
1111
+ keep.addAll(additionalKeepNames);
1112
+ }
1113
+
1114
+ // Collect the boilerplate keep options.
1115
+ for (int index = 0; index < boilerplateKeep.length; index++)
1116
+ {
1117
+ if (boilerplateKeepCheckBoxes[index].isSelected())
1118
+ {
1119
+ keep.add(classSpecification(boilerplateKeep[index],
1120
+ boilerplateKeepTextFields[index].getText()));
1121
+ }
1122
+ }
1123
+
1124
+ // Collect the boilerplate keep names options.
1125
+ for (int index = 0; index < boilerplateKeepNames.length; index++)
1126
+ {
1127
+ if (boilerplateKeepNamesCheckBoxes[index].isSelected())
1128
+ {
1129
+ keep.add(classSpecification(boilerplateKeepNames[index],
1130
+ boilerplateKeepNamesTextFields[index].getText()));
1131
+ }
1132
+ }
1133
+
1134
+ // Put the list of keep specifications in the configuration.
1135
+ if (keep.size() > 0)
1136
+ {
1137
+ configuration.keep = keep;
1138
+ }
1139
+
1140
+
1141
+ // Collect the boilerplate "no side effect methods" options.
1142
+ List noSideEffectMethods = new ArrayList();
1143
+
1144
+ for (int index = 0; index < boilerplateNoSideEffectMethods.length; index++)
1145
+ {
1146
+ if (boilerplateNoSideEffectMethodCheckBoxes[index].isSelected())
1147
+ {
1148
+ noSideEffectMethods.add(boilerplateNoSideEffectMethods[index]);
1149
+ }
1150
+ }
1151
+
1152
+ // Collect the additional "no side effect methods" options.
1153
+ List additionalNoSideEffectOptions = additionalNoSideEffectsPanel.getClassSpecifications();
1154
+ if (additionalNoSideEffectOptions != null)
1155
+ {
1156
+ noSideEffectMethods.addAll(additionalNoSideEffectOptions);
1157
+ }
1158
+
1159
+ // Put the list of "no side effect methods" options in the configuration.
1160
+ if (noSideEffectMethods.size() > 0)
1161
+ {
1162
+ configuration.assumeNoSideEffects = noSideEffectMethods;
1163
+ }
1164
+
1165
+
1166
+ // Collect the "why are you keeping" options.
1167
+ configuration.whyAreYouKeeping = whyAreYouKeepingPanel.getClassSpecifications();
1168
+
1169
+
1170
+ // Get the other options.
1171
+ configuration.shrink = shrinkCheckBox .isSelected();
1172
+ configuration.printUsage = printUsageCheckBox .isSelected() ? new File(printUsageTextField .getText()) : null;
1173
+
1174
+ configuration.optimize = optimizeCheckBox .isSelected();
1175
+ configuration.allowAccessModification = allowAccessModificationCheckBox .isSelected();
1176
+ configuration.mergeInterfacesAggressively = mergeInterfacesAggressivelyCheckBox .isSelected();
1177
+ configuration.optimizations = optimizationsTextField.getText().length() > 1 ? ListUtil.commaSeparatedList(optimizationsTextField .getText()) : null;
1178
+ configuration.optimizationPasses = ((SpinnerNumberModel)optimizationPassesSpinner.getModel()).getNumber().intValue();
1179
+
1180
+ configuration.obfuscate = obfuscateCheckBox .isSelected();
1181
+ configuration.printMapping = printMappingCheckBox .isSelected() ? new File(printMappingTextField .getText()) : null;
1182
+ configuration.applyMapping = applyMappingCheckBox .isSelected() ? new File(applyMappingTextField .getText()) : null;
1183
+ configuration.obfuscationDictionary = obfuscationDictionaryCheckBox .isSelected() ? new File(obfuscationDictionaryTextField .getText()) : null;
1184
+ configuration.classObfuscationDictionary = classObfuscationDictionaryCheckBox .isSelected() ? new File(classObfuscationDictionaryTextField .getText()) : null;
1185
+ configuration.packageObfuscationDictionary = packageObfuscationDictionaryCheckBox .isSelected() ? new File(packageObfuscationDictionaryTextField .getText()) : null;
1186
+ configuration.overloadAggressively = overloadAggressivelyCheckBox .isSelected();
1187
+ configuration.useUniqueClassMemberNames = useUniqueClassMemberNamesCheckBox .isSelected();
1188
+ configuration.useMixedCaseClassNames = useMixedCaseClassNamesCheckBox .isSelected();
1189
+ configuration.keepPackageNames = keepPackageNamesCheckBox .isSelected() ? keepPackageNamesTextField.getText().length() > 0 ? ListUtil.commaSeparatedList(ClassUtil.internalClassName(keepPackageNamesTextField.getText())) : new ArrayList() : null;
1190
+ configuration.flattenPackageHierarchy = flattenPackageHierarchyCheckBox .isSelected() ? ClassUtil.internalClassName(flattenPackageHierarchyTextField .getText()) : null;
1191
+ configuration.repackageClasses = repackageClassesCheckBox .isSelected() ? ClassUtil.internalClassName(repackageClassesTextField .getText()) : null;
1192
+ configuration.keepAttributes = keepAttributesCheckBox .isSelected() ? ListUtil.commaSeparatedList(keepAttributesTextField .getText()) : null;
1193
+ configuration.keepParameterNames = keepParameterNamesCheckBox .isSelected();
1194
+ configuration.newSourceFileAttribute = newSourceFileAttributeCheckBox .isSelected() ? newSourceFileAttributeTextField .getText() : null;
1195
+ configuration.adaptClassStrings = adaptClassStringsCheckBox .isSelected() ? adaptClassStringsTextField.getText().length() > 0 ? ListUtil.commaSeparatedList(ClassUtil.internalClassName(adaptClassStringsTextField.getText())) : new ArrayList() : null;
1196
+ configuration.adaptResourceFileNames = adaptResourceFileNamesCheckBox .isSelected() ? ListUtil.commaSeparatedList(adaptResourceFileNamesTextField .getText()) : null;
1197
+ configuration.adaptResourceFileContents = adaptResourceFileContentsCheckBox .isSelected() ? ListUtil.commaSeparatedList(adaptResourceFileContentsTextField .getText()) : null;
1198
+
1199
+ configuration.preverify = preverifyCheckBox .isSelected();
1200
+ configuration.microEdition = microEditionCheckBox .isSelected();
1201
+ configuration.targetClassVersion = targetCheckBox .isSelected() ? ClassUtil.internalClassVersion(targetComboBox.getSelectedItem().toString()) : 0;
1202
+
1203
+ configuration.verbose = verboseCheckBox .isSelected();
1204
+ configuration.note = noteCheckBox .isSelected() ? noteTextField.getText().length() > 0 ? ListUtil.commaSeparatedList(ClassUtil.internalClassName(noteTextField.getText())) : null : new ArrayList();
1205
+ configuration.warn = warnCheckBox .isSelected() ? warnTextField.getText().length() > 0 ? ListUtil.commaSeparatedList(ClassUtil.internalClassName(warnTextField.getText())) : null : new ArrayList();
1206
+ configuration.ignoreWarnings = ignoreWarningsCheckBox .isSelected();
1207
+ configuration.skipNonPublicLibraryClasses = skipNonPublicLibraryClassesCheckBox .isSelected();
1208
+ configuration.skipNonPublicLibraryClassMembers = skipNonPublicLibraryClassMembersCheckBox.isSelected();
1209
+ configuration.keepDirectories = keepDirectoriesCheckBox .isSelected() ? keepDirectoriesTextField.getText().length() > 0 ? ListUtil.commaSeparatedList(ClassUtil.internalClassName(keepDirectoriesTextField.getText())) : new ArrayList() : null;
1210
+ configuration.lastModified = forceProcessingCheckBox .isSelected() ? Long.MAX_VALUE : System.currentTimeMillis();
1211
+ configuration.printSeeds = printSeedsCheckBox .isSelected() ? new File(printSeedsTextField .getText()) : null;
1212
+ configuration.printConfiguration = printConfigurationCheckBox .isSelected() ? new File(printConfigurationTextField .getText()) : null;
1213
+ configuration.dump = dumpCheckBox .isSelected() ? new File(dumpTextField .getText()) : null;
1214
+
1215
+ return configuration;
1216
+ }
1217
+
1218
+
1219
+ /**
1220
+ * Looks in the given list for a class specification that is identical to
1221
+ * the given template. Returns true if it is found, and removes the matching
1222
+ * class specification as a side effect.
1223
+ */
1224
+ private boolean findClassSpecification(ClassSpecification classSpecificationTemplate,
1225
+ List classSpecifications)
1226
+ {
1227
+ if (classSpecifications == null)
1228
+ {
1229
+ return false;
1230
+ }
1231
+
1232
+ for (int index = 0; index < classSpecifications.size(); index++)
1233
+ {
1234
+ if (classSpecificationTemplate.equals(classSpecifications.get(index)))
1235
+ {
1236
+ // Remove the matching option as a side effect.
1237
+ classSpecifications.remove(index);
1238
+
1239
+ return true;
1240
+ }
1241
+ }
1242
+
1243
+ return false;
1244
+ }
1245
+
1246
+
1247
+ /**
1248
+ * Returns the subset of the given list of keep specifications, with
1249
+ * matching shrinking flag.
1250
+ */
1251
+ private List filteredKeepSpecifications(List keepSpecifications,
1252
+ boolean allowShrinking)
1253
+ {
1254
+ List filteredKeepSpecifications = new ArrayList();
1255
+
1256
+ for (int index = 0; index < keepSpecifications.size(); index++)
1257
+ {
1258
+ KeepClassSpecification keepClassSpecification =
1259
+ (KeepClassSpecification)keepSpecifications.get(index);
1260
+
1261
+ if (keepClassSpecification.allowShrinking == allowShrinking)
1262
+ {
1263
+ filteredKeepSpecifications.add(keepClassSpecification);
1264
+ }
1265
+ }
1266
+
1267
+ return filteredKeepSpecifications;
1268
+ }
1269
+
1270
+
1271
+ /**
1272
+ * Looks in the given list for keep specifications that match the given
1273
+ * template. Returns a comma-separated string of class names from
1274
+ * matching keep specifications, and removes the matching keep
1275
+ * specifications as a side effect.
1276
+ */
1277
+ private String findMatchingKeepSpecifications(KeepClassSpecification keepClassSpecificationTemplate,
1278
+ List keepSpecifications)
1279
+ {
1280
+ if (keepSpecifications == null)
1281
+ {
1282
+ return null;
1283
+ }
1284
+
1285
+ StringBuffer buffer = null;
1286
+
1287
+ for (int index = 0; index < keepSpecifications.size(); index++)
1288
+ {
1289
+ KeepClassSpecification listedKeepClassSpecification =
1290
+ (KeepClassSpecification)keepSpecifications.get(index);
1291
+ String className = listedKeepClassSpecification.className;
1292
+ keepClassSpecificationTemplate.className = className;
1293
+ if (keepClassSpecificationTemplate.equals(listedKeepClassSpecification))
1294
+ {
1295
+ if (buffer == null)
1296
+ {
1297
+ buffer = new StringBuffer();
1298
+ }
1299
+ else
1300
+ {
1301
+ buffer.append(',');
1302
+ }
1303
+ buffer.append(className == null ? "*" : ClassUtil.externalClassName(className));
1304
+
1305
+ // Remove the matching option as a side effect.
1306
+ keepSpecifications.remove(index--);
1307
+ }
1308
+ }
1309
+
1310
+ return buffer == null ? null : buffer.toString();
1311
+ }
1312
+
1313
+
1314
+ /**
1315
+ * Returns a class specification or keep specification, based on the given
1316
+ * template and the class name to be filled in.
1317
+ */
1318
+ private ClassSpecification classSpecification(ClassSpecification classSpecificationTemplate,
1319
+ String className)
1320
+ {
1321
+ // Create a copy of the template.
1322
+ ClassSpecification classSpecification =
1323
+ (ClassSpecification)classSpecificationTemplate.clone();
1324
+
1325
+ // Set the class name in the copy.
1326
+ classSpecification.className =
1327
+ className.equals("") ||
1328
+ className.equals("*") ?
1329
+ null :
1330
+ ClassUtil.internalClassName(className);
1331
+
1332
+ // Return the modified copy.
1333
+ return classSpecification;
1334
+ }
1335
+
1336
+
1337
+ // Methods and internal classes related to actions.
1338
+
1339
+ /**
1340
+ * Loads the given ProGuard configuration into the GUI.
1341
+ */
1342
+ private void loadConfiguration(File file)
1343
+ {
1344
+ // Set the default directory and file in the file choosers.
1345
+ configurationChooser.setSelectedFile(file.getAbsoluteFile());
1346
+ fileChooser.setCurrentDirectory(file.getAbsoluteFile().getParentFile());
1347
+
1348
+ try
1349
+ {
1350
+ // Parse the configuration file.
1351
+ ConfigurationParser parser = new ConfigurationParser(file);
1352
+ Configuration configuration = new Configuration();
1353
+
1354
+ try
1355
+ {
1356
+ parser.parse(configuration);
1357
+
1358
+ // Let the GUI reflect the configuration.
1359
+ setProGuardConfiguration(configuration);
1360
+ }
1361
+ catch (ParseException ex)
1362
+ {
1363
+ JOptionPane.showMessageDialog(getContentPane(),
1364
+ msg("cantParseConfigurationFile", file.getPath()),
1365
+ msg("warning"),
1366
+ JOptionPane.ERROR_MESSAGE);
1367
+ }
1368
+ finally
1369
+ {
1370
+ parser.close();
1371
+ }
1372
+ }
1373
+ catch (IOException ex)
1374
+ {
1375
+ JOptionPane.showMessageDialog(getContentPane(),
1376
+ msg("cantOpenConfigurationFile", file.getPath()),
1377
+ msg("warning"),
1378
+ JOptionPane.ERROR_MESSAGE);
1379
+ }
1380
+ }
1381
+
1382
+
1383
+ /**
1384
+ * Loads the given ProGuard configuration into the GUI.
1385
+ */
1386
+ private void loadConfiguration(URL url)
1387
+ {
1388
+ try
1389
+ {
1390
+ // Parse the configuration file.
1391
+ ConfigurationParser parser = new ConfigurationParser(url);
1392
+ Configuration configuration = new Configuration();
1393
+
1394
+ try
1395
+ {
1396
+ parser.parse(configuration);
1397
+
1398
+ // Let the GUI reflect the configuration.
1399
+ setProGuardConfiguration(configuration);
1400
+ }
1401
+ catch (ParseException ex)
1402
+ {
1403
+ JOptionPane.showMessageDialog(getContentPane(),
1404
+ msg("cantParseConfigurationFile", url),
1405
+ msg("warning"),
1406
+ JOptionPane.ERROR_MESSAGE);
1407
+ }
1408
+ finally
1409
+ {
1410
+ parser.close();
1411
+ }
1412
+ }
1413
+ catch (IOException ex)
1414
+ {
1415
+ JOptionPane.showMessageDialog(getContentPane(),
1416
+ msg("cantOpenConfigurationFile", url),
1417
+ msg("warning"),
1418
+ JOptionPane.ERROR_MESSAGE);
1419
+ }
1420
+ }
1421
+
1422
+
1423
+ /**
1424
+ * Saves the current ProGuard configuration to the given file.
1425
+ */
1426
+ private void saveConfiguration(File file)
1427
+ {
1428
+ try
1429
+ {
1430
+ // Save the configuration file.
1431
+ ConfigurationWriter writer = new ConfigurationWriter(file);
1432
+ writer.write(getProGuardConfiguration());
1433
+ writer.close();
1434
+ }
1435
+ catch (Exception ex)
1436
+ {
1437
+ JOptionPane.showMessageDialog(getContentPane(),
1438
+ msg("cantSaveConfigurationFile", file.getPath()),
1439
+ msg("warning"),
1440
+ JOptionPane.ERROR_MESSAGE);
1441
+ }
1442
+ }
1443
+
1444
+
1445
+ /**
1446
+ * Loads the given stack trace into the GUI.
1447
+ */
1448
+ private void loadStackTrace(File file)
1449
+ {
1450
+ try
1451
+ {
1452
+ StringBuffer buffer = new StringBuffer(1024);
1453
+
1454
+ Reader reader = new BufferedReader(new FileReader(file));
1455
+ try
1456
+ {
1457
+ while (true)
1458
+ {
1459
+ int c = reader.read();
1460
+ if (c < 0)
1461
+ {
1462
+ break;
1463
+ }
1464
+
1465
+ buffer.append(c);
1466
+ }
1467
+ }
1468
+ finally
1469
+ {
1470
+ reader.close();
1471
+ }
1472
+
1473
+ // Put the stack trace in the text area.
1474
+ stackTraceTextArea.setText(buffer.toString());
1475
+ }
1476
+ catch (IOException ex)
1477
+ {
1478
+ JOptionPane.showMessageDialog(getContentPane(),
1479
+ msg("cantOpenStackTraceFile", fileName(file)),
1480
+ msg("warning"),
1481
+ JOptionPane.ERROR_MESSAGE);
1482
+ }
1483
+ }
1484
+
1485
+
1486
+ /**
1487
+ * This ActionListener loads a ProGuard configuration file and initializes
1488
+ * the GUI accordingly.
1489
+ */
1490
+ private class MyLoadConfigurationActionListener implements ActionListener
1491
+ {
1492
+ public void actionPerformed(ActionEvent e)
1493
+ {
1494
+ configurationChooser.setDialogTitle(msg("selectConfigurationFile"));
1495
+
1496
+ int returnValue = configurationChooser.showOpenDialog(ProGuardGUI.this);
1497
+ if (returnValue == JFileChooser.APPROVE_OPTION)
1498
+ {
1499
+ loadConfiguration(configurationChooser.getSelectedFile());
1500
+ }
1501
+ }
1502
+ }
1503
+
1504
+
1505
+ /**
1506
+ * This ActionListener saves a ProGuard configuration file based on the
1507
+ * current GUI settings.
1508
+ */
1509
+ private class MySaveConfigurationActionListener implements ActionListener
1510
+ {
1511
+ public void actionPerformed(ActionEvent e)
1512
+ {
1513
+ configurationChooser.setDialogTitle(msg("saveConfigurationFile"));
1514
+
1515
+ int returnVal = configurationChooser.showSaveDialog(ProGuardGUI.this);
1516
+ if (returnVal == JFileChooser.APPROVE_OPTION)
1517
+ {
1518
+ saveConfiguration(configurationChooser.getSelectedFile());
1519
+ }
1520
+ }
1521
+ }
1522
+
1523
+
1524
+ /**
1525
+ * This ActionListener displays the ProGuard configuration specified by the
1526
+ * current GUI settings.
1527
+ */
1528
+ private class MyViewConfigurationActionListener implements ActionListener
1529
+ {
1530
+ public void actionPerformed(ActionEvent e)
1531
+ {
1532
+ // Make sure System.out has not been redirected yet.
1533
+ if (!systemOutRedirected)
1534
+ {
1535
+ consoleTextArea.setText("");
1536
+
1537
+ TextAreaOutputStream outputStream =
1538
+ new TextAreaOutputStream(consoleTextArea);
1539
+
1540
+ try
1541
+ {
1542
+ // TODO: write out relative path names and path names with system properties.
1543
+
1544
+ // Write the configuration.
1545
+ ConfigurationWriter writer = new ConfigurationWriter(outputStream);
1546
+ try
1547
+ {
1548
+ writer.write(getProGuardConfiguration());
1549
+ }
1550
+ finally
1551
+ {
1552
+ writer.close();
1553
+ }
1554
+ }
1555
+ catch (IOException ex)
1556
+ {
1557
+ // This shouldn't happen.
1558
+ }
1559
+
1560
+ // Scroll to the top of the configuration.
1561
+ consoleTextArea.setCaretPosition(0);
1562
+ }
1563
+ }
1564
+ }
1565
+
1566
+
1567
+ /**
1568
+ * This ActionListener executes ProGuard based on the current GUI settings.
1569
+ */
1570
+ private class MyProcessActionListener implements ActionListener
1571
+ {
1572
+ public void actionPerformed(ActionEvent e)
1573
+ {
1574
+ // Make sure System.out has not been redirected yet.
1575
+ if (!systemOutRedirected)
1576
+ {
1577
+ systemOutRedirected = true;
1578
+
1579
+ // Get the informational configuration file name.
1580
+ File configurationFile = configurationChooser.getSelectedFile();
1581
+ String configurationFileName = configurationFile != null ?
1582
+ configurationFile.getName() :
1583
+ msg("sampleConfigurationFileName");
1584
+
1585
+ // Create the ProGuard thread.
1586
+ Thread proGuardThread =
1587
+ new Thread(new ProGuardRunnable(consoleTextArea,
1588
+ getProGuardConfiguration(),
1589
+ configurationFileName));
1590
+
1591
+ // Run it.
1592
+ proGuardThread.start();
1593
+ }
1594
+ }
1595
+ }
1596
+
1597
+
1598
+ /**
1599
+ * This ActionListener loads an obfuscated stack trace from a file and puts
1600
+ * it in the proper text area.
1601
+ */
1602
+ private class MyLoadStackTraceActionListener implements ActionListener
1603
+ {
1604
+ public void actionPerformed(ActionEvent e)
1605
+ {
1606
+ fileChooser.setDialogTitle(msg("selectStackTraceFile"));
1607
+ fileChooser.setSelectedFile(null);
1608
+
1609
+ int returnValue = fileChooser.showOpenDialog(ProGuardGUI.this);
1610
+ if (returnValue == JFileChooser.APPROVE_OPTION)
1611
+ {
1612
+
1613
+ loadStackTrace(fileChooser.getSelectedFile());
1614
+ }
1615
+ }
1616
+ }
1617
+
1618
+
1619
+ /**
1620
+ * This ActionListener executes ReTrace based on the current GUI settings.
1621
+ */
1622
+ private class MyReTraceActionListener implements ActionListener
1623
+ {
1624
+ public void actionPerformed(ActionEvent e)
1625
+ {
1626
+ // Make sure System.out has not been redirected yet.
1627
+ if (!systemOutRedirected)
1628
+ {
1629
+ systemOutRedirected = true;
1630
+
1631
+ boolean verbose = reTraceVerboseCheckBox.isSelected();
1632
+ File retraceMappingFile = new File(reTraceMappingTextField.getText());
1633
+ String stackTrace = stackTraceTextArea.getText();
1634
+
1635
+ // Create the ReTrace runnable.
1636
+ Runnable reTraceRunnable = new ReTraceRunnable(reTraceTextArea,
1637
+ verbose,
1638
+ retraceMappingFile,
1639
+ stackTrace);
1640
+
1641
+ // Run it in this thread, because it won't take long anyway.
1642
+ reTraceRunnable.run();
1643
+ }
1644
+ }
1645
+ }
1646
+
1647
+
1648
+ // Small utility methods.
1649
+
1650
+ /**
1651
+ * Returns the canonical file name for the given file, or the empty string
1652
+ * if the file name is empty.
1653
+ */
1654
+ private String fileName(File file)
1655
+ {
1656
+ if (isFile(file))
1657
+ {
1658
+ try
1659
+ {
1660
+ return file.getCanonicalPath();
1661
+ }
1662
+ catch (IOException ex)
1663
+ {
1664
+ return file.getPath();
1665
+ }
1666
+ }
1667
+ else
1668
+ {
1669
+ return "";
1670
+ }
1671
+ }
1672
+
1673
+
1674
+ /**
1675
+ * Returns whether the given file is actually a file, or just a placeholder
1676
+ * for the standard output.
1677
+ */
1678
+ private boolean isFile(File file)
1679
+ {
1680
+ return file != null &&
1681
+ file.getPath().length() > 0;
1682
+ }
1683
+
1684
+
1685
+ /**
1686
+ * Attaches the tool tip from the GUI resources that corresponds to the
1687
+ * given key, to the given component.
1688
+ */
1689
+ private static JComponent tip(JComponent component, String messageKey)
1690
+ {
1691
+ component.setToolTipText(msg(messageKey));
1692
+
1693
+ return component;
1694
+ }
1695
+
1696
+
1697
+ /**
1698
+ * Returns the message from the GUI resources that corresponds to the given
1699
+ * key.
1700
+ */
1701
+ private static String msg(String messageKey)
1702
+ {
1703
+ return GUIResources.getMessage(messageKey);
1704
+ }
1705
+
1706
+
1707
+ /**
1708
+ * Returns the message from the GUI resources that corresponds to the given
1709
+ * key and argument.
1710
+ */
1711
+ private String msg(String messageKey,
1712
+ Object messageArgument)
1713
+ {
1714
+ return GUIResources.getMessage(messageKey, new Object[] {messageArgument});
1715
+ }
1716
+
1717
+
1718
+ /**
1719
+ * The main method for the ProGuard GUI.
1720
+ */
1721
+ public static void main(final String[] args)
1722
+ {
1723
+ try
1724
+ {
1725
+ SwingUtil.invokeAndWait(new Runnable()
1726
+ {
1727
+ public void run()
1728
+ {
1729
+ try
1730
+ {
1731
+ ProGuardGUI gui = new ProGuardGUI();
1732
+ gui.pack();
1733
+
1734
+ Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
1735
+ Dimension guiSize = gui.getSize();
1736
+ gui.setLocation((screenSize.width - guiSize.width) / 2,
1737
+ (screenSize.height - guiSize.height) / 2);
1738
+ gui.show();
1739
+
1740
+ // Start the splash animation, unless specified otherwise.
1741
+ int argIndex = 0;
1742
+ if (argIndex < args.length &&
1743
+ NO_SPLASH_OPTION.startsWith(args[argIndex]))
1744
+ {
1745
+ gui.skipSplash();
1746
+ argIndex++;
1747
+ }
1748
+ else
1749
+ {
1750
+ gui.startSplash();
1751
+ }
1752
+
1753
+ // Load an initial configuration, if specified.
1754
+ if (argIndex < args.length)
1755
+ {
1756
+ gui.loadConfiguration(new File(args[argIndex]));
1757
+ argIndex++;
1758
+ }
1759
+
1760
+ if (argIndex < args.length)
1761
+ {
1762
+ System.out.println(gui.getClass().getName() + ": ignoring extra arguments [" + args[argIndex] + "...]");
1763
+ }
1764
+ }
1765
+ catch (Exception e)
1766
+ {
1767
+ System.out.println("Internal problem starting the ProGuard GUI (" + e.getMessage() + ")");
1768
+ }
1769
+ }
1770
+ });
1771
+ }
1772
+ catch (Exception e)
1773
+ {
1774
+ System.out.println("Internal problem starting the ProGuard GUI (" + e.getMessage() + ")");
1775
+ }
1776
+ }
1777
+ }