Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasKaminsky committed Mar 16, 2024
2 parents 3bff3de + 4e2a472 commit e3f2689
Show file tree
Hide file tree
Showing 22 changed files with 163 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,7 @@ protected RemoteOperationResult run(OwnCloudClient client) {
}
}

// TODO REFACTOR
@SuppressLint("AndroidLintUseSparseArrays") // gson cannot handle sparse arrays easily, therefore use hashmap
private RemoteOperationResult encryptedUpload(OwnCloudClient client, OCFile parentFile) {
RemoteOperationResult result = null;
Expand Down Expand Up @@ -489,13 +490,14 @@ private RemoteOperationResult encryptedUpload(OwnCloudClient client, OCFile pare
// mContext);

Object object = EncryptionUtils.downloadFolderMetadata(parentFile, client, mContext, user);
if (object instanceof DecryptedFolderMetadataFileV1 decrypted && decrypted.getMetadata() != null) {
metadataExists = true;
}

if (CapabilityUtils.getCapability(mContext).getEndToEndEncryptionApiVersion().compareTo(E2EVersion.V2_0) >= 0) {
if (object == null) {
// TODO return error
return new RemoteOperationResult(new IllegalStateException("Metadata does not exist"));
} else {
metadataExists = true;
}
} else {
// v1 is allowed to be null, thus create it
Expand All @@ -507,8 +509,11 @@ private RemoteOperationResult encryptedUpload(OwnCloudClient client, OCFile pare
String encryptedMetadataKey = EncryptionUtils.encryptStringAsymmetric(metadataKey, publicKey);
metadata.getMetadata().setMetadataKey(encryptedMetadataKey);

if (object instanceof DecryptedFolderMetadataFileV1) {
metadata = (DecryptedFolderMetadataFileV1) object;
}

object = metadata;
metadataExists = false;
}

// todo fail if no metadata
Expand Down Expand Up @@ -669,7 +674,6 @@ private RemoteOperationResult encryptedUpload(OwnCloudClient client, OCFile pare
data.setFilename(mFile.getDecryptedFileName());
data.setMimetype(mFile.getMimeType());
data.setKey(EncryptionUtils.encodeBytesToBase64String(key));

decryptedFile.setEncrypted(data);
decryptedFile.setInitializationVector(EncryptionUtils.encodeBytesToBase64String(iv));
decryptedFile.setAuthenticationTag(encryptedFile.getAuthenticationTag());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,6 @@ public class ReceiveExternalFilesActivity extends FileActivity

@Override
protected void onCreate(Bundle savedInstanceState) {
prepareStreamsToUpload();

if (savedInstanceState != null) {
String parentPath = savedInstanceState.getString(KEY_PARENTS);

Expand All @@ -191,6 +189,8 @@ protected void onCreate(Bundle savedInstanceState) {
binding = ReceiveExternalFilesBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());

prepareStreamsToUpload();

// Listen for sync messages
IntentFilter syncIntentFilter = new IntentFilter(RefreshFolderOperation.
EVENT_SINGLE_FOLDER_CONTENTS_SYNCED);
Expand Down Expand Up @@ -850,16 +850,16 @@ private String generatePath(Stack<String> dirs) {
private void prepareStreamsToUpload() {
Intent intent = getIntent();

if (Intent.ACTION_SEND.equals(intent.getAction())) {
if (intent.hasExtra(Intent.EXTRA_STREAM) && Intent.ACTION_SEND.equals(intent.getAction())) {
mStreamsToUpload = new ArrayList<>();
mStreamsToUpload.add(IntentExtensionsKt.getParcelableArgument(intent, Intent.EXTRA_STREAM, Parcelable.class));
} else if (Intent.ACTION_SEND_MULTIPLE.equals(intent.getAction())) {
} else if (intent.hasExtra(Intent.EXTRA_STREAM) && Intent.ACTION_SEND_MULTIPLE.equals(intent.getAction())) {
mStreamsToUpload = intent.getParcelableArrayListExtra(Intent.EXTRA_STREAM);
}

if (mStreamsToUpload == null || mStreamsToUpload.isEmpty() || mStreamsToUpload.get(0) == null) {
} else if (intent.hasExtra(Intent.EXTRA_TEXT) && Intent.ACTION_SEND.equals(intent.getAction())) {
mStreamsToUpload = null;
saveTextsFromIntent(intent);
} else {
showErrorDialog(R.string.uploader_error_message_no_file_to_upload, R.string.uploader_error_title_file_cannot_be_uploaded);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ class SharedListFragment : OCFileListFragment(), Injectable {
val fileDisplayActivity = activity as FileDisplayActivity
fileDisplayActivity.updateActionBarTitleAndHomeButtonByString(getString(R.string.drawer_item_shared))
fileDisplayActivity.setMainFabVisible(false)
fileDisplayActivity.initSyncBroadcastReceiver()
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1390,6 +1390,7 @@ public static Pair<Boolean, DecryptedFolderMetadataFileV1> retrieveMetadataV1(OC
// new metadata
metadata = new DecryptedFolderMetadataFileV1();
metadata.setMetadata(new DecryptedMetadata());
metadata.getMetadata().setVersion(Double.parseDouble(E2EVersion.V1_2.getValue()));
metadata.getMetadata().setMetadataKeys(new HashMap<>());
String metadataKey = EncryptionUtils.encodeBytesToBase64String(EncryptionUtils.generateKey());
String encryptedMetadataKey = EncryptionUtils.encryptStringAsymmetric(metadataKey, publicKey);
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/res/values-ar/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@
<string name="allow_resharing">السماح بإعادة المشاركة </string>
<string name="app_widget_description">عرض أداة واحدة من لوحة القيادة</string>
<string name="appbar_search_in">بحث في %s</string>
<string name="assistant_screen_all_task_type">الكل</string>
<string name="assistant_screen_create_task_alert_dialog_input_field_placeholder">أكتُب أيَّ نص</string>
<string name="assistant_screen_task_delete_fail_message">تمّ حذف المهمة بنجاح</string>
<string name="assistant_screen_task_view_show_less">عرض أقل</string>
<string name="assistant_screen_task_view_show_more">عرض المزيد</string>
<string name="associated_account_not_found">الحساب المرتبط غير موجود!</string>
<string name="auth_access_failed">فشل الوصول لـ: %1$s</string>
<string name="auth_account_does_not_exist">هذا الحساب لم تتم إضافته في هذا الجهاز بعد</string>
Expand Down
3 changes: 3 additions & 0 deletions app/src/main/res/values-b+en+001/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,11 @@
<string name="allow_resharing">Allow resharing</string>
<string name="app_widget_description">Shows one widget from dashboard</string>
<string name="appbar_search_in">Search in %s</string>
<string name="assistant_screen_all_task_type">All</string>
<string name="assistant_screen_create_task_alert_dialog_input_field_placeholder">Type some text</string>
<string name="assistant_screen_task_delete_fail_message">Task successfully deleted</string>
<string name="assistant_screen_task_view_show_less">Show less</string>
<string name="assistant_screen_task_view_show_more">Show more</string>
<string name="associated_account_not_found">Associated account not found!</string>
<string name="auth_access_failed">Access failed: %1$s</string>
<string name="auth_account_does_not_exist">The account is not added on this device yet</string>
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/res/values-bg-rBG/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
<string name="allow_resharing">Може да споделя повторно</string>
<string name="app_widget_description">Показва един изпълним модул от таблото за управление</string>
<string name="appbar_search_in">Търсене в %s</string>
<string name="assistant_screen_all_task_type">Всички</string>
<string name="assistant_screen_task_delete_fail_message">Задачата е успешно изтрита</string>
<string name="assistant_screen_task_view_show_less">Покажи по-малко</string>
<string name="assistant_screen_task_view_show_more">Покажи повече</string>
<string name="associated_account_not_found">Свързания профил не е намерен!</string>
<string name="auth_access_failed">Достъп неуспешен: %1$s</string>
<string name="auth_account_does_not_exist">Профилът все още не съществува на устройството</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-br/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
<string name="add_to_cloud">Ouzhpennañ da %1$s</string>
<string name="allow_resharing">Aotrea an adrannañ</string>
<string name="appbar_search_in">Klask e %s</string>
<string name="assistant_screen_all_task_type">Pep tra</string>
<string name="associated_account_not_found">N\'eo ket bet kavet ur c\'hont kenstaget</string>
<string name="auth_access_failed">Aksed c\'hwitet: %1$s</string>
<string name="auth_account_does_not_exist">Ar c\'hont n\'eo ket bet ouzhpennet war an ardivink c\'hoaz</string>
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/res/values-ca/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
<string name="allow_resharing">Permet compartir de nou</string>
<string name="app_widget_description">Mostra un giny del tauler</string>
<string name="appbar_search_in">Cerca a %s</string>
<string name="assistant_screen_all_task_type">Totes</string>
<string name="assistant_screen_create_task_alert_dialog_input_field_placeholder">Escriu una mica de text</string>
<string name="assistant_screen_task_view_show_less">Mostra\'n menys</string>
<string name="assistant_screen_task_view_show_more">Mostra\'n més</string>
<string name="associated_account_not_found">No s\'ha trobat el compte associat!</string>
<string name="auth_access_failed">No s\'ha tingut accés: %1$s</string>
<string name="auth_account_does_not_exist">Encara no s\'ha afegit el compte en aquest dispositiu</string>
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/res/values-cs-rCZ/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@
<string name="allow_resharing">Povolit sdílet dál dalším</string>
<string name="app_widget_description">Zobrazuje jeden ovládací prvek z nástěnky</string>
<string name="appbar_search_in">Hledat v %s</string>
<string name="assistant_screen_all_task_type">Vše</string>
<string name="assistant_screen_create_task_alert_dialog_input_field_placeholder">Zadejte nějaký text</string>
<string name="assistant_screen_task_delete_fail_message">Úloha úspěšně smazána</string>
<string name="assistant_screen_task_view_show_less">Zobrazit méně</string>
<string name="assistant_screen_task_view_show_more">Zobrazit více</string>
<string name="associated_account_not_found">Související účet nenalezen!</string>
<string name="auth_access_failed">Přístup se nezdařil: %1$s</string>
<string name="auth_account_does_not_exist">Účet zatím není na tomto zařízení přidán</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-da/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
<string name="allow_resharing">Tillad videredeling</string>
<string name="app_widget_description">Viser én widget fra dashboard</string>
<string name="appbar_search_in">Søg i %s</string>
<string name="assistant_screen_all_task_type">Alle</string>
<string name="associated_account_not_found">Forbundet konto blev ikke fundet!</string>
<string name="auth_access_failed">Adgang fejlede: %1$s</string>
<string name="auth_account_does_not_exist">Kontoen findes endnu ikke på enheden</string>
Expand Down
17 changes: 17 additions & 0 deletions app/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,23 @@
<string name="allow_resharing">Weiterteilen erlauben</string>
<string name="app_widget_description">Zeigt ein Widget aus dem Dashboard an</string>
<string name="appbar_search_in">Suche in %s</string>
<string name="assistant_screen_all_task_type">Alle</string>
<string name="assistant_screen_create_task_alert_dialog_input_field_placeholder">Bitte einen Text eingeben</string>
<string name="assistant_screen_delete_task_alert_dialog_description">Möchten Sie diese Aufgabe wirklich löschen?</string>
<string name="assistant_screen_delete_task_alert_dialog_title">Aufgabe löschen</string>
<string name="assistant_screen_loading">Aufgabenlisten werden geladen, bitte warten</string>
<string name="assistant_screen_no_task_available_for_all_task_filter_text">Keine Aufgabe verfügbar. Aufgabentyp auswählen, um eine neue Aufgabe zu erstellen.</string>
<string name="assistant_screen_no_task_available_text">Für den Aufgabentyp %s ist keine Aufgabe verfügbar. Sie können unten rechts eine neue Aufgabe erstellen.</string>
<string name="assistant_screen_task_create_fail_message">Fehler beim Erstellen der Aufgabe</string>
<string name="assistant_screen_task_create_success_message">Aufgabe erfolgreich erstellt</string>
<string name="assistant_screen_task_delete_fail_message">Aufgabe erfolgreich gelöscht</string>
<string name="assistant_screen_task_delete_success_message">Fehler beim Löschen der Aufgabe</string>
<string name="assistant_screen_task_list_error_state_message">Die Aufgabenliste kann nicht abgerufen werden. Bitte überprüfen Sie Ihre Internetverbindung.</string>
<string name="assistant_screen_task_more_actions_bottom_sheet_delete_action">Aufgabe löschen</string>
<string name="assistant_screen_task_types_error_state_message">Die Aufgabenliste kann nicht abgerufen werden. Bitte überprüfen Sie Ihre Internetverbindung.</string>
<string name="assistant_screen_task_view_show_less">Weniger anzeigen</string>
<string name="assistant_screen_task_view_show_more">Mehr anzeigen</string>
<string name="assistant_screen_top_bar_title">Assistent</string>
<string name="associated_account_not_found">Verknüpftes Konto nicht gefunden!</string>
<string name="auth_access_failed">Zugriffsfehler: %1$s</string>
<string name="auth_account_does_not_exist">Das Konto ist bislang auf dem Gerät nicht vorhanden</string>
Expand Down Expand Up @@ -237,6 +252,7 @@
<string name="drawer_header_background">Hintergrundbild des Kopfbereiches</string>
<string name="drawer_item_activities">Aktivitäten</string>
<string name="drawer_item_all_files">Alle Dateien</string>
<string name="drawer_item_assistant">Assistent</string>
<string name="drawer_item_favorites">Favoriten</string>
<string name="drawer_item_gallery">Medien</string>
<string name="drawer_item_groupfolders">Gruppenordner</string>
Expand All @@ -255,6 +271,7 @@
<string name="drawer_synced_folders">Automatisches Hochladen</string>
<string name="e2e_not_yet_setup">E2E bislang nicht eingerichtet</string>
<string name="e2e_offline">Ohne Internetverbindung nicht möglich</string>
<string name="ecosystem_apps_display_assistant">Assistent</string>
<string name="ecosystem_apps_display_more">Mehr</string>
<string name="ecosystem_apps_display_notes">Notizen</string>
<string name="ecosystem_apps_display_talk">Talk</string>
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values-el/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@
<string name="allow_resharing">Επιτρέπεται ο επαναδιαμοιρασμός</string>
<string name="app_widget_description">Εμφάνιση ενός γραφικού στοιχείου από τον πίνακα ελέγχου</string>
<string name="appbar_search_in">Αναζήτηση στο %s</string>
<string name="assistant_screen_all_task_type">\'Ολα</string>
<string name="assistant_screen_create_task_alert_dialog_input_field_placeholder">Πληκτρολογήστε κάποιο κείμενο</string>
<string name="assistant_screen_task_view_show_less">Εμφάνιση λιγότερων</string>
<string name="assistant_screen_task_view_show_more">Εμφάνιση περισσότερων</string>
<string name="associated_account_not_found">Δεν βρέθηκε ο συνδεδεμένος λογαριασμός!</string>
<string name="auth_access_failed">Αποτυχία πρόσβασης: %1$s</string>
<string name="auth_account_does_not_exist">Ο λογαριασμός δεν υπάρχει ακόμα στη συσκευή</string>
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values-eo/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
<string name="advanced_settings">Detalaj agordoj</string>
<string name="allow_resharing">Permesi rekunhavigon</string>
<string name="appbar_search_in">Serĉi en 1%s</string>
<string name="assistant_screen_all_task_type">Ĉiuj</string>
<string name="assistant_screen_task_view_show_less">Montri malpli</string>
<string name="assistant_screen_task_view_show_more">Montri pli</string>
<string name="auth_access_failed">Aliro malsukcesis: %1$s</string>
<string name="auth_account_does_not_exist">La konto ankoraŭ ne aldoniĝis al tiu ĉi aparato</string>
<string name="auth_account_not_new">Konto pri samaj uzanto kaj servilo jam ekzistas tiuaparate</string>
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values-es-rEC/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@
<string name="allow_resharing">Permitir volver a compartir</string>
<string name="app_widget_description">Muestra un widget del panel de control</string>
<string name="appbar_search_in">Compartir en %s</string>
<string name="assistant_screen_all_task_type">Todos</string>
<string name="assistant_screen_task_delete_fail_message">Tarea eliminada con éxito</string>
<string name="assistant_screen_task_view_show_less">Mostrar menos</string>
<string name="assistant_screen_task_view_show_more">Mostrar más</string>
<string name="associated_account_not_found">¡Cuenta asociada no encontrada!</string>
<string name="auth_access_failed">Acceso fallido: %1$s</string>
<string name="auth_account_does_not_exist">La cuenta aún no ha sido agregada a este dispositivo </string>
Expand Down
Loading

0 comments on commit e3f2689

Please sign in to comment.