ProGuard obfuscating classes even after `keep class` flag. Affecting Android WebView behavior

后端 未结 2 2033
青春惊慌失措
青春惊慌失措 2021-01-06 23:25

I\'m using ProGuard to obfuscate my Android app.

I\'m also using WebView to show a webpage (an HTML walkthrough page) that contains a button that will c

2条回答
  •  别那么骄傲
    2021-01-07 00:03

    Not sure if it is just a typo in your post or not, but the ProGuard configuration file refers to

    com.myapp.android.JavaScriptInterface
    

    whereas your Java class indicates a different package

    package com.myclass.android; // myapp != myclass
    

    and, of course, they must be the same.

    EDIT: in addition to your existing configuration, try adding the following option:

    -keepclassmembers class com.myclass.android.JavaScriptInterface { 
        public ;
    }
    

提交回复
热议问题