Compare commits

..
1 Commits
Author SHA1 Message Date
Andy Scherzinger 1c9d100b04 add scrollable header interface
Signed-off-by: Andy Scherzinger <[email protected]>
2020-08-14 09:21:45 +02:00
4452 changed files with 180584 additions and 385423 deletions

No files matched your search

@@ -1,179 +0,0 @@
---
name: android-activity-to-navigator-fragment
description: >
Use when converting a standalone Activity (usually a DrawerActivity or FileActivity
subclass such as a drawer destination) into a Fragment hosted by NavigatorActivity, when
the user mentions "navigator", "NavigatorActivity", "NavigatorScreen", "convert activity
to fragment", "move screen into the new navigation", or names a drawer screen that still
has its own Activity. Covers registering the NavigatorScreen, building the fragment and
its layout, decoupling collaborators from the old Activity type, rewiring every entry
point (drawer, PendingIntents, broadcast receivers, deep links), DI and manifest cleanup,
and migrating the instrumented screenshot test.
license: AGPL-3.0-or-later
SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
SPDX-License-Identifier: AGPL-3.0-or-later
metadata:
author: Nextcloud Android
version: "1.0.0"
---
# Activity → NavigatorActivity Fragment Conversion
Historically every drawer destination was its own `DrawerActivity` subclass, each with its
own toolbar, `DrawerLayout` and back handling. `NavigatorActivity` replaces them with **one
host Activity** that owns the toolbar and drawer, and swaps **fragments** for the
destinations. Converted so far: Community (#16652), Activities (#16753), Notifications
(#16800), Trashbin (#16879), Upload list.
Read `references/ARCHITECTURE.md` once before the first conversion. It explains how
`Navigator`, `NavigatorScreen`, `NavigatorActivity` and `DrawerActivity.pushFragment` work
together.
## The Prime Directive: Behaviour Must Not Change
The screen must look and behave exactly as before from every entry point: drawer item,
notification tap, notification action, deep link, rotation, back press, drawer toggle and
menu actions. This is a structural refactor. If you find a bug, report it instead of
fixing it in the same change.
## Workflow
### Step 0: Inventory (do not edit yet)
1. Read the whole Activity, its layout and its menu.
2. `git grep -n "<ActivityName>"` across `app/src`, including `AndroidManifest.xml`,
`ComponentsModule.java`, KDoc links, `androidTest` and screenshot file names. Every hit is
either an **entry point** you must rewire or a **reference** you must update.
3. List what the Activity takes from its **base class**. This is the step most likely to go
wrong. `NavigatorActivity` is a `DrawerActivity`, **not** a `FileActivity`. Anything from
`FileActivity` (`fileOperationsHelper`, `OperationsService` binding,
`onRemoteOperationFinish`, `requestCredentialsUpdate`, `showLoadingDialog`,
`connectivityService` field, `backgroundJobManager` field, `EXTRA_FILE`/`EXTRA_USER`
handling in `onCreate`) does not exist in the host. See `references/HOST-CAPABILITIES.md`.
4. List the intent extras the Activity, or its base class, reads. Each one must keep working
when it arrives on the `NavigatorActivity` intent.
5. Note any `onActivityResult`, `BroadcastReceiver`, `OnBackPressedCallback`,
`onOptionsItemSelected`, `ActionMode` or drawer listeners. Each one needs a fragment
equivalent (see `references/ACTIVITY-TO-FRAGMENT-MAPPING.md`).
If a collaborator needs a capability the host does not have, **stop and ask the
developer** whether to (a) move the flow into the fragment and extract the shared pieces
into a helper used by both places, or (b) change the host. Option (a) is the default. It
was chosen for the upload list's credential check (`CredentialsUpdateHelper`).
### Step 1: Register the screen in `NavigatorScreen`
Add the screen in all **five** places in `ui/navigation/NavigatorScreen.kt`. The `when`
expressions are exhaustive, so the compiler catches a missing branch, except in `fromTag`:
1. `@Parcelize object X : NavigatorScreen(X_TAG[, hasDrawer = false])`
2. `private const val X_TAG = "X"` in the companion
3. `fromTag`: `X_TAG -> X` (**not compiler-checked**; missing it breaks restoring after rotation)
4. `menuItemId()`: the drawer item id, or `-1` for screens outside the drawer
5. `actionBarStyle()`: `ActionBarStyle.Plain to R.string.<existing title>`
6. `toFragment()`: `X -> XFragment()`
Use `hasDrawer = false` for screens with a back arrow instead of a hamburger (Notifications).
### Step 2: Fragment layout
Copy the Activity layout to `fragment_<name>.xml` and strip the shell. The host already
provides it:
- remove the root `DrawerLayout`, the `<include layout="@layout/toolbar_standard"/>` and the
`<include layout="@layout/drawer"/>`;
- remove `layout_below="@id/appbar"`. The host's `FragmentContainerView` already sits below
the app bar;
- keep every view id the code or tests use, so the generated binding properties match;
- keep the original SPDX copyright lines and add a line for the current year (derived file).
Delete the old layout once nothing references it.
### Step 3: Write the fragment
Follow `references/ACTIVITY-TO-FRAGMENT-MAPPING.md`. The essentials:
- `class XFragment : Fragment()`, with `@Inject lateinit var` dependencies. Injection is done
by `NavigatorActivity.onAttachFragment`, so `Injectable` is optional.
- Nullable binding: `private var binding: FragmentXBinding? = null`. Set it to `null` in
`onDestroyView`. Use `val binding = binding ?: return` in every function that touches views
(#16783 fixed a crash after a configuration change caused by `_binding!!`).
- Host access: `getTypedActivity(NavigatorActivity::class.java)` (or `DrawerActivity` /
`BaseActivity` when that is all you need) for `user`, `storageManager`, `clientRepository`,
`setUser`, `setDrawerIndicatorEnabled`, `startActionMode`.
- Menu: `requireActivity().addMenuProvider(provider, viewLifecycleOwner, Lifecycle.State.RESUMED)`.
Do **not** handle `android.R.id.home`. The host does that.
- Back press: implement `NavigatorOnBackPressListener` only if the screen has internal
navigation (Trashbin folders).
- Remove `getMenuItemId()`, `setupDrawer()`, `setupToolbar()`, `highlightNavigationViewItem()`
and title setup. `NavigatorScreen` + `NavigatorActivity.setupActionBar` handle all of these.
- Keep files under 300 lines. Extract cohesive flows (conflict handling, credential checks,
the menu provider) into their own classes in the fragment's package.
### Step 4: Decouple collaborators from the old Activity
Adapters, helpers and listeners typed as `XActivity` or `FileActivity` must take the
narrowest type that has what they use. Usually that is `DrawerActivity`, `BaseActivity`,
`NavigatorActivity` or a plain `Context`. Calls to capabilities the host lacks become
callbacks on the click or listener interface, implemented by the fragment
(e.g. `UploadListItemOnClick.onCredentialErrorClick(user)`).
### Step 5: Rewire every entry point
**Always** build the intent with `NavigatorActivity.intent(context, NavigatorScreen.X)`.
`NavigatorActivity.onCreate` calls `requireNotNull` on the screen extra, so a bare
`Intent(context, NavigatorActivity::class.java)` crashes (#17193).
| Old call site | New call site |
|---|---|
| `DrawerActivity.onNavigationItemClicked`: `startActivity(X.class, FLAG_ACTIVITY_CLEAR_TOP)` | `pushFragment(NavigatorScreen.X.INSTANCE)` |
| Buttons in other DrawerActivities: `startActivity(X::class.java)` | `pushFragment(NavigatorScreen.X)` |
| `handleDeepLink`: `startActivity(X.class)` | `pushFragment(NavigatorScreen.X.INSTANCE)` |
| `PendingIntent` / `BroadcastReceiver` / Worker: `Intent(context, X::class.java)` | `NavigatorActivity.intent(context, NavigatorScreen.X).apply { flags = … }` |
| `X.createIntent(...)` factory | inline `NavigatorActivity.intent(...)` + only the extras the fragment reads |
Keep the original flags (`FLAG_ACTIVITY_NEW_TASK`, `FLAG_ACTIVITY_CLEAR_TOP`, …). Extras the
old base class consumed (e.g. `FileActivity.EXTRA_USER` → `setUser`) must now be read by the
fragment from `activity?.intent`, once, when `savedInstanceState == null`.
### Step 6: DI, manifest, cleanup
- `ComponentsModule.java`: remove `abstract XActivity xActivity();` and add
`@ContributesAndroidInjector abstract XFragment xFragment();`. Without this, injection
fails at runtime.
- `AndroidManifest.xml`: remove the `<activity>` entry.
- Delete the Activity, update KDoc/Javadoc `[link]`s that pointed at it, and remove now-unused
imports in files you edited.
### Step 7: Migrate the instrumented test
Rename `XActivityIT` to `XFragmentIT` and launch through the host:
```kotlin
val intent = NavigatorActivity.intent(targetContext, NavigatorScreen.X)
ActivityScenario.launch<NavigatorActivity>(intent).use { scenario -> … }
```
To call into the fragment, find it with `sut.supportFragmentManager.fragments.filterIsInstance<XFragment>()`
(see `TrashbinFragmentIT.launchFragment`). **Rename the reference screenshots with `git mv`**
(`app/screenshots/generic/debug/<pkg>.XActivityIT_*.png` → `XFragmentIT_*.png`) so the
screenshot test compares against the existing images instead of failing.
### Step 8: Verify
1. `./gradlew :app:compileGplayDebugKotlin :app:compileGplayDebugJavaWithJavac :app:compileGplayDebugAndroidTestKotlin`
2. `./gradlew spotlessKotlinCheck detekt lintGplayDebug spotbugsGplayDebug`, then fix findings
in every file you touched.
3. `git grep -n "<ActivityName>\|<old_layout_name>"` returns nothing.
4. Manual checklist (hand it to the developer if you cannot run the app): open from the
drawer, from every notification or PendingIntent, from the deep link; rotate on the
screen; switch to another drawer destination and press back; toggle the drawer with the
hamburger; use every menu action; check light and dark themes.
## References
- `references/ARCHITECTURE.md`: how the navigator works.
- `references/ACTIVITY-TO-FRAGMENT-MAPPING.md`: Activity API → fragment equivalent.
- `references/HOST-CAPABILITIES.md`: what `NavigatorActivity` provides and what it does not.
- `references/PITFALLS.md`: bugs that the earlier conversions ran into.
- `assets/worked-example.md`: the upload list conversion, step by step.
@@ -1,81 +0,0 @@
<!--
~ Nextcloud - Android Client
~
~ SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
~ SPDX-License-Identifier: AGPL-3.0-or-later
-->
# Worked Example: `UploadListActivity` → `UploadListFragment`
This conversion was the hardest one so far, because the Activity extended `FileActivity`.
## Inventory findings
- Base class `FileActivity`. The adapter called `activity.fileOperationsHelper.checkCurrentCredentials(user)`
for uploads that failed with `CREDENTIAL_ERROR`. The result came back through
`onRemoteOperationFinish` → `requestCredentialsUpdate` → `CheckRemoteWipeTask` →
`performCredentialsUpdate` → `startActivityForResult(AuthenticatorActivity)` →
`onActivityResult` → `FilesSyncHelper.restartUploadsIfNeeded`.
- Entry points: drawer `nav_uploads`, `FileUploaderIntents.openUploadListIntent` (upload
notifications, with `EXTRA_USER`), `AppWideNotificationManager.getUploadListPendingIntent`,
`SyncConflictNotificationBroadcastReceiver`.
- `EXTRA_USER` was consumed by `FileActivity.onCreate` → `setUser`. `EXTRA_FILE` was
ignored (the Activity set `file = null`).
- Menu: global pause/resume toggle. A `LocalBroadcastManager` receiver for upload events.
`UploadWarningCard` registered in `onCreate` and unregistered in `onDestroy`.
## Decisions
- Host stays a `DrawerActivity`. The credential flow moves into the
fragment.
- To avoid copying `FileActivity` logic, `ui/helpers/CredentialsUpdateHelper.kt` was
extracted. `FileActivity.performCredentialsUpdate`, `CheckRemoteWipeTask` and the fragment
all use it.
## Resulting files
| File | Role |
|---|---|
| `ui/fragment/uploadList/UploadListFragment.kt` | lifecycle, list setup, receiver, warning card, `EXTRA_USER` |
| `ui/fragment/uploadList/UploadListMenuProvider.kt` | global pause toggle |
| `ui/fragment/uploadList/UploadListConflictHandler.kt` | sync-conflict check and retry |
| `ui/fragment/uploadList/UploadListCredentialsHandler.kt` | check credentials → remote wipe → re-login |
| `ui/helpers/CredentialsUpdateHelper.kt` | credential steps shared with `FileActivity` |
| `res/layout/fragment_upload_list.xml` | old layout without `DrawerLayout`/toolbar/drawer |
## Collaborator changes
- `UploadListAdapter(activity: FileActivity)` → `DrawerActivity`.
`fileOperationsHelper.checkCurrentCredentials(user)` → `itemOnClick.onCredentialErrorClick(user)`.
- `UploadListAdapterHelper(activity: FileActivity)` → `DrawerActivity`;
`activity.accountManager` → `activity.userAccountManager`.
- `UploadListItemOnClick` gained `onCredentialErrorClick(user: User)`.
## Entry point changes
```kotlin
// FileUploaderIntents
val intent = NavigatorActivity.intent(context, NavigatorScreen.UploadList).apply {
addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
putExtra(FileActivity.EXTRA_USER, operation?.user)
}
// AppWideNotificationManager, SyncConflictNotificationBroadcastReceiver
val intent = NavigatorActivity.intent(context, NavigatorScreen.UploadList).apply {
flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP
}
```
```java
// DrawerActivity.onNavigationItemClicked
} else if (itemId == R.id.nav_uploads) {
resetOnlyPersonalAndOnDevice();
pushFragment(NavigatorScreen.UploadList.INSTANCE);
```
## Cleanup
- `ComponentsModule`: `uploadListActivity()` removed, `uploadListFragment()` added.
- Manifest entry removed. `UploadListActivity.kt` and `upload_list_layout.xml` deleted.
- `FileUploadEventBroadcaster` KDoc links updated.
- `UploadListActivityActivityIT` → `UploadListFragmentIT`, with screenshots `git mv`'d.
@@ -1,52 +0,0 @@
<!--
~ Nextcloud - Android Client
~
~ SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
~ SPDX-License-Identifier: AGPL-3.0-or-later
-->
# Activity API → Navigator Fragment Equivalent
| In the Activity | In the fragment |
|---|---|
| `class X : DrawerActivity()` / `FileActivity()` | `class XFragment : Fragment()` |
| `onCreate`: `setContentView(binding.root)` | `onCreateView`: `binding = FragmentXBinding.inflate(inflater, container, false)` |
| View setup in `onCreate` | `onViewCreated` |
| Non-view setup in `onCreate` (intent extras, config) | `onCreate` (guard extras with `savedInstanceState == null`) |
| `onDestroy` cleanup tied to views/receivers registered in `onCreate` | `onDestroyView` |
| `onStart`/`onStop`/`onResume` | same callbacks on the fragment |
| `setupToolbar()`, `updateActionBarTitleAndHomeButtonByString`, `setupDrawer(menuItemId)` | delete; `NavigatorScreen.actionBarStyle()` + host |
| `getMenuItemId()`, `highlightNavigationViewItem()` | delete; `NavigatorScreen.menuItemId()` + host |
| `onCreateOptionsMenu` / `onOptionsItemSelected` | `MenuProvider` added with `viewLifecycleOwner, Lifecycle.State.RESUMED`; return `false` for ids you do not own |
| `android.R.id.home` → toggle drawer | delete; the host handles it |
| `OnBackPressedCallback` for internal navigation | `NavigatorOnBackPressListener` |
| `mDrawerToggle.isDrawerIndicatorEnabled = x` | `navigatorActivity?.setDrawerIndicatorEnabled(x)` |
| `addDrawerListener(l)` | `activity?.findViewById<DrawerLayout>(R.id.drawer_layout)?.addDrawerListener(l)` |
| `startActionMode(cb)` | `navigatorActivity?.startActionMode(cb)` |
| `findViewById(R.id.sort_button)` (toolbar views) | `activity?.findViewById(...)`; the toolbar belongs to the host |
| `supportFragmentManager` for dialogs | `childFragmentManager`, or `requireActivity().supportFragmentManager` when the dialog calls back into the activity |
| `this` as `Context` | `requireContext()` (inside callbacks: capture before launching) |
| `this` as `Activity` (snackbars, PopupMenu, adapters) | `requireActivity()` / typed host |
| `lifecycleScope` | `lifecycleScope` (fragment lifetime; survives while on back stack) or `viewLifecycleOwner.lifecycleScope` (view work only) |
| `user`, `storageManager`, `clientRepository`, `capabilities` | `navigatorActivity?.user`, `.storageManager`, `.clientRepository`, `.capabilities` |
| `setUser(user)` | `navigatorActivity?.setUser(user)` (`BaseActivity.setUser` is public) |
| `startActivityForResult` + `onActivityResult` | `registerForActivityResult(StartActivityForResult())` as a fragment property |
| `finish()` | `activity?.finish()` |
| `DisplayUtils.showSnackMessage(this, …)` | `DisplayUtils.showSnackMessage(requireView(), …)` / `SnackbarUtil.show(this, …)` |
| inner `BroadcastReceiver` class | `private val receiver = object : BroadcastReceiver() { … }`, avoids an extra type in the file |
| `@Inject var x: T? = null` with `@JvmField` | `@Inject lateinit var x: T` |
| Activity fields inherited from the base (`viewThemeUtils`, `preferences`, `connectivityService`, `accountManager`, `backgroundJobManager`) | `@Inject lateinit var` them in the fragment |
## Dialog listener lookups
Dialogs that cast `activity as Listener` break when the listener is now a fragment.
Trashbin fixed `SortingOrderDialogFragment` with this fallback chain:
```kotlin
val listener = parentFragment as? OnSortingOrderListener
?: activity as? OnSortingOrderListener
?: requireActivity().supportFragmentManager.fragments
.firstOrNull { it is OnSortingOrderListener } as? OnSortingOrderListener
```
Check every dialog the screen opens for the same pattern.
@@ -1,89 +0,0 @@
<!--
~ Nextcloud - Android Client
~
~ SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
~ SPDX-License-Identifier: AGPL-3.0-or-later
-->
# Navigator Architecture
All classes live in `app/src/main/java/com/owncloud/android/ui/navigation/`.
```
NavigatorActivity (DrawerActivity) activity_navigator.xml
├─ toolbar_standard (appbar) DrawerLayout
├─ FragmentContainerView ◄── Navigator ──► ├─ CoordinatorLayout
└─ drawer │ ├─ appbar
│ └─ fragment_container_view
└─ drawer
```
## `NavigatorScreen`: the destination registry
A `sealed class NavigatorScreen(val tag: String, val hasDrawer: Boolean = true) : Parcelable`.
Each destination is a `@Parcelize object`, so it can travel in an `Intent` extra and is
compared by identity in `when`.
| Member | Purpose |
|---|---|
| `tag` | Used as the fragment back-stack entry name. Must be unique |
| `hasDrawer` | `true`: hamburger + unlocked drawer. `false`: back arrow + `LOCK_MODE_LOCKED_CLOSED` |
| `fromTag(tag)` | Turns a back-stack entry name back into a screen. Used after configuration changes |
| `menuItemId()` | Drawer item to highlight (`-1` for none) |
| `actionBarStyle()` | `ActionBarStyle.Plain` → `setupToolbar()`, `Search` → `setupHomeSearchToolbarWithSortAndListButtons()`, plus title res |
| `toFragment()` | Creates a fresh fragment instance |
## `Navigator`: the fragment stack
- `push(screen)`: ignores the call if a fragment with that tag already exists. Otherwise it
does `replace(container, screen.toFragment())` + `addToBackStack(screen.tag)`.
- `pop()`: `popBackStack()` and returns the new top screen.
- `getTopScreen()`: reads the name of the last back-stack entry and maps it with `fromTag`.
This keeps working after process death or rotation, because the `FragmentManager`
restores the back stack. The in-memory `stack` does not survive that.
## `NavigatorActivity`: the host
- `onCreate`: inflates `ActivityNavigatorBinding`, then `requireNotNull`s the
`EXTRA_SCREEN` extra. It either `push`es the screen (first launch) or restores the action
bar from `getTopScreen()` (re-creation).
- `onAttachFragment`: `AndroidSupportInjection.inject(fragment)` for **every** attached
fragment. This is why converted fragments need a `@ContributesAndroidInjector` entry in
`ComponentsModule`, even when they do not implement `Injectable`.
- `setupActionBar(screen)`: toolbar style, title, drawer or back arrow, drawer lock mode.
Called on every `push`/`pop`.
- Back press (`OnBackPressedCallback`): close the drawer → let the top
`NavigatorOnBackPressListener` intercept → `finish()` if only one entry is left → `pop()`.
- Home button (`onOptionsItemSelected(android.R.id.home)`): listener intercept → back if
`!hasDrawer` → toggle the drawer otherwise.
- `getMenuItemId()` / `onResume`: highlight the drawer item of the top screen.
- `NavigatorActivity.intent(context, screen)`: the **only** correct way to build a launch
intent.
## `DrawerActivity.pushFragment(screen)`
```java
public void pushFragment(NavigatorScreen screen) {
if (this instanceof NavigatorActivity navigatorActivity) {
navigatorActivity.push(screen); // already in the navigator: swap fragment
} else {
startActivity(NavigatorActivity.Companion.intent(this, screen)); // e.g. from FileDisplayActivity
}
}
```
Drawer item clicks call this, so moving between converted screens swaps fragments
inside a single `NavigatorActivity` instead of starting a new Activity each time.
## `NavigatorOnBackPressListener`
```kotlin
interface NavigatorOnBackPressListener {
fun canInterceptBackPress(): Boolean
fun interceptBackPress()
}
```
Implement it in a fragment that has its own navigation inside the screen. For example,
`TrashbinFragment` goes up one folder while `trashbinPresenter.isRoot == false`. The host
checks it for both the system back gesture and the toolbar home button.
@@ -1,44 +0,0 @@
<!--
~ Nextcloud - Android Client
~
~ SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
~ SPDX-License-Identifier: AGPL-3.0-or-later
-->
# What `NavigatorActivity` Provides
`NavigatorActivity` extends `DrawerActivity → ToolbarActivity → BaseActivity`. It does
**not** extend `FileActivity`. Decided to keep it that way: making every
navigator screen a `FileActivity` would bind `OperationsService` for all of them and show
`FileActivity`'s offline info box on screens that never had one.
## Available from the host
- `BaseActivity`: `user`, `setUser(user)`, `capabilities`, `storageManager`,
`clientRepository`, `userAccountManager`, `account`.
- `ToolbarActivity`: toolbar setup, `showInfoBox`/`hideInfoBox` (only called by
`FileActivity`), sort and grid toolbar buttons (`R.id.sort_button`,
`R.id.switch_grid_view_button`).
- `DrawerActivity`: `appPreferences`, `openDrawer`/`closeDrawer`/`isDrawerOpen`,
`setDrawerIndicatorEnabled`, `pushFragment`, `fetchExternalLinks`.
## Not available: `FileActivity`-only features
| `FileActivity` feature | How to replace it in a fragment |
|---|---|
| `fileOperationsHelper.*` (queues operations on `OperationsService`) | Run the `RemoteOperation`/`SyncOperation` directly in `lifecycleScope` on `Dispatchers.IO` with a client for the right user |
| `onRemoteOperationFinish(op, result)` override | Handle the result inline after the coroutine returns |
| `requestCredentialsUpdate(account)` → `CheckRemoteWipeTask` → `performCredentialsUpdate` | `CredentialsUpdateHelper` (`isRemoteWipeRequested`, `invalidateCredentials`, `createUpdateCredentialsIntent`) + `registerForActivityResult` |
| `onActivityResult(REQUEST_CODE__UPDATE_CREDENTIALS, RESULT_OK)` | the `ActivityResultLauncher` callback |
| `showLoadingDialog` / `dismissLoadingDialog` | `LoadingDialog.newInstance(msg).show(childFragmentManager, TAG)` and `dismissAllowingStateLoss()` |
| `EXTRA_USER` → `setUser` in `onCreate` | fragment reads `activity?.intent` and calls `navigatorActivity?.setUser` |
| `EXTRA_FILE` → `file` | read it in the fragment if it is used, otherwise drop it from the callers |
| `connectivityService`, `backgroundJobManager`, `accountManager` fields | `@Inject lateinit var` in the fragment |
## De-duplication rule
When a fragment needs logic that a base Activity implements privately, **do not copy it**.
Extract the reusable steps into a Kotlin helper (e.g. `ui/helpers/CredentialsUpdateHelper.kt`).
Have the original Activity code call the helper too, so there is one implementation.
Only the orchestration specific to the fragment (coroutines, result launcher, dialog) should
live in the fragment's package.
@@ -1,71 +0,0 @@
<!--
~ Nextcloud - Android Client
~
~ SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
~ SPDX-License-Identifier: AGPL-3.0-or-later
-->
# Pitfalls Found in Earlier Conversions
## Bare intents crash the host (#17193)
`NotificationWork` was changed to `Intent(context, NavigatorActivity::class.java)` without
a screen. `NavigatorActivity.onCreate` calls `requireNotNull` on `EXTRA_SCREEN`, so tapping
the notification crashed. Always use `NavigatorActivity.intent(context, NavigatorScreen.X)`.
Check **every** `PendingIntent`, `BroadcastReceiver`, Worker and notification manager that
referenced the old Activity.
## `binding!!` after a configuration change (#16783)
The `_binding!!` / `val binding get() = _binding!!` pattern crashed when a callback
(presenter, coroutine, receiver) fired after `onDestroyView`. Use a nullable
`private var binding` and `val binding = binding ?: return` in each function.
## Screen not restored after rotation (#16783)
`NavigatorActivity` only re-applies the action bar and drawer highlight if
`NavigatorScreen.fromTag` knows the tag. `fromTag` is not an exhaustive `when` over the
sealed class, so the compiler does not catch a missing entry.
## Dependency injection
`NavigatorActivity.onAttachFragment` injects every fragment. That only works if
`ComponentsModule` has a `@ContributesAndroidInjector abstract XFragment xFragment();`.
Without it you get an `IllegalArgumentException: No injector factory bound` at runtime, not at
compile time. `addFragmentOnAttachListener` / lifecycle callbacks did not behave the same,
which is why the deprecated `onAttachFragment` is used.
## Toolbar views belong to the host
Sort and grid buttons, the info box and the search bar live in the host's `toolbar_standard`.
Reach them with `activity?.findViewById`. Set their visibility explicitly, because the
previous screen may have changed it.
## Dialog callbacks
Dialogs that do `activity as Listener` silently stop working when the listener is now a
fragment (see the `SortingOrderDialogFragment` fix in `ACTIVITY-TO-FRAGMENT-MAPPING.md`).
## Lifecycle scope choice
Long-running work started by the user (retrying an upload, executing an action) should use
the fragment's `lifecycleScope`. That keeps it running while the fragment sits on the back
stack with its view destroyed. Only pure view work should use
`viewLifecycleOwner.lifecycleScope`. Always null-check the binding when the work returns.
## Receivers and registrations
Anything registered in the Activity's `onCreate` and released in `onDestroy` (e.g.
`UploadWarningCard.register/unregister`) must move to `onViewCreated`/`onDestroyView`.
Otherwise it leaks across back-stack transitions or registers twice.
## Screenshot tests
Renaming `XActivityIT` → `XFragmentIT` changes the screenshot names. `git mv` the PNGs in
`app/screenshots/generic/debug/` to match, or CI reports missing references.
## File size and type rules
`AGENTS.md` caps files at 300 lines and wants one type per file. Activities converted to
fragments often exceed 300 lines. Split cohesive flows (menu provider, conflict handler,
credentials handler) into separate classes in the fragment's package.
@@ -1,135 +0,0 @@
---
name: android-eventbus-to-workmanager-flow
description: >
Use when replacing a GreenRobot EventBus event that a WorkManager worker posts (progress,
state, completion) with WorkManager's own observation APIs, consumed through a ViewModel
Flow; when the user mentions "event bus", "EventBus", "EventBusFactory", "@Subscribe",
"worker progress", "setProgress", "observe worker", "getWorkInfosForUniqueWorkFlow" or
"listen to the worker through the viewmodel". Covers publishing progress from the worker,
building the ViewModel Flow keyed by the work name, DI registration, collecting the Flow
from Kotlin or legacy Java fragments/activities, and deleting the event classes.
license: AGPL-3.0-or-later
SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
SPDX-License-Identifier: AGPL-3.0-or-later
metadata:
author: Nextcloud Android
version: "1.0.0"
---
# EventBus → WorkManager Flow via ViewModel
Workers used to tell the UI what they were doing by posting GreenRobot EventBus events
(`EventBusFactory.downloadProgressEventBus.post(FileDownloadProgressEvent(percent))`). That
has three problems: the event is global (every subscriber gets every worker's events,
whatever file it is about), it is lost when nobody is registered, and the subscriber has to
register and unregister by hand in `onStart`/`onStop`.
WorkManager already stores each worker's state and progress and exposes them as `Flow`s. The
UI asks WorkManager about **one specific piece of work**, through a ViewModel, and collects
the Flow with the lifecycle. Official guide:
https://developer.android.com/develop/background-work/background-tasks/persistent/how-to/observe
Converted so far: `FileDownloadProgressEvent` → `FileDetailFragmentViewModel.downloadProgress`
(see `assets/worked-example.md`). The earlier `FileDisplayActivityViewModel.observeOfflineWorker`
is the simplest form of the same pattern (state only, Kotlin consumer).
## The Prime Directive: Behaviour Must Not Change
The screen must show the same thing at the same moments as before. The only intended
differences are the ones the global bus got wrong: a screen now only reacts to the work it is
about. Write them down for the PR description. If you find an unrelated bug, report it
instead of fixing it in the same change.
## Workflow
### Step 0: Inventory (do not edit yet)
1. `git grep -n "<EventName>"` across `app/src`. List every **poster** (usually a worker) and
every **subscriber** (`@Subscribe fun on…(event: <EventName>)`).
2. If the event lives on a dedicated bus (`EventBusFactory.<x>EventBus`), also grep for the
bus. When it has no other users, delete it together with the event.
3. For each poster, find how its work is enqueued in `BackgroundJobManagerImpl`: the
**unique work name** (`enqueueUniqueWork(name, …)`) and the **tags** (`oneTimeRequestBuilder`
adds `formatNameTag`, `formatClassTag`, `formatUserTag`, plus any custom tag). The UI
must be able to rebuild exactly one of these from what it already knows (user, file id…).
4. List what each event field carries and what the subscriber does with it. Decide whether
it is **progress** (while running → `setProgress`), a **result** (at the end →
`Result.success(outputData)`), or only **state** (`WorkInfo.state`, nothing to publish).
5. Look for older parallel mechanisms the subscriber also uses for the same purpose (bound
listeners, `LocalBroadcastManager`). If you can prove one is dead (e.g. a field that is
only ever set to `null`), remove it with all its plumbing, including test doubles in
`app/src/debug` and mocks in `androidTest`. Otherwise leave it and mention it in the summary.
### Step 1: Make the work addressable
If the unique work name / tag builder is `private` in `BackgroundJobManagerImpl`, move it
into the `companion object` next to `formatNameTag`/`formatClassTag` as a public
`format…Tag(...)` function, and have the enqueue and cancel call sites use it. The UI and
the scheduler must build the name with the same function, never with a copied string.
### Step 2: Publish from the worker
- Add the `Data` key as a `const val` in the worker's `companion object`
(`const val PROGRESS_PERCENT = "PROGRESS_PERCENT"`).
- From a `suspend` context call `setProgress(workDataOf(KEY to value))`. From a non-suspend
callback (e.g. `OnDatatransferProgressListener.onTransferProgress`) call
`setProgressAsync(...)`.
- **Throttle it.** WorkManager writes progress to its database. Publish only when the value
changed, and reuse an existing throttle (the notification update interval) when the
worker has one.
- Results go in `Result.success(workDataOf(...))` and are read from `WorkInfo.outputData`.
- Delete the `post(...)` call and the event imports.
### Step 3: ViewModel
One ViewModel per screen, in a package next to the screen
(`ui/fragment/<screen>/<Screen>FragmentViewModel.kt`, mirroring
`ui/activity/filedisplayactivity/FileDisplayActivityViewModel.kt`). Template:
`references/VIEWMODEL-TEMPLATE.md`.
- Constructor-inject `WorkManager` (`@Inject constructor(private val workManager: WorkManager)`).
- Hold the work name the screen is interested in a `MutableStateFlow<String?>`. A setter
function (`observeDownloadProgress(user, file)`) builds it with the Step 1 function.
- Expose a **cold** `Flow<T>`: `filterNotNull()` → `flatMapLatest { getWorkInfosForUniqueWorkFlow(it) }`
→ map the `WorkInfo` list to the UI value → `distinctUntilChanged()`. Use
`getWorkInfoByIdFlow(id)` when you have the request id, `getWorkInfosByTagFlow(tag)` when
the work is not unique.
- Progress is only present while `state == RUNNING`. It is empty after the work finishes, so
filter on `RUNNING` and drop missing keys (`progress.keyValueMap[KEY] as? Int`).
- Register it in `di/ViewModelModule.kt` with `@Binds @IntoMap @ViewModelKey(X::class)`.
Without this, `ViewModelFactory` throws at runtime.
### Step 4: Consumer
- Get the ViewModel from `ViewModelFactory`: Kotlin `by viewModels { vmFactory }`, Java
`new ViewModelProvider(this, vmFactory).get(X.class)` in `onCreate`. Injection of
`Injectable` fragments happens before `onAttach`, so `vmFactory` is ready in `onCreate`.
- Tell the ViewModel what to watch where the screen learns its subject (`onViewCreated`,
and every public "show this other file" method such as `updateFileDetails(file, user)`).
- Collect with the **view** lifecycle in fragments:
- Kotlin: `viewLifecycleOwner.lifecycleScope.launch { viewLifecycleOwner.repeatOnLifecycle(STARTED) { vm.flow.collect { … } } }`
- Java: `LifecycleOwnerExtensionsKt.collectWhenStarted(getViewLifecycleOwner(), viewModel.getX(), this::onX);`
(`utils/extensions/LifecycleOwnerExtensions.kt`). Do not switch to `LiveData` for Java
callers. See `references/PITFALLS.md` for why.
- Turn the old `@Subscribe public void onX(Event e)` into `private void onX(T value)`. Keep
its body unchanged apart from reading the value directly.
- Remove the `register`/`unregister` lines for the bus. Keep `EventBus.getDefault()` registration
if the class still has other `@Subscribe` methods.
### Step 5: Delete and verify
1. Delete the event class (and the dedicated bus if it has no users left).
2. `git grep -n "<EventName>\|<busName>"` returns nothing.
3. `./gradlew :app:compileGplayDebugJavaWithJavac spotlessKotlinCheck detekt`, then
`lintGplayDebug spotbugsGplayDebug`. Fix findings in every file you touched.
4. Manual check (hand it to the developer if you cannot run the app): start the work and
open the screen, so the value shows up; open the screen first, then start the work; rotate
while it runs; leave the screen for more than 5 s, let the work finish, come back (no stale
value); open the screen for a *different* subject while work runs for another one (it must
not react).
## References
- `references/VIEWMODEL-TEMPLATE.md`: ViewModel, worker and consumer snippets.
- `references/PITFALLS.md`: what went wrong or nearly went wrong.
- `assets/worked-example.md`: `FileDownloadProgressEvent` → `FileDetailFragmentViewModel`.
@@ -1,56 +0,0 @@
<!--
~ Nextcloud - Android Client
~
~ SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
~ SPDX-License-Identifier: AGPL-3.0-or-later
-->
# Worked Example: `FileDownloadProgressEvent` → `FileDetailFragmentViewModel`
## Inventory findings
- Event: `ui/events/FileDownloadProgressEvent(percent: Int)` on a dedicated bus,
`ui/events/EventBusFactory.downloadProgressEventBus`. Neither had other users.
- Poster: `FileDownloadWorker.onTransferProgress`, on every transfer chunk, unthrottled, with
no file information.
- Subscriber: `FileDetailFragment` (Java). It registered the bus in `onStart`, unregistered
it in `onStop`, and `@Subscribe(threadMode = MAIN) onDownloadProgress` showed the progress
block with the "downloading" text and the percent.
- Enqueue: `BackgroundJobManagerImpl.startFileDownloadJob` →
`enqueueUniqueWork(startFileDownloadJobTag(accountName, fileId), KEEP, request)`, and the
same string as a tag. The builder was `private`.
- Parallel mechanism: `containerActivity.getFileDownloadProgressListener()` /
`FileDownloadWorker.FileDownloadProgressListener`. The field in `FileActivity` is never
assigned, so it is always `null`, which is why the bus was added (commit `37df0dca9d`).
Removed in the same change, since the ViewModel replaces it.
- Folders use `FolderDownloadWorker`, which never posted the event.
## Changes
| File | Change |
|---|---|
| `jobs/BackgroundJobManagerImpl.kt` | `startFileDownloadJobTag` → public companion `formatFileDownloadTag`, used by start and cancel |
| `jobs/download/FileDownloadWorker.kt` | `PROGRESS_PERCENT` key; `setProgressAsync(workDataOf(PROGRESS_PERCENT to percent))` inside the notification throttle; bus post removed |
| `ui/fragment/filedetail/FileDetailFragmentViewModel.kt` | new; `downloadProgress: Flow<Int>` keyed by `formatFileDownloadTag` |
| `di/ViewModelModule.kt` | `@Binds @IntoMap @ViewModelKey(FileDetailFragmentViewModel::class)` |
| `utils/extensions/LifecycleOwnerExtensions.kt` | new; `collectWhenStarted(flow, Consumer)` for Java consumers |
| `ui/fragment/FileDetailFragment.java` | `ViewModelFactory` inject, VM in `onCreate`, `observeDownloadProgress` in `onViewCreated` and `updateFileDetails(file, user)`, `collectWhenStarted` on the view lifecycle, `@Subscribe` → `private void onDownloadProgress(int)`, bus register/unregister removed |
| `ui/events/FileDownloadProgressEvent.kt`, `ui/events/EventBusFactory.kt` | deleted |
| `FileDownloadWorker.FileDownloadProgressListener` and its plumbing | deleted: inner class, worker field, `ComponentsGetter.getFileDownloadProgressListener()`, `FileActivity` field and getter, the two `= null` assignments in `FileDisplayActivity`, the download branches of `FileDetailFragment.listenForTransferProgress`/`leaveTransferProgress`, the `TestActivity` override and the `FileMenuFilterIT` mock |
## Intended behaviour differences
- Progress is shown only for the file the details screen is about, not for whichever file is
downloading.
- The UI updates at the notification throttle (750 ms) instead of on every chunk.
## Decisions
- **Cold `Flow` + `collectWhenStarted`, not `LiveData`.** `LiveData` replayed a stale
percent after a finish that happened while the view was stopped (see `PITFALLS.md`).
- **The ViewModel is created in `onCreate`, not `onViewCreated`.** The activity can call
`updateFileDetails(file, user)` before the view exists, and the ViewModel must survive view
re-creation from the back stack.
- **The finished state is still handled by the existing broadcast path.**
`FileDisplayActivity` calls `updateFileDetails(false, true)` on `ACTION_DOWNLOAD_COMPLETED`.
Moving that to `WorkInfo.State.SUCCEEDED` is a possible follow-up, not part of this change.
@@ -1,67 +0,0 @@
<!--
~ Nextcloud - Android Client
~
~ SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
~ SPDX-License-Identifier: AGPL-3.0-or-later
-->
# Pitfalls
## `LiveData` replays a stale value
The first draft exposed `asLiveData()` so the Java fragment could `observe(...)`. `LiveData`
keeps its last value and stops collecting upstream 5 s after the last observer goes away. If
the download finishes during those 5 s, the cached value is the last running percent, and
the next observer gets it right away. The progress block is shown again for a download that
has already finished. A cold `Flow` collected with `repeatOnLifecycle` asks WorkManager again
on every start and only gets the current state. Use `collectWhenStarted` from Java instead
of `LiveData`.
## Progress disappears when the work finishes
`WorkInfo.progress` is empty as soon as the state leaves `RUNNING`. Do not read progress
from `SUCCEEDED`/`FAILED` infos, and do not treat the missing key as `0`. Use `mapNotNull`
and let the existing "finished" path (broadcast, `updateFileDetails(false, true)`) hide the
UI, as it did before. Put final values in `Result.success(outputData)` if the UI needs them.
## Every `setProgress` is a database write
WorkManager persists progress. Calling it on every transfer chunk writes to the database
hundreds of times per file. Publish only on change and inside the worker's existing
throttle (`minProgressUpdateInterval`).
## Unique work name vs tag
`getWorkInfosForUniqueWorkFlow(name)` matches the `enqueueUniqueWork` name.
`getWorkInfosByTagFlow(tag)` matches `addTag`. In `startFileDownloadJob` the same string
is used for both, but that is not true for every job. Check the enqueue call. Never build the
string by hand in the ViewModel. Make the builder public in the
`BackgroundJobManagerImpl` companion.
## The bus was global; the Flow is not
`FileDownloadProgressEvent` reached `FileDetailFragment` for **any** running download, so
the details of file A could show the progress of file B. The ViewModel is keyed by
account + file id, so it only reacts to its own file. This is the intended change; mention it
in the PR. Check which worker really runs for each subject: folders are downloaded by
`FolderDownloadWorker`, not `FileDownloadWorker`, and never posted the event.
## The subject can change without a new view
`FileDetailFragment.updateFileDetails(OCFile, User)` swaps the file on a live fragment. Call
`viewModel.observeX(...)` there too. Thanks to `flatMapLatest`, the old work's Flow is
cancelled automatically. Guard with `viewModel != null` because the activity can call it on a
fragment that has not reached `onCreate` yet.
## Missing ViewModel binding
Forgetting `@Binds @IntoMap @ViewModelKey(X::class)` in `ViewModelModule` compiles, but
`ViewModelFactory` throws `IllegalArgumentException` when the screen opens.
## Keep other `@Subscribe` methods registered
`FileDetailFragment` still receives `FavoriteEvent` on `EventBus.getDefault()`. Remove only
the registration for the bus you are replacing. Removing the default registration silently
stops the remaining events. The other way round fails too: if the last `@Subscribe` method
goes away but `register(this)` stays, EventBus throws `EventBusException` ("has no public
methods with the @Subscribe annotation") when the screen starts.
@@ -1,126 +0,0 @@
<!--
~ Nextcloud - Android Client
~
~ SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
~ SPDX-License-Identifier: AGPL-3.0-or-later
-->
# Templates
## Worker
```kotlin
companion object {
const val PROGRESS_PERCENT = "PROGRESS_PERCENT"
}
// suspend context
setProgress(workDataOf(PROGRESS_PERCENT to percent))
// non-suspend callback, inside the existing throttle
if (percent != lastPercent && (currentTime - lastUpdateTime) >= minProgressUpdateInterval) {
notificationManager.updateDownloadProgress(percent, totalToTransfer)
setProgressAsync(workDataOf(PROGRESS_PERCENT to percent))
lastUpdateTime = currentTime
}
```
## Work name (BackgroundJobManagerImpl companion)
```kotlin
fun formatFileDownloadTag(accountName: String, fileId: Long): String =
JOB_FOLDER_DOWNLOAD + accountName + fileId
```
Use it in `startXJob` (`enqueueUniqueWork(tag, …)`), in `cancelXJob`, and in the ViewModel.
## ViewModel
```kotlin
class FileDetailFragmentViewModel @Inject constructor(private val workManager: WorkManager) : ViewModel() {
private val downloadWorkName = MutableStateFlow<String?>(null)
@OptIn(ExperimentalCoroutinesApi::class)
val downloadProgress: Flow<Int> = downloadWorkName
.filterNotNull()
.flatMapLatest { workManager.getWorkInfosForUniqueWorkFlow(it) }
.mapNotNull { workInfos -> workInfos.firstOrNull { it.state == WorkInfo.State.RUNNING }?.downloadPercent() }
.distinctUntilChanged()
fun observeDownloadProgress(user: User, file: OCFile) {
downloadWorkName.value = BackgroundJobManagerImpl.formatFileDownloadTag(user.accountName, file.fileId)
}
private fun WorkInfo.downloadPercent(): Int? = progress.keyValueMap[FileDownloadWorker.PROGRESS_PERCENT] as? Int
}
```
State-only variant (no progress published), from `FileDisplayActivityViewModel`:
```kotlin
suspend fun observeOfflineWorker(onComplete: () -> Unit) {
workManager
.getWorkInfosByTagFlow(BackgroundJobManagerImpl.formatClassTag(OfflineOperationsWorker::class))
.collect { workInfos ->
if (workInfos.any { it.state == WorkInfo.State.SUCCEEDED }) {
onComplete()
}
}
}
```
Prefer exposing a `Flow` property over a `suspend fun` with a callback: the consumer decides
the lifecycle, and Java can collect it through `collectWhenStarted`.
## DI (`di/ViewModelModule.kt`)
```kotlin
@Binds
@IntoMap
@ViewModelKey(FileDetailFragmentViewModel::class)
abstract fun fileDetailFragmentViewModel(vm: FileDetailFragmentViewModel): ViewModel
```
## Kotlin consumer (fragment)
```kotlin
@Inject lateinit var vmFactory: ViewModelFactory
private val viewModel by viewModels<FileDetailFragmentViewModel> { vmFactory }
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
viewModel.observeDownloadProgress(user, file)
viewLifecycleOwner.lifecycleScope.launch {
viewLifecycleOwner.repeatOnLifecycle(Lifecycle.State.STARTED) {
viewModel.downloadProgress.collect(::onDownloadProgress)
}
}
}
```
## Java consumer (fragment)
```java
@Inject ViewModelFactory vmFactory;
private FileDetailFragmentViewModel viewModel;
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
viewModel = new ViewModelProvider(this, vmFactory).get(FileDetailFragmentViewModel.class);
}
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
viewModel.observeDownloadProgress(user, getFile());
LifecycleOwnerExtensionsKt.collectWhenStarted(getViewLifecycleOwner(),
viewModel.getDownloadProgress(),
this::onDownloadProgress);
}
private void onDownloadProgress(int percent) { … }
```
`collectWhenStarted` (`utils/extensions/LifecycleOwnerExtensions.kt`) wraps
`lifecycleScope.launch { repeatOnLifecycle(STARTED) { flow.collect(collector::accept) } }`
and takes an `androidx.core.util.Consumer`, so a Java method reference fits.
@@ -1,130 +0,0 @@
---
name: android-java-to-kotlin
description: >
Use when finishing a Java-to-Kotlin conversion in an Android project, when the user
mentions "java to kotlin", "j2k", "convert java", "migrate java to kotlin", "finish the
conversion", "make it idiomatic", or when a freshly IDE-converted .kt file needs to be
turned into clean, modern, idiomatic Kotlin. The developer first runs the IDE converter
(Android Studio: Code > Convert Java File to Kotlin File), then this skill drives the
second pass: idiomatic cleanup, fail-fast control flow, coroutines/lifecycleScope,
modern Android APIs, function decomposition, and a behaviour-locking test.
license: AGPL-3.0-or-later
SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
SPDX-License-Identifier: AGPL-3.0-or-later
metadata:
author: Nextcloud Android
version: "1.0.0"
---
# Android Java to Kotlin Conversion (Second Pass)
The IDE converter produces Kotlin that *compiles* but is not *idiomatic*: platform types
everywhere, one giant function per lifecycle callback, nested `if`/`else`, `new Thread`,
`switch`, `TextUtils.isEmpty`, magic numbers. This skill drives the disciplined second
pass that turns that output into clean, modern, testable Kotlin — **without changing
observable behaviour** — and then writes a test that proves behaviour is unchanged.
## The Two-Person Workflow
This skill assumes a hand-off:
1. **Developer** runs the mechanical IDE conversion (`Code > Convert Java File to Kotlin
File`, or ⌥⇧⌘K), producing a `.kt` file that compiles but is not idiomatic.
2. **You (Claude)** drive everything after that:
Step 0 Baseline → Step 1 Idiomatic pass → Step 2 Behaviour-locking test → Step 3
Verify. If Step 3 fails or behaviour drifts, loop back to Step 1.
If you are handed a `.java` file instead, first apply a faithful 1:1 translation to reach
the same starting point, then continue.
## The Prime Directive: Behaviour Must Not Change
Every transformation in this skill is **behaviour-preserving**. You are refactoring for
readability, safety, and modern API usage — not adding features or fixing bugs. If you
spot a real bug, surface it to the developer; do not silently "fix" it inside a
conversion. The behaviour-locking test in Step 3 exists to keep you honest.
## Step 0: Establish Baseline
Before editing anything:
1. Read the whole `.kt` file (and, if you can, the original `.java` via
`git show <rev>:<path>.java` or the IDE's local history) to understand *what it does*.
2. Write down the **public/observable surface** you must keep intact:
- Lifecycle callbacks (`onCreate`, `onViewCreated`, `onSaveInstanceState`, …) and their
ordering of side-effects.
- Any Parcelable/Bundle keys, intent extras, and `newInstance(...)` factory shapes.
3. Note threading: which work runs off the main thread today (`Thread`, `AsyncTask`,
`runOnUiThread`, executors) — this maps to coroutines in Step 2.
## Step 1: Idiomatic Pass
Apply, in this order, then re-check the invariants:
1. **Kill platform types.** Give every `!` platform type an explicit nullable/non-null
type based on the Java source and call sites.
2. **Fail fast.** Replace nested `if`/`else` pyramids and null-checks with guard clauses
and `require`/`requireNotNull`/`?: return`. See [FAIL-FAST.md](references/FAIL-FAST.md).
3. **Decompose.** Break each oversized lifecycle callback / `setupView`-style method into
small, single-purpose private functions named for their intent. See
[ANDROID-IDIOMS.md](references/ANDROID-IDIOMS.md).
4. **Modern concurrency.** Replace `new Thread`, `AsyncTask`, `runOnUiThread`, and
callback pairs with `lifecycleScope` + `suspend` + `withContext`. See
[CONCURRENCY.md](references/CONCURRENCY.md).
5. **Modern Android + Kotlin idioms.** Scope functions (`run`/`apply`/`let`), extension
functions, `when`/`partition`/`filter` over `switch`, string templates, `isNullOrEmpty`,
view/KTX extensions. See [ANDROID-IDIOMS.md](references/ANDROID-IDIOMS.md). Retire
deprecated Android APIs (`onActivityResult`, options-menu overrides,
`java.util.Observable`) — see [DEPRECATED-APIS.md](references/DEPRECATED-APIS.md).
6. **Project conventions.** SPDX header, no magic numbers (`companion object` +
`const val`), resources not hardcoded strings, ≤300 lines/file, ≤120 cols. See
[PROJECT-CONVENTIONS.md](references/PROJECT-CONVENTIONS.md).
7. **Testability seams.** Extract pure logic (URL building, permission math, partitioning)
into functions you can unit-test; mark with `@VisibleForTesting` where they must stay
`internal`/`private`-ish but be reachable from tests.
Do NOT expand scope. Unrelated files stay untouched (AGENTS.md / AI policy).
## Step 2: Write a Behaviour-Locking Test (Mandatory)
A conversion is not complete until a test proves behaviour is unchanged. See
[TESTING.md](references/TESTING.md) for the decision tree. In short:
- **Pure functions you extracted** (e.g. link builders, `isReshareForbidden`,
partitioning) → fast JVM unit tests in `app/src/test/` (JUnit4 + mockito-kotlin).
- **Fragment/Activity/DB behaviour** → instrumented test in `app/src/androidTest/`
extending the project's base test class, or a Robolectric test where the project uses it.
- Prefer testing the **seams you just created**. If the Java original had no test, your
new test is the characterization test that locks current behaviour.
Every test file gets the SPDX header and follows the project's test conventions.
## Step 3: Verify
Run and report real output — never claim green without evidence:
```bash
# Formatting + static analysis on the changed files
./gradlew spotlessKotlinCheck detektGplayDebug lintGplayDebug spotbugsGplayDebug
# Unit tests
./gradlew jacocoTestGplayDebugUnitTest
# Instrumented tests (if you wrote one), scoped to the class
./gradlew createGplayDebugCoverageReport -Pcoverage=true \
-Pandroid.testInstrumentationRunnerArguments.class=<fully.qualified.TestClass>
```
## Worked Example
[assets/worked-example.md](assets/worked-example.md) is a real before/after from
`FileDetailSharingFragment` (871-line Java fragment → idiomatic Kotlin) showing each
transformation class in context. Read it when you need a concrete pattern.
## Batch Conversion
Convert one file at a time, leaf dependencies first. Report progress per file. Warn the
developer before a change set grows into several thousand lines — split into focused PRs
(AGENTS.md). Each commit needs `Assisted-by: <agent>:<model>`; only the human adds
`Signed-off-by`.
@@ -1,163 +0,0 @@
# Worked Example: FileDetailSharingFragment
A real conversion of an 871-line Java fragment
(`com.owncloud.android.ui.fragment.FileDetailSharingFragment`) into idiomatic Kotlin. Each
section shows one transformation class from the skill, in context. Behaviour is unchanged
throughout; the only new capability (`@VisibleForTesting createInternalLink`) is a
testability seam that returns the same URL the Java produced.
## A. SPDX Header Rewrite
```diff
-/*
- * Nextcloud Android client application
- *
- * @author Andy Scherzinger
- * ...
- * Copyright (C) 2018 Andy Scherzinger
- * SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
- */
+/*
+ * Nextcloud - Android Client
+ *
+ * SPDX-FileCopyrightText: 2026 Alper Ozturk <[email protected]>
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
```
## B. Fail-Fast Preconditions
```diff
-if (file == null) throw new IllegalArgumentException("File may not be null");
-if (user == null) throw new IllegalArgumentException("Account may not be null");
-fileActivity = (FileActivity) getActivity();
-if (fileActivity == null) throw new IllegalArgumentException("FileActivity may not be null");
+fileActivity = (activity as FileActivity?)
+requireNotNull(file) { "File may not be null" }
+requireNotNull(user) { "Account may not be null" }
+requireNotNull(fileActivity) { "FileActivity may not be null" }
```
## C. Decomposition of `onViewCreated`
The Java `onViewCreated` inlined adapter creation (duplicated for internal/external),
layout managers, listeners, and the fetch kick-off. It became a readable sequence plus
extracted helpers `getUserId()`, `setupInternalShares()`, `setupExternalShares()`,
`createShareListAdapter(userId, type)`, `startAnimation()`. The two near-identical adapter
blocks collapsed into one parameterized factory:
```kotlin
private fun createShareListAdapter(userId: String, type: SharesType): ShareeListAdapter =
ShareeListAdapter(
fileActivity!!, ArrayList(), this, userId, user, viewThemeUtils,
(file?.isEncrypted == true), type
).apply { setHasStableIds(true) }
```
## D. `new Thread` + `runOnUiThread` → `lifecycleScope` + `suspend`
```diff
-private void fetchE2EECounter(Runnable onComplete) {
- new Thread(() -> {
- try { ... fileDataStorageManager.saveFile(file); }
- catch (Exception e) { Log_OC.e(TAG, "..." + e.getMessage()); }
- Activity a = getActivity();
- if (a != null) a.runOnUiThread(onComplete);
- }).start();
-}
+private suspend fun fetchE2EECounter(): Boolean = withContext(Dispatchers.IO) {
+ return@withContext try {
+ val client = clientFactory.create(user)
+ val metadata = RefreshFolderOperation.getDecryptedFolderMetadata(true, file, client, user, requireContext())
+ if (metadata is DecryptedFolderMetadataFile) {
+ file?.setE2eCounter(metadata.metadata.counter)
+ fileDataStorageManager?.saveFile(file)
+ }
+ true
+ } catch (e: Exception) {
+ Log_OC.e(TAG, "Error refreshing E2E counter: " + e.message)
+ false
+ }
+}
```
Caller now `lifecycleScope.launch { if (!fetchE2EECounter()) return@launch; withContext(Main){ ... } }`.
The callback-pair `fetchSharees(onSuccess, onError)` was likewise turned into a `suspend`
call returning `Boolean`.
## E. `switch` Bucketing → `partition` + Set
```diff
-for (OCShare share : shares) {
- if (share.getShareType() != null) {
- switch (share.getShareType()) {
- case PUBLIC_LINK: case FEDERATED_GROUP: case FEDERATED: case EMAIL:
- externalShares.add(share); break;
- default: internalShares.add(share); break;
- }
- }
-}
+private val externalShareTypes = setOf(
+ ShareType.PUBLIC_LINK, ShareType.FEDERATED_GROUP, ShareType.FEDERATED, ShareType.EMAIL
+)
+val (external, internal) = shares
+ .filter { it.shareType != null }
+ .partition { it.shareType in externalShareTypes }
```
## F. Nested `if` Cursor Handling → Guard Clauses
The three-level-nested `handleContactResult` became flat sequential guards, each showing
the snackbar + log and returning, with `cursor.close()` preserved on every path. See
[FAIL-FAST.md](../references/FAIL-FAST.md) section "Deeply Nested".
## G. Scope Functions & KTX
```diff
-final LinearLayout shimmerLayout = binding.shimmerLayout.getRoot();
-shimmerLayout.clearAnimation();
-shimmerLayout.setVisibility(View.GONE);
-binding.shareContainer.setVisibility(View.VISIBLE);
+binding?.run {
+ shimmerLayout.root.run { clearAnimation(); visibility = View.GONE }
+ shareContainer.visibility = View.VISIBLE
+}
```
```diff
-for (int i = 0; i < viewGroup.getChildCount(); i++) { toggleSearchViewEnable(viewGroup.getChildAt(i), enable); }
+for (i in 0..<view.size) { toggleSearchViewEnable(view.getChildAt(i), enable) } // androidx.core.view.size
```
## H. Constants + Companion + `@JvmStatic`
```diff
-private static final String TAG = "FileDetailSharingFragment";
-ViewExtensionsKt.setVisibleIf(binding.sharesListInternalShowAll, adapter.shares.size() > 3);
+companion object {
+ private const val TAG = "FileDetailSharingFragment"
+ private const val MIN_SHOW_ALL_VISIBLE_ITEM_COUNT = 3
+ @JvmStatic fun newInstance(file: OCFile?, user: User?) = FileDetailSharingFragment().apply { ... }
+}
+binding.sharesListInternalShowAll.setVisibleIf(internalShares.size > MIN_SHOW_ALL_VISIBLE_ITEM_COUNT)
```
## I. Testability Seam
`createInternalLink` was inlined string concatenation in Java. It was extracted to a pure
`@VisibleForTesting internal fun createInternalLink(user, file, capabilities): String` that
returns the identical URL — enabling the unit test in
[TESTING.md](../references/TESTING.md) without a device.
## J. Detekt Suppression (Last Resort)
The class is genuinely large and can't be fully split within one conversion, so a
file-level suppression documents the debt honestly:
```kotlin
@Suppress("TooManyFunctions", "LargeClass", "TooGenericExceptionCaught", "ReturnCount")
class FileDetailSharingFragment : Fragment(), ... {
```
Prefer real decomposition; use this only when splitting is out of scope, and tell the
developer.
@@ -1,170 +0,0 @@
<!--
~ Nextcloud - Android Client
~
~ SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
~ SPDX-License-Identifier: AGPL-3.0-or-later
-->
# Android + Kotlin Idioms
Transformations applied during the idiomatic pass. Every one is behaviour-preserving.
Examples are drawn from a real fragment conversion.
## 1. Decompose Oversized Functions
The IDE keeps the Java structure: one enormous `onViewCreated`/`setupView` that inflates,
themes, wires listeners, and kicks off loading in a single 80-line block. Split by
intent into small private functions. The lifecycle callback becomes a readable table of
contents.
```kotlin
// BEFORE: onViewCreated does everything inline (adapters, layout managers, listeners, fetch)
// AFTER
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
fileActivity ?: return
fileDataStorageManager = fileActivity?.storageManager
fileOperationsHelper = fileActivity?.fileOperationsHelper
startAnimation()
val userId = getUserId()
setupInternalShares(userId)
setupExternalShares(userId)
binding?.pickContactEmailBtn?.setOnClickListener { checkContactPermission() }
fetchSharees()
setupView()
}
```
Rules:
- One function = one reason to change. Name it for *what it accomplishes*
(`setupInternalShares`, `themeView`, `disableE2EEShareForV1`), not *how*.
- Factor duplicated blocks into a parameterized helper
(`createShareListAdapter(userId, SharesType.INTERNAL)`).
- Keep files ≤300 lines (project rule). Heavy decomposition sometimes means splitting a
god-class into collaborators — raise that with the developer rather than exceeding 300.
## 2. Scope Functions Over Repetition
Replace repeated `binding.x` / `viewThemeUtils.material.y` chains with `run`/`apply`/`with`.
```kotlin
// BEFORE
viewThemeUtils.material.themeSearchCardView(binding.searchCardWrapper);
viewThemeUtils.material.colorMaterialButtonPrimaryOutlined(binding.sendCopyBtn);
viewThemeUtils.material.colorMaterialButtonPrimaryBorderless(binding.sharesListInternalShowAll);
// AFTER
binding.run {
viewThemeUtils.material.run {
themeSearchCardView(searchCardWrapper)
colorMaterialButtonPrimaryOutlined(sendCopyBtn)
colorMaterialButtonPrimaryBorderless(sharesListInternalShowAll)
}
}
```
Use `apply {}` when configuring and returning the receiver:
```kotlin
ShareeListAdapter(fileActivity!!, ArrayList(), this, userId, user, viewThemeUtils, encrypted, type)
.apply { setHasStableIds(true) }
```
## 3. `switch` → `when` / `filter` + `partition`
Collapse a `switch` that sorts items into buckets into a declarative pipeline with a
constant `Set`.
```kotlin
// BEFORE: for-loop with switch(shareType) adding to internalShares / externalShares
// AFTER
private val externalShareTypes = setOf(
ShareType.PUBLIC_LINK, ShareType.FEDERATED_GROUP, ShareType.FEDERATED, ShareType.EMAIL
)
val (external, internal) = shares
.filter { it.shareType != null }
.partition { it.shareType in externalShareTypes }
```
## 4. Extension Functions & KTX
Import members directly and lean on AndroidX KTX instead of verbose Java utilities.
| Java / verbose | Idiomatic Kotlin |
|---|---|
| `TextUtils.isEmpty(s)` | `s.isNullOrEmpty()` |
| `BundleExtensionsKt.getParcelableArgument(b, k, T.class)` | `b.getParcelableArgument(k, T::class.java)` |
| `for (int i = 0; i < vg.getChildCount(); i++)` | `for (i in 0..<view.size)` (`androidx.core.view.size`) |
| manual getter/setter methods | Kotlin property access (`view.visibility = View.GONE`) |
| `private int x; public int getX()` (read-only to callers) | `var columnsCount = 0; private set` |
| empty override method body | `= Unit` single-expression body |
| free-standing util call | receiver extension (`externalShares.mergeDistinctByToken(publicShares)`) |
Domain-specific extensions read best as receivers on the relevant type:
```kotlin
private fun OCCapability?.isPasswordEnforced(): Boolean =
this?.filesSharingPublicPasswordEnforced?.isTrue == true &&
filesSharingPublicAskForOptionalPassword.isTrue
```
## 5. Null Safety Instead of Platform Types
The IDE leaves `!` platform types and defensive Java null-checks. Replace with `?.`,
`?:`, and Kotlin's `require`/`requireNotNull`. A nullable `binding` (cleared in
`onDestroyView`) is the canonical Android case — guard it with `?.` / `?: return`.
```kotlin
// BEFORE
if (binding == null) return;
final LinearLayout shimmer = binding.shimmerLayout.getRoot();
shimmer.clearAnimation();
// AFTER
binding?.run {
shimmerLayout.root.run {
clearAnimation()
visibility = View.GONE
}
shareContainer.visibility = View.VISIBLE
}
```
## 6. Constants & Companion Object
Move `static final` and magic literals into a `companion object`; use `const val` for
compile-time constants. Add `@JvmStatic` to factory methods still called from Java.
```kotlin
companion object {
private const val TAG = "FileDetailSharingFragment"
private const val ARG_FILE = "FILE"
private const val MIN_SHOW_ALL_VISIBLE_ITEM_COUNT = 3
private const val INTERNAL_LINK_PATH_PRETTY = "/f/"
@JvmStatic
fun newInstance(file: OCFile?, user: User?) = FileDetailSharingFragment().apply {
arguments = Bundle().apply {
putParcelable(ARG_FILE, file)
putParcelable(ARG_USER, user)
}
}
}
```
## 7. Detekt Suppressions Are a Last Resort
If a legacy god-class genuinely cannot be split within the conversion's scope, a
file/class-level `@Suppress("TooManyFunctions", "LargeClass", ...)` is acceptable — but
prefer real decomposition and tell the developer what you suppressed and why.
## 8. `// region` Organization
For large classes, grouping members under `// region <name>` / `// endregion` (lifecycle,
private methods, overrides, companion) aids IDE folding. This is IDE structure, not a
decorative divider. Match the surrounding file's existing style; do not introduce ASCII
banner comments (`// ==== ====`), which the project forbids.
@@ -1,213 +0,0 @@
<!--
~ Nextcloud - Android Client
~
~ SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
~ SPDX-License-Identifier: AGPL-3.0-or-later
-->
# Concurrency: Java Threads → Coroutines & `lifecycleScope`
Replace `new Thread`, `AsyncTask`, executors, and `runOnUiThread`/`Handler.post`
callback-passing with structured coroutines scoped to the component lifecycle. This is
behaviour-preserving *and* fixes leaks: `lifecycleScope`/`viewModelScope` cancel
automatically when the owner is destroyed, so no work touches a dead view.
## Choose the Right Scope
| Context | Scope |
|---|---|
| `Fragment` (UI work tied to view) | `viewLifecycleOwner.lifecycleScope` (preferred) or `lifecycleScope` |
| `Activity` | `lifecycleScope` |
| `ViewModel` | `viewModelScope` |
| No lifecycle owner | inject a `CoroutineScope` / use a repository suspend fun |
Use `Dispatchers.IO` for disk/network/DB, `Dispatchers.Main` (or `withContext(Main)`) to
touch views.
## `AsyncTask` → Coroutines
`AsyncTask` is deprecated. Map its callbacks onto a single `launch`:
| `AsyncTask` | Coroutine |
|---|---|
| `onPreExecute()` | code before `withContext(IO)` (runs on Main) |
| `doInBackground()` | `withContext(Dispatchers.IO) { ... }` |
| `onPostExecute(result)` | code after, back on `Dispatchers.Main` |
| `isCancelled()` | `isActive` (or `ensureActive()`) |
| `cancel(true)` | `job.cancel()` |
| the `AsyncTask` instance field | the returned `Job` |
A self-contained task class stops extending `AsyncTask` and holds the lifecycle owner so
its scope cancels with the screen:
```kotlin
// BEFORE: class GallerySearchTask extends AsyncTask<Void, Void, Result> { ... }
class GallerySearchTask(
private val fragment: GalleryFragment,
private val user: User,
private val storageManager: FileDataStorageManager,
private val endDate: Long,
private val limit: Int
) {
fun execute(): Job = fragment.lifecycleScope.launch(Dispatchers.IO) {
if (!isActive) return@launch
val context = fragment.context ?: return@launch
val result = performSearch(context)
withContext(Dispatchers.Main) {
fragment.searchCompleted(result.emptySearch, result.lastTimestamp)
}
}
}
```
The caller keeps the `Job` and cancels it with the view:
```kotlin
private var photoSearchTask: Job? = null
// ...
photoSearchTask = GallerySearchTask(this, user, storageManager, endDate, limit).execute()
override fun onDestroyView() {
photoSearchTask?.cancel()
photoSearchTask = null
}
```
Because `lifecycleScope` cancels on destroy, the old `WeakReference<Fragment>` leak-guard
disappears — a direct `fragment` reference plus `fragment.context ?: return@launch` is
enough. (PR #16908)
## `AsyncTask` Behind a Callback API → `runCatching` + `fold`
When a service method hid an `AsyncTask` that set mutable fields (a boolean success flag,
`errorMessage`, result fields) and dispatched them in `onPostExecute`, keep the public
callback signature but drive it from a coroutine. Return an **immutable** result from the
background function and branch with `fold`:
```kotlin
private data class ActivitiesResult(
val activities: List<Any>,
val client: NextcloudClient,
val lastGiven: Long
)
override fun getActivities(lastGiven: Long, callback: ActivitiesServiceCallback) {
scope.launch {
runCatching { withContext(Dispatchers.IO) { fetchActivities(lastGiven) } }
.fold(
onSuccess = { (activities, client, updated) ->
callback.onLoaded(activities, client, updated)
},
onFailure = { callback.onError(it.message ?: "") }
)
}
}
```
`runCatching` / `fold` replaces the boolean-success + `errorMessage`-field idiom; the
background function `fetchActivities` throws on failure instead of returning `false`, and
the immutable `ActivitiesResult` destructures straight into `onSuccess`. (PR #16654)
> **Scope caveat:** that PR launched on an ad-hoc `CoroutineScope(Dispatchers.Main)` with
> no lifecycle owner — it never cancels and can leak. Prefer an injected `CoroutineScope`
> or expose a `suspend` function the presenter runs on `lifecycleScope` / `viewModelScope`.
> Flag ad-hoc scopes in review.
## `new Thread { ... runOnUiThread(...) }` → `lifecycleScope.launch` + `withContext`
```kotlin
// BEFORE
private void fetchE2EECounter(Runnable onComplete) {
new Thread(() -> {
try {
OwnCloudClient client = clientFactory.create(user);
Object metadata = RefreshFolderOperation.getDecryptedFolderMetadata(true, file, client, user, ctx);
if (metadata instanceof DecryptedFolderMetadataFile m) {
file.setE2eCounter(m.getMetadata().getCounter());
fileDataStorageManager.saveFile(file);
}
} catch (Exception e) { Log_OC.e(TAG, "..." + e.getMessage()); }
Activity a = getActivity();
if (a != null) a.runOnUiThread(onComplete);
}).start();
}
// AFTER: background work is a suspend fun on IO; the UI reaction runs on Main
private suspend fun fetchE2EECounter(): Boolean = withContext(Dispatchers.IO) {
return@withContext try {
val context = requireContext()
val client = clientFactory.create(user)
val metadata = RefreshFolderOperation.getDecryptedFolderMetadata(true, file, client, user, context)
if (metadata is DecryptedFolderMetadataFile) {
file?.setE2eCounter(metadata.metadata.counter)
fileDataStorageManager?.saveFile(file)
}
true
} catch (e: Exception) {
Log_OC.e(TAG, "Error refreshing E2E counter: " + e.message)
false
}
}
// caller
lifecycleScope.launch {
val ok = fetchE2EECounter()
if (!ok) return@launch
withContext(Dispatchers.Main) { /* update views */ }
}
```
Notes:
- The old code returned nothing and drove the UI via a `Runnable`. The idiomatic version
returns a `Boolean` result and lets the caller decide — same observable outcome, no
callback threading.
- `getActivity() != null` guard becomes `lifecycleScope` cancellation + `binding?`/`?:
return` guards. Preserve any "is the view still alive?" check as a `binding == null`
guard inside `launch`.
## Callback-Pair API → `suspend` Result
Repositories that took `onSuccess`/`onError` lambdas become `suspend` functions returning
a result, awaited inside a coroutine.
```kotlin
// BEFORE
shareRepository.fetchSharees(remotePath, onSuccess = { ... }, onError = { ... });
// AFTER
lifecycleScope.launch {
val result = shareRepository.fetchSharees(remotePath)
if (binding == null) return@launch
if (result) { refreshSharesFromDB(); stopLoadingAnimationAndShowShareContainer() }
else { stopLoadingAnimationAndShowShareContainer(); showError() }
}
```
## Moving DB/IO off the Main Thread
Wrap the blocking DB read in `withContext(Dispatchers.IO)` and hop back to `Main` to touch
adapters/views. This can be a *behaviour improvement* (fewer main-thread stalls) — flag it
to the developer if the Java version was doing DB work on the main thread synchronously,
since timing changes can be observable (e.g. tests that assumed synchronous population).
```kotlin
private suspend fun loadAndPartitionShares(): Pair<List<OCShare>, List<OCShare>> =
withContext(Dispatchers.IO) {
val shares = fileDataStorageManager?.getSharesWithForAFile(file?.remotePath, user?.accountName)
?: emptyList()
val (external, internal) = shares.filter { it.shareType != null }
.partition { it.shareType in externalShareTypes }
internal to external
}
```
## Pitfalls
- Never launch on `GlobalScope` — it outlives the screen and leaks.
- An ad-hoc `CoroutineScope(Dispatchers.Main)` created inside a service/presenter has the
same problem: no lifecycle owner, no cancellation, a leak. Use an injected scope or a
`suspend` function the caller runs on `lifecycleScope` / `viewModelScope`.
- Keep `try/catch` semantics: coroutine cancellation throws `CancellationException`;
rethrow it (don't swallow in a broad `catch (e: Exception)` that logs and continues) or
catch `Exception` only around the real work, not around the whole `launch`.
- Preserve exception-to-UI mapping exactly (same snackbar, same log tag/message).
@@ -1,85 +0,0 @@
<!--
~ Nextcloud - Android Client
~
~ SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
~ SPDX-License-Identifier: AGPL-3.0-or-later
-->
# Retiring Deprecated Android APIs During Conversion
A Java→Kotlin conversion is the right moment to replace deprecated Android APIs the IDE
converter leaves untouched. Each replacement below is behaviour-preserving. Examples are
real conversions (nextcloud/android PRs #16878, #16792).
## `startActivityForResult` / `onActivityResult` → Activity Result API
The request-code + `onActivityResult` protocol is deprecated. Register a launcher at
construction time and receive the result in its callback.
```kotlin
// BEFORE
startActivityForResult(action, SELECT_LOCATION_REQUEST_CODE)
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
if (requestCode == SELECT_LOCATION_REQUEST_CODE && data != null) { handle(data) }
}
// AFTER
private val folderPickerLauncher = registerForActivityResult(
ActivityResultContracts.StartActivityForResult()
) { result ->
if (result.resultCode == Activity.RESULT_OK) {
handle(result.data)
}
}
// launch it:
folderPickerLauncher.launch(intent)
```
Type-safe, no manual request-code bookkeeping, and it survives process death because
registration is declarative. Register during initialization (a field initializer or
`onCreate`/`onViewCreated`) — never inside a click handler, or the registration is lost.
## `onCreateOptionsMenu` / `onOptionsItemSelected` → `MenuProvider`
`setHasOptionsMenu(true)` plus the two menu overrides are deprecated on `Fragment`. Add a
`MenuProvider` bound to the view lifecycle instead.
```kotlin
// AFTER
val menuHost: MenuHost = requireActivity()
menuHost.addMenuProvider(object : MenuProvider {
override fun onCreateMenu(menu: Menu, inflater: MenuInflater) =
inflater.inflate(R.menu.gallery_menu, menu)
override fun onMenuItemSelected(item: MenuItem): Boolean = when (item.itemId) {
R.id.action_select_all -> { selectAll(); true }
else -> false
}
}, viewLifecycleOwner, Lifecycle.State.RESUMED)
```
Passing `viewLifecycleOwner` + `Lifecycle.State.RESUMED` auto-adds and removes the menu as
the view's lifecycle changes — no leak, no manual `setHasOptionsMenu`. (PR #16878)
## `java.util.Observable` — Keep or Migrate?
`java.util.Observable` / `Observer` are deprecated (Java 9+). But a conversion is
behaviour-locked, so **do not** silently swap the notification mechanism — existing Java
observers rely on `setChanged()` / `notifyObservers()`. PR #16792 deliberately KEPT it:
```kotlin
class UploadsStorageManager(...) : Observable() {
fun notifyObserversNow() {
Handler(Looper.getMainLooper()).post {
setChanged()
notifyObservers()
}
}
}
```
Migrating to `StateFlow` / `SharedFlow` changes the observation contract and every call
site — that is a separate, opt-in refactor, not part of a 1:1 conversion. Note the
deprecation, propose the flow migration as a follow-up, and keep the current mechanism
unless the developer scopes the larger change.
@@ -1,115 +0,0 @@
<!--
~ Nextcloud - Android Client
~
~ SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
~ SPDX-License-Identifier: AGPL-3.0-or-later
-->
# Fail Fast: Guard Clauses Over Nested `if`/`else`
The IDE preserves Java's nested-`if` pyramids. Invert them into guard clauses that return
(or throw) early, leaving the happy path at the lowest indentation. Behaviour is
identical — the branches are the same, only the shape changes.
## Precondition Checks → `require` / `requireNotNull`
`requireNotNull` returns the smart-cast non-null value AND throws
`IllegalArgumentException` with the message — exactly matching the Java `if (x == null)
throw new IllegalArgumentException(...)`.
```kotlin
// BEFORE
if (file == null) throw IllegalArgumentException("File may not be null");
if (user == null) throw IllegalArgumentException("Account may not be null");
fileActivity = (FileActivity) getActivity();
if (fileActivity == null) throw IllegalArgumentException("FileActivity may not be null");
// AFTER
fileActivity = activity as? FileActivity
requireNotNull(file) { "File may not be null" }
requireNotNull(user) { "Account may not be null" }
requireNotNull(fileActivity) { "FileActivity may not be null" }
```
Use `require(condition) { msg }` for boolean preconditions:
```kotlin
require(activity is FileActivity) { "Calling activity must be of type FileActivity" }
```
`check`/`checkNotNull` are the `IllegalStateException` equivalents — use them when the Java
threw `IllegalStateException`. Match the original exception type; that is observable
behaviour.
## Early Return Over Nested Success Path
```kotlin
// BEFORE
private void checkShareViaUser() {
if (!MDMConfig.INSTANCE.shareViaUser(requireContext())) {
binding.searchContainer.setVisibility(View.GONE);
}
}
// AFTER
private fun checkShareViaUser() {
if (shareViaUser(requireContext())) return
binding?.searchContainer?.visibility = View.GONE
}
```
## Deeply Nested `if`/`else` → Sequential Guards
The most valuable transformation. A cursor-handling method nested three levels deep
becomes a flat sequence of guard clauses, each handling one failure and returning.
```kotlin
// BEFORE: if (cursor != null) { if (moveToFirst()) { if (columnIndex != -1) {...} else ... } else ... } else ...
// AFTER
private fun handleContactResult(contactUri: Uri) {
val cursor = fileActivity?.contentResolver?.query(contactUri, projection, null, null, null)
if (cursor == null) {
DisplayUtils.showSnackMessage(this, R.string.email_pick_failed)
Log_OC.e(TAG, "Failed to pick email address as Cursor is null.")
return
}
if (!cursor.moveToFirst()) {
DisplayUtils.showSnackMessage(this, R.string.email_pick_failed)
Log_OC.e(TAG, "Failed to pick email address as no Email found.")
return
}
val columnIndex = cursor.getColumnIndex(ContactsContract.CommonDataKinds.Email.ADDRESS)
if (columnIndex == -1) {
DisplayUtils.showSnackMessage(this, R.string.email_pick_failed)
Log_OC.e(TAG, "Failed to pick email address.")
cursor.close()
return
}
val email = cursor.getString(columnIndex)
// ... happy path at base indentation
cursor.close()
}
```
Watch the cleanup: if the Java relied on falling through to a single `cursor.close()`,
each early return must still close it (or wrap in `use {}`). Missing that changes
behaviour (resource leak) — verify it.
## Nullable-Guard Idioms
```kotlin
val activity = fileActivity ?: return
val clientRepository = activity.clientRepository ?: return
val remotePath = file?.remotePath ?: return
```
Each `?: return` collapses one Java `if (x == null) return;`. Chain them at the top of the
function so the body works with non-null smart-cast locals.
## When NOT to Invert
- Do not turn a genuine two-branch decision (both branches do real work) into a guard if
it obscures the symmetry — a `when`/`if-else` expression is clearer there.
- Do not change the *order* of side-effects while inverting; the snackbar/log calls above
must fire in the same cases as before.
@@ -1,79 +0,0 @@
# Project Conventions (Nextcloud Android)
Apply these during Step 2 so the converted file passes review and the quality gates. They
are enforced by `spotlessKotlinCheck`, `detekt`, `lint`, and `spotbugsGplayDebug`.
## SPDX Header (every new/renamed file)
The IDE keeps the old license block. Replace it with the current template. The year is the
year the Kotlin file is created. New contributions are `AGPL-3.0-or-later`; keep
`OR GPL-2.0-only` only if the original file carried it.
```kotlin
/*
* Nextcloud - Android Client
*
* SPDX-FileCopyrightText: <YEAR> Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
```
If the developer wants personal attribution (as in the real conversion), the form
`SPDX-FileCopyrightText: <YEAR> <Name> <email>` is also used — match what the developer
asks for; default to the "Nextcloud GmbH and Nextcloud contributors" line.
## Structural Rules
- **≤300 lines per file.** If decomposition pushes past it, split responsibilities into
separate files/collaborators and tell the developer. A file/class-level
`@Suppress("LargeClass", "TooManyFunctions")` is a last resort for legacy god-classes.
- **≤120 columns per line.**
- **One top-level type per file.** Extract models, states, sealed classes, and listener
interfaces into their own files rather than nesting many types in one.
- **Exactly one trailing newline** at end of file.
## No Magic Numbers / Hardcoded Resources
- Extract literals into named `const val` in a `companion object`
(`MIN_SHOW_ALL_VISIBLE_ITEM_COUNT = 3`, `INTERNAL_LINK_PATH_PRETTY = "/f/"`).
- Strings, colors, dimens come from resources (`R.string.*`, `R.dimen.*`), never inline.
- Only `app/src/main/res/values/strings.xml` may be edited for strings; never touch
`values-*` translation folders.
## Comments & Naming
- No decorative divider comments (`// ==== ====`, `// ---- Title ----`). `// region` /
`// endregion` for IDE folding is allowed and should match the file's existing style.
- Names carry the explanation, not comments. If a name needs a comment to be understood,
rename or decompose instead. Do not add KDoc to a function just because it is new.
- Preserve genuinely informative Javadoc as KDoc (invariant 4); drop noise. A comment
earns its place only for a non-obvious invariant, a platform/server workaround, or an
ordering requirement — and it explains **why**, never **what**.
- Never narrate the conversion itself: no "was a Java thread, now a coroutine", no
"changed from X to Y", no references to the PR, the issue, or this conversation.
Comments describe the code as it stands. That history belongs in the commit message.
- Do not use multiple boolean flags to model state — use an `enum`/sealed class.
## Modern Java Interop
When the file still has Java callers, keep the Java-facing API clean:
`@JvmStatic` for factory/companion functions, `@JvmField` for exposed constants,
`@JvmOverloads` for defaulted params, `@Throws` for checked exceptions.
## Git & Commits (developer-driven)
- Preserve history: the rename `git mv Foo.java Foo.kt` should be a **separate commit**
from the content change so `git blame` follows through.
- Conventional Commits (`refactor(sharing): convert FileDetailSharingFragment to Kotlin`).
- Every AI-assisted commit needs an `Assisted-by: <agent>:<model>` trailer.
- Only the human contributor adds `Signed-off-by` (DCO). You must never add it, and never
open PRs/issues autonomously (AI policy).
## Quality Gate
```bash
./gradlew spotlessKotlinCheck detektGplayDebug lintGplayDebug spotbugsGplayDebug \
jacocoTestGplayDebugUnitTest
```
Fix every finding in the files you changed before declaring done.
@@ -1,107 +0,0 @@
# Behaviour-Locking Tests (Mandatory Step)
A conversion is not done until a test proves behaviour did not change. If the Java class
already had tests, they are your primary safety net — run them and keep them green. If it
had none, you must add a **characterization test** that pins the current behaviour so the
refactor is provably safe.
## Decision Tree
```dot
digraph test_choice {
rankdir=LR;
"What are you locking?" -> "Pure logic (no Android SDK)" [label="fn returns a value"];
"What are you locking?" -> "Component behaviour" [label="Fragment/Activity/DB/View"];
"Pure logic (no Android SDK)" -> "JVM unit test app/src/test/ (JUnit4 + mockito-kotlin)";
"Component behaviour" -> "Robolectric unit test (if project uses it)";
"Component behaviour" -> "Instrumented test app/src/androidTest/ extends base IT class";
}
```
**Prefer the seams you just created.** The idiomatic pass extracts pure functions
(link builders, permission math, partitioning, `isReshareForbidden`) specifically so they
can be unit-tested fast without a device. Test those first; they give the most behaviour
coverage per second.
## 1. JVM Unit Tests — Pure Functions
Location: `app/src/test/`. Fast, no emulator. Command:
`./gradlew jacocoTestGplayDebugUnitTest`.
Mark the function `@VisibleForTesting internal` so the test module can reach it while it
stays out of the public API.
```kotlin
/*
* Nextcloud - Android Client
*
* SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
package com.owncloud.android.ui.fragment
import com.owncloud.android.lib.resources.status.OCCapability
import org.junit.Assert.assertEquals
import org.junit.Test
import org.mockito.kotlin.mock
import org.mockito.kotlin.whenever
class FileDetailSharingFragmentTest {
@Test
fun `internal link uses pretty path when modRewrite is on`() {
val user = mock<User> { whenever(it.server.uri).thenReturn(URI("https://cloud.example")) }
val file = mock<OCFile> { whenever(it.localId).thenReturn(42L) }
val caps = mock<OCCapability> { whenever(it.modRewriteWorking.isTrue).thenReturn(true) }
val link = FileDetailSharingFragment().createInternalLink(user, file, caps)
assertEquals("https://cloud.example/f/42", link)
}
@Test
fun `internal link falls back to index php path when modRewrite is off`() {
// ... same setup with modRewriteWorking.isTrue == false
// assertEquals("https://cloud.example/index.php/f/42", link)
}
}
```
The point: run this test's logic against **both** the pre-conversion and post-conversion
code paths mentally (or, if the Java is still on disk, literally) and confirm the assertion
holds for both. That is what "behaviour must not change" means concretely.
## 2. Instrumented Tests — Component Behaviour
Location: `app/src/androidTest/`. For Fragment/Activity/DB behaviour that needs the Android
runtime. Extend the project's base test class (`AbstractOnServerIT` when server
communication is required) and follow its conventions (separate test user, etc.).
```bash
./gradlew createGplayDebugCoverageReport -Pcoverage=true \
-Pandroid.testInstrumentationRunnerArguments.class=com.owncloud.android.ui.fragment.FileDetailSharingFragmentIT
```
Use `@VisibleForTesting` hooks the original exposed (e.g. a `search(query)` or
`showSharingMenuActionSheet(share)` method) to drive and assert UI state, exactly as the
existing IT suite does. Do not weaken visibility further than the Java original did.
## 3. What to Assert
Lock the observable contract, not the implementation:
- Same return values / thrown exception types for the same inputs (including the
`require`/`requireNotNull` messages if callers depend on them).
- Same Bundle keys, intent extras, and `newInstance` argument wiring.
- Same branch outcomes (e.g. "reshare forbidden when FEDERATED", "show-all button visible
only when > 3 shares").
- For coroutine conversions, assert the end state, and use the project's test dispatcher /
`runTest` so async work is deterministic — never assert on wall-clock timing.
## 4. Guardrails
- Every new test file gets the SPDX header and ends with exactly one trailing newline.
- Do not modify unrelated tests to make yours pass.
- Report actual test output. If a test reveals the conversion changed behaviour, fix the
conversion — do not adjust the test to match the drift.
- If a genuine pre-existing bug is uncovered, surface it to the developer separately; do
not fold a behaviour change into the conversion.
+2 -11
View File
@@ -1,11 +1,7 @@
# SPDX-FileCopyrightText: 2018-2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
codecov:
branch: master
ci:
- drone.nextcloud.com
notify:
after_n_builds: 2
coverage:
precision: 2
@@ -19,12 +15,7 @@ coverage:
comment:
layout: "header, diff, changes, uncovered, tree"
behavior: default
require_changes: true
after_n_builds: 2
github_checks:
annotations: false
ignore:
- "app/src/main/res/values*/*"
- "src/main/res/values*/*"
-19
View File
@@ -1,19 +0,0 @@
FROM ubuntu:resolute@sha256:6a06111c3b0a8600feadb270aec771dc239bf407b25625f93f44ab00e11f4d3c
ARG DEBIAN_FRONTEND=noninteractive
ENV ANDROID_HOME=/usr/lib/android-sdk
RUN apt-get update -y
RUN apt-get install -y unzip wget openjdk-21-jdk vim
RUN wget https://dl.google.com/android/repository/commandlinetools-linux-6858069_latest.zip -O /tmp/commandlinetools.zip
RUN cd /tmp && unzip commandlinetools.zip
RUN mkdir -p /usr/lib/android-sdk/cmdline-tools/
RUN cd /tmp/ && mv cmdline-tools/ latest/ && mv latest/ /usr/lib/android-sdk/cmdline-tools/
RUN mkdir /usr/lib/android-sdk/licenses/
RUN chmod -R 755 /usr/lib/android-sdk/
RUN mkdir -p "$HOME/.gradle" && \
echo "org.gradle.jvmargs=-Xmx6g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:+UseParallelGC -XX:MaxMetaspaceSize=1g" > "$HOME/.gradle/gradle.properties" && \
echo "org.gradle.caching=true" >> "$HOME/.gradle/gradle.properties" && \
echo "org.gradle.parallel=true" >> "$HOME/.gradle/gradle.properties" && \
echo "org.gradle.configureondemand=true" >> "$HOME/.gradle/gradle.properties"
-2
View File
@@ -1,2 +0,0 @@
SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors
SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
-9
View File
@@ -1,9 +0,0 @@
<!--
~ SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors
~ SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
-->
# 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`.
-3
View File
@@ -1,3 +0,0 @@
ANDROID_HOME=/usr/lib/android-sdk
JAVA_OPTS="-Xmx8192M"
GRADLE_OPTS="-Dorg.gradle.daemon=true"
-2
View File
@@ -1,2 +0,0 @@
SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors
SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
-4
View File
@@ -1,4 +0,0 @@
{
"name": "NextcloudAndroid",
"dockerFile": "Dockerfile",
}
-2
View File
@@ -1,2 +0,0 @@
SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors
SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
+360
View File
@@ -0,0 +1,360 @@
---
kind: pipeline
type: docker
name: tests-stable
steps:
- name: gplay
image: nextcloudci/android:android-49
privileged: true
environment:
LOG_USERNAME:
from_secret: LOG_USERNAME
LOG_PASSWORD:
from_secret: LOG_PASSWORD
GIT_USERNAME:
from_secret: GIT_USERNAME
GIT_TOKEN:
from_secret: GIT_TOKEN
ORG_GRADLE_PROJECT_coverage: ''
commands:
- scripts/checkIfRunDrone.sh $GIT_USERNAME $GIT_TOKEN $DRONE_PULL_REQUEST || exit 0
- emulator-headless -avd android-27 -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"#server#server#" gradle.properties
- sed -i s"#1#5#" ./src/androidTest/java/com/nextcloud/client/RetryTestRule.kt
- ./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
- ./gradlew installGplayDebugAndroidTest
- scripts/wait_for_server.sh "server"
- ./gradlew createGplayDebugCoverageReport -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
- ./gradlew combinedTestReport
- 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
services:
- name: server
image: nextcloudci/server:server-17 # also change in updateScreenshots.sh
environment:
EVAL: true
commands:
- BRANCH='stable18' /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"
- su www-data -c "OC_PASS=user3 php /var/www/html/occ user:add --password-from-env --display-name='User Three' user3"
- su www-data -c "php /var/www/html/occ user:setting user2 files quota 1G"
- 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 stable18 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 stable18 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
trigger:
branch:
- master
event:
- push
- pull_request
---
kind: pipeline
type: docker
name: tests-master
steps:
- name: gplay
image: nextcloudci/android:android-49
privileged: true
environment:
LOG_USERNAME:
from_secret: LOG_USERNAME
LOG_PASSWORD:
from_secret: LOG_PASSWORD
GIT_USERNAME:
from_secret: GIT_USERNAME
GIT_TOKEN:
from_secret: GIT_TOKEN
ORG_GRADLE_PROJECT_coverage: ''
commands:
- scripts/checkIfRunDrone.sh $GIT_USERNAME $GIT_TOKEN $DRONE_PULL_REQUEST || exit 0
- emulator-headless -avd android-27 -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"#1#5#" ./src/androidTest/java/com/nextcloud/client/RetryTestRule.kt
- ./gradlew assembleGplay
- ./gradlew assembleGplayDebug
- scripts/wait_for_emulator.sh
- ./gradlew jacocoTestGplayDebugUnitTestReport && scripts/deleteOutdatedComments.sh "master" "Unit" $DRONE_PULL_REQUEST $GIT_USERNAME $GIT_TOKEN || scripts/uploadReport.sh $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER "master" "Unit" $DRONE_PULL_REQUEST $GIT_USERNAME $GIT_TOKEN
- ./gradlew installGplayDebugAndroidTest
- scripts/wait_for_server.sh "server"
- ./gradlew createGplayDebugCoverageReport -Pandroid.testInstrumentationRunnerArguments.notAnnotation=com.owncloud.android.utils.ScreenshotTest && scripts/deleteOutdatedComments.sh "master" "IT" $DRONE_PULL_REQUEST $GIT_USERNAME $GIT_TOKEN || scripts/uploadReport.sh $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER "master" "IT" $DRONE_PULL_REQUEST $GIT_USERNAME $GIT_TOKEN
- ./gradlew combinedTestReport
- curl -o codecov.sh https://codecov.io/bash
- bash ./codecov.sh -t fc506ba4-33c3-43e4-a760-aada38c24fd5
- 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
services:
- name: server
image: nextcloudci/server:server-17 # also change in updateScreenshots.sh
environment:
EVAL: true
commands:
- /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"
- su www-data -c "OC_PASS=user3 php /var/www/html/occ user:add --password-from-env --display-name='User Three' user3"
- su www-data -c "php /var/www/html/occ user:setting user2 files quota 1G"
- 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 master 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 master 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 "git clone -b master https://github.com/nextcloud/end_to_end_encryption/ /var/www/html/apps/end_to_end_encryption/"
- su www-data -c "php /var/www/html/occ app:enable end_to_end_encryption"
- /usr/local/bin/run.sh
trigger:
branch:
- master
event:
- push
- pull_request
---
kind: pipeline
type: docker
name: screenshots-stable
steps:
- name: gplay
image: nextcloudci/android:android-49
privileged: true
environment:
LOG_USERNAME:
from_secret: LOG_USERNAME
LOG_PASSWORD:
from_secret: LOG_PASSWORD
GIT_USERNAME:
from_secret: GIT_USERNAME
GIT_TOKEN:
from_secret: GIT_TOKEN
ORG_GRADLE_PROJECT_coverage: ''
commands:
- scripts/checkIfRunDrone.sh $GIT_USERNAME $GIT_TOKEN $DRONE_PULL_REQUEST || exit 0
- emulator-headless -avd android-27 -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
- ./gradlew assembleGplayDebug
- scripts/wait_for_emulator.sh
- ./gradlew installGplayDebugAndroidTest
- scripts/runAllScreenshotCombinations "stable" false
- 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
trigger:
branch:
- master
event:
- push
- pull_request
---
kind: pipeline
type: docker
name: screenshots-master
steps:
- name: gplay
image: nextcloudci/android:android-49
privileged: true
environment:
LOG_USERNAME:
from_secret: LOG_USERNAME
LOG_PASSWORD:
from_secret: LOG_PASSWORD
GIT_USERNAME:
from_secret: GIT_USERNAME
GIT_TOKEN:
from_secret: GIT_TOKEN
ORG_GRADLE_PROJECT_coverage: ''
commands:
- scripts/checkIfRunDrone.sh $GIT_USERNAME $GIT_TOKEN $DRONE_PULL_REQUEST || exit 0
- emulator-headless -avd android-27 -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
- ./gradlew assembleGplayDebug
- scripts/wait_for_emulator.sh
- ./gradlew installGplayDebugAndroidTest
- sed -i s"#5#1#" ./src/androidTest/java/com/nextcloud/client/RetryTestRule.kt
- scripts/runAllScreenshotCombinations "master" false
- 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
trigger:
branch:
- master
event:
- push
- pull_request
---
kind: pipeline
type: docker
name: analysis
steps:
- name: analysis
image: nextcloudci/android:android-49
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:
- scripts/checkIfRunDrone.sh $GIT_USERNAME $GIT_TOKEN $DRONE_PULL_REQUEST || exit 0
- export BRANCH=$(scripts/analysis/getBranchName.sh $GIT_USERNAME $GIT_TOKEN $DRONE_PULL_REQUEST)
- scripts/analysis/analysis-wrapper.sh $GIT_USERNAME $GIT_TOKEN $BRANCH $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER $DRONE_PULL_REQUEST
- 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
trigger:
branch:
- master
event:
- push
- pull_request
---
kind: pipeline
type: docker
name: qa
steps:
- name: qa
image: nextcloudci/android:android-49
privileged: true
environment:
LOG_USERNAME:
from_secret: LOG_USERNAME
LOG_PASSWORD:
from_secret: LOG_PASSWORD
GIT_USERNAME:
from_secret: GIT_USERNAME
GIT_TOKEN:
from_secret: GIT_TOKEN
KS_PASS:
from_secret: KS_PASS
KEY_PASS:
from_secret: KEY_PASS
commands:
- scripts/checkIfRunDrone.sh $GIT_USERNAME $GIT_TOKEN $DRONE_PULL_REQUEST || exit 0
- sed -i "/qa/,/\}/ s/versionCode .*/versionCode $DRONE_BUILD_NUMBER/" build.gradle
- sed -i "/qa/,/\}/ s/versionName .*/versionName \"$DRONE_BUILD_NUMBER\"/" build.gradle
- ./gradlew assembleQaDebug
- $(find /opt/android-sdk-linux/build-tools/*/apksigner | sort | tail -n1) sign --ks-pass pass:$KS_PASS --key-pass pass:$KEY_PASS --ks-key-alias key0 --ks scripts/QA_keystore.jks build/outputs/apk/qa/debug/qa-debug-*.apk
- scripts/uploadArtifact.sh $LOG_USERNAME $LOG_PASSWORD $DRONE_BUILD_NUMBER $DRONE_PULL_REQUEST $GIT_USERNAME $GIT_TOKEN
trigger:
event:
- pull_request
+1 -12
View File
@@ -2,9 +2,6 @@
# see http://EditorConfig.org
# SPDX-FileCopyrightText: 2018-2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
# This is the file in the root of the project.
# For sub folders you can have other files that override only some settings.
# For these, this settings should be false.
@@ -16,9 +13,6 @@ max_line_length=120
indent_style=space
indent_size=4
[*.yml]
max_line_length=150
charset=utf-8
# Trimming is good for consistency
@@ -42,10 +36,5 @@ trim_trailing_whitespace=false
indent_size=2
[*.{kt,kts}]
ktlint_code_style = android_studio
# IDE does not follow this Ktlint rule strictly, but the default ordering is pretty good anyway, so let's ditch it
ktlint_standard_import-ordering = disabled
ktlint_standard_no-consecutive-comments = disabled
ktlint_function_naming_ignore_when_annotated_with = Composable
ij_kotlin_allow_trailing_comma = false
ij_kotlin_allow_trailing_comma_on_call_site = false
disabled_rules=import-ordering
+1
View File
@@ -1,3 +1,4 @@
firstPRMergeComment: >
Thanks for your first pull request and welcome to the community!
Feel free to keep them coming! If you are looking for issues to tackle then have a look at this selection: https://github.com/nextcloud/android/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22
Most developers hang out on IRC. So join \#nextcloud-mobile on Freenode for a chat!
-2
View File
@@ -1,2 +0,0 @@
SPDX-FileCopyrightText: 2018-2024 Nextcloud GmbH and Nextcloud contributors
SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
-2
View File
@@ -1,4 +1,2 @@
# SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
# You can add one username per supported platform and one custom link
custom: https://nextcloud.com/include/
+47
View File
@@ -0,0 +1,47 @@
---
name: Bug report
about: Create a report to help us improve
labels: bug
---
### Steps to reproduce
1.
2.
3.
### Expected behaviour
- Tell us what should happen
### Actual behaviour
- Tell us what happens
### Can you reproduce this problem on https://try.nextcloud.com?
- Please create a test demo account and see if this still happens there.
- If yes, please open up a bug report
- If not, please verify server setup and ask for help on forum
### Environment data
Android version:
Device model:
Stock or customized system:
Nextcloud app version:
Nextcloud server version:
Reverse proxy:
### Logs
#### Web server error log
```
Insert your webserver log here
```
#### Nextcloud log (data/nextcloud.log)
```
Insert your Nextcloud log here
```
**NOTE:** Be super sure to remove sensitive data like passwords, note that everybody can look here! You can use the Issue Template application to prefill some of the required information: https://apps.nextcloud.com/apps/issuetemplate
-132
View File
@@ -1,132 +0,0 @@
name: "🐛 Bug report: Nextcloud Android Client"
description: "Submit a report and help us improve the Nextcloud Android Client"
labels: ["bug", "0. Needs triage"]
body:
- type: checkboxes
id: before-posting
attributes:
label: "⚠️ Before posting ⚠️"
description: All conditions are **required**. Your issue can be closed if these are checked incorrectly.
options:
- label: This is a **bug**, not a question or an enhancement.
required: true
- label: I've [searched for similar issues](https://github.com/nextcloud/android/issues) and didn't find a duplicate.
required: true
- label: I've written a clear and descriptive title for this issue, not just "Bug" or "Crash".
required: true
- label: I agree to follow Nextcloud's [Code of Conduct](https://nextcloud.com/contribute/code-of-conduct/).
required: true
- type: textarea
id: repro-steps
attributes:
label: Steps to reproduce
description: |
What are the steps to reproduce this issue? Please be as specific as possible.
If you can't reproduce it, please add an explanation.
placeholder: |
1.
2.
3.
validations:
required: true
- type: textarea
id: expected-behaviour
attributes:
label: Expected behaviour
description: Tell us what should happen.
validations:
required: true
- type: textarea
id: actual-behaviour
attributes:
label: Actual behaviour
description: Tell us what happens instead, as detailed as possible.
validations:
required: true
# disabled because try.nextcloud.com is not working
# - type: dropdown
# id: repro-on-try
# attributes:
# label: Can you reproduce this problem on try.nextcloud.com?
# description: |
# 1. Create a demo account in [try.nextcloud.com](https://try.nextcloud.com). You'll be logged in automatically.
# 2. Got to Settings -> Security and create a new app password
# 3. Log in to this account with this app password by choosing "Alternative login with app token" during the login process.
# options:
# - "Yes"
# - "No"
# - Not applicable (explain in "additional information")
# validations:
# required: true
- type: markdown
attributes:
value: "## Environment information"
- type: input
id: android-version
attributes:
label: Android version
validations:
required: true
- type: input
id: device-model
attributes:
label: Device brand and model
validations:
required: true
- type: dropdown
id: stock-or-custom
attributes:
label: Stock or custom OS?
options:
- Stock
- Custom (explain in "additional information")
validations:
required: true
- type: input
id: app-version
attributes:
label: Nextcloud android app version
description: Check the _About_ section in the Settings screen
validations:
required: true
- type: input
id: server-version
attributes:
label: Nextcloud server version
description: Check _About_ in the top web menu (top right corner)
validations:
required: true
- type: dropdown
id: reverse-proxy
attributes:
label: Using a reverse proxy?
options:
- "I don't know"
- "Yes"
- "No"
validations:
required: true
- type: markdown
attributes:
value: "## Logs"
- type: textarea
id: android-logs
attributes:
label: Android logs
description: |
Please **drop a log file** here.
Log file can be obtained:
- At `storage/emulated/0/data/nextcloud.log` on beta or dev versions
- By using [`logcat`](https://github.com/nextcloud/android#getting-debug-info-via-logcat-mag) otherwise
If you are unable to post logs, explain why in "Additional information"
- type: textarea
id: server-logs
attributes:
label: Server error logs
description: Paste your server error logs here if available. Will be automatically formatted.
render: bash
- type: textarea
id: additional-info
attributes:
label: Additional information
description: Enter any additional information here
@@ -1,2 +0,0 @@
SPDX-FileCopyrightText: 2022-2024 Nextcloud GmbH and Nextcloud contributors
SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
-16
View File
@@ -1,16 +0,0 @@
# SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later
contact_links:
- name: 🚨 Report a security or privacy issue
url: https://hackerone.com/nextcloud
about: Report security and privacy related issues privately to the Nextcloud team, so we can coordinate the fix and release without potentially exposing all Nextcloud servers and users in the meantime.
- name: 🚨 报告安全或隐私问题
url: https://hackerone.com/nextcloud
about: 请以私密方式向 Nextcloud 团队报告安全和隐私相关问题,以便我们能够协调修复工作并安排发布计划,避免在此期间可能暴露所有 Nextcloud 服务器和用户的风险。
- name: ❓ Community Support and Help
url: https://help.nextcloud.com/
about: Configuration, webserver/proxy or performance issues and other questions
- name: 💼 Nextcloud Enterprise
url: https://portal.nextcloud.com/
about: If you are a Nextcloud Enterprise customer, or need Professional support, so it can be resolved directly by our dedicated engineers more quickly
blank_issues_enabled: false
@@ -1,2 +0,0 @@
SPDX-FileCopyrightText: 2022-2024 Nextcloud GmbH and Nextcloud contributors
SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
+9 -37
View File
@@ -1,48 +1,20 @@
---
name: 🚀 Feature request
name: Feature request
about: Suggest an idea for this project
labels: enhancement, 0. Needs triage
labels: enhancement
---
<!--
Thanks for reporting issues back to Nextcloud!
Note: This is the **issue tracker of Nextcloud**, please do NOT use this to get answers to your questions or get help for fixing your installation. This is a place to report bugs to developers, after your server has been debugged. You can find help debugging your system on our home user forums: https://help.nextcloud.com or, if you use Nextcloud in a large organization, ask our engineers on https://portal.nextcloud.com. See also https://nextcloud.com/support for support options.
Nextcloud is an open source project backed by Nextcloud GmbH. Most of our volunteers are home users and thus primarily care about issues that affect home users. Our paid engineers prioritize issues of our customers. If you are neither a home user nor a customer, consider paying somebody to fix your issue, do it yourself or become a customer.
Guidelines for submitting issues:
* Please search the existing issues first, it's likely that your issue was already reported or even fixed.
- Go to https://github.com/nextcloud and type any word in the top search/command bar. You probably see something like "We couldn’t find any repositories matching ..." then click "Issues" in the left navigation.
- You can also filter by appending e. g. "state:open" to the search string.
- More info on search syntax within github: https://help.github.com/articles/searching-issues
* This repository https://github.com/nextcloud/server/issues is *only* for issues within the Nextcloud Server code. This also includes the apps: files, encryption, external storage, sharing, deleted files, versions, LDAP, and WebDAV Auth
* SECURITY: Report any potential security bug to us via our HackerOne page (https://hackerone.com/nextcloud) following our security policy (https://nextcloud.com/security/) instead of filing an issue in our bug tracker.
* The issues in other components should be reported in their respective repositories: You will find them in our GitHub Organization (https://github.com/nextcloud/)
-->
<!--- Please keep this note for other contributors -->
### How to use GitHub
* Please use the 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to show that you are interested into the same feature.
* Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
* Subscribe to receive notifications on status change and new comments.
**Is your feature request related to a problem? Please describe.**
### Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
### Describe the solution you'd like
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
### Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
### Additional context
Add any other context or screenshots about the feature request here.
**NOTE:** Be super sure to remove sensitive data like passwords, note that everybody can look here! You can use the Issue Template application to prefill some of the required information: https://apps.nextcloud.com/apps/issuetemplate
@@ -1,2 +0,0 @@
SPDX-FileCopyrightText: 2022-2024 Nextcloud GmbH and Nextcloud contributors
SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
+5 -22
View File
@@ -1,26 +1,9 @@
<!--
TESTING
### Testing
Writing tests is very important. Please try to write some tests for your PR.
If you need help, please do not hesitate to ask in this PR for help.
Unit tests: https://github.com/nextcloud/android/blob/master/CONTRIBUTING.md#unit-tests
Instrumented tests: https://github.com/nextcloud/android/blob/master/CONTRIBUTING.md#instrumented-tests
UI tests: https://github.com/nextcloud/android/blob/master/CONTRIBUTING.md#ui-tests
-->
### 🖼️ Screenshots
[unit tests](https://github.com/nextcloud/android/blob/master/CONTRIBUTING.md#unit-tests)
[instrumented tests](https://github.com/nextcloud/android/blob/master/CONTRIBUTING.md#instrumented-tests)
[UI tests](https://github.com/nextcloud/android/blob/master/CONTRIBUTING.md#ui-tests)
🏚️ Before | 🏡 After
---|---
B | A
### 🏁 Checklist
- [ ] ⛑️ Tests (unit and/or integration) are included or not needed
- [ ] 🔙 Backport requests are created or not needed: `/backport to stable-xx.x`
- [ ] 📅 Milestone is set
- [ ] 🌸 PR title is meaningful (if it should be in the changelog: is it meaningful to users?)
## 🤖 AI (if applicable)
- [ ] The content of this PR was partly or fully generated using AI (N/A)
- [ ] Tests written, or not not needed
-3
View File
@@ -1,3 +0,0 @@
SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors
SPDX-FileCopyrightText: 2023 Marcel Hibbe <[email protected]>
SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
+19
View File
@@ -0,0 +1,19 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 28
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 14
# Only issues or pull requests with all of these labels are check if stale. Defaults to `[]` (disabled)
onlyLabels:
- bug
- "needs info/discussion"
# Issues with these labels will never be considered stale
exemptLabels: []
# Label to use when marking an issue as stale
staleLabel: stale
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This bug report did not receive an update in the last 4 weeks.
Please take a look again and update the issue with new details,
otherwise the issue will be automatically closed in 2 weeks. Thank you!
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false
@@ -1,2 +0,0 @@
SPDX-FileCopyrightText: 2019-2024 Nextcloud GmbH and Nextcloud contributors
SPDX-License-Identifier: AGPL-3.0-or-later
-179
View File
@@ -1,179 +0,0 @@
# This workflow is provided via the organization template repository
#
# https://github.com/nextcloud/.github
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
#
# SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: MIT
name: AI Policy
on:
pull_request:
types: [opened, synchronize, reopened]
branches: [master, main]
permissions:
contents: read
# Required to add the "AI assisted" label via `gh pr edit --add-label`
pull-requests: write
# Required to create the "AI assisted" label via the REST labels endpoint
# (labels are an issues-scoped resource in the GitHub API)
issues: write
concurrency:
group: ai-policy-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
check-ai-trailers:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false
- name: Collect PR commit messages
id: collect
env:
BASE_REF: ${{ github.base_ref }}
run: |
set -euo pipefail
git fetch origin "${BASE_REF}"
MERGE_BASE=$(git merge-base "origin/${BASE_REF}" HEAD)
git log --format="%B" "${MERGE_BASE}..HEAD" > /tmp/pr_commits.txt
echo "--- PR commit messages ---"
cat /tmp/pr_commits.txt
echo "--------------------------"
- name: Define shared agent detection patterns
run: |
set -euo pipefail
# Email addresses known to be used by coding agents.
# These should never appear in Signed-off-by because the DCO can only be attested by a human.
EMAIL_PATTERN="copilot@github\.com\
|noreply@anthropic\.com\
|devin@cognition\.ai\
|devin@cognition-labs\.com\
|aider@aider\.chat\
|noreply@aider\.chat\
|codex@openai\.com\
|cursor@anysphere\.com\
|windsurf@codeium\.com\
|codeium@codeium\.com\
|amazon-q@amazon\.com\
|codewhisperer@amazon\.com\
|gemini-code-assist@google\.com\
|openhands@all-hands\.dev\
|swe-agent@princeton\.edu"
# Strip embedded whitespace (used above only for readability)
EMAIL_PATTERN=$(echo "$EMAIL_PATTERN" | tr -d ' \n')
echo "AGENT_EMAIL_PATTERN=${EMAIL_PATTERN}" >> "$GITHUB_ENV"
# Display-name prefixes used by known coding agents (shared by Signed-off-by and Co-Authored-By checks)
# shellcheck disable=SC2016
echo 'AGENT_NAMES=GitHub Copilot|Claude( [A-Za-z0-9. -]+)?|Devin( AI)?|aider( \(.*\))?|OpenAI Codex|Cursor( AI)?|Windsurf|Amazon Q|CodeWhisperer|Gemini Code Assist|OpenHands|SWE-agent|AutoCodeRover|Tabnine' >> "$GITHUB_ENV"
- name: Check for AI-assistant / Assisted-by trailers
id: ai_trailers
run: |
set -euo pipefail
AI_ASSISTED=false
if grep -qiE '^(AI-assistant|Assisted-by):' /tmp/pr_commits.txt; then
AI_ASSISTED=true
echo "Found AI-assistant/Assisted-by trailer(s):"
grep -iE '^(AI-assistant|Assisted-by):' /tmp/pr_commits.txt
fi
echo "ai_assisted=${AI_ASSISTED}" >> "$GITHUB_OUTPUT"
- name: Check for coding-agent Signed-off-by trailers
id: agent_signoff
run: |
set -euo pipefail
EMAIL_HITS=$(grep -iE "^Signed-off-by:.*<(${AGENT_EMAIL_PATTERN})>" /tmp/pr_commits.txt 2>/dev/null || true)
NAME_HITS=$(grep -iE "^Signed-off-by: *(${AGENT_NAMES}) *[<(]" /tmp/pr_commits.txt 2>/dev/null || true)
AGENT_LINES=$(printf '%s\n%s' "$EMAIL_HITS" "$NAME_HITS" | sort -u | sed '/^[[:space:]]*$/d')
AGENT_SIGNOFF=false
if [ -n "$AGENT_LINES" ]; then
AGENT_SIGNOFF=true
fi
echo "agent_signoff=${AGENT_SIGNOFF}" >> "$GITHUB_OUTPUT"
{
echo "agent_lines<<AGENT_EOF"
echo "${AGENT_LINES}"
echo "AGENT_EOF"
} >> "$GITHUB_OUTPUT"
- name: Check for coding-agent Co-Authored-By trailers
id: co_authored
run: |
set -euo pipefail
EMAIL_HITS=$(grep -iE "^Co-Authored-By:.*<(${AGENT_EMAIL_PATTERN})>" /tmp/pr_commits.txt 2>/dev/null || true)
NAME_HITS=$(grep -iE "^Co-Authored-By: *(${AGENT_NAMES}) *[<(]" /tmp/pr_commits.txt 2>/dev/null || true)
CO_AUTHORED=false
if [ -n "$EMAIL_HITS" ] || [ -n "$NAME_HITS" ]; then
CO_AUTHORED=true
echo "Found coding-agent Co-Authored-By trailer(s):"
printf '%s\n%s' "$EMAIL_HITS" "$NAME_HITS" | sort -u | sed '/^[[:space:]]*$/d'
fi
echo "co_authored=${CO_AUTHORED}" >> "$GITHUB_OUTPUT"
- name: Create 'AI assisted' label if absent
if: steps.ai_trailers.outputs.ai_assisted == 'true' || steps.agent_signoff.outputs.agent_signoff == 'true' || steps.co_authored.outputs.co_authored == 'true'
env:
GH_TOKEN: ${{ github.token }}
run: |
gh api "repos/${{ github.repository }}/labels" \
--method POST \
-f name="AI assisted" \
-f color="d93f0b" \
-f description="This PR contains AI-assisted commits" \
2>/dev/null || true
- name: Label PR as AI assisted
if: steps.ai_trailers.outputs.ai_assisted == 'true' || steps.agent_signoff.outputs.agent_signoff == 'true' || steps.co_authored.outputs.co_authored == 'true'
env:
GH_TOKEN: ${{ github.token }}
run: |
gh pr edit "${{ github.event.pull_request.number }}" \
--repo "${{ github.repository }}" \
--add-label "AI assisted"
echo "Added 'AI assisted' label to PR #${{ github.event.pull_request.number }}"
- name: Fail on coding-agent Signed-off-by
if: steps.agent_signoff.outputs.agent_signoff == 'true'
env:
AGENT_LINES: ${{ steps.agent_signoff.outputs.agent_lines }}
AGENTS_MD_URL: https://github.com/${{ github.repository }}/blob/${{ github.base_ref }}/AGENTS.md
run: |
echo "::error title=Coding-agent sign-off detected::A Signed-off-by trailer from a known coding agent was found in one or more commits."
echo ""
echo "Offending trailer(s):"
echo "${AGENT_LINES}"
echo ""
echo "The 'Signed-off-by' trailer represents the Developer Certificate of Origin (DCO)"
echo "and must only be attested by a human contributor."
echo "Please amend the affected commit(s) to remove the coding-agent sign-off"
echo "and replace it with an 'Assisted-by' trailer, for example:"
echo ""
echo " Assisted-by: Claude Code:claude-sonnet-4-6"
echo ""
echo "References:"
echo " • AGENTS.md (this repository)"
echo " ${AGENTS_MD_URL}"
echo " • AI Contribution Policy"
echo " https://github.com/nextcloud/.github/blob/master/AI_POLICY.md"
echo " • Contribution Guidelines"
echo " https://github.com/nextcloud/.github/blob/master/CONTRIBUTING.md"
exit 1
-76
View File
@@ -1,76 +0,0 @@
# synced from @nextcloud/android-config
# SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-FileCopyrightText: 2025 Alper Ozturk <[email protected]>
# SPDX-FileCopyrightText: 2023 Tobias Kaminsky <[email protected]>
# SPDX-FileCopyrightText: 2023 Andy Scherzinger <[email protected]>
# SPDX-FileCopyrightText: 2023 Josh Richards <[email protected]>
# SPDX-FileCopyrightText: 2025 Marcel Hibbe <[email protected]>
# SPDX-License-Identifier: GPL-3.0-or-later
name: "Analysis"
on:
pull_request:
branches: [ "master", "main", "stable-*" ]
push:
branches: [ "master", "main", "stable-*" ]
permissions:
pull-requests: write
contents: write
concurrency:
group: analysis-wrapper-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
analysis:
runs-on: ubuntu-latest-max
steps:
- name: Disabled on forks
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository }}
run: |
echo 'Can not analyze PRs from forks'
exit 1
- name: Setup variables # zizmor: ignore[template-injection]
id: get-vars
run: |
if [ -z "$GITHUB_HEAD_REF" ]; then
# push
{
echo "branch=$GITHUB_REF_NAME"
echo "pr=$GITHUB_RUN_ID"
echo "repo=${{ github.repository }}"
} >> "$GITHUB_OUTPUT"
else
# pull request
{
echo "branch=$GITHUB_HEAD_REF"
echo "pr=${{ github.event.pull_request.number }}"
echo "repo=${{ github.event.pull_request.head.repo.full_name }}"
} >> "$GITHUB_OUTPUT"
fi
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
repository: ${{ steps.get-vars.outputs.repo }}
ref: ${{ steps.get-vars.outputs.branch }}
- name: Set up JDK 21
uses: actions/setup-java@b843ebf9b913146b38da2eaa7aeddf76074ae1ad # v6.1.0
with:
distribution: "temurin"
java-version: 25
- name: Install dependencies
run: |
sudo apt install python3-defusedxml
- name: Run analysis wrapper
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mkdir -p "$HOME/.gradle"
{
echo "org.gradle.jvmargs=-Xmx6g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8"
echo "org.gradle.configureondemand=true"
} > "$HOME/.gradle/gradle.properties"
scripts/analysis/analysis-wrapper.sh "${{ steps.get-vars.outputs.branch }}" "${{ secrets.LOG_USERNAME }}" "${{ secrets.LOG_PASSWORD }}" "$GITHUB_RUN_NUMBER" "${{ steps.get-vars.outputs.pr }}"
-51
View File
@@ -1,51 +0,0 @@
# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
name: "Assemble"
on:
pull_request:
branches: [ master, stable-* ]
push:
branches: [ master ]
# Declare default permissions as read only.
permissions: read-all
concurrency:
group: assemble-flavors-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
flavor:
name: flavor (${{ matrix.flavor }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- flavor: Generic
tasks: assembleGenericDebug
- flavor: Gplay
tasks: assembleGplayDebug assembleGplayRelease
- flavor: Huawei
tasks: assembleHuaweiDebug
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: set up JDK 21
uses: actions/setup-java@b843ebf9b913146b38da2eaa7aeddf76074ae1ad # v6.1.0
with:
distribution: "temurin"
java-version: 21
- uses: gradle/actions/wrapper-validation@8da46b539cd8fe6ab27ca75128919a18d757604c # v6.4.1
- name: Setup Gradle
uses: gradle/actions/setup-gradle@8da46b539cd8fe6ab27ca75128919a18d757604c # v6.4.1
- name: Build ${{ matrix.flavor }}
run: |
{
echo "org.gradle.jvmargs=-Xmx4g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:+UseParallelGC -XX:MaxMetaspaceSize=768m"
echo "kotlin.daemon.jvmargs=-Xmx3g -XX:+UseParallelGC -XX:MaxMetaspaceSize=512m"
echo "org.gradle.workers.max=2"
} >> gradle.properties
./gradlew ${{ matrix.tasks }}
-40
View File
@@ -1,40 +0,0 @@
# synced from @nextcloud/android-config
# SPDX-FileCopyrightText: 2022-2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-FileCopyrightText: 2023 Álvaro Brey <[email protected]>
# SPDX-License-Identifier: GPL-3.0-or-later
name: Auto approve sync
on:
pull_request_target: # zizmor: ignore[dangerous-triggers]
branches:
- master
- main
types:
- opened
- reopened
- synchronize
- labeled
concurrency:
group: sync-approve-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions:
pull-requests: write
jobs:
auto-approve:
name: Auto approve sync
runs-on: ubuntu-latest-low
if: ${{ contains(github.event.pull_request.labels.*.name, 'sync') && github.actor == 'nextcloud-android-bot' }}
steps:
- name: Disabled on forks
if: ${{ github.event.pull_request.head.repo.full_name != github.repository }}
run: |
echo 'Can not approve PRs from forks'
exit 1
- uses: hmarr/auto-approve-action@f0939ea97e9205ef24d872e76833fa908a770363 # v4.0.0
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
-36
View File
@@ -1,36 +0,0 @@
# SPDX-FileCopyrightText: 2020-2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
name: Check
on:
pull_request:
branches: [ master, stable-* ]
push:
branches: [ master ]
# Declare default permissions as read only.
permissions: read-all
concurrency:
group: check-kotlin-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
check:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
task: [ detekt, spotlessKotlinCheck, lint ]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up JDK 21
uses: actions/setup-java@b843ebf9b913146b38da2eaa7aeddf76074ae1ad # v6.1.0
with:
distribution: "temurin"
java-version: 21
- name: Setup Gradle
uses: gradle/actions/setup-gradle@8da46b539cd8fe6ab27ca75128919a18d757604c # v6.4.1
- name: Check ${{ matrix.task }}
run: ./gradlew ${{ matrix.task }}
-66
View File
@@ -1,66 +0,0 @@
# synced from @nextcloud/android-config
# SPDX-FileCopyrightText: 2022-2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-FileCopyrightText: 2026 Alper Ozturk <[email protected]>
# SPDX-FileCopyrightText: 2023-2024 Andy Scherzinger <[email protected]>
# SPDX-FileCopyrightText: 2022 Tobias Kaminsky <[email protected]>
# SPDX-FileCopyrightText: 2022 Álvaro Brey <[email protected]>
# SPDX-FileCopyrightText: 2025 Marcel Hibbe <[email protected]>
# SPDX-License-Identifier: GPL-3.0-or-later
name: "CodeQL"
on:
push:
branches: [ "master", "main", "stable-*" ]
pull_request:
branches: [ "master", "main" ]
schedule:
- cron: '24 18 * * 3'
permissions:
contents: read
concurrency:
group: codeql-${{ github.event.pull_request.number || github.run_id }}
cancel-in-progress: true
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest-max
timeout-minutes: 90
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ 'java' ]
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Set Swap Space
if: runner.environment == 'github-hosted'
uses: pierotofy/set-swap-space@49819abfb41bd9b44fb781159c033dba90353a7c # v1.0
with:
swap-size-gb: 10
- name: Initialize CodeQL
uses: github/codeql-action/init@1fc58d04a4d4374f921bdac573c3811c240f9c26 # v4.39.2
with:
languages: ${{ matrix.language }}
- name: Set up JDK 21
uses: actions/setup-java@b843ebf9b913146b38da2eaa7aeddf76074ae1ad # v6.1.0
with:
distribution: "temurin"
java-version: 25
- name: Assemble
run: |
mkdir -p "$HOME/.gradle"
echo "org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError" > "$HOME/.gradle/gradle.properties"
./gradlew --no-daemon assembleDebug
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@1fc58d04a4d4374f921bdac573c3811c240f9c26 # v4.39.2
-86
View File
@@ -1,86 +0,0 @@
#!/bin/sh
# Nextcloud Android Library
#
# SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: MIT
#
if [ $1 = "master" ]; then
SERVER_VERSION_MAIN="main"
SERVER_VERSION_MASTER="master"
else
SERVER_VERSION_MAIN=$1
SERVER_VERSION_MASTER=$1
fi
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
. ~/.bashrc; nvm install node
php /var/www/html/occ log:manage --level warning
OC_PASS=user1 php /var/www/html/occ user:add --password-from-env --display-name='User One' user1
OC_PASS=user2 php /var/www/html/occ user:add --password-from-env --display-name='User Two' user2
OC_PASS=user3 php /var/www/html/occ user:add --password-from-env --display-name='User Three' user3
OC_PASS=test php /var/www/html/occ user:add --password-from-env --display-name='Test@Test' test@test
OC_PASS=test php /var/www/html/occ user:add --password-from-env --display-name='Test Spaces' 'test test'
php /var/www/html/occ user:setting user2 files quota 1G
php /var/www/html/occ group:add users
php /var/www/html/occ group:adduser users user1
php /var/www/html/occ group:adduser users user2
php /var/www/html/occ group:adduser users test
git clone --depth=1 -b $SERVER_VERSION_MASTER https://github.com/nextcloud/activity.git /var/www/html/apps/activity/
php /var/www/html/occ app:enable -f activity
git clone --depth=1 -b $SERVER_VERSION_MAIN https://github.com/nextcloud/text.git /var/www/html/apps/text/
php /var/www/html/occ app:enable -f text
git clone --depth=1 -b $SERVER_VERSION_MASTER https://github.com/nextcloud/end_to_end_encryption.git /var/www/html/apps/end_to_end_encryption/
php /var/www/html/occ app:enable -f end_to_end_encryption
git clone --depth=1 -b $SERVER_VERSION_MASTER https://github.com/nextcloud/password_policy.git /var/www/html/apps/password_policy/
php /var/www/html/occ app:enable -f password_policy
git clone --depth=1 -b $SERVER_VERSION_MASTER https://github.com/nextcloud/external.git /var/www/html/apps/external/
cd /var/www/html/apps/external; composer install --no-dev
php /var/www/html/occ app:enable -f external
php /var/www/html/occ config:app:set external sites --value="{\"1\":{\"id\":1,\"name\":\"Nextcloud\",\"url\":\"https:\/\/www.nextcloud.com\",\"lang\":\"\",\"type\":\"link\",\"device\":\"\",\"icon\":\"external.svg\",\"groups\":[],\"redirect\":false},\"2\":{\"id\":2,\"name\":\"Forum\",\"url\":\"https:\/\/help.nextcloud.com\",\"lang\":\"\",\"type\":\"link\",\"device\":\"\",\"icon\":\"external.svg\",\"groups\":[],\"redirect\":false}}"
git clone --depth=1 -b $SERVER_VERSION_MAIN https://github.com/nextcloud/files_lock.git /var/www/html/apps/files_lock/
php /var/www/html/occ app:enable -f files_lock
git clone --depth=1 -b $SERVER_VERSION_MASTER https://github.com/nextcloud/notifications.git /var/www/html/apps/notifications/
cd /var/www/html/apps/notifications; composer install --no-dev
php /var/www/html/occ app:enable -f notifications
if [ $1 = 'stable22' ]; then
php /var/www/html/occ notification:generate test test
else
php /var/www/html/occ notification:generate test -d test
fi
git clone --depth=1 -b $SERVER_VERSION_MASTER https://github.com/nextcloud/photos.git /var/www/html/apps/photos/
cd /var/www/html/apps/photos; composer install --no-dev
php /var/www/html/occ app:enable -f photos
git clone --depth=1 -b $SERVER_VERSION_MAIN https://github.com/nextcloud/assistant.git /var/www/html/apps/assistant/
cd /var/www/html/apps/assistant; . ~/.bashrc; make
php /var/www/html/occ app:enable -f assistant
php /var/www/html/occ app:enable -f testing
git clone --depth 1 -b $SERVER_VERSION_MASTER https://github.com/nextcloud/files_downloadlimit.git /var/www/html/apps/files_downloadlimit/
php /var/www/html/occ app:enable -f files_downloadlimit
git clone --depth 1 -b $SERVER_VERSION_MASTER https://github.com/nextcloud/recommendations.git /var/www/html/apps/recommendations/
cd /var/www/html/apps/recommendations; composer install --no-dev
php /var/www/html/occ app:enable -f recommendations
git clone --depth 1 -b $SERVER_VERSION_MASTER https://github.com/nextcloud/viewer.git /var/www/html/apps/viewer/
php /var/www/html/occ app:enable -f viewer
php /var/www/html/occ config:system:set ratelimit.protection.enabled --value false --type bool
-20
View File
@@ -1,20 +0,0 @@
#!/bin/sh
# Nextcloud Android Library
#
# SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: MIT
#
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
apt-get update && apt-get install -y composer
mkdir /var/www/.nvm /var/www/.npm
mkdir /var/www/.cache/
touch /var/www/.bashrc
chown -R 33:33 /var/www/.nvm /var/www/.npm /var/www/.bashrc /var/www/.cache
cd /var/www/html/
rm data -rf
rm config/config.php
su www-data -c "git reset --hard"
BRANCH="$1" /usr/local/bin/initnc.sh
-43
View File
@@ -1,43 +0,0 @@
# synced from @nextcloud/android-config
# SPDX-FileCopyrightText: 2022-2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-FileCopyrightText: 2023 Andy Scherzinger <[email protected]>
# SPDX-FileCopyrightText: 2022 Tobias Kaminsky <[email protected]>
# SPDX-FileCopyrightText: 2022 Álvaro Brey <[email protected]>
# SPDX-License-Identifier: GPL-3.0-or-later
name: "Detect new java files"
on:
pull_request:
branches: [ master, main, stable-* ]
permissions: read-all
concurrency:
group: detect-new-java-files-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
detectNewJavaFiles:
runs-on: ubuntu-latest-low
steps:
- id: file_changes
uses: trilom/file-changes-action@a6ca26c14274c33b15e6499323aac178af06ad4b # v1.2.4
with:
output: ','
- name: Detect new java files
run: |
if [ -z '${{ steps.file_changes.outputs.files_added }}' ]; then
echo "No new files added"
exit 0
fi
new_java=$(echo '${{ steps.file_changes.outputs.files_added }}' | tr ',' '\n' | grep '\.java$' | cat)
if [ -n "$new_java" ]; then
# shellcheck disable=SC2016
printf 'New java files detected:\n```\n%s\n```\n' "$new_java" | tee "$GITHUB_STEP_SUMMARY"
exit 1
else
echo "No new java files detected"
exit 0
fi
-30
View File
@@ -1,30 +0,0 @@
# SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-FileCopyrightText: 2023 Tobias Kaminsky <[email protected]>
# SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
name: "Detect wrong settings"
on:
pull_request:
branches: [ master, stable-* ]
# Declare default permissions as read only.
permissions: read-all
concurrency:
group: detect-wrong-settings-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
detectWrongSettings:
runs-on: ubuntu-26.04
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up JDK 21
uses: actions/setup-java@b843ebf9b913146b38da2eaa7aeddf76074ae1ad # v6.1.0
with:
distribution: "temurin"
java-version: 21
- name: Detect SNAPSHOT
run: scripts/analysis/detectWrongSettings.sh
+20
View File
@@ -0,0 +1,20 @@
name: Detekt
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
detekt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Runt detekt
run: ./gradlew detekt
+25
View File
@@ -0,0 +1,25 @@
name: "Gplay Flavor"
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
gPlayFlavor:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Install NDK
run: echo "y" | sudo /usr/local/lib/android/sdk/tools/bin/sdkmanager --install "ndk;21.0.6113669" --sdk_root=${ANDROID_SDK_ROOT}
- name: Build with Gradle
run: |
mkdir -p $HOME/.gradle
echo "org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError" > $HOME/.gradle/gradle.properties
./gradlew assembleGplay
-103
View File
@@ -1,103 +0,0 @@
# SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: MIT
name: "Garm"
on:
pull_request:
branches: [ master, stable-* ]
permissions:
contents: read
pull-requests: write
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-26.04
services:
server:
image: ${{ matrix.server == 'stable22' && 'ghcr.io/nextcloud/continuous-integration-shallow-server-php8.0:1' || 'ghcr.io/nextcloud/continuous-integration-shallow-server-php8.3:latest' }}
options: --name server
ports:
- 80:80
strategy:
fail-fast: false
matrix:
server: [ stable22, stable35, master ]
api-level: [ 29 ] # [ 21, 36 ]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: configure server
run: |
sudo apt-get update && sudo apt-get install unzip cpu-checker qemu-system-x86 --yes
sudo chmod 666 /dev/kvm
docker cp .github/workflows/configServer.sh server:/tmp/
docker exec server chmod +x /tmp/configServer.sh
docker exec server /tmp/configServer.sh ${{ matrix.server }}
docker cp .github/workflows/configNC.sh server:/tmp/
docker exec server chmod +x /tmp/configNC.sh
docker exec --user www-data server /tmp/configNC.sh ${{ matrix.server }}
docker exec server /usr/local/bin/run.sh
- name: set up JDK 21
uses: actions/setup-java@b843ebf9b913146b38da2eaa7aeddf76074ae1ad # v6.1.0
with:
distribution: "temurin"
java-version: 21
- name: Configure gradle daemon
run: |
mkdir -p $HOME/.gradle
echo "org.gradle.jvmargs=-Xmx6g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:+UseParallelGC -XX:MaxMetaspaceSize=1g" >> $HOME/.gradle/gradle.properties
echo "org.gradle.caching=true" >> $HOME/.gradle/gradle.properties
echo "org.gradle.parallel=true" >> $HOME/.gradle/gradle.properties
echo "org.gradle.configureondemand=true" >> $HOME/.gradle/gradle.properties
- name: Config gplay
run: |
sed -i s#http://server#http://10.0.2.2# gradle.properties
sed -i s'#<bool name="is_beta">false</bool>#<bool name="is_beta">true</bool>#'g app/src/main/res/values/setup.xml
- name: wait and ping server
run: |
while ! curl http://localhost/status.php 2>&1 | grep installed; do
echo "wait…"
sleep 5
done
- name: gplay
env:
GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }}
uses: reactivecircus/android-emulator-runner@a421e43855164a8197daf9d8d40fe71c6996bb0d # v2.38.0
with:
api-level: ${{ matrix.api-level }}
cmake: 4.1.2
force-avd-creation: false
arch: x86_64
sdcard-path-or-size: 100M
ram-size: 4096M
heap-size: 512M
target: google_apis
emulator-options: -no-metrics -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -skin 500x833
script: scripts/runCombinedTest.sh ${{github.event.number}} ${{ secrets.LOG_USERNAME }} ${{ secrets.LOG_PASSWORD }} ${{github.event.number}} ${{ matrix.server }}
- name: upload failing results
if: ${{ failure() }}
env:
LOG_USERNAME: ${{ secrets.LOG_USERNAME }}
LOG_PASSWORD: ${{ secrets.LOG_PASSWORD }}
GIT_USERNAME: ${{ secrets.GIT_USERNAME }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: scripts/uploadReport.sh "${{ secrets.LOG_USERNAME }}" "${{ secrets.LOG_PASSWORD }}" ${{github.event.number}} ${{ matrix.server }} "IT" ${{github.event.number}}
- name: Archive Espresso results
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
if: ${{ always() }}
with:
name: Report-${{ matrix.server }}-${{ matrix.api-level }}
path: app/build/reports
retention-days: 4
+25
View File
@@ -0,0 +1,25 @@
name: "Generic Flavor"
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
genericFlavor:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Install NDK
run: echo "y" | sudo /usr/local/lib/android/sdk/tools/bin/sdkmanager --install "ndk;21.0.6113669" --sdk_root=${ANDROID_SDK_ROOT}
- name: Build generic
run: |
mkdir -p $HOME/.gradle
echo "org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError" > $HOME/.gradle/gradle.properties
./gradlew assembleGeneric
@@ -0,0 +1,15 @@
name: "Validate Gradle Wrapper"
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
validation:
name: "Validation"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: gradle/wrapper-validation-action@v1
+20
View File
@@ -0,0 +1,20 @@
name: KtLint
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
ktlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Runt ktlint
run: ./gradlew ktlint
-27
View File
@@ -1,27 +0,0 @@
#!/usr/bin/env bash
#
# SPDX-FileCopyrightText: 2022-2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-FileCopyrightText: 2022 Álvaro Brey <[email protected]>
# SPDX-License-Identifier: AGPL-3.0-or-later
#
## This file is intended to be sourced by other scripts
function err() {
echo >&2 "$@"
}
function curl_gh() {
if [[ -n "$GITHUB_TOKEN" ]]
then
curl \
--silent \
--header "Authorization: token $GITHUB_TOKEN" \
"$@"
else
err "WARNING: No GITHUB_TOKEN found. Skipping API call"
fi
}
-2
View File
@@ -1,2 +0,0 @@
SPDX-FileCopyrightText: 2019-2025 Nextcloud GmbH and Nextcloud contributors
SPDX-License-Identifier: AGPL-3.0-or-later
-39
View File
@@ -1,39 +0,0 @@
# SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: MIT
name: Lint translation files
on:
pull_request:
branches: [ master, main, stable-* ]
push:
branches: [ master, main, stable-* ]
permissions:
contents: read
concurrency:
group: lint-php-cs-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
lint:
runs-on: ubuntu-latest-low
name: translations-string-xml
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Check for new lines in translation strings
id: counter
run: |
grep -P '<string name' app/src/main/res/values/strings.xml | grep -vcP '</string>' | grep '^0$'
- name: Output
if: failure()
run: |
grep -P '<string name' app/src/main/res/values/strings.xml | grep -vP '</string>'
-55
View File
@@ -1,55 +0,0 @@
# This workflow is provided via the organization template repository
#
# https://github.com/nextcloud/.github
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
# SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-FileCopyrightText: 2023 Marcel Klehr <[email protected]>
# SPDX-FileCopyrightText: 2023 Joas Schilling <[email protected]>
# SPDX-FileCopyrightText: 2023 Daniel Kesselberg <[email protected]>
# SPDX-FileCopyrightText: 2023 Florian Steffens <[email protected]>
# SPDX-License-Identifier: MIT
name: 'Ask for feedback on PRs'
on:
schedule:
- cron: '30 1 * * *'
permissions:
contents: read
pull-requests: write
jobs:
pr-feedback:
if: ${{ github.repository_owner == 'nextcloud' }}
runs-on: ubuntu-latest-low
steps:
- name: The get-github-handles-from-website action
uses: marcelklehr/get-github-handles-from-website-action@06b2239db0a48fe1484ba0bfd966a3ab81a08308 # v1.0.1
id: scrape
with:
website: 'https://nextcloud.com/team/'
- name: Get blocklist
id: blocklist
run: |
blocklist=$(curl https://raw.githubusercontent.com/nextcloud/.github/master/non-community-usernames.txt | paste -s -d, -)
echo "blocklist=$blocklist" >> "$GITHUB_OUTPUT"
- uses: nextcloud/pr-feedback-action@4738cf661995d96df3512409ec17c900a4081d33 # main
with:
feedback-message: |
Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.
We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.
Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6
Thank you for contributing to Nextcloud and we hope to hear from you soon!
(If you believe you should not receive this message, you can add yourself to the [blocklist](https://github.com/nextcloud/.github/blob/master/non-community-usernames.txt).)
days-before-feedback: 14
start-date: '2024-04-30'
exempt-authors: '${{ steps.blocklist.outputs.blocklist }},${{ steps.scrape.outputs.users }}'
exempt-bots: true
-116
View File
@@ -1,116 +0,0 @@
# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-FileCopyrightText: 2026 Alper Ozturk <[email protected]>
# SPDX-FileCopyrightText: 2023 Andy Scherzinger <[email protected]>
# SPDX-License-Identifier: MIT
name: "QA"
on:
pull_request:
branches: [ main, master, stable-* ]
permissions:
pull-requests: write
contents: read
concurrency:
group: qa-build-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
qa:
runs-on: ubuntu-latest-max
steps:
- name: Check if secrets are available
run: echo "ok=${{ secrets.KS_PASS != '' }}" >> "$GITHUB_OUTPUT"
id: check-secrets
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
if: ${{ steps.check-secrets.outputs.ok == 'true' }}
with:
persist-credentials: false
- name: set up JDK 21
uses: actions/setup-java@b843ebf9b913146b38da2eaa7aeddf76074ae1ad # v6.1.0
if: ${{ steps.check-secrets.outputs.ok == 'true' }}
with:
distribution: "temurin"
java-version: 25
- name: Build QA
id: build-qa
if: ${{ steps.check-secrets.outputs.ok == 'true' }}
env:
KS_PASS: ${{ secrets.KS_PASS }}
KEY_PASS: ${{ secrets.KEY_PASS }}
LOG_USERNAME: ${{ secrets.LOG_USERNAME }}
LOG_PASSWORD: ${{ secrets.LOG_PASSWORD }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mkdir -p "$HOME/.gradle"
{
echo "org.gradle.jvmargs=-Xmx3g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -XX:+UseParallelGC -XX:MaxMetaspaceSize=1g"
echo "org.gradle.caching=true"
echo "org.gradle.parallel=true"
echo "org.gradle.configureondemand=true"
} > "$HOME/.gradle/gradle.properties"
[ -e app/build.gradle ] && sed -i "/qa/,/\}/ s/versionCode .*/versionCode ${{github.event.number}} /" "app/build.gradle"
[ -e app/build.gradle ] && sed -i "/qa/,/\}/ s/versionName .*/versionName \"${{github.event.number}}\"/" "app/build.gradle"
[ -e app/build.gradle.kts ] && sed -i "/qa/,/\}/ s/versionCode .*/versionCode = ${{github.event.number}} /" "app/build.gradle.kts"
[ -e app/build.gradle.kts ] && sed -i "/qa/,/\}/ s/versionName .*/versionName = \"${{github.event.number}}\"/" "app/build.gradle.kts"
./gradlew assembleQaDebug
$(find /usr/local/lib/android/sdk/build-tools/*/apksigner | sort | tail -n1) sign --ks-pass pass:"$KS_PASS" --key-pass pass:"$KEY_PASS" --ks-key-alias key0 --ks ".github/workflows/QA_keystore.jks" app/build/outputs/apk/qa/debug/*qa-debug*.apk
apk=$(find app/build/outputs/apk/qa/debug -name '*qa-debug*.apk' | head -n1)
{
echo "apk-path=$apk"
echo "apk-name=$(basename "$apk")"
echo "apk-size=$(du -h "$apk" | cut -f1)"
} >> "$GITHUB_OUTPUT"
- name: Upload APK
id: upload-apk
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f
with:
path: app/build/outputs/apk/qa/debug/*qa-debug*.apk
retention-days: 7
archive: false
- name: Create QR Code
if: ${{ steps.check-secrets.outputs.ok == 'true' }}
env:
ARTIFACT_URL: ${{ steps.upload-apk.outputs.artifact-url }}
run: |
sudo apt-get -y install qrencode
qrencode -s 8 -o qr.png "$ARTIFACT_URL"
- name: Upload QR
id: upload-qr
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f
with:
path: qr.png
if-no-files-found: error
retention-days: 7
archive: false
- name: Comment PR
if: ${{ steps.check-secrets.outputs.ok == 'true' }}
uses: thollander/actions-comment-pull-request@e4a76dd2b0a3c2027c3fd84147a67c22ee4c90fa
with:
comment-tag: qa-apk
mode: upsert
message: |
### :iphone: QA build
| | |
|---|---|
| **Download** | [${{ steps.build-qa.outputs.apk-name }}](${{ steps.upload-apk.outputs.artifact-url }}) |
| **QR code** | [Open the QR code for this download](${{ steps.upload-qr.outputs.artifact-url }}) |
| **Commit** | ${{ github.event.pull_request.head.sha }} |
| **Version** | `${{ github.event.number }}` |
| **Available until** | 7 days after this build |
The QA build installs alongside a released Nextcloud app, so you can keep
using your existing install while testing.
Downloading the file requires a GitHub account, so open this link on the
device you want to test on, or transfer the APK to it.
@@ -1,61 +0,0 @@
# This workflow is provided via the organization template repository
#
# https://github.com/nextcloud/.github
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
#
# SPDX-FileCopyrightText: Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: MIT
name: Auto approve renovate PRs
on:
pull_request_target: # zizmor: ignore[dangerous-triggers]
branches:
- main
- master
- stable*
permissions:
contents: read
concurrency:
group: renovate-approve-merge-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
auto-approve-merge:
if: github.event.pull_request.user.login == 'renovate[bot]'
runs-on: ubuntu-latest-low
permissions:
# for hmarr/auto-approve-action to approve PRs
pull-requests: write
steps:
- name: Disabled on forks
if: ${{ github.event.pull_request.head.repo.full_name != github.repository }}
run: |
echo 'Can not approve PRs from forks'
exit 1
- uses: mdecoleman/pr-branch-name@55795d86b4566d300d237883103f052125cc7508 # v3.0.0
id: branchname
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
# GitHub actions bot approve
- uses: hmarr/auto-approve-action@f0939ea97e9205ef24d872e76833fa908a770363 # v4.0.0
if: github.actor == 'renovate[bot]'
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ github.head_ref }}
# Enable GitHub auto merge
- name: Enable Pull Request Automerge
if: github.actor == 'renovate[bot]'
run: gh pr merge --merge --auto
env:
GH_TOKEN: ${{ secrets.AUTOMERGE }}
-27
View File
@@ -1,27 +0,0 @@
# This workflow is provided via the organization template repository
#
# https://github.com/nextcloud/.github
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
# SPDX-FileCopyrightText: 2022 Free Software Foundation Europe e.V. <https://fsfe.org>
#
# SPDX-License-Identifier: CC0-1.0
name: REUSE Compliance Check
on: [pull_request]
permissions:
contents: read
jobs:
reuse-compliance-check:
runs-on: ubuntu-latest-low
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: REUSE Compliance Check
uses: fsfe/reuse-action@676e2d560c9a403aa252096d99fcab3e1132b0f5 # v6.0.0
-47
View File
@@ -1,47 +0,0 @@
# synced from @nextcloud/android-config
# SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-FileCopyrightText: 2023 Andy Scherzinger <[email protected]>
# SPDX-License-Identifier: GPL-3.0-or-later
name: Scorecard supply-chain security
on:
branch_protection_rule:
schedule:
- cron: '32 23 * * 4'
push:
branches: [ "main", "master" ]
# Declare default permissions as read only.
permissions: read-all
concurrency:
group: scorecard-supply-chain-security-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
analysis:
name: Scorecard analysis
runs-on: ubuntu-latest
permissions:
# Needed to upload the results to code-scanning dashboard.
security-events: write
steps:
- name: "Checkout code"
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: "Run analysis"
uses: ossf/scorecard-action@fa7117db83c52d787ae5a89f350999701505d78e # v2.5.0
with:
results_file: results.sarif
results_format: sarif
publish_results: false
# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@1fc58d04a4d4374f921bdac573c3811c240f9c26 # v4.39.2
with:
sarif_file: results.sarif
-35
View File
@@ -1,35 +0,0 @@
# synced from @nextcloud/android-config
# SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-FileCopyrightText: 2023 Tobias Kaminsky <[email protected]>
# SPDX-FileCopyrightText: 2022 Álvaro Brey <[email protected]>
# SPDX-License-Identifier: GPL-3.0-or-later
name: 'Close stale issues'
on:
schedule:
- cron: '0 0 * * *'
# Declare default permissions as read only.
permissions: read-all
jobs:
stale:
runs-on: ubuntu-latest-low
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/stale@4391f3da665fdf50b6810c1a66712fb9ba21aa93 # v11.0.0
with:
days-before-stale: 28
days-before-close: 14
days-before-pr-close: -1
only-labels: 'bug,needs info'
exempt-issue-labels: 'no-stale'
stale-issue-message: >-
This bug report did not receive an update in the last 4 weeks.
Please take a look again and update the issue with new details,
otherwise the issue will be automatically closed in 2 weeks. Thank you!
exempt-all-pr-milestones: true
labels-to-remove-when-unstale: 'needs info'
-64
View File
@@ -1,64 +0,0 @@
# SPDX-FileCopyrightText: 2022-2025 Nextcloud GmbH and contributors
# SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
name: Unit tests
on:
pull_request:
branches: [ master, stable-* ]
push:
branches: [ master, stable-* ]
permissions:
contents: read
pull-requests: write
concurrency:
group: unit-tests-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up JDK 21
uses: actions/setup-java@b843ebf9b913146b38da2eaa7aeddf76074ae1ad # v6.1.0
with:
distribution: "temurin"
java-version: 21
- name: Delete old comments
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: ${{ always() }}
run: scripts/deleteOldComments.sh "test" "Unit" ${{github.event.number}}
- name: Setup Gradle
uses: gradle/actions/setup-gradle@8da46b539cd8fe6ab27ca75128919a18d757604c # v6.4.1
- name: Run unit tests with coverage
run: ./gradlew jacocoTestGplayDebugUnitTest
- name: Upload failing results
if: ${{ failure() }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: scripts/uploadReport.sh "${{ secrets.LOG_USERNAME }}" "${{ secrets.LOG_PASSWORD }}" ${{github.event.number}} "test" "Unit" ${{github.event.number}}
- name: Upload coverage to codecov
uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: unit
fail_ci_if_error: true
files: app/build/reports/jacoco/jacocoTestGplayDebugUnitTestReport/jacoco.xml
- name: Upload jacoco artifacts
if: ${{ failure() }}
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: test-results
path: app/build/reports/jacoco/jacocoTestGplayDebugUnitTestReport/html/
-44
View File
@@ -1,44 +0,0 @@
#!/usr/bin/env bash
#
# SPDX-FileCopyrightText: 2019-2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-FileCopyrightText: 2019-2022 Tobias Kaminsky <[email protected]>
# SPDX-License-Identifier: AGPL-3.0-or-later
#
#1: LOG_USERNAME
#2: LOG_PASSWORD
#3: DRONE_BUILD_NUMBER
#4: DRONE_PULL_REQUEST
PUBLIC_URL=https://www.kaminsky.me/nc-dev/android-artifacts
USER=$1
PASS=$2
BUILD=$3
PR=$4
GITHUB_TOKEN=$5
DAV_URL=https://nextcloud.kaminsky.me/remote.php/dav/files/$USER/android-artifacts/
source .github/workflows/lib.sh
REPO=$(cat scripts/repo)
if ! test -e app/build/outputs/apk/qa/debug/*qa-debug*.apk ; then
exit 1
fi
echo "Uploaded artifact to $DAV_URL/$BUILD.apk"
# delete all old comments, starting with "APK file:"
oldComments=$(curl_gh -X GET https://api.github.com/repos/nextcloud/$REPO/issues/$PR/comments | jq '.[] | (.id |tostring) + "|" + (.user.login | test("github-actions") | tostring) + "|" + (.body | test("APK file:.*") | tostring)' | grep "true|true" | tr -d "\"" | cut -f1 -d"|")
echo $oldComments | while read comment ; do
curl_gh -X DELETE https://api.github.com/repos/nextcloud/$REPO/issues/comments/$comment
done
sudo apt-get -y install qrencode
qrencode -o $PR.png "$PUBLIC_URL/$BUILD.apk"
curl -u $USER:$PASS -X PUT $DAV_URL/$BUILD.apk --upload-file app/build/outputs/apk/qa/debug/*qa-debug*.apk
curl -u $USER:$PASS -X PUT $DAV_URL/$BUILD.png --upload-file $PR.png
curl_gh -X POST https://api.github.com/repos/nextcloud/$REPO/issues/$PR/comments -d "{ \"body\" : \"APK file: $PUBLIC_URL/$BUILD.apk <br/><br/> ![qrcode]($PUBLIC_URL/$BUILD.png) <br/><br/>To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app. \" }"
+2 -48
View File
@@ -1,9 +1,6 @@
# SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
# built application files
*.apk
*.ap_
*.aab
# files for the dex VM
*.dex
@@ -22,61 +19,23 @@ target/
local.properties
tests/local.properties
# Signing & secrets
*.jks
*.keystore
keystore.properties
release.properties
google-services.json
GoogleService-Info.plist
*.p12
*.pem
secrets.properties
.env
.env.*
# Windows
Thumbs.db
desktop.ini
# Mac .DS_Store files
.DS_Store
# Linux/editor temp files
*~
*.swp
*.swo
.vscode/
# Proguard README
proguard-project.txt
tests/proguard-project.txt
# Android Studio and Gradle specific entries
.gradle
.idea/*
!.idea/codeStyles/
.idea
*.iml
build
/gradle.properties
.attach_pid*
fastlane/Fastfile
fastlane/ruby
*.hprof
# NDK / C++
*.so
obj/
*.o
*.a
.cxx/
# Testing & coverage
.kotlin/
*.lcov
test-results/
jacoco/
*.exec
# fastlane specific
**/fastlane/report.xml
@@ -90,8 +49,3 @@ jacoco/
**/fastlane/test_output
/fastlane/vendor/
/.bundle/
/fastlane/.bundle
# python
**/__pycache__/
/gradle/verification-keyring.gpg
File renamed without changes.
+33 -15
View File
@@ -2,11 +2,36 @@
<code_scheme name="Project" version="173">
<option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="99" />
<option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="99" />
<option name="PACKAGES_TO_USE_IMPORT_ON_DEMAND">
<value />
</option>
<option name="IMPORT_LAYOUT_TABLE">
<value>
<package name="android" withSubpackages="true" static="false" />
<emptyLine />
<package name="com" withSubpackages="true" static="false" />
<emptyLine />
<package name="junit" withSubpackages="true" static="false" />
<emptyLine />
<package name="net" withSubpackages="true" static="false" />
<emptyLine />
<package name="org" withSubpackages="true" static="false" />
<emptyLine />
<package name="java" withSubpackages="true" static="false" />
<emptyLine />
<package name="javax" withSubpackages="true" static="false" />
<emptyLine />
<package name="" withSubpackages="true" static="false" />
<emptyLine />
<package name="" withSubpackages="true" static="true" />
<emptyLine />
</value>
</option>
<option name="RIGHT_MARGIN" value="120" />
<option name="WRAP_WHEN_TYPING_REACHES_RIGHT_MARGIN" value="true" />
<JavaCodeStyleSettings>
<option name="IMPORT_LAYOUT_TABLE">
<value>
<package name="" withSubpackages="true" static="false" module="true" />
<package name="android" withSubpackages="true" static="false" />
<emptyLine />
<package name="com" withSubpackages="true" static="false" />
@@ -31,14 +56,19 @@
<JetCodeStyleSettings>
<option name="PACKAGES_TO_USE_STAR_IMPORTS">
<value>
<package name="kotlinx.android.synthetic" alias="false" withSubpackages="true" />
<package name="kotlinx.android.synthetic" withSubpackages="true" static="false" />
</value>
</option>
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
<option name="NAME_COUNT_TO_USE_STAR_IMPORT" value="2147483647" />
<option name="NAME_COUNT_TO_USE_STAR_IMPORT_FOR_MEMBERS" value="2147483647" />
<option name="CONTINUATION_INDENT_IN_PARAMETER_LISTS" value="false" />
</JetCodeStyleSettings>
<MarkdownNavigatorCodeStyleSettings>
<option name="RIGHT_MARGIN" value="120" />
</MarkdownNavigatorCodeStyleSettings>
<XML>
<option name="XML_LEGACY_SETTINGS_IMPORTED" value="true" />
</XML>
<codeStyleSettings language="JAVA">
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
<option name="ALIGN_MULTILINE_METHOD_BRACKETS" value="true" />
@@ -164,17 +194,5 @@
</rules>
</arrangement>
</codeStyleSettings>
<codeStyleSettings language="kotlin">
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
<option name="LINE_COMMENT_AT_FIRST_COLUMN" value="false" />
<option name="LINE_COMMENT_ADD_SPACE" value="true" />
<option name="KEEP_BLANK_LINES_IN_DECLARATIONS" value="1" />
<option name="KEEP_BLANK_LINES_IN_CODE" value="1" />
<option name="KEEP_BLANK_LINES_BEFORE_RBRACE" value="0" />
<option name="ALIGN_MULTILINE_PARAMETERS" value="false" />
<indentOptions>
<option name="CONTINUATION_INDENT_SIZE" value="4" />
</indentOptions>
</codeStyleSettings>
</code_scheme>
</component>
-6
View File
@@ -1,6 +0,0 @@
<component name="CopyrightManager">
<copyright>
<option name="notice" value="Nextcloud - Android Client&#10;&#10;SPDX-FileCopyrightText: &amp;#36;{today.year} Your Name &lt;[email protected]&gt;&#10;SPDX-License-Identifier: AGPL-3.0-or-later" />
<option name="myName" value="Nextcloud - Android Client" />
</copyright>
</component>
-3
View File
@@ -1,3 +0,0 @@
<component name="CopyrightManager">
<settings default="Nextcloud - Android Client" />
</component>
-11
View File
@@ -1,11 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="100%" height="100%" viewBox="0 0 1344 1344" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
<path d="M673.24,0.001C1043.55,0.662 1344,301.521 1344,672C1344,1042.89 1042.89,1344 672,1344C301.113,1344 0,1042.89 0,672C0,301.15 301.053,0.06 671.846,0L672.154,0L673.24,0.001Z" style="fill:url(#_Linear1);"/>
<g id="path2" transform="matrix(1.27124,0,0,1.27145,-187.221,-167.93)">
<path d="M672.681,456.07C579.33,456.08 500.945,519.999 476.995,605.988C456.091,559.995 410.078,527.4 356.617,527.394C283.844,527.404 224.009,587.243 224,660.022C223.986,732.815 283.829,792.667 356.617,792.676C410.084,792.666 456.067,760.055 476.968,714.055C500.909,800.059 579.321,863.991 672.684,864C765.524,864.01 843.524,800.77 867.961,715.501C889.204,760.649 934.51,792.667 987.356,792.673C1060.16,792.686 1120.01,732.827 1120,660.019C1119.99,587.225 1060.14,527.379 987.356,527.391C934.507,527.401 889.176,559.409 867.934,604.563C843.497,519.297 765.524,456.058 672.684,456.064L672.681,456.07ZM672.681,533.926C742.787,533.926 798.79,589.913 798.796,660.025C798.796,730.145 742.796,786.156 672.681,786.15C602.575,786.14 546.587,730.136 546.593,660.025C546.603,589.922 602.584,533.935 672.681,533.926ZM356.602,605.25C387.314,605.25 411.366,629.309 411.369,660.022C411.369,690.741 387.319,714.817 356.602,714.82C325.884,714.82 301.83,690.741 301.836,660.022C301.836,629.309 325.892,605.253 356.602,605.25ZM987.356,605.25C1018.07,605.24 1042.15,629.302 1042.15,660.022C1042.16,690.75 1018.08,714.826 987.356,714.82C956.638,714.82 932.584,690.741 932.587,660.022C932.587,629.309 956.644,605.253 987.356,605.25Z" style="fill:white;fill-rule:nonzero;"/>
</g>
<defs>
<linearGradient id="_Linear1" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(1180.66,-1344,1344,1180.66,163.341,1344)"><stop offset="0" style="stop-color:rgb(0,130,201);stop-opacity:1"/><stop offset="1" style="stop-color:rgb(28,175,255);stop-opacity:1"/></linearGradient>
</defs>
</svg>

Before

Width:  |  Height:  |  Size: 2.3 KiB

-83
View File
@@ -1,83 +0,0 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="ktlint" />
<inspection_tool class="AutoCloseableResource" enabled="true" level="WARNING" enabled_by_default="true">
<option name="METHOD_MATCHER_CONFIG" value="java.util.Formatter,format,java.io.Writer,append,com.google.common.base.Preconditions,checkNotNull,org.hibernate.Session,close,java.io.PrintWriter,printf,java.io.PrintStream,printf,java.nio.channels.FileChannel,position,okhttp3.Call,execute" />
</inspection_tool>
<inspection_tool class="ComposePreviewDimensionRespectsLimit" enabled="true" level="WARNING" enabled_by_default="true">
<option name="composableFile" value="true" />
<option name="previewFile" value="true" />
</inspection_tool>
<inspection_tool class="ComposePreviewMustBeTopLevelFunction" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
<option name="previewFile" value="true" />
</inspection_tool>
<inspection_tool class="ComposePreviewNeedsComposableAnnotation" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
<option name="previewFile" value="true" />
</inspection_tool>
<inspection_tool class="ComposePreviewNotSupportedInUnitTestFiles" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
<option name="previewFile" value="true" />
</inspection_tool>
<inspection_tool class="GlancePreviewDimensionRespectsLimit" enabled="true" level="WARNING" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
<inspection_tool class="GlancePreviewMustBeTopLevelFunction" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
<inspection_tool class="GlancePreviewNeedsComposableAnnotation" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
<inspection_tool class="GlancePreviewNotSupportedInUnitTestFiles" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
<inspection_tool class="KotlinUnusedImport" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="LongLine" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="PreviewAnnotationInFunctionWithParameters" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
<option name="previewFile" value="true" />
</inspection_tool>
<inspection_tool class="PreviewApiLevelMustBeValid" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
<option name="previewFile" value="true" />
</inspection_tool>
<inspection_tool class="PreviewDeviceShouldUseNewSpec" enabled="true" level="WEAK WARNING" enabled_by_default="true">
<option name="composableFile" value="true" />
<option name="previewFile" value="true" />
</inspection_tool>
<inspection_tool class="PreviewDimensionRespectsLimit" enabled="true" level="WARNING" enabled_by_default="true">
<option name="composableFile" value="true" />
<option name="previewFile" value="true" />
</inspection_tool>
<inspection_tool class="PreviewFontScaleMustBeGreaterThanZero" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
<option name="previewFile" value="true" />
</inspection_tool>
<inspection_tool class="PreviewMultipleParameterProviders" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
<option name="previewFile" value="true" />
</inspection_tool>
<inspection_tool class="PreviewMustBeTopLevelFunction" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
<option name="previewFile" value="true" />
</inspection_tool>
<inspection_tool class="PreviewNeedsComposableAnnotation" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
<option name="previewFile" value="true" />
</inspection_tool>
<inspection_tool class="PreviewNotSupportedInUnitTestFiles" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
<option name="previewFile" value="true" />
</inspection_tool>
<inspection_tool class="PreviewParameterProviderOnFirstParameter" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
<option name="previewFile" value="true" />
</inspection_tool>
<inspection_tool class="PreviewPickerAnnotation" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
<option name="previewFile" value="true" />
</inspection_tool>
<inspection_tool class="RedundantSemicolon" enabled="true" level="ERROR" enabled_by_default="true" />
</profile>
</component>
-6
View File
@@ -1,6 +0,0 @@
<component name="InspectionProjectProfileManager">
<settings>
<option name="PROJECT_PROFILE" value="ktlint" />
<version value="1.0" />
</settings>
</component>
-63
View File
@@ -1,63 +0,0 @@
kotlin version: 2.3.0
error message: Daemon compilation failed: Connection to the Kotlin daemon has been unexpectedly lost. This might be caused by the daemon being killed by another process or the operating system, or by JVM crash.
org.jetbrains.kotlin.gradle.tasks.DaemonCrashedException: Connection to the Kotlin daemon has been unexpectedly lost. This might be caused by the daemon being killed by another process or the operating system, or by JVM crash.
at org.jetbrains.kotlin.gradle.tasks.TasksUtilsKt.wrapCompilationExceptionIfNeeded(tasksUtils.kt:54)
at org.jetbrains.kotlin.gradle.tasks.TasksUtilsKt.wrapAndRethrowCompilationException(tasksUtils.kt:65)
at org.jetbrains.kotlin.compilerRunner.GradleKotlinCompilerWork.compileWithDaemon(GradleKotlinCompilerWork.kt:227)
at org.jetbrains.kotlin.compilerRunner.GradleKotlinCompilerWork.compileWithDaemonOrFallbackImpl(GradleKotlinCompilerWork.kt:143)
at org.jetbrains.kotlin.compilerRunner.GradleKotlinCompilerWork.run(GradleKotlinCompilerWork.kt:107)
at org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction.execute(GradleCompilerRunnerWithWorkers.kt:75)
at org.gradle.workers.internal.DefaultWorkerServer.execute(DefaultWorkerServer.java:68)
at org.gradle.workers.internal.NoIsolationWorkerFactory$1$1.create(NoIsolationWorkerFactory.java:64)
at org.gradle.workers.internal.NoIsolationWorkerFactory$1$1.create(NoIsolationWorkerFactory.java:61)
at org.gradle.internal.classloader.ClassLoaderUtils.executeInClassloader(ClassLoaderUtils.java:102)
at org.gradle.workers.internal.NoIsolationWorkerFactory$1.lambda$execute$0(NoIsolationWorkerFactory.java:61)
at org.gradle.workers.internal.AbstractWorker$1.call(AbstractWorker.java:44)
at org.gradle.workers.internal.AbstractWorker$1.call(AbstractWorker.java:41)
at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:209)
at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204)
at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:166)
at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
at org.gradle.workers.internal.AbstractWorker.executeWrappedInBuildOperation(AbstractWorker.java:41)
at org.gradle.workers.internal.NoIsolationWorkerFactory$1.execute(NoIsolationWorkerFactory.java:58)
at org.gradle.workers.internal.DefaultWorkerExecutor.lambda$submitWork$0(DefaultWorkerExecutor.java:176)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.runExecution(DefaultConditionalExecutionQueue.java:194)
at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.access$700(DefaultConditionalExecutionQueue.java:127)
at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner$1.run(DefaultConditionalExecutionQueue.java:169)
at org.gradle.internal.Factories$1.create(Factories.java:30)
at org.gradle.internal.work.DefaultWorkerLeaseService.lambda$withLocksAcquired$0(DefaultWorkerLeaseService.java:269)
at org.gradle.internal.work.ResourceLockStatistics$1.measure(ResourceLockStatistics.java:42)
at org.gradle.internal.work.DefaultWorkerLeaseService.withLocksAcquired(DefaultWorkerLeaseService.java:267)
at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:259)
at org.gradle.internal.work.DefaultWorkerLeaseService.runAsWorkerThread(DefaultWorkerLeaseService.java:127)
at org.gradle.internal.work.DefaultWorkerLeaseService.runAsWorkerThread(DefaultWorkerLeaseService.java:132)
at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.runBatch(DefaultConditionalExecutionQueue.java:164)
at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.run(DefaultConditionalExecutionQueue.java:133)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
at org.gradle.internal.concurrent.AbstractManagedExecutor$1.run(AbstractManagedExecutor.java:47)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: java.rmi.UnmarshalException: Error unmarshaling return header; nested exception is:
java.io.EOFException
at java.rmi/sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:255)
at java.rmi/sun.rmi.server.UnicastRef.invoke(UnicastRef.java:166)
at java.rmi/java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:215)
at java.rmi/java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:160)
at jdk.proxy4/jdk.proxy4.$Proxy184.compile(Unknown Source)
at org.jetbrains.kotlin.compilerRunner.GradleKotlinCompilerWork.incrementalCompilationWithDaemon(GradleKotlinCompilerWork.kt:312)
at org.jetbrains.kotlin.compilerRunner.GradleKotlinCompilerWork.compileWithDaemon(GradleKotlinCompilerWork.kt:219)
... 40 more
Caused by: java.io.EOFException
at java.base/java.io.DataInputStream.readUnsignedByte(DataInputStream.java:297)
at java.base/java.io.DataInputStream.readByte(DataInputStream.java:275)
at java.rmi/sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:241)
... 46 more
+1 -2
View File
@@ -1,6 +1,5 @@
version: 2
# SPDX-FileCopyrightText: 2017-2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
# General settings to apply
always_pending:
title_regex: '(WIP|wip)'
+5 -6
View File
@@ -1,10 +1,9 @@
[main]
host = https://www.transifex.com
[o:nextcloud:p:nextcloud:r:android]
file_filter = app/src/main/res/values-<lang>/strings.xml
source_file = app/src/main/res/values/strings.xml
[nextcloud.android]
file_filter = src/main/res/values-<lang>/strings.xml
source_file = src/main/res/values/strings.xml
type = ANDROID
source_lang = en
type = ANDROID
lang_map = en_SG: en-rSG, es_PA: es-rPA, mr_IN: mr-rIN, cs_CZ: cs-rCZ, vi_VN: vi-rVN, fr_MC: fr-rMC, it_CH: it-rCH, ta_LK: ta-rLK, kk_KZ: kk-rKZ, mn_CN: mn-rCN, mt_MT: mt-rMT, sma_SE: sma-rSE, si_LK: si-rLK, pl_PL: pl-rPL, de_AT: de-rAT, ii_CN: ii-rCN, hi_IN: hi-rIN, ar_BH: ar-rBH, ar_JO: ar-rJO, es_NI: es-rNI, quz_BO: quz-rBO, sr_CS: sr-rCS, es_CO: es-rCO, es_GT: es-rGT, ml_IN: ml-rIN, rm_CH: rm-rCH, zh_CN.GB2312: zh-rBG, hr_BA: hr-rBA, se_FI: se-rFI, tn_ZA: tn-rZA, tzm_DZ: tzm-rDZ, en_ZA: en-rZA, es_419: b+es+419, en_IN: en-rIN, my_MM: my, se_NO: se-rNO, am_ET: am-rET, arn_CL: arn-rCL, en_MY: en-rMY, es_HN: es-rHN, es_UY: es-rUY, en_AU: en-rAU, id: in, ku_IQ: ku-rIQ, pt_BR: pt-rBR, xh_ZA: xh-rZA, co_FR: co-rFR, en_BZ: en-rBZ, ha_NG: ha-rNG, or_IN: or-rIN, dsb_DE: dsb-rDE, fo_FO: fo-rFO, fr_CA: fr-rCA, ky_KG: ky-rKG, ar_LB: ar-rLB, es_AR: es-rAR, is_IS: is-rIS, ar_KW: ar-rKW, en_GB: b+en+001, fy_NL: fy-rNL, ar_QA: ar-rQA, hy_AM: hy-rAM, mn_MN: mn-rMN, nl_BE: nl-rBE, ar_OM: ar-rOM, as_IN: as-rIN, cy_GB: cy-rGB, he: iw, it_IT: it-rIT, nso_ZA: nso-rZA, ba_RU: ba-rRU, wo_SN: wo-rSN, lb_LU: lb-rLU, quz_EC: quz-rEC, uz_UZ: uz-rUZ, zh_TW: zh-rTW, ar_MA: ar-rMA, es_CL: es-rCL, es_VE: es-rVE, da_DK: da-rDK, et_EE: et-rEE, af_ZA: af-rZA, en@pirate: en-rpirate, ga_IE: ga-rIE, kok_IN: kok-rIN, ur_PK: ur-rPK, tg_TJ: tg-rTJ, ne_NP: ne-rNP, es_CR: es-rCR, fil_PH: fil-rPH, fr_CH: fr-rCH, gl_ES: gl-rES, se_SE: se-rSE, sr_BA: sr-rBA, es_DO: es-rDO, ms_MY: ms-rMY, oc_FR: oc-rFR, syr_SY: syr-rSY, ug_CN: ug-rCN, en_CA: en-rCA, en_JM: en-rJM, ko_KR: ko-rKR, be_BY: be-rBY, zh_HK: zh-rHK, nb_NO: nb-rNO, fi_FI: fi-rFI, fr_FR: fr-rFR, ar_SA: ar-rSA, az_AZ: az-rAZ, he_IL: he-rIL, zh_CN: zh-rCN, bn_BD: bn-rBD, el_GR: el-rGR, en_PH: en-rPH, sr@latin: sr-rSP, br_FR: br-rFR, ta_IN: ta-rIN, hu_HU: hu-rHU, lt_LT: lt-rLT, ar_AE: ar-rAE, en_ZW: en-rZW, ar_TN: ar-rTN, ka_GE: ka-rGE, en_TT: en-rTT, mi_NZ: mi-rNZ, zu_ZA: zu-rZA, fa_IR: fa-rIR, fr_LU: fr-rLU, lo_LA: lo-rLA, ms_BN: ms-rBN, rw_RW: rw-rRW, sl_SI: sl-rSI, tt_RU: tt-rRU, de_LI: de-rLI, es_EC: es-rEC, ps_AF: ps-rAF, id_ID: id-rID, smn_FI: smn-rFI, bg_BG: bg-rBG, lv_LV: lv-rLV, te_IN: te-rIN, iu_CA: iu-rCA, sms_FI: sms-rFI, es_PE: es-rPE, gd_GB: gd-rGB, hr_HR: hr-rHR, moh_CA: moh-rCA, smj_SE: smj-rSE, ar_LY: ar-rLY, de_LU: de-rLU, es_BO: es-rBO, sq_AL: sq-rAL, ar_SY: ar-rSY, tr_TR: tr-rTR, sr_RS: sr-rRS, sv_SE: sv-rSE, kl_GL: kl-rGL, quz_PE: quz-rPE, de_DE: de-rDE, sv_FI: sv-rFI, tk_TM: tk-rTM, bo_CN: bo-rCN, gsw_FR: gsw-rFR, pt_PT: pt-rPT, dv_MV: dv-rMV, uk_UA: uk-rUA, ar_YE: ar-rYE, zh_SG: zh-rSG, sw_KE: sw-rKE, en_IE: en-rIE, en_US: en-rUS, es_SV: es-rSV, qut_GT: qut-rGT, th_TH: th-rTH, ar_DZ: ar-rDZ, gu_IN: gu-rIN, kn_IN: kn-rIN, mk_MK: mk-rMK, es_MX: es-rMX, ig_NG: ig-rNG, smj_NO: smj-rNO, bn_IN: bn-rIN, de_CH: de-rCH, sk_SK: sk-rSK, es_PR: es-rPR, yo_NG: yo-rNG, sma_NO: sma-rNO, sa_IN: sa-rIN, en_NZ: en-rNZ, ja_JP: ja-rJP, pa_IN: pa-rIN, es_PY: es-rPY, nn_NO: nn-rNO, ar_EG: ar-rEG, bs_BA: bs-rBA, eu_ES: eu-rES, fr_BE: fr-rBE, km_KH: km-rKH, ru_RU: ru-rRU, sah_RU: sah-rRU, ca_ES: ca-rES, sr_ME: sr-rME, ro_RO: ro-rRO, prs_AF: prs-rAF, zh_MO: zh-rMO, es_ES: es-rES, hsb_DE: hsb-rDE, nl_NL: nl-rNL, ar_IQ: ar-rIQ
lang_map = af_ZA: af-rZA, am_ET: am-rET, ar_AE: ar-rAE, ar_BH: ar-rBH, ar_DZ: ar-rDZ, ar_EG: ar-rEG, ar_IQ: ar-rIQ, ar_JO: ar-rJO, ar_KW: ar-rKW, ar_LB: ar-rLB, ar_LY: ar-rLY, ar_MA: ar-rMA, ar_OM: ar-rOM, ar_QA: ar-rQA, ar_SA: ar-rSA, ar_SY: ar-rSY, ar_TN: ar-rTN, ar_YE: ar-rYE, arn_CL: arn-rCL, as_IN: as-rIN, az_AZ: az-rAZ, ba_RU: ba-rRU, be_BY: be-rBY, bg_BG: bg-rBG, bn_BD: bn-rBD, bn_IN: bn-rIN, bo_CN: bo-rCN, br_FR: br-rFR, bs_BA: bs-rBA, ca_ES: ca-rES, co_FR: co-rFR, cs_CZ: cs-rCZ, cy_GB: cy-rGB, da_DK: da-rDK, de_AT: de-rAT, de_CH: de-rCH, de_DE: de-rDE, de_LI: de-rLI, de_LU: de-rLU, dsb_DE: dsb-rDE, dv_MV: dv-rMV, el_GR: el-rGR, en_AU: en-rAU, en_BZ: en-rBZ, en_CA: en-rCA, en_GB: b+en+001, en_IE: en-rIE, en_IN: en-rIN, en_JM: en-rJM, en_MY: en-rMY, en_NZ: en-rNZ, en_PH: en-rPH, en_SG: en-rSG, en_TT: en-rTT, en_US: en-rUS, en_ZA: en-rZA, en_ZW: en-rZW, en@pirate: en-rpirate, es_AR: es-rAR, es_BO: es-rBO, es_CL: es-rCL, es_CO: es-rCO, es_CR: es-rCR, es_DO: es-rDO, es_EC: es-rEC, es_ES: es-rES, es_GT: es-rGT, es_HN: es-rHN, es_MX: es-rMX, es_NI: es-rNI, es_PA: es-rPA, es_PE: es-rPE, es_PR: es-rPR, es_PY: es-rPY, es_SV: es-rSV, es_419: b+es+419, es_UY: es-rUY, es_VE: es-rVE, et_EE: et-rEE, eu_ES: eu-rES, fa_IR: fa-rIR, fi_FI: fi-rFI, fil_PH: fil-rPH, fo_FO: fo-rFO, fr_BE: fr-rBE, fr_CA: fr-rCA, fr_CH: fr-rCH, fr_FR: fr-rFR, fr_LU: fr-rLU, fr_MC: fr-rMC, fy_NL: fy-rNL, ga_IE: ga-rIE, gd_GB: gd-rGB, gl_ES: gl-rES, gsw_FR: gsw-rFR, gu_IN: gu-rIN, ha_NG: ha-rNG, he: iw, he_IL: he-rIL, hi_IN: hi-rIN, hr_BA: hr-rBA, hr_HR: hr-rHR, hsb_DE: hsb-rDE, hu_HU: hu-rHU, hy_AM: hy-rAM, id: in, id_ID: id-rID, ig_NG: ig-rNG, ii_CN: ii-rCN, is_IS: is-rIS, it_CH: it-rCH, it_IT: it-rIT, iu_CA: iu-rCA, ja_JP: ja-rJP, ka_GE: ka-rGE, kk_KZ: kk-rKZ, kl_GL: kl-rGL, km_KH: km-rKH, kn_IN: kn-rIN, ko_KR: ko-rKR, kok_IN: kok-rIN, ku_IQ: ku-rIQ, ky_KG: ky-rKG, lb_LU: lb-rLU, lo_LA: lo-rLA, lt_LT: lt-rLT, lv_LV: lv-rLV, mi_NZ: mi-rNZ, mk_MK: mk-rMK, ml_IN: ml-rIN, mn_CN: mn-rCN, mn_MN: mn-rMN, moh_CA: moh-rCA, mr_IN: mr-rIN, ms_BN: ms-rBN, ms_MY: ms-rMY, my_MM: my, mt_MT: mt-rMT, nb_NO: nb-rNO, ne_NP: ne-rNP, nl_BE: nl-rBE, nl_NL: nl-rNL, nn_NO: nn-rNO, nso_ZA: nso-rZA, oc_FR: oc-rFR, or_IN: or-rIN, pa_IN: pa-rIN, pl_PL: pl-rPL, prs_AF: prs-rAF, ps_AF: ps-rAF, pt_BR: pt-rBR, pt_PT: pt-rPT, qut_GT: qut-rGT, quz_BO: quz-rBO, quz_EC: quz-rEC, quz_PE: quz-rPE, rm_CH: rm-rCH, ro_RO: ro-rRO, ru_RU: ru-rRU, rw_RW: rw-rRW, sa_IN: sa-rIN, sah_RU: sah-rRU, se_FI: se-rFI, se_NO: se-rNO, se_SE: se-rSE, si_LK: si-rLK, sk_SK: sk-rSK, sl_SI: sl-rSI, sma_NO: sma-rNO, sma_SE: sma-rSE, smj_NO: smj-rNO, smj_SE: smj-rSE, smn_FI: smn-rFI, sms_FI: sms-rFI, sq_AL: sq-rAL, sr_BA: sr-rBA, sr_CS: sr-rCS, sr_ME: sr-rME, sr_RS: sr-rRS, sr@latin: sr-rSP, sv_FI: sv-rFI, sv_SE: sv-rSE, sw_KE: sw-rKE, syr_SY: syr-rSY, ta_IN: ta-rIN, ta_LK: ta-rLK, te_IN: te-rIN, tg_TJ: tg-rTJ, th_TH: th-rTH, tk_TM: tk-rTM, tn_ZA: tn-rZA, tr_TR: tr-rTR, tt_RU: tt-rRU, tzm_DZ: tzm-rDZ, ug_CN: ug-rCN, uk_UA: uk-rUA, ur_PK: ur-rPK, uz_UZ: uz-rUZ, vi_VN: vi-rVN, wo_SN: wo-rSN, xh_ZA: xh-rZA, yo_NG: yo-rNG, zh_CN: zh-rCN, zh_CN.GB2312:zh-rBG, zh_HK: zh-rHK, zh_MO: zh-rMO, zh_SG: zh-rSG, zh_TW: zh-rTW, zu_ZA: zu-rZA
-3
View File
@@ -1,3 +0,0 @@
SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
SPDX-FileCopyrightText: 2012 Bartosz Przybylski <[email protected]>
SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
-236
View File
@@ -1,236 +0,0 @@
<!--
- SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
- SPDX-License-Identifier: AGPL-3.0-or-later
-->
# Agents.md
This file provides guidance to all AI agents (Claude, Codex, Gemini, etc.) working with code in this repository.
You are an experienced engineer specialized on Java, Kotlin and familiar with the platform-specific details of Android.
## Your Role
- You implement features and fix bugs.
- Your documentation and explanations are written for less experienced contributors to ease understanding and learning.
- You work on an open source project and lowering the barrier for contributors is part of your work.
## Project Overview
The Nextcloud Android Client is a application to synchronize files from Nextcloud Server with your Android device.
Java, Kotlin, XML, Jetpack Compose are the key technologies used for building the app.
## Project Structure: AI Agent Handling Guidelines
- `./app/src/main/java/com/owncloud/android/` Legacy components (Activities, datamodel, operations)
- `./app/src/main/java/com/nextcloud/` Modern components (client APIs, DI, repositories, UI with Compose)
- `./app/src/main/java/com/nextcloud/utils/extensions/` Extension functions for common types
- `./app/src/main/java/com/nextcloud/ui/` Jetpack Compose UI components and screens
- `./app/src/main/java/com/nextcloud/client/di/` Dependency injection configuration (Dagger 2)
- `./app/src/main/java/com/nextcloud/client/assistant/` AI features (Assistant screen, chat, conversations, translations)
- `./app/src/test/` Unit tests (small, isolated tests without Android SDK)
- `./app/src/androidTest/` Instrumented tests (require Android SDK)
- `./app/src/main/res/values/` Translations. Only update `./app/src/main/res/values/strings.xml`. Do not modify any other translation files or folders. Ignore all `values-*` directories (e.g., `values-es`, `values-fr`).
- `./.claude/skills/` Reusable agent skills. Each subdirectory is one skill with a `SKILL.md` entry point plus `references/` and `assets/`.
## Agent Skills
Project-specific skills live in `./.claude/skills/<skill-name>/`. Load a skill when the task matches its trigger.
- **`android-java-to-kotlin`** (`./.claude/skills/android-java-to-kotlin/SKILL.md`) — Completes a Java-to-Kotlin conversion in this Android app. Use it when finishing a conversion, when the user mentions "java to kotlin", "j2k", "convert java", or "make it idiomatic", or when a freshly IDE-converted `.kt` file needs cleanup. The workflow is two-person: the developer first runs the Android Studio converter (`Code > Convert Java File to Kotlin File`), then the agent drives the idiomatic second pass — fail-fast control flow, function decomposition, `lifecycleScope`/coroutines instead of Java threads, modern Android APIs, and project conventions (SPDX headers, no magic numbers, `@JvmStatic`). The conversion must preserve behaviour, and the agent must write a behaviour-locking test before declaring it done.
- **`android-activity-to-navigator-fragment`** (`./.claude/skills/android-activity-to-navigator-fragment/SKILL.md`) — Converts a standalone Activity (typically a drawer destination) into a Fragment hosted by `NavigatorActivity`. Use it when the user mentions "navigator", `NavigatorActivity`, `NavigatorScreen`, or "convert activity to fragment". It covers registering the `NavigatorScreen`, the fragment and its layout, decoupling collaborators from `FileActivity`, rewiring every entry point with `NavigatorActivity.intent(...)`, DI and manifest cleanup, and migrating the screenshot test.
- **`android-eventbus-to-workmanager-flow`** (`./.claude/skills/android-eventbus-to-workmanager-flow/SKILL.md`) — Replaces an EventBus event posted by a WorkManager worker with WorkManager observation through a ViewModel `Flow`. Use it when the user mentions "event bus", `EventBusFactory`, `@Subscribe`, "worker progress", or "observe worker". It covers publishing with `setProgress`, a ViewModel keyed by the unique work name, `ViewModelModule` registration, collecting from Kotlin or Java (`collectWhenStarted`) and deleting the event. The live example is `FileDetailFragmentViewModel`.
### Android Skills
Agent skills for Android development at https://github.com/android/skills (overview: https://developer.android.com/tools/agents/android-skills). Use them when a task matches their trigger and no project-specific skill above covers it. Install one with the Android CLI (`android skills add <skill-name>`) or read its `SKILL.md` directly from the repository. Project-specific skills and the rules in this file take precedence over the official skills.
- **`r8-analyzer`** (https://github.com/android/skills/tree/main/performance/r8-analyzer) — Analyzes the R8 configuration and keep rules for redundant, overly broad, or library-subsumed rules. Use it when changing the keep rules in `app/src/main/keepRules/` or the `optimization {}` blocks in `app/build.gradle.kts`.
## General Guidance
Every new file needs to get a SPDX header in the first rows according to this template.
The year in the first line must be replaced with the year when the file is created (for example, 2026 for files first added in 2026).
The commenting signs need to be used depending on the file type.
New contributions use AGPL-3.0-or-later license. Files may also have `OR GPL-2.0-only` in the license if they originated from GPL-licensed code.
```plaintext
SPDX-FileCopyrightText: <YEAR> Nextcloud GmbH and Nextcloud contributors
SPDX-License-Identifier: AGPL-3.0-or-later
```
Kotlin/Java:
```kotlin
/*
* Nextcloud - Android Client
*
* SPDX-FileCopyrightText: <year> Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
```
XML:
```xml
<!--
~ Nextcloud - Android Client
~
~ SPDX-FileCopyrightText: <year> Nextcloud GmbH and Nextcloud contributors
~ SPDX-License-Identifier: AGPL-3.0-or-later
-->
```
Avoid creating source files that implement multiple types; instead, place each type in its own dedicated source file.
## Design
- Follow Material Design 3 guidelines
- In addition to any Material Design wording guidelines, follow the Nextcloud wording guidelines at https://docs.nextcloud.com/server/latest/developer_manual/design/foundations.html#wording
- Ensure the app works in both light and dark theme
- Ensure the app works with different server primary colors by using the colorTheme of viewThemeUtils
## Architecture & Patterns
### Jetpack Compose
Modern UI is built with Jetpack Compose (Material 3). Key directories:
- `com.nextcloud.ui.composeActivity` - Activities hosting Compose content
- `com.nextcloud.ui.composeComponents` - Reusable Compose components
- `com.nextcloud.client.assistant` - Compose-based Assistant screens and features
Use `StateFlow` and `MutableStateFlow` in ViewModels for state management. Collect state in Compose functions with `collectAsState()`.
### Dependency Injection
Uses Dagger 2 for major Android components (`Activity`, `Fragment`, `Service`, `BroadcastReceiver`, `ContentProvider`). Manual constructor injection for other components.
### Network Clients
Get `OwnCloudClient` and `NextcloudClient` instances from `ClientRepository` (`com.nextcloud.repository`), never from `ClientFactory`.
`ClientFactory` is deprecated and being phased out; do not add new usages of it, and replace it with `ClientRepository` when touching code that still uses it.
- Inject `ClientRepository` with Dagger (`@Inject lateinit var clientRepository: ClientRepository`); it is bound to `RemoteClientRepository`, which resolves the current user via `UserAccountManager` on every call.
- Activities extending `BaseActivity` already expose it via `getClientRepository()`.
- Prefer the `suspend` functions `getOwncloudClient()` / `getNextcloudClient()` from a lifecycle-aware scope (`lifecycleScope`, `viewModelScope`); they switch to `Dispatchers.IO` and return `null` on failure, so handle `null` instead of catching exceptions.
- Do not construct `RemoteClientRepository` manually.
### Extension Functions
The `com.nextcloud.utils.extensions` package contains helper extensions organized by type (e.g., `FileExtensions.kt`, `StringExtensions.kt`, `ViewExtensions.kt`). Create focused extension files rather than putting multiple types in one file.
## Testing
### Unit Tests (`./app/src/test/`)
- Small, isolated tests without Android SDK
- Use Mockito with `mockito-kotlin` for easier mocking
- Recommended command: `./gradlew jacocoTestGplayDebugUnitTest`
- Tests use JUnit 4 with `@Test`, `@Before`, `@After` annotations
### Instrumented Tests (`./app/src/androidTest/`)
- Tests requiring Android SDK (Activities, Fragments, database access)
- Use Espresso for UI testing
- Tests should inherit from `AbstractOnServerIT` if they need server communication
- Always create a separate test user on test server to avoid data interference
- Run with: `./gradlew createGplayDebugCoverageReport -Pcoverage=true`
- Run specific test class: `./gradlew createGplayDebugCoverageReport -Pcoverage=true -Pandroid.testInstrumentationRunnerArguments.class=<fully.qualified.ClassName>`
- Run one test method: `./gradlew createGplayDebugCoverageReport -Pcoverage=true -Pandroid.testInstrumentationRunnerArguments.class=<fully.qualified.ClassName>#methodName`
### Screenshot Tests (Shot)
- Enabled via `SHOT_TEST=true` environment variable
- Use: `scripts/androidScreenshotTest` to check, `scripts/updateScreenshots.sh` to regenerate
- CI renders shadows differently; 0.5% tolerance is configured
## Code Quality Tools
All code is validated with the following tools. Fix findings in modified files:
- **lint** - Android linting (configured in `app/lint.xml`)
- **spotbugsGplayDebug** - Bug detection for Gplay variant
- **detekt** - Kotlin code analysis (configured in `app/detekt.yml`)
- **spotlessKotlinCheck** - Code formatting with ktlint
Run all checks with: `./gradlew check`
## Nextcloud Contribution Policy
All contributions generated or assisted by this agent must fully comply with:
- **[AI Contribution Policy](https://github.com/nextcloud/.github/blob/master/AI_POLICY.md)** - the primary reference for AI-specific rules, covering disclosure, author accountability, communication, security, licensing, code quality, and autonomous agent behavior.
- **[Contribution Guidelines](https://github.com/nextcloud/.github/blob/master/CONTRIBUTING.md)** - covering testing requirements, the Developer Certificate of Origin (DCO), license headers, conventional commits, and translations. These apply in full to all contributions regardless of how they were produced.
### What this agent must always do
- Add an `Assisted-by: AGENT_NAME:MODEL_VERSION` git trailer to every commit containing AI-assisted content.
- Ensure every pull request includes a disclosure of AI tool use in the PR description.
- Produce focused, scoped pull requests that address exactly one concern. Do not touch unrelated files or introduce incidental refactors.
- Verify all dependencies against actual package registries before suggesting them. Do not use hallucinated or unverified package names.
- Explicitly inform the contributor when any action they are about to take, or have taken, would violate the AI Contribution Policy or the Contribution Guidelines. Do not silently proceed. State which rule is at risk and what the contributor should do instead.
- Warn the contributor if a pull request is growing too large. A PR approaching several thousand lines of changed code is a signal that it should be split into smaller, focused PRs. Suggest a logical split before the PR is opened, not after.
- Recommend opening a ticket for discussion before starting implementation whenever a feature or change is sufficiently complex - for example when it touches multiple subsystems, requires architectural decisions, or the right approach is not yet clear. A ticket allows maintainers and the contributor to align on direction before code is written, avoiding wasted effort on a PR that may be rejected or require fundamental rework.
### What this agent must never do
- Open issues, submit pull requests, post review comments, or send security reports autonomously. Every contribution must be reviewed and submitted by a human.
- Add `Signed-off-by` tags to commits. Only the human contributor can certify the Developer Certificate of Origin.
- Generate or submit security reports without independent human verification. Report verified vulnerabilities via [HackerOne](https://hackerone.com/nextcloud), not as GitHub issues.
- Write PR descriptions, review comments, or issue reports on behalf of the contributor. These must be in the contributor's own words.
- Fully automate the resolution of issues labeled [`good first issue`](https://github.com/issues?q=org%3Anextcloud+label%3A%22good+first+issue%22) or similar beginner-friendly labels.
- Submit code that has not been reviewed and cleaned up by the contributor. Dead code, redundant logic, excessive comments, and unrelated changes must be removed before submission.
## Commit and Pull Request Guidelines
### Commits
- All commits must be signed off (`git commit -s`) per the Developer Certificate of Origin (DCO). All PRs target `master`. Backports use `/backport to stable-X.Y` in a PR comment.
- Commit messages must follow the [Conventional Commits v1.0.0 specification](https://www.conventionalcommits.org/en/v1.0.0/#specification) — e.g. `feat(chat): add voice message playback`, `fix(call): handle MCU disconnect gracefully`.
- Every commit made with AI assistance must include an `Assisted-by: AGENT_NAME:MODEL_VERSION` git trailer identifying the coding agent and model used:
```
Assisted-by: ClaudeCode:claude-sonnet-4-6
Assisted-by: Copilot:claude-sonnet-4-6
```
General pattern: `Assisted-by: <coding-agent>:<model-version>`
### Pull Requests
- Include a short summary of what changed. *Example:* `fix: prevent crash on empty todo title`.
- **Pull Request**: When the agent creates a PR, it should include a description summarizing the changes and why they were made. If a GitHub issue exists, reference it (e.g., “Closes #123”).
## Code Style
- Do not exceed 300 lines of code per file.
- Line length: **120 characters**
- Standard Android Studio formatter with EditorConfig.
- Kotlin preferred for new code; legacy Java still present.
- Every new file must end with exactly one empty trailing line (no more, no less).
- Create models, states in different files instead of doing it one single file.
- Do not use magic numbers.
- Apply fail fast principle instead of using nested if-else statements.
- Do not use multiple boolean flags to determine states instead use enums or sealed classes.
- Use modern Java for Java classes. Optionals, virtual threads, records, streams if necessary.
- Avoid hardcoded strings, colors, dimensions. Use resources.
- Run lint, spotbugsGplayDebug, detekt, spotlessKotlinCheck and fix findings inside the files that have been changed.
## Comments
Names carry the explanation, not comments. A function or variable whose purpose is not obvious from its
name is a naming problem or a decomposition problem — rename it or split it, do not describe it in a comment.
Assume the reader knows Kotlin, Java and the Android framework.
Write a comment only when the code cannot carry the information itself: a non-obvious invariant, a workaround
for a platform or server bug, an ordering requirement, or a decision whose alternatives look equally valid and
are not. When you do write one, explain **why**, never **what**.
Never write:
- Comments that restate the code (`// increase the counter` above `counter++`).
- KDoc/Javadoc added to a function just because the function is new.
- Narration of the change or its history: "changed from X to Y", "previously this failed", "this is not a
permanent failure so we now retry", "fixes the crash reported in the issue". Comments describe the code as
it is today. A reader six months from now has no access to the issue, the PR discussion, or the conversation
that produced the change — that context belongs in the commit message and the PR description.
- Decorative section-divider comments of any kind (e.g. `// ── Title ───`, `// ------`, `// ======`).
`// region` / `// endregion` for IDE folding is allowed where the file already uses it.
Existing comments that are still accurate stay. Delete the ones the change makes wrong or obsolete.
-492
View File
@@ -1,495 +1,3 @@
## 3.33.0 (September 10, 2025)
- Migrate to Glide 4
- Performance improvements
- Fix gallery image scaling
- Bugfixes
Minimum: NC 18 Server, Android 8.1 Nougat
For a full list, please see https://github.com/nextcloud/android/milestone/112
## 3.32.3 (August 21, 2025)
- Bugfixes
Minimum: NC 18 Server, Android 8.0 Nougat
For a full list, please see https://github.com/nextcloud/android/milestone/114
## 3.32.2 (July 18, 2025)
- Resolved image blurriness issue.
- Fixed crash occurring in the conflict resolution dialog.
- Addressed crash in the upload finish receiver event handler.
Minimum: NC 18 Server, Android 8.0 Nougat
For a full list, please see https://github.com/nextcloud/android/milestone/115
## 3.32.1 (July 14, 2025)
- Bug fixes.
Minimum: NC 18 Server, Android 8.0 Nougat
For a full list, please see https://github.com/nextcloud/android/milestone/113
## 3.32.0 (July 2, 2025)
- Minimum supported Android version is 8.0.
- Scrolling performance has been increased in the media tab.
- Multi-select feature added to the media tab.
- Custom share permissions have been added.
- Bug fixes.
Minimum: NC 18 Server, Android 8.0 Nougat
For a full list, please see https://github.com/nextcloud/android/milestone/107
## 3.31.4 (June 3, 2025)
- Add missing auto migration
Minimum: NC 18 Server, Android 7.1 Nougat
For a full list, please see https://github.com/nextcloud/android/milestone/110
## 3.31.3 (May 28, 2025)
- fix simple sign up
- bugfixes
- update translations
Minimum: NC 18 Server, Android 7.1 Nougat
For a full list, please see https://github.com/nextcloud/android/milestone/110
## 3.31.2 (May 20, 2025)
- bring back MANAGE_EXTERNAL_STORAGE permission
Minimum: NC 18 Server, Android 7.1 Nougat
For a full list, please see https://github.com/nextcloud/android/milestone/108
## 3.31.1 (April 3, 2025)
- Various bug fixes and performance enhancements
Minimum: NC 18 Server, Android 7.1 Nougat
For a full list, please see https://github.com/nextcloud/android/milestone/108
## 3.31.0 (February 25, 2025)
- New share layout
- Various bug fixes and performance enhancements
Minimum: NC 18 Server, Android 7.1 Nougat
For a full list, please see https://github.com/nextcloud/android/milestone/100
## 3.30.7 (January 6, 2025)
- Fix crash of auto upload settings
Minimum: NC 16 Server, Android 7.0 Nougat
For a full list, please see https://github.com/nextcloud/android/milestone/104
## 3.30.3 (October 22, 2024)
- Bugfix for two way sync: sync only on wifi
## 3.30.2 (October 21, 2024)
- Bugfix for two way sync. Please check listed folders in settings -> internal two way sync
Minimum: NC 16 Server, Android 7.0 Nougat
For a full list, please see https://github.com/nextcloud/android/milestone/99
## 3.30.1 (October 11, 2024)
- Bugfixes
Minimum: NC 16 Server, Android 7.0 Nougat
For a full list, please see https://github.com/nextcloud/android/milestone/99
## 3.29.1 (June 27, 2024)
- Bugfixes
Minimum: NC 16 Server, Android 7.0 Nougat
For a full list, please see https://github.com/nextcloud/android/milestone/93
<!--
~ SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
~ SPDX-FileCopyrightText: 2016-2024 Tobias Kaminsky <[email protected]>
~ SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
-->
## 3.29.0 (April 24, 2024)
- NC Assistant
- Client certificates
- Personal files view
- REUSE compliance
- Bugfixes
Minimum: NC 16 Server, Android 7.0 Nougat
For a full list, please see https://github.com/nextcloud/android/milestone/89
## 3.28.2 (April 4th, 2024)
- Bugfixes
Minimum: NC 16 Server, Android 7.0 Nougat
For a full list, please see https://github.com/nextcloud/android/milestone/90
## 3.28.1 (March 25th, 2024)
- Bugfixes
Minimum: NC 16 Server, Android 7.0 Nougat
For a full list, please see https://github.com/nextcloud/android/milestone/90
## 3.28.0 (February 13th, 2024)
- E2E sharing
- Bugfixes
Minimum: NC 16 Server, Android 7.0 Nougat
For a full list, please see https://github.com/nextcloud/android/milestone/88
## 3.26.0 (September 16, 2023)
- image editing
- image details, with map
- show other Nextcloud apps
Minimum: NC 16 Server, Android 6.0 Marshmallow
For a full list, please see https://github.com/nextcloud/android/milestone/84
## 3.25.0 (June 13, 2023)
- show Groupfolder
- Tag in file listing
Minimum: NC 16 Server, Android 6.0 Marshmallow
For a full list, please see https://github.com/nextcloud/android/milestone/81
## 3.24.1 (February 21, 2023)
- Fix crash in previous version when connecting to old server versions
Minimum: NC 16 Server, Android 6.0 Marshmallow
For a full list, please see https://github.com/nextcloud/android/milestone/80
## 3.24.0 (February 13, 2023)
- Several performance optimizations by @starypatyk
- Support multi-page document scanning and exporting to PDF
- Many small bugfixes and improvements
Minimum: NC 16 Server, Android 6.0 Marshmallow
For a full list, please see https://github.com/nextcloud/android/milestone/78
## 3.23.1 (December 21, 2022)
- Bug fixes
Minimum: NC 16 Server, Android 6.0 Marshmallow
For a full list, please see https://github.com/nextcloud/android/milestone/79
## 3.23.0 (December 1, 2022)
- File actions menu redesign
- Allow adding shortcuts to Home screen (@newhinton)
- Many bugfixes and performance optimizations
Minimum: NC 16 Server, Android 6.0 Marshmallow
For a full list, please see https://github.com/nextcloud/android/milestone/74
## 3.22.3 (November 3, 2022)
- Bug fixes
Minimum: NC 16 Server, Android 6.0 Marshmallow
For a full list, please see https://github.com/nextcloud/android/milestone/76
## 3.22.2 (October 24, 2022)
- Bug fixes
Minimum: NC 16 Server, Android 6.0 Marshmallow
For a full list, please see https://github.com/nextcloud/android/milestone/75
## 3.22.1 (October 20, 2022)
- Bug fixes
Minimum: NC 16 Server, Android 6.0 Marshmallow
For a full list, please see https://github.com/nextcloud/android/milestone/73
## 3.22.0 (October 19, 2022)
- Material 3 UI revamp
- Dashboard widgets for Android launcher
- New tiled design for media view
- Many bugfixes and improvements
Minimum: NC 16 Server, Android 6.0 Marshmallow
For a full list, please see https://github.com/nextcloud/android/milestone/70
## 3.21.2 (September 1, 2022)
- Bug fixes
Minimum: NC 16 Server, Android 6.0 Marshmallow
## 3.21.1 (August 26, 2022)
- Bug fixes
Minimum: NC 16 Server, Android 6.0 Marshmallow
For a full list, please see https://github.com/nextcloud/android/milestone/72
## 3.21.0 (August 8, 2022)
- Fast scroll for all lists
- Media view
- Group photos as timeline by month
- Filter options
- File locking
- File export to sdcard
- Many bugfixes and improvements
Minimum: NC 16 Server, Android 6.0 Marshmallow
For a full list, please see https://github.com/nextcloud/android/milestone/66
## 3.20.3 (June 13th, 2022)
- Minor bug fixes
Minimum: NC 16 Server, Android 6.0 Marshmallow
For a full list, please see https://github.com/nextcloud/android/milestone/69
## 3.20.2 (June 9th, 2022)
- Several minor bugfixes
Minimum: NC 16 Server, Android 6.0 Marshmallow
For a full list, please see https://github.com/nextcloud/android/milestone/68
## 3.20.1 (May 6th, 2022)
- Several minor bugfixes
Minimum: NC 16 Server, Android 6.0 Marshmallow
For a full list, please see https://github.com/nextcloud/android/milestone/67
## 3.20.0 (May 3rd, 2022)
- Built-in PDF viewer
- Built-in document scanner
- Better choices for storage permissions
- File locking support
- Better UI for media gallery
- Many bugfixes and improvements
Minimum: NC 16 Server, Android 6.0 Marshmallow
For a full list, please see https://github.com/nextcloud/android/milestone/64
## 3.19.1 (March 10, 2022)
- Minor fixes and improvements
Minimum: NC 16 Server, Android 6.0 Marshmallow
For a full list, please see https://github.com/nextcloud/android/milestone/65
## 3.19.0 (February 3, 2022)
- Support external storage in Media page
- Connection fallback to IPv4 when IPv6 fails
- Many other fixes and improvements
Minimum: NC 16 Server, Android 6.0 Marshmallow
For a full list, please see https://github.com/nextcloud/android/milestone/62
## 3.18.1 (December 22, 2021)
- Fix connection bug for usernames with spaces
- Fix some crashes in search and share views
- Fix login for server URLs in IP:port format
- Lots of minor bug fixes
Minimum: NC 16 Server, Android 6.0 Marshmallow
For a full list, please see https://github.com/nextcloud/android/milestone/63
## 3.18.0 (November 18, 2021)
- Calendar backup/restore
- Unified search
- Sharing permissions improvements
- Minor bug fixes
Minimum: NC 16 Server, Android 6.0 Marshmallow
For a full list, please see https://github.com/nextcloud/android/milestone/61
## 3.17.1 (October, 20, 2021)
- fix FIDO crash
- fix crash in documents provider while offline
- updated translations
Minimum: NC 16 Server, Android 5.1 Lollipop
For a full list, please see https://github.com/nextcloud/android/milestone/60
## 3.17.0 (August, 19, 2021)
- UI improvements (Avatar, password dialog)
- New video player for better streaming
- Many bug fixes
- Drop Android 5.0, new min version Android 5.1
Minimum: NC 16 Server, Android 5.1 Lollipop
For a full list, please see https://github.com/nextcloud/android/milestone/59
## 3.16.1 (June, 01, 2021)
- Fix media tab not showing images/videos
- Connectivity checks fixed
- Crashing while retrieving avatar
Minimum: NC 16 Server, Android 5.0 Lollipop
For a full list, please see https://github.com/nextcloud/android/milestone/58
## 3.16.0 (May, 05, 2021)
- Enhance sharing
- Update template section when creating new files
- Pin protection update
- Updated notification handling during updates @newhinton
- UI improvements
Minimum: NC 16 Server, Android 5.0 Lollipop
For a full list, please see https://github.com/nextcloud/android/milestone/55
## 3.15.1 (March, 10, 2021)
- share fix
- passcode fix
- enhance share access
Minimum: NC 16 Server, Android 5.0 Lollipop
For a full list, please see https://github.com/nextcloud/android/milestone/57
## 3.15.0 (February, 02, 2021)
- Media instead of Photos: also show videos
- UI Improvement (shimmer)
- Bug fixes all over the place
- Drop Android 4.4, new min version Android 5.0
Minimum: NC 16 Server, Android 5.0 Lollipop
For a full list, please see https://github.com/nextcloud/android/milestone/52
## 3.14.3 (January, 13, 2021)
- Fix crash when clicking "+" button
- Fix push notifications on some devices
- Fix updating of sharee list
- Fix crash during setting status
- Fix Crash Sharing files to Nextcloud via Android Apps
For a full list, please see https://github.com/nextcloud/android/milestone/56
## 3.14.2 (January, 13, 2021)
- Fix push notifications on some devices
- Fix updating of sharee list
- Fix crash during setting status
- Fix Crash Sharing files to Nextcloud via Android Apps
For a full list, please see https://github.com/nextcloud/android/milestone/54
## 3.14.1 (December, 02, 2020)
- Fix crash due to service not started in time
- Fix UI while media playback
- Fix uploading direct camera images with more than one picture
- Fix conflict handling on auto upload
For a full list, please see https://github.com/nextcloud/android/milestone/53
## 3.14.0 (November, 18, 2020)
- Prevent Firebase crashes: Exodus will warn about tracker, but code wise it is disabled
- Status support
- Document storage enhancement @tgrote
- Auto upload media detection improvements @AndyScherzinger
- Sharing UI rewrite
- Drop Android 4.3, new min version Android 4.4
For a full list, please see https://github.com/nextcloud/android/milestone/50
## 3.13.1 (September, 15, 2020)
- bugfix release
- auto upload obey metered network
- fix adding account via qrCode
- fix deleting password on share
- fix conflict handling on auto upload
- lots more
For a full list, please see https://github.com/nextcloud/android/milestone/51
## 3.13.0 (August, 18, 2020)
- new UI overhaul @Shagequi @JorisBodin
- E2EE beta support
- dark mode enhancement @AndyScherzinger
- warn on outdated NC16 server
- requires Android 4.3 or newer
For a full list, please see https://github.com/nextcloud/android/milestone/48
## 3.12.1 (July, 07, 2020)
- UI does not hang when changing auto upload
-1
View File
@@ -1 +0,0 @@
@AGENTS.md
-4
View File
@@ -1,7 +1,3 @@
<!--
~ SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
~ SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
-->
In the Nextcloud community, participants from all over the world come together to create Free Software for a free internet. This is made possible by the support, hard work and enthusiasm of thousands of people, including those who create and use Nextcloud software.
Our code of conduct offers some guidance to ensure Nextcloud participants can cooperate effectively in a positive and inspiring atmosphere, and to explain how together we can strengthen and support each other.
+81 -86
View File
@@ -1,9 +1,9 @@
<!--
~ SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
~ SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
-->
# [Nextcloud](https://nextcloud.com) Android app
[![irc](https://img.shields.io/badge/IRC-%23nextcloud%20on%20freenode-orange.svg)](https://webchat.freenode.net/?channels=nextcloud)
[![irc](https://img.shields.io/badge/IRC-%23nextcloud--mobile%20on%20freenode-blue.svg)](https://webchat.freenode.net/?channels=nextcloud-mobile)
# Index
1. [Guidelines](#guidelines)
1. [Issue reporting](#issue-reporting)
@@ -14,9 +14,8 @@
1. [Contributing to Source Code](#contributing-to-source-code)
1. [Developing process](#developing-process)
1. [Branching model](#branching-model)
1. [Formatter setup](#formatter-setup)
1. [Android Studio formatter setup](#android-studio-formatter-setup)
1. [Build variants](#build-variants)
1. [Git hooks](#git-hooks)
1. [Contribution process](#contribution-process)
1. [Fork and download android repository](#fork-and-download-android-repository)
1. [Create pull request](#create-pull-request)
@@ -107,22 +106,12 @@ We are all about quality while not sacrificing speed so we use a very pragmatic
* Hot fixes not relevant for an upcoming feature release but the latest release can target the bug fix branch directly
### Formatter setup
### Android Studio formatter setup
Our formatter setup is rather simple:
* Standard Android Studio
* Line length 120 characters (Settings->Editor->Code Style->Right margin(columns): 120; also set by EditorConfig
* Line length 120 characters (Settings->Editor->Code Style->Right margin(columns): 120)
* Auto optimize imports (Settings->Editor->Auto Import->Optimize imports on the fly)
You can fix Check / check (spotlessKotlinCheck) via following commands:
```bash
./gradlew spotlessApply
./gradlew detekt
./gradlew spotlessCheck
./gradlew spotlessKotlinCheck
```
See section [Git hooks](#git-hooks) to have these run automatically with your commits.
### Build variants
There are three build variants
@@ -130,14 +119,6 @@ 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.
They are stored in [/scripts/hooks](/scripts/hooks) and can be installed with:
```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.
@@ -148,11 +129,12 @@ They are stored in [/scripts/hooks](/scripts/hooks) and can be installed with:
### Create pull request:
* Commit your changes locally. Remember to sign off your commits (`git commit -sm 'Your commit message'`).
* 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
* Enter description and send pull request.
### Create another pull request:
To make sure your new pull request does not contain commits which are already contained in previous PRs, create a new branch which is a clone of upstream/master.
@@ -187,31 +169,79 @@ Copyright of Nextcloud GmbH is optional.
Source code of library:
```java
/*
* Nextcloud Android Library
/* Nextcloud Android Library is available under MIT license
*
* @author Your Name
* Copyright (C) 2019 Your Name
* Copyright (C) 2019 Nextcloud GmbH
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* SPDX-FileCopyrightText: 2024 Your Name <[email protected]>
* SPDX-License-Identifier: MIT
*/
```
Source code of app:
```java
/*
* Nextcloud - Android Client
* Nextcloud Android client application
*
* SPDX-FileCopyrightText: 2024 Your Name <[email protected]>
* SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
* @author Your Name
* Copyright (C) 2019 Your Name
* Copyright (C) 2019 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/>.
*/
```
XML (layout) file:
```xml
<!--
~ Nextcloud - Android Client
~
~ SPDX-FileCopyrightText: 2024 Your name <your@email.com>
~ SPDX-License-Identifier: AGPL-3.0-or-later OR GPL-2.0-only
Nextcloud Android client application
@author Your Name
Copyright (C) 2019 Your Name
Copyright (C) 2019 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/>.
-->
```
@@ -224,48 +254,29 @@ Source code of app:
- small, isolated tests, with no need of Android SDK
- code coverage can be directly shown via right click on test and select "Run Test with Coverage"
```bash
./gradlew jacocoTestGplayDebugUnitTest
```
#### Instrumented tests
- tests to see larger code working in correct way
- tests that require parts of Android SDK
- best to avoid server communication, see https://github.com/nextcloud/android/pull/3624
- run all tests ```./gradlew createGplayDebugCoverageReport -Pcoverage=true```
- run selective test class: ```./gradlew createGplayDebugCoverageReport -Pcoverage=true
-Pandroid.testInstrumentationRunnerArguments.class=com.owncloud.android.datamodel.FileDataStorageManagerContentProviderClientIT```
-Pandroid.testInstrumentationRunnerArguments.class=com.owncloud.android.datamodel.FileDataStorageManagerTest```
- run multiple test classes:
- separate by ","
- ```./gradlew createGplayDebugCoverageReport -Pcoverage=true -Pandroid.testInstrumentationRunnerArguments.class=com.owncloud.android.datamodel.FileDataStorageManagerContentProviderClientIT,com.nextcloud.client.FileDisplayActivityIT```
- ```./gradlew createGplayDebugCoverageReport -Pcoverage=true -Pandroid.testInstrumentationRunnerArguments.class=com.owncloud.android.datamodel.FileDataStorageManagerTest,com.nextcloud.client.FileDisplayActivityIT```
- run one test in class: ```./gradlew createGplayDebugCoverageReport -Pcoverage=true
-Pandroid.testInstrumentationRunnerArguments.class=com.owncloud.android.datamodel.FileDataStorageManagerContentProviderClientIT#saveFile```
-Pandroid.testInstrumentationRunnerArguments.class=com.owncloud.android.datamodel.FileDataStorageManagerTest#saveNewFile```
- JaCoCo results are shown as html: firefox ./build/reports/coverage/gplay/debug/index.html
#### Instrumented tests with server communication
It is best to avoid server communication, see https://github.com/nextcloud/android/pull/3624.
But if a test requires a server, this is how it is done:
- Have a Nextcloud service reachable by your test device. This can be an existing server in the internet or a locally deployed one
as per the [server developer documentation](https://docs.nextcloud.com/server/latest/developer_manual/getting_started/devenv.html)
- Create a separate(!) test user on that server, otherwise the tests will infer with productive data.
- In `gradle.properties`, enter the URL, user name and password via the `NC_TEST_SERVER_...` attributes.
If you want to prevent an accidental commit of those, you can also store them in `~/.gradle/gradle.properties`.
- Your test class should inherit from `AbstractOnServerIT`, e.g.: `public class DownloadIT extends AbstractOnServerIT { ...`
Note that this will automatically delete all files after each test run, so you absolutely NEED a separate test user as mentioned above.
- All preconditions of your test regarding server data, e.g. existing files, need to be established by your test itself.
As a reference, see how `DownloadIT` first uploads the files it later tests the download with.
- Clean up these preconditions again, also in the failure case, using one or multiple `@After` methods in your test class.
#### UI tests
We use [shot](https://github.com/Karumi/Shot) for taking screenshots and compare them.
To exclude the shot dependency from normal builds, the dependency needs to be activated via an environment variable `SHOT_TEST`.
For convenience, this and other prerequisites are encapsulated in utility scripts, so it is advised to use them
- check screenshots: ```scripts/androidScreenshotTest ```
- check the script for a detailed documentation of the parameters
We use [shot](https://github.com/Karumi/Shot) for taking screenshots and compare them
- check screenshots: ```./gradlew gplayDebugExecuteScreenshotTests ```
- update/generate new screenshots: ```scripts/updateScreenshots.sh ```
- in this script are samples how to only execute a given class/test
- this will fire up docker & emulator to ensure that screenshots look the same
- creating own UI comparison tests:
- creating own UI comparision tests:
- add IntentsTestRule for launching activity directly:
```java
@@ -282,7 +293,7 @@ For convenience, this and other prerequisites are encapsulated in utility script
Screenshot.snapActivity(activity).record();
```
- best practice is to first create test with emulator too see behaviour and then create screenshots
- best practise is to first create test with emulator too see behaviour and then create screenshots
## File naming
@@ -304,21 +315,21 @@ A good practice is to not include the word `menu` as part of the name because th
## Translations
We manage translations via [Transifex](https://app.transifex.com/nextcloud/nextcloud/android/). So just request joining the translation team for Android on the site and start translating. All translations will then be automatically pushed to this repository, there is no need for any pull request for translations.
We manage translations via [Transifex](https://www.transifex.com/nextcloud/nextcloud/android/). So just request joining the translation team for Android on the site and start translating. All translations will then be automatically pushed to this repository, there is no need for any pull request for translations.
If you need to change a translation, do not change it, but give it new key. This way the translation stays backward compatible as we automatically backport translated strings to last versions.
When submitting PRs with changed translations, please only submit changes to values/strings.xml and not changes to translated files. These will be overwritten by next merge of transifex-bot and increase PR review.
When submitting PRs with changed translations, please only submit changes to values/strings.xml and not changes to translated files. These will be overwritten by next merge of transifex-but and increase PR review.
## Engineering practices
This section contains some general guidelines for new contributors, based on common issues flagged during code review.
This section contains some general guideliens for new contributors, based on common issues flagged during code review.
### Approach to technical debt
TL;DR Non-Stop Litter Picking Party!
We recognize the importance of technical debt that can slow down development, make bug fixing difficult and
We recognize the importance of technical debt that can slow down development, make bufixing difficult and
discourage future contributors.
We are mindful of the [Broken Windows Theory](https://en.wikipedia.org/wiki/Broken_windows_theory) and we'd like
@@ -392,22 +403,6 @@ and thereof we'd ask contributors to be mindful of their code testability:
should at least not make future efforts more challenging
3. whenever possible, testability should be improved even if the code is not covered by tests
### Performance
If you're interested in improving the app's performance, please check the [official documentation](https://developer.android.com/topic/performance)
for ways you can inspect and improve performance.
For additional analysis, set the `perfAnalysis` property
in your Gradle build:
```shell
./gradlew installGplayDebug -P perfAnalysis
```
This will install the app with [LeakCanary](https://square.github.io/leakcanary/) and
[StrictMode](https://developer.android.com/reference/android/os/StrictMode) enabled and configured.
These tools can help find memory leaks, foreground operations that should be in background, and other performance
problems.
# Releases
At the moment we are releasing the app in two app stores:
@@ -450,7 +445,7 @@ Examples for different versions:
* 8.12.2 ```80120200```
* 9.8.4-rc18 ```90080418```
beware, that beta releases for an upcoming version will always use the minor and hotfix version of the release they are targeting. So to make sure the version code of the upcoming stable release will always be higher stable releases set the 2 beta digits to '99' as seen above in the examples. For major versions, as we're not a library and thus 'incompatible API changes' is not something that happens, decisions are essentially marketing-based. If we deem a release to be very impactful, we might increase the major version number.
beware, that beta releases for an upcoming version will always use the minor and hotfix version of the release they are targeting. So to make sure the version code of the upcoming stable release will always be higher stable releases set the 2 beta digits to '99' as seen above in the examples.
### Dev
For dev the version name is in format YYYYMMDD. It is mainly as a reference for reporting bugs and is not related to stable/release candidates as it is an independent app.
+6 -3
View File
@@ -1,7 +1,10 @@
# Autogenerated by fastlane
#
# Ensure this file is checked in to source control!
source "https://rubygems.org"
gem "fastlane"
gem "abbrev"
gem 'fastlane'
plugins_path = File.join(File.dirname(__FILE__), '.', 'Pluginfile')
plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile')
eval_gemfile(plugins_path) if File.exist?(plugins_path)
-2
View File
@@ -1,2 +0,0 @@
# SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: CC0-1.0
+132 -215
View File
@@ -1,263 +1,180 @@
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (3.0.8)
abbrev (0.1.2)
addressable (2.9.0)
public_suffix (>= 2.0.2, < 8.0)
artifactory (3.0.17)
CFPropertyList (3.0.2)
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
atomos (0.1.3)
aws-eventstream (1.4.0)
aws-partitions (1.1290.0)
aws-sdk-core (3.257.0)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.992.0)
aws-sigv4 (~> 1.9)
base64
bigdecimal
jmespath (~> 1, >= 1.6.1)
logger
rexml (~> 3.4, >= 3.4.2)
aws-sdk-kms (1.132.0)
aws-sdk-core (~> 3, >= 3.256.0)
aws-sigv4 (~> 1.5)
aws-sdk-s3 (1.232.2)
aws-sdk-core (~> 3, >= 3.256.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.5)
aws-sigv4 (1.12.1)
aws-eventstream (1.1.0)
aws-partitions (1.343.0)
aws-sdk-core (3.104.1)
aws-eventstream (~> 1, >= 1.0.2)
babosa (1.0.4)
base64 (0.3.0)
benchmark (0.5.0)
bigdecimal (4.1.3)
cgi (0.5.2)
claide (1.1.0)
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-sigv4 (~> 1.1)
aws-sdk-s3 (1.75.0)
aws-sdk-core (~> 3, >= 3.104.1)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.1)
aws-sigv4 (1.2.1)
aws-eventstream (~> 1, >= 1.0.2)
babosa (1.0.3)
claide (1.0.3)
colored (1.2)
colored2 (3.1.2)
commander (4.6.0)
highline (~> 2.0.0)
csv (3.3.6)
commander-fastlane (4.4.6)
highline (~> 1.7.2)
declarative (0.0.20)
digest-crc (0.7.0)
rake (>= 12.0.0, < 14.0.0)
domain_name (0.6.20260921)
dotenv (2.8.1)
emoji_regex (3.2.3)
erb (6.0.7)
excon (1.7.1)
logger
faraday (2.14.4)
faraday-net_http (>= 2.0, < 3.5)
json
logger
faraday-cookie_jar (0.0.8)
faraday (>= 0.8.0)
http-cookie (>= 1.0.0)
faraday-follow_redirects (0.5.0)
faraday (>= 1, < 3)
faraday-multipart (1.2.0)
multipart-post (~> 2.0)
faraday-net_http (3.4.4)
net-http (~> 0.5)
faraday-retry (2.4.0)
faraday (~> 2.0)
fastimage (2.4.1)
fastlane (2.240.1)
CFPropertyList (>= 2.3, < 5.0.0)
abbrev (~> 0.1)
addressable (>= 2.9.0, < 3.0.0)
artifactory (~> 3.0)
aws-sdk-s3 (~> 1.197)
declarative-option (0.1.0)
digest-crc (0.6.1)
rake (~> 13.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)
multipart-post (>= 1.2, < 3)
faraday-cookie_jar (0.0.6)
faraday (>= 0.7.4)
http-cookie (~> 1.0.0)
faraday_middleware (0.14.0)
faraday (>= 0.7.4, < 1.0)
fastimage (2.1.7)
fastlane (2.152.0)
CFPropertyList (>= 2.3, < 4.0.0)
addressable (>= 2.3, < 3.0.0)
aws-sdk-s3 (~> 1.0)
babosa (>= 1.0.3, < 2.0.0)
base64 (~> 0.2)
benchmark (>= 0.1.0)
bundler (>= 2.4.0, < 5.0.0)
cgi (~> 0.4)
colored (~> 1.2)
commander (~> 4.6)
csv (~> 3.3)
bundler (>= 1.12.0, < 3.0.0)
colored
commander-fastlane (>= 4.4.6, < 5.0.0)
dotenv (>= 2.1.1, < 3.0.0)
emoji_regex (>= 0.1, < 4.0)
excon (>= 0.71.0, < 2.0.0)
faraday (~> 2.7)
faraday-cookie_jar (~> 0.0.8)
faraday-follow_redirects (~> 0.3)
faraday-multipart (~> 1.0)
faraday-retry (~> 2.0)
excon (>= 0.71.0, < 1.0.0)
faraday (>= 0.17, < 1.0)
faraday-cookie_jar (~> 0.0.6)
faraday_middleware (>= 0.13.1, < 2.0)
fastimage (>= 2.1.0, < 3.0.0)
fastlane-sirp (>= 1.1.0)
gh_inspector (>= 1.1.2, < 2.0.0)
google-apis-androidpublisher_v3 (~> 0.99)
google-apis-playcustomapp_v1 (~> 0.1)
google-cloud-env (>= 1.6.0, < 2.4.0)
google-cloud-storage (~> 1.31)
highline (~> 2.0)
irb (>= 1.8)
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)
json (< 3.0.0)
jwt (>= 2.10.3, < 4)
logger (>= 1.6, < 2.0)
jwt (>= 2.1.0, < 3)
mini_magick (>= 4.9.4, < 5.0.0)
multi_json (~> 1.12)
multipart-post (>= 2.0.0, < 3.0.0)
mutex_m (~> 0.3)
naturally (~> 2.2)
nkf (~> 0.2)
optparse (>= 0.1.1, < 1.0.0)
ostruct (>= 0.1.0)
multipart-post (~> 2.0.0)
plist (>= 3.1.0, < 4.0.0)
rubyzip (>= 3.4.0, < 4.0.0)
security (~> 0.3)
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 (~> 4)
terminal-table (>= 1.4.5, < 2.0.0)
tty-screen (>= 0.6.3, < 1.0.0)
tty-spinner (>= 0.8.0, < 1.0.0)
word_wrap (~> 1.0.0)
xcodeproj (>= 1.13.0, < 2.0.0)
xcpretty (~> 0.4.1)
xcpretty-travis-formatter (>= 0.0.3, < 2.0.0)
fastlane-sirp (1.1.0)
xcpretty (~> 0.3.0)
xcpretty-travis-formatter (>= 0.0.3)
fastlane-plugin-huawei_appgallery_connect (1.0.9)
gh_inspector (1.1.3)
google-apis-androidpublisher_v3 (0.109.0)
google-apis-core (>= 0.15.0, < 2.a)
google-apis-core (1.2.5)
addressable (~> 2.9)
faraday (~> 2.13)
faraday-follow_redirects (~> 0.3)
googleauth (~> 1.14)
mini_mime (~> 1.1)
multi_json (~> 1.11)
representable (~> 3.0)
retriable (>= 3.1, < 5.0)
google-apis-iamcredentials_v1 (0.28.0)
google-apis-core (>= 0.15.0, < 2.a)
google-apis-playcustomapp_v1 (0.18.0)
google-apis-core (>= 0.15.0, < 2.a)
google-apis-storage_v1 (0.68.0)
google-apis-core (>= 0.15.0, < 2.a)
google-cloud-core (1.9.0)
google-cloud-env (>= 1.0, < 3.a)
google-cloud-errors (~> 1.0)
google-cloud-env (2.3.1)
base64 (~> 0.2)
faraday (>= 1.0, < 3.a)
google-cloud-errors (1.7.0)
google-cloud-storage (1.62.0)
addressable (~> 2.8)
digest-crc (~> 0.4)
google-apis-core (>= 0.18, < 2)
google-apis-iamcredentials_v1 (~> 0.18)
google-apis-storage_v1 (>= 0.42)
google-cloud-core (~> 1.6)
googleauth (~> 1.9)
google-api-client (0.38.0)
addressable (~> 2.5, >= 2.5.1)
googleauth (~> 0.9)
httpclient (>= 2.8.1, < 3.0)
mini_mime (~> 1.0)
google-logging-utils (0.2.0)
googleauth (1.17.4)
faraday (>= 1.0, < 3.a)
google-cloud-env (~> 2.2)
google-logging-utils (~> 0.1)
jwt (>= 1.4, < 4.0)
representable (~> 3.0)
retriable (>= 2.0, < 4.0)
signet (~> 0.12)
google-cloud-core (1.5.0)
google-cloud-env (~> 1.0)
google-cloud-errors (~> 1.0)
google-cloud-env (1.3.3)
faraday (>= 0.17.3, < 2.0)
google-cloud-errors (1.0.1)
google-cloud-storage (1.26.2)
addressable (~> 2.5)
digest-crc (~> 0.4)
google-api-client (~> 0.33)
google-cloud-core (~> 1.2)
googleauth (~> 0.9)
mini_mime (~> 1.0)
googleauth (0.13.0)
faraday (>= 0.17.3, < 2.0)
jwt (>= 1.4, < 3.0)
memoist (~> 0.16)
multi_json (~> 1.11)
os (>= 0.9, < 2.0)
pstore (~> 0.1)
signet (>= 0.16, < 2.a)
highline (2.0.3)
http-cookie (1.1.6)
signet (~> 0.14)
highline (1.7.10)
http-cookie (1.0.3)
domain_name (~> 0.5)
io-console (0.9.4)
irb (1.18.0)
pp (>= 0.6.0)
prism (>= 1.3.0)
rdoc (>= 4.0.0)
reline (>= 0.4.2)
jmespath (1.6.2)
json (2.21.2)
jwt (3.3.0)
base64
logger (1.7.0)
mini_magick (4.13.2)
mini_mime (1.1.5)
multi_json (1.21.2)
multipart-post (2.4.1)
mutex_m (0.3.0)
nanaimo (0.4.0)
naturally (2.3.0)
net-http (0.9.1)
uri (>= 0.11.1)
nkf (0.3.0)
optparse (0.8.1)
os (1.1.4)
ostruct (0.6.3)
plist (3.7.2)
pp (0.6.4)
prettyprint
prettyprint (0.2.0)
prism (1.9.0)
pstore (0.2.1)
public_suffix (7.0.5)
rake (13.4.2)
rbs (4.2.0)
logger
prism (>= 1.6.0)
tsort
rdoc (8.0.0)
erb
prism (>= 1.6.0)
rbs (>= 4.0.0)
tsort
reline (0.7.0)
io-console (~> 0.5)
representable (3.3.0)
httpclient (2.8.3)
jmespath (1.4.0)
json (2.3.1)
jwt (2.2.1)
memoist (0.16.2)
mini_magick (4.10.1)
mini_mime (1.0.2)
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)
declarative (< 0.1.0)
trailblazer-option (>= 0.1.1, < 0.2.0)
declarative-option (< 0.2.0)
uber (< 0.2.0)
retriable (4.2.0)
rexml (3.4.4)
rouge (3.28.0)
rubyzip (3.7.0)
security (0.3.0)
signet (0.22.0)
addressable (~> 2.8)
faraday (>= 0.17.5, < 3.a)
jwt (>= 1.5, < 4.0)
simctl (1.6.10)
retriable (3.1.2)
rouge (2.0.7)
rubyzip (2.3.0)
security (0.1.3)
signet (0.14.0)
addressable (~> 2.3)
faraday (>= 0.17.3, < 2.0)
jwt (>= 1.5, < 3.0)
multi_json (~> 1.10)
simctl (1.6.8)
CFPropertyList
naturally
slack-notifier (2.3.2)
terminal-notifier (2.0.0)
terminal-table (4.0.0)
unicode-display_width (>= 1.1.1, < 4)
trailblazer-option (0.1.2)
tsort (0.2.0)
terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1)
tty-cursor (0.7.1)
tty-screen (0.8.2)
tty-screen (0.8.1)
tty-spinner (0.9.3)
tty-cursor (~> 0.7)
uber (0.1.0)
unicode-display_width (3.3.0)
unicode-emoji (~> 4.3)
unicode-emoji (4.3.0)
uri (1.1.1)
unf (0.1.4)
unf_ext
unf_ext (0.0.7.7)
unicode-display_width (1.7.0)
word_wrap (1.0.0)
xcodeproj (1.28.1)
xcodeproj (1.17.1)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
base64
claide (>= 1.0.2, < 2.0)
colored2 (~> 3.1)
nanaimo (~> 0.4.0)
nkf
rexml (>= 3.3.6, < 4.0)
xcpretty (0.4.1)
rouge (~> 3.28.0)
xcpretty-travis-formatter (1.0.1)
nanaimo (~> 0.3.0)
xcpretty (0.3.0)
rouge (~> 2.0.7)
xcpretty-travis-formatter (1.0.0)
xcpretty (~> 0.2, >= 0.0.7)
PLATFORMS
x86_64-linux
ruby
DEPENDENCIES
abbrev
fastlane
fastlane-plugin-huawei_appgallery_connect
BUNDLED WITH
2.5.4
2.1.4
-2
View File
@@ -1,2 +0,0 @@
# SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: CC0-1.0
+99
View File
@@ -0,0 +1,99 @@
Standard Google Material Design icons
Copyright (c) 2014, Google (http://www.google.com/design/)
uses the license at https://github.com/google/material-design-icons/blob/master/LICENSE
Twitter icon graphic
Copyright (c) 2014, Austin Andrews (http://materialdesignicons.com/),
with Reserved Font Name Material Design Icons.
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
-235
View File
@@ -1,235 +0,0 @@
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
Preamble
The GNU Affero General Public License is a free, copyleft license for software and other kinds of works, specifically designed to ensure cooperation with the community in the case of network server software.
The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, our General Public Licenses are intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users.
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.
Developers that use our General Public Licenses protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License which gives you legal permission to copy, distribute and/or modify the software.
A secondary benefit of defending all users' freedom is that improvements made in alternate versions of the program, if they receive widespread use, become available for other developers to incorporate. Many developers of free software are heartened and encouraged by the resulting cooperation. However, in the case of software used on network servers, this result may fail to come about. The GNU General Public License permits making a modified version and letting the public access it on a server without ever releasing its source code to the public.
The GNU Affero General Public License is designed specifically to ensure that, in such cases, the modified source code becomes available to the community. It requires the operator of a network server to provide the source code of the modified version running there to the users of that server. Therefore, public use of a modified version, on a publicly accessible server, gives the public access to the source code of the modified version.
An older license, called the Affero General Public License and published by Affero, was designed to accomplish similar goals. This is a different license, not a version of the Affero GPL, but Affero has released a new version of the Affero GPL which permits relicensing under this license.
The precise terms and conditions for copying, distribution and modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU Affero General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based on the Program.
To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work.
A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.
The Corresponding Source for a work in source code form is that same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.
When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified it, and giving a relevant date.
b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices".
c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.
A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:
a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.
d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.
A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.
"Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.
If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).
The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or authors of the material; or
e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.
All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).
However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.
Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.
If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.
A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.
13. Remote Network Interaction; Use with the GNU General Public License.
Notwithstanding any other provision of this License, if you modify the Program, your modified version must prominently offer all users interacting with it remotely through a computer network (if your version supports such interaction) an opportunity to receive the Corresponding Source of your version by providing access to the Corresponding Source from a network server at no charge, through some standard or customary means of facilitating copying of software. This Corresponding Source shall include the Corresponding Source for any work covered by version 3 of the GNU General Public License that is incorporated pursuant to the following paragraph.
Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the work with which it is combined will remain governed by version 3 of the GNU General Public License.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of the GNU Affero General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU Affero General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU Affero General Public License, you may choose any version ever published by the Free Software Foundation.
If the Program specifies that a proxy can decide which future versions of the GNU Affero General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.
Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
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 <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If your software can interact with users remotely through a computer network, you should also make sure that it provides a way for users to get its source. For example, if your program is a web application, its interface could display a "Source" link that leads users to an archive of the code. There are many ways you could offer source, and different solutions will be better for different programs; see section 13 for the specific requirements.
You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU AGPL, see <http://www.gnu.org/licenses/>.
-73
View File
@@ -1,73 +0,0 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
(a) You must give any other recipients of the Work or Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-9
View File
@@ -1,9 +0,0 @@
Copyright (c) <year> <owner>
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-121
View File
@@ -1,121 +0,0 @@
Creative Commons Legal Code
CC0 1.0 Universal
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
HEREUNDER.
Statement of Purpose
The laws of most jurisdictions throughout the world automatically confer
exclusive Copyright and Related Rights (defined below) upon the creator
and subsequent owner(s) (each and all, an "owner") of an original work of
authorship and/or a database (each, a "Work").
Certain owners wish to permanently relinquish those rights to a Work for
the purpose of contributing to a commons of creative, cultural and
scientific works ("Commons") that the public can reliably and without fear
of later claims of infringement build upon, modify, incorporate in other
works, reuse and redistribute as freely as possible in any form whatsoever
and for any purposes, including without limitation commercial purposes.
These owners may contribute to the Commons to promote the ideal of a free
culture and the further production of creative, cultural and scientific
works, or to gain reputation or greater distribution for their Work in
part through the use and efforts of others.
For these and/or other purposes and motivations, and without any
expectation of additional consideration or compensation, the person
associating CC0 with a Work (the "Affirmer"), to the extent that he or she
is an owner of Copyright and Related Rights in the Work, voluntarily
elects to apply CC0 to the Work and publicly distribute the Work under its
terms, with knowledge of his or her Copyright and Related Rights in the
Work and the meaning and intended legal effect of CC0 on those rights.
1. Copyright and Related Rights. A Work made available under CC0 may be
protected by copyright and related or neighboring rights ("Copyright and
Related Rights"). Copyright and Related Rights include, but are not
limited to, the following:
i. the right to reproduce, adapt, distribute, perform, display,
communicate, and translate a Work;
ii. moral rights retained by the original author(s) and/or performer(s);
iii. publicity and privacy rights pertaining to a person's image or
likeness depicted in a Work;
iv. rights protecting against unfair competition in regards to a Work,
subject to the limitations in paragraph 4(a), below;
v. rights protecting the extraction, dissemination, use and reuse of data
in a Work;
vi. database rights (such as those arising under Directive 96/9/EC of the
European Parliament and of the Council of 11 March 1996 on the legal
protection of databases, and under any national implementation
thereof, including any amended or successor version of such
directive); and
vii. other similar, equivalent or corresponding rights throughout the
world based on applicable law or treaty, and any national
implementations thereof.
2. Waiver. To the greatest extent permitted by, but not in contravention
of, applicable law, Affirmer hereby overtly, fully, permanently,
irrevocably and unconditionally waives, abandons, and surrenders all of
Affirmer's Copyright and Related Rights and associated claims and causes
of action, whether now known or unknown (including existing as well as
future claims and causes of action), in the Work (i) in all territories
worldwide, (ii) for the maximum duration provided by applicable law or
treaty (including future time extensions), (iii) in any current or future
medium and for any number of copies, and (iv) for any purpose whatsoever,
including without limitation commercial, advertising or promotional
purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
member of the public at large and to the detriment of Affirmer's heirs and
successors, fully intending that such Waiver shall not be subject to
revocation, rescission, cancellation, termination, or any other legal or
equitable action to disrupt the quiet enjoyment of the Work by the public
as contemplated by Affirmer's express Statement of Purpose.
3. Public License Fallback. Should any part of the Waiver for any reason
be judged legally invalid or ineffective under applicable law, then the
Waiver shall be preserved to the maximum extent permitted taking into
account Affirmer's express Statement of Purpose. In addition, to the
extent the Waiver is so judged Affirmer hereby grants to each affected
person a royalty-free, non transferable, non sublicensable, non exclusive,
irrevocable and unconditional license to exercise Affirmer's Copyright and
Related Rights in the Work (i) in all territories worldwide, (ii) for the
maximum duration provided by applicable law or treaty (including future
time extensions), (iii) in any current or future medium and for any number
of copies, and (iv) for any purpose whatsoever, including without
limitation commercial, advertising or promotional purposes (the
"License"). The License shall be deemed effective as of the date CC0 was
applied by Affirmer to the Work. Should any part of the License for any
reason be judged legally invalid or ineffective under applicable law, such
partial invalidity or ineffectiveness shall not invalidate the remainder
of the License, and in such case Affirmer hereby affirms that he or she
will not (i) exercise any of his or her remaining Copyright and Related
Rights in the Work or (ii) assert any associated claims and causes of
action with respect to the Work, in either case contrary to Affirmer's
express Statement of Purpose.
4. Limitations and Disclaimers.
a. No trademark or patent rights held by Affirmer are waived, abandoned,
surrendered, licensed or otherwise affected by this document.
b. Affirmer offers the Work as-is and makes no representations or
warranties of any kind concerning the Work, express, implied,
statutory or otherwise, including without limitation warranties of
title, merchantability, fitness for a particular purpose, non
infringement, or the absence of latent or other defects, accuracy, or
the present or absence of errors, whether or not discoverable, all to
the greatest extent permissible under applicable law.
c. Affirmer disclaims responsibility for clearing rights of other persons
that may apply to the Work or any use thereof, including without
limitation any person's Copyright and Related Rights in the Work.
Further, Affirmer disclaims responsibility for obtaining any necessary
consents, permissions or other rights required for any use of the
Work.
d. Affirmer understands and acknowledges that Creative Commons is not a
party to this document and has no duty or obligation with respect to
this CC0 or use of the Work.
-117
View File
@@ -1,117 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too.
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations.
Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and modification follow.
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.
You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License.
c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program.
In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.
7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.
10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.
one line to give the program's name and an idea of what it does. Copyright (C) yyyy name of author
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 2 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, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker.
signature of Ty Coon, 1 April 1989 Ty Coon, President of Vice
-232
View File
@@ -1,232 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright © 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for software and other kinds of works.
The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too.
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions.
Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and modification follow.
TERMS AND CONDITIONS
0. Definitions.
“This License” refers to version 3 of the GNU General Public License.
“Copyright” also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.
“The Program” refers to any copyrightable work licensed under this License. Each licensee is addressed as “you”. “Licensees” and “recipients” may be individuals or organizations.
To “modify” a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a “modified version” of the earlier work or a work “based on” the earlier work.
A “covered work” means either the unmodified Program or a work based on the Program.
To “propagate” a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.
To “convey” a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays “Appropriate Legal Notices” to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.
1. Source Code.
The “source code” for a work means the preferred form of the work for making modifications to it. “Object code” means any non-source form of a work.
A “Standard Interface” means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.
The “System Libraries” of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A “Major Component”, in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.
The “Corresponding Source” for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work.
The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.
The Corresponding Source for a work in source code form is that same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.
When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified it, and giving a relevant date.
b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to “keep intact all notices”.
c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.
A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an “aggregate” if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:
a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.
d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.
A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.
A “User Product” is either (1) a “consumer product”, which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, “normally used” refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.
“Installation Information” for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.
If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).
The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.
7. Additional Terms.
“Additional permissions” are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or authors of the material; or
e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.
All other non-permissive additional terms are considered “further restrictions” within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).
However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.
Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.
An “entity transaction” is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.
11. Patents.
A “contributor” is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's “contributor version”.
A contributor's “essential patent claims” are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, “control” includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.
In the following three paragraphs, a “patent license” is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To “grant” such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.
If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. “Knowingly relying” means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.
A patent license is “discriminatory” if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation.
If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.
Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the “copyright” line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
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 <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an “about box”.
You should also get your employer (if you work as a programmer) or school, if any, to sign a “copyright disclaimer” for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see <https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read <https://www.gnu.org/philosophy/why-not-lgpl.html>.
-175
View File
@@ -1,175 +0,0 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.]
Preamble
The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things.
To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others.
Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs.
When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library.
We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances.
For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system.
Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run.
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library.
Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library.
You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful.
(For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.)
These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library.
In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices.
Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange.
If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things:
a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place.
e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute.
7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above.
b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License.
11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License).
To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.
one line to give the library's name and an idea of what it does.
Copyright (C) year name of author
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
This library 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 Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in
the library `Frob' (a library for tweaking knobs) written
by James Random Hacker.
signature of Ty Coon, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!
@@ -1,9 +0,0 @@
The Nextcloud marks
Nextcloud and the Nextcloud logo is a registered trademark of Nextcloud GmbH in Germany and/or other countries.
These guidelines cover the following marks pertaining both to the product names and the logo: “Nextcloud”
and the blue/white cloud logo with or without the word Nextcloud; the service “Nextcloud Enterprise”;
and our products: “Nextcloud Files”; “Nextcloud Groupware” and “Nextcloud Talk”.
This set of marks is collectively referred to as the “Nextcloud marks.”
Use of Nextcloud logos and other marks is only permitted under the guidelines provided by the Nextcloud GmbH.
A copy can be found at https://nextcloud.com/trademarks/
-49
View File
@@ -1,49 +0,0 @@
Trademark policy
April 2023
You may not violate others’ intellectual property rights, including copyright and trademark.
A trademark is a word, logo, phrase, or device that distinguishes a trademark holder’s good or service in the marketplace. Trademark law may prevent others from using a trademark in an unauthorized or confusing manner.
What is in violation of this policy?
Using another’s trademark in a way that may mislead or confuse people about your affiliation may be a violation of our trademark policy.
What is not a violation of this policy?
Referencing another’s trademark is not automatically a violation of X's trademark policy. Examples of non-violations include:
* using a trademark in a way that is outside the scope of the trademark registration e.g., in a different territory, or a different class of goods or services than that identified in the registration; and
* using a trademark in a nominative or other fair use manner. For more information, see our Misleading and deceptive identities policy (https://help.twitter.com/en/rules-and-policies/twitter-impersonation-and-deceptive-identities-policy.html).
Who can report violations of this policy?
X only investigates requests that are submitted by the trademark holder or their authorized representative e.g., a legal representative or other representative for a brand.
How can I report violations of this policy?
You can submit a trademark report through our trademark report form (https://help.twitter.com/forms/trademark). Please provide all the information requested in the form. If you submit an incomplete report, we’ll need to follow up about the missing information. Please note that this will result in a delay in processing your report.
Note: We may provide the account holder with your name and other information included in the copy of the report.
What happens if you violate this policy?
If we determine that you violated our trademark policy, we may suspend your account. Depending on the type of violation, we may give you an opportunity to comply with our policies. In other instances, an account may be permanently suspended upon first review. If you believe that your account was suspended in error, you can submit an appeal (https://help.twitter.com/forms/general?subtopic=suspended).
Additional resources
Learn more about our range of enforcement options (https://help.twitter.com/rules-and-policies/enforcement-options) and our approach to policy development and enforcement (https://help.twitter.com/rules-and-policies/enforcement-philosophy).
Legal disclaimer
By using the X trademarks and resources on this site, you agree to follow the X Trademark Guidelines in our Brand Guidelines — as well as our Terms of Service and all other X rules and policies. If you have any questions, contact us at [email protected].
A copy can be found at https://about.x.com/en/who-we-are/brand-toolkit and https://help.twitter.com/en/rules-and-policies/x-trademark-policy
Loaded 100 of 4452 files, more files were not shown because too many files have changed in this diff. Show more