فهرست منبع

Merge pull request #1706 from owncloud/stable

Merge version 2.0.1 from stable to master
David A. Velasco 9 سال پیش
والد
کامیت
b9e0c34fc3

+ 2 - 2
AndroidManifest.xml

@@ -19,8 +19,8 @@
 -->
 -->
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
     package="com.owncloud.android"
     package="com.owncloud.android"
-    android:versionCode="20000000"
-    android:versionName="2.0.0" >
+    android:versionCode="20000001"
+    android:versionName="2.0.1" >
 
 
     <uses-sdk
     <uses-sdk
         android:minSdkVersion="14"
         android:minSdkVersion="14"

+ 10 - 0
CHANGELOG.md

@@ -1,3 +1,13 @@
+## 2.0.1 (June 2016)
+- Favorite files are now called AVAILABLE OFFLINE
+- New overlay icons
+- Bugs fixed, including:
+ + Upload content from other apps works again
+ + Passwords with non-alphanumeric characters work fine
+ + Sending files from other apps does not duplicate them
+ + Favorite setting is not lost after uploading
+ + Instant uploads waiting for Wi-Fi are not shown as failed				
+
 ## 2.0.0 (April 2016)
 ## 2.0.0 (April 2016)
 - Uploads view: track the progress of your uploads and handle failures
 - Uploads view: track the progress of your uploads and handle failures
 - Federated sharing: share files with users in other ownCloud servers
 - Federated sharing: share files with users in other ownCloud servers

+ 61 - 1
build.gradle

@@ -123,4 +123,64 @@ android {
         exclude 'META-INF/LICENSE.txt'
         exclude 'META-INF/LICENSE.txt'
     }
     }
 
 
-}
+    signingConfigs {
+        release {
+            if (System.env.OC_RELEASE_KEYSTORE) {
+                storeFile file(System.env.OC_RELEASE_KEYSTORE)  // use an absolute path
+                storePassword System.env.OC_RELEASE_KEYSTORE_PASSWORD
+                keyAlias System.env.OC_RELEASE_KEY_ALIAS
+                keyPassword System.env.OC_RELEASE_KEY_PASSWORD
+            }
+        }
+    }
+
+    buildTypes {
+        release {
+            signingConfig signingConfigs.release
+        }
+    }
+
+    applicationVariants.all { variant ->
+        def appName = System.env.OC_APP_NAME
+        setOutputFileName(variant, appName, project)
+    }
+
+}
+
+// Updates output file names of a given variant to format
+// [appName].[variant.versionName].[OC_BUILD_NUMBER]-[variant.name].apk.
+//
+// OC_BUILD_NUMBER is an environment variable read directly in this method. If undefined, it's not added.
+//
+// @param variant           Build variant instance which output file name will be updated.
+// @param appName           String to use as first part of the new file name. May be undefined, the original
+//                          project.archivesBaseName property will be used instead.
+// @param callerProject     Caller project.
+
+def setOutputFileName(variant, appName, callerProject) {
+    logger.info("Setting new name for output of variant $variant.name")
+
+    def originalFile = variant.outputs[0].outputFile;
+    def originalName = originalFile.name;
+    logger.info("$variant.name: originalName is $originalName")
+
+    def newName = ""
+
+    if (appName) {
+        newName += appName
+    } else {
+        newName += callerProject.archivesBaseName
+    }
+
+    newName += "_$variant.versionName"
+
+    def buildNumber = System.env.OC_BUILD_NUMBER
+    if (buildNumber) {
+        newName += ".$buildNumber"
+    }
+
+    newName += originalName.substring(callerProject.archivesBaseName.length())
+
+    logger.info("$variant.name: newName is $newName")
+    variant.outputs[0].outputFile = new File(originalFile.parent, newName)
+}

+ 2 - 2
oc_jb_workaround/AndroidManifest.xml

@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="utf-8"?>
 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
     package="com.owncloud.android.workaround.accounts"
     package="com.owncloud.android.workaround.accounts"
