Merge pull request #400 from tommyd3mdi/develop
authormasensio <masensio@solidgear.es>
Fri, 21 Mar 2014 09:32:49 +0000 (10:32 +0100)
committermasensio <masensio@solidgear.es>
Fri, 21 Mar 2014 09:32:49 +0000 (10:32 +0100)
Notification improvements

45 files changed:
.travis.yml [new file with mode: 0644]
owncloud-android-library
res/layout/ssl_untrusted_cert_layout.xml [new file with mode: 0644]
res/layout/ssl_validator_layout.xml
res/layout/sso_dialog.xml
res/values-ar/strings.xml
res/values-ca/strings.xml
res/values-da/strings.xml
res/values-de-rDE/strings.xml
res/values-de/strings.xml
res/values-el/strings.xml
res/values-en-rGB/strings.xml
res/values-es/strings.xml
res/values-fi-rFI/strings.xml
res/values-fr/strings.xml
res/values-gl/strings.xml
res/values-it/strings.xml
res/values-ja-rJP/strings.xml
res/values-nl/strings.xml
res/values-nn-rNO/strings.xml
res/values-pl/strings.xml
res/values-pt-rBR/strings.xml
res/values-ro/strings.xml
res/values-sl/strings.xml
res/values-tr/strings.xml
res/values/strings.xml
res/xml/preferences.xml
src/com/owncloud/android/authentication/AuthenticatorActivity.java
src/com/owncloud/android/authentication/SsoWebViewClient.java
src/com/owncloud/android/operations/CreateShareOperation.java
src/com/owncloud/android/syncadapter/FileSyncAdapter.java
src/com/owncloud/android/ui/CheckBoxPreferenceWithLongTitle.java [new file with mode: 0644]
src/com/owncloud/android/ui/PreferenceMultiline.java [new file with mode: 0644]
src/com/owncloud/android/ui/activity/CopyToClipboardActivity.java
src/com/owncloud/android/ui/activity/FileDisplayActivity.java
src/com/owncloud/android/ui/adapter/CertificateCombinedExceptionViewAdapter.java [new file with mode: 0644]
src/com/owncloud/android/ui/adapter/SslCertificateViewAdapter.java [new file with mode: 0644]
src/com/owncloud/android/ui/adapter/SslErrorViewAdapter.java [new file with mode: 0644]
src/com/owncloud/android/ui/adapter/X509CertificateViewAdapter.java [new file with mode: 0644]
src/com/owncloud/android/ui/dialog/LoadingDialog.java
src/com/owncloud/android/ui/dialog/SamlWebViewDialog.java
src/com/owncloud/android/ui/dialog/SslUntrustedCertDialog.java [new file with mode: 0644]
src/com/owncloud/android/ui/dialog/SslValidatorDialog.java
src/com/owncloud/android/ui/preview/PreviewImageActivity.java
src/com/owncloud/android/ui/preview/PreviewVideoActivity.java

diff --git a/.travis.yml b/.travis.yml
new file mode 100644 (file)
index 0000000..7ec196c
--- /dev/null
@@ -0,0 +1,16 @@
+language: java
+jdk: oraclejdk7
+before_install:
+  # Install base Android SDK
+    - sudo apt-get update -qq
+    - sudo apt-get install -qq libstdc++6:i386 lib32z1
+    - export COMPONENTS=build-tools-18.1.0,android-14,android-17,android-19,sysimg-19,extra-android-support
+    - curl -L https://raw.github.com/embarkmobile/android-sdk-installer/master/android-sdk-installer | bash /dev/stdin --install=$COMPONENTS
+    - source ~/.android-sdk-installer/env
+    - rm pom.xml
+    - ./setup_env.sh
+
+script:
+  - ant clean
+  - ant debug
+
index 1dbc9a1..ae2f5b4 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 1dbc9a121e8818d0202d3aaec31bce1335ee428b
+Subproject commit ae2f5b48b86015642998bf515a978db380c88787
diff --git a/res/layout/ssl_untrusted_cert_layout.xml b/res/layout/ssl_untrusted_cert_layout.xml
new file mode 100644 (file)
index 0000000..6a30c2e
--- /dev/null
@@ -0,0 +1,460 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 
+    ownCloud Android client application
+
+    Copyright (C) 2012-2013 ownCloud Inc.
+
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License version 2,
+    as published by the Free Software Foundation.
+  
+    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 <http://www.gnu.org/licenses/>.
+-->
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/root"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content"
+    android:gravity="center"
+    android:orientation="vertical" >
+
+       <TextView
+               android:id="@+id/header"
+               android:layout_width="wrap_content"
+               android:layout_height="wrap_content"
+               android:layout_weight="0"
+               android:text="@string/ssl_validator_header"
+               android:padding="5dp"
+               android:textAppearance="?android:attr/textAppearanceMedium"
+                />
+    
+       <TextView
+               android:id="@+id/reason_cert_not_trusted"
+               android:layout_width="wrap_content"
+               android:layout_height="wrap_content"
+               android:layout_weight="0"
+               android:layout_gravity="left"
+               android:paddingLeft="20dp"
+               android:text="@string/ssl_validator_reason_cert_not_trusted"
+               android:textAppearance="?android:attr/textAppearanceSmall"
+                />
+               
+       
+       <TextView
+               android:id="@+id/reason_cert_expired"
+               android:layout_width="wrap_content"
+               android:layout_height="wrap_content"
+               android:layout_gravity="left"
+               android:paddingLeft="20dp"
+               android:text="@string/ssl_validator_reason_cert_expired"
+               android:textAppearance="?android:attr/textAppearanceSmall"
+                />
+       
+       <TextView
+               android:id="@+id/reason_cert_not_yet_valid"
+               android:layout_width="wrap_content"
+               android:layout_height="wrap_content"
+               android:layout_gravity="left"
+               android:paddingLeft="20dp"
+               android:text="@string/ssl_validator_reason_cert_not_yet_valid"
+               android:textAppearance="?android:attr/textAppearanceSmall"
+                />
+               
+       <TextView
+               android:id="@+id/reason_hostname_not_verified"
+               android:layout_width="wrap_content"
+               android:layout_height="wrap_content"
+               android:layout_gravity="left"
+               android:paddingLeft="20dp"
+               android:text="@string/ssl_validator_reason_hostname_not_verified"
+               android:textAppearance="?android:attr/textAppearanceSmall"
+                />
+       
+       <TextView
+               android:id="@+id/reason_no_info_about_error"
+               android:layout_width="wrap_content"
+               android:layout_height="wrap_content"
+               android:layout_gravity="left"
+               android:paddingLeft="20dp"
+               android:text="@string/ssl_validator_no_info_about_error"
+               android:textAppearance="?android:attr/textAppearanceSmall"
+                />
+       
+    <ScrollView 
+        android:id="@+id/details_scroll"
+        android:visibility="gone" 
+       android:padding="20dp"
+        android:layout_width="match_parent"
+        android:layout_height="0dp"
+        android:layout_weight="1"
+        >
+        
+               <LinearLayout 
+               android:id="@+id/details_view"
+               android:layout_width="wrap_content"
+               android:layout_height="wrap_content"
+               android:gravity="left"
+               android:orientation="vertical" >
+                       
+                   <TextView
+                       android:id="@+id/null_cert"
+                       android:layout_width="wrap_content"
+                       android:layout_height="wrap_content"
+                       android:layout_gravity="left"
+                       android:paddingLeft="20dp"
+                       android:text="@string/ssl_validator_null_cert"
+                       android:textAppearance="?android:attr/textAppearanceSmall" />
+
+                               <TextView
+                               android:id="@+id/label_subject"
+                               android:layout_width="wrap_content"
+                               android:layout_height="wrap_content"
+                                       android:paddingBottom="5dp"
+                               android:text="@string/ssl_validator_label_subject"
+                               android:textAppearance="?android:attr/textAppearanceMedium"
+                       />
+                               
+                               <TextView
+                                   android:id="@+id/label_subject_CN"
+                                   android:layout_width="wrap_content"
+                                   android:layout_height="wrap_content"
+                                   android:text="@string/ssl_validator_label_CN"
+                                   android:textAppearance="?android:attr/textAppearanceSmall"
+                               />
+                           
+                               <TextView
+                                   android:id="@+id/value_subject_CN"
+                                   android:layout_width="wrap_content"
+                                   android:layout_height="wrap_content"
+                                   android:paddingBottom="5dp"
+                                   android:text=""
+                                   android:textAppearance="?android:attr/textAppearanceSmall"
+                               />
+                               
+                               <TextView
+                                   android:id="@+id/label_subject_O"
+                                   android:layout_width="wrap_content"
+                                   android:layout_height="wrap_content"
+                                   android:text="@string/ssl_validator_label_O"
+                                   android:textAppearance="?android:attr/textAppearanceSmall"
+                               />
+                           
+                               <TextView
+                                   android:id="@+id/value_subject_O"
+                                   android:layout_width="wrap_content"
+                                   android:layout_height="wrap_content"
+                                   android:paddingBottom="5dp"
+                                   android:text=""
+                                   android:textAppearance="?android:attr/textAppearanceSmall"
+                               />
+                               
+                               <TextView
+                                   android:id="@+id/label_subject_OU"
+                                   android:layout_width="wrap_content"
+                                   android:layout_height="wrap_content"
+                                   android:text="@string/ssl_validator_label_OU"
+                                   android:textAppearance="?android:attr/textAppearanceSmall"
+                               />
+                           
+                               <TextView
+                                   android:id="@+id/value_subject_OU"
+                                   android:layout_width="wrap_content"
+                                   android:layout_height="wrap_content"
+                                   android:paddingBottom="5dp"
+                                   android:text=""
+                                   android:textAppearance="?android:attr/textAppearanceSmall"
+                               />
+                               
+                               <TextView
+                                   android:id="@+id/label_subject_ST"
+                                   android:layout_width="wrap_content"
+                                   android:layout_height="wrap_content"
+                                   android:text="@string/ssl_validator_label_ST"
+                                   android:textAppearance="?android:attr/textAppearanceSmall"
+                               />
+                           
+                               <TextView
+                                   android:id="@+id/value_subject_ST"
+                                   android:layout_width="wrap_content"
+                                   android:layout_height="wrap_content"
+                                   android:paddingBottom="5dp"
+                                   android:text=""
+                                   android:textAppearance="?android:attr/textAppearanceSmall"
+                               />
+
+                               <TextView
+                                   android:id="@+id/label_subject_C"
+                                   android:layout_width="wrap_content"
+                                   android:layout_height="wrap_content"
+                                   android:text="@string/ssl_validator_label_C"
+                                   android:textAppearance="?android:attr/textAppearanceSmall"
+                               />
+                               
+                               <TextView
+                                   android:id="@+id/value_subject_C"
+                                   android:layout_width="wrap_content"
+                                   android:layout_height="wrap_content"
+                                   android:paddingBottom="5dp"
+                                   android:text=""
+                                   android:textAppearance="?android:attr/textAppearanceSmall"
+                               />
+                               
+                               <TextView
+                                   android:id="@+id/label_subject_L"
+                                   android:layout_width="wrap_content"
+                                   android:layout_height="wrap_content"
+                                   android:text="@string/ssl_validator_label_L"
+                                   android:textAppearance="?android:attr/textAppearanceSmall"
+                               />
+                           
+                               <TextView
+                                   android:id="@+id/value_subject_L"
+                                   android:layout_width="wrap_content"
+                                   android:layout_height="wrap_content"
+                                   android:paddingBottom="5dp"
+                                   android:text=""
+                                   android:textAppearance="?android:attr/textAppearanceSmall"
+                               />
+                           
+
+                               <TextView
+                               android:id="@+id/label_issuer"
+                               android:layout_width="wrap_content"
+                               android:layout_height="wrap_content"
+                                       android:paddingBottom="5dp"
+                               android:text="@string/ssl_validator_label_issuer"
+                               android:textAppearance="?android:attr/textAppearanceMedium"
+                       />
+                               
+                               <TextView
+                                   android:id="@+id/label_issuer_CN"
+                                   android:layout_width="wrap_content"
+                                   android:layout_height="wrap_content"
+                                   android:text="@string/ssl_validator_label_CN"
+                                   android:textAppearance="?android:attr/textAppearanceSmall"
+                               />
+                           
+                               <TextView
+                                   android:id="@+id/value_issuer_CN"
+                                   android:layout_width="wrap_content"
+                                   android:layout_height="wrap_content"
+                                   android:paddingBottom="5dp"
+                                   android:text=""
+                                   android:textAppearance="?android:attr/textAppearanceSmall"
+                               />
+                               
+                               <TextView
+                                   android:id="@+id/label_issuer_O"
+                                   android:layout_width="wrap_content"
+                                   android:layout_height="wrap_content"
+                                   android:text="@string/ssl_validator_label_O"
+                                   android:textAppearance="?android:attr/textAppearanceSmall"
+                               />
+                           
+                               <TextView
+                                   android:id="@+id/value_issuer_O"
+                                   android:layout_width="wrap_content"
+                                   android:layout_height="wrap_content"
+                                   android:paddingBottom="5dp"
+                                   android:text=""
+                                   android:textAppearance="?android:attr/textAppearanceSmall"
+                               />
+                               
+                               <TextView
+                                   android:id="@+id/label_issuer_OU"
+                                   android:layout_width="wrap_content"
+                                   android:layout_height="wrap_content"
+                                   android:text="@string/ssl_validator_label_OU"
+                                   android:textAppearance="?android:attr/textAppearanceSmall"
+                               />
+                           
+                               <TextView
+                                   android:id="@+id/value_issuer_OU"
+                                   android:layout_width="wrap_content"
+                                   android:layout_height="wrap_content"
+                                   android:paddingBottom="5dp"
+                                   android:text=""
+                                   android:textAppearance="?android:attr/textAppearanceSmall"
+                               />
+                               
+                               <TextView
+                                   android:id="@+id/label_issuer_ST"
+                                   android:layout_width="wrap_content"
+                                   android:layout_height="wrap_content"
+                                   android:text="@string/ssl_validator_label_ST"
+                                   android:textAppearance="?android:attr/textAppearanceSmall"
+                               />
+                           
+                               <TextView
+                                   android:id="@+id/value_issuer_ST"
+                                   android:layout_width="wrap_content"
+                                   android:layout_height="wrap_content"
+                                   android:paddingBottom="5dp"
+                                   android:text=""
+                                   android:textAppearance="?android:attr/textAppearanceSmall"
+                               />
+
+                               <TextView
+                                   android:id="@+id/label_issuer_C"
+                                   android:layout_width="wrap_content"
+                                   android:layout_height="wrap_content"
+                                   android:text="@string/ssl_validator_label_C"
+                                   android:textAppearance="?android:attr/textAppearanceSmall"
+                               />
+                               
+                               <TextView
+                                   android:id="@+id/value_issuer_C"
+                                   android:layout_width="wrap_content"
+                                   android:layout_height="wrap_content"
+                                   android:paddingBottom="5dp"
+                                   android:text=""
+                                   android:textAppearance="?android:attr/textAppearanceSmall"
+                               />
+                               
+                               <TextView
+                                   android:id="@+id/label_issuer_L"
+                                   android:layout_width="wrap_content"
+                                   android:layout_height="wrap_content"
+                                   android:text="@string/ssl_validator_label_L"
+                                   android:textAppearance="?android:attr/textAppearanceSmall"
+                               />
+                           
+                               <TextView
+                                   android:id="@+id/value_issuer_L"
+                                   android:layout_width="wrap_content"
+                                   android:layout_height="wrap_content"
+                                   android:paddingBottom="5dp"
+                                   android:text=""
+                                   android:textAppearance="?android:attr/textAppearanceSmall"
+                               />
+                           
+                               <TextView
+                               android:id="@+id/label_validity"
+                               android:layout_width="wrap_content"
+                               android:layout_height="wrap_content"
+                                       android:paddingBottom="5dp"
+                               android:text="@string/ssl_validator_label_validity"
+                               android:textAppearance="?android:attr/textAppearanceMedium"
+                       />
+                               
+                               <TextView
+                                   android:id="@+id/label_validity_from"
+                                   android:layout_width="wrap_content"
+                                   android:layout_height="wrap_content"
+                                   android:text="@string/ssl_validator_label_validity_from"
+                                   android:textAppearance="?android:attr/textAppearanceSmall"
+                               />
+                           
+                               <TextView
+                                   android:id="@+id/value_validity_from"
+                                   android:layout_width="wrap_content"
+                                   android:layout_height="wrap_content"
+                                   android:paddingBottom="5dp"
+                                   android:text=""
+                                   android:textAppearance="?android:attr/textAppearanceSmall"
+                               />
+                               
+                               <TextView
+                                   android:id="@+id/label_validity_to"
+                                   android:layout_width="wrap_content"
+                                   android:layout_height="wrap_content"
+                                   android:text="@string/ssl_validator_label_validity_to"
+                                   android:textAppearance="?android:attr/textAppearanceSmall"
+                               />
+                           
+                               <TextView
+                                   android:id="@+id/value_validity_to"
+                                   android:layout_width="wrap_content"
+                                   android:layout_height="wrap_content"
+                                   android:paddingBottom="5dp"
+                                   android:text=""
+                                   android:textAppearance="?android:attr/textAppearanceSmall"
+                               />
+                               
+
+                               <TextView
+                               android:id="@+id/label_signature"
+                               android:layout_width="wrap_content"
+                               android:layout_height="wrap_content"
+                                       android:paddingBottom="5dp"
+                               android:text="@string/ssl_validator_label_signature"
+                               android:textAppearance="?android:attr/textAppearanceMedium"
+                       />
+                               
+                               <TextView
+                               android:id="@+id/label_signature_algorithm"
+                               android:layout_width="wrap_content"
+                               android:layout_height="wrap_content"
+                               android:text="@string/ssl_validator_label_signature_algorithm"
+                               android:textAppearance="?android:attr/textAppearanceSmall"
+                       />
+                               
+                               <TextView
+                               android:id="@+id/value_signature_algorithm"
+                               android:layout_width="wrap_content"
+                               android:layout_height="wrap_content"
+                                       android:paddingBottom="5dp"
+                               android:text=""
+                               android:textAppearance="?android:attr/textAppearanceSmall"
+                       />
+                                                                                                                                                                                               
+                                                               
+                               <TextView
+                               android:id="@+id/value_signature"
+                               android:layout_width="wrap_content"
+                               android:layout_height="wrap_content"
+                                       android:paddingBottom="5dp"
+                               android:text=""
+                               android:textAppearance="?android:attr/textAppearanceSmall"
+                       />
+                               
+               </LinearLayout>
+               
+    </ScrollView>
+       
+       <TextView
+        android:id="@+id/question"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+               android:layout_weight="0"
+               android:padding="5dp"
+        android:text="@string/ssl_validator_question"
+        android:textAppearance="?android:attr/textAppearanceMedium"
+        >
+    </TextView>
+
+       <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+               android:layout_weight="0"
+        android:gravity="center" >
+
+        <Button
+            android:id="@+id/cancel"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_weight="1"
+            android:text="@string/common_cancel" />
+
+        <Button
+            android:id="@+id/details_btn"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_weight="1"
+            android:text="@string/ssl_validator_btn_details_see" />
+
+        <Button
+            android:id="@+id/ok"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_weight="1"
+            android:text="@string/common_ok" />
+
+    </LinearLayout>
+
+</LinearLayout>
index 9da017b..27204a2 100644 (file)
@@ -79,7 +79,7 @@
         android:layout_width="wrap_content"
         android:layout_height="180dp">
         
