How to remove a method using ProGuard
<p><em>inb4 duplicate</em></p>

<p>I know there are many questions/blogs available about how to remove logging code from an app using ProGuard, I've tried those solutions and they work as they are designed to. My problem is slightly different. In my app, I haven't used the default logging methods or <code>System.out.println()</code> directly from anywhere. Instead, I have a custom method that calls <code>System.out.println()</code> and this method (<code>MyApplication.log()</code>) is called by my app every time it logs something. There is a reason why <strong>I need this method</strong>.</p>

<p>My <code>public static void log()</code> method resides in a class called <code>MyApplication</code> that overrides the default <code>Application</code> class. I got this ProGuard rule from <a href="https://stackoverflow.com/a/35105403/3856009">here</a>:</p>

<pre><code>-assumenosideeffects class java.io.PrintStream {
     public void println(%);
     public void println(**);
}
</code></pre>

<p>This successfully removes direct usages of <code>System.out.println()</code>, including from <code>MyApplication.log()</code>. But when I use this very rule by tweaking it to remove <code>MyApplication.log()</code>, it doesn't work:</p>

<pre><code>-assumenosideeffects class changed.package.name.MyApplication {
     public static void log(...);
}
</code></pre>

<p>There are two versions of the <code>log()</code>:</p>

<ol>
<li><code>log(String)</code></li>
<li><code>log(String, int)</code></li>
</ol>

<p>None of them get removed. The method gets obfuscated to <code>m17739c()</code>, I even (childishly) added this method name in the rule. It still didn't work.</p>

<p>I don't believe <code>-assumenosideeffects</code> was designed specifically for the default logging methods. What am I doing wrong here?</p>