-    android:versionCode="0100028"
-    android:versionName="1.0.28" >
+    android:versionCode="0100029"
+    android:versionName="1.0.29" >
 
 
     <uses-sdk
     <uses-sdk
         android:minSdkVersion="16"
         android:minSdkVersion="16"

+ 26 - 0
oc_jb_workaround/build.gradle

@@ -39,4 +39,30 @@ android {
         debug.setRoot('build-types/debug')
         debug.setRoot('build-types/debug')
         release.setRoot('build-types/release')
         release.setRoot('build-types/release')
     }
     }
+
+    signingConfigs {
+        release {
+            if (System.env.OC_RELEASE_KEYSTORE) {
+                storeFile file(System.env.OC_RELEASE_KEYSTORE)  // use an absolute path
+                storePassword System.env.OC_RELEASE_KEYSTORE_PASSWORD
+                keyAlias System.env.OC_RELEASE_KEY_ALIAS
+                keyPassword System.env.OC_RELEASE_KEY_PASSWORD
+            }
+        }
+    }
+
+    buildTypes {
+        release {
+            signingConfig signingConfigs.release
+        }
+    }
+
+    applicationVariants.all { variant ->
+        def appName = System.env.OC_APP_NAME
+        if (appName) {
+            appName += "_jb_workaround"
+        }
+        setOutputFileName(variant, appName, project)
+    }
+
 }
 }

+ 1 - 1
owncloud-android-library

@@ -1 +1 @@
-Subproject commit 785562038e5b2c9847e8eb5f550065d05fd8137c
+Subproject commit 954f69de990fe1c54bd29a23e52f12e5f41f1c71

+ 5 - 0
src/com/owncloud/android/datamodel/OCFile.java

@@ -636,6 +636,10 @@ public class OCFile implements Parcelable, Comparable<OCFile> {
         return mEtagInConflict;
         return mEtagInConflict;
     }
     }
 
 
+    public boolean isInConflict() {
+        return mEtagInConflict != null && mEtagInConflict != "";
+    }
+
     public void setEtagInConflict(String etagInConflict) {
     public void setEtagInConflict(String etagInConflict) {
         mEtagInConflict = etagInConflict;
         mEtagInConflict = etagInConflict;
     }
     }
@@ -652,4 +656,5 @@ public class OCFile implements Parcelable, Comparable<OCFile> {
         String permissions = getPermissions();
         String permissions = getPermissions();
         return (permissions != null && permissions.contains(PERMISSION_SHARED_WITH_ME));
         return (permissions != null && permissions.contains(PERMISSION_SHARED_WITH_ME));
     }
     }
+
 }
 }

+ 1 - 1
src/com/owncloud/android/operations/RefreshFolderOperation.java

