Compare commits

...
281 Commits
Author SHA1 Message Date
tobiasKaminsky 001cbdf25f Use CheckEtagRemoteOperation which is faster
Signed-off-by: tobiasKaminsky <[email protected]>
2021-09-29 16:01:40 +02:00
Álvaro Brey 7fd8724473 Drone: update FindBugs results to reflect reduced error/warning count [skip ci]
Signed-off-by: Álvaro Brey <[email protected]>
2021-09-29 12:28:59 +00:00
Álvaro Brey 79864037e4 Merge pull request #8997 from nextcloud/dependabot/gradle/byteBuddyVersion-1.11.18
Bump byteBuddyVersion from 1.11.15 to 1.11.18
2021-09-29 13:25:01 +02:00
Álvaro Brey 132431b6ce Merge pull request #8998 from nextcloud/dependabot/gradle/com.google.android.exoplayer-exoplayer-2.15.1
Bump exoplayer from 2.14.2 to 2.15.1
2021-09-29 13:24:08 +02:00
Álvaro Brey a8ccc283f2 Merge pull request #9008 from nextcloud/dependabot/gradle/androidx.constraintlayout-constraintlayout-2.1.1
Bump constraintlayout from 2.1.0 to 2.1.1
2021-09-29 13:23:39 +02:00
dependabot[bot] ed9e427ed0 Bump exoplayer from 2.14.2 to 2.15.1
Bumps [exoplayer](https://github.com/google/ExoPlayer) from 2.14.2 to 2.15.1.
- [Release notes](https://github.com/google/ExoPlayer/releases)
- [Changelog](https://github.com/google/ExoPlayer/blob/release-v2/RELEASENOTES.md)
- [Commits](https://github.com/google/ExoPlayer/compare/r2.14.2...r2.15.1)

---
updated-dependencies:
- dependency-name: com.google.android.exoplayer:exoplayer
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
2021-09-29 11:08:24 +00:00
Álvaro Brey 120f940a7a Merge pull request #9021 from nextcloud/dependabot/gradle/com.vanniktech-emoji-google-0.8.0
Bump emoji-google from 0.7.0 to 0.8.0
2021-09-29 13:02:44 +02:00
dependabot[bot] e516bda462 Bump constraintlayout from 2.1.0 to 2.1.1
Bumps [constraintlayout](https://github.com/androidx/constraintlayout) from 2.1.0 to 2.1.1.
- [Release notes](https://github.com/androidx/constraintlayout/releases)
- [Commits](https://github.com/androidx/constraintlayout/commits)

---
updated-dependencies:
- dependency-name: androidx.constraintlayout:constraintlayout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
2021-09-29 11:02:05 +00:00
Álvaro Brey 4ec71da7a1 Merge pull request #9032 from nextcloud/reAddRetryTestRule
Re-add retryTestRule
2021-09-29 12:52:51 +02:00
Tobias Kaminsky ecbb64bbba Merge pull request #8831 from hrk/spotbugs-boxed-primitive-for-compare
Fix: boxed primitive for compare
2021-09-29 12:18:03 +02:00
Álvaro Brey Vilas c1092d15c4 EndToEndRandomIT: also add RetryTestRule
Flaaaky

Signed-off-by: Álvaro Brey Vilas <[email protected]>
2021-09-29 09:27:08 +00:00
tobiasKaminsky aee16ec64a Re-add retryTestRule
Signed-off-by: tobiasKaminsky <[email protected]>
2021-09-29 09:27:08 +00:00
Tobias Kaminsky 770369477a Merge pull request #9027 from nextcloud/fix-delete-old-comments-again
scripts/drone: Use deleteOldComments everywhere
2021-09-29 11:25:20 +02:00
Álvaro Brey Vilas 3010bb2977 scripts/drone: Use deleteOldComments everywhere
This removes duplication between deleteOldComments and deleteOutdatedComments.

Additionally, deleteOutdatedComments was broken anyway, and IT/drone test comments were not being deleted.

Signed-off-by: Álvaro Brey Vilas <[email protected]>
2021-09-29 08:30:58 +00:00
Álvaro Brey a4f3268074 Merge pull request #8703 from nextcloud/screenshot
Enhance screenshot handling
2021-09-29 10:29:23 +02:00
tobiasKaminsky a57f8eb989 Enhance screenshot handling
Signed-off-by: tobiasKaminsky <[email protected]>
2021-09-29 09:16:10 +02:00
Nextcloud bot 545197d68c [tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <[email protected]>
2021-09-28 03:57:17 +00:00
dependabot[bot] 7ab9e73e13 Bump emoji-google from 0.7.0 to 0.8.0
Bumps [emoji-google](https://github.com/vanniktech/Emoji) from 0.7.0 to 0.8.0.
- [Release notes](https://github.com/vanniktech/Emoji/releases)
- [Changelog](https://github.com/vanniktech/Emoji/blob/master/CHANGELOG.md)
- [Commits](https://github.com/vanniktech/Emoji/compare/0.7.0...0.8.0)

---
updated-dependencies:
- dependency-name: com.vanniktech:emoji-google
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
2021-09-28 01:05:10 +00:00
Andy Scherzinger cfae25c137 Merge pull request #8818 from binsky08/add-sso-patch-method
add custom PatchMethod class to use http PATCH requests with the Nextcloud SSO api
2021-09-27 12:09:28 +02:00
Tobias Kaminsky 7f9bc4b948 Merge pull request #9014 from nextcloud/hooks-improvement
Minor improvements to git hooks
2021-09-27 12:01:03 +02:00
Álvaro Brey Vilas a38edb92dd Improvements to git hooks
- pre-commit: Suppress all output and show reduced results.
   This is more concise and avoids unreadable errors when committing from an IDE
 - pre-push: Format with shell formatter, fix typo

Signed-off-by: Álvaro Brey Vilas <[email protected]>
2021-09-27 11:42:20 +02:00
Nextcloud bot c5a06b7225 [tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <[email protected]>
2021-09-26 03:58:45 +00:00
Andy Scherzinger 611a3a221b Merge pull request #9002 from nextcloud/git-hooks
Add QOL git hooks and gradle task to install them
2021-09-25 17:31:15 +02:00
Nextcloud bot 5b44ea2408 [tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <[email protected]>
2021-09-25 03:57:30 +00:00
Álvaro Brey Vilas 9a1dfc1627 build.gradle: installGitHooks: add description and group
So it shows up properly in gradle tasks

Signed-off-by: Álvaro Brey Vilas <[email protected]>
2021-09-24 15:13:26 +02:00
Álvaro Brey Vilas 556982ad8b Add simple git hooks and gradle task to install them
- Pre-commit hook checks ktlint and detekt
 - Pre-push hook checks signoff

Signed-off-by: Álvaro Brey Vilas <[email protected]>
2021-09-24 14:07:11 +02:00
Nextcloud bot 27dd912bff [tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <[email protected]>
2021-09-23 04:16:07 +00:00
dependabot[bot] 8f4ec8da18 Bump byteBuddyVersion from 1.11.15 to 1.11.18
Bumps `byteBuddyVersion` from 1.11.15 to 1.11.18.

Updates `byte-buddy` from 1.11.15 to 1.11.18
- [Release notes](https://github.com/raphw/byte-buddy/releases)
- [Changelog](https://github.com/raphw/byte-buddy/blob/master/release-notes.md)
- [Commits](https://github.com/raphw/byte-buddy/compare/byte-buddy-1.11.15...byte-buddy-1.11.18)

Updates `byte-buddy-android` from 1.11.15 to 1.11.18
- [Release notes](https://github.com/raphw/byte-buddy/releases)
- [Changelog](https://github.com/raphw/byte-buddy/blob/master/release-notes.md)
- [Commits](https://github.com/raphw/byte-buddy/compare/byte-buddy-1.11.15...byte-buddy-1.11.18)

---
updated-dependencies:
- dependency-name: net.bytebuddy:byte-buddy
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: net.bytebuddy:byte-buddy-android
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
2021-09-23 01:04:57 +00:00
Nextcloud bot 7a003bcdab [tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <[email protected]>
2021-09-22 03:59:48 +00:00
Timo Triebensky 5e6e3d4800 Merge branch 'master' into add-sso-patch-method 2021-09-21 11:39:25 +02:00
Nextcloud bot ede8995e3b [tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <[email protected]>
2021-09-20 03:56:02 +00:00
Nextcloud bot aa415e6b55 [tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <[email protected]>
2021-09-19 03:56:30 +00:00
Nextcloud bot f1cb45ab30 [tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <[email protected]>
2021-09-18 04:01:05 +00:00
Nextcloud bot 3e6c9627d1 [tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <[email protected]>
2021-09-17 03:55:56 +00:00
Álvaro Brey d8fe4cc0a0 Merge pull request #8967 from nextcloud/fix-delete-snapshot-comments
Fix old screenshot test comments deletion
2021-09-15 15:02:47 +02:00
Nextcloud bot 2866bc3898 [tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <[email protected]>
2021-09-15 03:58:40 +00:00
Álvaro Brey Vilas ab692d92a7 scripts: Fix deleteOldComments.sh
* Get comments from github-actions, not only our android bot
 * Fix count (was broken for 0 comments) and only try to delete if count > 0

Signed-off-by: Álvaro Brey Vilas <[email protected]>
2021-09-14 10:49:07 +02:00
Álvaro Brey Vilas 6c176c4802 deleteOldComments: fix github token var name
Signed-off-by: Álvaro Brey Vilas <[email protected]>
2021-09-14 07:50:24 +00:00
Álvaro Brey Vilas a621e29f18 Revert "scripts: Remove deleteOldComments.sh"
This reverts commit 131373f066.

Signed-off-by: Álvaro Brey Vilas <[email protected]>
2021-09-14 07:50:24 +00:00
Nextcloud bot 70daf0b327 [tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <[email protected]>
2021-09-14 04:03:14 +00:00
Álvaro Brey 9025f6c3ac Merge pull request #8973 from nextcloud/dependabot/gradle/gradle.plugin.com.github.spotbugs.snom-spotbugs-gradle-plugin-4.7.5
Bump spotbugs-gradle-plugin from 4.7.4 to 4.7.5
2021-09-13 15:09:19 +02:00
Álvaro Brey c94311a069 Merge pull request #8972 from nextcloud/dependabot/gradle/com.googlecode.ez-vcard-ez-vcard-0.11.3
Bump ez-vcard from 0.11.2 to 0.11.3
2021-09-13 15:08:51 +02:00
drone 8a59cd9c87 Drone: update FindBugs results to reflect reduced error/warning count [skip ci]
Signed-off-by: drone <noreply@drone>
2021-09-13 09:51:17 +00:00
drone e78893b1f8 Merge commit '7398e64eec72f45ba941f50cbcba67a80d77bce5' 2021-09-13 09:32:18 +00:00
Nextcloud bot 00fa174b38 [tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <[email protected]>
2021-09-13 03:58:38 +00:00
dependabot[bot] 7398e64eec Bump spotbugs-gradle-plugin from 4.7.4 to 4.7.5
Bumps spotbugs-gradle-plugin from 4.7.4 to 4.7.5.

---
updated-dependencies:
- dependency-name: gradle.plugin.com.github.spotbugs.snom:spotbugs-gradle-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
2021-09-13 01:16:53 +00:00
dependabot[bot] 4d746a0176 Bump ez-vcard from 0.11.2 to 0.11.3
Bumps [ez-vcard](https://github.com/mangstadt/ez-vcard) from 0.11.2 to 0.11.3.
- [Release notes](https://github.com/mangstadt/ez-vcard/releases)
- [Commits](https://github.com/mangstadt/ez-vcard/compare/0.11.2...0.11.3)

---
updated-dependencies:
- dependency-name: com.googlecode.ez-vcard:ez-vcard
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
2021-09-13 01:16:32 +00:00
Nextcloud bot 81799410be [tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <[email protected]>
2021-09-12 04:00:37 +00:00
Nextcloud bot a057dafab3 [tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <[email protected]>
2021-09-11 03:57:15 +00:00
Andy Scherzinger bd67dd238e Merge pull request #8965 from nextcloud/Valdnet-patch-1
l10n: Spelling unification
2021-09-10 15:07:40 +02:00
Valdnet eaf9f0ca80 l10n: Spelling unification
Spelling unification in Transifex.

Signed-off-by: Valdnet <[email protected]>
2021-09-10 12:11:47 +02:00
Nextcloud bot 77d0b06105 [tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <[email protected]>
2021-09-10 04:08:54 +00:00
Andy Scherzinger d98427fdc1 Merge pull request #8955 from nextcloud/dependabot/gradle/gradle.plugin.com.github.spotbugs.snom-spotbugs-gradle-plugin-4.7.4
Bump spotbugs-gradle-plugin from 4.7.3 to 4.7.4
2021-09-09 16:02:21 +02:00
dependabot[bot] e5d9b75b4d Bump spotbugs-gradle-plugin from 4.7.3 to 4.7.4
Bumps spotbugs-gradle-plugin from 4.7.3 to 4.7.4.

---
updated-dependencies:
- dependency-name: gradle.plugin.com.github.spotbugs.snom:spotbugs-gradle-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
2021-09-09 12:00:21 +00:00
Andy Scherzinger 865a59336b Merge pull request #8656 from nextcloud/remove-account-from-thumbnail-task
Migrate ThumbnailCacheManager to User model
2021-09-09 13:58:59 +02:00
Nextcloud bot 6517be09df [tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <[email protected]>
2021-09-09 03:57:32 +00:00
drone 50e0cef895 Drone: update FindBugs results to reflect reduced error/warning count [skip ci]
Signed-off-by: drone <noreply@drone>
2021-09-08 10:39:22 +00:00
Chris Narkiewicz f134cf4cd3 Migrate ThumbnailCacheManager to User model
Signed-off-by: Chris Narkiewicz <[email protected]>
2021-09-08 10:39:22 +00:00
Andy Scherzinger bf3a6fb0c3 Merge pull request #8954 from ANUKULJHA1506/master
Update README.md
2021-09-08 12:18:31 +02:00
Tobias Kaminsky 7baa1aa697 Merge pull request #8936 from nextcloud/minor-script-improvements
Minor script improvements
2021-09-08 11:26:17 +02:00
Nextcloud bot c6610937f7 [tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <[email protected]>
2021-09-08 03:54:26 +00:00
ANUKULJHA1506 336c5c84c4 Update README.md 2021-09-07 13:27:47 +05:30
Nextcloud bot 7ad1cce4df [tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <[email protected]>
2021-09-07 03:58:10 +00:00
Andy Scherzinger 0d90e0a94b Merge pull request #8925 from t-m-w/master
Fix opening downloaded files from Documents Provider when offline (#5265)
2021-09-06 16:23:35 +02:00
t-m-w 3fc5be9b07 Fix opening downloaded files when offline (#5265)
Signed-off-by: t-m-w <[email protected]>
2021-09-06 13:26:04 +00:00
Álvaro Brey 85a43e838e Merge pull request #8900 from nextcloud/dependabot/gradle/mockitoVersion-3.12.4
Bump mockitoVersion from 3.11.2 to 3.12.4
2021-09-06 14:12:42 +02:00
dependabot[bot] f7e629da86 Bump mockitoVersion from 3.11.2 to 3.12.4
Bumps `mockitoVersion` from 3.11.2 to 3.12.4.

Updates `mockito-core` from 3.11.2 to 3.12.4
- [Release notes](https://github.com/mockito/mockito/releases)
- [Commits](https://github.com/mockito/mockito/compare/v3.11.2...v3.12.4)

Updates `mockito-android` from 3.11.2 to 3.12.4
- [Release notes](https://github.com/mockito/mockito/releases)
- [Commits](https://github.com/mockito/mockito/compare/v3.11.2...v3.12.4)

---
updated-dependencies:
- dependency-name: org.mockito:mockito-core
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: org.mockito:mockito-android
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
2021-09-06 11:22:15 +00:00
Álvaro Brey Vilas 131373f066 scripts: Remove deleteOldComments.sh
Only used by screenShotTest.yml, but uploadReports.sh already
has a function for the same purpose.

Signed-off-by: Álvaro Brey Vilas <[email protected]>
2021-09-06 12:08:27 +02:00
Álvaro Brey Vilas f3f14bfcc4 scripts:uploadReport: Fix git token usage
Signed-off-by: Álvaro Brey Vilas <[email protected]>
2021-09-06 11:29:46 +02:00
Tobias Kaminsky 33fa8283cf Merge pull request #8933 from nextcloud/test/revert-cotech-hwsecurity
Revert "Bump hwsecurity-fido from 4.1.0 to 4.4.0"
2021-09-06 10:56:40 +02:00
Nextcloud bot 7e1cb0f0df [tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <[email protected]>
2021-09-06 03:57:12 +00:00
Andy Scherzinger 6343afb38d Merge pull request #8939 from nextcloud/Valdnet-patch-1
Change to a capital letter
2021-09-05 18:50:18 +02:00
Valdnet 6a65298699 Change to a capital letter
Signed-off-by: Valdnet <[email protected]>
2021-09-05 13:10:18 +02:00
Nextcloud bot 194ca7885c [tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <[email protected]>
2021-09-05 03:56:23 +00:00
Nextcloud bot fb3957423f [tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <[email protected]>
2021-09-04 03:54:41 +00:00
Álvaro Brey Vilas 47689c938c scripts:uploadReport: Fix github authorization
Signed-off-by: Álvaro Brey Vilas <[email protected]>
2021-09-03 13:09:43 +02:00
Álvaro Brey Vilas 4121cd9e50 androidScreenshotTest: Use full path to emulator
In some systems (like mine) emulator will fail if not called by full path

Signed-off-by: Álvaro Brey Vilas <[email protected]>
2021-09-03 12:37:55 +02:00
Álvaro Brey Vilas 6ab58b7b1a scripts: androidScreenshotTest: Fail on first error
Signed-off-by: Álvaro Brey Vilas <[email protected]>
2021-09-03 12:29:58 +02:00
Álvaro Brey aa897677ac Merge pull request #8934 from nextcloud/shotWorksAgain
Replace Facebook lib to get screenshots again
2021-09-03 11:55:29 +02:00
Tobias KaminskyandÁlvaro Brey Vilas f6fbfbd4c5 Notification buttons enhancement (#8932)
* Show buttons:
two or primary and more option menu

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

* NotificationsActivityIT: fix linting issues

Signed-off-by: Álvaro Brey Vilas <[email protected]>

* Fix kotlin syntax

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

Co-authored-by: Álvaro Brey Vilas <[email protected]>
2021-09-03 11:36:14 +02:00
Álvaro Brey Vilas 9f5db12d13 Downgrade fido version to 4.1.0
This prevents crashes described in https://github.com/nextcloud/android/issues/8585

Signed-off-by: Álvaro Brey Vilas <[email protected]>
2021-09-03 11:23:47 +02:00
tobiasKaminsky a35a6a3417 Revert Shot to get screenshots again
Signed-off-by: tobiasKaminsky <[email protected]>
2021-09-03 07:48:47 +02:00
Tobias Kaminsky fa30776100 Merge pull request #8931 from nextcloud/dependabot/gradle/byteBuddyVersion-1.11.15
Bump byteBuddyVersion from 1.11.12 to 1.11.15
2021-09-03 07:23:05 +02:00
dependabot[bot] 6d39f4963c Bump byteBuddyVersion from 1.11.12 to 1.11.15
Bumps `byteBuddyVersion` from 1.11.12 to 1.11.15.

Updates `byte-buddy` from 1.11.12 to 1.11.15
- [Release notes](https://github.com/raphw/byte-buddy/releases)
- [Changelog](https://github.com/raphw/byte-buddy/blob/master/release-notes.md)
- [Commits](https://github.com/raphw/byte-buddy/compare/byte-buddy-1.11.12...byte-buddy-1.11.15)

Updates `byte-buddy-android` from 1.11.12 to 1.11.15
- [Release notes](https://github.com/raphw/byte-buddy/releases)
- [Changelog](https://github.com/raphw/byte-buddy/blob/master/release-notes.md)
- [Commits](https://github.com/raphw/byte-buddy/compare/byte-buddy-1.11.12...byte-buddy-1.11.15)

---
updated-dependencies:
- dependency-name: net.bytebuddy:byte-buddy
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: net.bytebuddy:byte-buddy-android
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
2021-09-02 12:07:06 +00:00
Tobias Kaminsky 0793f23c0d Merge pull request #8928 from nextcloud/exclude-xpp3
build: Exclude xpp3 dependency from library
2021-09-02 14:05:30 +02:00
Álvaro Brey Vilas ca1d671707 build: Exclude xpp3 dependency from library
Although this dep is excluded in the library itself, Gradle still
includes it because it doesn't respect exclusions for transitive dependencies.
(see https://github.com/gradle/gradle/issues/1473)

This would be okay if it wasn't for the fact that xpp3 forces an old Junit version
that breaks the integration tests.

Signed-off-by: Álvaro Brey Vilas <[email protected]>
2021-09-02 11:18:07 +02:00
Nextcloud bot 03a1c31a86 [tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <[email protected]>
2021-09-02 03:55:14 +00:00
Nextcloud bot 052df0f42c [tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <[email protected]>
2021-09-01 03:54:48 +00:00
Andy Scherzinger 7b1efc7505 Merge pull request #8917 from nextcloud/dependabot/gradle/io.gitlab.arturbosch.detekt-detekt-gradle-plugin-1.18.1
Bump detekt-gradle-plugin from 1.18.0 to 1.18.1
2021-08-31 10:40:44 +02:00
dependabot[bot] 63284e3aa5 Bump detekt-gradle-plugin from 1.18.0 to 1.18.1
Bumps detekt-gradle-plugin from 1.18.0 to 1.18.1.

---
updated-dependencies:
- dependency-name: io.gitlab.arturbosch.detekt:detekt-gradle-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
2021-08-31 01:05:10 +00:00
Tobias Kaminsky 7aeb5e7a9e Merge pull request #8886 from nextcloud/dependabot/gradle/com.google.code.gson-gson-2.8.8
Bump gson from 2.8.7 to 2.8.8
2021-08-30 11:53:04 +02:00
Nextcloud bot 8591733fa6 [tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <[email protected]>
2021-08-27 03:56:32 +00:00
Nextcloud bot 7039208461 [tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <[email protected]>
2021-08-25 03:54:06 +00:00
Nextcloud bot 5eba647fb5 [tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <[email protected]>
2021-08-24 03:55:02 +00:00
Nextcloud bot 337ca8393b [tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <[email protected]>
2021-08-23 03:52:02 +00:00
dependabot[bot] 92d3b9c55b Bump gson from 2.8.7 to 2.8.8
Bumps [gson](https://github.com/google/gson) from 2.8.7 to 2.8.8.
- [Release notes](https://github.com/google/gson/releases)
- [Changelog](https://github.com/google/gson/blob/master/CHANGELOG.md)
- [Commits](https://github.com/google/gson/compare/gson-parent-2.8.7...gson-parent-2.8.8)

---
updated-dependencies:
- dependency-name: com.google.code.gson:gson
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
2021-08-23 01:12:44 +00:00
Nextcloud bot 95e4e8a7a0 [tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <[email protected]>
2021-08-21 03:57:24 +00:00
Nextcloud bot 6b902c68bf [tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <[email protected]>
2021-08-20 03:55:28 +00:00
Andy Scherzinger 4c44358c0f Merge pull request #8868 from nextcloud/dependabot/gradle/gradle.plugin.com.github.spotbugs.snom-spotbugs-gradle-plugin-4.7.3
Bump spotbugs-gradle-plugin from 4.7.2 to 4.7.3
2021-08-19 23:00:26 +02:00
Andy Scherzinger a1700664d2 bump due to spotbugs update
Signed-off-by: Andy Scherzinger <[email protected]>
2021-08-19 21:53:15 +02:00
dependabot[bot] 9c468b3b9f Bump spotbugs-gradle-plugin from 4.7.2 to 4.7.3
Bumps spotbugs-gradle-plugin from 4.7.2 to 4.7.3.

---
updated-dependencies:
- dependency-name: gradle.plugin.com.github.spotbugs.snom:spotbugs-gradle-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
2021-08-19 15:41:30 +00:00
Andy Scherzinger d0266cf6e0 Merge pull request #8871 from nextcloud/changelog-master-stable-3.17.0
Add changelog for 3.17.0
2021-08-19 17:05:45 +02:00
tobiasKaminsky 585a850a54 Add changelog for 3.17.0
Signed-off-by: tobiasKaminsky <[email protected]>
2021-08-19 11:27:29 +02:00
Tobias Kaminsky be4efff7b6 Merge pull request #8861 from alvarobrey/skip-QA-for-forks
CI:skip QA build if keystore pass is not available
2021-08-19 11:06:50 +02:00
Nextcloud bot 9190c3afba [tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <[email protected]>
2021-08-19 08:42:27 +00:00
Nextcloud bot 5589d5eaa1 [tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <[email protected]>
2021-08-19 08:39:27 +00:00
Nextcloud bot b19ee307c9 [tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <[email protected]>
2021-08-19 07:06:30 +00:00
Nextcloud bot dc27330264 [tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <[email protected]>
2021-08-19 06:34:07 +00:00
Nextcloud bot f9813bcdcb [tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <[email protected]>
2021-08-18 03:55:17 +00:00
Andy Scherzinger c006691de8 Merge pull request #8712 from nextcloud/addShareTest
Add shares to folder and check them
2021-08-17 16:08:00 +02:00
Nextcloud bot 3e062a7f8c [tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <[email protected]>
2021-08-16 05:29:21 +00:00
Álvaro Brey 6863a8a637 CI:skip QA build if keystore pass is not available
This is just another step towards green checks on PRs :)

There is no way to skip the whole workflow depending on whether it is
a PR from a fork or not. The only workaround is to check whether secrets are present or not.

So, I've added a step to check if KS_PASS is empty, and set an output depending on that.
If it is empty, we just skip the rest of the steps.

To avoid the `if` repetition, a separate job can be used and then the whole `qa` job can
depend on its outputs. But that would add another "check" in the github UI.

Inspired by https://github.com/nextcloud/android/pull/8791#issuecomment-890524333

Signed-off-by: Álvaro Brey <[email protected]>
2021-08-16 00:42:30 +02:00
Andy Scherzinger b669fa14ad Merge pull request #8854 from nextcloud/dependabot/gradle/io.gitlab.arturbosch.detekt-detekt-gradle-plugin-1.18.0
Bump detekt-gradle-plugin from 1.17.1 to 1.18.0
2021-08-13 18:13:05 +02:00
dependabot[bot] c2182deddf Bump detekt-gradle-plugin from 1.17.1 to 1.18.0
Bumps detekt-gradle-plugin from 1.17.1 to 1.18.0.

---
updated-dependencies:
- dependency-name: io.gitlab.arturbosch.detekt:detekt-gradle-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
2021-08-13 01:07:44 +00:00
binsky f25d85a33e increase SpotBugs to 464 to accept the new PatchMethod class for the SSO api
Signed-off-by: binsky <[email protected]>
2021-08-12 15:50:47 +02:00
Tobias Kaminsky 17d2cec881 Merge pull request #8532 from nextcloud/removed-account-from-text-preview-fragments
Removed Account dependency from preview fragments
2021-08-11 11:44:26 +02:00
Tobias Kaminsky 4bd14b34b0 Merge pull request #8577 from nextcloud/tokenRemoval
Delete app password on account removal
2021-08-11 11:44:15 +02:00
tobiasKaminsky ee14d7e135 Add shares to folder and check them
Signed-off-by: tobiasKaminsky <[email protected]>
2021-08-11 11:43:20 +02:00
Tobias Kaminsky 8090cd0e13 Merge pull request #8833 from nextcloud/fixNPE
catch AccountNotFoundException from createNextcloudClient
2021-08-11 09:10:10 +02:00
Nextcloud bot 44972891c9 [tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <[email protected]>
2021-08-10 04:11:41 +00:00
tobiasKaminsky 00c14377f7 catch AccountNotFoundException from createNextcloudClient
Signed-off-by: tobiasKaminsky <[email protected]>
2021-08-09 08:50:01 +02:00
Nextcloud bot 31d515c66c [tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <[email protected]>
2021-08-09 03:55:52 +00:00
Luca Santarelli f4597d879a Fix: boxed primitive for compare
[Broken Window Theory] As per current SpotBugs report, replace all usages
of boxed Long.compareTo(Long) with Long.compare(long, long)
2021-08-08 23:24:59 +02:00
Andy Scherzinger b23f7b9750 Merge pull request #8822 from nextcloud/dependabot/gradle/com.pinterest-ktlint-0.42.1
Bump ktlint from 0.42.0 to 0.42.1
2021-08-08 21:53:05 +02:00
Nextcloud bot ed87079885 [tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <[email protected]>
2021-08-08 03:51:01 +00:00
binsky 238c7d610d add license header, clear comments in PatchMethod class
Signed-off-by: binsky <[email protected]>
2021-08-06 22:06:16 +02:00
dependabot[bot] 3f176674b2 Bump ktlint from 0.42.0 to 0.42.1
Bumps [ktlint](https://github.com/pinterest/ktlint) from 0.42.0 to 0.42.1.
- [Release notes](https://github.com/pinterest/ktlint/releases)
- [Changelog](https://github.com/pinterest/ktlint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pinterest/ktlint/compare/0.42.0...0.42.1)

---
updated-dependencies:
- dependency-name: com.pinterest:ktlint
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
2021-08-06 19:24:18 +00:00
Andy Scherzinger cfa12f3c59 Merge pull request #8638 from nextcloud/dependabot/gradle/tools.fastlane-screengrab-2.1.0
Bump screengrab from 2.0.0 to 2.1.0
2021-08-06 21:23:10 +02:00
Andy Scherzinger d46dfa8ded ktlint: reformat kotlin
Signed-off-by: Andy Scherzinger <[email protected]>
2021-08-06 16:05:50 +02:00
dependabot[bot] c521a875ae Bump screengrab from 2.0.0 to 2.1.0
Bumps [screengrab](https://github.com/fastlane/fastlane) from 2.0.0 to 2.1.0.
- [Release notes](https://github.com/fastlane/fastlane/releases)
- [Commits](https://github.com/fastlane/fastlane/compare/2.0.0...2.1.0)

---
updated-dependencies:
- dependency-name: tools.fastlane:screengrab
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
2021-08-06 12:27:20 +00:00
Andy Scherzinger e4d06418ce Merge pull request #8641 from nextcloud/bumpDroneServer
Use NC 21 for drone
2021-08-06 14:26:35 +02:00
Tobias Kaminsky 27b808d8cd Merge pull request #8742 from nextcloud/dependabot/gradle/mockitoVersion-3.11.2
Bump mockitoVersion from 3.11.0 to 3.11.2
2021-08-06 11:38:49 +02:00
Tobias Kaminsky eceb3a13d4 Merge pull request #8365 from af7567/notifications
Use unique requestcode for notification PendingIntents
2021-08-06 11:25:49 +02:00
tobiasKaminsky cd10e2db15 Delete app password on account removal
Signed-off-by: tobiasKaminsky <[email protected]>
2021-08-06 11:21:37 +02:00
Chris Narkiewicz 0e71f05931 Removed Account dependency from preview fragments
Remove Account dependency in text preview fragment.
Remove Account dependency from outdated JavaDoc in
image and video preview fragments.

Signed-off-by: Chris Narkiewicz <[email protected]>
2021-08-06 08:26:58 +00:00
Tobias Kaminsky 4a5fc357c8 Merge pull request #8737 from hrk/patch-1
Avoid redundant call to getConnectivity()
2021-08-06 10:23:17 +02:00
tobiasKaminsky 8f176cb46f Use NC 21 for drone
Signed-off-by: tobiasKaminsky <[email protected]>
2021-08-06 08:15:52 +00:00
dependabot[bot] e6074c918f Bump mockitoVersion from 3.11.0 to 3.11.2
Bumps `mockitoVersion` from 3.11.0 to 3.11.2.

Updates `mockito-core` from 3.11.0 to 3.11.2
- [Release notes](https://github.com/mockito/mockito/releases)
- [Commits](https://github.com/mockito/mockito/compare/v3.11.0...v3.11.2)

Updates `mockito-android` from 3.11.0 to 3.11.2
- [Release notes](https://github.com/mockito/mockito/releases)
- [Commits](https://github.com/mockito/mockito/compare/v3.11.0...v3.11.2)

---
updated-dependencies:
- dependency-name: org.mockito:mockito-core
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.mockito:mockito-android
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
2021-08-06 08:11:17 +00:00
Tobias Kaminsky d2df21af34 Merge pull request #8749 from nextcloud/dependabot/gradle/androidx.fragment-fragment-ktx-1.3.6
Bump fragment-ktx from 1.3.4 to 1.3.6
2021-08-06 10:10:03 +02:00
Tobias Kaminsky 299fb77f15 Merge pull request #8807 from nextcloud/dependabot/gradle/androidx.exifinterface-exifinterface-1.3.3
Bump exifinterface from 1.3.2 to 1.3.3
2021-08-06 10:09:34 +02:00
Tobias Kaminsky 5f652ba81c Merge pull request #8821 from nextcloud/dependabot/gradle/byteBuddyVersion-1.11.12
Bump byteBuddyVersion from 1.11.2 to 1.11.12
2021-08-06 09:39:44 +02:00
Tobias Kaminsky edf693ce7d Merge pull request #8819 from nextcloud/dependabot/gradle/com.karumi-shot-5.11.2
Bump shot from 5.11.1 to 5.11.2
2021-08-06 07:24:32 +02:00
dependabot[bot] 38b84562ad Bump byteBuddyVersion from 1.11.2 to 1.11.12
Bumps `byteBuddyVersion` from 1.11.2 to 1.11.12.

Updates `byte-buddy` from 1.11.2 to 1.11.12
- [Release notes](https://github.com/raphw/byte-buddy/releases)
- [Changelog](https://github.com/raphw/byte-buddy/blob/master/release-notes.md)
- [Commits](https://github.com/raphw/byte-buddy/compare/byte-buddy-1.11.2...byte-buddy-1.11.12)

Updates `byte-buddy-android` from 1.11.2 to 1.11.12
- [Release notes](https://github.com/raphw/byte-buddy/releases)
- [Changelog](https://github.com/raphw/byte-buddy/blob/master/release-notes.md)
- [Commits](https://github.com/raphw/byte-buddy/compare/byte-buddy-1.11.2...byte-buddy-1.11.12)

---
updated-dependencies:
- dependency-name: net.bytebuddy:byte-buddy
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: net.bytebuddy:byte-buddy-android
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
2021-08-06 05:24:12 +00:00
dependabot[bot] 97e958f7f5 Bump exifinterface from 1.3.2 to 1.3.3
Bumps exifinterface from 1.3.2 to 1.3.3.

---
updated-dependencies:
- dependency-name: androidx.exifinterface:exifinterface
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
2021-08-06 05:23:50 +00:00
Tobias Kaminsky 17a26ba3ef Merge pull request #8748 from nextcloud/dependabot/gradle/com.google.android.exoplayer-exoplayer-2.14.2
Bump exoplayer from 2.13.2 to 2.14.2
2021-08-06 07:22:59 +02:00
Nextcloud bot a75dde5283 [tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <[email protected]>
2021-08-06 04:03:50 +00:00
dependabot[bot] e6a63f8445 Bump shot from 5.11.1 to 5.11.2
Bumps [shot](https://github.com/karumi/shot) from 5.11.1 to 5.11.2.
- [Release notes](https://github.com/karumi/shot/releases)
- [Commits](https://github.com/karumi/shot/compare/5.11.1...5.11.2)

---
updated-dependencies:
- dependency-name: com.karumi:shot
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
2021-08-06 01:04:12 +00:00
binsky 55bdbc1f55 add custom PatchMethod class to use http PATCH requests with the Nextcloud SSO api
Signed-off-by: binsky <[email protected]>
2021-08-06 02:24:13 +02:00
dependabot[bot] c23ffe93a6 Bump exoplayer from 2.13.2 to 2.14.2
Bumps [exoplayer](https://github.com/google/ExoPlayer) from 2.13.2 to 2.14.2.
- [Release notes](https://github.com/google/ExoPlayer/releases)
- [Changelog](https://github.com/google/ExoPlayer/blob/release-v2/RELEASENOTES.md)
- [Commits](https://github.com/google/ExoPlayer/compare/r2.13.2...r2.14.2)

---
updated-dependencies:
- dependency-name: com.google.android.exoplayer:exoplayer
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
2021-08-05 13:16:27 +00:00
Tobias Kaminsky 7eff86cd3d Merge pull request #8812 from nextcloud/bumpFindbugs
Somehow SpotBugs needs to be on 462.
2021-08-05 15:11:13 +02:00
tobiasKaminsky 947d0c5115 Somehow SpotBugs needs to be on 462.
Signed-off-by: tobiasKaminsky <[email protected]>
2021-08-05 15:02:46 +02:00
Tobias Kaminsky 709ee086a1 Merge pull request #8809 from nextcloud/fixSSOtest
Fix SSO test
2021-08-05 10:18:12 +02:00
tobiasKaminsky dd46ce928c Fix SSO test
Signed-off-by: tobiasKaminsky <[email protected]>
2021-08-05 09:41:34 +02:00
Tobias Kaminsky 6ca7c9d05f Merge pull request #8776 from nextcloud/dependabot/gradle/daggerVersion-2.38.1
Bump daggerVersion from 2.36 to 2.38.1
2021-08-05 08:52:38 +02:00
Tobias Kaminsky b3d499a8fc Merge pull request #8798 from nextcloud/dependabot/gradle/androidx.constraintlayout-constraintlayout-2.1.0
Bump constraintlayout from 2.0.4 to 2.1.0
2021-08-05 08:52:00 +02:00
Tobias Kaminsky 5b2398bf0c Merge pull request #7995 from nextcloud/parameterV2
SSO: support of parameter v2, which allows to have multiple values for same key
2021-08-05 07:59:21 +02:00
Nextcloud bot 8b0a8b27ac [tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <[email protected]>
2021-08-04 03:55:43 +00:00
Tobias Kaminsky 1e84999b35 Merge pull request #8801 from nextcloud/feat/workflow-auto-update-command-rebase.yml
Updating command-rebase.yml workflow from template
2021-08-03 07:13:10 +02:00
Nextcloud bot 08b2b481fe Updating command-rebase.yml workflow from template
Signed-off-by: Nextcloud bot <[email protected]>
2021-08-02 08:44:35 +00:00
Tobias Kaminsky 7f995726b3 Merge pull request #8791 from alvarobrey/fix-connectedTest-crashes
Fix connected test crashes
2021-08-02 08:56:17 +02:00
dependabot[bot] e86ee266d6 Bump constraintlayout from 2.0.4 to 2.1.0
Bumps [constraintlayout](https://github.com/androidx/constraintlayout) from 2.0.4 to 2.1.0.
- [Release notes](https://github.com/androidx/constraintlayout/releases)
- [Commits](https://github.com/androidx/constraintlayout/compare/2.0.4...2.1.0)

---
updated-dependencies:
- dependency-name: androidx.constraintlayout:constraintlayout
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
2021-08-02 01:12:51 +00:00
Nextcloud bot a4ad5848ff [tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <[email protected]>
2021-08-01 03:29:50 +00:00
Álvaro Brey f13ebd3abb Replace server and server.com with an invalid domain everywhere.
This should fix the timeout crashes in screenshot tests.
This also speeds up integration tests significantly, as the resolution fails
immediately, in contrast to the timeout for server.com.

As a bonus, we don't ping server.com from our IPs when running tests :)

I've chosen nextcloud.localhost for a fake domain, but suggestions are welcome.

Signed-off-by: Álvaro Brey <[email protected]>
2021-07-31 18:24:11 +02:00
Álvaro Brey 6f212de7ea androidTest: DialogFragmentIT: remove unneeded shortSleep in @Before
Leftover from testing

Signed-off-by: Álvaro Brey <[email protected]>
2021-07-31 18:24:11 +02:00
Álvaro Brey 2dbf0a313c androidTest: DialogFragmentIT: fix process crash when running tests
This involved:
 1. quitting the opened loopers
 2. force-setting tokens to prevent a NullPointerException in createNextcloudClient,
which also crashed the process because it was in an AsyncTask.

Signed-off-by: Álvaro Brey <[email protected]>
2021-07-31 18:24:11 +02:00
Álvaro Brey ece95ef2c0 SettingsActivityIT: fix crash due to unclosed looper
Signed-off-by: Álvaro Brey <[email protected]>
2021-07-31 18:24:11 +02:00
dependabot[bot] 9b8d85d160 Bump daggerVersion from 2.36 to 2.38.1
Bumps `daggerVersion` from 2.36 to 2.38.1.

Updates `dagger` from 2.36 to 2.38.1
- [Release notes](https://github.com/google/dagger/releases)
- [Changelog](https://github.com/google/dagger/blob/master/CHANGELOG.md)
- [Commits](https://github.com/google/dagger/compare/dagger-2.36...dagger-2.38.1)

Updates `dagger-android` from 2.36 to 2.38.1
- [Release notes](https://github.com/google/dagger/releases)
- [Changelog](https://github.com/google/dagger/blob/master/CHANGELOG.md)
- [Commits](https://github.com/google/dagger/compare/dagger-2.36...dagger-2.38.1)

Updates `dagger-android-support` from 2.36 to 2.38.1
- [Release notes](https://github.com/google/dagger/releases)
- [Changelog](https://github.com/google/dagger/blob/master/CHANGELOG.md)
- [Commits](https://github.com/google/dagger/compare/dagger-2.36...dagger-2.38.1)

Updates `dagger-compiler` from 2.36 to 2.38.1
- [Release notes](https://github.com/google/dagger/releases)
- [Changelog](https://github.com/google/dagger/blob/master/CHANGELOG.md)
- [Commits](https://github.com/google/dagger/compare/dagger-2.36...dagger-2.38.1)

Updates `dagger-android-processor` from 2.36 to 2.38.1
- [Release notes](https://github.com/google/dagger/releases)
- [Changelog](https://github.com/google/dagger/blob/master/CHANGELOG.md)
- [Commits](https://github.com/google/dagger/compare/dagger-2.36...dagger-2.38.1)

---
updated-dependencies:
- dependency-name: com.google.dagger:dagger
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: com.google.dagger:dagger-android
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: com.google.dagger:dagger-android-support
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: com.google.dagger:dagger-compiler
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: com.google.dagger:dagger-android-processor
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
2021-07-30 21:31:43 +00:00
Andy Scherzinger 4332636d78 Merge pull request #8788 from nextcloud/dependabot/gradle/com.pinterest-ktlint-0.42.0
Bump ktlint from 0.41.0 to 0.42.0
2021-07-30 23:26:21 +02:00
Tobias Kaminsky 412c5219ea Merge pull request #8779 from nextcloud/fixLogin
Pass user info result upon success
2021-07-30 13:25:51 +02:00
dependabot[bot] f9dae6030b Bump ktlint from 0.41.0 to 0.42.0
Bumps [ktlint](https://github.com/pinterest/ktlint) from 0.41.0 to 0.42.0.
- [Release notes](https://github.com/pinterest/ktlint/releases)
- [Changelog](https://github.com/pinterest/ktlint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/pinterest/ktlint/compare/0.41.0...0.42.0)

---
updated-dependencies:
- dependency-name: com.pinterest:ktlint
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
2021-07-30 09:51:12 +00:00
Andy Scherzinger dc23baa68f Merge pull request #8787 from nextcloud/dependabot/gradle/com.karumi-shot-5.11.1
Bump shot from 5.11.0 to 5.11.1
2021-07-30 11:49:35 +02:00
Nextcloud bot 7f1f295899 [tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <[email protected]>
2021-07-30 03:26:58 +00:00
dependabot[bot] a18f6c2fbf Bump shot from 5.11.0 to 5.11.1
Bumps [shot](https://github.com/karumi/shot) from 5.11.0 to 5.11.1.
- [Release notes](https://github.com/karumi/shot/releases)
- [Commits](https://github.com/karumi/shot/compare/5.11.0...5.11.1)

---
updated-dependencies:
- dependency-name: com.karumi:shot
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
2021-07-30 01:03:57 +00:00
Nextcloud bot b0538c5967 [tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <[email protected]>
2021-07-29 03:25:25 +00:00
tobiasKaminsky f5b8bcd906 Pass user info result upon success
Signed-off-by: tobiasKaminsky <[email protected]>
2021-07-28 11:17:12 +02:00
Nextcloud bot bbbccd5987 [tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <[email protected]>
2021-07-28 03:28:19 +00:00
Nextcloud bot 0fcf49beaa [tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <[email protected]>
2021-07-27 03:26:47 +00:00
Nextcloud bot ac05b03bae [tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <[email protected]>
2021-07-26 03:27:48 +00:00
Andy Scherzinger 00327e27b7 Merge pull request #8722 from nextcloud/dependabot/gradle/com.karumi-shot-5.11.0
Bump shot from 5.10.3 to 5.11.0
2021-07-25 17:29:01 +02:00
Andy Scherzinger aea0f28887 explicitely add facedbook-screenshot dependencies
Signed-off-by: Andy Scherzinger <[email protected]>
2021-07-25 13:20:55 +02:00
dependabot[bot] 20555e7a88 Bump shot from 5.10.3 to 5.11.0
Bumps [shot](https://github.com/karumi/shot) from 5.10.3 to 5.11.0.
- [Release notes](https://github.com/karumi/shot/releases)
- [Commits](https://github.com/karumi/shot/compare/5.10.3...5.11.0)

---
updated-dependencies:
- dependency-name: com.karumi:shot
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
2021-07-25 10:47:24 +00:00
Andy Scherzinger b8238ca430 Merge pull request #8765 from nextcloud/dependabot/gradle/androidx.appcompat-appcompat-1.3.1
Bump appcompat from 1.3.0 to 1.3.1
2021-07-25 12:40:15 +02:00
Andy Scherzinger e33666b863 Merge pull request #8752 from nextcloud/fixComment
Fix exception when running CommentFileOperation
2021-07-25 10:52:12 +02:00
dependabot[bot] b583953bb2 Bump appcompat from 1.3.0 to 1.3.1
Bumps appcompat from 1.3.0 to 1.3.1.

---
updated-dependencies:
- dependency-name: androidx.appcompat:appcompat
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
2021-07-24 22:21:28 +00:00
tobiasKaminsky ffcad70c12 Fix exception when running CommentFileOperation
Signed-off-by: tobiasKaminsky <[email protected]>
2021-07-25 00:19:18 +02:00
Andy Scherzinger 28a8ee99a6 Merge pull request #8738 from nextcloud/updateBc169
Update bouncycastle to 1.69
2021-07-25 00:18:45 +02:00
Andy Scherzinger feb187b291 Merge pull request #8756 from nextcloud/explicitFDSM
For SyncOperation FileDataStorageManager is required
2021-07-24 20:17:17 +02:00
Andy Scherzinger e95c94939b Drone: update FindBugs results to reflect reduced error/warning count [skip ci]
Signed-off-by: Andy Scherzinger <[email protected]>
2021-07-24 15:23:44 +02:00
tobiasKaminsky 02eb42e42a For SyncOperation FileDataStorageManager is required, therefore this is now part of constructor, whereas it before was only part of .execute()
Signed-off-by: tobiasKaminsky <[email protected]>
2021-07-24 15:22:59 +02:00
Andy Scherzinger dcfef5754f Merge pull request #8758 from nextcloud/davChanges
Use new dav
2021-07-24 15:16:34 +02:00
Andy Scherzinger 2be7b3b4dd Merge pull request #8761 from alvarobrey/patch/clean-submodules-info
Remove .gitmodules and references to submodules in SETUP.md
2021-07-24 15:01:29 +02:00
Nextcloud bot dbf433ca69 [tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <[email protected]>
2021-07-24 03:32:05 +00:00
Álvaro Brey aa36056261 Remove .gitmodules and references to submodules in SETUP.md
While setting up a clone of this repo I noticed that .gitmodules was empty
and that no submodules were being used. However, SETUP.md still referenced them.

This commit cleans that up. The empty .gitmodules is deleted and the references
to modules in SETUP are deleted too.
2021-07-24 00:15:40 +02:00
tobiasKaminsky 3805692fd7 Use new dav
Signed-off-by: tobiasKaminsky <[email protected]>
2021-07-23 10:33:05 +02:00
Tobias Kaminsky a66a7e4d9c Merge pull request #8670 from nextcloud/fixSearchTests
Fix tests
2021-07-23 10:31:49 +02:00
Tobias Kaminsky 7dd08fb74c Merge pull request #8759 from nextcloud/fastlaneUpdate
Update bundle for Fastlane
2021-07-23 07:06:39 +02:00
tobiasKaminsky 70218cc7b0 Update bundle for Fastlane
Signed-off-by: tobiasKaminsky <[email protected]>
2021-07-23 07:06:12 +02:00
Nextcloud bot cbd36eb47e [tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <[email protected]>
2021-07-23 03:28:24 +00:00
Andy Scherzinger 18e5edbf4f Merge pull request #8754 from nextcloud/Valdnet-patch-1
Change to uppercase
2021-07-22 13:08:10 +02:00
Valdnet 3d5df69570 Change to uppercase 2021-07-22 10:36:43 +02:00
tobiasKaminsky 870e979f12 Correctly return exit code
Signed-off-by: tobiasKaminsky <[email protected]>
2021-07-22 07:40:54 +02:00
tobiasKaminsky 8ac7d46e0f Correctly return exit code
Signed-off-by: tobiasKaminsky <[email protected]>
2021-07-22 07:40:20 +02:00
tobiasKaminsky 706beabdc9 Fix tests
Signed-off-by: tobiasKaminsky <[email protected]>
2021-07-22 07:40:18 +02:00
Nextcloud bot 6f2ea735a0 [tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <[email protected]>
2021-07-22 03:30:08 +00:00
dependabot[bot] cf9e190399 Bump fragment-ktx from 1.3.4 to 1.3.6
Bumps fragment-ktx from 1.3.4 to 1.3.6.

---
updated-dependencies:
- dependency-name: androidx.fragment:fragment-ktx
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
2021-07-22 01:05:39 +00:00
Tobias Kaminsky 29d6edc634 Merge pull request #8739 from nextcloud/fixDocumentsTest
Fix test for DocumentsStorageProvider
2021-07-21 09:36:25 +02:00
tobiasKaminsky dadb52e364 Fix test for DocumentsStorageProvider
Signed-off-by: tobiasKaminsky <[email protected]>
2021-07-21 06:45:47 +00:00
Tobias Kaminsky e47c4a7758 Merge pull request #8711 from nextcloud/deleteoutdatedComments
Delete outdated comments before running
2021-07-21 08:44:25 +02:00
Andy Scherzinger f3dd13c7c6 update bouncycastle to 1.69
Signed-off-by: Andy Scherzinger <[email protected]>
2021-07-21 06:37:27 +00:00
Tobias Kaminsky 3fef7044c3 Merge pull request #8740 from nextcloud/storageTest
Fix test for FileDataStorageManager
2021-07-21 08:32:44 +02:00
tobiasKaminsky c3846b7d25 Fix test for FileDataStorageManager
Signed-off-by: tobiasKaminsky <[email protected]>
2021-07-21 06:01:11 +00:00
Tobias Kaminsky e39379580d Merge pull request #8741 from nextcloud/revertMockitoBump
Mockito 3.11.2 seems to have trouble for us, therefore reverting
2021-07-21 07:59:51 +02:00
tobiasKaminsky 7748306083 Mockito 3.11.2 seems to have trouble for us, therefore reverting
Signed-off-by: tobiasKaminsky <[email protected]>
2021-07-21 07:37:26 +02:00
Luca Santarelli c7ca196631 Avoid redundant call to getConnectivity()
[Broken Windows Theory] avoid calling getConnectivity() a second time, since the object is still fresh in the else branch of the check for WiFi.
2021-07-20 09:03:18 +02:00
Nextcloud bot 092b605b4a [tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <[email protected]>
2021-07-19 06:37:00 +00:00
Andy Scherzinger cc1e1fbd63 Merge pull request #8726 from nextcloud/fix-npe-in-fda-last-displayed-user
Initialize last displayed user to correct empty Optional in FileDisplayActivity
2021-07-18 01:34:02 +02:00
Chris Narkiewicz 3745201b54 Initialize last displayed user to correct empty Optional in FileDisplayActivity
Fixes #8725

Signed-off-by: Chris Narkiewicz <[email protected]>
2021-07-17 23:46:51 +01:00
Andy Scherzinger 9d4d26b5f9 Merge pull request #8724 from nextcloud/dependabot/gradle/com.google.android.material-material-1.4.0
Bump material from 1.3.0 to 1.4.0
2021-07-18 00:24:20 +02:00
dependabot[bot] 1a1cef9860 Bump material from 1.3.0 to 1.4.0
Bumps [material](https://github.com/material-components/material-components-android) from 1.3.0 to 1.4.0.
- [Release notes](https://github.com/material-components/material-components-android/releases)
- [Commits](https://github.com/material-components/material-components-android/compare/1.3.0...1.4.0)

---
updated-dependencies:
- dependency-name: com.google.android.material:material
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
2021-07-17 21:56:42 +00:00
Andy Scherzinger 240c1b5003 Merge pull request #8723 from nextcloud/dependabot/gradle/androidx.test-runner-1.4.0
Bump runner from 1.3.0 to 1.4.0
2021-07-17 23:55:20 +02:00
Andy Scherzinger eba8e93177 unify androidx.test version
Signed-off-by: Andy Scherzinger <[email protected]>
2021-07-17 23:12:29 +02:00
dependabot[bot] b0f5857545 Bump runner from 1.3.0 to 1.4.0
Bumps runner from 1.3.0 to 1.4.0.

---
updated-dependencies:
- dependency-name: androidx.test:runner
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
2021-07-17 23:12:29 +02:00
Andy Scherzinger 442791200b Merge pull request #8717 from nextcloud/dependabot/gradle/gradle.plugin.com.github.spotbugs.snom-spotbugs-gradle-plugin-4.7.2
Bump spotbugs-gradle-plugin from 4.7.1 to 4.7.2
2021-07-17 23:05:24 +02:00
Andy Scherzinger c3971575e0 Merge pull request #8721 from nextcloud/dependabot/gradle/androidx.test.ext-junit-1.1.3
Bump junit from 1.1.2 to 1.1.3
2021-07-17 23:05:00 +02:00
dependabot[bot] 17d7910e40 Bump junit from 1.1.2 to 1.1.3
Bumps junit from 1.1.2 to 1.1.3.

---
updated-dependencies:
- dependency-name: androidx.test.ext:junit
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
2021-07-17 20:42:12 +00:00
Andy Scherzinger a0fce98f85 Merge pull request #8511 from nextcloud/migrate-uploads-storage-manager-to-user
Remove Account from UploadsStorageManager
2021-07-17 22:41:16 +02:00
Andy Scherzinger 75582183e0 Merge pull request #8720 from nextcloud/dependabot/gradle/androidx.test-orchestrator-1.4.0
Bump orchestrator from 1.3.0 to 1.4.0
2021-07-17 22:40:14 +02:00
dependabot[bot] 7e13dc899c Bump orchestrator from 1.3.0 to 1.4.0
Bumps orchestrator from 1.3.0 to 1.4.0.

---
updated-dependencies:
- dependency-name: androidx.test:orchestrator
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
2021-07-17 20:38:19 +00:00
Andy Scherzinger 4eb2b49e02 Merge pull request #8718 from nextcloud/dependabot/gradle/com.android.tools.build-gradle-4.2.2
Bump gradle from 4.2.1 to 4.2.2
2021-07-17 22:37:51 +02:00
Andy Scherzinger be1a52a813 bump spotbugs score
Signed-off-by: Andy Scherzinger <[email protected]>
2021-07-17 22:33:02 +02:00
Andy Scherzinger b7bfdc89e2 Merge pull request #8719 from nextcloud/dependabot/gradle/androidx.test-rules-1.4.0
Bump rules from 1.3.0 to 1.4.0
2021-07-17 22:30:03 +02:00
dependabot[bot] d8fcea59c8 Bump rules from 1.3.0 to 1.4.0
Bumps rules from 1.3.0 to 1.4.0.

---
updated-dependencies:
- dependency-name: androidx.test:rules
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
2021-07-17 18:43:45 +00:00
dependabot[bot] c49b37847d Bump gradle from 4.2.1 to 4.2.2
Bumps gradle from 4.2.1 to 4.2.2.

---
updated-dependencies:
- dependency-name: com.android.tools.build:gradle
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
2021-07-17 18:43:42 +00:00
Andy Scherzinger 9d236a4991 Merge pull request #8613 from nextcloud/dependabot/gradle/mockitoVersion-3.11.2
Bump mockitoVersion from 3.11.0 to 3.11.2
2021-07-17 20:43:18 +02:00
dependabot[bot] b8eb775989 Bump mockitoVersion from 3.11.0 to 3.11.2
Bumps `mockitoVersion` from 3.11.0 to 3.11.2.

Updates `mockito-core` from 3.11.0 to 3.11.2
- [Release notes](https://github.com/mockito/mockito/releases)
- [Commits](https://github.com/mockito/mockito/compare/v3.11.0...v3.11.2)

Updates `mockito-android` from 3.11.0 to 3.11.2
- [Release notes](https://github.com/mockito/mockito/releases)
- [Commits](https://github.com/mockito/mockito/compare/v3.11.0...v3.11.2)

---
updated-dependencies:
- dependency-name: org.mockito:mockito-core
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.mockito:mockito-android
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
2021-07-17 17:18:25 +00:00
dependabot[bot] 8ff31550f6 Bump spotbugs-gradle-plugin from 4.7.1 to 4.7.2
Bumps spotbugs-gradle-plugin from 4.7.1 to 4.7.2.

---
updated-dependencies:
- dependency-name: gradle.plugin.com.github.spotbugs.snom:spotbugs-gradle-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
2021-07-17 17:18:00 +00:00
Andy Scherzinger 035354535a Merge pull request #8715 from nextcloud/dependabot/gradle/androidx.test-core-1.4.0
Bump core from 1.3.0 to 1.4.0
2021-07-17 19:17:36 +02:00
dependabot[bot] 4e8aed0436 Bump core from 1.3.0 to 1.4.0
Bumps core from 1.3.0 to 1.4.0.

---
updated-dependencies:
- dependency-name: androidx.test:core
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
2021-07-17 16:35:44 +00:00
Andy Scherzinger d6a5e8a40a Merge pull request #8516 from nextcloud/RessourceIDs
Replace Butterknife with native view bindings
2021-07-17 18:34:51 +02:00
Andy Scherzinger 8516e6a4d5 Drone: update Lint results to reflect reduced error/warning count [skip ci]
Signed-off-by: Andy Scherzinger <[email protected]>
2021-07-17 16:52:25 +02:00
Andy Scherzinger 2535103a73 remove break due to rebase
Signed-off-by: Andy Scherzinger <[email protected]>
2021-07-17 14:16:41 +02:00
Andy Scherzinger c9beb66272 Update WebView
Signed-off-by: Andy Scherzinger <[email protected]>
2021-07-17 14:16:41 +02:00
Andy Scherzinger 10a6e519cb Drone: update Lint/spotbugs results to reflect reduced error/warning count [skip ci]
Signed-off-by: Andy Scherzinger <[email protected]>
2021-07-17 14:16:40 +02:00
Andy Scherzinger 8cfd9aa8c7 improve spotbugs score
Signed-off-by: Andy Scherzinger <[email protected]>
2021-07-17 14:16:40 +02:00
Andy Scherzinger e7a321f0a9 remove obsolete Butterknife dependency
Signed-off-by: Andy Scherzinger <[email protected]>
2021-07-17 14:16:40 +02:00
Andy Scherzinger 84edbdedac implement native view bindings in activities/fragments/adapters
Signed-off-by: Andy Scherzinger <[email protected]>
2021-07-17 14:16:40 +02:00
Andy Scherzinger 1fdea011a7 replace switch statements with if/else since resource ids will be non-final in Android Gradle Plugin version 7.0
...so avoid using them in switch case statements.

Signed-off-by: Andy Scherzinger <[email protected]>
2021-07-17 14:16:39 +02:00
Andy Scherzinger 9f1c79494b Merge pull request #8710 from nextcloud/dependabot/gradle/espressoVersion-3.4.0
Bump espressoVersion from 3.3.0 to 3.4.0
2021-07-16 18:44:35 +02:00
Tobias Kaminsky 5e83b6ca90 Merge pull request #8654 from nextcloud/fix-npe-in-preview-media-fragment
Fix NPE when navigating out of PreviewMediaFragment during video loading
2021-07-16 12:02:54 +02:00
Tobias Kaminsky b94a439e4b Merge pull request #8535 from nextcloud/fix-auth-with-uppercase-scheme
Normalize input URL scheme during auth process
2021-07-16 12:01:42 +02:00
Tobias Kaminsky 0c9eb86c68 Merge pull request #8658 from nextcloud/migrate-file-display-activity-to-user-model
Migrate FileDisplayActivity to User model
2021-07-16 12:00:10 +02:00
tobiasKaminsky 14f7dbb3db Delete outdated comments before running
Signed-off-by: tobiasKaminsky <[email protected]>
2021-07-16 11:07:23 +02:00
dependabot[bot] 1f15802fdb Bump espressoVersion from 3.3.0 to 3.4.0
Bumps `espressoVersion` from 3.3.0 to 3.4.0.

Updates `espresso-core` from 3.3.0 to 3.4.0

Updates `espresso-contrib` from 3.3.0 to 3.4.0

Updates `espresso-web` from 3.3.0 to 3.4.0

Updates `espresso-accessibility` from 3.3.0 to 3.4.0

---
updated-dependencies:
- dependency-name: androidx.test.espresso:espresso-core
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: androidx.test.espresso:espresso-contrib
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: androidx.test.espresso:espresso-web
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: androidx.test.espresso:espresso-accessibility
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
2021-07-16 09:02:25 +00:00
Tobias Kaminsky 9937274443 Merge pull request #8691 from nextcloud/dependabot/gradle/commons-io-commons-io-2.11.0
Bump commons-io from 2.9.0 to 2.11.0
2021-07-16 11:02:08 +02:00
Tobias Kaminsky 6664a8e5d9 Merge pull request #8655 from nextcloud/remove-unused-method
Remove unused UserListItem.getAccount() method
2021-07-16 11:01:38 +02:00
Tobias Kaminsky bf2685d247 Merge pull request #8543 from nextcloud/darkNcText
Respect dark mode for Web Text Editor
2021-07-16 11:00:46 +02:00
Tobias Kaminsky 2056d44cc8 Merge pull request #8663 from nextcloud/drone
Add stable-* to drone.yml
2021-07-16 10:48:10 +02:00
dependabot[bot] 3b973729e9 Bump commons-io from 2.9.0 to 2.11.0
Bumps commons-io from 2.9.0 to 2.11.0.

---
updated-dependencies:
- dependency-name: commons-io:commons-io
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
2021-07-14 01:05:59 +00:00
Nextcloud bot 6b34599103 [tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <[email protected]>
2021-07-13 03:54:46 +00:00
Nextcloud bot 9fdc4eb2b2 [tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <[email protected]>
2021-07-10 04:07:16 +00:00
Nextcloud bot b33b39cdef [tx-robot] updated from transifex
Signed-off-by: Nextcloud bot <[email protected]>
2021-07-09 03:56:01 +00:00
tobiasKaminsky c867764fde Add stable-* to drone.yml
Signed-off-by: tobiasKaminsky <[email protected]>
2021-07-06 08:36:34 +02:00
Chris Narkiewicz c4116456fa Migrate FileDisplayActivity to User model
1. server version is available from User, so we can skip
   redundant retrieval via Account
2. last displayed account can be safely changed to User,
   eliminating name comparison complexities

Signed-off-by: Chris Narkiewicz <[email protected]>
2021-07-04 23:34:39 +01:00
Chris Narkiewicz d99d047885 Remove unused UserListItem.getAccount() method
Signed-off-by: Chris Narkiewicz <[email protected]>
2021-07-04 16:27:10 +01:00
Chris Narkiewicz 39a682fa1d Fix NPE when navigating out of PreviewMediaFragment during video loading
Although original error has been fixed by migration to Exo player,
there is still a potential NPE when fragment went through
onDestroyView().

Fixes #8620

Signed-off-by: Chris Narkiewicz <[email protected]>
2021-07-04 15:18:37 +01:00
Andy Scherzinger 111def7bd4 respect dark mode for web view
Resolves #8524

Signed-off-by: Andy Scherzinger <[email protected]>
2021-06-07 15:46:13 +02:00
Andy Scherzinger 306ea92b36 Add license header and remove duplicate empty lines
Signed-off-by: Andy Scherzinger <[email protected]>
2021-06-07 09:57:17 +02:00
Chris Narkiewicz c893834576 Normalize input URL scheme during auth process
Fixes #8519

Signed-off-by: Chris Narkiewicz <[email protected]>
2021-06-07 00:23:20 +01:00
Chris Narkiewicz 9171fb1d1c Remove Account from UploadsStorageManager
Signed-off-by: Chris Narkiewicz <[email protected]>
2021-06-02 01:54:51 +01:00
tobiasKaminsky 61cef4979f Renamed QueryPair
Signed-off-by: tobiasKaminsky <[email protected]>
2021-05-25 09:34:05 +02:00
tobiasKaminsky 9a464ca5c5 Renamed QueryPair
Signed-off-by: tobiasKaminsky <[email protected]>
2021-05-25 09:32:18 +02:00
Adam 4f5ed31618 Revert translation files that shouldn't have been changed
Signed-off-by: Adam <[email protected]>
2021-05-09 16:58:33 +01:00
Adam 540a286877 don't go over 120 characters
Signed-off-by: Adam <[email protected]>
2021-05-07 19:01:40 +01:00
Nextcloud bot 9b960cef18 [tx-robot] updated from transifex
Signed-off-by: Adam <[email protected]>
2021-05-07 19:01:40 +01:00
Nextcloud bot b7e033f07e [tx-robot] updated from transifex
Signed-off-by: Adam <[email protected]>
2021-05-07 19:01:40 +01:00
Adam fc155f0ba8 Use notificationID as requestcode to allow multiple android notifications
Signed-off-by: Adam <[email protected]>
2021-05-07 19:01:40 +01:00
tobiasKaminsky 1d60d23b9d Merge remote-tracking branch 'origin/parameterV2' into parameterV2 2021-05-04 09:19:26 +02:00
tobiasKaminsky 4875b20c6c Use own QueryPair implementation that supports serializable
Signed-off-by: tobiasKaminsky <[email protected]>
2021-05-04 09:19:16 +02:00
Stefan Niedermann 59a2187447 Fix another NPE when parameterV2 is null 2021-03-18 20:30:16 +01:00
tobiasKaminsky e7bc146524 fix possible NPE
Signed-off-by: tobiasKaminsky <[email protected]>
2021-03-18 15:31:50 +01:00
tobiasKaminsky 561cff8157 SSO: support of parameter v2, which allows to have multiple values for same key
Signed-off-by: tobiasKaminsky <[email protected]>
2021-03-18 15:31:50 +01:00
218 changed files with 5043 additions and 2388 deletions

No files matched your search

+3 -3
View File
@@ -1,5 +1,5 @@
# Instructions
1. Start a DevContainer either on GitHub Codespaces or locally in VSCode
2. Accept all licenses by running `yes | /usr/lib/android-sdk/cmdline-tools/latest/bin/sdkmanager --licenses`
3. You can now build the app using `./gradlew clean build`
1. Start a DevContainer either on GitHub Codespaces or locally in VSCode.
2. Accept all licenses by running `yes | /usr/lib/android-sdk/cmdline-tools/latest/bin/sdkmanager --licenses`.
3. You can now build the app using `./gradlew clean build`.
+67 -5
View File
@@ -25,10 +25,12 @@ steps:
- ./gradlew assembleGplay
- ./gradlew assembleGplayDebug
- scripts/wait_for_emulator.sh
- ./gradlew jacocoTestGplayDebugUnitTestReport && scripts/deleteOutdatedComments.sh "stable" "Unit" $DRONE_PULL_REQUEST $GIT_USERNAME $GIT_TOKEN || scripts/uploadReport.sh $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER "stable" "Unit" $DRONE_PULL_REQUEST $GIT_USERNAME $GIT_TOKEN
- scripts/deleteOldComments.sh "stable" "Unit" $DRONE_PULL_REQUEST $GIT_TOKEN
- ./gradlew jacocoTestGplayDebugUnitTestReport || scripts/uploadReport.sh $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER "stable" "Unit" $DRONE_PULL_REQUEST $GIT_TOKEN
- ./gradlew installGplayDebugAndroidTest
- scripts/wait_for_server.sh "server"
- ./gradlew createGplayDebugCoverageReport -Pcoverage -Pandroid.testInstrumentationRunnerArguments.notAnnotation=com.owncloud.android.utils.ScreenshotTest && scripts/deleteOutdatedComments.sh "stable" "IT" $DRONE_PULL_REQUEST $GIT_USERNAME $GIT_TOKEN || scripts/uploadReport.sh $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER "stable" "IT" $DRONE_PULL_REQUEST $GIT_USERNAME $GIT_TOKEN
- scripts/deleteOldComments.sh "stable" "IT" $DRONE_PULL_REQUEST $GIT_TOKEN
- ./gradlew createGplayDebugCoverageReport -Pcoverage -Pandroid.testInstrumentationRunnerArguments.notAnnotation=com.owncloud.android.utils.ScreenshotTest || scripts/uploadReport.sh $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER "stable" "IT" $DRONE_PULL_REQUEST $GIT_TOKEN
- ./gradlew combinedTestReport
- name: notify
image: drillster/drone-email
@@ -51,6 +53,7 @@ steps:
- failure
branch:
- master
- stable-*
services:
- name: server
@@ -58,7 +61,7 @@ services:
environment:
EVAL: true
commands:
- BRANCH='stable20' /usr/local/bin/initnc.sh
- BRANCH='stable21' /usr/local/bin/initnc.sh
- echo 127.0.0.1 server >> /etc/hosts
- su www-data -c "OC_PASS=user1 php /var/www/html/occ user:add --password-from-env --display-name='User One' user1"
- su www-data -c "OC_PASS=user2 php /var/www/html/occ user:add --password-from-env --display-name='User Two' user2"
@@ -67,9 +70,9 @@ services:
- su www-data -c "php /var/www/html/occ group:add users"
- su www-data -c "php /var/www/html/occ group:adduser users user1"
- su www-data -c "php /var/www/html/occ group:adduser users user2"
- su www-data -c "git clone -b stable20 https://github.com/nextcloud/activity.git /var/www/html/apps/activity/"
- su www-data -c "git clone -b stable21 https://github.com/nextcloud/activity.git /var/www/html/apps/activity/"
- su www-data -c "php /var/www/html/occ app:enable activity"
- su www-data -c "git clone -b stable20 https://github.com/nextcloud/text.git /var/www/html/apps/text/"
- su www-data -c "git clone -b stable21 https://github.com/nextcloud/text.git /var/www/html/apps/text/"
- su www-data -c "php /var/www/html/occ app:enable text"
- su www-data -c "php /var/www/html/occ app:enable end_to_end_encryption"
- /usr/local/bin/run.sh
@@ -77,6 +80,7 @@ services:
trigger:
branch:
- master
- stable-*
event:
- push
- pull_request
@@ -126,6 +130,7 @@ steps:
- failure
branch:
- master
- stable-*
services:
- name: server
@@ -153,6 +158,7 @@ services:
trigger:
branch:
- master
- stable-*
event:
- push
- pull_request
@@ -199,10 +205,66 @@ steps:
- failure
branch:
- master
- stable-*
trigger:
branch:
- master
- stable-*
event:
- push
- pull_request
---
kind: pipeline
type: docker
name: allScreenshots
steps:
- name: runAllScreenshots
image: nextcloudci/android8:android-61
privileged: true
environment:
GIT_USERNAME:
from_secret: GIT_USERNAME
GIT_TOKEN:
from_secret: GIT_TOKEN
LOG_USERNAME:
from_secret: LOG_USERNAME
LOG_PASSWORD:
from_secret: LOG_PASSWORD
commands:
- emulator -avd android -no-snapshot -gpu swiftshader_indirect -no-window -no-audio -skin 500x833 &
- sed -i s'#<bool name="is_beta">false</bool>#<bool name="is_beta">true</bool>#'g src/main/res/values/setup.xml
- sed -i s'#showOnlyFailingTestsInReports = ciBuild#showOnlyFailingTestsInReports = false#' build.gradle
- scripts/wait_for_emulator.sh
- scripts/runAllScreenshotCombinations noCI false
- scripts/screenshotSummary.sh
- name: notify
image: drillster/drone-email
settings:
port: 587
from: [email protected]
recipients_only: true
username:
from_secret: EMAIL_USERNAME
password:
from_secret: EMAIL_PASSWORD
recipients:
from_secret: EMAIL_RECIPIENTS
host:
from_secret: EMAIL_HOST
when:
event:
- push
status:
- failure
branch:
- master
- stable-*
trigger:
branch:
- master
event:
- cron
cron:
- nightly
+26 -7
View File
@@ -3,25 +3,44 @@
# https://github.com/nextcloud/.github
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
name: Rebase command
on:
issue_comment:
types: [ created ]
name: Automatic Rebase
types: created
jobs:
rebase:
name: Rebase
# On pull requests and if the comment starts with `/rebase`
if: github.event.issue.pull_request != '' && startsWith(github.event.comment.body, '/rebase')
runs-on: ubuntu-latest
# On pull requests and if the comment starts with `/rebase`
if: github.event.issue.pull_request != '' && startsWith(github.event.comment.body, '/rebase')
steps:
- name: Add reaction on start
uses: peter-evans/create-or-update-comment@v1
with:
token: ${{ secrets.COMMAND_BOT_PAT }}
repository: ${{ github.event.repository.full_name }}
comment-id: ${{ github.event.comment.id }}
reaction-type: "+1"
- name: Checkout the latest code
uses: actions/checkout@v2
with:
fetch-depth: 0
token: ${{ secrets.COMMAND_BOT_PAT }}
- name: Automatic Rebase
uses: cirrus-actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.COMMAND_BOT_PAT }}
- name: Add reaction on failure
uses: peter-evans/create-or-update-comment@v1
if: failure()
with:
token: ${{ secrets.COMMAND_BOT_PAT }}
repository: ${{ github.event.repository.full_name }}
comment-id: ${{ github.event.comment.id }}
reaction-type: "-1"
+6
View File
@@ -8,12 +8,18 @@ jobs:
qa:
runs-on: ubuntu-latest
steps:
- name: Check if secrets are available
run: echo "::set-output name=ok::${{ secrets.KS_PASS != '' }}"
id: check-secrets
- uses: actions/checkout@v2
if: ${{ steps.check-secrets.outputs.ok == 'true' }}
- name: set up JDK 1.8
if: ${{ steps.check-secrets.outputs.ok == 'true' }}
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Build QA
if: ${{ steps.check-secrets.outputs.ok == 'true' }}
env:
KS_PASS: ${{ secrets.KS_PASS }}
KEY_PASS: ${{ secrets.KEY_PASS }}
+2 -2
View File
@@ -10,8 +10,8 @@ jobs:
strategy:
fail-fast: false
matrix:
scheme: [ Dark, Light ]
color: [ blue, white, black ]
scheme: [ Light ]
color: [ blue ]
steps:
- uses: actions/checkout@v2
- name: set up JDK 1.8
+1
View File
@@ -49,3 +49,4 @@ fastlane/Fastfile
**/fastlane/test_output
/fastlane/vendor/
/.bundle/
/fastlane/.bundle/
View File
Whitespace-only changes.
+10
View File
@@ -1,3 +1,13 @@
## 3.17.0 (August, 19, 2021)
UI improvements (Avatar, password dialog)
New video player for better streaming
Many bug fixes
Minimum: NC 16 Server, Android 5.1 Lollipop
For a full list, please see https://github.com/nextcloud/android/milestone/59
## 3.17.0 (-, -, -)
- New upload manager @ezaquarii
+8
View File
@@ -119,6 +119,14 @@ There are three build variants
* gplay: with Google Stuff (Push notification), used for Google Play Store
* versionDev: based on master and library master, available as direct download and FDroid
### Git hooks
We provide git hooks to make development process easier for both the developer and the reviewers.
To install them, just run:
```bash
./gradlew installGitHooks
```
## Contribution process
* Contribute your code in the branch 'master'. It will give us a better chance to test your code before merging it with stable code.
* For your first contribution start a pull request on master.
+98 -67
View File
@@ -1,77 +1,94 @@
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (3.0.2)
addressable (2.7.0)
CFPropertyList (3.0.3)
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
artifactory (3.0.15)
atomos (0.1.3)
aws-eventstream (1.1.0)
aws-partitions (1.343.0)
aws-sdk-core (3.104.1)
aws-eventstream (1.1.1)
aws-partitions (1.479.0)
aws-sdk-core (3.117.0)
aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.239.0)
aws-sigv4 (~> 1.1)
jmespath (~> 1.0)
aws-sdk-kms (1.36.0)
aws-sdk-core (~> 3, >= 3.99.0)
aws-sdk-kms (1.44.0)
aws-sdk-core (~> 3, >= 3.112.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.75.0)
aws-sdk-core (~> 3, >= 3.104.1)
aws-sdk-s3 (1.96.2)
aws-sdk-core (~> 3, >= 3.112.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.1)
aws-sigv4 (1.2.1)
aws-sigv4 (1.2.4)
aws-eventstream (~> 1, >= 1.0.2)
babosa (1.0.3)
babosa (1.0.4)
claide (1.0.3)
colored (1.2)
colored2 (3.1.2)
commander-fastlane (4.4.6)
highline (~> 1.7.2)
commander (4.6.0)
highline (~> 2.0.0)
declarative (0.0.20)
declarative-option (0.1.0)
digest-crc (0.6.1)
rake (~> 13.0)
digest-crc (0.6.3)
rake (>= 12.0.0, < 14.0.0)
domain_name (0.5.20190701)
unf (>= 0.0.5, < 1.0.0)
dotenv (2.7.6)
emoji_regex (3.0.0)
excon (0.75.0)
faraday (0.17.3)
emoji_regex (3.2.2)
excon (0.85.0)
faraday (1.5.1)
faraday-em_http (~> 1.0)
faraday-em_synchrony (~> 1.0)
faraday-excon (~> 1.1)
faraday-httpclient (~> 1.0.1)
faraday-net_http (~> 1.0)
faraday-net_http_persistent (~> 1.1)
faraday-patron (~> 1.0)
multipart-post (>= 1.2, < 3)
faraday-cookie_jar (0.0.6)
faraday (>= 0.7.4)
ruby2_keywords (>= 0.0.4)
faraday-cookie_jar (0.0.7)
faraday (>= 0.8.0)
http-cookie (~> 1.0.0)
faraday_middleware (0.14.0)
faraday (>= 0.7.4, < 1.0)
fastimage (2.1.7)
fastlane (2.152.0)
faraday-em_http (1.0.0)
faraday-em_synchrony (1.0.0)
faraday-excon (1.1.0)
faraday-httpclient (1.0.1)
faraday-net_http (1.0.1)
faraday-net_http_persistent (1.2.0)
faraday-patron (1.0.0)
faraday_middleware (1.0.0)
faraday (~> 1.0)
fastimage (2.2.4)
fastlane (2.188.0)
CFPropertyList (>= 2.3, < 4.0.0)
addressable (>= 2.3, < 3.0.0)
addressable (>= 2.8, < 3.0.0)
artifactory (~> 3.0)
aws-sdk-s3 (~> 1.0)
babosa (>= 1.0.3, < 2.0.0)
bundler (>= 1.12.0, < 3.0.0)
colored
commander-fastlane (>= 4.4.6, < 5.0.0)
commander (~> 4.6)
dotenv (>= 2.1.1, < 3.0.0)
emoji_regex (>= 0.1, < 4.0)
excon (>= 0.71.0, < 1.0.0)
faraday (>= 0.17, < 1.0)
faraday (~> 1.0)
faraday-cookie_jar (~> 0.0.6)
faraday_middleware (>= 0.13.1, < 2.0)
faraday_middleware (~> 1.0)
fastimage (>= 2.1.0, < 3.0.0)
gh_inspector (>= 1.1.2, < 2.0.0)
google-api-client (>= 0.37.0, < 0.39.0)
google-cloud-storage (>= 1.15.0, < 2.0.0)
highline (>= 1.7.2, < 2.0.0)
google-apis-androidpublisher_v3 (~> 0.1)
google-apis-playcustomapp_v1 (~> 0.1)
google-cloud-storage (~> 1.31)
highline (~> 2.0)
json (< 3.0.0)
jwt (>= 2.1.0, < 3)
mini_magick (>= 4.9.4, < 5.0.0)
multipart-post (~> 2.0.0)
naturally (~> 2.2)
plist (>= 3.1.0, < 4.0.0)
rubyzip (>= 2.0.0, < 3.0.0)
security (= 0.1.3)
simctl (~> 1.6.3)
slack-notifier (>= 2.0.0, < 3.0.0)
terminal-notifier (>= 2.0.0, < 3.0.0)
terminal-table (>= 1.4.5, < 2.0.0)
tty-screen (>= 0.6.3, < 1.0.0)
@@ -80,63 +97,75 @@ GEM
xcodeproj (>= 1.13.0, < 2.0.0)
xcpretty (~> 0.3.0)
xcpretty-travis-formatter (>= 0.0.3)
fastlane-plugin-huawei_appgallery_connect (1.0.9)
fastlane-plugin-huawei_appgallery_connect (1.0.16)
gh_inspector (1.1.3)
google-api-client (0.38.0)
google-apis-androidpublisher_v3 (0.8.0)
google-apis-core (>= 0.4, < 2.a)
google-apis-core (0.4.1)
addressable (~> 2.5, >= 2.5.1)
googleauth (~> 0.9)
httpclient (>= 2.8.1, < 3.0)
googleauth (>= 0.16.2, < 2.a)
httpclient (>= 2.8.1, < 3.a)
mini_mime (~> 1.0)
representable (~> 3.0)
retriable (>= 2.0, < 4.0)
signet (~> 0.12)
google-cloud-core (1.5.0)
retriable (>= 2.0, < 4.a)
rexml
webrick
google-apis-iamcredentials_v1 (0.6.0)
google-apis-core (>= 0.4, < 2.a)
google-apis-playcustomapp_v1 (0.5.0)
google-apis-core (>= 0.4, < 2.a)
google-apis-storage_v1 (0.6.0)
google-apis-core (>= 0.4, < 2.a)
google-cloud-core (1.6.0)
google-cloud-env (~> 1.0)
google-cloud-errors (~> 1.0)
google-cloud-env (1.3.3)
google-cloud-env (1.5.0)
faraday (>= 0.17.3, < 2.0)
google-cloud-errors (1.0.1)
google-cloud-storage (1.26.2)
google-cloud-errors (1.1.0)
google-cloud-storage (1.34.1)
addressable (~> 2.5)
digest-crc (~> 0.4)
google-api-client (~> 0.33)
google-cloud-core (~> 1.2)
googleauth (~> 0.9)
google-apis-iamcredentials_v1 (~> 0.1)
google-apis-storage_v1 (~> 0.1)
google-cloud-core (~> 1.6)
googleauth (>= 0.16.2, < 2.a)
mini_mime (~> 1.0)
googleauth (0.13.0)
googleauth (0.16.2)
faraday (>= 0.17.3, < 2.0)
jwt (>= 1.4, < 3.0)
memoist (~> 0.16)
multi_json (~> 1.11)
os (>= 0.9, < 2.0)
signet (~> 0.14)
highline (1.7.10)
http-cookie (1.0.3)
highline (2.0.3)
http-cookie (1.0.4)
domain_name (~> 0.5)
httpclient (2.8.3)
jmespath (1.4.0)
json (2.3.1)
jwt (2.2.1)
json (2.5.1)
jwt (2.2.3)
memoist (0.16.2)
mini_magick (4.10.1)
mini_mime (1.0.2)
mini_magick (4.11.0)
mini_mime (1.1.0)
multi_json (1.15.0)
multipart-post (2.0.0)
nanaimo (0.3.0)
naturally (2.2.0)
os (1.1.0)
plist (3.5.0)
public_suffix (4.0.5)
rake (13.0.1)
representable (3.0.4)
naturally (2.2.1)
os (1.1.1)
plist (3.6.0)
public_suffix (4.0.6)
rake (13.0.6)
representable (3.1.1)
declarative (< 0.1.0)
declarative-option (< 0.2.0)
trailblazer-option (>= 0.1.1, < 0.2.0)
uber (< 0.2.0)
retriable (3.1.2)
rexml (3.2.5)
rouge (2.0.7)
rubyzip (2.3.0)
ruby2_keywords (0.0.5)
rubyzip (2.3.2)
security (0.1.3)
signet (0.14.0)
signet (0.15.0)
addressable (~> 2.3)
faraday (>= 0.17.3, < 2.0)
jwt (>= 1.5, < 3.0)
@@ -144,10 +173,10 @@ GEM
simctl (1.6.8)
CFPropertyList
naturally
slack-notifier (2.3.2)
terminal-notifier (2.0.0)
terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1)
trailblazer-option (0.1.1)
tty-cursor (0.7.1)
tty-screen (0.8.1)
tty-spinner (0.9.3)
@@ -157,24 +186,26 @@ GEM
unf_ext
unf_ext (0.0.7.7)
unicode-display_width (1.7.0)
webrick (1.7.0)
word_wrap (1.0.0)
xcodeproj (1.17.1)
xcodeproj (1.20.0)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)
colored2 (~> 3.1)
nanaimo (~> 0.3.0)
rexml (~> 3.2.4)
xcpretty (0.3.0)
rouge (~> 2.0.7)
xcpretty-travis-formatter (1.0.0)
xcpretty-travis-formatter (1.0.1)
xcpretty (~> 0.2, >= 0.0.7)
PLATFORMS
ruby
x86_64-linux
DEPENDENCIES
fastlane
fastlane-plugin-huawei_appgallery_connect
BUNDLED WITH
2.1.4
2.2.18
+1 -3
View File
@@ -32,7 +32,7 @@ The next steps will assume you have a GitHub account and that you will get the c
* In a web browser, go to https://github.com/nextcloud/android, and click the 'Fork' button near the top right corner.
* Open a terminal and go on with the next steps in it.
* Clone your forked repository: ```git clone --recursive https://github.com/YOURGITHUBNAME/android.git```.
* Clone your forked repository: ```git clone https://github.com/YOURGITHUBNAME/android.git```.
* Move to the project folder with ```cd android```.
* Pull any changes from your remote branch 'master': ```git pull origin master```
* Make official Nextcloud repo known as upstream: ```git remote add upstream https://github.com/nextcloud/android.git```
@@ -49,7 +49,6 @@ We recommend to use the last version available in the stable channel of Android
To set up the project in Android Studio follow the next steps:
* Make sure you have called ```git submodule update``` whenever you switched branches
* Open Android Studio and select 'Import Project (Eclipse ADT, Gradle, etc)'. Browse through your file system to the folder 'android' where the project is located. Android Studio will then create the '.iml' files it needs. If you ever close the project but the files are still there, you just select 'Open Project…'. The file chooser will show an Android face as the folder icon, which you can select to reopen the project.
* Android Studio will try to build the project directly after importing it. To build it manually, follow the menu path 'Build'/'Make Project', or just click the 'Play' button in the toolbar to build and run it in a mobile device or an emulator. The resulting APK file will be saved in the 'build/outputs/apk/' subdirectory in the project folder.
* Setup Android Studio editor configurtation for the project: ```Settings``` → ```Editor``` → ```Code Style``` → ```Scheme: Project``` and ```Enable EditorConfig support```
@@ -60,7 +59,6 @@ To set up the project in Android Studio follow the next steps:
[Gradle][7] is the build system used by Android Studio to manage the building operations on Android apps. You do not need to install Gradle in your system, and Google recommends not to do it, but instead trusting on the [Gradle wrapper][8] included in the project.
* Open a terminal and go to the 'android' directory that contains the repository.
* Make sure you have called ```git submodule update``` whenever you switched branches
* Run the 'clean' and 'build' tasks using the Gradle wrapper provided
- Windows: ```gradlew.bat clean build```
- Mac OS/Linux: ```./gradlew clean build```
+41 -34
View File
@@ -18,13 +18,13 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.2.1'
classpath 'com.android.tools.build:gradle:4.2.2'
classpath 'com.hiya:jacoco-android:0.2'
classpath 'gradle.plugin.com.github.spotbugs.snom:spotbugs-gradle-plugin:4.7.1'
classpath 'gradle.plugin.com.github.spotbugs.snom:spotbugs-gradle-plugin:4.7.5'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.17.1"
classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.18.1"
classpath "commons-httpclient:commons-httpclient:3.1@jar" // remove after entire switch to lib v2
classpath 'com.karumi:shot:5.10.3'
classpath 'com.karumi:shot:5.11.2'
}
}
@@ -56,18 +56,18 @@ configurations {
}
ext {
daggerVersion = "2.36"
androidxTestVersion = "1.4.0"
daggerVersion = "2.38.1"
markwonVersion = "4.6.2"
prismVersion = "2.0.0"
butterknifeVersion = "10.2.3"
androidLibraryVersion = "master-SNAPSHOT"
mockitoVersion = "3.11.0"
mockitoVersion = "3.12.4"
mockkVersion = "1.10.4"
powermockVersion = "2.0.9"
byteBuddyVersion = "1.11.2"
espressoVersion = "3.3.0"
byteBuddyVersion = "1.11.18"
espressoVersion = "3.4.0"
workRuntime = "2.5.0"
fidoVersion = "4.4.0"
fidoVersion = "4.1.0"
ciBuild = System.getenv("CI") == "true"
@@ -266,35 +266,33 @@ dependencies {
// dependencies for app building
implementation 'androidx.multidex:multidex:2.0.1'
// implementation project('nextcloud-android-library')
genericImplementation "com.github.nextcloud:android-library:$androidLibraryVersion"
gplayImplementation "com.github.nextcloud:android-library:$androidLibraryVersion"
versionDevImplementation "com.github.nextcloud:android-library:$androidLibraryVersion"
qaImplementation "com.github.nextcloud:android-library:$androidLibraryVersion"
implementation ("com.github.nextcloud:android-library:$androidLibraryVersion") {
exclude group: 'org.ogce', module: 'xpp3' // unused in Android and brings wrong Junit version
}
compileOnly 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2' // remove after entire switch to lib v2
implementation "commons-httpclient:commons-httpclient:3.1@jar" // remove after entire switch to lib v2
implementation 'org.apache.jackrabbit:jackrabbit-webdav:2.13.1' // remove after entire switch to lib v2
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.3.0'
implementation 'com.google.android.material:material:1.4.0'
implementation 'com.jakewharton:disklrucache:2.0.2'
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'androidx.webkit:webkit:1.4.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.exifinterface:exifinterface:1.3.2'
implementation 'androidx.exifinterface:exifinterface:1.3.3'
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1"
implementation "androidx.work:work-runtime:$workRuntime"
implementation "androidx.work:work-runtime-ktx:$workRuntime"
implementation "androidx.fragment:fragment-ktx:1.3.4"
implementation "androidx.fragment:fragment-ktx:1.3.6"
implementation 'com.github.albfernandez:juniversalchardet:2.0.3' // need this version for Android <7
compileOnly 'com.google.code.findbugs:annotations:3.0.1u2'
implementation 'commons-io:commons-io:2.9.0'
implementation "com.jakewharton:butterknife:$butterknifeVersion"
kapt "com.jakewharton:butterknife-compiler:$butterknifeVersion"
implementation 'commons-io:commons-io:2.11.0'
implementation 'org.greenrobot:eventbus:3.2.0'
implementation 'com.googlecode.ez-vcard:ez-vcard:0.11.2'
implementation 'com.googlecode.ez-vcard:ez-vcard:0.11.3'
implementation 'org.lukhnos:nnio:0.2'
implementation 'org.bouncycastle:bcpkix-jdk15to18:1.68'
implementation 'com.google.code.gson:gson:2.8.7'
implementation 'org.bouncycastle:bcpkix-jdk15to18:1.69'
implementation 'com.google.code.gson:gson:2.8.8'
implementation 'com.afollestad:sectioned-recyclerview:0.5.0'
implementation 'com.github.chrisbanes:PhotoView:2.3.0'
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.21'
@@ -307,7 +305,7 @@ dependencies {
}
implementation 'com.caverock:androidsvg:1.4'
implementation 'androidx.annotation:annotation:1.2.0'
implementation 'com.vanniktech:emoji-google:0.7.0'
implementation 'com.vanniktech:emoji-google:0.8.0'
implementation "com.github.cotechde.hwsecurity:hwsecurity-fido:$fidoVersion"
implementation "com.github.cotechde.hwsecurity:hwsecurity-fido2:$fidoVersion"
@@ -321,10 +319,10 @@ dependencies {
kapt "com.google.dagger:dagger-compiler:$daggerVersion"
kapt "com.google.dagger:dagger-android-processor:$daggerVersion"
ktlint "com.pinterest:ktlint:0.41.0"
ktlint "com.pinterest:ktlint:0.42.1"
implementation 'org.conscrypt:conscrypt-android:2.5.2'
implementation 'com.google.android.exoplayer:exoplayer:2.13.2'
implementation 'com.google.android.exoplayer:exoplayer:2.15.1'
// Shimmer animation
implementation 'com.elyeproj.libraries:loaderviewlibrary:2.0.0'
@@ -343,7 +341,7 @@ dependencies {
// dependencies for local unit tests
testImplementation 'junit:junit:4.13.2'
testImplementation "org.mockito:mockito-core:$mockitoVersion"
testImplementation 'androidx.test:core:1.3.0'
testImplementation "androidx.test:core:$androidxTestVersion"
testImplementation "org.powermock:powermock-core:$powermockVersion"
testImplementation "org.powermock:powermock-module-junit4:$powermockVersion"
testImplementation "org.powermock:powermock-api-mockito2:$powermockVersion"
@@ -355,11 +353,11 @@ dependencies {
// dependencies for instrumented tests
// JUnit4 Rules
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test:rules:1.3.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation "androidx.test:rules:$androidxTestVersion"
// Android JUnit Runner
androidTestImplementation 'androidx.test:runner:1.3.0'
androidTestUtil 'androidx.test:orchestrator:1.3.0'
androidTestImplementation "androidx.test:runner:$androidxTestVersion"
androidTestUtil "androidx.test:orchestrator:$androidxTestVersion"
// Espresso core
androidTestImplementation "androidx.test.espresso:espresso-core:$espressoVersion"
@@ -378,12 +376,13 @@ dependencies {
androidTestImplementation "net.bytebuddy:byte-buddy-android:$byteBuddyVersion"
androidTestImplementation "io.mockk:mockk-android:1.10.4"
androidTestImplementation 'androidx.arch.core:core-testing:2.0.1'
androidTestImplementation "com.facebook.testing.screenshot:core:0.13.0"
// UIAutomator - for cross-app UI tests, and to grant screen is turned on in Espresso tests
// androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0'
// fix conflict in dependencies; see http://g.co/androidstudio/app-test-app-conflict for details
//androidTestImplementation "com.android.support:support-annotations:${supportLibraryVersion}"
androidTestImplementation 'tools.fastlane:screengrab:2.0.0'
androidTestImplementation 'tools.fastlane:screengrab:2.1.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
androidTestImplementation('com.android.support.test.espresso:espresso-intents:3.0.2')
@@ -441,6 +440,14 @@ task ktlintFormat(type: JavaExec, group: "formatting") {
args "-F", "src/**/*.kt"
}
task installGitHooks(type: Copy, group: "development") {
description = "Install git hooks"
from("${project.rootDir}/scripts/hooks") {
include '*'
}
into '.git/hooks'
}
detekt {
reports {
xml {
-1
View File
@@ -3,4 +3,3 @@
# Ensure this file is checked in to source control!
gem 'fastlane-plugin-huawei_appgallery_connect'
gem 'fastlane-plugin-huawei_appgallery_connect'
+1 -1
View File
@@ -7,7 +7,7 @@
<issue id="InvalidPackage">
<ignore path="**/freemarker-2.*.*.jar" />
<ignore path="**/nnio-0.2.jar"/>
<ignore path="**/bcpkix-jdk15on-1.65.jar" />
<ignore path="**/bcpkix-jdk15on-1.69.jar" />
</issue>
<issue id="UnusedResources">
Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.5 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.2 KiB

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.3 KiB

After

Width:  |  Height:  |  Size: 9.3 KiB

+1 -1
View File
@@ -1 +1 @@
305
460
+1 -1
View File
@@ -1,2 +1,2 @@
DO NOT TOUCH; GENERATED BY DRONE
<span class="mdl-layout-title">Lint Report: 227 warnings</span>
<span class="mdl-layout-title">Lint Report: 68 warnings</span>
+3 -2
View File
@@ -1,4 +1,5 @@
#!/bin/bash
set -e
if [ $# -lt 2 ]; then
echo "1: record: true/false
@@ -57,8 +58,8 @@ while read line ; do
fi
done < <(adb devices | cut -f1)
if [ ! $emulatorIsRunning ] ; then
emulator -writable-system -avd uiComparison -no-snapshot -gpu swiftshader_indirect -no-audio -skin 500x833 &
if [ "$emulatorIsRunning" == false ] ; then
"$(command -v emulator)" -writable-system -avd uiComparison -no-snapshot -gpu swiftshader_indirect -no-audio -skin 500x833 &
fi
if [ -e $5 ] ; then
+14 -15
View File
@@ -1,28 +1,27 @@
#!/usr/bin/env bash
#1: LOG_USERNAME
#2: LOG_PASSWORD
#3: DRONE_BUILD_NUMBER
#4: BRANCH (stable or master)
#5: TYPE (IT or Unit)
#6: DRONE_PULL_REQUEST
#7: GITHUB_TOKEN
#1: BRANCH
#2: TYPE
#3: PR
#4: GITHUB_TOKEN
BRANCH=$1
TYPE=$2
PR=$3
GITHUB_USER=$4
GITHUB_PASSWORD=$5
GITHUB_TOKEN=$4
BRANCH_TYPE=$BRANCH-$TYPE
# delete all old comments, matching this type
echo "Deleting old comments for $BRANCH_TYPE"
oldComments=$(curl 2>/dev/null --header "authorization: Bearer $GITHUB_TOKEN" -X GET https://api.github.com/repos/nextcloud/android/issues/$PR/comments | jq --arg TYPE $BRANCH_TYPE '.[] | (.id |tostring) + "|" + (.user.login | test("nextcloud-android-bot") | tostring) + "|" + (.body | test([$TYPE]) | tostring)'| grep "true|true" | tr -d "\"" | cut -f1 -d"|")
count=$(echo $oldComments | grep true | wc -l)
oldComments=$(curl 2>/dev/null --header "authorization: Bearer $GITHUB_TOKEN" -X GET https://api.github.com/repos/nextcloud/android/issues/$PR/comments | jq --arg TYPE $BRANCH_TYPE '.[] | (.id |tostring) + "|" + (.user.login | test("(nextcloud-android-bot|github-actions)") | tostring) + "|" + (.body | test([$TYPE]) | tostring)'| grep "true|true" | tr -d "\"" | cut -f1 -d"|")
count=$(echo -n "$oldComments" | grep -c '^')
echo "Found $count old comments"
echo $oldComments | while read comment ; do
echo "Deleting comment: $comment"
curl 2>/dev/null --header "authorization: Bearer $GITHUB_TOKEN" -X DELETE https://api.github.com/repos/nextcloud/android/issues/comments/$comment
done
if [ "$count" -gt 0 ]; then
echo "$oldComments" | while read comment ; do
echo "Deleting comment: $comment"
curl 2>/dev/null --header "authorization: Bearer $GITHUB_TOKEN" -X DELETE https://api.github.com/repos/nextcloud/android/issues/comments/$comment
done
fi
exit 0
-17
View File
@@ -1,17 +0,0 @@
#!/usr/bin/env bash
BRANCH=$1
TYPE=$2
PR=$3
GITHUB_USER=$4
GITHUB_PASSWORD=$5
BRANCH_TYPE=$BRANCH-$TYPE
# delete all old comments, matching this type
oldComments=$(curl 2>/dev/null -u $GITHUB_USER:$GITHUB_PASSWORD -X GET https://api.github.com/repos/nextcloud/android/issues/$PR/comments | jq --arg TYPE $BRANCH_TYPE '.[] | (.id |tostring) + "|" + (.user.login | test("nextcloud-android-bot") | tostring) + "|" + (.body | test([$TYPE]) | tostring)'| grep "true|true" | tr -d "\"" | cut -f1 -d"|")
echo $oldComments | while read comment ; do
curl 2>/dev/null -u $GITHUB_USER:$GITHUB_PASSWORD -X DELETE https://api.github.com/repos/nextcloud/android/issues/comments/$comment
done
exit 0
+85
View File
@@ -0,0 +1,85 @@
#!/bin/bash
#
# Nextcloud Android client application
#
# @author Tobias Kaminsky
# Copyright (C) 2021 Tobias Kaminsky
# Copyright (C) 2021 Nextcloud GmbH
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
error=0
total=0
cp scripts/screenshotCombinations scripts/screenshotCombinations_
grep -v "#" scripts/screenshotCombinations_ > scripts/screenshotCombinations
rm scripts/screenshotCombinations_
echo '<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="utf-8"/>
</head>'
echo "<table>"
echo "<tr><td style='width:150px'>Original</td>"
while read line; do
echo "<td style='width:150px'>$line</td>"
done < scripts/screenshotCombinations
echo "</tr>"
#for image in ./build/reports/shot/verification/images/*.png ; do
for image in $(/bin/ls -1 ./screenshots/gplay/debug/*.png | grep -v _dark_ | grep -v _light_) ; do
cp $image build/screenshotSummary/images/
echo "<tr style='height:200px'>"
echo "<td><a target='_blank' href=\"images/$(basename $image)\"><img width=100px src=\"images/$(basename $image)\"/></a></td>"
while read line; do
echo "<td>"
mode=$(echo $line | cut -d" " -f1)
color=$(echo $line | cut -d" " -f2)
total=$((total + 1))
if [ $mode = "light" -a $color = "blue" ]; then
name=$(basename $image)
else
name=$(basename $image| sed s"/\.png/_${mode}_$color\.png/")
fi
# if image does not exist
if [ ! -e ./build/reports/shot/verification/images/$name ]; then
echo "<span style='color: red'>✘</span>"
error=$((error + 1))
elif [ -e ./build/reports/shot/verification/images/diff_$name ]; then
# file with "diff_" prefix
cp ./build/reports/shot/verification/images/diff_$name build/screenshotSummary/images/
echo "<a target='_blank' href=\"images/diff_$name\"><img width=100px src=\"images/diff_$name\"/></a>"
error=$((error + 1))
else
echo "✔"
fi
echo "</td>"
done < scripts/screenshotCombinations
echo "</tr>"
done
echo "</table>"
echo "ERROR: $error / $total"
echo "</html>"
+14
View File
@@ -0,0 +1,14 @@
#!/bin/bash
# Pre-commit hook: don't allow commits if detekt or ktlint fail. Skip with "git commit --no-verify".
echo "Running pre-commit checks."
if ! ./gradlew --daemon ktlint &>/dev/null; then
echo >&2 "Lint failed! See report at file://$(pwd)/build/ktlint.txt"
echo >&2 "Hint: fix most lint errors with ./gradlew ktlintFormat"
exit 1
fi
if ! ./gradlew --daemon detekt &>/dev/null; then
echo >&2 "Detekt failed! See report at file://$(pwd)/build/reports/detekt/detekt.html"
exit 1
fi
+27
View File
@@ -0,0 +1,27 @@
#!/bin/bash
# Pre-push: Don't allow commits without Signed-off-by. Skip with "git push --no-verify".
set -euo pipefail
z40=0000000000000000000000000000000000000000 # magic deleted ref
while read local_ref local_sha remote_ref remote_sha; do
if [ "$local_sha" != $z40 ]; then
if [ "$remote_sha" = $z40 ]; then
# New branch, examine all commits
range="$(git merge-base master $local_sha)..$local_sha"
else
# Update to existing branch, examine new commits
range="$remote_sha..$local_sha"
fi
# Check for commits without sign-off
commit=$(git rev-list --grep 'Signed-off-by' --invert-grep "$range")
if [ -n "$commit" ]; then
echo >&2 "Found commits without sign-off in $local_ref. Aborting push. Offending commits:"
echo >&2 "$commit"
exit 1
fi
fi
done
exit 0
+9 -8
View File
@@ -1,6 +1,6 @@
#!/bin/bash
## $1 noCI/stable/master: wether to run deleteOutdatedComments.sh or uploadReport.sh
## $1 noCI/stable/master: wether to run deleteOldComments.sh or uploadReport.sh
## $2 true/false: record or verify screenshots
## $3 classMethod: piped from androidScreenshotTest
## $4 github event number
@@ -16,12 +16,12 @@ fi
classMethod=$3
resultCode=0
while read line
grep -v "#" scripts/screenshotCombinations | while read line
do
darkMode=$(echo "$line" | cut -d" " -f1)
color=$(echo "$line" | cut -d" " -f2)
echo "Run $color on $darkMode mode"
echo -n "Run $color on $darkMode mode"
if [[ $1 = "noCI" ]]; then
./gradlew --console plain gplayDebugExecuteScreenshotTests \
@@ -32,7 +32,9 @@ do
-Pandroid.testInstrumentationRunnerArguments.DARKMODE="$darkMode" \
$classMethod </dev/null > /dev/null
if [[ $? -ne 0 ]]; then
exit
echo " failed!"
else
echo
fi
else
./gradlew --console plain gplayDebugExecuteScreenshotTests \
@@ -40,12 +42,11 @@ do
-Pandroid.testInstrumentationRunnerArguments.annotation=com.owncloud.android.utils.ScreenshotTest \
-Pandroid.testInstrumentationRunnerArguments.COLOR="$color" \
-Pandroid.testInstrumentationRunnerArguments.DARKMODE="$darkMode" </dev/null > /dev/null \
&& scripts/deleteOutdatedComments.sh "$1-$darkMode-$color" "Screenshot" "$4" \
"$GIT_USERNAME" "$GIT_TOKEN" \
&& scripts/deleteOldComments.sh "$1-$darkMode-$color" "Screenshot" "$4" "$GIT_TOKEN" \
|| resultCode=1 && scripts/uploadReport.sh "$LOG_USERNAME" "$LOG_PASSWORD" "$4" \
"$1-$darkMode-$color" "Screenshot" "$4" "$GIT_USERNAME" "$GIT_TOKEN"
"$1-$darkMode-$color" "Screenshot" "$4" "$GIT_TOKEN"
fi
done < scripts/screenshotCombinations
done
sed -i s'#<bool name="is_beta">true</bool>#<bool name="is_beta">false</bool>#'g src/main/res/values/setup.xml
+12 -12
View File
@@ -7,34 +7,34 @@ LOG_USERNAME=$4
LOG_PASSWORD=$5
DRONE_BUILD_NUMBER=$6
scripts/deleteOldComments.sh "master" "Unit" $DRONE_PULL_REQUEST $GIT_TOKEN
scripts/deleteOldComments.sh "master" "IT" $DRONE_PULL_REQUEST $GIT_TOKEN
./gradlew assembleGplay
./gradlew assembleGplayDebug
scripts/wait_for_emulator.sh
./gradlew jacocoTestGplayDebugUnitTestReport
status=$?
stat=$?
if [ $status -eq 0 ]; then
scripts/deleteOutdatedComments.sh "master" "Unit" $DRONE_PULL_REQUEST $GIT_USERNAME $GIT_TOKEN
else
bash scripts/uploadReport.sh $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER "master" "Unit" $DRONE_PULL_REQUEST $GIT_USERNAME $GIT_TOKEN
if [ ! $stat -eq 0 ]; then
bash scripts/uploadReport.sh $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER "master" "Unit" $DRONE_PULL_REQUEST $GIT_TOKEN
fi
./gradlew installGplayDebugAndroidTest
scripts/wait_for_server.sh "server"
./gradlew createGplayDebugCoverageReport -Pcoverage -Pandroid.testInstrumentationRunnerArguments.notAnnotation=com.owncloud.android.utils.ScreenshotTest
status=$?
stat=$(( stat | $? ))
if [ $status -eq 0 ]; then
scripts/deleteOutdatedComments.sh "master" "IT" $DRONE_PULL_REQUEST $GIT_USERNAME $GIT_TOKEN
else
bash scripts/uploadReport.sh $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER "master" "IT" $DRONE_PULL_REQUEST $GIT_USERNAME $GIT_TOKEN
if [ ! $stat -eq 0 ]; then
bash scripts/uploadReport.sh $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER "master" "IT" $DRONE_PULL_REQUEST $GIT_TOKEN
fi
./gradlew combinedTestReport
status=$?
stat=$(( stat | $? ))
curl -o codecov.sh https://codecov.io/bash
bash ./codecov.sh -t fc506ba4-33c3-43e4-a760-aada38c24fd5
exit $status
echo "Exit with: " $stat
exit $stat
+9 -3
View File
@@ -1,4 +1,10 @@
light blue
dark blue
light white
dark white
#dark blue
#light white
#dark white
#light black
#dark black
#light red
#dark red
#light lightgreen
dark lightgreen
+30
View File
@@ -0,0 +1,30 @@
#!/bin/bash
#
# Nextcloud Android client application
#
# @author Tobias Kaminsky
# Copyright (C) 2021 Tobias Kaminsky
# Copyright (C) 2021 Nextcloud GmbH
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
#
mkdir -p build/screenshotSummary/images
scripts/generateScreenshotOverview.sh > build/screenshotSummary/summary.html
error=$?
scripts/uploadScreenshotSummary.sh $LOG_USERNAME $LOG_PASSWORD
exit $error
+13 -8
View File
@@ -1,15 +1,21 @@
#!/usr/bin/env bash
curl_gh() {
curl \
--header "authorization: Bearer $GITHUB_TOKEN" \
"$@"
}
deleteOldComments() {
# delete all old comments, matching this type
echo "Deleting old comments for $BRANCH_TYPE"
oldComments=$(curl > /dev/null 2>&1 -u $GITHUB_USER:$GITHUB_PASSWORD -X GET https://api.github.com/repos/nextcloud/android/issues/$PR/comments | jq --arg TYPE $BRANCH_TYPE '.[] | (.id |tostring) + "|" + (.user.login | test("nextcloud-android-bot") | tostring) + "|" + (.body | test([$TYPE]) | tostring)'| grep "true|true" | tr -d "\"" | cut -f1 -d"|")
oldComments=$(curl_gh > /dev/null 2>&1 -X GET https://api.github.com/repos/nextcloud/android/issues/$PR/comments | jq --arg TYPE $BRANCH_TYPE '.[] | (.id |tostring) + "|" + (.user.login | test("nextcloud-android-bot") | tostring) + "|" + (.body | test([$TYPE]) | tostring)'| grep "true|true" | tr -d "\"" | cut -f1 -d"|")
count=$(echo $oldComments | grep true | wc -l)
echo "Found $count old comments"
echo $oldComments | while read comment ; do
echo "Deleting comment: $comment"
curl > /dev/null 2>&1 -u $GITHUB_USER:$GITHUB_PASSWORD -X DELETE https://api.github.com/repos/nextcloud/android/issues/comments/$comment
curl_gh > /dev/null 2>&1 -X DELETE https://api.github.com/repos/nextcloud/android/issues/comments/$comment
done
}
@@ -23,7 +29,7 @@ upload() {
echo "Uploaded failing tests to https://www.kaminsky.me/nc-dev/android-integrationTests/$REMOTE_FOLDER"
curl -u $GITHUB_USER:$GITHUB_PASSWORD -X POST https://api.github.com/repos/nextcloud/android/issues/$PR/comments \
curl_gh -X POST https://api.github.com/repos/nextcloud/android/issues/$PR/comments \
-d "{ \"body\" : \"$BRANCH_TYPE test failed: https://www.kaminsky.me/nc-dev/android-integrationTests/$REMOTE_FOLDER \" }"
exit 1
@@ -35,8 +41,7 @@ upload() {
#4: BRANCH (stable or master)
#5: TYPE (IT or Unit)
#6: DRONE_PULL_REQUEST
#7: GIT_USERNAME
#8: GIT_TOKEN
#7: GITHUB_TOKEN
URL=https://nextcloud.kaminsky.me/remote.php/webdav/android-integrationTests
ID=$3
@@ -45,8 +50,8 @@ PASS=$2
BRANCH=$4
TYPE=$5
PR=$6
GITHUB_USER=$7
GITHUB_PASSWORD=$8
GITHUB_TOKEN="$7"
REMOTE_FOLDER=$ID-$TYPE-$BRANCH-$(date +%H-%M)
BRANCH_TYPE=$BRANCH-$TYPE
@@ -71,7 +76,7 @@ else
deleteOldComments
echo "$BRANCH_TYPE test failed, but no output was generated. Maybe a preliminary stage failed."
curl > /dev/null 2>&1 -u $GITHUB_USER:$GITHUB_PASSWORD \
curl_gh > /dev/null 2>&1 \
-X POST https://api.github.com/repos/nextcloud/android/issues/$PR/comments \
-d "{ \"body\" : \"$BRANCH_TYPE test failed, but no output was generated. Maybe a preliminary stage failed. \" }"
+17
View File
@@ -0,0 +1,17 @@
#!/bin/bash -x
#1: LOG_USERNAME
#2: LOG_PASSWORD
DAV_URL=https://nextcloud.kaminsky.me/remote.php/webdav/android-screenshot-summary/
PUBLIC_URL=https://www.kaminsky.me/nc-dev/android-screenshot-summary
USER=$1
PASS=$2
date=$(date +%F)
echo "Uploaded screenshot summary to $PUBLIC_URL/$date/summary.html"
cd build/screenshotSummary
find . -type d -exec curl > /dev/null 2>&1 -u $USER:$PASS -X MKCOL $DAV_URL/$date/$(echo {} | sed s#\./##) \;
find . -type f -exec curl > /dev/null 2>&1 -u $USER:$PASS -X PUT $DAV_URL/$date/$(echo {} | sed s#\./##) --upload-file {} \;
@@ -52,6 +52,7 @@ import net.bytebuddy.utility.RandomString;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Rule;
import org.junit.Test;
import java.io.File;
@@ -84,6 +85,9 @@ public class EndToEndRandomIT extends AbstractOnServerIT {
private int actionCount = 20;
private String rootEncFolder = "/e/";
@Rule
public RetryTestRule retryTestRule = new RetryTestRule();
@BeforeClass
public static void initClass() {
arbitraryDataProvider = new ArbitraryDataProvider(targetContext.getContentResolver());
@@ -95,7 +99,9 @@ public class EndToEndRandomIT extends AbstractOnServerIT {
if (capability.getVersion().equals(new OwnCloudVersion("0.0.0"))) {
// fetch new one
assertTrue(new GetCapabilitiesOperation().execute(client, getStorageManager()).isSuccess());
assertTrue(new GetCapabilitiesOperation(getStorageManager())
.execute(client)
.isSuccess());
}
// tests only for NC19+
assumeTrue(getStorageManager()
@@ -464,8 +470,9 @@ public class EndToEndRandomIT extends AbstractOnServerIT {
false,
account,
false,
targetContext)
.execute(client, getStorageManager())
targetContext,
getStorageManager())
.execute(client)
.isSuccess());
}
@@ -614,8 +621,8 @@ public class EndToEndRandomIT extends AbstractOnServerIT {
Log_OC.d(this, "Remove file: " + child.getDecryptedRemotePath());
}
assertTrue(new RemoveFileOperation(child, false, account, false, targetContext)
.execute(client, getStorageManager())
assertTrue(new RemoveFileOperation(child, false, account, false, targetContext, getStorageManager())
.execute(client)
.isSuccess()
);
}
@@ -135,8 +135,8 @@ public class FileDisplayActivityIT extends AbstractOnServerIT {
FileDisplayActivity sut = activityRule.launchActivity(null);
// given test folder
assertTrue(new CreateFolderOperation("/test/", user, targetContext)
.execute(client, getStorageManager())
assertTrue(new CreateFolderOperation("/test/", user, targetContext, getStorageManager())
.execute(client)
.isSuccess());
// navigate into it
@@ -162,8 +162,8 @@ public class FileDisplayActivityIT extends AbstractOnServerIT {
public void switchToGridView() {
activityRule.launchActivity(null);
assertTrue(new CreateFolderOperation("/test/", user, targetContext)
.execute(client, getStorageManager())
assertTrue(new CreateFolderOperation("/test/", user, targetContext, getStorageManager())
.execute(client)
.isSuccess());
Espresso.onView(withId(R.id.switch_grid_view_button)).perform(click());
@@ -27,6 +27,7 @@ import android.Manifest;
import com.owncloud.android.AbstractIT;
import com.owncloud.android.R;
import com.owncloud.android.ui.activity.FileDisplayActivity;
import com.owncloud.android.ui.fragment.OCFileListFragment;
import com.owncloud.android.utils.ScreenshotTest;
import org.junit.Rule;
@@ -39,6 +40,7 @@ import androidx.test.rule.GrantPermissionRule;
import static androidx.test.espresso.Espresso.onView;
import static androidx.test.espresso.matcher.ViewMatchers.withId;
import static org.junit.Assert.assertNotNull;
public class FileDisplayActivityScreenshotIT extends AbstractIT {
@Rule public IntentsTestRule<FileDisplayActivity> activityRule = new IntentsTestRule<>(FileDisplayActivity.class,
@@ -64,14 +66,16 @@ public class FileDisplayActivityScreenshotIT extends AbstractIT {
screenshot(sut);
}
@Test
@ScreenshotTest
//@Test
//@ScreenshotTest
public void showMediaThenAllFiles() {
FileDisplayActivity sut = activityRule.launchActivity(null);
FileDisplayActivity fileDisplayActivity = activityRule.launchActivity(null);
OCFileListFragment sut = fileDisplayActivity.getListOfFilesFragment();
assertNotNull(sut);
sut.getListOfFilesFragment().setFabEnabled(false);
sut.getListOfFilesFragment().setEmptyListLoadingMessage();
sut.getListOfFilesFragment().setLoading(false);
sut.setFabEnabled(false);
sut.setEmptyListLoadingMessage();
sut.setLoading(false);
// open drawer
onView(withId(R.id.drawer_layout)).perform(DrawerActions.open());
@@ -89,11 +93,11 @@ public class FileDisplayActivityScreenshotIT extends AbstractIT {
// then compare screenshot
shortSleep();
sut.getListOfFilesFragment().setFabEnabled(false);
sut.getListOfFilesFragment().setEmptyListLoadingMessage();
sut.getListOfFilesFragment().setLoading(false);
sut.setFabEnabled(false);
sut.setEmptyListLoadingMessage();
sut.setLoading(false);
shortSleep();
screenshot(sut);
screenshot(fileDisplayActivity);
}
@Test
@@ -86,6 +86,7 @@ public class SettingsActivityIT extends AbstractIT {
SettingsActivity sut = activityRule.launchActivity(null);
sut.handleMnemonicRequest(intent);
Looper.myLooper().quitSafely();
assertTrue(true); // if we reach this, everything is ok
}
}
@@ -71,7 +71,7 @@ public class SyncedFoldersActivityIT extends AbstractIT {
false,
false,
true,
"test@https://server.com",
"test@https://nextcloud.localhost",
0,
0,
true,
@@ -38,7 +38,7 @@ class RegisteredUserTest {
private companion object {
fun buildTestUser(accountName: String): RegisteredUser {
val uri = Uri.parse("https://nextcloud.localhost.localdomain")
val uri = Uri.parse("https://nextcloud.localhost")
val credentials = OwnCloudBasicCredentials("user", "pass")
val account = Account(accountName, "test-type")
val ownCloudAccount = OwnCloudAccount(uri, credentials)
@@ -58,7 +58,7 @@ class RegisteredUserTest {
@Before
fun setUp() {
user = buildTestUser("[email protected].localdomain")
user = buildTestUser("[email protected]")
}
@Test
@@ -25,11 +25,9 @@ package com.nextcloud.client.etm
import android.app.Activity
import androidx.test.espresso.intent.rule.IntentsTestRule
import androidx.test.internal.runner.junit4.statement.UiThreadStatement
import com.nextcloud.client.preferences.AppPreferencesImpl
import com.owncloud.android.AbstractIT
import com.owncloud.android.lib.resources.status.OwnCloudVersion
import com.owncloud.android.utils.ScreenshotTest
import org.junit.Assume
import org.junit.Before
import org.junit.Rule
import org.junit.Test
@@ -37,16 +35,6 @@ class EtmActivityTest : AbstractIT() {
@get:Rule
var activityRule = IntentsTestRule(EtmActivity::class.java, true, false)
@Before
fun before() {
// tests only on NC 18
Assume.assumeTrue(
storageManager
.getCapability(account.name)
.version.compareTo(OwnCloudVersion.nextcloud_18) == 0
)
}
@Test
@ScreenshotTest
fun overview() {
@@ -62,7 +50,11 @@ class EtmActivityTest : AbstractIT() {
fun preferences() {
val sut: EtmActivity = activityRule.launchActivity(null)
UiThreadStatement.runOnUiThread { sut.vm.onPageSelected(0) }
UiThreadStatement.runOnUiThread {
val preferences = AppPreferencesImpl.fromContext(targetContext)
preferences.pushToken = "Push token"
sut.vm.onPageSelected(0)
}
screenshot(sut)
}
@@ -0,0 +1,62 @@
/*
*
* Nextcloud Android client application
*
* @author Tobias Kaminsky
* Copyright (C) 2021 Tobias Kaminsky
* Copyright (C) 2021 Nextcloud GmbH
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.nextcloud.sso
import com.nextcloud.android.sso.InputStreamBinder
import com.nextcloud.android.sso.QueryParam
import org.junit.Assert.assertEquals
import org.junit.Test
class InputStreamBinderTest {
@Test
fun convertMapToNVP() {
val source = mutableMapOf<String, String>()
source["quality"] = "1024p"
source["someOtherParameter"] = "parameterValue"
source["duplicate"] = "1"
source["duplicate"] = "2" // this overwrites previous parameter
val output = InputStreamBinder.convertMapToNVP(source)
assertEquals(source.size, output.size)
assertEquals("1024p", output[0].value)
assertEquals("parameterValue", output[1].value)
assertEquals("2", output[2].value)
}
@Test
fun convertListToNVP() {
val source = mutableListOf<QueryParam>()
source.add(QueryParam("quality", "1024p"))
source.add(QueryParam("someOtherParameter", "parameterValue"))
source.add(QueryParam("duplicate", "1"))
source.add(QueryParam("duplicate", "2")) // here we can have same parameter multiple times
val output = InputStreamBinder.convertListToNVP(source)
assertEquals(source.size, output.size)
assertEquals("1024p", output[0].value)
assertEquals("parameterValue", output[1].value)
assertEquals("1", output[2].value)
assertEquals("2", output[3].value)
}
}
@@ -103,13 +103,13 @@ public abstract class AbstractIT {
}
}
Account temp = new Account("test@https://server.com", MainApp.getAccountType(targetContext));
Account temp = new Account("test@https://nextcloud.localhost", MainApp.getAccountType(targetContext));
platformAccountManager.addAccountExplicitly(temp, "password", null);
platformAccountManager.setUserData(temp, AccountUtils.Constants.KEY_OC_BASE_URL, "https://server.com");
platformAccountManager.setUserData(temp, AccountUtils.Constants.KEY_OC_BASE_URL, "https://nextcloud.localhost");
platformAccountManager.setUserData(temp, KEY_USER_ID, "test");
final UserAccountManager userAccountManager = UserAccountManagerImpl.fromContext(targetContext);
account = userAccountManager.getAccountByName("test@https://server.com");
account = userAccountManager.getAccountByName("test@https://nextcloud.localhost");
if (account == null) {
throw new ActivityNotFoundException();
@@ -156,6 +156,10 @@ public abstract class AbstractIT {
colorHex = "#000000";
break;
case "lightgreen":
colorHex = "#aaff00";
break;
default:
break;
}
@@ -312,8 +316,8 @@ public abstract class AbstractIT {
}
public OCFile createFolder(String remotePath) {
TestCase.assertTrue(new CreateFolderOperation(remotePath, user, targetContext)
.execute(client, getStorageManager())
TestCase.assertTrue(new CreateFolderOperation(remotePath, user, targetContext, getStorageManager())
.execute(client)
.isSuccess());
return getStorageManager().getFileByDecryptedRemotePath(remotePath);
@@ -355,17 +359,18 @@ public abstract class AbstractIT {
targetContext.getContentResolver());
UploadFileOperation newUpload = new UploadFileOperation(
uploadsStorageManager,
connectivityServiceMock,
powerManagementServiceMock,
user,
null,
ocUpload,
NameCollisionPolicy.DEFAULT,
FileUploader.LOCAL_BEHAVIOUR_COPY,
targetContext,
false,
false
uploadsStorageManager,
connectivityServiceMock,
powerManagementServiceMock,
user,
null,
ocUpload,
NameCollisionPolicy.DEFAULT,
FileUploader.LOCAL_BEHAVIOUR_COPY,
targetContext,
false,
false,
getStorageManager()
);
newUpload.addRenameUploadListener(() -> {
// dummy
@@ -373,7 +378,7 @@ public abstract class AbstractIT {
newUpload.setRemoteFolderToBeCreated();
RemoteOperationResult result = newUpload.execute(client, getStorageManager());
RemoteOperationResult result = newUpload.execute(client);
assertTrue(result.getLogMessage(), result.isSuccess());
}
@@ -203,17 +203,18 @@ public abstract class AbstractOnServerIT extends AbstractIT {
targetContext.getContentResolver());
UploadFileOperation newUpload = new UploadFileOperation(
uploadsStorageManager,
connectivityServiceMock,
powerManagementServiceMock,
user,
null,
ocUpload,
NameCollisionPolicy.DEFAULT,
localBehaviour,
targetContext,
false,
false
uploadsStorageManager,
connectivityServiceMock,
powerManagementServiceMock,
user,
null,
ocUpload,
NameCollisionPolicy.DEFAULT,
localBehaviour,
targetContext,
false,
false,
getStorageManager()
);
newUpload.addRenameUploadListener(() -> {
// dummy
@@ -221,7 +222,7 @@ public abstract class AbstractOnServerIT extends AbstractIT {
newUpload.setRemoteFolderToBeCreated();
RemoteOperationResult result = newUpload.execute(client, getStorageManager());
RemoteOperationResult result = newUpload.execute(client);
assertTrue(result.getLogMessage(), result.isSuccess());
OCFile parentFolder = getStorageManager()
@@ -65,8 +65,9 @@ public class DownloadIT extends AbstractOnServerIT {
false,
account,
false,
targetContext)
.execute(client, getStorageManager());
targetContext,
getStorageManager())
.execute(client);
}
}
@@ -27,8 +27,8 @@ public class FileIT extends AbstractOnServerIT {
// folder does not exist yet
assertNull(getStorageManager().getFileByPath(path));
SyncOperation syncOp = new CreateFolderOperation(path, user, targetContext);
RemoteOperationResult result = syncOp.execute(client, getStorageManager());
SyncOperation syncOp = new CreateFolderOperation(path, user, targetContext, getStorageManager());
RemoteOperationResult result = syncOp.execute(client);
assertTrue(result.toString(), result.isSuccess());
@@ -37,7 +37,7 @@ public class FileIT extends AbstractOnServerIT {
assertTrue(file.isFolder());
// cleanup
new RemoveFileOperation(file, false, account, false, targetContext).execute(client, getStorageManager());
new RemoveFileOperation(file, false, account, false, targetContext, getStorageManager()).execute(client);
}
@Test
@@ -46,8 +46,8 @@ public class FileIT extends AbstractOnServerIT {
// folder does not exist yet
assertNull(getStorageManager().getFileByPath(path));
SyncOperation syncOp = new CreateFolderOperation(path, user, targetContext);
RemoteOperationResult result = syncOp.execute(client, getStorageManager());
SyncOperation syncOp = new CreateFolderOperation(path, user, targetContext, getStorageManager());
RemoteOperationResult result = syncOp.execute(client);
assertTrue(result.toString(), result.isSuccess());
// folder exists
@@ -59,7 +59,8 @@ public class FileIT extends AbstractOnServerIT {
false,
account,
false,
targetContext)
.execute(client, getStorageManager());
targetContext,
getStorageManager())
.execute(client);
}
}
@@ -73,8 +73,8 @@ public class ScreenshotsIT extends AbstractOnServerIT {
// folder does not exist yet
if (getStorageManager().getFileByEncryptedRemotePath(path) == null) {
SyncOperation syncOp = new CreateFolderOperation(path, user, targetContext);
RemoteOperationResult result = syncOp.execute(client, getStorageManager());
SyncOperation syncOp = new CreateFolderOperation(path, user, targetContext, getStorageManager());
RemoteOperationResult result = syncOp.execute(client);
assertTrue(result.isSuccess());
}
@@ -114,8 +114,9 @@ public class UploadIT extends AbstractOnServerIT {
false,
account,
false,
targetContext)
.execute(client, getStorageManager());
targetContext,
getStorageManager())
.execute(client);
}
}
@@ -224,24 +225,25 @@ public class UploadIT extends AbstractOnServerIT {
ocUpload.setWhileChargingOnly(true);
UploadFileOperation newUpload = new UploadFileOperation(
uploadsStorageManager,
connectivityServiceMock,
powerManagementServiceMock,
user,
null,
ocUpload,
NameCollisionPolicy.DEFAULT,
FileUploader.LOCAL_BEHAVIOUR_COPY,
targetContext,
false,
true
uploadsStorageManager,
connectivityServiceMock,
powerManagementServiceMock,
user,
null,
ocUpload,
NameCollisionPolicy.DEFAULT,
FileUploader.LOCAL_BEHAVIOUR_COPY,
targetContext,
false,
true,
getStorageManager()
);
newUpload.setRemoteFolderToBeCreated();
newUpload.addRenameUploadListener(() -> {
// dummy
});
RemoteOperationResult result = newUpload.execute(client, getStorageManager());
RemoteOperationResult result = newUpload.execute(client);
assertFalse(result.toString(), result.isSuccess());
assertEquals(RemoteOperationResult.ResultCode.DELAYED_FOR_CHARGING, result.getCode());
}
@@ -271,24 +273,25 @@ public class UploadIT extends AbstractOnServerIT {
ocUpload.setWhileChargingOnly(true);
UploadFileOperation newUpload = new UploadFileOperation(
uploadsStorageManager,
connectivityServiceMock,
powerManagementServiceMock,
user,
null,
ocUpload,
NameCollisionPolicy.DEFAULT,
FileUploader.LOCAL_BEHAVIOUR_COPY,
targetContext,
false,
true
uploadsStorageManager,
connectivityServiceMock,
powerManagementServiceMock,
user,
null,
ocUpload,
NameCollisionPolicy.DEFAULT,
FileUploader.LOCAL_BEHAVIOUR_COPY,
targetContext,
false,
true,
getStorageManager()
);
newUpload.setRemoteFolderToBeCreated();
newUpload.addRenameUploadListener(() -> {
// dummy
});
RemoteOperationResult result = newUpload.execute(client, getStorageManager());
RemoteOperationResult result = newUpload.execute(client);
assertTrue(result.toString(), result.isSuccess());
}
@@ -310,24 +313,25 @@ public class UploadIT extends AbstractOnServerIT {
ocUpload.setUseWifiOnly(true);
UploadFileOperation newUpload = new UploadFileOperation(
uploadsStorageManager,
connectivityServiceMock,
powerManagementServiceMock,
user,
null,
ocUpload,
NameCollisionPolicy.DEFAULT,
FileUploader.LOCAL_BEHAVIOUR_COPY,
targetContext,
true,
false
uploadsStorageManager,
connectivityServiceMock,
powerManagementServiceMock,
user,
null,
ocUpload,
NameCollisionPolicy.DEFAULT,
FileUploader.LOCAL_BEHAVIOUR_COPY,
targetContext,
true,
false,
getStorageManager()
);
newUpload.setRemoteFolderToBeCreated();
newUpload.addRenameUploadListener(() -> {
// dummy
});
RemoteOperationResult result = newUpload.execute(client, getStorageManager());
RemoteOperationResult result = newUpload.execute(client);
assertFalse(result.toString(), result.isSuccess());
assertEquals(RemoteOperationResult.ResultCode.DELAYED_FOR_WIFI, result.getCode());
}
@@ -339,24 +343,25 @@ public class UploadIT extends AbstractOnServerIT {
ocUpload.setWhileChargingOnly(true);
UploadFileOperation newUpload = new UploadFileOperation(
uploadsStorageManager,
connectivityServiceMock,
powerManagementServiceMock,
user,
null,
ocUpload,
NameCollisionPolicy.DEFAULT,
FileUploader.LOCAL_BEHAVIOUR_COPY,
targetContext,
true,
false
uploadsStorageManager,
connectivityServiceMock,
powerManagementServiceMock,
user,
null,
ocUpload,
NameCollisionPolicy.DEFAULT,
FileUploader.LOCAL_BEHAVIOUR_COPY,
targetContext,
true,
false,
getStorageManager()
);
newUpload.setRemoteFolderToBeCreated();
newUpload.addRenameUploadListener(() -> {
// dummy
});
RemoteOperationResult result = newUpload.execute(client, getStorageManager());
RemoteOperationResult result = newUpload.execute(client);
assertTrue(result.toString(), result.isSuccess());
// cleanup
@@ -364,8 +369,9 @@ public class UploadIT extends AbstractOnServerIT {
false,
account,
false,
targetContext)
.execute(client, getStorageManager());
targetContext,
getStorageManager())
.execute(client);
}
@Test
@@ -387,24 +393,25 @@ public class UploadIT extends AbstractOnServerIT {
ocUpload.setUseWifiOnly(true);
UploadFileOperation newUpload = new UploadFileOperation(
uploadsStorageManager,
connectivityServiceMock,
powerManagementServiceMock,
user,
null,
ocUpload,
NameCollisionPolicy.DEFAULT,
FileUploader.LOCAL_BEHAVIOUR_COPY,
targetContext,
true,
false
uploadsStorageManager,
connectivityServiceMock,
powerManagementServiceMock,
user,
null,
ocUpload,
NameCollisionPolicy.DEFAULT,
FileUploader.LOCAL_BEHAVIOUR_COPY,
targetContext,
true,
false,
getStorageManager()
);
newUpload.setRemoteFolderToBeCreated();
newUpload.addRenameUploadListener(() -> {
// dummy
});
RemoteOperationResult result = newUpload.execute(client, getStorageManager());
RemoteOperationResult result = newUpload.execute(client);
assertFalse(result.toString(), result.isSuccess());
assertEquals(RemoteOperationResult.ResultCode.DELAYED_FOR_WIFI, result.getCode());
}
@@ -50,6 +50,7 @@ import java.util.List;
import static com.owncloud.android.lib.resources.files.SearchRemoteOperation.SearchType.GALLERY_SEARCH;
import static com.owncloud.android.lib.resources.files.SearchRemoteOperation.SearchType.PHOTO_SEARCH;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
@@ -76,8 +77,10 @@ abstract public class FileDataStorageManagerIT extends AbstractOnServerIT {
@Test
public void simpleTest() {
assertTrue(sut.getFileByPath("/").fileExists());
assertNull(sut.getFileByPath("/123123"));
OCFile file = sut.getFileByDecryptedRemotePath("/");
assertNotNull(file);
assertTrue(file.fileExists());
assertNull(sut.getFileByDecryptedRemotePath("/123123"));
}
@Test
@@ -112,9 +115,9 @@ abstract public class FileDataStorageManagerIT extends AbstractOnServerIT {
.execute(client).isSuccess());
// sync
assertNull(sut.getFileByPath("/1/1/"));
assertNull(sut.getFileByDecryptedRemotePath("/1/1/"));
assertTrue(new RefreshFolderOperation(sut.getFileByPath("/"),
assertTrue(new RefreshFolderOperation(sut.getFileByDecryptedRemotePath("/"),
System.currentTimeMillis() / 1000,
false,
false,
@@ -122,7 +125,7 @@ abstract public class FileDataStorageManagerIT extends AbstractOnServerIT {
account,
targetContext).execute(client).isSuccess());
assertTrue(new RefreshFolderOperation(sut.getFileByPath("/1/"),
assertTrue(new RefreshFolderOperation(sut.getFileByDecryptedRemotePath("/1/"),
System.currentTimeMillis() / 1000,
false,
false,
@@ -130,7 +133,7 @@ abstract public class FileDataStorageManagerIT extends AbstractOnServerIT {
account,
targetContext).execute(client).isSuccess());
assertTrue(new RefreshFolderOperation(sut.getFileByPath("/1/1/"),
assertTrue(new RefreshFolderOperation(sut.getFileByDecryptedRemotePath("/1/1/"),
System.currentTimeMillis() / 1000,
false,
false,
@@ -138,7 +141,7 @@ abstract public class FileDataStorageManagerIT extends AbstractOnServerIT {
account,
targetContext).execute(client).isSuccess());
assertEquals(3, sut.getFolderContent(sut.getFileByPath("/1/1/"), false).size());
assertEquals(3, sut.getFolderContent(sut.getFileByDecryptedRemotePath("/1/1/"), false).size());
}
/**
@@ -150,7 +153,7 @@ abstract public class FileDataStorageManagerIT extends AbstractOnServerIT {
String remotePath = "/imageFile.png";
VirtualFolderType virtualType = VirtualFolderType.GALLERY;
assertEquals(0, sut.getFolderContent(sut.getFileByPath("/"), false).size());
assertEquals(0, sut.getFolderContent(sut.getFileByDecryptedRemotePath("/"), false).size());
assertEquals(1, sut.getAllFiles().size());
File imageFile = getFile("imageFile.png");
@@ -160,18 +163,18 @@ abstract public class FileDataStorageManagerIT extends AbstractOnServerIT {
String.valueOf(System.currentTimeMillis() / 1000))
.execute(client).isSuccess());
assertNull(sut.getFileByPath(remotePath));
assertNull(sut.getFileByDecryptedRemotePath(remotePath));
// search
SearchRemoteOperation searchRemoteOperation = new SearchRemoteOperation("image/%",
PHOTO_SEARCH,
false);
RemoteOperationResult searchResult = searchRemoteOperation.execute(client);
RemoteOperationResult<List<RemoteFile>> searchResult = searchRemoteOperation.execute(client);
TestCase.assertTrue(searchResult.isSuccess());
TestCase.assertEquals(1, searchResult.getData().size());
TestCase.assertEquals(1, searchResult.getResultData().size());
OCFile ocFile = FileStorageUtils.fillOCFile((RemoteFile) searchResult.getData().get(0));
OCFile ocFile = FileStorageUtils.fillOCFile(searchResult.getResultData().get(0));
sut.saveFile(ocFile);
List<ContentValues> contentValues = new ArrayList<>();
@@ -185,13 +188,13 @@ abstract public class FileDataStorageManagerIT extends AbstractOnServerIT {
assertEquals(remotePath, ocFile.getRemotePath());
assertEquals(0, sut.getFolderContent(sut.getFileByPath("/"), false).size());
assertEquals(0, sut.getFolderContent(sut.getFileByDecryptedRemotePath("/"), false).size());
assertEquals(1, sut.getVirtualFolderContent(virtualType, false).size());
assertEquals(2, sut.getAllFiles().size());
// update root
assertTrue(new RefreshFolderOperation(sut.getFileByPath("/"),
assertTrue(new RefreshFolderOperation(sut.getFileByDecryptedRemotePath("/"),
System.currentTimeMillis() / 1000,
false,
false,
@@ -200,12 +203,12 @@ abstract public class FileDataStorageManagerIT extends AbstractOnServerIT {
targetContext).execute(client).isSuccess());
assertEquals(1, sut.getFolderContent(sut.getFileByPath("/"), false).size());
assertEquals(1, sut.getFolderContent(sut.getFileByDecryptedRemotePath("/"), false).size());
assertEquals(1, sut.getVirtualFolderContent(virtualType, false).size());
assertEquals(2, sut.getAllFiles().size());
assertEquals(sut.getVirtualFolderContent(virtualType, false).get(0),
sut.getFolderContent(sut.getFileByPath("/"), false).get(0));
sut.getFolderContent(sut.getFileByDecryptedRemotePath("/"), false).get(0));
}
/**
@@ -220,43 +223,46 @@ abstract public class FileDataStorageManagerIT extends AbstractOnServerIT {
.acquireContentProviderClient(ProviderMeta.ProviderTableMeta.CONTENT_URI)
);
String remotePath = "/imageFile.png";
String imagePath = "/imageFile.png";
VirtualFolderType virtualType = VirtualFolderType.GALLERY;
assertEquals(0, sut.getFolderContent(sut.getFileByPath("/"), false).size());
assertEquals(0, sut.getFolderContent(sut.getFileByDecryptedRemotePath("/"), false).size());
assertEquals(1, sut.getAllFiles().size());
File imageFile = getFile("imageFile.png");
assertTrue(new UploadFileRemoteOperation(imageFile.getAbsolutePath(),
"/imageFile.png",
imagePath,
"image/png",
String.valueOf(System.currentTimeMillis() / 1000))
String.valueOf((System.currentTimeMillis() - 10000) / 1000))
.execute(client).isSuccess());
// Check that file does not yet exist in local database
assertNull(sut.getFileByPath("/imageFile.png"));
assertNull(sut.getFileByDecryptedRemotePath(imagePath));
String videoPath = "/videoFile.mp4";
File videoFile = getFile("videoFile.mp4");
assertTrue(new UploadFileRemoteOperation(videoFile.getAbsolutePath(),
"/videoFile.mp4",
videoPath,
"video/mpeg",
String.valueOf(System.currentTimeMillis() / 1000))
String.valueOf((System.currentTimeMillis() + 10000) / 1000))
.execute(client).isSuccess());
// Check that file does not yet exist in local database
assertNull(sut.getFileByPath("/videoFile.mp4"));
assertNull(sut.getFileByDecryptedRemotePath(videoPath));
// search
SearchRemoteOperation searchRemoteOperation = new SearchRemoteOperation("",
GALLERY_SEARCH,
false);
RemoteOperationResult searchResult = searchRemoteOperation.execute(client);
RemoteOperationResult<List<RemoteFile>> searchResult = searchRemoteOperation.execute(client);
TestCase.assertTrue(searchResult.isSuccess());
TestCase.assertEquals(2, searchResult.getData().size());
TestCase.assertEquals(2, searchResult.getResultData().size());
OCFile ocFile = FileStorageUtils.fillOCFile((RemoteFile) searchResult.getData().get(0));
// newest file must be video path (as sorted by recently modified)
OCFile ocFile = FileStorageUtils.fillOCFile( searchResult.getResultData().get(0));
sut.saveFile(ocFile);
assertEquals(videoPath, ocFile.getRemotePath());
List<ContentValues> contentValues = new ArrayList<>();
ContentValues cv = new ContentValues();
@@ -265,8 +271,10 @@ abstract public class FileDataStorageManagerIT extends AbstractOnServerIT {
contentValues.add(cv);
OCFile ocFile2 = FileStorageUtils.fillOCFile((RemoteFile) searchResult.getData().get(0));
// second is image file, as older
OCFile ocFile2 = FileStorageUtils.fillOCFile(searchResult.getResultData().get(1));
sut.saveFile(ocFile2);
assertEquals(imagePath, ocFile2.getRemotePath());
ContentValues cv2 = new ContentValues();
cv2.put(ProviderMeta.ProviderTableMeta.VIRTUAL_TYPE, virtualType.toString());
@@ -276,15 +284,13 @@ abstract public class FileDataStorageManagerIT extends AbstractOnServerIT {
sut.saveVirtuals(contentValues);
assertEquals(remotePath, ocFile.getRemotePath());
assertEquals(0, sut.getFolderContent(sut.getFileByPath("/"), false).size());
assertEquals(0, sut.getFolderContent(sut.getFileByDecryptedRemotePath("/"), false).size());
assertEquals(2, sut.getVirtualFolderContent(virtualType, false).size());
assertEquals(2, sut.getAllFiles().size());
assertEquals(3, sut.getAllFiles().size());
// update root
assertTrue(new RefreshFolderOperation(sut.getFileByPath("/"),
assertTrue(new RefreshFolderOperation(sut.getFileByDecryptedRemotePath("/"),
System.currentTimeMillis() / 1000,
false,
false,
@@ -293,19 +299,19 @@ abstract public class FileDataStorageManagerIT extends AbstractOnServerIT {
targetContext).execute(client).isSuccess());
assertEquals(2, sut.getFolderContent(sut.getFileByPath("/"), false).size());
assertEquals(2, sut.getFolderContent(sut.getFileByDecryptedRemotePath("/"), false).size());
assertEquals(2, sut.getVirtualFolderContent(virtualType, false).size());
assertEquals(3, sut.getAllFiles().size());
assertEquals(sut.getVirtualFolderContent(virtualType, false).get(0),
sut.getFolderContent(sut.getFileByPath("/"), false).get(0));
sut.getFolderContent(sut.getFileByDecryptedRemotePath("/"), false).get(0));
}
@Test
public void testSaveNewFile() {
assertTrue(new CreateFolderRemoteOperation("/1/1/", true).execute(client).isSuccess());
assertTrue(new RefreshFolderOperation(sut.getFileByPath("/"),
assertTrue(new RefreshFolderOperation(sut.getFileByDecryptedRemotePath("/"),
System.currentTimeMillis() / 1000,
false,
false,
@@ -313,7 +319,7 @@ abstract public class FileDataStorageManagerIT extends AbstractOnServerIT {
account,
targetContext).execute(client).isSuccess());
assertTrue(new RefreshFolderOperation(sut.getFileByPath("/1/"),
assertTrue(new RefreshFolderOperation(sut.getFileByDecryptedRemotePath("/1/"),
System.currentTimeMillis() / 1000,
false,
false,
@@ -321,7 +327,7 @@ abstract public class FileDataStorageManagerIT extends AbstractOnServerIT {
account,
targetContext).execute(client).isSuccess());
assertTrue(new RefreshFolderOperation(sut.getFileByPath("/1/1/"),
assertTrue(new RefreshFolderOperation(sut.getFileByDecryptedRemotePath("/1/1/"),
System.currentTimeMillis() / 1000,
false,
false,
@@ -58,7 +58,7 @@ public class OCFileUnitTest {
private static final long LAST_SYNC_DATE_FOR_PROPERTIES = 5432109876L;
private static final long LAST_SYNC_DATE_FOR_DATA = 4321098765L;
private static final String ETAG = "adshfas98ferqw8f9yu2";
private static final String PUBLIC_LINK = "https://fake.url.net/owncloud/987427448712984sdas29";
private static final String PUBLIC_LINK = "https://nextcloud.localhost/owncloud/987427448712984sdas29";
private static final String PERMISSIONS = "SRKNVD";
private static final String REMOTE_ID = "jadñgiadf8203:9jrp98v2mn3er2089fh";
private static final String ETAG_IN_CONFLICT = "2adshfas98ferqw8f9yu";
@@ -7,6 +7,7 @@ import android.content.ContentResolver;
import android.content.Context;
import com.nextcloud.client.account.CurrentAccountProvider;
import com.nextcloud.client.account.User;
import com.nextcloud.client.account.UserAccountManager;
import com.nextcloud.client.account.UserAccountManagerImpl;
import com.owncloud.android.AbstractIT;
@@ -47,17 +48,18 @@ import static org.junit.Assert.assertTrue;
public class UploadStorageManagerTest extends AbstractIT {
private UploadsStorageManager uploadsStorageManager;
private CurrentAccountProvider currentAccountProvider = () -> null;
private Account account2;
private UserAccountManager userAccountManager;
private User user2;
@Before
public void setUp() {
Context instrumentationCtx = ApplicationProvider.getApplicationContext();
ContentResolver contentResolver = instrumentationCtx.getContentResolver();
uploadsStorageManager = new UploadsStorageManager(currentAccountProvider, contentResolver);
userAccountManager = UserAccountManagerImpl.fromContext(targetContext);
Account temp = new Account("[email protected]", MainApp.getAccountType(targetContext));
UserAccountManager accountManager = UserAccountManagerImpl.fromContext(targetContext);
if (!accountManager.exists(temp)) {
if (!userAccountManager.exists(temp)) {
AccountManager platformAccountManager = AccountManager.get(targetContext);
platformAccountManager.addAccountExplicitly(temp, "testPassword", null);
platformAccountManager.setUserData(temp, AccountUtils.Constants.KEY_OC_ACCOUNT_VERSION,
@@ -68,27 +70,23 @@ public class UploadStorageManagerTest extends AbstractIT {
}
final UserAccountManager userAccountManager = UserAccountManagerImpl.fromContext(targetContext);
account2 = userAccountManager.getAccountByName("[email protected]");
if (account2 == null) {
throw new ActivityNotFoundException();
}
user2 = userAccountManager.getUser("[email protected]").orElseThrow(ActivityNotFoundException::new);
}
@Test
public void testDeleteAllUploads() {
// Clean
for (Account account : getAllAccounts()) {
uploadsStorageManager.removeAccountUploads(account);
for (User user : userAccountManager.getAllUsers()) {
uploadsStorageManager.removeUserUploads(user);
}
int accountRowsA = 3;
int accountRowsB = 4;
insertUploads(account, accountRowsA);
insertUploads(account2, accountRowsB);
insertUploads(user2.toPlatformAccount(), accountRowsB);
assertEquals("Expected 4 removed uploads files",
4,
uploadsStorageManager.removeAccountUploads(account2));
uploadsStorageManager.removeUserUploads(user2));
}
@Test
@@ -212,8 +210,6 @@ public class UploadStorageManagerTest extends AbstractIT {
@After
public void tearDown() {
deleteAllUploads();
AccountManager platformAccountManager = AccountManager.get(targetContext);
platformAccountManager.removeAccountExplicitly(account2);
userAccountManager.removeUser(user2);
}
}
@@ -156,7 +156,7 @@ class FileUploaderIT : AbstractOnServerIT() {
assertEquals(file.length(), (result.data[0] as RemoteFile).length)
val ocFile2 = OCFile("/testFile.txt")
ocFile2.setStoragePath(getDummyFile("/empty.txt").absolutePath)
ocFile2.storagePath = getDummyFile("/empty.txt").absolutePath
FileUploader.uploadUpdateFile(
targetContext,
@@ -196,10 +196,11 @@ class FileUploaderIT : AbstractOnServerIT() {
FileUploader.LOCAL_BEHAVIOUR_COPY,
targetContext,
false,
false
false,
storageManager
)
.setRemoteFolderToBeCreated()
.execute(client, storageManager)
.execute(client)
.isSuccess
)
@@ -223,12 +224,13 @@ class FileUploaderIT : AbstractOnServerIT() {
FileUploader.LOCAL_BEHAVIOUR_COPY,
targetContext,
false,
false
false,
storageManager
)
.addRenameUploadListener {
renameListenerWasTriggered = true
}
.execute(client, storageManager)
.execute(client)
.isSuccess
)
@@ -273,7 +275,7 @@ class FileUploaderIT : AbstractOnServerIT() {
assertEquals(file.length(), (result.data[0] as RemoteFile).length)
val ocFile2 = OCFile("/testFile.txt")
ocFile2.setStoragePath(getDummyFile("/empty.txt").absolutePath)
ocFile2.storagePath = getDummyFile("/empty.txt").absolutePath
FileUploader.uploadUpdateFile(
targetContext,
@@ -316,10 +318,11 @@ class FileUploaderIT : AbstractOnServerIT() {
FileUploader.LOCAL_BEHAVIOUR_COPY,
targetContext,
false,
false
false,
storageManager
)
.setRemoteFolderToBeCreated()
.execute(client, storageManager)
.execute(client)
.isSuccess
)
@@ -342,9 +345,10 @@ class FileUploaderIT : AbstractOnServerIT() {
FileUploader.LOCAL_BEHAVIOUR_COPY,
targetContext,
false,
false
false,
storageManager
)
.execute(client, storageManager).isSuccess
.execute(client).isSuccess
)
val result2 = ReadFileRemoteOperation("/testFile.txt").execute(client)
@@ -382,7 +386,7 @@ class FileUploaderIT : AbstractOnServerIT() {
assertEquals(file.length(), (result.data[0] as RemoteFile).length)
val ocFile2 = OCFile("/testFile.txt")
ocFile2.setStoragePath(getDummyFile("/empty.txt").absolutePath)
ocFile2.storagePath = getDummyFile("/empty.txt").absolutePath
FileUploader.uploadUpdateFile(
targetContext,
@@ -420,10 +424,11 @@ class FileUploaderIT : AbstractOnServerIT() {
FileUploader.LOCAL_BEHAVIOUR_COPY,
targetContext,
false,
false
false,
storageManager
)
.setRemoteFolderToBeCreated()
.execute(client, storageManager)
.execute(client)
.isSuccess
)
@@ -445,9 +450,10 @@ class FileUploaderIT : AbstractOnServerIT() {
FileUploader.LOCAL_BEHAVIOUR_COPY,
targetContext,
false,
false
false,
storageManager
)
.execute(client, storageManager)
.execute(client)
assertFalse(uploadResult.isSuccess)
assertTrue(uploadResult.exception is OperationCancelledException)
@@ -487,7 +493,7 @@ class FileUploaderIT : AbstractOnServerIT() {
assertEquals(file.length(), (result.data[0] as RemoteFile).length)
val ocFile2 = OCFile("/testFile.txt")
ocFile2.setStoragePath(getDummyFile("/empty.txt").absolutePath)
ocFile2.storagePath = getDummyFile("/empty.txt").absolutePath
FileUploader.uploadUpdateFile(
targetContext,
@@ -0,0 +1,85 @@
/*
*
* Nextcloud Android client application
*
* @author Tobias Kaminsky
* Copyright (C) 2021 Tobias Kaminsky
* Copyright (C) 2021 Nextcloud GmbH
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.owncloud.android.operations
import com.owncloud.android.AbstractOnServerIT
import com.owncloud.android.lib.resources.files.CreateFolderRemoteOperation
import com.owncloud.android.lib.resources.shares.CreateShareRemoteOperation
import com.owncloud.android.lib.resources.shares.OCShare
import com.owncloud.android.lib.resources.shares.ShareType
import junit.framework.TestCase
import org.junit.Assert.assertEquals
import org.junit.Assert.assertTrue
import org.junit.Test
@Suppress("MagicNumber")
class GetSharesForFileOperationIT : AbstractOnServerIT() {
@Test
fun shares() {
val remotePath = "/share/"
assertTrue(CreateFolderRemoteOperation(remotePath, true).execute(client).isSuccess)
// share folder to user "admin"
TestCase.assertTrue(
CreateShareRemoteOperation(
remotePath,
ShareType.USER,
"admin",
false,
"",
OCShare.MAXIMUM_PERMISSIONS_FOR_FOLDER
)
.execute(client).isSuccess
)
// share folder via public link
TestCase.assertTrue(
CreateShareRemoteOperation(
remotePath,
ShareType.PUBLIC_LINK,
"",
true,
"",
OCShare.READ_PERMISSION_FLAG
)
.execute(client).isSuccess
)
// share folder to group
assertTrue(
CreateShareRemoteOperation(
remotePath,
ShareType.GROUP,
"users",
false,
"",
OCShare.NO_PERMISSION
)
.execute(client).isSuccess
)
val shareResult = GetSharesForFileOperation(remotePath, false, false, storageManager).execute(client)
assertTrue(shareResult.isSuccess)
assertEquals(3, (shareResult.data as ArrayList<OCShare>).size)
}
}
@@ -38,7 +38,7 @@ public class RemoveFileOperationIT extends AbstractOnServerIT {
public void deleteFolder() {
String parent = "/test/";
String path = parent + "folder1/";
assertTrue(new CreateFolderOperation(path, user, targetContext).execute(client, getStorageManager())
assertTrue(new CreateFolderOperation(path, user, targetContext, getStorageManager()).execute(client)
.isSuccess());
OCFile folder = getStorageManager().getFileByPath(path);
@@ -49,8 +49,9 @@ public class RemoveFileOperationIT extends AbstractOnServerIT {
false,
account,
false,
targetContext)
.execute(client, getStorageManager())
targetContext,
getStorageManager())
.execute(client)
.isSuccess());
OCFile parentFolder = getStorageManager().getFileByPath(parent);
@@ -60,8 +61,9 @@ public class RemoveFileOperationIT extends AbstractOnServerIT {
false,
account,
false,
targetContext)
.execute(client, getStorageManager())
targetContext,
getStorageManager())
.execute(client)
.isSuccess());
}
@@ -81,8 +83,9 @@ public class RemoveFileOperationIT extends AbstractOnServerIT {
false,
account,
false,
targetContext)
.execute(client, getStorageManager())
targetContext,
getStorageManager())
.execute(client)
.isSuccess());
OCFile parentFolder = getStorageManager().getFileByPath(parent);
@@ -92,8 +95,9 @@ public class RemoveFileOperationIT extends AbstractOnServerIT {
false,
account,
false,
targetContext)
.execute(client, getStorageManager())
targetContext,
getStorageManager())
.execute(client)
.isSuccess());
}
}
@@ -6,7 +6,6 @@ import androidx.documentfile.provider.DocumentFile
import com.owncloud.android.AbstractOnServerIT
import com.owncloud.android.R
import com.owncloud.android.datamodel.OCFile.ROOT_PATH
import com.owncloud.android.lib.common.network.WebdavUtils
import com.owncloud.android.providers.DocumentsProviderUtils.assertExistsOnServer
import com.owncloud.android.providers.DocumentsProviderUtils.assertListFilesEquals
import com.owncloud.android.providers.DocumentsProviderUtils.assertReadEquals
@@ -183,7 +182,9 @@ class DocumentsStorageProviderIT : AbstractOnServerIT() {
val file1 = rootDir.createFile("text/plain", RandomString.make())!!
file1.assertRegularFile(size = 0L)
val createdETag = file1.getOCFile(storageManager)!!.etag
val createdETag = file1.getOCFile(storageManager)!!.etagOnServer
assertTrue(createdETag.isNotEmpty())
val content1 = "initial content".toByteArray()
@@ -192,8 +193,10 @@ class DocumentsStorageProviderIT : AbstractOnServerIT() {
it!!.write(content1)
}
while (file1.getOCFile(storageManager)!!.etag == createdETag) {
// refresh
while (file1.getOCFile(storageManager)!!.etagOnServer == createdETag) {
shortSleep()
rootDir.listFiles()
}
val remotePath = file1.getOCFile(storageManager)!!.remotePath
@@ -201,7 +204,7 @@ class DocumentsStorageProviderIT : AbstractOnServerIT() {
val content2 = "new content".toByteArray()
// modify content on server side
val putMethod = PutMethod(client.webdavUri.toString() + WebdavUtils.encodePath(remotePath))
val putMethod = PutMethod(client.getFilesDavUri(remotePath))
putMethod.requestEntity = ByteArrayRequestEntity(content2)
assertEquals(HttpStatus.SC_NO_CONTENT, client.executeMethod(putMethod))
client.exhaustResponse(putMethod.responseBodyAsStream)
@@ -40,6 +40,10 @@ class NotificationsActivityIT : AbstractIT() {
fun loading() {
val sut: NotificationsActivity = activityRule.launchActivity(null)
waitForIdleSync()
sut.runOnUiThread { sut.setLoadingMessageEmpty() }
screenshot(sut)
}
@@ -87,9 +91,10 @@ class NotificationsActivityIT : AbstractIT() {
)
)
val actions = ArrayList<Action>()
actions.add(Action("Send usage", "link", "url", true))
actions.add(Action("Not now", "link", "url", false))
val actions = ArrayList<Action>().apply {
add(Action("Send usage", "link", "url", true))
add(Action("Not now", "link", "url", false))
}
notifications.add(
Notification(
@@ -112,6 +117,34 @@ class NotificationsActivityIT : AbstractIT() {
)
)
val moreAction = ArrayList<Action>().apply {
add(Action("Send usage", "link", "url", true))
add(Action("Not now", "link", "url", false))
add(Action("third action", "link", "url", false))
add(Action("Delay", "link", "url", false))
}
notifications.add(
Notification(
2,
"files",
"user",
date.time,
"objectType",
"objectId",
"Help improve Nextcloud",
"SubjectRich",
HashMap<String, RichObject>(),
"Do you want to help us to improve Nextcloud by providing some anonymize data about your setup and " +
"usage?",
"MessageRich",
HashMap<String, RichObject>(),
"link",
"icon",
moreAction
)
)
sut.runOnUiThread { sut.populateList(notifications) }
shortSleep()
@@ -44,6 +44,7 @@ import com.owncloud.android.lib.common.Creator;
import com.owncloud.android.lib.common.DirectEditing;
import com.owncloud.android.lib.common.Editor;
import com.owncloud.android.lib.common.OwnCloudAccount;
import com.owncloud.android.lib.common.accounts.AccountTypeUtils;
import com.owncloud.android.lib.common.accounts.AccountUtils;
import com.owncloud.android.lib.resources.status.CapabilityBooleanType;
import com.owncloud.android.lib.resources.status.OCCapability;
@@ -56,6 +57,7 @@ import com.owncloud.android.ui.fragment.OCFileListBottomSheetDialog;
import com.owncloud.android.utils.MimeTypeUtil;
import com.owncloud.android.utils.ScreenshotTest;
import org.junit.After;
import org.junit.Rule;
import org.junit.Test;
@@ -70,9 +72,19 @@ import androidx.test.espresso.intent.rule.IntentsTestRule;
import static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;
public class DialogFragmentIT extends AbstractIT {
private final String SERVER_URL = "https://nextcloud.localhost";
@Rule public IntentsTestRule<FileDisplayActivity> activityRule =
new IntentsTestRule<>(FileDisplayActivity.class, true, false);
@After
public void quitLooperIfNeeded() {
if (Looper.myLooper() != null) {
Looper.myLooper().quitSafely();
}
}
@Test
@ScreenshotTest
public void testRenameFileDialog() {
@@ -164,17 +176,20 @@ public class DialogFragmentIT extends AbstractIT {
accountManager.removeAccountExplicitly(account);
}
Account newAccount = new Account("test@https://server.com", MainApp.getAccountType(targetContext));
Account newAccount = new Account("test@https://nextcloud.localhost", MainApp.getAccountType(targetContext));
accountManager.addAccountExplicitly(newAccount, "password", null);
accountManager.setUserData(newAccount, AccountUtils.Constants.KEY_OC_BASE_URL, "https://server.com");
accountManager.setUserData(newAccount, AccountUtils.Constants.KEY_OC_BASE_URL, SERVER_URL);
accountManager.setUserData(newAccount, AccountUtils.Constants.KEY_USER_ID, "test");
accountManager.setAuthToken(newAccount, AccountTypeUtils.getAuthTokenTypePass(newAccount.type), "password");
Account newAccount2 = new Account("user1@server.com", MainApp.getAccountType(targetContext));
Account newAccount2 = new Account("user1@nextcloud.localhost", MainApp.getAccountType(targetContext));
accountManager.addAccountExplicitly(newAccount2, "password", null);
accountManager.setUserData(newAccount2, AccountUtils.Constants.KEY_OC_BASE_URL, "https://server.com");
accountManager.setUserData(newAccount2, AccountUtils.Constants.KEY_OC_BASE_URL, SERVER_URL);
accountManager.setUserData(newAccount2, AccountUtils.Constants.KEY_USER_ID, "user1");
accountManager.setUserData(newAccount2, AccountUtils.Constants.KEY_OC_VERSION, "20.0.0");
accountManager.setAuthToken(newAccount2, AccountTypeUtils.getAuthTokenTypePass(newAccount.type), "password");
FileDataStorageManager fileDataStorageManager = new FileDataStorageManager(newAccount,
targetContext.getContentResolver());
@@ -187,7 +202,7 @@ public class DialogFragmentIT extends AbstractIT {
ChooseAccountDialogFragment sut =
ChooseAccountDialogFragment.newInstance(new RegisteredUser(newAccount,
new OwnCloudAccount(newAccount, targetContext),
new Server(URI.create("https://server.com"),
new Server(URI.create(SERVER_URL),
OwnCloudVersion.nextcloud_20)));
FileDisplayActivity activity = showDialog(sut);
@@ -232,10 +247,11 @@ public class DialogFragmentIT extends AbstractIT {
accountManager.removeAccountExplicitly(account);
}
Account newAccount = new Account("test@https://server.com", MainApp.getAccountType(targetContext));
Account newAccount = new Account("test@https://nextcloud.localhost", MainApp.getAccountType(targetContext));
accountManager.addAccountExplicitly(newAccount, "password", null);
accountManager.setUserData(newAccount, AccountUtils.Constants.KEY_OC_BASE_URL, "https://server.com");
accountManager.setUserData(newAccount, AccountUtils.Constants.KEY_OC_BASE_URL, SERVER_URL);
accountManager.setUserData(newAccount, AccountUtils.Constants.KEY_USER_ID, "test");
accountManager.setAuthToken(newAccount, AccountTypeUtils.getAuthTokenTypePass(newAccount.type), "password");
FileDataStorageManager fileDataStorageManager = new FileDataStorageManager(newAccount,
targetContext.getContentResolver());
@@ -248,7 +264,7 @@ public class DialogFragmentIT extends AbstractIT {
ChooseAccountDialogFragment sut =
ChooseAccountDialogFragment.newInstance(new RegisteredUser(newAccount,
new OwnCloudAccount(newAccount, targetContext),
new Server(URI.create("https://server.com"),
new Server(URI.create(SERVER_URL),
OwnCloudVersion.nextcloud_20)));
showDialog(sut);
}
@@ -56,7 +56,7 @@ class AvatarIT : AbstractIT() {
fragment.addAvatar("winston brent", avatarRadius, width, targetContext)
fragment.addAvatar("Baker James Lorena", avatarRadius, width, targetContext)
fragment.addAvatar("Baker James Lorena", avatarRadius, width, targetContext)
fragment.addAvatar("email@server.com", avatarRadius, width, targetContext)
fragment.addAvatar("email@nextcloud.localhost", avatarRadius, width, targetContext)
}
shortSleep()
@@ -110,7 +110,7 @@ class FileDetailSharingFragmentIT : AbstractIT() {
OCShare(file.decryptedRemotePath).apply {
remoteId = 3
shareType = ShareType.EMAIL
sharedWithDisplayName = "admin@nextcloud.server.com"
sharedWithDisplayName = "admin@nextcloud.localhost"
userId = getUserId(user)
activity.storageManager.saveShare(this)
}
@@ -132,7 +132,7 @@ class FileDetailSharingFragmentIT : AbstractIT() {
OCShare(file.decryptedRemotePath).apply {
remoteId = 6
shareType = ShareType.FEDERATED
sharedWithDisplayName = "admin@nextcloud.remoteserver.com"
sharedWithDisplayName = "admin@nextcloud.localhost"
permissions = OCShare.FEDERATED_PERMISSIONS_FOR_FILE
userId = getUserId(user)
activity.storageManager.saveShare(this)
@@ -104,7 +104,7 @@ class OCFileListFragmentStaticServerIT : AbstractIT() {
val emailShare = OCFile("/sharedToEmail.jpg").apply {
parentId = sut.storageManager.getFileByEncryptedRemotePath("/").fileId
isSharedWithSharee = true
sharees = listOf(ShareeUser("admin@nextcloud.server.com", "admin@nextcloud.server.com", ShareType.EMAIL))
sharees = listOf(ShareeUser("admin@nextcloud.localhost", "admin@nextcloud.localhost", ShareType.EMAIL))
}
sut.storageManager.saveFile(emailShare)
@@ -123,15 +123,15 @@ class TrashbinActivityIT : AbstractIT() {
@Test
fun differentUser() {
val temp = Account("differentUser@https://server.com", MainApp.getAccountType(targetContext))
val temp = Account("differentUser@https://nextcloud.localhost", MainApp.getAccountType(targetContext))
val platformAccountManager = AccountManager.get(targetContext)
platformAccountManager.addAccountExplicitly(temp, "password", null)
platformAccountManager.setUserData(temp, AccountUtils.Constants.KEY_OC_BASE_URL, "https://server.com")
platformAccountManager.setUserData(temp, AccountUtils.Constants.KEY_OC_BASE_URL, "https://nextcloud.localhost")
platformAccountManager.setUserData(temp, AccountUtils.Constants.KEY_USER_ID, "differentUser")
val intent = Intent()
intent.putExtra(Intent.EXTRA_USER, "differentUser@https://server.com")
intent.putExtra(Intent.EXTRA_USER, "differentUser@https://nextcloud.localhost")
val sut: TrashbinActivity = activityRule.launchActivity(intent)
val trashbinRepository = TrashbinLocalRepository(TestCase.EMPTY)
@@ -26,6 +26,7 @@ import android.text.TextUtils;
import com.google.gson.JsonElement;
import com.google.gson.JsonParser;
import com.google.gson.reflect.TypeToken;
import com.nextcloud.client.RetryTestRule;
import com.owncloud.android.datamodel.DecryptedFolderMetadata;
import com.owncloud.android.datamodel.EncryptedFolderMetadata;
import com.owncloud.android.lib.common.utils.Log_OC;
@@ -35,6 +36,7 @@ import com.owncloud.android.utils.EncryptionUtils;
import net.bytebuddy.utility.RandomString;
import org.apache.commons.io.FileUtils;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -84,16 +86,18 @@ import static org.junit.Assert.assertEquals;
@RunWith(AndroidJUnit4.class)
public class EncryptionTestIT {
@Rule public RetryTestRule retryTestRule = new RetryTestRule();
private String privateKey = "MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAo" +
"IBAQDsn0JKS/THu328z1IgN0VzYU53HjSX03WJIgWkmyTaxbiKpoJaKbksXmfSpgzV" +
"GzKFvGfZ03fwFrN7Q8P8R2e8SNiell7mh1TDw9/0P7Bt/ER8PJrXORo+GviKHxaLr7" +
"Y0BJX9i/nW/L0L/VaE8CZTAqYBdcSJGgHJjY4UMf892ZPTa9T2Dl3ggdMZ7BQ2kiCi" +
"CC3qV99b0igRJGmmLQaGiAflhFzuDQPMifUMq75wI8RSRPdxUAtjTfkl68QHu7Umye" +
"yy33OQgdUKaTl5zcS3VSQbNjveVCNM4RDH1RlEc+7Wf1BY8APqT6jbiBcROJD2CeoL" +
"H2eiIJCi+61ZkSGfAgMBAAECggEBALFStCHrhBf+GL9a+qer4/8QZ/X6i91PmaBX/7" +
"SYk2jjjWVSXRNmex+V6+Y/jBRT2mvAgm8J+7LPwFdatE+lz0aZrMRD2gCWYF6Itpda" +
"90OlLkmQPVWWtGTgX2ta2tF5r2iSGzk0IdoL8zw98Q2UzpOcw30KnWtFMxuxWk0mHq" +
"pgp00g80cDWg3+RPbWOhdLp5bflQ36fKDfmjq05cGlIk6unnVyC5HXpvh4d4k2EWlX" +
"IBAQDsn0JKS/THu328z1IgN0VzYU53HjSX03WJIgWkmyTaxbiKpoJaKbksXmfSpgzV" +
"GzKFvGfZ03fwFrN7Q8P8R2e8SNiell7mh1TDw9/0P7Bt/ER8PJrXORo+GviKHxaLr7" +
"Y0BJX9i/nW/L0L/VaE8CZTAqYBdcSJGgHJjY4UMf892ZPTa9T2Dl3ggdMZ7BQ2kiCi" +
"CC3qV99b0igRJGmmLQaGiAflhFzuDQPMifUMq75wI8RSRPdxUAtjTfkl68QHu7Umye" +
"yy33OQgdUKaTl5zcS3VSQbNjveVCNM4RDH1RlEc+7Wf1BY8APqT6jbiBcROJD2CeoL" +
"H2eiIJCi+61ZkSGfAgMBAAECggEBALFStCHrhBf+GL9a+qer4/8QZ/X6i91PmaBX/7" +
"SYk2jjjWVSXRNmex+V6+Y/jBRT2mvAgm8J+7LPwFdatE+lz0aZrMRD2gCWYF6Itpda" +
"90OlLkmQPVWWtGTgX2ta2tF5r2iSGzk0IdoL8zw98Q2UzpOcw30KnWtFMxuxWk0mHq" +
"pgp00g80cDWg3+RPbWOhdLp5bflQ36fKDfmjq05cGlIk6unnVyC5HXpvh4d4k2EWlX" +
"rjGsndVBPCjGkZePlLRgDHxT06r+5XdJ+1CBDZgCsmjGz3M8uOHyCfVW0WhB7ynzDT" +
"agVgz0iqpuhAi9sPt6iWWwpAnRw8cQgqEKw9bvKKECgYEA/WPi2PJtL6u/xlysh/H7" +
"A717CId6fPHCMDace39ZNtzUzc0nT5BemlcF0wZ74NeJSur3Q395YzB+eBMLs5p8mA" +
@@ -22,9 +22,11 @@
package com.owncloud.android.util;
import android.accounts.Account;
import android.content.Context;
import android.content.res.Resources;
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;
@@ -48,12 +50,18 @@ public class ErrorMessageAdapterIT {
public void getErrorCauseMessageForForbiddenRemoval() {
Resources resources = InstrumentationRegistry.getInstrumentation().getTargetContext().getResources();
Account account = new Account("name", ACCOUNT_TYPE);
Context context = MainApp.getAppContext();
String errorMessage = ErrorMessageAdapter.getErrorCauseMessage(
new RemoteOperationResult(RemoteOperationResult.ResultCode.FORBIDDEN),
new RemoveFileOperation(new OCFile(PATH_TO_DELETE), false, account, false, MainApp.getAppContext()),
new RemoveFileOperation(new OCFile(PATH_TO_DELETE),
false,
account,
false,
context,
new FileDataStorageManager(account, context.getContentResolver())),
resources
);
);
assertEquals(EXPECTED_ERROR_MESSAGE, errorMessage);
}
@@ -0,0 +1,17 @@
Platforma de productivitate ce îți oferă ție ontrolul și poate fi găzduită de tine.
\Caracteristici:
* Interfață facilă, modernă, complet personalizată in aliniere cu tema serverului tău
* Încarcă fișiere pe serverul tău Nextcloud
* Partajează fișierele tale cu alții
* Păstrează-ți fișierele și folderele preferate sincronizate
* Căutare în toate folderele de pe serverul tău
* Încărcare automată a fotografiilor și videoclipurilor făcute cu dispozitivul tău
* Fii la curent cu toate notificările
* Suport pentru conturi multiple
* Acces securizat la datele tale prin amprentă sau PIN
* Integrare cu DAVx5 (în trecut cunoscut ca DAVdroid) pentru configurarea ușoară a sincronizarii Calendarelor si Contactelor.
Te rugăm să anunți orice fel de probleme la https://github.com/nextcloud/android/issues și să discuți despre această aplicație la https://help.nextcloud.com/c/clients/android
Ești nou la Nextcloud? Nextcloud este un server privat pentru comunicare, sincronizare & și partajare de fișiere. Este în întregime open-source și îl poți găzdui tu, sau poți plăti o companie să facă asta pentru tine. În acest fel, ești pe deplin în control asupra fotografiilor tale, a calendarului și informațiilor de contact, a documentelor și a orice altceva.
Află mai multe despre Nextcloud la https://nextcloud.com
@@ -0,0 +1 @@
Platforma găzduită și controlată de tine
@@ -0,0 +1 @@
Nextcloud
@@ -70,9 +70,12 @@ import java.io.InputStreamReader;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import androidx.annotation.VisibleForTesting;
import static com.nextcloud.android.sso.Constants.DELIMITER;
import static com.nextcloud.android.sso.Constants.EXCEPTION_ACCOUNT_NOT_FOUND;
import static com.nextcloud.android.sso.Constants.EXCEPTION_HTTP_REQUEST_FAILED;
@@ -260,6 +263,20 @@ public class InputStreamBinder extends IInputStreamService.Stub {
}
break;
case "PATCH":
method = new PatchMethod(requestUrl);
if (requestBodyInputStream != null) {
RequestEntity requestEntity = new InputStreamRequestEntity(requestBodyInputStream);
((PatchMethod) method).setRequestEntity(requestEntity);
} else if (request.getRequestBody() != null) {
StringRequestEntity requestEntity = new StringRequestEntity(
request.getRequestBody(),
CONTENT_TYPE_APPLICATION_JSON,
CHARSET_UTF8);
((PatchMethod) method).setRequestEntity(requestEntity);
}
break;
case "PUT":
method = new PutMethod(requestUrl);
if (requestBodyInputStream != null) {
@@ -295,8 +312,8 @@ public class InputStreamBinder extends IInputStreamService.Stub {
break;
case "HEAD":
method = new HeadMethod(requestUrl);
break;
method = new HeadMethod(requestUrl);
break;
default:
throw new UnsupportedOperationException(EXCEPTION_UNSUPPORTED_METHOD);
@@ -331,7 +348,11 @@ public class InputStreamBinder extends IInputStreamService.Stub {
HttpMethodBase method = buildMethod(request, client.getBaseUri(), requestBodyInputStream);
method.setQueryString(convertMapToNVP(request.getParameter()));
if (request.getParameterV2() != null && !request.getParameterV2().isEmpty()) {
method.setQueryString(convertListToNVP(request.getParameterV2()));
} else {
method.setQueryString(convertMapToNVP(request.getParameter()));
}
method.addRequestHeader("OCS-APIREQUEST", "true");
for (Map.Entry<String, List<String>> header : request.getHeader().entrySet()) {
@@ -394,7 +415,12 @@ public class InputStreamBinder extends IInputStreamService.Stub {
HttpMethodBase method = buildMethod(request, client.getBaseUri(), requestBodyInputStream);
method.setQueryString(convertMapToNVP(request.getParameter()));
if (request.getParameterV2() != null && !request.getParameterV2().isEmpty()) {
method.setQueryString(convertListToNVP(request.getParameterV2()));
} else {
method.setQueryString(convertMapToNVP(request.getParameter()));
}
method.addRequestHeader("OCS-APIREQUEST", "true");
for (Map.Entry<String, List<String>> header : request.getHeader().entrySet()) {
@@ -482,7 +508,8 @@ public class InputStreamBinder extends IInputStreamService.Stub {
}
}
private static NameValuePair[] convertMapToNVP(Map<String, String> map) {
@VisibleForTesting
public static NameValuePair[] convertMapToNVP(Map<String, String> map) {
NameValuePair[] nvp = new NameValuePair[map.size()];
int i = 0;
for (String key : map.keySet()) {
@@ -491,4 +518,15 @@ public class InputStreamBinder extends IInputStreamService.Stub {
}
return nvp;
}
@VisibleForTesting
public static NameValuePair[] convertListToNVP(Collection<QueryParam> list) {
NameValuePair[] nvp = new NameValuePair[list.size()];
int i = 0;
for (QueryParam pair : list) {
nvp[i] = new NameValuePair(pair.key, pair.value);
i++;
}
return nvp;
}
}
@@ -0,0 +1,118 @@
/*
* Nextcloud SingleSignOn
*
* @author Timo Triebensky
* Copyright (C) 2021 Timo Triebensky
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* More information here: https://github.com/abeluck/android-streams-ipc
*
* ====================================================================
*
* The required methods of this class are copied and customized from PostMethod.
*/
package com.nextcloud.android.sso;
import org.apache.commons.httpclient.methods.ByteArrayRequestEntity;
import org.apache.commons.httpclient.methods.EntityEnclosingMethod;
import org.apache.commons.httpclient.methods.PostMethod;
import org.apache.commons.httpclient.methods.RequestEntity;
import org.apache.commons.httpclient.util.EncodingUtil;
import java.util.Vector;
public class PatchMethod extends PostMethod {
/**
* The buffered request body consisting of <code>NameValuePair</code>s.
*/
private Vector params = new Vector();
/**
* No-arg constructor.
*/
public PatchMethod() {
super();
}
/**
* Constructor specifying a URI.
*
* @param uri either an absolute or relative URI
*/
public PatchMethod(String uri) {
super(uri);
}
/**
* Returns <tt>"PATCH"</tt>.
*
* @return <tt>"PATCH"</tt>
* @since 2.0
*/
@Override
public String getName() {
return "PATCH";
}
/**
* Returns <tt>true</tt> if there is a request body to be sent.
*
* @return boolean
* @since 2.0beta1
*/
protected boolean hasRequestContent() {
if (!this.params.isEmpty()) {
return true;
} else {
return super.hasRequestContent();
}
}
/**
* Clears request body.
*
* @since 2.0beta1
*/
protected void clearRequestBody() {
this.params.clear();
super.clearRequestBody();
}
/**
* Generates a request entity from the patch parameters, if present. Calls {@link
* EntityEnclosingMethod#generateRequestBody()} if parameters have not been set.
*
* @since 3.0
*/
protected RequestEntity generateRequestEntity() {
if (!this.params.isEmpty()) {
// Use a ByteArrayRequestEntity instead of a StringRequestEntity.
// This is to avoid potential encoding issues. Form url encoded strings
// are ASCII by definition but the content type may not be. Treating the content
// as bytes allows us to keep the current charset without worrying about how
// this charset will effect the encoding of the form url encoded string.
String content = EncodingUtil.formUrlEncode(getParameters(), getRequestCharSet());
ByteArrayRequestEntity entity = new ByteArrayRequestEntity(
EncodingUtil.getAsciiBytes(content),
FORM_URL_ENCODED_CONTENT_TYPE
);
return entity;
} else {
return super.generateRequestEntity();
}
}
}
@@ -0,0 +1,35 @@
/*
*
* Nextcloud Android client application
*
* @author Tobias Kaminsky
* Copyright (C) 2021 Tobias Kaminsky
* Copyright (C) 2021 Nextcloud GmbH
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package com.nextcloud.android.sso;
import java.io.Serializable;
public class QueryParam implements Serializable {
public String key;
public String value;
public QueryParam(String key, String value) {
this.key = key;
this.value = value;
}
}
@@ -1,3 +1,25 @@
/*
*
* Nextcloud Android client application
*
* @author Tobias Kaminsky
* Copyright (C) 2021 Tobias Kaminsky
* Copyright (C) 2021 Nextcloud GmbH
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/*
* Nextcloud SingleSignOn
*
@@ -19,8 +41,12 @@
package com.nextcloud.android.sso.aidl;
import com.nextcloud.android.sso.QueryParam;
import java.io.Serializable;
import java.util.Collection;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
@@ -31,6 +57,7 @@ public class NextcloudRequest implements Serializable {
private String method;
private Map<String, List<String>> header = new HashMap<>();
private Map<String, String> parameter = new HashMap<>();
private final Collection<QueryParam> parameterV2 = new LinkedList<>();
private String requestBody;
private String url;
private String token;
@@ -144,4 +171,8 @@ public class NextcloudRequest implements Serializable {
public boolean isFollowRedirects() {
return this.followRedirects;
}
public Collection<QueryParam> getParameterV2() {
return parameterV2;
}
}
@@ -86,11 +86,12 @@ class UploadTask(
applicationContext,
upload.isUseWifiOnly,
upload.isWhileChargingOnly,
false
false,
fileDataStorageManager
)
val client = clientProvider()
uploadsStorageManager.updateDatabaseUploadStart(op)
val result = op.execute(client, fileDataStorageManager)
val result = op.execute(client)
uploadsStorageManager.updateDatabaseUploadResult(result, op)
return Result(file, result.isSuccess)
}
@@ -76,7 +76,8 @@ public class DeckApiImpl implements DeckApi {
private PendingIntent createPendingIntent(@NonNull Intent intent, @NonNull Notification notification, @NonNull User user) {
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
return PendingIntent.getActivity(context, 0, putExtrasToIntent(intent, notification, user),
return PendingIntent.getActivity(context, notification.getNotificationId(),
putExtrasToIntent(intent, notification, user),
PendingIntent.FLAG_ONE_SHOT);
}
@@ -33,6 +33,7 @@ import com.nextcloud.client.account.User
import com.nextcloud.client.account.UserAccountManager
import com.nextcloud.client.core.Clock
import com.nextcloud.client.preferences.AppPreferencesImpl
import com.nextcloud.common.NextcloudClient
import com.nextcloud.java.util.Optional
import com.owncloud.android.MainApp
import com.owncloud.android.R
@@ -45,6 +46,7 @@ import com.owncloud.android.datamodel.UploadsStorageManager
import com.owncloud.android.lib.common.OwnCloudClient
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.ui.activity.ContactsPreferenceActivity
@@ -110,7 +112,7 @@ class AccountRemovalWork(
remoceSyncedFolders(context, user.toPlatformAccount(), clock)
// delete all uploads for account
uploadsStorageManager.removeAccountUploads(user.toPlatformAccount())
uploadsStorageManager.removeUserUploads(user)
// delete stored E2E keys and mnemonic
arbitraryDataProvider.deleteKeyForAccount(user.accountName, EncryptionUtils.PRIVATE_KEY)
@@ -133,6 +135,14 @@ class AccountRemovalWork(
// notify Document Provider
DocumentsStorageProvider.notifyRootsChanged(context)
// delete app password
val deleteAppPasswordRemoteOperation = DeleteAppPasswordRemoteOperation()
val optionNextcloudClient = createNextcloudClient(user)
if (optionNextcloudClient.isPresent) {
deleteAppPasswordRemoteOperation.execute(optionNextcloudClient.get())
}
if (userRemoved) {
eventBus.post(AccountRemovedEvent())
}
@@ -202,4 +212,17 @@ class AccountRemovalWork(
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()
}
}
}
@@ -156,7 +156,12 @@ class NotificationWork constructor(
}
intent.putExtra(KEY_NOTIFICATION_ACCOUNT, user.accountName)
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
pendingIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_ONE_SHOT)
pendingIntent = PendingIntent.getActivity(
context,
notification.getNotificationId(),
intent,
PendingIntent.FLAG_ONE_SHOT
)
}
val pushNotificationId = randomId.nextInt()
@@ -113,9 +113,10 @@ class OfflineSyncWork constructor(
ocFile.remotePath,
user,
true,
context
context,
storageManager
)
synchronizeFileOperation.execute(storageManager, context)
synchronizeFileOperation.execute(context)
}
}
// recursive into folder
@@ -81,7 +81,7 @@ class ConnectivityServiceImpl implements ConnectivityService {
return result;
} else {
return !getConnectivity().isConnected();
return !c.isConnected();
}
}
@@ -25,12 +25,20 @@ package com.nextcloud.ui
import android.accounts.Account
import android.content.Context
import com.owncloud.android.lib.common.OwnCloudClientFactory
import com.owncloud.android.lib.common.accounts.AccountUtils
import com.owncloud.android.lib.common.utils.Log_OC
import com.owncloud.android.lib.resources.users.ClearStatusMessageRemoteOperation
public class ClearStatusTask(val account: Account?, val context: Context?) : Function0<Boolean> {
override fun invoke(): Boolean {
val client = OwnCloudClientFactory.createNextcloudClient(account, context)
return try {
val client = OwnCloudClientFactory.createNextcloudClient(account, context)
return ClearStatusMessageRemoteOperation().execute(client).isSuccess
ClearStatusMessageRemoteOperation().execute(client).isSuccess
} catch (e: AccountUtils.AccountNotFoundException) {
Log_OC.e(this, "Error clearing status", e)
false
}
}
}
@@ -25,6 +25,8 @@ package com.nextcloud.ui
import android.accounts.Account
import android.content.Context
import com.owncloud.android.lib.common.OwnCloudClientFactory
import com.owncloud.android.lib.common.accounts.AccountUtils
import com.owncloud.android.lib.common.utils.Log_OC
import com.owncloud.android.lib.resources.users.SetPredefinedCustomStatusMessageRemoteOperation
public class SetPredefinedCustomStatusTask(
@@ -34,8 +36,14 @@ public class SetPredefinedCustomStatusTask(
val context: Context?
) : Function0<Boolean> {
override fun invoke(): Boolean {
val client = OwnCloudClientFactory.createNextcloudClient(account, context)
return try {
val client = OwnCloudClientFactory.createNextcloudClient(account, context)
return SetPredefinedCustomStatusMessageRemoteOperation(messageId, clearAt).execute(client).isSuccess
SetPredefinedCustomStatusMessageRemoteOperation(messageId, clearAt).execute(client).isSuccess
} catch (e: AccountUtils.AccountNotFoundException) {
Log_OC.e(this, "Error setting predefined status", e)
false
}
}
}
@@ -25,6 +25,8 @@ package com.nextcloud.ui
import android.accounts.Account
import android.content.Context
import com.owncloud.android.lib.common.OwnCloudClientFactory
import com.owncloud.android.lib.common.accounts.AccountUtils
import com.owncloud.android.lib.common.utils.Log_OC
import com.owncloud.android.lib.resources.users.SetStatusRemoteOperation
import com.owncloud.android.lib.resources.users.StatusType
@@ -34,8 +36,14 @@ class SetStatusTask(
val context: Context?
) : Function0<Boolean> {
override fun invoke(): Boolean {
val client = OwnCloudClientFactory.createNextcloudClient(account, context)
return try {
val client = OwnCloudClientFactory.createNextcloudClient(account, context)
return SetStatusRemoteOperation(statusType).execute(client).isSuccess
SetStatusRemoteOperation(statusType).execute(client).isSuccess
} catch (e: AccountUtils.AccountNotFoundException) {
Log_OC.e(this, "Error setting status", e)
false
}
}
}
@@ -25,6 +25,8 @@ package com.nextcloud.ui
import android.accounts.Account
import android.content.Context
import com.owncloud.android.lib.common.OwnCloudClientFactory
import com.owncloud.android.lib.common.accounts.AccountUtils
import com.owncloud.android.lib.common.utils.Log_OC
import com.owncloud.android.lib.resources.users.SetUserDefinedCustomStatusMessageRemoteOperation
public class SetUserDefinedCustomStatusTask(
@@ -35,8 +37,14 @@ public class SetUserDefinedCustomStatusTask(
val context: Context?
) : Function0<Boolean> {
override fun invoke(): Boolean {
val client = OwnCloudClientFactory.createNextcloudClient(account, context)
return try {
val client = OwnCloudClientFactory.createNextcloudClient(account, context)
return SetUserDefinedCustomStatusMessageRemoteOperation(message, icon, clearAt).execute(client).isSuccess
return SetUserDefinedCustomStatusMessageRemoteOperation(message, icon, clearAt).execute(client).isSuccess
} catch (e: AccountUtils.AccountNotFoundException) {
Log_OC.e(this, "Error setting user defined custom status", e)
false
}
}
}
@@ -771,6 +771,8 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
accountSetupBinding.hostUrlInput.setText(uri);
}
uri = AuthenticatorUrlUtils.normalizeScheme(uri);
// Handle internationalized domain names
try {
uri = DisplayUtils.convertIdn(uri, true);
@@ -1264,6 +1266,12 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
return false;
} else {
UserInfo userInfo = authResult.getResultData();
if (userInfo == null) {
Log_OC.e(this, "Could not read user data!");
return false;
}
mAccount = newAccount;
mAccountMgr.addAccountExplicitly(mAccount, webViewPassword, null);
@@ -1287,13 +1295,6 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
// addAccountExplicitly, or in KEY_USERDATA
mAccountMgr.setUserData(mAccount, Constants.KEY_OC_VERSION, mServerInfo.mVersion.getVersion());
mAccountMgr.setUserData(mAccount, Constants.KEY_OC_BASE_URL, mServerInfo.mBaseUrl);
UserInfo userInfo = authResult.getResultData();
if (userInfo == null) {
Log_OC.e(this, "Could not read user data!");
return false;
}
mAccountMgr.setUserData(mAccount, Constants.KEY_DISPLAY_NAME, userInfo.getDisplayName());
mAccountMgr.setUserData(mAccount, Constants.KEY_USER_ID, userInfo.getId());
mAccountMgr.setUserData(mAccount,
@@ -46,7 +46,7 @@ public class AuthenticatorAsyncTask extends AsyncTask<Object, Void, RemoteOperat
private static final boolean SUCCESS_IF_ABSENT = false;
private WeakReference<Context> mWeakContext;
private final WeakReference<Context> mWeakContext;
private final WeakReference<OnAuthenticatorTaskListener> mListener;
public AuthenticatorAsyncTask(Activity activity) {
@@ -65,15 +65,21 @@ public class AuthenticatorAsyncTask extends AsyncTask<Object, Void, RemoteOperat
// Client
Uri uri = Uri.parse(url);
OwnCloudClient client = OwnCloudClientFactory.createOwnCloudClient(uri, context, true);
NextcloudClient nextcloudClient = OwnCloudClientFactory.createNextcloudClient(uri,
credentials.getUsername(),
credentials.toOkHttpCredentials(),
context,
true);
client.setCredentials(credentials);
// Operation - get display name
RemoteOperationResult<UserInfo> userInfoResult = new GetUserInfoRemoteOperation().execute(nextcloudClient);
// Operation - try credentials
OwnCloudClient client = OwnCloudClientFactory.createOwnCloudClient(uri, context, true);
client.setUserId(userInfoResult.getResultData().getId());
client.setCredentials(credentials);
ExistenceCheckRemoteOperation operation = new ExistenceCheckRemoteOperation(ROOT_PATH, SUCCESS_IF_ABSENT);
result = operation.execute(client);
@@ -82,13 +88,8 @@ public class AuthenticatorAsyncTask extends AsyncTask<Object, Void, RemoteOperat
String permanentLocation = redirectionPath.getLastPermanentLocation();
result.setLastPermanentLocation(permanentLocation);
}
// Operation - get display name
if (result.isSuccess()) {
GetUserInfoRemoteOperation remoteUserNameOperation = new GetUserInfoRemoteOperation();
result = remoteUserNameOperation.execute(nextcloudClient);
}
result.setResultData(userInfoResult.getResultData());
} else {
result = new RemoteOperationResult(RemoteOperationResult.ResultCode.UNKNOWN_ERROR);
}
@@ -23,6 +23,7 @@ package com.owncloud.android.authentication;
import android.text.TextUtils;
import java.net.URI;
import java.util.Locale;
/**
@@ -97,4 +98,14 @@ public final class AuthenticatorUrlUtils {
return strippedUrl;
}
public static String normalizeScheme(String url) {
URI uri = URI.create(url);
if (uri.getScheme() != null) {
String lcScheme = uri.getScheme().toLowerCase(Locale.ROOT);
return String.format("%s:%s", lcScheme, uri.getRawSchemeSpecificPart());
} else {
return url;
}
}
}
@@ -440,7 +440,7 @@ public final class ThumbnailsCacheManager {
public static class ThumbnailGenerationTask extends AsyncTask<ThumbnailGenerationTaskObject, Void, Bitmap> {
private final WeakReference<ImageView> mImageViewReference;
private static Account mAccount;
private User user;
private List<ThumbnailGenerationTask> mAsyncTasks;
private Object mFile;
private String mImageKey;
@@ -449,13 +449,13 @@ public final class ThumbnailsCacheManager {
private Listener mListener;
private boolean gridViewEnabled = false;
public ThumbnailGenerationTask(ImageView imageView, FileDataStorageManager storageManager, Account account)
public ThumbnailGenerationTask(ImageView imageView, FileDataStorageManager storageManager, User user)
throws IllegalArgumentException {
this(imageView, storageManager, account, null);
this(imageView, storageManager, user, null);
}
public ThumbnailGenerationTask(ImageView imageView, FileDataStorageManager storageManager,
Account account, List<ThumbnailGenerationTask> asyncTasks)
User user, List<ThumbnailGenerationTask> asyncTasks)
throws IllegalArgumentException {
// Use a WeakReference to ensure the ImageView can be garbage collected
mImageViewReference = new WeakReference<>(imageView);
@@ -463,15 +463,15 @@ public final class ThumbnailsCacheManager {
throw new IllegalArgumentException("storageManager must not be NULL");
}
mStorageManager = storageManager;
mAccount = account;
this.user = user;
mAsyncTasks = asyncTasks;
}
public ThumbnailGenerationTask(ImageView imageView, FileDataStorageManager storageManager,
Account account, List<ThumbnailGenerationTask> asyncTasks,
User user, List<ThumbnailGenerationTask> asyncTasks,
boolean gridViewEnabled)
throws IllegalArgumentException {
this(imageView, storageManager, account, asyncTasks);
this(imageView, storageManager, user, asyncTasks);
this.gridViewEnabled = gridViewEnabled;
}
@@ -479,12 +479,12 @@ public final class ThumbnailsCacheManager {
return getMethod;
}
public ThumbnailGenerationTask(FileDataStorageManager storageManager, Account account){
public ThumbnailGenerationTask(FileDataStorageManager storageManager, User user){
if (storageManager == null) {
throw new IllegalArgumentException("storageManager must not be NULL");
}
mStorageManager = storageManager;
mAccount = account;
this.user = user;
mImageViewReference = null;
}
@@ -498,11 +498,8 @@ public final class ThumbnailsCacheManager {
protected Bitmap doInBackground(ThumbnailGenerationTaskObject... params) {
Bitmap thumbnail = null;
try {
if (mAccount != null) {
OwnCloudAccount ocAccount = new OwnCloudAccount(
mAccount,
MainApp.getAppContext()
);
if (user != null) {
OwnCloudAccount ocAccount = user.toOwnCloudAccount();
mClient = OwnCloudClientManagerFactory.getDefaultSingleton().
getClientFor(ocAccount, MainApp.getAppContext());
}
@@ -23,7 +23,6 @@
*/
package com.owncloud.android.datamodel;
import android.accounts.Account;
import android.content.ContentResolver;
import android.content.ContentValues;
import android.database.Cursor;
@@ -59,8 +58,8 @@ public class UploadsStorageManager extends Observable {
private static final String AND = " AND ";
private static final int SINGLE_RESULT = 1;
private ContentResolver mContentResolver;
private CurrentAccountProvider currentAccountProvider;
private final ContentResolver contentResolver;
private final CurrentAccountProvider currentAccountProvider;
public UploadsStorageManager(
CurrentAccountProvider currentAccountProvider,
@@ -69,7 +68,7 @@ public class UploadsStorageManager extends Observable {
if (contentResolver == null) {
throw new IllegalArgumentException("Cannot create an instance with a NULL contentResolver");
}
mContentResolver = contentResolver;
this.contentResolver = contentResolver;
this.currentAccountProvider = currentAccountProvider;
}
@@ -511,7 +510,7 @@ public class UploadsStorageManager extends Observable {
}
private ContentResolver getDB() {
return mContentResolver;
return contentResolver;
}
public long clearFailedButNotDelayedUploads() {
@@ -647,12 +646,12 @@ public class UploadsStorageManager extends Observable {
new String[]{});
}
public int removeAccountUploads(Account account) {
Log_OC.v(TAG, "Delete all uploads for account " + account.name);
public int removeUserUploads(User user) {
Log_OC.v(TAG, "Delete all uploads for account " + user.getAccountName());
return getDB().delete(
ProviderTableMeta.CONTENT_URI_UPLOADS,
ProviderTableMeta.UPLOADS_ACCOUNT_NAME + "=?",
new String[]{account.name});
new String[]{user.getAccountName()});
}
public enum UploadStatus {
@@ -490,7 +490,8 @@ public class FileUploader extends Service
this,
onWifiOnly,
whileChargingOnly,
disableRetries
disableRetries,
new FileDataStorageManager(user.toPlatformAccount(), getContentResolver())
);
newUpload.setCreatedBy(createdBy);
if (isCreateRemoteFolder) {
@@ -539,7 +540,8 @@ public class FileUploader extends Service
this,
onWifiOnly,
whileChargingOnly,
true
true,
new FileDataStorageManager(user.toPlatformAccount(), getContentResolver())
);
newUpload.addDataTransferProgressListener(this);
@@ -639,7 +641,7 @@ public class FileUploader extends Service
// uploadResult = uploadEncryptedFileOperation.execute(mUploadClient, mStorageManager);
// } else {
/// perform the regular upload
uploadResult = mCurrentUpload.execute(mUploadClient, mStorageManager);
uploadResult = mCurrentUpload.execute(mUploadClient);
// }
} catch (Exception e) {
Log_OC.e(TAG, "Error uploading", e);
@@ -667,16 +669,32 @@ public class FileUploader extends Service
}
// generate new Thumbnail
final ThumbnailsCacheManager.ThumbnailGenerationTask task =
new ThumbnailsCacheManager.ThumbnailGenerationTask(mStorageManager, mCurrentAccount);
Optional<User> user = getCurrentUser();
if (user.isPresent()) {
final ThumbnailsCacheManager.ThumbnailGenerationTask task =
new ThumbnailsCacheManager.ThumbnailGenerationTask(mStorageManager, user.get());
File file = new File(mCurrentUpload.getOriginalStoragePath());
String remoteId = mCurrentUpload.getFile().getRemoteId();
File file = new File(mCurrentUpload.getOriginalStoragePath());
String remoteId = mCurrentUpload.getFile().getRemoteId();
task.execute(new ThumbnailsCacheManager.ThumbnailGenerationTaskObject(file, remoteId));
task.execute(new ThumbnailsCacheManager.ThumbnailGenerationTaskObject(file, remoteId));
}
}
}
/**
* Convert current account to user. This is a temporary workaround until
* service is migrated to new user model.
*
* @return Optional {@link User}
*/
private Optional<User> getCurrentUser() {
if (mCurrentAccount == null) {
return Optional.empty();
} else {
return accountManager.getUser(mCurrentAccount.name);
}
}
/**
* Creates a status notification to show the upload progress
@@ -104,7 +104,6 @@ public class MediaControlView extends FrameLayout implements OnClickListener, On
handler.removeMessages(SHOW_PROGRESS);
}
private void initControllerView(View v) {
pauseButton = v.findViewById(R.id.playBtn);
if (pauseButton != null) {
@@ -162,7 +161,6 @@ public class MediaControlView extends FrameLayout implements OnClickListener, On
}
}
private Handler handler = new Handler() {
@Override
public void handleMessage(Message msg) {
@@ -218,7 +216,6 @@ public class MediaControlView extends FrameLayout implements OnClickListener, On
return position;
}
@Override
public boolean dispatchKeyEvent(KeyEvent event) {
int keyCode = event.getKeyCode();
@@ -277,7 +274,6 @@ public class MediaControlView extends FrameLayout implements OnClickListener, On
} else {
rewindButton.setVisibility(View.INVISIBLE);
}
}
private void doPauseResume() {
@@ -311,38 +307,29 @@ public class MediaControlView extends FrameLayout implements OnClickListener, On
public void onClick(View v) {
int pos;
boolean playing = playerControl.isPlaying();
switch (v.getId()) {
case R.id.playBtn:
doPauseResume();
break;
int id = v.getId();
case R.id.rewindBtn:
pos = playerControl.getCurrentPosition();
pos -= 5000;
playerControl.seekTo(pos);
if (!playing) {
playerControl.pause(); // necessary in some 2.3.x devices
}
setProgress();
break;
case R.id.forwardBtn:
pos = playerControl.getCurrentPosition();
pos += 15000;
playerControl.seekTo(pos);
if (!playing) {
playerControl.pause(); // necessary in some 2.3.x devices
}
setProgress();
break;
default:
// do nothing
break;
if (id == R.id.playBtn) {
doPauseResume();
} else if (id == R.id.rewindBtn) {
pos = playerControl.getCurrentPosition();
pos -= 5000;
playerControl.seekTo(pos);
if (!playing) {
playerControl.pause(); // necessary in some 2.3.x devices
}
setProgress();
} else if (id == R.id.forwardBtn) {
pos = playerControl.getCurrentPosition();
pos += 15000;
playerControl.seekTo(pos);
if (!playing) {
playerControl.pause(); // necessary in some 2.3.x devices
}
setProgress();
}
}
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
if (!fromUser) {
@@ -370,7 +357,6 @@ public class MediaControlView extends FrameLayout implements OnClickListener, On
handler.removeMessages(SHOW_PROGRESS); // grants no more updates with media player progress while dragging
}
/**
* Called in devices with touchpad when the user finishes the adjusting of the seekbar.
*/
@@ -21,6 +21,7 @@
package com.owncloud.android.operations;
import com.nextcloud.client.account.User;
import com.owncloud.android.datamodel.FileDataStorageManager;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.lib.common.OwnCloudClient;
import com.owncloud.android.lib.common.operations.RemoteOperation;
@@ -37,13 +38,14 @@ public class CheckCurrentCredentialsOperation extends SyncOperation {
private final User user;
public CheckCurrentCredentialsOperation(User user) {
public CheckCurrentCredentialsOperation(User user, FileDataStorageManager storageManager) {
super(storageManager);
this.user = user;
}
@Override
protected RemoteOperationResult run(OwnCloudClient client) {
RemoteOperationResult result = null;
RemoteOperationResult result;
boolean validAccount = user.nameEquals(getStorageManager().getAccount().name);
if (!validAccount) {
result = new RemoteOperationResult(new IllegalStateException(
@@ -22,19 +22,18 @@
package com.owncloud.android.operations;
import com.owncloud.android.lib.common.OwnCloudClient;
import com.owncloud.android.lib.common.operations.RemoteOperation;
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.lib.resources.comments.CommentFileRemoteOperation;
import com.owncloud.android.operations.common.SyncOperation;
/**
* Comment file
*/
public class CommentFileOperation extends SyncOperation {
public class CommentFileOperation extends RemoteOperation {
private String message;
private String fileId;
private final String message;
private final String fileId;
/**
* Constructor
@@ -16,6 +16,7 @@
package com.owncloud.android.operations;
import com.owncloud.android.datamodel.FileDataStorageManager;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.lib.common.OwnCloudClient;
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
@@ -31,7 +32,7 @@ import com.owncloud.android.operations.common.SyncOperation;
*/
public class CopyFileOperation extends SyncOperation {
private String srcPath;
private final String srcPath;
private String targetParentPath;
/**
@@ -40,7 +41,9 @@ public class CopyFileOperation extends SyncOperation {
* @param srcPath Remote path of the {@link OCFile} to move.
* @param targetParentPath Path to the folder where the file will be copied into.
*/
public CopyFileOperation(String srcPath, String targetParentPath) {
public CopyFileOperation(String srcPath, String targetParentPath, FileDataStorageManager storageManager) {
super(storageManager);
this.srcPath = srcPath;
this.targetParentPath = targetParentPath;
if (!this.targetParentPath.endsWith(OCFile.PATH_SEPARATOR)) {
@@ -28,6 +28,7 @@ import com.nextcloud.client.account.User;
import com.owncloud.android.datamodel.ArbitraryDataProvider;
import com.owncloud.android.datamodel.DecryptedFolderMetadata;
import com.owncloud.android.datamodel.EncryptedFolderMetadata;
import com.owncloud.android.datamodel.FileDataStorageManager;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.lib.common.OwnCloudClient;
import com.owncloud.android.lib.common.operations.OnRemoteOperationListener;
@@ -67,7 +68,9 @@ public class CreateFolderOperation extends SyncOperation implements OnRemoteOper
/**
* Constructor
*/
public CreateFolderOperation(String remotePath, User user, Context context) {
public CreateFolderOperation(String remotePath, User user, Context context, FileDataStorageManager storageManager) {
super(storageManager);
this.remotePath = remotePath;
this.user = user;
this.context = context;
@@ -21,6 +21,7 @@
package com.owncloud.android.operations;
import com.owncloud.android.datamodel.FileDataStorageManager;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.lib.common.OwnCloudClient;
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
@@ -40,7 +41,9 @@ public class CreateShareViaLinkOperation extends SyncOperation {
private String path;
private String password;
public CreateShareViaLinkOperation(String path, String password) {
public CreateShareViaLinkOperation(String path, String password, FileDataStorageManager storageManager) {
super(storageManager);
this.path = path;
this.password = password;
}
Loaded 100 of 218 files, more files were not shown because too many files have changed in this diff. Show more