+
+To fix this and make sure your contribution branch is updated with official android/master, you need to perform the next steps:
+* Checkout your master branch: ```git checkout master```
+* Get and apply official android/master branch changes in your master branch: ```git fetch upstream``` + ```git rebase upstream/master```. Now you have your master branch updated with official master branch changes.
+* Checkout your contribution branch: ```git checkout feature/feature_name```
+* Rebase contribution branch with master to put your contribution commits after the last commit of master branch, ensuring a clean commits history: ```git rebase master```. If there's some conflicts, solve it by using rebase in different steps.
+* Push branch to server: ```git push -f origin feature/feature_name```. At this point, the message ```This branch is out-of-date with the base branch``` should disappear.
+
+## Versioning
+
+In order to check or review the stable versions, all available tags can be fetched with the command `git fetch --tags` and listed with the command `git tag`. The tag `latest` is also available pointing to the latest released version.
## Translations
Please submit translations via [Transifex][transifex].
[transifex]: https://www.transifex.com/projects/p/owncloud/
+
+## Code of conduct
+Please, read the [ownCloud code of conduct]. Being respectful and polite with other members of the community and staff is necessary to develop a better product together.
+
+[ownCloud code of conduct]: https://owncloud.com/contribute/code-of-conduct/
diff --git a/README.md b/README.md
index 45cb4be9a13..17bce512f13 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,35 @@
-This is the Android client for [ownCloud][0].
+[](https://github.com/owncloud/android/actions/workflows/android-unit-tests.yml) [](https://github.com/owncloud/android/actions/workflows/android-instrumented-data-tests.yml) [](https://github.com/owncloud/android/actions/workflows/detekt.yml) [](https://github.com/owncloud/android/actions/workflows/conventional-commits.yml)
-The app performs file synchronization with an ownCloud server. Other ownCloud features may be added in the future, but they are not a priority right now.
+# [ownCloud](https://owncloud.org) Android app
-Make sure you read [SETUP.md][1] when you start working on this project.
+
-[0]: https://github.com/owncloud/core
-[1]: https://raw.github.com/owncloud/android/master/SETUP.md
\ No newline at end of file
+|
|
|
|
|
+| ---------------------------------------------- | -------------------------------------------- | ------------------------------------------- | ------------------------------------------- |
+
+## Join development!
+
+**Start contributing:** Make sure you read [SETUP.md](https://github.com/owncloud/android/blob/master/SETUP.md) when you start working on this project. Basically: Fork this repository and contribute back using pull requests to the master branch.
+Easy starting points are also reviewing [pull requests](https://github.com/owncloud/android/pulls) and working on [contributions are welcome](https://github.com/owncloud/android/issues?q=is%3Aopen+is%3Aissue+label%3A%22Contributions+are+welcome%22).
+
+**Forum:** [#Android](https://central.owncloud.org/c/android)
+
+**License:** [GPLv2](https://github.com/owncloud/android/blob/master/LICENSE.txt)
+
+## Join testing!
+
+If you are interested in testing the new features before being released and give us your feedback, please try out our beta channels:
+
+**Play Store**
+
+1. Download ownCloud app from Play Store.
+2. Go to ownCloud tab in Play Store and scroll down to the end of the view.
+3. Press the **I'M IN** button to join the beta program and your final app will be replaced with the beta one.
+
+Note: If you want to use the ownCloud production version you have to leave the beta program, uninstall the app, and reinstall the production version.
+
+**F-Droid**
+
+1. Go to ownCloud tab in F-Droid.
+2. Open versions section.
+3. Download the latest version that contains beta in the name.
diff --git a/SETUP.md b/SETUP.md
index 647015770e0..424f134e22e 100644
--- a/SETUP.md
+++ b/SETUP.md
@@ -1,73 +1,79 @@
-
-If you want to start help developing ownCloud please follow the [contribution guidelines][0] and observe these instructions:
-
-### 1. Fork and download android/develop repository:
-
-NOTE: You must have git in your environment path variable to perform the next operations.
-
-* Navigate to https://github.com/owncloud/android, click fork.
-* Clone your new repo: "git clone git@github.com:YOURGITHUBNAME/android.git"
-* Move to the project folder with "cd android"
-* Checkout remote develop branch: "git checkout -b develop remotes/origin/develop"
-* Pull changes from your develop branch: "git pull origin develop"
-* Make official ownCloud repo known as upstream: "git remote add upstream git@github.com:owncloud/android.git"
-* Make sure to get the latest changes from official android/develop branch: "git pull upstream develop"
-
-At this point you can continue using different tools to build the project. Section 2, 3 and 4 describe some of the existing alternatives.
-
-### 2. Building with Ant:
-
-NOTE: You must have the Android SDK 'tools/', and 'platforms-tools/' folders in your environment path variable.
-
-* Complete the setup of project properties and resolve pending dependencies running "setup_env.bat" or "./setup_env.sh" .
-* Run "ant clean" .
-* Run "ant debug" to generate a debuggable version of the ownCkoud app.
-
-### 3. Building with console/maven:
-
-NOTE: You must have mvn in your environment path
-
-* Download/install Android plugin for Maven, then build ownCloud with mvn:
-* "cd .."
-* "git clone https://github.com/mosabua/maven-android-sdk-deployer.git"
-* "cd maven-android-sdk-deployer"
-* "mvn -pl com.simpligility.android.sdk-deployer:android-17 -am install"
-* "cd ../android"
-* Now you can create APK using "mvn package"
-
-### 4. Building with Eclipse:
-
-NOTE: You must have the Android SDK 'tools/', and 'platforms-tools/' folders in your environment path variable.
-
-* Complete the setup of project properties and resolve pending dependencies running "setup_env.bat" or "./setup_env.sh" .
-* Open Eclipse and create new "Android Project from Existing Code". Choose android/actionbarsherlock/library as root.
-* Clean project and compile.
-* If any error appear, check the project properties; in the 'Android' section, API Level should be greater or equal than 14.
-* Make sure android/actionbarsherlock/library/bin/library.jar was created.
-* Create a new "Android Project from Existing Code". Choose android/oc_framework/library as root.
-* Clean project and compile.
-* If any error appear, check the project properties; in the 'Android' section, API Level should be 19 or greater.
-* Make sure android/oc_framework/bin/classes.jar was created.
-* Import ownCloud Android project.
-* Clean project and compile.
-* If any error appears, check the project properties; in the 'Android' section:
- - API Level should be 19 or greater.
- - Two library projects should appear referred in the bottom square: actionbarsherlock/library and oc_framework. Add them if needed.
-* After those actions you should be good to go. HAVE FUN!
-
-NOTE: Even though API level is set to 19, APK also runs on older devices because in AndroidManifest.xml minSdkVersion is set to 8.
-
-### 5. Create pull request:
-
-NOTE: You must sign the [Contributor Agreement][1] before your changes can be accepted!
-
-* Commit your changes locally: "git commit -a"
-* Push your changes to your Github repo: "git push"
-* Browse to https://github.com/YOURGITHUBNAME/android/pulls and issue pull request
-* Click "Edit" and set "base:develop"
-* Again, click "Edit" and set "compare:develop"
-* Enter description and send pull request.
+### Setup Information
+
+These instructions will help you to set up your development environment, get the source code of the ownCloud for Android app and build it by yourself. If you want to help developing the app take a look to the [contribution guidelines][0].
+
+Sections 1) and 2) are common for any environment. The rest of the sections describe how to set up a project in different tool environments. Nowadays we recommend to use Android Studio (section 2), but you can also build the app from the command line (section 3).
+
+If you have any problem, remove the 'android' folder, start again from 1) and work your way down. If something still does not work as described here, please open a new issue describing exactly what you did, what happened, and what should have happened.
+
+
+### 0. Common software dependencies.
+
+There are some tools needed, no matter what is your specific IDE or build tool of preference.
+
+[git][1] is used to access to the different versions of the ownCloud's source code. Download and install the version appropriate for your operating system from [here][2]. Add the full path to the 'bin/' directory from your git installation into the PATH variable of your environment so that it can be used from any location.
+
+The [Android SDK][3] is necessary to build the app. There are different options to install it in your system, depending of the IDE you decide to use. Check Google documentation about [installation][4] for more details on these options. After installing it, add the full path to the directories 'tools/' and 'platform-tools/' from your Android SDK installation into the PATH variable of your environment.
+
+Open a terminal and type 'android' to start the Android SDK Manager. To build the ownCloud for Android app you will need to install at least the next SDK packages:
+
+* Android SDK Tools and Android SDK Platform-tools (already installed); upgrade to their last versions is usually a good idea.
+* No longer need to specify a version for the build tools, Gradle plugin uses the minimum required version by default.
+* Android 12.0 (API 31), SDK Platform; needed to build the owncloud app.
+
+Install any other package you consider interesting, such as emulators.
+
+For other software dependencies check the details in the section corresponding to your preferred IDE or build system.
+
+
+### 1. Fork and download the owncloud/android repository.
+
+You will need [git][1] to access to the different versions of the ownCloud's source code. The source code is hosted in Github and may be read by anybody without needing a Github account. You will need a Github account if you want to contribute to the development of the app with your own code.
+
+Next steps will assume you have a Github account and that you will get the code from your own fork.
+
+* In a web browser, go to https://github.com/owncloud/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 https://github.com/YOURGITHUBNAME/android.git```.
+* Move to the project folder with ```cd android```.
+* Fetch and apply any changes from your remote branch 'master': ```git fetch``` + ```git rebase```
+* Make official ownCloud repo known as upstream: ```git remote add upstream https://github.com/owncloud/android.git```
+* Make sure to get and apply the latest changes from official android/master branch: ```git fetch upstream``` + ```git rebase upstream/master```
+
+At this point you can continue using different tools to build the project. Section 2 and 3 describe the existing alternatives.
+
+
+### 2. Working with Android Studio.
+
+[Android Studio][5] is currently the official Android IDE. Due to this, we recommend it as the IDE to use in your development environment.
+
+We recommend to use the last version available in the stable channel of Android Studio updates. See what update channel is your Android Studio checking for updates in the menu path 'Help'/'Check for Update...'/link 'Updates' in the dialog.
+
+To set up the project in Android Studio follow the next steps:
+
+* 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 tool bar 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.
+
+
+### 3. Working in a terminal with Gradle:
+
+[Gradle][6] 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][7] included in the project.
+
+* Open a terminal and go to the 'android' directory that contains the repository.
+* Run the 'clean' and 'build' tasks using the Gradle wrapper provided
+ - Windows: ```gradlew.bat clean build```
+ - Mac OS/Linux: ```./gradlew clean build```
+
+The first time the Gradle wrapper is called, the correct Gradle version will be downloaded automatically. An Internet connection is needed for it works.
+
+The generated APK file is saved in android/build/outputs/apk as android-debug.apk
[0]: https://github.com/owncloud/android/blob/master/CONTRIBUTING.md
-[1]: http://owncloud.org/about/contributor-agreement/
+[1]: https://git-scm.com/
+[2]: https://git-scm.com/downloads
+[3]: https://developer.android.com/sdk/index.html
+[4]: https://developer.android.com/sdk/installing/index.html
+[5]: https://developer.android.com/studio
+[6]: https://gradle.org/
+[7]: https://docs.gradle.org/current/userguide/gradle_wrapper.html
diff --git a/THIRD_PARTY.txt b/THIRD_PARTY.txt
index d85eb899083..57bd31e343e 100644
--- a/THIRD_PARTY.txt
+++ b/THIRD_PARTY.txt
@@ -1,7 +1,7 @@
###################################################################
- ownCloud Android client
+ ownCloud Android client
- Copyright (C) 2012-2013 ownCloud Inc.
+ Copyright (C) 2020 ownCloud GmbH.
Copyright (C) 2012 Bartek Przybylski
###################################################################
@@ -11,7 +11,7 @@
###########
This program is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License verions 2,
+it under the terms of the GNU General Public License version 2,
as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
@@ -20,7 +20,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
The source distribution of this program should include a full copy
-of the GNU GPL version 2 license in the LICENSE.txt file located
+of the GNU GPL version 2 license in the LICENSE.txt file located
in its root directory. If not, see + * 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
+ * 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
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2,
+ * as published by the Free Software Foundation.
+ *
+ * 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
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2,
+ * as published by the Free Software Foundation.
+ *
+ * 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
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2,
+ * as published by the Free Software Foundation.
+ *
+ * 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
+ * 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
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2,
+ * as published by the Free Software Foundation.
+ *
+ * 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
+ * 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
+ * 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
+ * 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
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2,
+ * as published by the Free Software Foundation.
+ *
+ * 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
+ * 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
+ * Copyright (C) 2020 ownCloud GmbH.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2,
+ * as published by the Free Software Foundation.
+ *
+ * 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
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2,
+ * as published by the Free Software Foundation.
+ *
+ * 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 > = UIResult.Success(shares)
+ ) {
+ val shareFileFragment = ShareFileFragment.newInstance(
+ OC_FILE,
+ OC_ACCOUNT
+ )
+
+ ActivityScenario.launch(TestShareFileActivity::class.java).onActivity {
+ it.startFragment(shareFileFragment)
+ }
+
+ capabilitiesLiveData.postValue(capabilitiesEvent)
+ sharesLiveData.postValue(Event(sharesUIResult))
+ }
+}
diff --git a/owncloudApp/src/androidTest/java/com/owncloud/android/sharing/shares/ui/ShareFolderFragmentTest.kt b/owncloudApp/src/androidTest/java/com/owncloud/android/sharing/shares/ui/ShareFolderFragmentTest.kt
new file mode 100644
index 00000000000..e03bb30d2a4
--- /dev/null
+++ b/owncloudApp/src/androidTest/java/com/owncloud/android/sharing/shares/ui/ShareFolderFragmentTest.kt
@@ -0,0 +1,104 @@
+/**
+ * ownCloud Android client application
+ *
+ * @author David González Verdugo
+ * @author Jesus Recio Rincon
+ * Copyright (C) 2020 ownCloud GmbH.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2,
+ * as published by the Free Software Foundation.
+ *
+ * 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