Compare commits

...
Author SHA1 Message Date
Tobias Kaminsky 23a1a1f3b6 daily dev 20180914 2018-09-14 00:32:13 +02:00
Andy Scherzinger 5ac1af47c1 Merge pull request #3037 from nextcloud/switchAccount
Fix account switching: After adding an account, the app restart and uses the new account
2018-09-13 12:51:36 +02:00
tobiasKaminsky 0c86ed9f77 fix account switching: now after adding an account, the app restart and uses the new account
Signed-off-by: tobiasKaminsky <[email protected]>
2018-09-13 11:28:05 +02:00
Andy Scherzinger ff6cf2df4a Merge pull request #3033 from nextcloud/quickfixForUnknownSharingType
Quickfix for unknown SharingTypes
2018-09-13 10:16:16 +02:00
tobiasKaminsky 9f2b8a73c8 quickfix for unknown SharingTypes
Signed-off-by: tobiasKaminsky <[email protected]>
2018-09-13 09:04:41 +02:00
Andy Scherzinger c4bbb792dc Merge pull request #3032 from nextcloud/dependabot/gradle/jacocoVersion
Bump jacocoVersion from 0.7.4.201502262128 to 0.8.2
2018-09-13 06:32:54 +02:00
dependabot[bot] ba84def527 Bump jacocoVersion from 0.7.4.201502262128 to 0.8.2
Bumps `jacocoVersion` from 0.7.4.201502262128 to 0.8.2.

