Skip to content

Commit

Permalink
update progurad rules
Browse files Browse the repository at this point in the history
  • Loading branch information
lemon committed Apr 9, 2018
1 parent 2d6d6ae commit d903960
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ You can set your policy according to the current page's url and the parameters y
-keepclassmembers class tech.easily.easybridge.lib.EasyBridge{
public *;
}
-keepclassmembernames class tech.easily.easybridge.lib.CallBackMessage{
<fields>;
}
```

# <a name="README_CN">功能</a>
Expand Down Expand Up @@ -216,6 +219,9 @@ EasyBridge提供两种安全检查策略。其中全局的安全检查在EasyBri
-keepclassmembers class tech.easily.easybridge.lib.EasyBridge{
public *;
}
-keepclassmembernames class tech.easily.easybridge.lib.CallBackMessage{
<fields>;
}
```

# EasyBridge
Expand Down
3 changes: 3 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,7 @@
#-renamesourcefileattribute SourceFile
-keepclassmembers class tech.easily.easybridge.lib.EasyBridge{
public *;
}
-keepclassmembernames class tech.easily.easybridge.lib.CallBackMessage{
<fields>;
}
4 changes: 3 additions & 1 deletion app/src/main/assets/demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
}, false);

function toast(params) {
window.easyBridge.callHandler('toast', 'toast with:' + params + 'at ' + new Date().toLocaleString());
window.easyBridge.callHandler('toast', 'toast with:' + params + 'at ' + new Date().toLocaleString(),function(result){
console.log('receive data:'+result);
});
}

function jumpToPage(){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ import tech.easily.easybridge.lib.handler.BaseBridgeHandler
class ToastHandler(handlerName:String,webView: EasyBridgeWebView) : BaseBridgeHandler(handlerName,webView) {
override fun onCall(parameters: String?, callBack: ResultCallBack?) {
Toast.makeText(webView.context, parameters, Toast.LENGTH_SHORT).show()
callBack?.onResult(null)
callBack?.onResult("data send to js")
}
}

0 comments on commit d903960

Please sign in to comment.