From 51f58f34457fc7b00430c1072d3209ddc8a8461c Mon Sep 17 00:00:00 2001 From: Sergey Valiulik Date: Mon, 4 Apr 2022 01:11:01 +0300 Subject: [PATCH] Access to all files in order to read/write repos from external storage --- app/src/main/AndroidManifest.xml | 1 + .../mgit/repolist/RepoListActivity.java | 21 +++++++++++++++++++ app/src/main/res/values-de/strings.xml | 2 ++ app/src/main/res/values-es/strings.xml | 2 ++ app/src/main/res/values-fr/strings.xml | 2 ++ app/src/main/res/values-iw/strings.xml | 2 ++ app/src/main/res/values-ja/strings.xml | 2 ++ app/src/main/res/values-ko/strings.xml | 2 ++ app/src/main/res/values-ru/strings.xml | 2 ++ app/src/main/res/values-zh-rCN/strings.xml | 2 ++ app/src/main/res/values/strings.xml | 2 ++ 11 files changed, 40 insertions(+) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index aab7225b..504ba8f3 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -7,6 +7,7 @@ + = Build.VERSION_CODES.R && !Environment.isExternalStorageManager()) { + showMessageDialog( + R.string.dialog_access_all_files_title, + R.string.dialog_access_all_files_msg, + R.string.label_ok, (dialogInterface, i) -> { + try { + Uri uri = Uri.fromParts("package", getPackageName(), null); + startActivity(new Intent(Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION, uri)); + } catch (ActivityNotFoundException e) { + startActivity(new Intent(Settings.ACTION_MANAGE_ALL_FILES_ACCESS_PERMISSION)); + } + } + ); + return true; + } intent = new Intent(this, ImportRepositoryActivity.class); startActivityForResult(intent, REQUEST_IMPORT_REPO); forwardTransition(); @@ -177,6 +197,7 @@ public void configSearchAction(MenuItem searchItem) { @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { + super.onActivityResult(requestCode, resultCode, data); if (resultCode != Activity.RESULT_OK) return; switch (requestCode) { diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 0307c8e2..08e68564 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -190,4 +190,6 @@ This is a bare repository! The Git index is invalid! File not found! + Zugriff auf alle Dateien + Bitte erlauben Sie den Zugriff auf alle Dateien, um Repositories von einem externen Speicher lesen/schreiben zu können. diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 8e236502..8182a749 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -188,4 +188,6 @@ This is a bare repository! The Git index is invalid! File not found! + Acceso a todos los archivos + Permita el acceso a todos los archivos para leer/escribir repositorios desde almacenamiento externo. diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 2534900d..c3ddd547 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -189,4 +189,6 @@ This is a bare repository! The Git index is invalid! File not found! + Accès à tous les fichiers + Veuillez autoriser l\'accès à tous les fichiers afin de lire/écrire des référentiels à partir d\'un stockage externe. diff --git a/app/src/main/res/values-iw/strings.xml b/app/src/main/res/values-iw/strings.xml index fbea8019..499abdfc 100644 --- a/app/src/main/res/values-iw/strings.xml +++ b/app/src/main/res/values-iw/strings.xml @@ -178,4 +178,6 @@ This is a bare repository! The Git index is invalid! File not found! + גישה לכל הקבצים + אנא אפשר גישה לכל הקבצים כדי לקרוא/לכתוב מאגרים מאחסון חיצוני. diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index 69a06402..96d3ff23 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -189,4 +189,6 @@ This is a bare repository! The Git index is invalid! File not found! + すべてのファイルへのアクセス + 外部ストレージからリポジトリを読み書きするには、すべてのファイルへのアクセスを許可してください。 diff --git a/app/src/main/res/values-ko/strings.xml b/app/src/main/res/values-ko/strings.xml index 94b6ef9a..d0728340 100644 --- a/app/src/main/res/values-ko/strings.xml +++ b/app/src/main/res/values-ko/strings.xml @@ -172,4 +172,6 @@ This is a bare repository! The Git index is invalid! File not found! + 모든 파일에 대한 액세스 + 외부 저장소에서 리포지토리를 읽고 쓰려면 모든 파일에 대한 액세스를 허용하세요. diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 908048cb..83ff0073 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -187,4 +187,6 @@ This is a bare repository! The Git index is invalid! File not found! + Доступ ко всем файлам + Разрешите доступ ко всем файлам для чтения/записи репозиториев с внешнего хранилища. diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index b8e2b69c..296ab193 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -190,4 +190,6 @@ This is a bare repository! The Git index is invalid! File not found! + 所有文件的访问 + 请允许访问所有文件以从外部存储读取/写入存储库。 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 607a8f9d..5710ca78 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -208,4 +208,6 @@ English Language Use English instead of the default language use.english + Access to all files + Please allow access to all files in order to read/write repositories from external storage.