How to configure Proguard to keep static methods with different return times
<p>I have a set of classes (more than 50) that contain a few static methods called <code>parse()</code> that returns an instance of that class. This is an example of one of those classes:</p>

<pre><code>class SomeType {

   // Parse methods
   public static SomeType parse(String text) { ... }
   public static SomeType parse(Object obj) { ... }
   ...

   // Other methods
   public void static somethingStatic(...) { ... }
   public void somethingNotStatic(...) { ... }
   ...
}
</code></pre>

<p>I'm trying to configure ProGuard to obfuscate these classes and all their methods and fields <strong>except</strong> the <code>parse(...)</code> methods. Basically, I want to obfuscate the class name, all static and non-static methods, plus the class fields.</p>

<p>I've tried to use:</p>

<pre><code>-keepclassmembers class SomeType {
  public static SomeType parse(***);
}
</code></pre>

<p>and that worked fine for <code>SomeType</code>, but I don't want to have to write this rule for each of my 50 classes... so how can I generalize it?</p>

<p>I tried:</p>

<pre><code>-keepclassmembers class ** {
  public static * parse(***);
}
</code></pre>

<p>but ProGuard complains about the syntax of the return type...</p>