From 13084bab2384dca6f3af72579e11981921f06abc Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Wed, 10 Jul 2024 14:25:01 +0200 Subject: [PATCH 1/2] Gplay: do not allow to download APK/AAB Signed-off-by: tobiasKaminsky [skip ci] --- .../owncloud/android/ui/fragment/OCFileListFragment.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/src/main/java/com/owncloud/android/ui/fragment/OCFileListFragment.java b/app/src/main/java/com/owncloud/android/ui/fragment/OCFileListFragment.java index e0aff046f85a..9901ff7efea2 100644 --- a/app/src/main/java/com/owncloud/android/ui/fragment/OCFileListFragment.java +++ b/app/src/main/java/com/owncloud/android/ui/fragment/OCFileListFragment.java @@ -1024,6 +1024,12 @@ private void folderOnItemClick(OCFile file, int position) { } private void fileOnItemClick(OCFile file) { + if (isAPKorAAB(Set.of(file))) { + Snackbar.make(getRecyclerView(), + R.string.gplay_restriction, + Snackbar.LENGTH_LONG).show(); + return; + } if (PreviewImageFragment.canBePreviewed(file)) { // preview image - it handles the download, if needed if (searchFragment) { From 93a38f4e69822b36767658ba43b5050d43d50518 Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Wed, 10 Jul 2024 14:25:01 +0200 Subject: [PATCH 2/2] Gplay: do not allow to download APK/AAB Signed-off-by: tobiasKaminsky --- app/src/main/java/com/owncloud/android/datamodel/OCFile.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/owncloud/android/datamodel/OCFile.java b/app/src/main/java/com/owncloud/android/datamodel/OCFile.java index 4a1424d2178a..c6bba5ae2dc0 100644 --- a/app/src/main/java/com/owncloud/android/datamodel/OCFile.java +++ b/app/src/main/java/com/owncloud/android/datamodel/OCFile.java @@ -1053,7 +1053,7 @@ public void setE2eCounter(@Nullable Long e2eCounter) { } public boolean isAPKorAAB() { - if (BuildConfig.FLAVOR.equals("gplay")) { + if ("gplay".equals(BuildConfig.FLAVOR)) { return getFileName().endsWith(".apk") || getFileName().endsWith(".aab"); } else { return false;