From 96d23c26c18ad24d20366827954d31e1bc9feab6 Mon Sep 17 00:00:00 2001 From: Justson Date: Sun, 27 Aug 2017 17:58:15 +0800 Subject: [PATCH] release 2.0.0 --- README.md | 27 +++++++++++++------ README_ENGLISH.md | 4 +-- library/build.gradle | 2 +- .../java/com/just/library/AgentWebConfig.java | 2 +- 4 files changed, 23 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 4b459f09..627ddc1b 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ WebView 可谓是每个应用必备的一个控件了 ,但是它不是一个 * Gradle ``` - compile 'com.just.agentweb:agentweb:1.2.6' + compile 'com.just.agentweb:agentweb:2.0.0' ``` * Maven @@ -53,7 +53,7 @@ WebView 可谓是每个应用必备的一个控件了 ,但是它不是一个 com.just.agentweb agentweb - 1.2.6 + 2.0.0 pom @@ -205,6 +205,20 @@ AgentWebConfig.syncCookie("http://www.jd.com","ID=XXXX") ``` String cookies=AgentWebConfig.getCookiesByUrl(targetUrl); ``` +* #### 权限拦截 +``` +protected PermissionInterceptor mPermissionInterceptor = new PermissionInterceptor() { + + //AgentWeb 在触发某些敏感的 Action 时候会回调该方法, 比如定位触发 。 + //例如 http//:www.taobao.com 该 Url 需要定位权限, 返回false ,如果版本大于等于23 , agentWeb 会动态申请权限 ,true 该Url对应页面请求定位失败。 + //该方法是每次都会优先触发的 , 开发者可以做一些敏感权限拦截 。 + @Override + public boolean intercept(String url, String[] permissions, String action) { + Log.i(TAG, "url:" + url + " permission:" + permissions + " action:" + action); + return false; + } + }; +``` * #### AgentWeb 所需要的权限 ``` @@ -247,13 +261,10 @@ Java 注入类不要混淆 , 例如 sample 里面的 AndroidInterface 类 , * v_1.2.0 全面支持全屏视频 。 * v_1.1.2 完善功能 。 -## 下个版本功能预告 - -* 支持动态权限申请 -* 废弃 `uploadFileResult` 方法 (走 `ActionActivity` 绕过该方法) -* 加入权限控制 -* `FileChooser` 加入了拍照选择 +## 下个版本预告 +* 加入默认的错误页 +* 支持自定义错误页 ## 致谢 * [SafeWebView](https://github.com/seven456/SafeWebView) diff --git a/README_ENGLISH.md b/README_ENGLISH.md index cbc50d09..276999fd 100644 --- a/README_ENGLISH.md +++ b/README_ENGLISH.md @@ -39,7 +39,7 @@ Support | Simplicity | Support | Concise | Yes | Security | Support | * Gradle ``` - compile 'com.just.agentweb:agentweb:1.2.6' + compile 'com.just.agentweb:agentweb:2.0.0' ``` * Maven @@ -47,7 +47,7 @@ Support | Simplicity | Support | Concise | Yes | Security | Support | com.just.agentweb agentweb - 1.2.6 + 2.0.0 pom diff --git a/library/build.gradle b/library/build.gradle index 15a8ab01..d585ba09 100644 --- a/library/build.gradle +++ b/library/build.gradle @@ -51,7 +51,7 @@ publish { userOrg = 'just' groupId = 'com.just.agentweb' artifactId = 'agentweb' - version = '1.2.6' + version = '2.0.0' description = 'very easy to build you web page' website = "https://github.com/Justson/AgentWeb" } diff --git a/library/src/main/java/com/just/library/AgentWebConfig.java b/library/src/main/java/com/just/library/AgentWebConfig.java index 3e142bf8..b68e4eb6 100644 --- a/library/src/main/java/com/just/library/AgentWebConfig.java +++ b/library/src/main/java/com/just/library/AgentWebConfig.java @@ -24,7 +24,7 @@ public class AgentWebConfig { static final String AGENTWEB_CACHE_PATCH = File.separator + "agentweb-cache"; static final String FILE_CACHE_PATH = "agentweb-cache"; static String AGENTWEB_FILE_PATH; - public static boolean DEBUG = true; + public static boolean DEBUG = false; static final boolean isKikatOrBelowKikat = Build.VERSION.SDK_INT <= Build.VERSION_CODES.KITKAT; public static final int WEBVIEW_DEFAULT_TYPE = 1; public static final int WEBVIEW_AGENTWEB_SAFE_TYPE = 2;