From 270106b403a3295c47eea5ae7db6e39df05babd4 Mon Sep 17 00:00:00 2001 From: jackjintai Date: Fri, 7 Aug 2020 18:51:20 +0800 Subject: [PATCH] =?UTF-8?q?modify:=201=E3=80=81add=20android=20dokit=20v3.?= =?UTF-8?q?2.0=20&=203.1.8.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Android/java/app/doraemonkit.gradle | 4 +- Android/java/build.gradle | 4 +- Android/java/config.gradle | 4 +- Android/java/settings.gradle | 2 +- Doc/android-ReleaseNotes.md | 9 ++++ Doc/android_cn_guide.md | 83 +++++++++++++++++++---------- Doc/android_en_guide.md | 32 +++++++---- README.md | 8 +-- README_CN.md | 2 +- 9 files changed, 98 insertions(+), 50 deletions(-) diff --git a/Android/java/app/doraemonkit.gradle b/Android/java/app/doraemonkit.gradle index abee76fa..761e0fd2 100644 --- a/Android/java/app/doraemonkit.gradle +++ b/Android/java/app/doraemonkit.gradle @@ -1,7 +1,7 @@ if (rootProject.ext.config["runType"] == 0) { // 引用插件 - //apply plugin: 'com.didi.dokit.debug' - apply plugin: 'com.didi.dokit' + apply plugin: 'com.didi.dokit.debug' +// apply plugin: 'com.didi.dokit' // 这里引用正常库 dependencies { //外部平台依赖 diff --git a/Android/java/build.gradle b/Android/java/build.gradle index c97c1936..9dca0402 100644 --- a/Android/java/build.gradle +++ b/Android/java/build.gradle @@ -4,7 +4,7 @@ buildscript { repositories { google() jcenter() - maven { url 'http://artifactory.intra.xiaojukeji.com/artifactory/public' } +// maven { url 'http://artifactory.intra.xiaojukeji.com/artifactory/public' } maven { //本地插件地址 url uri(rootProject.ext.config["localRepoURL"]) @@ -23,7 +23,7 @@ allprojects { repositories { google() jcenter() - maven { url 'http://artifactory.intra.xiaojukeji.com/artifactory/public' } +// maven { url 'http://artifactory.intra.xiaojukeji.com/artifactory/public' } maven { //本地插件地址 url uri(rootProject.ext.config["localRepoURL"]) diff --git a/Android/java/config.gradle b/Android/java/config.gradle index 6e7da88b..d7817f5c 100755 --- a/Android/java/config.gradle +++ b/Android/java/config.gradle @@ -2,14 +2,14 @@ ext { config = [ //0:运行模式 //1:打包模式 - runOrPublish : 1, + runOrPublish : 0, //0:依赖dokit本地module运行 //1:依赖dokit远程aar运行 runType : 0, //0:发布到到本地localRepoURL仓库 //1:发布到滴滴内部仓库 一般不建议使用 如果需要发布到滴滴内网仓库需要将版本号改得比较大 假如版本号跟jcenter上的一致会由于缓存导致没法下载最新的jcenter的线上代码 //2:发布到jcenter远程仓库 - publishArchivesType: 2, + publishArchivesType: 0, //本地仓库地址 localRepoURL : "/Users/didi/project/dokit_repo" ] diff --git a/Android/java/settings.gradle b/Android/java/settings.gradle index 4e1f0882..4d8d652f 100644 --- a/Android/java/settings.gradle +++ b/Android/java/settings.gradle @@ -1,6 +1,6 @@ include ':app' include ':doraemonkit' -include ':doraemonkit-rpc' +//include ':doraemonkit-rpc' include ':doraemonkit-no-op' include ':doraemonkit-weex' include ':doraemonkit-leakcanary' diff --git a/Doc/android-ReleaseNotes.md b/Doc/android-ReleaseNotes.md index d146ce05..f007a0f4 100644 --- a/Doc/android-ReleaseNotes.md +++ b/Doc/android-ReleaseNotes.md @@ -1,5 +1,14 @@ DoraemonKit-Android releases === +## 3.2.0 & 3.0.8.0 +1.文件同步助手功能已推出。 +详细文档参考: +http://xingyun.xiaojukeji.com/docs/dokit/#/FileList + +**注意: 由于文件同步助手的http服务是在终端启动的,暂时没法正常处理https协议的请求。所以要正常使用该功能,需要手动将当前web页面的https协议手动改成http协议,否则浏览器会对当前的请求进行安全拦截,导致不能正常使用该功能。** + +2.github issues fixed + ## 3.1.8 & 3.0.7.2 1.适配AGP 4.0 diff --git a/Doc/android_cn_guide.md b/Doc/android_cn_guide.md index e05a315f..0a6df3d0 100644 --- a/Doc/android_cn_guide.md +++ b/Doc/android_cn_guide.md @@ -2,8 +2,8 @@ |DoKit|最新版本|描述| |-|-|-| -|支持Androidx|3.1.8|从v3.1.0版本开始支持androidx| -|支持android support|3.0.7.2|3.0.7.1版本对应3.1.8的功能,后期support将会不定期更新,主要还是看社区的反馈,请大家尽快升级和适配Androidx| +|支持Androidx|3.2.0|从v3.1.0版本开始支持androidx| +|支持android support|3.0.8.0|3.0.8.0版本对应3.2.0的功能,后期support将会不定期更新,主要还是看社区的反馈,请大家尽快升级和适配Androidx| #### 1. Gradle 依赖 @@ -11,8 +11,8 @@ ```groovy dependencies { … - debugImplementation 'com.didichuxing.doraemonkit:doraemonkit:3.1.8' - releaseImplementation 'com.didichuxing.doraemonkit:doraemonkit-no-op:3.1.8' + debugImplementation 'com.didichuxing.doraemonkit:doraemonkit:3.2.0' + releaseImplementation 'com.didichuxing.doraemonkit:doraemonkit-no-op:3.2.0' … } ``` @@ -21,20 +21,20 @@ dependencies { 滴滴内部业务线接入请将 ``` -debugImplementation 'com.didichuxing.doraemonkit:doraemonkit:3.1.8' +debugImplementation 'com.didichuxing.doraemonkit:doraemonkit:3.2.0' ``` 替换为 ``` -debugImplementation 'com.didichuxing.doraemonkit:doraemonkit-rpc:3.1.8' +debugImplementation 'com.didichuxing.doraemonkit:doraemonkit-rpc:3.2.0' ``` **注意:** 假如你无法通过 jcenter 下载到依赖库并报了以下的错误 ``` -ERROR: Failed to resolve: com.didichuxing.doraemonkit:doraemonkit:3.1.8 +ERROR: Failed to resolve: com.didichuxing.doraemonkit:doraemonkit:3.2.0 ``` 建议你可以尝试挂载VPN或通过命令行重试(以Mac系统为例 项目根目录下) @@ -63,7 +63,7 @@ DoraemonKit目前已支持Weex工具,包括 ```groovy dependencies { … - debugImplementation 'com.didichuxing.doraemonkit:doraemonkit-weex:3.1.8' + debugImplementation 'com.didichuxing.doraemonkit:doraemonkit-weex:3.2.0' … } ``` @@ -73,7 +73,7 @@ dependencies { ```groovy dependencies { … - debugImplementation 'com.didichuxing.doraemonkit:doraemonkit-leakcanary:3.1.8' + debugImplementation 'com.didichuxing.doraemonkit:doraemonkit-leakcanary:3.2.0' … } ``` @@ -118,7 +118,7 @@ AOP包括以下几个功能: buildscript { dependencies { … - classpath 'com.didichuxing.doraemonkit:doraemonkit-plugin:3.1.8' + classpath 'com.didichuxing.doraemonkit:doraemonkit-plugin:3.2.0' … } } @@ -135,8 +135,6 @@ apply plugin: 'com.didi.dokit' 添加到app module 的build.gradle文件下 与android {}处于同一级 ```groovy dokitExt { - //dokit 插件开关 - dokitPluginSwitch true //通用设置 comm { //地图经纬度开关 @@ -173,7 +171,21 @@ dokitExt { } } ``` - +项目根目录下的gradle.properties文件进行以下配置 +``` +#dokit全局配置 +# 插件开关 +DOKIT_PLUGIN_SWITCH=true +# 插件日志 +DOKIT_LOG_SWITCH=true +#dokit 慢函数开关 +DOKIT_METHOD_SWITCH=true +#dokit 函数调用栈层级 +DOKIT_METHOD_STACK_LEVEL=4 +#0:默认模式 打印函数调用栈 需添加指定入口 默认为application onCreate 和attachBaseContext +#1:普通模式 运行时打印某个函数的耗时 全局业务代码函数插入 +DOKIT_METHOD_STRATEGY=0 +``` #### 4. 自定义功能组件(可选) @@ -225,22 +237,26 @@ public void onCreate() { **DoraemonKit入口api** ``` object DoraemonKit { - //不需要productId @JvmStatic fun install(app: Application) { } - //需要productId @JvmStatic fun install(app: Application, productId: String) { } - - //用户自定义用户专区分组 + + @JvmStatic + fun install(app: Application, mapKits: LinkedHashMap>) { + } + @JvmStatic fun install(app: Application, mapKits: LinkedHashMap>, productId: String) { } - - //默认用户专区分组 + + @JvmStatic + fun install(app: Application, listKits: MutableList) { + } + @JvmStatic fun install(app: Application, listKits: MutableList, productId: String) { } @@ -252,25 +268,18 @@ object DoraemonKit { * @param productId Dokit平台端申请的productId */ @JvmStatic - private fun install(app: Application, mapKits: LinkedHashMap>? = linkedMapOf(), listKits: MutableList? = mutableListOf(), productId: String? = "") { + private fun install(app: Application, mapKits: LinkedHashMap>? = linkedMapOf(), listKits: MutableList? = mutableListOf(), productId: String? = "") { } - - //h5任意门回调 + @JvmStatic fun setWebDoorCallback(callback: WebDoorManager.WebDoorCallback?) { } - //显示mainIcon @JvmStatic fun show() { } - //隐藏mainIcon - @JvmStatic - fun hide() { - } - /** * 直接显示工具面板页面 */ @@ -285,7 +294,9 @@ object DoraemonKit { fun hideToolPanel() { } - + @JvmStatic + fun hide() { + } /** * 禁用app信息上传开关,该上传信息只为做DoKit接入量的统计,如果用户需要保护app隐私,可调用该方法进行禁用 @@ -308,6 +319,20 @@ object DoraemonKit { @JvmStatic fun setAwaysShowMainIcon(awaysShow: Boolean) { } + + /** + * 设置加密数据库密码 + */ + @JvmStatic + fun setDatabasePass(map: Map) { + } + + /** + * 设置文件管理助手http端口号 + */ + @JvmStatic + fun setFileManagerHttpPort(port: Int) { + } } ``` diff --git a/Doc/android_en_guide.md b/Doc/android_en_guide.md index 1c4e58af..7c39cc31 100644 --- a/Doc/android_en_guide.md +++ b/Doc/android_en_guide.md @@ -2,16 +2,16 @@ |DoKit|new Version|Desc| |- |- |- | -|support Androidx|3.1.8|support Androidx from v3.1.0| -|supprot android support|3.0.7.2|Version 3.0.7.2 corresponds to the function of 3.1.8. Later support will be updated from time to time, mainly based on community feedback, please upgrade and adapt to Androidx as soon as possible| +|support Androidx|3.2.0|support Androidx from v3.1.0| +|supprot android support|3.0.8.0|Version 3.0.8.0 corresponds to the function of 3.2.0. Later support will be updated from time to time, mainly based on community feedback, please upgrade and adapt to Androidx as soon as possible| #### 1. DoKit SDK Dependencie ```groovy dependencies { - debugImplementation 'com.didichuxing.doraemonkit:doraemonkit:3.1.8' - releaseImplementation 'com.didichuxing.doraemonkit:doraemonkit-no-op:3.1.8' + debugImplementation 'com.didichuxing.doraemonkit:doraemonkit:3.2.0' + releaseImplementation 'com.didichuxing.doraemonkit:doraemonkit-no-op:3.2.0' } ``` @@ -21,7 +21,7 @@ dependencies { If you cannot download the dependent library through jcenter and report the following error ``` -ERROR: Failed to resolve: com.didichuxing.doraemonkit:doraemonkit:3.1.8 +ERROR: Failed to resolve: com.didichuxing.doraemonkit:doraemonkit:3.2.0 ``` You can try again from the command line (take Mac system as an example under the project root directory) @@ -47,7 +47,7 @@ If you need to support Weex, you can directly add the following dependencies ```groovy dependencies { … - debugImplementation 'com.didichuxing.doraemonkit:doraemonkit-weex:3.1.8' + debugImplementation 'com.didichuxing.doraemonkit:doraemonkit-weex:3.2.0' … } ``` @@ -57,7 +57,7 @@ If you need to integrate LeakCanary, you can directly add the following dependen ```groovy dependencies { … - debugImplementation 'com.didichuxing.doraemonkit:doraemonkit-leakcanary:3.1.8' + debugImplementation 'com.didichuxing.doraemonkit:doraemonkit-leakcanary:3.2.0' … } ``` @@ -89,7 +89,7 @@ Plugin includes the following functions: ```groovy buildscript { dependencies { - classpath 'com.didichuxing.doraemonkit:doraemonkit-plugin:3.1.8' + classpath 'com.didichuxing.doraemonkit:doraemonkit-plugin:3.2.0' } } ``` @@ -105,7 +105,6 @@ Added to the app module's build.gradle file at the same level as android {} ```groovy dokitExt { //dokit plugin switch - dokitPluginSwitch true comm { gpsSwitch true @@ -141,6 +140,21 @@ dokitExt { } } ``` +The gradle.properties file in the project root directory is configured as follows +``` +# dokit global configuration +# Plug-in switch +DOKIT_PLUGIN_SWITCH=true +# Plugin log +DOKIT_LOG_SWITCH=true +# dokit slow function switch +DOKIT_METHOD_SWITCH=true +# dokit function call stack level +DOKIT_METHOD_STACK_LEVEL=4 +# 0:The default mode is to print the function call stack, and the specified entry needs to be added. The default is application onCreate and attachBaseContext +# 1:Normal mode prints the time consuming of a certain function when running, inserts global business code functions +DOKIT_METHOD_STRATEGY=0 +``` diff --git a/README.md b/README.md index 926cb2a7..9f7ef339 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@
DoraemonKit - +
@@ -117,7 +117,7 @@ buildscript { } dependencies { classpath 'com.android.tools.build:gradle:3.6.1' - classpath 'com.didichuxing.doraemonkit:doraemonkit-plugin:3.1.8' + classpath 'com.didichuxing.doraemonkit:doraemonkit-plugin:3.2.0' } } @@ -130,8 +130,8 @@ apply plugin: 'com.didi.dokit' and then implementation DoKit SDK ``` -debugImplementation "com.didichuxing.doraemonkit:doraemonkit:3.1.8" -releaseImplementation "com.didichuxing.doraemonkit:doraemonkit-no-op:3.1.8" +debugImplementation "com.didichuxing.doraemonkit:doraemonkit:3.2.0" +releaseImplementation "com.didichuxing.doraemonkit:doraemonkit-no-op:3.2.0" ``` #### 2、SDK Init diff --git a/README_CN.md b/README_CN.md index 08693b4f..919db186 100644 --- a/README_CN.md +++ b/README_CN.md @@ -1,7 +1,7 @@
DoraemonKit - + -- GitLab