-               <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+               <LinearLayout
                android:id="@+id/details_view"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
index 788a0e2..ccfb04b 100644 (file)
     android:layout_height="wrap_content"
     >
     
-    <com.owncloud.android.ui.dialog.SsoWebView
+    <!--  com.owncloud.android.ui.dialog.SsoWebView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
         android:id="@+id/sso_webview"
         android:focusable="true"
         android:focusableInTouchMode="true"
         android:clickable="true"
-        />
+        /-->
 
 </RelativeLayout>
index 64bada0..506f66a 100644 (file)
@@ -7,18 +7,18 @@
   <string name="actionbar_upload_from_apps">محتويات من تطبيقات أخرى</string>
   <string name="actionbar_upload_files">الملفات</string>
   <string name="actionbar_open_with">فتح باستخدام</string>
-  <string name="actionbar_mkdir">إنشاء دليل</string>
+  <string name="actionbar_mkdir">إنشاء مجلد</string>
   <string name="actionbar_settings">إعدادات</string>
   <string name="actionbar_see_details">تفاصيل</string>
   <string name="actionbar_send_file">أرسل</string>
   <string name="prefs_category_general">عام</string>
   <string name="prefs_category_more">المزيد</string>
   <string name="prefs_accounts">حسابات</string>
-  <string name="prefs_manage_accounts">ادارة الحسابات</string>
-  <string name="prefs_pincode">كلمه السر للتطبيق</string>
-  <string name="prefs_pincode_summary">حمايه العميل</string>
+  <string name="prefs_manage_accounts">Ø¥دارة الحسابات</string>
+  <string name="prefs_pincode">كلمة سر التطبيق</string>
+  <string name="prefs_pincode_summary">حماية العميل</string>
   <string name="prefs_instant_upload">تفعيل الرفع الفوري</string>
-  <string name="prefs_instant_upload_summary">رفع الصور الماخوذة عن طريق الكاميرا تلقائياً</string>
+  <string name="prefs_instant_upload_summary">رفع الصور فور التقاطها بالكاميرا </string>
   <string name="prefs_log_title">تفعيل الدخول</string>
   <string name="prefs_log_summary">يستخدم هذا لتسجيل المشاكل</string>
   <string name="prefs_log_title_history">تاريخ الدخول</string>
   <string name="auth_host_url">عنوان الخادم https://…</string>
   <string name="auth_username">إسم المستخدم</string>
   <string name="auth_password">كلمة السر</string>
-  <string name="auth_register">جدÙ\8aد Ù\84Ù\80 %1$s ؟</string>
+  <string name="auth_register">جدÙ\8aد Ù\81Ù\8a %1$s ؟</string>
   <string name="sync_string_files">الملفات</string>
   <string name="setup_btn_connect">اتصال</string>
-  <string name="uploader_btn_upload_text">إرÙ\81ع</string>
-  <string name="uploader_top_message">اختر مجلد الرفع:</string>
+  <string name="uploader_btn_upload_text">رفع</string>
+  <string name="uploader_top_message">اختر مجلد الرفع :</string>
   <string name="uploader_wrn_no_account_title">لم يتم العثور على أي حساب</string>
-  <string name="uploader_wrn_no_account_text">لا يوجد جسابات للـ %1$s في جهازك. يرجى إعداد حساب أولاَ.</string>
-  <string name="uploader_wrn_no_account_setup_btn_text">إعداد</string>
+  <string name="uploader_wrn_no_account_text">لا توجد حسابات  %1$s على جهازك. يرجى تهيئة حساب أولاً.</string>
+  <string name="uploader_wrn_no_account_setup_btn_text">تÙ\87Ù\8aئة</string>
   <string name="uploader_wrn_no_account_quit_btn_text">خروج</string>
-  <string name="uploader_wrn_no_content_title">Ù\84ا Ù\8aÙ\88جد Ù\85حتÙ\88Ù\8aات للرفع</string>
-  <string name="uploader_wrn_no_content_text">Ù\84Ù\85 Ù\8aتÙ\85 Ø§Ø³ØªÙ\84اÙ\85 Ø£Ù\8a Ù\85حتÙ\88Ù\8aات.</string>
-  <string name="uploader_error_forbidden_content">%1$s  ØºÙ\8aر Ù\85سÙ\85Ù\88Ø­ Ù\84Ù\87 Ø¨Ø§Ù\84Ù\88صÙ\88Ù\84 Ù\84Ù\84Ù\85حتÙ\88Ù\89 Ø§Ù\84Ù\85شترك</string>
+  <string name="uploader_wrn_no_content_title">Ù\84ا Ù\8aÙ\88جد Ù\85حتÙ\88Ù\89 للرفع</string>
+  <string name="uploader_wrn_no_content_text">Ù\84Ù\85 Ù\8aتÙ\85 Ø§Ø³ØªÙ\84اÙ\85 Ø£Ù\8a Ù\85حتÙ\88Ù\89. Ù\84ا Ø´Ù\8aØ¡ Ù\84Ù\84رÙ\81ع.</string>
+  <string name="uploader_error_forbidden_content">%1$s  ØºÙ\8aر Ù\85سÙ\85Ù\88Ø­ Ù\84Ù\87 Ø¨Ø§Ù\84Ù\88صÙ\88Ù\84 Ù\84Ù\84Ù\85حتÙ\88Ù\89 Ø§Ù\84Ù\85شارك</string>
   <string name="uploader_info_uploading">يتم الرفع</string>
-  <string name="file_list_empty">لا يوجد ملفات في هذا المجلد.\nيمكن انشاء ملف جديد عن طريق خيارات قائمة \"رفع\". </string>
+  <string name="file_list_empty">لا توجد ملفات في هذا المجلد.\nيمكن إنشاء ملف جديد  باختيار \"رفع\" القائمة.</string>
   <string name="filedetails_select_file">اضغظ على الملف ليتم عرض خيارات أكثر</string>
-  <string name="filedetails_size">الحجم:</string>
-  <string name="filedetails_type">النوع:</string>
-  <string name="filedetails_created">انشئ:</string>
-  <string name="filedetails_modified">عُدل:</string>
-  <string name="filedetails_download">اÙ\86زال</string>
-  <string name="filedetails_sync_file">تحديث ملف</string>
+  <string name="filedetails_size">الحجم :</string>
+  <string name="filedetails_type">النوع :</string>
+  <string name="filedetails_created">انشئ في :</string>
+  <string name="filedetails_modified">عُدل في :</string>
+  <string name="filedetails_download">تحÙ\85Ù\8aل</string>
+  <string name="filedetails_sync_file">تحديث الملف</string>
   <string name="filedetails_renamed_in_upload_msg">تم تغيير اسم الملف إلى  %1$s أثناء الرفع</string>
   <string name="action_share_file">شارك الرابط</string>
   <string name="action_unshare_file">الغاء مشاركة الرابط</string>
   <string name="common_yes">نعم</string>
   <string name="common_no">لا</string>
   <string name="common_ok">تم</string>
-  <string name="common_cancel_download">إلغاء تحميل</string>
-  <string name="common_cancel_upload">Ø¥Ù\84غاء Ø±Ù\81ع Ø§Ù\84Ù\85Ù\84Ù\81ات</string>
-  <string name="common_cancel">الغاء</string>
-  <string name="common_save_exit">احÙ\81ظ &amp; خروج</string>
+  <string name="common_cancel_download">Ø¥Ù\84غاء Ø§Ù\84تحÙ\85Ù\8aÙ\84</string>
+  <string name="common_cancel_upload">Ø¥Ù\84غاء Ø§Ù\84رÙ\81ع</string>
+  <string name="common_cancel">Ø¥لغاء</string>
+  <string name="common_save_exit">Ø­Ù\81ظ + خروج</string>
   <string name="common_error">خطأ</string>
   <string name="common_loading">تحميل ...</string>
-  <string name="common_error_unknown">حدث Ø®Ø·Ø£ ØºÙ\8aر Ù\85عرÙ\88Ù\81. </string>
+  <string name="common_error_unknown">خطأ غير معروف. </string>
   <string name="about_title">حول</string>
   <string name="change_password">عدل كلمة السر</string>
   <string name="delete_account">حذف الحساب</string>
   <string name="create_account">حساب جديد</string>
-  <string name="upload_chooser_title">رÙ\81ع Ù\85Ù\86</string>
+  <string name="upload_chooser_title">اÙ\84رÙ\81ع Ù\85Ù\86 ...</string>
   <string name="uploader_info_dirname">اسم المجلد</string>
   <string name="uploader_upload_in_progress_ticker">يتم الرفع ...</string>
   <string name="uploader_upload_in_progress_content">%1$d%% رفع %2$s</string>
   <string name="uploader_upload_succeeded_ticker">تم الرفع بنجاح</string>
   <string name="uploader_upload_succeeded_content_single">تم رفع %1$s  بنجاح </string>
-  <string name="uploader_upload_failed_ticker">عملية الرفع فشلت</string>
-  <string name="uploader_upload_failed_content_single">رفع %1$s قد لا يكون كاملاً</string>
-  <string name="downloader_download_in_progress_ticker">يتم التحميل</string>
-  <string name="downloader_download_in_progress_content">%1$d%% تنزيل  %2$s</string>
+  <string name="uploader_upload_failed_ticker">فشل الرفع</string>
+  <string name="uploader_upload_failed_content_single">لم يكتمل رفع  %1$s </string>
+  <string name="downloader_download_in_progress_ticker">يتم التحميل ...</string>
+  <string name="downloader_download_in_progress_content">%1$d%% تحميل  %2$s</string>
   <string name="downloader_download_succeeded_ticker">تم التحميل بنجاح</string>
   <string name="downloader_download_succeeded_content">تم تحميل %1$s  بنجاح </string>
   <string name="downloader_download_failed_ticker">فشل التحميل</string>
-  <string name="downloader_download_failed_content"> تحميل %1$s قد لا يكون كاملاَ</string>
+  <string name="downloader_download_failed_content"> لم يكتمل تحميل %1$s</string>
   <string name="downloader_not_downloaded_yet">لم يتم تحميلها بعد</string>
-  <string name="common_choose_account">اختر حساب</string>
-  <string name="sync_fail_ticker">فشل في المزامنة</string>
-  <string name="sync_fail_content">تعذر إكمال التزامن لـ %1$s  </string>
+  <string name="common_choose_account">اختر حسابا</string>
+  <string name="sync_fail_ticker">فشلت المزامنة.</string>
+  <string name="sync_fail_content">لم تكتمل مزامنة %1$s  </string>
   <string name="sync_fail_content_unauthorized">كلمة السر غير صالحة لـ %1$s</string>
-  <string name="sync_conflicts_in_favourites_ticker">يوجد تعارض</string>
-  <string name="sync_fail_in_favourites_content"> جهات الاتصال لـ %1$d لا يمكن مزامنتها ( %2$d تعارض) </string>
+  <string name="sync_conflicts_in_favourites_ticker">هناك تعارض</string>
+  <string name="sync_conflicts_in_favourites_content">لم تنجح المزامنة الدائمة لـ %1$d ملفات</string>
+  <string name="sync_fail_in_favourites_ticker">لم تنجح المزامنة التلقائية للملفات</string>
+  <string name="sync_fail_in_favourites_content"> لا يمكن مزامنة جهات اتصال %1$d  ( %2$d تعارض) </string>
+  <string name="sync_foreign_files_forgotten_ticker">تم نسيان بعض الملفات المحلية</string>
+  <string name="sync_foreign_files_forgotten_content">لم ينجح نقل %1$d ملفات إلى المجلد  %2$s</string>
+  <string name="sync_foreign_files_forgotten_explanation">اعتبارا من اﻹصدار 1.3.16, الملفات المرفوعة من هذا الجهاز يتم نسخها إلى المجلد المحلي %1$s تفاديا لفقدان البيانات حينما تتم مزامنة ملف واحد مع عدة حسابات.\n\nنظرا لهذا التغيير، تم نسخ كل الملفات المرفوعة في اﻹصدارات السابقة إلى المجلد %2$s. لكن خطأً ما حال دون إتمام العملية أثناء مزامنة الحسابات. يمكنك إما ترك هذه الملفات و حذف الرابط إلى %3$s، و إما نقل الملفات إلى المجلد %1$s و الاحتفاظ بالرابط إلى %4$s \n\nفيما يلي الملفات المحلية، و المفات الخارجية المرتبطة بها في %5$s</string>
   <string name="sync_current_folder_was_removed">لا يوجد مجلد %1$s بعد الان</string>
   <string name="foreign_files_move">نقل الكل</string>
   <string name="foreign_files_success">تم نقل جميع الملفات</string>
-  <string name="foreign_files_fail">بعض الملفات لا يمكن نقلها</string>
-  <string name="foreign_files_local_text">محلي:%1$s</string>
-  <string name="upload_query_move_foreign_files">لا يوجد مساحة كافية لنسخ الملفات المحددة لمجلد  %1$s . هل ترغب بنقلهم للمجلد بدلاَ من ذلك؟</string>
-  <string name="pincode_enter_pin_code">فضلا, ادخل كلمة السر</string>
-  <string name="pincode_configure_your_pin">فضلا, ادخل كلمة السر</string>
+  <string name="foreign_files_fail">لم ينجح نقل بعض الملفات</string>
+  <string name="foreign_files_local_text">محلي :%1$s</string>
+  <string name="foreign_files_remote_text">خارجي : %1$s</string>
+  <string name="upload_query_move_foreign_files">لا يوجد مساحة كافية لنسخ الملفات المحددة إلى مجلد  %1$s . هل ترغب بنقلها بدلاَ من ذلك؟</string>
+  <string name="pincode_enter_pin_code">يرجى إدخال كلمة السر</string>
+  <string name="pincode_configure_your_pin">أدخل كلمة السر</string>
   <string name="pincode_configure_your_pin_explanation">سيتم طلب PIN في كل مرة يتم فيها تشغيل التطبيق</string>
-  <string name="pincode_reenter_your_pincode">Ù\81ضÙ\84ا, Ø§Ø¯Ø®Ù\84 Ù\83Ù\84Ù\85Ø© Ø§Ù\84سر Ù\85رÙ\87 Ø§Ø®Ø±Ù\8a</string>
-  <string name="pincode_remove_your_pincode">ازاÙ\84Ù\87 كلمة السر</string>
-  <string name="pincode_mismatch">Ù\83Ù\84Ù\85ات Ø§Ù\84سر ØºÙ\8aر Ù\85تطابÙ\82Ù\87</string>
-  <string name="pincode_wrong">كلمه السر غير صحيحه</string>
-  <string name="pincode_removed">تم ازاله كلمه السر</string>
-  <string name="pincode_stored">تم تسجيل كلمه السر</string>
-  <string name="media_notif_ticker">%1$s مشغل الموسيقى</string>
-  <string name="media_state_playing">%1$s  (عرض)</string>
-  <string name="media_state_loading">%1$s (تحميل)</string>
-  <string name="media_event_done">تÙ\85 Ø§Ù\84اÙ\86تÙ\87اء Ù\85Ù\86 تشغيل %1$s </string>
+  <string name="pincode_reenter_your_pincode">Ù\8aرجÙ\89 Ø¥Ø¯Ø®Ø§Ù\84 Ù\83Ù\84Ù\85Ø© Ø§Ù\84سر Ù\85رة Ø£Ø®Ø±Ù\89</string>
+  <string name="pincode_remove_your_pincode">إزاÙ\84Ø© كلمة السر</string>
+  <string name="pincode_mismatch">Ù\83Ù\84Ù\85تا Ø§Ù\84سر ØºÙ\8aر Ù\85تطابÙ\82تÙ\8aÙ\86</string>
+  <string name="pincode_wrong">كلمه السر غير صحيحة</string>
+  <string name="pincode_removed">تمت إزالة كلمه السر</string>
+  <string name="pincode_stored">تم تسجيل كلمت السر</string>
+  <string name="media_notif_ticker">مشغل الموسيقى %1$s </string>
+  <string name="media_state_playing">%1$s  (يتم التشغيل)</string>
+  <string name="media_state_loading">%1$s (يتم التحميل)</string>
+  <string name="media_event_done">اÙ\86تÙ\87Ù\89 تشغيل %1$s </string>
   <string name="media_err_nothing_to_play">لا يوجد ملف وسائط</string>
-  <string name="media_err_no_account">Ù\84Ù\85 Ù\8aتÙ\85 ØªÙ\82دÙ\8aÙ\85 Ø§ي حساب</string>
-  <string name="media_err_not_in_owncloud">الملف ليس في حساب فعال</string>
-  <string name="media_err_unsupported">ترÙ\85Ù\8aز ØºÙ\8aر Ù\85دعÙ\88م</string>
+  <string name="media_err_no_account">Ù\84Ù\85 Ù\8aتÙ\85 ØªÙ\82دÙ\8aÙ\85 Ø£ي حساب</string>
+  <string name="media_err_not_in_owncloud">الملف ليس في حساب صحيح</string>
+  <string name="media_err_unsupported">ترÙ\85Ù\8aز ØºÙ\8aر Ù\85دعÙ\91م</string>
   <string name="media_err_io">لا يمكن قراءة ملف الوسائط</string>
-  <string name="media_err_malformed">لم يتم فك ترميز ملف الوسائط بشكل صحيح</string>
+  <string name="media_err_malformed">الملف غير مرمز بشكل صحيح</string>
   <string name="media_err_timeout">انتهت المهلة أثناء محاولة العرض</string>
+  <string name="media_err_invalid_progressive_playback">لا يمكن بث ملف الوسائط</string>
   <string name="media_err_unknown">لا يمكن عرض ملف الوسائط مع عارض الوسائط المستعمل</string>
   <string name="media_err_security_ex">خطا امني اثناء محاولة عرض %1$s</string>
   <string name="media_err_io_ex">خطا في المدخلات اثناء محاولة عرض %1$s</string>
   <string name="media_err_unexpected">خطا غير متوقع اثناء محاولة عرض %1$s</string>
+  <string name="media_rewind_description">زر الترجيع</string>
+  <string name="media_play_pause_description">زر التشغيل أو الإيقاف</string>
+  <string name="media_forward_description">زر التقدم للأمام</string>
   <string name="auth_trying_to_login">محاولة الدخول ...</string>
   <string name="auth_no_net_conn_title">لا يتوفر اتصال</string>
   <string name="auth_nossl_plain_ok_title">الاتصال الآمن غير متاح</string>
