title: How to configure proguard for javascript interface?
body: <p>I have a implemented a Webview which takes use of JavascriptInterface. It's working fine when not obfuscating, but at once Proguard is active, it does not work. I've looked here at other answers, but i still can't get it working.</p>
  
  <p><strong>Some of the WebView class:</strong></p>
  
  <pre><code>public class Activity_Webview {
  private WebView webView;
  
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          webView = (WebView) findViewById(R.id.webview);
          webView.getSettings().setJavaScriptEnabled(true);
          webView.addJavascriptInterface(new JavaScriptInterface (), "HTMLOUT");
          webView.setWebViewClient(mWebViewClient);
      }
  
      public class JavaScriptInterface implements NonObfuscateable{
          @JavascriptInterface
          public void processHTML(String html) {
          handleFinishFromWebView(html);
      }
  }
  </code></pre>
  
  <p><strong>What i've tried in Proguard</strong>:</p>
  
  <pre><code>-keep public class * implements com.project.NonObfuscateable
  -keepclassmembers class * implements NonObfuscateable {
      public void processHTML(java.lang.String);
  }
  </code></pre>
  
  <p><strong>I've also tried this (when not implementing NonObfuscateable interface</strong>:</p>
  
  <pre><code>-keep public class com.project.Activity_Webview.JavaScriptInterface
  -keep public class * implements com.project.Activity_Webview.JavaScriptInterface
  -keepclassmembers class * implements com.project.Activity_Webview.JavaScriptInterface {
      &lt;fields&gt;;
      &lt;methods&gt;;
  }
  </code></pre>
  
  <p>Does anybody have an idea of what could be wrong?
  Thanks in advance</p>