Skip to content

Commit

Permalink
Merge branch 'develop' into release/1.6.3
Browse files Browse the repository at this point in the history
  • Loading branch information
SailReal committed Nov 5, 2021
2 parents 409f64a + 0c31410 commit cbc8084
Show file tree
Hide file tree
Showing 10 changed files with 304 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ internal object SSLSocketFactories {

fun from(trustManager: X509TrustManager): SSLSocketFactory {
return try {
val sslContext = SSLContext.getInstance("TLSv1.2")
val tlsVersion = if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.Q) {
"TLSv1.3"
} else {
"TLSv1.2"
}
val sslContext = SSLContext.getInstance(tlsVersion)
sslContext.init(null, arrayOf<TrustManager>(trustManager), null)
sslContext.socketFactory
} catch (e: GeneralSecurityException) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.cryptomator.data.cloud.webdav.network

import android.content.Context
import android.net.ConnectivityManager
import com.burgstaller.okhttp.AuthenticationCacheInterceptor
import com.burgstaller.okhttp.CachingAuthenticatorDecorator
import com.burgstaller.okhttp.DispatchingAuthenticator
Expand All @@ -22,7 +21,6 @@ import java.io.IOException
import java.nio.charset.StandardCharsets
import java.util.concurrent.ConcurrentHashMap
import java.util.concurrent.TimeUnit
import javax.net.ssl.X509TrustManager
import okhttp3.Authenticator
import okhttp3.Cache
import okhttp3.CacheControl
Expand Down Expand Up @@ -66,33 +64,30 @@ internal class WebDavCompatibleHttpClient(cloud: WebDavCloud, context: Context)
val cache = Cache(LruFileCacheUtil(context).resolve(LruFileCacheUtil.Cache.WEBDAV), lruCacheSize.toLong())
builder.cache(cache) //
.addNetworkInterceptor(provideCacheInterceptor()) //
.addInterceptor(provideOfflineCacheInterceptor(context))
.addInterceptor(provideOfflineCacheInterceptor())
}

val trustManager: X509TrustManager
if (usingWebDavWithSelfSignedCertificate(webDavCloud)) {
val trustManager = if (usingWebDavWithSelfSignedCertificate(webDavCloud)) {
val pinningTrustManager = PinningTrustManager(webDavCloud.certificate())
trustManager = pinningTrustManager
builder.hostnameVerifier(pinningTrustManager.hostnameVerifier())
pinningTrustManager
} else {
trustManager = DefaultTrustManager()
DefaultTrustManager()
}

builder.sslSocketFactory(SSLSocketFactories.from(trustManager), trustManager)

return builder.build()
}

private fun provideOfflineCacheInterceptor(context: Context): Interceptor {
private fun provideOfflineCacheInterceptor(): Interceptor {
return Interceptor { chain: Interceptor.Chain ->
var request = chain.request()
if (isNetworkAvailable(context)) {
val cacheControl = CacheControl.Builder() //
.maxAge(0, TimeUnit.DAYS) //
.build()
request = request.newBuilder() //
.cacheControl(cacheControl) //
.build()
}
val cacheControl = CacheControl.Builder() //
.maxAge(0, TimeUnit.DAYS) //
.build()
request = request.newBuilder() //
.cacheControl(cacheControl) //
.build()
chain.proceed(request)
}
}
Expand Down Expand Up @@ -147,12 +142,6 @@ internal class WebDavCompatibleHttpClient(cloud: WebDavCloud, context: Context)
private fun usingWebDavWithSelfSignedCertificate(webDavCloud: WebDavCloud): Boolean {
return webDavCloud.certificate() != null
}

private fun isNetworkAvailable(context: Context): Boolean {
val connectivityManager = context.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager
val activeNetworkInfo = connectivityManager.activeNetworkInfo
return activeNetworkInfo != null && activeNetworkInfo.isConnected
}
}

