diff --git a/app/src/androidTest/java/com/nmc/android/FileMenuFilterIT.kt b/app/src/androidTest/java/com/nmc/android/FileMenuFilterIT.kt new file mode 100644 index 000000000000..58dc7c8386db --- /dev/null +++ b/app/src/androidTest/java/com/nmc/android/FileMenuFilterIT.kt @@ -0,0 +1,152 @@ +/* + * Nextcloud Android client application + * + * @author Álvaro Brey Vilas + * Copyright (C) 2022 Álvaro Brey Vilas + * Copyright (C) 2022 Nextcloud GmbH + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package com.nmc.android + +import androidx.test.core.app.launchActivity +import androidx.test.ext.junit.runners.AndroidJUnit4 +import com.nextcloud.client.account.User +import com.nextcloud.client.jobs.download.FileDownloadWorker +import com.nextcloud.client.jobs.upload.FileUploadHelper +import com.nextcloud.test.TestActivity +import com.nextcloud.utils.EditorUtils +import com.owncloud.android.AbstractIT +import com.owncloud.android.R +import com.owncloud.android.datamodel.ArbitraryDataProvider +import com.owncloud.android.datamodel.FileDataStorageManager +import com.owncloud.android.datamodel.OCFile +import com.owncloud.android.files.FileMenuFilter +import com.owncloud.android.lib.resources.status.CapabilityBooleanType +import com.owncloud.android.lib.resources.status.OCCapability +import com.owncloud.android.services.OperationsService +import com.owncloud.android.ui.activity.ComponentsGetter +import com.owncloud.android.utils.MimeType +import io.mockk.MockKAnnotations +import io.mockk.every +import io.mockk.impl.annotations.MockK +import org.junit.Assert.assertFalse +import org.junit.Assert.assertTrue +import org.junit.Before +import org.junit.Test +import org.junit.runner.RunWith +import java.security.SecureRandom + +@RunWith(AndroidJUnit4::class) +class FileMenuFilterIT : AbstractIT() { + + @MockK + private lateinit var mockComponentsGetter: ComponentsGetter + + @MockK + private lateinit var mockStorageManager: FileDataStorageManager + + @MockK + private lateinit var mockFileUploaderBinder: FileUploadHelper + + @MockK + private lateinit var mockOperationsServiceBinder: OperationsService.OperationsServiceBinder + + @MockK + private lateinit var mockFileDownloadProgressListener: FileDownloadWorker.FileDownloadProgressListener + + @MockK + private lateinit var mockArbitraryDataProvider: ArbitraryDataProvider + + private lateinit var editorUtils: EditorUtils + + @Before + fun setup() { + MockKAnnotations.init(this) + every { mockFileUploaderBinder.isUploading(any(), any()) } returns false + every { mockComponentsGetter.fileUploaderHelper } returns mockFileUploaderBinder + every { mockFileDownloadProgressListener.isDownloading(any(), any()) } returns false + every { mockComponentsGetter.fileDownloadProgressListener } returns mockFileDownloadProgressListener + every { mockOperationsServiceBinder.isSynchronizing(any(), any()) } returns false + every { mockComponentsGetter.operationsServiceBinder } returns mockOperationsServiceBinder + every { mockStorageManager.getFileById(any()) } returns OCFile("/") + every { mockStorageManager.getFolderContent(any(), any()) } returns ArrayList() + every { mockArbitraryDataProvider.getValue(any(), any()) } returns "" + editorUtils = EditorUtils(mockArbitraryDataProvider) + } + + @Test + fun hide_shareAndFavouriteMenu_encryptedFolder() { + val capability = OCCapability().apply { + endToEndEncryption = CapabilityBooleanType.TRUE + } + + val encryptedFolder = OCFile("/encryptedFolder/").apply { + isEncrypted = true + mimeType = MimeType.DIRECTORY + fileLength = SecureRandom().nextLong() + } + + configureCapability(capability) + + launchActivity().use { + it.onActivity { activity -> + val filterFactory = + FileMenuFilter.Factory(mockStorageManager, activity, editorUtils) + + val sut = filterFactory.newInstance(encryptedFolder, mockComponentsGetter, true, user) + val toHide = sut.getToHide(false) + + // encrypted folder + assertTrue(toHide.contains(R.id.action_see_details)) + assertTrue(toHide.contains(R.id.action_favorite)) + assertTrue(toHide.contains(R.id.action_unset_favorite)) + } + } + } + + @Test + fun show_shareAndFavouriteMenu_normalFolder() { + val capability = OCCapability().apply { + endToEndEncryption = CapabilityBooleanType.TRUE + } + + val normalFolder = OCFile("/folder/").apply { + mimeType = MimeType.DIRECTORY + fileLength = SecureRandom().nextLong() + } + + configureCapability(capability) + + launchActivity().use { + it.onActivity { activity -> + val filterFactory = + FileMenuFilter.Factory(mockStorageManager, activity, editorUtils) + + val sut = filterFactory.newInstance(normalFolder, mockComponentsGetter, true, user) + val toHide = sut.getToHide(false) + + // normal folder + assertFalse(toHide.contains(R.id.action_see_details)) + assertFalse(toHide.contains(R.id.action_favorite)) + assertTrue(toHide.contains(R.id.action_unset_favorite)) + } + } + } + + private fun configureCapability(capability: OCCapability) { + every { mockStorageManager.getCapability(any()) } returns capability + every { mockStorageManager.getCapability(any()) } returns capability + } +} diff --git a/app/src/androidTest/java/com/nmc/android/SetupEncryptionDialogFragmentIT.kt b/app/src/androidTest/java/com/nmc/android/SetupEncryptionDialogFragmentIT.kt new file mode 100644 index 000000000000..91cd80a457ae --- /dev/null +++ b/app/src/androidTest/java/com/nmc/android/SetupEncryptionDialogFragmentIT.kt @@ -0,0 +1,56 @@ +package com.nmc.android + +import androidx.test.espresso.Espresso.onView +import androidx.test.espresso.assertion.ViewAssertions.matches +import androidx.test.espresso.intent.rule.IntentsTestRule +import androidx.test.espresso.matcher.ViewMatchers.withHint +import androidx.test.espresso.matcher.ViewMatchers.withId +import androidx.test.internal.runner.junit4.statement.UiThreadStatement +import com.nextcloud.test.TestActivity +import com.owncloud.android.AbstractIT +import com.owncloud.android.ui.dialog.SetupEncryptionDialogFragment +import org.junit.Rule +import org.junit.Test +import com.owncloud.android.R + +class SetupEncryptionDialogFragmentIT : AbstractIT() { + + @get:Rule + val testActivityRule = IntentsTestRule(TestActivity::class.java, true, false) + + @Test + fun validatePassphraseInputHint() { + val activity = testActivityRule.launchActivity(null) + + val sut = SetupEncryptionDialogFragment.newInstance(user, 0) + + sut.show(activity.supportFragmentManager, "1") + + val keyWords = arrayListOf( + "ability", + "able", + "about", + "above", + "absent", + "absorb", + "abstract", + "absurd", + "abuse", + "access", + "accident", + "account", + "accuse" + ) + + shortSleep() + + UiThreadStatement.runOnUiThread { + sut.setMnemonic(keyWords) + sut.showMnemonicInfo() + } + + waitForIdleSync() + + onView(withId(R.id.encryption_passwordInput)).check(matches(withHint("Passphrase…"))) + } +} \ No newline at end of file diff --git a/app/src/main/java/com/owncloud/android/datamodel/OCFile.java b/app/src/main/java/com/owncloud/android/datamodel/OCFile.java index 408245678289..aa62f0dc6d3e 100644 --- a/app/src/main/java/com/owncloud/android/datamodel/OCFile.java +++ b/app/src/main/java/com/owncloud/android/datamodel/OCFile.java @@ -638,6 +638,10 @@ public boolean isHidden() { } /** + * The unique fileId for the file within the instance This only works if we have 12 digits for instanceId RemoteId + * is a combination of localId + instanceId If a file has remoteId: 4174305739oc97a8ddfc96, in this 4174305739 is + * localId & oc97a8ddfc96 is instanceId which is of 12 digits + * * unique fileId for the file within the instance */ @SuppressFBWarnings("STT") @@ -645,7 +649,8 @@ public long getLocalId() { if (localId > 0) { return localId; } else if (remoteId != null && remoteId.length() > 8) { - return Long.parseLong(remoteId.substring(0, 8).replaceAll("^0*", "")); + //NMC Customization --> for long remote id's + return Long.parseLong(remoteId.substring(0, remoteId.length() - 12).replaceAll("^0*", "")); } else { return -1; } diff --git a/app/src/main/java/com/owncloud/android/files/FileMenuFilter.java b/app/src/main/java/com/owncloud/android/files/FileMenuFilter.java index 74081626507d..6c21915615c9 100644 --- a/app/src/main/java/com/owncloud/android/files/FileMenuFilter.java +++ b/app/src/main/java/com/owncloud/android/files/FileMenuFilter.java @@ -186,7 +186,7 @@ private List filter(boolean inSingleFileFragment) { private void filterShareFile(List toHide, OCCapability capability) { - if (!isSingleSelection() || containsEncryptedFile() || hasEncryptedParent() || + if (!isSingleSelection() || containsEncryptedFile() || hasEncryptedParent() || containsEncryptedFolder() || (!isShareViaLinkAllowed() && !isShareWithUsersAllowed()) || !isShareApiEnabled(capability) || !files.iterator().next().canReshare()) { toHide.add(R.id.action_send_share_file); @@ -202,19 +202,21 @@ private void filterSendFiles(List toHide, boolean inSingleFileFragment) } private void filterDetails(Collection toHide) { - if (!isSingleSelection()) { + if (!isSingleSelection() || containsEncryptedFolder() || containsEncryptedFile()) { toHide.add(R.id.action_see_details); } } private void filterFavorite(List toHide, boolean synchronizing) { - if (files.isEmpty() || synchronizing || allFavorites()) { + if (files.isEmpty() || synchronizing || allFavorites() || containsEncryptedFile() + || containsEncryptedFolder()) { toHide.add(R.id.action_favorite); } } private void filterUnfavorite(List toHide, boolean synchronizing) { - if (files.isEmpty() || synchronizing || allNotFavorites()) { + if (files.isEmpty() || synchronizing || allNotFavorites() || containsEncryptedFile() + || containsEncryptedFolder()) { toHide.add(R.id.action_unset_favorite); } } @@ -300,8 +302,8 @@ private boolean isRichDocumentEditingSupported(OCCapability capability, String m } private void filterSync(List toHide, boolean synchronizing) { - if (files.isEmpty() || (!anyFileDown() && !containsFolder()) || synchronizing || containsEncryptedFile() - || containsEncryptedFolder()) { + //NMC Customization --> show sync option for e2ee folder + if (files.isEmpty() || (!anyFileDown() && !containsFolder()) || synchronizing) { toHide.add(R.id.action_sync_file); } } @@ -343,8 +345,10 @@ private void filterSelectAll(List toHide, boolean inSingleFileFragment) } private void filterRemove(List toHide, boolean synchronizing) { - if (files.isEmpty() || synchronizing || containsLockedFile() - || containsEncryptedFolder() || isFolderAndContainsEncryptedFile()) { + if ((files.isEmpty() || synchronizing || containsLockedFile() + || containsEncryptedFolder() || isFolderAndContainsEncryptedFile()) + //show delete option for encrypted sub-folder + && !hasEncryptedParent()) { toHide.add(R.id.action_remove_file); } } diff --git a/app/src/main/java/com/owncloud/android/ui/activity/FolderPickerActivity.kt b/app/src/main/java/com/owncloud/android/ui/activity/FolderPickerActivity.kt index 18abd8d85165..efe4cf88eaf4 100644 --- a/app/src/main/java/com/owncloud/android/ui/activity/FolderPickerActivity.kt +++ b/app/src/main/java/com/owncloud/android/ui/activity/FolderPickerActivity.kt @@ -72,6 +72,8 @@ open class FolderPickerActivity : private var mSyncBroadcastReceiver: SyncBroadcastReceiver? = null private var mSyncInProgress = false private var mSearchOnlyFolders = false + private var mShowOnlyFolder = false + private var mHideEncryptedFolder = false var isDoNotEnterEncryptedFolder = false private set @@ -125,6 +127,9 @@ open class FolderPickerActivity : } private fun setupAction() { + mShowOnlyFolder = intent.getBooleanExtra(EXTRA_SHOW_ONLY_FOLDER, false) + mHideEncryptedFolder = intent.getBooleanExtra(EXTRA_HIDE_ENCRYPTED_FOLDER, false) + action = intent.getStringExtra(EXTRA_ACTION) if (action != null && action == CHOOSE_LOCATION) { @@ -370,7 +375,7 @@ open class FolderPickerActivity : } private fun refreshListOfFilesFragment(fromSearch: Boolean) { - listOfFilesFragment?.listDirectory(false, fromSearch) + listOfFilesFragment?.listDirectoryFolder(false, fromSearch, mShowOnlyFolder, mHideEncryptedFolder) } fun browseToRoot() { @@ -672,6 +677,12 @@ open class FolderPickerActivity : @JvmField val EXTRA_ACTION = FolderPickerActivity::class.java.canonicalName?.plus(".EXTRA_ACTION") + @JvmField + val EXTRA_SHOW_ONLY_FOLDER = FolderPickerActivity::class.java.canonicalName?.plus(".EXTRA_SHOW_ONLY_FOLDER") + + @JvmField + val EXTRA_HIDE_ENCRYPTED_FOLDER = FolderPickerActivity::class.java.canonicalName?.plus(".EXTRA_HIDE_ENCRYPTED_FOLDER") + const val MOVE_OR_COPY = "MOVE_OR_COPY" const val CHOOSE_LOCATION = "CHOOSE_LOCATION" private val TAG = FolderPickerActivity::class.java.simpleName diff --git a/app/src/main/java/com/owncloud/android/ui/activity/SettingsActivity.java b/app/src/main/java/com/owncloud/android/ui/activity/SettingsActivity.java index 3017ff43b8b4..2255026f8c5b 100644 --- a/app/src/main/java/com/owncloud/android/ui/activity/SettingsActivity.java +++ b/app/src/main/java/com/owncloud/android/ui/activity/SettingsActivity.java @@ -430,10 +430,14 @@ private void setupE2EPreference(PreferenceCategory preferenceCategoryMore) { Preference preference = findPreference("setup_e2e"); if (preference != null) { + + if (!CapabilityUtils.getCapability(this).getEndToEndEncryption().isTrue()) { + preferenceCategoryMore.removePreference(preference); + return; + } + if (FileOperationsHelper.isEndToEndEncryptionSetup(this, user) || - CapabilityUtils.getCapability(this).getEndToEndEncryptionKeysExist().isTrue() || - CapabilityUtils.getCapability(this).getEndToEndEncryptionKeysExist().isUnknown() - ) { + CapabilityUtils.getCapability(this).getEndToEndEncryptionKeysExist().isTrue()) { preferenceCategoryMore.removePreference(preference); } else { preference.setOnPreferenceClickListener(p -> { @@ -506,19 +510,16 @@ private void removeE2E(PreferenceCategory preferenceCategoryMore) { preferenceCategoryMore.removePreference(preference); } else { preference.setOnPreferenceClickListener(p -> { - AlertDialog.Builder builder = new AlertDialog.Builder(this, R.style.FallbackTheming_Dialog); + AlertDialog.Builder builder = new AlertDialog.Builder(this); AlertDialog alertDialog = builder.setTitle(R.string.prefs_e2e_mnemonic) .setMessage(getString(R.string.remove_e2e_message)) .setCancelable(true) .setNegativeButton(R.string.common_cancel, ((dialog, i) -> dialog.dismiss())) .setPositiveButton(R.string.confirm_removal, (dialog, which) -> { EncryptionUtils.removeE2E(arbitraryDataProvider, user); - preferenceCategoryMore.removePreference(preference); - Preference pMnemonic = findPreference("mnemonic"); - if (pMnemonic != null) { - preferenceCategoryMore.removePreference(pMnemonic); - } + //restart to show the preferences correctly + restartSettingsActivity(); dialog.dismiss(); }) @@ -974,13 +975,18 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) { } else if (requestCode == ACTION_SHOW_MNEMONIC && resultCode == RESULT_OK) { handleMnemonicRequest(data); } else if (requestCode == ACTION_E2E && data != null && data.getBooleanExtra(SetupEncryptionDialogFragment.SUCCESS, false)) { - Intent i = new Intent(this, SettingsActivity.class); - i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); - i.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION); - startActivity(i); + //restart to show the preferences correctly + restartSettingsActivity(); } } + private void restartSettingsActivity() { + Intent i = new Intent(this, SettingsActivity.class); + i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); + i.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION); + startActivity(i); + } + @VisibleForTesting public void handleMnemonicRequest(Intent data) { if (data == null) { @@ -993,8 +999,8 @@ public void handleMnemonicRequest(Intent data) { ArbitraryDataProvider arbitraryDataProvider = new ArbitraryDataProviderImpl(this); String mnemonic = arbitraryDataProvider.getValue(user.getAccountName(), EncryptionUtils.MNEMONIC).trim(); - AlertDialog.Builder builder = new AlertDialog.Builder(this, R.style.FallbackTheming_Dialog); - AlertDialog alertDialog = builder.setTitle(R.string.prefs_e2e_mnemonic) + AlertDialog.Builder builder = new AlertDialog.Builder(this); + AlertDialog alertDialog = builder.setTitle(R.string.dialog_e2e_mnemonic_title) .setMessage(mnemonic) .setNegativeButton(R.string.common_cancel, (dialog, i) -> dialog.dismiss()) .setNeutralButton(R.string.common_copy, (dialog, i) -> @@ -1003,7 +1009,6 @@ public void handleMnemonicRequest(Intent data) { .create(); alertDialog.show(); - viewThemeUtils.platform.colorTextButtons(alertDialog.getButton(AlertDialog.BUTTON_POSITIVE)); } } } diff --git a/app/src/main/java/com/owncloud/android/ui/adapter/OCFileListAdapter.java b/app/src/main/java/com/owncloud/android/ui/adapter/OCFileListAdapter.java index b8e633860ab9..37c111684027 100644 --- a/app/src/main/java/com/owncloud/android/ui/adapter/OCFileListAdapter.java +++ b/app/src/main/java/com/owncloud/android/ui/adapter/OCFileListAdapter.java @@ -80,6 +80,7 @@ import com.owncloud.android.utils.DisplayUtils; import com.owncloud.android.utils.FileSortOrder; import com.owncloud.android.utils.FileStorageUtils; +import com.owncloud.android.utils.MimeType; import com.owncloud.android.utils.MimeTypeUtil; import com.owncloud.android.utils.theme.CapabilityUtils; import com.owncloud.android.utils.theme.ViewThemeUtils; @@ -765,6 +766,65 @@ public void swapDirectory( notifyDataSetChanged(); } + /** + * method will only called if only folders has to show + */ + public void showOnlyFolder( + User account, + OCFile directory, + FileDataStorageManager updatedStorageManager, + boolean onlyOnDevice, String limitToMimeType, + boolean hideEncryptedFolder + ) { + this.onlyOnDevice = onlyOnDevice; + + if (updatedStorageManager != null && !updatedStorageManager.equals(mStorageManager)) { + mStorageManager = updatedStorageManager; + ocFileListDelegate.setShowShareAvatar(mStorageManager + .getCapability(user.getAccountName()) + .getVersion() + .isShareesOnDavSupported()); + this.user = account; + } + + if (mStorageManager != null) { + + List allFiles = mStorageManager.getFolderContent(directory, onlyOnDevice); + mFiles.clear(); + + for (int i = 0; i < allFiles.size(); i++) { + OCFile ocFile = allFiles.get(i); + + //if e2ee folder has to hide then ignore if OCFile is encrypted + if (hideEncryptedFolder && ocFile.isEncrypted()) { + continue; + } + + if (ocFile.getMimeType().equals(MimeType.DIRECTORY)) { + mFiles.add(allFiles.get(i)); + } + } + + if (!preferences.isShowHiddenFilesEnabled()) { + mFiles = filterHiddenFiles(mFiles); + } + if (!limitToMimeType.isEmpty()) { + mFiles = filterByMimeType(mFiles, limitToMimeType); + } + FileSortOrder sortOrder = preferences.getSortOrderByFolder(directory); + mFiles = sortOrder.sortCloudFiles(mFiles); + mFilesAll.clear(); + mFilesAll.addAll(mFiles); + + currentDirectory = directory; + } else { + mFiles.clear(); + mFilesAll.clear(); + } + + new Handler(Looper.getMainLooper()).post(this::notifyDataSetChanged); + } + public void setData(List objects, SearchType searchType, FileDataStorageManager storageManager, diff --git a/app/src/main/java/com/owncloud/android/ui/dialog/SyncedFolderPreferencesDialogFragment.kt b/app/src/main/java/com/owncloud/android/ui/dialog/SyncedFolderPreferencesDialogFragment.kt index 90c1bb13a412..04aa2eec198f 100644 --- a/app/src/main/java/com/owncloud/android/ui/dialog/SyncedFolderPreferencesDialogFragment.kt +++ b/app/src/main/java/com/owncloud/android/ui/dialog/SyncedFolderPreferencesDialogFragment.kt @@ -381,6 +381,9 @@ class SyncedFolderPreferencesDialogFragment : DialogFragment(), Injectable { binding.remoteFolderContainer.setOnClickListener { val action = Intent(activity, FolderPickerActivity::class.java).apply { putExtra(FolderPickerActivity.EXTRA_ACTION, FolderPickerActivity.CHOOSE_LOCATION) + // NMC Customization + putExtra(FolderPickerActivity.EXTRA_SHOW_ONLY_FOLDER, true) + putExtra(FolderPickerActivity.EXTRA_HIDE_ENCRYPTED_FOLDER, true) } requireActivity().startActivityForResult(action, REQUEST_CODE__SELECT_REMOTE_FOLDER) } diff --git a/app/src/main/java/com/owncloud/android/ui/fragment/GalleryFragment.java b/app/src/main/java/com/owncloud/android/ui/fragment/GalleryFragment.java index 00b5b00adb62..2a2c3f8a7b23 100644 --- a/app/src/main/java/com/owncloud/android/ui/fragment/GalleryFragment.java +++ b/app/src/main/java/com/owncloud/android/ui/fragment/GalleryFragment.java @@ -397,6 +397,8 @@ public void updateMediaContent(GalleryFragmentBottomSheetDialog.MediaState media public void selectMediaFolder() { Intent action = new Intent(requireActivity(), FolderPickerActivity.class); action.putExtra(FolderPickerActivity.EXTRA_ACTION, FolderPickerActivity.CHOOSE_LOCATION); + action.putExtra(FolderPickerActivity.EXTRA_SHOW_ONLY_FOLDER, true); + action.putExtra(FolderPickerActivity.EXTRA_HIDE_ENCRYPTED_FOLDER, true); startActivityForResult(action, SELECT_LOCATION_REQUEST_CODE); } diff --git a/app/src/main/java/com/owncloud/android/ui/fragment/OCFileListFragment.java b/app/src/main/java/com/owncloud/android/ui/fragment/OCFileListFragment.java index 3af6eb035c0a..a1e3eb3ebd12 100644 --- a/app/src/main/java/com/owncloud/android/ui/fragment/OCFileListFragment.java +++ b/app/src/main/java/com/owncloud/android/ui/fragment/OCFileListFragment.java @@ -247,6 +247,8 @@ protected enum MenuItemAddRemove { ADD_GRID_AND_SORT_WITH_SEARCH } + private boolean mShowOnlyFolder, mHideEncryptedFolder; + protected MenuItemAddRemove menuItemAddRemoveValue = MenuItemAddRemove.ADD_GRID_AND_SORT_WITH_SEARCH; private List mOriginalMenuItems = new ArrayList<>(); @@ -1273,6 +1275,8 @@ private void pickFolderForMoveOrCopy(final Set checkedFiles) { } action.putStringArrayListExtra(FolderPickerActivity.EXTRA_FILE_PATHS, paths); action.putExtra(FolderPickerActivity.EXTRA_ACTION, extraAction); + action.putExtra(FolderPickerActivity.EXTRA_SHOW_ONLY_FOLDER, true); + action.putExtra(FolderPickerActivity.EXTRA_HIDE_ENCRYPTED_FOLDER, true); getActivity().startActivityForResult(action, requestCode); } @@ -1293,6 +1297,12 @@ public void listDirectory(boolean onlyOnDevice, boolean fromSearch) { listDirectory(null, onlyOnDevice, fromSearch); } + public void listDirectoryFolder(boolean onlyOnDevice, boolean fromSearch, boolean showOnlyFolder, boolean hideEncryptedFolder) { + mShowOnlyFolder = showOnlyFolder; + mHideEncryptedFolder = hideEncryptedFolder; + listDirectory(null, onlyOnDevice, fromSearch); + } + public void refreshDirectory() { searchFragment = false; @@ -1336,13 +1346,24 @@ public void listDirectory(OCFile directory, OCFile file, boolean onlyOnDevice, b } } - mAdapter.swapDirectory( - accountManager.getUser(), - directory, - storageManager, - onlyOnDevice, - mLimitToMimeType - ); + if(mShowOnlyFolder) { + mAdapter.showOnlyFolder( + accountManager.getUser(), + directory, + storageManager, + onlyOnDevice, + mLimitToMimeType, + mHideEncryptedFolder); + } + else { + mAdapter.swapDirectory( + accountManager.getUser(), + directory, + storageManager, + onlyOnDevice, + mLimitToMimeType + ); + } OCFile previousDirectory = mFile; mFile = directory; diff --git a/app/src/main/res/layout/setup_encryption_dialog.xml b/app/src/main/res/layout/setup_encryption_dialog.xml index 733b7a8b14d4..6e627c203d9c 100644 --- a/app/src/main/res/layout/setup_encryption_dialog.xml +++ b/app/src/main/res/layout/setup_encryption_dialog.xml @@ -61,7 +61,7 @@ android:layout_height="wrap_content" android:autofillHints="password" android:ems="10" - android:inputType="textPassword" + android:inputType="text" android:textCursorDrawable="@null" /> diff --git a/app/src/main/res/raw/encryption_key_words.txt b/app/src/main/res/raw/encryption_key_words.txt index f78ccaf2ce6f..1d8fcdea8410 100644 --- a/app/src/main/res/raw/encryption_key_words.txt +++ b/app/src/main/res/raw/encryption_key_words.txt @@ -1,2048 +1,2304 @@ -abandon -ability -able -about -above -absent -absorb -abstract -absurd -abuse -access -accident -account -accuse -achieve -acid -acoustic -acquire -across -act +aal +abend +abendrot +abenteuer +aberglaube +abfahrt +abfall +abtei +achse +acht +achtung +achtzig +acidum +acker +ackerbau +ackerhof action -actor -actress -actual -adapt -add -addict -address -adjust -admit -adult -advance -advice -aerobic -affair -afford -afraid -again -age -agent -agree -ahead -aim -air -airport -aisle -alarm -album -alcohol -alert -alien -all -alley -allow -almost -alone -alpha -already -also -alter -always -amateur -amazing -among -amount -amused -analyst -anchor -ancient -anger -angle -angry -animal -ankle -announce -annual -another -answer -antenna -antique -anxiety -any -apart -apology -appear -apple -approve +ada +adam +adel +adenauer +ader +aderlass +adidas +adieu +adjektiv +adolph +adonis +adria +adverb +advokat +angina +angler +ansicht +antonio +antrag +antrieb +antritt +antwort +anwalt +apache +apartheid +apartment +aperitif +apfel +apfelmus +apfelsine +apfeltorte +apfelwein +aphorismus +aphrodite +apokalypse +apoll +apollo +apologeten +apostel +apostroph +apostrophs +apotheke +apparat april -arch -arctic -area +apropos +apsis +apulien +aquarell +aragon +arbeit +archimedes +architekt +archiv +arden +areal arena -argue +arenen +argau +arge +argentinien +arglist +argonaut +argosy +argument +argus +argusaugen +argwohn +ariane +arie +aristokrat +aristoteles +arithmetik +arizona +arkade +arkadenhof +arkansas +arktisforscher arm -armed -armor +armada +armagnac +armando +armaturen +armband +armee +armenien +armenier +armfluegeln +armhaltung +armhebel +armkettchen +armlehnen +armreif +arms +armseligkeit +armsessel +armstrong +armut army -around -arrange +arnica +arno arrest -arrive -arrow -art -artefact -artist -artwork -ask -aspect -assault -asset -assist -assume -asthma -athlete +arroganz +arsch +arterie +arthur +arzt +asbest +asien +aspirant +astrologe +astrologie +astronaut +astronomie +asyl +atelier +atem +atemzug +atheist +atheisten +atheistin +athen +athene +athlet atom -attack -attend -attitude -attract -auction -audit -august -aunt -author +aubergine +auch +audienz +audienzen +audrey +auen +auerhahn auto -autumn -average -avocado -avoid -awake -aware -away -awesome -awful -awkward -axis baby -bachelor -bacon -badge -bag -balance -balcony +bach +backup +backware +backwaren +bad +badetuch +bahamas +bahn +balearen +bali +balkan ball -bamboo -banana -banner -bar -barely -bargain -barrel -base -basic -basket -battle -beach -bean -beauty -because -become -beef -before -begin -behave -behind -believe -below -belt -bench -benefit -best -betray -better -between -beyond -bicycle -bid -bike -bind -biology -bird -birth -bitter -black -blade -blame -blanket -blast -bleak -bless -blind -blood -blossom -blouse -blue -blur -blush -board -boat -body -boil -bomb -bone -bonus -book -boost -border -boring -borrow -boss -bottom -bounce -box -boy -bracket -brain -brand -brass -brave -bread -breeze -brick -bridge +band +bank +barbar +barbara +bargeld +baron +basketball +batterie +bau +bauernhof +bauherr +baum +bazar +bazille +bedarf +beere +beet +behauptung +beifall +beine +beischlaf +beitrag +belfast +belgien +bengel +benzin +berg +bert +berta +bier +bild +billionen +billy +bindegewebe +bindeglied +birmingham +birne +blaubeere +blaubeertorte +blech +blei +bleibe +blume +blut +bonsai +boa +bob +bock +bombe +boot +bordell brief -bright -bring -brisk -broccoli -broken +bronchitis bronze -broom -brother -brown -brush -bubble -buddy -budget -buffalo -build -bulb -bulk -bullet -bundle -bunker -burden -burger -burst +buchkritik +buchmacher +buckingham +budapest +buddha +bude +buch +buechse +buechsen +bueffel +buegels +buehler +buehne +bungalow +burda +bureau +burg +burgenland bus -business -busy +butler butter -buyer -buzz -cabbage -cabin -cable -cactus -cage -cake -call -calm -camera -camp -can -canal -cancel -candy -cannon -canoe -canvas -canyon -capable -capital -captain -car -carbon -card -cargo -carpet -carry -cart -case -cash -casino -castle -casual -cat -catalog -catch -category -cattle -caught -cause -caution -cave -ceiling -celery -cement -census -century -cereal -certain -chair -chalk -champion -change -chaos -chapter -charge -chase -chat -cheap -check -cheese +buxtehude +cafe +cafeteria +calabrien +calamares +calcutta +carlo +carol +carola +carton +charakter +chefkoch chef -cherry -chest -chicken -chief -child -chimney -choice -choose -chronic -chuckle -chunk -churn -cigar -cinnamon -circle -citizen -city -civil -claim -clap -clarify -claw -clay -clean -clerk -clever -click -client -cliff -climb -clinic -clip -clock -clog -close -cloth -cloud +chemie +cheyenne +chiffre +chromosom +circus +citroen clown club -clump -cluster -clutch -coach -coast -coconut -code -coffee -coil -coin -collect -color -column -combine -come -comfort -comic -common -company -concert -conduct -confirm -congress -connect -consider -control -convince -cook -cool -copper -copy -coral -core -corn -correct -cost -cotton -couch -country -couple -course -cousin -cover -coyote -crack -cradle -craft -cram -crane -crash -crater -crawl -crazy -cream -credit -creek -crew -cricket -crime -crisp -critic -crop -cross -crouch -crowd -crucial -cruel -cruise -crumble -crunch -crush -cry -crystal -cube -culture -cup -cupboard -curious -current -curtain -curve -cushion -custom -cute -cycle -dad -damage -damp -dance -danger -daring -dash -daughter -dawn -day -deal -debate -debris -decade -december -decide -decline -decorate -decrease -deer -defense -define -defy -degree -delay -deliver -demand -demise -denial -dentist -deny -depart -depend -deposit -depth -deputy -derive -describe -desert -design -desk -despair -destroy +clubmaster +cocktail +comune +dach +dachbalken +dachboden +dackel +daemon +dammbruch +dampfbad +dante +danton +datenbank +daten +daumen +daune +daunen +david +deckblatt +deckel +decoder +defizit +deich +deichbauer +dekan +dekor +dekorateur +dekret +delikt +demokrat +demut +denkfehler +denkmal +denkspiel +depot +destillat detail -detect -develop -device -devote -diagram -dial -diamond -diary -dice +detektiv +detroit +dezember +dialog diesel -diet -differ -digital -dignity +diesellok +dieter +diether +dietrich +digitaluhr +diktat +diktatur dilemma -dinner -dinosaur -direct -dirt -disagree -discover -disease -dish -dismiss -disorder -display -distance -divert -divide -divorce -dizzy -doctor -document -dog -doll -dolphin -domain -donate -donkey -donor -door -dose -double -dove -draft -dragon +diplomat +direkt +disco +dogma +doktor +doktorarbeit +dokument +dolch +donald +donaudelta +doping +dorf +dorne +dosis +drache +drachenboot +dracula +draht +drahtzaun drama -drastic -draw -dream +drecksack +dreher +drehung +drehzahl +drei +dreieck +dreiklang dress -drift -drill -drink -drip -drive -drop -drum -dry -duck -dumb -dune -during -dust -dutch -duty -dwarf -dynamic -eager -eagle -early -earn -earth -easily -east -easy +droge +drogen +drogenbaron +dubios +dublin +duell +duft +duftnote +dumm +dunkel +dunkelheit +durst +dynamik +dynamit +ebenbild echo -ecology -economy -edge -edit -educate -effort -egg -eight -either -elbow -elder -electric -elegant -element -elephant -elevator -elite -else -embark -embody -embrace -emerge +echos +ecke +eden +edens +edinburgh +edison +editieren +editor +editorial +edmund +efeu +efeus +effekt +egal +ehebruch +ehefrau +ehezwist +ehre +eiche +eichel +eid +eidechsen +eier +eierschale +eifel +eifer +eifersucht +eiffelturm +eigenheim +eigenleben +eigensinn +eile +eilgut +eiltempo +eimer +einband +einbau +einbruch +eingabe +einheit +einhorn +einklang +einladung +einlagen +einsamkeit +einsatz +einschlag +einschuss +einzelfall +eis +eisbaer +eisbecher +eisberg +eisbombe +eisdiele +eisen +eisenbahn +ekel +elektro +elektrik +elend +elfenbein +elsass +eltern +elternbeirat +email +emanuel +emanuela +emanzipation +embargo +emblem +embolie +embyro +emilia +eminenz +eminenzen emotion -employ -empower -empty -enable -enact -end -endless -endorse -enemy -energy -enforce -engage -engine -enhance -enjoy -enlist -enough -enrich -enroll -ensure -enter -entire -entry -envelope -episode -equal -equip -era -erase -erode +ende +endrunde +endung +endungen +engel +england +enkel +enkelin +entgelt +erbgut +erdoel +erhalt +erhaltes +erhaltung +erich +erika +eritrea +erkaeltung +erkenntis +ernte +eros erosion -error -erupt -escape -essay -essence -estate -eternal -ethics -evidence -evil -evoke -evolve -exact -example -excess -exchange -excite -exclude -excuse -execute -exercise -exhaust -exhibit -exile -exist -exit -exotic -expand -expect -expire -explain -expose -express -extend -extra -eye -eyebrow -fabric -face -faculty -fade -faint -faith +erst +erzeugung +eskorte +essig +etat +eule +exil +fabel +fabian +fabrik +fabrikant +faden +fahne +fahrgast +fahrer +fahrgeld +fahrrad +falke fall -false -fame -family -famous -fan -fancy -fantasy +fallbeil +falle +fallobst +fallschirm +faltboot +faltdach +fantasie +farbe farm -fashion -fat -fatal -father -fatigue -fault -favorite -feature -february -federal -fee -feed -feel -female -fence +farmer +farn +faruk +fasan +fass +fassade +fatalismus +fatalitaet +faulenzer +faulpelz +fauna +faust +favorit +fazit +fechter +feder +federung +fegefeuer +fehde +fehler +fehlmenge +feier +feierabend +feiertag +feigling +feind +feinkost +felder +felge +felix +fell +fenchel +fenster +fensterbank +ferien +fernglas +fernost +fernseher +fernsicht +fernweh +ferrari +festakt +festakte festival -fetch -fever -few -fiber -fiction -field +fett +feuer +feueralarm +feuerwerk +fiasko +fiat +fieber figure -file +fiktion film -filter -final -find -fine +filz +fimmel +finale +finanzhai +finderlohn finger -finish -fire -firm -first -fiscal -fish -fit +fink +firlefanz +firma +firmament +fisch +fischerboot +fischfang fitness -fix -flag -flame -flash -flat -flavor -flee -flight -flip -float -flock -floor -flower -fluid -flush -fly -foam -focus -fog -foil -fold -follow -food -foot -force -forest -forget -fork -fortune -forum -forward +flagge +fleiss +fleisch +fliege +fliegen +fliegenpilz +fliese +flinte +flipper +flirt +flo +flop +flora +florenz +florett +florida +floskel +flotte +flucht +fluchtauto +fluchtburg +flug +flugabwehr +flughafen +flunder +fluss +flusspferd +flutwelle +foen +folklore +folter +folterbank +folterknecht +forschung +forst +forstamt fossil -foster -found -fox -fragile -frame -frequent -fresh -friend -fringe -frog -front -frost -frown -frozen -fruit -fuel -fun -funny -furnace -fury -future -gadget -gain -galaxy -gallery -game -gap +foto +fotoapparat +foulspiel +foyer +fracht +frack +fragment +frankfurt +franzose +fratze +frei +freibier +freiheit +freitag +freizeit +freske +freude +freund +frevel +frieden +friesland +frikadelle +friseur +frist +frohnatur +frohsinn +frosch +frucht +fruehjahr +frust +fuchs +fuenf +furie +fuss +gabe +galaxie +galeere +galerie +galgen +galilei +galizien garage -garbage -garden -garlic -garment +garten +gartenzwerg gas -gasp -gate -gather -gauge -gaze -general -genius -genre -gentle -genuine -gesture -ghost -giant +gast +gasthof +gauda +gaudi +gaul +gaukler +gaumen +gauner +gazelle +geburtstag +gedanke +geduld +gefaengnis +gefecht +gehirn +geier +geist +geizhals +georg +getto +gewehr +ghetto gift -giggle -ginger -giraffe -girl -give -glad -glance -glare -glass -glide -glimpse -globe -gloom -glory -glove -glow -glue -goat -goddess -gold -good -goose +gina +gleis +glueck gorilla -gospel -gossip -govern -gown -grab -grace -grain -grant -grape -grass -gravity -great -green -grid -grief -grit -grocery -group -grow -grunt -guard -guess -guide -guilt -guitar -gun -gym -habit -hair -half -hammer -hamster -hand -happy -harbor -hard -harsh -harvest -hat -have -hawk -hazard -head -health -heart -heavy -hedgehog -height -hello -helmet -help -hen -hero -hidden -high -hill -hint -hip -hire -history -hobby -hockey -hold -hole -holiday -hollow -home -honey -hood -hope -horn -horror -horse -hospital -host +guido +gummi +gurke +gurkensalat +gurt +guru +haar +hafen +haft +haftbefehl +halbmond +halogen +hals +handball +handbremse +handgelenk +handtasche +hannelore +hantel +harlekin +harmonie +haschisch +harz +hausarrest +hausarzt +hausschwein +haut +hawaii +heck +heckteil +hehler +heike +heimat +heino +heinrich +heinz +heirat +hektik +held +helsinki +hemd +herbert +herbst +herz +heuchler +hexen +hexerei +himalaja +himalaya +himbeere +himmel +hindu +hintergrund +hintern +hippie +hippodamus +hippodrom +hirn +hitze +hobbie +hochmut +hoftor +hoheit +hollywood +holz hotel -hour -hover -hub -huge -human -humble -humor -hundred -hungry -hunt -hurdle -hurry -hurt -husband -hybrid -ice -icon -idea -identify -idle -ignore -ill -illegal -illness -image -imitate -immense -immune -impact -impose -improve -impulse -inch -include -income -increase +hubraum +huehnerdieb +huf +hund +hygiene +hymne +hypnose +idee +ignoranz +imbiss +immobilie +import index -indicate -indoor -industry -infant -inflict -inform -inhale -inherit -initial -inject -injury -inmate -inner -innocent -input -inquiry -insane -insect -inside -inspire -install -intact -interest -into -invest -invite -involve -iron -island -isolate -issue -item -ivory -jacket +indianer +indikator +induktion +industrie +infarkt +infekt +infektion +inferno +information +inka +inkasso +innovation +innsbruck +insasse +insekt +insekten +insel +inselstaat +instanz +instinkt +institut +instrument +intelligenz +intellekt +interesse +irak +iran +irrenhaus +irrsinn +irrtum +italien +ivan +jacht +jachtklub +jacke +jacob +jagd jaguar -jar +jahr +jahrbuchs +jahre +jahrmarkt +jahrzehnt +japan jazz -jealous -jeans -jelly -jewel -job -join -joke -journey -joy -judge -juice -jump -jungle -junior -junk -just -kangaroo -keen -keep -ketchup -key -kick -kid -kidney +jazzband +joker +jongleur +jordanien +josef +jubel +jucken +judo +judoka +jugend +junge +jurist +kabarett +kabel +kabine +kabrio +kabriolett +kabuki +kabul +kadaver +kader +kaernten +kaese +kaffee +kafka +kairo +kaiser +kakao +kaktee +kaktus +kalabrien +kalauer +kalb +kali +kalk +kalkulation +kalkutta +kalzium +kambodscha +kamel +kamera +kamerad +kamikaze +kamille +kamin +kanada +kanaille +kanal +kannibale +kanzlei +kapitol +kapitulation +kaplan +kappe +kapsel +kapuze +karambolage +karate +karosse +karosserie +karotte +karriere +karte +kartei +kartell +kartenspiel +Kartoffel +kartoffelbrei +karton +kasino +kaskade +kasko +kasse +kassel +kastanie +kastell +katamaran +katastrophe +katze +katzenauge +kehle +keim +kennziffer +kent +kentucky +keramik +kerbe +kerbel +kessel +kette +ketzer +keule +kiesgrube +killer +kilo +kilogramm +kilometer +kilowatt kind -kingdom -kiss -kit -kitchen -kite -kitten -kiwi -knee -knife -knock -know -lab -label +kinder +kirchturm +kirschbaum +kirsche +kitzel +klamotten +klang +klar +klarheit +klarinette +klartext +klassik +klausel +klavier +klee +kleider +klima +klinik +klischee +klo +klopapier +kloster +klotz +klub +knallfrosch +kneipe +knete +knetmasse +knick +knie +kniff +knoblauch +knochen +knopf +knopfloch +knospe +kobalt +kobold +kobra +kochbuch +koerper +koffein +koffer +kohle +kokain +kollege +kombi +kombination +komma +kommandant +kommando +kommentar +kommerz +kommissar +kommode +kommune +kompetenz +komplott +kompost +konfekt +konfetti +konflikt +kongo +konkurs +konrad +konsens +konsulat +konvoi +kopfball +kopie +kork +kottelet +krabbe +krach +kraehe +kraft +kraftakt +krakau +kralle +kram +krampf +kran +krankenhaus +krebs +kredit +krefeld +kreide +kreis +krempe +krempel +kreole +kresse +kreta +kreuz +kreuzberg +kreuzung +krieg +krim +krimi +kriminalbeamte +kriminalbeamtin +krippe +krise +krishna +kristall +kritik +kuba +kubanerin +kuckuck +kueche +kufe +kugel +kugellager +kultur +kumulation +kundin +kundschaft +kunst +kurbel +kurbelwelle +kybernetik labor -ladder -lady -lake -lamp -language -laptop -large -later -latin -laugh -laundry +laborant +laborleiter +labrador +labyrinth +lachs +laderaum +ladung +lage +lager +lagune +lamborghini +lamelle +lametta +lamm +lampe +landau +landgut +landung +landzunge +langeweile +languste +lanzarote +last +lauch +lauge +laune +lautsprecher lava -law -lawn -lawsuit -layer -lazy -leader -leaf -learn -leave -lecture -left -leg -legal -legend -leisure -lemon -lend -length -lens +lavendel +lawine +layout +lazarett +legierung +legion +leguan +lehre +lehrer +leiche +leierkasten +leim +leine +leinen +leinwand +leitern +lektion +lektorin +lemming +leonie +leonore leopard -lesson -letter -level -liar -liberty -library -license -life -lift -light -like -limb -limit -link -lion -liquid -list -little -live -lizard -load -loan -lobster -local -lock -logic -lonely -long -loop -lottery -loud -lounge -love -loyal -lucky -luggage -lumber -lunar -lunch -luxury -lyrics -machine -mad -magic -magnet -maid -mail -main -major -make -mammal -man -manage -mandate -mango -mansion -manual -maple -marble -march -margin +leopold +lerche +lermming +lettland +leuchtturm +libanon +libelle +libyen +licht +lichtung +lid +liebe +lied +lieferung +limonade +linienbus +linsensuppe +linz +lippe +lizenz +lorbeer +loreley +lorenzo +luder +ludwigshafen +luebeck +luegner +luegnerin +luemmel +lueneburg +luft +luftabwehr +lugano +luke +luna +luxus +macher +macht +machtwort +macke +madonna +madrid +maedchen +mafia +magazin +magnetspule +mai +mainz +mais +maiskolben +malaria +malediven +maler +mammon +mammut +mandel +mandelbaum +manitu +manko +mann +manschette +mantel +manuela +marburg marine -market -marriage -mask -mass -master -match +marita +mark +markt +marmor +marokko +marquise +marrakesch +mars +mascarpone +masche +maschine +maschinenbau material -math -matrix -matter -maximum -maze -meadow -mean -measure -meat -mechanic -medal -media -melody -melt -member -memory -mention -menu -mercy -merge -merit -merry -mesh -message -metal -method -middle -midnight -milk -million -mimic -mind -minimum -minor -minute -miracle -mirror -misery -miss -mistake -mix -mixed -mixture -mobile -model -modify -mom -moment -monitor -monkey -monster -month -moon -moral -more -morning -mosquito -mother -motion +materie +mathematik +matratze +medikament +medizin +meer +melodie +melone +mensch +mercedes +merkmal +metall +metropole +metropolis +metzger +michelangelo +migraene +mikado +minderheit +mineral +minus +module +moebel +mondlandung motor -mountain -mouse -move -movie -much -muffin -mule -multiply -muscle +motorblock +muecke +muenze +muschi museum -mushroom -music -must -mutual -myself -mystery -myth -naive -name -napkin -narrow -nasty -nation -nature -near -neck -need -negative -neglect -neither -nephew -nerve -nest -net -network -neutral -never -news -next -nice -night -noble -noise -nominee -noodle +mustang +mutation +mutti +nachbar +nachricht +nachtleben +nadelholz +nagasaki +nagel +nagellack +nahrung +nairobi +nase +nasenbein +nationalpark +natur +nazi +neapel +nebel +nebraska +nebukadnezar +neckar +neffe +negativ +nepal +netz +netzanschluss +neubau +neujahrstag +neumond +neun +nickel +nie +niete +nikolaus +nikotin +nordpol +norm normal -north -nose -notable -note -nothing -notice -novel -now -nuclear -number -nurse -nut -oak -obey -object -oblige -obscure -observe -obtain -obvious -occur -ocean -october -odor -off -offer -office -often -oil -okay -old -olive -olympic -omit -once -one -onion -online -only -open -opera -opinion -oppose -option +normanne +norwegen +nostalgie +not +notar +notausgang +nudel +nudelholz +nylon +oberst +oberteil +objekt +obligation +ofen +ofenheizung +ohren +oktober +oldtimer +oleg +olga +oligarch +oliven +oliver +olymp +olympia +opa +opel +operette +oper +opium +opiumkrieg +optiker +opus orange -orbit -orchard -order -ordinary -organ +orden +ordner +ordnung +oregon +organe +organen +organleiden +orgel orient -original -orphan -ostrich -other -outdoor -outer -output -outside -oval -oven -over -own -owner -oxygen -oyster -ozone -pact -paddle +orion +orkan +orlando +orleans +ornament +ortschaft +oscar +osiris +oskar +oslo +osnabrueck +ostern +otter +otto +ouvertuere +ovation +ozean +ozeandampfer +ozonschicht +paella +paganini page -pair -palace -palm -panda -panel -panic -panther -paper -parade -parent +paket +palaver +palermo +palette +palisade +palladium +panzerkreuzer +panzer +papa +papagalli +papagallo +papagei +papierkorb +pappe +pappeln +paradies +paraguay +parameter +parasit +pardon +parfuem park -parrot +parkallee +parkhaus +parkplatz +parkuhr +parkverbot +parlament +parole +paroli +partei party -pass -patch -path +partyraum +paruguay +parzelle +passau +passfoto +patent patient -patrol -pattern -pause -pave -payment -peace -peanut -pear -peasant -pelican -pen -penalty -pencil -people -pepper -perfect -permit +paul +paulette +paulus +pauschal +pavian +pavillon +pazifik +pelikan +pellkartoffel +pelz +peng person -pet -phone +peru +peruecke +perversion +pest +peter +petersilie +pfadfinder +pfalz +pfand +pfannkuchen +pfarrer +pfeil +pferch +pferd +pfirsich +pflaster +pflasters +pflegerin +pfoertner +phaenomen +phalanx +phantast +pharao +pharma +pharmazie +phase +phasen +philippsburg +philosoph +philosphie +phlegma +phon +phonetik photo -phrase -physical -piano -picnic -picture -piece -pig -pigeon -pill -pilot -pink -pioneer -pipe -pistol -pitch -pizza -place -planet -plastic -plate -play -please -pledge -pluck -plug -plunge -poem -poet -point -polar -pole +pianist +piazza +picasso +pickelgesicht +picknick +piemont +pietaet +pigment +pils +pingpong +pinguin +pinie +pinsel +pinselstrich +pinzette +pionier +pirat +piraten +pirelli +pirmasens +piroschka +plagiat +plagiator +plakat +plankton +planquadrat +planzahl +plasma +plastik +plateau +platin +pluralismus +plus +plutarch +pluto +plutonium +plymouth +pokalsieg +pokerspiel +pol +polareis +polarfuchs +polaris police -pond -pony -pool -popular -portion +polier +poliklinik +politur +polle +pollen +pomp +pompadour +pompeij +pomps +porsche +portwein +porzellan position -possible post -potato -pottery -poverty -powder -power -practice -praise -predict -prefer -prepare -present -pretty -prevent -price -pride -primary -print -priority -prison -private -prize +poster +postfach +postille +postkarte +potzblitz +praefekt +praeparat +praxis +prellung +premier +premiere +presse +priester problem -process -produce +produkt +produzent +profession +professor +professur +profiboxer +profil +profilneurose profit -program -project -promote -proof -property -prosper -protect -proud -provide -public -pudding -pull -pulp -pulse -pumpkin -punch -pupil -puppy -purchase -purity -purpose -purse -push -put -puzzle -pyramid -quality -quantum -quarter -question -quick -quit +prognose +programm +projekt +projektion +prokura +promille +prominenz +propeller +prophet +provision +pruefung +pruegel +puffer +punsch +pupillen +puppe +pyjama +pyramide +qualitaet +qualle +qualm +quartal +quasar +quatsch +quattro +quebec +quitte +quitten +quittungen quiz -quote -rabbit -raccoon -race -rack +rabe +rache +racheakt radar -radio -rail -rain -raise -rally -ramp -ranch -random -range -rapid -rare -rate -rather -raven -raw -razor -ready +radarschirm +radioskop +radium +raetsel +raffinerie +raffinesse +rahm +rahmen +rampe +rampenlicht +rang +rasse +rastatt +raster +rastplatz +ratte +rattengift +raudi +raumschiff +rauschgift +ravenna +ravensberg real -reason -rebel -rebuild -recall -receive -recipe -record -recycle -reduce -reflect -reform -refuse -region -regret -regular -reject -relax -release -relief -rely -remain -remember -remind -remove -render -renew -rent -reopen -repair -repeat -replace -report -require -rescue -resemble -resist -resource -response -result -retire -retreat -return -reunion -reveal -review -reward -rhythm -rib -ribbon -rice -rich -ride -ridge -rifle -right -rigid -ring -riot -ripple -risk -ritual -rival -river -road -roast -robot -robust -rocket -romance -roof -rookie -room +reale +rebell +rechner +rechtsform +redner +reflektion +reflex +regal +regel +regenwald +regenwurm +reinfall +reis +reise +reiz +reklame +rekrut +reparatur +reporter +reporterin +reservat +reserve +reservebank +respekt +ressort +rettich +revolutuion +revolver +rhythmus +riad +rialto +ribbentrop +rind +risiko +rivale +rivalin +robbe +robert +roberta +robin +roboter +rolle rose -rotate -rough -round -route -royal -rubber -rude -rug -rule -run -runway -rural -sad -saddle -sadness -safe -sail -salad -salmon +rund +rundfunk +russe +spiegel +saatgut +sabotage +saboteur +sachbuch +sack +sackgasse +saeugling +safari +safran +saftladen +saite salon -salt -salute -same -sample -sand -satisfy -satoshi -sauce -sausage -save -say -scale -scan -scare -scatter -scene -scheme -school -science -scissors -scorpion -scout -scrap -screen -script -scrub -sea -search -season -seat -second -secret -section -security -seed -seek -segment -select -sell -seminar -senior -sense -sentence -series -service -session -settle -setup -seven -shadow -shaft -shallow -share -shed -shell -sheriff -shield -shift -shine -ship -shiver -shock -shoe -shoot -shop -short -shoulder -shove -shrimp -shrug -shuffle -shy -sibling -sick -side -siege -sight -sign -silent -silk -silly -silver -similar -simple -since -sing -siren -sister -situate -six -size -skate -sketch -ski -skill -skin -skirt -skull -slab -slam -sleep -slender -slice -slide -slight -slim -slogan -slot -slow -slush -small -smart -smile -smoke -smooth -snack -snake -snap -sniff -snow -soap -soccer -social -sock +saloniki +sambia +samen +samenbank +sammlung +sanddorn +sandsack +sanftmut +sansibar +sardine +sarg +sarkasmus +satan +satire +sattel +schachspiel +schach +schachtel +schaden +schafe +schandmaul +schanghai +scharade +schatten +schatulle +schatz +schatzamt +schaumbad +scheck +scheidung +schein +scheintod +scheitel +schenkel +scherbe +scherzartikel +schick +schickeria +schicksal +schiebedach +schiffbau +schild +schilf +schirm +schinken +schlachtschiff +schlamassel +schlamm +schlampe +schlauch +schlauchboot +schleim +schlitzohr +schloss +schlosser +schluckauf +schlummer +schmerz +schmerzen +schmuggler +schmusekatze +schmutz +schnake +schnaps +schnapsglas +schnapsidee +schneehase +schneekette +schnee +schnitzel +schnitzerei +schnulze +schnurrbart +schock +schotte +schrank +schranke +schreck +schreibpult +schritt +schrott +schuh +schulden +schuljahr +schuss +schuster +schutz +schwager +schwalbe +schwamm +schwan +schwinger +seebaer +seenot +segen +segler +seide +seife +semester +semikolon +sender +serie +sidnay +sie +sieben +sieger +siegerin +signatur +sigrid +sigrun +silbe +silber +simbabwe +simulant +sintflut +sinus +sinuskurve +sirene +sizilianer +skelett soda -soft -solar -soldier -solid -solution -solve -someone -song -soon -sorry -sort -soul -sound -soup -source -south -space -spare -spatial -spawn -speak -special -speed -spell -spend -sphere -spice -spider -spike -spin -spirit -split -spoil -sponsor -spoon +sodawasser +sodbrennen +sodomie +solarzelle +sommer +sommertag +sommerurlaub +sommerzeit +sonne +sonnenfleck +sonntag +spalt +spatel +spaten +specht +spekulation +sphinx +spiegel +spiel +spielbeginn +spinner +spinnrad +spion +spionin +spirale +spital +spitzmaus +spitzname +spleen +spore +sporn +sportbund sport -spot -spray -spread -spring -spy -square -squeeze -squirrel -stable +sportwagen +spreu +sprichwort +sprung +staat +staatsanwalt +staatsbesuch stadium -staff -stage -stairs -stamp +stadt +staffel +staffelei +stamm +stammaktie stand -start -state -stay +standard +statut +statuten +staub +stausee steak -steel -stem -step +steinmetz stereo -stick -still -sting -stock -stomach -stone -stool -story -stove -strategy -street -strike -strong -struggle -student -stuff -stumble -style -subject -submit -subway -success -such -sudden -suffer -sugar -suggest -suit -summer -sun -sunny -sunset -super -supply -supreme -sure -surface -surge -surprise -surround -survey -suspect -sustain -swallow -swamp -swap -swarm -swear -sweet -swift -swim -swing -switch -sword +sternbild +stettin +steuer +stichflamme +stift +strahl +strasse +sturmflut +sydney +sylt +sylvester +symbiose symbol symptom -syrup +syndikat system -table -tackle +szenario +taeter +tafel tag -tail +tagbau talent -talk +taler +talg +talgdruese +tanger +tango +tangs tank -tape -target -task +tankanlage +tankwart +tante +tanzbaer +tara +tarantel +tarif +taschendieb +tasse taste -tattoo +tatare +tartaria +tatendrang +tatort +tatze +tau +taube +taucher +tausch +tausend taxi -teach +taxifahrer team -tell -ten -tenant -tennis -tent -term -test +teamarbeit +technics +technikerin +teddybaer +teekanne +teenager +teheran +teich +teil +teilchen +teilnahme +teint +telefon +temperatur +teneriffa +tenor +teppich +termin +terminal +terrine +terror +texas text -thank -that -theme -then -theory -there -they -thing -this -thought -three -thrive -throw -thumb -thunder +thailand +theater +theke +thema +thematik +theo +theodor +theologe +theorie +therapeut +therapie +theresa +therese +thermalbad +thesaurus +these +thomas +thriller +thunfisch +thymian +tibet +tick ticket -tide -tiger -tilt -timber -time -tiny -tip -tired -tissue -title -toast -tobacco -today -toddler -toe -together -toilet -token -tomato -tomorrow -tone -tongue -tonight -tool -tooth -top -topic -topple -torch -tornado -tortoise -toss +tiegel +tier +tierarzt +tilsiter +tinte +tintenfass +tintenfisch +tintenfleck +tippzettel +tips +tirol +tischler +titan +titanic +titel +titelbild +tivoli +toaster +tobak +tobsucht +todfeind +tofu +toilette +tokio +toleranz +tollwut +tolpatsch +tomaten +tonlage +tonleiter +tonnage +tonne +tonspur +tor +torchance +torpedo +torpedoboot +torraum +tortur total +toulouse +tour +tourenrad tourist -toward -tower -town -toy -track -trade -traffic -tragic -train +tournee +toyota +trab +trabant +tracht +tradition +trafalgar +tragbahre +tragik +trainer +trakt +traktor +tramper +trance transfer -trap -trash -travel -tray -treat -tree +transport +trapez +tratte +trauer +traum +trauma +traumberuf +treffen +treffer +treiber +treibhaus +treibsand +treibstoff trend -trial -tribe +trennung +trennwand +treppe +tresen +tresor +treue +treueid +treuhand +tribun trick -trigger -trim -trip -trophy -trouble -truck -true -truly -trumpet -trust -truth -try -tube -tuition -tumble -tuna +trickfilm +triebwerk +triest +trikot +trilogie +trinkgeld +tripolis +tritt +triumpf +triumph +troja +trojaner +trommelfell +trommler +trompeter +tropen +trottel +trubel +truhe +truppe +tschernobyl +tuberkulose +tuebingen +tuemmler +tuer +tuerkei +tuete +tugend +tulpe +tumult +tundra +tunesien +tunichtgut tunnel -turkey -turn -turtle -twelve -twenty -twice -twin -twist -two +turban +turbine +turbo +turm +turner +turnerin +turnier +tusch +tycoon +typ type -typical -ugly -umbrella -unable -unaware -uncle -uncover -under -undo -unfair -unfold -unhappy +typografie +tyrann +tyrannei +ufo +uebung +ufer +uganda +uhrwerk +uhrzeit +uhu +ukraine +umfrage +umkehr +umkreis +umleitung +umschau +umschrift +umschweif +umweg +umzug +unfall +unfug +ungarn +ungeduld +ungeheuer +unhold uniform -unique -unit -universe -unknown -unlock -until -unusual -unveil -update -upgrade -uphold -upon -upper -upset -urban -urge -usage -use -used -useful -useless -usual -utility -vacant -vacuum -vague -valid -valley -valve -van -vanish -vapor -various -vast -vault -vehicle -velvet -vendor -venture -venue +unikum +universal +universum +unterholz +unterleib +unternehmer +unterricht +untertan +unterteil +unzucht +uran +urkunde +urlaub +urmensch +urne +ursache +urteil +urwald +urwelt +urzeit +utopie +utrecht +vagabund +vampir +vandale +vanille +variation +vasall +vater +vatikan +vehemenz +vehikel +veilchen +vene +venedig +venezuela +ventilator +ventil +venus +verachtung +veranda verb -verify -version -very -vessel +verband +verbleib +verblendung +verbot +verbrecher +verbund +verdienst +verdun +verehrer +verein +verfall +verfasser +vergleich +verhalten +verhandlung +verkehr +verlag +verlust +verona +verputz +verrat +verse +vertrag +verwalter +verwalterin +verzehr +verzicht +verzug veteran -viable -vibrant -vicious -victory +veto +vetorecht +viadukt +vibration +victor video -view -village -vintage -violin -virtual -virus +vieh +viertel +vignette +viktoria +viktualie +villa +viola +violine +viper +viren +virginia visa -visit -visual -vital -vivid -vocal -voice -void -volcano -volume -vote -voyage -wage -wagon -wait -walk +visage +visier +vision +visum +vitamin +vitrine +vogel +vogt +vokabel +vokal +volk +volleyball +vollmond +volt +voltaire +vorbild +votum +voyeur +vulkan +wachs +wachtstum +wade +waehrung +waffe +waffel +wagemut +waggon +waise +wal +wald wall -walnut -want -warfare -warm -warrior -wash -wasp -waste -water -wave -way -wealth -weapon -wear -weasel -weather -web -wedding -weekend -weird -welcome -west -wet -whale -what -wheat -wheel -when -where -whip -whisper -wide -width -wife -wild -will -win -window -wine -wing -wink -winner +wallach +walter +walther +wand +wanne +warze +wassermann +weber +wecker +wehmut +weib +weinblatt +weizen +welle +welpe +welt +weltall +werbung +werft +werk +werkstoff +werktag +wermut +wert +wertung +werwolf +wesen +weser +wespe +wespennest +weste +westfalen +westwind +wette +wetter +whisky +wicht +wichtig +wickel +widder +widmung +wiedergabe +wiesel +wiener +wildwest +wille +willi +willy +wimpel +wimper +wind +windbeutel +windhose +windhund +winkel winter -wire -wisdom -wise -wish -witness +winterthur +wippe +wirbelwind +wirkung +wirrwarr +wirt +wirtshaus +wischer +witterung +witwe +witz +wladimir +woche +woelbung wolf -woman -wonder -wood -wool -word -work -world -worry -worth -wrap -wreck -wrestle -wrist -write -wrong -yard -year -yellow -you -young -youth +wohnsitz +wohnung +wolfgang +wolfram +wolfsburg +wolfshund +wolke +wolga +wolle +wollust +worms +wort +wrack +wucher +wucht +wunde +wunder +wurf +wurm +wurzel +wut +xerox +xerxes +xylograph +yacht +yangtse +yen +yeti +yoga +yokohama +yuppie +zack +zaehler +zahl +zahn +zahnarzt +zahnaerztin +zahnersatz +zahnfleisch +zahngold +zahnluecke +zahnpaste +zahnpflege +zahnrad +zahnschmelz +zange +zapfenstreich +zar +zarathustra +zauber +zauberei +zaum +zaun +zaunkoenig zebra +zeche +zeh +zehner +zeichen +zeichnung +zeigefinger +zeiger +zeile +zeit +zeitalter +zeitbombe +zeitung +zeitgeist +zelle +zellkern +zeltdach +zelt +zement +zensur +zentner +zentral +zentrum +zeppelin +zepter +zeremonie +zerfall zero +zettel +zeuge +zeugin +zeus +zicke +ziege +ziegel +ziffer +zigarette +zigarillo +zigarre +zigeuner +zigeunerin +zikade +zimmer +zimmermann +zimt +zinne +zinnsoldat +zins +zirkel +zisterne +zitadelle +zitat +zivilist +zoll +zombie zone -zoo \ No newline at end of file +zoo +zopf +zorro +zucht +zucker +zuegel +zugabe +zukunft +zunge +zuruf +zustand +zuzug +zwang +zweifel +zwerg +zwerchfell +zwilling +zwinger +zwist +zyanid +zyankali +zyklon +zyklop +zyklus +zylinder +zyniker +zypern +zypresse +zyste \ No newline at end of file diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index c1121faeb82e..5ce07da82783 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -145,7 +145,7 @@ Helfen Sie durch Testen Fehlerbericht auf GitHub erstellen Konfigurieren - Lokale Verschlüsselung entfernen + Verschlüsselung lokal entfernen Wollen Sie %1$s wirklich löschen? Möchten Sie die ausgewählten Elemente wirklich löschen? Wollen Sie %1$s und deren Inhalte wirklich löschen? @@ -250,7 +250,7 @@ %1$s von %2$s verwendet %1$s verwendet Automatisches Hochladen - E2E bislang nicht eingerichtet + Die Ende-zu-Ende Verschlüsselung ist noch nicht eingerichtet. Ohne Internetverbindung nicht möglich Mehr Notizen @@ -263,13 +263,13 @@ Verschlüsselung einrichten Entschlüssele… Schließen - Geben Sie bitte das Passwort ein, um den privaten Schlüssel zu entschlüsseln. + Bitte geben Sie Ihren 12-Wort-Schlüssel (Passphrase) ein. Dieser Ordner ist nicht leer. Neue Schlüssel generieren… Diese 12 Wörter-Phrase ist wie ein sehr starkes Passwort: Sie bietet vollen Zugriff um Ihre verschlüsselten Dateien anzusehen und zu verwenden. Bitte schreiben Sie sie auf und verwahren sie an einem sicheren Ort. Ende-zu-Ende Verschlüsselung ist auf diesem Server deaktiviert. Notieren Sie Ihre Verschlüsselungs-Passphrase - Passwort… + Passphrase… Schlüssel abrufen… Schlüssel speichern Verschlüsselung einrichten @@ -289,7 +289,7 @@ Problem melden? (benötigt ein GitHub-Konto) Fehler beim Abruf der Datei Fehler beim Laden der Vorlagen - Fehler beim Anzeigen des Setup-Dialogs für Verschlüsselung! + Fehler bei der Anzeige des Verschlüsselungsdialogs! Fehler beim Starten der Kamera Start des Dokumentenscans fehlgeschlagen Konten @@ -597,6 +597,7 @@ E2E-Gedächtnisstütze Um die Gedächtnisstütze anzuzeigen, aktivieren Sie bitte Geräte-Zugangsdaten Benachrichtigungen der Mediensuche anzeigen + Passphrase Über neu gefundene Medienordner informieren GNU General Public Lizenz, version 2 Hilfe @@ -606,7 +607,7 @@ Nach Datum in Unterordnern speichern Unterordner benutzen Unterordneroptionen - Diesem Client Ende-zu-Ende-Verschlüsselung hinzufügen + Fügen Sie dieses Gerät zur Ende-zu-Ende Verschlüsselung hinzu. Lizenz App-PIN Geräte-Anmeldedaten aktiviert @@ -618,7 +619,7 @@ Konten verwalten Einem Freund empfehlen Verschlüsselung lokal entfernen - Ende-zu-Ende-Verschlüsselung einrichten + Ende-zu-Ende Verschlüsselung starten App-Umschalter anzeigen Nextcloud-App-Vorschläge in der Navigationsüberschrift Versteckte Dateien anzeigen @@ -648,8 +649,8 @@ Neu laden (entfernt) Datei nicht gefunden! - Sie können die Ende-zu-Ende-Verschlüsselung lokal auf diesem Client entfernen - Sie können die Ende-zu-Ende-Verschlüsselung lokal auf diesem Client entfernen. Die verschlüsselten Dateien bleiben auf dem Server, werden aber nicht mehr mit diesem Computer synchronisiert. + Sie können die Passphrase auf diesem Gerät entfernen. + Sie können die Passphrase auf diesem Gerät entfernen. Dadurch bleiben die verschlüsselten Inhalte unberührt, jedoch kann dieses Gerät die Daten nicht mehr entschlüsseln.\n\nSie können die Passphrase jederzeit wieder hier eingeben, um Zugriff von diesem Gerät aus auf ihre verschlüsselten Inhalte zu gewährleisten. Löschung fehlgeschlagen Lokales Konto entfernen Das Konto vom Gerät entfernen und alle lokalen Dateien löschen @@ -700,7 +701,7 @@ Nutze Bild als Status setzen Statusnachricht setzen - Während der Einrichtung der Ende-zu-Ende-Verschlüsselung erhalten Sie eine zufällige 12-Wörter-Gedächtnisstütze, die Sie benötigen, um Ihre Dateien auf anderen Geräten zu öffnen. Diese wird nur auf diesem Gerät gespeichert und kann in diesem Bildschirm erneut angezeigt werden. Bitte notieren Sie es an einem sicheren Ort! + Nach dem Start der Verschlüsselung wird Ihnen eine aus 12 Wörtern zufällig erzeugte Wortfolge (Passphrase) angezeigt. Diese bleibt in dieser App erhalten und kann erneut angezeigt werden. Dennoch empfehlen wir Ihnen, die Passphrase zu notieren. Teilen Teilen & Link kopieren Teilen diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 8ba77bc10d47..52b1efb6b954 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -727,14 +727,14 @@ Error while decrypting. Wrong password? Decrypting… Retrieving keys… - Please enter password to decrypt private key. + Please enter your passphrase. Generating new keys… All 12 words together make a very strong password, letting only you view and make use of your encrypted files. Please write it down and keep it somewhere safe. Set up encryption Make note of your 12 word encryption password End-to-end encryption disabled on server. Set up encryption - Password… + Passphrase… Could not save keys, please try again. Close Storing keys @@ -760,6 +760,7 @@ Updating share failed E2E mnemonic To show mnemonic please enable device credentials. + Passphrase Log in Sign up with provider Host your own server @@ -1074,18 +1075,18 @@ Icon for empty list No items Check back later or reload. - E2E not yet setup + End-to-end encryption is not yet setup. Error showing file actions Pin to Home screen Open %1$s Displays your 12 word passphrase - Set up end-to-end encryption + Start end-to-end encryption End-to-end encryption is set up! Remove encryption locally - You can remove end-to-end encryption locally on this client - Remove local encryption - You can remove end-to-end encryption locally on this client. The encrypted files will remain on server, but will not be synced to this computer any longer. - During setup of end-to-end encryption, you will receive a random 12 word mnemonic, which you will need to open your files on other devices. This will only be stored on this device, and can be shown again in this screen. Please note it down in a secure place! + You can remove end-to-end encryption locally on this device. + Remove encryption locally + You can remove the passphrase on this device. This will not affect the encrypted content, but this device will no longer be able to decrypt your data.\n\nYou can re- enter the passphrase here at any time to ensure access to your encrypted content from this device. + After starting the encryption, a randomly generated word sequence (passphrase) of 12 words is displayed. This remains in this app and can be displayed again. Nevertheless, we recommend that you write down the passphrase. Error showing encryption setup dialog! Add end-to-end encryption to this client Add new secure file drop diff --git a/app/src/test/java/com/nmc/android/OCFileTest.kt b/app/src/test/java/com/nmc/android/OCFileTest.kt new file mode 100644 index 000000000000..e68d7e9e5435 --- /dev/null +++ b/app/src/test/java/com/nmc/android/OCFileTest.kt @@ -0,0 +1,73 @@ +package com.nmc.android + +import com.owncloud.android.datamodel.OCFile +import org.junit.Assert.assertEquals +import org.junit.Test + +class OCFileTest { + + @Test + fun testLongIds() { + val sut = OCFile("/") + + //1 digit local id + sut.remoteId = "1ocjycgrudn78" + assertEquals(1, sut.localId) + + //2 digit local id + sut.remoteId = "12ocjycgrudn78" + assertEquals(12, sut.localId) + + //3 digit local id + sut.remoteId = "123ocjycgrudn78" + assertEquals(123, sut.localId) + + //4 digit local id + sut.remoteId = "1234ocjycgrudn78" + assertEquals(1234, sut.localId) + + //5 digit local id + sut.remoteId = "12345ocjycgrudn78" + assertEquals(12345, sut.localId) + + //6 digit local id + sut.remoteId = "123456ocjycgrudn78" + assertEquals(123456, sut.localId) + + //7 digit local id + sut.remoteId = "1234567ocjycgrudn78" + assertEquals(1234567, sut.localId) + + //8 digit local id + sut.remoteId = "12345678ocjycgrudn78" + assertEquals(12345678, sut.localId) + + //9 digit local id + sut.remoteId = "123456789ocjycgrudn78" + assertEquals(123456789, sut.localId) + + //10 digit local id + sut.remoteId = "1234567890ocjycgrudn78" + assertEquals(1234567890, sut.localId) + + //11 digit local id + sut.remoteId = "12345678901ocjycgrudn78" + assertEquals(12345678901, sut.localId) + + //12 digit local id + sut.remoteId = "123456789012ocjycgrudn78" + assertEquals(123456789012, sut.localId) + + //13 digit local id + sut.remoteId = "1234567890123ocjycgrudn78" + assertEquals(1234567890123, sut.localId) + + //14 digit local id + sut.remoteId = "12345678901234ocjycgrudn78" + assertEquals(12345678901234, sut.localId) + + //20 digit local id + sut.remoteId = "1234567890123456233ocjycgrudn78" + assertEquals(1234567890123456233L, sut.localId) + } +} \ No newline at end of file diff --git a/app/src/test/java/com/owncloud/android/datamodel/OCFileTest.kt b/app/src/test/java/com/owncloud/android/datamodel/OCFileTest.kt index 75234d899d3f..c639ae48e9fa 100644 --- a/app/src/test/java/com/owncloud/android/datamodel/OCFileTest.kt +++ b/app/src/test/java/com/owncloud/android/datamodel/OCFileTest.kt @@ -38,7 +38,7 @@ class OCFileTest { // this will fail as fileId is too large sut.remoteId = "1234567891011ocjycgrudn78" - assertNotEquals(1234567891011L, sut.localId) + assertEquals(1234567891011L, sut.localId) sut.localId = 1234567891011L assertEquals(1234567891011L, sut.localId)