@@ -527,7 +527,7 @@ public class RefreshFolderOperation extends RemoteOperation {
     private void fetchFavoritesToSyncFromLocalData() {
     private void fetchFavoritesToSyncFromLocalData() {
         List<OCFile> children = mStorageManager.getFolderContent(mLocalFolder);
         List<OCFile> children = mStorageManager.getFolderContent(mLocalFolder);
         for (OCFile child : children) {
         for (OCFile child : children) {
-            if (!child.isFolder() && child.isFavorite()) {
+            if (!child.isFolder() && child.isFavorite() && !child.isInConflict()) {
                 SynchronizeFileOperation operation = new SynchronizeFileOperation(
                 SynchronizeFileOperation operation = new SynchronizeFileOperation(
                         child,
                         child,
                         child,  // cheating with the remote file to get an update to server; to refactor
                         child,  // cheating with the remote file to get an update to server; to refactor

+ 4 - 3
src/com/owncloud/android/operations/UpdateShareViaLinkOperation.java

@@ -40,7 +40,7 @@ public class UpdateShareViaLinkOperation extends SyncOperation {
 
 
     private String mPath;
     private String mPath;
     private String mPassword;
     private String mPassword;
-    private boolean mPublicUpload;
+    private Boolean mPublicUpload;
     private long mExpirationDateInMillis;
     private long mExpirationDateInMillis;
 
 
     /**
     /**
@@ -53,7 +53,7 @@ public class UpdateShareViaLinkOperation extends SyncOperation {
         mPath = path;
         mPath = path;
         mPassword = null;
         mPassword = null;
         mExpirationDateInMillis = 0;
         mExpirationDateInMillis = 0;
-        mPublicUpload = false;
+        mPublicUpload = null;
     }
     }
 
 
 
 
@@ -85,8 +85,9 @@ public class UpdateShareViaLinkOperation extends SyncOperation {
      * Enable upload permissions to update in Share resource.
      * Enable upload permissions to update in Share resource.
      *
      *
      * @param publicUpload    Upload Permission to set to the public link.
      * @param publicUpload    Upload Permission to set to the public link.
+     *                        Null results in no update applied to the upload permission.
      */
      */
-    public void setPublicUpload(boolean publicUpload) {
+    public void setPublicUpload(Boolean publicUpload) {
         mPublicUpload = publicUpload;
         mPublicUpload = publicUpload;
     }
     }
 
 

+ 5 - 2
src/com/owncloud/android/services/OperationsService.java

@@ -586,8 +586,11 @@ public class OperationsService extends Service {
                                 expirationDate
                                 expirationDate
                         );
                         );
 
 
-                        boolean publicUpload = operationIntent.getBooleanExtra(EXTRA_SHARE_PUBLIC_UPLOAD, false);
-                        ((UpdateShareViaLinkOperation) operation).setPublicUpload(publicUpload);
+                        if (operationIntent.hasExtra(EXTRA_SHARE_PUBLIC_UPLOAD)) {
+                            ((UpdateShareViaLinkOperation) operation).setPublicUpload(
+                                operationIntent.getBooleanExtra(EXTRA_SHARE_PUBLIC_UPLOAD, false)
+                            );
+                        }
 
 
                     } else if (shareId > 0) {
                     } else if (shareId > 0) {
                         operation = new UpdateSharePermissionsOperation(shareId);
                         operation = new UpdateSharePermissionsOperation(shareId);

+ 5 - 6
src/com/owncloud/android/ui/dialog/RemoveFileDialogFragment.java

@@ -54,19 +54,18 @@ implements ConfirmationDialogFragmentListener {
         
         
         int messageStringId = R.string.confirmation_remove_alert;
         int messageStringId = R.string.confirmation_remove_alert;
         
         
-        int negBtn = -1;
+        int localRemoveButton = (!file.isFavorite() && (file.isFolder() || file.isDown())) ?
+            R.string.confirmation_remove_local : -1;
+
         if (file.isFolder()) {
         if (file.isFolder()) {
             messageStringId = R.string.confirmation_remove_folder_alert;
             messageStringId = R.string.confirmation_remove_folder_alert;
-            negBtn = R.string.confirmation_remove_local;
-        } else if (file.isDown()) {
-            negBtn = R.string.confirmation_remove_local;
         }
         }
-        
+
         args.putInt(ARG_MESSAGE_RESOURCE_ID, messageStringId);
         args.putInt(ARG_MESSAGE_RESOURCE_ID, messageStringId);
         args.putStringArray(ARG_MESSAGE_ARGUMENTS, new String[]{file.getFileName()});
         args.putStringArray(ARG_MESSAGE_ARGUMENTS, new String[]{file.getFileName()});
         args.putInt(ARG_POSITIVE_BTN_RES, R.string.common_yes);
         args.putInt(ARG_POSITIVE_BTN_RES, R.string.common_yes);
         args.putInt(ARG_NEUTRAL_BTN_RES, R.string.common_no);
         args.putInt(ARG_NEUTRAL_BTN_RES, R.string.common_no);
-        args.putInt(ARG_NEGATIVE_BTN_RES, negBtn);
+        args.putInt(ARG_NEGATIVE_BTN_RES, localRemoveButton);
         args.putParcelable(ARG_TARGET_FILE, file);
         args.putParcelable(ARG_TARGET_FILE, file);
         frag.setArguments(args);
         frag.setArguments(args);