-  <string name="auth_connection_established">يتم إنشاء الاتصال</string>
+  <string name="auth_connection_established">تم الاتصال</string>
   <string name="auth_testing_connection">اختبار الاتصال ...</string>
-  <string name="auth_not_configured_title">اعدادات Ø§Ù\84خاد ØªØ§Ù\84Ù\81Ø© </string>
+  <string name="auth_not_configured_title">إعداد Ø§Ù\84خادÙ\85 ØºÙ\8aر ØµØ­Ù\8aحة</string>
   <string name="auth_account_not_new">الحساب لنفس المستخدم والخادم موجود مسبقا على الجهاز </string>
   <string name="auth_account_not_the_same">المستخدم المدخل لا يتوافق مع المستخدم الموجود في الحساب </string>
-  <string name="auth_unknown_error_title">حدث خطأ غير معروف!</string>
+  <string name="auth_unknown_error_title">حدث خطأ غير معروف !</string>
   <string name="auth_unknown_host_title">فشل في العثور على المضيف</string>
-  <string name="auth_incorrect_path_title">تعذر إيجاد جهة الاتصال للسيرفر.</string>
-  <string name="auth_timeout_title">الخادم اخذ الكثير من الوقت للرد</string>
-  <string name="auth_incorrect_address_title">رابط تالف</string>
-  <string name="auth_ssl_general_error_title">فشل في انشاء SSL</string>
-  <string name="auth_bad_oc_version_title">لم يتم التعرف على اصدار الخادم</string>
-  <string name="auth_wrong_connection_title">لا يمكن إنشاء اتصال</string>
-  <string name="auth_secure_connection">تم إنشاء اتصال آمن</string>
-  <string name="auth_unauthorized">خطا في الاسم او كلمة المرور</string>
+  <string name="auth_incorrect_path_title">لم يتم إيجاد الخادم</string>
+  <string name="auth_timeout_title">الخادم أخذ كثيرا من الوقت للرد</string>
+  <string name="auth_incorrect_address_title">رابط غير سليم</string>
+  <string name="auth_ssl_general_error_title">فشل في تهيئة SSL</string>
+  <string name="auth_ssl_unverified_server_title">لا يمكن التحقق من هوية خادم SSL</string>
+  <string name="auth_bad_oc_version_title">إصدار الخادم غير معروف</string>
+  <string name="auth_wrong_connection_title">لم ينجح الاتصال</string>
+  <string name="auth_secure_connection">نجح الاتصال آمن</string>
+  <string name="auth_unauthorized">اسم المستخدم أو كلمة المرور خاطئة</string>
   <string name="auth_oauth_error">فشل في التحقق</string>
   <string name="auth_oauth_error_access_denied">تم رفض الوصول من قبل الخادم المرخص</string>
   <string name="auth_wtf_reenter_URL">حالة غير متوقعة: الرجاء, ادخال عنوان الخادم مرة اخرى</string>
   <string name="auth_connecting_auth_server">يتم الاتصال بالخادم للتحقق</string>
   <string name="auth_unsupported_auth_method">الخادم لا يدعم طريقة التحقق هذه</string>
   <string name="auth_unsupported_multiaccount">%1$s لا يدعم الحسابات المتعددة </string>
-  <string name="fd_keep_in_sync">اجعل الملف محدث</string>
-  <string name="common_rename">إعادة تسميه</string>
-  <string name="common_remove">الغى</string>
+  <string name="auth_fail_get_user_name">الخادم لا يجيب بمعرف صحيح للمستخدم، الرجاء الاتصال بالمدير</string>
+  <string name="fd_keep_in_sync"> جعل الملف محدثا</string>
+  <string name="common_rename">إعادة التسمية</string>
+  <string name="common_remove">حذف</string>
   <string name="confirmation_remove_alert">هل تود حقاَ إزالة %1$s ؟ </string>
-  <string name="confirmation_remove_folder_alert">هل ترغب في إزالة %1$s و جهات الاتصال التابعة له؟ </string>
-  <string name="confirmation_remove_local">محلي فقط</string>
+  <string name="confirmation_remove_folder_alert">هل ترغب حقا في إزالة %1$s و محتوياته ؟</string>
+  <string name="confirmation_remove_local">محليا فقط</string>
   <string name="confirmation_remove_folder_local">المحتويات المحلية فقط</string>
-  <string name="confirmation_remove_remote">حذف من الخادم</string>
-  <string name="confirmation_remove_remote_and_local">شبكي و محلي</string>
-  <string name="remove_success_msg">يتم الحذف بنجاح</string>
-  <string name="remove_fail_msg">Ù\84Ù\82د Ù\81Ø´Ù\84 Ø§Ù\84حذÙ\81</string>
+  <string name="confirmation_remove_remote">اÙ\84حذÙ\81 Ù\85Ù\86 Ø§Ù\84خادÙ\85</string>
+  <string name="confirmation_remove_remote_and_local">محليا و عن بعد</string>
+  <string name="remove_success_msg">تم الحذف بنجاح</string>
+  <string name="remove_fail_msg">فشل الحذف</string>
   <string name="rename_dialog_title">أدخل اسما جديدا</string>
-  <string name="rename_local_fail_msg">لايمكن اعادة تسمية النسخ المحلي  ,حاول باسم آخر </string>
-  <string name="rename_server_fail_msg">اعادة التسمية لم تكتمل</string>
-  <string name="sync_file_nothing_to_do_msg">محتويات الملفات متزامنة سابقا</string>
-  <string name="create_dir_fail_msg">لم يتمكن من انشاء المجلد</string>
+  <string name="rename_local_fail_msg">لم تنجح إعادة تسمية النسخة المحلية، جرب اسما آخر</string>
+  <string name="rename_server_fail_msg">لم تكتمل إعادة التسمية</string>
+  <string name="sync_file_fail_msg">لا يمكن التحقق من الملف الخارجي</string>
+  <string name="sync_file_nothing_to_do_msg">تمت  مزامنة محتويات الملفات من قبل</string>
+  <string name="create_dir_fail_msg">لم ينجح إنشاء المجلد</string>
   <string name="filename_forbidden_characters">رموز ممنوعة: / \\ &lt; &gt; : \" | ? *</string>
-  <string name="wait_a_moment">فضلاً, انتظر</string>
-  <string name="filedisplay_unexpected_bad_get_content">خطا ØºÙ\8aر Ù\85تÙ\88Ù\82ع : Ø§Ù\84رجاء Ø§Ø®ØªÙ\8aار Ø§Ù\84Ù\85Ù\84Ù\81 Ù\85Ù\86 Ø¨Ø±Ù\86اÙ\85ج آخر</string>
+  <string name="wait_a_moment">انتظر للحظة</string>
+  <string name="filedisplay_unexpected_bad_get_content">خطا ØºÙ\8aر Ù\85تÙ\88Ù\82ع : Ø§Ù\84رجاء Ø§Ø®ØªÙ\8aار Ø§Ù\84Ù\85Ù\84Ù\81 Ù\85Ù\86 ØªØ·Ø¨Ù\8aÙ\82 آخر</string>
   <string name="filedisplay_no_file_selected">لم يتم اختيار أي ملف</string>
   <string name="activity_chooser_title">ارسل الرابط الى ...</string>
   <string name="oauth_check_onoff">تسجيل الدخول باستخدام oAuth2</string>
   <string name="oauth_login_connection">الاتصال مع خادم oAuth2</string>
-  <string name="ssl_validator_header">تعذر التحقق من هوية الموقع</string>
+  <string name="ssl_validator_header">لا يمكن التحقق من هوية الموقع</string>
   <string name="ssl_validator_reason_cert_not_trusted">شهادة الخادم غير موثوقة</string>
-  <string name="ssl_validator_reason_cert_expired">شهادة الخادم منتهية</string>
-  <string name="ssl_validator_reason_cert_not_yet_valid">تاريخ صلاحية شهادة الخادم في المستقبل</string>
-  <string name="ssl_validator_reason_hostname_not_verified">هذه الوصله غير متطابقه مع السيرفر فى  شهاده الحمايه </string>
-  <string name="ssl_validator_question">Ù\87Ù\84 ØªØ±Ù\8aد Ø§ن تثق في هذه الشهادة على اي حال ؟</string>
-  <string name="ssl_validator_not_saved">لم يتمكن من حفظ الشهادة </string>
+  <string name="ssl_validator_reason_cert_expired">شهادة الخادم منتهية الصلاحية</string>
+  <string name="ssl_validator_reason_cert_not_yet_valid">وقت صلاحية شهادة الخادم لم يحن بعد</string>
+  <string name="ssl_validator_reason_hostname_not_verified">الرابط لا يوافق اسم المضيف فى  شهاده الحماية </string>
+  <string name="ssl_validator_question">Ù\87Ù\84 ØªØ±Ù\8aد Ø£ن تثق في هذه الشهادة على اي حال ؟</string>
+  <string name="ssl_validator_not_saved">لم ينجح حفظ الشهادة </string>
   <string name="ssl_validator_btn_details_see">تفاصيل</string>
   <string name="ssl_validator_btn_details_hide">إخفاء</string>
-  <string name="ssl_validator_label_subject">أصدرت ل:</string>
-  <string name="ssl_validator_label_CN">الاسم الشائع:</string>
-  <string name="ssl_validator_label_O">منظمة:</string>
-  <string name="ssl_validator_label_OU">الوحدة التنظيمية:</string>
-  <string name="ssl_validator_label_C">البلد:</string>
-  <string name="ssl_validator_label_ST">حالة:</string>
-  <string name="ssl_validator_label_L">المكان:</string>
-  <string name="ssl_validator_label_validity_from">من:</string>
-  <string name="ssl_validator_label_validity_to">إلى:</string>
-  <string name="ssl_validator_label_signature">التوقيع:</string>
-  <string name="ssl_validator_label_signature_algorithm">الخوارزمية:</string>
+  <string name="ssl_validator_label_subject">أصدرت لـ :</string>
+  <string name="ssl_validator_label_issuer">أصدرت بواسطة</string>
+  <string name="ssl_validator_label_CN">الاسم الشائع :</string>
+  <string name="ssl_validator_label_O">منظمة :</string>
+  <string name="ssl_validator_label_OU">الوحدة التنظيمية :</string>
+  <string name="ssl_validator_label_C">البلد :</string>
+  <string name="ssl_validator_label_ST">الحالة :</string>
+  <string name="ssl_validator_label_L">المكان :</string>
+  <string name="ssl_validator_label_validity">الصلاحية :</string>
+  <string name="ssl_validator_label_validity_from">من :</string>
+  <string name="ssl_validator_label_validity_to">إلى :</string>
+  <string name="ssl_validator_label_signature">التوقيع :</string>
+  <string name="ssl_validator_label_signature_algorithm">الخوارزمية :</string>
+  <string name="ssl_validator_null_cert">لا يمكن إظهار الشهادة</string>
+  <string name="ssl_validator_no_info_about_error">- لا معلومات عن الخطأ.</string>
+  <string name="placeholder_sentence">هذه مساحة محجوزة</string>
+  <string name="placeholder_filename">placeholder.txt</string>
   <string name="placeholder_filetype">صورة PNG</string>
   <string name="placeholder_filesize">389 KB</string>
+  <string name="placeholder_timestamp">2012/05/18 12:23 مساء</string>
   <string name="placeholder_media_time">12:23:45</string>
-  <string name="instant_upload_on_wifi">رفع الصور من خلال الواي فاي فقط</string>
+  <string name="instant_upload_on_wifi">رفع الصور من خلال الـ WiFi فقط</string>
+  <string name="instant_upload_path">/InstantUpload</string>
   <string name="conflict_title">تعارض في التحديث </string>
+  <string name="conflict_message">الملف %s غير </string>
+  <string name="conflict_keep_both">الاحتفاظ بالنسختين</string>
+  <string name="conflict_overwrite">استبدال</string>
   <string name="conflict_dont_upload">عدم الرفع</string>
   <string name="preview_image_description">معاينة الصورة</string>
   <string name="preview_image_error_unknown_format">هذه الصورة لا يمكن أن تظهر</string>
-  <string name="error__upload__local_file_not_copied">%1$s لم يتمكن من النسخ الى %2$s في المجلد المحلي</string>
+  <string name="error__upload__local_file_not_copied">لم ينجح نسخ %1$s  إلى المجلد المحلي %2$s </string>
   <string name="actionbar_failed_instant_upload">فشل في محاولة الرفع الفوري</string>
   <string name="failed_upload_headline_text">فشل في الرفع الفوري</string>
   <string name="failed_upload_headline_hint">ملخص لكل الاخطاء في عملية الرفع الفوري</string>
   <string name="failed_upload_headline_delete_all_btn">حذف كل المختارات من قائمة انتظار الرفع</string>
   <string name="failed_upload_retry_text">اعادة المحاولة لرفع الصورة:</string>
   <string name="failed_upload_load_more_images">تحميل المزيد من الصور</string>
+  <string name="failed_upload_retry_do_nothing_text">do nothing you are not online for instant upload</string>
   <string name="failed_upload_failure_text">رسالة خطا:</string>
   <string name="failed_upload_quota_exceeded_text">الرجاء التاكد من اعدادات الخادم, من الممكن انك تعديت الحد في quota</string>
   <string name="share_link_no_support_share_api">عذرا , المشاركة غير مفعلة في الخادم. الرجاء التواصل مع المدير</string>
   <string name="unshare_link_file_no_exist">غير قادر على إلغاء مشاركة هذا الملف أو المجلد.لا وجود له</string>
   <string name="unshare_link_file_error">حدث خطأ ما أثناء محاولة إلغاء مشاركة هذا الملف أو المجلد</string>
   <string name="activity_chooser_send_file_title">أرسل</string>
+  <string name="copy_link">نسخ الرابط</string>
+  <string name="clipboard_text_copied">تم النسخ للحافظة</string>
 </resources>
index 85c4acc..67d7e29 100644 (file)
   <string name="auth_connecting_auth_server">S\'està connectant a un servidor d\'autenticació...</string>
   <string name="auth_unsupported_auth_method">El serivdor no permet aquest mètode d\'autenticació</string>
   <string name="auth_unsupported_multiaccount">%1$s no permet comptes múltiples</string>
+  <string name="auth_fail_get_user_name">El servidor no retorna una id d\'usuari correcta, contacteu amb l\'administrador.</string>
   <string name="fd_keep_in_sync">Mantén el fitxer actualitzat</string>
   <string name="common_rename">Reanomena</string>
   <string name="common_remove">Elimina</string>
   <string name="ssl_validator_label_validity_to">A:</string>
   <string name="ssl_validator_label_signature">Signatura:</string>
   <string name="ssl_validator_label_signature_algorithm">Algoritme:</string>
+  <string name="ssl_validator_null_cert">No s\'ha pogut mostrar el certificat.</string>
+  <string name="ssl_validator_no_info_about_error">- No hi ha informació de l\'error</string>
   <string name="placeholder_sentence">Això és un text variable</string>
   <string name="placeholder_filename">placeholder.txt</string>
   <string name="placeholder_filetype">Imatge PNG</string>
index 7fae754..31d216b 100644 (file)
@@ -97,6 +97,7 @@
   <string name="sync_fail_in_favourites_content">Indholdet af %1$d filer ikke kunne synkroniseres (%2$d konflikter)</string>
   <string name="sync_foreign_files_forgotten_ticker">Visse lokale filer blev glemt</string>
   <string name="sync_foreign_files_forgotten_content">%1$d filer ud af %2$s mappe kunne ikke kopieres ind i</string>
+  <string name="sync_foreign_files_forgotten_explanation">Fra version 1.3.16 bliver filer uploadet fra denne enhed kopieret til mappen %1$s for at forhindre datatab når en enkelt fil synkroniseres med flere konti.\n\nPå grund af denne ændring er alle filer som var uploadet i tidligere versioner af denne app kopieret til mappen %2$s. Imidlertid forhindrede en fejl færdiggørelsen af denne operation under konto-synkronisering. Du kan enten lade filerne være som de er og fjerne linket til %3$s eller flytte filerne til mappen %1$s og beholde linket til %4$s.\n\nHerunder er en liste med de lokale og eksterne filer i %5$s, som de var knyttet til.</string>
   <string name="sync_current_folder_was_removed">Mappen %1$s eksistere ikke længere</string>
   <string name="foreign_files_move">Flyt alle</string>
   <string name="foreign_files_success">Alle filer blev flyttet</string>
   <string name="auth_connecting_auth_server">Forbinder til godkendelsesserver ...</string>
   <string name="auth_unsupported_auth_method">Serveren understøtter ikke denne godkendelsesmetode</string>
   <string name="auth_unsupported_multiaccount">%1$s understøtter ikke multiple konti</string>
+  <string name="auth_fail_get_user_name">Din server retunere ikke et korrekt bruger-id. Kontakt venligst din administrator</string>
   <string name="fd_keep_in_sync">Hold fil opdateret</string>
   <string name="common_rename">Omdøb</string>
   <string name="common_remove">Fjern</string>
   <string name="ssl_validator_label_validity_to">Til:</string>
   <string name="ssl_validator_label_signature">Signatur:</string>
   <string name="ssl_validator_label_signature_algorithm">Algoritme:</string>
+  <string name="ssl_validator_null_cert">Certifikatet kunne ikke vises.</string>
+  <string name="ssl_validator_no_info_about_error">- Ingen information om fejlen</string>
   <string name="placeholder_sentence">Dette er en pladsholder</string>
   <string name="placeholder_filename">stedfortræder.txt</string>
   <string name="placeholder_filetype">PNG Billede</string>
   <string name="share_link_no_support_share_api">Beklager, deling er ikke slået til på din server. Kontakt venligst din administrator.</string>
   <string name="share_link_file_no_exist">Kan ikke dele denne fil eller mappe. Find venligst ud af om den eksisterer</string>
   <string name="share_link_file_error">Der opstod en fejl ved deling af denne fil eller mappe</string>
+  <string name="unshare_link_file_no_exist">Kan ikke fjerne delingen af denne fil eller mappe. Den findes ikke.</string>
   <string name="unshare_link_file_error">Der opstod en fejl ved stopning af deling af denne mappe.</string>
   <string name="activity_chooser_send_file_title">Send</string>
   <string name="copy_link">Kopier link</string>
index 80410e8..93f4703 100644 (file)
@@ -57,7 +57,7 @@
   <string name="filedetails_sync_file">Datei aktualisieren</string>
   <string name="filedetails_renamed_in_upload_msg">Datei wurde wärend des Uploads zu %1$s umbenannt</string>
   <string name="action_share_file">Link teilen</string>
-  <string name="action_unshare_file">Link nicht mehr freigeben</string>
+  <string name="action_unshare_file">Link nicht mehr teilen</string>
   <string name="common_yes">Ja</string>
   <string name="common_no">Nein</string>
   <string name="common_ok">OK</string>
   <string name="auth_connecting_auth_server">Verbinde mit dem Authentifizierung-Server…</string>
   <string name="auth_unsupported_auth_method">Der Server unterstützt diese Authentifizierung-Methode nicht</string>
   <string name="auth_unsupported_multiaccount">%1$s unterstützt nicht mehrere Benutzerkonten</string>
