Forráskód Böngészése

Quick patch to fix operations not ready for HTTPS

David A. Velasco 12 éve
szülő
commit
a032bdeebc

+ 1 - 1
AndroidManifest.xml

@@ -18,7 +18,7 @@
  -->
 <manifest package="eu.alefzero.owncloud"
     android:versionCode="1"
-    android:versionName="0.1.183B" xmlns:android="http://schemas.android.com/apk/res/android">
+    android:versionName="0.1.184B" xmlns:android="http://schemas.android.com/apk/res/android">
 
     <uses-permission android:name="android.permission.GET_ACCOUNTS" />
     <uses-permission android:name="android.permission.USE_CREDENTIALS" />

+ 1 - 0
src/eu/alefzero/owncloud/Uploader.java

@@ -369,6 +369,7 @@ public class Uploader extends ListActivity implements OnItemClickListener, andro
 
     public void uploadFiles() {
         WebdavClient wdc = new WebdavClient(mAccount, getApplicationContext());
+        wdc.allowSelfsignedCertificates();
 
         // create last directory in path if nessesary
         if (mCreateDir) {

+ 2 - 2
src/eu/alefzero/owncloud/datamodel/OCFile.java

@@ -373,8 +373,8 @@ public class OCFile implements Parcelable, Comparable<OCFile> {
 
     @Override
     public String toString() {
-        String asString = "[id=%s, name=%s, mime=%s, downloaded=%s, local=%s, remote=%s]";
-        asString = String.format(asString, new Long(mId), getFileName(), mMimeType, isDown(), mLocalPath, mRemotePath);
+        String asString = "[id=%s, name=%s, mime=%s, downloaded=%s, local=%s, remote=%s, parentId=%s, keepInSinc=%s]";
+        asString = String.format(asString, new Long(mId), getFileName(), mMimeType, isDown(), mLocalPath, mRemotePath, new Long(mParentId), new Boolean(mKeepInSync));
         return asString;
     }
 

+ 1 - 0
src/eu/alefzero/owncloud/files/services/FileUploader.java

@@ -144,6 +144,7 @@ public class FileUploader extends Service implements OnDatatransferProgressListe
         mNotificationManager.notify(42, mNotification);
 
         WebdavClient wc = new WebdavClient(mAccount, getApplicationContext());
+        wc.allowSelfsignedCertificates();
         wc.setDataTransferProgressListener(this);
 
         for (int i = 0; i < mLocalPaths.length; ++i) {

+ 1 - 0
src/eu/alefzero/owncloud/syncadapter/AbstractOwnCloudSyncAdapter.java

@@ -154,6 +154,7 @@ public abstract class AbstractOwnCloudSyncAdapter extends
                 throw new UnknownHostException();
             }
             mClient = new WebdavClient(account, getContext());
+            mClient.allowSelfsignedCertificates();
             // mHost = mClient.getTargetHost();
         }
 

+ 4 - 2
src/eu/alefzero/owncloud/syncadapter/FileSyncAdapter.java

@@ -150,7 +150,7 @@ public class FileSyncAdapter extends AbstractOwnCloudSyncAdapter {
 
     private void fetchData(String uri, SyncResult syncResult, long parentId) {
         try {
-            //Log.v(TAG, "syncing: fetching " + uri);
+            Log.d(TAG, "fetching " + uri);
             
             // remote request 
             PropFindMethod query = new PropFindMethod(uri);
@@ -187,6 +187,7 @@ public class FileSyncAdapter extends AbstractOwnCloudSyncAdapter {
                     file.setKeepInSync(getStorageManager().getFileByPath(file.getRemotePath()).keepInSync());
                 
                 //getStorageManager().saveFile(file);
+                Log.v(TAG, "adding file: " + file);
                 updatedFiles.add(file);
                 if (parentId == 0)
                     parentId = file.getFileId();
@@ -207,6 +208,7 @@ public class FileSyncAdapter extends AbstractOwnCloudSyncAdapter {
             for (int i=0; i < files.size(); ) {
                 file = files.get(i);
                 if (file.getLastSyncDate() != mCurrentSyncTime) {
+                    Log.v(TAG, "removing file: " + file);
                     getStorageManager().removeFile(file);
                     files.remove(i);
                 } else {
@@ -224,7 +226,7 @@ public class FileSyncAdapter extends AbstractOwnCloudSyncAdapter {
                     fetchData(getUri().toString() + WebdavUtils.encodePath(newFile.getRemotePath()), syncResult, newFile.getFileId());
                 }
             }
-            if (mCancellation) Log.d(TAG, "Leaving " + uri + " because cancellation request");
+            if (mCancellation) Log.d(TAG, "Leaving " + uri + " because cancelation request");
                 
             /*  Commented code for ugly performance tests
             mResponseDelays[mDelaysIndex] = responseDelay;

+ 2 - 0
src/eu/alefzero/owncloud/ui/fragment/FileDetailFragment.java

@@ -733,6 +733,7 @@ public class FileDetailFragment extends SherlockFragment implements
         
         public void run() {
             WebdavClient wc = new WebdavClient(mAccount, getSherlockActivity().getApplicationContext());
+            wc.allowSelfsignedCertificates();
             AccountManager am = AccountManager.get(getSherlockActivity());
             String baseUrl = am.getUserData(mAccount, AccountAuthenticator.KEY_OC_BASE_URL);
             OwnCloudVersion ocv = new OwnCloudVersion(am.getUserData(mAccount, AccountAuthenticator.KEY_OC_VERSION));
@@ -863,6 +864,7 @@ public class FileDetailFragment extends SherlockFragment implements
         
         public void run() {
             WebdavClient wc = new WebdavClient(mAccount, getSherlockActivity().getApplicationContext());
+            wc.allowSelfsignedCertificates();
             AccountManager am = AccountManager.get(getSherlockActivity());
             String baseUrl = am.getUserData(mAccount, AccountAuthenticator.KEY_OC_BASE_URL);
             OwnCloudVersion ocv = new OwnCloudVersion(am.getUserData(mAccount, AccountAuthenticator.KEY_OC_VERSION));