From 9ab86ab1a9fa1e36acaca32c8cd9180888a23906 Mon Sep 17 00:00:00 2001 From: ewt45 <79033456+ewt45@users.noreply.github.com> Date: Fri, 12 Apr 2024 10:45:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=AD=BE=E5=90=8D=EF=BC=8Cac?= =?UTF-8?q?tion=E4=B8=AD=E4=B8=8B=E8=BD=BD=E7=9A=84=E5=88=86=E6=94=AF,=20s?= =?UTF-8?q?af=E6=A0=B9=E7=9B=AE=E5=BD=95=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 签名使用原gradle中的签名 action中指定分支为extra-feature 修复mt左侧显示根目录名称为files的bug --- .github/workflows/debug_build.yml | 6 ++++-- app/build.gradle | 10 ++++++---- .../termux/filepicker/TermuxDocumentsProvider.java | 13 ++++++++----- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/.github/workflows/debug_build.yml b/.github/workflows/debug_build.yml index 5c650b054b..91ad8d76bb 100644 --- a/.github/workflows/debug_build.yml +++ b/.github/workflows/debug_build.yml @@ -4,10 +4,10 @@ on: workflow_dispatch: push: branches: - - master + - extra-feature #指定分支 pull_request: branches: - - master + - extra-feature jobs: build: @@ -20,6 +20,8 @@ jobs: steps: - name: Clone repository uses: actions/checkout@v4 + with: + ref: extra-feature #指定分支 - name: Build APKs shell: bash {0} diff --git a/app/build.gradle b/app/build.gradle index 2c1a078733..b155832d2e 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,5 +1,5 @@ plugins { - id "com.android.application" + id "com.android.application" } ext { @@ -77,13 +77,15 @@ android { signingConfigs { debug { - storeFile file('no_trust.jks') + storeFile file('testkey_untrusted.jks') keyAlias 'alias' - storePassword '&TdLbu2Y'//'xrj45yWGLbsO7W0v' - keyPassword '&TdLbu2Y'//'xrj45yWGLbsO7W0v' + storePassword 'xrj45yWGLbsO7W0v'//'xrj45yWGLbsO7W0v' + keyPassword 'xrj45yWGLbsO7W0v'//'xrj45yWGLbsO7W0v' } } + + buildTypes { release { minifyEnabled true diff --git a/app/src/main/java/com/termux/filepicker/TermuxDocumentsProvider.java b/app/src/main/java/com/termux/filepicker/TermuxDocumentsProvider.java index a74d84ec49..70717c83b7 100644 --- a/app/src/main/java/com/termux/filepicker/TermuxDocumentsProvider.java +++ b/app/src/main/java/com/termux/filepicker/TermuxDocumentsProvider.java @@ -169,13 +169,13 @@ public Cursor querySearchDocuments(String rootId, String query, String[] project final File file = pending.removeFirst(); // Avoid directories outside the $HOME directory linked with symlinks (to avoid e.g. search // through the whole SD card). - boolean isInsideFiles; + boolean isInsideHome; try { - isInsideFiles = file.getCanonicalPath().startsWith(TermuxConstants.TERMUX_FILES_DIR_PATH); + isInsideHome = file.getCanonicalPath().startsWith(TermuxConstants.TERMUX_FILES_DIR_PATH); } catch (IOException e) { - isInsideFiles = true; + isInsideHome = true; } - if (isInsideFiles) { + if (isInsideHome) { if (file.isDirectory()) { Collections.addAll(pending, file.listFiles()); } else { @@ -257,7 +257,10 @@ private void includeFile(MatrixCursor result, String docId, File file) final MatrixCursor.RowBuilder row = result.newRow(); row.add(Document.COLUMN_DOCUMENT_ID, docId); - row.add(Document.COLUMN_DISPLAY_NAME, displayName); + row.add(Document.COLUMN_DISPLAY_NAME, + file.getAbsolutePath().equals(BASE_DIR.getAbsolutePath()) + ? getContext().getString(R.string.application_name) + : displayName);//修复mt左侧显示根目录名称为files的bug row.add(Document.COLUMN_SIZE, file.length()); row.add(Document.COLUMN_MIME_TYPE, mimeType); row.add(Document.COLUMN_LAST_MODIFIED, file.lastModified());