class UserAgentInterceptor : Interceptor {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,20 @@ class CryptomatorApp : MultiDexApplication(), HasComponent<ApplicationComponent>

fun startAutoUpload() {
val sharedPreferencesHandler = SharedPreferencesHandler(applicationContext())
if(sharedPreferencesHandler.usePhotoUpload()) {
if (checkToStartAutoImageUpload(sharedPreferencesHandler)) {
val vault = applicationComponent.vaultRepository().load(sharedPreferencesHandler.photoUploadVault())
if(vault.isUnlocked) {
if (vault.isUnlocked) {
val cloud = applicationComponent.cloudRepository().decryptedViewOf(vault)
applicationContext().startService(AutoUploadService.startAutoUploadIntent(applicationContext(), cloud))
}
}
}

private fun checkToStartAutoImageUpload(sharedPreferencesHandler: SharedPreferencesHandler): Boolean {
return sharedPreferencesHandler.usePhotoUpload()
&& (!sharedPreferencesHandler.autoPhotoUploadOnlyUsingWifi() || applicationComponent.networkConnectionCheck().checkWifiOnAndConnected())
}

private fun setupLogging() {
setupLoggingFramework()
setup()
Expand Down
1 change: 1 addition & 0 deletions presentation/src/main/res/values-cs-rCZ/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<string name="error_general_update">Kontrola aktualizací se nezdařila. Došlo k obecné chybě.</string>
<string name="error_hash_mismatch_update">Kontrola aktualizace se nezdařila. Hash neodpovídá nahranému souboru</string>
<string name="error_update_no_internet">Kontrola aktualizací se nezdařila. Žádné připojení k internetu.</string>
<string name="error_play_services_not_available">Obchod Google Play není nainstalován</string>
<string name="error_biometric_auth_aborted">Ověření pomocí otisků prstů selhalo</string>
<string name="error_vault_config_loading">Obecná chyba při načítání konfigurace trezoru</string>
<string name="error_file_not_found_after_opening_using_3party">Místní soubor již není přítomen po přepnutí zpět na Cryptomator. Možné změny nelze promítnout zpět do cloudu.</string>
Expand Down
6 changes: 3 additions & 3 deletions presentation/src/main/res/values-de-rDE/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<string name="error_cloud_already_exists">Cloud existiert bereits.</string>
<string name="error_activity_not_found">Installiere eine App, die diesen Dateityp unterstützt.</string>
<string name="error_server_not_found">Server nicht gefunden.</string>
<string name="error_device_policy_manager_not_found">Bitte öffne die Einstellungen Deines Geräts und stell die Bildschirmsperre von Hand ein</string>
<string name="error_device_policy_manager_not_found">Bitte öffne die Einstellungen Deines Geräts und stelle die Bildschirmsperre von Hand ein</string>
<string name="error_export_illegal_file_name">Export fehlgeschlagen. Versuche, Sonderzeichen aus den Dateinamen zu entfernen und erneut zu exportieren.</string>
<string name="error_name_contains_invalid_characters">Keine Sonderzeichen möglich.</string>
<string name="error_names_contains_invalid_characters">Dateinamen können keine Sonderzeichen enthalten.</string>
Expand All @@ -27,7 +27,7 @@
<string name="error_failed_to_decrypt_webdav_password">Beim entschlüsseln des WebDAV-Passworts trat ein Fehler auf. Bitte in den Einstellungen erneut festlegen.</string>
<string name="error_play_services_not_available">Die Google Play Services sind nicht installiert</string>
<string name="error_biometric_auth_aborted">Biometrischer Login abgebrochen</string>
<string name="error_vault_version_mismatch">Die in der %1$s-Datei angegebene Version ist nicht identisch mit jener der %2$s-Datei</string>
<string name="error_vault_version_mismatch">Die in %1$s angegebene Version ist nicht identisch mit der Version in %2$s</string>
<string name="error_vault_key_invalid">%1$s-Datei stimmt nicht mit der %2$s-Datei überein</string>
<string name="error_vault_config_loading">Allgemeiner Fehler beim Laden der Tresorkonfiguration</string>
<string name="error_file_not_found_after_opening_using_3party">Lokale Datei ist nach dem Zurückwechseln zu Cryptomator nicht mehr vorhanden. Mögliche Änderungen können nicht in die Cloud übertragen werden.</string>
Expand Down Expand Up @@ -324,7 +324,7 @@
<string name="dialog_no_more_images_to_display">Keine weiteren Bilder anzuzeigen&#8230;</string>
<string name="dialog_pcloud_credentials_updated_title">Anmeldedaten von \'%1$s\' aktualisiert</string>
<string name="dialog_pcloud_credentials_updated">Falls du ein neues pCloud-Konto hinzufügen wolltest, klicke auf diese URL <a href="https://www.pcloud.com">www.pcloud.com</a>, melde dich vom aktuellen Konto ab und klicke in dieser App erneut auf das „+“, um eine neue Cloud-Verbindung zu erstellen.</string>
<string name="permission_snackbar_auth_local_vault">Cryptomator benötigt Speicherzugriff, um lokale Tresore nutzen zu können</string>
<string name="permission_snackbar_auth_local_vault">Um lokale Tresore nutzen zu können benötigt Cryptomator Speicherzugriff</string>
<string name="permission_snackbar_auth_auto_upload">Cryptomator benötigt Zugriff auf den Speicher um den automatischen Foto-Upload zu nutzen</string>
<!-- # error reports -->
<!-- # misc -->
Expand Down
8 changes: 4 additions & 4 deletions presentation/src/main/res/values-ru-rRU/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
<string name="error_no_such_file">Файл не существует.</string>
<string name="error_vault_has_been_locked">Хранилище заблокировано.</string>
<string name="error_cloud_already_exists">Облако уже существует.</string>
<string name="error_activity_not_found">Скачайте приложение, которое может открыть этот файл.</string>
<string name="error_activity_not_found">Пожалуйста, скачайте приложение, которое может открыть этот файл.</string>
<string name="error_server_not_found">Сервер не найден.</string>
<string name="error_device_policy_manager_not_found">Откройте настройки устройств и установите блокировку экрана вручную</string>
<string name="error_export_illegal_file_name">Ошибка экспорта. Попробуйте удалить спецсимволы из имён файлов и экспортировать снова.</string>
<string name="error_name_contains_invalid_characters">Не может содержать спецсимволы.</string>
<string name="error_device_policy_manager_not_found">Откройте настройки устройства и установите блокировку экрана вручную</string>
<string name="error_export_illegal_file_name">Не удалось экспортировать. Попробуйте удалить специальные символы из имен файлов и экспортировать снова.</string>
<string name="error_name_contains_invalid_characters">Не может содержать специальные символы.</string>
<string name="error_names_contains_invalid_characters">В имени файла не может быть спецсимволов.</string>
<string name="error_vault_name_contains_invalid_characters">В имени хранилища не может быть спецсимволов.</string>
<string name="error_general_update">Не удалось проверить наличие обновления. Общая ошибка.</string>
Expand Down
5 changes: 5 additions & 0 deletions presentation/src/main/res/values-sv-rSE/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
<string name="permission_message_export_file">Cryptomator behöver åtkomst till lagringsutrymme för att exportera filer</string>
<string name="permission_message_upload_file">Cryptomator behöver åtkomst till lagringsutrymme för att ladda upp filer</string>
<string name="permission_message_share_file">Cryptomator behöver åtkomst till lagringsutrymme för att dela filer</string>
<string name="permission_revoked_re_request_permission">Cryptomator har förlorat behörighet att komma åt den här platsen. Välj denna mapp igen för att återställa behörigheten.</string>
<string name="snack_bar_action_title_settings">Inställningar</string>
<string name="snack_bar_action_title_search">Sök</string>
<string name="snack_bar_action_title_search_previous">Föregående</string>
Expand Down Expand Up @@ -288,6 +289,10 @@
<string name="dialog_app_is_obscured_info_title">Appen är täckt</string>
<string name="dialog_app_is_obscured_info_hint">En annan app visar något ovanpå Cryptomator (t.ex., ett blått ljusfilter eller nattläge app). Av säkerhetsskäl är Cryptomator inaktiverad.\n\n<a href="https://docs.cryptomator.org/en/1.5/android/settings/#block-app-when-obscured">Så här aktiverar du Cryptomator</a></string>
<string name="dialog_app_is_obscured_info_neutral_button">Stäng</string>
<string name="dialog_vaults_removed_during_migration_title">Vänligen lägg till valv igen för %1s molnet</string>
<string name="dialog_vaults_removed_during_migration_hint">Medan vi migrerar till den här appversionen måste vi ta bort följande valv från appen:\n%2s \n\nDessa valv tas inte bort från molnet utan endast från den här appen. Ledsen för besväret. Du lägger sedan till dessa valv igen för att fortsätta arbeta med dem.</string>
<string name="dialog_vault_is_root_folder_of_cloud_title">Valvet är rotmapp för molnanslutningen</string>
<string name="dialog_vault_is_root_folder_of_cloud_hint">Skapa en ny molnanslutning där du väljer minst den överordnade mappen i denna valvkatalog som rotkatalog för att lägga till valvet.</string>
<string name="dialog_disable_secure_screen_disclaimer_hint">Den här inställningen är en säkerhetsfunktion och hindrar andra appar från att lura användare att göra saker de inte vill göra.\n\nGenom att inaktivera bekräftar du att du är <a href="https://docs.cryptomator.org/en/1.5/android/settings/#screen-security">medveten om riskerna</a>.</string>
<string name="dialog_delete_cloud_connection_with_vaults_message">Är du säker på att du vill ta bort den här molnanslutningen?</string>
<string name="dialog_delete_cloud_connection_with_vaults_hint">Denna åtgärd kommer att ta bort molnanslutningen och alla valv i detta moln.</string>
Expand Down
5 changes: 5 additions & 0 deletions presentation/src/main/res/values-tr-rTR/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
<string name="permission_message_export_file">Cryptomator\'un dosyaları dışa aktarmak için depolama erişimine ihtiyacı var</string>
<string name="permission_message_upload_file">Cryptomator\'un dosyaları yüklemek için depolama erişimine ihtiyacı var</string>
<string name="permission_message_share_file">Cryptomator\'un dosyaları paylaşmak için depolama erişimine ihtiyacı var</string>
<string name="permission_revoked_re_request_permission">Cryptomator bu konuma erişim iznini kaybetti. İzni geri yüklemek için lütfen bu klasörü tekrar seçin.</string>
<string name="snack_bar_action_title_settings">Ayarlar</string>
<string name="snack_bar_action_title_search">Ara</string>
<string name="snack_bar_action_title_search_previous">Önceki</string>
Expand Down Expand Up @@ -288,6 +289,10 @@
<string name="dialog_app_is_obscured_info_title">Uygulama gizlendi</string>
<string name="dialog_app_is_obscured_info_hint">Cryptomator\'un üstünde çalışan bazı uygulamalar, (örn. Mavi ışık filtresi ve gece modu uygulamaları gibi) içeriği görüntüler! Bu nedenden dolayı, güvenlik amacıyla Cryptomator devre dışı bırakılır!\n\n<a href="https://docs.cryptomator.org/en/1.5/android/settings/#block-app-when-obscured">Cryptomator\'u tekrar nasıl etkinleştirebilirim?</a></string>
<string name="dialog_app_is_obscured_info_neutral_button">Kapat</string>
<string name="dialog_vaults_removed_during_migration_title">Lütfen %1s bulutu için kasaları yeniden ekleyin</string>
<string name="dialog_vaults_removed_during_migration_hint">Bu uygulama sürümüne geçiş yaparken aşağıdaki kasaları uygulamadan kaldırmamız gerekiyor:\n%2s \n\nBu kasalar buluttan değil, yalnızca bu uygulamadan kaldırılır. Rahatsızlık için özür dileriz ve onlarla çalışmaya devam etmek için lütfen bu kasaları yeniden ekleyin.</string>
<string name="dialog_vault_is_root_folder_of_cloud_title">Vault, bulut bağlantısının kök klasörüdür</string>
<string name="dialog_vault_is_root_folder_of_cloud_hint">Bu kasayı eklemek için kök dizin olarak bu kasa klasörünün en azından üst klasörünü seçtiğiniz yeni bir bulut bağlantısı oluşturun.</string>
<string name="dialog_disable_secure_screen_disclaimer_hint">Bu ayar bir güvenlik özelliğidir ve diğer uygulamaların, kullanıcıları kandırmasını engeller.\n\nDevre dışı bırakarak, <a href="https://docs.cryptomator.org/en/1.5/android/settings/#screen-security">risklerin farkında olduğunuzu onaylamış olursunuz</a>.</string>
<string name="dialog_delete_cloud_connection_with_vaults_message">Bu bulut bağlantısını kaldırmak istediğinizden emin misiniz?</string>
<string name="dialog_delete_cloud_connection_with_vaults_hint">Bu işlem, bulut bağlantısını ve bu bulutun tüm kasalarını kaldıracak.</string>
Expand Down
Loading

0 comments on commit cbc8084

Please sign in to comment.