Compare commits

...
207 Commits
Author SHA1 Message Date
alperozturk96 4deb914755 fix(auth): re-authenticating revoke account
Signed-off-by: alperozturk96 <[email protected]>
2026-11-03 16:09:17 +03:00
Alper Öztürk a6b90e4c99 Merge pull request #17942 from nextcloud/fix/clear-system-insets-in-widget-config
Clear system insets in widget config
2026-11-03 15:20:20 +03:00
daniele-verducci a74e9af79b Fix unreadable text on system bar
Signed-off-by: daniele-verducci <[email protected]>
2026-11-03 12:40:41 +01:00
daniele-verducci edd4afdc07 Theme activity to have matching color between system bars and layout
Signed-off-by: daniele-verducci <[email protected]>
2026-11-03 12:36:19 +01:00
daniele-verducci 612fdfba12 Clear system insets in widget config view
Signed-off-by: daniele-verducci <[email protected]>
2026-11-03 12:28:48 +01:00
Alper Öztürk c2618ba512 Merge pull request #17899 from nextcloud/refactor/error-message-adapter-kotlin
refactor(error-message-adapter): kotlin
2026-11-03 13:16:43 +03:00
Alper Öztürk 145c7c2570 Merge pull request #17938 from nextcloud/refactor/toolbar-activity-kotlin
refactor(toolbar-activity): kotlin
2026-11-03 13:06:13 +03:00
alperozturk96 0ec85602e7 simplify
Signed-off-by: alperozturk96 <[email protected]>
2026-11-03 11:16:33 +03:00
alperozturk96 858ecf8ddb simplify
Signed-off-by: alperozturk96 <[email protected]>
2026-11-03 11:10:49 +03:00
alperozturk96 a6b3895031 simplify
Signed-off-by: alperozturk96 <[email protected]>
2026-11-03 10:35:24 +03:00
alperozturk96 9e5c932574 simplify
Signed-off-by: alperozturk96 <[email protected]>
2026-11-03 10:35:24 +03:00
alperozturk96 03a219dbaf remove theme color utils
Signed-off-by: alperozturk96 <[email protected]>
2026-11-03 10:35:24 +03:00
alperozturk96 0d1c6357ca convert to kotlin
Signed-off-by: alperozturk96 <[email protected]>
2026-11-03 10:35:24 +03:00
alperozturk96 50a0eb7635 convert to kotlin
Signed-off-by: alperozturk96 <[email protected]>
2026-11-03 10:35:24 +03:00
alperozturk96 6ba61b0b70 Rename .java to .kt
Signed-off-by: alperozturk96 <[email protected]>
2026-11-03 10:35:24 +03:00
Alper Öztürk ca9f4ecc56 Merge pull request #17937 from nextcloud/fix/picker-back-navigation-to-forbidden-folder
Fix back navigation to forbidden folder in file picker
2026-11-03 10:15:48 +03:00
daniele-verducci 7f8c416572 Fix back navigation to forbidden folder in file picker
Signed-off-by: daniele-verducci <[email protected]>
2026-11-03 09:42:54 +03:00
Alper Öztürk b70acc3cfd Merge pull request #17920 from nextcloud/fix/internal-109155-media-missing-empty-indicator-after-folder-deletion
Fixed empty view not shown in Media
2026-11-03 08:30:23 +03:00
Alper Öztürk d402f3acdb Merge pull request #17884 from nextcloud/improv/updateLibraryHash
Small improvement in update library script
2026-11-03 08:28:40 +03:00
daniele-verducci 8cba126120 Prevent script from failing it running on a macine with the git hooks configured as documented in CONTRIBUTING.md
Signed-off-by: daniele-verducci <[email protected]>
2026-11-02 17:44:52 +01:00
daniele-verducci 6a5224788f Early fail with clear message on updateLibraryHash to prevent confusion
Signed-off-by: daniele-verducci <[email protected]>
2026-11-02 17:44:52 +01:00
daniele-verducci 3ec1c781d9 Spotless
Signed-off-by: daniele-verducci <[email protected]>
2026-11-02 17:42:07 +01:00
Daniele VerducciandAlper Öztürk fec574b981 Oneliner with null casting for setHasFooter
Co-authored-by: Alper Öztürk <[email protected]>
Signed-off-by: Daniele Verducci <[email protected]>
2026-11-02 16:24:48 +01:00
daniele-verducci 2fc9fa2807 Fixed empty view not triggered in Media due to EmptyRecyclerView still expecting a footer
Signed-off-by: daniele-verducci <[email protected]>
2026-11-02 16:24:48 +01:00
Alper Öztürk a1ed32bf7b Merge pull request #17933 from nextcloud/fix/lint
fix lint
2026-11-02 14:45:44 +03:00
alperozturk96 aef268c7d7 fix lint
Signed-off-by: alperozturk96 <[email protected]>
2026-11-02 12:36:22 +03:00
renovate[bot] 3b0f7bb0d4 Update ubuntu:resolute Docker digest to 6a06111 (#17930)
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-02 06:54:25 +00:00
86bc3a62a4 Update androidPluginVersion to v9.5.0 (#17928)
* Update androidPluginVersion to v9.5.0

Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix verification-metadata.xml

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Tobias Kaminsky <[email protected]>

---------

Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: Tobias Kaminsky <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Tobias Kaminsky <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-02 06:47:34 +00:00
Alper Öztürk 9eadf8ed4d Merge pull request #17921 from nextcloud/fix/upload-activity-back-navigation
Fixed back navigation in upload screen
2026-11-02 09:19:05 +03:00
Nextcloud bot 3499350263 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-11-02 04:19:42 +00:00
Andy Scherzinger 3145d45531 Merge pull request #17927 from nextcloud/renovate/gradle-actions-6.x
Update gradle/actions action to v6.4.1
2026-11-01 15:43:23 +01:00
renovate[bot] fde49354af Update gradle/actions action to v6.4.1
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-11-01 14:40:08 +00:00
Nextcloud bot 6362bae384 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-11-01 03:54:54 +00:00
Nextcloud bot 23baa00e31 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-10-31 03:43:38 +00:00
daniele-verducci 0578c7299c Fixed back navigation in upload screen
Signed-off-by: daniele-verducci <[email protected]>
2026-10-30 19:27:59 +01:00
Alper Öztürk 593d7e09fb Merge pull request #17725 from nextcloud/feat/remove-retrieve-last-version
feat(open-file): remove syncing dialog
2026-10-30 15:20:36 +03:00
Alper Öztürk 58ef1b9a6d Merge pull request #17910 from nextcloud/refactor/document-storage-provider-kotlin
refactor(document-storage-provider): kotlin
2026-10-30 15:16:33 +03:00
alperozturk96 908a7e3d05 fix ci
Signed-off-by: alperozturk96 <[email protected]>
2026-10-30 14:46:44 +03:00
alperozturk96 ddefc90ed8 get rid of magic number
Signed-off-by: alperozturk96 <[email protected]>
2026-10-30 14:44:06 +03:00
alperozturk96 4b6a7b0c59 resolve conflict
Signed-off-by: alperozturk96 <[email protected]>
2026-10-30 14:39:37 +03:00
alperozturk96 ce7f23d282 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-10-30 14:22:26 +03:00
alperozturk96 cc7a22e8b7 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-10-30 14:22:26 +03:00
alperozturk96 0151b454a6 handle Image that isn't downloaded via -> fileOnItemClick -> previewImageWithSearchContext
Downloaded text file via -> fileOnItemClick -> previewFile -> startTextPreview
       Downloaded audio file via > fileOnItemClick -> previewFile -> startAudioPreview

Signed-off-by: alperozturk96 <[email protected]>
2026-10-30 14:22:21 +03:00
alperozturk96 91af72e96c only sync when user get in directory
Signed-off-by: alperozturk96 <[email protected]>
2026-10-30 14:22:17 +03:00
alperozturk96 e0f7094c90 print results
Signed-off-by: alperozturk96 <[email protected]>
2026-10-30 14:22:14 +03:00
alperozturk96 10d1f99526 simplify startContentSynchronizations
Signed-off-by: alperozturk96 <[email protected]>
2026-10-30 14:22:13 +03:00
alperozturk96 a4f82c1df6 fix spotbugs: (This write of this shared primitive variable may not be visible to other threads)
Signed-off-by: alperozturk96 <[email protected]>
2026-10-30 14:22:12 +03:00
alperozturk96 bf430c7265 simplify openFile function
Signed-off-by: alperozturk96 <[email protected]>
2026-10-30 14:22:07 +03:00
alperozturk96 c17763d2c6 Check local eTag if it's outdated then run SynchronizeFileOperation else skip.
Signed-off-by: alperozturk96 <[email protected]>

# Conflicts:
#	app/src/main/java/com/nextcloud/utils/extensions/OCFileExtensions.kt
2026-10-30 14:22:07 +03:00
alperozturk96 288c4d81d0 Only add when user open the folder first time not every 10 seconds.
Signed-off-by: alperozturk96 <[email protected]>

# Conflicts:
#	app/src/main/java/com/owncloud/android/ui/activity/FileDisplayActivity.kt
2026-10-30 14:22:06 +03:00
alperozturk96 9d2c134bb7 reduce auto folder refresh to 10 seconds
Signed-off-by: alperozturk96 <[email protected]>
2026-10-30 14:21:56 +03:00
alperozturk96 2271bb9f35 use kotlin durations
Signed-off-by: alperozturk96 <[email protected]>
2026-10-30 14:21:56 +03:00
alperozturk96 db29c5d677 remove sync in progress dialog
Signed-off-by: alperozturk96 <[email protected]>
2026-10-30 14:21:56 +03:00
alperozturk96 b998db6394 add missing items for mFilesToSyncContents
Signed-off-by: alperozturk96 <[email protected]>
2026-10-30 14:21:55 +03:00
Alper Öztürk 3f73de97ef Merge pull request #17902 from nextcloud/refactor/file-display-activity
refactor(file-display-activity)
2026-10-30 13:34:49 +03:00
alperozturk96 84122f24e4 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-10-30 13:29:54 +03:00
alperozturk96 93d1eeb8ce fix spotbugs and convert cursor implm to kotlin
Signed-off-by: alperozturk96 <[email protected]>
2026-10-30 13:29:28 +03:00
alperozturk96 722823c9c4 Rename .java to .kt
Signed-off-by: alperozturk96 <[email protected]>
2026-10-30 13:29:28 +03:00
alperozturk96 60be5044ea use injections
Signed-off-by: alperozturk96 <[email protected]>
2026-10-30 13:29:28 +03:00
alperozturk96 ecefd79e91 optimize imports
Signed-off-by: alperozturk96 <[email protected]>
2026-10-30 13:29:28 +03:00
alperozturk96 528bd1f191 restructure package
Signed-off-by: alperozturk96 <[email protected]>
2026-10-30 13:29:28 +03:00
alperozturk96 ed2bfb4599 refactor(document-storage-provider): kotlin
Signed-off-by: alperozturk96 <[email protected]>
2026-10-30 13:29:28 +03:00
alperozturk96 020edd6500 Rename .java to .kt
Signed-off-by: alperozturk96 <[email protected]>
2026-10-30 13:29:28 +03:00
renovate[bot] 26f565510d Update dependency com.google.code.gson:gson to v2.15.0 (#17894)
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-10-30 09:29:26 +00:00
Tobias Kaminsky 8aefbb1d58 Merge pull request #17907 from nextcloud/renovate/fastlane-2.x-lockfile
Update dependency fastlane to v2.241.1
2026-10-30 09:28:30 +01:00
Nextcloud bot fb4cb3421f fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-10-30 03:48:09 +00:00
Alper Öztürk cc16cd5075 Merge pull request #17860 from nextcloud/remove-confusion-for-e2ee-operations
refactor(get-public-key): rename to get certificate
2026-10-29 17:18:19 +03:00
alperozturk96 25efb018de update lib
Signed-off-by: alperozturk96 <[email protected]>
2026-10-29 17:08:00 +03:00
alperozturk96 4fc858e987 wip
Signed-off-by: alperozturk96 <[email protected]>

# Conflicts:
#	gradle/libs.versions.toml
2026-10-29 17:02:36 +03:00
alperozturk96 97fe7e99e1 refactor(get-public-key): rename to get certificate
Signed-off-by: alperozturk96 <[email protected]>

# Conflicts:
#	gradle/libs.versions.toml
2026-10-29 17:02:26 +03:00
Alper Öztürk 72483540ae Merge pull request #17841 from nextcloud/update-fastlane
build(fastlane): disable R8 optimization for release builds
2026-10-29 16:18:34 +03:00
Alper Öztürk 3348df5cf8 Merge pull request #17704 from nextcloud/fix/modification-date
fix(copy-upload): modification date
2026-10-29 16:13:47 +03:00
Alper Öztürk 58673046f2 Merge pull request #17890 from nextcloud/fix/document-storage-provider
fix(document-storage-provider): exceptions
2026-10-29 16:11:29 +03:00
renovate[bot] 62d234e059 Update dependency fastlane to v2.241.1
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-10-29 11:47:28 +00:00
Tobias Kaminsky a6a217cf9b Merge pull request #17904 from nextcloud/repo-sync/android-config/master
🔄 synced file(s) with nextcloud/android-config
2026-10-29 12:45:37 +01:00
Tobias Kaminsky 6a0f80be69 Merge pull request #17903 from nextcloud/update-library-2026-10-29
Update library to 2026-10-29
2026-10-29 10:33:24 +01:00
nextcloud-android-bot 23f18c3f6d 🔄 synced local '.' with remote 'config/root/'
Signed-off-by: nextcloud-android-bot <[email protected]>
2026-10-29 08:00:20 +00:00
nextcloud-android-bot c1ca00ec7b 🔄 synced local 'fastlane/' with remote 'config/fastlane/'
Signed-off-by: nextcloud-android-bot <[email protected]>
2026-10-29 08:00:20 +00:00
nextcloud-android-bot 1e45fd05c1 🔄 synced local '.github/workflows/' with remote 'config/workflows/'
Signed-off-by: nextcloud-android-bot <[email protected]>
2026-10-29 08:00:20 +00:00
Tobias Kaminsky 101ad50866 Merge pull request #17868 from nextcloud/remove-codacy
chore: remove codacy
2026-10-29 08:48:35 +01:00
Tobias Kaminsky 24e07557ee Merge pull request #17898 from nextcloud/extractHashCheck
library hash check is extracted to daily check on server
2026-10-29 08:11:58 +01:00
Nextcloud Android Bot 28c97540f6 Update library to 2026-10-29
Signed-off-by: Nextcloud Android Bot <[email protected]>
2026-10-29 07:11:33 +00:00
alperozturk96 8f25744c93 simplify
Signed-off-by: alperozturk96 <[email protected]>
2026-10-29 09:25:18 +03:00
Alper Öztürk e85d31cc1c Merge pull request #17900 from nextcloud/fix/qrcode-login-when-no-enforced-servers
Fix QR login
2026-10-29 09:12:15 +03:00
alperozturk96 ec37270835 refactor
Signed-off-by: alperozturk96 <[email protected]>
2026-10-29 09:09:26 +03:00
alperozturk96 79a6424d74 refactor
Signed-off-by: alperozturk96 <[email protected]>
2026-10-29 09:09:00 +03:00
alperozturk96 54d67a271e increase long method to 120
Signed-off-by: alperozturk96 <[email protected]>
2026-10-29 08:49:43 +03:00
alperozturk96 9f8916e5d9 improve ContentUriLastModifiedResolver
Signed-off-by: alperozturk96 <[email protected]>
2026-10-29 08:45:02 +03:00
alperozturk96 e60810d66a add fallback to OS.fstat via ContentUriLastModifiedResolver
Signed-off-by: alperozturk96 <[email protected]>
2026-10-29 08:45:02 +03:00
alperozturk96 e038907f76 fix(copy-upload): modification date
Signed-off-by: alperozturk96 <[email protected]>
2026-10-29 08:45:02 +03:00
alperozturk96 fac406c2ec refactor document storage provider
Signed-off-by: alperozturk96 <[email protected]>
2026-10-29 08:43:50 +03:00
alperozturk96 e7f4dea232 fix null path and concurrent modification issue
Signed-off-by: alperozturk96 <[email protected]>
2026-10-29 08:43:50 +03:00
alperozturk96 a1da79b441 fix wrote
Signed-off-by: alperozturk96 <[email protected]>
2026-10-29 08:43:50 +03:00
alperozturk96 5241e7308c add more logs
Signed-off-by: alperozturk96 <[email protected]>
2026-10-29 08:43:50 +03:00
alperozturk96 d3f4305a87 check parent folder existance
Signed-off-by: alperozturk96 <[email protected]>
2026-10-29 08:43:50 +03:00
Nextcloud bot f9c3e5e617 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-10-29 03:50:00 +00:00
Andy Scherzinger e5117680ac Merge pull request #17876 from nextcloud/rakekniven-patch-2
fix(i18n): Fix typo in gallery unsupported file message
2026-10-28 20:33:51 +01:00
alperozturk96 bf09016f26 adopt latest changes from master
Signed-off-by: alperozturk96 <[email protected]>
2026-10-28 19:25:35 +03:00
alperozturk96 07488b2e8e build(fastlane): disable R8 optimization for release builds
Signed-off-by: alperozturk96 <[email protected]>

# Conflicts:
#	fastlane/Fastfile
2026-10-28 19:21:24 +03:00
tobiasKaminsky 002c021319 library hash check is extracted to daily check on server
Signed-off-by: tobiasKaminsky <[email protected]>
2026-10-28 19:16:23 +03:00
Alper Öztürk 535e7b737b Merge pull request #17901 from nextcloud/fix/player-in-favorite
fix(player): in favorite
2026-10-28 19:13:33 +03:00
alperozturk96 c0d3da9368 fix(player): in favorite
Signed-off-by: alperozturk96 <[email protected]>
2026-10-28 16:57:13 +03:00
daniele-verducci ee6fa543a1 Fix QR login when enforced servers are not defined
Signed-off-by: daniele-verducci <[email protected]>
2026-10-28 14:43:24 +01:00
alperozturk96 119916bb03 refactor(error-message-adapter): kotlin
Signed-off-by: alperozturk96 <[email protected]>
2026-10-28 16:37:46 +03:00
alperozturk96 11045a2549 Rename .java to .kt
Signed-off-by: alperozturk96 <[email protected]>
2026-10-28 16:37:46 +03:00
Alper Öztürk 4b7a08757d Merge pull request #17891 from nextcloud/refactor/authenticator-activity-kotlin
refactor(authenticator-activity): kotlin
2026-10-28 16:23:31 +03:00
Alper Öztürk 29ba77473b Merge pull request #17848 from nextcloud/fix/sharing-enforce-protection-for-public-links
fix(share): enforce protection for public links
2026-10-28 12:03:23 +03:00
alperozturk96 3fd412d838 split into child classes to simplify logic
Signed-off-by: alperozturk96 <[email protected]>
2026-10-27 19:35:35 +03:00
alperozturk96 5e02399b1c split into child classes to simplify logic
Signed-off-by: alperozturk96 <[email protected]>
2026-10-27 19:31:58 +03:00
alperozturk96 0b6bc33285 convert tests to kotlin
Signed-off-by: alperozturk96 <[email protected]>
2026-10-27 19:31:42 +03:00
alperozturk96 a6b6e59d11 convert async task to coroutines
Signed-off-by: alperozturk96 <[email protected]>
2026-10-27 19:19:15 +03:00
alperozturk96 19cbac87c2 refactor(authenticator-activity): kotlin
Signed-off-by: alperozturk96 <[email protected]>
2026-10-27 19:14:27 +03:00
alperozturk96 f0fb4a044c Rename .java to .kt
Signed-off-by: alperozturk96 <[email protected]>
2026-10-27 19:14:26 +03:00
alperozturk96 9bff11a311 remove codacy
Signed-off-by: alperozturk96 <[email protected]>
2026-10-27 16:18:07 +01:00
Alper Öztürk 0688788230 Merge pull request #17867 from nextcloud/refactor/unify-file-action
refactor(file-actions): unify preview fragments
2026-10-27 16:01:47 +01:00
alperozturk96 962de1d4c8 wip
Signed-off-by: alperozturk96 <[email protected]>
2026-10-27 17:03:11 +03:00
alperozturk96 b194dee07b refactor PreviewTextFileFragment convert to kotlin
Signed-off-by: alperozturk96 <[email protected]>
2026-10-27 17:03:11 +03:00
alperozturk96 a23160b4e4 refactor PreviewTextFileFragment convert to kotlin
Signed-off-by: alperozturk96 <[email protected]>
2026-10-27 17:03:11 +03:00
alperozturk96 9f5dcd7116 refactor PreviewTextFileFragment convert to kotlin
Signed-off-by: alperozturk96 <[email protected]>
2026-10-27 17:03:11 +03:00
alperozturk96 4057b4ccd1 Rename .java to .kt
Signed-off-by: alperozturk96 <[email protected]>
2026-10-27 17:03:11 +03:00
alperozturk96 632396f0f7 refactor(file-actions): unify preview fragments
Signed-off-by: alperozturk96 <[email protected]>

# Conflicts:
#	app/src/main/java/com/owncloud/android/ui/fragment/OCFileListFragment.java
2026-10-27 17:03:11 +03:00
alperozturk96 9bf5602c2d refactor(file-actions): unify preview fragments
Signed-off-by: alperozturk96 <[email protected]>

# Conflicts:
#	app/src/main/java/com/owncloud/android/ui/preview/media/PreviewMediaFragment.kt
2026-10-27 17:03:10 +03:00
Alper Öztürk 2e628d8f62 Merge pull request #17886 from nextcloud/refactor/oc-file-list-fragment-kotlin
refactor(oc-file-list-fragment): kotlin
2026-10-27 14:53:49 +01:00
Tobias Kaminsky a8c54accbd Merge pull request #17852 from nextcloud/feat/support-move-method
Implemented MOVE WebDAV method for SSO requests
2026-10-27 10:12:31 +01:00
Nextcloud bot 3679c7f2c2 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-10-27 03:52:42 +00:00
alperozturk96 1d9bbe9c55 simplify
Signed-off-by: alperozturk96 <[email protected]>
2026-10-26 19:47:21 +03:00
alperozturk96 27f706f257 simplify
Signed-off-by: alperozturk96 <[email protected]>
2026-10-26 19:26:57 +03:00
alperozturk96 e25410438f refactor(oc-file-list-fragment): kotlin
Signed-off-by: alperozturk96 <[email protected]>
2026-10-26 19:13:30 +03:00
alperozturk96 afb55de964 Rename .java to .kt
Signed-off-by: alperozturk96 <[email protected]>
2026-10-26 19:13:29 +03:00
renovate[bot]andTobias Kaminsky 2997278f40 Update dependency org.conscrypt:conscrypt-android to v2.8.0 (#17875)
* Update dependency org.conscrypt:conscrypt-android to v2.8.0

Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix verification-metadata.xml

Signed-off-by: Tobias Kaminsky <[email protected]>
Signed-off-by: tobiasKaminsky <[email protected]>

---------

Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: Tobias Kaminsky <[email protected]>
Signed-off-by: tobiasKaminsky <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Tobias Kaminsky <[email protected]>
2026-10-26 15:59:24 +00:00
Tobias Kaminsky 1795cde04f Merge pull request #17731 from nextcloud/extractFastlane
extract Fastlane
2026-10-26 16:40:19 +01:00
tobiasKaminsky 4ea5d865ce clarify semVer
Signed-off-by: tobiasKaminsky <[email protected]>
2026-10-26 16:18:08 +01:00
tobiasKaminsky 85604bbe85 extract Fastlane
Signed-off-by: tobiasKaminsky <[email protected]>
2026-10-26 16:18:05 +01:00
daniele-verducci 1984c94a85 Fix SpotBugs LITERAL_STRING_COMPARISON
Signed-off-by: daniele-verducci <[email protected]>
2026-10-26 14:10:57 +01:00
daniele-verducci c8bcb9c1d8 Implemented MOVE WebDAV method in InputStreamBinder to make it available trough Android-SingleSignOn lib
Signed-off-by: daniele-verducci <[email protected]>
2026-10-26 13:07:53 +01:00
Alper Öztürk 71c112b0d4 Merge pull request #17866 from nextcloud/feat/provide-long-name-in-file-action-bottom-sheet
feat(file-actions): show long file names on up to three lines
2026-10-26 12:50:49 +01:00
Tobias Kaminsky 9f73851e5f Merge pull request #17882 from nextcloud/update-library-2026-10-26_2
Update library to 2026-10-26
2026-10-26 12:45:43 +01:00
Alper Öztürk 3b653e73f1 Merge pull request #17870 from nextcloud/adjust-detekt
chore(detekt): relax rules and drop obsolete suppressions
2026-10-26 11:59:50 +01:00
renovate[bot]andTobias Kaminsky bc844bc023 Update dependency androidx.webkit:webkit to v1.18.0 (#17879)
* Update dependency androidx.webkit:webkit to v1.18.0

Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* fix verification-metadata.xml

Signed-off-by: Tobias Kaminsky <[email protected]>

---------

Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: Tobias Kaminsky <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Tobias Kaminsky <[email protected]>
2026-10-26 10:31:25 +00:00
renovate[bot] 72ba1d8d46 Update dependency org.jetbrains.kotlinx:kotlinx-serialization-json to v1.12.0 (#17872)
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-10-26 10:50:07 +01:00
daniele-verducci 516934fc91 Update library to 2026-10-26
Signed-off-by: daniele-verducci <[email protected]>
Signed-off-by: tobiasKaminsky <[email protected]>
2026-10-26 10:33:33 +01:00
Tobias Kaminsky 2804ff620f Merge pull request #17877 from nextcloud/renovate/firebasemessagingversion
Update dependency com.google.firebase:firebase-messaging to v26.0.1
2026-10-26 08:42:51 +01:00
Tobias Kaminsky 05d28f8872 Merge pull request #17871 from nextcloud/renovate/gradle-9.x
Update Gradle to v9.8.2
2026-10-26 08:42:13 +01:00
Nextcloud bot 0bbf14e92c fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-10-26 03:54:11 +00:00
Andy Scherzinger eacb7e4dc0 Merge pull request #17878 from nextcloud/renovate/github-codeql-action-4.x
Update github/codeql-action action to v4.39.1
2026-10-25 22:05:50 +01:00
renovate[bot] 7ba1a758b8 Update github/codeql-action action to v4.39.1
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-10-25 18:39:38 +00:00
renovate[bot] e12b988158 Update dependency com.google.firebase:firebase-messaging to v26.0.1
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-10-25 18:39:24 +00:00
rakekniven 7cc0c88983 fix(i18n): Fix typo in gallery unsupported file message
Reported at Transifex

Signed-off-by: rakekniven <[email protected]>
2026-10-25 18:03:27 +01:00
Nextcloud bot 364883a6ec fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-10-25 04:17:57 +00:00
Nextcloud bot cae2070490 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-10-24 03:49:12 +00:00
renovate[bot] 54e6dd4432 Update Gradle to v9.8.2
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-10-23 18:30:38 +00:00
alperozturk96 8b3f38c610 chore(detekt): relax rules and drop obsolete suppressions
Signed-off-by: alperozturk96 <[email protected]>
2026-10-23 12:01:50 +02:00
Alper Öztürk d57fdc8981 Merge pull request #17869 from nextcloud/fix/lint
fix lint
2026-10-23 11:46:41 +02:00
alperozturk96 5a761b28f3 fix lint
Signed-off-by: alperozturk96 <[email protected]>
2026-10-23 11:27:34 +02:00
Tobias Kaminsky 580b4203a2 Merge pull request #17737 from nextcloud/renovate/spotless
Update dependency com.diffplug.spotless to v8.10.4
2026-10-23 10:01:31 +02:00
Tobias Kaminsky dd64c29490 Merge pull request #17820 from nextcloud/renovate/juniversalchardetversion
Update dependency com.github.albfernandez:juniversalchardet to v2.5.1
2026-10-23 10:01:14 +02:00
Tobias Kaminsky 868922abcd Merge pull request #17859 from nextcloud/renovate/ubuntu-26.x
Update dependency ubuntu to v26
2026-10-23 10:01:01 +02:00
Tobias Kaminsky 83727c2834 Merge pull request #17779 from nextcloud/renovate/ical4jversion
Update dependency org.mnode.ical4j:ical4j to v4.4.0
2026-10-23 09:03:59 +02:00
tobiasKaminsky 866709070e fix kvm
Signed-off-by: tobiasKaminsky <[email protected]>
2026-10-23 08:50:15 +02:00
renovate[bot] 760f573edb Update dependency ubuntu to v26
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-10-23 08:48:26 +02:00
Nextcloud bot f15b2f9dc4 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-10-23 03:55:00 +00:00
alperozturk96 6558f45f6e fix error: cannot find symbol
import androidx.lifecycle.ProcessLifecycleOwner;

Signed-off-by: alperozturk96 <[email protected]>
2026-10-22 16:15:05 +02:00
alperozturk96 2bbb2d386e abi optimization for build and remove data binding and is fork
Signed-off-by: alperozturk96 <[email protected]>
2026-10-22 15:29:45 +02:00
alperozturk96 40a4a27fe4 disable data binding
Signed-off-by: alperozturk96 <[email protected]>
2026-10-22 15:24:12 +02:00
Alper Öztürk c4932a7046 Merge pull request #17864 from nextcloud/refactor/unify-file-actions
refactor(file-actions): unify
2026-10-22 14:42:30 +02:00
Alper Öztürk 4f732286bb Merge pull request #17865 from nextcloud/fix/file-list-update
fix(file-list): renew after upload
2026-10-22 14:36:24 +02:00
alperozturk96 741a9eea3e use in file actions bottom sheet
Signed-off-by: alperozturk96 <[email protected]>
2026-10-22 14:30:39 +02:00
alperozturk96 af2643eee2 introduce reusable filenameview
Signed-off-by: alperozturk96 <[email protected]>
2026-10-22 14:30:31 +02:00
alperozturk96 9a73d3a712 fix(file-list): renew after upload
Signed-off-by: alperozturk96 <[email protected]>
2026-10-22 11:40:59 +02:00
alperozturk96 6e49655948 simplify
Signed-off-by: alperozturk96 <[email protected]>
2026-10-22 10:35:53 +02:00
alperozturk96 2d61551c8a simplify
Signed-off-by: alperozturk96 <[email protected]>
2026-10-22 10:05:38 +02:00
alperozturk96 f1e4f35abe migrate oc file list fragment
Signed-off-by: alperozturk96 <[email protected]>
2026-10-22 10:01:39 +02:00
Alper Öztürk 6e7bbf4178 Merge pull request #17842 from nextcloud/observe-file-downloads-in-folder
feat(folder-download): observe file downloads
2026-10-22 09:46:08 +02:00
alperozturk96 347cf282ba migrate file detail actions to file action handler
Signed-off-by: alperozturk96 <[email protected]>
2026-10-22 09:26:12 +02:00
Alper Öztürk 5cfdf3089f Merge pull request #17850 from nextcloud/refactor/web-view-util
refactor(web-view-util): use proxy controller
2026-10-22 09:02:12 +02:00
alperozturk96 b5ec4f4769 use app consts
Signed-off-by: alperozturk96 <[email protected]>
2026-10-22 08:57:07 +02:00
alperozturk96 d87ea8dd3a fix dir observation
Signed-off-by: alperozturk96 <[email protected]>
2026-10-22 08:57:07 +02:00
alperozturk96 c621738ae7 fix icon changes
Signed-off-by: alperozturk96 <[email protected]>
2026-10-22 08:57:07 +02:00
alperozturk96 d98ce8454c set current folder id
Signed-off-by: alperozturk96 <[email protected]>
2026-10-22 08:57:07 +02:00
alperozturk96 8f9cb4f7a9 add file download progress in current folder sync
Signed-off-by: alperozturk96 <[email protected]>
2026-10-22 08:57:07 +02:00
alperozturk96 56ee9fdb43 use worker instead local broadcast manager
Signed-off-by: alperozturk96 <[email protected]>
2026-10-22 08:57:07 +02:00
Alper Öztürk b68e602800 Merge pull request #17826 from nextcloud/fix/internal-105127
Fix local/remote image file comparison
2026-10-22 08:55:45 +02:00
Alper Öztürk 71881954dc Merge pull request #17851 from nextcloud/refactor/resized-image-generation-task
refactor(thumbail-cache-manager): resized image generation
2026-10-22 08:52:41 +02:00
alperozturk96 8ff8cd8be1 fix kotlin spotless bug
Signed-off-by: alperozturk96 <[email protected]>
2026-10-22 08:27:54 +02:00
alperozturk96 760bd4d79d fix kotlin spotless bug
Signed-off-by: alperozturk96 <[email protected]>
2026-10-22 08:25:03 +02:00
daniele-verducci ceb1d38c48 Wait for proxy only if there's a proxy configured
Signed-off-by: daniele-verducci <[email protected]>
2026-10-22 08:20:03 +02:00
alperozturk96 28a8672443 refactor(web-view-util): use ProxyController
Signed-off-by: alperozturk96 <[email protected]>
2026-10-22 08:20:03 +02:00
daniele-verducci 332f6f58ce Refactored tests
Signed-off-by: daniele-verducci <[email protected]>
2026-10-21 17:15:33 +02:00
alperozturk96 62e06864a1 rebase
Signed-off-by: alperozturk96 <[email protected]>
2026-10-21 17:15:33 +02:00
daniele-verducci 5d84351639 Implemented tests
Signed-off-by: daniele-verducci <[email protected]>

# Conflicts:
#	app/src/main/java/com/nextcloud/utils/extensions/RemoteFileExtensions.kt
2026-10-21 17:15:33 +02:00
daniele-verducci 300eb6fd4c Fix: areImageDimensionsSame remote file check is now symmetric to local one (it doesn't fail when dimensions are unknown)
Signed-off-by: daniele-verducci <[email protected]>
2026-10-21 17:15:33 +02:00
alperozturk96 75c655a544 replace deprecated api with display metrics
Signed-off-by: alperozturk96 <[email protected]>
2026-10-21 16:55:14 +02:00
alperozturk96 e00baeca70 deduplicate display size logic
Signed-off-by: alperozturk96 <[email protected]>
2026-10-21 16:55:14 +02:00
alperozturk96 9a331f76f0 refactor(thumbail-cache-manager): resized image generation
Signed-off-by: alperozturk96 <[email protected]>
2026-10-21 16:55:14 +02:00
alperozturk96 2c2c8cd1b9 remove dead code
Signed-off-by: alperozturk96 <[email protected]>
2026-10-21 16:54:36 +02:00
Tobias Kaminsky ee9b8b5380 fix(ical4j): match nullable getTzId() return type from ical4j 4.4.0
ical4j 4.4.0 annotates TimeZoneRegistry.getTzId() as @Nullable (it can
return null when the zone id has no mapping). Update the override to
match, fixing a Kotlin compile error introduced by the ical4j bump.

Signed-off-by: Tobias Kaminsky <[email protected]>
2026-10-21 11:07:47 +02:00
Tobias Kaminsky 12d5fc543f fix verification-metadata.xml
Signed-off-by: Tobias Kaminsky <[email protected]>
2026-10-21 10:30:46 +02:00
Tobias Kaminsky e74ed7f033 fix verification-metadata.xml
Signed-off-by: Tobias Kaminsky <[email protected]>
2026-10-21 10:30:43 +02:00
tobiasKaminsky 37c595bae9 fix verification-metadata.xml
Signed-off-by: tobiasKaminsky <[email protected]>
2026-10-21 09:31:51 +02:00
tobiasKaminsky b45f336aef fix verification-metadata.xml
Signed-off-by: tobiasKaminsky <[email protected]>
2026-10-21 09:11:52 +02:00
renovate[bot] b819e8081f Update dependency com.github.albfernandez:juniversalchardet to v2.5.1
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-10-21 09:11:49 +02:00
renovate[bot] cd3cee246b Update dependency org.mnode.ical4j:ical4j to v4.4.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-10-21 09:10:42 +02:00
tobiasKaminsky 872bf3f95a fix verification-metadata.xml
Signed-off-by: tobiasKaminsky <[email protected]>
2026-10-21 09:04:03 +02:00
renovate[bot] 10cd0fa39a Update dependency com.diffplug.spotless to v8.10.4
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-10-21 09:04:03 +02:00
alperozturk96 d034ef94ad fix double duplicate snackbar
Signed-off-by: alperozturk96 <[email protected]>
2026-10-20 08:54:00 +02:00
alperozturk96 4f4e403fd7 add better error message for weak password
Signed-off-by: alperozturk96 <[email protected]>
2026-10-20 08:47:31 +02:00
alperozturk96 9bf6a7be02 fix enforce password check
Signed-off-by: alperozturk96 <[email protected]>
2026-10-20 08:41:11 +02:00
430 changed files with 11714 additions and 12324 deletions

No files matched your search

-5
View File
@@ -1,5 +0,0 @@
# SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
exclude_paths:
- "app/src/main/cpp/**"
+1 -1
View File
@@ -1,4 +1,4 @@
FROM ubuntu:resolute@sha256:c098726dd9b9733f3e885f8de0ef375206a311b0a317eadc40d347b1115fb944
FROM ubuntu:resolute@sha256:6a06111c3b0a8600feadb270aec771dc239bf407b25625f93f44ab00e11f4d3c
ARG DEBIAN_FRONTEND=noninteractive
ENV ANDROID_HOME=/usr/lib/android-sdk
+2 -2
View File
@@ -37,9 +37,9 @@ jobs:
with:
distribution: "temurin"
java-version: 21
- uses: gradle/actions/wrapper-validation@3f5f9adaf7d9fecd50b5935e54106014257a94e6 # v6.4.0
- uses: gradle/actions/wrapper-validation@8da46b539cd8fe6ab27ca75128919a18d757604c # v6.4.1
- name: Setup Gradle
uses: gradle/actions/setup-gradle@3f5f9adaf7d9fecd50b5935e54106014257a94e6 # v6.4.0
uses: gradle/actions/setup-gradle@8da46b539cd8fe6ab27ca75128919a18d757604c # v6.4.1
- name: Build ${{ matrix.flavor }}
run: |
{
+1 -1
View File
@@ -31,6 +31,6 @@ jobs:
distribution: "temurin"
java-version: 21
- name: Setup Gradle
uses: gradle/actions/setup-gradle@3f5f9adaf7d9fecd50b5935e54106014257a94e6 # v6.4.0
uses: gradle/actions/setup-gradle@8da46b539cd8fe6ab27ca75128919a18d757604c # v6.4.1
- name: Check ${{ matrix.task }}
run: ./gradlew ${{ matrix.task }}
+8 -2
View File
@@ -1,6 +1,7 @@
# synced from @nextcloud/android-config
# SPDX-FileCopyrightText: 2022-2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-FileCopyrightText: 2026 Alper Ozturk <[email protected]>
# SPDX-FileCopyrightText: 2023-2024 Andy Scherzinger <[email protected]>
# SPDX-FileCopyrightText: 2022 Tobias Kaminsky <[email protected]>
# SPDX-FileCopyrightText: 2022 Álvaro Brey <[email protected]>
@@ -20,10 +21,15 @@ on:
permissions:
contents: read
concurrency:
group: codeql-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest-max
timeout-minutes: 90
permissions:
actions: read
contents: read
@@ -43,7 +49,7 @@ jobs:
with:
swap-size-gb: 10
- name: Initialize CodeQL
uses: github/codeql-action/init@6f2ac81f5cd81fe351a197ba0b00d91d03cd2aee # v4.39.0
uses: github/codeql-action/init@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4.39.1
with:
languages: ${{ matrix.language }}
- name: Set up JDK 21
@@ -57,4 +63,4 @@ jobs:
echo "org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError" > "$HOME/.gradle/gradle.properties"
./gradlew --no-daemon assembleDebug
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@6f2ac81f5cd81fe351a197ba0b00d91d03cd2aee # v4.39.0
uses: github/codeql-action/analyze@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4.39.1
+1 -1
View File
@@ -17,7 +17,7 @@ concurrency:
jobs:
detectWrongSettings:
runs-on: ubuntu-24.04
runs-on: ubuntu-26.04
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
+2 -8
View File
@@ -17,7 +17,7 @@ concurrency:
jobs:
test:
runs-on: ubuntu-24.04
runs-on: ubuntu-26.04
services:
server:
image: ${{ matrix.server == 'stable22' && 'ghcr.io/nextcloud/continuous-integration-shallow-server-php8.0:1' || 'ghcr.io/nextcloud/continuous-integration-shallow-server-php8.3:latest' }}
@@ -34,7 +34,7 @@ jobs:
- name: configure server
run: |
sudo apt-get update && sudo apt-get install unzip cpu-checker qemu-kvm --yes
sudo apt-get update && sudo apt-get install unzip cpu-checker qemu-system-x86 --yes
sudo chmod 666 /dev/kvm
docker cp .github/workflows/configServer.sh server:/tmp/
docker exec server chmod +x /tmp/configServer.sh
@@ -50,12 +50,6 @@ jobs:
distribution: "temurin"
java-version: 21
- name: Enable KVM group perms
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: Configure gradle daemon
run: |
mkdir -p $HOME/.gradle
+1 -1
View File
@@ -42,6 +42,6 @@ jobs:
# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@6f2ac81f5cd81fe351a197ba0b00d91d03cd2aee # v4.39.0
uses: github/codeql-action/upload-sarif@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4.39.1
with:
sarif_file: results.sarif
+1 -1
View File
@@ -37,7 +37,7 @@ jobs:
run: scripts/deleteOldComments.sh "test" "Unit" ${{github.event.number}}
- name: Setup Gradle
uses: gradle/actions/setup-gradle@3f5f9adaf7d9fecd50b5935e54106014257a94e6 # v6.4.0
uses: gradle/actions/setup-gradle@8da46b539cd8fe6ab27ca75128919a18d757604c # v6.4.1
- name: Run unit tests with coverage
run: ./gradlew jacocoTestGplayDebugUnitTest
+1
View File
@@ -60,6 +60,7 @@ build
/gradle.properties
.attach_pid*
fastlane/Fastfile
fastlane/ruby
*.hprof
# NDK / C++
+2 -8
View File
@@ -1,10 +1,4 @@
# Autogenerated by fastlane
#
# Ensure this file is checked in to source control!
source "https://rubygems.org"
gem 'fastlane'
plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile')
eval_gemfile(plugins_path) if File.exist?(plugins_path)
gem "fastlane"
gem "abbrev"
+44 -38
View File
@@ -7,10 +7,10 @@ GEM
public_suffix (>= 2.0.2, < 8.0)
artifactory (3.0.17)
atomos (0.1.3)
aws-eventstream (1.4.0)
aws-partitions (1.1296.0)
aws-sdk-core (3.257.0)
aws-eventstream (~> 1, >= 1.3.0)
aws-eventstream (1.4.1)
aws-partitions (1.1299.1)
aws-sdk-core (3.262.0)
aws-eventstream (~> 1, >= 1.4.1)
aws-partitions (~> 1, >= 1.992.0)
aws-sigv4 (~> 1.9)
base64
@@ -18,11 +18,11 @@ GEM
jmespath (~> 1, >= 1.6.1)
logger
rexml (~> 3.4, >= 3.4.2)
aws-sdk-kms (1.132.0)
aws-sdk-core (~> 3, >= 3.256.0)
aws-sdk-kms (1.137.0)
aws-sdk-core (~> 3, >= 3.262.0)
aws-sigv4 (~> 1.5)
aws-sdk-s3 (1.233.2)
aws-sdk-core (~> 3, >= 3.256.0)
aws-sdk-s3 (1.236.0)
aws-sdk-core (~> 3, >= 3.262.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.5)
aws-sigv4 (1.12.1)
@@ -30,14 +30,14 @@ GEM
babosa (1.0.4)
base64 (0.3.0)
benchmark (0.5.0)
bigdecimal (3.3.1)
bigdecimal (4.1.3)
cgi (0.5.2)
claide (1.1.0)
colored (1.2)
colored2 (3.1.2)
commander (4.6.0)
highline (~> 2.0.0)
csv (3.3.6)
csv (3.3.7)
declarative (0.0.20)
digest-crc (0.7.0)
rake (>= 12.0.0, < 14.0.0)
@@ -45,9 +45,8 @@ GEM
dotenv (2.8.1)
emoji_regex (3.2.3)
erb (6.0.7)
excon (1.7.3)
logger
faraday (2.15.0)
excon (1.9.0)
faraday (2.15.1)
faraday-net_http (>= 2.0, < 3.6)
json
logger
@@ -58,11 +57,12 @@ GEM
faraday (>= 1, < 3)
faraday-multipart (1.2.0)
multipart-post (~> 2.0)
faraday-net_http (2.1.0)
faraday-net_http (3.5.0)
net-http (~> 0.5)
faraday-retry (2.4.0)
faraday (~> 2.0)
fastimage (2.4.1)
fastlane (2.241.1)
fastimage (2.4.3)
fastlane (2.241.2)
CFPropertyList (>= 2.3, < 5.0.0)
abbrev (~> 0.1)
addressable (>= 2.9.0, < 3.0.0)
@@ -117,25 +117,24 @@ GEM
xcodeproj (>= 1.13.0, < 2.0.0)
xcpretty (~> 0.4.1)
xcpretty-travis-formatter (>= 0.0.3, < 2.0.0)
fastlane-plugin-huawei_appgallery_connect (1.0.31)
cgi
fastlane-sirp (1.1.0)
gh_inspector (1.1.3)
google-apis-androidpublisher_v3 (0.109.0)
google-apis-androidpublisher_v3 (0.110.0)
google-apis-core (>= 0.15.0, < 2.a)
google-apis-core (0.18.0)
addressable (~> 2.5, >= 2.5.1)
googleauth (~> 1.9)
httpclient (>= 2.8.3, < 3.a)
mini_mime (~> 1.0)
mutex_m
google-apis-core (1.4.0)
addressable (~> 2.9)
faraday (~> 2.13)
faraday-follow_redirects (~> 0.3)
googleauth (~> 1.14)
mini_mime (~> 1.1)
multi_json (~> 1.11)
representable (~> 3.0)
retriable (>= 2.0, < 4.a)
retriable (>= 3.1, < 5.0)
google-apis-iamcredentials_v1 (0.28.0)
google-apis-core (>= 0.15.0, < 2.a)
google-apis-playcustomapp_v1 (0.18.0)
google-apis-core (>= 0.15.0, < 2.a)
google-apis-storage_v1 (0.69.0)
google-apis-storage_v1 (0.70.0)
google-apis-core (>= 0.15.0, < 2.a)
google-cloud-core (1.9.0)
google-cloud-env (>= 1.0, < 3.a)
@@ -154,7 +153,7 @@ GEM
googleauth (~> 1.9)
mini_mime (~> 1.0)
google-logging-utils (0.2.1)
googleauth (1.17.5)
googleauth (1.17.6)
faraday (>= 1.0, < 3.a)
google-cloud-env (~> 2.2)
google-logging-utils (~> 0.1)
@@ -165,9 +164,7 @@ GEM
highline (2.0.3)
http-cookie (1.1.6)
domain_name (~> 0.5)
httpclient (2.9.0)
mutex_m
io-console (0.9.4)
io-console (0.9.5)
irb (1.18.0)
pp (>= 0.6.0)
prism (>= 1.3.0)
@@ -175,7 +172,7 @@ GEM
reline (>= 0.4.2)
jmespath (1.6.2)
json (2.21.2)
jwt (2.10.3)
jwt (3.3.0)
base64
logger (1.7.0)
mini_magick (4.13.2)
@@ -185,6 +182,11 @@ GEM
mutex_m (0.3.0)
nanaimo (0.4.0)
naturally (2.3.0)
net-http (0.10.0)
net-protocol (>= 0.3.0)
uri (>= 0.11.1)
net-protocol (0.4.0)
timeout
nkf (0.3.0)
optparse (0.8.1)
os (1.1.4)
@@ -194,8 +196,8 @@ GEM
prettyprint
prettyprint (0.2.1)
prism (1.9.0)
pstore (0.2.1)
public_suffix (6.0.2)
pstore (0.3.0)
public_suffix (7.0.5)
rake (13.4.2)
rbs (4.2.0)
logger
@@ -212,11 +214,11 @@ GEM
declarative (< 0.1.0)
trailblazer-option (>= 0.1.1, < 0.2.0)
uber (< 0.2.0)
retriable (3.8.0)
retriable (4.2.0)
rexml (3.4.4)
rouge (3.28.0)
rubyzip (3.7.0)
security (0.3.0)
security (0.4.0)
signet (0.22.1)
addressable (~> 2.8)
faraday (>= 0.17.5, < 3.a)
@@ -227,6 +229,7 @@ GEM
terminal-notifier (3.1.0)
terminal-table (4.0.0)
unicode-display_width (>= 1.1.1, < 4)
timeout (0.6.1)
trailblazer-option (0.1.2)
tsort (0.2.0)
tty-cursor (0.7.1)
@@ -234,7 +237,10 @@ GEM
tty-spinner (0.9.3)
tty-cursor (~> 0.7)
uber (0.1.0)
unicode-display_width (2.6.0)
unicode-display_width (3.3.0)
unicode-emoji (~> 4.3)
unicode-emoji (4.3.0)
uri (1.1.2)
word_wrap (1.0.0)
xcodeproj (1.28.1)
CFPropertyList (>= 2.3.3, < 4.0)
@@ -254,8 +260,8 @@ PLATFORMS
x86_64-linux
DEPENDENCIES
abbrev
fastlane
fastlane-plugin-huawei_appgallery_connect
BUNDLED WITH
2.5.4
+1 -1
View File
@@ -4,7 +4,7 @@
-->
# [Nextcloud](https://nextcloud.com) Android app :iphone:
[![REUSE status](https://api.reuse.software/badge/github.com/nextcloud/android)](https://api.reuse.software/info/github.com/nextcloud/android) [![Build Status](https://drone.nextcloud.com/api/badges/nextcloud/android/status.svg)](https://drone.nextcloud.com/nextcloud/android) [![Codacy Badge](https://app.codacy.com/project/badge/Grade/fb4cf26336774ee3a5c9adfe829c41aa)](https://app.codacy.com/gh/nextcloud/android/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade) [![Releases](https://img.shields.io/github/release/nextcloud/android.svg)](https://github.com/nextcloud/android/releases/latest)
[![REUSE status](https://api.reuse.software/badge/github.com/nextcloud/android)](https://api.reuse.software/info/github.com/nextcloud/android) [![Build Status](https://drone.nextcloud.com/api/badges/nextcloud/android/status.svg)](https://drone.nextcloud.com/nextcloud/android) [![Releases](https://img.shields.io/github/release/nextcloud/android.svg)](https://github.com/nextcloud/android/releases/latest)
[<img src="https://play.google.com/intl/en_us/badges/images/generic/en_badge_web_generic.png"
alt="Download from Google Play"
-1
View File
@@ -6,7 +6,6 @@
[![حالة REUSE](https://api.reuse.software/badge/github.com/nextcloud/android)](https://api.reuse.software/info/github.com/nextcloud/android)
[![حالة البناء](https://drone.nextcloud.com/api/badges/nextcloud/android/status.svg)](https://drone.nextcloud.com/nextcloud/android)
[![تقييم Codacy](https://app.codacy.com/project/badge/Grade/fb4cf26336774ee3a5c9adfe829c41aa)](https://app.codacy.com/gh/nextcloud/android/dashboard)
[![الإصدارات](https://img.shields.io/github/release/nextcloud/android.svg)](https://github.com/nextcloud/android/releases/latest)
[<img src="https://play.google.com/intl/en_us/badges/images/generic/en_badge_web_generic.png" alt="تحميل من Google Play" height="80">](https://play.google.com/store/apps/details?id=com.nextcloud.client)
+18 -22
View File
@@ -18,6 +18,12 @@ val shotTest = System.getenv("SHOT_TEST") == "true"
val ciBuild = System.getenv("CI") == "true"
val perfAnalysis = project.hasProperty("perfAnalysis")
val allAbis = listOf("armeabi-v7a", "arm64-v8a", "x86", "x86_64")
val localDebugAbis = when (System.getProperty("os.arch")) {
"aarch64", "arm64" -> listOf("arm64-v8a")
else -> listOf("arm64-v8a", "x86_64")
}
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.compose)
@@ -66,12 +72,6 @@ configurations.configureEach {
}
}
// semantic versioning for version code
val versionMajor = 35
val versionMinor = 1
val versionPatch = 0
val versionBuild = 50 // 0-50=Alpha / 51-98=RC / 90-99=stable
val ndkEnv = buildMap {
file("${project.rootDir}/ndk.env").readLines().forEach {
val (key, value) = it.split("=")
@@ -107,12 +107,12 @@ android {
)
applicationId = "com.nextcloud.client"
minSdk = 28
targetSdk = 36
compileSdk = 37
ndk {
abiFilters += listOf("armeabi-v7a", "arm64-v8a", "x86", "x86_64")
}
targetSdk = 36
// mayor.minor.hotfix.increment (for increment: 01-50=Alpha / 51-89=RC / 90-99=stable)
// xx .xxx .xx .xx
versionCode = 350010050
versionName = "35.1.0 Alpha 51"
buildConfigField("boolean", "CI", ciBuild.toString())
buildConfigField("boolean", "RUNTIME_PERF_ANALYSIS", perfAnalysis.toString())
@@ -121,13 +121,6 @@ android {
testInstrumentationRunner = if (shotTest) "com.karumi.shot.ShotTestRunner"
else "com.nextcloud.client.TestRunner"
versionCode = versionMajor * 10000000 + versionMinor * 10000 + versionPatch * 100 + versionBuild
versionName = when {
versionBuild > 89 -> "${versionMajor}.${versionMinor}.${versionPatch}"
versionBuild > 50 -> "${versionMajor}.${versionMinor}.${versionPatch} RC" + (versionBuild - 50)
else -> "${versionMajor}.${versionMinor}.${versionPatch} Alpha" + (versionBuild + 1)
}
// adapt structure from Eclipse to Gradle/Android Studio expectations;
// see http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Configuring-the-Structure
@@ -139,11 +132,17 @@ android {
enable = true
}
buildConfigField("String", "NC_TEST_SERVER_DATA_STRING", "\"\"")
ndk {
abiFilters += allAbis
}
}
debug {
enableUnitTestCoverage = project.hasProperty("coverage")
enableAndroidTestCoverage = project.hasProperty("coverage")
resConfigs("xxxhdpi")
ndk {
abiFilters += if (ciBuild) allAbis else localDebugAbis
}
}
}
@@ -194,7 +193,6 @@ android {
buildFeatures {
buildConfig = true
dataBinding = true
viewBinding = true
aidl = true
compose = true
@@ -319,10 +317,7 @@ tasks.withType<SpotBugsTask>().configureEach {
}
}
// Run the compiler as a separate process
tasks.withType<JavaCompile>().configureEach {
options.isFork = true
// Enable Incremental Compilation
options.isIncremental = true
}
@@ -404,6 +399,7 @@ dependencies {
// region Lifecycle
implementation(libs.lifecycle.viewmodel.ktx)
implementation(libs.lifecycle.process)
implementation(libs.lifecycle.service)
implementation(libs.lifecycle.runtime.ktx)
// endregion
+10 -10
View File
@@ -53,9 +53,9 @@ complexity:
active: false
threshold: 10
includeStaticDeclarations: false
ComplexMethod:
CyclomaticComplexMethod:
active: true
threshold: 10
threshold: 15
ignoreSingleWhenExpression: false
ignoreSimpleWhenEntries: false
excludes: ['**/androidTest/**']
@@ -67,10 +67,10 @@ complexity:
threshold: 600
LongMethod:
active: true
threshold: 60
threshold: 120
excludes: ['**/androidTest/**']
LongParameterList:
active: true
active: false
functionThreshold: 7
constructorThreshold: 6
ignoreDefaultParameters: false
@@ -87,7 +87,7 @@ complexity:
excludeStringsWithLessThan5Characters: true
ignoreStringsRegex: '$^'
TooManyFunctions:
active: true
active: false
thresholdInFiles: 15
thresholdInClasses: 15
thresholdInInterfaces: 15
@@ -158,7 +158,7 @@ exceptions:
ThrowingNewInstanceOfSameException:
active: false
TooGenericExceptionCaught:
active: true
active: false
exceptionNames:
- ArrayIndexOutOfBoundsException
- Error
@@ -170,7 +170,7 @@ exceptions:
- Throwable
allowedExceptionNameRegex: "^(_|(ignore|expected).*)"
TooGenericExceptionThrown:
active: true
active: false
exceptionNames:
- Error
- Exception
@@ -226,7 +226,7 @@ naming:
active: true
packagePattern: '^[a-z]+(\.[a-z][A-Za-z0-9]*)*$'
TopLevelPropertyNaming:
active: true
active: false
constantPattern: '[A-Z][_A-Z0-9]*'
propertyPattern: '[A-Za-z][_A-Za-z0-9]*'
privatePropertyPattern: '(_)?[A-Za-z][A-Za-z0-9]*'
@@ -346,7 +346,7 @@ style:
NestedClassesVisibility:
active: false
NewLineAtEndOfFile:
active: true
active: false
NoTabs:
active: false
OptionalAbstractKeyword:
@@ -362,7 +362,7 @@ style:
RedundantVisibilityModifierRule:
active: false
ReturnCount:
active: true
active: false
max: 2
excludedFunctions: [equals]
excludeLabeled: false
+5
View File
@@ -90,6 +90,11 @@
<ignore path="**/appcompat-1.**/**/lint.jar" />
</issue>
<!-- Lint reads abiFilters as source text and cannot resolve allAbis; local debug builds skip x86 on purpose. -->
<issue id="ChromeOsAbiSupport">
<ignore path="build.gradle.kts" />
</issue>
<issue id="Aligned16KB">
<ignore path="**/arm64-v8a/libmockkjvmtiagent.so" />
</issue>
@@ -16,7 +16,6 @@ import java.util.TreeMap
*
* The implementation is not thread-safe.
*/
@Suppress("TooManyFunctions")
class MockSharedPreferences : SharedPreferences {
class MockEditor(val store: MutableMap<String?, Any?>) : SharedPreferences.Editor {
@@ -0,0 +1,138 @@
/*
* Nextcloud - Android Client
*
* SPDX-FileCopyrightText: 2026 Daniele Verducci <[email protected]>
* SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
package com.nextcloud.extensions
import android.graphics.Bitmap
import com.nextcloud.utils.extensions.areImageDimensionsSame
import com.owncloud.android.lib.resources.files.model.ImageDimension
import com.owncloud.android.lib.resources.files.model.RemoteFile
import org.junit.After
import org.junit.Assert.assertFalse
import org.junit.Assert.assertTrue
import org.junit.Before
import org.junit.Test
import java.io.File
import java.io.OutputStream
import java.nio.file.Files
import java.nio.file.Path
import kotlin.io.path.exists
class RemoteFileExtensionsImageTest {
private lateinit var tempDir: Path
private val remoteFileWithDimensions = RemoteFile().apply {
mimeType = "image/jpeg"
imageDimension = ImageDimension(IMAGE_WIDTH.toFloat(), IMAGE_HEIGHT.toFloat())
}
private val remoteFileWithoutDimensions = RemoteFile().apply {
mimeType = "image/jpeg"
imageDimension = null
}
@Test
fun testAreImageDimensionsSameWhenLocalFileIsNotImage_ShouldReturnTrue() {
// local not an image
assertTrue(
"comparing with non-image",
remoteFileWithDimensions.areImageDimensionsSame(getPath(TEXT_FILENAME).toString())
)
}
@Test
fun testAreImageDimensionsSame_ShouldReturnTrue() {
// same dimensions
assertTrue(
"comparing with same-size image",
remoteFileWithDimensions.areImageDimensionsSame(getPath(IMAGE_FILENAME).toString())
)
}
@Test
fun testAreImageDimensionsSame_ShouldReturnFalse() {
// different dimensions
val biggerRemoteImage = RemoteFile().apply {
mimeType = "image/jpeg"
imageDimension = ImageDimension((IMAGE_WIDTH * 2).toFloat(), IMAGE_HEIGHT.toFloat())
}
assertFalse(
"comparing with different-size image",
biggerRemoteImage.areImageDimensionsSame(getPath(IMAGE_FILENAME).toString())
)
}
@Test
fun testAreImageDimensionsSameWhenLocalFileHasNoDimensions_ShouldReturnTrue() {
// local file with null dimensions
assertTrue(
"comparing null-dimensions local file with valid remote file",
remoteFileWithoutDimensions.areImageDimensionsSame(getPath(TEXT_FILENAME).toString())
)
}
@Test
fun testAreImageDimensionsSameWhenRemoteFileHasNoDimensions_ShouldReturnTrue() {
// remote file with null dimensions
assertTrue(
"comparing with null-dimensions remote file",
remoteFileWithoutDimensions.areImageDimensionsSame(getPath(IMAGE_FILENAME).toString())
)
}
@Test
fun testAreImageDimensionsSameWhenBothFilesHaveNoDimensions_ShouldReturnTrue() {
// both files with null dimensions
assertTrue(
"comparing null-dimensions local file with null-dimensions remote file",
remoteFileWithoutDimensions.areImageDimensionsSame(getPath(TEXT_FILENAME).toString())
)
}
@After
fun cleanup() {
val tf = File(getPath(TEXT_FILENAME).toUri())
val imgf = File(getPath(IMAGE_FILENAME).toUri())
tf.delete()
imgf.delete()
}
@Before
fun setup() {
tempDir = Files.createTempDirectory(TMP_DIR)
assertTrue("Temp directory should exist", tempDir.exists())
createImageFile()
createTextFile()
}
private fun getPath(filename: String): Path = tempDir.resolve("test_$filename")
private fun createImageFile() {
val bitmap = Bitmap.createBitmap(IMAGE_WIDTH, IMAGE_HEIGHT, Bitmap.Config.ARGB_8888)
val imagePath = getPath(IMAGE_FILENAME)
Files.newOutputStream(imagePath).use { out: OutputStream ->
bitmap.compress(Bitmap.CompressFormat.JPEG, 90, out)
}
assertTrue(imagePath.exists())
}
private fun createTextFile() {
val f = File(getPath(TEXT_FILENAME).toUri())
f.writeText("Lorem ipsum")
}
companion object {
val TMP_DIR = "remoteFileExtensionsTest"
val TEXT_FILENAME = "text.txt"
val IMAGE_FILENAME = "image.jpg"
val IMAGE_WIDTH = 123
val IMAGE_HEIGHT = 45
}
}
@@ -11,7 +11,6 @@ import junit.framework.TestCase.assertFalse
import junit.framework.TestCase.assertTrue
import org.junit.Test
@Suppress("TooManyFunctions")
class StringExtensionTests {
@Test
fun testIsNotBlankAndEqualsWhenGivenBothStringsAreNull() {
@@ -22,7 +22,7 @@ import org.junit.Test
import java.io.File
import kotlin.random.Random
@Suppress("TooManyFunctions", "MagicNumber")
@Suppress("MagicNumber")
class FileDeletionTests : AbstractIT() {
private val createdFilePaths = mutableListOf<String>()
@@ -18,7 +18,6 @@ fun withSelectedText(expected: String): Matcher<View> = object : TypeSafeMatcher
description.appendText("with selected text \"$expected\"")
}
@Suppress("ReturnCount")
override fun matchesSafely(view: View): Boolean {
if (view !is TextView) return false
val text = view.text?.toString() ?: ""
@@ -27,7 +27,6 @@ class RetryTestRule(val retryCount: Int = defaultRetryValue) : TestRule {
override fun apply(base: Statement, description: Description): Statement = statement(base, description)
@Suppress("TooGenericExceptionCaught") // and this exactly what we want here
private fun statement(base: Statement, description: Description): Statement {
return object : Statement() {
@@ -18,7 +18,6 @@ import com.owncloud.android.lib.resources.status.OCCapability
import org.junit.Before
import org.junit.Test
@Suppress("TooManyFunctions")
@SinceServer(majorVersion = 30)
class AutoRenameTests : AbstractOnServerIT() {
@@ -12,7 +12,6 @@ import junit.framework.TestCase.assertFalse
import junit.framework.TestCase.assertTrue
import org.junit.Test
@Suppress("TooManyFunctions")
class FileExtensionTest {
@Test
@@ -15,7 +15,6 @@ import org.junit.Test
import java.io.File
import java.nio.file.Files
@Suppress("TooManyFunctions")
class FileHelperTest {
private lateinit var testDirectory: File
@@ -21,7 +21,6 @@ import org.junit.Assert.assertTrue
import org.junit.Before
import org.junit.Test
@Suppress("TooManyFunctions")
class FileNameValidatorTests : AbstractOnServerIT() {
companion object {
private const val MAX_FILENAME_SIZE = 250
@@ -17,7 +17,7 @@ import junit.framework.TestCase.assertEquals
import junit.framework.TestCase.assertTrue
import org.junit.Test
@Suppress("MagicNumber", "TooManyFunctions")
@Suppress("MagicNumber")
class OCCapabilityJsonToListTests : AbstractIT() {
private var capability: OCCapability = fileDataStorageManager.getCapability(account.name)
@@ -18,7 +18,6 @@ import junit.framework.TestCase.assertFalse
import junit.framework.TestCase.assertTrue
import org.junit.Test
@Suppress("TooManyFunctions")
class SharePermissionManagerTest {
private fun createShare(sharePermission: Int, isFolder: Boolean = false, attributesJson: String? = null): OCShare =
@@ -11,7 +11,6 @@ import com.nextcloud.utils.extensions.webDavParentPath
import org.junit.Assert.assertEquals
import org.junit.Test
@Suppress("TooManyFunctions")
class WebDavParentPathTests {
@Test
@@ -40,7 +40,7 @@ import java.nio.file.attribute.BasicFileAttributes
import java.util.concurrent.TimeUnit
import kotlin.math.abs
@Suppress("TooManyFunctions", "DEPRECATION")
@Suppress("DEPRECATION")
class UploadIT : AbstractOnServerIT() {
private val uploadsStorageManager = UploadsStorageManager(
UserAccountManagerImpl.fromContext(targetContext),
@@ -18,7 +18,6 @@ class AuthenticatorActivityIT {
}
@Test
@Suppress("TooGenericExceptionCaught")
fun tryCatch() {
val color = try {
Color.parseColor("1")
@@ -30,7 +29,6 @@ class AuthenticatorActivityIT {
}
@Test
@Suppress("TooGenericExceptionCaught")
fun tryCatch2() {
val color = try {
Color.parseColor("")
@@ -42,7 +40,6 @@ class AuthenticatorActivityIT {
}
@Test
@Suppress("TooGenericExceptionCaught")
fun tryCatch3() {
val color = try {
Color.parseColor(null)
@@ -54,7 +51,6 @@ class AuthenticatorActivityIT {
}
@Test
@Suppress("TooGenericExceptionCaught")
fun tryCatch4() {
val color = try {
Color.parseColor("abc")
@@ -12,7 +12,7 @@ import com.owncloud.android.lib.resources.e2ee.DeleteEncryptedFilesRemoteOperati
import com.owncloud.android.lib.resources.users.DeletePrivateKeyRemoteOperation
import com.owncloud.android.lib.resources.users.DeletePublicKeyRemoteOperation
import com.owncloud.android.lib.resources.users.GetPrivateKeyRemoteOperation
import com.owncloud.android.lib.resources.users.GetPublicKeyRemoteOperation
import com.owncloud.android.lib.resources.users.GetCertificateRemoteOperation
import com.owncloud.android.lib.resources.users.StorePrivateKeyRemoteOperation
import com.owncloud.android.ui.dialog.setupEncryption.EncryptionKeyGenerator
import com.owncloud.android.utils.EncryptionUtils
@@ -58,7 +58,7 @@ class DeleteE2ERemoteOperationIT : AbstractOnServerIT() {
val result = sut.execute(nextcloudClient)
assertTrue(result.isSuccess)
val getResult = GetPublicKeyRemoteOperation().execute(nextcloudClient)
val getResult = GetCertificateRemoteOperation().execute(nextcloudClient)
assertFalse(getResult.isSuccess)
}
}
@@ -18,7 +18,7 @@ import org.junit.Assert.assertTrue
import org.junit.Test
import java.io.File
@Suppress("TooManyFunctions", "DEPRECATION")
@Suppress("DEPRECATION")
class InternalTwoWaySyncIT : AbstractInternalTwoWaySyncIT() {
companion object {
@@ -4,7 +4,7 @@
* SPDX-FileCopyrightText: 2020 Torsten Grote <t@grobox.de>
* SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
*/
package com.owncloud.android.providers
package com.owncloud.android.providers.documentstorage
import android.content.Context
import android.database.ContentObserver
@@ -25,7 +25,7 @@ import com.owncloud.android.datamodel.OCFile
import com.owncloud.android.lib.common.OwnCloudClient
import com.owncloud.android.lib.common.utils.Log_OC
import com.owncloud.android.lib.resources.files.ExistenceCheckRemoteOperation
import com.owncloud.android.providers.DocumentsStorageProvider.DOCUMENTID_SEPARATOR
import com.owncloud.android.providers.documentstorage.DocumentsStorageProvider.Companion.DOCUMENTID_SEPARATOR
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.TimeoutCancellationException
import kotlinx.coroutines.suspendCancellableCoroutine
@@ -4,7 +4,7 @@
* SPDX-FileCopyrightText: 2020 Torsten Grote <t@grobox.de>
* SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
*/
package com.owncloud.android.providers
package com.owncloud.android.providers.documentstorage
import android.provider.DocumentsContract
import androidx.documentfile.provider.DocumentFile
@@ -20,16 +20,16 @@ import com.owncloud.android.datamodel.UploadsStorageManager.UploadStatus
import com.owncloud.android.db.OCUpload
import com.owncloud.android.db.UploadResult
import com.owncloud.android.lib.common.utils.Log_OC
import com.owncloud.android.providers.DocumentsProviderUtils.assertExistsOnServer
import com.owncloud.android.providers.DocumentsProviderUtils.assertListFilesEquals
import com.owncloud.android.providers.DocumentsProviderUtils.assertReadEquals
import com.owncloud.android.providers.DocumentsProviderUtils.assertRecentlyModified
import com.owncloud.android.providers.DocumentsProviderUtils.assertRegularFile
import com.owncloud.android.providers.DocumentsProviderUtils.assertRegularFolder
import com.owncloud.android.providers.DocumentsProviderUtils.findFileBlocking
import com.owncloud.android.providers.DocumentsProviderUtils.getOCFile
import com.owncloud.android.providers.DocumentsProviderUtils.listFilesBlocking
import com.owncloud.android.providers.DocumentsStorageProvider.DOCUMENTID_SEPARATOR
import com.owncloud.android.providers.documentstorage.DocumentsProviderUtils.assertExistsOnServer
import com.owncloud.android.providers.documentstorage.DocumentsProviderUtils.assertListFilesEquals
import com.owncloud.android.providers.documentstorage.DocumentsProviderUtils.assertReadEquals
import com.owncloud.android.providers.documentstorage.DocumentsProviderUtils.assertRecentlyModified
import com.owncloud.android.providers.documentstorage.DocumentsProviderUtils.assertRegularFile
import com.owncloud.android.providers.documentstorage.DocumentsProviderUtils.assertRegularFolder
import com.owncloud.android.providers.documentstorage.DocumentsProviderUtils.findFileBlocking
import com.owncloud.android.providers.documentstorage.DocumentsProviderUtils.getOCFile
import com.owncloud.android.providers.documentstorage.DocumentsProviderUtils.listFilesBlocking
import com.owncloud.android.providers.documentstorage.DocumentsStorageProvider.Companion.DOCUMENTID_SEPARATOR
import kotlinx.coroutines.runBlocking
import org.apache.commons.httpclient.HttpStatus
import org.apache.commons.httpclient.methods.ByteArrayRequestEntity
@@ -52,7 +52,7 @@ class LoginIT : AbstractIT() {
*/
@Test
@Throws(InterruptedException::class)
@Suppress("MagicNumber", "SwallowedException")
@Suppress("MagicNumber")
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.Q)
@Flaky("Login no longer uses an in-app WebView, so espresso-web (Espresso.onWebView) cannot drive it. ")
fun login() {
@@ -31,7 +31,6 @@ import javax.inject.Provider
import org.junit.Before
import org.junit.Test
@Suppress("TooManyFunctions")
class UnifiedSearchListAdapterIT : AbstractIT() {
private val testClassName = "com.owncloud.android.ui.adapter.UnifiedSearchListAdapterIT"
@@ -46,7 +46,7 @@ import com.nextcloud.utils.EditorUtils
import com.owncloud.android.AbstractIT
import com.owncloud.android.MainApp
import com.owncloud.android.R
import com.owncloud.android.authentication.EnforcedServer
import com.owncloud.android.authentication.server.EnforcedServer
import com.owncloud.android.datamodel.ArbitraryDataProvider
import com.owncloud.android.datamodel.ArbitraryDataProviderImpl
import com.owncloud.android.datamodel.FileDataStorageManager
@@ -78,7 +78,6 @@ import org.junit.Test
import java.net.URI
import java.util.function.Supplier
@Suppress("TooManyFunctions")
class DialogFragmentIT : AbstractIT() {
private val testClassName = "com.owncloud.android.ui.dialog.DialogFragmentIT"
private val serverUrl = "https://nextcloud.localhost"
@@ -58,7 +58,6 @@ import org.junit.Before
import org.junit.Rule
import org.junit.Test
@Suppress("TooManyFunctions")
class FileDetailSharingFragmentIT : AbstractIT() {
private val testClassName = "com.owncloud.android.ui.fragment.FileDetailSharingFragmentIT"
@@ -151,7 +151,6 @@ class GalleryFragmentIT : AbstractIT() {
}
/** Recursively walk view tree to find the first RecyclerView. Runs on the same thread that calls it. */
@Suppress("ReturnCount")
private fun findRecyclerViewRecursively(root: View?): RecyclerView? {
if (root == null) return null
if (root is RecyclerView) return root
@@ -115,7 +115,6 @@ class NotificationsFragmentIT : AbstractIT() {
add(buildNotificationManyActions())
}
@Suppress("ReturnCount")
private fun findFragment(sut: NavigatorActivity): NotificationsFragment? {
val allFragments = sut.supportFragmentManager.fragments
for (f in allFragments) {
@@ -246,7 +246,7 @@ class OCFileListFragmentStaticServerIT : AbstractIT() {
sut.supportFragmentManager.executePendingTransactions()
val root = sut.storageManager.getFileByEncryptedRemotePath("/")
fragment.listDirectory(root, false)
fragment.adapter.setShowShareAvatar(true)
requireNotNull(fragment.adapter).setShowShareAvatar(true)
}
val screenShotName = createName(testClassName + "_" + "showSharedFiles", "")
@@ -334,7 +334,7 @@ class OCFileListFragmentStaticServerIT : AbstractIT() {
sut.supportFragmentManager.executePendingTransactions()
val root = sut.storageManager.getFileByEncryptedRemotePath("/")
fragment.listDirectory(root, false)
fragment.adapter.setShowShareAvatar(true)
requireNotNull(fragment.adapter).setShowShareAvatar(true)
}
val screenShotName = createName(testClassName + "_" + "showFolderTypes", "")
@@ -399,27 +399,28 @@ class OCFileListFragmentStaticServerIT : AbstractIT() {
}
val testFolder: OCFile = activity!!.storageManager.getFileByEncryptedRemotePath("/test/")
val adapter = requireNotNull(sut.adapter)
// richWorkspace is not set
Assert.assertFalse(sut.adapter.shouldShowHeader())
Assert.assertFalse(adapter.shouldShowHeader())
testFolder.richWorkspace = " "
activity.storageManager.saveFile(testFolder)
sut.adapter.swapDirectory(user, testFolder, activity.storageManager, false, "")
adapter.swapDirectory(user, testFolder, activity.storageManager, false, "")
Assert.assertFalse(sut.adapter.shouldShowHeader())
Assert.assertFalse(adapter.shouldShowHeader())
testFolder.richWorkspace = null
activity.storageManager.saveFile(testFolder)
sut.adapter.swapDirectory(user, testFolder, activity.storageManager, false, "")
Assert.assertFalse(sut.adapter.shouldShowHeader())
adapter.swapDirectory(user, testFolder, activity.storageManager, false, "")
Assert.assertFalse(adapter.shouldShowHeader())
EspressoIdlingResource.increment()
testFolder.richWorkspace = "1"
activity.storageManager.saveFile(testFolder)
sut.adapter.setCurrentDirectory(testFolder)
adapter.setCurrentDirectory(testFolder)
Assert.assertTrue(sut.adapter.shouldShowHeader())
Assert.assertTrue(adapter.shouldShowHeader())
}
}
@@ -170,7 +170,7 @@ internal class SharedListFragmentIT : AbstractIT() {
OCShareToOCFileConverter
.parseAndSaveShares(listOf(), shares, storageManager, user)
}
fragment.adapter.run {
requireNotNull(fragment.adapter).run {
prepareForSearchData(SearchType.SHARED_FILTER)
updateAdapter(newList, null)
}
@@ -32,7 +32,6 @@ class TrashbinFragmentIT : AbstractIT() {
FILES
}
@Suppress("ReturnCount")
private fun findFragment(sut: NavigatorActivity): TrashbinFragment? {
val allFragments = sut.supportFragmentManager.fragments
for (f in allFragments) {
@@ -1,55 +0,0 @@
/*
* Nextcloud - Android Client
*
* SPDX-FileCopyrightText: 2021-2022 Chris Narkiewicz <hello@ezaquarii.com>
* SPDX-FileCopyrightText: 2019-2021 Tobias Kaminsky <tobias@kaminsky.me>
* SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
*/
package com.owncloud.android.util;
import android.content.Context;
import android.content.res.Resources;
import com.nextcloud.client.account.MockUser;
import com.nextcloud.client.account.User;
import com.owncloud.android.MainApp;
import com.owncloud.android.datamodel.FileDataStorageManager;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.operations.RemoveFileOperation;
import com.owncloud.android.utils.ErrorMessageAdapter;
import org.junit.Test;
import org.junit.runner.RunWith;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.platform.app.InstrumentationRegistry;
import static junit.framework.TestCase.assertEquals;
@RunWith(AndroidJUnit4.class)
public class ErrorMessageAdapterIT {
private final static String PATH_TO_DELETE = "/path/to/a.file";
private final static String EXPECTED_ERROR_MESSAGE = "You are not permitted to delete this file";
private final static String ACCOUNT_TYPE = "nextcloud";
@Test
public void getErrorCauseMessageForForbiddenRemoval() {
Resources resources = InstrumentationRegistry.getInstrumentation().getTargetContext().getResources();
User user = new MockUser("name", ACCOUNT_TYPE);
Context context = MainApp.getAppContext();
String errorMessage = ErrorMessageAdapter.getErrorCauseMessage(
new RemoteOperationResult(RemoteOperationResult.ResultCode.FORBIDDEN),
new RemoveFileOperation(new OCFile(PATH_TO_DELETE),
false,
user,
false,
context,
new FileDataStorageManager(user, context.getContentResolver())),
resources
);
assertEquals(EXPECTED_ERROR_MESSAGE, errorMessage);
}
}
@@ -0,0 +1,54 @@
/*
* Nextcloud - Android Client
*
* SPDX-FileCopyrightText: 2026 Alper Ozturk <alper.ozturk@nextcloud.com>
* SPDX-FileCopyrightText: 2021-2022 Chris Narkiewicz <hello@ezaquarii.com>
* SPDX-FileCopyrightText: 2019-2021 Tobias Kaminsky <tobias@kaminsky.me>
* SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
*/
package com.owncloud.android.util
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.platform.app.InstrumentationRegistry
import com.nextcloud.client.account.MockUser
import com.nextcloud.client.account.User
import com.owncloud.android.MainApp
import com.owncloud.android.datamodel.FileDataStorageManager
import com.owncloud.android.datamodel.OCFile
import com.owncloud.android.lib.common.operations.RemoteOperationResult
import com.owncloud.android.operations.RemoveFileOperation
import com.owncloud.android.utils.ErrorMessageAdapter.getErrorCauseMessage
import junit.framework.TestCase
import org.junit.Test
import org.junit.runner.RunWith
@RunWith(AndroidJUnit4::class)
class ErrorMessageAdapterIT {
@Test
fun getErrorCauseMessageForForbiddenRemoval() {
val resources = InstrumentationRegistry.getInstrumentation().targetContext.resources
val user: User = MockUser("name", ACCOUNT_TYPE)
val context = MainApp.getAppContext()
val errorMessage = getErrorCauseMessage(
RemoteOperationResult<Any?>(RemoteOperationResult.ResultCode.FORBIDDEN),
RemoveFileOperation(
OCFile(PATH_TO_DELETE),
false,
user,
false,
context,
FileDataStorageManager(user, context.contentResolver)
),
resources
)
TestCase.assertEquals(EXPECTED_ERROR_MESSAGE, errorMessage)
}
companion object {
private const val PATH_TO_DELETE = "/path/to/a.file"
private const val EXPECTED_ERROR_MESSAGE = "You are not permitted to delete this file"
private const val ACCOUNT_TYPE = "nextcloud"
}
}
@@ -32,7 +32,7 @@ import org.junit.Assert.assertFalse
import org.junit.Assert.assertNotEquals
import org.junit.Test
@Suppress("TooManyFunctions", "LargeClass")
@Suppress("LargeClass")
class EncryptionUtilsV2IT : EncryptionIT() {
private val encryptionTestUtils = EncryptionTestUtils()
private val encryptionUtilsV2 = EncryptionUtilsV2()
@@ -30,7 +30,6 @@ import org.junit.Assert.assertNull
import org.junit.Before
import org.junit.Test
@Suppress("TooManyFunctions")
class FileUploadHelperTest {
private lateinit var uploadDao: UploadDao
@@ -49,7 +48,6 @@ class FileUploadHelperTest {
fileUploadHelper.fileStorageManager = mockFileStorageManager
}
@Suppress("LongParameterList")
private fun buildEntity(
id: Int = 1,
localPath: String = this.localPath,
+1 -1
View File
@@ -481,7 +481,7 @@
android:exported="false"
android:label="@string/share_search" />
<provider
android:name=".providers.DocumentsStorageProvider"
android:name=".providers.documentstorage.DocumentsStorageProvider"
android:authorities="@string/document_provider_authority"
android:enabled="true"
android:exported="true"
@@ -43,6 +43,7 @@ import org.apache.commons.httpclient.methods.RequestEntity;
import org.apache.commons.httpclient.methods.StringRequestEntity;
import org.apache.jackrabbit.webdav.DavConstants;
import org.apache.jackrabbit.webdav.client.methods.MkColMethod;
import org.apache.jackrabbit.webdav.client.methods.MoveMethod;
import org.apache.jackrabbit.webdav.client.methods.PropFindMethod;
import org.apache.jackrabbit.webdav.property.DavPropertyNameSet;
@@ -280,6 +281,15 @@ public class InputStreamBinder extends IInputStreamService.Stub {
method = new DeleteMethod(requestUrl);
break;
case "MOVE":
String destUrl = request.getAdditionalParameter(NextcloudRequest.ADDITIONAL_PARAMETER_MOVE_DESTINATION);
boolean overwrite =
"true".equalsIgnoreCase(
request.getAdditionalParameter(NextcloudRequest.ADDITIONAL_PARAMETER_MOVE_OVERWRITE)
);
method = new MoveMethod(requestUrl, destUrl, overwrite);
break;
case "PROPFIND":
method = new NCPropFindMethod(requestUrl, DavConstants.PROPFIND_ALL_PROP, DavConstants.DEPTH_1);
if (request.getRequestBody() != null) {
@@ -21,9 +21,13 @@ public class NextcloudRequest implements Serializable {
private static final long serialVersionUID = 215521212534240L; //assign a long value
public static final String ADDITIONAL_PARAMETER_MOVE_DESTINATION = "Destination";
public static final String ADDITIONAL_PARAMETER_MOVE_OVERWRITE = "Overwrite";
private String method;
private Map<String, List<String>> header = new HashMap<>();
private Map<String, String> parameter = new HashMap<>();
private Map<String, String> additionalParameter = new HashMap<>();
private final Collection<QueryParam> parameterV2 = new LinkedList<>();
private String requestBody;
private String url;
@@ -60,6 +64,15 @@ public class NextcloudRequest implements Serializable {
return this;
}
public Builder setAdditionalParameters(Map<String, String> ap) {
ncr.additionalParameter = ap;
return this;
}
public Builder setAdditionalParameter(String key, String value) {
ncr.additionalParameter.put(key, value);
return this;
}
public Builder setRequestBody(String requestBody) {
ncr.requestBody = requestBody;
return this;
@@ -103,6 +116,13 @@ public class NextcloudRequest implements Serializable {
return this.parameter;
}
public Map<String, String> getAdditionalParameters() {
return this.additionalParameter;
}
public String getAdditionalParameter(String key) {
return this.additionalParameter.get(key);
}
public String getRequestBody() {
return this.requestBody;
}
@@ -88,7 +88,7 @@ import kotlinx.coroutines.withContext
private const val CHAT_INPUT_DELAY = 100L
private const val PULL_TO_REFRESH_DELAY = 1500L
@Suppress("LongMethod")
@Suppress("LongMethod", "CyclomaticComplexMethod")
@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun AssistantScreen(
@@ -28,7 +28,6 @@ import kotlinx.coroutines.flow.update
import kotlinx.coroutines.isActive
import kotlinx.coroutines.launch
@Suppress("TooManyFunctions")
class AssistantViewModel(
private val accountName: String,
private val remoteRepository: AssistantRemoteRepository,
@@ -5,7 +5,7 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
@file:Suppress("TopLevelPropertyNaming", "MagicNumber")
@file:Suppress("MagicNumber")
package com.nextcloud.client.assistant.chat
@@ -5,7 +5,7 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
@file:Suppress("TopLevelPropertyNaming", "MagicNumber")
@file:Suppress("MagicNumber")
package com.nextcloud.client.assistant.conversation
@@ -146,7 +146,7 @@ fun TranslationScreen(viewModel: TranslationViewModel, assistantViewModel: Assis
}
}
@Suppress("LongMethod", "LongParameterList")
@Suppress("LongMethod")
@Composable
private fun TranslationSection(
labelId: Int,
@@ -11,7 +11,6 @@ import com.owncloud.android.R
import com.owncloud.android.lib.resources.assistant.v2.model.TaskTypeData
import com.owncloud.android.lib.resources.assistant.v2.model.toTranslationLanguages
@Suppress("LongParameterList")
sealed class TranslationScreenState(
open val taskTypeData: TaskTypeData,
open val source: TranslationSideState,
@@ -84,7 +84,6 @@ class TranslationViewModel(private val remoteRepository: AssistantRemoteReposito
}
}
@Suppress("ReturnCount")
private suspend fun pollTranslationResult() {
val screenStateValue = _screenState.value
if (screenStateValue is Uninitialized) {
@@ -12,7 +12,6 @@ import java.util.concurrent.atomic.AtomicBoolean
* This is a wrapper for a task function running in background.
* It executes task function and handles result or error delivery.
*/
@Suppress("LongParameterList")
internal class Task<T, P>(
private val postResult: (Runnable) -> Boolean,
private val removeFromQueue: (Runnable) -> Boolean,
@@ -32,7 +31,6 @@ internal class Task<T, P>(
postResult(Runnable { onProgress?.invoke(p) })
}
@Suppress("TooGenericExceptionCaught") // this is exactly what we want here
override fun run() {
try {
val result = taskBody.invoke({ postProgress(it) }, this::isCancelled)
@@ -109,7 +109,6 @@ import com.owncloud.android.db.ProviderMeta
],
exportSchema = true
)
@Suppress("Detekt.UnnecessaryAbstractClass") // needed by Room
@TypeConverters(OfflineOperationTypeConverter::class)
abstract class NextcloudDatabase : RoomDatabase() {
@@ -14,7 +14,6 @@ import com.nextcloud.client.database.entity.FileEntity
import com.owncloud.android.db.ProviderMeta.ProviderTableMeta
import com.owncloud.android.utils.MimeType
@Suppress("TooManyFunctions")
@Dao
interface FileDao {
@Update
@@ -162,7 +162,7 @@ data class CapabilityEntity(
val sharingJson: String?
)
@Suppress("LongMethod", "ReturnCount")
@Suppress("LongMethod", "CyclomaticComplexMethod")
fun CapabilityEntity?.toOCCapability(): OCCapability {
val capability = OCCapability()
if (this == null) return capability
@@ -71,6 +71,7 @@ data class UploadEntity(
val folderUnlockToken: String?
)
@Suppress("CyclomaticComplexMethod")
fun UploadEntity.toOCUpload(capability: OCCapability? = null): OCUpload? {
val localPath = localPath
var remotePath = remotePath
@@ -28,6 +28,7 @@ import com.nextcloud.client.core.ThreadPoolAsyncRunner
import com.nextcloud.client.database.dao.ArbitraryDataDao
import com.nextcloud.client.device.DeviceInfo
import com.nextcloud.client.jobs.operation.FileOperationHelper
import com.nextcloud.client.jobs.upload.FileUploadHelper
import com.nextcloud.client.logger.FileLogHandler
import com.nextcloud.client.logger.Logger
import com.nextcloud.client.logger.LoggerImpl
@@ -73,7 +74,6 @@ import javax.inject.Singleton
import com.nextcloud.utils.AppConstants.BYTES_PER_MB
@Module(includes = [ComponentsModule::class, VariantComponentsModule::class, BuildTypeComponentsModule::class])
@Suppress("TooManyFunctions")
internal class AppModule {
@Provides
@@ -120,6 +120,9 @@ internal class AppModule {
@Provides
fun clientRepository(repository: RemoteClientRepository): ClientRepository = repository
@Provides
fun fileUploadHelper(): FileUploadHelper = FileUploadHelper.instance()
@Provides
fun uploadsStorageManager(currentAccountProvider: CurrentAccountProvider, context: Context): UploadsStorageManager =
UploadsStorageManager(currentAccountProvider, context.contentResolver)
@@ -43,7 +43,7 @@ import com.owncloud.android.authentication.AuthenticatorActivity
import com.owncloud.android.authentication.DeepLinkLoginActivity
import com.owncloud.android.files.BootupBroadcastReceiver
import com.owncloud.android.providers.DiskLruImageCacheFileProvider
import com.owncloud.android.providers.DocumentsStorageProvider
import com.owncloud.android.providers.documentstorage.DocumentsStorageProvider
import com.owncloud.android.providers.FileContentProvider
import com.owncloud.android.providers.UsersAndGroupsSearchProvider
import com.owncloud.android.services.AccountManagerService
@@ -144,7 +144,6 @@ import dagger.android.ContributesAndroidInjector
* Register classes that require dependency injection. This class is used by Dagger compiler only.
*/
@Module
@Suppress("TooManyFunctions")
internal interface ComponentsModule {
@ContributesAndroidInjector
fun trashbinFragment(): TrashbinFragment
@@ -10,7 +10,6 @@ package com.nextcloud.client.di
import com.nextcloud.android.common.ui.theme.MaterialSchemes
import com.owncloud.android.utils.theme.MaterialSchemesProvider
import com.owncloud.android.utils.theme.MaterialSchemesProviderImpl
import com.owncloud.android.utils.theme.ThemeColorUtils
import com.owncloud.android.utils.theme.ThemeUtils
import dagger.Binds
import dagger.Module
@@ -25,10 +24,6 @@ internal abstract class ThemeModule {
companion object {
@Provides
@Singleton
fun themeColorUtils(): ThemeColorUtils = ThemeColorUtils()
@Provides
@Singleton
fun themeUtils(): ThemeUtils = ThemeUtils()
@@ -24,7 +24,7 @@ import com.owncloud.android.R
import com.owncloud.android.databinding.ActivityDocumentScanBinding
import com.owncloud.android.databinding.DialogScanExportTypeBinding
import com.owncloud.android.ui.activity.ToolbarActivity
import com.owncloud.android.utils.theme.ViewThemeUtils
import com.owncloud.android.ui.navigation.model.ActionBarStyle
import javax.inject.Inject
class DocumentScanActivity :
@@ -37,9 +37,6 @@ class DocumentScanActivity :
@Inject
lateinit var logger: Logger
@Inject
lateinit var viewThemeUtils: ViewThemeUtils
@Inject
lateinit var appScanOptionalFeature: AppScanOptionalFeature
@@ -71,7 +68,7 @@ class DocumentScanActivity :
binding = ActivityDocumentScanBinding.inflate(layoutInflater)
setContentView(binding.root)
setupToolbar()
showActionBar(ActionBarStyle.Plain)
supportActionBar?.let {
it.setDisplayHomeAsUpEnabled(true)
it.setDisplayShowHomeEnabled(true)
@@ -29,7 +29,6 @@ import kotlinx.coroutines.launch
import java.io.File
import javax.inject.Inject
@Suppress("Detekt.LongParameterList") // satisfied by DI
class DocumentScanViewModel @Inject constructor(
@IoDispatcher private val ioDispatcher: CoroutineDispatcher = Dispatchers.IO,
app: Application,
@@ -30,7 +30,6 @@ import com.owncloud.android.utils.theme.ViewThemeUtils
import java.io.File
import java.security.SecureRandom
@Suppress("Detekt.LongParameterList") // constructed only from factory method and tests
class GeneratePdfFromImagesWork(
private val appContext: Context,
private val generatePdfUseCase: GeneratePDFUseCase,
@@ -27,7 +27,6 @@ class ExceptionHandler(
}
override fun uncaughtException(thread: Thread, exception: Throwable) {
@Suppress("TooGenericExceptionCaught") // this is exactly what we want here
try {
val errorReport = generateErrorReport(formatException(thread, exception))
val intent = Intent(context, ShowErrorActivity::class.java)
@@ -17,6 +17,7 @@ import com.nextcloud.client.di.Injectable
import com.nextcloud.client.di.ViewModelFactory
import com.owncloud.android.R
import com.owncloud.android.ui.activity.ToolbarActivity
import com.owncloud.android.ui.navigation.model.ActionBarStyle
import javax.inject.Inject
class EtmActivity :
@@ -38,8 +39,8 @@ class EtmActivity :
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_etm)
setupToolbar()
updateActionBarTitleAndHomeButtonByString(getString(R.string.etm_title))
showActionBar(ActionBarStyle.Plain)
setActionBarTitle(getString(R.string.etm_title))
vm = ViewModelProvider(this, viewModelFactory).get(EtmViewModel::class.java)
vm.currentPage.observe(
this,
@@ -80,12 +81,12 @@ class EtmActivity :
supportFragmentManager.beginTransaction()
.replace(R.id.etm_page_container, fragment)
.commit()
updateActionBarTitleAndHomeButtonByString("ETM - ${getString(page.titleRes)}")
setActionBarTitle("ETM - ${getString(page.titleRes)}")
} else {
supportFragmentManager.beginTransaction()
.replace(R.id.etm_page_container, EtmMenuFragment())
.commitNow()
updateActionBarTitleAndHomeButtonByString(getString(R.string.etm_title))
setActionBarTitle(getString(R.string.etm_title))
}
}
}
@@ -32,7 +32,6 @@ import com.owncloud.android.R
import com.owncloud.android.lib.common.accounts.AccountUtils
import javax.inject.Inject
@Suppress("LongParameterList") // Dependencies Injection
@SuppressLint("StaticFieldLeak")
class EtmViewModel @Inject constructor(
private val context: Context,
@@ -78,7 +78,6 @@ class DownloadRequest internal constructor(
}
}
@Suppress("LongParameterList")
class UploadRequest internal constructor(
user: User,
file: OCFile,
@@ -36,7 +36,7 @@ import com.owncloud.android.lib.common.OwnCloudClientManagerFactory
import com.owncloud.android.lib.common.utils.Log_OC
import com.owncloud.android.lib.resources.users.DeleteAppPasswordRemoteOperation
import com.owncloud.android.lib.resources.users.RemoteWipeSuccessRemoteOperation
import com.owncloud.android.providers.DocumentsStorageProvider
import com.owncloud.android.providers.documentstorage.DocumentsStorageProvider
import com.owncloud.android.ui.activity.ContactsPreferenceActivity
import com.owncloud.android.ui.activity.ManageAccountsActivity
import com.owncloud.android.ui.events.AccountRemovedEvent
@@ -48,7 +48,6 @@ import java.util.Optional
/**
* Removes account and all local files
*/
@Suppress("LongParameterList") // legacy code
class AccountRemovalWork(
private val context: Context,
params: WorkerParameters,
@@ -67,7 +66,6 @@ class AccountRemovalWork(
const val REMOTE_WIPE = "remote_wipe"
}
@Suppress("ReturnCount") // legacy code
override fun doWork(): Result {
val accountName = inputData.getString(ACCOUNT) ?: ""
if (TextUtils.isEmpty(accountName)) {
@@ -185,29 +183,23 @@ class AccountRemovalWork(
}
}
private fun createClient(user: User): Optional<OwnCloudClient> {
@Suppress("TooGenericExceptionCaught") // needs migration to newer api to get rid of exceptions
return try {
val context = MainApp.getAppContext()
val factory = OwnCloudClientManagerFactory.getDefaultSingleton()
val client = factory.getClientFor(user.toOwnCloudAccount(), context)
Optional.of(client)
} catch (e: Exception) {
Log_OC.e(this, "Could not create client", e)
Optional.empty()
}
private fun createClient(user: User): Optional<OwnCloudClient> = try {
val context = MainApp.getAppContext()
val factory = OwnCloudClientManagerFactory.getDefaultSingleton()
val client = factory.getClientFor(user.toOwnCloudAccount(), context)
Optional.of(client)
} catch (e: Exception) {
Log_OC.e(this, "Could not create client", e)
Optional.empty()
}
private fun createNextcloudClient(user: User): Optional<NextcloudClient> {
@Suppress("TooGenericExceptionCaught") // needs migration to newer api to get rid of exceptions
return try {
val context = MainApp.getAppContext()
val factory = OwnCloudClientManagerFactory.getDefaultSingleton()
val client = factory.getNextcloudClientFor(user.toOwnCloudAccount(), context)
Optional.of(client)
} catch (e: Exception) {
Log_OC.e(this, "Could not create client", e)
Optional.empty()
}
private fun createNextcloudClient(user: User): Optional<NextcloudClient> = try {
val context = MainApp.getAppContext()
val factory = OwnCloudClientManagerFactory.getDefaultSingleton()
val client = factory.getNextcloudClientFor(user.toOwnCloudAccount(), context)
Optional.of(client)
} catch (e: Exception) {
Log_OC.e(this, "Could not create client", e)
Optional.empty()
}
}
@@ -51,7 +51,6 @@ import javax.inject.Provider
*
* This class is doing too many things and should be split up into smaller factories.
*/
@Suppress("LongParameterList", "TooManyFunctions") // satisfied by DI
class BackgroundJobFactory @Inject constructor(
private val logger: Logger,
private val preferences: AppPreferences,
@@ -76,7 +75,7 @@ class BackgroundJobFactory @Inject constructor(
) : WorkerFactory() {
@SuppressLint("NewApi")
@Suppress("ComplexMethod") // it's just a trivial dispatch
@Suppress("CyclomaticComplexMethod") // it's just a trivial dispatch
override fun createWorker(
context: Context,
workerClassName: String,
@@ -338,7 +337,6 @@ class BackgroundJobFactory @Inject constructor(
accountManager,
context,
viewThemeUtils.get(),
localBroadcastManager.get(),
params
)
@@ -18,7 +18,6 @@ import com.owncloud.android.operations.DownloadType
* This interface allows to control, schedule and monitor all application
* long-running background tasks, such as periodic checks or synchronization.
*/
@Suppress("TooManyFunctions") // we expect this implementation to have rich API
interface BackgroundJobManager {
/**
@@ -152,7 +151,6 @@ interface BackgroundJobManager {
fun cancelEnqueuedAutoUploads()
fun cancelFilesDownloadJob(accountName: String, fileId: Long)
@Suppress("LongParameterList")
fun startFileDownloadJob(
user: User,
file: OCFile,
@@ -70,7 +70,6 @@ import kotlin.time.Duration.Companion.days
* considered private implementation detail and should not be leaked through the interface, to minimize
* potential migration cost in the future.
*/
@Suppress("TooManyFunctions") // we expect this implementation to have rich API
internal class BackgroundJobManagerImpl(
private val workManager: WorkManager,
private val clock: Clock,
@@ -926,6 +925,8 @@ internal class BackgroundJobManagerImpl(
val request = oneTimeRequestBuilder(FolderDownloadWorker::class, JOB_DOWNLOAD_FOLDER)
.addTag(JOB_DOWNLOAD_FOLDER)
.addTag(FolderDownloadWorker.formatTag(folder.fileId))
.addTag(FolderDownloadWorker.formatParentTag(folder.parentId))
.setInputData(data)
.setConstraints(constraints)
.setExpedited(OutOfQuotaPolicy.RUN_AS_NON_EXPEDITED_WORK_REQUEST)
@@ -32,7 +32,6 @@ class CalendarImportWork(
const val TAG = "CalendarImportWork"
}
@Suppress("TooGenericExceptionCaught")
override fun doWork(): Result {
val calendars = inputData.keyValueMap as? Map<*, *>
if (calendars == null) {
@@ -45,7 +45,6 @@ import java.io.InputStreamReader
import java.util.Calendar
import kotlin.time.Duration.Companion.days
@Suppress("LongParameterList") // legacy code
class ContactsBackupWork(
appContext: Context,
params: WorkerParameters,
@@ -66,7 +65,6 @@ class ContactsBackupWork(
private var operationsServiceConnection: OperationsServiceConnection? = null
private var operationsServiceBinder: OperationsServiceBinder? = null
@Suppress("ReturnCount") // pre-existing issue
override fun doWork(): Result {
val accountName = inputData.getString(KEY_ACCOUNT) ?: ""
if (TextUtils.isEmpty(accountName)) {
@@ -46,7 +46,7 @@ class ContactsImportWork(
const val SELECTED_CONTACTS_FILE_PATH = "selected_contacts_file_path"
}
@Suppress("ComplexMethod", "NestedBlockDepth", "LongMethod", "ReturnCount") // legacy code
@Suppress("CyclomaticComplexMethod", "NestedBlockDepth", "LongMethod") // legacy code
override fun doWork(): Result {
val vCardFilePath = inputData.getString(VCARD_FILE_PATH) ?: ""
val contactsAccountName = inputData.getString(ACCOUNT_NAME)
@@ -69,7 +69,6 @@ class ContactsImportWork(
val vCards = ArrayList<VCard>()
var cursor: Cursor? = null
@Suppress("TooGenericExceptionCaught") // legacy code
try {
val operations = ContactOperations(applicationContext, contactsAccountName, contactsAccountType)
vCards.addAll(Ezvcard.parse(inputStream).all())
@@ -129,7 +128,6 @@ class ContactsImportWork(
return Result.success()
}
@Suppress("TooGenericExceptionCaught")
fun readCheckedContractsFromFile(file: File): IntArray = try {
val fileData = FileUtils.readFileToByteArray(file)
fileData.toIntArray()
@@ -24,7 +24,6 @@ import kotlinx.coroutines.withContext
* It fires media detection worker and auto upload worker and finishes immediately.
*
*/
@Suppress("TooGenericExceptionCaught", "LongParameterList")
class ContentObserverWork(
context: Context,
private val params: WorkerParameters,
@@ -22,7 +22,7 @@ import com.owncloud.android.operations.SynchronizeFolderOperation
import com.owncloud.android.utils.FileStorageUtils
import java.io.File
@Suppress("Detekt.NestedBlockDepth", "ReturnCount", "LongParameterList")
@Suppress("Detekt.NestedBlockDepth")
class InternalTwoWaySyncWork(
private val context: Context,
params: WorkerParameters,
@@ -113,7 +113,6 @@ class InternalTwoWaySyncWork(
super.onStopped()
}
@Suppress("TooGenericExceptionCaught")
private fun checkFreeSpace(folder: OCFile): Result? {
val storagePath = folder.storagePath ?: MainApp.getStoragePath()
val file = File(storagePath)
@@ -48,7 +48,6 @@ import com.owncloud.android.utils.SyncedFolderUtils
import com.owncloud.android.utils.theme.ViewThemeUtils
import java.util.Random
@Suppress("LongParameterList") // dependencies injection
class MediaFoldersDetectionWork(
private val context: Context,
params: WorkerParameters,
@@ -73,7 +72,7 @@ class MediaFoldersDetectionWork(
private val randomIdGenerator = Random(clock.currentTime)
@Suppress("LongMethod", "ComplexMethod", "NestedBlockDepth", "ReturnCount") // legacy code
@Suppress("LongMethod", "CyclomaticComplexMethod", "NestedBlockDepth") // legacy code
override fun doWork(): Result {
val arbitraryDataProvider: ArbitraryDataProvider = ArbitraryDataProviderImpl(context)
val gson = Gson()
@@ -61,7 +61,6 @@ import javax.crypto.BadPaddingException
import javax.crypto.Cipher
import javax.inject.Inject
@Suppress("LongParameterList")
class NotificationWork constructor(
private val context: Context,
params: WorkerParameters,
@@ -82,7 +81,7 @@ class NotificationWork constructor(
private const val NUMERIC_NOTIFICATION_ID = "NUMERIC_NOTIFICATION_ID"
}
@Suppress("TooGenericExceptionCaught", "NestedBlockDepth", "ComplexMethod", "LongMethod") // legacy code
@Suppress("NestedBlockDepth", "CyclomaticComplexMethod", "LongMethod") // legacy code
override fun doWork(): Result {
val subject = inputData.getString(KEY_NOTIFICATION_SUBJECT) ?: ""
val signature = inputData.getString(KEY_NOTIFICATION_SIGNATURE) ?: ""
@@ -252,7 +251,6 @@ class NotificationWork constructor(
}
}
@Suppress("TooGenericExceptionCaught") // legacy code
private fun fetchCompleteNotification(account: User, decryptedPushMessage: DecryptedPushMessage) {
val optionalUser = accountManager.getUser(account.accountName)
if (!optionalUser.isPresent) {
@@ -286,7 +284,7 @@ class NotificationWork constructor(
this.accountManager = accountManager
}
@Suppress("ComplexMethod") // legacy code
@Suppress("CyclomaticComplexMethod") // legacy code
override fun onReceive(context: Context, intent: Intent) {
AndroidInjection.inject(this, context)
val numericNotificationId = intent.getIntExtra(NUMERIC_NOTIFICATION_ID, 0)
@@ -341,7 +339,6 @@ class NotificationWork constructor(
}
}
@Suppress("ReturnCount") // legacy code
private fun executeAction(
actionType: String,
actionLink: String,
@@ -27,7 +27,6 @@ import com.owncloud.android.operations.SynchronizeFileOperation
import com.owncloud.android.utils.FileStorageUtils
import java.io.File
@Suppress("LongParameterList") // Legacy code
class OfflineSyncWork(
private val context: Context,
params: WorkerParameters,
@@ -98,7 +97,6 @@ class OfflineSyncWork(
}
}
// update eTag
@Suppress("TooGenericExceptionCaught") // legacy code
try {
val ocFolder = storageManager.getFileByPath(folderName)
ocFolder.etagOnServer = updatedEtag
@@ -23,7 +23,7 @@ import java.nio.file.Paths
import java.nio.file.SimpleFileVisitor
import java.nio.file.attribute.BasicFileAttributes
@Suppress("TooGenericExceptionCaught", "MagicNumber", "ReturnCount")
@Suppress("MagicNumber")
class AutoUploadHelper(private val repository: FileSystemRepository) {
companion object {
private const val TAG = "AutoUploadHelper"
@@ -57,7 +57,6 @@ import java.io.File
import kotlin.coroutines.cancellation.CancellationException
import kotlin.time.Duration.Companion.milliseconds
@Suppress("LongParameterList", "TooManyFunctions", "TooGenericExceptionCaught")
class AutoUploadWorker(
private val context: Context,
params: WorkerParameters,
@@ -90,7 +89,6 @@ class AutoUploadWorker(
private val overridePowerSaving: Boolean
get() = inputData.getBoolean(OVERRIDE_POWER_SAVING, false)
@Suppress("ReturnCount")
override suspend fun doWork(): Result {
return try {
trySetForeground()
@@ -178,7 +176,6 @@ class AutoUploadWorker(
.setSilent(true)
.build()
@Suppress("TooGenericExceptionCaught")
private fun getStartNotificationTitle(): Pair<String, String>? = try {
val localPath = syncedFolder.localPath
val remotePath = syncedFolder.remotePath
@@ -195,7 +192,6 @@ class AutoUploadWorker(
null
}
@Suppress("ReturnCount")
private fun isBlocked(syncedFolderID: Long): Boolean {
if (powerManagementService.blocksAutoUpload && !overridePowerSaving) {
Log_OC.w(TAG, "⚡ Skipping: device is in power saving mode")
@@ -268,7 +264,7 @@ class AutoUploadWorker(
}
}
@Suppress("LongMethod", "DEPRECATION", "TooGenericExceptionCaught")
@Suppress("LongMethod", "DEPRECATION", "CyclomaticComplexMethod")
private suspend fun uploadFiles(syncedFolder: SyncedFolder) = withContext(Dispatchers.IO) {
val user = getUserOrReturn(syncedFolder) ?: return@withContext
val ocAccount = OwnCloudAccount(user.toPlatformAccount(), context)
@@ -425,7 +421,6 @@ class AutoUploadWorker(
return lastUploadResult in conflictResults && syncedFolder.nameCollisionPolicy != NameCollisionPolicy.ASK_USER
}
@Suppress("ReturnCount")
private fun getEntityResult(
user: User,
localPath: String,
@@ -26,7 +26,7 @@ import java.util.zip.CRC32
import com.nextcloud.utils.AppConstants.BYTES_PER_KB
import com.nextcloud.utils.AppConstants.MILLIS_PER_SECOND
@Suppress("TooGenericExceptionCaught", "NestedBlockDepth", "MagicNumber", "ReturnCount")
@Suppress("NestedBlockDepth", "MagicNumber")
class FileSystemRepository(
private val dao: FileSystemDao,
private val uploadsStorageManager: UploadsStorageManager,
@@ -85,7 +85,6 @@ class SyncFolderHelper(private val context: Context) {
if (MediaFolderType.IMAGE == syncedFolder.type && hasExif(file)) {
Log_OC.d(TAG, "calculateLastModificationTime exif found")
@Suppress("TooGenericExceptionCaught")
try {
val exifInterface = ExifInterface(file.absolutePath)
val exifDate = exifInterface.getAttribute(ExifInterface.TAG_DATETIME)
@@ -22,7 +22,6 @@ class ClipboardClearWorker(private val context: Context, params: WorkerParameter
const val CLIPBOARD_TEXT = "clipboard_text"
}
@Suppress("TooGenericExceptionCaught", "ReturnCount")
override fun doWork(): Result {
try {
val clipboardManager = context.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
@@ -18,7 +18,7 @@ import com.owncloud.android.ui.notifications.NotificationUtils
import com.owncloud.android.utils.theme.ViewThemeUtils
import java.security.SecureRandom
@Suppress("TooManyFunctions", "MagicNumber")
@Suppress("MagicNumber")
class DownloadNotificationManager(id: Int, private val context: Context, viewThemeUtils: ViewThemeUtils) :
WorkerNotificationManager(
id,
@@ -112,7 +112,6 @@ class FileDownloadHelper {
downloadFile(user, file, downloadType = DownloadType.DOWNLOAD)
}
@Suppress("LongParameterList")
fun downloadFile(
user: User,
ocFile: OCFile,
@@ -42,7 +42,6 @@ import java.util.Optional
import java.util.Vector
import kotlin.random.Random
@Suppress("LongParameterList", "TooManyFunctions", "TooGenericExceptionCaught")
class FileDownloadWorker(
viewThemeUtils: ViewThemeUtils,
private val accountManager: UserAccountManager,
@@ -100,7 +99,6 @@ class FileDownloadWorker(
private var downloadError: FileDownloadError? = null
@Suppress("ReturnCount")
override suspend fun doWork(): Result {
return try {
setUser()
@@ -245,7 +243,7 @@ class FileDownloadWorker(
am.addOnAccountsUpdatedListener(this, null, false)
}
@Suppress("TooGenericExceptionCaught", "DEPRECATION")
@Suppress("DEPRECATION")
private suspend fun downloadFile(downloadKey: String) {
currentDownload = pendingDownloads.get(downloadKey)
@@ -88,7 +88,6 @@ class SendShareDownloader(
fileWaitingToSend = savedInstanceState?.getParcelableArgument(KEY_FILE_WAITING_TO_SEND, OCFile::class.java)
}
@Suppress("ReturnCount")
private fun onDownloadCompleted(intent: Intent) {
val waitingToSend = fileWaitingToSend ?: return
@@ -1,49 +0,0 @@
/*
* Nextcloud - Android Client
*
* SPDX-FileCopyrightText: 2026 Alper Ozturk <alper.ozturk@nextcloud.com>
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
package com.nextcloud.client.jobs.folderDownload
import android.content.Context
import android.content.Intent
import androidx.localbroadcastmanager.content.LocalBroadcastManager
import com.owncloud.android.lib.common.utils.Log_OC
class FolderDownloadEventBroadcaster(
private val context: Context,
private val broadcastManager: LocalBroadcastManager
) {
companion object {
private const val TAG = "📣" + "FolderDownloadBroadcastManager"
private const val PREFIX = "com.nextcloud.client.folderDownload."
const val ACTION_DOWNLOAD_ENQUEUED = PREFIX + "ACTION_DOWNLOAD_ENQUEUED"
const val ACTION_DOWNLOAD_COMPLETED = PREFIX + "ACTION_DOWNLOAD_COMPLETED"
const val EXTRA_FILE_ID = PREFIX + "EXTRA_FILE_ID"
}
fun sendDownloadEnqueued(id: Long) {
Log_OC.d(TAG, "Download enqueued broadcast sent")
val intent = Intent(ACTION_DOWNLOAD_ENQUEUED).apply {
putExtra(EXTRA_FILE_ID, id)
}
broadcastManager.sendBroadcast(intent)
}
fun sendDownloadCompleted(id: Long) {
Log_OC.d(TAG, "Download completed broadcast sent")
val intent = Intent(ACTION_DOWNLOAD_COMPLETED).apply {
putExtra(EXTRA_FILE_ID, id)
}
broadcastManager.sendBroadcast(intent)
}
}
@@ -8,12 +8,14 @@
package com.nextcloud.client.jobs.folderDownload
import android.content.Context
import androidx.localbroadcastmanager.content.LocalBroadcastManager
import androidx.work.CoroutineWorker
import androidx.work.ForegroundInfo
import androidx.work.WorkerParameters
import androidx.work.workDataOf
import com.nextcloud.client.account.UserAccountManager
import com.nextcloud.client.jobs.BackgroundJobManagerImpl
import com.nextcloud.client.jobs.download.FileDownloadHelper
import com.nextcloud.utils.AppConstants
import com.owncloud.android.datamodel.FileDataStorageManager
import com.owncloud.android.datamodel.OCFile
import com.owncloud.android.lib.common.OwnCloudClientManagerFactory
@@ -30,12 +32,11 @@ import java.util.concurrent.ConcurrentHashMap
/**
* Only used for downloading files in first level of the folder, not subfolders.
*/
@Suppress("LongMethod", "TooGenericExceptionCaught", "MagicNumber")
@Suppress("LongMethod", "MagicNumber")
class FolderDownloadWorker(
private val accountManager: UserAccountManager,
private val context: Context,
viewThemeUtils: ViewThemeUtils,
localBroadcastManager: LocalBroadcastManager,
params: WorkerParameters
) : CoroutineWorker(context, params) {
@@ -43,15 +44,20 @@ class FolderDownloadWorker(
private const val TAG = "📂" + "FolderDownloadWorker"
const val FOLDER_ID = "FOLDER_ID"
const val ACCOUNT_NAME = "ACCOUNT_NAME"
const val FILE_ID = "FILE_ID"
const val PREVIOUS_FILE_ID = "PREVIOUS_FILE_ID"
const val IS_FOLDER_DOWNLOADED = "IS_FOLDER_DOWNLOADED"
private val pendingDownloads: MutableSet<Long> = ConcurrentHashMap.newKeySet()
fun isDownloading(id: Long): Boolean = pendingDownloads.contains(id)
fun formatTag(folderId: Long): String = BackgroundJobManagerImpl.JOB_DOWNLOAD_FOLDER + folderId
fun formatParentTag(parentId: Long): String =
BackgroundJobManagerImpl.JOB_DOWNLOAD_FOLDER + "_parent_" + parentId
}
private val notificationManager = FolderDownloadWorkerNotificationManager(context, true, viewThemeUtils)
private val folderDownloadEventBroadcaster = FolderDownloadEventBroadcaster(context, localBroadcastManager)
private lateinit var storageManager: FileDataStorageManager
@Suppress("ReturnCount", "DEPRECATION")
@Suppress("DEPRECATION")
override suspend fun doWork(): Result {
val folderID = inputData.getLong(FOLDER_ID, -1)
if (folderID == -1L) {
@@ -82,7 +88,6 @@ class FolderDownloadWorker(
Log_OC.d(TAG, "🕒 started for ${user.accountName} | folder=${folder.fileName}")
trySetForeground(folder)
folderDownloadEventBroadcaster.sendDownloadEnqueued(folder.fileId)
pendingDownloads.add(folder.fileId)
val downloadHelper = FileDownloadHelper.instance()
@@ -100,6 +105,7 @@ class FolderDownloadWorker(
}
var overallSuccess = true
var previousFileId: Long? = null
files.forEachIndexed { index, file ->
if (isStopped) {
@@ -119,6 +125,7 @@ class FolderDownloadWorker(
files.size
)
setProgress(workDataOf(FILE_ID to file.fileId, PREVIOUS_FILE_ID to previousFileId))
val operation = DownloadFileOperation(user, file, context)
val operationResult = operation.execute(client)
@@ -132,6 +139,7 @@ class FolderDownloadWorker(
Log_OC.w(TAG, "⚠️ download failed for ${file.remotePath}: ${operationResult?.logMessage}")
overallSuccess = false
}
previousFileId = file.fileId
}
notificationManager.showCompletionNotification(folder.fileName, overallSuccess)
@@ -148,17 +156,16 @@ class FolderDownloadWorker(
notificationManager.showCompletionNotification(folder.fileName, false)
Result.failure()
} finally {
folderDownloadEventBroadcaster.sendDownloadCompleted(folder.fileId)
pendingDownloads.remove(folder.fileId)
setProgress(workDataOf(IS_FOLDER_DOWNLOADED to true))
// delay so that user can see the error or success notification
delay(2000)
delay(AppConstants.TWO_SECOND)
notificationManager.dismiss()
}
}
}
@Suppress("ReturnCount")
override suspend fun getForegroundInfo(): ForegroundInfo {
return try {
val folderID = inputData.getLong(FOLDER_ID, -1)
@@ -187,12 +194,10 @@ class FolderDownloadWorker(
}
}
private fun getOCFile(operation: DownloadFileOperation): OCFile? = operation.file?.fileId?.let {
storageManager.getFileById(it)
}
?: storageManager.getFileByDecryptedRemotePath(operation.file?.remotePath)
private fun getOCFile(operation: DownloadFileOperation): OCFile? = storageManager.getFileById(operation.file.fileId)
?: storageManager.getFileByDecryptedRemotePath(operation.file.remotePath)
?: run {
Log_OC.e(TAG, "could not resolve OCFile for save: ${operation.file?.remotePath}")
Log_OC.e(TAG, "could not resolve OCFile for save: ${operation.file.remotePath}")
null
}
@@ -8,12 +8,10 @@
package com.nextcloud.client.jobs.gallery
import android.graphics.Bitmap
import android.graphics.Point
import android.media.ThumbnailUtils
import android.os.Build
import android.provider.MediaStore
import android.util.Size
import android.view.WindowManager
import android.widget.ImageView
import com.nextcloud.client.account.User
import com.nextcloud.utils.extensions.getBigThumbnailKey
@@ -21,6 +19,8 @@ import com.nextcloud.utils.extensions.getSmallThumbnail
import com.nextcloud.utils.extensions.isPNG
import com.nextcloud.utils.extensions.setMediaThumbnail
import com.nextcloud.utils.extensions.toFile
import com.nextcloud.utils.thumbnail.ResizedImageGenerator
import com.nextcloud.utils.view.ScreenMetrics
import com.owncloud.android.MainApp
import com.owncloud.android.datamodel.FileDataStorageManager
import com.owncloud.android.datamodel.OCFile
@@ -37,7 +37,7 @@ import kotlinx.coroutines.withContext
import java.util.Collections
import java.util.WeakHashMap
@Suppress("DEPRECATION", "TooGenericExceptionCaught", "ReturnCount")
@Suppress("DEPRECATION")
class GalleryImageGenerationJob(private val user: User, private val storageManager: FileDataStorageManager) {
companion object {
@@ -142,9 +142,7 @@ class GalleryImageGenerationJob(private val user: User, private val storageManag
}
private fun createImageThumbnail(file: OCFile): Bitmap? {
val wm = MainApp.getAppContext().getSystemService(android.content.Context.WINDOW_SERVICE) as WindowManager
val p = Point()
wm.defaultDisplay.getSize(p)
val p = ScreenMetrics.size()
val pxW = p.x
val pxH = p.y
@@ -185,7 +183,7 @@ class GalleryImageGenerationJob(private val user: User, private val storageManag
.getClientFor(user.toOwnCloudAccount(), MainApp.getAppContext())
}
ThumbnailsCacheManager.setClient(client)
ThumbnailsCacheManager.doResizedImageInBackground(file, storageManager)
ResizedImageGenerator.getOrCreate(file, client, storageManager)
} catch (t: Throwable) {
Log_OC.e(TAG, "Server fetch failed for $file", t)
null
@@ -19,7 +19,7 @@ import com.owncloud.android.operations.RefreshFolderOperation
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
@Suppress("DEPRECATION", "ReturnCount", "TooGenericExceptionCaught")
@Suppress("DEPRECATION")
class MetadataWorker(private val context: Context, params: WorkerParameters, private val user: User) :
CoroutineWorker(context, params) {
@@ -57,7 +57,6 @@ class OfflineOperationsWorker(
private val notificationManager = OfflineOperationsNotificationManager(context, viewThemeUtils)
private var repository = OfflineOperationsRepository(fileDataStorageManager)
@Suppress("TooGenericExceptionCaught")
override suspend fun doWork(): Result = withContext(Dispatchers.IO) {
try {
val jobName = inputData.getString(JOB_NAME)
@@ -92,7 +91,6 @@ class OfflineOperationsWorker(
}
// region Handle offline operations
@Suppress("TooGenericExceptionCaught")
private suspend fun processOperations(operations: List<OfflineOperationEntity>, client: OwnCloudClient) {
val totalOperationSize = operations.size
operations.forEachIndexed { index, operation ->
@@ -183,7 +181,7 @@ class OfflineOperationsWorker(
}
// region Operation Execution
@Suppress("ComplexCondition", "LongMethod")
@Suppress("ComplexCondition", "LongMethod", "CyclomaticComplexMethod")
private suspend fun executeOperation(
operation: OfflineOperationEntity,
client: OwnCloudClient
Loaded 100 of 430 files, more files were not shown because too many files have changed in this diff. Show more