From 47eb0b6a632d0a3e9e0ba693c3c45335b97111d2 Mon Sep 17 00:00:00 2001 From: yangchong Date: Thu, 3 Mar 2022 11:46:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E6=B2=99=E7=9B=92=E5=B0=8F?= =?UTF-8?q?=E5=B7=A5=E5=85=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CommonLib/AppStatusLib/build.gradle | 2 +- CommonLib/ApplicationLib/build.gradle | 2 +- CommonLib/ComponentLib/build.gradle | 2 +- CommonLib/ConfigLayer/build.gradle | 2 +- CommonLib/ToolUtilsLib/build.gradle | 3 +- MonitorLib/MonitorAliveLib/build.gradle | 2 +- MonitorLib/MonitorAnrLib/build.gradle | 2 +- MonitorLib/MonitorCatonLib/build.gradle | 2 +- MonitorLib/MonitorCrashLib/build.gradle | 2 +- MonitorLib/MonitorFileLib/build.gradle | 2 +- .../monitorfilelib/FileExplorerFragment.java | 13 +- .../yc/monitorfilelib/TextDetailFragment.java | 2 +- MonitorLib/MonitorNetLib/build.gradle | 2 +- MonitorLib/MonitorOomLib/build.gradle | 2 +- ...45\345\205\267\345\256\236\350\267\265.md" | 153 ++++++++++++++++-- ServerLib/GsonServer/build.gradle | 2 +- ServerLib/HttpServer/build.gradle | 2 +- ServerLib/ImageServer/build.gradle | 2 +- ServerLib/NfcServer/build.gradle | 2 +- ServerLib/ServerInterface/build.gradle | 2 +- ServerLib/ShareServer/build.gradle | 2 +- ServerLib/XlogServer/build.gradle | 2 +- ToolLib/AnimatorToolLib/build.gradle | 2 +- ToolLib/AppTraceTool/build.gradle | 2 +- ToolLib/CountTimerLib/build.gradle | 2 +- ToolLib/LocaleHelperLib/build.gradle | 2 +- ToolLib/LongevityLib/build.gradle | 2 +- ToolLib/NetHelperLib/build.gradle | 2 +- ToolLib/SerialTaskLib/build.gradle | 2 +- ToolLib/SocketIoLib/build.gradle | 2 +- ToolLib/ThreadPoolLib/build.gradle | 2 +- ToolLib/ThreadTaskLib/build.gradle | 2 +- ToolLib/WebSocketLib/build.gradle | 2 +- ToolLib/ZxingServerLib/build.gradle | 2 +- WidgetLib/AppStateLib/build.gradle | 2 +- WidgetLib/BannerViewLib/build.gradle | 2 +- WidgetLib/BlurViewLib/build.gradle | 2 +- WidgetLib/CustomWidget/build.gradle | 2 +- WidgetLib/FragmentLib/build.gradle | 2 +- WidgetLib/LargeImageLib/build.gradle | 2 +- WidgetLib/PhotoWidget/build.gradle | 2 +- WidgetLib/StatusBarLib/build.gradle | 2 +- WidgetLib/SwipeBackLib/build.gradle | 2 +- .../java/com/yc/swipe/SwipeBackHelper.java | 1 - .../java/com/yc/swipe/SwipeBackLayout.java | 5 +- .../com/yc/swipe/SwipeBackShadowView.java | 1 - WidgetLib/WidgetViewLib/build.gradle | 2 +- WidgetLib/ZoomImageLib/build.gradle | 2 +- 48 files changed, 197 insertions(+), 63 deletions(-) diff --git a/CommonLib/AppStatusLib/build.gradle b/CommonLib/AppStatusLib/build.gradle index e8b10360c..788af683b 100644 --- a/CommonLib/AppStatusLib/build.gradle +++ b/CommonLib/AppStatusLib/build.gradle @@ -5,7 +5,7 @@ apply plugin: 'com.github.dcendents.android-maven' android { compileSdkVersion rootProject.ext.android["compileSdkVersion"] - buildToolsVersion rootProject.ext.android["buildToolsVersion"] + //buildToolsVersion rootProject.ext.android["buildToolsVersion"] defaultConfig { minSdkVersion rootProject.ext.android["minSdkVersion"] diff --git a/CommonLib/ApplicationLib/build.gradle b/CommonLib/ApplicationLib/build.gradle index a8d893bdf..28faec30a 100644 --- a/CommonLib/ApplicationLib/build.gradle +++ b/CommonLib/ApplicationLib/build.gradle @@ -5,7 +5,7 @@ apply plugin: 'com.github.dcendents.android-maven' android { compileSdkVersion rootProject.ext.android["compileSdkVersion"] - buildToolsVersion rootProject.ext.android["buildToolsVersion"] + //buildToolsVersion rootProject.ext.android["buildToolsVersion"] defaultConfig { minSdkVersion rootProject.ext.android["minSdkVersion"] diff --git a/CommonLib/ComponentLib/build.gradle b/CommonLib/ComponentLib/build.gradle index 2055bca0a..0fe31aef1 100644 --- a/CommonLib/ComponentLib/build.gradle +++ b/CommonLib/ComponentLib/build.gradle @@ -5,7 +5,7 @@ apply plugin: 'com.github.dcendents.android-maven' android { compileSdkVersion rootProject.ext.android["compileSdkVersion"] - buildToolsVersion rootProject.ext.android["buildToolsVersion"] + //buildToolsVersion rootProject.ext.android["buildToolsVersion"] defaultConfig { minSdkVersion rootProject.ext.android["minSdkVersion"] diff --git a/CommonLib/ConfigLayer/build.gradle b/CommonLib/ConfigLayer/build.gradle index 285dbcb43..b8a746706 100644 --- a/CommonLib/ConfigLayer/build.gradle +++ b/CommonLib/ConfigLayer/build.gradle @@ -2,7 +2,7 @@ apply plugin: 'com.android.library' android { compileSdkVersion rootProject.ext.android["compileSdkVersion"] - buildToolsVersion rootProject.ext.android["buildToolsVersion"] + //buildToolsVersion rootProject.ext.android["buildToolsVersion"] defaultConfig { minSdkVersion rootProject.ext.android["minSdkVersion"] diff --git a/CommonLib/ToolUtilsLib/build.gradle b/CommonLib/ToolUtilsLib/build.gradle index 318902998..208898c51 100644 --- a/CommonLib/ToolUtilsLib/build.gradle +++ b/CommonLib/ToolUtilsLib/build.gradle @@ -8,7 +8,7 @@ apply plugin: 'com.github.dcendents.android-maven' android { compileSdkVersion rootProject.ext.android["compileSdkVersion"] - buildToolsVersion rootProject.ext.android["buildToolsVersion"] + //buildToolsVersion rootProject.ext.android["buildToolsVersion"] defaultConfig { minSdkVersion rootProject.ext.android["minSdkVersion"] targetSdkVersion rootProject.ext.android["targetSdkVersion"] @@ -32,5 +32,4 @@ dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation(rootProject.ext.dependencies["appcompat"]) implementation(rootProject.ext.dependencies["annotation"]) - implementation rootProject.ext.dependencies["utilcode"] } \ No newline at end of file diff --git a/MonitorLib/MonitorAliveLib/build.gradle b/MonitorLib/MonitorAliveLib/build.gradle index cf741b593..54b79327b 100644 --- a/MonitorLib/MonitorAliveLib/build.gradle +++ b/MonitorLib/MonitorAliveLib/build.gradle @@ -6,7 +6,7 @@ apply from: rootProject.projectDir.absolutePath + "/yc.gradle" android { compileSdkVersion rootProject.ext.android["compileSdkVersion"] - buildToolsVersion rootProject.ext.android["buildToolsVersion"] + //buildToolsVersion rootProject.ext.android["buildToolsVersion"] defaultConfig { minSdkVersion rootProject.ext.android["minSdkVersion"] targetSdkVersion rootProject.ext.android["targetSdkVersion"] diff --git a/MonitorLib/MonitorAnrLib/build.gradle b/MonitorLib/MonitorAnrLib/build.gradle index 2bd3d693d..98e115c5f 100644 --- a/MonitorLib/MonitorAnrLib/build.gradle +++ b/MonitorLib/MonitorAnrLib/build.gradle @@ -5,7 +5,7 @@ apply from: rootProject.projectDir.absolutePath + "/yc.gradle" android { compileSdkVersion rootProject.ext.android["compileSdkVersion"] - buildToolsVersion rootProject.ext.android["buildToolsVersion"] + //buildToolsVersion rootProject.ext.android["buildToolsVersion"] defaultConfig { minSdkVersion rootProject.ext.android["minSdkVersion"] targetSdkVersion rootProject.ext.android["targetSdkVersion"] diff --git a/MonitorLib/MonitorCatonLib/build.gradle b/MonitorLib/MonitorCatonLib/build.gradle index 71bcfa117..c6abd44f0 100644 --- a/MonitorLib/MonitorCatonLib/build.gradle +++ b/MonitorLib/MonitorCatonLib/build.gradle @@ -6,7 +6,7 @@ apply from: rootProject.projectDir.absolutePath + "/yc.gradle" android { compileSdkVersion rootProject.ext.android["compileSdkVersion"] - buildToolsVersion rootProject.ext.android["buildToolsVersion"] + //buildToolsVersion rootProject.ext.android["buildToolsVersion"] defaultConfig { minSdkVersion rootProject.ext.android["minSdkVersion"] targetSdkVersion rootProject.ext.android["targetSdkVersion"] diff --git a/MonitorLib/MonitorCrashLib/build.gradle b/MonitorLib/MonitorCrashLib/build.gradle index 71e63caa7..b2f5e2ff2 100644 --- a/MonitorLib/MonitorCrashLib/build.gradle +++ b/MonitorLib/MonitorCrashLib/build.gradle @@ -4,7 +4,7 @@ apply from: rootProject.projectDir.absolutePath + "/yc.gradle" android { compileSdkVersion rootProject.ext.android["compileSdkVersion"] - buildToolsVersion rootProject.ext.android["buildToolsVersion"] + //buildToolsVersion rootProject.ext.android["buildToolsVersion"] defaultConfig { minSdkVersion rootProject.ext.android["minSdkVersion"] targetSdkVersion rootProject.ext.android["targetSdkVersion"] diff --git a/MonitorLib/MonitorFileLib/build.gradle b/MonitorLib/MonitorFileLib/build.gradle index b03f3cdde..a2091109b 100644 --- a/MonitorLib/MonitorFileLib/build.gradle +++ b/MonitorLib/MonitorFileLib/build.gradle @@ -5,7 +5,7 @@ apply from: rootProject.projectDir.absolutePath + "/yc.gradle" android { compileSdkVersion rootProject.ext.android["compileSdkVersion"] - buildToolsVersion rootProject.ext.android["buildToolsVersion"] + //buildToolsVersion rootProject.ext.android["buildToolsVersion"] defaultConfig { minSdkVersion rootProject.ext.android["minSdkVersion"] targetSdkVersion rootProject.ext.android["targetSdkVersion"] diff --git a/MonitorLib/MonitorFileLib/src/main/java/com/yc/monitorfilelib/FileExplorerFragment.java b/MonitorLib/MonitorFileLib/src/main/java/com/yc/monitorfilelib/FileExplorerFragment.java index e79ee9179..cf959718e 100644 --- a/MonitorLib/MonitorFileLib/src/main/java/com/yc/monitorfilelib/FileExplorerFragment.java +++ b/MonitorLib/MonitorFileLib/src/main/java/com/yc/monitorfilelib/FileExplorerFragment.java @@ -86,7 +86,7 @@ public void onClick(View v) { if (mCurDir != null) { String path = mCurDir.getPath(); boolean copyToClipBoard = AppWindowUtils.copyToClipBoard(getContext(), path); - if (copyToClipBoard){ + if (copyToClipBoard) { Toast.makeText(getContext(), "拷贝成功", Toast.LENGTH_SHORT).show(); } } else { @@ -102,7 +102,7 @@ private void initRecyclerView() { mFileInfoAdapter.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(View view, int i) { - if (mFileList.size()>i && i>=0){ + if (mFileList.size() > i && i >= 0) { File fileInfo = mFileList.get(i); if (fileInfo.exists() && fileInfo.isFile()) { //如果是文件,则直接打开文件 @@ -273,13 +273,13 @@ private List initRootFileInfo(Context context) { } /** - * 初始化默认文件。注意:加External和不加的比较 + * 初始化默认文件。注意:加External和不加(默认)的比较 * 相同点:1.都可以做app缓存目录。2.app卸载后,两个目录下的数据都会被清空。 * 不同点:1.目录的路径不同。前者的目录存在外部SD卡上的。后者的目录存在app的内部存储上。 - * 2.前者的路径在手机里可以直接看到。后者的路径需要root以后,用Root Explorer 文件管理器才能看到。 + * 2.前者的路径在手机里可以直接看到。后者的路径需要root以后,用Root Explorer 文件管理器才能看到。 * * @param context 上下文 - * @return + * @return 列表 */ private List initDefaultRootFileInfos(Context context) { List fileInfos = new ArrayList<>(); @@ -289,6 +289,7 @@ private List initDefaultRootFileInfos(Context context) { fileInfos.add(parentFile); FileExplorerUtils.logInfo(TAG + parentFile.getPath()); } + //路径:/data/user/0/com.yc.lifehelper //第二个是缓存文件路径 File externalCacheDir = context.getExternalCacheDir(); @@ -296,6 +297,7 @@ private List initDefaultRootFileInfos(Context context) { fileInfos.add(externalCacheDir); FileExplorerUtils.logInfo(TAG + externalCacheDir.getPath()); } + //路径:/storage/emulated/0/Android/data/com.yc.lifehelper/cache //第三个是外部file路径 File externalFilesDir = context.getExternalFilesDir((String) null); @@ -303,6 +305,7 @@ private List initDefaultRootFileInfos(Context context) { fileInfos.add(externalFilesDir); FileExplorerUtils.logInfo(TAG + externalFilesDir.getPath()); } + //路径:/storage/emulated/0/Android/data/com.yc.lifehelper/files return fileInfos; } diff --git a/MonitorLib/MonitorFileLib/src/main/java/com/yc/monitorfilelib/TextDetailFragment.java b/MonitorLib/MonitorFileLib/src/main/java/com/yc/monitorfilelib/TextDetailFragment.java index e0e891803..7737cc85d 100644 --- a/MonitorLib/MonitorFileLib/src/main/java/com/yc/monitorfilelib/TextDetailFragment.java +++ b/MonitorLib/MonitorFileLib/src/main/java/com/yc/monitorfilelib/TextDetailFragment.java @@ -109,8 +109,8 @@ public void onClick(View v) { private void shareFile() { //分享 if (mFile != null) { - //先把文件转移到外部存储文件 //请求权限 + //先把文件转移到外部存储文件 //检查版本是否大于M if (ContextCompat.checkSelfPermission(mActivity, Manifest.permission.WRITE_EXTERNAL_STORAGE) diff --git a/MonitorLib/MonitorNetLib/build.gradle b/MonitorLib/MonitorNetLib/build.gradle index d989b90d0..7b67967e7 100644 --- a/MonitorLib/MonitorNetLib/build.gradle +++ b/MonitorLib/MonitorNetLib/build.gradle @@ -6,7 +6,7 @@ apply from: rootProject.projectDir.absolutePath + "/yc.gradle" android { compileSdkVersion rootProject.ext.android["compileSdkVersion"] - buildToolsVersion rootProject.ext.android["buildToolsVersion"] + //buildToolsVersion rootProject.ext.android["buildToolsVersion"] defaultConfig { minSdkVersion rootProject.ext.android["minSdkVersion"] targetSdkVersion rootProject.ext.android["targetSdkVersion"] diff --git a/MonitorLib/MonitorOomLib/build.gradle b/MonitorLib/MonitorOomLib/build.gradle index 2bd3d693d..98e115c5f 100644 --- a/MonitorLib/MonitorOomLib/build.gradle +++ b/MonitorLib/MonitorOomLib/build.gradle @@ -5,7 +5,7 @@ apply from: rootProject.projectDir.absolutePath + "/yc.gradle" android { compileSdkVersion rootProject.ext.android["compileSdkVersion"] - buildToolsVersion rootProject.ext.android["buildToolsVersion"] + //buildToolsVersion rootProject.ext.android["buildToolsVersion"] defaultConfig { minSdkVersion rootProject.ext.android["minSdkVersion"] targetSdkVersion rootProject.ext.android["targetSdkVersion"] diff --git "a/Read/ReadMeWiki/00.\346\226\271\346\241\210\345\256\236\350\267\265/07.App\347\243\201\347\233\230\346\262\231\347\233\222\345\267\245\345\205\267\345\256\236\350\267\265.md" "b/Read/ReadMeWiki/00.\346\226\271\346\241\210\345\256\236\350\267\265/07.App\347\243\201\347\233\230\346\262\231\347\233\222\345\267\245\345\205\267\345\256\236\350\267\265.md" index 836d5b702..2e10206d4 100644 --- "a/Read/ReadMeWiki/00.\346\226\271\346\241\210\345\256\236\350\267\265/07.App\347\243\201\347\233\230\346\262\231\347\233\222\345\267\245\345\205\267\345\256\236\350\267\265.md" +++ "b/Read/ReadMeWiki/00.\346\226\271\346\241\210\345\256\236\350\267\265/07.App\347\243\201\347\233\230\346\262\231\347\233\222\345\267\245\345\205\267\345\256\236\350\267\265.md" @@ -28,9 +28,7 @@ - 05.其他设计实践说明 - 5.1 性能设计 - 5.2 稳定性设计 - - 5.3 灰度设计 - - 5.4 降级设计 - - 5.5 异常设计 + - 5.3 debug依赖设计 ### 01.磁盘沙盒的概述 @@ -138,11 +136,7 @@ #### 2.4 SD卡外部存储 -- 当给设备插入SD卡后,查看其目录:/sdcard/ ---> 依然指向/storage/self/primary,继续来看/storage/: - - 可以看出,多了sdcard1,软链接指向了/storage/77E4-07E7/。 - ``` java - - ``` +- 当给设备插入SD卡后,查看其目录:/sdcard/ ---> 依然指向/storage/self/primary,继续来看/storage/,可以看出,多了sdcard1,软链接指向了/storage/77E4-07E7/。 - 访问方式,跟获取外部存储-App私有目录方式一样。 ``` java File[] fileList = context.getExternalFilesDirs(null); @@ -250,6 +244,42 @@ ### 4.2 File文件列表 +- 获取文件列表,主要包括,`data/data/包名`目录下的缓存文件。`/sdcard/Android/data/包名`下存储文件。 + ``` java + /** + * 初始化默认文件。注意:加External和不加(默认)的比较 + * 相同点:1.都可以做app缓存目录。2.app卸载后,两个目录下的数据都会被清空。 + * 不同点:1.目录的路径不同。前者的目录存在外部SD卡上的。后者的目录存在app的内部存储上。 + * 2.前者的路径在手机里可以直接看到。后者的路径需要root以后,用Root Explorer 文件管理器才能看到。 + * + * @param context 上下文 + * @return 列表 + */ + private List initDefaultRootFileInfos(Context context) { + List fileInfos = new ArrayList<>(); + //第一个是文件父路径 + File parentFile = context.getFilesDir().getParentFile(); + if (parentFile != null) { + fileInfos.add(parentFile); + } + //路径:/data/user/0/com.yc.lifehelper + + //第二个是缓存文件路径 + File externalCacheDir = context.getExternalCacheDir(); + if (externalCacheDir != null) { + fileInfos.add(externalCacheDir); + } + //路径:/storage/emulated/0/Android/data/com.yc.lifehelper/cache + + //第三个是外部file路径 + File externalFilesDir = context.getExternalFilesDir((String) null); + if (externalFilesDir != null) { + fileInfos.add(externalFilesDir); + } + //路径:/storage/emulated/0/Android/data/com.yc.lifehelper/files + return fileInfos; + } + ``` @@ -338,8 +368,36 @@ #### 4.6 分享文件给第三方 -- https://www.jianshu.com/p/d71afdf9c90a - +- 这里直接说分享内部文件给第三方,大概的思路如下所示: + - 第一步:先判断是否有读取文件的权限,如果没有则申请;如果有则进行第二步; + - 第二步:先把文件转移到外部存储文件,为何要这样操作,主要是解决data/data下目前文件无法直接分享问题,因此需要将目标文件拷贝到外部路径 + - 第三步:通过intent发送,FileProvider拿到对应路径的uri,最后调用startActivity进行分享文件。 +- 大概的代码如下所示 + ``` java + if (ContextCompat.checkSelfPermission(mActivity,Manifest.permission.WRITE_EXTERNAL_STORAGE) + != PackageManager.PERMISSION_GRANTED) { + ActivityCompat.requestPermissions(mActivity, + new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, CODE); + } else { + //先把文件转移到外部存储文件 + File srcFile = new File(mFile.getPath()); + String newFilePath = AppFileUtils.getFileSharePath() + "/fileShare.txt"; + File destFile = new File(newFilePath); + //拷贝文件,将data/data源文件拷贝到新的目标文件路径下 + boolean copy = AppFileUtils.copyFile(srcFile, destFile); + if (copy) { + //分享 + boolean shareFile = FileShareUtils.shareFile(mActivity, destFile); + if (shareFile) { + Toast.makeText(getContext(), "文件分享成功", Toast.LENGTH_SHORT).show(); + } else { + Toast.makeText(getContext(), "文件分享失败", Toast.LENGTH_SHORT).show(); + } + } else { + Toast.makeText(getContext(), "文件保存失败", Toast.LENGTH_SHORT).show(); + } + } + ``` #### 4.7 打开图片资源 @@ -369,6 +427,7 @@ - 这就涉及到了进程间通信。Android进程间通信主要手段是Binder,而四大组件的通信也是依靠Binder,因此我们应用间传递路径可以依靠四大组件。 + ##### 4.8.2 7.0前后对文件处理方式 - Android 7.0 之前使用,传递路径可以通过Uri ``` java @@ -491,6 +550,80 @@ - 2、应用B使用Uri通过IPC获取应用A的FileProvider。 - 3、应用A使用FileProvider通过映射表将Uri转为Path,并构造出文件描述符。 - 4、应用A将文件描述符返回给应用B,应用B就可以读取应用A发送的文件了。 +- 整个交互流程图如下 + - + + +### 05.其他设计实践说明 +#### 5.1 性能设计 +- 这个暂无,因为是小工具,主要是在debug环境下依赖使用。代码逻辑并不复杂,不会影响App的性能。 + + +#### 5.2 稳定性设计 +- 修改文件说明 + - 目前,针对文本文件,比如缓存的json数据,存储在文本文件中,之前测试说让该工具支持修改属性,考虑到修改json比较复杂,因此这里只是实现可以删除文本文件,或者修改文件名称的功能。 + - 针对图片文件,可以打开且进行了图片压缩,仅仅支持删除图片文件操作。 + - 针对sp存储的数据,是xml,这里可视化展示sp的数据,目前可以支持修改sp数据,测试童鞋这方便操作简单,提高某些场景的测试效率。 +- 为何不支持修改json + - 读取文本文件,是一行行读取,修改数据编辑数据麻烦,而且修改完成后对json数据合法性判断也比较难处理。因此这里暂时不提供修改缓存的json数据,测试如果要看,可以通过分享到外部qq查看文件,或者直接查看,避免脏数据。 + + +#### 5.3 debug依赖设计 +- 建议在debug下使用 + - 在小工具放到debug包名下,依赖使用。或者在gradle依赖的时候区分也可以。如下所示: + ``` + //在app包下依赖 + apply from: rootProject.file('buildScript/fileExplorer.gradle') + + /** + * 沙盒file工具配置脚本 + */ + println('gradle file explorer , init start') + if (!isNeedUseExplorer()) { + println('gradle file explorer , not need file explorer') + return + } + println('gradle file isNeedUseExplorer = ture') + + dependencies { + // 依赖 + implementation('com.github.jacoco:runtime:0.0.23-SNAPSHOT') + } + + //过滤,只在debug下使用 + def isNeedUseJacoco() { + Map map = System.getenv() + if (map == null) { + return false + } + //拿到编译后的 BUILD_TYPE 和 CONFIG。具体看 BuildConfig 生成类的代码 + boolean hasBuildType = map.containsKey("BUILD_TYPE") + boolean hasConfig = map.containsKey("CONFIG") + println 'gradle file explorer isNeedUseExplorer hasBuildType =====>' + hasBuildType + ',hasConfig = ' + hasConfig + String buildType = "debug" + String config = "debug" + if (hasBuildType) { + buildType = map.get("BUILD_TYPE") + } + if (hasConfig) { + config = map.get("CONFIG") + } + println 'gradle file explorer isNeedUseExplorer buildType =====>' + buildType + ',config = ' + config + if (buildType.toLowerCase() == "debug" && config.toLowerCase() == "debug" && isNotUserFile()) { + println('gradle file explorer debug used') + return true + } + println('gradle file explorer not use') + //如果是正式包,则不使用沙盒file工具 + return false + } + + static def isNotUserFile() { + //在debug下默认沙盒file工具,如果你在debug下不想使用沙盒file工具,则设置成false + return true + } + ``` + diff --git a/ServerLib/GsonServer/build.gradle b/ServerLib/GsonServer/build.gradle index e8b5d8ecc..dead94439 100644 --- a/ServerLib/GsonServer/build.gradle +++ b/ServerLib/GsonServer/build.gradle @@ -8,7 +8,7 @@ apply plugin: 'com.github.dcendents.android-maven' android { compileSdkVersion rootProject.ext.android["compileSdkVersion"] - buildToolsVersion rootProject.ext.android["buildToolsVersion"] + //buildToolsVersion rootProject.ext.android["buildToolsVersion"] defaultConfig { minSdkVersion rootProject.ext.android["minSdkVersion"] targetSdkVersion rootProject.ext.android["targetSdkVersion"] diff --git a/ServerLib/HttpServer/build.gradle b/ServerLib/HttpServer/build.gradle index e375ea28f..1a8c2fae2 100644 --- a/ServerLib/HttpServer/build.gradle +++ b/ServerLib/HttpServer/build.gradle @@ -6,7 +6,7 @@ apply plugin: 'com.github.dcendents.android-maven' android { compileSdkVersion rootProject.ext.android["compileSdkVersion"] - buildToolsVersion rootProject.ext.android["buildToolsVersion"] + //buildToolsVersion rootProject.ext.android["buildToolsVersion"] defaultConfig { minSdkVersion rootProject.ext.android["minSdkVersion"] diff --git a/ServerLib/ImageServer/build.gradle b/ServerLib/ImageServer/build.gradle index c58cd8a2b..a287f197d 100644 --- a/ServerLib/ImageServer/build.gradle +++ b/ServerLib/ImageServer/build.gradle @@ -5,7 +5,7 @@ apply plugin: 'com.github.dcendents.android-maven' android { compileSdkVersion rootProject.ext.android["compileSdkVersion"] - buildToolsVersion rootProject.ext.android["buildToolsVersion"] + //buildToolsVersion rootProject.ext.android["buildToolsVersion"] defaultConfig { minSdkVersion rootProject.ext.android["minSdkVersion"] diff --git a/ServerLib/NfcServer/build.gradle b/ServerLib/NfcServer/build.gradle index 0ed4947bf..987c4993c 100644 --- a/ServerLib/NfcServer/build.gradle +++ b/ServerLib/NfcServer/build.gradle @@ -5,7 +5,7 @@ apply plugin: 'com.github.dcendents.android-maven' android { compileSdkVersion rootProject.ext.android["compileSdkVersion"] - buildToolsVersion rootProject.ext.android["buildToolsVersion"] + //buildToolsVersion rootProject.ext.android["buildToolsVersion"] defaultConfig { minSdkVersion rootProject.ext.android["minSdkVersion"] diff --git a/ServerLib/ServerInterface/build.gradle b/ServerLib/ServerInterface/build.gradle index e9da73de6..9d26a7c6c 100644 --- a/ServerLib/ServerInterface/build.gradle +++ b/ServerLib/ServerInterface/build.gradle @@ -6,7 +6,7 @@ apply plugin: 'com.github.dcendents.android-maven' android { compileSdkVersion rootProject.ext.android["compileSdkVersion"] - buildToolsVersion rootProject.ext.android["buildToolsVersion"] + //buildToolsVersion rootProject.ext.android["buildToolsVersion"] defaultConfig { minSdkVersion rootProject.ext.android["minSdkVersion"] diff --git a/ServerLib/ShareServer/build.gradle b/ServerLib/ShareServer/build.gradle index e9da73de6..9d26a7c6c 100644 --- a/ServerLib/ShareServer/build.gradle +++ b/ServerLib/ShareServer/build.gradle @@ -6,7 +6,7 @@ apply plugin: 'com.github.dcendents.android-maven' android { compileSdkVersion rootProject.ext.android["compileSdkVersion"] - buildToolsVersion rootProject.ext.android["buildToolsVersion"] + //buildToolsVersion rootProject.ext.android["buildToolsVersion"] defaultConfig { minSdkVersion rootProject.ext.android["minSdkVersion"] diff --git a/ServerLib/XlogServer/build.gradle b/ServerLib/XlogServer/build.gradle index 60ba869df..aa608b9fc 100644 --- a/ServerLib/XlogServer/build.gradle +++ b/ServerLib/XlogServer/build.gradle @@ -5,7 +5,7 @@ apply plugin: 'com.github.dcendents.android-maven' android { compileSdkVersion rootProject.ext.android["compileSdkVersion"] - buildToolsVersion rootProject.ext.android["buildToolsVersion"] + //buildToolsVersion rootProject.ext.android["buildToolsVersion"] defaultConfig { minSdkVersion rootProject.ext.android["minSdkVersion"] targetSdkVersion rootProject.ext.android["targetSdkVersion"] diff --git a/ToolLib/AnimatorToolLib/build.gradle b/ToolLib/AnimatorToolLib/build.gradle index c186cec62..1c19906a2 100644 --- a/ToolLib/AnimatorToolLib/build.gradle +++ b/ToolLib/AnimatorToolLib/build.gradle @@ -7,7 +7,7 @@ apply plugin: 'com.github.dcendents.android-maven' android { compileSdkVersion rootProject.ext.android["compileSdkVersion"] - buildToolsVersion rootProject.ext.android["buildToolsVersion"] + //buildToolsVersion rootProject.ext.android["buildToolsVersion"] defaultConfig { minSdkVersion rootProject.ext.android["minSdkVersion"] targetSdkVersion rootProject.ext.android["targetSdkVersion"] diff --git a/ToolLib/AppTraceTool/build.gradle b/ToolLib/AppTraceTool/build.gradle index f6e1bcfd5..82bf04f42 100644 --- a/ToolLib/AppTraceTool/build.gradle +++ b/ToolLib/AppTraceTool/build.gradle @@ -9,7 +9,7 @@ def releaseTime() { android { compileSdkVersion rootProject.ext.android["compileSdkVersion"] - buildToolsVersion rootProject.ext.android["buildToolsVersion"] + //buildToolsVersion rootProject.ext.android["buildToolsVersion"] defaultConfig { //applicationId "com.ddtaxi.common.tracesdk" diff --git a/ToolLib/CountTimerLib/build.gradle b/ToolLib/CountTimerLib/build.gradle index c186cec62..1c19906a2 100644 --- a/ToolLib/CountTimerLib/build.gradle +++ b/ToolLib/CountTimerLib/build.gradle @@ -7,7 +7,7 @@ apply plugin: 'com.github.dcendents.android-maven' android { compileSdkVersion rootProject.ext.android["compileSdkVersion"] - buildToolsVersion rootProject.ext.android["buildToolsVersion"] + //buildToolsVersion rootProject.ext.android["buildToolsVersion"] defaultConfig { minSdkVersion rootProject.ext.android["minSdkVersion"] targetSdkVersion rootProject.ext.android["targetSdkVersion"] diff --git a/ToolLib/LocaleHelperLib/build.gradle b/ToolLib/LocaleHelperLib/build.gradle index b4f22b372..208898c51 100644 --- a/ToolLib/LocaleHelperLib/build.gradle +++ b/ToolLib/LocaleHelperLib/build.gradle @@ -8,7 +8,7 @@ apply plugin: 'com.github.dcendents.android-maven' android { compileSdkVersion rootProject.ext.android["compileSdkVersion"] - buildToolsVersion rootProject.ext.android["buildToolsVersion"] + //buildToolsVersion rootProject.ext.android["buildToolsVersion"] defaultConfig { minSdkVersion rootProject.ext.android["minSdkVersion"] targetSdkVersion rootProject.ext.android["targetSdkVersion"] diff --git a/ToolLib/LongevityLib/build.gradle b/ToolLib/LongevityLib/build.gradle index b4f22b372..208898c51 100644 --- a/ToolLib/LongevityLib/build.gradle +++ b/ToolLib/LongevityLib/build.gradle @@ -8,7 +8,7 @@ apply plugin: 'com.github.dcendents.android-maven' android { compileSdkVersion rootProject.ext.android["compileSdkVersion"] - buildToolsVersion rootProject.ext.android["buildToolsVersion"] + //buildToolsVersion rootProject.ext.android["buildToolsVersion"] defaultConfig { minSdkVersion rootProject.ext.android["minSdkVersion"] targetSdkVersion rootProject.ext.android["targetSdkVersion"] diff --git a/ToolLib/NetHelperLib/build.gradle b/ToolLib/NetHelperLib/build.gradle index 5a1f40031..9b1caf561 100644 --- a/ToolLib/NetHelperLib/build.gradle +++ b/ToolLib/NetHelperLib/build.gradle @@ -8,7 +8,7 @@ apply plugin: 'com.github.dcendents.android-maven' android { compileSdkVersion rootProject.ext.android["compileSdkVersion"] - buildToolsVersion rootProject.ext.android["buildToolsVersion"] + //buildToolsVersion rootProject.ext.android["buildToolsVersion"] defaultConfig { minSdkVersion rootProject.ext.android["minSdkVersion"] targetSdkVersion rootProject.ext.android["targetSdkVersion"] diff --git a/ToolLib/SerialTaskLib/build.gradle b/ToolLib/SerialTaskLib/build.gradle index 6f4f50d9c..cefe43dbb 100644 --- a/ToolLib/SerialTaskLib/build.gradle +++ b/ToolLib/SerialTaskLib/build.gradle @@ -6,7 +6,7 @@ apply from: rootProject.projectDir.absolutePath + "/yc.gradle" android { compileSdkVersion rootProject.ext.android["compileSdkVersion"] - buildToolsVersion rootProject.ext.android["buildToolsVersion"] + //buildToolsVersion rootProject.ext.android["buildToolsVersion"] defaultConfig { minSdkVersion rootProject.ext.android["minSdkVersion"] targetSdkVersion rootProject.ext.android["targetSdkVersion"] diff --git a/ToolLib/SocketIoLib/build.gradle b/ToolLib/SocketIoLib/build.gradle index ec87a83d5..1b219b89e 100755 --- a/ToolLib/SocketIoLib/build.gradle +++ b/ToolLib/SocketIoLib/build.gradle @@ -7,7 +7,7 @@ apply plugin: 'com.github.dcendents.android-maven' android { compileSdkVersion rootProject.ext.android["compileSdkVersion"] - buildToolsVersion rootProject.ext.android["buildToolsVersion"] + //buildToolsVersion rootProject.ext.android["buildToolsVersion"] defaultConfig { minSdkVersion rootProject.ext.android["minSdkVersion"] targetSdkVersion rootProject.ext.android["targetSdkVersion"] diff --git a/ToolLib/ThreadPoolLib/build.gradle b/ToolLib/ThreadPoolLib/build.gradle index 6f4f50d9c..cefe43dbb 100644 --- a/ToolLib/ThreadPoolLib/build.gradle +++ b/ToolLib/ThreadPoolLib/build.gradle @@ -6,7 +6,7 @@ apply from: rootProject.projectDir.absolutePath + "/yc.gradle" android { compileSdkVersion rootProject.ext.android["compileSdkVersion"] - buildToolsVersion rootProject.ext.android["buildToolsVersion"] + //buildToolsVersion rootProject.ext.android["buildToolsVersion"] defaultConfig { minSdkVersion rootProject.ext.android["minSdkVersion"] targetSdkVersion rootProject.ext.android["targetSdkVersion"] diff --git a/ToolLib/ThreadTaskLib/build.gradle b/ToolLib/ThreadTaskLib/build.gradle index 6f4f50d9c..cefe43dbb 100644 --- a/ToolLib/ThreadTaskLib/build.gradle +++ b/ToolLib/ThreadTaskLib/build.gradle @@ -6,7 +6,7 @@ apply from: rootProject.projectDir.absolutePath + "/yc.gradle" android { compileSdkVersion rootProject.ext.android["compileSdkVersion"] - buildToolsVersion rootProject.ext.android["buildToolsVersion"] + //buildToolsVersion rootProject.ext.android["buildToolsVersion"] defaultConfig { minSdkVersion rootProject.ext.android["minSdkVersion"] targetSdkVersion rootProject.ext.android["targetSdkVersion"] diff --git a/ToolLib/WebSocketLib/build.gradle b/ToolLib/WebSocketLib/build.gradle index 2d75b0b8b..6985c5104 100755 --- a/ToolLib/WebSocketLib/build.gradle +++ b/ToolLib/WebSocketLib/build.gradle @@ -7,7 +7,7 @@ apply plugin: 'com.github.dcendents.android-maven' android { compileSdkVersion rootProject.ext.android["compileSdkVersion"] - buildToolsVersion rootProject.ext.android["buildToolsVersion"] + //buildToolsVersion rootProject.ext.android["buildToolsVersion"] defaultConfig { minSdkVersion rootProject.ext.android["minSdkVersion"] targetSdkVersion rootProject.ext.android["targetSdkVersion"] diff --git a/ToolLib/ZxingServerLib/build.gradle b/ToolLib/ZxingServerLib/build.gradle index a161277fd..d12092f45 100644 --- a/ToolLib/ZxingServerLib/build.gradle +++ b/ToolLib/ZxingServerLib/build.gradle @@ -5,7 +5,7 @@ apply plugin: 'com.github.dcendents.android-maven' android { compileSdkVersion rootProject.ext.android["compileSdkVersion"] - buildToolsVersion rootProject.ext.android["buildToolsVersion"] + //buildToolsVersion rootProject.ext.android["buildToolsVersion"] defaultConfig { minSdkVersion rootProject.ext.android["minSdkVersion"] diff --git a/WidgetLib/AppStateLib/build.gradle b/WidgetLib/AppStateLib/build.gradle index 6f4f50d9c..cefe43dbb 100644 --- a/WidgetLib/AppStateLib/build.gradle +++ b/WidgetLib/AppStateLib/build.gradle @@ -6,7 +6,7 @@ apply from: rootProject.projectDir.absolutePath + "/yc.gradle" android { compileSdkVersion rootProject.ext.android["compileSdkVersion"] - buildToolsVersion rootProject.ext.android["buildToolsVersion"] + //buildToolsVersion rootProject.ext.android["buildToolsVersion"] defaultConfig { minSdkVersion rootProject.ext.android["minSdkVersion"] targetSdkVersion rootProject.ext.android["targetSdkVersion"] diff --git a/WidgetLib/BannerViewLib/build.gradle b/WidgetLib/BannerViewLib/build.gradle index 2055bca0a..0fe31aef1 100644 --- a/WidgetLib/BannerViewLib/build.gradle +++ b/WidgetLib/BannerViewLib/build.gradle @@ -5,7 +5,7 @@ apply plugin: 'com.github.dcendents.android-maven' android { compileSdkVersion rootProject.ext.android["compileSdkVersion"] - buildToolsVersion rootProject.ext.android["buildToolsVersion"] + //buildToolsVersion rootProject.ext.android["buildToolsVersion"] defaultConfig { minSdkVersion rootProject.ext.android["minSdkVersion"] diff --git a/WidgetLib/BlurViewLib/build.gradle b/WidgetLib/BlurViewLib/build.gradle index c186cec62..1c19906a2 100644 --- a/WidgetLib/BlurViewLib/build.gradle +++ b/WidgetLib/BlurViewLib/build.gradle @@ -7,7 +7,7 @@ apply plugin: 'com.github.dcendents.android-maven' android { compileSdkVersion rootProject.ext.android["compileSdkVersion"] - buildToolsVersion rootProject.ext.android["buildToolsVersion"] + //buildToolsVersion rootProject.ext.android["buildToolsVersion"] defaultConfig { minSdkVersion rootProject.ext.android["minSdkVersion"] targetSdkVersion rootProject.ext.android["targetSdkVersion"] diff --git a/WidgetLib/CustomWidget/build.gradle b/WidgetLib/CustomWidget/build.gradle index 60bf0d5aa..3c2bd170c 100644 --- a/WidgetLib/CustomWidget/build.gradle +++ b/WidgetLib/CustomWidget/build.gradle @@ -2,7 +2,7 @@ apply plugin: 'com.android.library' android { compileSdkVersion rootProject.ext.android["compileSdkVersion"] - buildToolsVersion rootProject.ext.android["buildToolsVersion"] + //buildToolsVersion rootProject.ext.android["buildToolsVersion"] defaultConfig { minSdkVersion rootProject.ext.android["minSdkVersion"] diff --git a/WidgetLib/FragmentLib/build.gradle b/WidgetLib/FragmentLib/build.gradle index c186cec62..1c19906a2 100644 --- a/WidgetLib/FragmentLib/build.gradle +++ b/WidgetLib/FragmentLib/build.gradle @@ -7,7 +7,7 @@ apply plugin: 'com.github.dcendents.android-maven' android { compileSdkVersion rootProject.ext.android["compileSdkVersion"] - buildToolsVersion rootProject.ext.android["buildToolsVersion"] + //buildToolsVersion rootProject.ext.android["buildToolsVersion"] defaultConfig { minSdkVersion rootProject.ext.android["minSdkVersion"] targetSdkVersion rootProject.ext.android["targetSdkVersion"] diff --git a/WidgetLib/LargeImageLib/build.gradle b/WidgetLib/LargeImageLib/build.gradle index 524fa1bf8..2d394be8d 100644 --- a/WidgetLib/LargeImageLib/build.gradle +++ b/WidgetLib/LargeImageLib/build.gradle @@ -3,7 +3,7 @@ apply from: rootProject.projectDir.absolutePath + "/yc.gradle" android { compileSdkVersion rootProject.ext.android["compileSdkVersion"] - buildToolsVersion rootProject.ext.android["buildToolsVersion"] + //buildToolsVersion rootProject.ext.android["buildToolsVersion"] defaultConfig { minSdkVersion rootProject.ext.android["minSdkVersion"] diff --git a/WidgetLib/PhotoWidget/build.gradle b/WidgetLib/PhotoWidget/build.gradle index 171d963f4..81f8cc9db 100644 --- a/WidgetLib/PhotoWidget/build.gradle +++ b/WidgetLib/PhotoWidget/build.gradle @@ -5,7 +5,7 @@ apply plugin: 'com.github.dcendents.android-maven' android { compileSdkVersion rootProject.ext.android["compileSdkVersion"] - buildToolsVersion rootProject.ext.android["buildToolsVersion"] + //buildToolsVersion rootProject.ext.android["buildToolsVersion"] defaultConfig { minSdkVersion rootProject.ext.android["minSdkVersion"] diff --git a/WidgetLib/StatusBarLib/build.gradle b/WidgetLib/StatusBarLib/build.gradle index 200591fb4..d00a611d2 100644 --- a/WidgetLib/StatusBarLib/build.gradle +++ b/WidgetLib/StatusBarLib/build.gradle @@ -3,7 +3,7 @@ apply from: rootProject.projectDir.absolutePath + "/yc.gradle" android { compileSdkVersion rootProject.ext.android["compileSdkVersion"] - buildToolsVersion rootProject.ext.android["buildToolsVersion"] + //buildToolsVersion rootProject.ext.android["buildToolsVersion"] defaultConfig { minSdkVersion rootProject.ext.android["minSdkVersion"] targetSdkVersion rootProject.ext.android["targetSdkVersion"] diff --git a/WidgetLib/SwipeBackLib/build.gradle b/WidgetLib/SwipeBackLib/build.gradle index d786556a0..0bfc8eff9 100644 --- a/WidgetLib/SwipeBackLib/build.gradle +++ b/WidgetLib/SwipeBackLib/build.gradle @@ -4,7 +4,7 @@ apply from: rootProject.projectDir.absolutePath + "/yc.gradle" android { compileSdkVersion rootProject.ext.android["compileSdkVersion"] - buildToolsVersion rootProject.ext.android["buildToolsVersion"] + //buildToolsVersion rootProject.ext.android["buildToolsVersion"] defaultConfig { minSdkVersion rootProject.ext.android["minSdkVersion"] diff --git a/WidgetLib/SwipeBackLib/src/main/java/com/yc/swipe/SwipeBackHelper.java b/WidgetLib/SwipeBackLib/src/main/java/com/yc/swipe/SwipeBackHelper.java index 62b5ba931..6c92929fc 100644 --- a/WidgetLib/SwipeBackLib/src/main/java/com/yc/swipe/SwipeBackHelper.java +++ b/WidgetLib/SwipeBackLib/src/main/java/com/yc/swipe/SwipeBackHelper.java @@ -9,7 +9,6 @@ import java.util.List; -import cn.bingoogolapple.swipebacklayout.R; public class SwipeBackHelper { diff --git a/WidgetLib/SwipeBackLib/src/main/java/com/yc/swipe/SwipeBackLayout.java b/WidgetLib/SwipeBackLib/src/main/java/com/yc/swipe/SwipeBackLayout.java index b5e055aa2..870107156 100644 --- a/WidgetLib/SwipeBackLib/src/main/java/com/yc/swipe/SwipeBackLayout.java +++ b/WidgetLib/SwipeBackLib/src/main/java/com/yc/swipe/SwipeBackLayout.java @@ -23,12 +23,13 @@ import androidx.core.content.ContextCompat; import androidx.core.os.ParcelableCompat; import androidx.core.os.ParcelableCompatCreatorCallbacks; -import androidx.view.AbsSavedState; import androidx.core.view.AccessibilityDelegateCompat; import androidx.core.view.MotionEventCompat; import androidx.core.view.ViewCompat; import androidx.core.view.accessibility.AccessibilityNodeInfoCompat; -import androidx.widget.ViewDragHelper; +import androidx.customview.view.AbsSavedState; +import androidx.customview.widget.ViewDragHelper; + import android.util.AttributeSet; import android.util.Log; import android.view.MotionEvent; diff --git a/WidgetLib/SwipeBackLib/src/main/java/com/yc/swipe/SwipeBackShadowView.java b/WidgetLib/SwipeBackLib/src/main/java/com/yc/swipe/SwipeBackShadowView.java index 6cb87d486..02ee1ba72 100644 --- a/WidgetLib/SwipeBackLib/src/main/java/com/yc/swipe/SwipeBackShadowView.java +++ b/WidgetLib/SwipeBackLib/src/main/java/com/yc/swipe/SwipeBackShadowView.java @@ -13,7 +13,6 @@ import android.widget.LinearLayout; import android.widget.RelativeLayout; import java.lang.ref.WeakReference; -import cn.bingoogolapple.swipebacklayout.R; public class SwipeBackShadowView extends FrameLayout { diff --git a/WidgetLib/WidgetViewLib/build.gradle b/WidgetLib/WidgetViewLib/build.gradle index ad0f56328..89626eee0 100644 --- a/WidgetLib/WidgetViewLib/build.gradle +++ b/WidgetLib/WidgetViewLib/build.gradle @@ -5,7 +5,7 @@ apply from: rootProject.projectDir.absolutePath + "/yc.gradle" android { compileSdkVersion rootProject.ext.android["compileSdkVersion"] - buildToolsVersion rootProject.ext.android["buildToolsVersion"] + //buildToolsVersion rootProject.ext.android["buildToolsVersion"] defaultConfig { minSdkVersion rootProject.ext.android["minSdkVersion"] targetSdkVersion rootProject.ext.android["targetSdkVersion"] diff --git a/WidgetLib/ZoomImageLib/build.gradle b/WidgetLib/ZoomImageLib/build.gradle index 78bce14ec..8ca3bb568 100644 --- a/WidgetLib/ZoomImageLib/build.gradle +++ b/WidgetLib/ZoomImageLib/build.gradle @@ -6,7 +6,7 @@ apply plugin: 'com.github.dcendents.android-maven' android { compileSdkVersion rootProject.ext.android["compileSdkVersion"] - buildToolsVersion rootProject.ext.android["buildToolsVersion"] + //buildToolsVersion rootProject.ext.android["buildToolsVersion"] defaultConfig { minSdkVersion rootProject.ext.android["minSdkVersion"]