Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fd2328c693 |
No files matched your search
@@ -62,49 +62,12 @@ jobs:
|
||||
test:
|
||||
name: Run Tests
|
||||
runs-on: xcode-27
|
||||
timeout-minutes: 40
|
||||
needs: [build]
|
||||
|
||||
if: github.event.pull_request.draft == false
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Detect passcode changes
|
||||
id: passcode_changes
|
||||
shell: bash
|
||||
env:
|
||||
PR_BASE_SHA: ${{ github.event.pull_request.base.sha }}
|
||||
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
|
||||
PUSH_BEFORE_SHA: ${{ github.event.before }}
|
||||
run: |
|
||||
run_passcode_tests=false
|
||||
if [ "$GITHUB_EVENT_NAME" = "pull_request" ]; then
|
||||
compare_base=$(git merge-base "$PR_BASE_SHA" "$PR_HEAD_SHA")
|
||||
compare_head="$PR_HEAD_SHA"
|
||||
else
|
||||
compare_base="$PUSH_BEFORE_SHA"
|
||||
compare_head="$GITHUB_SHA"
|
||||
fi
|
||||
|
||||
if [ -z "$compare_base" ] || [ "$compare_base" = "0000000000000000000000000000000000000000" ]; then
|
||||
run_passcode_tests=true
|
||||
else
|
||||
git diff --name-only -z "$compare_base" "$compare_head" > "$RUNNER_TEMP/passcode-changed-files"
|
||||
while IFS= read -r -d '' changed_file; do
|
||||
case "$changed_file" in
|
||||
iOSClient/Utility/Passcode/* | \
|
||||
Tests/NextcloudUITests/PasscodeUITests.swift)
|
||||
run_passcode_tests=true
|
||||
break
|
||||
;;
|
||||
esac
|
||||
done < "$RUNNER_TEMP/passcode-changed-files"
|
||||
fi
|
||||
echo "run=$run_passcode_tests" >> "$GITHUB_OUTPUT"
|
||||
echo "Run passcode UI tests: $run_passcode_tests"
|
||||
|
||||
- name: Setup Xcode
|
||||
uses: maxim-lobanov/setup-xcode@ed7a3b1fda3918c0306d1b724322adc0b8cc0a90 # v1.7.0
|
||||
@@ -140,7 +103,6 @@ jobs:
|
||||
run: |
|
||||
mkdir server/data
|
||||
./server/occ maintenance:install --verbose --database=sqlite --database-name=nextcloud --database-host=127.0.0.1 --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass admin
|
||||
./server/occ config:system:set force_language --value=en
|
||||
./server/occ config:system:set hashing_default_password --value=true --type=boolean
|
||||
./server/occ config:system:set auth.bruteforce.protection.enabled --value false --type bool
|
||||
./server/occ config:system:set ratelimit.protection.enabled --value false --type bool
|
||||
@@ -154,17 +116,12 @@ jobs:
|
||||
name: Nextcloud for iOS
|
||||
|
||||
- name: Assert Nextcloud Server Status
|
||||
run: curl --fail --show-error --silent --max-time 5 --retry 5 --retry-delay 2 --retry-max-time 30 --retry-all-errors http://localhost:8080/status.php
|
||||
run: curl -s --retry 5 --retry-delay 60 --retry-all-errors http://localhost:8080/status.php || true
|
||||
|
||||
- name: Boot iOS Simulator
|
||||
run: |
|
||||
xcrun simctl boot "iPhone 17"
|
||||
xcrun simctl bootstatus "iPhone 17" -b
|
||||
xcrun simctl spawn "iPhone 17" defaults write NSGlobalDomain AppleLanguages -array en
|
||||
xcrun simctl spawn "iPhone 17" defaults write NSGlobalDomain AppleLocale -string en_US
|
||||
xcrun simctl shutdown "iPhone 17"
|
||||
xcrun simctl boot "iPhone 17"
|
||||
xcrun simctl bootstatus "iPhone 17" -b
|
||||
xcrun simctl bootstatus "iPhone 17" || echo "Simulator booted"
|
||||
|
||||
- name: Check if Safari is installed
|
||||
run: |
|
||||
@@ -176,31 +133,19 @@ jobs:
|
||||
fi
|
||||
|
||||
- name: Run Xcode Test
|
||||
timeout-minutes: 25
|
||||
shell: bash
|
||||
env:
|
||||
RUN_PASSCODE_TESTS: ${{ steps.passcode_changes.outputs.run }}
|
||||
run: |
|
||||
set -o pipefail
|
||||
test_selection=()
|
||||
if [ "$RUN_PASSCODE_TESTS" != "true" ]; then
|
||||
test_selection+=(-skip-testing:NextcloudUITests/PasscodeUITests)
|
||||
fi
|
||||
set -o pipefail && \
|
||||
xcodebuild test-without-building \
|
||||
-xctestrun $(find . -type f -name "*.xctestrun") \
|
||||
-destination "${{ env.DESTINATION }}" \
|
||||
-derivedDataPath "DerivedData" \
|
||||
"${test_selection[@]}" \
|
||||
-test-iterations 3 \
|
||||
-retry-tests-on-failure \
|
||||
-test-timeouts-enabled YES \
|
||||
-default-test-execution-time-allowance 600 \
|
||||
-maximum-test-execution-time-allowance 600 \
|
||||
-resultBundlePath "TestResult.xcresult"
|
||||
|
||||
- name: Upload Xcode Test Results
|
||||
uses: actions/upload-artifact@v7
|
||||
if: ${{ always() }}
|
||||
if: ${{ !cancelled() }}
|
||||
with:
|
||||
name: TestResult.xcresult
|
||||
path: "TestResult.xcresult"
|
||||
@@ -26,7 +26,6 @@ Other platforms like Android are irrelevant for this project.
|
||||
|-----------------|-----------------------------------------------------|----------------------|
|
||||
| `.github` | GitHub CI workflows (build & test, SwiftLint, extension-target builds) and issue templates. | Keep all three checks green: `xcode.yml` (builds the `Nextcloud` scheme and runs its tests against a Nextcloud server provisioned in CI), `lint.yml` (SwiftLint), `additional-targets.yml` (build-checks the extension schemes). CI skips draft PRs. |
|
||||
| `iOSClient` | Main iOS client source code. | — |
|
||||
| `iOSClient/Utility/Passcode` | Shared SwiftUI passcode UI and authentication model for the app and Share Extension; the mandatory app lock uses a dedicated window per scene. | Preserve existing credentials, lockout rules and app/extension reset behavior. |
|
||||
| `iOSClient/Supporting Files` | Translation files synced with Transifex (see `iOSClient/.tx/config`). | Only add new strings to `en.lproj` (`Localizable.strings`, plurals in `Localizable.stringsdict`); never edit the other `*.lproj` dirs — Transifex overwrites them. |
|
||||
| `Brand` | Branding layer: `NCBrand.swift` (app constants, colors), `Database.swift` (Realm database name and schema version), Info.plists and entitlements for all targets, launch screen and intro screens. | Bump `databaseSchemaVersion` in `Brand/Database.swift` when changing Realm models. |
|
||||
| `File Provider Extension` | Contains business logic for the iOS File Provider extension. | — |
|
||||
|
||||
@@ -39,7 +39,7 @@ extension BackgroundUploadExtension {
|
||||
livePhoto,
|
||||
component: "video",
|
||||
path: livePhoto.serverUrlFileNameVideo,
|
||||
error: videoResult.error,
|
||||
errorCode: videoResult.error.errorCode,
|
||||
account: account
|
||||
)
|
||||
}
|
||||
@@ -55,7 +55,7 @@ extension BackgroundUploadExtension {
|
||||
livePhoto,
|
||||
component: "image",
|
||||
path: livePhoto.serverUrlFileNameImage,
|
||||
error: imageResult.error,
|
||||
errorCode: imageResult.error.errorCode,
|
||||
account: account
|
||||
)
|
||||
}
|
||||
@@ -86,10 +86,10 @@ extension BackgroundUploadExtension {
|
||||
_ livePhoto: tableLivePhoto,
|
||||
component: String,
|
||||
path: String,
|
||||
error: NKError,
|
||||
errorCode: Int,
|
||||
account: String
|
||||
) async -> Bool {
|
||||
if error.errorCode == global.errorResourceNotFound {
|
||||
if errorCode == global.errorResourceNotFound {
|
||||
await database.deleteLivePhoto(
|
||||
account: account,
|
||||
serverUrlFileNameNoExt: livePhoto.serverUrlFileNameNoExt
|
||||
@@ -103,12 +103,12 @@ extension BackgroundUploadExtension {
|
||||
serverUrlFileNameNoExt: livePhoto.serverUrlFileNameNoExt
|
||||
)
|
||||
|
||||
if error.errorCode == global.errorUnauthorized {
|
||||
if errorCode == global.errorUnauthorized {
|
||||
preferences.setBackgroundUploadSuspended(true, account: account)
|
||||
logError("Suspended background upload after a Live Photo authentication failure for account \(account)")
|
||||
}
|
||||
|
||||
logError("Unable to link Live Photo \(component) \(path), error: \(error.logDescription)")
|
||||
logError("Unable to link Live Photo \(component) \(path), error: \(errorCode)")
|
||||
return false
|
||||
}
|
||||
}
|
||||
@@ -111,19 +111,18 @@ extension BackgroundUploadExtension {
|
||||
/// Stores the terminal upload error and resets transient task state on the associated metadata.
|
||||
/// Authentication failures receive a stable error code so the host app can require manual retry.
|
||||
func updateMetadataForUploadFailure(metadata: tableMetadata, job: PHAssetResourceUploadJob) async {
|
||||
let error: NKError
|
||||
let error = job.error.map { $0 as NSError }
|
||||
let authenticationRequired = isAuthenticationFailure(job: job)
|
||||
let message = authenticationRequired
|
||||
? "Authentication required for account \(metadata.user)"
|
||||
: error?.localizedDescription ?? "Background upload failed"
|
||||
let errorCode = authenticationRequired
|
||||
? NSURLErrorUserAuthenticationRequired
|
||||
: error?.code ?? NSURLErrorUnknown
|
||||
|
||||
if isAuthenticationFailure(job: job) {
|
||||
error = NKError(errorCode: NSURLErrorUserAuthenticationRequired, errorDescription: "Authentication required for account \(metadata.user)")
|
||||
} else if let jobError = job.error {
|
||||
error = NKError(error: jobError)
|
||||
} else {
|
||||
error = NKError(errorCode: NSURLErrorUnknown, errorDescription: "Background upload failed")
|
||||
}
|
||||
await persistMetadataState(.failed(message: message, errorCode: errorCode), metadata: metadata)
|
||||
|
||||
await persistMetadataState(.failed(error), metadata: metadata)
|
||||
|
||||
logError("Background upload failed for \(metadata.fileName), account: \(metadata.account), job: \(job.localIdentifier), error: \(error.logDescription)")
|
||||
logError("Background upload failed for \(metadata.fileName), account: \(metadata.account), job: \(job.localIdentifier), error: \(metadata.errorCode) \(metadata.sessionError)")
|
||||
}
|
||||
|
||||
/// Applies Nextcloud response metadata and records the asset as successfully auto-uploaded.
|
||||
@@ -132,7 +131,7 @@ extension BackgroundUploadExtension {
|
||||
let succeeded = await NCBackgroundUploadExtensionManager.shared.recordUploadSuccess(metadata: metadata, job: job)
|
||||
if !succeeded, !hasConfirmedUploadResponse(job: job) {
|
||||
await persistMetadataState(
|
||||
.failed(NKError(errorCode: NSURLErrorBadServerResponse, errorDescription: "Upload response missing oc-fileid")),
|
||||
.failed(message: "Upload response missing oc-fileid", errorCode: NSURLErrorBadServerResponse),
|
||||
metadata: metadata
|
||||
)
|
||||
}
|
||||
@@ -154,7 +153,6 @@ extension BackgroundUploadExtension {
|
||||
metadata.sessionDate = Date()
|
||||
metadata.sessionError = ""
|
||||
metadata.errorCode = 0
|
||||
metadata.errorKind = ""
|
||||
metadata.status = global.metadataStatusUploading
|
||||
|
||||
case .pendingRetry:
|
||||
@@ -172,12 +170,11 @@ extension BackgroundUploadExtension {
|
||||
metadata.backgroundUploadJobIdentifier = "pending"
|
||||
metadata.backgroundUploadNextRetryDate = nil
|
||||
|
||||
case let .failed(error):
|
||||
case let .failed(message, errorCode):
|
||||
metadata.sessionTaskIdentifier = 0
|
||||
metadata.sessionDate = Date()
|
||||
metadata.sessionError = error.errorDescription
|
||||
metadata.errorCode = error.errorCode
|
||||
metadata.errorKind = error.kind?.rawValue ?? ""
|
||||
metadata.sessionError = message
|
||||
metadata.errorCode = errorCode
|
||||
metadata.status = global.metadataStatusUploadError
|
||||
|
||||
case .completed:
|
||||
@@ -185,7 +182,6 @@ extension BackgroundUploadExtension {
|
||||
metadata.sceneIdentifier = nil
|
||||
metadata.session = ""
|
||||
metadata.sessionError = ""
|
||||
metadata.errorKind = ""
|
||||
metadata.sessionDate = nil
|
||||
metadata.sessionTaskIdentifier = 0
|
||||
metadata.status = global.metadataStatusNormal
|
||||
|
||||
@@ -32,7 +32,7 @@ final class BackgroundUploadExtension: PHBackgroundResourceUploadJobExtension {
|
||||
case uploading(jobIdentifier: String, incrementRetryCount: Bool)
|
||||
case pendingRetry
|
||||
case manualRetryRequired
|
||||
case failed(NKError)
|
||||
case failed(message: String, errorCode: Int)
|
||||
case completed
|
||||
}
|
||||
|
||||
|
||||
@@ -237,7 +237,6 @@ final class NCBackgroundUploadExtensionManager {
|
||||
metadata.sessionDate = nil
|
||||
metadata.sessionError = ""
|
||||
metadata.errorCode = 0
|
||||
metadata.errorKind = ""
|
||||
metadata.chunk = 0
|
||||
metadata.sceneIdentifier = nil
|
||||
metadata.backgroundUploadRetryCount = 0
|
||||
|
||||
@@ -8,4 +8,4 @@ import Foundation
|
||||
//
|
||||
let databaseName = "nextcloud.realm"
|
||||
let tableAccountBackup = "tableAccountBackup.json"
|
||||
let databaseSchemaVersion: UInt64 = 424
|
||||
let databaseSchemaVersion: UInt64 = 423
|
||||
@@ -246,7 +246,6 @@ class FileProviderData: NSObject {
|
||||
metadata.sceneIdentifier = nil
|
||||
metadata.session = ""
|
||||
metadata.sessionError = ""
|
||||
metadata.errorKind = ""
|
||||
metadata.sessionSelector = ""
|
||||
metadata.sessionDate = nil
|
||||
metadata.sessionTaskIdentifier = 0
|
||||
|
||||
@@ -139,7 +139,7 @@ extension FileProviderExtension {
|
||||
|
||||
} else {
|
||||
|
||||
completionHandler(nil, NSFileProviderError(.noSuchItem, userInfo: [NSLocalizedDescriptionKey: resultsMove.error.localizedGenericMessage, NSLocalizedFailureReasonErrorKey: ""]))
|
||||
completionHandler(nil, NSFileProviderError(.noSuchItem, userInfo: [NSLocalizedDescriptionKey: resultsMove.error.errorDescription, NSLocalizedFailureReasonErrorKey: ""]))
|
||||
return
|
||||
}
|
||||
}
|
||||
@@ -176,7 +176,7 @@ extension FileProviderExtension {
|
||||
|
||||
} else if resultsMove.error.errorCode == NCGlobal.shared.errorBadRequest {
|
||||
|
||||
completionHandler(nil, NSFileProviderError(.noSuchItem, userInfo: [NSLocalizedDescriptionKey: resultsMove.error.localizedGenericMessage, NSLocalizedFailureReasonErrorKey: ""]))
|
||||
completionHandler(nil, NSFileProviderError(.noSuchItem, userInfo: [NSLocalizedDescriptionKey: resultsMove.error.errorDescription, NSLocalizedFailureReasonErrorKey: ""]))
|
||||
return
|
||||
|
||||
} else {
|
||||
|
||||
@@ -12,15 +12,8 @@
|
||||
2C1D5D7923E2DE9100334ABB /* NCBrand.swift in Sources */ = {isa = PBXBuildFile; fileRef = F76B3CCD1EAE01BD00921AC9 /* NCBrand.swift */; };
|
||||
2C33C48223E2C475005F963B /* NotificationService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C33C48123E2C475005F963B /* NotificationService.swift */; };
|
||||
2C33C48623E2C475005F963B /* Notification Service Extension.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = 2C33C47F23E2C475005F963B /* Notification Service Extension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
|
||||
2EF7D3FD0885CE182717578E /* NKError+UserFriendlyMessage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 79DFE0BDF3898A66910E67CA /* NKError+UserFriendlyMessage.swift */; };
|
||||
370D26AF248A3D7A00121797 /* NCCellMain.swift in Sources */ = {isa = PBXBuildFile; fileRef = 370D26AE248A3D7A00121797 /* NCCellMain.swift */; };
|
||||
63563FE53573412998852DD3 /* NCAlbumsPersistenceTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 439616AAA50F4360A761E5EF /* NCAlbumsPersistenceTests.swift */; };
|
||||
7670DABED44E4D56AD99E6DC /* NCPasscodeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F902B24E44354B6D9F329F12 /* NCPasscodeView.swift */; };
|
||||
822D68B06B101563A759AD59 /* NKError+UserFriendlyMessage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 79DFE0BDF3898A66910E67CA /* NKError+UserFriendlyMessage.swift */; };
|
||||
87768C6AB8E040219DF85898 /* NCPasscodeModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 131F8E2F43AD414E9DB53019 /* NCPasscodeModel.swift */; };
|
||||
9310075861174A62B1C9FED6 /* NCPasscodeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F902B24E44354B6D9F329F12 /* NCPasscodeView.swift */; };
|
||||
9F0E3B428AB44A6480190C2D /* NCPasscodeModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 131F8E2F43AD414E9DB53019 /* NCPasscodeModel.swift */; };
|
||||
A0C0DE0230E0000100C0D001 /* NCPasscodeWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = A0C0DE0130E0000100C0D001 /* NCPasscodeWindow.swift */; };
|
||||
A12720261001000000000001 /* NCBackgroundUploadExtensionManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = F793E7C230417C7100F011FE /* NCBackgroundUploadExtensionManager.swift */; };
|
||||
A1E2EE010000000000000002 /* NCEndToEndKeySet.swift in Sources */ = {isa = PBXBuildFile; fileRef = A1E2EE010000000000000001 /* NCEndToEndKeySet.swift */; };
|
||||
A1E2EE010000000000000003 /* NCEndToEndKeySet.swift in Sources */ = {isa = PBXBuildFile; fileRef = A1E2EE010000000000000001 /* NCEndToEndKeySet.swift */; };
|
||||
@@ -35,7 +28,6 @@
|
||||
A1E2EE020000000000000005 /* NCEndToEndKeySetResolver.swift in Sources */ = {isa = PBXBuildFile; fileRef = A1E2EE020000000000000002 /* NCEndToEndKeySetResolver.swift */; };
|
||||
A1E2EE020000000000000006 /* NCEndToEndKeySetResolver.swift in Sources */ = {isa = PBXBuildFile; fileRef = A1E2EE020000000000000002 /* NCEndToEndKeySetResolver.swift */; };
|
||||
A1E2EE020000000000000008 /* NCEndToEndKeySetResolverTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A1E2EE020000000000000007 /* NCEndToEndKeySetResolverTests.swift */; };
|
||||
A358B569BF5FDABA6D9012D1 /* NCErrorContext.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE0CD9A00D74B01055F238E9 /* NCErrorContext.swift */; };
|
||||
A5A87F9E4B0E4441A6A4BC20 /* NCContextMenuProfile.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB7697C94BA14450A0867940 /* NCContextMenuProfile.swift */; };
|
||||
AA3C85E82D36B08C00F74F12 /* UITestBackend.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA3C85E72D36B08C00F74F12 /* UITestBackend.swift */; };
|
||||
AA3C85EB2D36BBFB00F74F12 /* OCSResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA3C85EA2D36BBF400F74F12 /* OCSResponse.swift */; };
|
||||
@@ -120,16 +112,13 @@
|
||||
AFCE353727E4ED7B00FEA6C2 /* NCShareCells.swift in Sources */ = {isa = PBXBuildFile; fileRef = AFCE353627E4ED7B00FEA6C2 /* NCShareCells.swift */; };
|
||||
AFCE353927E5DE0500FEA6C2 /* Shareable.swift in Sources */ = {isa = PBXBuildFile; fileRef = AFCE353827E5DE0400FEA6C2 /* Shareable.swift */; };
|
||||
B601AA012F10000100C0D3E5 /* NCLogFilesView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B601AA002F10000100C0D3E5 /* NCLogFilesView.swift */; };
|
||||
BAF64949B487A080A98F83F2 /* NKErrorUserFriendlyMessageTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 320C20803A58DAF7575440A8 /* NKErrorUserFriendlyMessageTests.swift */; };
|
||||
C0DEA070306D000100000005 /* NCLocalDatabase+AutoUpload.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0DEA070306D000100000004 /* NCLocalDatabase+AutoUpload.swift */; };
|
||||
C0DEA070306D000100000006 /* NCLocalDatabase+AutoUpload.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0DEA070306D000100000004 /* NCLocalDatabase+AutoUpload.swift */; };
|
||||
C0DEA070306D000100000008 /* NCAutoUploadAssetTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0DEA070306D000100000007 /* NCAutoUploadAssetTests.swift */; };
|
||||
C0DECA022F65000100C0D001 /* NCCameraRollTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0DECA012F65000100C0D001 /* NCCameraRollTests.swift */; };
|
||||
C0DEDA7E30C1000100A00002 /* NCAutoUploadDateTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0DEDA7E30C1000100A00001 /* NCAutoUploadDateTests.swift */; };
|
||||
CB3666201AF7550816B5CD6A /* NCContextMenuComment.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8932E90EC4278026D86CCCC9 /* NCContextMenuComment.swift */; };
|
||||
D56DFFE5D5014F66A7C9FED0 /* PasscodeUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = BC6C501EF1104A6A8569D9C1 /* PasscodeUITests.swift */; };
|
||||
D5B6AA7827200C7200D49C24 /* NCActivityTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5B6AA7727200C7200D49C24 /* NCActivityTableViewCell.swift */; };
|
||||
EB511D22564B7B9A605E70AE /* NCErrorContext.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE0CD9A00D74B01055F238E9 /* NCErrorContext.swift */; };
|
||||
F0A1B2C430B5000100D4E5F6 /* NCMediaViewerFloatingTitleViewTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0A1B2C330B5000100D4E5F6 /* NCMediaViewerFloatingTitleViewTests.swift */; };
|
||||
F0A1B2C630B6000100D4E5F6 /* NCImageZoomViewTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0A1B2C530B6000100D4E5F6 /* NCImageZoomViewTests.swift */; };
|
||||
F31165022F9674A1009A1E37 /* AppIcon.icon in Resources */ = {isa = PBXBuildFile; fileRef = F31165012F9674A1009A1E37 /* AppIcon.icon */; };
|
||||
@@ -185,6 +174,7 @@
|
||||
F37208C22BAB63F0006B5430 /* TagListView in Frameworks */ = {isa = PBXBuildFile; productRef = F37208C12BAB63F0006B5430 /* TagListView */; };
|
||||
F37208C42BAB63F0006B5430 /* Gzip in Frameworks */ = {isa = PBXBuildFile; productRef = F37208C32BAB63F0006B5430 /* Gzip */; };
|
||||
F37208C82BAB63F1006B5430 /* KeychainAccess in Frameworks */ = {isa = PBXBuildFile; productRef = F37208C72BAB63F1006B5430 /* KeychainAccess */; };
|
||||
F3754A7D2CF87D600009312E /* SetupPasscodeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3754A7C2CF87D600009312E /* SetupPasscodeView.swift */; };
|
||||
F389C9F52CEE383300049762 /* SelectAlbumView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F389C9F42CEE383300049762 /* SelectAlbumView.swift */; };
|
||||
F38F71252B6BBDC300473CDC /* NCCollectionViewCommonSelectTabBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = F38F71242B6BBDC300473CDC /* NCCollectionViewCommonSelectTabBar.swift */; };
|
||||
F39170AD2CB82024006127BC /* FileAutoRenamer+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = F39170A82CB8201B006127BC /* FileAutoRenamer+Extensions.swift */; };
|
||||
@@ -375,6 +365,8 @@
|
||||
F7346E2328B0FEBA006CE2D2 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F7346E2228B0FEBA006CE2D2 /* Assets.xcassets */; };
|
||||
F734B06628E75C0100E180D5 /* TLPhotoPicker in Frameworks */ = {isa = PBXBuildFile; productRef = F734B06528E75C0100E180D5 /* TLPhotoPicker */; };
|
||||
F7362A1F220C853A005101B5 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F7362A1E220C853A005101B5 /* LaunchScreen.storyboard */; };
|
||||
F737DA9D2B7B893C0063BAFC /* NCPasscode.swift in Sources */ = {isa = PBXBuildFile; fileRef = F737DA9C2B7B893C0063BAFC /* NCPasscode.swift */; };
|
||||
F737DA9E2B7B893C0063BAFC /* NCPasscode.swift in Sources */ = {isa = PBXBuildFile; fileRef = F737DA9C2B7B893C0063BAFC /* NCPasscode.swift */; };
|
||||
F7381EE1218218C9000B1560 /* NCOffline.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7381EDA218218C9000B1560 /* NCOffline.swift */; };
|
||||
F7381EE5218218C9000B1560 /* NCOffline.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F7381EDE218218C9000B1560 /* NCOffline.storyboard */; };
|
||||
F7386E482DA90E0F009A00F6 /* NCAppVersionManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7386E452DA90E02009A00F6 /* NCAppVersionManager.swift */; };
|
||||
@@ -990,6 +982,40 @@
|
||||
F7D496FD2EBFA6D9004F9823 /* String+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7A0D1342591FBC5008F8A13 /* String+Extension.swift */; };
|
||||
F7D497082EBFAFD6004F9823 /* NCImageCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = F76B649B2ADFFAED00014640 /* NCImageCache.swift */; };
|
||||
F7D4BF012CA1831900A5E746 /* NCCollectionViewCommonPinchGesture.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7D4BF002CA1831600A5E746 /* NCCollectionViewCommonPinchGesture.swift */; };
|
||||
F7D4BF2C2CA2E8D800A5E746 /* TOPasscodeKeypadView.m in Sources */ = {isa = PBXBuildFile; fileRef = F7D4BF102CA2E8D800A5E746 /* TOPasscodeKeypadView.m */; };
|
||||
F7D4BF2D2CA2E8D800A5E746 /* TOPasscodeSettingsKeypadView.m in Sources */ = {isa = PBXBuildFile; fileRef = F7D4BF172CA2E8D800A5E746 /* TOPasscodeSettingsKeypadView.m */; };
|
||||
F7D4BF2E2CA2E8D800A5E746 /* TOPasscodeFixedInputView.m in Sources */ = {isa = PBXBuildFile; fileRef = F7D4BF202CA2E8D800A5E746 /* TOPasscodeFixedInputView.m */; };
|
||||
F7D4BF2F2CA2E8D800A5E746 /* TOPasscodeButtonLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = F7D4BF1C2CA2E8D800A5E746 /* TOPasscodeButtonLabel.m */; };
|
||||
F7D4BF302CA2E8D800A5E746 /* TOPasscodeViewControllerAnimatedTransitioning.m in Sources */ = {isa = PBXBuildFile; fileRef = F7D4BF072CA2E8D800A5E746 /* TOPasscodeViewControllerAnimatedTransitioning.m */; };
|
||||
F7D4BF312CA2E8D800A5E746 /* TOPasscodeSettingsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F7D4BF282CA2E8D800A5E746 /* TOPasscodeSettingsViewController.m */; };
|
||||
F7D4BF322CA2E8D800A5E746 /* TOPasscodeCircleImage.m in Sources */ = {isa = PBXBuildFile; fileRef = F7D4BF032CA2E8D800A5E746 /* TOPasscodeCircleImage.m */; };
|
||||
F7D4BF332CA2E8D800A5E746 /* TOPasscodeView.m in Sources */ = {isa = PBXBuildFile; fileRef = F7D4BF122CA2E8D800A5E746 /* TOPasscodeView.m */; };
|
||||
F7D4BF342CA2E8D800A5E746 /* TOPasscodeCircleButton.m in Sources */ = {isa = PBXBuildFile; fileRef = F7D4BF0E2CA2E8D800A5E746 /* TOPasscodeCircleButton.m */; };
|
||||
F7D4BF352CA2E8D800A5E746 /* TOPasscodeInputField.m in Sources */ = {isa = PBXBuildFile; fileRef = F7D4BF222CA2E8D800A5E746 /* TOPasscodeInputField.m */; };
|
||||
F7D4BF362CA2E8D800A5E746 /* TOSettingsKeypadImage.m in Sources */ = {isa = PBXBuildFile; fileRef = F7D4BF092CA2E8D800A5E746 /* TOSettingsKeypadImage.m */; };
|
||||
F7D4BF372CA2E8D800A5E746 /* TOPasscodeSettingsWarningLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = F7D4BF192CA2E8D800A5E746 /* TOPasscodeSettingsWarningLabel.m */; };
|
||||
F7D4BF382CA2E8D800A5E746 /* TOPasscodeVariableInputView.m in Sources */ = {isa = PBXBuildFile; fileRef = F7D4BF242CA2E8D800A5E746 /* TOPasscodeVariableInputView.m */; };
|
||||
F7D4BF392CA2E8D800A5E746 /* TOPasscodeCircleView.m in Sources */ = {isa = PBXBuildFile; fileRef = F7D4BF1E2CA2E8D800A5E746 /* TOPasscodeCircleView.m */; };
|
||||
F7D4BF3A2CA2E8D800A5E746 /* TOPasscodeViewContentLayout.m in Sources */ = {isa = PBXBuildFile; fileRef = F7D4BF052CA2E8D800A5E746 /* TOPasscodeViewContentLayout.m */; };
|
||||
F7D4BF3B2CA2E8D800A5E746 /* TOPasscodeSettingsKeypadButton.m in Sources */ = {isa = PBXBuildFile; fileRef = F7D4BF152CA2E8D800A5E746 /* TOPasscodeSettingsKeypadButton.m */; };
|
||||
F7D4BF3C2CA2E8D800A5E746 /* TOPasscodeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F7D4BF2A2CA2E8D800A5E746 /* TOPasscodeViewController.m */; };
|
||||
F7D4BF3D2CA2E8D800A5E746 /* TOPasscodeKeypadView.m in Sources */ = {isa = PBXBuildFile; fileRef = F7D4BF102CA2E8D800A5E746 /* TOPasscodeKeypadView.m */; };
|
||||
F7D4BF3E2CA2E8D800A5E746 /* TOPasscodeSettingsKeypadView.m in Sources */ = {isa = PBXBuildFile; fileRef = F7D4BF172CA2E8D800A5E746 /* TOPasscodeSettingsKeypadView.m */; };
|
||||
F7D4BF3F2CA2E8D800A5E746 /* TOPasscodeFixedInputView.m in Sources */ = {isa = PBXBuildFile; fileRef = F7D4BF202CA2E8D800A5E746 /* TOPasscodeFixedInputView.m */; };
|
||||
F7D4BF402CA2E8D800A5E746 /* TOPasscodeButtonLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = F7D4BF1C2CA2E8D800A5E746 /* TOPasscodeButtonLabel.m */; };
|
||||
F7D4BF412CA2E8D800A5E746 /* TOPasscodeViewControllerAnimatedTransitioning.m in Sources */ = {isa = PBXBuildFile; fileRef = F7D4BF072CA2E8D800A5E746 /* TOPasscodeViewControllerAnimatedTransitioning.m */; };
|
||||
F7D4BF422CA2E8D800A5E746 /* TOPasscodeSettingsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F7D4BF282CA2E8D800A5E746 /* TOPasscodeSettingsViewController.m */; };
|
||||
F7D4BF432CA2E8D800A5E746 /* TOPasscodeCircleImage.m in Sources */ = {isa = PBXBuildFile; fileRef = F7D4BF032CA2E8D800A5E746 /* TOPasscodeCircleImage.m */; };
|
||||
F7D4BF442CA2E8D800A5E746 /* TOPasscodeView.m in Sources */ = {isa = PBXBuildFile; fileRef = F7D4BF122CA2E8D800A5E746 /* TOPasscodeView.m */; };
|
||||
F7D4BF452CA2E8D800A5E746 /* TOPasscodeCircleButton.m in Sources */ = {isa = PBXBuildFile; fileRef = F7D4BF0E2CA2E8D800A5E746 /* TOPasscodeCircleButton.m */; };
|
||||
F7D4BF462CA2E8D800A5E746 /* TOPasscodeInputField.m in Sources */ = {isa = PBXBuildFile; fileRef = F7D4BF222CA2E8D800A5E746 /* TOPasscodeInputField.m */; };
|
||||
F7D4BF472CA2E8D800A5E746 /* TOSettingsKeypadImage.m in Sources */ = {isa = PBXBuildFile; fileRef = F7D4BF092CA2E8D800A5E746 /* TOSettingsKeypadImage.m */; };
|
||||
F7D4BF482CA2E8D800A5E746 /* TOPasscodeSettingsWarningLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = F7D4BF192CA2E8D800A5E746 /* TOPasscodeSettingsWarningLabel.m */; };
|
||||
F7D4BF492CA2E8D800A5E746 /* TOPasscodeVariableInputView.m in Sources */ = {isa = PBXBuildFile; fileRef = F7D4BF242CA2E8D800A5E746 /* TOPasscodeVariableInputView.m */; };
|
||||
F7D4BF4A2CA2E8D800A5E746 /* TOPasscodeCircleView.m in Sources */ = {isa = PBXBuildFile; fileRef = F7D4BF1E2CA2E8D800A5E746 /* TOPasscodeCircleView.m */; };
|
||||
F7D4BF4B2CA2E8D800A5E746 /* TOPasscodeViewContentLayout.m in Sources */ = {isa = PBXBuildFile; fileRef = F7D4BF052CA2E8D800A5E746 /* TOPasscodeViewContentLayout.m */; };
|
||||
F7D4BF4C2CA2E8D800A5E746 /* TOPasscodeSettingsKeypadButton.m in Sources */ = {isa = PBXBuildFile; fileRef = F7D4BF152CA2E8D800A5E746 /* TOPasscodeSettingsKeypadButton.m */; };
|
||||
F7D4BF4D2CA2E8D800A5E746 /* TOPasscodeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F7D4BF2A2CA2E8D800A5E746 /* TOPasscodeViewController.m */; };
|
||||
F7D4BF542CA2ED9D00A5E746 /* VLCKitSPM in Frameworks */ = {isa = PBXBuildFile; productRef = F7D4BF532CA2ED9D00A5E746 /* VLCKitSPM */; };
|
||||
F7D56B1A2972405500FA46C4 /* Mantis in Frameworks */ = {isa = PBXBuildFile; productRef = F7D56B192972405500FA46C4 /* Mantis */; };
|
||||
F7D60CAF2C941ACB008FBFDD /* NCMediaPinchGesture.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7D60CAE2C941ACB008FBFDD /* NCMediaPinchGesture.swift */; };
|
||||
@@ -1305,17 +1331,13 @@
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
131F8E2F43AD414E9DB53019 /* NCPasscodeModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCPasscodeModel.swift; sourceTree = "<group>"; };
|
||||
2C33C47F23E2C475005F963B /* Notification Service Extension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = "Notification Service Extension.appex"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
2C33C48123E2C475005F963B /* NotificationService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationService.swift; sourceTree = "<group>"; };
|
||||
2C33C48A23E2CC26005F963B /* Notification_Service_Extension-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Notification_Service_Extension-Bridging-Header.h"; sourceTree = "<group>"; };
|
||||
320C20803A58DAF7575440A8 /* NKErrorUserFriendlyMessageTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NKErrorUserFriendlyMessageTests.swift; sourceTree = "<group>"; };
|
||||
370D26AE248A3D7A00121797 /* NCCellMain.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCCellMain.swift; sourceTree = "<group>"; };
|
||||
439616AAA50F4360A761E5EF /* NCAlbumsPersistenceTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCAlbumsPersistenceTests.swift; sourceTree = "<group>"; };
|
||||
4B74B947E07444CC9CFE0A6C /* NCDocumentEditorSupportTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCDocumentEditorSupportTests.swift; sourceTree = "<group>"; };
|
||||
79DFE0BDF3898A66910E67CA /* NKError+UserFriendlyMessage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NKError+UserFriendlyMessage.swift"; sourceTree = "<group>"; };
|
||||
8932E90EC4278026D86CCCC9 /* NCContextMenuComment.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCContextMenuComment.swift; sourceTree = "<group>"; };
|
||||
A0C0DE0130E0000100C0D001 /* NCPasscodeWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCPasscodeWindow.swift; sourceTree = "<group>"; };
|
||||
A1E2EE010000000000000001 /* NCEndToEndKeySet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCEndToEndKeySet.swift; sourceTree = "<group>"; };
|
||||
A1E2EE010000000000000009 /* NCEndToEndKeySetArchiveTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCEndToEndKeySetArchiveTests.swift; sourceTree = "<group>"; };
|
||||
A1E2EE020000000000000001 /* NCEndToEndKeySetAccess.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCEndToEndKeySetAccess.swift; sourceTree = "<group>"; };
|
||||
@@ -1452,14 +1474,12 @@
|
||||
AFCE353827E5DE0400FEA6C2 /* Shareable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Shareable.swift; sourceTree = "<group>"; };
|
||||
B601AA002F10000100C0D3E5 /* NCLogFilesView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCLogFilesView.swift; sourceTree = "<group>"; };
|
||||
BB7697C94BA14450A0867940 /* NCContextMenuProfile.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCContextMenuProfile.swift; sourceTree = "<group>"; };
|
||||
BC6C501EF1104A6A8569D9C1 /* PasscodeUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PasscodeUITests.swift; sourceTree = "<group>"; };
|
||||
C0046CDA2A17B98400D87C9D /* NextcloudUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = NextcloudUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
C04E2F202A17BB4D001BAD85 /* NextcloudIntegrationTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = NextcloudIntegrationTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
C0DEA070306D000100000004 /* NCLocalDatabase+AutoUpload.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NCLocalDatabase+AutoUpload.swift"; sourceTree = "<group>"; };
|
||||
C0DEA070306D000100000007 /* NCAutoUploadAssetTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCAutoUploadAssetTests.swift; sourceTree = "<group>"; };
|
||||
C0DECA012F65000100C0D001 /* NCCameraRollTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCCameraRollTests.swift; sourceTree = "<group>"; };
|
||||
C0DEDA7E30C1000100A00001 /* NCAutoUploadDateTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCAutoUploadDateTests.swift; sourceTree = "<group>"; };
|
||||
CE0CD9A00D74B01055F238E9 /* NCErrorContext.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCErrorContext.swift; sourceTree = "<group>"; };
|
||||
D5B6AA7727200C7200D49C24 /* NCActivityTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCActivityTableViewCell.swift; sourceTree = "<group>"; };
|
||||
F0A1B2C330B5000100D4E5F6 /* NCMediaViewerFloatingTitleViewTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCMediaViewerFloatingTitleViewTests.swift; sourceTree = "<group>"; };
|
||||
F0A1B2C530B6000100D4E5F6 /* NCImageZoomViewTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCImageZoomViewTests.swift; sourceTree = "<group>"; };
|
||||
@@ -1486,6 +1506,7 @@
|
||||
F36C514D2E89393C0097E5F7 /* UIView+BlurVibrancy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIView+BlurVibrancy.swift"; sourceTree = "<group>"; };
|
||||
F36E64F62B9245210085ABB5 /* NCCollectionViewCommon+SelectTabBarDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NCCollectionViewCommon+SelectTabBarDelegate.swift"; sourceTree = "<group>"; };
|
||||
F37208742BAB4AB0006B5430 /* TestConstants.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestConstants.swift; sourceTree = "<group>"; };
|
||||
F3754A7C2CF87D600009312E /* SetupPasscodeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SetupPasscodeView.swift; sourceTree = "<group>"; };
|
||||
F389C9F42CEE383300049762 /* SelectAlbumView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SelectAlbumView.swift; sourceTree = "<group>"; };
|
||||
F38F71242B6BBDC300473CDC /* NCCollectionViewCommonSelectTabBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCCollectionViewCommonSelectTabBar.swift; sourceTree = "<group>"; };
|
||||
F39170A82CB8201B006127BC /* FileAutoRenamer+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "FileAutoRenamer+Extensions.swift"; sourceTree = "<group>"; };
|
||||
@@ -1604,6 +1625,7 @@
|
||||
F7346E2028B0FA3A006CE2D2 /* Widget-Brinding-header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Widget-Brinding-header.h"; sourceTree = "<group>"; };
|
||||
F7346E2228B0FEBA006CE2D2 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||
F7362A1E220C853A005101B5 /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = LaunchScreen.storyboard; sourceTree = "<group>"; };
|
||||
F737DA9C2B7B893C0063BAFC /* NCPasscode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCPasscode.swift; sourceTree = "<group>"; };
|
||||
F7381EDA218218C9000B1560 /* NCOffline.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCOffline.swift; sourceTree = "<group>"; };
|
||||
F7381EDE218218C9000B1560 /* NCOffline.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = NCOffline.storyboard; sourceTree = "<group>"; };
|
||||
F7386E452DA90E02009A00F6 /* NCAppVersionManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCAppVersionManager.swift; sourceTree = "<group>"; };
|
||||
@@ -2053,6 +2075,41 @@
|
||||
F7CF06822E11273F0063AD04 /* NCManageDatabase+CreateMetadata.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NCManageDatabase+CreateMetadata.swift"; sourceTree = "<group>"; };
|
||||
F7D1611F23CF19E30039EBBF /* NCViewerRichWorkspace.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = NCViewerRichWorkspace.storyboard; sourceTree = "<group>"; };
|
||||
F7D4BF002CA1831600A5E746 /* NCCollectionViewCommonPinchGesture.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCCollectionViewCommonPinchGesture.swift; sourceTree = "<group>"; };
|
||||
F7D4BF022CA2E8D800A5E746 /* TOPasscodeCircleImage.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TOPasscodeCircleImage.h; sourceTree = "<group>"; };
|
||||
F7D4BF032CA2E8D800A5E746 /* TOPasscodeCircleImage.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TOPasscodeCircleImage.m; sourceTree = "<group>"; };
|
||||
F7D4BF042CA2E8D800A5E746 /* TOPasscodeViewContentLayout.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TOPasscodeViewContentLayout.h; sourceTree = "<group>"; };
|
||||
F7D4BF052CA2E8D800A5E746 /* TOPasscodeViewContentLayout.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TOPasscodeViewContentLayout.m; sourceTree = "<group>"; };
|
||||
F7D4BF062CA2E8D800A5E746 /* TOPasscodeViewControllerAnimatedTransitioning.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TOPasscodeViewControllerAnimatedTransitioning.h; sourceTree = "<group>"; };
|
||||
F7D4BF072CA2E8D800A5E746 /* TOPasscodeViewControllerAnimatedTransitioning.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TOPasscodeViewControllerAnimatedTransitioning.m; sourceTree = "<group>"; };
|
||||
F7D4BF082CA2E8D800A5E746 /* TOSettingsKeypadImage.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TOSettingsKeypadImage.h; sourceTree = "<group>"; };
|
||||
F7D4BF092CA2E8D800A5E746 /* TOSettingsKeypadImage.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TOSettingsKeypadImage.m; sourceTree = "<group>"; };
|
||||
F7D4BF0B2CA2E8D800A5E746 /* TOPasscodeViewControllerConstants.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TOPasscodeViewControllerConstants.h; sourceTree = "<group>"; };
|
||||
F7D4BF0D2CA2E8D800A5E746 /* TOPasscodeCircleButton.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TOPasscodeCircleButton.h; sourceTree = "<group>"; };
|
||||
F7D4BF0E2CA2E8D800A5E746 /* TOPasscodeCircleButton.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TOPasscodeCircleButton.m; sourceTree = "<group>"; };
|
||||
F7D4BF0F2CA2E8D800A5E746 /* TOPasscodeKeypadView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TOPasscodeKeypadView.h; sourceTree = "<group>"; };
|
||||
F7D4BF102CA2E8D800A5E746 /* TOPasscodeKeypadView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TOPasscodeKeypadView.m; sourceTree = "<group>"; };
|
||||
F7D4BF112CA2E8D800A5E746 /* TOPasscodeView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TOPasscodeView.h; sourceTree = "<group>"; };
|
||||
F7D4BF122CA2E8D800A5E746 /* TOPasscodeView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TOPasscodeView.m; sourceTree = "<group>"; };
|
||||
F7D4BF142CA2E8D800A5E746 /* TOPasscodeSettingsKeypadButton.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TOPasscodeSettingsKeypadButton.h; sourceTree = "<group>"; };
|
||||
F7D4BF152CA2E8D800A5E746 /* TOPasscodeSettingsKeypadButton.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TOPasscodeSettingsKeypadButton.m; sourceTree = "<group>"; };
|
||||
F7D4BF162CA2E8D800A5E746 /* TOPasscodeSettingsKeypadView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TOPasscodeSettingsKeypadView.h; sourceTree = "<group>"; };
|
||||
F7D4BF172CA2E8D800A5E746 /* TOPasscodeSettingsKeypadView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TOPasscodeSettingsKeypadView.m; sourceTree = "<group>"; };
|
||||
F7D4BF182CA2E8D800A5E746 /* TOPasscodeSettingsWarningLabel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TOPasscodeSettingsWarningLabel.h; sourceTree = "<group>"; };
|
||||
F7D4BF192CA2E8D800A5E746 /* TOPasscodeSettingsWarningLabel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TOPasscodeSettingsWarningLabel.m; sourceTree = "<group>"; };
|
||||
F7D4BF1B2CA2E8D800A5E746 /* TOPasscodeButtonLabel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TOPasscodeButtonLabel.h; sourceTree = "<group>"; };
|
||||
F7D4BF1C2CA2E8D800A5E746 /* TOPasscodeButtonLabel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TOPasscodeButtonLabel.m; sourceTree = "<group>"; };
|
||||
F7D4BF1D2CA2E8D800A5E746 /* TOPasscodeCircleView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TOPasscodeCircleView.h; sourceTree = "<group>"; };
|
||||
F7D4BF1E2CA2E8D800A5E746 /* TOPasscodeCircleView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TOPasscodeCircleView.m; sourceTree = "<group>"; };
|
||||
F7D4BF1F2CA2E8D800A5E746 /* TOPasscodeFixedInputView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TOPasscodeFixedInputView.h; sourceTree = "<group>"; };
|
||||
F7D4BF202CA2E8D800A5E746 /* TOPasscodeFixedInputView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TOPasscodeFixedInputView.m; sourceTree = "<group>"; };
|
||||
F7D4BF212CA2E8D800A5E746 /* TOPasscodeInputField.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TOPasscodeInputField.h; sourceTree = "<group>"; };
|
||||
F7D4BF222CA2E8D800A5E746 /* TOPasscodeInputField.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TOPasscodeInputField.m; sourceTree = "<group>"; };
|
||||
F7D4BF232CA2E8D800A5E746 /* TOPasscodeVariableInputView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TOPasscodeVariableInputView.h; sourceTree = "<group>"; };
|
||||
F7D4BF242CA2E8D800A5E746 /* TOPasscodeVariableInputView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TOPasscodeVariableInputView.m; sourceTree = "<group>"; };
|
||||
F7D4BF272CA2E8D800A5E746 /* TOPasscodeSettingsViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TOPasscodeSettingsViewController.h; sourceTree = "<group>"; };
|
||||
F7D4BF282CA2E8D800A5E746 /* TOPasscodeSettingsViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TOPasscodeSettingsViewController.m; sourceTree = "<group>"; };
|
||||
F7D4BF292CA2E8D800A5E746 /* TOPasscodeViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TOPasscodeViewController.h; sourceTree = "<group>"; };
|
||||
F7D4BF2A2CA2E8D800A5E746 /* TOPasscodeViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TOPasscodeViewController.m; sourceTree = "<group>"; };
|
||||
F7D532461F5D4123006568B1 /* is */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = is; path = is.lproj/Localizable.strings; sourceTree = "<group>"; };
|
||||
F7D5324D1F5D4137006568B1 /* nl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nl; path = nl.lproj/Localizable.strings; sourceTree = "<group>"; };
|
||||
F7D532541F5D4155006568B1 /* sk-SK */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "sk-SK"; path = "sk-SK.lproj/Localizable.strings"; sourceTree = "<group>"; };
|
||||
@@ -2104,7 +2161,6 @@
|
||||
F7FDFF592E437E55000D7688 /* NCAccount.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCAccount.swift; sourceTree = "<group>"; };
|
||||
F7FF2CB02842159500EBB7A1 /* NCSectionHeader.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = NCSectionHeader.xib; sourceTree = "<group>"; };
|
||||
F7FFFC9D2FB300440015441E /* NCAssistantSharedTextStore.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCAssistantSharedTextStore.swift; sourceTree = "<group>"; };
|
||||
F902B24E44354B6D9F329F12 /* NCPasscodeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCPasscodeView.swift; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFileSystemSynchronizedRootGroup section */
|
||||
@@ -2332,7 +2388,6 @@
|
||||
children = (
|
||||
AC13ADAF2026101300000001 /* NCMediaAdaptiveLayoutViewTests.swift */,
|
||||
C0DEDA7E30C1000100A00001 /* NCAutoUploadDateTests.swift */,
|
||||
320C20803A58DAF7575440A8 /* NKErrorUserFriendlyMessageTests.swift */,
|
||||
C0DEA070306D000100000007 /* NCAutoUploadAssetTests.swift */,
|
||||
F76BED7B306D0000002E1442 /* NCPhotoLibraryAssetTests.swift */,
|
||||
A1E2EE010000000000000009 /* NCEndToEndKeySetArchiveTests.swift */,
|
||||
@@ -2384,21 +2439,10 @@
|
||||
path = Advanced;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
B6DE60601BB3410D92EB99EC /* Passcode */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
131F8E2F43AD414E9DB53019 /* NCPasscodeModel.swift */,
|
||||
A0C0DE0130E0000100C0D001 /* NCPasscodeWindow.swift */,
|
||||
F902B24E44354B6D9F329F12 /* NCPasscodeView.swift */,
|
||||
);
|
||||
path = Passcode;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
C0046CDB2A17B98400D87C9D /* NextcloudUITests */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F3374A952D6744A4002A38F9 /* BaseUIXCTestCase.swift */,
|
||||
BC6C501EF1104A6A8569D9C1 /* PasscodeUITests.swift */,
|
||||
AABD0C882D5F631600F009E6 /* Extensions */,
|
||||
AA3C85E92D36BBDE00F74F12 /* UITestBackend */,
|
||||
AA8E03DB2D2FBAAD00E7E89C /* DownloadLimitUITests.swift */,
|
||||
@@ -2537,6 +2581,7 @@
|
||||
F7A03E342D427308007AA677 /* NCMainNavigationController.swift */,
|
||||
F794E13C2BBBFF2E003693D7 /* NCMainTabBarController.swift */,
|
||||
F75A64A3307DFB9E0059B78E /* NCMainTabBarController+Sidebar.swift */,
|
||||
F737DA9C2B7B893C0063BAFC /* NCPasscode.swift */,
|
||||
F77444F7222816D5000D5EB0 /* NCPickerViewController.swift */,
|
||||
F75A64A1307DFB870059B78E /* NCSidebarView.swift */,
|
||||
);
|
||||
@@ -2769,8 +2814,6 @@
|
||||
F785129A2D79899E0087DDD0 /* NCNetworking+TermsOfService.swift */,
|
||||
F71916102E2901E800E13E96 /* NCNetworking+Upload.swift */,
|
||||
F7327E2F2B73A86700A462C7 /* NCNetworking+WebDAV.swift */,
|
||||
79DFE0BDF3898A66910E67CA /* NKError+UserFriendlyMessage.swift */,
|
||||
CE0CD9A00D74B01055F238E9 /* NCErrorContext.swift */,
|
||||
F70D8D8024A4A9BF000A5756 /* NCNetworkingProcess.swift */,
|
||||
F755BD9A20594AC7008C5FBB /* NCService.swift */,
|
||||
);
|
||||
@@ -3185,6 +3228,7 @@
|
||||
children = (
|
||||
F76882112C0DD1E7001CF441 /* NCSettingsModel.swift */,
|
||||
F768820C2C0DD1E7001CF441 /* NCSettingsView.swift */,
|
||||
F3754A7C2CF87D600009312E /* SetupPasscodeView.swift */,
|
||||
);
|
||||
path = Settings;
|
||||
sourceTree = "<group>";
|
||||
@@ -3573,7 +3617,6 @@
|
||||
F7BFFA991A24D7BB0044ED85 /* Utility */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
B6DE60601BB3410D92EB99EC /* Passcode */,
|
||||
F39170A82CB8201B006127BC /* FileAutoRenamer+Extensions.swift */,
|
||||
F33918C32C7CD8F2002D9AA1 /* FileNameValidator+Extensions.swift */,
|
||||
F752BA042E58C05200616A26 /* Maintenance.swift */,
|
||||
@@ -3597,6 +3640,7 @@
|
||||
F3E173BE2C9B1057006D177A /* ScreenAwakeManager */,
|
||||
F71F6D062B6A6A5E00F1EB15 /* ThreadSafeArray.swift */,
|
||||
F7245923289BB50B00474787 /* ThreadSafeDictionary.swift */,
|
||||
F7D4BF2B2CA2E8D800A5E746 /* TOPasscodeViewController */,
|
||||
);
|
||||
path = Utility;
|
||||
sourceTree = "<group>";
|
||||
@@ -3686,6 +3730,96 @@
|
||||
path = RichWorkspace;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F7D4BF0A2CA2E8D800A5E746 /* Models */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F7D4BF022CA2E8D800A5E746 /* TOPasscodeCircleImage.h */,
|
||||
F7D4BF032CA2E8D800A5E746 /* TOPasscodeCircleImage.m */,
|
||||
F7D4BF042CA2E8D800A5E746 /* TOPasscodeViewContentLayout.h */,
|
||||
F7D4BF052CA2E8D800A5E746 /* TOPasscodeViewContentLayout.m */,
|
||||
F7D4BF062CA2E8D800A5E746 /* TOPasscodeViewControllerAnimatedTransitioning.h */,
|
||||
F7D4BF072CA2E8D800A5E746 /* TOPasscodeViewControllerAnimatedTransitioning.m */,
|
||||
F7D4BF082CA2E8D800A5E746 /* TOSettingsKeypadImage.h */,
|
||||
F7D4BF092CA2E8D800A5E746 /* TOSettingsKeypadImage.m */,
|
||||
);
|
||||
path = Models;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F7D4BF0C2CA2E8D800A5E746 /* Supporting */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F7D4BF0B2CA2E8D800A5E746 /* TOPasscodeViewControllerConstants.h */,
|
||||
);
|
||||
path = Supporting;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F7D4BF132CA2E8D800A5E746 /* Main */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F7D4BF0D2CA2E8D800A5E746 /* TOPasscodeCircleButton.h */,
|
||||
F7D4BF0E2CA2E8D800A5E746 /* TOPasscodeCircleButton.m */,
|
||||
F7D4BF0F2CA2E8D800A5E746 /* TOPasscodeKeypadView.h */,
|
||||
F7D4BF102CA2E8D800A5E746 /* TOPasscodeKeypadView.m */,
|
||||
F7D4BF112CA2E8D800A5E746 /* TOPasscodeView.h */,
|
||||
F7D4BF122CA2E8D800A5E746 /* TOPasscodeView.m */,
|
||||
);
|
||||
path = Main;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F7D4BF1A2CA2E8D800A5E746 /* Settings */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F7D4BF142CA2E8D800A5E746 /* TOPasscodeSettingsKeypadButton.h */,
|
||||
F7D4BF152CA2E8D800A5E746 /* TOPasscodeSettingsKeypadButton.m */,
|
||||
F7D4BF162CA2E8D800A5E746 /* TOPasscodeSettingsKeypadView.h */,
|
||||
F7D4BF172CA2E8D800A5E746 /* TOPasscodeSettingsKeypadView.m */,
|
||||
F7D4BF182CA2E8D800A5E746 /* TOPasscodeSettingsWarningLabel.h */,
|
||||
F7D4BF192CA2E8D800A5E746 /* TOPasscodeSettingsWarningLabel.m */,
|
||||
);
|
||||
path = Settings;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F7D4BF252CA2E8D800A5E746 /* Shared */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F7D4BF1B2CA2E8D800A5E746 /* TOPasscodeButtonLabel.h */,
|
||||
F7D4BF1C2CA2E8D800A5E746 /* TOPasscodeButtonLabel.m */,
|
||||
F7D4BF1D2CA2E8D800A5E746 /* TOPasscodeCircleView.h */,
|
||||
F7D4BF1E2CA2E8D800A5E746 /* TOPasscodeCircleView.m */,
|
||||
F7D4BF1F2CA2E8D800A5E746 /* TOPasscodeFixedInputView.h */,
|
||||
F7D4BF202CA2E8D800A5E746 /* TOPasscodeFixedInputView.m */,
|
||||
F7D4BF212CA2E8D800A5E746 /* TOPasscodeInputField.h */,
|
||||
F7D4BF222CA2E8D800A5E746 /* TOPasscodeInputField.m */,
|
||||
F7D4BF232CA2E8D800A5E746 /* TOPasscodeVariableInputView.h */,
|
||||
F7D4BF242CA2E8D800A5E746 /* TOPasscodeVariableInputView.m */,
|
||||
);
|
||||
path = Shared;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F7D4BF262CA2E8D800A5E746 /* Views */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F7D4BF132CA2E8D800A5E746 /* Main */,
|
||||
F7D4BF1A2CA2E8D800A5E746 /* Settings */,
|
||||
F7D4BF252CA2E8D800A5E746 /* Shared */,
|
||||
);
|
||||
path = Views;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F7D4BF2B2CA2E8D800A5E746 /* TOPasscodeViewController */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
F7D4BF0A2CA2E8D800A5E746 /* Models */,
|
||||
F7D4BF0C2CA2E8D800A5E746 /* Supporting */,
|
||||
F7D4BF262CA2E8D800A5E746 /* Views */,
|
||||
F7D4BF272CA2E8D800A5E746 /* TOPasscodeSettingsViewController.h */,
|
||||
F7D4BF282CA2E8D800A5E746 /* TOPasscodeSettingsViewController.m */,
|
||||
F7D4BF292CA2E8D800A5E746 /* TOPasscodeViewController.h */,
|
||||
F7D4BF2A2CA2E8D800A5E746 /* TOPasscodeViewController.m */,
|
||||
);
|
||||
path = TOPasscodeViewController;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
F7DFB7E9219C5A0500680748 /* Create */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -4717,7 +4851,6 @@
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
BAF64949B487A080A98F83F2 /* NKErrorUserFriendlyMessageTests.swift in Sources */,
|
||||
AC13ADAF2026101300000002 /* NCMediaAdaptiveLayoutViewTests.swift in Sources */,
|
||||
C0DEDA7E30C1000100A00002 /* NCAutoUploadDateTests.swift in Sources */,
|
||||
C0DEA070306D000100000008 /* NCAutoUploadAssetTests.swift in Sources */,
|
||||
@@ -4753,7 +4886,6 @@
|
||||
AAA7BC2E2D3E39F1008F1A22 /* CapabilitiesResponse.swift in Sources */,
|
||||
AA3C85F22D394B3A00F74F12 /* DownloadLimitResponse.swift in Sources */,
|
||||
F3374A962D6744A4002A38F9 /* BaseUIXCTestCase.swift in Sources */,
|
||||
D56DFFE5D5014F66A7C9FED0 /* PasscodeUITests.swift in Sources */,
|
||||
F37208812BAB5979006B5430 /* TestConstants.swift in Sources */,
|
||||
F33D303E2D8B129600531D64 /* AutoUploadUITests.swift in Sources */,
|
||||
);
|
||||
@@ -4812,8 +4944,6 @@
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
2EF7D3FD0885CE182717578E /* NKError+UserFriendlyMessage.swift in Sources */,
|
||||
EB511D22564B7B9A605E70AE /* NCErrorContext.swift in Sources */,
|
||||
F7864ACF2A78FE73004870E0 /* NCManageDatabase+LocalFile.swift in Sources */,
|
||||
F71F6D0A2B6A6A5E00F1EB15 /* ThreadSafeArray.swift in Sources */,
|
||||
F7245925289BB59100474787 /* ThreadSafeDictionary.swift in Sources */,
|
||||
@@ -4861,15 +4991,32 @@
|
||||
F711A4DF2AF92CAE00095DD8 /* NCUtility+Date.swift in Sources */,
|
||||
F78295311F962EFA00A572F5 /* NCEndToEndEncryption.m in Sources */,
|
||||
F7C30DFE291BD0B80017149B /* NCNetworkingE2EEDelete.swift in Sources */,
|
||||
F7D4BF2C2CA2E8D800A5E746 /* TOPasscodeKeypadView.m in Sources */,
|
||||
F7C630802FFE4F8000257EEB /* UIWindowScene+Extension.swift in Sources */,
|
||||
F7D4BF2D2CA2E8D800A5E746 /* TOPasscodeSettingsKeypadView.m in Sources */,
|
||||
F7D4BF2E2CA2E8D800A5E746 /* TOPasscodeFixedInputView.m in Sources */,
|
||||
F7D61EA92EBF1694007F865B /* NCManageDatabase+TableCapabilities.swift in Sources */,
|
||||
F7D4BF2F2CA2E8D800A5E746 /* TOPasscodeButtonLabel.m in Sources */,
|
||||
F7D4BF302CA2E8D800A5E746 /* TOPasscodeViewControllerAnimatedTransitioning.m in Sources */,
|
||||
F7D4BF312CA2E8D800A5E746 /* TOPasscodeSettingsViewController.m in Sources */,
|
||||
F71916122E2901FB00E13E96 /* NCNetworking+Upload.swift in Sources */,
|
||||
F73BC74F2F23811E003170C2 /* WarningBannerView.swift in Sources */,
|
||||
F7D4BF322CA2E8D800A5E746 /* TOPasscodeCircleImage.m in Sources */,
|
||||
F7CAFE192F168F6000DB35A5 /* NCDebouncer.swift in Sources */,
|
||||
F7D4BF332CA2E8D800A5E746 /* TOPasscodeView.m in Sources */,
|
||||
F77E8C252E79717D00EAE68F /* NCManageDatabase+LivePhoto.swift in Sources */,
|
||||
F7D4BF342CA2E8D800A5E746 /* TOPasscodeCircleButton.m in Sources */,
|
||||
F7D4BF352CA2E8D800A5E746 /* TOPasscodeInputField.m in Sources */,
|
||||
F7D4BF362CA2E8D800A5E746 /* TOSettingsKeypadImage.m in Sources */,
|
||||
F7D4BF372CA2E8D800A5E746 /* TOPasscodeSettingsWarningLabel.m in Sources */,
|
||||
F7D4BF382CA2E8D800A5E746 /* TOPasscodeVariableInputView.m in Sources */,
|
||||
F7D4BF392CA2E8D800A5E746 /* TOPasscodeCircleView.m in Sources */,
|
||||
F7D4BF3A2CA2E8D800A5E746 /* TOPasscodeViewContentLayout.m in Sources */,
|
||||
F79792482F5EECE100FE9544 /* Font+Extension.swift in Sources */,
|
||||
F751760B307F53680057C9B0 /* NCMediaViewerTransitionSource.swift in Sources */,
|
||||
F7D61EBF2EBF1878007F865B /* NCManageDatabase+Tag.swift in Sources */,
|
||||
F7D4BF3B2CA2E8D800A5E746 /* TOPasscodeSettingsKeypadButton.m in Sources */,
|
||||
F7D4BF3C2CA2E8D800A5E746 /* TOPasscodeViewController.m in Sources */,
|
||||
F74AF3A5247FB6AE00AC767B /* NCUtilityFileSystem.swift in Sources */,
|
||||
AF1A9B6527D0CC0500F17A9E /* UIAlertController+Extension.swift in Sources */,
|
||||
AF22B206277B4E4C00DAB0CC /* NCCreateFormUploadConflict.swift in Sources */,
|
||||
@@ -4911,8 +5058,7 @@
|
||||
F757CC8529E7F88B00F31428 /* NCManageDatabase+Groupfolders.swift in Sources */,
|
||||
F768823A2C0DD230001CF441 /* NCPreferences.swift in Sources */,
|
||||
A1E2EE010000000000000004 /* NCEndToEndKeySet.swift in Sources */,
|
||||
87768C6AB8E040219DF85898 /* NCPasscodeModel.swift in Sources */,
|
||||
9310075861174A62B1C9FED6 /* NCPasscodeView.swift in Sources */,
|
||||
F737DA9E2B7B893C0063BAFC /* NCPasscode.swift in Sources */,
|
||||
F7C30DF7291BC0D30017149B /* NCNetworkingE2EEUpload.swift in Sources */,
|
||||
F7C687EC2D22BDE5004757BC /* NCManageDatabase+RecommendedFiles.swift in Sources */,
|
||||
F33918C72C7CD8F2002D9AA1 /* FileNameValidator+Extensions.swift in Sources */,
|
||||
@@ -5060,8 +5206,6 @@
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
822D68B06B101563A759AD59 /* NKError+UserFriendlyMessage.swift in Sources */,
|
||||
A358B569BF5FDABA6D9012D1 /* NCErrorContext.swift in Sources */,
|
||||
F76BED77306D0000002E1442 /* NCLocalDatabase.swift in Sources */,
|
||||
F76BED78306D0000002E1442 /* NCLocalDatabaseMigrator.swift in Sources */,
|
||||
F76BED7C306D0000002E1442 /* NCLocalDatabase+PhotoLibraryAsset.swift in Sources */,
|
||||
@@ -5088,6 +5232,7 @@
|
||||
F768822C2C0DD1E7001CF441 /* NCPreferences.swift in Sources */,
|
||||
A1E2EE010000000000000007 /* NCEndToEndKeySet.swift in Sources */,
|
||||
F7CAFE1D2F17A35F00DB35A5 /* ProgressQuantizer.swift in Sources */,
|
||||
F3754A7D2CF87D600009312E /* SetupPasscodeView.swift in Sources */,
|
||||
F73EF7D72B0226080087E6E9 /* NCManageDatabase+Tip.swift in Sources */,
|
||||
F3374A842D64AC31002A38F9 /* AssistantLabelStyle.swift in Sources */,
|
||||
F74BAE172C7E2F4E0028D4FA /* FileProviderDomain.swift in Sources */,
|
||||
@@ -5185,13 +5330,30 @@
|
||||
F77A6B30301112C5007103E6 /* NCMediaSectionHeader.swift in Sources */,
|
||||
F794E13D2BBBFF2E003693D7 /* NCMainTabBarController.swift in Sources */,
|
||||
F7CBC1252BAC8B0000EC1D55 /* NCSectionFirstHeaderEmptyData.swift in Sources */,
|
||||
F7D4BF3D2CA2E8D800A5E746 /* TOPasscodeKeypadView.m in Sources */,
|
||||
F7D4BF3E2CA2E8D800A5E746 /* TOPasscodeSettingsKeypadView.m in Sources */,
|
||||
F7132C722D085AD200B42D6A /* NCTermOfServiceModel.swift in Sources */,
|
||||
F7132C732D085AD200B42D6A /* NCTermOfServiceView.swift in Sources */,
|
||||
F7A08A7C3017441D00470AD3 /* NCMedia+SelectDelegate.swift in Sources */,
|
||||
F7D4BF3F2CA2E8D800A5E746 /* TOPasscodeFixedInputView.m in Sources */,
|
||||
F7D4BF402CA2E8D800A5E746 /* TOPasscodeButtonLabel.m in Sources */,
|
||||
F70898692EDDB51700EF85BD /* NCSelectOpen+SelectDelegate.swift in Sources */,
|
||||
F7D4BF412CA2E8D800A5E746 /* TOPasscodeViewControllerAnimatedTransitioning.m in Sources */,
|
||||
F7D4BF422CA2E8D800A5E746 /* TOPasscodeSettingsViewController.m in Sources */,
|
||||
F7D4BF432CA2E8D800A5E746 /* TOPasscodeCircleImage.m in Sources */,
|
||||
F78026102E9CFA3700B63436 /* NCTransfersView.swift in Sources */,
|
||||
F7D4BF442CA2E8D800A5E746 /* TOPasscodeView.m in Sources */,
|
||||
F7D4BF452CA2E8D800A5E746 /* TOPasscodeCircleButton.m in Sources */,
|
||||
F7D4BF462CA2E8D800A5E746 /* TOPasscodeInputField.m in Sources */,
|
||||
F7D4BF472CA2E8D800A5E746 /* TOSettingsKeypadImage.m in Sources */,
|
||||
F7D4BF482CA2E8D800A5E746 /* TOPasscodeSettingsWarningLabel.m in Sources */,
|
||||
F3A0B1F12EC76FE800F10B82 /* NCUserStatusModel.swift in Sources */,
|
||||
F3A0B1F22EC76FE800F10B82 /* NCUserStatusView.swift in Sources */,
|
||||
F7D4BF492CA2E8D800A5E746 /* TOPasscodeVariableInputView.m in Sources */,
|
||||
F7D4BF4A2CA2E8D800A5E746 /* TOPasscodeCircleView.m in Sources */,
|
||||
F7D4BF4B2CA2E8D800A5E746 /* TOPasscodeViewContentLayout.m in Sources */,
|
||||
F7D4BF4C2CA2E8D800A5E746 /* TOPasscodeSettingsKeypadButton.m in Sources */,
|
||||
F7D4BF4D2CA2E8D800A5E746 /* TOPasscodeViewController.m in Sources */,
|
||||
AAE330042D2ED20200B04903 /* NCShareNavigationTitleSetting.swift in Sources */,
|
||||
F71CFA672F2A07DB007A3AE9 /* NCMediaNetwork.swift in Sources */,
|
||||
F7DF7B422F1A36C100514020 /* HelperBanner.swift in Sources */,
|
||||
@@ -5410,9 +5572,7 @@
|
||||
F79792472F5EECE100FE9544 /* Font+Extension.swift in Sources */,
|
||||
F768822A2C0DD1E7001CF441 /* NCSettingsModel.swift in Sources */,
|
||||
F7BCE48E301091EA00876F4D /* NCMediaDatePickerViewController.swift in Sources */,
|
||||
9F0E3B428AB44A6480190C2D /* NCPasscodeModel.swift in Sources */,
|
||||
7670DABED44E4D56AD99E6DC /* NCPasscodeView.swift in Sources */,
|
||||
A0C0DE0230E0000100C0D001 /* NCPasscodeWindow.swift in Sources */,
|
||||
F737DA9D2B7B893C0063BAFC /* NCPasscode.swift in Sources */,
|
||||
F77C97392953131000FDDD09 /* NCCameraRoll.swift in Sources */,
|
||||
F7CADEFD2EA159210057849E /* NCMetadataUploadTranfersSuccess.swift in Sources */,
|
||||
F343A4B32A1E01FF00DDA874 /* PHAsset+Extension.swift in Sources */,
|
||||
@@ -6679,7 +6839,7 @@
|
||||
"@executable_path/Frameworks",
|
||||
"@executable_path/../../Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 35.2.2;
|
||||
MARKETING_VERSION = 35.2.1;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
OTHER_CFLAGS = "-v";
|
||||
OTHER_LDFLAGS = "";
|
||||
@@ -6745,7 +6905,7 @@
|
||||
"@executable_path/Frameworks",
|
||||
"@executable_path/../../Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 35.2.2;
|
||||
MARKETING_VERSION = 35.2.1;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
OTHER_CFLAGS = "-v";
|
||||
OTHER_LDFLAGS = "";
|
||||
@@ -7008,7 +7168,7 @@
|
||||
repositoryURL = "https://github.com/apple/swift-nio-ssl";
|
||||
requirement = {
|
||||
kind = upToNextMajorVersion;
|
||||
minimumVersion = 2.37.5;
|
||||
minimumVersion = 2.26.0;
|
||||
};
|
||||
};
|
||||
F33EE6EE2BF4C0FF00CA1A51 /* XCRemoteSwiftPackageReference "swift-nio" */ = {
|
||||
@@ -7120,7 +7280,7 @@
|
||||
repositoryURL = "https://github.com/nextcloud/NextcloudKit";
|
||||
requirement = {
|
||||
kind = exactVersion;
|
||||
version = 7.6.4;
|
||||
version = 7.6.2;
|
||||
};
|
||||
};
|
||||
F788ECC5263AAAF900ADC67F /* XCRemoteSwiftPackageReference "MarkdownKit" */ = {
|
||||
|
||||
@@ -204,8 +204,8 @@
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/nextcloud/NextcloudKit",
|
||||
"state" : {
|
||||
"revision" : "49eee789ab676d6aba0020ccbe0d850f62e1d449",
|
||||
"version" : "7.6.4"
|
||||
"revision" : "705e69cf0526cac0bdeaf21699c41c895cae42a0",
|
||||
"version" : "7.6.2"
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -294,8 +294,8 @@
|
||||
"kind" : "remoteSourceControl",
|
||||
"location" : "https://github.com/apple/swift-nio-ssl",
|
||||
"state" : {
|
||||
"revision" : "322f3c2a4a21df31c84ca416bf65ee5e9059e440",
|
||||
"version" : "2.37.5"
|
||||
"revision" : "03827c1a9fdb2b6b00a4e93ede8861520263af8c",
|
||||
"version" : "2.37.4"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
@@ -65,8 +65,6 @@
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
language = "en"
|
||||
region = "US"
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
|
||||
@@ -61,6 +61,12 @@ precedence = "aggregate"
|
||||
SPDX-FileCopyrightText = "Nextcloud GmbH"
|
||||
SPDX-License-Identifier = "LicenseRef-NextcloudTrademarks"
|
||||
|
||||
[[annotations]]
|
||||
path = ["iOSClient/Utility/TOPasscodeViewController/**"]
|
||||
precedence = "aggregate"
|
||||
SPDX-FileCopyrightText = "2017 Timothy Oliver"
|
||||
SPDX-License-Identifier = "MIT"
|
||||
|
||||
[[annotations]]
|
||||
path = ["iOSClient/Utility/NYMnemonic/**"]
|
||||
precedence = "aggregate"
|
||||
|
||||
@@ -60,8 +60,8 @@ extension NCShareExtension {
|
||||
if resultsReadFolder.error == .success {
|
||||
self.metadataFolder = resultsReadFolder.metadataFolder
|
||||
await self.reloadData()
|
||||
} else if let message = resultsReadFolder.error.userFriendlyMessage() {
|
||||
self.showAlert(description: message)
|
||||
} else {
|
||||
self.showAlert(description: resultsReadFolder.error.errorDescription)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,8 +53,6 @@ class NCShareExtension: UIViewController {
|
||||
var banner: LucidBanner?
|
||||
var sceneIdentifier: String = UUID().uuidString
|
||||
private var isPresentingNoAccountAlert = false
|
||||
private var isPresentingPasscode = false
|
||||
private var isPasscodeAuthenticated = false
|
||||
|
||||
// MARK: - View Life Cycle
|
||||
|
||||
@@ -112,8 +110,11 @@ class NCShareExtension: UIViewController {
|
||||
return
|
||||
}
|
||||
|
||||
self.isPasscodeAuthenticated = false
|
||||
self.requestPasscodeIfNeeded()
|
||||
if NCPreferences().presentPasscode {
|
||||
NCPasscode.shared.presentPasscode(viewController: self, delegate: self) {
|
||||
NCPasscode.shared.enableTouchFaceID()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Verify version
|
||||
@@ -164,7 +165,11 @@ class NCShareExtension: UIViewController {
|
||||
}
|
||||
}
|
||||
|
||||
self.requestPasscodeIfNeeded()
|
||||
if NCPreferences().presentPasscode {
|
||||
NCPasscode.shared.presentPasscode(viewController: self, delegate: self) {
|
||||
NCPasscode.shared.enableTouchFaceID()
|
||||
}
|
||||
}
|
||||
|
||||
self.collectionView.reloadData()
|
||||
}
|
||||
@@ -184,7 +189,7 @@ class NCShareExtension: UIViewController {
|
||||
}
|
||||
|
||||
private func validateAccount() -> Bool {
|
||||
guard !NCPasscodeModel.isPasscodeReset else {
|
||||
guard !NCPasscode.shared.isPasscodeReset else {
|
||||
return showNoAccountAlert()
|
||||
}
|
||||
|
||||
@@ -339,15 +344,13 @@ class NCShareExtension: UIViewController {
|
||||
guard let capabilities = NCNetworking.shared.capabilities[session.account] else {
|
||||
return
|
||||
}
|
||||
let alertController = UIAlertController.createFolderWith(serverUrl: serverUrl, session: session, capabilities: capabilities) { error, folderName in
|
||||
let context = NCErrorContext.createFolder(folderName: folderName)
|
||||
|
||||
let alertController = UIAlertController.createFolderWith(serverUrl: serverUrl, session: session, capabilities: capabilities) { error in
|
||||
if error == .success {
|
||||
Task {
|
||||
await self.loadFolder()
|
||||
}
|
||||
} else if let message = error.userFriendlyMessage(for: context) {
|
||||
self.showAlert(title: context.failureTitle ?? "_error_", description: message)
|
||||
} else {
|
||||
self.showAlert(title: "_error_createsubfolders_upload_", description: error.errorDescription)
|
||||
}
|
||||
}
|
||||
self.present(alertController, animated: true)
|
||||
@@ -441,7 +444,6 @@ extension NCShareExtension {
|
||||
await NCNetworkingE2EE.beginNewServerKeyValidationCycle()
|
||||
|
||||
var error: NKError?
|
||||
var errorContext: NCErrorContext = .generic
|
||||
guard let window = self.view.window else {
|
||||
return
|
||||
}
|
||||
@@ -466,7 +468,6 @@ extension NCShareExtension {
|
||||
|
||||
error = await self.upload(metadata: metadata)
|
||||
if error != .success {
|
||||
errorContext = .upload(fileName: metadata.fileNameView)
|
||||
break
|
||||
}
|
||||
}
|
||||
@@ -474,11 +475,7 @@ extension NCShareExtension {
|
||||
if error == .success {
|
||||
banner?.update(payload: LucidBannerPayload.Update(stage: .success, horizontalLayout: .centered(width: 100)), for: self.token)
|
||||
} else {
|
||||
let payload = LucidBannerPayload.Update(title: errorContext.failureTitle ?? NSLocalizedString("_error_", comment: ""),
|
||||
subtitle: error?.userFriendlyMessage(for: errorContext) ?? "",
|
||||
stage: .error)
|
||||
|
||||
banner?.update(payload: payload, for: self.token)
|
||||
banner?.update(payload: LucidBannerPayload.Update(subtitle: error?.errorDescription, stage: .error), for: self.token)
|
||||
}
|
||||
|
||||
Task { @MainActor in
|
||||
@@ -578,22 +575,18 @@ extension NCShareExtension {
|
||||
}
|
||||
}
|
||||
|
||||
extension NCShareExtension {
|
||||
/// Require authentication once per foreground session without reopening after dismissal.
|
||||
private func requestPasscodeIfNeeded() {
|
||||
guard NCPreferences().presentPasscode,
|
||||
!isPasscodeAuthenticated,
|
||||
!isPresentingPasscode else { return }
|
||||
isPresentingPasscode = true
|
||||
// Embed in the content controller; the helper hides the outer navigation bar.
|
||||
NCPasscodeView.embed(in: self) { [weak self] result in
|
||||
guard let self else { return }
|
||||
self.isPresentingPasscode = false
|
||||
switch result {
|
||||
case .authenticated:
|
||||
self.isPasscodeAuthenticated = true
|
||||
_ = self.validateAccount()
|
||||
case .cancelled, .reset, .configured, .disabled:
|
||||
extension NCShareExtension: NCPasscodeDelegate {
|
||||
func passcodeReset(_ passcodeViewController: TOPasscodeViewController) {
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
|
||||
passcodeViewController.dismiss(animated: false)
|
||||
self.cancel(with: .noAccount)
|
||||
}
|
||||
}
|
||||
|
||||
func evaluatePolicy(_ passcodeViewController: TOPasscodeViewController, isCorrectCode: Bool) {
|
||||
if !isCorrectCode {
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
|
||||
passcodeViewController.dismiss(animated: false)
|
||||
self.cancel(with: .noAccount)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,3 +6,4 @@
|
||||
|
||||
#import "NCEndToEndEncryption.h"
|
||||
#import "UIImage+animatedGIF.h"
|
||||
#import "TOPasscodeViewController.h"
|
||||
@@ -1,6 +1,5 @@
|
||||
// SPDX-FileCopyrightText: Nextcloud GmbH
|
||||
// SPDX-FileCopyrightText: 2025 Milen Pivchev
|
||||
// SPDX-FileCopyrightText: 2026 Marino Faggiana
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
import Foundation
|
||||
@@ -59,136 +58,92 @@ class BaseUIXCTestCase: XCTestCase {
|
||||
try await Task.sleep(for: .seconds(TestConstants.controlExistenceTimeout))
|
||||
}
|
||||
|
||||
/// Sign in through the app's authentication flow, supporting system authentication and the embedded fallback.
|
||||
///
|
||||
/// Automation of the sign-in, if required.
|
||||
///
|
||||
///
|
||||
func logIn() async throws {
|
||||
let login = app.buttons["login"]
|
||||
let deadline = Date().addingTimeInterval(30)
|
||||
// Startup can restore the main interface after the first accessibility snapshot.
|
||||
// Wait for either destination instead of assuming that the login screen will appear.
|
||||
repeat {
|
||||
if app.buttons["openSidebar"].exists || app.buttons["accountSwitcher"].exists {
|
||||
return
|
||||
}
|
||||
if login.exists && login.isHittable {
|
||||
break
|
||||
}
|
||||
try await Task.sleep(for: .milliseconds(250))
|
||||
} while Date() < deadline
|
||||
guard login.exists else {
|
||||
attachAuthenticationDiagnostics()
|
||||
throw UITestError.waitForExistence(login)
|
||||
guard app.buttons["login"].exists else {
|
||||
return
|
||||
}
|
||||
login.tap()
|
||||
|
||||
let serverAddress = app.textFields["serverAddress"].firstMatch
|
||||
guard serverAddress.await() else { throw UITestError.waitForExistence(serverAddress) }
|
||||
serverAddress.tap()
|
||||
serverAddress.typeText(TestConstants.server)
|
||||
app.buttons["login"].tap()
|
||||
|
||||
let serverAddressTextField = app.textFields["serverAddress"].firstMatch
|
||||
guard serverAddressTextField.await() else { return }
|
||||
|
||||
try await aSmallMoment()
|
||||
|
||||
serverAddressTextField.tap()
|
||||
serverAddressTextField.typeText(TestConstants.server)
|
||||
|
||||
app.buttons["submitServerAddress"].tap()
|
||||
|
||||
let webView = try await authenticationWebView()
|
||||
let username = webView.textFields.firstMatch
|
||||
let loginButton = webView.buttons["Log in"].firstMatch
|
||||
if !username.exists, loginButton.await(timeout: 5) {
|
||||
loginButton.tap()
|
||||
try await aSmallMoment()
|
||||
|
||||
let webView = app.webViews.firstMatch
|
||||
|
||||
guard webView.await() else {
|
||||
throw UITestError.waitForExistence(webView)
|
||||
}
|
||||
if username.await() {
|
||||
username.tap()
|
||||
username.typeText(TestConstants.username)
|
||||
let password = webView.secureTextFields.firstMatch
|
||||
guard password.await() else { throw UITestError.waitForExistence(password) }
|
||||
password.tap()
|
||||
password.typeText(TestConstants.password)
|
||||
guard loginButton.await() else { throw UITestError.waitForExistence(loginButton) }
|
||||
|
||||
// try await aSmallMoment()
|
||||
|
||||
let loginButton = webView.buttons["Log in"]
|
||||
|
||||
// try await aSmallMoment()
|
||||
|
||||
if loginButton.await() {
|
||||
loginButton.tap()
|
||||
}
|
||||
|
||||
let grant = webView.buttons["Grant access"]
|
||||
guard try await waitForAuthenticationConsent() else {
|
||||
attachAuthenticationDiagnostics()
|
||||
throw UITestError.waitForExistence(grant)
|
||||
// try await aSmallMoment()
|
||||
|
||||
let usernameTextField = webView.textFields.firstMatch
|
||||
|
||||
if usernameTextField.await() {
|
||||
|
||||
try await aSmallMoment()
|
||||
|
||||
guard usernameTextField.await() else { return }
|
||||
usernameTextField.tap()
|
||||
|
||||
try await aSmallMoment()
|
||||
|
||||
usernameTextField.typeText(TestConstants.username)
|
||||
|
||||
try await aSmallMoment()
|
||||
|
||||
let passwordSecureTextField = webView.secureTextFields.firstMatch
|
||||
|
||||
try await aSmallMoment()
|
||||
|
||||
passwordSecureTextField.tap()
|
||||
|
||||
|
||||
try await aSmallMoment()
|
||||
|
||||
passwordSecureTextField.typeText(TestConstants.password)
|
||||
|
||||
try await aSmallMoment()
|
||||
|
||||
webView.buttons.firstMatch.tap()
|
||||
}
|
||||
|
||||
let sidebar = app.buttons["openSidebar"].firstMatch
|
||||
guard sidebar.await(timeout: 30) || app.buttons["accountSwitcher"].exists else {
|
||||
attachAuthenticationDiagnostics()
|
||||
throw UITestError.waitForExistence(sidebar)
|
||||
try await aSmallMoment()
|
||||
|
||||
let grantButton = webView.buttons["Grant access"]
|
||||
|
||||
guard grantButton.await() else {
|
||||
throw UITestError.waitForExistence(grantButton)
|
||||
}
|
||||
}
|
||||
|
||||
/// Waiting alone does not trigger interruption monitors; dismiss password prompts in their owning process.
|
||||
private func waitForAuthenticationConsent() async throws -> Bool {
|
||||
let browsers = [app!, XCUIApplication(bundleIdentifier: "com.apple.SafariViewService")]
|
||||
let hosts = browsers + [XCUIApplication(bundleIdentifier: "com.apple.springboard")]
|
||||
let deadline = Date().addingTimeInterval(30)
|
||||
var passwordPromptDismissed = false
|
||||
repeat {
|
||||
promptSearch: for host in hosts where !passwordPromptDismissed && host.state != .notRunning {
|
||||
for label in ["Not Now", "Non ora", "Ora no"] {
|
||||
let button = host.buttons[label].firstMatch
|
||||
if button.exists && button.isHittable {
|
||||
button.tap()
|
||||
passwordPromptDismissed = true
|
||||
_ = button.waitForNonExistence(timeout: 5)
|
||||
break promptSearch
|
||||
}
|
||||
}
|
||||
}
|
||||
for browser in browsers where browser.state != .notRunning {
|
||||
let grant = browser.webViews.buttons["Grant access"].firstMatch
|
||||
if grant.exists && grant.isHittable {
|
||||
grant.tap()
|
||||
return true
|
||||
}
|
||||
}
|
||||
try await Task.sleep(for: .milliseconds(250))
|
||||
} while Date() < deadline
|
||||
return false
|
||||
}
|
||||
grantButton.tap()
|
||||
grantButton.awaitInexistence()
|
||||
|
||||
/// ASWebAuthenticationSession may expose its UI in SafariViewService rather than in the app hierarchy.
|
||||
private func authenticationWebView() async throws -> XCUIElement {
|
||||
let browsers = [app!, XCUIApplication(bundleIdentifier: "com.apple.SafariViewService")]
|
||||
let promptHosts = browsers + [XCUIApplication(bundleIdentifier: "com.apple.springboard")]
|
||||
// The app tries HTTPS first, even for the HTTP-only localhost test server.
|
||||
// Allow the initial URLSession request to time out before its HTTP fallback starts.
|
||||
let timeout = URLSessionConfiguration.default.timeoutIntervalForRequest + 30
|
||||
let deadline = Date().addingTimeInterval(timeout)
|
||||
repeat {
|
||||
for host in promptHosts where host.state != .notRunning {
|
||||
for label in ["Continue", "Allow"] {
|
||||
let button = host.alerts.buttons[label].firstMatch
|
||||
if button.exists && button.isHittable {
|
||||
button.tap()
|
||||
}
|
||||
}
|
||||
}
|
||||
for browser in browsers where browser.state != .notRunning {
|
||||
let webView = browser.webViews.firstMatch
|
||||
if webView.exists {
|
||||
return webView
|
||||
}
|
||||
}
|
||||
try await Task.sleep(for: .milliseconds(250))
|
||||
} while Date() < deadline
|
||||
app.buttons["accountSwitcher"].await()
|
||||
|
||||
attachAuthenticationDiagnostics()
|
||||
throw UITestError.waitForExistence(app.webViews.firstMatch)
|
||||
}
|
||||
|
||||
/// Keep login diagnostics in the xcresult instead of losing the context on a CI failure.
|
||||
private func attachAuthenticationDiagnostics() {
|
||||
let screenshot = XCTAttachment(screenshot: XCUIScreen.main.screenshot())
|
||||
screenshot.name = "Authentication screen"
|
||||
screenshot.lifetime = .keepAlways
|
||||
add(screenshot)
|
||||
for host in [app!, XCUIApplication(bundleIdentifier: "com.apple.SafariViewService"), XCUIApplication(bundleIdentifier: "com.apple.springboard")]
|
||||
where host.state == .runningForeground {
|
||||
let hierarchy = XCTAttachment(string: host.debugDescription)
|
||||
hierarchy.name = "Authentication UI hierarchy"
|
||||
hierarchy.lifetime = .keepAlways
|
||||
add(hierarchy)
|
||||
}
|
||||
try await aSmallMoment()
|
||||
}
|
||||
|
||||
///
|
||||
|
||||
@@ -1,390 +0,0 @@
|
||||
// SPDX-FileCopyrightText: Nextcloud GmbH
|
||||
// SPDX-FileCopyrightText: 2026 Marino Faggiana
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
import XCTest
|
||||
|
||||
/// Exercises real settings and app-lock flows against the standard UI-test server.
|
||||
@MainActor
|
||||
final class PasscodeUITests: BaseUIXCTestCase {
|
||||
private let originalCode = "135790"
|
||||
private let replacementCode = "246801"
|
||||
private let wrongCode = "000000"
|
||||
private let resetTestLockoutSeconds = 10
|
||||
private var currentCode: String?
|
||||
private let languageArguments = ["-AppleLanguages", "(en)", "-AppleLocale", "en_US"]
|
||||
|
||||
private var title: XCUIElement { app.staticTexts["passcode.title"] }
|
||||
private var closeButton: XCUIElement { app.buttons["passcode.close"] }
|
||||
private var lockWindow: XCUIElement { app.windows["passcode.window"] }
|
||||
private var lockout: XCUIElement { app.staticTexts["passcode.lockout.remaining"] }
|
||||
private var lockSetting: XCUIElement { app.buttons["settings.passcode.toggle"] }
|
||||
private var changeSetting: XCUIElement { app.buttons["settings.passcode.change"] }
|
||||
|
||||
override func setUp() async throws {
|
||||
try await super.setUp()
|
||||
continueAfterFailure = false
|
||||
addUIInterruptionMonitor(withDescription: "Allow Notifications", for: "Allow")
|
||||
app = XCUIApplication()
|
||||
app.launchArguments = ["UI_TESTING", "UI_TESTING_PASSCODE", "UI_TESTING_NO_EXIT"] + languageArguments
|
||||
if name.contains("testAppResetAfterTenFailuresAcrossLockouts") {
|
||||
app.launchEnvironment["UI_TESTING_PASSCODE_LOCKOUT_SECONDS"] = String(resetTestLockoutSeconds)
|
||||
}
|
||||
app.launch()
|
||||
try await logIn()
|
||||
openSettings()
|
||||
XCTAssertFalse(changeSetting.exists, "Each test must start with app lock disabled.")
|
||||
}
|
||||
|
||||
override func tearDown() async throws {
|
||||
// Avoid leaving the simulator locked if an assertion interrupted a test.
|
||||
if let currentCode, app != nil {
|
||||
app.activate()
|
||||
if lockout.exists {
|
||||
_ = lockout.waitForNonExistence(timeout: 65)
|
||||
}
|
||||
if title.exists && !closeButton.exists {
|
||||
clearPartialCode()
|
||||
enter(currentCode)
|
||||
}
|
||||
if closeButton.exists {
|
||||
closeButton.tap()
|
||||
}
|
||||
if !lockSetting.exists {
|
||||
openSettings()
|
||||
}
|
||||
if changeSetting.exists {
|
||||
lockSetting.tap()
|
||||
enter(currentCode)
|
||||
_ = title.waitForNonExistence(timeout: TestConstants.controlExistenceTimeout)
|
||||
}
|
||||
}
|
||||
app?.terminate()
|
||||
try await super.tearDown()
|
||||
}
|
||||
|
||||
func testCreateChangeAndDisablePasscode() {
|
||||
createPasscode()
|
||||
changeSetting.tap()
|
||||
assertTitle("Enter Passcode")
|
||||
enter(originalCode)
|
||||
assertTitle("Enter a new passcode")
|
||||
enter(replacementCode)
|
||||
assertTitle("Confirm new passcode")
|
||||
enter(replacementCode)
|
||||
currentCode = replacementCode
|
||||
XCTAssertTrue(title.waitForNonExistence(timeout: TestConstants.controlExistenceTimeout))
|
||||
|
||||
lockSetting.tap()
|
||||
assertTitle("Enter Passcode")
|
||||
enter(originalCode)
|
||||
XCTAssertTrue(app.staticTexts["passcode.error"].waitForExistence(timeout: 5))
|
||||
XCTAssertEqual(app.staticTexts["passcode.error"].label, "Incorrect passcode. Try again.")
|
||||
enter(replacementCode)
|
||||
XCTAssertTrue(title.waitForNonExistence(timeout: TestConstants.controlExistenceTimeout))
|
||||
XCTAssertFalse(changeSetting.exists)
|
||||
currentCode = nil
|
||||
}
|
||||
|
||||
/// Regression for the reported brute-force bypass when disabling app lock.
|
||||
func testDisableLockoutSurvivesReopeningBackgroundAndRelaunch() {
|
||||
createPasscode()
|
||||
lockSetting.tap()
|
||||
enter(wrongCode)
|
||||
closeButton.tap()
|
||||
XCTAssertTrue(title.waitForNonExistence(timeout: 5))
|
||||
lockSetting.tap()
|
||||
enter(wrongCode)
|
||||
closeButton.tap()
|
||||
XCTAssertTrue(title.waitForNonExistence(timeout: 5))
|
||||
lockSetting.tap()
|
||||
enter(wrongCode)
|
||||
assertLockedOut()
|
||||
let deadline = Date().addingTimeInterval(TimeInterval(remainingSeconds()))
|
||||
|
||||
// The third error promotes the request to a mandatory app lock.
|
||||
XCTAssertTrue(lockWindow.waitForExistence(timeout: 5))
|
||||
XCTAssertFalse(closeButton.exists)
|
||||
XCTAssertFalse(lockSetting.isHittable)
|
||||
assertLockedOut()
|
||||
waitForCountdown(toDropBelow: 56)
|
||||
assertOriginalDeadline(deadline)
|
||||
|
||||
// Background and foreground must preserve the mandatory lock.
|
||||
backgroundAndActivate()
|
||||
assertTitle("Enter Passcode")
|
||||
XCTAssertFalse(closeButton.exists)
|
||||
assertLockedOut()
|
||||
assertOriginalDeadline(deadline)
|
||||
|
||||
// Relaunch without setup flags: credentials and the deadline must persist in Keychain.
|
||||
app.terminate()
|
||||
app.launchArguments = languageArguments
|
||||
app.launch()
|
||||
assertTitle("Enter Passcode")
|
||||
XCTAssertFalse(closeButton.exists)
|
||||
assertLockedOut()
|
||||
assertOriginalDeadline(deadline)
|
||||
|
||||
XCTAssertTrue(lockout.waitForNonExistence(timeout: max(0, deadline.timeIntervalSinceNow) + 5))
|
||||
enter(originalCode)
|
||||
XCTAssertTrue(title.waitForNonExistence(timeout: TestConstants.controlExistenceTimeout))
|
||||
}
|
||||
|
||||
/// Changing the code must enforce the same persisted protection as disabling it.
|
||||
func testChangePasscodeCannotResetFailedAttemptsByReopening() {
|
||||
createPasscode()
|
||||
for attempt in 1...3 {
|
||||
changeSetting.tap()
|
||||
assertTitle("Enter Passcode")
|
||||
enter(wrongCode)
|
||||
if attempt < 3 {
|
||||
closeButton.tap()
|
||||
XCTAssertTrue(title.waitForNonExistence(timeout: 5))
|
||||
}
|
||||
}
|
||||
assertLockedOut()
|
||||
let deadline = Date().addingTimeInterval(TimeInterval(remainingSeconds()))
|
||||
XCTAssertTrue(lockWindow.waitForExistence(timeout: 5))
|
||||
XCTAssertFalse(closeButton.exists)
|
||||
XCTAssertFalse(changeSetting.isHittable)
|
||||
XCTAssertFalse(lockSetting.isHittable)
|
||||
assertOriginalDeadline(deadline)
|
||||
|
||||
// Waiting unlocks the keypad, never the app itself.
|
||||
XCTAssertTrue(lockout.waitForNonExistence(timeout: max(0, deadline.timeIntervalSinceNow) + 5))
|
||||
XCTAssertTrue(lockWindow.exists)
|
||||
XCTAssertFalse(closeButton.exists)
|
||||
XCTAssertFalse(changeSetting.isHittable)
|
||||
enter(originalCode)
|
||||
XCTAssertTrue(lockWindow.waitForNonExistence(timeout: 5))
|
||||
XCTAssertTrue(changeSetting.waitForExistence(timeout: 5))
|
||||
}
|
||||
|
||||
func testBackgroundCannotBypassMandatoryAppLock() {
|
||||
createPasscode()
|
||||
backgroundAndActivate()
|
||||
for _ in 0..<2 {
|
||||
assertTitle("Enter Passcode")
|
||||
XCTAssertFalse(closeButton.exists)
|
||||
XCTAssertFalse(lockSetting.isHittable, "Protected settings must remain inaccessible.")
|
||||
let start = app.coordinate(withNormalizedOffset: CGVector(dx: 0.5, dy: 0.25))
|
||||
let end = app.coordinate(withNormalizedOffset: CGVector(dx: 0.5, dy: 0.8))
|
||||
start.press(forDuration: 0.1, thenDragTo: end)
|
||||
XCTAssertTrue(title.exists, "Dragging must not dismiss the mandatory lock.")
|
||||
backgroundAndActivate()
|
||||
}
|
||||
enter(originalCode)
|
||||
XCTAssertTrue(title.waitForNonExistence(timeout: TestConstants.controlExistenceTimeout))
|
||||
XCTAssertTrue(lockSetting.waitForExistence(timeout: 5), "Unlocking must preserve the Settings screen.")
|
||||
}
|
||||
|
||||
/// An informational sheet stays in the app window while the mandatory lock covers it.
|
||||
func testAppLockAppearsAbovePresentedSheet() {
|
||||
createPasscode()
|
||||
let acknowledgements = app.buttons["Acknowledgements"]
|
||||
scrollTo(acknowledgements)
|
||||
acknowledgements.tap()
|
||||
let close = app.buttons["settings.acknowledgements.close"]
|
||||
XCTAssertTrue(close.waitForExistence(timeout: 5))
|
||||
|
||||
backgroundAndActivate()
|
||||
guard lockWindow.waitForExistence(timeout: 5) else {
|
||||
let screenshot = XCTAttachment(screenshot: XCUIScreen.main.screenshot())
|
||||
screenshot.name = "App lock above acknowledgements"
|
||||
screenshot.lifetime = .keepAlways
|
||||
add(screenshot)
|
||||
let hierarchy = XCTAttachment(string: app.debugDescription)
|
||||
hierarchy.name = "App lock UI hierarchy"
|
||||
hierarchy.lifetime = .keepAlways
|
||||
add(hierarchy)
|
||||
XCTFail("App-lock window missing after foreground. Passcode title exists: \(title.exists); acknowledgements close exists: \(close.exists).")
|
||||
return
|
||||
}
|
||||
assertTitle("Enter Passcode")
|
||||
XCTAssertFalse(close.isHittable)
|
||||
enter(originalCode)
|
||||
XCTAssertTrue(lockWindow.waitForNonExistence(timeout: 5))
|
||||
XCTAssertTrue(close.isHittable, "Unlocking must preserve the sheet underneath.")
|
||||
close.tap()
|
||||
scrollTo(lockSetting, towardsTop: true)
|
||||
}
|
||||
|
||||
/// An existing confirmation alert cannot intercept or prevent the app-lock window.
|
||||
func testAppLockAppearsAbovePresentedAlert() {
|
||||
createPasscode()
|
||||
let advanced = app.buttons["Advanced"]
|
||||
scrollTo(advanced)
|
||||
advanced.tap()
|
||||
let clearCache = app.buttons["Clear cache"]
|
||||
scrollTo(clearCache)
|
||||
clearCache.tap()
|
||||
let cancel = app.alerts.firstMatch.buttons["Cancel"]
|
||||
XCTAssertTrue(cancel.waitForExistence(timeout: 5))
|
||||
|
||||
backgroundAndActivate()
|
||||
XCTAssertTrue(lockWindow.waitForExistence(timeout: 5))
|
||||
assertTitle("Enter Passcode")
|
||||
XCTAssertFalse(cancel.isHittable)
|
||||
enter(originalCode)
|
||||
XCTAssertTrue(lockWindow.waitForNonExistence(timeout: 5))
|
||||
XCTAssertTrue(cancel.isHittable, "Unlocking must preserve the confirmation alert underneath.")
|
||||
cancel.tap()
|
||||
app.navigationBars["Advanced"].buttons["Settings"].tap()
|
||||
scrollTo(lockSetting, towardsTop: true)
|
||||
}
|
||||
|
||||
/// Waiting out each three-attempt lockout must not reset the ten-attempt app-wipe counter.
|
||||
func testAppResetAfterTenFailuresAcrossLockouts() {
|
||||
createPasscode()
|
||||
let resetSetting = app.switches["settings.passcode.reset"]
|
||||
for _ in 0..<3 where !resetSetting.isHittable {
|
||||
app.swipeUp()
|
||||
}
|
||||
XCTAssertTrue(resetSetting.waitForExistence(timeout: 5))
|
||||
// SwiftUI can expose the labelled row as a switch containing the actual control.
|
||||
let nestedSwitch = resetSetting.switches.firstMatch
|
||||
let resetControl = nestedSwitch.exists ? nestedSwitch : resetSetting
|
||||
XCTAssertEqual(resetControl.value as? String, "0")
|
||||
if nestedSwitch.exists {
|
||||
resetControl.tap()
|
||||
} else {
|
||||
// In the English test layout the switch is at the trailing edge of the row.
|
||||
resetControl.coordinate(withNormalizedOffset: CGVector(dx: 0.95, dy: 0.5)).tap()
|
||||
}
|
||||
let resetEnabled = XCTNSPredicateExpectation(predicate: NSPredicate(format: "value == %@", "1"), object: resetControl)
|
||||
guard XCTWaiter.wait(for: [resetEnabled], timeout: 5) == .completed else {
|
||||
let screenshot = XCTAttachment(screenshot: XCUIScreen.main.screenshot())
|
||||
screenshot.name = "Reset setting after tap"
|
||||
screenshot.lifetime = .keepAlways
|
||||
add(screenshot)
|
||||
let hierarchy = XCTAttachment(string: app.debugDescription)
|
||||
hierarchy.name = "Reset setting UI hierarchy"
|
||||
hierarchy.lifetime = .keepAlways
|
||||
add(hierarchy)
|
||||
XCTFail("The reset switch did not become enabled after tapping it.")
|
||||
return
|
||||
}
|
||||
|
||||
backgroundAndActivate()
|
||||
assertTitle("Enter Passcode")
|
||||
for attempt in 1...10 {
|
||||
enter(wrongCode)
|
||||
if attempt.isMultiple(of: 3) {
|
||||
assertLockedOut()
|
||||
XCTAssertTrue(lockout.waitForNonExistence(timeout: TimeInterval(resetTestLockoutSeconds + 5)))
|
||||
XCTAssertTrue(app.buttons["passcode.digit.1"].isEnabled)
|
||||
} else if attempt < 10 {
|
||||
XCTAssertTrue(title.exists, "The app must remain locked until the reset threshold.")
|
||||
}
|
||||
}
|
||||
|
||||
// Wait for real cleanup, then terminate through XCTest to avoid TSan's exit finalizer.
|
||||
XCTAssertTrue(app.otherElements["uiTesting.resetCompleted"].waitForExistence(timeout: 10))
|
||||
currentCode = nil
|
||||
app.terminate()
|
||||
// Relaunch without setup flags so they cannot hide an incomplete reset.
|
||||
app.launchArguments = languageArguments
|
||||
app.launch()
|
||||
XCTAssertTrue(app.buttons["login"].waitForExistence(timeout: TestConstants.controlExistenceTimeout))
|
||||
XCTAssertFalse(title.exists, "The app reset must remove the stored passcode.")
|
||||
}
|
||||
|
||||
private func createPasscode() {
|
||||
lockSetting.tap()
|
||||
assertTitle("Enter a new passcode")
|
||||
enter(originalCode)
|
||||
assertTitle("Confirm new passcode")
|
||||
enter(originalCode)
|
||||
currentCode = originalCode
|
||||
XCTAssertTrue(title.waitForNonExistence(timeout: TestConstants.controlExistenceTimeout))
|
||||
XCTAssertTrue(changeSetting.waitForExistence(timeout: 5))
|
||||
}
|
||||
|
||||
private func openSettings() {
|
||||
let sidebar = app.buttons["openSidebar"].firstMatch
|
||||
XCTAssertTrue(sidebar.waitForExistence(timeout: TestConstants.controlExistenceTimeout))
|
||||
sidebar.tap()
|
||||
let settings = app.buttons["sidebarSettings"]
|
||||
XCTAssertTrue(settings.waitForExistence(timeout: 5))
|
||||
settings.tap()
|
||||
XCTAssertTrue(lockSetting.waitForExistence(timeout: 5))
|
||||
}
|
||||
|
||||
private func scrollTo(_ element: XCUIElement, towardsTop: Bool = false) {
|
||||
for _ in 0..<6 where !element.isHittable {
|
||||
if towardsTop {
|
||||
app.swipeDown()
|
||||
} else {
|
||||
app.swipeUp()
|
||||
}
|
||||
}
|
||||
XCTAssertTrue(element.isHittable)
|
||||
}
|
||||
|
||||
private func enter(_ code: String) {
|
||||
for digit in code {
|
||||
let button = app.buttons["passcode.digit.\(digit)"]
|
||||
XCTAssertTrue(button.waitForExistence(timeout: 5))
|
||||
XCTAssertTrue(button.isEnabled)
|
||||
button.tap()
|
||||
}
|
||||
}
|
||||
|
||||
private func clearPartialCode() {
|
||||
let delete = app.buttons["passcode.delete"]
|
||||
for _ in 0..<6 where delete.exists && delete.isEnabled {
|
||||
delete.tap()
|
||||
}
|
||||
}
|
||||
|
||||
private func assertTitle(_ expected: String) {
|
||||
XCTAssertTrue(title.waitForExistence(timeout: TestConstants.controlExistenceTimeout))
|
||||
XCTAssertEqual(title.label, expected)
|
||||
}
|
||||
|
||||
/// Wait for the Home screen and an actual background state before reactivating the app.
|
||||
private func backgroundAndActivate() {
|
||||
XCUIDevice.shared.press(.home)
|
||||
let springboard = XCUIApplication(bundleIdentifier: "com.apple.springboard")
|
||||
XCTAssertTrue(springboard.wait(for: .runningForeground, timeout: 5))
|
||||
let background = NSPredicate { [app] _, _ in
|
||||
MainActor.assumeIsolated {
|
||||
app?.state == .runningBackground || app?.state == .runningBackgroundSuspended
|
||||
}
|
||||
}
|
||||
XCTAssertEqual(XCTWaiter.wait(for: [XCTNSPredicateExpectation(predicate: background, object: nil)], timeout: 5), .completed)
|
||||
app.activate()
|
||||
XCTAssertTrue(app.wait(for: .runningForeground, timeout: 5))
|
||||
}
|
||||
|
||||
private func assertLockedOut() {
|
||||
XCTAssertTrue(lockout.waitForExistence(timeout: 5))
|
||||
XCTAssertFalse(app.buttons["passcode.digit.1"].isEnabled)
|
||||
}
|
||||
|
||||
private func remainingSeconds() -> Int {
|
||||
guard let first = lockout.label.split(separator: " ").first, let seconds = Int(first) else {
|
||||
XCTFail("Missing lockout countdown: \(lockout.label)")
|
||||
return 0
|
||||
}
|
||||
return seconds
|
||||
}
|
||||
|
||||
private func waitForCountdown(toDropBelow seconds: Int) {
|
||||
let countdown = NSPredicate { [weak self] _, _ in
|
||||
MainActor.assumeIsolated {
|
||||
guard let self else { return false }
|
||||
return self.remainingSeconds() < seconds
|
||||
}
|
||||
}
|
||||
XCTAssertEqual(XCTWaiter.wait(for: [XCTNSPredicateExpectation(predicate: countdown, object: nil)], timeout: 10), .completed)
|
||||
}
|
||||
|
||||
private func assertOriginalDeadline(_ deadline: Date) {
|
||||
let expected = Int(deadline.timeIntervalSinceNow.rounded(.up))
|
||||
XCTAssertGreaterThan(remainingSeconds(), 0)
|
||||
XCTAssertLessThanOrEqual(remainingSeconds(), expected + 2, "Background, reopening or relaunch must not restart the lockout.")
|
||||
XCTAssertGreaterThanOrEqual(remainingSeconds(), max(0, expected - 2), "The persisted deadline must not be shortened.")
|
||||
}
|
||||
}
|
||||
@@ -1,131 +0,0 @@
|
||||
// SPDX-FileCopyrightText: Nextcloud GmbH
|
||||
// SPDX-FileCopyrightText: 2026 Milen Pivchev
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
import Foundation
|
||||
import NextcloudKit
|
||||
import Testing
|
||||
@testable import Nextcloud
|
||||
|
||||
@Suite("Error messages shown to people")
|
||||
struct NKErrorUserFriendlyMessageTests {
|
||||
static let shownKinds = NKError.Kind.allCases.filter { $0 != .cancelled }
|
||||
|
||||
private func localized(_ key: String) -> String {
|
||||
NSLocalizedString(key, comment: "")
|
||||
}
|
||||
|
||||
@Test("Nothing is shown for success or cancellation")
|
||||
func silentErrors() {
|
||||
#expect(NKError.success.userFriendlyMessage() == nil)
|
||||
#expect(NKError.cancelled.userFriendlyMessage(for: .upload(fileName: "a.jpg")) == nil)
|
||||
#expect(NKError(errorCode: NCGlobal.shared.errorTaskCancelled, errorDescription: "Task cancelled").userFriendlyMessage() == nil)
|
||||
}
|
||||
|
||||
@Test("Keeps text the app wrote itself")
|
||||
func appMessages() {
|
||||
#expect(NKError(errorCode: NCGlobal.shared.errorOfflineNotAllowed, errorDescription: "_offline_not_allowed_").userFriendlyMessage() == localized("_offline_not_allowed_"))
|
||||
#expect(NKError(errorCode: NCGlobal.shared.errorE2EELock, errorDescription: "Already translated").userFriendlyMessage() == "Already translated")
|
||||
}
|
||||
|
||||
@Test("Replaces technical server text")
|
||||
func technicalServerText() throws {
|
||||
let error = NKError(errorCode: 409, errorDescription: "Parent node does not exist")
|
||||
let generic = try #require(error.userFriendlyMessage())
|
||||
|
||||
#expect(error.userFriendlyMessage(for: .createFolder(folderName: "a/b")) == generic)
|
||||
#expect(generic != error.errorDescription)
|
||||
#expect(!generic.contains("409"))
|
||||
}
|
||||
|
||||
@Test("Uses the generic message unless the operation needs its own")
|
||||
func operationMessages() {
|
||||
let forbidden = NKError(errorCode: 403, errorDescription: "403: Forbidden")
|
||||
let generic = forbidden.userFriendlyMessage()
|
||||
|
||||
#expect(generic != nil)
|
||||
#expect(forbidden.userFriendlyMessage(for: .delete(fileName: "a.jpg")) == generic)
|
||||
#expect(forbidden.userFriendlyMessage(for: .rename) == generic)
|
||||
#expect(forbidden.userFriendlyMessage(for: .upload(fileName: "a.jpg")) == generic)
|
||||
}
|
||||
|
||||
@Test("Doesn't guess the cause of a document failure")
|
||||
func documentMessages() {
|
||||
let forbidden = NKError(errorCode: 403, errorDescription: "403: Forbidden")
|
||||
let notFound = NKError(errorCode: 404, errorDescription: "404: Not found")
|
||||
|
||||
#expect(forbidden.userFriendlyMessage(for: .createDocument(fileName: "a.md")) == localized("_error_occurred_"))
|
||||
#expect(forbidden.userFriendlyMessage(for: .openDocument(fileName: "a.md")) == localized("_error_occurred_"))
|
||||
#expect(notFound.userFriendlyMessage(for: .openDocument(fileName: "a.md")) == notFound.userFriendlyMessage())
|
||||
#expect(NKError(error: CancellationError()).userFriendlyMessage() == nil)
|
||||
}
|
||||
|
||||
@Test("Words different kinds of failure differently")
|
||||
func kindMessages() {
|
||||
let timeout = NKError(errorCode: NSURLErrorTimedOut, errorDescription: "The request timed out.").userFriendlyMessage()
|
||||
let quota = NKError(errorCode: 507, errorDescription: "507: Storage quota is reached").userFriendlyMessage()
|
||||
let unknown = NKError(errorCode: 418, errorDescription: "418: I'm a teapot").userFriendlyMessage()
|
||||
|
||||
#expect(Set([timeout, quota, unknown]).count == 3)
|
||||
#expect(quota != "507: Storage quota is reached")
|
||||
}
|
||||
|
||||
@Test("Every kind has a translated message", arguments: NKErrorUserFriendlyMessageTests.shownKinds)
|
||||
func everyKind(kind: NKError.Kind) {
|
||||
let message = NKError(errorCode: -1, errorDescription: "Technical", kind: kind).userFriendlyMessage()
|
||||
|
||||
#expect(message != nil)
|
||||
#expect(message != "Technical")
|
||||
}
|
||||
|
||||
@Test("Maps transfer events and saved statuses to operations")
|
||||
func contexts() {
|
||||
let global = NCGlobal.shared
|
||||
|
||||
#expect(NCErrorContext(networkingStatus: global.networkingStatusUploaded, fileName: "a.jpg") == .upload(fileName: "a.jpg"))
|
||||
#expect(NCErrorContext(networkingStatus: global.networkingStatusCopyMove, fileName: "a.jpg") == .moveOrCopy(fileName: "a.jpg"))
|
||||
#expect(NCErrorContext(networkingStatus: global.networkingStatusReloadAvatar, fileName: "") == .generic)
|
||||
#expect(NCErrorContext(metadataStatus: global.metadataStatusWaitCreateFolder, fileName: "Photos") == .createFolder(folderName: "Photos"))
|
||||
#expect(NCErrorContext(metadataStatus: global.metadataStatusDownloadError, fileName: "a.jpg") == .download(fileName: "a.jpg"))
|
||||
}
|
||||
|
||||
@Test("Titles say what failed")
|
||||
func failureTitles() throws {
|
||||
let contexts: [NCErrorContext] = [.upload(fileName: "f"), .download(fileName: "f"), .delete(fileName: "f"), .rename, .moveOrCopy(fileName: "f"), .createFolder(folderName: "f"), .favorite(fileName: "f"), .createDocument(fileName: "f"), .openDocument(fileName: "f")]
|
||||
|
||||
#expect(NCErrorContext.generic.failureTitle == nil)
|
||||
#expect(NCErrorContext.upload(fileName: "IMG_0042.jpg").failureTitle?.contains("IMG_0042.jpg") == true)
|
||||
|
||||
for context in contexts {
|
||||
let title = try #require(context.failureTitle)
|
||||
|
||||
#expect(!title.hasPrefix("_"))
|
||||
}
|
||||
}
|
||||
|
||||
@Test("Words saved transfer errors")
|
||||
func savedErrors() {
|
||||
let metadata = tableMetadata()
|
||||
metadata.fileNameView = "a.jpg"
|
||||
metadata.status = NCGlobal.shared.metadataStatusUploadError
|
||||
metadata.errorCode = 507
|
||||
metadata.sessionError = "507: Storage quota is reached"
|
||||
|
||||
#expect(metadata.sessionErrorMessage == NKError(errorCode: 507, errorDescription: "").userFriendlyMessage())
|
||||
|
||||
metadata.errorCode = 412
|
||||
metadata.errorKind = NKError.Kind.alreadyExists.rawValue
|
||||
|
||||
#expect(metadata.sessionErrorMessage == NKError(errorCode: 412, errorDescription: "", kind: .alreadyExists).userFriendlyMessage())
|
||||
|
||||
metadata.errorKind = "notAKind"
|
||||
|
||||
#expect(metadata.sessionErrorMessage == NKError(errorCode: 412, errorDescription: "").userFriendlyMessage())
|
||||
|
||||
metadata.errorCode = NSURLErrorCancelled
|
||||
metadata.sessionError = "Transfer was cancelled."
|
||||
|
||||
#expect(metadata.sessionErrorMessage != "Transfer was cancelled.")
|
||||
#expect(!metadata.sessionErrorMessage.isEmpty)
|
||||
}
|
||||
}
|
||||
@@ -25,9 +25,6 @@ docker run \
|
||||
echo "Please wait until the server is provisioned…"
|
||||
sleep 20
|
||||
|
||||
# Keep web authentication labels consistent with the UI tests.
|
||||
docker exec --user www-data $CONTAINER_NAME php /var/www/html/occ config:system:set force_language --value=en
|
||||
|
||||
# Enable File Download Limit App.
|
||||
docker exec $CONTAINER_NAME su www-data -c "git clone --depth 1 -b $SERVER_VERSION https://github.com/nextcloud/files_downloadlimit.git /var/www/html/apps/files_downloadlimit/"
|
||||
docker exec $CONTAINER_NAME su www-data -c "php /var/www/html/occ app:enable files_downloadlimit"
|
||||
|
||||
@@ -205,7 +205,7 @@ func getDashboardDataEntry(configuration: DashboardIntent?, isPreview: Bool, dis
|
||||
let footerText = "Dashboard " + NSLocalizedString("_of_", comment: "") + " " + activeTableAccount.displayName + alias
|
||||
|
||||
if resultsDashboardWidget.error != .success {
|
||||
return(DashboardDataEntry(date: Date(), datas: datasPlaceholder, dashboard: tableDashboard, buttons: buttons, isPlaceholder: true, isEmpty: false, titleImage: titleImage, title: title, footerImage: "xmark.icloud", footerText: resultsDashboardWidget.error.localizedGenericMessage, account: activeTableAccount.account))
|
||||
return(DashboardDataEntry(date: Date(), datas: datasPlaceholder, dashboard: tableDashboard, buttons: buttons, isPlaceholder: true, isEmpty: false, titleImage: titleImage, title: title, footerImage: "xmark.icloud", footerText: resultsDashboardWidget.error.errorDescription, account: activeTableAccount.account))
|
||||
} else {
|
||||
return(DashboardDataEntry(date: Date(), datas: datas, dashboard: tableDashboard, buttons: buttons, isPlaceholder: false, isEmpty: datas.isEmpty, titleImage: titleImage, title: title, footerImage: "checkmark.icloud", footerText: footerText, account: activeTableAccount.account))
|
||||
}
|
||||
|
||||
@@ -238,7 +238,7 @@ func getFilesDataEntry(configuration: AccountIntent?, isPreview: Bool, displaySi
|
||||
let footerText = "Files " + NSLocalizedString("_of_", comment: "") + " " + activeTableAccount.displayName + alias
|
||||
|
||||
if results.error != .success {
|
||||
return(FilesDataEntry(date: Date(), datas: datasPlaceholder, isPlaceholder: true, isEmpty: false, userId: activeTableAccount.userId, url: activeTableAccount.urlBase, account: activeTableAccount.account, tile: title, footerImage: "xmark.icloud", footerText: results.error.localizedGenericMessage))
|
||||
return(FilesDataEntry(date: Date(), datas: datasPlaceholder, isPlaceholder: true, isEmpty: false, userId: activeTableAccount.userId, url: activeTableAccount.urlBase, account: activeTableAccount.account, tile: title, footerImage: "xmark.icloud", footerText: results.error.errorDescription))
|
||||
} else {
|
||||
return(FilesDataEntry(date: Date(), datas: datas, isPlaceholder: false, isEmpty: datas.isEmpty, userId: activeTableAccount.userId, url: activeTableAccount.urlBase, account: activeTableAccount.account, tile: title, footerImage: "checkmark.icloud", footerText: footerText))
|
||||
}
|
||||
|
||||
@@ -38,12 +38,7 @@ class NCAccount: NSObject {
|
||||
|
||||
guard resultsGetUserProfile.error == .success, let userProfile = resultsGetUserProfile.userProfile else {
|
||||
NextcloudKit.shared.nkCommonInstance.nksessions.remove(account: account)
|
||||
|
||||
let error = resultsGetUserProfile.error == .success ? NKError.invalidData : resultsGetUserProfile.error
|
||||
|
||||
nkLog(error: "Getting the user profile failed: \(error.logDescription)")
|
||||
|
||||
let alertController = UIAlertController(title: NSLocalizedString("_error_", comment: ""), message: error.userFriendlyMessage() ?? error.localizedGenericMessage, preferredStyle: .alert)
|
||||
let alertController = UIAlertController(title: NSLocalizedString("_error_", comment: ""), message: resultsGetUserProfile.error.errorDescription, preferredStyle: .alert)
|
||||
alertController.addAction(UIAlertAction(title: NSLocalizedString("_ok_", comment: ""), style: .default, handler: { _ in }))
|
||||
viewController.present(alertController, animated: true)
|
||||
|
||||
@@ -243,7 +238,7 @@ class NCAccount: NSObject {
|
||||
await NCAccount().deleteAccount(account, wipe: resultsWipe.wipe)
|
||||
if resultsWipe.wipe {
|
||||
let resultsSetWipe = await NextcloudKit.shared.setRemoteWipeCompletitionAsync(serverUrl: tblAccount.urlBase, token: token, account: tblAccount.account)
|
||||
nkLog(debug: "Set Remote Wipe Completition result: \(resultsSetWipe.error.logDescription)")
|
||||
nkLog(debug: "Set Remote Wipe Completition error code: \(resultsSetWipe.error.errorCode)")
|
||||
}
|
||||
|
||||
if !account.isEmpty, controller == nil || controller?.account == account {
|
||||
|
||||
@@ -86,7 +86,8 @@ class NCActivity: UIViewController, NCSharePagingContent {
|
||||
} else {
|
||||
Task {
|
||||
await showErrorBanner(windowScene: self.windowScene,
|
||||
error: error)
|
||||
text: error.errorDescription,
|
||||
errorCode: error.errorCode)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -446,7 +447,8 @@ extension NCActivity {
|
||||
} else if error.errorCode != NCGlobal.shared.errorResourceNotFound {
|
||||
Task {
|
||||
await showErrorBanner(windowScene: self.windowScene,
|
||||
error: error)
|
||||
text: error.errorDescription,
|
||||
errorCode: error.errorCode)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -170,7 +170,8 @@ class AlbumDetailsViewModel: ObservableObject {
|
||||
AlbumsManager.shared.syncAlbums(for: account)
|
||||
self?.navigator.pop()
|
||||
case .failure(let error):
|
||||
await showErrorBanner(windowScene: self?.windowScene, error: error, context: .delete(fileName: deletedAlbum.name))
|
||||
// User-initiated failures must not be hidden by the network-error cooldown.
|
||||
await showErrorBanner(windowScene: self?.windowScene, text: error.errorDescription)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -184,7 +185,7 @@ class AlbumDetailsViewModel: ObservableObject {
|
||||
|
||||
let error = await deletePhotoFromAlbum(photo, metadata: photo.metadata)
|
||||
guard error == .success else {
|
||||
await showErrorBanner(windowScene: windowScene, error: error)
|
||||
await showErrorBanner(windowScene: windowScene, text: error.errorDescription)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -206,7 +207,7 @@ class AlbumDetailsViewModel: ObservableObject {
|
||||
guard let photo = photos.first(where: { $0.metadata.fileId == metadata.fileId }) else { continue }
|
||||
let error = await deletePhotoFromAlbum(photo, metadata: metadata)
|
||||
guard error == .success else {
|
||||
await showErrorBanner(windowScene: windowScene, error: error)
|
||||
await showErrorBanner(windowScene: windowScene, text: error.errorDescription)
|
||||
return
|
||||
}
|
||||
photos.removeAll { $0.id == photo.id }
|
||||
@@ -271,7 +272,8 @@ class AlbumDetailsViewModel: ObservableObject {
|
||||
} catch {
|
||||
self.isLoadingPopupVisible = false
|
||||
let error = (error as? NKError) ?? NKError(error: error)
|
||||
await showErrorBanner(windowScene: self.windowScene, error: error)
|
||||
// Report every failed rename, even after another offline operation.
|
||||
await showErrorBanner(windowScene: self.windowScene, text: error.errorDescription)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -294,7 +296,10 @@ class AlbumDetailsViewModel: ObservableObject {
|
||||
for photo in selectedPhotos {
|
||||
guard let metadata = NCManageDatabase.shared.getMetadataFromOcId(photo) else {
|
||||
Task {
|
||||
await showErrorBanner(windowScene: self.windowScene, text: "_media_not_available_")
|
||||
await showErrorBanner(
|
||||
windowScene: self.windowScene,
|
||||
text: NKError.invalidData.errorDescription
|
||||
)
|
||||
}
|
||||
continue
|
||||
}
|
||||
@@ -312,7 +317,7 @@ class AlbumDetailsViewModel: ObservableObject {
|
||||
case .success:
|
||||
hadAnySuccess = true
|
||||
case .failure(let error):
|
||||
await showErrorBanner(windowScene: self?.windowScene, error: error)
|
||||
await showErrorBanner(windowScene: self?.windowScene, text: error.errorDescription)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -160,7 +160,7 @@ class AlbumsListViewModel: ObservableObject {
|
||||
}
|
||||
case .failure(let error):
|
||||
Task {
|
||||
await showErrorBanner(windowScene: self?.windowScene, error: error)
|
||||
await showErrorBanner(windowScene: self?.windowScene, text: error.errorDescription)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -187,7 +187,10 @@ class AlbumsListViewModel: ObservableObject {
|
||||
for photo in selectedPhotos {
|
||||
guard let metadata = NCManageDatabase.shared.getMetadataFromOcId(photo) else {
|
||||
Task {
|
||||
await showErrorBanner(windowScene: self.windowScene, text: "_media_not_available_")
|
||||
await showErrorBanner(
|
||||
windowScene: self.windowScene,
|
||||
text: NKError.invalidData.errorDescription
|
||||
)
|
||||
}
|
||||
continue
|
||||
}
|
||||
@@ -199,7 +202,7 @@ class AlbumsListViewModel: ObservableObject {
|
||||
hadAnySuccess = true
|
||||
case .failure(let error):
|
||||
Task {
|
||||
await showErrorBanner(windowScene: self.windowScene, error: error)
|
||||
await showErrorBanner(windowScene: self.windowScene, text: error.errorDescription)
|
||||
}
|
||||
}
|
||||
group.leave()
|
||||
|
||||
@@ -32,17 +32,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
|
||||
var pushSubscriptionTask: Task<Void, Never>?
|
||||
|
||||
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
|
||||
#if DEBUG
|
||||
// Give security UI tests a repeatable starting state on their dedicated simulator.
|
||||
if isUiTestingEnabled && ProcessInfo.processInfo.arguments.contains("UI_TESTING_PASSCODE") {
|
||||
let preferences = NCPreferences()
|
||||
preferences.passcode = nil
|
||||
preferences.clearPasscodeFailures()
|
||||
preferences.touchFaceID = false
|
||||
preferences.requestPasscodeAtStart = true
|
||||
preferences.resetAppCounterFail = false
|
||||
if isUiTestingEnabled {
|
||||
Task {
|
||||
await NCAccount().deleteAllAccounts()
|
||||
}
|
||||
}
|
||||
#endif
|
||||
let utilityFileSystem = NCUtilityFileSystem()
|
||||
let utility = NCUtility()
|
||||
|
||||
@@ -306,22 +300,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
|
||||
|
||||
NCPreferences().removeAll()
|
||||
|
||||
#if DEBUG
|
||||
// Let UI tests observe the completed reset before terminating the process themselves.
|
||||
if isUiTestingEnabled,
|
||||
ProcessInfo.processInfo.arguments.contains("UI_TESTING_NO_EXIT"),
|
||||
let window = UIApplication.shared.mainAppWindow {
|
||||
let controller = UIViewController()
|
||||
controller.view.backgroundColor = .systemBackground
|
||||
controller.view.isAccessibilityElement = true
|
||||
controller.view.accessibilityIdentifier = "uiTesting.resetCompleted"
|
||||
controller.view.accessibilityLabel = "Reset completed"
|
||||
window.rootViewController = controller
|
||||
window.makeKeyAndVisible()
|
||||
return
|
||||
}
|
||||
#endif
|
||||
|
||||
exit(0)
|
||||
}
|
||||
|
||||
|
||||
@@ -18,12 +18,11 @@ extension NCManageDatabase {
|
||||
/// - newFileName: Optional new filename.
|
||||
/// - session: Optional session identifier.
|
||||
/// - sessionTaskIdentifier: Optional task ID.
|
||||
/// - sessionError: Optional error string (clears error code and kind if empty).
|
||||
/// - sessionError: Optional error string (clears error code if empty).
|
||||
/// - selector: Optional session selector.
|
||||
/// - status: Optional metadata status (may reset sessionDate).
|
||||
/// - etag: Optional ETag string.
|
||||
/// - errorCode: Optional error code to persist.
|
||||
/// - errorKind: Optional `NKError.Kind` raw value to persist.
|
||||
/// - Returns: A detached copy of the updated `tableMetadata` object, or `nil` if not found.
|
||||
func setMetadataSessionAsync(account: String? = nil,
|
||||
ocId: String? = nil,
|
||||
@@ -35,8 +34,7 @@ extension NCManageDatabase {
|
||||
selector: String? = nil,
|
||||
status: Int? = nil,
|
||||
etag: String? = nil,
|
||||
errorCode: Int? = nil,
|
||||
errorKind: String? = nil) async {
|
||||
errorCode: Int? = nil) async {
|
||||
var query: NSPredicate = NSPredicate()
|
||||
if let ocId {
|
||||
query = NSPredicate(format: "ocId == %@", ocId)
|
||||
@@ -72,7 +70,6 @@ extension NCManageDatabase {
|
||||
metadata.sessionError = sessionError
|
||||
if sessionError.isEmpty {
|
||||
metadata.errorCode = 0
|
||||
metadata.errorKind = ""
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,10 +96,6 @@ extension NCManageDatabase {
|
||||
if let errorCode {
|
||||
metadata.errorCode = errorCode
|
||||
}
|
||||
|
||||
if let errorKind {
|
||||
metadata.errorKind = errorKind
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -130,7 +123,6 @@ extension NCManageDatabase {
|
||||
metadata.session = session
|
||||
metadata.sessionTaskIdentifier = 0
|
||||
metadata.sessionError = ""
|
||||
metadata.errorKind = ""
|
||||
metadata.sessionSelector = selector
|
||||
metadata.status = NCGlobal.shared.metadataStatusWaitDownload
|
||||
}
|
||||
@@ -160,7 +152,6 @@ extension NCManageDatabase {
|
||||
metadata.session = ""
|
||||
metadata.sessionTaskIdentifier = 0
|
||||
metadata.sessionError = ""
|
||||
metadata.errorKind = ""
|
||||
metadata.sessionSelector = ""
|
||||
metadata.status = NCGlobal.shared.metadataStatusNormal
|
||||
return metadata
|
||||
@@ -180,7 +171,6 @@ extension NCManageDatabase {
|
||||
|
||||
object.session = ""
|
||||
object.sessionError = ""
|
||||
object.errorKind = ""
|
||||
object.sessionTaskIdentifier = 0
|
||||
object.status = NCGlobal.shared.metadataStatusNormal
|
||||
}
|
||||
|
||||
@@ -125,8 +125,6 @@ class tableMetadata: Object {
|
||||
@objc dynamic var height: Int = 0
|
||||
@objc dynamic var width: Int = 0
|
||||
@objc dynamic var errorCode: Int = 0
|
||||
/// Raw value of the saved error's `NKError.Kind`; empty when there's no error or it's unknown.
|
||||
@objc dynamic var errorKind = ""
|
||||
@objc dynamic var nativeFormat: Bool = false
|
||||
@objc dynamic var autoUploadServerUrlBase: String?
|
||||
@objc dynamic var typeIdentifier: String = ""
|
||||
@@ -380,18 +378,6 @@ extension tableMetadata {
|
||||
}
|
||||
}
|
||||
|
||||
#if !EXTENSION || EXTENSION_SHARE
|
||||
extension tableMetadata {
|
||||
/// The saved error, worded for people from its `errorKind` (or `errorCode` for older records) and the operation the item failed at.
|
||||
var sessionErrorMessage: String {
|
||||
let error = NKError(errorCode: errorCode, errorDescription: sessionError, kind: NKError.Kind(rawValue: errorKind))
|
||||
let context = NCErrorContext(metadataStatus: status, fileName: fileNameView)
|
||||
|
||||
return error.userFriendlyMessage(for: context) ?? error.localizedGenericMessage
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
extension NCManageDatabase {
|
||||
#if !EXTENSION
|
||||
func isMetadataShareOrMounted(metadata: tableMetadata, metadataFolder: tableMetadata?) -> Bool {
|
||||
|
||||
@@ -32,7 +32,6 @@ actor NCMetadataDownloadTranfersSuccess {
|
||||
func append(metadata: tableMetadata, etag: String?) async {
|
||||
metadata.session = ""
|
||||
metadata.sessionError = ""
|
||||
metadata.errorKind = ""
|
||||
metadata.sessionTaskIdentifier = 0
|
||||
metadata.status = NCGlobal.shared.metadataStatusNormal
|
||||
if let etag = etag {
|
||||
|
||||
@@ -62,7 +62,6 @@ actor NCMetadataUploadTranfersSuccess {
|
||||
|
||||
metadata.session = ""
|
||||
metadata.sessionError = ""
|
||||
metadata.errorKind = ""
|
||||
metadata.sessionTaskIdentifier = 0
|
||||
metadata.status = NCGlobal.shared.metadataStatusNormal
|
||||
|
||||
|
||||
@@ -11,14 +11,15 @@ extension UIAlertController {
|
||||
/// Creates a alert controller with a textfield, asking to create a new folder
|
||||
/// - Parameters:
|
||||
/// - serverUrl: Server url of the location where the folder should be created
|
||||
/// - completion: Receives the result and the folder name.
|
||||
/// - urlBase: UrlBase object
|
||||
/// - completion: If not` nil` it overrides the default behavior which shows an error
|
||||
/// - Returns: The presentable alert controller
|
||||
static func createFolderWith(serverUrl: String,
|
||||
session: NCSession.Session,
|
||||
markE2ee: Bool = false,
|
||||
sceneIdentifier: String? = nil,
|
||||
capabilities: NKCapabilities.Capabilities,
|
||||
completion: ((_ error: NKError, _ folderName: String) -> Void)? = nil) -> UIAlertController {
|
||||
completion: ((_ error: NKError) -> Void)? = nil) -> UIAlertController {
|
||||
let alertController = UIAlertController(title: NSLocalizedString("_create_folder_", comment: ""), message: nil, preferredStyle: .alert)
|
||||
let isDirectoryEncrypted = NCUtilityFileSystem().isDirectoryE2EE(serverUrl: serverUrl, urlBase: session.urlBase, userId: session.userId, account: session.account)
|
||||
|
||||
@@ -27,7 +28,7 @@ extension UIAlertController {
|
||||
|
||||
if markE2ee {
|
||||
if NCNetworking.shared.isOffline {
|
||||
completion?(NKError(errorCode: NCGlobal.shared.errorOfflineNotAllowed, errorDescription: "_offline_not_allowed_"), fileNameFolder)
|
||||
completion?(NKError(errorCode: NCGlobal.shared.errorOfflineNotAllowed, errorDescription: "_offline_not_allowed_"))
|
||||
return
|
||||
}
|
||||
Task {
|
||||
@@ -50,30 +51,30 @@ extension UIAlertController {
|
||||
banner.dismiss()
|
||||
}
|
||||
}
|
||||
completion?(error, fileNameFolder)
|
||||
completion?(error)
|
||||
} else {
|
||||
if let banner {
|
||||
banner.dismiss()
|
||||
}
|
||||
completion?(createFolderResults.error, fileNameFolder)
|
||||
completion?(NKError(errorCode: createFolderResults.error.errorCode, errorDescription: createFolderResults.error.errorDescription))
|
||||
}
|
||||
}
|
||||
} else if isDirectoryEncrypted {
|
||||
Task {
|
||||
if NCNetworking.shared.isOffline {
|
||||
completion?(NKError(errorCode: NCGlobal.shared.errorOfflineNotAllowed, errorDescription: "_offline_not_allowed_"), fileNameFolder)
|
||||
completion?(NKError(errorCode: NCGlobal.shared.errorOfflineNotAllowed, errorDescription: "_offline_not_allowed_"))
|
||||
return
|
||||
}
|
||||
|
||||
let error = await NCNetworkingE2EECreateFolder().createFolder(fileName: fileNameFolder, serverUrl: serverUrl, sceneIdentifier: sceneIdentifier, session: session)
|
||||
|
||||
completion?(error, fileNameFolder)
|
||||
completion?(error)
|
||||
}
|
||||
} else {
|
||||
#if EXTENSION
|
||||
Task {
|
||||
let error = await NCNetworking.shared.createFolder(fileName: fileNameFolder, serverUrl: serverUrl, overwrite: false, session: session)
|
||||
completion?(error, fileNameFolder)
|
||||
completion?(error)
|
||||
}
|
||||
#else
|
||||
var metadata = tableMetadata()
|
||||
@@ -330,6 +331,47 @@ extension UIAlertController {
|
||||
}
|
||||
}
|
||||
|
||||
@MainActor
|
||||
static func failedPasscode(presenter: UIViewController, completion: (() -> Void)? = nil) {
|
||||
let preferences = NCPreferences()
|
||||
let deadline: Date
|
||||
|
||||
if let pending = preferences.passcodeLockoutEnd {
|
||||
guard pending > Date() else {
|
||||
endPasscodeLockout(completion: completion)
|
||||
return
|
||||
}
|
||||
|
||||
deadline = pending
|
||||
} else {
|
||||
deadline = Date().addingTimeInterval(TimeInterval(NCBrandOptions.shared.passcodeSecondsFail))
|
||||
preferences.passcodeLockoutEnd = deadline
|
||||
}
|
||||
|
||||
let alertController = UIAlertController(title: NSLocalizedString("_passcode_counter_fail_", comment: ""), message: nil, preferredStyle: .alert)
|
||||
presenter.present(alertController, animated: true)
|
||||
|
||||
alertController.message = "\(Int(deadline.timeIntervalSinceNow.rounded(.up))) " + NSLocalizedString("_seconds_", comment: "")
|
||||
|
||||
_ = Timer.scheduledTimer(withTimeInterval: 1.0, repeats: true) { timer in
|
||||
let seconds = Int(deadline.timeIntervalSinceNow.rounded(.up))
|
||||
|
||||
if seconds > 0 {
|
||||
alertController.message = "\(seconds) " + NSLocalizedString("_seconds_", comment: "")
|
||||
} else {
|
||||
timer.invalidate()
|
||||
alertController.dismiss(animated: true)
|
||||
endPasscodeLockout(completion: completion)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static func endPasscodeLockout(completion: (() -> Void)?) {
|
||||
NCPreferences().clearPasscodeFailures()
|
||||
|
||||
completion?()
|
||||
}
|
||||
|
||||
/// Presents a localized confirmation alert and asynchronously returns the user's choice.
|
||||
///
|
||||
/// - Parameters:
|
||||
|
||||
+103
-14
@@ -9,6 +9,10 @@ import SwiftUI
|
||||
|
||||
class NCFiles: NCCollectionViewCommon {
|
||||
private var dataSourceTask: URLSessionTask?
|
||||
private var folderPollingTask: Task<Void, Never>?
|
||||
private var folderPollingNetworkTask: URLSessionTask?
|
||||
// Prevent polling from starting another refresh while server data is loading.
|
||||
private var serverDataRequests = 0
|
||||
internal var lastOffsetY: CGFloat = 0
|
||||
internal var lastScrollTime: TimeInterval = 0
|
||||
internal var accumulatedScrollDown: CGFloat = 0
|
||||
@@ -44,8 +48,15 @@ class NCFiles: NCCollectionViewCommon {
|
||||
}
|
||||
}
|
||||
|
||||
NotificationCenter.default.addObserver(forName: UIApplication.didBecomeActiveNotification, object: nil, queue: .main) { [weak self] _ in
|
||||
Task { @MainActor in
|
||||
self?.startFolderPolling()
|
||||
}
|
||||
}
|
||||
|
||||
NotificationCenter.default.addObserver(forName: UIApplication.didEnterBackgroundNotification, object: nil, queue: nil) { _ in
|
||||
Task {
|
||||
Task { @MainActor in
|
||||
self.stopFolderPolling()
|
||||
await self.stopSyncMetadata()
|
||||
await self.searchOperationHandle.cancel()
|
||||
}
|
||||
@@ -124,6 +135,7 @@ class NCFiles: NCCollectionViewCommon {
|
||||
|
||||
override func viewDidAppear(_ animated: Bool) {
|
||||
super.viewDidAppear(animated)
|
||||
startFolderPolling()
|
||||
|
||||
Task {
|
||||
// (+)
|
||||
@@ -138,15 +150,78 @@ class NCFiles: NCCollectionViewCommon {
|
||||
|
||||
override func viewWillDisappear(_ animated: Bool) {
|
||||
super.viewWillDisappear(animated)
|
||||
|
||||
dataSourceTask?.cancel()
|
||||
dataSourceTask = nil
|
||||
stopFolderPolling()
|
||||
|
||||
Task {
|
||||
await stopSyncMetadata()
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Folder polling
|
||||
|
||||
/// Checks the folder every 30 seconds while this is the current Files controller.
|
||||
/// Called when the view appears or the app becomes active; duplicate starts are ignored.
|
||||
private func startFolderPolling() {
|
||||
guard folderPollingTask == nil, viewIfLoaded?.window != nil, controller?.currentViewController() === self else { return }
|
||||
folderPollingTask = Task { @MainActor [weak self] in
|
||||
while !Task.isCancelled {
|
||||
do {
|
||||
try await Task.sleep(for: .seconds(30))
|
||||
} catch {
|
||||
return
|
||||
}
|
||||
guard let self else { return }
|
||||
await self.pollFolder()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Stops polling and cancels folder requests when leaving the view or entering background.
|
||||
private func stopFolderPolling() {
|
||||
folderPollingTask?.cancel()
|
||||
folderPollingTask = nil
|
||||
folderPollingNetworkTask?.cancel()
|
||||
folderPollingNetworkTask = nil
|
||||
dataSourceTask?.cancel()
|
||||
dataSourceTask = nil
|
||||
}
|
||||
|
||||
/// Reads only the folder metadata and reuses the existing refresh when its ETag changes.
|
||||
private func pollFolder() async {
|
||||
// Skip this cycle while the window is inactive or the user is interacting with the list.
|
||||
guard viewIfLoaded?.window?.windowScene?.activationState == .foregroundActive,
|
||||
presentedViewController == nil, !isSearchingMode, !isEditMode, serverDataRequests == 0,
|
||||
!collectionView.isTracking, !collectionView.isDecelerating else { return }
|
||||
|
||||
let account = session.account
|
||||
let serverUrl = self.serverUrl
|
||||
let directory = await database.getTableDirectoryAsync(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@", account, serverUrl))
|
||||
let etag = directory?.etag
|
||||
// Keep this cycle's task so a late network callback cannot attach to a restarted loop.
|
||||
let pollingTask = folderPollingTask
|
||||
guard !Task.isCancelled else { return }
|
||||
|
||||
let result = await networking.readFileAsync(serverUrlFileName: serverUrl, account: account) { task in
|
||||
Task { @MainActor in
|
||||
// Cancelling the Swift task does not automatically cancel the HTTP request.
|
||||
if pollingTask?.isCancelled == true {
|
||||
task.cancel()
|
||||
} else {
|
||||
self.folderPollingNetworkTask = task
|
||||
}
|
||||
}
|
||||
}
|
||||
// The account, folder or search mode may have changed while awaiting the response.
|
||||
guard !Task.isCancelled, account == session.account, serverUrl == self.serverUrl,
|
||||
viewIfLoaded?.window?.windowScene?.activationState == .foregroundActive,
|
||||
presentedViewController == nil, !isSearchingMode, !isEditMode, serverDataRequests == 0,
|
||||
!collectionView.isTracking, !collectionView.isDecelerating,
|
||||
result.error == .success, let metadata = result.metadata, metadata.etag != etag else { return }
|
||||
|
||||
// The existing refresh checks the ETag again before reading the folder contents.
|
||||
await getServerData()
|
||||
}
|
||||
|
||||
// MARK: - DataSource
|
||||
|
||||
override func reloadDataSource() async {
|
||||
@@ -179,9 +254,13 @@ class NCFiles: NCCollectionViewCommon {
|
||||
}
|
||||
|
||||
override func getServerData(forced: Bool = false) async {
|
||||
serverDataRequests += 1
|
||||
defer {
|
||||
serverDataRequests -= 1
|
||||
stopGUIGetServerData()
|
||||
startSyncMetadata(metadatas: self.dataSource.getMetadatas())
|
||||
if !Task.isCancelled {
|
||||
startSyncMetadata(metadatas: self.dataSource.getMetadatas())
|
||||
}
|
||||
}
|
||||
|
||||
dataSourceTask?.cancel()
|
||||
@@ -198,7 +277,7 @@ class NCFiles: NCCollectionViewCommon {
|
||||
|
||||
let effectiveForced = forced || hasPlaceholder
|
||||
let resultsReadFolder = await networkReadFolderAsync(serverUrl: self.serverUrl, forced: effectiveForced)
|
||||
guard resultsReadFolder.error == .success, resultsReadFolder.reloadRequired else {
|
||||
guard !Task.isCancelled, resultsReadFolder.error == .success, resultsReadFolder.reloadRequired else {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -237,10 +316,17 @@ class NCFiles: NCCollectionViewCommon {
|
||||
}
|
||||
|
||||
private func networkReadFolderAsync(serverUrl: String, forced: Bool) async -> (metadatas: [tableMetadata]?, error: NKError, reloadRequired: Bool) {
|
||||
guard !Task.isCancelled else { return (nil, .success, false) }
|
||||
var reloadRequired: Bool = false
|
||||
let account = session.account
|
||||
let pollingTask = folderPollingTask
|
||||
let resultsReadFile = await NCNetworking.shared.readFileAsync(serverUrlFileName: serverUrl, account: account) { task in
|
||||
Task { @MainActor in
|
||||
// The request callback can arrive after the polling cycle was stopped.
|
||||
guard pollingTask?.isCancelled != true else {
|
||||
task.cancel()
|
||||
return
|
||||
}
|
||||
self.dataSourceTask = task
|
||||
|
||||
if self.dataSource.isEmpty() {
|
||||
@@ -258,6 +344,7 @@ class NCFiles: NCCollectionViewCommon {
|
||||
await self.database.updateDirectoryRichWorkspaceAsync(metadata.richWorkspace, account: account, serverUrl: serverUrl)
|
||||
let tableDirectory = await self.database.getTableDirectoryAsync(ocId: metadata.ocId)
|
||||
|
||||
guard !Task.isCancelled else { return (nil, .success, false) }
|
||||
// Verify LivePhoto
|
||||
//
|
||||
reloadRequired = await networking.setLivePhoto(account: account)
|
||||
@@ -283,6 +370,10 @@ class NCFiles: NCCollectionViewCommon {
|
||||
options: options
|
||||
) { task in
|
||||
Task { @MainActor in
|
||||
guard pollingTask?.isCancelled != true else {
|
||||
task.cancel()
|
||||
return
|
||||
}
|
||||
self.dataSourceTask = task
|
||||
|
||||
if self.dataSource.isEmpty() {
|
||||
@@ -291,7 +382,7 @@ class NCFiles: NCCollectionViewCommon {
|
||||
}
|
||||
}
|
||||
|
||||
guard resultsReadFolder.error == .success else {
|
||||
guard !Task.isCancelled, resultsReadFolder.error == .success else {
|
||||
return(nil, resultsReadFolder.error, reloadRequired)
|
||||
}
|
||||
reloadRequired = true
|
||||
@@ -317,7 +408,7 @@ class NCFiles: NCCollectionViewCommon {
|
||||
|
||||
// Client Diagnostic
|
||||
await self.database.addDiagnosticAsync(account: account, issue: NCGlobal.shared.diagnosticIssueE2eeErrors)
|
||||
await showErrorBanner(windowScene: windowScene, error: error)
|
||||
await showErrorBanner(windowScene: windowScene, text: error.errorDescription, errorCode: error.errorCode)
|
||||
}
|
||||
|
||||
return (metadatas, error, reloadRequired)
|
||||
@@ -339,9 +430,9 @@ class NCFiles: NCCollectionViewCommon {
|
||||
// Continue: the previous key was archived and can still offer
|
||||
// read-only access to storage spaces encrypted with it.
|
||||
} catch let error as NKError {
|
||||
await showErrorBanner(windowScene: windowScene, error: error)
|
||||
await showErrorBanner(windowScene: windowScene, text: error.errorDescription)
|
||||
} catch {
|
||||
await showErrorBanner(windowScene: windowScene, error: NKError(error: error))
|
||||
await showErrorBanner(windowScene: windowScene, text: error.localizedDescription)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -363,11 +454,9 @@ class NCFiles: NCCollectionViewCommon {
|
||||
return storedAccess.writeAccessError
|
||||
}
|
||||
} catch {
|
||||
nkLog(tag: global.logTagE2EE, emoji: .error, message: "Unable to read the stored encryption keys: \(error)")
|
||||
|
||||
return NKError(
|
||||
errorCode: global.errorInternalError,
|
||||
errorDescription: NSLocalizedString("_e2ee_no_metadataKey_found_", comment: "")
|
||||
errorDescription: error.localizedDescription
|
||||
)
|
||||
}
|
||||
|
||||
@@ -382,7 +471,7 @@ class NCFiles: NCCollectionViewCommon {
|
||||
guard result.error == .success,
|
||||
let e2eMetadata = result.e2eMetadata,
|
||||
let version = result.version else {
|
||||
nkLog(tag: self.global.logTagE2EE, message: result.error.logDescription)
|
||||
nkLog(tag: self.global.logTagE2EE, message: returnError.errorDescription)
|
||||
return result.error
|
||||
}
|
||||
|
||||
|
||||
@@ -5,18 +5,14 @@
|
||||
import SwiftUI
|
||||
import LucidBanner
|
||||
import NextcloudKit
|
||||
import Alamofire
|
||||
|
||||
@MainActor
|
||||
func showErrorBanner(windowScene: UIWindowScene?,
|
||||
error: NKError,
|
||||
context: NCErrorContext = .generic) async {
|
||||
guard let text = error.userFriendlyMessage(for: context) else { return }
|
||||
|
||||
nkLog(error: "Error shown for \(context): \(error.logDescription)")
|
||||
|
||||
error: NKError) async {
|
||||
await showErrorBanner(windowScene: windowScene,
|
||||
title: context.failureTitle ?? "_error_",
|
||||
text: text,
|
||||
title: "_error_",
|
||||
text: error.errorDescription,
|
||||
errorCode: error.errorCode)
|
||||
}
|
||||
|
||||
@@ -25,7 +21,8 @@ func showErrorBanner(windowScene: UIWindowScene?,
|
||||
title: String = "_error_",
|
||||
text: String,
|
||||
footnote: String? = nil,
|
||||
errorCode: Int? = nil) async {
|
||||
errorCode: Int? = nil,
|
||||
afError: AFError? = nil) async {
|
||||
guard let windowScene,
|
||||
let window = windowScene.resolvedWindow else {
|
||||
return
|
||||
|
||||
@@ -56,13 +56,12 @@ func completeHudBannerSuccess(token: Int?, banner: LucidBanner?) {
|
||||
}
|
||||
|
||||
@MainActor
|
||||
func completeHudBannerError(title: String? = nil, description: String, token: Int?, banner: LucidBanner?) {
|
||||
func completeHudBannerError(description: String, token: Int?, banner: LucidBanner?) {
|
||||
guard let banner else {
|
||||
return
|
||||
}
|
||||
|
||||
let payload = LucidBannerPayload.Update(
|
||||
title: title.map { NSLocalizedString($0, comment: "") },
|
||||
subtitle: NSLocalizedString(description, comment: ""),
|
||||
stage: .error,
|
||||
autoDismissAfter: NCGlobal.shared.dismissAfterSecond
|
||||
|
||||
@@ -120,7 +120,7 @@ struct UploadBannerView: View {
|
||||
.foregroundStyle(.white)
|
||||
|
||||
VStack(alignment: .leading, spacing: 7) {
|
||||
Text(state.payload.title ?? NSLocalizedString("_error_", comment: ""))
|
||||
Text("_error_")
|
||||
.cappedFont(.subheadline, maxDynamicType: .accessibility1)
|
||||
.multilineTextAlignment(.leading)
|
||||
.truncationMode(.tail)
|
||||
|
||||
@@ -368,17 +368,6 @@ class NCLogin: UIViewController, UITextFieldDelegate, NCLoginQRCodeDelegate {
|
||||
loginProvider.startPolling(loginFlowV2Token: token, loginFlowV2Endpoint: endpoint, loginFlowV2Login: login)
|
||||
loginProvider.startAuthentication()
|
||||
self.activeLoginProvider = loginProvider
|
||||
} else {
|
||||
let loginFlowError = error == .success ? NKError.invalidData : error
|
||||
|
||||
nkLog(error: "Login flow v2 failed: \(loginFlowError.logDescription)")
|
||||
|
||||
loginButton.hideSpinnerAndShowButton()
|
||||
loginButton.isEnabled = true
|
||||
|
||||
let alertController = UIAlertController(title: NSLocalizedString("_connection_error_", comment: ""), message: loginFlowError.localizedGenericMessage, preferredStyle: .alert)
|
||||
alertController.addAction(UIAlertAction(title: NSLocalizedString("_ok_", comment: ""), style: .default, handler: { _ in }))
|
||||
self.present(alertController, animated: true, completion: { })
|
||||
}
|
||||
}
|
||||
case .failure(let error):
|
||||
@@ -424,7 +413,7 @@ class NCLogin: UIViewController, UITextFieldDelegate, NCLoginQRCodeDelegate {
|
||||
self.present(alertController, animated: true)
|
||||
#endif
|
||||
} else {
|
||||
let alertController = UIAlertController(title: NSLocalizedString("_connection_error_", comment: ""), message: error.localizedGenericMessage, preferredStyle: .alert)
|
||||
let alertController = UIAlertController(title: NSLocalizedString("_connection_error_", comment: ""), message: error.errorDescription, preferredStyle: .alert)
|
||||
alertController.addAction(UIAlertAction(title: NSLocalizedString("_ok_", comment: ""), style: .default, handler: { _ in }))
|
||||
self.present(alertController, animated: true, completion: { })
|
||||
}
|
||||
@@ -471,10 +460,7 @@ class NCLogin: UIViewController, UITextFieldDelegate, NCLoginQRCodeDelegate {
|
||||
await createAccount(urlBase: server, user: user, password: token)
|
||||
} else {
|
||||
let windowScene = SceneManager.shared.getWindowScene(controller: self.controller)
|
||||
|
||||
let error = results.error == .success ? NKError.invalidData : results.error
|
||||
|
||||
await showErrorBanner(windowScene: windowScene, error: error)
|
||||
await showErrorBanner(windowScene: windowScene, text: results.error.errorDescription, errorCode: results.error.errorCode)
|
||||
dismiss(animated: true, completion: nil)
|
||||
}
|
||||
} else if value.hasPrefix(protocolLogin) {
|
||||
@@ -490,10 +476,7 @@ class NCLogin: UIViewController, UITextFieldDelegate, NCLoginQRCodeDelegate {
|
||||
await self.createAccount(urlBase: urlBase, user: user, password: password)
|
||||
} else {
|
||||
let windowScene = SceneManager.shared.getWindowScene(controller: self.controller)
|
||||
|
||||
let error = results.error == .success ? NKError.invalidData : results.error
|
||||
|
||||
await showErrorBanner(windowScene: windowScene, error: error)
|
||||
await showErrorBanner(windowScene: windowScene, text: results.error.errorDescription, errorCode: results.error.errorCode)
|
||||
dismiss(animated: true, completion: nil)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -265,7 +265,7 @@ extension NCCollectionViewCommon {
|
||||
|
||||
if !metadata.sessionError.isEmpty, metadata.status != global.metadataStatusNormal {
|
||||
cell.labelSubinfo.isHidden = false
|
||||
cell.labelInfo.text = metadata.sessionErrorMessage
|
||||
cell.labelInfo.text = metadata.sessionError
|
||||
} else {
|
||||
cell.labelSubinfo.isHidden = false
|
||||
cell.writeInfoDateSize(date: metadata.date, size: metadata.size)
|
||||
|
||||
@@ -462,7 +462,7 @@ extension NCCollectionViewCommon {
|
||||
cell.labelSubinfo?.isHidden = true
|
||||
} else if !metadata.sessionError.isEmpty, metadata.status != global.metadataStatusNormal {
|
||||
cell.labelSubinfo?.isHidden = false
|
||||
cell.labelInfo?.text = metadata.sessionErrorMessage
|
||||
cell.labelInfo?.text = metadata.sessionError
|
||||
} else {
|
||||
cell.labelSubinfo?.isHidden = false
|
||||
cell.writeInfoDateSize(date: metadata.date, size: metadata.size)
|
||||
|
||||
+11
-7
@@ -23,10 +23,17 @@ extension NCCollectionViewCommon: UICollectionViewDelegate {
|
||||
if error.errorCode == NSUserCancelledError {
|
||||
return
|
||||
}
|
||||
await showErrorBanner(windowScene: windowScene, error: error)
|
||||
await showErrorBanner(
|
||||
windowScene: windowScene,
|
||||
text: error.errorDescription
|
||||
)
|
||||
return
|
||||
} catch {
|
||||
await showErrorBanner(windowScene: windowScene, error: NKError(error: error))
|
||||
// fallback (non NKError)
|
||||
await showErrorBanner(
|
||||
windowScene: windowScene,
|
||||
text: error.localizedDescription
|
||||
)
|
||||
return
|
||||
}
|
||||
}
|
||||
@@ -74,7 +81,7 @@ extension NCCollectionViewCommon: UICollectionViewDelegate {
|
||||
if results.nkError == .success || results.nkError == .cancelled {
|
||||
print("ok")
|
||||
} else {
|
||||
await showErrorBanner(windowScene: windowScene, error: results.nkError, context: .download(fileName: metadata.fileNameView))
|
||||
await showErrorBanner(windowScene: windowScene, text: results.nkError.errorDescription, errorCode: results.nkError.errorCode)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -125,10 +132,7 @@ extension NCCollectionViewCommon: UICollectionViewDelegate {
|
||||
self.navigationController?.pushViewController(vc, animated: true)
|
||||
}
|
||||
} else {
|
||||
await showErrorBanner(windowScene: windowScene,
|
||||
title: NCErrorContext.openDocument(fileName: metadata.fileNameView).failureTitle ?? "_error_",
|
||||
text: "_go_online_",
|
||||
errorCode: NCGlobal.shared.errorOfflineNotAllowed)
|
||||
await showErrorBanner(windowScene: windowScene, text: "_go_online_", errorCode: NCGlobal.shared.errorOfflineNotAllowed)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
import Foundation
|
||||
import NextcloudKit
|
||||
import Alamofire
|
||||
|
||||
extension NCCollectionViewCommon {
|
||||
@MainActor
|
||||
@@ -69,7 +70,8 @@ extension NCCollectionViewCommon {
|
||||
)
|
||||
} else {
|
||||
await showErrorBanner(windowScene: windowScene,
|
||||
error: results.error)
|
||||
text: results.error.errorDescription,
|
||||
errorCode: results.error.errorCode)
|
||||
}
|
||||
|
||||
collectionView.reloadData()
|
||||
@@ -110,7 +112,9 @@ extension NCCollectionViewCommon {
|
||||
|
||||
if results.error != .success {
|
||||
await showErrorBanner(windowScene: windowScene,
|
||||
error: results.error)
|
||||
text: results.error.errorDescription,
|
||||
errorCode: results.error.errorCode,
|
||||
afError: results.error.error as? AFError)
|
||||
}
|
||||
|
||||
guard isSearchingMode,
|
||||
@@ -141,7 +145,9 @@ extension NCCollectionViewCommon {
|
||||
|
||||
if results.error != .success {
|
||||
await showErrorBanner(windowScene: windowScene,
|
||||
error: results.error)
|
||||
text: results.error.errorDescription,
|
||||
errorCode: results.error.errorCode,
|
||||
afError: results.error.error as? AFError)
|
||||
}
|
||||
|
||||
guard isSearchingMode,
|
||||
@@ -198,7 +204,9 @@ extension NCCollectionViewCommon {
|
||||
|
||||
if results.error != .success {
|
||||
await showErrorBanner(windowScene: windowScene,
|
||||
error: results.error)
|
||||
text: results.error.errorDescription,
|
||||
errorCode: results.error.errorCode,
|
||||
afError: results.error.error as? AFError)
|
||||
}
|
||||
|
||||
guard isSearchingMode,
|
||||
|
||||
@@ -94,7 +94,7 @@ extension NCCollectionViewCommon {
|
||||
guard resultsReadFile.error == .success,
|
||||
let metadata = resultsReadFile.metadata,
|
||||
!metadata.e2eEncrypted else {
|
||||
nkLog(tag: global.logTagSpeedUpSyncMetadata, emoji: .info, message: "Exit: result \(resultsReadFile.error.logDescription) or e2ee directory \(resultsReadFile.metadata?.e2eEncrypted ?? false). Skipping this one.")
|
||||
nkLog(tag: global.logTagSpeedUpSyncMetadata, emoji: .info, message: "Exit: result error \(resultsReadFile.error.errorDescription) or e2ee directory \(resultsReadFile.metadata?.e2eEncrypted ?? false). Skipping this one.")
|
||||
return
|
||||
}
|
||||
}
|
||||
@@ -139,7 +139,7 @@ extension NCCollectionViewCommon {
|
||||
if resultsReadFolder.error == .success {
|
||||
nkLog(tag: global.logTagSpeedUpSyncMetadata, emoji: .network, message: "Read correctly: \(serverUrl)", consoleOnly: true)
|
||||
} else {
|
||||
nkLog(tag: global.logTagSpeedUpSyncMetadata, emoji: .error, message: "Read failed for \(serverUrl) with \(resultsReadFolder.error.logDescription)")
|
||||
nkLog(tag: global.logTagSpeedUpSyncMetadata, emoji: .error, message: "Read failed for \(serverUrl) with error: \(resultsReadFolder.error.errorDescription)")
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -133,8 +133,8 @@ extension NCCollectionViewCommon: UIEditMenuInteractionDelegate {
|
||||
} else {
|
||||
Task {
|
||||
await showErrorBanner(windowScene: windowScene,
|
||||
error: resultsUpload.error,
|
||||
context: .upload(fileName: fileName))
|
||||
text: resultsUpload.error.errorDescription,
|
||||
errorCode: resultsUpload.error.errorCode)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -872,7 +872,7 @@ extension NCCollectionViewCommon: NCTransferDelegate {
|
||||
Task {
|
||||
if error != .success,
|
||||
error.errorCode != global.errorResourceNotFound {
|
||||
await showErrorBanner(windowScene: windowScene, error: error, context: NCErrorContext(networkingStatus: networkingStatus, fileName: fileName))
|
||||
await showErrorBanner(windowScene: windowScene, text: error.errorDescription, errorCode: error.errorCode)
|
||||
}
|
||||
|
||||
guard session.account == account else {
|
||||
|
||||
@@ -113,7 +113,7 @@ class NCSectionFirstHeader: UICollectionReusableView, UIGestureRecognizerDelegat
|
||||
self.richWorkspaceText = richWorkspaceText
|
||||
}
|
||||
setRichWorkspaceColor()
|
||||
let recommendationsChanged = self.recommendations.count != recommendations.count || self.recommendations.first?.account != recommendations.first?.account
|
||||
let accountChanged = self.recommendations.first?.account != recommendations.first?.account
|
||||
contentRequestID = UUID()
|
||||
let requestID = contentRequestID
|
||||
self.recommendations = recommendations
|
||||
@@ -143,7 +143,7 @@ class NCSectionFirstHeader: UICollectionReusableView, UIGestureRecognizerDelegat
|
||||
viewSection.isHidden = false
|
||||
}
|
||||
|
||||
if recommendationsChanged {
|
||||
if accountChanged {
|
||||
recommendationsIdentity = []
|
||||
collectionViewRecommendations.reloadData()
|
||||
}
|
||||
@@ -204,22 +204,14 @@ extension NCSectionFirstHeader: UICollectionViewDataSource {
|
||||
}
|
||||
|
||||
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
|
||||
guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "cell", for: indexPath) as? NCRecommendationsCell else {
|
||||
let recommendedFile = self.recommendations[indexPath.row]
|
||||
guard let cell = collectionView.dequeueReusableCell(
|
||||
withReuseIdentifier: "cell",
|
||||
for: indexPath
|
||||
) as? NCRecommendationsCell else {
|
||||
fatalError("Unable to dequeue NCRecommendationsCell")
|
||||
}
|
||||
|
||||
guard recommendations.indices.contains(indexPath.item) else {
|
||||
cell.imageRequestID = UUID()
|
||||
cell.metadata = nil
|
||||
cell.image.image = nil
|
||||
cell.labelInfo.text = nil
|
||||
cell.labelFilename.text = nil
|
||||
cell.labelExtensionFilename.text = nil
|
||||
return cell
|
||||
}
|
||||
|
||||
let recommendedFile = recommendations[indexPath.item]
|
||||
|
||||
cell.representedFileId = recommendedFile.id
|
||||
cell.representedAccount = recommendedFile.account
|
||||
cell.imageRequestID = UUID()
|
||||
|
||||
@@ -62,7 +62,7 @@ class NCCreate: NSObject {
|
||||
let editorURL = results.url,
|
||||
!editorURL.isEmpty else {
|
||||
let error: NKError = results.error == .success ? .invalidData : results.error
|
||||
await showErrorBanner(windowScene: windowScene, error: error, context: .createDocument(fileName: fileName))
|
||||
await showErrorBanner(windowScene: windowScene, text: error.errorDescription, errorCode: error.errorCode)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ class NCCreate: NSObject {
|
||||
let editorURL = results.url,
|
||||
!editorURL.isEmpty else {
|
||||
let error: NKError = results.error == .success ? .invalidData : results.error
|
||||
await showErrorBanner(windowScene: windowScene, error: error, context: .createDocument(fileName: fileName))
|
||||
await showErrorBanner(windowScene: windowScene, text: error.errorDescription, errorCode: error.errorCode)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -170,11 +170,10 @@ class NCCreate: NSObject {
|
||||
)
|
||||
guard results.error == .success, let metadata = results.metadata else {
|
||||
let windowScene = SceneManager.shared.getWindowScene(controller: controller)
|
||||
let error: NKError = results.error == .success ? .invalidData : results.error
|
||||
await showErrorBanner(
|
||||
windowScene: windowScene,
|
||||
error: error,
|
||||
context: .openDocument(fileName: (serverUrlFileName as NSString).lastPathComponent)
|
||||
text: results.error.errorDescription,
|
||||
errorCode: results.error.errorCode
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -146,7 +146,7 @@ class NCDragDrop: NSObject {
|
||||
} catch {
|
||||
Task {
|
||||
let windowScene = await SceneManager.shared.getWindowScene(controller: controller)
|
||||
await showErrorBanner(windowScene: windowScene, error: NKError(error: error), context: .upload(fileName: url.lastPathComponent))
|
||||
await showErrorBanner(windowScene: windowScene, text: error.localizedDescription, errorCode: NCGlobal.shared.errorInternalError)
|
||||
}
|
||||
return
|
||||
}
|
||||
@@ -168,7 +168,7 @@ class NCDragDrop: NSObject {
|
||||
}
|
||||
} else {
|
||||
let windowScene = await SceneManager.shared.getWindowScene(controller: controller)
|
||||
await showErrorBanner(windowScene: windowScene, error: error, context: .moveOrCopy(fileName: metadata.fileNameView))
|
||||
await showErrorBanner(windowScene: windowScene, error: error)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -189,7 +189,7 @@ class NCDragDrop: NSObject {
|
||||
}
|
||||
} else {
|
||||
let windowScene = await SceneManager.shared.getWindowScene(controller: controller)
|
||||
await showErrorBanner(windowScene: windowScene, error: error, context: .moveOrCopy(fileName: metadata.fileNameView))
|
||||
await showErrorBanner(windowScene: windowScene, error: error)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -244,8 +244,8 @@ class NCDragDrop: NSObject {
|
||||
}
|
||||
guard results.nkError == .success else {
|
||||
await showErrorBanner(windowScene: windowScene,
|
||||
error: results.nkError,
|
||||
context: .download(fileName: metadata.fileNameView))
|
||||
text: results.nkError.errorDescription,
|
||||
errorCode: results.nkError.errorCode)
|
||||
break
|
||||
}
|
||||
}
|
||||
@@ -275,8 +275,7 @@ class NCDragDrop: NSObject {
|
||||
}
|
||||
guard results.error == .success else {
|
||||
await showErrorBanner(windowScene: windowScene,
|
||||
error: results.error,
|
||||
context: .upload(fileName: metadata.fileNameView))
|
||||
text: results.error.errorDescription, errorCode: results.error.errorCode)
|
||||
break
|
||||
}
|
||||
|
||||
|
||||
@@ -300,9 +300,11 @@ class NCMainNavigationController: UINavigationController, UINavigationController
|
||||
if let loadingItem, loadingIndicator?.isAnimating == true {
|
||||
items.append(loadingItem)
|
||||
}
|
||||
// Each item can move independently into UIKit's overflow menu.
|
||||
// Match Media: each item has its own group; only the sidebar is always available.
|
||||
navigationItem.leadingItemGroups = items.map { item in
|
||||
UIBarButtonItemGroup(barButtonItems: [item], representativeItem: nil)
|
||||
let group = UIBarButtonItemGroup(barButtonItems: [item], representativeItem: nil)
|
||||
group.alwaysAvailable = item === sidebarButtonItem
|
||||
return group
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -100,11 +100,10 @@ class NCMainTabBarController: UITabBarController {
|
||||
previousIndex = selectedIndex
|
||||
|
||||
if NCBrandOptions.shared.enforce_passcode_lock && NCPreferences().passcode.isEmptyOrNil {
|
||||
NCPasscodeView.present(from: self, mode: .create) { result in
|
||||
if result == .reset {
|
||||
(UIApplication.shared.delegate as? AppDelegate)?.resetApplication()
|
||||
}
|
||||
}
|
||||
let vc = UIHostingController(rootView: SetupPasscodeView(isLockActive: .constant(false), controller: self))
|
||||
vc.isModalInPresentation = true
|
||||
|
||||
present(vc, animated: true)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -257,18 +256,6 @@ class NCMainTabBarController: UITabBarController {
|
||||
}
|
||||
|
||||
extension NCMainTabBarController: UITabBarControllerDelegate {
|
||||
func tabBarController(_ tabBarController: UITabBarController, shouldSelect viewController: UIViewController) -> Bool {
|
||||
// Re-tapping Browse while it shows another sidebar section returns to All Files.
|
||||
guard viewController === selectedViewController,
|
||||
selectedIndex == 0,
|
||||
let filesNavigationController,
|
||||
viewController !== filesNavigationController || filesNavigationController.personalFilesOnly else { return true }
|
||||
|
||||
openSidebarFiles(personalFilesOnly: false)
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
func tabBarController(_ tabBarController: UITabBarController, didSelect viewController: UIViewController) {
|
||||
// Browse retains the sidebar destination, personal filter and folder stack when switching tabs.
|
||||
if previousIndex == tabBarController.selectedIndex {
|
||||
|
||||
@@ -0,0 +1,196 @@
|
||||
// SPDX-FileCopyrightText: Nextcloud GmbH
|
||||
// SPDX-FileCopyrightText: 2024 Marino Faggiana
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
import UIKit
|
||||
import LocalAuthentication
|
||||
|
||||
public protocol NCPasscodeDelegate: AnyObject {
|
||||
func evaluatePolicy(_ passcodeViewController: TOPasscodeViewController, isCorrectCode: Bool)
|
||||
func passcodeReset(_ passcodeViewController: TOPasscodeViewController)
|
||||
func requestedAccount(controller: UIViewController?)
|
||||
}
|
||||
|
||||
public extension NCPasscodeDelegate {
|
||||
func evaluatePolicy(_ passcodeViewController: TOPasscodeViewController, isCorrectCode: Bool) {}
|
||||
func passcodeReset(_ passcodeViewController: TOPasscodeViewController) {}
|
||||
func requestedAccount(controller: UIViewController?) {}
|
||||
}
|
||||
|
||||
class NCPasscode: NSObject, TOPasscodeViewControllerDelegate {
|
||||
public static let shared: NCPasscode = {
|
||||
let instance = NCPasscode()
|
||||
return instance
|
||||
}()
|
||||
var isPasscodeReset: Bool {
|
||||
let passcodeCounterFailReset = NCPreferences().passcodeCounterFailReset
|
||||
return NCPreferences().resetAppCounterFail && passcodeCounterFailReset >= NCBrandOptions.shared.resetAppPasscodeAttempts
|
||||
}
|
||||
|
||||
var isPasscodeCounterFail: Bool {
|
||||
let passcodeCounterFail = NCPreferences().passcodeCounterFail
|
||||
return passcodeCounterFail >= 3
|
||||
}
|
||||
|
||||
var passcodeViewController: TOPasscodeViewController!
|
||||
var delegate: NCPasscodeDelegate?
|
||||
var viewController: UIViewController?
|
||||
|
||||
override init() {
|
||||
super.init()
|
||||
|
||||
NotificationCenter.default.addObserver(self,
|
||||
selector: #selector(applicationDidBecomeActive),
|
||||
name: UIApplication.didBecomeActiveNotification,
|
||||
object: nil)
|
||||
}
|
||||
|
||||
func presentPasscode(viewController: UIViewController, delegate: NCPasscodeDelegate?, completion: @escaping () -> Void) {
|
||||
if viewController.presentedViewController is TOPasscodeViewController { return }
|
||||
|
||||
var error: NSError?
|
||||
self.delegate = delegate
|
||||
self.viewController = viewController
|
||||
|
||||
passcodeViewController = TOPasscodeViewController(passcodeType: .sixDigits, allowCancel: false)
|
||||
passcodeViewController.delegate = self
|
||||
passcodeViewController.keypadButtonShowLettering = false
|
||||
if NCPreferences().touchFaceID, LAContext().canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: &error) {
|
||||
if error == nil {
|
||||
if LAContext().biometryType == .faceID {
|
||||
passcodeViewController.biometryType = .faceID
|
||||
} else if LAContext().biometryType == .touchID {
|
||||
passcodeViewController.biometryType = .touchID
|
||||
}
|
||||
passcodeViewController.allowBiometricValidation = true
|
||||
passcodeViewController.automaticallyPromptForBiometricValidation = false
|
||||
}
|
||||
}
|
||||
viewController.presentedViewController?.dismiss(animated: false)
|
||||
viewController.present(passcodeViewController, animated: true, completion: {
|
||||
// `present` always runs on main thread so this assumption is correct.
|
||||
MainActor.assumeIsolated {
|
||||
self.presentTooManyFailedAttemptsAlertIfNeeded(passcodeViewController: self.passcodeViewController)
|
||||
}
|
||||
completion()
|
||||
})
|
||||
}
|
||||
|
||||
func enableTouchFaceID() {
|
||||
guard NCPreferences().touchFaceID,
|
||||
NCPreferences().presentPasscode,
|
||||
!isPasscodeCounterFail,
|
||||
let passcodeViewController
|
||||
else { return }
|
||||
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
|
||||
LAContext().evaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, localizedReason: NCBrandOptions.shared.brand) { success, evaluateError in
|
||||
if success {
|
||||
DispatchQueue.main.async {
|
||||
passcodeViewController.dismiss(animated: true) {
|
||||
NCPreferences().passcodeCounterFail = 0
|
||||
NCPreferences().passcodeCounterFailReset = 0
|
||||
self.delegate?.evaluatePolicy(passcodeViewController, isCorrectCode: true)
|
||||
if NCPreferences().accountRequest {
|
||||
self.delegate?.requestedAccount(controller: self.viewController)
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if let error = evaluateError {
|
||||
switch error._code {
|
||||
case LAError.userFallback.rawValue, LAError.authenticationFailed.rawValue:
|
||||
NCPreferences().passcodeCounterFail += 1
|
||||
NCPreferences().passcodeCounterFailReset += 1
|
||||
|
||||
// The biometry reply arrives off the main thread.
|
||||
DispatchQueue.main.async {
|
||||
self.presentTooManyFailedAttemptsAlertIfNeeded(passcodeViewController: passcodeViewController)
|
||||
}
|
||||
case LAError.biometryLockout.rawValue:
|
||||
LAContext().evaluatePolicy(LAPolicy.deviceOwnerAuthentication, localizedReason: NSLocalizedString("_deviceOwnerAuthentication_", comment: ""), reply: { success, _ in
|
||||
if success {
|
||||
DispatchQueue.main.async {
|
||||
NCPreferences().passcodeCounterFail = 0
|
||||
self.enableTouchFaceID()
|
||||
}
|
||||
}
|
||||
})
|
||||
default:
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func didInputCorrectPasscode(in passcodeViewController: TOPasscodeViewController) {
|
||||
DispatchQueue.main.async {
|
||||
passcodeViewController.dismiss(animated: true) {
|
||||
NCPreferences().passcodeCounterFail = 0
|
||||
NCPreferences().passcodeCounterFailReset = 0
|
||||
if NCPreferences().accountRequest {
|
||||
self.delegate?.requestedAccount(controller: self.viewController)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func passcodeViewController(_ passcodeViewController: TOPasscodeViewController, isCorrectCode code: String) -> Bool {
|
||||
if code == NCPreferences().passcode {
|
||||
self.delegate?.evaluatePolicy(passcodeViewController, isCorrectCode: true)
|
||||
return true
|
||||
} else {
|
||||
NCPreferences().passcodeCounterFail += 1
|
||||
NCPreferences().passcodeCounterFailReset += 1
|
||||
|
||||
// Keypad taps are delivered on the main thread.
|
||||
MainActor.assumeIsolated {
|
||||
presentTooManyFailedAttemptsAlertIfNeeded(passcodeViewController: passcodeViewController)
|
||||
}
|
||||
|
||||
self.delegate?.evaluatePolicy(passcodeViewController, isCorrectCode: false)
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
func didPerformBiometricValidationRequest(in passcodeViewController: TOPasscodeViewController) {
|
||||
enableTouchFaceID()
|
||||
}
|
||||
|
||||
@MainActor
|
||||
private func presentTooManyFailedAttemptsAlertIfNeeded(passcodeViewController: TOPasscodeViewController) {
|
||||
guard passcodeViewController.presentedViewController == nil else { return }
|
||||
|
||||
// A lockout can elapse while the app is closed; clear it before deciding whether to cover the keypad.
|
||||
if let lockoutEnd = NCPreferences().passcodeLockoutEnd, lockoutEnd <= Date() {
|
||||
NCPreferences().clearPasscodeFailures()
|
||||
}
|
||||
|
||||
if isPasscodeReset {
|
||||
passcodeViewController.setContentHidden(true, animated: true)
|
||||
|
||||
let alertController = UIAlertController(title: NSLocalizedString("_reset_wrong_passcode_", comment: ""), message: nil, preferredStyle: .alert)
|
||||
passcodeViewController.present(alertController, animated: true)
|
||||
|
||||
delegate?.passcodeReset(passcodeViewController)
|
||||
} else if isPasscodeCounterFail {
|
||||
passcodeViewController.setContentHidden(true, animated: true)
|
||||
|
||||
UIAlertController.failedPasscode(presenter: passcodeViewController) {
|
||||
passcodeViewController.setContentHidden(false, animated: true)
|
||||
self.enableTouchFaceID()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@MainActor
|
||||
@objc private func applicationDidBecomeActive() {
|
||||
guard let passcodeViewController,
|
||||
passcodeViewController.view.window != nil
|
||||
else { return }
|
||||
|
||||
presentTooManyFailedAttemptsAlertIfNeeded(passcodeViewController: passcodeViewController)
|
||||
}
|
||||
}
|
||||
+139
-150
@@ -59,27 +59,147 @@ struct NCSidebarView: View {
|
||||
|
||||
var body: some View {
|
||||
GeometryReader { geometry in
|
||||
// Keep the content clear of the landscape camera area, while glass reaches the edge.
|
||||
let leadingInset = contentLeadingInset(geometry: geometry)
|
||||
// Preserve the content width and a visible strip of the underlying screen.
|
||||
let width = max(0, min(320 + leadingInset, geometry.size.width - 56))
|
||||
ZStack(alignment: .leading) {
|
||||
Color.clear
|
||||
if isVisible {
|
||||
sidebarPanel(geometry: geometry)
|
||||
.transition(.move(edge: .leading))
|
||||
VStack {
|
||||
sidebarHeader
|
||||
.onGeometryChange(for: CGFloat.self) { geometry in
|
||||
geometry.size.height
|
||||
} action: { height in
|
||||
headerHeight = height
|
||||
navigationCenterY = navigationBarCenterY()
|
||||
}
|
||||
.padding(.leading, headerLeadingInset(geometry: geometry))
|
||||
.padding(.horizontal)
|
||||
.padding(.top, headerTopInset)
|
||||
.padding(.bottom, 16)
|
||||
ScrollView {
|
||||
VStack(alignment: .leading, spacing: 0) {
|
||||
Text("_home_")
|
||||
.font(.subheadline.weight(.semibold))
|
||||
.foregroundStyle(.secondary)
|
||||
.padding(.horizontal, 32)
|
||||
.padding(.bottom, 8)
|
||||
sidebarItem("_all_files_", systemImage: "folder", isSelected: selectedDestination == "sidebarFiles", action: openFiles)
|
||||
.accessibilityIdentifier("sidebarFiles")
|
||||
sidebarItem("_personal_files_", systemImage: "person", isSelected: selectedDestination == "sidebarPersonalFiles", action: openPersonalFiles)
|
||||
.accessibilityIdentifier("sidebarPersonalFiles")
|
||||
sidebarItem("_recent_", systemImage: "clock.arrow.circlepath", isSelected: selectedDestination == "sidebarRecent", action: openRecent)
|
||||
.accessibilityIdentifier("sidebarRecent")
|
||||
if showsShares {
|
||||
sidebarItem("_list_shares_", systemImage: "person.badge.plus", isSelected: selectedDestination == "sidebarShares", action: openShares)
|
||||
.accessibilityIdentifier("sidebarShares")
|
||||
}
|
||||
if showsGroupfolders {
|
||||
sidebarItem("_group_folders_", systemImage: "folder.badge.person.crop", isSelected: selectedDestination == "sidebarGroupfolders", action: openGroupfolders)
|
||||
.accessibilityIdentifier("sidebarGroupfolders")
|
||||
}
|
||||
sidebarItem("_offline_files_", systemImage: "arrow.down.circle.dotted", isSelected: selectedDestination == "sidebarOffline", action: openOffline)
|
||||
.accessibilityIdentifier("sidebarOffline")
|
||||
sidebarItem("_trash_view_", systemImage: "trash", isSelected: selectedDestination == "sidebarTrash", action: openTrash)
|
||||
.accessibilityIdentifier("sidebarTrash")
|
||||
Text("_status_")
|
||||
.font(.subheadline.weight(.semibold))
|
||||
.foregroundStyle(.secondary)
|
||||
.padding(.horizontal, 32)
|
||||
.padding(.top, 20)
|
||||
.padding(.bottom, 8)
|
||||
sidebarItem("_transfers_", systemImage: "arrow.left.arrow.right", isSelected: selectedDestination == "sidebarTransfers", subtitle: transfersSubtitle, action: openTransfers)
|
||||
.accessibilityIdentifier("sidebarTransfers")
|
||||
Text("_media_")
|
||||
.font(.subheadline.weight(.semibold))
|
||||
.foregroundStyle(.secondary)
|
||||
.padding(.horizontal, 32)
|
||||
.padding(.top, 20)
|
||||
.padding(.bottom, 8)
|
||||
sidebarItem("_auto_upload_folder_", icon: autoUploadIcon, subtitle: autoUploadSubtitle, action: openAutoUpload)
|
||||
.accessibilityIdentifier("sidebarAutoUpload")
|
||||
sidebarItem("_scanned_images_", systemImage: "doc.text.viewfinder", isSelected: false, action: openScannedImages)
|
||||
.accessibilityIdentifier("sidebarScannedImages")
|
||||
if !externalSites.isEmpty {
|
||||
Text("_external_sites_")
|
||||
.font(.subheadline.weight(.semibold))
|
||||
.foregroundStyle(.secondary)
|
||||
.padding(.horizontal, 32)
|
||||
.padding(.top, 20)
|
||||
.padding(.bottom, 8)
|
||||
ForEach(externalSites, id: \.idExternalSite) { site in
|
||||
sidebarItem(LocalizedStringKey(site.name),
|
||||
systemImage: site.type == "settings" ? "gear" : "network",
|
||||
isSelected: selectedDestination == "sidebarExternalSite-\(site.idExternalSite)") {
|
||||
openExternalSite(site.url, site.name, site.idExternalSite)
|
||||
}
|
||||
.accessibilityIdentifier("sidebarExternalSite-\(site.idExternalSite)")
|
||||
}
|
||||
}
|
||||
if !NCBrandOptions.shared.disable_show_more_nextcloud_apps_in_settings {
|
||||
Text("_apps_")
|
||||
.font(.subheadline.weight(.semibold))
|
||||
.foregroundStyle(.secondary)
|
||||
.padding(.horizontal, 32)
|
||||
.padding(.top, 20)
|
||||
.padding(.bottom, 8)
|
||||
sidebarApp("Talk", image: "talk-template") {
|
||||
openApp(NCGlobal.shared.talkSchemeUrl, NCGlobal.shared.talkAppStoreUrl)
|
||||
}
|
||||
.accessibilityIdentifier("sidebarTalk")
|
||||
sidebarApp("Notes", image: "notes-template") {
|
||||
openApp(NCGlobal.shared.notesSchemeUrl, NCGlobal.shared.notesAppStoreUrl)
|
||||
}
|
||||
.accessibilityIdentifier("sidebarNotes")
|
||||
sidebarApp("_more_apps_", image: "more-apps-template") {
|
||||
openApp(NCGlobal.shared.moreAppsUrl, nil)
|
||||
}
|
||||
.accessibilityIdentifier("sidebarMoreApps")
|
||||
}
|
||||
}
|
||||
// Let the final row scroll completely above the fade.
|
||||
.padding(.bottom, quotaDescription.isEmpty ? 0 : 32)
|
||||
}
|
||||
.mask {
|
||||
VStack(spacing: 0) {
|
||||
Rectangle()
|
||||
if !quotaDescription.isEmpty {
|
||||
LinearGradient(colors: [.black, .clear], startPoint: .top, endPoint: .bottom)
|
||||
.frame(height: 32)
|
||||
}
|
||||
}
|
||||
}
|
||||
quotaFooter
|
||||
}
|
||||
}
|
||||
}
|
||||
.task {
|
||||
// Present the overlay before inserting the panel with its slide transition.
|
||||
if !reduceMotion {
|
||||
do {
|
||||
try await Task.sleep(for: .milliseconds(50))
|
||||
} catch {
|
||||
return
|
||||
.padding(.leading, leadingInset)
|
||||
.frame(width: width)
|
||||
.frame(maxHeight: .infinity)
|
||||
.background {
|
||||
// Extend only the glass beneath the landscape camera margin.
|
||||
// Controls keep their safe-area positioning and navbar alignment.
|
||||
sidebarBackground
|
||||
.ignoresSafeArea(.container)
|
||||
}
|
||||
.offset(x: isVisible ? 0 : -width)
|
||||
.accessibilityAddTraits(.isModal)
|
||||
.accessibilityAction(.escape) { close(then: onClose) }
|
||||
}
|
||||
guard !isClosing, !Task.isCancelled else { return }
|
||||
updateHeaderLayout()
|
||||
withAnimation(reduceMotion ? nil : .easeOut(duration: 0.2)) {
|
||||
isVisible = true
|
||||
.task {
|
||||
// Wait 50 ms so SwiftUI can render the panel in its initial offscreen position.
|
||||
// Starting the animation during insertion can skip that first frame and make
|
||||
// the sidebar appear immediately instead of sliding in. This delay only
|
||||
// applies to opening; closing already starts from a rendered position.
|
||||
if !reduceMotion {
|
||||
do {
|
||||
try await Task.sleep(for: .milliseconds(50))
|
||||
} catch {
|
||||
return
|
||||
}
|
||||
}
|
||||
guard !isClosing, !Task.isCancelled else { return }
|
||||
updateHeaderLayout()
|
||||
withAnimation(reduceMotion ? nil : .easeOut(duration: 0.2)) {
|
||||
isVisible = true
|
||||
}
|
||||
}
|
||||
}
|
||||
// Only the expanded phone portrait layout (Duo) inherits the navbar inset.
|
||||
@@ -201,135 +321,6 @@ struct NCSidebarView: View {
|
||||
}
|
||||
}
|
||||
|
||||
private func sidebarPanel(geometry: GeometryProxy) -> some View {
|
||||
// Measure against the stationary container, not the sliding panel.
|
||||
Group {
|
||||
// Keep the content clear of the landscape camera area, while glass reaches the edge.
|
||||
let leadingInset = contentLeadingInset(geometry: geometry)
|
||||
// Preserve the content width and a visible strip of the underlying screen.
|
||||
let width = max(0, min(320 + leadingInset, geometry.size.width - 56))
|
||||
ZStack(alignment: .leading) {
|
||||
VStack {
|
||||
sidebarHeader
|
||||
.onGeometryChange(for: CGFloat.self) { geometry in
|
||||
geometry.size.height
|
||||
} action: { height in
|
||||
headerHeight = height
|
||||
navigationCenterY = navigationBarCenterY()
|
||||
}
|
||||
.padding(.leading, headerLeadingInset(geometry: geometry))
|
||||
.padding(.horizontal)
|
||||
.padding(.top, headerTopInset)
|
||||
.padding(.bottom, 16)
|
||||
ScrollView {
|
||||
VStack(alignment: .leading, spacing: 0) {
|
||||
Text("_home_")
|
||||
.font(.subheadline.weight(.semibold))
|
||||
.foregroundStyle(.secondary)
|
||||
.padding(.horizontal, 32)
|
||||
.padding(.bottom, 8)
|
||||
sidebarItem("_all_files_", systemImage: "folder", isSelected: selectedDestination == "sidebarFiles", action: openFiles)
|
||||
.accessibilityIdentifier("sidebarFiles")
|
||||
sidebarItem("_personal_files_", systemImage: "person", isSelected: selectedDestination == "sidebarPersonalFiles", action: openPersonalFiles)
|
||||
.accessibilityIdentifier("sidebarPersonalFiles")
|
||||
sidebarItem("_recent_", systemImage: "clock.arrow.circlepath", isSelected: selectedDestination == "sidebarRecent", action: openRecent)
|
||||
.accessibilityIdentifier("sidebarRecent")
|
||||
if showsShares {
|
||||
sidebarItem("_list_shares_", systemImage: "person.badge.plus", isSelected: selectedDestination == "sidebarShares", action: openShares)
|
||||
.accessibilityIdentifier("sidebarShares")
|
||||
}
|
||||
if showsGroupfolders {
|
||||
sidebarItem("_group_folders_", systemImage: "folder.badge.person.crop", isSelected: selectedDestination == "sidebarGroupfolders", action: openGroupfolders)
|
||||
.accessibilityIdentifier("sidebarGroupfolders")
|
||||
}
|
||||
sidebarItem("_offline_files_", systemImage: "arrow.down.circle.dotted", isSelected: selectedDestination == "sidebarOffline", action: openOffline)
|
||||
.accessibilityIdentifier("sidebarOffline")
|
||||
sidebarItem("_trash_view_", systemImage: "trash", isSelected: selectedDestination == "sidebarTrash", action: openTrash)
|
||||
.accessibilityIdentifier("sidebarTrash")
|
||||
Text("_status_")
|
||||
.font(.subheadline.weight(.semibold))
|
||||
.foregroundStyle(.secondary)
|
||||
.padding(.horizontal, 32)
|
||||
.padding(.top, 20)
|
||||
.padding(.bottom, 8)
|
||||
sidebarItem("_transfers_", systemImage: "arrow.left.arrow.right", isSelected: selectedDestination == "sidebarTransfers", subtitle: transfersSubtitle, action: openTransfers)
|
||||
.accessibilityIdentifier("sidebarTransfers")
|
||||
Text("_media_")
|
||||
.font(.subheadline.weight(.semibold))
|
||||
.foregroundStyle(.secondary)
|
||||
.padding(.horizontal, 32)
|
||||
.padding(.top, 20)
|
||||
.padding(.bottom, 8)
|
||||
sidebarItem("_auto_upload_folder_", icon: autoUploadIcon, subtitle: autoUploadSubtitle, action: openAutoUpload)
|
||||
.accessibilityIdentifier("sidebarAutoUpload")
|
||||
sidebarItem("_scanned_images_", systemImage: "doc.text.viewfinder", isSelected: false, action: openScannedImages)
|
||||
.accessibilityIdentifier("sidebarScannedImages")
|
||||
if !externalSites.isEmpty {
|
||||
Text("_external_sites_")
|
||||
.font(.subheadline.weight(.semibold))
|
||||
.foregroundStyle(.secondary)
|
||||
.padding(.horizontal, 32)
|
||||
.padding(.top, 20)
|
||||
.padding(.bottom, 8)
|
||||
ForEach(externalSites, id: \.idExternalSite) { site in
|
||||
sidebarItem(LocalizedStringKey(site.name),
|
||||
systemImage: site.type == "settings" ? "gear" : "network",
|
||||
isSelected: selectedDestination == "sidebarExternalSite-\(site.idExternalSite)") {
|
||||
openExternalSite(site.url, site.name, site.idExternalSite)
|
||||
}
|
||||
.accessibilityIdentifier("sidebarExternalSite-\(site.idExternalSite)")
|
||||
}
|
||||
}
|
||||
if !NCBrandOptions.shared.disable_show_more_nextcloud_apps_in_settings {
|
||||
Text("_apps_")
|
||||
.font(.subheadline.weight(.semibold))
|
||||
.foregroundStyle(.secondary)
|
||||
.padding(.horizontal, 32)
|
||||
.padding(.top, 20)
|
||||
.padding(.bottom, 8)
|
||||
sidebarApp("Talk", image: "talk-template") {
|
||||
openApp(NCGlobal.shared.talkSchemeUrl, NCGlobal.shared.talkAppStoreUrl)
|
||||
}
|
||||
.accessibilityIdentifier("sidebarTalk")
|
||||
sidebarApp("Notes", image: "notes-template") {
|
||||
openApp(NCGlobal.shared.notesSchemeUrl, NCGlobal.shared.notesAppStoreUrl)
|
||||
}
|
||||
.accessibilityIdentifier("sidebarNotes")
|
||||
sidebarApp("_more_apps_", image: "more-apps-template") {
|
||||
openApp(NCGlobal.shared.moreAppsUrl, nil)
|
||||
}
|
||||
.accessibilityIdentifier("sidebarMoreApps")
|
||||
}
|
||||
}
|
||||
// Let the final row scroll completely above the fade.
|
||||
.padding(.bottom, quotaDescription.isEmpty ? 0 : 32)
|
||||
}
|
||||
.mask {
|
||||
VStack(spacing: 0) {
|
||||
Rectangle()
|
||||
if !quotaDescription.isEmpty {
|
||||
LinearGradient(colors: [.black, .clear], startPoint: .top, endPoint: .bottom)
|
||||
.frame(height: 32)
|
||||
}
|
||||
}
|
||||
}
|
||||
quotaFooter
|
||||
}
|
||||
.padding(.leading, leadingInset)
|
||||
.frame(width: width)
|
||||
.frame(maxHeight: .infinity)
|
||||
.background {
|
||||
// Extend only the glass beneath the landscape camera margin.
|
||||
// Controls keep their safe-area positioning and navbar alignment.
|
||||
sidebarBackground
|
||||
.ignoresSafeArea(.container)
|
||||
}
|
||||
.accessibilityAddTraits(.isModal)
|
||||
.accessibilityAction(.escape) { close(then: onClose) }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private func updateTransfersSubtitle() async {
|
||||
let database = NCManageDatabase.shared
|
||||
async let progress = database.getMetadatasStatusCountAsync(status: TransfersFilter.progress.statuses)
|
||||
@@ -338,13 +329,11 @@ struct NCSidebarView: View {
|
||||
let counts = await (progress, waiting, errors)
|
||||
guard !Task.isCancelled else { return }
|
||||
let states = [("_in_error_", counts.2), ("_in_progress_", counts.0), ("_in_waiting_", counts.1)]
|
||||
let subtitle: String
|
||||
if let state = states.first(where: { $0.1 > 0 }) {
|
||||
subtitle = "\(state.1) \(NSLocalizedString(state.0, comment: ""))"
|
||||
transfersSubtitle = "\(state.1) \(NSLocalizedString(state.0, comment: ""))"
|
||||
} else {
|
||||
subtitle = NSLocalizedString("_no_transfer_in_progress_", comment: "")
|
||||
transfersSubtitle = NSLocalizedString("_no_transfer_in_progress_", comment: "")
|
||||
}
|
||||
if transfersSubtitle != subtitle { transfersSubtitle = subtitle }
|
||||
}
|
||||
|
||||
private var autoUploadIcon: some View {
|
||||
|
||||
@@ -33,7 +33,9 @@ class NCMediaNavigationController: NCMainNavigationController {
|
||||
items.append(media.searchActivityBarButtonItem)
|
||||
}
|
||||
media.navigationItem.leadingItemGroups = items.map { item in
|
||||
UIBarButtonItemGroup(barButtonItems: [item], representativeItem: nil)
|
||||
let group = UIBarButtonItemGroup(barButtonItems: [item], representativeItem: nil)
|
||||
group.alwaysAvailable = item === sidebarButtonItem
|
||||
return group
|
||||
}
|
||||
}
|
||||
|
||||
@@ -406,7 +408,7 @@ class NCMediaNavigationController: NCMainNavigationController {
|
||||
for photo in selectedPhotos {
|
||||
guard let metadata = NCManageDatabase.shared.getMetadataFromOcId(photo) else {
|
||||
Task {
|
||||
await showErrorBanner(windowScene: controller.viewIfLoaded?.window?.windowScene, text: "_media_not_available_")
|
||||
await showErrorBanner(windowScene: controller.viewIfLoaded?.window?.windowScene, error: .invalidData)
|
||||
}
|
||||
finishIfDone()
|
||||
continue
|
||||
|
||||
@@ -248,7 +248,6 @@ enum NCContextMenuActions {
|
||||
) != nil {
|
||||
await showErrorBanner(
|
||||
windowScene: windowScene,
|
||||
title: NCErrorContext.rename.failureTitle ?? "_error_",
|
||||
text: "_rename_already_exists_",
|
||||
errorCode: 0
|
||||
)
|
||||
@@ -261,7 +260,7 @@ enum NCContextMenuActions {
|
||||
windowScene: windowScene
|
||||
)
|
||||
if error != .success {
|
||||
await showErrorBanner(windowScene: windowScene, error: error, context: .rename)
|
||||
await showErrorBanner(windowScene: windowScene, error: error)
|
||||
} else if let renamedMetadata = await NCManageDatabase.shared.getMetadataFromOcIdAsync(metadata.ocId) {
|
||||
completion?(renamedMetadata)
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ class NCContextMenuComment: NSObject {
|
||||
NotificationCenter.default.postOnMainThread(name: NCGlobal.shared.notificationCenterReloadDataNCShare)
|
||||
} else {
|
||||
Task { @MainActor in
|
||||
await showErrorBanner(windowScene: self.windowScene, error: error)
|
||||
await showErrorBanner(windowScene: self.windowScene, text: error.errorDescription, errorCode: error.errorCode)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -85,7 +85,7 @@ class NCContextMenuComment: NSObject {
|
||||
(self.viewController as? NCActivity)?.loadComments()
|
||||
} else {
|
||||
Task { @MainActor in
|
||||
await showErrorBanner(windowScene: self.windowScene, error: error)
|
||||
await showErrorBanner(windowScene: self.windowScene, text: error.errorDescription, errorCode: error.errorCode)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -226,7 +226,7 @@ class NCContextMenuMain: NSObject {
|
||||
sceneIdentifier: self.sceneIdentifier
|
||||
)
|
||||
if error != .success {
|
||||
await showErrorBanner(windowScene: self.windowScene, error: error)
|
||||
await showErrorBanner(windowScene: self.windowScene, text: error.errorDescription, errorCode: error.errorCode)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -243,7 +243,11 @@ class NCContextMenuMain: NSObject {
|
||||
account: metadata.account
|
||||
)
|
||||
guard accessError == .success else {
|
||||
await showErrorBanner(windowScene: self.windowScene, error: accessError)
|
||||
await showErrorBanner(
|
||||
windowScene: self.windowScene,
|
||||
text: accessError.errorDescription,
|
||||
errorCode: accessError.errorCode
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -260,7 +264,9 @@ class NCContextMenuMain: NSObject {
|
||||
await NCManageDatabase.shared.setMetadataEncryptedAsync(ocId: metadata.ocId, encrypted: false)
|
||||
await (self.viewController as? NCCollectionViewCommon)?.reloadDataSource()
|
||||
} else {
|
||||
await showErrorBanner(windowScene: self.windowScene, error: results.error)
|
||||
await showErrorBanner(windowScene: self.windowScene,
|
||||
text: results.error.errorDescription,
|
||||
errorCode: results.error.errorCode)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -368,11 +374,8 @@ class NCContextMenuMain: NSObject {
|
||||
if self.viewController is NCCollectionViewCommon {
|
||||
Task {
|
||||
if metadata.isDirectoryE2EE {
|
||||
let context = NCErrorContext.delete(fileName: metadata.fileNameView)
|
||||
|
||||
if NCNetworking.shared.isOffline {
|
||||
await showErrorBanner(windowScene: self.windowScene,
|
||||
title: context.failureTitle ?? "_error_",
|
||||
text: "_offline_not_allowed_",
|
||||
errorCode: NCGlobal.shared.errorOfflineNotAllowed)
|
||||
} else {
|
||||
@@ -384,9 +387,7 @@ class NCContextMenuMain: NSObject {
|
||||
if error == .success {
|
||||
completeHudBannerSuccess(token: results.token, banner: results.banner)
|
||||
} else {
|
||||
let message = error.userFriendlyMessage(for: context) ?? error.localizedGenericMessage
|
||||
|
||||
completeHudBannerError(title: context.failureTitle, description: message, token: results.token, banner: results.banner)
|
||||
completeHudBannerError(description: error.errorDescription, token: results.token, banner: results.banner)
|
||||
}
|
||||
|
||||
await NCNetworking.shared.transferDispatcher.notifyAllDelegates { delegate in
|
||||
@@ -396,7 +397,7 @@ class NCContextMenuMain: NSObject {
|
||||
} else {
|
||||
let error = await NCNetworking.shared.setStatusWaitDelete(metadatas: [metadata])
|
||||
if error != .success {
|
||||
await showErrorBanner(windowScene: self.windowScene, error: error, context: .delete(fileName: metadata.fileNameView))
|
||||
await showErrorBanner(windowScene: self.windowScene, error: error)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -495,7 +496,9 @@ class NCContextMenuMain: NSObject {
|
||||
params: item.params
|
||||
)
|
||||
if results.error != .success {
|
||||
await showErrorBanner(windowScene: self.windowScene, error: results.error)
|
||||
await showErrorBanner(windowScene: self.windowScene,
|
||||
text: results.error.errorDescription,
|
||||
errorCode: results.error.errorCode)
|
||||
} else {
|
||||
if let tooltip = results.uiResponse?.ocs.data.tooltip {
|
||||
await showInfoBanner(windowScene: self.windowScene, text: tooltip)
|
||||
|
||||
@@ -138,12 +138,12 @@ class NCContextMenuPlus: NSObject {
|
||||
serverUrl: serverUrl,
|
||||
session: session,
|
||||
sceneIdentifier: controller.sceneIdentifier,
|
||||
capabilities: capabilities) { error, folderName in
|
||||
capabilities: capabilities) { error in
|
||||
if error != .success {
|
||||
Task {
|
||||
await showErrorBanner(windowScene: self.windowScene,
|
||||
error: error,
|
||||
context: .createFolder(folderName: folderName))
|
||||
text: error.errorDescription,
|
||||
errorCode: error.errorCode)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -164,10 +164,12 @@ class NCContextMenuPlus: NSObject {
|
||||
session: session,
|
||||
markE2ee: true,
|
||||
sceneIdentifier: controller.sceneIdentifier,
|
||||
capabilities: capabilities) { error, _ in
|
||||
capabilities: capabilities) { error in
|
||||
if error != .success {
|
||||
Task {
|
||||
await showErrorBanner(windowScene: self.windowScene, error: error)
|
||||
await showErrorBanner(windowScene: self.windowScene,
|
||||
text: error.errorDescription,
|
||||
errorCode: error.errorCode)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -626,7 +628,8 @@ class NCContextMenuPlus: NSObject {
|
||||
let selectedTemplate = result.selectedTemplate else {
|
||||
await showErrorBanner(
|
||||
windowScene: windowScene,
|
||||
error: result.error
|
||||
text: result.error.errorDescription,
|
||||
errorCode: result.error.errorCode
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -134,6 +134,7 @@ final class NCGlobal: Sendable {
|
||||
let errorMethodNotSupported: Int = 405
|
||||
let errorConflict: Int = 409
|
||||
let errorPreconditionFailed: Int = 412
|
||||
let errorUnsupportedMediaType: Int = 415
|
||||
let errorExpectationFailed: Int = 417
|
||||
let errorInternalServerError: Int = 500
|
||||
let errorMaintenance: Int = 503
|
||||
|
||||
@@ -26,9 +26,7 @@ class NCEndToEndMetadata: NSObject {
|
||||
} else if capabilities.e2EEApiVersion.hasPrefix("2.") {
|
||||
return await encodeMetadataV2(serverUrl: serverUrl, ocIdServerUrl: directory.ocId, addUserId: addUserId, addCertificate: addCertificate, removeUserId: removeUserId, session: session)
|
||||
} else {
|
||||
nkLog(tag: NCGlobal.shared.logTagE2EE, emoji: .error, message: "Server E2EE version \(capabilities.e2EEApiVersion) is not supported.")
|
||||
|
||||
return (nil, nil, 0, NKError(errorCode: NCGlobal.shared.errorE2EEVersion, errorDescription: NSLocalizedString("_e2ee_version_not_supported_", comment: "")))
|
||||
return (nil, nil, 0, NKError(errorCode: NCGlobal.shared.errorE2EEVersion, errorDescription: "Server E2EE version " + capabilities.e2EEApiVersion + ", not compatible"))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,10 +41,8 @@ class NCEndToEndMetadata: NSObject {
|
||||
session: NCSession.Session
|
||||
) async -> (error: NKError, access: NCEndToEndKeySetAccess) {
|
||||
guard let data = metadata.data(using: .utf8), let directory = self.database.getTableDirectory(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@", session.account, serverUrl)) else {
|
||||
nkLog(tag: NCGlobal.shared.logTagE2EE, emoji: .error, message: "Unable to decode the metadata file: invalid data or missing directory.")
|
||||
|
||||
return (
|
||||
NKError(errorCode: NCGlobal.shared.errorE2EEJSon, errorDescription: NSLocalizedString("_e2ee_decode_metadata_", comment: "")),
|
||||
NKError(errorCode: NCGlobal.shared.errorE2EEJSon, errorDescription: "Unable to decode the metadata file"),
|
||||
.unavailable
|
||||
)
|
||||
}
|
||||
@@ -57,12 +53,10 @@ class NCEndToEndMetadata: NSObject {
|
||||
let isMetadataV2 = metadataV2 != nil
|
||||
|
||||
guard isMetadataV1 || isMetadataV12 || isMetadataV2 else {
|
||||
nkLog(tag: NCGlobal.shared.logTagE2EE, emoji: .error, message: "Unable to decode the metadata file: unknown metadata format.")
|
||||
|
||||
return (
|
||||
NKError(
|
||||
errorCode: NCGlobal.shared.errorE2EEVersion,
|
||||
errorDescription: NSLocalizedString("_e2ee_decode_metadata_", comment: "")
|
||||
errorDescription: "Unable to decode the metadata file"
|
||||
),
|
||||
.unavailable
|
||||
)
|
||||
@@ -74,12 +68,10 @@ class NCEndToEndMetadata: NSObject {
|
||||
} catch {
|
||||
nkLog(
|
||||
tag: NCGlobal.shared.logTagE2EE,
|
||||
emoji: .error,
|
||||
message: "Unable to resolve E2EE key-set access: \(error)"
|
||||
message: "Unable to resolve E2EE key-set access."
|
||||
)
|
||||
|
||||
return (
|
||||
NKError(errorCode: NCGlobal.shared.errorInternalError, errorDescription: NSLocalizedString("_e2ee_no_metadataKey_found_", comment: "")),
|
||||
NKError(errorCode: NCGlobal.shared.errorInternalError, errorDescription: error.localizedDescription),
|
||||
.unavailable
|
||||
)
|
||||
}
|
||||
|
||||
@@ -117,9 +117,7 @@ extension NCEndToEndMetadata {
|
||||
}
|
||||
fileNameIdentifiers.append(e2eEncryption.fileNameIdentifier)
|
||||
} catch let error {
|
||||
nkLog(tag: NCGlobal.shared.logTagE2EE, emoji: .error, message: "Unable to encode the E2EE metadata: \(error)")
|
||||
|
||||
return (nil, nil, 0, NKError(errorCode: NCGlobal.shared.errorE2EEJSon, errorDescription: NSLocalizedString("_e2ee_encode_metadata_", comment: "")))
|
||||
return (nil, nil, 0, NKError(errorCode: NCGlobal.shared.errorE2EEJSon, errorDescription: error.localizedDescription))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -146,9 +144,7 @@ extension NCEndToEndMetadata {
|
||||
filedrop.updateValue(record, forKey: e2eEncryption.fileNameIdentifier)
|
||||
}
|
||||
} catch let error {
|
||||
nkLog(tag: NCGlobal.shared.logTagE2EE, emoji: .error, message: "Unable to encode the E2EE metadata: \(error)")
|
||||
|
||||
return (nil, nil, 0, NKError(errorCode: NCGlobal.shared.errorE2EEJSon, errorDescription: NSLocalizedString("_e2ee_encode_metadata_", comment: "")))
|
||||
return (nil, nil, 0, NKError(errorCode: NCGlobal.shared.errorE2EEJSon, errorDescription: error.localizedDescription))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -172,9 +168,7 @@ extension NCEndToEndMetadata {
|
||||
}
|
||||
return (jsonString, nil, 0, NKError())
|
||||
} catch let error {
|
||||
nkLog(tag: NCGlobal.shared.logTagE2EE, emoji: .error, message: "Unable to encode the E2EE metadata: \(error)")
|
||||
|
||||
return (nil, nil, 0, NKError(errorCode: NCGlobal.shared.errorE2EEJSon, errorDescription: NSLocalizedString("_e2ee_encode_metadata_", comment: "")))
|
||||
return (nil, nil, 0, NKError(errorCode: NCGlobal.shared.errorE2EEJSon, errorDescription: error.localizedDescription))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -276,9 +270,7 @@ extension NCEndToEndMetadata {
|
||||
}
|
||||
|
||||
} catch let error {
|
||||
nkLog(tag: NCGlobal.shared.logTagE2EE, emoji: .error, message: "Unable to decode the E2EE metadata: \(error)")
|
||||
|
||||
return NKError(errorCode: NCGlobal.shared.errorE2EEJSon, errorDescription: NSLocalizedString("_e2ee_decode_metadata_", comment: ""))
|
||||
return NKError(errorCode: NCGlobal.shared.errorE2EEJSon, errorDescription: error.localizedDescription)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -337,9 +329,7 @@ extension NCEndToEndMetadata {
|
||||
}
|
||||
|
||||
} catch let error {
|
||||
nkLog(tag: NCGlobal.shared.logTagE2EE, emoji: .error, message: "Unable to decode the E2EE metadata: \(error)")
|
||||
|
||||
return NKError(errorCode: NCGlobal.shared.errorE2EEJSon, errorDescription: NSLocalizedString("_e2ee_decode_metadata_", comment: ""))
|
||||
return NKError(errorCode: NCGlobal.shared.errorE2EEJSon, errorDescription: error.localizedDescription)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -354,9 +344,7 @@ extension NCEndToEndMetadata {
|
||||
errorDescription: NSLocalizedString("_e2ee_no_match_checksum_", comment: ""))
|
||||
}
|
||||
} catch let error {
|
||||
nkLog(tag: NCGlobal.shared.logTagE2EE, emoji: .error, message: "Unable to decode the E2EE metadata: \(error)")
|
||||
|
||||
return NKError(errorCode: NCGlobal.shared.errorE2EEJSon, errorDescription: NSLocalizedString("_e2ee_decode_metadata_", comment: ""))
|
||||
return NKError(errorCode: NCGlobal.shared.errorE2EEJSon, errorDescription: error.localizedDescription)
|
||||
}
|
||||
|
||||
return NKError()
|
||||
@@ -412,9 +400,7 @@ extension NCEndToEndMetadata {
|
||||
//
|
||||
if let tableE2eMetadata = await self.database.getE2eMetadataAsync(account: session.account, serverUrl: serverUrl) {
|
||||
if tableE2eMetadata.version > metadataVersion {
|
||||
nkLog(tag: NCGlobal.shared.logTagE2EE, emoji: .error, message: "E2EE metadata version \(metadataVersion) is older than the stored version \(tableE2eMetadata.version).")
|
||||
|
||||
return NKError(errorCode: NCGlobal.shared.errorE2EEVersion, errorDescription: NSLocalizedString("_e2ee_version_not_supported_", comment: ""))
|
||||
return NKError(errorCode: NCGlobal.shared.errorE2EEVersion, errorDescription: "Version \(tableE2eMetadata.version)")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -470,17 +456,13 @@ extension NCEndToEndMetadata {
|
||||
}
|
||||
|
||||
} catch let error {
|
||||
nkLog(tag: NCGlobal.shared.logTagE2EE, emoji: .error, message: "Unable to decode the E2EE metadata: \(error)")
|
||||
|
||||
return NKError(errorCode: NCGlobal.shared.errorE2EEJSon, errorDescription: NSLocalizedString("_e2ee_decode_metadata_", comment: ""))
|
||||
return NKError(errorCode: NCGlobal.shared.errorE2EEJSon, errorDescription: error.localizedDescription)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch let error {
|
||||
nkLog(tag: NCGlobal.shared.logTagE2EE, emoji: .error, message: "Unable to decode the E2EE metadata: \(error)")
|
||||
|
||||
return NKError(errorCode: NCGlobal.shared.errorE2EEJSon, errorDescription: NSLocalizedString("_e2ee_decode_metadata_", comment: ""))
|
||||
return NKError(errorCode: NCGlobal.shared.errorE2EEJSon, errorDescription: error.localizedDescription)
|
||||
}
|
||||
|
||||
return NKError()
|
||||
|
||||
@@ -201,9 +201,7 @@ extension NCEndToEndMetadata {
|
||||
return (e2eeJson, signature, counter, NKError())
|
||||
|
||||
} catch let error {
|
||||
nkLog(tag: NCGlobal.shared.logTagE2EE, emoji: .error, message: "Unable to encode the E2EE metadata: \(error)")
|
||||
|
||||
return (nil, nil, counter, NKError(errorCode: NCGlobal.shared.errorE2EEJSon, errorDescription: NSLocalizedString("_e2ee_encode_metadata_", comment: "")))
|
||||
return (nil, nil, counter, NKError(errorCode: NCGlobal.shared.errorE2EEJSon, errorDescription: error.localizedDescription))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -412,10 +410,8 @@ extension NCEndToEndMetadata {
|
||||
}
|
||||
|
||||
} catch let error {
|
||||
nkLog(tag: global.logTagE2EE, emoji: .error, message: "Unable to decode the E2EE metadata: \(error)")
|
||||
|
||||
return NKError(errorCode: NCGlobal.shared.errorE2EEJSon,
|
||||
errorDescription: NSLocalizedString("_e2ee_decode_metadata_", comment: ""))
|
||||
errorDescription: error.localizedDescription)
|
||||
}
|
||||
|
||||
return returnError
|
||||
|
||||
@@ -150,7 +150,7 @@ class NCNetworkingE2EE: NSObject {
|
||||
}
|
||||
|
||||
guard result.error == .success else {
|
||||
nkLog(tag: NCGlobal.shared.logTagE2EE, message: "Server-key validation request failed: \(result.error.logDescription)")
|
||||
nkLog(tag: NCGlobal.shared.logTagE2EE, message: "Server-key validation request failed with error code \(result.error.errorCode).")
|
||||
return result.error
|
||||
}
|
||||
|
||||
@@ -214,9 +214,8 @@ class NCNetworkingE2EE: NSObject {
|
||||
nkLog(tag: NCGlobal.shared.logTagE2EE, message: "Archived the active key set and marked it as stale.")
|
||||
return serverKeyChangedError
|
||||
} catch {
|
||||
nkLog(tag: NCGlobal.shared.logTagE2EE, emoji: .error, message: "Unable to archive the active key set after server-key validation: \(error)")
|
||||
|
||||
return NKError(errorCode: NCGlobal.shared.errorInternalError, errorDescription: NSLocalizedString("_e2ee_store_keys_", comment: ""))
|
||||
nkLog(tag: NCGlobal.shared.logTagE2EE, message: "Unable to archive the active key set after server-key validation.")
|
||||
return NKError(errorCode: NCGlobal.shared.errorInternalError, errorDescription: error.localizedDescription)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -256,9 +255,7 @@ class NCNetworkingE2EE: NSObject {
|
||||
}
|
||||
}
|
||||
default:
|
||||
nkLog(tag: NCGlobal.shared.logTagE2EE, emoji: .error, message: "Server E2EE version \(capabilities.e2EEApiVersion) is not supported.")
|
||||
|
||||
return ("", "", nil, nil, nil, NKError(errorCode: NCGlobal.shared.errorInternalError, errorDescription: NSLocalizedString("_e2ee_version_not_supported_", comment: "")))
|
||||
return ("", "", nil, nil, nil, NKError(errorCode: NCGlobal.shared.errorInternalError, errorDescription: "version e2ee not available"))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -363,10 +360,8 @@ class NCNetworkingE2EE: NSObject {
|
||||
session: session
|
||||
)
|
||||
} catch {
|
||||
nkLog(tag: NCGlobal.shared.logTagE2EE, emoji: .error, message: "Unable to resolve the stored E2EE key set: \(error)")
|
||||
|
||||
await unlock(account: session.account, serverUrl: serverUrl)
|
||||
return NKError(errorCode: NCGlobal.shared.errorInternalError, errorDescription: NSLocalizedString("_e2ee_no_metadataKey_found_", comment: ""))
|
||||
return NKError(errorCode: NCGlobal.shared.errorInternalError, errorDescription: error.localizedDescription)
|
||||
}
|
||||
|
||||
guard storedAccess.writeAccessError == .success else {
|
||||
@@ -452,9 +447,7 @@ class NCNetworkingE2EE: NSObject {
|
||||
session: session
|
||||
)
|
||||
} catch {
|
||||
nkLog(tag: NCGlobal.shared.logTagE2EE, emoji: .error, message: "Unable to resolve E2EE key-set access: \(error)")
|
||||
|
||||
return NKError(errorCode: NCGlobal.shared.errorInternalError, errorDescription: NSLocalizedString("_e2ee_no_metadataKey_found_", comment: ""))
|
||||
return NKError(errorCode: NCGlobal.shared.errorInternalError, errorDescription: error.localizedDescription)
|
||||
}
|
||||
|
||||
let writeAccessError = access.writeAccessError
|
||||
@@ -512,9 +505,7 @@ class NCNetworkingE2EE: NSObject {
|
||||
return storedAccess.writeAccessError
|
||||
}
|
||||
} catch {
|
||||
nkLog(tag: NCGlobal.shared.logTagE2EE, emoji: .error, message: "Unable to resolve the stored E2EE key set: \(error)")
|
||||
|
||||
return NKError(errorCode: NCGlobal.shared.errorInternalError, errorDescription: NSLocalizedString("_e2ee_no_metadataKey_found_", comment: ""))
|
||||
return NKError(errorCode: NCGlobal.shared.errorInternalError, errorDescription: error.localizedDescription)
|
||||
}
|
||||
}
|
||||
return resultsGetE2EEMetadata.error
|
||||
|
||||
@@ -73,11 +73,10 @@ class NCNetworkingE2EEUpload: NSObject {
|
||||
metadata.session = NCNetworking.shared.sessionUpload
|
||||
metadata.status = global.metadataStatusUploading
|
||||
metadata.sessionError = ""
|
||||
metadata.errorKind = ""
|
||||
metadata.serverUrlFileName = utilityFileSystem.createServerUrl(serverUrl: metadata.serverUrl, fileName: metadata.fileName)
|
||||
|
||||
guard let metadata = await self.database.addAndReturnMetadataAsync(metadata) else {
|
||||
return NKError(errorCode: global.errorInternalError, errorDescription: "")
|
||||
return .invalidData
|
||||
}
|
||||
|
||||
guard let directory = await self.database.getTableDirectoryAsync(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@", metadata.account, metadata.serverUrl)) else {
|
||||
@@ -228,7 +227,6 @@ class NCNetworkingE2EEUpload: NSObject {
|
||||
metadata.session = ""
|
||||
metadata.sessionTaskIdentifier = 0
|
||||
metadata.sessionError = ""
|
||||
metadata.errorKind = ""
|
||||
metadata.status = NCGlobal.shared.metadataStatusNormal
|
||||
|
||||
// Remove if exists same file name view
|
||||
|
||||
@@ -394,7 +394,7 @@ class NCAutoUpload: NSObject {
|
||||
nkLog(
|
||||
tag: self.global.logTagBgSync,
|
||||
emoji: .error,
|
||||
message: "Create folder '\(metadata.serverUrlFileName)' failed: \(err.logDescription) – aborting sync"
|
||||
message: "Create folder '\(metadata.serverUrlFileName)' failed: \(err.errorCode) – aborting sync"
|
||||
)
|
||||
return
|
||||
}
|
||||
@@ -475,7 +475,7 @@ class NCAutoUpload: NSObject {
|
||||
nkLog(
|
||||
tag: self.global.logTagBgSync,
|
||||
emoji: .error,
|
||||
message: "Upload failed \(extractedMetadata.fileName) -> \(extractedMetadata.serverUrl) [\(err.logDescription)]"
|
||||
message: "Upload failed \(extractedMetadata.fileName) -> \(extractedMetadata.serverUrl) [\(err.errorDescription)]"
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,116 +0,0 @@
|
||||
// SPDX-FileCopyrightText: Nextcloud GmbH
|
||||
// SPDX-FileCopyrightText: 2026 Milen Pivchev
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
import Foundation
|
||||
|
||||
/// What the user was doing when an error happened, so the message can say what failed.
|
||||
enum NCErrorContext: Equatable {
|
||||
case generic
|
||||
case upload(fileName: String)
|
||||
case download(fileName: String)
|
||||
case delete(fileName: String)
|
||||
case rename
|
||||
case moveOrCopy(fileName: String)
|
||||
case createFolder(folderName: String)
|
||||
case favorite(fileName: String)
|
||||
case createDocument(fileName: String)
|
||||
case openDocument(fileName: String)
|
||||
|
||||
/// The context of a transfer event, from its `networkingStatus`.
|
||||
init(networkingStatus: String, fileName: String) {
|
||||
let global = NCGlobal.shared
|
||||
|
||||
switch networkingStatus {
|
||||
case global.networkingStatusUploading, global.networkingStatusUploaded:
|
||||
self = .upload(fileName: fileName)
|
||||
|
||||
case global.networkingStatusDownloading, global.networkingStatusDownloaded:
|
||||
self = .download(fileName: fileName)
|
||||
|
||||
case global.networkingStatusDelete:
|
||||
self = .delete(fileName: fileName)
|
||||
|
||||
case global.networkingStatusRename:
|
||||
self = .rename
|
||||
|
||||
case global.networkingStatusCopyMove:
|
||||
self = .moveOrCopy(fileName: fileName)
|
||||
|
||||
case global.networkingStatusCreateFolder:
|
||||
self = .createFolder(folderName: fileName)
|
||||
|
||||
case global.networkingStatusFavorite:
|
||||
self = .favorite(fileName: fileName)
|
||||
|
||||
default:
|
||||
self = .generic
|
||||
}
|
||||
}
|
||||
|
||||
/// The context of the operation a metadata is waiting for or failed at, from its metadata `status`.
|
||||
init(metadataStatus: Int, fileName: String) {
|
||||
let global = NCGlobal.shared
|
||||
|
||||
switch metadataStatus {
|
||||
case global.metadataStatusWaitUpload, global.metadataStatusUploading, global.metadataStatusUploadError:
|
||||
self = .upload(fileName: fileName)
|
||||
|
||||
case global.metadataStatusWaitDownload, global.metadataStatusDownloading, global.metadataStatusDownloadError:
|
||||
self = .download(fileName: fileName)
|
||||
|
||||
case global.metadataStatusWaitDelete:
|
||||
self = .delete(fileName: fileName)
|
||||
|
||||
case global.metadataStatusWaitRename:
|
||||
self = .rename
|
||||
|
||||
case global.metadataStatusWaitCopy, global.metadataStatusWaitMove:
|
||||
self = .moveOrCopy(fileName: fileName)
|
||||
|
||||
case global.metadataStatusWaitCreateFolder:
|
||||
self = .createFolder(folderName: fileName)
|
||||
|
||||
case global.metadataStatusWaitFavorite:
|
||||
self = .favorite(fileName: fileName)
|
||||
|
||||
default:
|
||||
self = .generic
|
||||
}
|
||||
}
|
||||
|
||||
/// A title saying what failed, e.g. "Couldn't upload “IMG_0042.jpg”"; `nil` for `generic`.
|
||||
var failureTitle: String? {
|
||||
switch self {
|
||||
case .generic:
|
||||
return nil
|
||||
|
||||
case .upload(let fileName):
|
||||
return String(format: NSLocalizedString("_error_title_upload_", comment: ""), fileName)
|
||||
|
||||
case .download(let fileName):
|
||||
return String(format: NSLocalizedString("_error_title_download_", comment: ""), fileName)
|
||||
|
||||
case .delete(let fileName):
|
||||
return String(format: NSLocalizedString("_error_title_delete_", comment: ""), fileName)
|
||||
|
||||
case .rename:
|
||||
return NSLocalizedString("_error_title_rename_", comment: "")
|
||||
|
||||
case .moveOrCopy(let fileName):
|
||||
return String(format: NSLocalizedString("_error_title_move_copy_", comment: ""), fileName)
|
||||
|
||||
case .createFolder(let folderName):
|
||||
return String(format: NSLocalizedString("_error_title_create_folder_", comment: ""), folderName)
|
||||
|
||||
case .favorite(let fileName):
|
||||
return String(format: NSLocalizedString("_error_title_favorite_", comment: ""), fileName)
|
||||
|
||||
case .createDocument(let fileName):
|
||||
return String(format: NSLocalizedString("_error_title_create_document_", comment: ""), fileName)
|
||||
|
||||
case .openDocument(let fileName):
|
||||
return String(format: NSLocalizedString("_error_title_open_document_", comment: ""), fileName)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -174,7 +174,7 @@ extension NCNetworking {
|
||||
func downloadError(withMetadata metadata: tableMetadata, error: NKError) async {
|
||||
await nkComm.appendServerErrorAccount(metadata.account, errorCode: error.errorCode)
|
||||
|
||||
nkLog(error: "Downloaded file: " + metadata.serverUrlFileName + ", result: \(error.logDescription)")
|
||||
nkLog(error: "Downloaded file: " + metadata.serverUrlFileName + ", result: error \(error.errorCode)")
|
||||
|
||||
if error.errorCode == NCGlobal.shared.errorResourceNotFound {
|
||||
self.utilityFileSystem.removeFile(atPath: self.utilityFileSystem.getDirectoryProviderStorageOcId(metadata.ocId, userId: metadata.userId, urlBase: metadata.urlBase))
|
||||
@@ -237,7 +237,7 @@ extension NCNetworking {
|
||||
guard results.error == .success, let files = results.files else {
|
||||
nkLog(tag: self.global.logTagSync,
|
||||
emoji: .error,
|
||||
message: "Read infinite folder: \(serverUrl), error: \(results.error.logDescription)")
|
||||
message: "Read infinite folder: \(serverUrl), error: \(results.error.errorCode)")
|
||||
return
|
||||
}
|
||||
|
||||
@@ -270,7 +270,6 @@ extension NCNetworking {
|
||||
metadata.sessionSelector = NCGlobal.shared.selectorSynchronizationOffline
|
||||
metadata.sessionTaskIdentifier = 0
|
||||
metadata.sessionError = ""
|
||||
metadata.errorKind = ""
|
||||
metadata.status = NCGlobal.shared.metadataStatusWaitDownload
|
||||
metadata.sessionDate = Date()
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ extension NCNetworking {
|
||||
await NCManageDatabase.shared.deleteLivePhoto(account: account, serverUrlFileNameNoExt: result.serverUrlFileNameNoExt)
|
||||
continue
|
||||
} else {
|
||||
nkLog(error: "Upload set LivePhoto Video failed: \(resultLivePhotoVideo.error.logDescription)")
|
||||
nkLog(error: "Upload set LivePhoto Video with error \(resultLivePhotoVideo.error.errorCode)")
|
||||
await NCManageDatabase.shared.setLivePhotoError(
|
||||
account: account,
|
||||
serverUrlFileNameNoExt: result.serverUrlFileNameNoExt)
|
||||
@@ -50,7 +50,7 @@ extension NCNetworking {
|
||||
serverUrlFileNameNoExt: result.serverUrlFileNameNoExt)
|
||||
continue
|
||||
} else {
|
||||
nkLog(error: "Upload set LivePhoto Image failed: \(resultLivePhotoImage.error.logDescription)")
|
||||
nkLog(error: "Upload set LivePhoto Image with error \(resultLivePhotoImage.error.errorCode)")
|
||||
await NCManageDatabase.shared.setLivePhotoError(
|
||||
account: account,
|
||||
serverUrlFileNameNoExt: result.serverUrlFileNameNoExt)
|
||||
|
||||
@@ -228,11 +228,10 @@ extension NCNetworking: NCTransferDelegate {
|
||||
let resultsFile = await NextcloudKit.shared.getFileFromFileIdAsync(fileId: fileId, account: account)
|
||||
|
||||
guard resultsFile.error == .success, let file = resultsFile.file else {
|
||||
let error = resultsFile.error == .success ? NKError(errorCode: NCGlobal.shared.errorResourceNotFound, errorDescription: "File not found") : resultsFile.error
|
||||
|
||||
Task {
|
||||
await showErrorBanner(windowScene: windowScene,
|
||||
error: error)
|
||||
text: resultsFile.error.errorDescription,
|
||||
errorCode: resultsFile.error.errorCode)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
@@ -267,7 +267,7 @@ extension NCNetworking {
|
||||
error: "Background upload task creation failed: " +
|
||||
"\(metadata.fileNameView), " +
|
||||
"task: \(String(describing: task?.taskIdentifier)), " +
|
||||
"error: \(error.logDescription)"
|
||||
"error: \(error.errorCode) \(error.errorDescription)"
|
||||
)
|
||||
|
||||
await NCManageDatabase.shared.setMetadataSessionAsync(
|
||||
@@ -275,8 +275,7 @@ extension NCNetworking {
|
||||
sessionTaskIdentifier: 0,
|
||||
sessionError: error.errorDescription,
|
||||
status: global.metadataStatusUploadError,
|
||||
errorCode: error.errorCode,
|
||||
errorKind: error.kind?.rawValue ?? ""
|
||||
errorCode: error.errorCode
|
||||
)
|
||||
|
||||
return error
|
||||
@@ -348,7 +347,6 @@ extension NCNetworking {
|
||||
|
||||
metadata.session = ""
|
||||
metadata.sessionError = ""
|
||||
metadata.errorKind = ""
|
||||
metadata.sessionTaskIdentifier = 0
|
||||
metadata.status = self.global.metadataStatusNormal
|
||||
|
||||
@@ -385,7 +383,7 @@ extension NCNetworking {
|
||||
func uploadError(withMetadata metadata: tableMetadata, error: NKError) async {
|
||||
await nkComm.appendServerErrorAccount(metadata.account, errorCode: error.errorCode)
|
||||
|
||||
nkLog(error: "Upload file: " + metadata.serverUrlFileName + ", result: \(error.logDescription)")
|
||||
nkLog(error: "Upload file: " + metadata.serverUrlFileName + ", result: error \(error.errorCode)")
|
||||
|
||||
if error.errorCode == NSURLErrorCancelled {
|
||||
if metadata.sessionSelector == self.global.selectorUploadAutoUpload {
|
||||
@@ -394,17 +392,16 @@ extension NCNetworking {
|
||||
sessionTaskIdentifier: 0,
|
||||
sessionError: error.errorDescription,
|
||||
status: self.global.metadataStatusUploadError,
|
||||
errorCode: error.errorCode,
|
||||
errorKind: error.kind?.rawValue ?? ""
|
||||
errorCode: error.errorCode
|
||||
)
|
||||
} else {
|
||||
await uploadCancelFile(metadata: metadata)
|
||||
}
|
||||
} else if error.kind == .blockedByVirusScan {
|
||||
} else if (error.errorCode == self.global.errorBadRequest || error.errorCode == self.global.errorUnsupportedMediaType) && error.errorDescription.localizedCaseInsensitiveContains("virus") {
|
||||
await uploadCancelFile(metadata: metadata)
|
||||
#if !EXTENSION
|
||||
let windowScene = await SceneManager.shared.getWindow(sceneIdentifier: metadata.sceneIdentifier)?.windowScene
|
||||
await showErrorBanner(windowScene: windowScene, error: error, context: .upload(fileName: metadata.fileNameView))
|
||||
await showErrorBanner(windowScene: windowScene, text: "_virus_detect_", errorCode: self.global.errorBadRequest)
|
||||
#endif
|
||||
// Client Diagnostic
|
||||
await NCManageDatabase.shared.addDiagnosticAsync(account: metadata.account, issue: self.global.diagnosticIssueVirusDetected)
|
||||
@@ -413,13 +410,12 @@ extension NCNetworking {
|
||||
sessionTaskIdentifier: 0,
|
||||
sessionError: error.errorDescription,
|
||||
status: self.global.metadataStatusUploadError,
|
||||
errorCode: error.errorCode,
|
||||
errorKind: error.kind?.rawValue ?? "")
|
||||
errorCode: error.errorCode)
|
||||
#if !EXTENSION
|
||||
let capabilities = await NKCapabilities.shared.getCapabilities(for: metadata.account)
|
||||
if !isAppInBackground {
|
||||
if capabilities.termsOfService {
|
||||
await termsOfService(metadata: metadata, error: error)
|
||||
await termsOfService(metadata: metadata)
|
||||
} else {
|
||||
await uploadForbidden(metadata: metadata, error: error)
|
||||
}
|
||||
@@ -430,8 +426,7 @@ extension NCNetworking {
|
||||
sessionTaskIdentifier: 0,
|
||||
sessionError: error.errorDescription,
|
||||
status: self.global.metadataStatusUploadError,
|
||||
errorCode: error.errorCode,
|
||||
errorKind: error.kind?.rawValue ?? "")
|
||||
errorCode: error.errorCode)
|
||||
|
||||
await self.transferDispatcher.notifyAllDelegates { delegate in
|
||||
delegate.transferChange(networkingStatus: self.global.networkingStatusUploaded,
|
||||
@@ -475,8 +470,7 @@ extension NCNetworking {
|
||||
@MainActor
|
||||
func uploadForbidden(metadata: tableMetadata, error: NKError) async {
|
||||
let newFileName = self.utilityFileSystem.createFileName(metadata.fileName, serverUrl: metadata.serverUrl, account: metadata.account)
|
||||
|
||||
let alertController = uploadForbiddenAlert(metadata: metadata, error: error)
|
||||
let alertController = UIAlertController(title: error.errorDescription, message: NSLocalizedString("_change_upload_filename_", comment: ""), preferredStyle: .alert)
|
||||
|
||||
alertController.addAction(UIAlertAction(title: String(format: NSLocalizedString("_save_file_as_", comment: ""), newFileName), style: .default, handler: { _ in
|
||||
Task {
|
||||
@@ -492,8 +486,7 @@ extension NCNetworking {
|
||||
sessionTaskIdentifier: 0,
|
||||
sessionError: "",
|
||||
status: self.global.metadataStatusWaitUpload,
|
||||
errorCode: error.errorCode,
|
||||
errorKind: error.kind?.rawValue ?? "")
|
||||
errorCode: error.errorCode)
|
||||
}
|
||||
}))
|
||||
alertController.addAction(UIAlertAction(title: NSLocalizedString("_discard_changes_", comment: ""), style: .destructive, handler: { _ in
|
||||
@@ -511,7 +504,7 @@ extension NCNetworking {
|
||||
}
|
||||
|
||||
@MainActor
|
||||
func termsOfService(metadata: tableMetadata, error: NKError) async {
|
||||
func termsOfService(metadata: tableMetadata) async {
|
||||
let options = NKRequestOptions(checkInterceptor: false, queue: .main)
|
||||
let results = await NextcloudKit.shared.getTermsOfServiceAsync(account: metadata.account, options: options)
|
||||
|
||||
@@ -522,7 +515,7 @@ extension NCNetworking {
|
||||
|
||||
let newFileName = self.utilityFileSystem.createFileName(metadata.fileName, serverUrl: metadata.serverUrl, account: metadata.account)
|
||||
|
||||
let alertController = uploadForbiddenAlert(metadata: metadata, error: error)
|
||||
let alertController = UIAlertController(title: results.error.errorDescription, message: NSLocalizedString("_change_upload_filename_", comment: ""), preferredStyle: .alert)
|
||||
|
||||
alertController.addAction(UIAlertAction(title: String(format: NSLocalizedString("_save_file_as_", comment: ""), newFileName), style: .default, handler: { _ in
|
||||
Task {
|
||||
@@ -538,8 +531,7 @@ extension NCNetworking {
|
||||
sessionTaskIdentifier: 0,
|
||||
sessionError: "",
|
||||
status: self.global.metadataStatusWaitUpload,
|
||||
errorCode: results.error.errorCode,
|
||||
errorKind: results.error.kind?.rawValue ?? "")
|
||||
errorCode: results.error.errorCode)
|
||||
}
|
||||
}))
|
||||
|
||||
@@ -557,15 +549,6 @@ extension NCNetworking {
|
||||
error: self.global.diagnosticProblemsForbidden)
|
||||
}
|
||||
|
||||
@MainActor
|
||||
private func uploadForbiddenAlert(metadata: tableMetadata, error: NKError) -> UIAlertController {
|
||||
let context = NCErrorContext.upload(fileName: metadata.fileNameView)
|
||||
let reason = error.userFriendlyMessage(for: context) ?? error.localizedGenericMessage
|
||||
let message = reason + "\n\n" + NSLocalizedString("_change_upload_filename_", comment: "")
|
||||
|
||||
return UIAlertController(title: context.failureTitle, message: message, preferredStyle: .alert)
|
||||
}
|
||||
|
||||
@MainActor
|
||||
private func getViewController(metadata: tableMetadata) -> UIViewController? {
|
||||
var controller = UIApplication.shared.mainAppWindow?.rootViewController
|
||||
|
||||
@@ -170,7 +170,7 @@ extension NCNetworking {
|
||||
fileNameFolder = utilityFileSystem.createFileName(fileNameFolder, serverUrl: serverUrl, account: session.account)
|
||||
}
|
||||
if fileNameFolder.isEmpty {
|
||||
return NKError(errorCode: global.errorIncorrectFileName, errorDescription: "", kind: .invalidName)
|
||||
return NKError(errorCode: global.errorIncorrectFileName, errorDescription: "")
|
||||
}
|
||||
let serverUrlFileName = utilityFileSystem.createServerUrl(serverUrl: serverUrl, fileName: fileNameFolder)
|
||||
|
||||
@@ -197,8 +197,7 @@ extension NCNetworking {
|
||||
await NCManageDatabase.shared.setMetadataSessionAsync(account: session.account,
|
||||
serverUrlFileName: serverUrlFileName,
|
||||
sessionError: resultCreateFolder.error.errorDescription,
|
||||
errorCode: resultCreateFolder.error.errorCode,
|
||||
errorKind: resultCreateFolder.error.kind?.rawValue ?? "")
|
||||
errorCode: resultCreateFolder.error.errorCode)
|
||||
}
|
||||
|
||||
return resultCreateFolder.error
|
||||
@@ -230,8 +229,7 @@ extension NCNetworking {
|
||||
await NCManageDatabase.shared.setMetadataSessionAsync(account: account,
|
||||
serverUrlFileName: serverUrlFileName,
|
||||
sessionError: results.error.errorDescription,
|
||||
errorCode: results.error.errorCode,
|
||||
errorKind: results.error.kind?.rawValue ?? "")
|
||||
errorCode: results.error.errorCode)
|
||||
}
|
||||
|
||||
return results.error
|
||||
@@ -335,14 +333,10 @@ extension NCNetworking {
|
||||
}
|
||||
|
||||
let permission = NCMetadataPermissions.permissionsContainsString(metadata.permissions, permissions: NCMetadataPermissions.permissionCanDeleteOrUnshare)
|
||||
if !metadata.permissions.isEmpty && permission == false {
|
||||
if (!metadata.permissions.isEmpty && permission == false) || (metadata.status != global.metadataStatusNormal) {
|
||||
return NKError(errorCode: global.errorNotPermission, errorDescription: "_no_permission_delete_file_")
|
||||
}
|
||||
|
||||
if metadata.status != global.metadataStatusNormal {
|
||||
return NKError(errorCode: global.errorNotPermission, errorDescription: "_error_file_busy_")
|
||||
}
|
||||
|
||||
ocIds.insert(metadata.ocId)
|
||||
serverUrls.insert(metadata.serverUrl)
|
||||
}
|
||||
@@ -408,14 +402,11 @@ extension NCNetworking {
|
||||
|
||||
func setStatusWaitRename(_ metadata: tableMetadata, fileNameNew: String, windowScene: UIWindowScene?) async -> NKError {
|
||||
let permission = NCMetadataPermissions.permissionsContainsString(metadata.permissions, permissions: NCMetadataPermissions.permissionCanRename)
|
||||
if !metadata.permissions.isEmpty && permission == false {
|
||||
if (!metadata.permissions.isEmpty && permission == false) ||
|
||||
(metadata.status != global.metadataStatusNormal && metadata.status != global.metadataStatusWaitRename) {
|
||||
return NKError(errorCode: global.errorNotPermission, errorDescription: "_no_permission_modify_file_")
|
||||
}
|
||||
|
||||
if metadata.status != global.metadataStatusNormal && metadata.status != global.metadataStatusWaitRename {
|
||||
return NKError(errorCode: global.errorNotPermission, errorDescription: "_error_file_busy_")
|
||||
}
|
||||
|
||||
if metadata.isDirectoryE2EE {
|
||||
if isOffline {
|
||||
return NKError(errorCode: global.errorOfflineNotAllowed, errorDescription: "_offline_not_allowed_")
|
||||
@@ -423,7 +414,7 @@ extension NCNetworking {
|
||||
|
||||
let error = await NCNetworkingE2EERename().rename(metadata: metadata, fileNameNew: fileNameNew, windowScene: windowScene)
|
||||
if error != .success {
|
||||
return error
|
||||
return NKError(errorCode: error.errorCode, errorDescription: error.errorDescription)
|
||||
}
|
||||
} else {
|
||||
let ocId = metadata.ocId
|
||||
@@ -468,14 +459,11 @@ extension NCNetworking {
|
||||
func setStatusWaitMove(_ metadata: tableMetadata, destination: String, overwrite: Bool) async -> NKError {
|
||||
let permission = NCMetadataPermissions.permissionsContainsString(metadata.permissions, permissions: NCMetadataPermissions.permissionCanRename)
|
||||
|
||||
if !metadata.permissions.isEmpty && !permission {
|
||||
if (!metadata.permissions.isEmpty && !permission) ||
|
||||
(metadata.status != global.metadataStatusNormal && metadata.status != global.metadataStatusWaitMove) {
|
||||
return NKError(errorCode: global.errorNotPermission, errorDescription: "_no_permission_modify_file_")
|
||||
}
|
||||
|
||||
if metadata.status != global.metadataStatusNormal && metadata.status != global.metadataStatusWaitMove {
|
||||
return NKError(errorCode: global.errorNotPermission, errorDescription: "_error_file_busy_")
|
||||
}
|
||||
|
||||
let ocId = metadata.ocId
|
||||
let serverUrl = metadata.serverUrl
|
||||
await self.transferDispatcher.notifyAllDelegatesAsync { delegate in
|
||||
@@ -528,14 +516,11 @@ extension NCNetworking {
|
||||
func setStatusWaitCopy(_ metadata: tableMetadata, destination: String, overwrite: Bool) async -> NKError {
|
||||
let permission = NCMetadataPermissions.permissionsContainsString(metadata.permissions, permissions: NCMetadataPermissions.permissionCanRename)
|
||||
|
||||
if !metadata.permissions.isEmpty && !permission {
|
||||
if (!metadata.permissions.isEmpty && !permission) ||
|
||||
(metadata.status != global.metadataStatusNormal && metadata.status != global.metadataStatusWaitCopy) {
|
||||
return NKError(errorCode: global.errorNotPermission, errorDescription: "_no_permission_modify_file_")
|
||||
}
|
||||
|
||||
if metadata.status != global.metadataStatusNormal && metadata.status != global.metadataStatusWaitCopy {
|
||||
return NKError(errorCode: global.errorNotPermission, errorDescription: "_error_file_busy_")
|
||||
}
|
||||
|
||||
let ocId = metadata.ocId
|
||||
let serverUrl = metadata.serverUrl
|
||||
await self.transferDispatcher.notifyAllDelegatesAsync { delegate in
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
// SPDX-FileCopyrightText: Nextcloud GmbH
|
||||
// SPDX-FileCopyrightText: 2026 Milen Pivchev
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
import Foundation
|
||||
import NextcloudKit
|
||||
|
||||
extension NKError {
|
||||
/// The message to show users for this error, or `nil` when nothing should be shown (success or cancellation).
|
||||
///
|
||||
/// Tries the app's own text, then the few operations where the generic message would be wrong, then
|
||||
/// NextcloudKit's generic message. Keep `errorDescription` for logs.
|
||||
func userFriendlyMessage(for context: NCErrorContext = .generic) -> String? {
|
||||
guard let kind, kind != .cancelled, errorCode != NCGlobal.shared.errorTaskCancelled else { return nil }
|
||||
|
||||
if let appMessage {
|
||||
return appMessage
|
||||
}
|
||||
|
||||
if let operationMessage = operationMessage(for: context, kind: kind) {
|
||||
return operationMessage
|
||||
}
|
||||
|
||||
return localizedGenericMessage
|
||||
}
|
||||
|
||||
/// Text the app wrote itself: a localization key, or the description of one of its own error codes.
|
||||
private var appMessage: String? {
|
||||
let localized = NSLocalizedString(errorDescription, comment: "")
|
||||
|
||||
if localized != errorDescription {
|
||||
return localized
|
||||
}
|
||||
|
||||
let global = NCGlobal.shared
|
||||
let isAppError = (global.errorInternalError...global.errorE2EENotEnabled).contains(errorCode)
|
||||
|
||||
return isAppError && !errorDescription.isEmpty ? errorDescription : nil
|
||||
}
|
||||
|
||||
/// Unique cases that require a specific non-generic error
|
||||
private func operationMessage(for context: NCErrorContext, kind: Kind) -> String? {
|
||||
switch (context, kind) {
|
||||
// Direct editing answers every failure with 403, so "no permission" isn't reliable there.
|
||||
case (.createDocument, .forbidden), (.openDocument, .forbidden):
|
||||
return NSLocalizedString("_error_occurred_", comment: "")
|
||||
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,3 +6,4 @@
|
||||
#import "NYMnemonic.h"
|
||||
#import "UIImage+animatedGIF.h"
|
||||
#import "NCPushNotificationEncryption.h"
|
||||
#import "TOPasscodeViewController.h"
|
||||
@@ -275,7 +275,7 @@ class NCNotification: UITableViewController, NCNotificationCellDelegate {
|
||||
self.tableView.reloadData()
|
||||
} else if error != .success {
|
||||
Task {
|
||||
await showErrorBanner(windowScene: self.windowScene, error: error)
|
||||
await showErrorBanner(windowScene: self.windowScene, text: error.errorDescription, errorCode: error.errorCode)
|
||||
}
|
||||
} else {
|
||||
print("[Error] The user has been changed during networking process.")
|
||||
@@ -317,7 +317,7 @@ class NCNotification: UITableViewController, NCNotificationCellDelegate {
|
||||
}
|
||||
} else if error != .success {
|
||||
Task {
|
||||
await showErrorBanner(windowScene: self.windowScene, error: error)
|
||||
await showErrorBanner(windowScene: self.windowScene, text: error.errorDescription, errorCode: error.errorCode)
|
||||
}
|
||||
} else {
|
||||
print("[Error] The user has been changed during networking process.")
|
||||
|
||||
@@ -49,7 +49,7 @@ class NCPushNotification {
|
||||
let signature = responsePN.signature,
|
||||
let subscribingPublicKey = responsePN.publicKey
|
||||
else {
|
||||
nkLog(tag: self.global.logTagPN, emoji: .error, message: "Subscribed to Push Notification Server \(urlBase) with error \(responsePN.error.logDescription)")
|
||||
nkLog(tag: self.global.logTagPN, emoji: .error, message: "Subscribed to Push Notification Server \(urlBase) with error \(responsePN.error.errorDescription)")
|
||||
return
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ class NCPushNotification {
|
||||
options: options)
|
||||
|
||||
guard responsePushProxy.error == .success else {
|
||||
nkLog(tag: self.global.logTagPN, emoji: .error, message: "Subscribed to Push Notification Server Proxy \(proxyServerUrl) with error \(responsePushProxy.error.logDescription)")
|
||||
nkLog(tag: self.global.logTagPN, emoji: .error, message: "Subscribed to Push Notification Server Proxy \(proxyServerUrl) with error \(responsePushProxy.error.errorDescription)")
|
||||
return
|
||||
}
|
||||
|
||||
@@ -94,8 +94,8 @@ class NCPushNotification {
|
||||
account: account,
|
||||
options: options)
|
||||
|
||||
nkLog(tag: self.global.logTagPN, emoji: .info, message: "Unsubscribed to Push Notification Server \(urlBase) with error \(responsePN.error.logDescription)")
|
||||
nkLog(tag: self.global.logTagPN, emoji: .info, message: "Unsubscribed to Push Notification Server Proxy \(proxyServerUrl) with error \(responseProxy.error.logDescription)")
|
||||
nkLog(tag: self.global.logTagPN, emoji: .info, message: "Unsubscribed to Push Notification Server \(urlBase) with error \(responsePN.error.errorDescription)")
|
||||
nkLog(tag: self.global.logTagPN, emoji: .info, message: "Unsubscribed to Push Notification Server Proxy \(proxyServerUrl) with error \(responseProxy.error.errorDescription)")
|
||||
}
|
||||
|
||||
func applicationdidReceiveRemoteNotification(userInfo: [AnyHashable: Any], completion: @escaping (_ result: UIBackgroundFetchResult) -> Void) {
|
||||
|
||||
@@ -13,10 +13,7 @@ class NCRichWorkspaceCoordinator: NSObject {
|
||||
if !NextcloudKit.shared.isNetworkReachable() {
|
||||
Task {
|
||||
let windowScene = await SceneManager.shared.getWindowScene(controller: controller)
|
||||
await showErrorBanner(windowScene: windowScene,
|
||||
title: NCErrorContext.createDocument(fileName: NCGlobal.shared.fileNameRichWorkspace).failureTitle ?? "_error_",
|
||||
text: "_offline_not_allowed_",
|
||||
errorCode: NCGlobal.shared.errorOfflineNotAllowed)
|
||||
await showErrorBanner(windowScene: windowScene, text: "_go_online_", errorCode: NCGlobal.shared.errorOfflineNotAllowed)
|
||||
}
|
||||
return
|
||||
}
|
||||
@@ -36,7 +33,7 @@ class NCRichWorkspaceCoordinator: NSObject {
|
||||
let resultError: NKError = error == .success ? .invalidData : error
|
||||
Task {
|
||||
let windowScene = await SceneManager.shared.getWindowScene(controller: controller)
|
||||
await showErrorBanner(windowScene: windowScene, error: resultError, context: .createDocument(fileName: NCGlobal.shared.fileNameRichWorkspace))
|
||||
await showErrorBanner(windowScene: windowScene, text: resultError.errorDescription, errorCode: resultError.errorCode)
|
||||
}
|
||||
return
|
||||
}
|
||||
@@ -53,10 +50,7 @@ class NCRichWorkspaceCoordinator: NSObject {
|
||||
if !NextcloudKit.shared.isNetworkReachable() {
|
||||
Task {
|
||||
let windowScene = await SceneManager.shared.getWindowScene(controller: controller)
|
||||
await showErrorBanner(windowScene: windowScene,
|
||||
title: NCErrorContext.openDocument(fileName: NCGlobal.shared.fileNameRichWorkspace).failureTitle ?? "_error_",
|
||||
text: "_go_online_",
|
||||
errorCode: NCGlobal.shared.errorOfflineNotAllowed)
|
||||
await showErrorBanner(windowScene: windowScene, text: "_go_online_", errorCode: NCGlobal.shared.errorOfflineNotAllowed)
|
||||
}
|
||||
return
|
||||
}
|
||||
@@ -75,11 +69,9 @@ class NCRichWorkspaceCoordinator: NSObject {
|
||||
NCActivityIndicator.shared.stop()
|
||||
guard error == .success, let url else {
|
||||
let resultError: NKError = error == .success ? .invalidData : error
|
||||
let fileName = metadata.fileNameView
|
||||
|
||||
Task {
|
||||
let windowScene = await SceneManager.shared.getWindowScene(controller: controller)
|
||||
await showErrorBanner(windowScene: windowScene, error: resultError, context: .openDocument(fileName: fileName))
|
||||
await showErrorBanner(windowScene: windowScene, text: resultError.errorDescription, errorCode: resultError.errorCode)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
@@ -16,7 +16,6 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
|
||||
|
||||
private let appDelegate = UIApplication.shared.delegate as? AppDelegate
|
||||
private var privacyProtectionWindow: UIWindow?
|
||||
private var passcodeWindow: NCPasscodeWindow?
|
||||
private let global = NCGlobal.shared
|
||||
private let alreadyMigratedMultiDomains = UserDefaults.standard.bool(forKey: NCGlobal.shared.udMigrationMultiDomains)
|
||||
|
||||
@@ -24,9 +23,6 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
|
||||
guard let windowScene = (scene as? UIWindowScene) else {
|
||||
return
|
||||
}
|
||||
NotificationCenter.default.removeObserver(self, name: NCPasscodeModel.lockoutNotification, object: nil)
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(passcodeLockoutStarted),
|
||||
name: NCPasscodeModel.lockoutNotification, object: nil)
|
||||
let versionApp = NCUtility().getVersionMaintenance()
|
||||
var lastVersion: String?
|
||||
|
||||
@@ -116,8 +112,6 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
|
||||
// NO account found, start with the Login
|
||||
//
|
||||
NCPreferences().removeAll()
|
||||
passcodeWindow?.hide()
|
||||
passcodeWindow = nil
|
||||
|
||||
if let bundleID = Bundle.main.bundleIdentifier {
|
||||
UserDefaults.standard.removePersistentDomain(forName: bundleID)
|
||||
@@ -190,8 +184,6 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
|
||||
//
|
||||
window?.rootViewController = controller
|
||||
window?.makeKeyAndVisible()
|
||||
// Also protect interfaces created after an asynchronous maintenance or migration.
|
||||
requestPasscodeIfNeeded(controller: controller)
|
||||
//
|
||||
if activateSceneForAccount {
|
||||
self.activateSceneForAccount(scene, account: activeTblAccount.account, controller: controller)
|
||||
@@ -207,9 +199,6 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
|
||||
func sceneDidDisconnect(_ scene: UIScene) {
|
||||
guard let windowScene = scene as? UIWindowScene else { return }
|
||||
|
||||
passcodeWindow?.hide()
|
||||
passcodeWindow = nil
|
||||
hidePrivacyProtectionWindow()
|
||||
LucidBannerRegistry.shared.remove(for: windowScene)
|
||||
lucidBanner = nil
|
||||
|
||||
@@ -219,11 +208,15 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
|
||||
func sceneWillEnterForeground(_ scene: UIScene) {
|
||||
hidePrivacyProtectionWindow()
|
||||
|
||||
guard let controller = window?.rootViewController as? NCMainTabBarController else {
|
||||
return
|
||||
if let rootHostingController = scene.rootHostingController() {
|
||||
if rootHostingController.anyRootView is Maintenance {
|
||||
return
|
||||
}
|
||||
}
|
||||
let session = SceneManager.shared.getSession(scene: scene)
|
||||
let controller = SceneManager.shared.getController(scene: scene)
|
||||
|
||||
activateSceneForAccount(scene, account: controller.account, controller: controller)
|
||||
activateSceneForAccount(scene, account: session.account, controller: controller)
|
||||
}
|
||||
|
||||
func sceneDidBecomeActive(_ scene: UIScene) {
|
||||
@@ -262,14 +255,16 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
|
||||
guard let tblAccount = NCManageDatabase.shared.getTableAccount(predicate: NSPredicate(format: "account == %@", session.account)) else {
|
||||
return
|
||||
}
|
||||
if NCPreferences().presentPasscode {
|
||||
showPrivacyProtectionWindow()
|
||||
}
|
||||
bgID = app.beginBackgroundTask(withName: "FlushBeforeSuspend") {
|
||||
app.endBackgroundTask(bgID); bgID = .invalid
|
||||
}
|
||||
|
||||
Task {
|
||||
Task { @MainActor in
|
||||
if NCPreferences().presentPasscode {
|
||||
showPrivacyProtectionWindow()
|
||||
}
|
||||
}
|
||||
defer {
|
||||
app.endBackgroundTask(bgID); bgID = .invalid
|
||||
}
|
||||
@@ -514,15 +509,14 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
|
||||
}
|
||||
|
||||
private func showPrivacyProtectionWindow() {
|
||||
guard privacyProtectionWindow == nil,
|
||||
let windowScene = self.window?.windowScene else {
|
||||
guard let windowScene = self.window?.windowScene else {
|
||||
return
|
||||
}
|
||||
|
||||
self.privacyProtectionWindow = UIWindow(windowScene: windowScene)
|
||||
self.privacyProtectionWindow?.rootViewController = UIStoryboard(name: "LaunchScreen", bundle: nil).instantiateInitialViewController()
|
||||
self.privacyProtectionWindow?.windowLevel = .alert + 1
|
||||
self.privacyProtectionWindow?.isHidden = false
|
||||
self.privacyProtectionWindow?.makeKeyAndVisible()
|
||||
}
|
||||
|
||||
private func hidePrivacyProtectionWindow() {
|
||||
@@ -530,66 +524,23 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
|
||||
privacyProtectionWindow = nil
|
||||
}
|
||||
|
||||
/// A failed settings authentication must protect every scene, independently of modal transitions.
|
||||
@objc private func passcodeLockoutStarted() {
|
||||
guard let controller = window?.rootViewController as? NCMainTabBarController else { return }
|
||||
requestPasscodeIfNeeded(controller: controller)
|
||||
}
|
||||
|
||||
/// Request the mandatory lock; return whether authentication is required, including while the UI is not ready.
|
||||
@discardableResult
|
||||
private func requestPasscodeIfNeeded(controller: NCMainTabBarController) -> Bool {
|
||||
guard NCPreferences().presentPasscode else {
|
||||
passcodeWindow?.hide()
|
||||
passcodeWindow = nil
|
||||
return false
|
||||
}
|
||||
guard !controller.account.isEmpty,
|
||||
NCManageDatabase.shared.getTableAccount(account: controller.account) != nil,
|
||||
let window,
|
||||
window.rootViewController === controller,
|
||||
let windowScene = window.windowScene else {
|
||||
return true
|
||||
}
|
||||
if passcodeWindow == nil {
|
||||
passcodeWindow = NCPasscodeWindow(mainWindow: window, windowScene: windowScene) { [weak self, weak controller] result in
|
||||
guard let self else { return }
|
||||
self.passcodeWindow = nil
|
||||
switch result {
|
||||
case .authenticated:
|
||||
if NCPreferences().accountRequest,
|
||||
let controller,
|
||||
self.window?.rootViewController === controller,
|
||||
NCManageDatabase.shared.getTableAccount(account: controller.account) != nil {
|
||||
self.requestedAccount(controller: controller)
|
||||
}
|
||||
case .reset:
|
||||
self.appDelegate?.resetApplication()
|
||||
case .cancelled, .configured, .disabled:
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
passcodeWindow?.show()
|
||||
return true
|
||||
}
|
||||
|
||||
private func activateSceneForAccount(_ scene: UIScene,
|
||||
account: String,
|
||||
controller: NCMainTabBarController?) {
|
||||
guard !account.isEmpty,
|
||||
let controller,
|
||||
controller.account == account,
|
||||
NCManageDatabase.shared.getTableAccount(account: account) != nil,
|
||||
let window,
|
||||
window.rootViewController === controller,
|
||||
let windowScene = scene as? UIWindowScene,
|
||||
window.windowScene === windowScene else {
|
||||
guard !account.isEmpty else {
|
||||
return
|
||||
}
|
||||
|
||||
if !requestPasscodeIfNeeded(controller: controller), NCPreferences().accountRequest {
|
||||
requestedAccount(controller: controller)
|
||||
if let window = SceneManager.shared.getWindow(scene: scene),
|
||||
let controller = SceneManager.shared.getController(scene: scene) {
|
||||
window.rootViewController = controller
|
||||
if NCPreferences().presentPasscode {
|
||||
NCPasscode.shared.presentPasscode(viewController: controller, delegate: self) {
|
||||
NCPasscode.shared.enableTouchFaceID()
|
||||
}
|
||||
} else if NCPreferences().accountRequest {
|
||||
requestedAccount(controller: controller)
|
||||
}
|
||||
}
|
||||
|
||||
Task {
|
||||
@@ -611,15 +562,8 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
|
||||
|
||||
// MARK: - Extension
|
||||
|
||||
extension SceneDelegate {
|
||||
extension SceneDelegate: NCPasscodeDelegate {
|
||||
func requestedAccount(controller: UIViewController?) {
|
||||
guard var presenter = controller else { return }
|
||||
while let presented = presenter.presentedViewController {
|
||||
if let popup = presented as? NCPopupViewController, popup.contentController is NCAccountRequest {
|
||||
return
|
||||
}
|
||||
presenter = presented
|
||||
}
|
||||
let tblAccounts = NCManageDatabase.shared.getAllTableAccount()
|
||||
if tblAccounts.count > 1, let accountRequestVC = UIStoryboard(name: "NCAccountRequest", bundle: nil).instantiateInitialViewController() as? NCAccountRequest {
|
||||
accountRequestVC.controller = controller
|
||||
@@ -631,7 +575,7 @@ extension SceneDelegate {
|
||||
accountRequestVC.delegate = self
|
||||
accountRequestVC.startTimer(nil)
|
||||
|
||||
let availableHeight = presenter.view.safeAreaLayoutGuide.layoutFrame.height
|
||||
let availableHeight = controller?.view.safeAreaLayoutGuide.layoutFrame.height ?? window?.safeAreaLayoutGuide.layoutFrame.height ?? 0
|
||||
let maximumHeight = availableHeight * 0.8
|
||||
let numberCell = tblAccounts.count
|
||||
let height = min(CGFloat(numberCell * Int(accountRequestVC.heightCell) + 45), maximumHeight)
|
||||
@@ -639,9 +583,13 @@ extension SceneDelegate {
|
||||
let popup = NCPopupViewController(contentController: accountRequestVC, popupWidth: 300, popupHeight: height + 20)
|
||||
popup.backgroundAlpha = 0.8
|
||||
|
||||
presenter.present(popup, animated: true)
|
||||
controller?.present(popup, animated: true)
|
||||
}
|
||||
}
|
||||
|
||||
func passcodeReset(_ passcodeViewController: TOPasscodeViewController) {
|
||||
appDelegate?.resetApplication()
|
||||
}
|
||||
}
|
||||
|
||||
extension SceneDelegate: NCAccountRequestDelegate {
|
||||
|
||||
@@ -217,7 +217,7 @@ class NCSelect: UIViewController, UIGestureRecognizerDelegate, UIAdaptivePresent
|
||||
if error != .success {
|
||||
Task {
|
||||
let windowScene = SceneManager.shared.getWindow(sceneIdentifier: sceneIdentifier)?.windowScene
|
||||
await showErrorBanner(windowScene: windowScene, error: error, context: NCErrorContext(networkingStatus: networkingStatus, fileName: fileName))
|
||||
await showErrorBanner(windowScene: windowScene, text: error.errorDescription, errorCode: error.errorCode)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -258,12 +258,12 @@ class NCSelect: UIViewController, UIGestureRecognizerDelegate, UIAdaptivePresent
|
||||
func createFolderButtonPressed(_ sender: UIButton) {
|
||||
Task { @MainActor in
|
||||
let capabilities = await NKCapabilities.shared.getCapabilities(for: session.account)
|
||||
let alertController = UIAlertController.createFolderWith(serverUrl: serverUrl, session: session, capabilities: capabilities) { error, folderName in
|
||||
let alertController = UIAlertController.createFolderWith(serverUrl: serverUrl, session: session, capabilities: capabilities) { error in
|
||||
if error != .success {
|
||||
Task {
|
||||
await showErrorBanner(windowScene: self.windowScene,
|
||||
error: error,
|
||||
context: .createFolder(folderName: folderName))
|
||||
text: error.errorDescription,
|
||||
errorCode: error.errorCode)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ final class NCSelectOpen: NCSelectDelegate {
|
||||
let error = await NCNetworking.shared.setStatusWaitCopy(metadata, destination: destination, overwrite: overwrite)
|
||||
if error != .success {
|
||||
let windowScene = await SceneManager.shared.getWindowScene(controller: controller)
|
||||
await showErrorBanner(windowScene: windowScene, error: error, context: .moveOrCopy(fileName: metadata.fileNameView))
|
||||
await showErrorBanner(windowScene: windowScene, error: error)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ final class NCSelectOpen: NCSelectDelegate {
|
||||
let error = await NCNetworking.shared.setStatusWaitMove(metadata, destination: destination, overwrite: overwrite)
|
||||
if error != .success {
|
||||
let windowScene = await SceneManager.shared.getWindowScene(controller: controller)
|
||||
await showErrorBanner(windowScene: windowScene, error: error, context: .moveOrCopy(fileName: metadata.fileNameView))
|
||||
await showErrorBanner(windowScene: windowScene, error: error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,471 +1,247 @@
|
||||
{\rtf1\ansi\ansicpg1252\uc1
|
||||
{\fonttbl\f0\fswiss Helvetica;\f1\fswiss Helvetica-Bold;}
|
||||
\paperw12240\paperh15840\margl1440\margr1440
|
||||
\pard\f0\fs24
|
||||
This software contains additional third-party software, including direct and transitive Swift Package dependencies.\
|
||||
Each project is distributed under its original license. Links below identify the license files for the resolved package revisions.\
|
||||
{\rtf1\ansi\ansicpg1252\cocoartf2868
|
||||
\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fswiss\fcharset0 Helvetica;\f1\fswiss\fcharset0 Helvetica-Bold;}
|
||||
{\colortbl;\red255\green255\blue255;}
|
||||
{\*\expandedcolortbl;;}
|
||||
\paperw12240\paperh15840\margl1440\margr1440\vieww25280\viewh28800\viewkind0
|
||||
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0
|
||||
|
||||
\f0\fs24 \cf0 \
|
||||
This software contains additional third party software. \
|
||||
All the third party software included or linked is redistributed under the terms and conditions of their original licenses. \
|
||||
__________________________________\
|
||||
\
|
||||
|
||||
\f1\b Abseil\f0\b0\
|
||||
\
|
||||
https://github.com/google/abseil-cpp-binary\
|
||||
\
|
||||
Apache License 2.0\
|
||||
\
|
||||
License: https://github.com/google/abseil-cpp-binary/blob/26509120768c4add61cc1a63059f15f4fb49edb4/LICENSE\
|
||||
__________________________________\
|
||||
\
|
||||
\f1\b Nextcloud Kit\
|
||||
|
||||
\f1\b Alamofire\f0\b0\
|
||||
\
|
||||
https://github.com/Alamofire/Alamofire\
|
||||
\
|
||||
MIT License\
|
||||
\
|
||||
Copyright (c) 2014-2022 Alamofire Software Foundation (http://alamofire.org/)\
|
||||
\
|
||||
License: https://github.com/Alamofire/Alamofire/blob/bda9ed57d72988a3a2ada33d824583541f86eac6/LICENSE\
|
||||
__________________________________\
|
||||
\
|
||||
|
||||
\f1\b App Check\f0\b0\
|
||||
\
|
||||
https://github.com/google/app-check\
|
||||
\
|
||||
Apache License 2.0\
|
||||
\
|
||||
License: https://github.com/google/app-check/blob/c7eb17e5545f36e43dc50e70da09c2e999714e16/LICENSE\
|
||||
__________________________________\
|
||||
\
|
||||
|
||||
\f1\b CodeScanner\f0\b0\
|
||||
\
|
||||
https://github.com/twostraws/CodeScanner\
|
||||
\
|
||||
MIT License\
|
||||
\
|
||||
Copyright (c) 2021 Paul Hudson\
|
||||
\
|
||||
License: https://github.com/twostraws/CodeScanner/blob/5e886430238944c7200fc9e10dbf2d9550dba865/LICENSE\
|
||||
__________________________________\
|
||||
\
|
||||
|
||||
\f1\b DropDown\f0\b0\
|
||||
\
|
||||
https://github.com/AssistoLab/DropDown\
|
||||
\
|
||||
MIT License\
|
||||
\
|
||||
Copyright (c) 2014 kevin-hirsch\
|
||||
\
|
||||
License: https://github.com/AssistoLab/DropDown/blob/2ab6f6ce19f0117d1a76ea043ef8f57722c65d16/LICENSE\
|
||||
__________________________________\
|
||||
\
|
||||
|
||||
\f1\b EasyTipView\f0\b0\
|
||||
\
|
||||
https://github.com/marinofaggiana/EasyTipView\
|
||||
\
|
||||
MIT License\
|
||||
\
|
||||
Copyright (c) 2015 Teodor Patra\u351?\
|
||||
\
|
||||
License: https://github.com/marinofaggiana/EasyTipView/blob/bb25a13c8fa5d65144c8e5b5d31237b80a001b07/LICENSE\
|
||||
__________________________________\
|
||||
\
|
||||
|
||||
\f1\b Firebase (Crashlytics and Database)\f0\b0\
|
||||
\
|
||||
https://github.com/firebase/firebase-ios-sdk\
|
||||
\
|
||||
Apache License 2.0\
|
||||
\
|
||||
License: https://github.com/firebase/firebase-ios-sdk/blob/1c35b9453868cea1ecdf9f112b5b23b8b6343854/LICENSE\
|
||||
__________________________________\
|
||||
\
|
||||
|
||||
\f1\b Google Ads On Device Conversion\f0\b0\
|
||||
\
|
||||
https://github.com/googleads/google-ads-on-device-conversion-ios-sdk\
|
||||
\
|
||||
Apache License 2.0\
|
||||
\
|
||||
License: https://github.com/googleads/google-ads-on-device-conversion-ios-sdk/blob/0208e2681ec81f8a9c81084696f60fcce26cb7ee/LICENSE\
|
||||
__________________________________\
|
||||
\
|
||||
|
||||
\f1\b GoogleAppMeasurement\f0\b0\
|
||||
\
|
||||
https://github.com/google/GoogleAppMeasurement\
|
||||
\
|
||||
Apache License 2.0\
|
||||
\
|
||||
License: https://github.com/google/GoogleAppMeasurement/blob/1a3546fb9189292e9d64db9e72add7a286c0f85a/LICENSE\
|
||||
__________________________________\
|
||||
\
|
||||
|
||||
\f1\b GoogleDataTransport\f0\b0\
|
||||
\
|
||||
https://github.com/google/GoogleDataTransport\
|
||||
\
|
||||
Apache License 2.0\
|
||||
\
|
||||
License: https://github.com/google/GoogleDataTransport/blob/ba3358d3c3dbae8ef230b58a46b97ad65e84e974/LICENSE\
|
||||
__________________________________\
|
||||
\
|
||||
|
||||
\f1\b GoogleUtilities\f0\b0\
|
||||
\
|
||||
https://github.com/google/GoogleUtilities\
|
||||
\
|
||||
Apache License 2.0\
|
||||
\
|
||||
License: https://github.com/google/GoogleUtilities/blob/cc31f5ed464b111f877ce8554cbef4455d410d91/LICENSE\
|
||||
__________________________________\
|
||||
\
|
||||
|
||||
\f1\b GRDB.swift\f0\b0\
|
||||
\
|
||||
https://github.com/groue/GRDB.swift\
|
||||
\
|
||||
MIT License\
|
||||
\
|
||||
Copyright (C) 2015-2025 Gwendal Rou\u233?\
|
||||
\
|
||||
License: https://github.com/groue/GRDB.swift/blob/b83108d10f42680d78f23fe4d4d80fc88dab3212/LICENSE\
|
||||
__________________________________\
|
||||
\
|
||||
|
||||
\f1\b gRPC\f0\b0\
|
||||
\
|
||||
https://github.com/google/grpc-binary\
|
||||
\
|
||||
Apache License 2.0\
|
||||
\
|
||||
License: https://github.com/google/grpc-binary/blob/9d5e9f05670c9eab8d8c22731ddd5d4d9cf867a8/LICENSE\
|
||||
__________________________________\
|
||||
\
|
||||
|
||||
\f1\b GTM Session Fetcher\f0\b0\
|
||||
\
|
||||
https://github.com/google/gtm-session-fetcher\
|
||||
\
|
||||
Apache License 2.0\
|
||||
\
|
||||
License: https://github.com/google/gtm-session-fetcher/blob/724a52eea6329b7e12d3ad8300d76ca9f3895fcc/LICENSE\
|
||||
__________________________________\
|
||||
\
|
||||
|
||||
\f1\b GzipSwift\f0\b0\
|
||||
\
|
||||
https://github.com/1024jp/GzipSwift\
|
||||
\
|
||||
MIT License\
|
||||
\
|
||||
\u169? 2014-2026 1024jp\
|
||||
\
|
||||
License: https://github.com/1024jp/GzipSwift/blob/41d37421fe2cbbfae4a5593dc29d12999fb73cd7/LICENSE\
|
||||
__________________________________\
|
||||
\
|
||||
|
||||
\f1\b Interop for Google SDKs\f0\b0\
|
||||
\
|
||||
https://github.com/google/interop-ios-for-google-sdks\
|
||||
\
|
||||
Apache License 2.0\
|
||||
\
|
||||
License: https://github.com/google/interop-ios-for-google-sdks/blob/040d087ac2267d2ddd4cca36c757d1c6a05fdbfe/LICENSE\
|
||||
__________________________________\
|
||||
\
|
||||
|
||||
\f1\b KeychainAccess\f0\b0\
|
||||
\
|
||||
https://github.com/kishikawakatsumi/KeychainAccess\
|
||||
\
|
||||
MIT License\
|
||||
\
|
||||
Copyright (c) 2014 kishikawa katsumi\
|
||||
\
|
||||
License: https://github.com/kishikawakatsumi/KeychainAccess/blob/84e546727d66f1adc5439debad16270d0fdd04e7/LICENSE\
|
||||
__________________________________\
|
||||
\
|
||||
|
||||
\f1\b LevelDB\f0\b0\
|
||||
\
|
||||
https://github.com/firebase/leveldb\
|
||||
\
|
||||
BSD 3-Clause License\
|
||||
\
|
||||
Copyright (c) 2011 The LevelDB Authors. All rights reserved.\
|
||||
\
|
||||
License: https://github.com/firebase/leveldb/blob/a0bc79961d7be727d258d33d5a6b2f1023270ba1/LICENSE\
|
||||
__________________________________\
|
||||
\
|
||||
|
||||
\f1\b LucidBanner\f0\b0\
|
||||
\
|
||||
https://github.com/marinofaggiana/LucidBanner\
|
||||
\
|
||||
MIT License\
|
||||
\
|
||||
Copyright (c) 2025 Marino Faggiana\
|
||||
\
|
||||
License: https://github.com/marinofaggiana/LucidBanner/blob/408af8b2ff2451f055ff17042d8b9fb5c822d5fd/LICENSE\
|
||||
__________________________________\
|
||||
\
|
||||
|
||||
\f1\b Mantis\f0\b0\
|
||||
\
|
||||
https://github.com/marinofaggiana/Mantis\
|
||||
\
|
||||
MIT License\
|
||||
\
|
||||
Copyright (c) 2018 Yingtao Guo\
|
||||
\
|
||||
License: https://github.com/marinofaggiana/Mantis/blob/d145ce2403e0d94d4926eb8510bc4966fbf1bfca/LICENSE\
|
||||
__________________________________\
|
||||
\
|
||||
|
||||
\f1\b MarkdownKit\f0\b0\
|
||||
\
|
||||
https://github.com/bmoliveira/MarkdownKit\
|
||||
\
|
||||
MIT License\
|
||||
\
|
||||
Copyright (c) 2016 Ivan Bruel\
|
||||
\
|
||||
License: https://github.com/bmoliveira/MarkdownKit/blob/39ea7a3fc7e65bcafe55152592b834859be574a5/LICENSE\
|
||||
__________________________________\
|
||||
\
|
||||
|
||||
\f1\b nanopb\f0\b0\
|
||||
\
|
||||
https://github.com/firebase/nanopb\
|
||||
\
|
||||
zlib License\
|
||||
\
|
||||
Copyright (c) 2011 Petteri Aimonen <jpa at nanopb.mail.kapsi.fi>\
|
||||
\
|
||||
License: https://github.com/firebase/nanopb/blob/3851d94a41890dea16dc3db34caf60e585cb4163/LICENSE.txt\
|
||||
__________________________________\
|
||||
\
|
||||
|
||||
\f1\b NextcloudKit\f0\b0\
|
||||
\
|
||||
\f0\b0 \
|
||||
https://github.com/nextcloud/NextcloudKit\
|
||||
\
|
||||
GNU General Public License v3.0 or later, with Apple App Store exception (COPYING.iOS)\
|
||||
GPLv3 Licensed \
|
||||
\
|
||||
Copyright Nextcloud GmbH, Marino Faggiana and Nextcloud contributors\
|
||||
Copyright (c) Marino Faggiana\
|
||||
\
|
||||
License: https://github.com/nextcloud/NextcloudKit/blob/705e69cf0526cac0bdeaf21699c41c895cae42a0/LICENSE.txt\
|
||||
|
||||
\f1\b Alamofire -
|
||||
\f0\b0 MIT License (MIT)
|
||||
\f1\b \
|
||||
SwiftyXMLParser -
|
||||
\f0\b0 MIT License (MIT)
|
||||
\f1\b \
|
||||
SwiftyJSON -
|
||||
\f0\b0 MIT License (MIT) \
|
||||
__________________________________\
|
||||
\
|
||||
|
||||
\f1\b NYMnemonic - BIP 39 style mnemonic codes\f0\b0\
|
||||
\f1\b NYMnemonic - BIP 39 style mnemonic codes\
|
||||
|
||||
\f0\b0 __________________________________\
|
||||
\
|
||||
MIT License\
|
||||
\pard\pardeftab720\partightenfactor0
|
||||
|
||||
\f1\b \cf0 LucidBanner\
|
||||
\
|
||||
Copyright (c) 2014 Nybex, Inc. (https://nybex.com)\
|
||||
h
|
||||
\f0\b0 ttps://github.com/marinofaggiana/LucidBanner
|
||||
\f1\b \
|
||||
\
|
||||
|
||||
\f0\b0 MIT License\
|
||||
\
|
||||
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0
|
||||
\cf0 Copyright (c) Marino Faggiana
|
||||
\f1\b \
|
||||
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0
|
||||
|
||||
\f0\b0 \cf0 __________________________________\
|
||||
\
|
||||
\pard\pardeftab720\partightenfactor0
|
||||
|
||||
\f1\b \cf0 NextcloudKit\
|
||||
\
|
||||
h
|
||||
\f0\b0 ttps://github.com/nextcloud/NextcloudKit
|
||||
\f1\b \
|
||||
\
|
||||
|
||||
\f0\b0 GPLv3 License
|
||||
\f1\b \
|
||||
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardeftab720\pardirnatural\partightenfactor0
|
||||
|
||||
\f0\b0 \cf0 __________________________________\
|
||||
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0
|
||||
|
||||
\f1\b \cf0 \
|
||||
OpenSSL\
|
||||
\
|
||||
|
||||
\f0\b0 https://www.openssl.org/source/license.html\
|
||||
|
||||
\f1\b \
|
||||
|
||||
\f0\b0 Copyright (C) 1995-1998 Eric Young ([email protected])\
|
||||
__________________________________\
|
||||
\
|
||||
|
||||
\f1\b OpenSSL\f0\b0\
|
||||
\
|
||||
https://github.com/krzyzanowskim/OpenSSL\
|
||||
\f1\b Realm
|
||||
\f0\b0 \
|
||||
\
|
||||
Apache License 2.0\
|
||||
\
|
||||
License: https://github.com/krzyzanowskim/OpenSSL/blob/0a6149bff4fb00921ce0ec1811f726b166638095/LICENSE.txt\
|
||||
Copyright (c) 2014-2017 https://realm.io\
|
||||
__________________________________\
|
||||
\
|
||||
|
||||
\f1\b PopupView\f0\b0\
|
||||
\
|
||||
https://github.com/exyte/PopupView\
|
||||
\f1\b KeychainAccess
|
||||
\f0\b0 \
|
||||
\
|
||||
MIT License\
|
||||
\
|
||||
Copyright (c) 2019 exyte <[email protected]>\
|
||||
\
|
||||
License: https://github.com/exyte/PopupView/blob/99695337ce9e965b70e4aa14b49b1a9920017333/LICENSE\
|
||||
Copyright (c) kishikawa katsumi\
|
||||
__________________________________\
|
||||
\
|
||||
|
||||
\f1\b Promises\f0\b0\
|
||||
\
|
||||
https://github.com/google/promises\
|
||||
\
|
||||
Apache License 2.0\
|
||||
\
|
||||
License: https://github.com/google/promises/blob/f4a19a3c313dc2616c70bb49d29a799fb16be837/LICENSE\
|
||||
__________________________________\
|
||||
\
|
||||
|
||||
\f1\b QRCodeReader.swift\f0\b0\
|
||||
\
|
||||
https://github.com/yannickl/QRCodeReader.swift\
|
||||
\
|
||||
MIT License\
|
||||
\
|
||||
Copyright (c) 2014-present Yannick Loriot\
|
||||
\
|
||||
License: https://github.com/yannickl/QRCodeReader.swift/blob/5020b5a47199d8ba80c83a4b4fafd70e9dc9dc7f/LICENSE\
|
||||
__________________________________\
|
||||
\
|
||||
|
||||
\f1\b Realm Core\f0\b0\
|
||||
\
|
||||
https://github.com/realm/realm-core\
|
||||
\
|
||||
Apache License 2.0\
|
||||
\
|
||||
License: https://github.com/realm/realm-core/blob/b4192c46305570577c4d08df790fddec5ab3aa04/LICENSE\
|
||||
__________________________________\
|
||||
\
|
||||
|
||||
\f1\b Realm Swift\f0\b0\
|
||||
\
|
||||
https://github.com/realm/realm-swift\
|
||||
\
|
||||
Apache License 2.0\
|
||||
\
|
||||
License: https://github.com/realm/realm-swift/blob/a40ced79265b644a896e393b0f3a37e7916e7de3/LICENSE\
|
||||
__________________________________\
|
||||
\
|
||||
|
||||
\f1\b Swift Atomics\f0\b0\
|
||||
\
|
||||
https://github.com/apple/swift-atomics\
|
||||
\
|
||||
Apache License 2.0 with Swift Runtime Library Exception\
|
||||
\
|
||||
License: https://github.com/apple/swift-atomics/blob/0442cb5a3f98ab802acb777929fdb446bda11a34/LICENSE.txt\
|
||||
__________________________________\
|
||||
\
|
||||
|
||||
\f1\b Swift Collections\f0\b0\
|
||||
\
|
||||
https://github.com/apple/swift-collections\
|
||||
\
|
||||
Apache License 2.0 with Swift Runtime Library Exception\
|
||||
\
|
||||
License: https://github.com/apple/swift-collections/blob/35a1edcb8ebd2bfe251d587f0b69e62af28f508c/LICENSE.txt\
|
||||
__________________________________\
|
||||
\
|
||||
|
||||
\f1\b Swift System\f0\b0\
|
||||
\
|
||||
https://github.com/apple/swift-system\
|
||||
\
|
||||
Apache License 2.0 with Swift Runtime Library Exception\
|
||||
\
|
||||
License: https://github.com/apple/swift-system/blob/869129b7bf4ecc57b97d0193ad29690ca2134750/LICENSE.txt\
|
||||
__________________________________\
|
||||
\
|
||||
|
||||
\f1\b Swifter\f0\b0\
|
||||
\
|
||||
https://github.com/httpswift/swifter\
|
||||
\
|
||||
BSD 3-Clause License\
|
||||
\
|
||||
Copyright (c) 2014, Damian Ko\u322?akowski\
|
||||
\
|
||||
License: https://github.com/httpswift/swifter/blob/1e4f51c92d7ca486242d8bf0722b99de2c3531aa/LICENSE\
|
||||
__________________________________\
|
||||
\
|
||||
|
||||
\f1\b SwiftNIO\f0\b0\
|
||||
\
|
||||
https://github.com/apple/swift-nio\
|
||||
\
|
||||
Apache License 2.0\
|
||||
\
|
||||
License: https://github.com/apple/swift-nio/blob/6db9d9abd92ad7399b8a564cafbb87d3507245fa/LICENSE.txt\
|
||||
__________________________________\
|
||||
\
|
||||
|
||||
\f1\b SwiftNIO SSL\f0\b0\
|
||||
\
|
||||
https://github.com/apple/swift-nio-ssl\
|
||||
\
|
||||
Apache License 2.0\
|
||||
\
|
||||
License: https://github.com/apple/swift-nio-ssl/blob/03827c1a9fdb2b6b00a4e93ede8861520263af8c/LICENSE.txt\
|
||||
__________________________________\
|
||||
\
|
||||
|
||||
\f1\b SwiftRichString\f0\b0\
|
||||
\
|
||||
https://github.com/malcommac/SwiftRichString\
|
||||
\
|
||||
MIT License\
|
||||
\
|
||||
Copyright (c) 2018 Daniele Margutti\
|
||||
\
|
||||
License: https://github.com/malcommac/SwiftRichString/blob/9bf4b5af6bb4386865636fc504d6c588c2b65040/LICENSE\
|
||||
__________________________________\
|
||||
\
|
||||
|
||||
\f1\b SwiftyJSON\f0\b0\
|
||||
\
|
||||
https://github.com/SwiftyJSON/SwiftyJSON\
|
||||
\
|
||||
MIT License\
|
||||
\
|
||||
Copyright (c) 2017 Ruoyu Fu\
|
||||
\
|
||||
License: https://github.com/SwiftyJSON/SwiftyJSON/blob/af76cf3ef710b6ca5f8c05f3a31307d44a3c5828/LICENSE\
|
||||
__________________________________\
|
||||
\
|
||||
|
||||
\f1\b SwiftyXMLParser\f0\b0\
|
||||
\
|
||||
https://github.com/yahoojapan/SwiftyXMLParser\
|
||||
\
|
||||
MIT License\
|
||||
\
|
||||
Copyright (c) 2016 Yahoo Japan Corporation\
|
||||
\
|
||||
License: https://github.com/yahoojapan/SwiftyXMLParser/blob/d7a1d23f04c86c1cd2e8f19247dd15d74e0ea8be/LICENSE\
|
||||
__________________________________\
|
||||
\
|
||||
|
||||
\f1\b TagListView\f0\b0\
|
||||
\
|
||||
https://github.com/ElaWorkshop/TagListView\
|
||||
\
|
||||
MIT License\
|
||||
\
|
||||
Copyright (c) 2015 LIU Dongyuan\
|
||||
\
|
||||
License: https://github.com/ElaWorkshop/TagListView/blob/b30b61826736f4d9ec04aef5df891f3914423f16/LICENSE\
|
||||
__________________________________\
|
||||
\
|
||||
|
||||
\f1\b TLPhotoPicker\f0\b0\
|
||||
\
|
||||
https://github.com/tilltue/TLPhotoPicker\
|
||||
\
|
||||
MIT License\
|
||||
\
|
||||
Copyright (c) 2017 wade.hawk <[email protected]>\
|
||||
\
|
||||
License: https://github.com/tilltue/TLPhotoPicker/blob/91d7bca65721928af30c6a2bb1a1f517f7862964/LICENSE\
|
||||
__________________________________\
|
||||
\
|
||||
|
||||
\f1\b VLCKit (MobileVLCKit)\f0\b0\
|
||||
\
|
||||
https://code.videolan.org/videolan/VLCKit\
|
||||
\f1\b VLCKit
|
||||
\f0\b0 \
|
||||
\
|
||||
GNU Lesser General Public License 2.1\
|
||||
\
|
||||
Copyright VideoLAN\
|
||||
\
|
||||
License: https://code.videolan.org/videolan/VLCKit/-/blob/master/COPYING\
|
||||
Copyright (c) VideoLAN\
|
||||
__________________________________\
|
||||
\
|
||||
}
|
||||
|
||||
\f1\b SwiftRichString
|
||||
\f0\b0 \
|
||||
\
|
||||
MIT License\
|
||||
\
|
||||
Copyright (c) Daniele Margutti\
|
||||
__________________________________\
|
||||
\
|
||||
|
||||
\f1\b QRCodeReader
|
||||
\f0\b0 \
|
||||
\
|
||||
MIT License\
|
||||
\
|
||||
Copyright (c) Yannick Loriot\
|
||||
__________________________________\
|
||||
\
|
||||
|
||||
\f1\b Parchment
|
||||
\f0\b0 \
|
||||
\
|
||||
MIT License\
|
||||
\
|
||||
Copyright (c) Martin Rechsteiner\
|
||||
__________________________________\
|
||||
\
|
||||
|
||||
\f1\b DropDown
|
||||
\f0\b0 \
|
||||
\
|
||||
MIT License\
|
||||
\
|
||||
Copyright (c) Kevin Hirsch\
|
||||
__________________________________\
|
||||
\
|
||||
|
||||
\f1\b TLPhotoPicker
|
||||
\f0\b0 \
|
||||
\
|
||||
MIT License\
|
||||
\
|
||||
Copyright (c) wade.hawk, [email protected]\
|
||||
__________________________________\
|
||||
\
|
||||
|
||||
\f1\b MarkdownKit
|
||||
\f0\b0 \
|
||||
\
|
||||
MIT License\
|
||||
__________________________________\
|
||||
\
|
||||
|
||||
\f1\b Firebase Crashlytics
|
||||
\f0\b0 \
|
||||
\
|
||||
Apache License 2.0\
|
||||
\
|
||||
Copyright (c) Google Inc.\
|
||||
__________________________________\
|
||||
\
|
||||
|
||||
\f1\b Queuer
|
||||
\f0\b0 \
|
||||
\
|
||||
MIT License\
|
||||
\
|
||||
Copyright (c) Fabrizio Brancati\
|
||||
__________________________________\
|
||||
\
|
||||
|
||||
\f1\b TOPasscodeViewController
|
||||
\f0\b0 \
|
||||
\
|
||||
MIT License\
|
||||
\
|
||||
Copyright (c) Tim Oliver\
|
||||
__________________________________\
|
||||
\
|
||||
|
||||
\f1\b EasyTipView
|
||||
\f0\b0 \
|
||||
\
|
||||
MIT License\
|
||||
\
|
||||
Copyright (c) Teodor Patras\
|
||||
__________________________________\
|
||||
\
|
||||
|
||||
\f1\b Swifter
|
||||
\f0\b0 \
|
||||
\
|
||||
BSD 3\
|
||||
\
|
||||
Copyright (c) Damian Kolakowski\
|
||||
__________________________________\
|
||||
\
|
||||
|
||||
\f1\b Mantis
|
||||
\f0\b0 \
|
||||
\
|
||||
MIT License\
|
||||
\
|
||||
Copyright (c) Yingtao Guo\
|
||||
__________________________________\
|
||||
\
|
||||
|
||||
\f1\b TagListView
|
||||
\f0\b0 \
|
||||
\
|
||||
MIT License\
|
||||
\
|
||||
Copyright (c) LIU Dongyuan\
|
||||
__________________________________\
|
||||
\
|
||||
\pard\pardeftab720\partightenfactor0
|
||||
|
||||
\f1\b \cf0 GzipSwift\
|
||||
|
||||
\f0\b0 \
|
||||
MIT License\
|
||||
\
|
||||
Copyright (c) 1024jp
|
||||
\f1\b \
|
||||
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0
|
||||
|
||||
\f0\b0 \cf0 __________________________________\
|
||||
\
|
||||
|
||||
\f1\b LRUCache
|
||||
\f0\b0 \
|
||||
\
|
||||
MIT License\
|
||||
\
|
||||
Copyright (c) Nick Lockwood\
|
||||
__________________________________\
|
||||
}
|
||||
@@ -160,10 +160,14 @@ final class NCAutoUploadCounter {
|
||||
|
||||
let currentSinceDate = await NCManageDatabase.shared.getTableAccountAsync(predicate: NSPredicate(format: "account == %@", account))?.autoUploadSinceDate
|
||||
guard self.account == account, self.autoUploadServerUrlBase == autoUploadServerUrlBase else { return }
|
||||
let currentIsSuspended = NCPreferences().isBackgroundUploadSuspended(account: account)
|
||||
var currentSuspensionError: String?
|
||||
sinceDate = currentSinceDate
|
||||
count = counts.pending
|
||||
failedCount = counts.failed
|
||||
|
||||
if currentIsSuspended {
|
||||
isSuspended = NCPreferences().isBackgroundUploadSuspended(account: account)
|
||||
suspensionError = nil
|
||||
|
||||
if isSuspended {
|
||||
// The newest stopped transfer contains the server error that opened the circuit breaker.
|
||||
let predicate = NSPredicate(
|
||||
format: "account == %@ AND autoUploadServerUrlBase == %@ AND directory == false AND status == %d AND backgroundUploadJobIdentifier == %@",
|
||||
@@ -178,20 +182,13 @@ final class NCAutoUploadCounter {
|
||||
ascending: false,
|
||||
limit: 1
|
||||
)?.first
|
||||
let error = metadata?.sessionErrorMessage.trimmingCharacters(in: .whitespacesAndNewlines)
|
||||
let error = metadata?.sessionError.trimmingCharacters(in: .whitespacesAndNewlines)
|
||||
|
||||
if let error, !error.isEmpty {
|
||||
currentSuspensionError = error
|
||||
suspensionError = error
|
||||
}
|
||||
}
|
||||
|
||||
// Publish only after all reads finish, keeping the previous message visible across awaits.
|
||||
guard !Task.isCancelled, self.account == account, self.autoUploadServerUrlBase == autoUploadServerUrlBase else { return }
|
||||
if sinceDate != currentSinceDate { sinceDate = currentSinceDate }
|
||||
if count != counts.pending { count = counts.pending }
|
||||
if failedCount != counts.failed { failedCount = counts.failed }
|
||||
if isSuspended != currentIsSuspended { isSuspended = currentIsSuspended }
|
||||
if suspensionError != currentSuspensionError { suspensionError = currentSuspensionError }
|
||||
if !isLoaded { isLoaded = true }
|
||||
isLoaded = true
|
||||
}
|
||||
}
|
||||
@@ -588,21 +588,6 @@ class NCEndToEndSetup {
|
||||
}
|
||||
|
||||
let deleteError = await NextcloudKit.shared.deleteE2EEPublicKeyAsync(account: session.account, password: password, options: options).error
|
||||
|
||||
let passwordRejectedCodes = [global.errorUnauthorized, global.errorUnauthorized997]
|
||||
|
||||
if password?.isEmpty == false, passwordRejectedCodes.contains(deleteError.errorCode) {
|
||||
nkLog(tag: global.logTagE2EE, emoji: .error, message: "Deleting the public key was rejected: \(deleteError.logDescription)")
|
||||
|
||||
throw NKError(
|
||||
errorCode: global.errorInternalError,
|
||||
errorDescription: NSLocalizedString(
|
||||
"_error_password_incorrect_",
|
||||
comment: ""
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
guard deleteError == .success else {
|
||||
throw deleteError
|
||||
}
|
||||
|
||||
@@ -5,9 +5,11 @@
|
||||
import UIKit
|
||||
import SwiftUI
|
||||
import NextcloudKit
|
||||
import LocalAuthentication
|
||||
|
||||
@MainActor
|
||||
class NCManageE2EE: NSObject, ObservableObject, ViewOnAppearHandling {
|
||||
class NCManageE2EE: NSObject, ObservableObject, ViewOnAppearHandling, TOPasscodeViewControllerDelegate {
|
||||
var passcodeType = ""
|
||||
|
||||
let preference = NCPreferences()
|
||||
let networkingE2EE = NCNetworkingE2EE()
|
||||
@@ -80,12 +82,13 @@ class NCManageE2EE: NSObject, ObservableObject, ViewOnAppearHandling {
|
||||
}
|
||||
await showErrorBanner(
|
||||
windowScene: windowScene,
|
||||
error: error
|
||||
text: error.errorDescription
|
||||
)
|
||||
} catch {
|
||||
// fallback (non NKError)
|
||||
await showErrorBanner(
|
||||
windowScene: windowScene,
|
||||
error: NKError(error: error)
|
||||
text: error.localizedDescription
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -98,27 +101,38 @@ class NCManageE2EE: NSObject, ObservableObject, ViewOnAppearHandling {
|
||||
|
||||
// MARK: - Passcode
|
||||
|
||||
/// Authenticate before performing the selected E2EE action, including in Debug builds.
|
||||
@objc func requestPasscodeType(_ passcodeType: String) {
|
||||
guard let presenter = controller?.topMostViewController() else { return }
|
||||
let account = session.account
|
||||
NCPasscodeView.present(from: presenter, allowCancel: true) { [weak self] result in
|
||||
guard let self else { return }
|
||||
switch result {
|
||||
case .authenticated:
|
||||
guard self.session.account == account,
|
||||
NCManageDatabase.shared.getTableAccount(account: account) != nil else { return }
|
||||
self.performAuthenticatedAction(passcodeType)
|
||||
case .reset:
|
||||
(UIApplication.shared.delegate as? AppDelegate)?.resetApplication()
|
||||
case .cancelled, .configured, .disabled:
|
||||
break
|
||||
#if DEBUG
|
||||
self.passcodeType = passcodeType
|
||||
correctPasscode()
|
||||
return
|
||||
#else
|
||||
let laContext = LAContext()
|
||||
var error: NSError?
|
||||
let passcodeViewController = TOPasscodeViewController(passcodeType: .sixDigits, allowCancel: true)
|
||||
|
||||
passcodeViewController.delegate = self
|
||||
passcodeViewController.keypadButtonShowLettering = false
|
||||
if NCPreferences().touchFaceID, laContext.canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: &error) {
|
||||
if error == nil {
|
||||
if laContext.biometryType == .faceID {
|
||||
passcodeViewController.biometryType = .faceID
|
||||
passcodeViewController.allowBiometricValidation = true
|
||||
} else if laContext.biometryType == .touchID {
|
||||
passcodeViewController.biometryType = .touchID
|
||||
}
|
||||
passcodeViewController.allowBiometricValidation = true
|
||||
passcodeViewController.automaticallyPromptForBiometricValidation = true
|
||||
}
|
||||
}
|
||||
|
||||
self.passcodeType = passcodeType
|
||||
controller?.topMostViewController().present(passcodeViewController, animated: true)
|
||||
#endif
|
||||
}
|
||||
|
||||
private func performAuthenticatedAction(_ passcodeType: String) {
|
||||
switch passcodeType {
|
||||
@objc func correctPasscode() {
|
||||
switch self.passcodeType {
|
||||
case "startE2E":
|
||||
Task {
|
||||
do {
|
||||
@@ -131,12 +145,13 @@ class NCManageE2EE: NSObject, ObservableObject, ViewOnAppearHandling {
|
||||
}
|
||||
await showErrorBanner(
|
||||
windowScene: windowScene,
|
||||
error: error
|
||||
text: error.errorDescription
|
||||
)
|
||||
} catch {
|
||||
// fallback (non NKError)
|
||||
await showErrorBanner(
|
||||
windowScene: windowScene,
|
||||
error: NKError(error: error)
|
||||
text: error.localizedDescription
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -162,4 +177,32 @@ class NCManageE2EE: NSObject, ObservableObject, ViewOnAppearHandling {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
nonisolated func passcodeViewController(_ passcodeViewController: TOPasscodeViewController, isCorrectCode code: String) -> Bool {
|
||||
if code == NCPreferences().passcode {
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) {
|
||||
self.correctPasscode()
|
||||
}
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
nonisolated func didPerformBiometricValidationRequest(in passcodeViewController: TOPasscodeViewController) {
|
||||
LAContext().evaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, localizedReason: NCBrandOptions.shared.brand) { success, _ in
|
||||
if success {
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) {
|
||||
passcodeViewController.dismiss(animated: true)
|
||||
self.correctPasscode()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
nonisolated func didTapCancel(in passcodeViewController: TOPasscodeViewController) {
|
||||
Task {@MainActor in
|
||||
passcodeViewController.dismiss(animated: true)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -245,7 +245,8 @@ struct NCManageE2EEView: View {
|
||||
text: "E2E delete publicKey")
|
||||
} else {
|
||||
await showErrorBanner(windowScene: model.windowScene,
|
||||
error: results.error)
|
||||
text: results.error.errorDescription,
|
||||
errorCode: results.error.errorCode)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -276,7 +277,8 @@ struct NCManageE2EEView: View {
|
||||
text: "E2E delete privateKey")
|
||||
} else {
|
||||
await showErrorBanner(windowScene: model.windowScene,
|
||||
error: results.error)
|
||||
text: results.error.errorDescription,
|
||||
errorCode: results.error.errorCode)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -306,7 +308,8 @@ struct NCManageE2EEView: View {
|
||||
text: "E2E delete Keys from FS")
|
||||
} else {
|
||||
await showErrorBanner(windowScene: model.windowScene,
|
||||
error: results.error)
|
||||
text: results.error.errorDescription,
|
||||
errorCode: results.error.errorCode)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +41,6 @@ struct NCAcknowledgementsView: View {
|
||||
.foregroundColor(Color(NCBrandColor.shared.iconImageColor))
|
||||
}
|
||||
}
|
||||
.accessibilityIdentifier("settings.acknowledgements.close")
|
||||
.padding()
|
||||
}
|
||||
Divider()
|
||||
|
||||
@@ -161,8 +161,7 @@ final class NCPreferences: NSObject {
|
||||
}
|
||||
|
||||
var presentPasscode: Bool {
|
||||
// After a lockout, only successful authentication may restore access, even after relaunch.
|
||||
return passcode != nil && (requestPasscodeAtStart || passcodeCounterFailReset >= 3)
|
||||
return passcode != nil && requestPasscodeAtStart
|
||||
}
|
||||
|
||||
var incrementalNumber: String {
|
||||
|
||||
@@ -16,7 +16,6 @@ class NCSettingsModel: ObservableObject, ViewOnAppearHandling {
|
||||
@Published var isLockActive: Bool = false
|
||||
// State to control the enable TouchID toggle
|
||||
@Published var enableTouchFaceID: Bool = false
|
||||
@Published private(set) var isUpdatingTouchID = false
|
||||
// State to control
|
||||
@Published var lockScreen: Bool = false
|
||||
// State to control
|
||||
@@ -61,38 +60,9 @@ class NCSettingsModel: ObservableObject, ViewOnAppearHandling {
|
||||
|
||||
// MARK: - All functions
|
||||
|
||||
/// Request biometric authorization immediately and enable it only after successful authentication.
|
||||
@MainActor
|
||||
func updateTouchIDSettingAsync(_ enabled: Bool) async {
|
||||
guard !isUpdatingTouchID else { return }
|
||||
guard enabled else {
|
||||
enableTouchFaceID = false
|
||||
keychain.touchFaceID = false
|
||||
return
|
||||
}
|
||||
guard isLockActive, keychain.passcode != nil else { return }
|
||||
|
||||
isUpdatingTouchID = true
|
||||
let context = LAContext()
|
||||
context.localizedFallbackTitle = ""
|
||||
defer {
|
||||
context.invalidate()
|
||||
isUpdatingTouchID = false
|
||||
}
|
||||
|
||||
var authenticated = false
|
||||
if context.canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: nil) {
|
||||
do {
|
||||
authenticated = try await context.evaluatePolicy(.deviceOwnerAuthenticationWithBiometrics,
|
||||
localizedReason: NCBrandOptions.shared.brand)
|
||||
} catch {
|
||||
authenticated = false
|
||||
}
|
||||
}
|
||||
// The passcode may have been removed while the system prompt was open.
|
||||
let shouldEnable = authenticated && isLockActive && keychain.passcode != nil
|
||||
keychain.touchFaceID = shouldEnable
|
||||
enableTouchFaceID = shouldEnable
|
||||
/// Function to update Touch ID / Face ID setting
|
||||
func updateTouchIDSetting() {
|
||||
keychain.touchFaceID = enableTouchFaceID
|
||||
}
|
||||
|
||||
/// Function to update Lock Screen setting
|
||||
|
||||
@@ -48,12 +48,11 @@ struct NCSettingsView: View {
|
||||
.opacity(NCBrandOptions.shared.enforce_passcode_lock ? 0.5 : 1)
|
||||
.frame(width: 39)
|
||||
|
||||
Text(model.isLockActive ? NSLocalizedString("_turn_passcode_off_", comment: "") : NSLocalizedString("_turn_passcode_on_", comment: ""))
|
||||
Text(model.isLockActive ? NSLocalizedString("_lock_active_", comment: "") : NSLocalizedString("_lock_not_active_", comment: ""))
|
||||
.font(.body)
|
||||
}
|
||||
})
|
||||
.tint(Color(NCBrandColor.shared.textColor))
|
||||
.accessibilityIdentifier("settings.passcode.toggle")
|
||||
.disabled(NCBrandOptions.shared.enforce_passcode_lock)
|
||||
}, header: {
|
||||
Text(NSLocalizedString("_privacy_", comment: ""))
|
||||
@@ -78,18 +77,12 @@ struct NCSettingsView: View {
|
||||
.tint(Color(NCBrandColor.shared.textColor))
|
||||
}
|
||||
})
|
||||
.accessibilityIdentifier("settings.passcode.change")
|
||||
// Enable Touch ID
|
||||
Toggle(NSLocalizedString("_enable_touch_face_id_", comment: ""), isOn: Binding(
|
||||
get: { model.enableTouchFaceID },
|
||||
set: { enabled in
|
||||
Task { @MainActor in
|
||||
await model.updateTouchIDSettingAsync(enabled)
|
||||
}
|
||||
Toggle(NSLocalizedString("_enable_touch_face_id_", comment: ""), isOn: $model.enableTouchFaceID)
|
||||
.font(.body)
|
||||
.onChange(of: model.enableTouchFaceID) {
|
||||
model.updateTouchIDSetting()
|
||||
}
|
||||
))
|
||||
.font(.body)
|
||||
.disabled(model.isUpdatingTouchID)
|
||||
|
||||
if !NCBrandOptions.shared.enforce_passcode_lock {
|
||||
// Do not ask for passcode on startup
|
||||
@@ -102,7 +95,6 @@ struct NCSettingsView: View {
|
||||
|
||||
// Reset app wrong attempts
|
||||
Toggle(NSLocalizedString("_reset_wrong_passcode_option_", comment: ""), isOn: $model.resetWrongAttempts)
|
||||
.accessibilityIdentifier("settings.passcode.reset")
|
||||
.font(.body)
|
||||
.onChange(of: model.resetWrongAttempts) {
|
||||
model.updateResetWrongAttemptsSetting()
|
||||
@@ -313,23 +305,11 @@ struct NCSettingsView: View {
|
||||
.font(.footnote)
|
||||
})
|
||||
}
|
||||
.onReceive(NotificationCenter.default.publisher(for: NCPasscodeModel.lockoutNotification)) { _ in
|
||||
// The scene's mandatory window takes over; do not leave the settings operation open underneath.
|
||||
if showPasscode || showChangePasscode {
|
||||
completePasscode(.cancelled)
|
||||
}
|
||||
}
|
||||
.sheet(isPresented: $showPasscode) {
|
||||
NCPasscodeView(mode: NCPreferences().passcode == nil ? .create : .disable,
|
||||
allowCancel: true,
|
||||
windowScene: SceneManager.shared.getWindowScene(controller: model.controller),
|
||||
completion: completePasscode)
|
||||
SetupPasscodeView(isLockActive: $model.isLockActive, controller: model.controller)
|
||||
}
|
||||
.sheet(isPresented: $showChangePasscode) {
|
||||
NCPasscodeView(mode: .change,
|
||||
allowCancel: true,
|
||||
windowScene: SceneManager.shared.getWindowScene(controller: model.controller),
|
||||
completion: completePasscode)
|
||||
SetupPasscodeView(isLockActive: $model.isLockActive, controller: model.controller, changePasscode: true)
|
||||
}
|
||||
#if DEBUG
|
||||
.alert("Database export failed", isPresented: $showDatabaseExportError) {
|
||||
@@ -342,22 +322,6 @@ struct NCSettingsView: View {
|
||||
.defaultViewModifier(model)
|
||||
}
|
||||
|
||||
/// Update the lock setting only after the passcode operation has completed.
|
||||
private func completePasscode(_ result: NCPasscodeModel.Result) {
|
||||
switch result {
|
||||
case .configured:
|
||||
model.isLockActive = true
|
||||
case .disabled:
|
||||
model.isLockActive = false
|
||||
case .reset:
|
||||
(UIApplication.shared.delegate as? AppDelegate)?.resetApplication()
|
||||
case .authenticated, .cancelled:
|
||||
break
|
||||
}
|
||||
showPasscode = false
|
||||
showChangePasscode = false
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
private func exportDebugDatabase() {
|
||||
isExportingDatabase = true
|
||||
|
||||
@@ -0,0 +1,186 @@
|
||||
// SPDX-FileCopyrightText: Nextcloud GmbH
|
||||
// SPDX-FileCopyrightText: 2026 Milen Pivchev
|
||||
// SPDX-FileCopyrightText: 2024 Marino Faggiana
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
import Foundation
|
||||
import UIKit
|
||||
import SwiftUI
|
||||
import LocalAuthentication
|
||||
import PopupView
|
||||
|
||||
struct SetupPasscodeView: UIViewControllerRepresentable {
|
||||
var isPasscodeReset: Bool {
|
||||
let passcodeCounterFailReset = NCPreferences().passcodeCounterFailReset
|
||||
return NCPreferences().resetAppCounterFail && passcodeCounterFailReset >= NCBrandOptions.shared.resetAppPasscodeAttempts
|
||||
}
|
||||
|
||||
var isPasscodeCounterFail: Bool {
|
||||
let passcodeCounterFail = NCPreferences().passcodeCounterFail
|
||||
return passcodeCounterFail > 0 && passcodeCounterFail >= 3
|
||||
}
|
||||
|
||||
@Binding var isLockActive: Bool
|
||||
weak var controller: NCMainTabBarController?
|
||||
var changePasscode: Bool = false
|
||||
|
||||
func makeUIViewController(context: Context) -> UIViewController {
|
||||
let laContext = LAContext()
|
||||
var error: NSError?
|
||||
let viewController: UIViewController
|
||||
|
||||
if !NCPreferences().passcode.isEmptyOrNil, !changePasscode {
|
||||
let passcodeVC = TOPasscodeViewController(passcodeType: .sixDigits, allowCancel: true)
|
||||
passcodeVC.keypadButtonShowLettering = false
|
||||
|
||||
if NCPreferences().touchFaceID, laContext.canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: &error), error == nil {
|
||||
switch laContext.biometryType {
|
||||
case .faceID:
|
||||
passcodeVC.biometryType = .faceID
|
||||
case .touchID:
|
||||
passcodeVC.biometryType = .touchID
|
||||
default:
|
||||
print("No Biometric support")
|
||||
}
|
||||
passcodeVC.allowBiometricValidation = true
|
||||
passcodeVC.automaticallyPromptForBiometricValidation = true
|
||||
}
|
||||
|
||||
passcodeVC.delegate = context.coordinator
|
||||
viewController = passcodeVC
|
||||
} else {
|
||||
let passcodeSettingsVC = TOPasscodeSettingsViewController()
|
||||
passcodeSettingsVC.hideOptionsButton = true
|
||||
passcodeSettingsVC.requireCurrentPasscode = changePasscode
|
||||
passcodeSettingsVC.passcodeType = .sixDigits
|
||||
passcodeSettingsVC.delegate = context.coordinator
|
||||
viewController = passcodeSettingsVC
|
||||
}
|
||||
|
||||
return PasscodeContainerViewController(child: viewController)
|
||||
}
|
||||
|
||||
func updateUIViewController(_ uiViewController: UIViewController, context: Context) {
|
||||
// Update the view controller if needed
|
||||
}
|
||||
|
||||
func makeCoordinator() -> Coordinator {
|
||||
Coordinator(self)
|
||||
}
|
||||
|
||||
class Coordinator: NSObject, @MainActor TOPasscodeSettingsViewControllerDelegate, @MainActor TOPasscodeViewControllerDelegate {
|
||||
var parent: SetupPasscodeView
|
||||
init(_ parent: SetupPasscodeView) {
|
||||
self.parent = parent
|
||||
}
|
||||
|
||||
func didPerformBiometricValidationRequest(in passcodeViewController: TOPasscodeViewController) {
|
||||
let context = LAContext()
|
||||
var error: NSError?
|
||||
|
||||
if context.canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: &error) {
|
||||
context.evaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, localizedReason: NCBrandOptions.shared.brand) { success, evaluateError in
|
||||
DispatchQueue.main.async {
|
||||
if success {
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) { [self] in
|
||||
parent.isLockActive = false
|
||||
NCPreferences().passcode = nil
|
||||
|
||||
passcodeViewController.dismiss(animated: true)
|
||||
}
|
||||
} else if evaluateError != nil {
|
||||
NCPreferences().passcodeCounterFail += 1
|
||||
NCPreferences().passcodeCounterFailReset += 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// This triggers only for "Change passcode" option
|
||||
@MainActor
|
||||
func passcodeSettingsViewController(_ passcodeSettingsViewController: TOPasscodeSettingsViewController, didAttemptCurrentPasscode passcode: String) -> Bool {
|
||||
if passcode == NCPreferences().passcode {
|
||||
return true
|
||||
} else {
|
||||
NCPreferences().passcodeCounterFail += 1
|
||||
NCPreferences().passcodeCounterFailReset += 1
|
||||
}
|
||||
|
||||
if parent.isPasscodeCounterFail {
|
||||
UIAlertController.failedPasscode(presenter: passcodeSettingsViewController)
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
func passcodeSettingsViewController(_ passcodeSettingsViewController: TOPasscodeSettingsViewController, didChangeToNewPasscode passcode: String, of type: TOPasscodeType) {
|
||||
NCPreferences().passcode = passcode
|
||||
parent.isLockActive = true
|
||||
passcodeSettingsViewController.dismiss(animated: true)
|
||||
}
|
||||
|
||||
func didTapCancel(in passcodeViewController: TOPasscodeViewController) {
|
||||
passcodeViewController.dismiss(animated: true)
|
||||
}
|
||||
|
||||
// This triggers upon pressing "Lock: On"
|
||||
@MainActor
|
||||
func passcodeViewController(_ passcodeViewController: TOPasscodeViewController, isCorrectCode passcode: String) -> Bool {
|
||||
if passcode == NCPreferences().passcode {
|
||||
parent.isLockActive = false
|
||||
NCPreferences().passcode = nil
|
||||
return true
|
||||
}
|
||||
|
||||
NCPreferences().passcodeCounterFail += 1
|
||||
NCPreferences().passcodeCounterFailReset += 1
|
||||
|
||||
if parent.isPasscodeCounterFail {
|
||||
UIAlertController.failedPasscode(presenter: passcodeViewController)
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private final class PasscodeContainerViewController: UIViewController {
|
||||
private let child: UIViewController
|
||||
|
||||
init(child: UIViewController) {
|
||||
self.child = child
|
||||
super.init(nibName: nil, bundle: nil)
|
||||
}
|
||||
|
||||
required init?(coder: NSCoder) {
|
||||
fatalError("init(coder:) has not been implemented")
|
||||
}
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
addChild(child)
|
||||
child.view.frame = view.bounds
|
||||
child.view.autoresizingMask = [.flexibleWidth, .flexibleHeight]
|
||||
view.addSubview(child.view)
|
||||
child.didMove(toParent: self)
|
||||
|
||||
NotificationCenter.default.addObserver(self,
|
||||
selector: #selector(presentFailedPasscodeIfNeeded),
|
||||
name: UIApplication.didBecomeActiveNotification,
|
||||
object: nil)
|
||||
}
|
||||
|
||||
override func viewDidAppear(_ animated: Bool) {
|
||||
super.viewDidAppear(animated)
|
||||
|
||||
presentFailedPasscodeIfNeeded()
|
||||
}
|
||||
|
||||
@objc private func presentFailedPasscodeIfNeeded() {
|
||||
guard presentedViewController == nil, NCPreferences().passcodeCounterFail >= 3 else { return }
|
||||
|
||||
UIAlertController.failedPasscode(presenter: self)
|
||||
}
|
||||
}
|
||||
@@ -40,7 +40,7 @@ final class NCShareDetailsGovernanceModel {
|
||||
let result = await NextcloudKit.shared.getGovernanceAvailableLabels(entityId: entityID, account: account)
|
||||
|
||||
guard let labels = result.labels else {
|
||||
nkLog(error: "Could not load governance labels: \(result.error.logDescription)")
|
||||
nkLog(error: "Could not load governance labels: \(result.error.errorDescription) (\(result.error.errorCode))")
|
||||
state = .error
|
||||
return
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loaded 100 of 246 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user