+  <string name="auth_fail_get_user_name">Ihr Server gibt keine korrekte Benutzer-ID zurück, bitte nehmen Sie Kontakt zu Ihrem Administrator auf.</string>
   <string name="fd_keep_in_sync">Datei aktuell halten</string>
   <string name="common_rename">Umbenennen</string>
   <string name="common_remove">Löschen</string>
   <string name="ssl_validator_label_validity_to">An:</string>
   <string name="ssl_validator_label_signature">Signatur:</string>
   <string name="ssl_validator_label_signature_algorithm">Algorithmus:</string>
+  <string name="ssl_validator_null_cert">Das Zertifikat konnte nicht gezeigt werden.</string>
+  <string name="ssl_validator_no_info_about_error">- Keine Informationen über den Fehler</string>
   <string name="placeholder_sentence">Dies ist ein Platzhalter</string>
   <string name="placeholder_filename">platzhalter.txt</string>
   <string name="placeholder_filetype">PNG Bild</string>
index bda35fa..159be32 100644 (file)
   <string name="auth_connecting_auth_server">Verbinde mit dem Authentifizierung-Server…</string>
   <string name="auth_unsupported_auth_method">Der Server unterstützt diese Authentifizierung-Methode nicht</string>
   <string name="auth_unsupported_multiaccount">%1$s unterstützt nicht mehrere Benutzerkonten</string>
+  <string name="auth_fail_get_user_name">Dein Server gibt keine korrekte Benutzer-ID zurück, bitte nimm Kontakt zu Deinem Administrator auf.</string>
   <string name="fd_keep_in_sync">Datei aktuell halten</string>
   <string name="common_rename">Umbenennen</string>
   <string name="common_remove">Löschen</string>
   <string name="ssl_validator_label_validity_to">Bis:</string>
   <string name="ssl_validator_label_signature">Signatur:</string>
   <string name="ssl_validator_label_signature_algorithm">Algorithmus:</string>
+  <string name="ssl_validator_null_cert">Das Zertifikat konnte nicht gezeigt werden.</string>
+  <string name="ssl_validator_no_info_about_error">- Keine Informationen über den Fehler</string>
   <string name="placeholder_sentence">Dies ist ein Platzhalter</string>
   <string name="placeholder_filename">platzhalter.txt</string>
   <string name="placeholder_filetype">PNG-Bild</string>
index 99fc830..aae7922 100644 (file)
   <string name="auth_connecting_auth_server">Σύνδεση με το διακομιστή πιστοποίησης σε εξέλιξη...</string>
   <string name="auth_unsupported_auth_method">Ο διακομιστής δεν υποστηρίζει αυτή τη μέθοδο πιστοποίησης</string>
   <string name="auth_unsupported_multiaccount">Ο %1$s  δεν υποστηρίζει πολλαπλούς λογαριασμούς</string>
+  <string name="auth_fail_get_user_name">Ο διακομιστής σας δεν επέστρεψε το σωστό id του χρήστη, παρακαλώ επικοινωνήστε με τον διαχειριστή σας</string>
   <string name="fd_keep_in_sync">Διατήρηση αρχείου ενημερωμένo</string>
   <string name="common_rename">Μετονομασία</string>
   <string name="common_remove">Αφαίρεση</string>
   <string name="ssl_validator_label_validity_to">Μέχρι</string>
   <string name="ssl_validator_label_signature">Υπογραφή:</string>
   <string name="ssl_validator_label_signature_algorithm">Αλγόριθμος:</string>
+  <string name="ssl_validator_null_cert">Δεν μπορεί να εμφανιστεί το πιστοποιητικό.</string>
+  <string name="ssl_validator_no_info_about_error">- Καμία πληροφορία σχετικά με το σφάλμα</string>
   <string name="placeholder_sentence">Αυτό είναι ένα σημείο κράτησης θέσης</string>
   <string name="placeholder_filename">placeholder.txt</string>
   <string name="placeholder_filetype">Εικόνα PNG</string>
   <string name="unshare_link_file_no_exist">Ήταν αδύνατη η ακύρωση διαμοιρασμού αυτού του αρχείου ή φακέλου. Δεν υπάρχει.</string>
   <string name="unshare_link_file_error">Ένα σφάλμα προέκυψε κατά τη διάρκεια ακύρωσης διαμοιρασμού αυτού του αρχείου ή φακέλου</string>
   <string name="activity_chooser_send_file_title">Αποστολή</string>
+  <string name="copy_link">Αντιγραφή συνδέσμου</string>
   <string name="clipboard_text_copied">Αντιγραφθηκε στο clipboard</string>
 </resources>
index 75ea736..e40c01d 100644 (file)
   <string name="auth_connecting_auth_server">Connecting to authentication server…</string>
   <string name="auth_unsupported_auth_method">The server does not support this authentication method</string>
   <string name="auth_unsupported_multiaccount">%1$s does not support multiple accounts</string>
+  <string name="auth_fail_get_user_name">Your server is not returning a correct user id, please contact an administrator</string>
   <string name="fd_keep_in_sync">Keep file up to date</string>
   <string name="common_rename">Rename</string>
   <string name="common_remove">Remove</string>
   <string name="ssl_validator_label_validity_to">To:</string>
   <string name="ssl_validator_label_signature">Signature:</string>
   <string name="ssl_validator_label_signature_algorithm">Algorithm:</string>
+  <string name="ssl_validator_null_cert">The certificate could not be shown.</string>
+  <string name="ssl_validator_no_info_about_error">- No information about the error</string>
   <string name="placeholder_sentence">This is a placeholder</string>
   <string name="placeholder_filename">placeholder.txt</string>
   <string name="placeholder_filetype">PNG Image</string>
index cba4cca..4ce6865 100644 (file)
@@ -56,8 +56,8 @@
   <string name="filedetails_download">Descargar</string>
   <string name="filedetails_sync_file">Actualizar archivo</string>
   <string name="filedetails_renamed_in_upload_msg">El fichero fue renombrado como %1$s durante la subida</string>
-  <string name="action_share_file">Enlace compartido</string>
-  <string name="action_unshare_file">Ya no compartir enlace</string>
+  <string name="action_share_file">Compartir</string>
+  <string name="action_unshare_file">Descompartir</string>
   <string name="common_yes">Sí</string>
   <string name="common_no">No</string>
   <string name="common_ok">Aceptar</string>
   <string name="auth_connecting_auth_server">Conectando al servidor de autenticación...</string>
   <string name="auth_unsupported_auth_method">El servidor no soporta este método de autenticación</string>
   <string name="auth_unsupported_multiaccount">%1$s no soporta cuentas múltiples</string>
+  <string name="auth_fail_get_user_name">Su servidor no está retornando una identificación de usuario correcta. Contacte a su administrador.</string>
   <string name="fd_keep_in_sync">Mantener el archivo actualizado</string>
   <string name="common_rename">Renombrar</string>
   <string name="common_remove">Borrar</string>
   <string name="ssl_validator_label_validity_to">A:</string>
   <string name="ssl_validator_label_signature">Firma:</string>
   <string name="ssl_validator_label_signature_algorithm">Algoritmo:</string>
+  <string name="ssl_validator_null_cert">El certifiicado no pudo ser mostrado.</string>
+  <string name="ssl_validator_no_info_about_error">- No hay información acerca del error</string>
   <string name="placeholder_sentence">Esto es un marcador de posición</string>
   <string name="placeholder_filename">marcadordeposición.txt</string>
   <string name="placeholder_filetype">Imagen PNG</string>
index 781f73d..29076c5 100644 (file)
   <string name="media_state_playing">%1$s (toistetaan)</string>
   <string name="media_state_loading">%1$s (ladataan)</string>
   <string name="media_err_nothing_to_play">Mediatiedostoa ei löytynyt</string>
+  <string name="media_err_no_account">Tiliä ei määritetty</string>
+  <string name="media_err_not_in_owncloud">Tiedosto ei ole kelvollisella tilillä</string>
   <string name="media_err_io">Mediatiedoston luku ei onnistunut</string>
   <string name="media_rewind_description">Taaksepäin kelaus -painike</string>
   <string name="media_play_pause_description">Toisto tai keskeytys -painike</string>
   <string name="conflict_keep_both">Säilytä molemmat</string>
   <string name="conflict_overwrite">Korvaa</string>
   <string name="conflict_dont_upload">Älä lähetä</string>
+  <string name="preview_image_description">Kuvan esikatselu</string>
   <string name="preview_image_error_unknown_format">Kuvaa ei voi näyttää</string>
   <string name="failed_upload_all_cb">valitse kaikki</string>
   <string name="failed_upload_headline_retryall_btn">yritä uudelleen kaikkia valittuja</string>
index d633877..9e64652 100644 (file)
   <string name="auth_connecting_auth_server">Connexion au serveur d\'authentification...</string>
   <string name="auth_unsupported_auth_method">Le serveur ne supporte pas cette méthode d\'authentification</string>
   <string name="auth_unsupported_multiaccount">%1$s ne supporte pas les comptes multiples</string>
+  <string name="auth_fail_get_user_name">Votre serveur a retourné un identifiant d\'utilisateur incorrect. Veuillez prendre contact avec votre administrateur</string>
   <string name="fd_keep_in_sync">Maintenir le fichier à jour</string>
   <string name="common_rename">Renommer</string>
   <string name="common_remove">Supprimer</string>
   <string name="ssl_validator_label_validity_to">À :</string>
   <string name="ssl_validator_label_signature">Signature :</string>
   <string name="ssl_validator_label_signature_algorithm">Algorithme :</string>
+  <string name="ssl_validator_null_cert">Impossible d\'afficher le certificat.</string>
+  <string name="ssl_validator_no_info_about_error">- Aucune information sur l\'erreur</string>
   <string name="placeholder_sentence">Ceci est un espace réservé</string>
   <string name="placeholder_filename">placeholder.txt</string>
   <string name="placeholder_filetype">Image PNG</string>
index 7d1e2a0..4bf2b76 100644 (file)
   <string name="auth_connecting_auth_server">Conectando co servidor de autenticación…</string>
   <string name="auth_unsupported_auth_method">O servidor non admite este método de autenticación</string>
   <string name="auth_unsupported_multiaccount">%1$s non admite contas múltipes</string>
+  <string name="auth_fail_get_user_name">O seu servidor non devolveu un ID de usuario correcto, contacte co administrador</string>
   <string name="fd_keep_in_sync">Manter actualizado o ficheiro</string>
   <string name="common_rename">Renomear</string>
   <string name="common_remove">Retirar</string>
   <string name="ssl_validator_label_validity_to">A:</string>
   <string name="ssl_validator_label_signature">Sinatura:</string>
   <string name="ssl_validator_label_signature_algorithm">Algoritmo:</string>
+  <string name="ssl_validator_null_cert">Non é posíbel amosar o certificado.</string>
+  <string name="ssl_validator_no_info_about_error">- Non hai información sobre este erro</string>
   <string name="placeholder_sentence">Isto é un marcador de posición</string>
   <string name="placeholder_filename">marcador_de_posición.txt</string>
   <string name="placeholder_filetype">Imaxe PNG</string>
index d516061..161f89c 100644 (file)
   <string name="auth_connecting_auth_server">Connessione al server di autenticazione in corso...</string>
   <string name="auth_unsupported_auth_method">Il server non supporta questo metodo di autenticazione</string>
   <string name="auth_unsupported_multiaccount">%1$s non supporta account multipli</string>
+  <string name="auth_fail_get_user_name">Il tuo server non restituisce un id utente corretto, contatta un amministratore</string>
   <string name="fd_keep_in_sync">Tieni aggiornato il file</string>
   <string name="common_rename">Rinomina</string>
   <string name="common_remove">Rimuovi</string>
   <string name="ssl_validator_label_validity_to">A:</string>
   <string name="ssl_validator_label_signature">Firma:</string>
   <string name="ssl_validator_label_signature_algorithm">Algoritmo:</string>
+  <string name="ssl_validator_null_cert">Il certificato non può essere mostrato.</string>
+  <string name="ssl_validator_no_info_about_error">- Nessuna informazione sull\'errore</string>
   <string name="placeholder_sentence">Questo è un segnaposto</string>
   <string name="placeholder_filename">segnaposto.txt</string>
   <string name="placeholder_filetype">Immagine PNG</string>
index 20b58fb..7a9b0ac 100644 (file)
@@ -3,7 +3,7 @@
   <string name="about_android">%1$s アンドロイドアプリ</string>
   <string name="about_version">バージョン %1$s</string>
   <string name="actionbar_sync">アカウントを同期</string>
-  <string name="actionbar_upload">ã\83\95ã\82¡ã\82¤ã\83«ã\82\92ã\82¢ã\83\83ã\83\97ã\83­ã\83¼ã\83\89</string>
+  <string name="actionbar_upload">アップロード</string>
   <string name="actionbar_upload_from_apps">他アプリからのコンテンツ</string>
   <string name="actionbar_upload_files">ファイル</string>
   <string name="actionbar_open_with">次で開く</string>
@@ -97,6 +97,7 @@
   <string name="sync_fail_in_favourites_content">%1$d ファイルのコンテンツを同期できませんでした(%2$d の競合)</string>
   <string name="sync_foreign_files_forgotten_ticker">一部のローカルファイルが忘れられています</string>
   <string name="sync_foreign_files_forgotten_content">%2$s ディレクトリ内の %1$d ファイルはコピーすることができませんでした</string>
+  <string name="sync_foreign_files_forgotten_explanation">バージョン 1.3.16から、このデバイスからアップロードされたファイルは、単独のファイルが複数のアカウントと同期される時にデータの損失を防ぐため、ローカルの%1$sのフォルダにコピーされます。\n\nこの変更により、このアプリの以前のバージョンでアップロードされたすべてのファイルが%2$s フォルダにコピーされます。ただし、アカウント同期の際に、エラーがこの操作の完了を阻止しました。ファイルをこのままにして%3$sへのリンクを削除するか、あるいは%1$s ディレクトリにファイルを移動して%4$sへのリンクを維持することができます。\n\n以下にリストされているのは、ローカルのファイル及びそれらにリンクしている %5$s 内のリモートファイルです。</string>
   <string name="sync_current_folder_was_removed">フォルダー %1$s はもう存在しません</string>
   <string name="foreign_files_move">全て移動</string>
   <string name="foreign_files_success">全てのファイルは移動されました</string>
   <string name="auth_connecting_auth_server">認証サーバーに接続中 ...</string>
   <string name="auth_unsupported_auth_method">サーバーはこの認証方式をサポートしていません</string>
   <string name="auth_unsupported_multiaccount">%1$s は複数アカウントをサポートしていません</string>
+  <string name="auth_fail_get_user_name">サーバーが正しいユーザーIDを返してきません。管理者に連絡してください。</string>
   <string name="fd_keep_in_sync">ファイルを最新に保つ</string>
   <string name="common_rename">名前を変更</string>
   <string name="common_remove">削除</string>
index 0e2405b..466a5d3 100644 (file)
   <string name="auth_connecting_auth_server">Verbinden met authenticatieserver...</string>
   <string name="auth_unsupported_auth_method">De server ondersteunt deze authenticatiemethode niet</string>
   <string name="auth_unsupported_multiaccount">%1$s ondersteunt het gebruik van meerdere accounts niet</string>
+  <string name="auth_fail_get_user_name">Uw server geeft geen geldig user id terug, neem contact op met uw beheerder</string>
   <string name="fd_keep_in_sync">Houd bestand actueel</string>
   <string name="common_rename">Hernoemen</string>
   <string name="common_remove">Verwijderen</string>
   <string name="ssl_validator_label_validity_to">Aan:</string>
   <string name="ssl_validator_label_signature">Handtekening:</string>
   <string name="ssl_validator_label_signature_algorithm">Algoritme:</string>
+  <string name="ssl_validator_null_cert">Het certificaat kon niet worden getoond.</string>
+  <string name="ssl_validator_no_info_about_error">- Geen informatie over de fout</string>
   <string name="placeholder_sentence">Dit is een plaatshouder</string>
   <string name="placeholder_filename">plaatshouder.txt</string>
   <string name="placeholder_filetype">PNG Afbeelding</string>
index 5715699..424b280 100644 (file)
@@ -1,5 +1,6 @@
 <?xml version='1.0' encoding='UTF-8'?>
 <resources>
+  <string name="actionbar_sync">Oppdater konto</string>
   <string name="actionbar_upload">Last opp</string>
   <string name="actionbar_upload_from_apps">Innhald frå andre program</string>
   <string name="actionbar_upload_files">Filer</string>
index 35ef100..788975e 100644 (file)
   <string name="auth_connecting_auth_server">Łączenie z serwerem autoryzacji...</string>
   <string name="auth_unsupported_auth_method">Serwer nie obsługuje tej metody autoryzacji</string>
   <string name="auth_unsupported_multiaccount">%1$s nie wspiera multikont</string>
+  <string name="auth_fail_get_user_name">Twój serwer nie zwraca prawidłowego ID użytkownika, skontaktuj się z administratorem serwera.</string>
   <string name="fd_keep_in_sync">Automatyczne aktualizuj plik</string>
   <string name="common_rename">Zmień nazwę</string>
   <string name="common_remove">Usuń</string>
   <string name="ssl_validator_label_validity_to">Do:</string>
   <string name="ssl_validator_label_signature">Sygnatura:</string>
   <string name="ssl_validator_label_signature_algorithm">Algorytm:</string>
+  <string name="ssl_validator_null_cert">Nie można wyświetlić certyfikatu.</string>
+  <string name="ssl_validator_no_info_about_error">- Brak informacji o błędzie</string>
   <string name="placeholder_sentence">Tekst zastępczy</string>
   <string name="placeholder_filename">placeholder.txt</string>
   <string name="placeholder_filetype">Obraz PNG</string>
index 656a067..daafd9b 100644 (file)
   <string name="auth_connecting_auth_server">Conectando ao servidor de autenticação ...</string>
   <string name="auth_unsupported_auth_method">O servidor não suporta este método de autenticação</string>
   <string name="auth_unsupported_multiaccount">%1$s não suporta múltiplas contas</string>
+  <string name="auth_fail_get_user_name">Seu servidor não está retornando uma ID de usuário correta, por favor entre em contato com o seu administrador</string>
   <string name="fd_keep_in_sync">Manter arquivo atualizado</string>
   <string name="common_rename">Renomear</string>
   <string name="common_remove">Remover</string>
   <string name="ssl_validator_label_validity_to">Para:</string>
   <string name="ssl_validator_label_signature">Assinatura:</string>
   <string name="ssl_validator_label_signature_algorithm">Algoritmo:</string>