Updates `org.jacoco.ant` from 0.7.4.201502262128 to 0.8.2
- [Release notes](https://github.com/jacoco/jacoco/releases)
- [Commits](https://github.com/jacoco/jacoco/commits/v0.8.2)

Updates `org.jacoco.agent` from 0.7.4.201502262128 to 0.8.2
- [Release notes](https://github.com/jacoco/jacoco/releases)
- [Commits](https://github.com/jacoco/jacoco/commits/v0.8.2)

Updates `org.jacoco.core` from 0.7.4.201502262128 to 0.8.2
- [Release notes](https://github.com/jacoco/jacoco/releases)
- [Commits](https://github.com/jacoco/jacoco/commits/v0.8.2)

Updates `org.jacoco.report` from 0.7.4.201502262128 to 0.8.2
- [Release notes](https://github.com/jacoco/jacoco/releases)
- [Commits](https://github.com/jacoco/jacoco/commits/v0.8.2)

Signed-off-by: dependabot[bot] <[email protected]>
2018-09-13 01:14:21 +00:00
Nextcloud bot d7d2e1916f [tx-robot] updated from transifex 2018-09-13 00:49:04 +00:00
Tobias Kaminsky cc66d8857e daily dev 20180913 2018-09-13 00:33:41 +02:00
Andy Scherzinger fc62aa42b8 Merge pull request #3010 from nextcloud/codacy
Codacy
2018-09-12 16:41:32 +02:00
Andy Scherzinger fc3a911a14 Merge pull request #3028 from nextcloud/deleteProguard
Delete proguard
2018-09-12 16:04:59 +02:00
AndyScherzinger ee4ec654de CR 2018-09-12 16:02:59 +02:00
Tobias Kaminsky 755425cf0c Delete proguard
As discussed in https://github.com/nextcloud/android-library/issues/160 proguard.cfg is not correctly working.
As we do not use it, this should be removed.
2018-09-12 14:51:23 +02:00
AndyScherzinger c839a5b83e codacy: avoid using Literals in Conditional Statements 2018-09-12 13:53:21 +02:00
AndyScherzinger 112450418a organize imports 2018-09-12 13:53:20 +02:00
AndyScherzinger f6f0165caf explicitly cast var-arg parameter (null) to String[] to get rid of compiler warning 2018-09-12 13:53:20 +02:00
AndyScherzinger 0fb3dedef1 fix all experimental warnings found by findbugs (missing stream closing) 2018-09-12 13:53:19 +02:00
AndyScherzinger 333dfcb1ed codacy: avoid using implementation types like 'HashMap'; use the interface instead 2018-09-12 13:53:18 +02:00
AndyScherzinger f81415dbab make all utils methods static 2018-09-12 13:53:18 +02:00
AndyScherzinger d5008116db codacy: avoid using Literals in Conditional Statements 2018-09-12 13:53:17 +02:00
AndyScherzinger 994d73f529 make all utils methods static 2018-09-12 13:53:17 +02:00
AndyScherzinger 65df2e82b3 codacy: utils classes are to be final with private constructor 2018-09-12 13:53:16 +02:00
AndyScherzinger ce4ce8db41 fix exceptions in method signature 2018-09-12 13:53:16 +02:00
AndyScherzinger 0f7fe6fd1c codacy: make utilities classes final with private constructor 2018-09-12 13:53:15 +02:00
AndyScherzinger 4724ab3329 codacy: combine nested if statements 2018-09-12 13:53:14 +02:00
AndyScherzinger b40b12e0eb codacy: replace with local variable 2018-09-12 13:53:14 +02:00
AndyScherzinger 5195badfd1 use correct exception 2018-09-12 13:53:13 +02:00
AndyScherzinger fb4b9a932f shorten if statement 2018-09-12 13:53:13 +02:00
AndyScherzinger 69399c394f codacy: position literals first in String comparisons for EqualsIgnoreCase 2018-09-12 13:53:12 +02:00
AndyScherzinger 0e93f00277 codacy: a class which only has private constructors should be final 2018-09-12 13:53:12 +02:00
AndyScherzinger 5f10a9301b codacy: This statement should have braces 2018-09-12 13:53:09 +02:00
Andy Scherzinger 916ef99313 Merge pull request #3025 from nextcloud/whatsNewOnWhite
Tint drawable according to login color
2018-09-12 13:13:37 +02:00
Tobias Kaminsky 00a045864d Merge pull request #3013 from nextcloud/storeMnemonicAsTyped
Store mnemonic as typed in
2018-09-12 10:51:41 +02:00
tobiasKaminsky 7ffc8660bb tint drawable according to login color (e.g. black on white background, white on blue background)
Signed-off-by: tobiasKaminsky <[email protected]>
2018-09-12 09:55:06 +02:00
Tobias Kaminsky 0c371b9603 Merge pull request #3008 from NilsGriebner/filepicker_grid
Use grid_item view for gridview in upload filepicker
2018-09-12 09:43:00 +02:00
Tobias Kaminsky dafe42d1c5 Merge pull request #3018 from nextcloud/fixAvatarFetching
Fix Avatar fetching for Nc14 server
2018-09-12 09:26:51 +02:00
Nextcloud bot cbf84e27bb [tx-robot] updated from transifex 2018-09-12 00:48:05 +00:00
AndyScherzinger d8da2f8007 fixes #3015 - server sends a HTTP-201 (not 200) for a newly created avatar on Nc14
HTTP-201 (CREATED) is actually the correct HTTP code since the resource has just been created and is part of the body/reply
2018-09-11 17:28:27 +02:00
tobiasKaminsky 21ebf1568e store mnemonic as typed in
Signed-off-by: tobiasKaminsky <[email protected]>
2018-09-11 11:15:59 +02:00
Nils Griebner 7dc0604b8b Use grid_item view for gridview in upload filepicker 2018-09-10 11:12:29 +02:00
62 changed files with 384 additions and 225 deletions

No files matched your search

+3 -3
View File
@@ -37,7 +37,7 @@ configurations.all {
ext {
supportLibraryVersion = '27.1.1'
jacocoVersion = "0.7.4.201502262128"
jacocoVersion = "0.8.2"
travisBuild = System.getenv("TRAVIS") == "true"
@@ -130,8 +130,8 @@ android {
versionDev {
applicationId "com.nextcloud.android.beta"
dimension "default"
versionCode 20180912
versionName "20180912"
versionCode 20180914
versionName "20180914"
}
}
}
-38
View File
@@ -1,38 +0,0 @@
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
-keep public class * extends android.app.Activity
-keep public class * extends android.app.Application
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider
-keep public class * extends android.app.backup.BackupAgentHelper
-keep public class * extends android.preference.Preference
-keep public class com.android.vending.licensing.ILicensingService
-keepclasseswithmembernames class * {
native <methods>;
}
-keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet);
}
-keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet, int);
}
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}
-keepattributes InnerClasses
@@ -28,9 +28,12 @@ import com.owncloud.android.db.PreferenceManager;
import java.security.Key;
public class PushUtils {
public final class PushUtils {
public static final String KEY_PUSH = "push";
private PushUtils() {
}
public static void pushRegistrationToServer() {
// do nothing
}
@@ -44,7 +47,7 @@ public class PushUtils {
return null;
}
public SignatureVerification verifySignature(Context context, byte[] signatureBytes, byte[] subjectBytes) {
public static SignatureVerification verifySignature(Context context, byte[] signatureBytes, byte[] subjectBytes) {
return null;
}
@@ -71,7 +71,7 @@ import java.security.spec.PKCS8EncodedKeySpec;
import java.security.spec.X509EncodedKeySpec;
import java.util.Locale;
public class PushUtils {
public final class PushUtils {
public static final String KEY_PUSH = "push";
private static final String TAG = "PushUtils";
@@ -81,6 +81,9 @@ public class PushUtils {
private static final String KEYPAIR_PUB_EXTENSION = ".pub";
private static ArbitraryDataProvider arbitraryDataProvider;
private PushUtils() {
}
public static String generateSHA512Hash(String pushToken) {
MessageDigest messageDigest = null;
try {
@@ -295,7 +298,6 @@ public class PushUtils {
fileInputStream = new FileInputStream(path);
byte[] bytes = new byte[fileInputStream.available()];
fileInputStream.read(bytes);
fileInputStream.close();
KeyFactory keyFactory = KeyFactory.getInstance("RSA");
@@ -315,6 +317,14 @@ public class PushUtils {
Log_OC.d(TAG, "InvalidKeySpecException while reading the key");
} catch (NoSuchAlgorithmException e) {
Log_OC.d(TAG, "RSA algorithm not supported");
} finally {
if (fileInputStream != null) {
try {
fileInputStream.close();
} catch (IOException e) {
Log_OC.e(TAG, "Error closing input stream during reading key from file", e);
}
}
}
return null;
@@ -331,12 +341,19 @@ public class PushUtils {
}
keyFileOutputStream = new FileOutputStream(path);
keyFileOutputStream.write(encoded);
keyFileOutputStream.close();
return 0;
} catch (FileNotFoundException e) {
Log_OC.d(TAG, "Failed to save key to file");
} catch (IOException e) {
Log_OC.d(TAG, "Failed to save key to file via IOException");
} finally {
if (keyFileOutputStream != null) {
try {
keyFileOutputStream.close();
} catch (IOException e) {
Log_OC.e(TAG, "Error closing input stream during reading key from file", e);
}
}
}
return -1;
@@ -400,7 +417,7 @@ public class PushUtils {
}
}
public SignatureVerification verifySignature(Context context, byte[] signatureBytes, byte[] subjectBytes) {
public static SignatureVerification verifySignature(Context context, byte[] signatureBytes, byte[] subjectBytes) {
Signature signature = null;
PublicKey publicKey;
SignatureVerification signatureVerification = new SignatureVerification();
@@ -413,7 +430,6 @@ public class PushUtils {
Gson gson = new Gson();
PushConfigurationState pushArbitraryData;
try {
signature = Signature.getInstance("SHA512withRSA");
if (accounts.length > 0) {
@@ -444,7 +460,7 @@ public class PushUtils {
return signatureVerification;
}
private Key readKeyFromString(boolean readPublicKey, String keyString) {
private static Key readKeyFromString(boolean readPublicKey, String keyString) {
String modifiedKey;
if (readPublicKey) {
modifiedKey = keyString.replaceAll("\\n", "").replace("-----BEGIN PUBLIC KEY-----",
@@ -464,7 +480,6 @@ public class PushUtils {
PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(Base64.decode(modifiedKey, Base64.DEFAULT));
return keyFactory.generatePrivate(keySpec);
}
} catch (NoSuchAlgorithmException e) {
Log.d("TAG", "No such algorithm while reading key from string");
} catch (InvalidKeySpecException e) {
@@ -473,5 +488,4 @@ public class PushUtils {
return null;
}
}
@@ -2081,6 +2081,8 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
private abstract static class RightDrawableOnTouchListener implements OnTouchListener {
private static final int RIGHT_DRAWABLE_COMPOUND_DRAWABLES_LENGTH = 2;
private int fuzz = 75;
/**
@@ -2091,7 +2093,7 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
Drawable rightDrawable = null;
if (view instanceof TextView) {
Drawable[] drawables = ((TextView) view).getCompoundDrawables();
if (drawables.length > 2) {
if (drawables.length > RIGHT_DRAWABLE_COMPOUND_DRAWABLES_LENGTH) {
rightDrawable = drawables[2];
}
}
@@ -32,7 +32,7 @@ import java.util.Locale;
/**
* Helper class for authenticator-URL related logic.
*/
public abstract class AuthenticatorUrlUtils {
public final class AuthenticatorUrlUtils {
public static final String WEBDAV_PATH_4_0_AND_LATER = "/remote.php/webdav";
private static final String HTTPS_PROTOCOL = "https://";
@@ -41,6 +41,9 @@ public abstract class AuthenticatorUrlUtils {
private static final String ODAV_PATH = "/remote.php/odav";
private static final String SAML_SSO_PATH = "/remote.php/webdav";
private AuthenticatorUrlUtils() {
}
/**
* Returns the proper URL path to access the WebDAV interface of an ownCloud server,
* according to its version and the authorization method used.
@@ -37,7 +37,7 @@ import com.owncloud.android.utils.DeviceCredentialUtils;
import java.util.HashSet;
import java.util.Set;
public class PassCodeManager {
public final class PassCodeManager {
private static final Set<Class> exemptOfPasscodeActivities;
@@ -35,7 +35,8 @@ import java.util.List;
* Database provider for handling the persistence aspects of arbitrary data table.
*/
public class ArbitraryDataProvider {
static private final String TAG = ArbitraryDataProvider.class.getSimpleName();
private static final String TAG = ArbitraryDataProvider.class.getSimpleName();
private static final String TRUE = "true";
private ContentResolver contentResolver;
@@ -115,9 +116,7 @@ public class ArbitraryDataProvider {
}
public boolean getBooleanValue(String accountName, String key) {
String value = getValue(accountName, key);
return !value.isEmpty() && value.equalsIgnoreCase("true");
return TRUE.equalsIgnoreCase(getValue(accountName, key));
}
public boolean getBooleanValue(Account account, String key) {
@@ -25,7 +25,7 @@ import java.util.HashMap;
import java.util.Map;
/**
* Decrypted class representation of metadata json of folder metadata
* Decrypted class representation of metadata json of folder metadata.
*/
public class DecryptedFolderMetadata {
private Metadata metadata;
@@ -36,7 +36,7 @@ public class DecryptedFolderMetadata {
this.files = new HashMap<>();
}
public DecryptedFolderMetadata(Metadata metadata, HashMap<String, DecryptedFile> files) {
public DecryptedFolderMetadata(Metadata metadata, Map<String, DecryptedFile> files) {
this.metadata = metadata;
this.files = files;
}
@@ -766,7 +766,8 @@ public class FileDataStorageManager {
}
}
public void migrateStoredFiles(String srcPath, String dstPath) throws Exception {
public void migrateStoredFiles(String srcPath, String dstPath)
throws RemoteException, OperationApplicationException {
Cursor cursor;
try {
if (getContentResolver() != null) {
@@ -1465,8 +1466,8 @@ public class FileDataStorageManager {
}
}
public void saveSharesDB(ArrayList<OCShare> shares) {
ArrayList<ContentProviderOperation> operations = new ArrayList<ContentProviderOperation>();
public void saveSharesDB(List<OCShare> shares) {
ArrayList<ContentProviderOperation> operations = new ArrayList<>();
// Reset flags & Remove shares for this files
String filePath = "";
@@ -1580,7 +1581,7 @@ public class FileDataStorageManager {
* @return
*/
private ArrayList<ContentProviderOperation> prepareInsertShares(
ArrayList<OCShare> shares, ArrayList<ContentProviderOperation> operations) {
List<OCShare> shares, ArrayList<ContentProviderOperation> operations) {
if (shares != null) {
// prepare operations to insert or update files to save in the given folder
@@ -78,7 +78,7 @@ import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
/**
* Manager for concurrent access to thumbnails cache.
*/
public class ThumbnailsCacheManager {
public final class ThumbnailsCacheManager {
public static final String PREFIX_RESIZED_IMAGE = "r";
public static final String PREFIX_THUMBNAIL = "t";
@@ -103,6 +103,9 @@ public class ThumbnailsCacheManager {
public static final Bitmap mDefaultVideo = BitmapFactory.decodeResource(MainApp.getAppContext().getResources(),
R.drawable.file_movie);
private ThumbnailsCacheManager() {
}
public static class InitDiskCacheTask extends AsyncTask<File, Void, Void> {
@Override
@@ -641,6 +644,9 @@ public class ThumbnailsCacheManager {
}
public static class MediaThumbnailGenerationTask extends AsyncTask<Object, Void, Bitmap> {
private static final int IMAGE_KEY_PARAMS_LENGTH = 2;
private enum Type {IMAGE, VIDEO}
private final WeakReference<ImageView> mImageViewReference;
private File mFile;
@@ -660,7 +666,7 @@ public class ThumbnailsCacheManager {
try {
if (params[0] instanceof File) {
mFile = (File) params[0];
if (params.length == 2) {
if (params.length == IMAGE_KEY_PARAMS_LENGTH) {
mImageKey = (String) params[1];
}
@@ -870,7 +876,8 @@ public class ThumbnailsCacheManager {
// we are using eTag to download a new avatar only if it changed
switch (status) {
case HttpStatus.SC_OK:
// new avatar
case HttpStatus.SC_CREATED:
// new avatar
InputStream inputStream = get.getResponseBodyAsStream();
String newETag = null;
@@ -45,13 +45,14 @@ import java.util.Observable;
* information for each file.
*/
public class UploadsStorageManager extends Observable {
private static final String TAG = UploadsStorageManager.class.getSimpleName();
private static final String AND = " AND ";
static private final String TAG = UploadsStorageManager.class.getSimpleName();
private static final int SINGLE_RESULT = 1;
private ContentResolver mContentResolver;
private Context mContext;
public UploadsStorageManager(ContentResolver contentResolver, Context context) {
if (contentResolver == null) {
throw new IllegalArgumentException("Cannot create an instance with a NULL contentResolver");
@@ -123,7 +124,7 @@ public class UploadsStorageManager extends Observable {
);
Log_OC.d(TAG, "updateUpload returns with: " + result + " for file: " + ocUpload.getLocalPath());
if (result != 1) {
if (result != SINGLE_RESULT) {
Log_OC.e(TAG, "Failed to update item " + ocUpload.getLocalPath() + " into upload db.");
} else {
notifyObserversNow();
@@ -189,7 +190,7 @@ public class UploadsStorageManager extends Observable {
);
if (c != null) {
if (c.getCount() != 1) {
if (c.getCount() != SINGLE_RESULT) {
Log_OC.e(TAG, c.getCount() + " items for id=" + id
+ " available in UploadDb. Expected 1. Failed to update upload db.");
} else {
@@ -272,7 +273,7 @@ public class UploadsStorageManager extends Observable {
}
public OCUpload[] getAllStoredUploads() {
return getUploads(null, null);
return getUploads(null, (String[]) null);
}
private OCUpload[] getUploads(@Nullable String selection, @Nullable String... selectionArgs) {
@@ -393,7 +394,7 @@ public class UploadsStorageManager extends Observable {
*/
public OCUpload[] getFinishedUploads() {
return getUploads(ProviderTableMeta.UPLOADS_STATUS + "==" + UploadStatus.UPLOAD_SUCCEEDED.value, null);
return getUploads(ProviderTableMeta.UPLOADS_STATUS + "==" + UploadStatus.UPLOAD_SUCCEEDED.value, (String[]) null);
}
public OCUpload[] getFailedButNotDelayedUploadsForCurrentAccount() {
@@ -432,7 +433,7 @@ public class UploadsStorageManager extends Observable {
"<>" + UploadResult.DELAYED_FOR_CHARGING.getValue() +
AND + ProviderTableMeta.UPLOADS_LAST_RESULT +
"<>" + UploadResult.DELAYED_IN_POWER_SAVE_MODE.getValue(),
null
(String[]) null
);
}
@@ -1,4 +1,4 @@
/**
/*
* Nextcloud Android client application
*
* @author Bartosz Przybylski
@@ -1,4 +1,4 @@
/**
/*
* Nextcloud Android client application
*
* @author Bartosz Przybylski
@@ -24,14 +24,14 @@ package com.owncloud.android.datastorage.providers;
import com.owncloud.android.datastorage.StoragePoint;
import java.io.File;
import java.util.Vector;
import java.util.List;
/**
* @author Bartosz Przybylski
*/
abstract class AbstractStoragePointProvider implements IStoragePointProvider {
boolean canBeAddedToAvailableList(Vector<StoragePoint> currentList, String path) {
boolean canBeAddedToAvailableList(List<StoragePoint> currentList, String path) {
if (path == null) {
return false;
}
@@ -1,4 +1,4 @@
/**
/*
* Nextcloud Android client application
*
* @author Bartosz Przybylski
@@ -25,6 +25,7 @@ import android.text.TextUtils;
import com.owncloud.android.datastorage.StoragePoint;
import java.util.List;
import java.util.Vector;
/**
@@ -40,15 +41,15 @@ public class EnvironmentStoragePointProvider extends AbstractStoragePointProvide
}
@Override
public Vector<StoragePoint> getAvailableStoragePoint() {
Vector<StoragePoint> result = new Vector<>();
public List<StoragePoint> getAvailableStoragePoint() {
List<StoragePoint> result = new Vector<>();
addEntriesFromEnv(result, sSecondaryStorageEnvName);
return result;
}
private void addEntriesFromEnv(Vector<StoragePoint> result, String envName) {
private void addEntriesFromEnv(List<StoragePoint> result, String envName) {
String env = System.getenv(envName);
if (env != null) {
for (String p : env.split(":")) {
@@ -1,4 +1,4 @@
/**
/*
* Nextcloud Android client application
*
* @author Bartosz Przybylski
@@ -23,7 +23,7 @@ package com.owncloud.android.datastorage.providers;
import com.owncloud.android.datastorage.StoragePoint;
import java.util.Vector;
import java.util.List;
/**
* @author Bartosz Przybylski
@@ -38,11 +38,9 @@ public interface IStoragePointProvider {
*/
boolean canProvideStoragePoints();
/**
*
* @return available storage points
*/
Vector<StoragePoint> getAvailableStoragePoint();
List<StoragePoint> getAvailableStoragePoint();
}
@@ -1,4 +1,4 @@
/**
/*
* Nextcloud Android client application
*
* @author Bartosz Przybylski
@@ -23,6 +23,7 @@ package com.owncloud.android.datastorage.providers;
import com.owncloud.android.datastorage.StoragePoint;
import java.util.List;
import java.util.Locale;
import java.util.Vector;
import java.util.regex.Pattern;
@@ -42,8 +43,8 @@ public class MountCommandStoragePointProvider extends AbstractCommandLineStorage
}
@Override
public Vector<StoragePoint> getAvailableStoragePoint() {
Vector<StoragePoint> result = new Vector<>();
public List<StoragePoint> getAvailableStoragePoint() {
List<StoragePoint> result = new Vector<>();
for (String p : getPotentialPaths(getCommandLineResult())) {
if (canBeAddedToAvailableList(result, p)) {
@@ -54,8 +55,8 @@ public class MountCommandStoragePointProvider extends AbstractCommandLineStorage
return result;
}
private Vector<String> getPotentialPaths(String mounted) {
final Vector<String> result = new Vector<>();
private List<String> getPotentialPaths(String mounted) {
final List<String> result = new Vector<>();
for (String line : mounted.split("\n")) {
if (!line.toLowerCase(Locale.US).contains("asec") && sPattern.matcher(line).matches()) {
@@ -24,6 +24,7 @@ package com.owncloud.android.datastorage.providers;
import com.owncloud.android.datastorage.StoragePoint;
import com.owncloud.android.lib.common.utils.Log_OC;
import java.util.List;
import java.util.Vector;
/**
@@ -38,8 +39,8 @@ public class VDCStoragePointProvider extends AbstractCommandLineStoragePoint {
@Override
public Vector<StoragePoint> getAvailableStoragePoint() {
Vector<StoragePoint> result = new Vector<>();
public List<StoragePoint> getAvailableStoragePoint() {
List<StoragePoint> result = new Vector<>();
result.addAll(getPaths(getCommandLineResult()));
@@ -51,8 +52,8 @@ public class VDCStoragePointProvider extends AbstractCommandLineStoragePoint {
return sVDCVolListCommand;
}
private Vector<StoragePoint> getPaths(String vdcResources) {
Vector<StoragePoint> result = new Vector<>();
private List<StoragePoint> getPaths(String vdcResources) {
List<StoragePoint> result = new Vector<>();
for (String line : vdcResources.split("\n")) {
String vdcLine[] = line.split(" ");
@@ -36,7 +36,7 @@ import static com.owncloud.android.ui.fragment.OCFileListFragment.FOLDER_LAYOUT_
/**
* Helper to simplify reading of Preferences all around the app
*/
public abstract class PreferenceManager {
public final class PreferenceManager {
/**
* Constant to access value of last path selected by the user to upload a file shared from other app.
* Value handled by the app without direct access in the UI.
@@ -65,6 +65,9 @@ public abstract class PreferenceManager {
private static final String PREF__FOLDER_SORT_ORDER = "folder_sort_order";
private static final String PREF__FOLDER_LAYOUT = "folder_layout";
private PreferenceManager() {
}
public static void setKeysReInit(Context context) {
saveBooleanPreference(context, PREF__KEYS_REINIT, true);
}
@@ -71,11 +71,10 @@ public class NotificationJob extends Job {
try {
byte[] base64DecodedSubject = Base64.decode(subject, Base64.DEFAULT);
byte[] base64DecodedSignature = Base64.decode(signature, Base64.DEFAULT);
PushUtils pushUtils = new PushUtils();
PrivateKey privateKey = (PrivateKey) PushUtils.readKeyFromFile(false);
try {
SignatureVerification signatureVerification = pushUtils.verifySignature(context,
SignatureVerification signatureVerification = PushUtils.verifySignature(context,
base64DecodedSignature, base64DecodedSubject);
if (signatureVerification.isSignatureValid()) {
@@ -37,9 +37,11 @@ import java.util.Map;
public class OAuth2GetAccessToken extends RemoteOperation {
private static final String TAG = OAuth2GetAccessToken.class.getSimpleName();
private static final int KEY_INDEX = 0;
private static final int VALUE_INDEX = 1;
private String mClientId;
private String mRedirectUri;
private String mGrantType;
@@ -149,9 +151,9 @@ public class OAuth2GetAccessToken extends RemoteOperation {
String[] part = pairs[i].split("=");
while (part.length > j) {
String p = part[j];
if (j == 0) {
if (j == KEY_INDEX) {
key = p;
} else if (j == 1) {
} else if (j == VALUE_INDEX) {
value = p;
mOAuth2ParsedAuthorizationResponse.put(key, value);
}
@@ -1,18 +1,18 @@
/**
/*
* ownCloud Android client application
*
* @author David A. Velasco
* Copyright (C) 2015 ownCloud Inc.
* <p>
*
* 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.
* <p>
*
* 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.
* <p>
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
@@ -39,6 +39,7 @@ import com.owncloud.android.lib.resources.files.ReadRemoteFolderOperation;
import com.owncloud.android.lib.resources.files.RemoteFile;
import com.owncloud.android.lib.resources.shares.GetRemoteSharesForFileOperation;
import com.owncloud.android.lib.resources.shares.OCShare;
import com.owncloud.android.lib.resources.shares.ShareType;
import com.owncloud.android.syncadapter.FileSyncAdapter;
import com.owncloud.android.utils.DataHolderUtil;
import com.owncloud.android.utils.EncryptionUtils;
@@ -344,7 +345,7 @@ public class RefreshFolderOperation extends RemoteOperation {
*
* @param folderAndFiles Remote folder and children files in Folder
*/
private void synchronizeData(ArrayList<Object> folderAndFiles) {
private void synchronizeData(List<Object> folderAndFiles) {
// get 'fresh data' from the database
mLocalFolder = mStorageManager.getFileByPath(mLocalFolder.getRemotePath());
@@ -397,10 +398,9 @@ public class RefreshFolderOperation extends RemoteOperation {
// prepare content synchronization for kept-in-sync files
if (updatedFile.isAvailableOffline()) {
SynchronizeFileOperation operation = new SynchronizeFileOperation(localFile, remoteFile, mAccount, true,
mContext);
mFilesToSyncContents.add(operation);
mFilesToSyncContents.add(
new SynchronizeFileOperation(localFile, remoteFile, mAccount, true, mContext)
);
}
// update file name for encrypted files
@@ -550,8 +550,13 @@ public class RefreshFolderOperation extends RemoteOperation {
if (result.isSuccess()) {
// update local database
ArrayList<OCShare> shares = new ArrayList<>();
OCShare share;
for (Object obj : result.getData()) {
shares.add((OCShare) obj);
share = (OCShare) obj;
if (!ShareType.NO_SHARED.equals(share.getShareType())) {
shares.add(share);
}
}
mStorageManager.saveSharesInFolder(shares, mLocalFolder);
}
@@ -43,7 +43,8 @@ import java.util.List;
public class UnshareOperation extends SyncOperation {
private static final String TAG = UnshareOperation.class.getSimpleName();
private static final int SINGLY_SHARED = 1;
private String mRemotePath;
private ShareType mShareType;
private String mShareWith;
@@ -83,7 +84,7 @@ public class UnshareOperation extends SyncOperation {
List <OCShare> sharesWith = getStorageManager().
getSharesWithForAFile(mRemotePath,
getStorageManager().getAccount().name);
if (sharesWith.size() == 1) {
if (sharesWith.size() == SINGLY_SHARED) {
file.setShareWithSharee(false);
}
}
@@ -699,12 +699,10 @@ public class UploadFileOperation extends SyncOperation {
private RemoteOperationResult unlockFolder(OCFile parentFolder, OwnCloudClient client, String token) {
if (token != null) {
UnlockFileOperation unlockFileOperation = new UnlockFileOperation(parentFolder.getLocalId(), token);
RemoteOperationResult unlockFileOperationResult = unlockFileOperation.execute(client, true);
return unlockFileOperationResult;
} else
return new UnlockFileOperation(parentFolder.getLocalId(), token).execute(client, true);
} else {
return new RemoteOperationResult(new Exception("No token available"));
}
}
private RemoteOperationResult checkConditions(File originalFile) {
@@ -86,6 +86,9 @@ public class FileContentProvider extends ContentProvider {
private static final String ADD_COLUMN = " ADD COLUMN ";
private static final String REMOVE_COLUMN = " REMOVE COLUMN ";
private static final String UPGRADE_VERSION_MSG = "OUT of the ADD in onUpgrade; oldVersion == %d, newVersion == %d";
private static final int SINGLE_PATH_SEGMENT = 1;
public static final int ARBITRARY_DATA_TABLE_INTRODUCTION_VERSION = 20;
private DataBaseHelper mDbHelper;
private Context mContext;
private UriMatcher mUriMatcher;
@@ -175,14 +178,14 @@ public class FileContentProvider extends ContentProvider {
db,
ContentUris.withAppendedId(ProviderTableMeta.CONTENT_URI_DIR, childId),
null,
null
(String[]) null
);
} else {
count += delete(
db,
ContentUris.withAppendedId(ProviderTableMeta.CONTENT_URI_FILE, childId),
null,
null
(String[]) null
);
}
children.moveToNext();
@@ -501,67 +504,66 @@ public class FileContentProvider extends ContentProvider {
case ROOT_DIRECTORY:
break;
case DIRECTORY:
String folderId = uri.getPathSegments().get(1);
sqlQuery.appendWhere(ProviderTableMeta.FILE_PARENT + "="
+ folderId);
+ uri.getPathSegments().get(1));
break;
case SINGLE_FILE:
if (uri.getPathSegments().size() > 1) {
if (uri.getPathSegments().size() > SINGLE_PATH_SEGMENT) {
sqlQuery.appendWhere(ProviderTableMeta._ID + "="
+ uri.getPathSegments().get(1));
}
break;
case SHARES:
sqlQuery.setTables(ProviderTableMeta.OCSHARES_TABLE_NAME);
if (uri.getPathSegments().size() > 1) {
if (uri.getPathSegments().size() > SINGLE_PATH_SEGMENT) {
sqlQuery.appendWhere(ProviderTableMeta._ID + "="
+ uri.getPathSegments().get(1));
}
break;
case CAPABILITIES:
sqlQuery.setTables(ProviderTableMeta.CAPABILITIES_TABLE_NAME);
if (uri.getPathSegments().size() > 1) {
if (uri.getPathSegments().size() > SINGLE_PATH_SEGMENT) {
sqlQuery.appendWhere(ProviderTableMeta._ID + "="
+ uri.getPathSegments().get(1));
}
break;
case UPLOADS:
sqlQuery.setTables(ProviderTableMeta.UPLOADS_TABLE_NAME);
if (uri.getPathSegments().size() > 1) {
if (uri.getPathSegments().size() > SINGLE_PATH_SEGMENT) {
sqlQuery.appendWhere(ProviderTableMeta._ID + "="
+ uri.getPathSegments().get(1));
}
break;
case SYNCED_FOLDERS:
sqlQuery.setTables(ProviderTableMeta.SYNCED_FOLDERS_TABLE_NAME);
if (uri.getPathSegments().size() > 1) {
if (uri.getPathSegments().size() > SINGLE_PATH_SEGMENT) {
sqlQuery.appendWhere(ProviderTableMeta._ID + "="
+ uri.getPathSegments().get(1));
}
break;
case EXTERNAL_LINKS:
sqlQuery.setTables(ProviderTableMeta.EXTERNAL_LINKS_TABLE_NAME);
if (uri.getPathSegments().size() > 1) {
if (uri.getPathSegments().size() > SINGLE_PATH_SEGMENT) {
sqlQuery.appendWhere(ProviderTableMeta._ID + "="
+ uri.getPathSegments().get(1));
}
break;
case ARBITRARY_DATA:
sqlQuery.setTables(ProviderTableMeta.ARBITRARY_DATA_TABLE_NAME);
if (uri.getPathSegments().size() > 1) {
if (uri.getPathSegments().size() > SINGLE_PATH_SEGMENT) {
sqlQuery.appendWhere(ProviderTableMeta._ID + "="
+ uri.getPathSegments().get(1));
}
break;
case VIRTUAL:
sqlQuery.setTables(ProviderTableMeta.VIRTUAL_TABLE_NAME);
if (uri.getPathSegments().size() > 1) {
if (uri.getPathSegments().size() > SINGLE_PATH_SEGMENT) {
sqlQuery.appendWhere(ProviderTableMeta._ID + "=" + uri.getPathSegments().get(1));
}
break;
case FILESYSTEM:
sqlQuery.setTables(ProviderTableMeta.FILESYSTEM_TABLE_NAME);
if (uri.getPathSegments().size() > 1) {
if (uri.getPathSegments().size() > SINGLE_PATH_SEGMENT) {
sqlQuery.appendWhere(ProviderTableMeta._ID + "="
+ uri.getPathSegments().get(1));
}
@@ -1629,7 +1631,7 @@ public class FileContentProvider extends ContentProvider {
db.execSQL(ALTER_TABLE + ProviderTableMeta.FILE_TABLE_NAME +
ADD_COLUMN + ProviderTableMeta.FILE_ENCRYPTED_NAME + " TEXT ");
}
if (oldVersion > 20) {
if (oldVersion > ARBITRARY_DATA_TABLE_INTRODUCTION_VERSION) {
if (!checkIfColumnExists(db, ProviderTableMeta.CAPABILITIES_TABLE_NAME,
ProviderTableMeta.CAPABILITIES_END_TO_END_ENCRYPTION)) {
db.execSQL(ALTER_TABLE + ProviderTableMeta.CAPABILITIES_TABLE_NAME +
@@ -1,4 +1,4 @@
/**
/*
* ownCloud Android client application
*
* @author David A. Velasco
@@ -18,7 +18,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.owncloud.android.providers;
import android.accounts.Account;
@@ -32,6 +31,7 @@ import android.net.Uri;
import android.os.Handler;
import android.os.Looper;
import android.provider.BaseColumns;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.widget.Toast;
@@ -52,6 +52,7 @@ import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
/**
@@ -84,7 +85,7 @@ public class UsersAndGroupsSearchProvider extends ContentProvider {
private UriMatcher mUriMatcher;
private static HashMap<String, ShareType> sShareTypes = new HashMap<>();
private static Map<String, ShareType> sShareTypes = new HashMap<>();
public static ShareType getShareType(String authority) {
@@ -93,7 +94,7 @@ public class UsersAndGroupsSearchProvider extends ContentProvider {
@Nullable
@Override
public String getType(Uri uri) {
public String getType(@NonNull Uri uri) {
// TODO implement
return null;
}
@@ -119,7 +120,7 @@ public class UsersAndGroupsSearchProvider extends ContentProvider {
/**
* TODO description
* <p/>
*
* Reference: http://developer.android.com/guide/topics/search/adding-custom-suggestions.html#CustomContentProvider
*
* @param uri Content {@link Uri}, formattted as
@@ -133,7 +134,7 @@ public class UsersAndGroupsSearchProvider extends ContentProvider {
*/
@Nullable
@Override
public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) {
public Cursor query(@NonNull Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) {
Log_OC.d(TAG, "query received in thread " + Thread.currentThread().getName());
int match = mUriMatcher.match(uri);
@@ -240,19 +241,19 @@ public class UsersAndGroupsSearchProvider extends ContentProvider {
@Nullable
@Override
public Uri insert(Uri uri, ContentValues values) {
public Uri insert(@NonNull Uri uri, ContentValues values) {
// TODO implementation
return null;
}
@Override
public int delete(Uri uri, String selection, String[] selectionArgs) {
public int delete(@NonNull Uri uri, String selection, String[] selectionArgs) {
// TODO implementation
return 0;
}
@Override
public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) {
public int update(@NonNull Uri uri, ContentValues values, String selection, String[] selectionArgs) {
// TODO implementation
return 0;
}
@@ -283,5 +284,4 @@ public class UsersAndGroupsSearchProvider extends ContentProvider {
}
});
}
}
@@ -1,4 +1,4 @@
/**
/*
* Nextcloud Android client application
*
* Copyright (C) 2018 Edvard Holst
@@ -34,6 +34,8 @@ import com.owncloud.android.lib.common.operations.RemoteOperationResult;
import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.lib.resources.activities.GetRemoteActivitiesOperation;
import org.apache.commons.httpclient.HttpStatus;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
@@ -94,7 +96,7 @@ public class ActivitiesServiceApiImpl implements ActivitiesServiceApi {
Log_OC.d(TAG, result.getLogMessage());
// show error
errorMessage = result.getLogMessage();
if (result.getHttpCode() == 304) {
if (result.getHttpCode() == HttpStatus.SC_NOT_MODIFIED) {
errorMessage = context.getString(R.string.file_list_empty_headline_server_search);
}
return false;
@@ -663,7 +663,7 @@ public abstract class DrawerActivity extends ToolbarActivity implements DisplayU
*
* @param accounts list of accounts
*/
private void repopulateAccountList(ArrayList<Account> accounts) {
private void repopulateAccountList(List<Account> accounts) {
// remove all accounts from list
mNavigationView.getMenu().removeGroup(R.id.drawer_menu_accounts);
@@ -216,10 +216,21 @@ public class FirstRunActivity extends BaseActivity implements ViewPager.OnPageCh
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (FIRST_RUN_RESULT_CODE == requestCode && RESULT_OK == resultCode) {
setAccount(AccountUtils.getCurrentOwnCloudAccount(this));
String accountName = data.getStringExtra(AccountManager.KEY_ACCOUNT_NAME);
Account account = AccountUtils.getOwnCloudAccountByName(this, accountName);
if (account == null) {
DisplayUtils.showSnackMessage(this, R.string.account_creation_failed);
return;
}
setAccount(account);
AccountUtils.setCurrentOwnCloudAccount(this, account.name);
onAccountSet(false);
Intent i = new Intent(this, FileDisplayActivity.class);
i.setAction(FileDisplayActivity.RESTART);
i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(i);
}
@@ -74,15 +74,17 @@ import java.util.Set;
public class ManageAccountsActivity extends FileActivity
implements AccountListAdapter.AccountListAdapterListener, AccountManagerCallback<Boolean>, ComponentsGetter {
private static final String TAG = ManageAccountsActivity.class.getSimpleName();
public static final String KEY_ACCOUNT_LIST_CHANGED = "ACCOUNT_LIST_CHANGED";
public static final String KEY_CURRENT_ACCOUNT_CHANGED = "CURRENT_ACCOUNT_CHANGED";
public static final String PENDING_FOR_REMOVAL = "PENDING_FOR_REMOVAL";
private static final String KEY_DISPLAY_NAME = "DISPLAY_NAME";
private static final int KEY_USER_INFO_REQUEST_CODE = 13;
private static final int KEY_DELETE_CODE = 101;
private static final int SINGLE_ACCOUNT = 1;
private static final int MIN_MULTI_ACCOUNT_SIZE = 2;
private ListView mListView;
private final Handler mHandler = new Handler();
@@ -90,8 +92,8 @@ public class ManageAccountsActivity extends FileActivity
private AccountListAdapter mAccountListAdapter;
private ServiceConnection mDownloadServiceConnection;
private ServiceConnection mUploadServiceConnection;
Set<String> mOriginalAccounts;
String mOriginalCurrentAccount;
private Set<String> mOriginalAccounts;
private String mOriginalCurrentAccount;
private Drawable mTintedCheck;
private ArbitraryDataProvider arbitraryDataProvider;
@@ -347,7 +349,7 @@ public class ManageAccountsActivity extends FileActivity
}
List<AccountListItem> accountListItemArray = getAccountListItems();
if (accountListItemArray.size() > 1) {
if (accountListItemArray.size() > SINGLE_ACCOUNT) {
mAccountListAdapter = new AccountListAdapter(this, accountListItemArray, mTintedCheck);
mListView.setAdapter(mAccountListAdapter);
} else {
@@ -452,7 +454,7 @@ public class ManageAccountsActivity extends FileActivity
}
// only one to be (deleted) account remaining
if (accounts.length < 2) {
if (accounts.length < MIN_MULTI_ACCOUNT_SIZE) {
Intent resultIntent = new Intent();
resultIntent.putExtra(KEY_ACCOUNT_LIST_CHANGED, true);
resultIntent.putExtra(KEY_CURRENT_ACCOUNT_CHANGED, true);
@@ -315,9 +315,9 @@ public class ReceiveExternalFilesActivity extends FileActivity
*
* @return list of account list items
*/
private ArrayList<AccountListItem> getAccountListItems(ReceiveExternalFilesActivity activity) {
private List<AccountListItem> getAccountListItems(ReceiveExternalFilesActivity activity) {
Account[] accountList = activity.mAccountManager.getAccountsByType(MainApp.getAccountType(getActivity()));
ArrayList<AccountListItem> adapterAccountList = new ArrayList<>(accountList.length);
List<AccountListItem> adapterAccountList = new ArrayList<>(accountList.length);
for (Account account : accountList) {
adapterAccountList.add(new AccountListItem(account));
}
@@ -332,6 +332,8 @@ public class ReceiveExternalFilesActivity extends FileActivity
private static final int CATEGORY_URL = 1;
private static final int CATEGORY_MAPS_URL = 2;
private static final int EXTRA_TEXT_LENGTH = 3;
private static final int SINGLE_SPINNER_ENTRY = 1;
private List<String> mFilenameBase;
private List<String> mFilenameSuffix;
@@ -430,9 +432,8 @@ public class ReceiveExternalFilesActivity extends FileActivity
final Spinner spinner = view.findViewById(R.id.file_type);
setupSpinner(adapter, selectPos, userInput, spinner);
if (adapter.getCount() == 1) {
TextView label = view.findViewById(R.id.label_file_type);
label.setVisibility(View.GONE);
if (adapter.getCount() == SINGLE_SPINNER_ENTRY) {
view.findViewById(R.id.label_file_type).setVisibility(View.GONE);
spinner.setVisibility(View.GONE);
}
mSpinner = spinner;
@@ -538,10 +539,14 @@ public class ReceiveExternalFilesActivity extends FileActivity
private boolean isIntentFromGoogleMap(String subjectText, String extraText) {
String texts[] = extraText.split("\n");
if (texts.length != 3)
if (texts.length != EXTRA_TEXT_LENGTH) {
return false;
if (texts[0].length() == 0 || !subjectText.equals(texts[0]))
}
if (texts[0].length() == 0 || !subjectText.equals(texts[0])) {
return false;
}
return texts[2].startsWith("https://goo.gl/maps/");
}
@@ -625,7 +630,7 @@ public class ReceiveExternalFilesActivity extends FileActivity
@Override
public void onBackPressed() {
if (mParents.size() <= 1) {
if (mParents.size() <= SINGLE_PARENT) {
super.onBackPressed();
} else {
mParents.pop();
@@ -274,8 +274,9 @@ public class StorageMigration {
// probably migration failed even before saving states,
// which is weird and should be investigated.
// But its better than crashing on ArrayOutOfBounds.
if (oldSync == null)
if (oldSync == null) {
return;
}
for (int i = 0; i < mOcAccounts.length; ++i) {
ContentResolver.setSyncAutomatically(mOcAccounts[i], mAuthority, oldSync[i]);
}
@@ -1,4 +1,4 @@
/**
/*
* ownCloud Android client application
*
* @author David A. Velasco
@@ -82,6 +82,7 @@ public class UploadFilesActivity extends FileActivity implements
OnClickListener, ConfirmationDialogFragmentListener, SortingOrderDialogFragment.OnSortingOrderListener {
private static final String SORT_ORDER_DIALOG_TAG = "SORT_ORDER_DIALOG";
private static final int SINGLE_DIR = 1;
private ArrayAdapter<String> mDirectories;
private File mCurrentDir;
@@ -333,7 +334,7 @@ public class UploadFilesActivity extends FileActivity implements
mSearchView.onActionViewCollapsed();
setDrawerIndicatorEnabled(isDrawerIndicatorAvailable());
} else {
if (mDirectories.getCount() <= 1) {
if (mDirectories.getCount() <= SINGLE_DIR) {
finish();
return;
}
@@ -301,8 +301,9 @@ public class UserInfoActivity extends FileActivity {
private void addToListIfNeeded(List<UserInfoDetailsItem> info, @DrawableRes int icon, String text,
@StringRes int contentDescriptionInt) {
if (!TextUtils.isEmpty(text))
if (!TextUtils.isEmpty(text)) {
info.add(new UserInfoDetailsItem(icon, text, getResources().getString(contentDescriptionInt)));
}
}
public static void openAccountRemovalConfirmationDialog(Account account, FragmentManager fragmentManager,
@@ -127,9 +127,9 @@ public class ActivityAndVersionListAdapter extends ActivityListAdapter {
public int getItemViewType(int position) {
Object value = values.get(position);
if (value instanceof Activity)
if (value instanceof Activity) {
return ACTIVITY_TYPE;
else if (value instanceof FileVersion) {
} else if (value instanceof FileVersion) {
return VERSION_TYPE;
} else {
return HEADER_TYPE;
@@ -332,8 +332,9 @@ public class ActivityListAdapter extends RecyclerView.Adapter<RecyclerView.ViewH
private RichObject searchObjectByName(List<RichObject> richObjectList, String name) {
for (RichObject richObject : richObjectList) {
if (richObject.getTag().equalsIgnoreCase(name))
if (richObject.getTag().equalsIgnoreCase(name)) {
return richObject;
}
}
return null;
}
@@ -341,10 +342,11 @@ public class ActivityListAdapter extends RecyclerView.Adapter<RecyclerView.ViewH
@Override
public int getItemViewType(int position) {
if (values.get(position) instanceof Activity)
if (values.get(position) instanceof Activity) {
return ACTIVITY_TYPE;
else
} else {
return HEADER_TYPE;
}
}
@Override
@@ -519,6 +519,10 @@ public class LocalFileListAdapter extends RecyclerView.Adapter<RecyclerView.View
return output;
}
public void setGridView(boolean gridView) {
this.gridView = gridView;
}
static class LocalFileListItemViewHolder extends LocalFileListGridViewHolder {
private final TextView fileSize;
private final TextView lastModification;
@@ -530,6 +534,8 @@ public class LocalFileListAdapter extends RecyclerView.Adapter<RecyclerView.View
fileSize = itemView.findViewById(R.id.file_size);
fileSeparator = itemView.findViewById(R.id.file_separator);
lastModification = itemView.findViewById(R.id.last_mod);
itemView.findViewById(R.id.overflow_menu).setVisibility(View.GONE);
}
}
@@ -547,7 +553,6 @@ public class LocalFileListAdapter extends RecyclerView.Adapter<RecyclerView.View
checkbox = itemView.findViewById(R.id.custom_checkbox);
itemLayout = itemView.findViewById(R.id.ListItemLayout);
itemView.findViewById(R.id.overflow_menu).setVisibility(View.GONE);
itemView.findViewById(R.id.sharedIcon).setVisibility(View.GONE);
itemView.findViewById(R.id.favorite_action).setVisibility(View.GONE);
itemView.findViewById(R.id.keptOfflineIcon).setVisibility(View.GONE);
@@ -71,7 +71,6 @@ public class UserListAdapter extends RecyclerView.Adapter<UserListAdapter.UserVi
private float avatarRadiusDimension;
private Account account;
private OCFile file;
private FileDataStorageManager storageManager;
public UserListAdapter(FragmentManager fragmentManager, Context context, List<OCShare> shares, Account account,
OCFile file, ShareeListAdapterListener listener) {
@@ -83,8 +82,7 @@ public class UserListAdapter extends RecyclerView.Adapter<UserListAdapter.UserVi
this.file = file;
accentColor = ThemeUtils.primaryAccentColor(context);
storageManager = new FileDataStorageManager(account, context.getContentResolver());
capabilities = storageManager.getCapability(account.name);
capabilities = new FileDataStorageManager(account, context.getContentResolver()).getCapability(account.name);
avatarRadiusDimension = context.getResources().getDimension(R.dimen.user_icon_radius);
}
@@ -42,10 +42,10 @@ import java.util.Collection;
public class RemoveFilesDialogFragment extends ConfirmationDialogFragment implements
ConfirmationDialogFragmentListener {
private Collection<OCFile> mTargetFiles;
private static final int SINGLE_SELECTION = 1;
private static final String ARG_TARGET_FILES = "TARGET_FILES";
private Collection<OCFile> mTargetFiles;
private ActionMode actionMode;
/**
@@ -81,7 +81,7 @@ public class RemoveFilesDialogFragment extends ConfirmationDialogFragment implem
containsFavorite |= file.isAvailableOffline();
}
if (files.size() == 1) {
if (files.size() == SINGLE_SELECTION) {
// choose message for a single file
OCFile file = files.get(0);
@@ -185,6 +185,7 @@ public class SetupEncryptionDialogFragment extends DialogFragment {
try {
String privateKey = task.get();
String mnemonicUnchanged = passwordField.getText().toString();
String mnemonic = passwordField.getText().toString().replaceAll("\\s", "")
.toLowerCase(Locale.ROOT);
String decryptedPrivateKey = EncryptionUtils.decryptPrivateKey(privateKey,
@@ -197,7 +198,7 @@ public class SetupEncryptionDialogFragment extends DialogFragment {
Log_OC.d(TAG, "Private key successfully decrypted and stored");
arbitraryDataProvider.storeOrUpdateKeyValue(account.name, EncryptionUtils.MNEMONIC,
mnemonic);
mnemonicUnchanged);
Intent intentExisting = new Intent();
intentExisting.putExtra(SUCCESS, true);
@@ -18,6 +18,7 @@ import android.widget.TextView;
import com.owncloud.android.R;
import com.owncloud.android.features.FeatureItem;
import com.owncloud.android.utils.ThemeUtils;
public class FeatureFragment extends Fragment {
@@ -46,7 +47,7 @@ public class FeatureFragment extends Fragment {
ImageView whatsNewImage = view.findViewById(R.id.whatsNewImage);
if (item.shouldShowImage()) {
whatsNewImage.setImageResource(item.getImage());
whatsNewImage.setImageDrawable(ThemeUtils.tintDrawable(item.getImage(), fontColor));
}
TextView whatsNewTitle = view.findViewById(R.id.whatsNewTitle);
@@ -69,6 +69,8 @@ import com.owncloud.android.ui.interfaces.ActivityListInterface;
import com.owncloud.android.ui.interfaces.VersionListInterface;
import com.owncloud.android.utils.ThemeUtils;
import org.apache.commons.httpclient.HttpStatus;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
@@ -332,7 +334,7 @@ public class FileDetailActivitiesFragment extends Fragment implements ActivityLi
Log_OC.d(TAG, result.getLogMessage());
// show error
String logMessage = result.getLogMessage();
if (result.getHttpCode() == 304) {
if (result.getHttpCode() == HttpStatus.SC_NOT_MODIFIED) {
logMessage = noResultsMessage;
}
final String finalLogMessage = logMessage;
@@ -271,6 +271,27 @@ public class LocalFileListFragment extends ExtendedListFragment implements Local
}
}
@Override
public void switchToGridView() {
mAdapter.setGridView(true);
/**
* Set recyclerview adapter again to force new view for items. If this is not done
* a few items keep their old view.
*
* https://stackoverflow.com/questions/36495009/force-recyclerview-to-redraw-android
*/
getRecyclerView().setAdapter(mAdapter);
super.switchToGridView();
}
@Override
public void switchToListView() {
mAdapter.setGridView(false);
/** Same problem here, see switchToGridView() */
getRecyclerView().setAdapter(mAdapter);
super.switchToListView();
}
/**
* Interface to implement by any Activity that includes some instance of LocalFileListFragment
*/
@@ -117,6 +117,7 @@ import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
/**
@@ -151,6 +152,8 @@ public class OCFileListFragment extends ExtendedListFragment implements
private static final String DIALOG_CREATE_FOLDER = "DIALOG_CREATE_FOLDER";
private static final int SINGLE_SELECTION = 1;
private FileFragment.ContainerActivity mContainerActivity;
private OCFile mFile;
@@ -180,7 +183,7 @@ public class OCFileListFragment extends ExtendedListFragment implements
private MenuItemAddRemove menuItemAddRemoveValue = MenuItemAddRemove.DO_NOTHING;
private ArrayList<MenuItem> mOriginalMenuItems = new ArrayList<>();
private List<MenuItem> mOriginalMenuItems = new ArrayList<>();
@Override
public void onCreate(Bundle savedInstanceState) {
@@ -439,7 +442,7 @@ public class OCFileListFragment extends ExtendedListFragment implements
/**
* Selected items in list when action mode is closed by drawer
*/
private HashSet<OCFile> mSelectionWhenActionModeClosedByDrawer = new HashSet<>();
private Set<OCFile> mSelectionWhenActionModeClosedByDrawer = new HashSet<>();
@Override
public void onDrawerSlide(@NonNull View drawerView, float slideOffset) {
@@ -487,7 +490,6 @@ public class OCFileListFragment extends ExtendedListFragment implements
}
}
/**
* Update action mode bar when an item is selected / unselected in the list
*/
@@ -894,7 +896,7 @@ public class OCFileListFragment extends ExtendedListFragment implements
return false;
}
if (checkedFiles.size() == 1) {
if (checkedFiles.size() == SINGLE_SELECTION) {
/// action only possible on a single file
OCFile singleFile = checkedFiles.iterator().next();
switch (menuId) {
@@ -109,9 +109,10 @@ public class ContactListFragment extends FileFragment {
public static final String FILE_NAME = "FILE_NAME";
public static final String ACCOUNT = "ACCOUNT";
public static final String CHECKED_ITEMS_ARRAY_KEY = "CHECKED_ITEMS";
private static final int SINGLE_ACCOUNT = 1;
@BindView(R.id.contactlist_recyclerview)
public RecyclerView recyclerView;
@@ -416,7 +417,7 @@ public class ContactListFragment extends FileFragment {
}
}
if (accounts.size() == 1) {
if (accounts.size() == SINGLE_ACCOUNT) {
importContacts(accounts.get(0));
} else {
ArrayAdapter adapter = new ArrayAdapter<>(getContext(), android.R.layout.simple_list_item_1, accounts);
@@ -565,6 +566,8 @@ public class ContactListFragment extends FileFragment {
}
class ContactListAdapter extends RecyclerView.Adapter<ContactListFragment.ContactItemViewHolder> {
private static final int SINGLE_SELECTION = 1;
private List<VCard> vCards;
private Set<Integer> checkedVCards;
@@ -704,7 +707,7 @@ class ContactListAdapter extends RecyclerView.Adapter<ContactListFragment.Contac
if (!checkedVCards.contains(verifiedPosition)) {
checkedVCards.add(verifiedPosition);
}
if (checkedVCards.size() == 1) {
if (checkedVCards.size() == SINGLE_SELECTION) {
EventBus.getDefault().post(new VCardToggleEvent(true));
}
} else {
@@ -30,7 +30,7 @@ import com.owncloud.android.lib.resources.status.OCCapability;
/**
* Helper calls for visibility logic of the sharing fragment.
*/
public class FileDetailSharingFragmentHelper {
public final class FileDetailSharingFragmentHelper {
private FileDetailSharingFragmentHelper() {
// Private empty constructor
}
@@ -412,6 +412,7 @@ public class PreviewImageFragment extends FileFragment {
private class LoadBitmapTask extends AsyncTask<OCFile, Void, LoadImage> {
private static final int PARAMS_LENGTH = 1;
/**
* Weak reference to the target {@link ImageView} where the bitmap will be loaded into.
@@ -422,7 +423,7 @@ public class PreviewImageFragment extends FileFragment {
private final WeakReference<PhotoView> mImageViewRef;
/**
* Error message to show when a load fails
* Error message to show when a load fails.
*/
private int mErrorMessageId;
@@ -440,7 +441,7 @@ public class PreviewImageFragment extends FileFragment {
protected LoadImage doInBackground(OCFile... params) {
Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND + Process.THREAD_PRIORITY_MORE_FAVORABLE);
if (params.length != 1) {
if (params.length != PARAMS_LENGTH) {
return null;
}
@@ -95,6 +95,7 @@ public class PreviewMediaFragment extends FileFragment implements
public static final String EXTRA_ACCOUNT = "ACCOUNT";
private static final String EXTRA_PLAY_POSITION = "PLAY_POSITION";
private static final String EXTRA_PLAYING = "PLAYING";
private static final double MIN_DENSITY_RATIO = 24.0;
private Account mAccount;
private ImageView mImagePreview;
@@ -666,7 +667,7 @@ public class PreviewMediaFragment extends FileFragment implements
public boolean onTouch(View v, MotionEvent event) {
if (event.getAction() == MotionEvent.ACTION_DOWN && v.equals(mVideoPreview)) {
// added a margin on the left to avoid interfering with gesture to open navigation drawer
if (event.getX() / Resources.getSystem().getDisplayMetrics().density > 24.0) {
if (event.getX() / Resources.getSystem().getDisplayMetrics().density > MIN_DENSITY_RATIO) {
startFullScreenVideo();
}
return true;
@@ -674,7 +675,6 @@ public class PreviewMediaFragment extends FileFragment implements
return false;
}
private void startFullScreenVideo() {
Intent i = new Intent(getActivity(), PreviewVideoActivity.class);
i.putExtra(FileActivity.EXTRA_ACCOUNT, mAccount);
@@ -193,6 +193,7 @@ public class PreviewTextFragment extends FileFragment {
* Reads the file to preview and shows its contents. Too critical to be anonymous.
*/
private class TextLoadAsyncTask extends AsyncTask<Object, Void, StringWriter> {
private static final int PARAMS_LENGTH = 1;
private final WeakReference<TextView> mTextViewReference;
private TextLoadAsyncTask(WeakReference<TextView> textView) {
@@ -206,8 +207,9 @@ public class PreviewTextFragment extends FileFragment {
@Override
protected StringWriter doInBackground(java.lang.Object... params) {
if (params.length != 1) {
throw new IllegalArgumentException("The parameter to " + TextLoadAsyncTask.class.getName() + " must be (1) the file location");
if (params.length != PARAMS_LENGTH) {
throw new IllegalArgumentException("The parameter to " + TextLoadAsyncTask.class.getName()
+ " must be (1) the file location");
}
String location = (String) params[0];
@@ -32,7 +32,7 @@ import com.owncloud.android.lib.common.utils.Log_OC;
/**
* Helper implementation to copy a string into the system clipboard.
*/
public class ClipboardUtil {
public final class ClipboardUtil {
private static final String TAG = ClipboardUtil.class.getName();
private ClipboardUtil() {
@@ -39,6 +39,7 @@ import com.owncloud.android.lib.common.OwnCloudClientFactory;
import com.owncloud.android.lib.common.utils.Log_OC;
import com.owncloud.android.lib.resources.status.OwnCloudVersion;
import org.apache.commons.httpclient.HttpStatus;
import org.apache.commons.httpclient.methods.GetMethod;
import org.json.JSONObject;
@@ -73,10 +74,10 @@ public final class ConnectivityUtils {
int status = client.executeMethod(get);
if (serverVersion.compareTo(OwnCloudVersion.nextcloud_13) > 0) {
return !(status == 204 &&
return !(status == HttpStatus.SC_NO_CONTENT &&
(get.getResponseContentLength() == -1 || get.getResponseContentLength() == 0));
} else {
if (status == 200) {
if (status == HttpStatus.SC_OK) {
try {
// try parsing json to verify response
// check if json contains maintenance and it should be false
@@ -113,6 +113,10 @@ public final class DisplayUtils {
private static final String HTTP_PROTOCOL = "http://";
private static final String HTTPS_PROTOCOL = "https://";
private static final String TWITTER_HANDLE_PREFIX = "@";
private static final int MIMETYPE_PARTS_COUNT = 2;
private static final int BYTE_SIZE_DIVIDER = 1024;
private static final double BYTE_SIZE_DIVIDER_DOUBLE = 1024.0;
private static final int DATE_TIME_PARTS_SIZE = 2;
private static Map<String, String> mimeType2HumanReadable;
@@ -152,8 +156,8 @@ public final class DisplayUtils {
} else {
double result = bytes;
int suffixIndex = 0;
while (result > 1024 && suffixIndex < sizeSuffixes.length) {
result /= 1024.;
while (result > BYTE_SIZE_DIVIDER && suffixIndex < sizeSuffixes.length) {
result /= BYTE_SIZE_DIVIDER_DOUBLE;
suffixIndex++;
}
@@ -173,7 +177,7 @@ public final class DisplayUtils {
if (mimeType2HumanReadable.containsKey(mimetype)) {
return mimeType2HumanReadable.get(mimetype);
}
if (mimetype.split("/").length >= 2) {
if (mimetype.split("/").length >= MIMETYPE_PARTS_COUNT) {
return mimetype.split("/")[1].toUpperCase(Locale.getDefault()) + " file";
}
return MIME_TYPE_UNKNOWN;
@@ -351,7 +355,7 @@ public final class DisplayUtils {
}
String[] parts = dateString.toString().split(",");
if (parts.length == 2) {
if (parts.length == DATE_TIME_PARTS_SIZE) {
if (parts[1].contains(":") && !parts[0].contains(":")) {
return parts[0];
} else if (parts[0].contains(":") && !parts[1].contains(":")) {
@@ -33,7 +33,7 @@ import com.owncloud.android.lib.resources.status.OwnCloudVersion;
/**
* A helper class for drawer menu related operations.
*/
public class DrawerMenuUtil {
public final class DrawerMenuUtil {
private DrawerMenuUtil() {
}
@@ -67,18 +67,17 @@ public class DrawerMenuUtil {
}
public static void filterTrashbinMenuItem(Menu menu, @Nullable Account account, @Nullable OCCapability capability) {
if (account != null && capability != null) {
if (AccountUtils.getServerVersion(account).compareTo(OwnCloudVersion.nextcloud_14) < 0 ||
capability.getFilesUndelete().isFalse() || capability.getFilesUndelete().isUnknown()) {
filterMenuItems(menu, R.id.nav_trashbin);
}
if (account != null && capability != null &&
(AccountUtils.getServerVersion(account).compareTo(OwnCloudVersion.nextcloud_14) < 0 ||
capability.getFilesUndelete().isFalse() || capability.getFilesUndelete().isUnknown())) {
filterMenuItems(menu, R.id.nav_trashbin);
}
}
public static void filterActivityMenuItem(Menu menu, @Nullable OCCapability capability) {
if (capability != null && capability.isActivityEnabled().isFalse()) {
filterMenuItems(menu, R.id.nav_activity);
}
filterMenuItems(menu, R.id.nav_activity);
}
}
public static void removeMenuItem(Menu menu, int id, boolean remove) {
@@ -69,6 +69,7 @@ import java.security.spec.PKCS8EncodedKeySpec;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.crypto.BadPaddingException;
@@ -86,7 +87,6 @@ import javax.crypto.spec.SecretKeySpec;
/**
* Utils for encryption
*/
public final class EncryptionUtils {
private static String TAG = EncryptionUtils.class.getSimpleName();
@@ -95,8 +95,8 @@ public final class EncryptionUtils {
public static final String MNEMONIC = "MNEMONIC";
public static final int ivLength = 16;
public static final int saltLength = 40;
public static final String HASH_DELIMITER = "$";
private static final String HASH_DELIMITER = "$";
private static final String ivDelimiter = "fA=="; // "|" base64 encoded
private static final int iterationCount = 1024;
private static final int keyStrength = 256;
@@ -571,8 +571,9 @@ public final class EncryptionUtils {
*/
public static String getMD5Sum(File file) {
FileInputStream fileInputStream = null;
try {
FileInputStream fileInputStream = new FileInputStream(file);
fileInputStream = new FileInputStream(file);
MessageDigest md5 = MessageDigest.getInstance("MD5");
byte[] bytes = new byte[2048];
int readBytes;
@@ -585,12 +586,20 @@ public final class EncryptionUtils {
} catch (Exception e) {
Log_OC.e(TAG, e.getMessage());
} finally {
if (fileInputStream != null) {
try {
fileInputStream.close();
} catch (IOException e) {
Log_OC.e(TAG, "Error getting MD5 checksum for file", e);
}
}
}
return "";
}
public static ArrayList<String> getRandomWords(int count, Context context) throws IOException {
public static List<String> getRandomWords(int count, Context context) throws IOException {
InputStream ins = context.getResources().openRawResource(context.getResources()
.getIdentifier("encryption_key_words", "raw", context.getPackageName()));
@@ -598,7 +607,7 @@ public final class EncryptionUtils {
BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
ArrayList<String> lines = new ArrayList<>();
List<String> lines = new ArrayList<>();
String line;
while ((line = bufferedReader.readLine()) != null) {
lines.add(line);
@@ -606,7 +615,7 @@ public final class EncryptionUtils {
SecureRandom random = new SecureRandom();
ArrayList<String> outputLines = new ArrayList<>();
List<String> outputLines = new ArrayList<>();
for (int i = 0; i < count; i++) {
int randomLine = random.nextInt(lines.size());
outputLines.add(lines.get(randomLine));
@@ -280,6 +280,8 @@ public final class FileStorageUtils {
}
}
@SuppressFBWarnings(value="OBL_UNSATISFIED_OBLIGATION_EXCEPTION_EDGE",
justification="False-positive on the output stream")
public static boolean copyFile(File src, File target) {
boolean ret = true;
@@ -41,11 +41,15 @@ public class SvgDecoder implements ResourceDecoder<InputStream, SVG> {
try {
SVG svg = SVG.getFromInputStream(source);
if (width > 0) svg.setDocumentWidth(width);
if (height > 0) svg.setDocumentHeight(height);
if (width > 0) {
svg.setDocumentWidth(width);
}
if (height > 0) {
svg.setDocumentHeight(height);
}
svg.setDocumentPreserveAspectRatio(PreserveAspectRatio.LETTERBOX);
return new SimpleResource<SVG>(svg);
return new SimpleResource<>(svg);
} catch (SVGParseException ex) {
throw new IOException("Cannot load SVG from stream", ex);
}
+35 -3
View File
@@ -32,10 +32,16 @@
<string name="drawer_item_notifications">Ειδοποιήσεις</string>
<string name="drawer_quota">χρησιμοποιούνται %1$s από %2$s</string>
<string name="drawer_quota_unlimited">%1$sσε χρήση</string>
<string name="prefs_category_general">Γενικά</string>
<string name="drawer_close">Κλείσιμο πλευρικής στήλης</string>
<string name="drawer_open">Άνοιγμα πλευρικής στήλης</string>
<string name="prefs_category_general">Γενικά</string>
<string name="prefs_category_more">Περισσότερα</string>
<string name="prefs_manage_accounts">Διαχείριση λογαριασμών</string>
<string name="prefs_lock_none">Τίποτα</string>
<string name="prefs_lock_using_passcode">Κωδικός πρόσβασης</string>
<string name="prefs_lock_using_device_credentials">Διαπιστευτήρια συσκευής</string>
<string name="prefs_lock_device_credentials_enabled">Ενεργοποιημένα διαπιστευτήρια συσκευής</string>
<string name="prefs_lock_device_credentials_not_setup">Δεν έχουν ρυθμιστεί διαπιστευτήρια συσκευής</string>
<string name="prefs_expert_mode">Λειτουργία για προχωρημένους</string>
<string name="prefs_show_hidden_files">Εμφάνιση κρυφών αρχείων</string>
<string name="prefs_log_delete_history_button">Διαγραφή ιστορικού</string>
@@ -61,7 +67,7 @@
<string name="sync_string_files">Αρχεία</string>
<string name="setup_btn_connect">Σύνδεση</string>
<string name="uploader_btn_upload_text">Μεταφόρτωση</string>
<string name="uploader_btn_alternative_text">Επιλέξτε</string>
<string name="uploader_btn_alternative_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>
@@ -181,13 +187,20 @@
<string name="foreign_files_success">Όλα τα αρχεία μετακινήθηκαν</string>
<string name="upload_query_move_foreign_files">Δεν υπάρχει αρκετός διαθέσιμος αποθηκευτικός χώρος για να αντιγραφούν τα επιλεγμένα αρχεία στον φάκελο %1$s. Θα θέλατε να τα μετακινήσετε αντί αυτού;</string>
<string name="pass_code_enter_pass_code">Παρακαλούμε εισάγετε τον κωδικό πρόσβασης</string>
<string name="default_credentials_wrong">Λανθασμένα διαπιστευτήρια</string>
<string name="credentials_disabled">Απενεργοποιημένα διαπιστευτήρια</string>
<string name="pass_code_configure_your_pass_code">Εισάγετε τον κωδικό πρόσβασης</string>
<string name="pass_code_configure_your_pass_code_explanation">Ο κωδικός πρόσβασης θα ζητείται κάθε φορά που εκκινεί η εφαρμογή</string>
<string name="pass_code_reenter_your_pass_code">Παρακαλούμε εισάγετε ξανά τον κωδικό πρόσβασης</string>
<string name="pass_code_remove_your_pass_code">Διαγραφή κωδικού πρόσβασης</string>
<string name="pass_code_mismatch">Οι κωδικοί πρόσβασης δεν ταιριάζουν</string>
<string name="pass_code_wrong">Εσφαλμένος κωδικός πρόσβασης</string>
<string name="pass_code_removed">Διεγράφη ο κωδικός πρόσβασης</string>
<string name="pass_code_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_err_nothing_to_play">Δεν βρέθηκαν αρχεία πολυμέσων</string>
<string name="media_err_not_in_owncloud">Το αρχείο δεν είναι έγκυρος λογαριασμός</string>
@@ -234,6 +247,8 @@
<string name="unfavorite">Αναίρεση ορισμού ως διαθέσιμο εκτός σύνδεσης</string>
<string name="favorite_real">Προσθήκη στα αγαπημένα</string>
<string name="unset_favorite_real">Αφαίρεση από τα αγαπημένα</string>
<string name="encrypted">Ορισμός ως κρυπτογραφημένου</string>
<string name="unset_encrypted">Χρήση κρυπτογράφησης</string>
<string name="common_rename">Μετονομασία</string>
<string name="common_remove">Διαγραφή</string>
<string name="confirmation_remove_local">Μόνο τοπικά</string>
@@ -578,14 +593,17 @@
<string name="resized_images_download_full_image">Λήψη πλήρους εικόνας;</string>
<string name="drawer_current_account">Τρέχον λογαριασμός</string>
<string name="drawer_middle_account">Μεσαίος λογαριασμός</string>
<string name="drawer_end_account">Τελευταίος λογαριασμός</string>
<string name="activity_icon">Δραστηριότητα</string>
<string name="file_icon">Αρχείο</string>
<string name="user_icon">Χρήστης</string>
<string name="favorite_icon">Αγαπημένο</string>
<string name="available_offline_icon">Διαθέσιμα εκτός σύνδεσης</string>
<string name="shared_icon_share">διαμοιρασμός</string>
<string name="shared_icon_shared_via_link">Διαμοιράστηκε μέσω συνδέσμου</string>
<string name="shared_icon_shared">διαμοιρασμένα</string>
<string name="overflow_menu">Περισσότερο μενού</string>
<string name="sort_by_name_ascending">Α - Ω</string>
<string name="sort_by_modification_date_ascending">Νεότερο πρώτα</string>
<string name="sort_by_size_descending">Μεγαλύτερο πρώτα</string>
@@ -593,7 +611,9 @@
<string name="sort_by_name_descending">Ω - Α</string>
<string name="sort_by_modification_date_descending">Παλαιότερο πρώτα</string>
<string name="synced_folders_type">Τύπος</string>
<string name="sync_status_button">Κουμπί κατάστασης συγχρονισμού</string>
<string name="synced_folder_settings_button">Κουμπί ρυθμίσεων</string>
<string name="synced_folder_custom_folder_image">Προσαρμοσμένη εικόνα φακέλου</string>
<string name="dev_version_no_information_available">Καμία διαθέσιμη πληροφορία.</string>
<string name="dev_version_no_new_version_available">Καμία διαθέσιμη νέα έκδοση.</string>
<string name="folder_icon">Εικονίδιο φακέλου</string>
@@ -607,6 +627,7 @@
<string name="notification_channel_download_description">Εμφάνιση προόδου λήψης</string>
<string name="notification_channel_upload_description">Εμφάνισης προόδου μεταφόρτωσης</string>
<string name="notification_channel_media_name">Αναπαραγωγή πολυμέσων</string>
<string name="notification_channel_media_description">Πρόοδος αναπαραγωγής μουσικής</string>
<string name="notification_channel_file_sync_name">Συγχρονισμός αρχείου</string>
<string name="account_not_found">Δεν βρέθηκε λογαριασμός!</string>
@@ -614,6 +635,8 @@
<string name="userinfo_no_info_headline">Δεν ορίστηκαν προσωπικές πληροφορίες</string>
<string name="account_icon">Εικονίδιο λογαριασμού</string>
<string name="end_to_end_encryption_folder_not_empty">Αυτός ο φάκελος δεν είναι κενός.</string>
<string name="end_to_end_encryption_wrong_password">Σφάλμα κατά την αποκρυπτογράφηση. Εσφαλμένο συνθηματικό;</string>
<string name="end_to_end_encryption_decrypting">Γίνεται αποκρυπτογράφηση…</string>
<string name="end_to_end_encryption_retrieving_keys">Γίνεται λήψη κλειδιών…</string>
<string name="end_to_end_encryption_enter_password">Παρακαλούμε εισάγετε το συνθηματικό για αποκρυπτογράφηση του ιδιωτικού κλειδιού.</string>
@@ -637,14 +660,23 @@
<string name="restore">Επαναφορά αρχείου</string>
<string name="new_version_was_created">Νέα έκδοση δημιουργήθηκε</string>
<string name="new_comment">Νέο σχόλιο…</string>
<string name="error_comment_file">Σφάλμα σχολιασμού αρχείου</string>
<string name="file_version_restored_successfully">Επιτυχημένη επαναφορά έκδοσης αρχείου.</string>
<string name="file_version_restored_error">Σφάλμα κατά την επαναφορά έκδοσης αρχείου!</string>
<string name="notification_channel_general_name">Γενικές ειδοποιήσεις</string>
<string name="new_media_folder_photos">φωτογραφία</string>
<string name="new_media_folder_videos">Βίντεο</string>
<string name="dismiss">Αποδέσμευση</string>
<string name="drawer_item_trashbin">Διεγραμμένα αρχεία</string>
<string name="trashbin_activity_title">Διεγραμμένα αρχεία</string>
<string name="action_empty_trashbin">Άδειασμα κάδου</string>
<string name="trashbin_loading_failed">Αποτυχία φόρτωσης κάδου ανακύκλωσης!</string>
<string name="stream_not_possible_message">Παρακαλούμε να γίνει λήψη των μέσων ή να χρησιμοποιηθεί εξωτερική εφαρμογή</string>
<string name="folder_already_exists">Ο φάκελος υπάρχει ήδη</string>
<string name="notification_icon">Εικονίδιο ειδοποιήσεων</string>
<string name="folder_confirm_create">Δημιουργία</string>
<string name="file_delete">Διαγραφή</string>
<string name="file_keep">Διατήρηση</string>
<string name="file_rename">Μετονομασία</string>
</resources>
<string name="fab_label">Προσθήκη ή μεταφόρτωση</string>
</resources>
+4
View File
@@ -720,6 +720,10 @@
<string name="updating_share_failed">עדכון השיתוף נכשל</string>
<string name="whats_new_device_credentials_title">שימוש בהגנה הפנימית של מכשיר ה־Android שלך</string>
<string name="login">כניסה</string>
<string name="host_your_own_server">אירוח שרת משלך</string>
<string name="first_run_1_text">ניתן להשאיר את הנתונים שלך מאובטחים ותחת שליטה</string>
<string name="first_run_2_text">שיתוף פעולה והעברת קבצים באופן מאובטח</string>
<string name="first_run_4_text">שיתוף מסך, פגישות מקוונות וכנסים מקוונים</string>
<string name="whats_new_device_credentials_content">להשתמש בכל דבר כגון תבנית נעילה, ססמה, קוד או טביעת אצבע כדי לאבטח את המידע שלך.</string>
<string name="restore_button_description">שחזור קובץ שנמחק</string>
<string name="restore">שחזור קובץ</string>
+36 -1
View File
@@ -222,6 +222,7 @@
<string name="media_err_timeout">Time-out tijdens het afspelen</string>
<string name="media_err_invalid_progressive_playback">Mediabestand kan niet worden gestreamd</string>
<string name="media_err_unknown">Mediabestand kan niet worden afgespeeld met de standaard mediaplayer</string>
<string name="media_err_playing">Onverwachte fout tijdens het afspelen %1$s</string>
<string name="media_rewind_description">Terugspoelknop</string>
<string name="media_play_pause_description">Speel- of pauzeknop</string>
<string name="media_forward_description">Doorspoelknop</string>
@@ -260,6 +261,8 @@
<string name="auth_can_not_auth_against_server">Kan niet authenticeren tegen deze server</string>
<string name="auth_account_does_not_exist">Account bestaat nog niet op dit apparaat</string>
<string name="auth_access_failed">Toegang mislukt: %1$s</string>
<string name="auth_illegal_login_used">Ongeldige login URL gebruikt</string>
<string name="favorite">Offline beschikbaar maken</string>
<string name="unfavorite">Niet langer offline beschikbaar maken</string>
<string name="favorite_real">Aan favorieten toevoegen</string>
@@ -488,6 +491,8 @@
<string name="share_get_public_link_button">Link ophalen </string>
<string name="share_with_title">Deel met…</string>
<string name="share_with_edit_title">Deel met %1$s</string>
<string name="share_via_link_unset_password">uitgeschakeld</string>
<string name="share_search">Naam, gefedereerde Cloud ID of een e-mailadres…</string>
<string name="search_users_and_groups_hint">Zoeken naar gebruikers en groepen</string>
@@ -521,6 +526,8 @@
<string name="confirmation_remove_files_alert">Wil je de geselecteerde objecten echt verwijderen?</string>
<string name="confirmation_remove_folders_alert">Wil je de geselecteerde objecten en hun inhoud echt verwijderen?</string>
<string name="maintenance_mode">Server in onderhoudsmodus</string>
<string name="offline_mode">Geen internet verbinding</string>
<string name="uploads_view_upload_status_waiting_for_charging">Wachten to apparaat wordt opgeladen</string>
<string name="actionbar_search">Zoeken</string>
<string name="files_drop_not_supported">Dit is een Nextcloud optie, graag bijwerken.</string>
@@ -650,6 +657,7 @@
<string name="file_icon">Bestand</string>
<string name="user_icon">Gebruiker</string>
<string name="favorite_icon">Favoriet</string>
<string name="synced_icon">gesynchroniseerd</string>
<string name="available_offline_icon">Offline beschikbaar</string>
<string name="checkbox">Aanvinkvakje</string>
<string name="shared_icon_share">delen</string>
@@ -731,31 +739,58 @@
<string name="notification_channel_push_description">Toon push meldingen verstuurd door de server: als je wordt vermeld in reacties, of als je een deellink ontvangt of als een beheerder een aankondiging plaatst.</string>
<string name="sendbutton_description">Verstuur-knop pictogram</string>
<string name="oauth_2_0_auth_end_point_address_hint">Auth end point adres</string>
<string name="oauth_2_0_access_end_point_address_hint">Toegang end point adres</string>
<string name="hint_name">Naam</string>
<string name="hint_password">Wachtwoord</string>
<string name="add_to_cloud">Voeg toe aan %1$s</string>
<string name="upload_files">Bestanden uploaden</string>
<string name="upload_content_from_other_apps">Uploaden content vanaf andere apps</string>
<string name="create_new_folder">Nieuwe map aanmaken</string>
<string name="uploads_view_upload_status_virus_detected">Virus gevonden. Upload kan niet vervolledigd worden!</string>
<string name="tags">Labels</string>
<string name="unsharing_failed">Stoppen met delen mislukt</string>
<string name="updating_share_failed">Bijwerken delen mislukt</string>
<string name="prefs_e2e_mnemonic">E2E mnemonic</string>
<string name="whats_new_device_credentials_title">Gebruik de interne Android\'s apparaatbeveiliging</string>
<string name="login">Inloggen</string>
<string name="signup_with_provider">Aanmelden bij provider</string>
<string name="host_your_own_server">Host je eigen server</string>
<string name="first_run_1_text">Hou je gegevens veilig en in eigen beheer</string>
<string name="first_run_2_text">Beveiligde samenwerking &amp; bestand uitwisseling</string>
<string name="first_run_3_text">Eenvoudige webmail, agenda &amp; contacten</string>
<string name="first_run_4_text">Schermdelen, online afspraken &amp; web conferenties</string>
<string name="whats_new_device_credentials_content">Gebruik een patroon, wachtwoord, pin of je vingerafdruk om je gegevens te beveiligen.</string>
<string name="restore_button_description">Herstel verwijderd bestand</string>
<string name="restore">Herstellen bestand</string>
<string name="new_version_was_created">Nieuwe versie gecreëerd</string>
<string name="new_comment">Nieuwe reactie…</string>
<string name="error_comment_file">Fout bij plaatsen commentaar</string>
<string name="file_version_restored_successfully">Herstellen bestandsversie succesvol</string>
<string name="file_version_restored_error">Fout bij herstellen bestandsversie!</string>
<string name="notification_channel_general_name">Algemene meldingen</string>
<string name="notification_channel_general_description">Tonen meldingen voor nieuwe mediamappen en dergelijke</string>
<string name="new_media_folder_detected">Nieuwe%1$smedia map gevonden.</string>
<string name="new_media_folder_photos">foto</string>
<string name="new_media_folder_videos">video</string>
<string name="outdated_server">Deze server is verouderd, graag upgraden!</string>
<string name="dismiss">Weigeren</string>
<string name="feedback_no_mail_app">Geen app beschikbaar voor versturen mail!</string>
<string name="drawer_item_trashbin">Verwijderde bestanden</string>
<string name="trashbin_activity_title">Verwijderde bestanden</string>
<string name="action_empty_trashbin">Legen prullebak</string>
<string name="trashbin_loading_failed">Laden prullenbak mislukt!</string>
<string name="trashbin_file_not_deleted">Bestand %1$s kon niet worden verwijderd!</string>
<string name="trashbin_file_not_restored">Bestand %1$s kon niet worden hersteld!</string>
<string name="trashbin_not_emptied">Bestanden konden niet permanent worden verwijderd!</string>
<string name="stream">Streamen met…</string>
<string name="stream_not_possible_headline">Intern streamen niet mogelijk</string>
<string name="stream_not_possible_message">Download media in plaats van gebruik externe app.</string>
<string name="folder_already_exists">Map bestaat al</string>
<string name="notification_icon">Meldingenpictogram</string>
<string name="folder_confirm_create">Aanmaken</string>
<string name="file_delete">Verwijderen</string>
<string name="file_keep">Behouden</string>
<string name="file_rename">Hernoemen</string>
</resources>
<string name="fab_label">Toevoegen of uploaden</string>
</resources>
+2 -1
View File
@@ -31,7 +31,8 @@
<string name="drawer_item_activities">Aktywności</string>
<string name="drawer_item_notifications">Powiadomienia</string>
<string name="drawer_quota">Użyto %1$s z %2$s</string>
<string name="drawer_close">Zamknij pasek boczny</string>
<string name="drawer_quota_unlimited">%1$s wykorzystano</string>
<string name="drawer_close">Zamknij pasek boczny</string>
<string name="drawer_open">Otwórz pasek boczny</string>
<string name="prefs_category_general">Ogólne</string>
<string name="prefs_category_more">Więcej</string>
+1
View File
@@ -816,4 +816,5 @@
<string name="file_keep">Keep</string>
<string name="file_rename">Rename</string>
<string name="fab_label">Add or upload</string>
<string name="account_creation_failed">Account creation failed</string>
</resources>
@@ -28,9 +28,12 @@ import com.owncloud.android.db.PreferenceManager;
import java.security.Key;
public class PushUtils {
public final class PushUtils {
public static final String KEY_PUSH = "push";
private PushUtils() {
}
public static void pushRegistrationToServer() {
// do nothing
}
@@ -44,7 +47,7 @@ public class PushUtils {
return null;
}
public SignatureVerification verifySignature(Context context, byte[] signatureBytes, byte[] subjectBytes) {
public static SignatureVerification verifySignature(Context context, byte[] signatureBytes, byte[] subjectBytes) {
return null;
}
}