+  <string name="ssl_validator_null_cert">O certificado não pode ser mostrado.</string>
+  <string name="ssl_validator_no_info_about_error">- Nenhuma informação sobre o erro</string>
   <string name="placeholder_sentence">Este é um espaço reservado</string>
   <string name="placeholder_filename">espaçoreservado.txt</string>
   <string name="placeholder_filetype">Imagem PNG</string>
index 7855520..4c2b2b9 100644 (file)
@@ -34,6 +34,7 @@
   <string name="common_cancel">Anulare</string>
   <string name="common_save_exit">Salvare &amp; Ieșire</string>
   <string name="common_error">Eroare</string>
+  <string name="common_error_unknown">Eroare necunoscută</string>
   <string name="about_title">Despre</string>
   <string name="change_password">Schimbă parola</string>
   <string name="delete_account">Șterge cont</string>
index 5521388..e87a9d3 100644 (file)
   <string name="auth_connecting_auth_server">Poteka povezovanje z overitvenim strežnikom ...</string>
   <string name="auth_unsupported_auth_method">Strežnik ne podpira tega načina overitve</string>
   <string name="auth_unsupported_multiaccount">%1$s ne omogoča podpore več računom</string>
+  <string name="auth_fail_get_user_name">Strežnik je javlja pravilnega ID uporabnika. Stopite v stik s skrbnikom sistema.</string>
   <string name="fd_keep_in_sync">Datoteka naj bo posodobljena</string>
   <string name="common_rename">Preimenuj</string>
   <string name="common_remove">Odstrani</string>
   <string name="ssl_validator_label_validity_to">Do:</string>
   <string name="ssl_validator_label_signature">Podpis:</string>
   <string name="ssl_validator_label_signature_algorithm">Algoritem:</string>
+  <string name="ssl_validator_null_cert">Potrdila ni mogoče pokazati.</string>
+  <string name="ssl_validator_no_info_about_error">– Ni podatkov o napaki</string>
   <string name="placeholder_sentence">To je vsebnik predmetov</string>
   <string name="placeholder_filename">vsebnik.txt</string>
   <string name="placeholder_filetype">Slika PNG</string>
index ff8d4c8..3d1a8e9 100644 (file)
   <string name="auth_connecting_auth_server">Kimlik doğrulama sunucusuna bağlanılıyor...</string>
   <string name="auth_unsupported_auth_method">Sunucu bu kimlik doğrulama yöntemini desteklemiyor</string>
   <string name="auth_unsupported_multiaccount">%1$s çoklu hesapları desteklemiyor</string>
+  <string name="auth_fail_get_user_name">Sunucunuz geçerli bir kullanıcı kimliği döndürmüyor, lütfen yöneticinizle iletişime geçin</string>
   <string name="fd_keep_in_sync">Dosyayı güncel tut </string>
   <string name="common_rename">İsim değiştir.</string>
   <string name="common_remove">Kaldır</string>
   <string name="ssl_validator_label_validity_to">Kime:</string>
   <string name="ssl_validator_label_signature">İmza:</string>
   <string name="ssl_validator_label_signature_algorithm">Algoritma:</string>
+  <string name="ssl_validator_null_cert">Sertifika gösterilemedi.</string>
+  <string name="ssl_validator_no_info_about_error">- Hata hakkında bilgi yok</string>
   <string name="placeholder_sentence">Bu bir yer tutucudur</string>
   <string name="placeholder_filename">yertutucu.txt</string>
   <string name="placeholder_filetype">PNG Resmi</string>
index c8f370e..6967fd0 100644 (file)
        <string name="ssl_validator_label_validity_to">To:</string>
        <string name="ssl_validator_label_signature">Signature:</string>
        <string name="ssl_validator_label_signature_algorithm">Algorithm:</string>
+       <string name="ssl_validator_null_cert">The certificate could not be shown.</string>
+       <string name="ssl_validator_no_info_about_error">- No information about the error</string>
                        
     <string name="placeholder_sentence">This is a placeholder</string>
     <string name="placeholder_filename">placeholder.txt</string>
index a7f76f5..4c6ee40 100644 (file)
         android:title="@string/prefs_select_oc_account"
         android:summary="@string/prefs_summary_select_oc_account" 
         / -->
-    <Preference android:title="@string/prefs_manage_accounts" android:key="manage_account" />
-    <CheckBoxPreference android:title="@string/prefs_pincode" android:key="set_pincode" 
+    <com.owncloud.android.ui.PreferenceMultiline android:title="@string/prefs_manage_accounts" android:key="manage_account" />
+    <com.owncloud.android.ui.CheckBoxPreferenceWithLongTitle android:title="@string/prefs_pincode" android:key="set_pincode" 
                         android:summary="@string/prefs_pincode_summary"/>
-    <CheckBoxPreference android:key="instant_uploading" 
+    <com.owncloud.android.ui.CheckBoxPreferenceWithLongTitle android:key="instant_uploading" 
                         android:title="@string/prefs_instant_upload"  
                         android:summary="@string/prefs_instant_upload_summary"/>
-    <CheckBoxPreference android:dependency="instant_uploading" 
+    <com.owncloud.android.ui.CheckBoxPreferenceWithLongTitle android:dependency="instant_uploading" 
                                        android:disableDependentsState="true" 
                                        android:title="@string/instant_upload_on_wifi" 
                                        android:key="instant_upload_on_wifi"/>
index e604a95..9dcddce 100644 (file)
@@ -18,6 +18,8 @@
 \r
 package com.owncloud.android.authentication;\r
 \r
+import java.security.cert.X509Certificate;\r
+\r
 import android.accounts.Account;\r
 import android.accounts.AccountManager;\r
 import android.app.AlertDialog;\r
@@ -29,10 +31,13 @@ import android.content.SharedPreferences;
 import android.graphics.Rect;\r
 import android.graphics.drawable.Drawable;\r
 import android.net.Uri;\r
+import android.net.http.SslError;\r
 import android.os.Bundle;\r
 import android.os.Handler;\r
 import android.preference.PreferenceManager;\r
 import android.support.v4.app.Fragment;\r
+import android.support.v4.app.FragmentManager;\r
+import android.support.v4.app.FragmentTransaction;\r
 import android.text.Editable;\r
 import android.text.InputType;\r
 import android.text.TextWatcher;\r
@@ -43,6 +48,7 @@ import android.view.View.OnFocusChangeListener;
 import android.view.View.OnTouchListener;\r
 import android.view.Window;\r
 import android.view.inputmethod.EditorInfo;\r
+import android.webkit.SslErrorHandler;\r
 import android.widget.Button;\r
 import android.widget.CheckBox;\r
 import android.widget.EditText;\r
@@ -59,6 +65,7 @@ import com.owncloud.android.lib.common.OwnCloudClientFactory;
 import com.owncloud.android.lib.common.OwnCloudClient;\r
 import com.owncloud.android.operations.OAuth2GetAccessToken;\r
 
+import com.owncloud.android.lib.common.network.CertificateCombinedException;\r
 import com.owncloud.android.lib.common.operations.OnRemoteOperationListener;\r
 import com.owncloud.android.lib.resources.status.GetRemoteStatusOperation;\r
 import com.owncloud.android.lib.common.operations.RemoteOperation;\r
@@ -68,8 +75,8 @@ import com.owncloud.android.lib.resources.files.ExistenceCheckRemoteOperation;
 import com.owncloud.android.lib.resources.users.GetRemoteUserNameOperation;\r
 
 import com.owncloud.android.ui.dialog.SamlWebViewDialog;\r
-import com.owncloud.android.ui.dialog.SslValidatorDialog;\r
-import com.owncloud.android.ui.dialog.SslValidatorDialog.OnSslValidatorListener;\r
+import com.owncloud.android.ui.dialog.SslUntrustedCertDialog;\r
+import com.owncloud.android.ui.dialog.SslUntrustedCertDialog.OnSslUntrustedCertListener;\r
 import com.owncloud.android.utils.Log_OC;\r
 import com.owncloud.android.lib.resources.status.OwnCloudVersion;\r
 \r
@@ -80,7 +87,8 @@ import com.owncloud.android.lib.resources.status.OwnCloudVersion;
  * @author David A. Velasco\r
  */\r
 public class AuthenticatorActivity extends AccountAuthenticatorActivity\r
-implements  OnRemoteOperationListener, OnSslValidatorListener, OnFocusChangeListener, OnEditorActionListener, SsoWebViewClientListener{\r
+    implements  OnRemoteOperationListener, OnFocusChangeListener, OnEditorActionListener, \r
+    SsoWebViewClientListener, OnSslUntrustedCertListener {\r
 \r
     private static final String TAG = AuthenticatorActivity.class.getSimpleName();\r
 \r
@@ -113,9 +121,8 @@ implements  OnRemoteOperationListener, OnSslValidatorListener, OnFocusChangeList
     private static final String AUTH_OPTIONAL = "optional";\r
     \r
     private static final int DIALOG_LOGIN_PROGRESS = 0;\r
-    private static final int DIALOG_SSL_VALIDATOR = 1;\r
-    private static final int DIALOG_CERT_NOT_SAVED = 2;\r
-    private static final int DIALOG_OAUTH2_LOGIN_PROGRESS = 3;\r
+    private static final int DIALOG_CERT_NOT_SAVED = 1;\r
+    private static final int DIALOG_OAUTH2_LOGIN_PROGRESS = 2;\r
 \r
     public static final byte ACTION_CREATE = 0;\r
     public static final byte ACTION_UPDATE_TOKEN = 1;\r
@@ -135,7 +142,6 @@ implements  OnRemoteOperationListener, OnSslValidatorListener, OnFocusChangeList
     private Thread mOperationThread;\r
     private GetRemoteStatusOperation mOcServerChkOperation;\r
     private ExistenceCheckRemoteOperation mAuthCheckOperation;\r
-    private RemoteOperationResult mLastSslUntrustedServerResult;\r
 \r
     private Uri mNewCapturedUriFromOAuth2Redirection;\r
 \r
@@ -168,6 +174,8 @@ implements  OnRemoteOperationListener, OnSslValidatorListener, OnFocusChangeList
     \r
     private boolean mResumed; // Control if activity is resumed\r
 \r
+    public static String DIALOG_UNTRUSTED_CERT = "DIALOG_UNTRUSTED_CERT";\r
+\r
 \r
     /**\r
      * {@inheritDoc}\r
@@ -893,8 +901,7 @@ implements  OnRemoteOperationListener, OnSslValidatorListener, OnFocusChangeList
 \r
             /// very special case (TODO: move to a common place for all the remote operations)\r
             if (result.getCode() == ResultCode.SSL_RECOVERABLE_PEER_UNVERIFIED) {\r
-                mLastSslUntrustedServerResult = result;\r
-                showDialog(DIALOG_SSL_VALIDATOR); \r
+                showUntrustedCertDialog(result);\r
             }\r
 \r
             /// retrieve discovered version and normalize server URL\r
@@ -1198,8 +1205,7 @@ implements  OnRemoteOperationListener, OnSslValidatorListener, OnFocusChangeList
 \r
             // very special case (TODO: move to a common place for all the remote operations) (dangerous here?)\r
             if (result.getCode() == ResultCode.SSL_RECOVERABLE_PEER_UNVERIFIED) {\r
-                mLastSslUntrustedServerResult = result;\r
-                showDialog(DIALOG_SSL_VALIDATOR); \r
+                showUntrustedCertDialog(result);\r
             }\r
 \r
         } else {    // authorization fail due to client side - probably wrong credentials\r
@@ -1331,10 +1337,6 @@ implements  OnRemoteOperationListener, OnSslValidatorListener, OnFocusChangeList
         case DIALOG_CERT_NOT_SAVED:\r
         case DIALOG_OAUTH2_LOGIN_PROGRESS:\r
             break;\r
-        case DIALOG_SSL_VALIDATOR: {\r
-            ((SslValidatorDialog)dialog).updateResult(mLastSslUntrustedServerResult);\r
-            break;\r
-        }\r
         default:\r
             Log_OC.e(TAG, "Incorrect dialog called with id = " + id);\r
         }\r
@@ -1385,11 +1387,6 @@ implements  OnRemoteOperationListener, OnSslValidatorListener, OnFocusChangeList
             dialog = working_dialog;\r
             break;\r
         }\r
-        case DIALOG_SSL_VALIDATOR: {\r
-            /// TODO start to use new dialog interface, at least for this (it is a FragmentDialog already)\r
-            dialog = SslValidatorDialog.newInstance(this, mLastSslUntrustedServerResult, this);\r
-            break;\r
-        }\r
         case DIALOG_CERT_NOT_SAVED: {\r
             AlertDialog.Builder builder = new AlertDialog.Builder(this);\r
             builder.setMessage(getResources().getString(R.string.ssl_validator_not_saved));\r
@@ -1540,23 +1537,6 @@ implements  OnRemoteOperationListener, OnSslValidatorListener, OnFocusChangeList
     }\r
     \r
     /**\r
-     * Called from SslValidatorDialog when a new server certificate was correctly saved.\r
-     */\r
-    public void onSavedCertificate() {\r
-        checkOcServer();\r
-    }\r
-\r
-    /**\r
-     * Called from SslValidatorDialog when a new server certificate could not be saved \r
-     * when the user requested it.\r
-     */\r
-    @Override\r
-    public void onFailedSavingCertificate() {\r
-        showDialog(DIALOG_CERT_NOT_SAVED);\r
-    }\r
-\r
-\r
-    /**\r
      *  Called when the 'action' button in an IME is pressed ('enter' in software keyboard).\r
      * \r
      *  Used to trigger the authentication check when the user presses 'enter' after writing the password, \r
@@ -1670,5 +1650,86 @@ implements  OnRemoteOperationListener, OnSslValidatorListener, OnFocusChangeList
         }\r
         return super.onTouchEvent(event);\r
     }\r
+\r
+\r
+    /**\r
+     * Show untrusted cert dialog \r
+     */\r
+    public void showUntrustedCertDialog(X509Certificate x509Certificate, SslError error, SslErrorHandler handler) {\r
+        // Show a dialog with the certificate info\r
+        SslUntrustedCertDialog dialog = null;\r
+        if (x509Certificate == null) {\r
+            dialog = SslUntrustedCertDialog.newInstanceForEmptySslError(error, handler);\r
+        } else {\r
+            dialog = SslUntrustedCertDialog.newInstanceForFullSslError(x509Certificate, error, handler);\r
+        }\r
+        FragmentManager fm = getSupportFragmentManager();\r
+        FragmentTransaction ft = fm.beginTransaction();\r
+        ft.addToBackStack(null);\r
+        dialog.show(ft, DIALOG_UNTRUSTED_CERT);\r
+    }\r
+    \r
+    /**\r
+     * Show untrusted cert dialog \r
+     */\r
+    public void showUntrustedCertDialog(RemoteOperationResult result) {\r
+        // Show a dialog with the certificate info\r
+        SslUntrustedCertDialog dialog = SslUntrustedCertDialog.newInstanceForFullSslError((CertificateCombinedException)result.getException());\r
+        FragmentManager fm = getSupportFragmentManager();\r
+        FragmentTransaction ft = fm.beginTransaction();\r
+        ft.addToBackStack(null);\r
+        dialog.show(ft, DIALOG_UNTRUSTED_CERT);\r
+        \r
+    }\r
     \r
+    /**\r
+     * Dismiss untrusted cert dialog\r
+     */\r
+    public void dismissUntrustedCertDialog(){\r
+        /*Fragment frag = getSupportFragmentManager().findFragmentByTag(DIALOG_UNTRUSTED_CERT);\r
+        if (frag != null) {\r
+            SslErrorViewAdapter dialog = (SslErrorViewAdapter) frag;\r
+            dialog.dismiss();\r
+        }\r
+        */\r
+    }\r
+    \r
+    /**\r
+     * Called from SslValidatorDialog when a new server certificate was correctly saved.\r
+     */\r
+    public void onSavedCertificate() {\r
+        Fragment fd = getSupportFragmentManager().findFragmentByTag(TAG_SAML_DIALOG);\r
+        if (fd == null) {\r
+            // if SAML dialog is not shown, the SslDialog was shown due to an SSL error in the server check\r
+            checkOcServer();\r
+        }\r
+    }\r
+\r
+    /**\r
+     * Called from SslValidatorDialog when a new server certificate could not be saved \r
+     * when the user requested it.\r
+     */\r
+    @Override\r
+    public void onFailedSavingCertificate() {\r
+        showDialog(DIALOG_CERT_NOT_SAVED);\r
+        cancelWebView();\r
+    }\r
+\r
+    @Override\r
+    public void onCancelCertificate() {\r
+        cancelWebView();\r
+    }\r
+    \r
+\r
+    public void cancelWebView() {\r
+        Fragment fd = getSupportFragmentManager().findFragmentByTag(TAG_SAML_DIALOG);\r
+        if (fd != null && fd instanceof SherlockDialogFragment) {\r
+            Dialog d = ((SherlockDialogFragment)fd).getDialog();\r
+            if (d != null && d.isShowing()) {\r
+                d.dismiss();\r
+            }\r
+        }\r
+        \r
+    }\r
+\r
 }\r
index 442ec73..27e1f5b 100644 (file)
 
 package com.owncloud.android.authentication;
 
+import java.io.ByteArrayInputStream;
 import java.lang.ref.WeakReference;
+import java.security.cert.Certificate;
+import java.security.cert.CertificateException;
+import java.security.cert.CertificateFactory;
+import java.security.cert.X509Certificate;
 
+import com.owncloud.android.lib.common.network.NetworkUtils;
 import com.owncloud.android.utils.Log_OC;
 
+import android.content.Context;
 import android.graphics.Bitmap;
+import android.net.http.SslCertificate;
 import android.net.http.SslError;
+import android.os.Bundle;
 import android.os.Handler;
 import android.os.Message;
 import android.view.KeyEvent;
@@ -52,12 +61,14 @@ public class SsoWebViewClient extends WebViewClient {
         public void onSsoFinished(String sessionCookie);
     }
     
+    private Context mContext;
     private Handler mListenerHandler;
     private WeakReference<SsoWebViewClientListener> mListenerRef;
     private String mTargetUrl;
     private String mLastReloadedUrlAtError;
     
-    public SsoWebViewClient (Handler listenerHandler, SsoWebViewClientListener listener) {
+    public SsoWebViewClient (Context context, Handler listenerHandler, SsoWebViewClientListener listener) {
+        mContext = context;
         mListenerHandler = listenerHandler;
         mListenerRef = new WeakReference<SsoWebViewClient.SsoWebViewClientListener>(listener);
         mTargetUrl = "fake://url.to.be.set";
@@ -135,9 +146,50 @@ public class SsoWebViewClient extends WebViewClient {
     }
     
     @Override
-    public void onReceivedSslError (WebView view, SslErrorHandler handler, SslError error) {
+    public void onReceivedSslError (final WebView view, final SslErrorHandler handler, SslError error) {
         Log_OC.d(TAG, "onReceivedSslError : " + error);
-        handler.proceed();
+        // Test 1
+        X509Certificate x509Certificate = getX509CertificateFromError(error);
+        boolean isKnownServer = false;
+        
+        if (x509Certificate != null) {
+            Log_OC.d(TAG, "------>>>>> x509Certificate " + x509Certificate.toString());
+            
+            try {
+                isKnownServer = NetworkUtils.isCertInKnownServersStore((Certificate) x509Certificate, mContext);
+            } catch (Exception e) {
+                Log_OC.e(TAG, "Exception: " + e.getMessage());
+            }
+        }
+        
+         if (isKnownServer) {
+             handler.proceed();
+         } else {
+             ((AuthenticatorActivity)mContext).showUntrustedCertDialog(x509Certificate, error, handler);
+         }
+    }
+    
+    /**
+     * Obtain the X509Certificate from SslError
+     * @param   error     SslError
+     * @return  X509Certificate from error
+     */
+    public X509Certificate getX509CertificateFromError (SslError error) {
+        Bundle bundle = SslCertificate.saveState(error.getCertificate());
+        X509Certificate x509Certificate;
+        byte[] bytes = bundle.getByteArray("x509-certificate");
+        if (bytes == null) {
+            x509Certificate = null;
+        } else {
+            try {
+                CertificateFactory certFactory = CertificateFactory.getInstance("X.509");
+                Certificate cert = certFactory.generateCertificate(new ByteArrayInputStream(bytes));
+                x509Certificate = (X509Certificate) cert;
+            } catch (CertificateException e) {
+                x509Certificate = null;
+            }
+        }        
+        return x509Certificate;
     }
     
     @Override
index 7277b3a..896ecca 100644 (file)
@@ -30,7 +30,9 @@ import com.owncloud.android.datamodel.FileDataStorageManager;
 import com.owncloud.android.datamodel.OCFile;
 import com.owncloud.android.lib.common.OwnCloudClient;
 import com.owncloud.android.lib.resources.shares.OCShare;
+import com.owncloud.android.lib.common.operations.RemoteOperation;
 import com.owncloud.android.lib.common.operations.RemoteOperationResult;
+import com.owncloud.android.lib.resources.shares.GetRemoteSharesForFileOperation;
 import com.owncloud.android.lib.resources.shares.ShareType;
 import com.owncloud.android.lib.resources.shares.CreateRemoteShareOperation;
 import com.owncloud.android.lib.resources.files.FileUtils;
@@ -40,6 +42,7 @@ import com.owncloud.android.utils.Log_OC;
 public class CreateShareOperation extends SyncOperation {
 
     private static final String TAG = CreateShareOperation.class.getSimpleName();
+    
 
     protected FileDataStorageManager mStorageManager;
 
@@ -83,39 +86,24 @@ public class CreateShareOperation extends SyncOperation {
 
     @Override
     protected RemoteOperationResult run(OwnCloudClient client) {
-        CreateRemoteShareOperation operation = new CreateRemoteShareOperation(mPath, mShareType, mShareWith, mPublicUpload, mPassword, mPermissions);
-        RemoteOperationResult result = operation.execute(client);
-
+        RemoteOperation operation = null;
+        
+        // Check if the share link already exists
+        operation = new GetRemoteSharesForFileOperation(mPath, false, false);
+        RemoteOperationResult result = ((GetRemoteSharesForFileOperation)operation).execute(client);
+
+        if (!result.isSuccess() || result.getData().size() <= 0) {
+            operation = new CreateRemoteShareOperation(mPath, mShareType, mShareWith, mPublicUpload, mPassword, mPermissions);
+            result = ((CreateRemoteShareOperation)operation).execute(client);
+        }
+        
         if (result.isSuccess()) {
-
             if (result.getData().size() > 0) {
                 OCShare share = (OCShare) result.getData().get(0);
-
-                // Update DB with the response
-                share.setPath(mPath);
-                if (mPath.endsWith(FileUtils.PATH_SEPARATOR)) {
-                    share.setIsFolder(true);
-                } else {
-                    share.setIsFolder(false);
-                }
-                share.setPermissions(mPermissions);
-                
-                getStorageManager().saveShare(share);
-                
-                // Update OCFile with data from share: ShareByLink  and publicLink
-                OCFile file = getStorageManager().getFileByPath(mPath);
-                if (file!=null) {
-                    mSendIntent.putExtra(Intent.EXTRA_TEXT, share.getShareLink());
-                    file.setPublicLink(share.getShareLink());
-                    file.setShareByLink(true);
-                    getStorageManager().saveFile(file);
-                    Log_OC.d(TAG, "Public Link = " + file.getPublicLink());
-
-                }
-            }
+                updateData(share);
+            } 
         }
-
-
+        
         return result;
     }
     
@@ -123,5 +111,29 @@ public class CreateShareOperation extends SyncOperation {
     public Intent getSendIntent() {
         return mSendIntent;
     }
+    
+    private void updateData(OCShare share) {
+        // Update DB with the response
+        share.setPath(mPath);
+        if (mPath.endsWith(FileUtils.PATH_SEPARATOR)) {
+            share.setIsFolder(true);
+        } else {
+            share.setIsFolder(false);
+        }
+        share.setPermissions(mPermissions);
+        
+        getStorageManager().saveShare(share);
+        
+        // Update OCFile with data from share: ShareByLink  and publicLink
+        OCFile file = getStorageManager().getFileByPath(mPath);
+        if (file!=null) {
+            mSendIntent.putExtra(Intent.EXTRA_TEXT, share.getShareLink());
+            file.setPublicLink(share.getShareLink());
+            file.setShareByLink(true);
+            getStorageManager().saveFile(file);
+            Log_OC.d(TAG, "Public Link = " + file.getPublicLink());
+
+        }
+    }
 
 }
index 59e7754..a3394e6 100644 (file)
@@ -30,7 +30,6 @@ import com.owncloud.android.R;
 import com.owncloud.android.authentication.AuthenticatorActivity;
 import com.owncloud.android.datamodel.FileDataStorageManager;
 import com.owncloud.android.datamodel.OCFile;
-import com.owncloud.android.lib.common.accounts.AccountUtils.Constants;
 import com.owncloud.android.lib.common.operations.RemoteOperationResult;
 import com.owncloud.android.operations.SynchronizeFolderOperation;
 import com.owncloud.android.operations.UpdateOCVersionOperation;
@@ -39,7 +38,6 @@ import com.owncloud.android.ui.activity.ErrorsWhileCopyingHandlerActivity;
 import com.owncloud.android.utils.Log_OC;
 
 import android.accounts.Account;
-import android.accounts.AccountManager;
 import android.accounts.AccountsException;
 import android.app.NotificationManager;
 import android.app.PendingIntent;
diff --git a/src/com/owncloud/android/ui/CheckBoxPreferenceWithLongTitle.java b/src/com/owncloud/android/ui/CheckBoxPreferenceWithLongTitle.java
new file mode 100644 (file)
index 0000000..dac083a
--- /dev/null
@@ -0,0 +1,47 @@
+/* ownCloud Android client application
+ *   Copyright (C) 2014 ownCloud Inc.
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2,
+ *   as published by the Free Software Foundation.
+ *
+ *   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 <http://www.gnu.org/licenses/>.
+ *
+ */
+
+package com.owncloud.android.ui;
+
+import android.content.Context;
+import android.util.AttributeSet;
+import android.view.View;
+import android.widget.TextView;
+import android.preference.CheckBoxPreference;
+
+public class CheckBoxPreferenceWithLongTitle extends CheckBoxPreference{
+
+    public CheckBoxPreferenceWithLongTitle(Context context) {
+        super(context);
+    }
+
+    public CheckBoxPreferenceWithLongTitle(Context context, AttributeSet attrs) {
+        super(context, attrs);
+    }
+    public CheckBoxPreferenceWithLongTitle(Context context, AttributeSet attrs, int defStyle) {
+        super(context, attrs, defStyle);
+    }
+
+    @Override
+    protected void onBindView(View view) {
+        super.onBindView(view);
+        TextView titleView = (TextView) view.findViewById(android.R.id.title);
+        titleView.setSingleLine(false);
+        titleView.setMaxLines(3);
+        titleView.setEllipsize(null);
+    }
+}
\ No newline at end of file
diff --git a/src/com/owncloud/android/ui/PreferenceMultiline.java b/src/com/owncloud/android/ui/PreferenceMultiline.java
new file mode 100644 (file)
index 0000000..28b3621
--- /dev/null
@@ -0,0 +1,53 @@
+/* ownCloud Android client application
+ *   Copyright (C) 2014 ownCloud Inc.
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2,
+ *   as published by the Free Software Foundation.
+ *
+ *   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 <http://www.gnu.org/licenses/>.
+ *
+ */
+
+package com.owncloud.android.ui;
+
+import android.content.Context;
+import android.preference.Preference;
+import android.util.AttributeSet;
+import android.view.View;
+import android.widget.TextView;
+
+/**
+ * Allow multiline titles in preferences
+ * 
+ * @author masensio
+ *
+ */
+public class PreferenceMultiline extends Preference {
+
+    public PreferenceMultiline(Context context) {
+        super(context);
+    }
+
+    public PreferenceMultiline(Context context, AttributeSet attrs) {
+        super(context, attrs);
+    }
+
+    public PreferenceMultiline(Context context, AttributeSet attrs, int defStyle) {
+        super(context, attrs, defStyle);
+    }
+
+    @Override
+    protected void onBindView(View view) {
+        super.onBindView(view);
+        TextView titleView = (TextView) view.findViewById(android.R.id.title);
+        titleView.setSingleLine(false);
+        titleView.setMaxLines(3);
+    }
+}
index 7c54641..b503c37 100644 (file)
@@ -22,7 +22,6 @@ import com.owncloud.android.R;
 import android.app.Activity;
 import android.content.ClipData;
 import android.content.Intent;
-import android.os.Build;
 import android.os.Bundle;
 import android.text.ClipboardManager;
 import android.widget.Toast;
index 0293314..4593e3f 100644 (file)
@@ -19,7 +19,6 @@
 package com.owncloud.android.ui.activity;
 
 import java.io.File;
-
 import android.accounts.Account;
 import android.app.AlertDialog;
 import android.app.Dialog;
@@ -34,7 +33,6 @@ import android.content.IntentFilter;
 import android.content.ServiceConnection;
 import android.content.SharedPreferences;
 import android.content.SyncRequest;
-import android.content.res.Configuration;
 import android.content.res.Resources.NotFoundException;
 import android.database.Cursor;
 import android.net.Uri;
@@ -43,6 +41,7 @@ import android.os.IBinder;
 import android.preference.PreferenceManager;
 import android.provider.MediaStore;
 import android.support.v4.app.Fragment;
+import android.support.v4.app.FragmentManager;
 import android.support.v4.app.FragmentTransaction;
 //import android.support.v4.content.LocalBroadcastManager;
 import android.util.Log;
@@ -68,6 +67,7 @@ import com.owncloud.android.files.services.FileDownloader.FileDownloaderBinder;
 import com.owncloud.android.files.services.FileUploader.FileUploaderBinder;
 import com.owncloud.android.operations.CreateFolderOperation;
 
+import com.owncloud.android.lib.common.network.CertificateCombinedException;
 import com.owncloud.android.lib.common.operations.RemoteOperation;
 import com.owncloud.android.lib.common.operations.RemoteOperationResult;
 import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;
@@ -79,10 +79,11 @@ import com.owncloud.android.operations.SynchronizeFolderOperation;
 import com.owncloud.android.operations.UnshareLinkOperation;
 import com.owncloud.android.services.OperationsService;
 import com.owncloud.android.syncadapter.FileSyncAdapter;
+import com.owncloud.android.ui.adapter.SslErrorViewAdapter;
 import com.owncloud.android.ui.dialog.EditNameDialog;
+import com.owncloud.android.ui.dialog.SslUntrustedCertDialog;
 import com.owncloud.android.ui.dialog.EditNameDialog.EditNameDialogListener;
-import com.owncloud.android.ui.dialog.SslValidatorDialog;
-import com.owncloud.android.ui.dialog.SslValidatorDialog.OnSslValidatorListener;
+import com.owncloud.android.ui.dialog.SslUntrustedCertDialog.OnSslUntrustedCertListener;
 import com.owncloud.android.ui.fragment.FileDetailFragment;
 import com.owncloud.android.ui.fragment.FileFragment;
 import com.owncloud.android.ui.fragment.OCFileListFragment;
@@ -101,7 +102,7 @@ import com.owncloud.android.utils.Log_OC;
  */
 
 public class FileDisplayActivity extends HookActivity implements
-OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNavigationListener, OnSslValidatorListener, EditNameDialogListener {
+OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNavigationListener, OnSslUntrustedCertListener, EditNameDialogListener {
 
     private ArrayAdapter<String> mDirectories;
 
@@ -125,8 +126,8 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
 
     public static final int DIALOG_SHORT_WAIT = 0;
     private static final int DIALOG_CHOOSE_UPLOAD_SOURCE = 1;
-    private static final int DIALOG_SSL_VALIDATOR = 2;
-    private static final int DIALOG_CERT_NOT_SAVED = 3;
+    //private static final int DIALOG_SSL_VALIDATOR = 2;
+    private static final int DIALOG_CERT_NOT_SAVED = 2;
     
     public static final String ACTION_DETAILS = "com.owncloud.android.ui.activity.action.DETAILS";
 
@@ -143,6 +144,8 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
     private boolean mSyncInProgress = false;
     //private boolean mRefreshSharesInProgress = false;
 
+    private String DIALOG_UNTRUSTED_CERT;
+    
     private OCFile mWaitingToSend;
 
     @Override
@@ -745,14 +748,6 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
 
 
     @Override
-    protected void onPrepareDialog(int id, Dialog dialog, Bundle args) {
-        if (id == DIALOG_SSL_VALIDATOR && mLastSslUntrustedServerResult != null) {
-            ((SslValidatorDialog)dialog).updateResult(mLastSslUntrustedServerResult);
-        }
-    }
-
-
-    @Override
     protected Dialog onCreateDialog(int id) {
         Dialog dialog = null;
         AlertDialog.Builder builder;
@@ -810,10 +805,6 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
             dialog = builder.create();
             break;
         }
-        case DIALOG_SSL_VALIDATOR: {
-            dialog = SslValidatorDialog.newInstance(this, mLastSslUntrustedServerResult, this);
-            break;
-        }
         case DIALOG_CERT_NOT_SAVED: {
             builder = new AlertDialog.Builder(this);
             builder.setMessage(getResources().getString(R.string.ssl_validator_not_saved));
@@ -982,7 +973,6 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
             if (synchResult != null) {
                 if (synchResult.getCode().equals(RemoteOperationResult.ResultCode.SSL_RECOVERABLE_PEER_UNVERIFIED)) {
                     mLastSslUntrustedServerResult = synchResult;
-                    showDialog(DIALOG_SSL_VALIDATOR); 
                 }
             }
         }
@@ -1078,7 +1068,7 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
                 if ((getSharesResult != null) &&
                         RemoteOperationResult.ResultCode.SSL_RECOVERABLE_PEER_UNVERIFIED.equals(getSharesResult.getCode())) {
                     mLastSslUntrustedServerResult = getSharesResult;
-                    showDialog(DIALOG_SSL_VALIDATOR); 
+                    showUntrustedCertDialog(mLastSslUntrustedServerResult);
                 }
 
                 //setSupportProgressBarIndeterminateVisibility(mRefreshSharesInProgress || mSyncInProgress);
@@ -1324,6 +1314,10 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
         showDialog(DIALOG_CERT_NOT_SAVED);
     }
 
+    @Override
+    public void onCancelCertificate() {
+        // nothing to do
+    }
 
     /**
      * Updates the view associated to the activity after the finish of some operation over files
@@ -1421,7 +1415,7 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
             msg.show();
             if (result.isSslRecoverableException()) {
                 mLastSslUntrustedServerResult = result;
-                showDialog(DIALOG_SSL_VALIDATOR); 
+                showUntrustedCertDialog(mLastSslUntrustedServerResult);
             }
         }
     }
@@ -1488,7 +1482,7 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
                 msg.show();
                 if (result.isSslRecoverableException()) {
                     mLastSslUntrustedServerResult = result;
-                    showDialog(DIALOG_SSL_VALIDATOR); 
+                    showUntrustedCertDialog(mLastSslUntrustedServerResult);
                 }
             }
         }
@@ -1613,7 +1607,18 @@ OCFileListFragment.ContainerActivity, FileDetailFragment.ContainerActivity, OnNa
         mRefreshSharesInProgress = true;
     }
     */
-
+    
+    /**
+     * Show untrusted cert dialog 
+     */
+    public void showUntrustedCertDialog(RemoteOperationResult result) {
+        // Show a dialog with the certificate info
+        SslUntrustedCertDialog dialog = SslUntrustedCertDialog.newInstanceForFullSslError((CertificateCombinedException)result.getException());
+        FragmentManager fm = getSupportFragmentManager();
+        FragmentTransaction ft = fm.beginTransaction();
+        dialog.show(ft, DIALOG_UNTRUSTED_CERT);
+    }
+    
     /**
      * Requests the download of the received {@link OCFile} , updates the UI
      * to monitor the download progress and prepares the activity to send the file
diff --git a/src/com/owncloud/android/ui/adapter/CertificateCombinedExceptionViewAdapter.java b/src/com/owncloud/android/ui/adapter/CertificateCombinedExceptionViewAdapter.java
new file mode 100644 (file)
index 0000000..b1c3263
--- /dev/null
@@ -0,0 +1,74 @@
+/* ownCloud Android client application
+ *   Copyright (C) 2012-2014 ownCloud Inc.
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2,
+ *   as published by the Free Software Foundation.
+ *
+ *   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 <http://www.gnu.org/licenses/>.
+ *
+ */
+package com.owncloud.android.ui.adapter;
+
+import com.owncloud.android.R;
+import com.owncloud.android.lib.common.network.CertificateCombinedException;
+import com.owncloud.android.ui.dialog.SslUntrustedCertDialog;
+
+import android.view.View;
+import android.widget.TextView;
+
+/**
+ * TODO
+ * 
+ * @author masensio
+ * @author David A. Velasco
+ *
+ */
+public class CertificateCombinedExceptionViewAdapter implements SslUntrustedCertDialog.ErrorViewAdapter {
+    
+    //private final static String TAG = CertificateCombinedExceptionViewAdapter.class.getSimpleName();
+    
+    private CertificateCombinedException mSslException = null;
+    
+    public CertificateCombinedExceptionViewAdapter(CertificateCombinedException sslException) {
+        mSslException = sslException;
+    }
+    
+    @Override
+    public void updateErrorView(View dialogView) {
+        /// clean
+        dialogView.findViewById(R.id.reason_no_info_about_error).setVisibility(View.GONE);
+       
+        /// refresh
+        if (mSslException.getCertPathValidatorException() != null) {
+            ((TextView)dialogView.findViewById(R.id.reason_cert_not_trusted)).setVisibility(View.VISIBLE);
+        } else {
+            dialogView.findViewById(R.id.reason_cert_not_trusted).setVisibility(View.GONE);
+        }
+        
+        if (mSslException.getCertificateExpiredException() != null) {
+            ((TextView)dialogView.findViewById(R.id.reason_cert_expired)).setVisibility(View.VISIBLE);
+        } else {
+            dialogView.findViewById(R.id.reason_cert_expired).setVisibility(View.GONE);
+        }
+        
+        if (mSslException.getCertificateNotYetValidException() != null) {
+            ((TextView)dialogView.findViewById(R.id.reason_cert_not_yet_valid)).setVisibility(View.VISIBLE);
+        } else {
+            dialogView.findViewById(R.id.reason_cert_not_yet_valid).setVisibility(View.GONE);
+        }
+
+        if (mSslException.getSslPeerUnverifiedException() != null) {
+            ((TextView)dialogView.findViewById(R.id.reason_hostname_not_verified)).setVisibility(View.VISIBLE);
+        } else {
+            dialogView.findViewById(R.id.reason_hostname_not_verified).setVisibility(View.GONE);
+        }
+        
+    }
+}
diff --git a/src/com/owncloud/android/ui/adapter/SslCertificateViewAdapter.java b/src/com/owncloud/android/ui/adapter/SslCertificateViewAdapter.java
new file mode 100644 (file)
index 0000000..a944ead
--- /dev/null
@@ -0,0 +1,126 @@
+/* ownCloud Android client application
+ *   Copyright (C) 2012-2014 ownCloud Inc.
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2,
+ *   as published by the Free Software Foundation.
+ *
+ *   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 <http://www.gnu.org/licenses/>.
+ *
+ */
+package com.owncloud.android.ui.adapter;
+
+import java.text.DateFormat;
+import java.util.Date;
+
+import com.owncloud.android.R;
+import com.owncloud.android.ui.dialog.SslUntrustedCertDialog;
+import android.net.http.SslCertificate;
+import android.view.View;
+import android.widget.TextView;
+
+/**
+ * TODO
+ * 
+ * @author masensio
+ * @author David A. Velasco
+ */
+public class SslCertificateViewAdapter implements SslUntrustedCertDialog.CertificateViewAdapter {
+    
+    //private final static String TAG = SslCertificateViewAdapter.class.getSimpleName();
+    
+    private SslCertificate mCertificate;
+
+    
+    /**
+     * Constructor
+     * 
+     * @param 
+     */
+    public SslCertificateViewAdapter(SslCertificate certificate) {
+        mCertificate = certificate;
+    }
+
+    @Override
+    public void updateCertificateView(View dialogView) {
+        TextView nullCerView = (TextView) dialogView.findViewById(R.id.null_cert);
+        if (mCertificate != null) {
+            nullCerView.setVisibility(View.GONE);
+            showSubject(mCertificate.getIssuedTo(), dialogView);
+            showIssuer(mCertificate.getIssuedBy(), dialogView);
+            showValidity(mCertificate.getValidNotBeforeDate(), mCertificate.getValidNotAfterDate(), dialogView);
+            hideSignature(dialogView);
+            
+        } else {
+            nullCerView.setVisibility(View.VISIBLE);
+        }
+    }
+    
+    private void showValidity(Date notBefore, Date notAfter, View dialogView) {
+        TextView fromView = ((TextView)dialogView.findViewById(R.id.value_validity_from));
+        TextView toView = ((TextView)dialogView.findViewById(R.id.value_validity_to));
+        DateFormat dateFormat = DateFormat.getDateInstance();
+        fromView.setText(dateFormat.format(notBefore));
+        toView.setText(dateFormat.format(notAfter));
+    }
+
+    
+    private void showSubject(SslCertificate.DName subject, View dialogView) {
+        TextView cnView = ((TextView)dialogView.findViewById(R.id.value_subject_CN));
+        cnView.setText(subject.getCName());
+        cnView.setVisibility(View.VISIBLE);
+        
+        TextView oView = ((TextView)dialogView.findViewById(R.id.value_subject_O));
+        oView.setText(subject.getOName());
+        oView.setVisibility(View.VISIBLE);
+        
+        TextView ouView = ((TextView)dialogView.findViewById(R.id.value_subject_OU));
+        ouView.setText(subject.getUName());
+        ouView.setVisibility(View.VISIBLE);
+
+        // SslCertificates don't offer this information
+        ((TextView)dialogView.findViewById(R.id.value_subject_C)).setVisibility(View.GONE);
+        ((TextView)dialogView.findViewById(R.id.value_subject_ST)).setVisibility(View.GONE);
+        ((TextView)dialogView.findViewById(R.id.value_subject_L)).setVisibility(View.GONE);
+        ((TextView)dialogView.findViewById(R.id.label_subject_C)).setVisibility(View.GONE);
+        ((TextView)dialogView.findViewById(R.id.label_subject_ST)).setVisibility(View.GONE);
+        ((TextView)dialogView.findViewById(R.id.label_subject_L)).setVisibility(View.GONE);
+    }
+    
+    
+    private void showIssuer(SslCertificate.DName issuer, View dialogView) {
+        TextView cnView = ((TextView)dialogView.findViewById(R.id.value_issuer_CN));
+        cnView.setText(issuer.getCName());
+        cnView.setVisibility(View.VISIBLE);
+        
+        TextView oView = ((TextView)dialogView.findViewById(R.id.value_issuer_O));
+        oView.setText(issuer.getOName());
+        oView.setVisibility(View.VISIBLE);
+
+        TextView ouView = ((TextView)dialogView.findViewById(R.id.value_issuer_OU));
+        ouView.setText(issuer.getUName());
+        ouView.setVisibility(View.VISIBLE);
+        
+        // SslCertificates don't offer this information
+        ((TextView)dialogView.findViewById(R.id.value_issuer_C)).setVisibility(View.GONE);
+        ((TextView)dialogView.findViewById(R.id.value_issuer_ST)).setVisibility(View.GONE);
+        ((TextView)dialogView.findViewById(R.id.value_issuer_L)).setVisibility(View.GONE);
+        ((TextView)dialogView.findViewById(R.id.label_issuer_C)).setVisibility(View.GONE);
+        ((TextView)dialogView.findViewById(R.id.label_issuer_ST)).setVisibility(View.GONE);
+        ((TextView)dialogView.findViewById(R.id.label_issuer_L)).setVisibility(View.GONE);
+    }
+    
+    private void hideSignature(View dialogView) {
+        ((TextView)dialogView.findViewById(R.id.label_signature)).setVisibility(View.GONE);
+        ((TextView)dialogView.findViewById(R.id.label_signature_algorithm)).setVisibility(View.GONE);
+        ((TextView)dialogView.findViewById(R.id.value_signature_algorithm)).setVisibility(View.GONE);
+        ((TextView)dialogView.findViewById(R.id.value_signature)).setVisibility(View.GONE);
+    }
+
+}
diff --git a/src/com/owncloud/android/ui/adapter/SslErrorViewAdapter.java b/src/com/owncloud/android/ui/adapter/SslErrorViewAdapter.java
new file mode 100644 (file)
index 0000000..7d2e291
--- /dev/null
@@ -0,0 +1,73 @@
+/* ownCloud Android client application
+ *   Copyright (C) 2012-2014 ownCloud Inc.
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2,
+ *   as published by the Free Software Foundation.
+ *
+ *   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 <http://www.gnu.org/licenses/>.
+ *
+ */
+package com.owncloud.android.ui.adapter;
+
+import com.owncloud.android.R;
+import com.owncloud.android.ui.dialog.SslUntrustedCertDialog;
+import android.net.http.SslError;
+import android.view.View;
+import android.widget.TextView;
+
+/**
+ * Dialog to show an Untrusted Certificate
+ * 
+ * @author masensio
+ * @author David A. Velasco
+ *
+ */
+public class SslErrorViewAdapter implements SslUntrustedCertDialog.ErrorViewAdapter {
+    
+    //private final static String TAG = SslErrorViewAdapter.class.getSimpleName();
+    
+    private SslError mSslError;
+    
+    public SslErrorViewAdapter(SslError sslError) {
+        mSslError = sslError;
+    }
+    
+    @Override
+    public void updateErrorView(View dialogView) {
+        /// clean
+        dialogView.findViewById(R.id.reason_no_info_about_error).setVisibility(View.GONE);
+        
+        /// refresh
+        if (mSslError.hasError(SslError.SSL_UNTRUSTED)) {
+            ((TextView)dialogView.findViewById(R.id.reason_cert_not_trusted)).setVisibility(View.VISIBLE);
+        } else {
+            dialogView.findViewById(R.id.reason_cert_not_trusted).setVisibility(View.GONE);
+        }
+        
+        if (mSslError.hasError(SslError.SSL_EXPIRED)) {
+            ((TextView)dialogView.findViewById(R.id.reason_cert_expired)).setVisibility(View.VISIBLE);
+        } else {
+            dialogView.findViewById(R.id.reason_cert_expired).setVisibility(View.GONE);
+        }
+        
+        if (mSslError.getPrimaryError() == SslError.SSL_NOTYETVALID) {
+            ((TextView)dialogView.findViewById(R.id.reason_cert_not_yet_valid)).setVisibility(View.VISIBLE);
+        } else {
+            dialogView.findViewById(R.id.reason_cert_not_yet_valid).setVisibility(View.GONE);
+        }
+        
+        if (mSslError.getPrimaryError() == SslError.SSL_IDMISMATCH) {
+            ((TextView)dialogView.findViewById(R.id.reason_hostname_not_verified)).setVisibility(View.VISIBLE);
+        } else {
+            dialogView.findViewById(R.id.reason_hostname_not_verified).setVisibility(View.GONE);
+        }
+    }
+
+}
diff --git a/src/com/owncloud/android/ui/adapter/X509CertificateViewAdapter.java b/src/com/owncloud/android/ui/adapter/X509CertificateViewAdapter.java
new file mode 100644 (file)
index 0000000..a290dca
--- /dev/null
@@ -0,0 +1,204 @@
+/* ownCloud Android client application
+ *   Copyright (C) 2012-2014 ownCloud Inc.
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2,
+ *   as published by the Free Software Foundation.
+ *
+ *   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 <http://www.gnu.org/licenses/>.
+ *
+ */
+package com.owncloud.android.ui.adapter;
+
+import java.security.cert.X509Certificate;
+import java.text.DateFormat;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.security.auth.x500.X500Principal;
+
+import com.owncloud.android.R;
+import com.owncloud.android.ui.dialog.SslUntrustedCertDialog;
+
+import android.view.View;
+import android.widget.TextView;
+
+/**
+ * 
+ * @author masensio
+ * @author David A. Velasco
+ *
+ */
+public class X509CertificateViewAdapter implements SslUntrustedCertDialog.CertificateViewAdapter {
+    
+    //private final static String TAG = X509CertificateViewAdapter.class.getSimpleName();
+    
+    private X509Certificate mCertificate = null;
+    
+    public X509CertificateViewAdapter(X509Certificate certificate) {
+        mCertificate = certificate;
+    }
+    
+    @Override
+    public void updateCertificateView(View dialogView) {
+        TextView nullCerView = (TextView) dialogView.findViewById(R.id.null_cert);
+        
+        if (mCertificate != null) {
+            nullCerView.setVisibility(View.GONE);
+            showSubject(mCertificate.getSubjectX500Principal(), dialogView);
+            showIssuer(mCertificate.getIssuerX500Principal(), dialogView);
+            showValidity(mCertificate.getNotBefore(), mCertificate.getNotAfter(), dialogView);
+            showSignature(dialogView);
+            
+        } else {
+            nullCerView.setVisibility(View.VISIBLE);
+        }
+    }
+
+    private void showSignature(View dialogView) {
+        TextView sigView = ((TextView)dialogView.findViewById(R.id.value_signature));
+        TextView algorithmView = ((TextView)dialogView.findViewById(R.id.value_signature_algorithm));
+        sigView.setText(getHex(mCertificate.getSignature()));
+        algorithmView.setText(mCertificate.getSigAlgName());
+    }
+    
+    public String getHex(final byte [] raw) {
+        if (raw == null) {
+           return null;
+        }
+        final StringBuilder hex = new StringBuilder(2 * raw.length);
+        for (final byte b : raw) {
+           final int hiVal = (b & 0xF0) >> 4;
+           final int loVal = b & 0x0F;
+           hex.append((char) ('0' + (hiVal + (hiVal / 10 * 7))));
+           hex.append((char) ('0' + (loVal + (loVal / 10 * 7))));
+        }
+        return hex.toString();
+     }    
+
+    private void showValidity(Date notBefore, Date notAfter, View dialogView) {
+        TextView fromView = ((TextView)dialogView.findViewById(R.id.value_validity_from));
+        TextView toView = ((TextView)dialogView.findViewById(R.id.value_validity_to));
+        DateFormat dateFormat = DateFormat.getDateInstance();
+        fromView.setText(dateFormat.format(notBefore));
+        toView.setText(dateFormat.format(notAfter));
+    }
+
+    private void showSubject(X500Principal subject, View dialogView) {
+        Map<String, String> s = parsePrincipal(subject);
+        TextView cnView = ((TextView)dialogView.findViewById(R.id.value_subject_CN));
+        TextView oView = ((TextView)dialogView.findViewById(R.id.value_subject_O));
+        TextView ouView = ((TextView)dialogView.findViewById(R.id.value_subject_OU));
+        TextView cView = ((TextView)dialogView.findViewById(R.id.value_subject_C));
+        TextView stView = ((TextView)dialogView.findViewById(R.id.value_subject_ST));
+        TextView lView = ((TextView)dialogView.findViewById(R.id.value_subject_L));
+        
+        if (s.get("CN") != null) {
+            cnView.setText(s.get("CN"));
+            cnView.setVisibility(View.VISIBLE);
+        } else {
+            cnView.setVisibility(View.GONE);
+        }
+        if (s.get("O") != null) {
+            oView.setText(s.get("O"));
+            oView.setVisibility(View.VISIBLE);
+        } else {
+            oView.setVisibility(View.GONE);
+        }
+        if (s.get("OU") != null) {
+            ouView.setText(s.get("OU"));
+            ouView.setVisibility(View.VISIBLE);
+        } else {
+            ouView.setVisibility(View.GONE);
+        }
+        if (s.get("C") != null) {
+            cView.setText(s.get("C"));
+            cView.setVisibility(View.VISIBLE);
+        } else {
+            cView.setVisibility(View.GONE);
+        }
+        if (s.get("ST") != null) {
+            stView.setText(s.get("ST"));
+            stView.setVisibility(View.VISIBLE);
+        } else {
+            stView.setVisibility(View.GONE);
+        }
+        if (s.get("L") != null) {
+            lView.setText(s.get("L"));
+            lView.setVisibility(View.VISIBLE);
+        } else {
+            lView.setVisibility(View.GONE);
+        }
+    }
+    
+    private void showIssuer(X500Principal issuer, View dialogView) {
+        Map<String, String> s = parsePrincipal(issuer);
+        TextView cnView = ((TextView)dialogView.findViewById(R.id.value_issuer_CN));
+        TextView oView = ((TextView)dialogView.findViewById(R.id.value_issuer_O));
+        TextView ouView = ((TextView)dialogView.findViewById(R.id.value_issuer_OU));
+        TextView cView = ((TextView)dialogView.findViewById(R.id.value_issuer_C));
+        TextView stView = ((TextView)dialogView.findViewById(R.id.value_issuer_ST));
+        TextView lView = ((TextView)dialogView.findViewById(R.id.value_issuer_L));
+        
+        if (s.get("CN") != null) {
+            cnView.setText(s.get("CN"));
+            cnView.setVisibility(View.VISIBLE);
+        } else {
+            cnView.setVisibility(View.GONE);
+        }
+        if (s.get("O") != null) {
+            oView.setText(s.get("O"));
+            oView.setVisibility(View.VISIBLE);
+        } else {
+            oView.setVisibility(View.GONE);
+        }
+        if (s.get("OU") != null) {
+            ouView.setText(s.get("OU"));
+            ouView.setVisibility(View.VISIBLE);
+        } else {
+            ouView.setVisibility(View.GONE);
+        }
+        if (s.get("C") != null) {
+            cView.setText(s.get("C"));
+            cView.setVisibility(View.VISIBLE);
+        } else {
+            cView.setVisibility(View.GONE);
+        }
+        if (s.get("ST") != null) {
+            stView.setText(s.get("ST"));
+            stView.setVisibility(View.VISIBLE);
+        } else {
+            stView.setVisibility(View.GONE);
+        }
+        if (s.get("L") != null) {
+            lView.setText(s.get("L"));
+            lView.setVisibility(View.VISIBLE);
+        } else {
+            lView.setVisibility(View.GONE);
+        }
+    }
+    
+
+    private Map<String, String> parsePrincipal(X500Principal principal) {
+        Map<String, String> result = new HashMap<String, String>();
+        String toParse = principal.getName();
+        String[] pieces = toParse.split(",");
+        String[] tokens = {"CN", "O", "OU", "C", "ST", "L"}; 
+        for (int i=0; i < pieces.length ; i++) {
+            for (int j=0; j<tokens.length; j++) {
+                if (pieces[i].startsWith(tokens[j] + "=")) {
+                    result.put(tokens[j], pieces[i].substring(tokens[j].length()+1));
+                }
+            }
+        }
+        return result;
+    }
+
+}
index 2203e03..5622441 100644 (file)
@@ -1,3 +1,19 @@
+/* ownCloud Android client application
+ *   Copyright (C) 2012-2014 ownCloud Inc.
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2,
+ *   as published by the Free Software Foundation.
+ *
+ *   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 <http://www.gnu.org/licenses/>.
+ *
+ */
 package com.owncloud.android.ui.dialog;
 
 import com.owncloud.android.R;
index 1752606..cbf1acb 100644 (file)
@@ -1,5 +1,5 @@
 /* ownCloud Android client application
- *   Copyright (C) 2012-2013 ownCloud Inc.
+ *   Copyright (C) 2012-2014 ownCloud Inc.
  *
  *   This program is free software: you can redistribute it and/or modify
  *   it under the terms of the GNU General Public License version 2,
@@ -30,9 +30,9 @@ import android.view.View;
 import android.view.ViewGroup;
 import android.webkit.CookieManager;
 import android.webkit.CookieSyncManager;
-import android.webkit.WebBackForwardList;
 import android.webkit.WebSettings;
 import android.webkit.WebView;
+import android.widget.RelativeLayout;
 
 import com.actionbarsherlock.app.SherlockDialogFragment;
 import com.owncloud.android.R;
@@ -56,7 +56,6 @@ public class SamlWebViewDialog extends SherlockDialogFragment {
 
     private static final String ARG_INITIAL_URL = "INITIAL_URL";
     private static final String ARG_TARGET_URL = "TARGET_URL";
-    private static final String KEY_WEBVIEW_STATE = "WEBVIEW_STATE";
     
     private WebView mSsoWebView;
     private SsoWebViewClient mWebViewClient;
@@ -68,9 +67,6 @@ public class SamlWebViewDialog extends SherlockDialogFragment {
 
     private SsoWebViewClientListener mSsoWebViewClientListener;
 
-    //private View mSsoRootView;
-
-
     /**
      * Public factory method to get dialog instances.
      * 
@@ -103,7 +99,7 @@ public class SamlWebViewDialog extends SherlockDialogFragment {
         try {
             mSsoWebViewClientListener = (SsoWebViewClientListener) activity;
             mHandler = new Handler();
-            mWebViewClient = new SsoWebViewClient(mHandler, mSsoWebViewClientListener);
+            mWebViewClient = new SsoWebViewClient(activity, mHandler, mSsoWebViewClientListener);
             
        } catch (ClassCastException e) {
             throw new ClassCastException(activity.toString() + " must implement " + SsoWebViewClientListener.class.getSimpleName());
@@ -114,10 +110,12 @@ public class SamlWebViewDialog extends SherlockDialogFragment {
     @SuppressLint("SetJavaScriptEnabled")
     @Override
     public void onCreate(Bundle savedInstanceState) {
-        Log_OC.d(TAG, "onCreate");
+        Log_OC.d(TAG, "onCreate, savedInstanceState is " + savedInstanceState);
         super.onCreate(savedInstanceState);
         
-        CookieSyncManager.createInstance(getActivity());
+        setRetainInstance(true);
+        
+        CookieSyncManager.createInstance(getSherlockActivity().getApplicationContext());
 
         if (savedInstanceState == null) {
             mInitialUrl = getArguments().getString(ARG_INITIAL_URL);
@@ -130,82 +128,68 @@ public class SamlWebViewDialog extends SherlockDialogFragment {
         setStyle(SherlockDialogFragment.STYLE_NO_TITLE, R.style.Theme_ownCloud_Dialog);
     }
     
-    @Override
-    public Dialog onCreateDialog(Bundle savedInstanceState) {
-        Log_OC.d(TAG, "onCreateDialog");
-
-        /*
-        // build the dialog
-        AlertDialog.Builder builder = new AlertDialog.Builder(getSherlockActivity());
-        if (mSsoRootView.getParent() != null) {
-            ((ViewGroup)(mSsoRootView.getParent())).removeView(mSsoRootView);
-        }
-        builder.setView(mSsoRootView);
-        //builder.setView(mSsoWebView);
-        Dialog dialog = builder.create();
-        */
-        
-        return super.onCreateDialog(savedInstanceState);
-    }
-
+    @SuppressWarnings("deprecation")
     @SuppressLint("SetJavaScriptEnabled")
     @Override
     public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
-        Log_OC.d(TAG, "onCreateView");
+        Log_OC.d(TAG, "onCreateView, savedInsanceState is " + savedInstanceState);
         
         // Inflate layout of the dialog  
-        View rootView = inflater.inflate(R.layout.sso_dialog, container, false);  // null parent view because it will go in the dialog layout
-        mSsoWebView  = (WebView) rootView.findViewById(R.id.sso_webview);
-            
-        mWebViewClient.setTargetUrl(mTargetUrl);
-        mSsoWebView.setWebViewClient(mWebViewClient);
+        RelativeLayout ssoRootView = (RelativeLayout) inflater.inflate(R.layout.sso_dialog, container, false);  // null parent view because it will go in the dialog layout
         
-        if (savedInstanceState == null) {
-            Log_OC.d(TAG,  "   initWebView start");
+        if (mSsoWebView == null) {
+            // initialize the WebView
+            mSsoWebView = new SsoWebView(getSherlockActivity().getApplicationContext());
+            mSsoWebView.setFocusable(true);
+            mSsoWebView.setFocusableInTouchMode(true);
+            mSsoWebView.setClickable(true);
+            
             CookieManager cookieManager = CookieManager.getInstance();
             cookieManager.setAcceptCookie(true);
             cookieManager.removeAllCookie();
             mSsoWebView.loadUrl(mInitialUrl);
-            
-        } else {
-            Log_OC.d(TAG, "   restoreWebView start");
-            WebBackForwardList history = mSsoWebView.restoreState(savedInstanceState.getBundle(KEY_WEBVIEW_STATE));
-            if (history == null) {
-                Log_OC.e(TAG, "Error restoring WebView state ; back to starting URL");
-                mSsoWebView.loadUrl(mInitialUrl);
-            }
+          
+            WebSettings webSettings = mSsoWebView.getSettings();
+            webSettings.setJavaScriptEnabled(true);
+            webSettings.setBuiltInZoomControls(false);
+            webSettings.setLoadWithOverviewMode(false);
+            webSettings.setSavePassword(false);
+            webSettings.setUserAgentString(OwnCloudClient.USER_AGENT);
+            webSettings.setSaveFormData(false);
         }
-
-        WebSettings webSettings = mSsoWebView.getSettings();
-        webSettings.setJavaScriptEnabled(true);
-        webSettings.setBuiltInZoomControls(true);
-        webSettings.setLoadWithOverviewMode(false);
-        webSettings.setSavePassword(false);
-        webSettings.setUserAgentString(OwnCloudClient.USER_AGENT);
-        webSettings.setSaveFormData(false);
         
-        return rootView;
+        mWebViewClient.setTargetUrl(mTargetUrl);
+        mSsoWebView.setWebViewClient(mWebViewClient);
+        
+        // add the webview into the layout
+        RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(
+                RelativeLayout.LayoutParams.WRAP_CONTENT, 
+                RelativeLayout.LayoutParams.WRAP_CONTENT
+                );
+        ssoRootView.addView(mSsoWebView, layoutParams);
+        ssoRootView.requestLayout();
+        
+        return ssoRootView;
     }
 
     @Override
     public void onSaveInstanceState(Bundle outState) {
-        Log_OC.d(SAML_DIALOG_TAG, "onSaveInstanceState being CALLED");
+        Log_OC.d(TAG, "onSaveInstanceState being CALLED");
         super.onSaveInstanceState(outState);
         
         // save URLs
         outState.putString(ARG_INITIAL_URL, mInitialUrl);
         outState.putString(ARG_TARGET_URL, mTargetUrl);
-        
-        // Save the state of the WebView
-        Bundle webviewState = new Bundle();
-        mSsoWebView.saveState(webviewState);
-        outState.putBundle(KEY_WEBVIEW_STATE, webviewState);
     }
 
     @Override
     public void onDestroyView() {
         Log_OC.d(TAG, "onDestroyView");
         
+        if ((ViewGroup)mSsoWebView.getParent() != null) {
+            ((ViewGroup)mSsoWebView.getParent()).removeView(mSsoWebView);
+        }
+        
         mSsoWebView.setWebViewClient(null);
         
         // Work around bug: http://code.google.com/p/android/issues/detail?id=17423
@@ -235,50 +219,52 @@ public class SamlWebViewDialog extends SherlockDialogFragment {
     
     @Override
     public void onCancel (DialogInterface dialog) {
-        Log_OC.d(SAML_DIALOG_TAG, "onCancel");
+        Log_OC.d(TAG, "onCancel");
         super.onCancel(dialog);
     }
     
     @Override
     public void onDismiss (DialogInterface dialog) {
-        Log_OC.d(SAML_DIALOG_TAG, "onDismiss");
+        Log_OC.d(TAG, "onDismiss");
         super.onDismiss(dialog);
     }
     
     @Override
     public void onStart() {
-        Log_OC.d(SAML_DIALOG_TAG, "onStart");
+        Log_OC.d(TAG, "onStart");
         super.onStart();
     }
 
     @Override
     public void onStop() {
-        Log_OC.d(SAML_DIALOG_TAG, "onStop");
+        Log_OC.d(TAG, "onStop");
         super.onStop();
     }
 
     @Override
     public void onResume() {
-        Log_OC.d(SAML_DIALOG_TAG, "onResume");
+        Log_OC.d(TAG, "onResume");
         super.onResume();
+        mSsoWebView.onResume();
     }
 
     @Override
     public void onPause() {
-        Log_OC.d(SAML_DIALOG_TAG, "onPause");
+        Log_OC.d(TAG, "onPause");
+        mSsoWebView.onPause();
         super.onPause();
     }
     
     @Override
     public int show (FragmentTransaction transaction, String tag) {
-        Log_OC.d(SAML_DIALOG_TAG, "show (transaction)");
+        Log_OC.d(TAG, "show (transaction)");
         return super.show(transaction, tag);
     }
 
     @Override
     public void show (FragmentManager manager, String tag) {
-        Log_OC.d(SAML_DIALOG_TAG, "show (manager)");
+        Log_OC.d(TAG, "show (manager)");
         super.show(manager, tag);
     }
-
+    
 }
\ No newline at end of file
diff --git a/src/com/owncloud/android/ui/dialog/SslUntrustedCertDialog.java b/src/com/owncloud/android/ui/dialog/SslUntrustedCertDialog.java
new file mode 100644 (file)
index 0000000..315ed19
--- /dev/null
@@ -0,0 +1,241 @@
+/* ownCloud Android client application
+ *   Copyright (C) 2012-2014 ownCloud Inc.
+ *
+ *   This program is free software: you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License version 2,
+ *   as published by the Free Software Foundation.
+ *
+ *   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 <http://www.gnu.org/licenses/>.
+ *
+ */
+package com.owncloud.android.ui.dialog;
+
+import java.io.IOException;
+import java.security.GeneralSecurityException;
+import java.security.cert.X509Certificate;
+
+import android.app.Activity;
+import android.app.Dialog;
+import android.net.http.SslError;
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.Window;
+import android.view.View.OnClickListener;
+import android.webkit.SslErrorHandler;
+import android.widget.Button;
+
+import com.actionbarsherlock.app.SherlockDialogFragment;
+import com.owncloud.android.R;
+import com.owncloud.android.lib.common.network.CertificateCombinedException;
+import com.owncloud.android.lib.common.network.NetworkUtils;
+import com.owncloud.android.ui.adapter.CertificateCombinedExceptionViewAdapter;
+import com.owncloud.android.ui.adapter.SslCertificateViewAdapter;
+import com.owncloud.android.ui.adapter.SslErrorViewAdapter;
+import com.owncloud.android.ui.adapter.X509CertificateViewAdapter;
+import com.owncloud.android.utils.Log_OC;
+
+/**
+ * Dialog to show information about an untrusted certificate and allow the user
+ * to decide trust on it or not.
+ * 
+ * Abstract implementation of common functionality for different dialogs that
+ * get the information about the error and the certificate from different classes. 
+ * 
+ * @author masensio
+ * @author David A. Velasco
+ */
+public class SslUntrustedCertDialog extends SherlockDialogFragment {
+    
+    private final static String TAG = SslUntrustedCertDialog.class.getSimpleName();
+    
+    protected View mView = null;
+    protected SslErrorHandler mHandler = null;
+    protected X509Certificate m509Certificate = null;
+
+    private ErrorViewAdapter mErrorViewAdapter = null;
+    private CertificateViewAdapter mCertificateViewAdapter = null;
+    
+    public static SslUntrustedCertDialog newInstanceForEmptySslError(SslError error, SslErrorHandler handler) {
+        if (error == null) {
+            throw new IllegalArgumentException("Trying to create instance with parameter error == null");
+        }
+        if (handler == null) {
+            throw new IllegalArgumentException("Trying to create instance with parameter handler == null");
+        }
+        SslUntrustedCertDialog dialog = new SslUntrustedCertDialog();
+        dialog.mHandler = handler;
+        dialog.mErrorViewAdapter = new SslErrorViewAdapter(error);
+        dialog.mCertificateViewAdapter = new SslCertificateViewAdapter(error.getCertificate());
+        return dialog;
+    }
+    
+    public static SslUntrustedCertDialog newInstanceForFullSslError(CertificateCombinedException sslException) {
+        if (sslException == null) {
+            throw new IllegalArgumentException("Trying to create instance with parameter sslException == null");
+        }
+        SslUntrustedCertDialog dialog = new SslUntrustedCertDialog();
+        dialog.m509Certificate = sslException.getServerCertificate();
+        dialog.mErrorViewAdapter = new CertificateCombinedExceptionViewAdapter(sslException);
+        dialog.mCertificateViewAdapter = new X509CertificateViewAdapter(sslException.getServerCertificate());
+        return dialog;
+    }
+    
+    public static SslUntrustedCertDialog newInstanceForFullSslError(X509Certificate cert, SslError error, SslErrorHandler handler) {
+        if (cert == null) {
+            throw new IllegalArgumentException("Trying to create instance with parameter cert == null");
+        }
+        if (error == null) {
+            throw new IllegalArgumentException("Trying to create instance with parameter error == null");
+        }
+        if (handler == null) {
+            throw new IllegalArgumentException("Trying to create instance with parameter handler == null");
+        }
+        SslUntrustedCertDialog dialog = new SslUntrustedCertDialog();
+        dialog.m509Certificate = cert;
+        dialog.mHandler = handler;
+        dialog.mErrorViewAdapter = new SslErrorViewAdapter(error);
+        dialog.mCertificateViewAdapter = new X509CertificateViewAdapter(cert);
+        return dialog;
+    }
+    
+    
+    @Override
+    public void onAttach(Activity activity) {
+        Log_OC.d(TAG, "onAttach");
+        super.onAttach(activity);
+        if (!(activity instanceof OnSslUntrustedCertListener)) {
+            throw new IllegalArgumentException("The host activity must implement " + OnSslUntrustedCertListener.class.getCanonicalName());
+        }
+    }
+
+    
+    @Override
+    public void onCreate(Bundle savedInstanceState) {
+        Log_OC.d(TAG, "onCreate, savedInstanceState is " + savedInstanceState);
+        super.onCreate(savedInstanceState);
+        setRetainInstance(true);    // force to keep the state of the fragment on configuration changes (such as device rotations)
+        setCancelable(false);
+        mView = null;
+    }
+    
+    @Override
+    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+        Log_OC.d(TAG, "onCreateView, savedInsanceState is " + savedInstanceState);
+        // Create a view by inflating desired layout
+        if (mView == null) {
+            mView = inflater.inflate(R.layout.ssl_untrusted_cert_layout, container,  false);
+            mView.findViewById(R.id.details_scroll).setVisibility(View.GONE);
+            mErrorViewAdapter.updateErrorView(mView);
+        } else {
+            ((ViewGroup)mView.getParent()).removeView(mView);
+        }
+        
+        Button ok = (Button) mView.findViewById(R.id.ok);
+        ok.setOnClickListener(new OnCertificateTrusted());
+        
+        Button cancel = (Button) mView.findViewById(R.id.cancel);
+        cancel.setOnClickListener(new OnCertificateNotTrusted());
+        
+        Button details = (Button) mView.findViewById(R.id.details_btn);
+        details.setOnClickListener(new OnClickListener() {
+
+            @Override
+            public void onClick(View v) {
+                View detailsScroll = mView.findViewById(R.id.details_scroll);
+                if (detailsScroll.getVisibility() == View.VISIBLE) {
+                    detailsScroll.setVisibility(View.GONE);
+                    ((Button) v).setText(R.string.ssl_validator_btn_details_see);
+
+                } else {
+                    detailsScroll.setVisibility(View.VISIBLE);
+                    ((Button) v).setText(R.string.ssl_validator_btn_details_hide);
+                    mCertificateViewAdapter.updateCertificateView(mView);
+                }
+            }
+
+        });
+        
+        return mView;
+    }
+    
+
+    @Override
+    public Dialog onCreateDialog(Bundle savedInstanceState) {
+        Log_OC.d(TAG, "onCreateDialog, savedInstanceState is " + savedInstanceState);
+        final Dialog dialog = super.onCreateDialog(savedInstanceState);
+        dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
+        return dialog;
+    }
+
+    @Override
+    public void onDestroyView() {
+        Log_OC.d(TAG, "onDestroyView");
+        if (getDialog() != null && getRetainInstance())
+            getDialog().setDismissMessage(null);
+        super.onDestroyView();
+    }
+    
+    private class OnCertificateNotTrusted implements OnClickListener {
+        
+        @Override
+        public void onClick(View v) {
+            getDialog().cancel();
+            if (mHandler != null) {
+                mHandler.cancel();
+            }
+            ((OnSslUntrustedCertListener)getSherlockActivity()).onCancelCertificate();
+        }
+    }
+    
+    
+    private class OnCertificateTrusted implements OnClickListener {
+
+        @Override
+        public void onClick(View v) {
+            dismiss();
+            if (mHandler != null) {
+                mHandler.proceed();
+            }
+            if (m509Certificate != null) {
+                Activity activity = getSherlockActivity();
+                try {
+                    NetworkUtils.addCertToKnownServersStore(m509Certificate, activity);   // TODO make this asynchronously, it can take some time
+                    ((OnSslUntrustedCertListener)activity).onSavedCertificate();
+    
+                } catch (GeneralSecurityException e) {
+                    ((OnSslUntrustedCertListener)activity).onFailedSavingCertificate();
+                    Log_OC.e(TAG, "Server certificate could not be saved in the known-servers trust store ", e);
+                  
+                } catch (IOException e) {
+                    ((OnSslUntrustedCertListener)activity).onFailedSavingCertificate();
+                    Log_OC.e(TAG, "Server certificate could not be saved in the known-servers trust store ", e);
+                }
+            }
+        }
+        
+    }
+    
+    
+    public interface OnSslUntrustedCertListener {
+        public void onSavedCertificate();
+        public void onFailedSavingCertificate();
+        public void onCancelCertificate();
+    }
+    
+    public interface ErrorViewAdapter {
+        void updateErrorView(View mView);
+    }
+    
+    public interface CertificateViewAdapter {
+        void updateCertificateView(View mView);
+    }
+    
+}
index 920e696..0e95552 100644 (file)
@@ -223,6 +223,7 @@ public class SslValidatorDialog extends Dialog {
         return hex.toString();
      }    
 
+    @SuppressWarnings("deprecation")
     private void showValidity(Date notBefore, Date notAfter) {
         TextView fromView = ((TextView)mView.findViewById(R.id.value_validity_from));
         TextView toView = ((TextView)mView.findViewById(R.id.value_validity_to));
index 0da4fbc..d7cc36d 100644 (file)
@@ -23,7 +23,6 @@ import android.content.Intent;
 import android.content.IntentFilter;
 import android.content.ServiceConnection;
 import android.content.SharedPreferences;
-import android.content.res.Configuration;
 import android.os.Bundle;
 import android.os.IBinder;
 import android.preference.PreferenceManager;
index 48dc047..c674e91 100644 (file)
@@ -27,7 +27,6 @@ import android.accounts.Account;
 import android.app.AlertDialog;
 import android.content.DialogInterface;
 import android.content.Intent;
-import android.content.res.Configuration;
 import android.media.MediaPlayer;
 import android.media.MediaPlayer.OnCompletionListener;
 import android.media.MediaPlayer.OnErrorListener;