From 32331d73021a9b4a96c973e7f054666da31d653d Mon Sep 17 00:00:00 2001 From: Jorge Ruesga Date: Tue, 13 Nov 2012 01:57:16 +0100 Subject: [PATCH 01/11] CMFileManager: Fixes for non-rooted devices Various fixes for non-rooted devices running under java console: * Improve navigation (caching unsused data on chrooted mode: aids, mountpoints, ...) * Editor: Don't ask user to gain privileges (non rooted devices never can gain privileged access) * Move common file operations to FileHelper * MoveCommand: As shell console, java console doesn't allow to move between filesystems. Use a copy-delete operation when renameTo is not allowed. * On non-rooted devices, not allow to change to other access mode. Change-Id: I7ae8b4f4203fc8a20f498e43f45c0a956731b02e --- .../activities/EditorActivity.java | 9 +- .../preferences/SettingsPreferences.java | 2 + .../commands/java/CopyCommand.java | 85 +------------- .../commands/java/DeleteDirCommand.java | 27 +---- .../commands/java/MoveCommand.java | 33 +++++- .../ui/dialogs/FsoPropertiesDialog.java | 2 +- .../filemanager/util/AIDHelper.java | 76 ++++++------ .../filemanager/util/ExceptionUtil.java | 2 +- .../filemanager/util/FileHelper.java | 109 ++++++++++++++++++ .../filemanager/util/MountPointHelper.java | 29 +++-- 10 files changed, 217 insertions(+), 157 deletions(-) diff --git a/src/com/cyanogenmod/filemanager/activities/EditorActivity.java b/src/com/cyanogenmod/filemanager/activities/EditorActivity.java index 9e6796689..912c0befb 100644 --- a/src/com/cyanogenmod/filemanager/activities/EditorActivity.java +++ b/src/com/cyanogenmod/filemanager/activities/EditorActivity.java @@ -42,6 +42,7 @@ import android.widget.TextView.BufferType; import android.widget.Toast; +import com.cyanogenmod.filemanager.FileManagerApplication; import com.cyanogenmod.filemanager.R; import com.cyanogenmod.filemanager.commands.AsyncResultListener; import com.cyanogenmod.filemanager.commands.WriteExecutable; @@ -49,6 +50,7 @@ import com.cyanogenmod.filemanager.console.InsufficientPermissionsException; import com.cyanogenmod.filemanager.console.RelaunchableException; import com.cyanogenmod.filemanager.model.FileSystemObject; +import com.cyanogenmod.filemanager.preferences.AccessMode; import com.cyanogenmod.filemanager.preferences.FileManagerSettings; import com.cyanogenmod.filemanager.ui.ThemeManager; import com.cyanogenmod.filemanager.ui.ThemeManager.Theme; @@ -550,9 +552,12 @@ public void onProgress(int progress) { // Check if the read was successfully if (this.mReader.mCause != null) { // Check if we can't read the file because we don't the require - // permissions + // permissions. If we are in a ChRooted environment, resolve the + // error without doing anymore if (this.mReader.mCause instanceof InsufficientPermissionsException) { - if (!ConsoleBuilder.isPrivileged()) { + if (!ConsoleBuilder.isPrivileged() && + FileManagerApplication.getAccessMode(). + compareTo(AccessMode.SAFE) != 0) { // We don't have a privileged console, we can't ask the user // to gain privileges and relauch the command again askGainAccessAndRead( diff --git a/src/com/cyanogenmod/filemanager/activities/preferences/SettingsPreferences.java b/src/com/cyanogenmod/filemanager/activities/preferences/SettingsPreferences.java index 438e8c109..b78aafc28 100644 --- a/src/com/cyanogenmod/filemanager/activities/preferences/SettingsPreferences.java +++ b/src/com/cyanogenmod/filemanager/activities/preferences/SettingsPreferences.java @@ -304,6 +304,8 @@ public void onCreate(Bundle savedInstanceState) { FileManagerSettings.SETTINGS_ACCESS_MODE.getId(), defaultValue); this.mOnChangeListener.onPreferenceChange(this.mAccessMode, value); + // If device is not rooted, this setting cannot be changed + this.mAccessMode.setEnabled(FileManagerApplication.isDeviceRooted()); // Capture Debug traces this.mDebugTraces = diff --git a/src/com/cyanogenmod/filemanager/commands/java/CopyCommand.java b/src/com/cyanogenmod/filemanager/commands/java/CopyCommand.java index 3e1e316fd..0c7832cc8 100644 --- a/src/com/cyanogenmod/filemanager/commands/java/CopyCommand.java +++ b/src/com/cyanogenmod/filemanager/commands/java/CopyCommand.java @@ -23,13 +23,10 @@ import com.cyanogenmod.filemanager.console.InsufficientPermissionsException; import com.cyanogenmod.filemanager.console.NoSuchFileOrDirectory; import com.cyanogenmod.filemanager.model.MountPoint; +import com.cyanogenmod.filemanager.util.FileHelper; import com.cyanogenmod.filemanager.util.MountPointHelper; -import java.io.BufferedInputStream; -import java.io.BufferedOutputStream; import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; /** @@ -84,7 +81,7 @@ public void execute() } //Copy recursively - if (!copyRecursive(s, d)) { + if (!FileHelper.copyRecursive(s, d, getBufferSize())) { if (isTrace()) { Log.v(TAG, "Result: FAIL. InsufficientPermissionsException"); //$NON-NLS-1$ } @@ -111,82 +108,4 @@ public MountPoint getSrcWritableMountPoint() { public MountPoint getDstWritableMountPoint() { return MountPointHelper.getMountPointFromDirectory(this.mDst); } - - /** - * Method that copies recursively to the destination - * - * @param src The source file or folder - * @param dst The destination file or folder - * @return boolean If the operation complete successfully - * @throws ExecutionException If a problem was detected in the operation - */ - public boolean copyRecursive(final File src, final File dst) throws ExecutionException { - if (src.isDirectory()) { - // Create the directory - if (dst.exists() && !dst.isDirectory()) { - Log.e(TAG, - String.format("Failed to check destionation dir: %s", dst)); //$NON-NLS-1$ - throw new ExecutionException("the path exists but is not a folder"); //$NON-NLS-1$ - } - if (!dst.exists()) { - if (!dst.mkdir()) { - Log.e(TAG, String.format("Failed to create directory: %s", dst)); //$NON-NLS-1$ - return false; - } - } - File[] files = src.listFiles(); - if (files != null) { - for (int i = 0; i < files.length; i++) { - if (!copyRecursive(files[i], new File(dst, files[i].getName()))) { - return false; - } - } - } - } else { - // Copy the directory - if (!bufferedCopy(src, dst)) { - return false; - } - } - return true; - } - - /** - * Method that copies a file - * - * @param src The source file - * @param dst The destination file - * @return boolean If the operation complete successfully - */ - public boolean bufferedCopy(final File src, final File dst) { - BufferedInputStream bis = null; - BufferedOutputStream bos = null; - try { - bis = new BufferedInputStream(new FileInputStream(src), getBufferSize()); - bos = new BufferedOutputStream(new FileOutputStream(dst), getBufferSize()); - int read = 0; - byte[] data = new byte[getBufferSize()]; - while ((read = bis.read(data, 0, getBufferSize())) != -1) { - bos.write(data, 0, read); - } - return true; - - } catch (Throwable e) { - Log.e(TAG, - String.format(TAG, "Failed to copy from %s to %d", src, dst), e); //$NON-NLS-1$ - return false; - } finally { - try { - if (bis != null) { - bis.close(); - } - } catch (Throwable e) {/**NON BLOCK**/} - try { - if (bos != null) { - bos.close(); - } - } catch (Throwable e) {/**NON BLOCK**/} - } - - } } diff --git a/src/com/cyanogenmod/filemanager/commands/java/DeleteDirCommand.java b/src/com/cyanogenmod/filemanager/commands/java/DeleteDirCommand.java index 07e9498da..04b8e20c2 100644 --- a/src/com/cyanogenmod/filemanager/commands/java/DeleteDirCommand.java +++ b/src/com/cyanogenmod/filemanager/commands/java/DeleteDirCommand.java @@ -23,6 +23,7 @@ import com.cyanogenmod.filemanager.console.InsufficientPermissionsException; import com.cyanogenmod.filemanager.console.NoSuchFileOrDirectory; import com.cyanogenmod.filemanager.model.MountPoint; +import com.cyanogenmod.filemanager.util.FileHelper; import com.cyanogenmod.filemanager.util.MountPointHelper; import java.io.File; @@ -84,7 +85,7 @@ public void execute() } // Delete the file - if (!deleteFolder(f)) { + if (!FileHelper.deleteFolder(f)) { if (isTrace()) { Log.v(TAG, "Result: FAIL. InsufficientPermissionsException"); //$NON-NLS-1$ } @@ -111,28 +112,4 @@ public MountPoint getSrcWritableMountPoint() { public MountPoint getDstWritableMountPoint() { return MountPointHelper.getMountPointFromDirectory(this.mPath); } - - /** - * Method that deletes a folder recursively - * - * @param folder The folder to delete - * @return boolean If the folder was deleted - */ - private boolean deleteFolder(File folder) { - File[] files = folder.listFiles(); - if (files != null) { - for (int i = 0; i < files.length; i++) { - if (files[i].isDirectory()) { - if (!deleteFolder(files[i])) { - return false; - } - } else { - if (!files[i].delete()) { - return false; - } - } - } - } - return folder.delete(); - } } diff --git a/src/com/cyanogenmod/filemanager/commands/java/MoveCommand.java b/src/com/cyanogenmod/filemanager/commands/java/MoveCommand.java index f94e7f1fe..b0c85fb38 100644 --- a/src/com/cyanogenmod/filemanager/commands/java/MoveCommand.java +++ b/src/com/cyanogenmod/filemanager/commands/java/MoveCommand.java @@ -23,6 +23,7 @@ import com.cyanogenmod.filemanager.console.InsufficientPermissionsException; import com.cyanogenmod.filemanager.console.NoSuchFileOrDirectory; import com.cyanogenmod.filemanager.model.MountPoint; +import com.cyanogenmod.filemanager.util.FileHelper; import com.cyanogenmod.filemanager.util.MountPointHelper; import java.io.File; @@ -78,12 +79,34 @@ public void execute() throw new NoSuchFileOrDirectory(this.mSrc); } - //Copy recursively - if (!s.renameTo(d)) { - if (isTrace()) { - Log.v(TAG, "Result: FAIL. InsufficientPermissionsException"); //$NON-NLS-1$ + //Move or copy recursively + if (d.exists()) { + if (!FileHelper.copyRecursive(s, d, getBufferSize())) { + if (isTrace()) { + Log.v(TAG, "Result: FAIL. InsufficientPermissionsException"); //$NON-NLS-1$ + } + throw new InsufficientPermissionsException(); + } + if (!FileHelper.deleteFolder(s)) { + if (isTrace()) { + Log.v(TAG, "Result: OK. WARNING. Source not deleted."); //$NON-NLS-1$ + } + } + } else { + // Move between filesystem is not allow. If rename fails then use copy operation + if (!s.renameTo(d)) { + if (!FileHelper.copyRecursive(s, d, getBufferSize())) { + if (isTrace()) { + Log.v(TAG, "Result: FAIL. InsufficientPermissionsException"); //$NON-NLS-1$ + } + throw new InsufficientPermissionsException(); + } + if (!FileHelper.deleteFolder(s)) { + if (isTrace()) { + Log.v(TAG, "Result: OK. WARNING. Source not deleted."); //$NON-NLS-1$ + } + } } - throw new InsufficientPermissionsException(); } if (isTrace()) { diff --git a/src/com/cyanogenmod/filemanager/ui/dialogs/FsoPropertiesDialog.java b/src/com/cyanogenmod/filemanager/ui/dialogs/FsoPropertiesDialog.java index 44c980059..4a5a06a87 100644 --- a/src/com/cyanogenmod/filemanager/ui/dialogs/FsoPropertiesDialog.java +++ b/src/com/cyanogenmod/filemanager/ui/dialogs/FsoPropertiesDialog.java @@ -347,7 +347,7 @@ private void loadAIDs() { new AsyncTask>() { @Override protected SparseArray doInBackground(Void...params) { - return AIDHelper.getAIDs(FsoPropertiesDialog.this.mContext); + return AIDHelper.getAIDs(FsoPropertiesDialog.this.mContext, true); } @Override diff --git a/src/com/cyanogenmod/filemanager/util/AIDHelper.java b/src/com/cyanogenmod/filemanager/util/AIDHelper.java index c94cf2d38..50b3efef1 100644 --- a/src/com/cyanogenmod/filemanager/util/AIDHelper.java +++ b/src/com/cyanogenmod/filemanager/util/AIDHelper.java @@ -36,6 +36,8 @@ public final class AIDHelper { private static final String TAG = "AIDHelper"; //$NON-NLS-1$ + private static SparseArray sAids; + /** * Constructor of AIDHelper. */ @@ -47,45 +49,51 @@ private AIDHelper() { * Method that returns the Android IDs (system + application AID) * * @param context The current context + * @param force Force the reload of the AIDs * @return SparseArray The array of {@link AID} */ - public static SparseArray getAIDs(Context context) { - Properties systemAIDs = null; - try { - // Load the default known system identifiers - systemAIDs = new Properties(); - systemAIDs.load(context.getResources().openRawResource(R.raw.aid)); - } catch (Exception e) { - Log.e(TAG, "Fail to load AID raw file.", e); //$NON-NLS-1$ - return null; - } + public synchronized static SparseArray getAIDs(Context context, boolean force) { + if (sAids == null || force) { + Properties systemAIDs = null; + try { + // Load the default known system identifiers + systemAIDs = new Properties(); + systemAIDs.load(context.getResources().openRawResource(R.raw.aid)); + } catch (Exception e) { + Log.e(TAG, "Fail to load AID raw file.", e); //$NON-NLS-1$ + return null; + } - // Add the default known system identifiers - SparseArray aids = new SparseArray(); - Iterator it = systemAIDs.keySet().iterator(); - while (it.hasNext()) { - String key = (String)it.next(); - String value = systemAIDs.getProperty(key); - int uid = Integer.parseInt(key); - aids.put(uid, new AID(uid, value)); - } + // Add the default known system identifiers + SparseArray aids = new SparseArray(); + Iterator it = systemAIDs.keySet().iterator(); + while (it.hasNext()) { + String key = (String)it.next(); + String value = systemAIDs.getProperty(key); + int uid = Integer.parseInt(key); + aids.put(uid, new AID(uid, value)); + } - // Now, retrieve all AID of installed applications - final PackageManager pm = context.getPackageManager(); - List packages = - pm.getInstalledApplications(PackageManager.GET_META_DATA); - int cc = packages.size(); - for (int i = 0; i < cc; i++) { - ApplicationInfo info = packages.get(i); - int uid = info.uid; - if (aids.indexOfKey(uid) < 0) { - String name = pm.getNameForUid(uid); - aids.put(uid, new AID(uid, name)); + // Now, retrieve all AID of installed applications + final PackageManager pm = context.getPackageManager(); + List packages = + pm.getInstalledApplications(PackageManager.GET_META_DATA); + int cc = packages.size(); + for (int i = 0; i < cc; i++) { + ApplicationInfo info = packages.get(i); + int uid = info.uid; + if (aids.indexOfKey(uid) < 0) { + String name = pm.getNameForUid(uid); + aids.put(uid, new AID(uid, name)); + } } + + // Save to cached aids + sAids = aids; } // Return the list of AIDs found - return aids; + return sAids; } /** @@ -96,7 +104,9 @@ public static SparseArray getAIDs(Context context) { * @return AID The AID */ public static AID getAIDFromName(Context ctx, String name) { - SparseArray aids = getAIDs(ctx); + // This method is only used by java console under chrooted mode, so + // is safe to caching aids, because sdcards only allow known aids + SparseArray aids = getAIDs(ctx, false); int len = aids.size(); for (int i = 0; i < len; i++) { AID aid = aids.valueAt(i); @@ -104,7 +114,7 @@ public static AID getAIDFromName(Context ctx, String name) { return aid; } } - return null; + return new AID(-1, ""); //$NON-NLS-1$ } } diff --git a/src/com/cyanogenmod/filemanager/util/ExceptionUtil.java b/src/com/cyanogenmod/filemanager/util/ExceptionUtil.java index 213f4dc7c..84821f92d 100644 --- a/src/com/cyanogenmod/filemanager/util/ExceptionUtil.java +++ b/src/com/cyanogenmod/filemanager/util/ExceptionUtil.java @@ -256,7 +256,7 @@ static void askUser( } // If console is privileged there is not need to change - // If we are in a ChRooted environment, resolve the error without do anymore + // If we are in a ChRooted environment, resolve the error without doing anymore if (relaunchable instanceof InsufficientPermissionsException && (isPrivileged || FileManagerApplication.getAccessMode().compareTo(AccessMode.SAFE) == 0)) { diff --git a/src/com/cyanogenmod/filemanager/util/FileHelper.java b/src/com/cyanogenmod/filemanager/util/FileHelper.java index ba6c05e7f..bd9049799 100644 --- a/src/com/cyanogenmod/filemanager/util/FileHelper.java +++ b/src/com/cyanogenmod/filemanager/util/FileHelper.java @@ -24,6 +24,7 @@ import com.cyanogenmod.filemanager.FileManagerApplication; import com.cyanogenmod.filemanager.R; import com.cyanogenmod.filemanager.commands.shell.ResolveLinkCommand; +import com.cyanogenmod.filemanager.console.ExecutionException; import com.cyanogenmod.filemanager.model.AID; import com.cyanogenmod.filemanager.model.BlockDevice; import com.cyanogenmod.filemanager.model.CharacterDevice; @@ -43,7 +44,11 @@ import com.cyanogenmod.filemanager.preferences.ObjectIdentifier; import com.cyanogenmod.filemanager.preferences.Preferences; +import java.io.BufferedInputStream; +import java.io.BufferedOutputStream; import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; import java.io.IOException; import java.util.Collections; import java.util.Comparator; @@ -836,4 +841,108 @@ public static FileSystemObject createFileSystemObject(Context ctx, File file) { } return null; } + + /** + * Method that copies recursively to the destination + * + * @param src The source file or folder + * @param dst The destination file or folder + * @param bufferSize The buffer size for the operation + * @return boolean If the operation complete successfully + * @throws ExecutionException If a problem was detected in the operation + */ + public static boolean copyRecursive( + final File src, final File dst, int bufferSize) throws ExecutionException { + if (src.isDirectory()) { + // Create the directory + if (dst.exists() && !dst.isDirectory()) { + Log.e(TAG, + String.format("Failed to check destionation dir: %s", dst)); //$NON-NLS-1$ + throw new ExecutionException("the path exists but is not a folder"); //$NON-NLS-1$ + } + if (!dst.exists()) { + if (!dst.mkdir()) { + Log.e(TAG, String.format("Failed to create directory: %s", dst)); //$NON-NLS-1$ + return false; + } + } + File[] files = src.listFiles(); + if (files != null) { + for (int i = 0; i < files.length; i++) { + if (!copyRecursive(files[i], new File(dst, files[i].getName()), bufferSize)) { + return false; + } + } + } + } else { + // Copy the directory + if (!bufferedCopy(src, dst,bufferSize)) { + return false; + } + } + return true; + } + + /** + * Method that copies a file + * + * @param src The source file + * @param dst The destination file + * @param bufferSize The buffer size for the operation + * @return boolean If the operation complete successfully + */ + public static boolean bufferedCopy(final File src, final File dst, int bufferSize) { + BufferedInputStream bis = null; + BufferedOutputStream bos = null; + try { + bis = new BufferedInputStream(new FileInputStream(src), bufferSize); + bos = new BufferedOutputStream(new FileOutputStream(dst), bufferSize); + int read = 0; + byte[] data = new byte[bufferSize]; + while ((read = bis.read(data, 0, bufferSize)) != -1) { + bos.write(data, 0, read); + } + return true; + + } catch (Throwable e) { + Log.e(TAG, + String.format(TAG, "Failed to copy from %s to %d", src, dst), e); //$NON-NLS-1$ + return false; + } finally { + try { + if (bis != null) { + bis.close(); + } + } catch (Throwable e) {/**NON BLOCK**/} + try { + if (bos != null) { + bos.close(); + } + } catch (Throwable e) {/**NON BLOCK**/} + } + } + + /** + * Method that deletes a folder recursively + * + * @param folder The folder to delete + * @return boolean If the folder was deleted + */ + public static boolean deleteFolder(File folder) { + File[] files = folder.listFiles(); + if (files != null) { + for (int i = 0; i < files.length; i++) { + if (files[i].isDirectory()) { + if (!deleteFolder(files[i])) { + return false; + } + } else { + if (!files[i].delete()) { + return false; + } + } + } + } + return folder.delete(); + } } diff --git a/src/com/cyanogenmod/filemanager/util/MountPointHelper.java b/src/com/cyanogenmod/filemanager/util/MountPointHelper.java index 97036188b..a91affacd 100644 --- a/src/com/cyanogenmod/filemanager/util/MountPointHelper.java +++ b/src/com/cyanogenmod/filemanager/util/MountPointHelper.java @@ -45,6 +45,11 @@ public final class MountPointHelper { "ext4" //$NON-NLS-1$ }); + private static final long MAX_CACHED_TIME = 60000L * 5; + + private static List sMountPoints; + private static long sLastCachedTime; + /** * Constructor of MountPointHelper. */ @@ -84,15 +89,25 @@ public static MountPoint getMountPointFromDirectory(String dir) { * @param dir The directory of which recovers his mount point information * @return MountPoint The mount point information */ - public static MountPoint getMountPointFromDirectory(Console console, String dir) { + public synchronized static MountPoint getMountPointFromDirectory(Console console, String dir) { try { - //Retrieve the mount points - List mps = - CommandHelper.getMountPoints(null, console); + // For non-rooted devices, which console is java and runs under a chrooted + // device, mount point info mustn't be a main objective. Caching the status + // should be enough and operation runs smoothly. + // Refresh mount points after some time (5 minutes should be enough) + long now = System.currentTimeMillis(); + if (sMountPoints == null || (now - sLastCachedTime) > MAX_CACHED_TIME || + FileManagerApplication.isDeviceRooted()) { + //Retrieve the mount points + List mps = + CommandHelper.getMountPoints(null, console); + sMountPoints = mps; + sLastCachedTime = now; + } //Sort mount points in reverse order, needed for avoid //found an incorrect that matches the name - Collections.sort(mps, new Comparator() { + Collections.sort(sMountPoints, new Comparator() { @Override public int compare(MountPoint lhs, MountPoint rhs) { return lhs.compareTo(rhs) * -1; @@ -100,9 +115,9 @@ public int compare(MountPoint lhs, MountPoint rhs) { }); //Search for the mount point information - int cc = mps.size(); + int cc = sMountPoints.size(); for (int i = 0; i < cc; i++) { - MountPoint mp = mps.get(i); + MountPoint mp = sMountPoints.get(i); if (dir.startsWith(mp.getMountPoint())) { return mp; } From f506bb982bf5ef5782800696bba7b8c1387794b5 Mon Sep 17 00:00:00 2001 From: igoriok Date: Mon, 12 Nov 2012 18:36:35 +0200 Subject: [PATCH 02/11] CMFileManager: updated romanian translation Change-Id: Ief7f6e63dd1f1eeacbbd55670a58e08e45fc1ed9 Signed-off-by: igoriok --- res/values-ro/strings.xml | 7 +++++++ themes/res/values-ro/strings.xml | 25 +++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 themes/res/values-ro/strings.xml diff --git a/res/values-ro/strings.xml b/res/values-ro/strings.xml index ec7a2c33f..b168bca17 100644 --- a/res/values-ro/strings.xml +++ b/res/values-ro/strings.xml @@ -285,6 +285,13 @@ Eliminaţi termenii de căutare salvaţi Apăsaţi pentru eliminarea tuturor termenilor de căutare salvaţi Toţi termenii de căutare salvaţi au fost eliminaţi. + Teme + Aplicaţi tema + Nici o previzualizare\ndisponibilă + Tema a fost aplicată cu succes. + Tema nu a fost găsită. + Temă \"deschisă\" + Temă \"deschisă\" pentru Managerul de Fişiere CyanogenMod. Avertizare!\n\nExtragerea unui fişier arhivă cu căi relative sau absolute poate cauza defecţiuni dispozitivului Dvs. prin suprascrierea fişierelor de sistem.\n\nDoriţi să continuaţi? diff --git a/themes/res/values-ro/strings.xml b/themes/res/values-ro/strings.xml new file mode 100644 index 000000000..36555253c --- /dev/null +++ b/themes/res/values-ro/strings.xml @@ -0,0 +1,25 @@ + + + + + + Teme Manager Fișiere + Teme pentru Managerul de Fișiere CyanogenMod. + Temă \"întunecată\" + + Temă \"întunecată\" pentru Managerul de Fișiere CyanogenMod. + + From c5ad23bdb34051cb26429cade8f4e97cd8186aaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Buga=20D=C3=A1niel?= Date: Wed, 14 Nov 2012 18:15:49 +0100 Subject: [PATCH 03/11] Update Hungarian translations Updated some Hungarian strings to be a bit easier to understand. Added Dark Theme strings. Change-Id: Id1469ee5a6f042ee875712e976775ce8e7c51720 --- res/values-hu/strings.xml | 82 ++++++++++++++++---------------- themes/res/values-hu/strings.xml | 29 +++++++++++ 2 files changed, 70 insertions(+), 41 deletions(-) create mode 100644 themes/res/values-hu/strings.xml diff --git a/res/values-hu/strings.xml b/res/values-hu/strings.xml index e5650b732..aa2838c92 100644 --- a/res/values-hu/strings.xml +++ b/res/values-hu/strings.xml @@ -71,7 +71,7 @@ A beállítást nem lehet alkalmazni, vagy elmenteni. - A kezdő könyvtár "%1$s" helytelen. Váltás a gyökérkönyvtárra. + A kezdő könyvtár "%1$s" érvénytelen. Váltás a gyökérkönyvtárra. A művelet sikeresen befejeződött. @@ -82,7 +82,7 @@ A fájl vagy a könyvtár nem található. - A műveleti parancs nem található, vagy érvénytelen definíció. + A műveleti parancs nem található, vagy érvénytelen. Olvasási / írási hiba. @@ -106,13 +106,13 @@ Nyomja meg mégegyszer a kilépéshez. - Nincs társítva alkalmazás a kijelölt fájltípus kezelésére. + A kijelölt fájltípushoz nincs alkalmazás társítva. - Néhány fájl létezik a cél könyvtárban.\n\nFelülírja? + Néhány fájl már létezik a célkönyvtárban.\n\nFelülírja? - Sikertelen a művelet társítása az alkalmazáshoz. + A műveletet nem sikerült társítani az alkalmazáshoz. A művelet elvégzéséhez nincs megfelelő jogosultsága.\n\nÁtvált rendszergazda módra? @@ -179,17 +179,17 @@ Nincs elérhető információ a fájlrendszerről. - A fájlrendszer nem csatolható/lecsatolható. + A fájlrendszer nem csatolható. - Fájlrendszer csatolási műveletek nincsenek engedélyezve a biztonságos módban. Érintse meg a rendszergazda módba való váltáshoz. + Fájlrendszer-csatolási műveletek nincsenek engedélyezve a biztonságos módban. Érintse meg a rendszergazda módba való váltáshoz. - Fájlrendszer csatolási művelet sikertelen. Néhány fájlrendszer, mint bizonyos SD-kártyák fizikailag nem írhatóak. + Fájlrendszer-csatolási művelet sikertelen. Néhány fájlrendszer, mint bizonyos SD-kártyák fizikailag nem írhatóak. - Fájlrendszer információ + Fájlrendszer-információ Információ - Tárhely használat + Tárhelyhasználat Státusz: @@ -212,11 +212,11 @@ A jogosultság állítása nem engedélyezett biztonságos módban. Érintse meg a rendszergazda módba való váltáshoz. - A tulajdonos váltása sikertelen.\n\nBiztonsági okoból, néhány fájlrendszer, mint az SD-kártyák, nem engedélyezik a tulajdonos megváltoztatását. + A tulajdonos váltása sikertelen.\n\nBiztonsági okoból néhány fájlrendszer, mint az SD-kártyák, nem engedélyezik a tulajdonos megváltoztatását. - A csoport váltása sikertelen.\n\nBiztonsági okoból, néhány fájlrendszer, mint az SD-kártyák, nem engedélyezik a csoport megváltoztatását. + A csoport váltása sikertelen.\n\nBiztonsági okoból néhány fájlrendszer, mint az SD-kártyák, nem engedélyezik a csoport megváltoztatását. - A jogosultság megváltoztatása sikertelen.\n\nBiztonsági okoból, néhány fájlrendszer, mint az SD-kártyák, nem engedélyezik a jogosultságok megváltoztatását. + A jogosultság megváltoztatása sikertelen.\n\nBiztonsági okoból néhány fájlrendszer, mint az SD-kártyák, nem engedélyezik a jogosultságok megváltoztatását. Tulajdonságok @@ -248,14 +248,14 @@ - 0 könyvtár - 1 könyvtár + %1$d könyvtár - 0 fájl - 1 fájl + %1$d fájl @@ -273,13 +273,13 @@ Mondja ki a keresést - A keresés közben hiba történt. Nincs találat. + Hiba történt keresés közben. Nincs találat. Nincs találat. Nem található elem - 1 találat + %d találat @@ -289,7 +289,7 @@ Keresés megerősítése - Néhány keresési kifejezés kevés számú karaktert tartalmaz. A művelet sokáig eltarthat és megterhelheti a rendszert.\n\nBiztosan folytatja? + Néhány keresési kifejezés túl rövid. A művelet sokáig eltarthat és megterhelheti a rendszert.\n\nBiztosan folytatja? Kérem várjon\u2026 @@ -303,17 +303,17 @@ Érvénytelen fájl. - Fájl nem található. + A fájl nem található. - A fájl túl nagy ahhoz, hogy ezen az eszközön megnyithassa. + A fájl túl nagy, ezen az eszközön nem megnyitható. Kilépés megerősítése - El nem mentett módosítások.\n\nKilép mentés nélkül? + Nem mentette el a módosításokat.\n\nMindenképpen kilép? A fájl sikeresen elmentve. - A fájl csak olvashatóként van megnyitva. + A fájl csak olvasható. Könyvjelzők @@ -335,7 +335,7 @@ Válasszon kezdőkonyvtárat: - A relatív útvonal nem engedélyezett. + Relatív útvonalak nem használhatóak. Hiba történt a kezdőkönyvtár mentésekor. @@ -380,9 +380,9 @@ Elemzés\u2026]]> - A kitömörítés sikeresen befejeződött. Az adatokat a következő helyen találja %1$s. + A kitömörítés sikeresen befejeződött. Az adatokat a következő helyen találja: %1$s. - A tömörítés sikeresen befejeződött. Az adatokat a következő helyen találja %1$s. + A tömörítés sikeresen befejeződött. Az adatokat a következő helyen találja: %1$s. Műveletek @@ -447,9 +447,9 @@ A név mező nem lehet üres. - Helytelen név. A \'%1$s\' karakterek nincsenek engedélyezve. + Helytelen név. A \'%1$s\' karakterek nem megengedettek. - Helytelen név. A \'.\' és a \'..\' nincs enegélyezve. + Helytelen név. A \'.\' és a \'..\' nem megengedett. A név már létezik. @@ -536,18 +536,18 @@ Névjegy - Fájl kezelő v%1$s \nCopyright \u00A9 2012 The CyanogenMod Project + Fájlkezelő v%1$s \nCopyright \u00A9 2012 The CyanogenMod Project Általános Kis-/nagybetű helyes rendezés - Tárterület telítettség figyelmeztetés + Figyelmeztetés kevés tárterületnél - Tárterület használat megjelenítése más színnel, amikor a szabad hely eléri a %1$s százalékot. + Tárterület-használat megjelenítése más színnel, amikor az eléri a %1$s százalékot. Mappa statisztika számítása @@ -567,11 +567,11 @@ Rákérdezéses mód - Rákérdezés a felhasználótól.\n\nAz alkalmazás teljes jogkörrel hozzáfér a fájlrendszerhez, de a művelet végrehajtása előtt rákérdez a felhasználótól. + Rákérdezéses mód\n\nAz alkalmazás teljes jogkörrel hozzáfér a fájlrendszerhez, de kényes művelet végrehajtása előtt engedélyt kér a felhasználótól. Rendszergazda mód - Rendszergazda mód\n\nFigyelmeztetés! Ez a mód lehetővé teszi, hogy károsítsa az eszközt. Az Ön felelőssége annak biztosítása, hogy a művelet biztonságos legyen + Rendszergazda mód\n\nFigyelem! Ebben a módban semmi nem akadályozza meg, hogy egy helytelen művelet tönkretegye az eszközét. Csak saját felelősségére használja! Találatok @@ -585,15 +585,15 @@ Név szerint - Relevancia szerint + Találati pontosság szerint Titoktartás Keresési feltételek elmentése - Keresési feltételek el lesznek mentve a használható javaslatok érdekében + A keresési feltételek el lesznek mentve a használható javaslatok érdekében - Keresési feltételek nem lesznek elmentve + A keresési feltételek nem lesznek elmentve Keresési feltételek törlése @@ -605,9 +605,9 @@ Téma beállítása - Nincs előnézeti\nkép + Nincs előnézeti kép - Téma sikeresen beállítva. + Téma beállítva. Nem található téma. @@ -615,7 +615,7 @@ Hibakeresési napló - Világos Theme + Világos téma Világos téma a CyanogenMod Fájlkezelőhöz. @@ -630,6 +630,6 @@ Üdvözöljük - Üdvözöli a CyanogenMod fájlkezelő.\n\nEz az alkalmazás lehetővé teszi a fájlrendszer tallózását és olyan műveletek végrehajtását is, mellyel károsodhat az eszköz. A károsodás elkerülése érdekében az alkalmazás védett, alacsony jogosultsággal indul.\n\nLehetősége van a speciális beállításoknál a teljes privilegizált módú futtatásra is. Az Ön felelőssége annak biztosítása, hogy a művelet ne károsítsa a rendszert.\n\nA CyanogenMod csapata.\n + Üdvözöli a CyanogenMod fájlkezelő.\n\nEz az alkalmazás lehetővé teszi a fájlrendszer böngészését és olyan műveletek végrehajtását is, melyek esetleg károsíthatják az eszköz. A károsodás elkerülése érdekében az alkalmazás védett, alacsony jogosultsággal indul.\n\nLehetősége van a speciális beállításoknál a teljes privilegizált módú futtatásra is. Az Ön felelőssége annak biztosítása, hogy az egyes műveletek ne károsítsák a rendszert.\n\nA CyanogenMod csapata.\n diff --git a/themes/res/values-hu/strings.xml b/themes/res/values-hu/strings.xml new file mode 100644 index 000000000..a2ef24858 --- /dev/null +++ b/themes/res/values-hu/strings.xml @@ -0,0 +1,29 @@ + + + + + + + Fájlkezelő témák + + Témák a CyanogenMod Fájlkezelőhöz. + + + Sötét téma + + Sötét téma a CyanogenMod Fájlkezelőhöz. + + From b3d9e642a5f1d7483d579c18f74255a830aa4a2c Mon Sep 17 00:00:00 2001 From: Jorge Ruesga Date: Thu, 15 Nov 2012 21:52:00 +0100 Subject: [PATCH 04/11] Issue 6624: CM File manager: Mount RW does not work if i slide the slider from ro to rw. Issue: http://code.google.com/p/cyanogenmod/issues/detail?id=6624 Changed onClickListener for OnCheckedChangeListener for the switch control. The OnCheckedChangeListener listener handles both events: click and slide. Change-Id: I9b8c81d4d7489fce2cbef1f4799a12266cb14acf --- .../ui/dialogs/FilesystemInfoDialog.java | 73 +++++++++++-------- 1 file changed, 43 insertions(+), 30 deletions(-) diff --git a/src/com/cyanogenmod/filemanager/ui/dialogs/FilesystemInfoDialog.java b/src/com/cyanogenmod/filemanager/ui/dialogs/FilesystemInfoDialog.java index 19ca29342..b9752df4d 100644 --- a/src/com/cyanogenmod/filemanager/ui/dialogs/FilesystemInfoDialog.java +++ b/src/com/cyanogenmod/filemanager/ui/dialogs/FilesystemInfoDialog.java @@ -23,6 +23,8 @@ import android.view.LayoutInflater; import android.view.View; import android.view.View.OnClickListener; +import android.widget.CompoundButton; +import android.widget.CompoundButton.OnCheckedChangeListener; import android.widget.Switch; import android.widget.TextView; @@ -46,7 +48,7 @@ * A class that wraps a dialog for showing information about a mount point.
* This class display information like mount point name, device name, size, type, ... */ -public class FilesystemInfoDialog implements OnClickListener { +public class FilesystemInfoDialog implements OnClickListener, OnCheckedChangeListener { /** * An interface to communicate when the user change the mount state @@ -178,7 +180,7 @@ private void fillData(View contentView) { //Gets text views this.mSwStatus = (Switch)contentView.findViewById(R.id.filesystem_info_status); - this.mSwStatus.setOnClickListener(this); + this.mSwStatus.setOnCheckedChangeListener(this); TextView tvMountPoint = (TextView)contentView.findViewById(R.id.filesystem_info_mount_point); TextView tvDevice = (TextView)contentView.findViewById(R.id.filesystem_info_device); @@ -290,14 +292,50 @@ public void run() { }); break; + case R.id.filesystem_info_msg: + //Change the console + boolean superuser = ConsoleBuilder.changeToPrivilegedConsole(this.mContext); + if (superuser) { + this.mInfoMsgView.setOnClickListener(null); + + // Is filesystem able to be mounted? + boolean mountAllowed = MountPointHelper.isMountAllowed(this.mMountPoint); + if (mountAllowed) { + this.mInfoMsgView.setVisibility(View.GONE); + this.mInfoMsgView.setBackground(null); + this.mSwStatus.setEnabled(true); + this.mIsMountAllowed = true; + break; + } + + // Show the message + this.mInfoMsgView.setText( + this.mContext.getString( + R.string.filesystem_info_cant_be_mounted_msg)); + this.mInfoMsgView.setVisibility(View.VISIBLE); + this.mIsMountAllowed = false; + } + break; + + default: + break; + } + } + + /** + * {@inheritDoc} + */ + @Override + public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { + switch (buttonView.getId()) { case R.id.filesystem_info_status: //Mount the filesystem - Switch sw = (Switch)v; + Switch sw = (Switch)buttonView; boolean ret = false; try { ret = CommandHelper.remount( this.mContext, - this.mMountPoint, sw.isChecked(), null); + this.mMountPoint, isChecked, null); //Hide warning message this.mInfoMsgView.setVisibility(View.GONE); //Communicate the mount change @@ -315,32 +353,7 @@ public void run() { //Show warning message this.mInfoMsgView.setText(R.string.filesystem_info_mount_failed_msg); this.mInfoMsgView.setVisibility(View.VISIBLE); - sw.setChecked(!sw.isChecked()); - } - break; - - case R.id.filesystem_info_msg: - //Change the console - boolean superuser = ConsoleBuilder.changeToPrivilegedConsole(this.mContext); - if (superuser) { - this.mInfoMsgView.setOnClickListener(null); - - // Is filesystem able to be mounted? - boolean mountAllowed = MountPointHelper.isMountAllowed(this.mMountPoint); - if (mountAllowed) { - this.mInfoMsgView.setVisibility(View.GONE); - this.mInfoMsgView.setBackground(null); - this.mSwStatus.setEnabled(true); - this.mIsMountAllowed = true; - break; - } - - // Show the message - this.mInfoMsgView.setText( - this.mContext.getString( - R.string.filesystem_info_cant_be_mounted_msg)); - this.mInfoMsgView.setVisibility(View.VISIBLE); - this.mIsMountAllowed = false; + sw.setChecked(!isChecked); } break; From 41caa1499be93e47e89de175e2562272caa38e21 Mon Sep 17 00:00:00 2001 From: Jorge Ruesga Date: Thu, 15 Nov 2012 23:47:31 +0100 Subject: [PATCH 05/11] CMFileManager: Overlay activity must use overlay style Use FileManager.Theme.Holo.Light.Overlay and FileManager.Theme.Holo.Overlay for overlay activities Change-Id: I722b77e85753a81d360c87abc6b377acdbd147fd --- .../cyanogenmod/filemanager/activities/ChangeLogActivity.java | 2 +- src/com/cyanogenmod/filemanager/activities/PickerActivity.java | 2 +- .../cyanogenmod/filemanager/activities/ShortcutActivity.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/com/cyanogenmod/filemanager/activities/ChangeLogActivity.java b/src/com/cyanogenmod/filemanager/activities/ChangeLogActivity.java index 889b6512d..ae3a7c8f1 100644 --- a/src/com/cyanogenmod/filemanager/activities/ChangeLogActivity.java +++ b/src/com/cyanogenmod/filemanager/activities/ChangeLogActivity.java @@ -160,7 +160,7 @@ public void onCancel(DialogInterface dialog) { */ void applyTheme() { Theme theme = ThemeManager.getCurrentTheme(this); - theme.setBaseTheme(this, false); + theme.setBaseTheme(this, true); } } diff --git a/src/com/cyanogenmod/filemanager/activities/PickerActivity.java b/src/com/cyanogenmod/filemanager/activities/PickerActivity.java index d40dcba65..e40106411 100644 --- a/src/com/cyanogenmod/filemanager/activities/PickerActivity.java +++ b/src/com/cyanogenmod/filemanager/activities/PickerActivity.java @@ -366,7 +366,7 @@ public void onItemClick(AdapterView parent, View v, int position, long id) { */ void applyTheme() { Theme theme = ThemeManager.getCurrentTheme(this); - theme.setBaseTheme(this, false); + theme.setBaseTheme(this, true); // View theme.setBackgroundDrawable(this, this.mRootView, "background_drawable"); //$NON-NLS-1$ diff --git a/src/com/cyanogenmod/filemanager/activities/ShortcutActivity.java b/src/com/cyanogenmod/filemanager/activities/ShortcutActivity.java index 4578ce6b7..cf4377066 100644 --- a/src/com/cyanogenmod/filemanager/activities/ShortcutActivity.java +++ b/src/com/cyanogenmod/filemanager/activities/ShortcutActivity.java @@ -238,7 +238,7 @@ public void onCancel(DialogInterface dialog) { */ void applyTheme() { Theme theme = ThemeManager.getCurrentTheme(this); - theme.setBaseTheme(this, false); + theme.setBaseTheme(this, true); } } From 467118952ad95f800ec3f2be753ae59e8177fd4e Mon Sep 17 00:00:00 2001 From: Jorge Ruesga Date: Thu, 15 Nov 2012 23:56:40 +0100 Subject: [PATCH 06/11] CMFileManager: Fix invalid resource on create shortcut Resource must be drawable and not string. Otherwise the resource is not found and shortcut is not created. activities Change-Id: I6f526b2e8ca4458e6fa8b1bd80667e153f664cec --- .../filemanager/ui/policy/IntentsActionPolicy.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/com/cyanogenmod/filemanager/ui/policy/IntentsActionPolicy.java b/src/com/cyanogenmod/filemanager/ui/policy/IntentsActionPolicy.java index be0533b7e..004719b0e 100644 --- a/src/com/cyanogenmod/filemanager/ui/policy/IntentsActionPolicy.java +++ b/src/com/cyanogenmod/filemanager/ui/policy/IntentsActionPolicy.java @@ -265,7 +265,7 @@ public static void createShortcut(Context ctx, FileSystemObject fso) { String resid = MimeTypeHelper.getIcon(ctx, fso); int dwid = ResourcesHelper.getIdentifier( - ctx.getResources(), "string", resid); //$NON-NLS-1$ + ctx.getResources(), "drawable", resid); //$NON-NLS-1$ // The intent to send to broadcast for register the shortcut intent Intent intent = new Intent(); @@ -324,4 +324,4 @@ private static List createEditorIntent(Context ctx, FileSystemObject fso return intents; } -} \ No newline at end of file +} From 5056c53f5893ea8a103459cccdb490bde6a61e70 Mon Sep 17 00:00:00 2001 From: Jorge Ruesga Date: Sat, 17 Nov 2012 02:04:40 +0100 Subject: [PATCH 07/11] CMFileManager: Remove duplicate code Remove duplicate code for creation of privileged console Change-Id: I124286f6f33385f8c0faa98406b12fba67310775 --- .../filemanager/console/ConsoleBuilder.java | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/src/com/cyanogenmod/filemanager/console/ConsoleBuilder.java b/src/com/cyanogenmod/filemanager/console/ConsoleBuilder.java index 34ff8c4e1..331e82450 100644 --- a/src/com/cyanogenmod/filemanager/console/ConsoleBuilder.java +++ b/src/com/cyanogenmod/filemanager/console/ConsoleBuilder.java @@ -375,19 +375,9 @@ public static Console createAndCheckPrivilegedConsole( throws FileNotFoundException, IOException, InvalidCommandDefinitionException, ConsoleAllocException, InsufficientPermissionsException { try { - PrivilegedConsole console = new PrivilegedConsole(initialDirectory); - console.setBufferSize(context.getResources().getInteger(R.integer.buffer_size)); - console.alloc(); - if (console.getIdentity().getUser().getId() != ROOT_UID) { - //The console is not a privileged console - try { - console.dealloc(); - } catch (Throwable ex) { - /**NON BLOCK**/ - } - throw new InsufficientPermissionsException(null); - } - return console; + // Create the privileged console + return createPrivilegedConsole(context, initialDirectory); + } catch (ConsoleAllocException caEx) { //Show a message with the problem? Log.w(TAG, context.getString(R.string.msgs_privileged_console_alloc_failed), caEx); From 9c866c8abc9b3dcfd7d31a469a49968f1e6e968a Mon Sep 17 00:00:00 2001 From: Tanguy Pruvot Date: Sat, 17 Nov 2012 01:47:24 +0100 Subject: [PATCH 08/11] Fix possible NPE, and log path of "not found" commands Patchset 2: Added more log from https://github.com/tpruvot/android_packages_apps_CMFileManager/commit/6634611ba820f2a2c90f6ed9a7658f1d076bb32c Change-Id: I1612e16b7e144f688909501434230f7e55d5d459 --- .../filemanager/commands/shell/IdentityCommand.java | 3 ++- src/com/cyanogenmod/filemanager/commands/shell/Shell.java | 4 ++++ src/com/cyanogenmod/filemanager/console/ConsoleBuilder.java | 4 ++-- src/com/cyanogenmod/filemanager/util/ParseHelper.java | 3 ++- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/com/cyanogenmod/filemanager/commands/shell/IdentityCommand.java b/src/com/cyanogenmod/filemanager/commands/shell/IdentityCommand.java index 339637a60..e87a90eca 100644 --- a/src/com/cyanogenmod/filemanager/commands/shell/IdentityCommand.java +++ b/src/com/cyanogenmod/filemanager/commands/shell/IdentityCommand.java @@ -89,7 +89,8 @@ public void parse(String in, String err) throws ParseException { //At least uid and gid must be present if (!p.containsKey(UID) && !p.containsKey(GID)) { throw new ParseException( - String.format("no %s or %s present", UID, GID), 0); //$NON-NLS-1$ + String.format( + "no %s or %s present in %s", UID, GID, szLine), 0); //$NON-NLS-1$ } //1.- Extract user diff --git a/src/com/cyanogenmod/filemanager/commands/shell/Shell.java b/src/com/cyanogenmod/filemanager/commands/shell/Shell.java index 648dcfd13..779796d77 100644 --- a/src/com/cyanogenmod/filemanager/commands/shell/Shell.java +++ b/src/com/cyanogenmod/filemanager/commands/shell/Shell.java @@ -24,6 +24,7 @@ import com.cyanogenmod.filemanager.console.NoSuchFileOrDirectory; import com.cyanogenmod.filemanager.console.ReadOnlyFilesystemException; +import android.util.Log; /** * An abstract class that represents a command to wrap others commands, @@ -33,6 +34,8 @@ public abstract class Shell extends Command { private int mPid; + private final String TAG = "Shell"; + /** * @Constructor of Shell * @@ -72,6 +75,7 @@ public void checkExitCode(int exitCode) throws InsufficientPermissionsException, CommandNotFoundException, ExecutionException { //Command not found if (exitCode == 127) { + Log.w(TAG, getCommand() + " " + getArguments() + ": error"); throw new CommandNotFoundException(getId()); } //No exit code diff --git a/src/com/cyanogenmod/filemanager/console/ConsoleBuilder.java b/src/com/cyanogenmod/filemanager/console/ConsoleBuilder.java index 331e82450..1552abd95 100644 --- a/src/com/cyanogenmod/filemanager/console/ConsoleBuilder.java +++ b/src/com/cyanogenmod/filemanager/console/ConsoleBuilder.java @@ -115,7 +115,7 @@ public static Console getConsole(Context context, boolean createIfNotExists) public static boolean changeToNonPrivilegedConsole(Context context) { //Check the current console - if (sHolder.getConsole() instanceof NonPriviledgeConsole) { + if (sHolder != null && sHolder.getConsole() instanceof NonPriviledgeConsole) { //The current console is non-privileged. Not needed return true; } @@ -147,7 +147,7 @@ public static boolean changeToNonPrivilegedConsole(Context context) { public static boolean changeToPrivilegedConsole(Context context) { //Destroy and create the new console - if (sHolder.getConsole() instanceof PrivilegedConsole) { + if (sHolder != null && sHolder.getConsole() instanceof PrivilegedConsole) { //The current console is privileged. Not needed return true; } diff --git a/src/com/cyanogenmod/filemanager/util/ParseHelper.java b/src/com/cyanogenmod/filemanager/util/ParseHelper.java index f59b98008..43c4b6e7e 100644 --- a/src/com/cyanogenmod/filemanager/util/ParseHelper.java +++ b/src/com/cyanogenmod/filemanager/util/ParseHelper.java @@ -152,7 +152,8 @@ public static FileSystemObject toFileSystemObject( Pattern pattern = Pattern.compile(DATE_PATTERN); Matcher matcher = pattern.matcher(raw); if (!matcher.find()) { - throw new ParseException("last modification date not found", 0); //$NON-NLS-1$ + throw new ParseException( + "last modification date not found in " + raw, 0); //$NON-NLS-1$ } Date dLastModified = null; try { From 660bb5d8e7f7d43fc9d8b6aa8497d197b6f4a902 Mon Sep 17 00:00:00 2001 From: DelPETER Date: Tue, 13 Nov 2012 23:15:45 +0100 Subject: [PATCH 09/11] CMFileManager : French translation correction Patch 5: No-break spaces, update typo, more understandable, ... Patch 6: Add themes Patch 7: Dark theme, fichiers, ... Change-Id: I092625fe29534c24f02476c8cafc9a81d79d67f1 --- res/values-fr/strings.xml | 305 ++++++++++++++++--------------- themes/res/values-fr/strings.xml | 32 ++++ 2 files changed, 194 insertions(+), 143 deletions(-) create mode 100644 themes/res/values-fr/strings.xml diff --git a/res/values-fr/strings.xml b/res/values-fr/strings.xml index 4e2f329d3..a613de70a 100644 --- a/res/values-fr/strings.xml +++ b/res/values-fr/strings.xml @@ -16,9 +16,9 @@ - Explorateur de fichier + Explorateur de fichiers - Explorateur de fichier CyanogenMod. + Explorateur de fichiers CyanogenMod @@ -34,20 +34,20 @@ Ecraser - Rechercher: %1$s + Rechercher\u00A0: %1$s - Chargement \u2026; + Chargement\u2026 - Annulé. + Annulé - Erreur. + Erreur Attention - Erreur detecté + Erreur detectée Confirmer l\'opération @@ -58,64 +58,64 @@ Confirmer le changement - Impossible de passer en mode Root. Retour au mode normal.\n\nEffectuer le changement? + Impossible de passer en mode Root. Retour au mode normal.\n\nEffectuer le changement\u00A0? - Impossible d\'obtenir les privilèges requis pour fonctionner. + Impossible d\'obtenir les privilèges requis pour fonctionner Impossible de passer en mode Root. Retour au mode normal. - Le réglage ne ​​peut être appliqué ou enregistré. + Impossible d\'appliquer ou d\'enregistrer le réglage - Le dossier d\'acceuil "%1$s" est invalide. Changement vers le dossier Root. + Le dossier d\'accueil "%1$s" est invalide. Changement vers le dossier Root. - L\'opération a réussie. + Opération réussie - Une erreur a été détecté. L\'opération n\'a pas réussi. + Une erreur a été détectée. L\'opération a échoué - Cette opération nécessite une élévation des droits. Tentative d\'accés Root. + Cette opération nécessite une élévation des droits. Tentative d\'accès Root. - Le fichier ou le dossier n\'a pas été trouvé. + Fichier ou dossier introuvable - La commande n\'a pas été trouvé ou a une définition non valide. + Commande introuvable ou définition invalide - Lecture/Ecriture échouée. + Lecture/Ecriture échouée - L\'opération a expiré. + Opération expirée - L\'opération a échoué. + Opération échouée - Une erreur interne s\'est produite. + Erreur interne - L\'opération ne peut pas être annulé. + Impossible d\'annuler l\'opération Le système de fichiers est en lecture seul. Essayez de monter le système de fichiers en lecture-écriture avant de retenter l\'opération. - Argument illégal. invocation échoué. + Argument illégal. Invocation échouée. - L\'opération n\'est pas autorisée car cela créerait des incohérences. + Opération non autorisée pour cause d\'incohérences - L\'opération n\'est pas autorisée dans le dossier actuel. + Opération non autorisée dans le dossier actuel - Appuyez encore pour sortir. + Appuyer encore pour sortir - Il n\'y a pas d\'application enregistré pour ouvrir le fichier sélectionné. + Aucune application disponible pour ouvrir le fichier sélectionné - Certains fichiers existent déjà dans le dossier de destination.\n\nEcraser? + Certains fichiers existent déjà dans le dossier de destination.\n\nEcraser\u00A0? - Associer l\'action à l\'application a échoué. + Impossible d\'associer l\'action à l\'application - L\'opération nécessite une élévation des priviléges.\n\nVoulez-vous passer en mode Root? + L\'opération nécessite une élévation des privilèges.\n\nVoulez-vous passer en mode Root\u00A0? - Dossier parents + Dossier parent Stockage externe @@ -128,7 +128,7 @@ Mode d\'affichage - Autre option d\'affichage + Autres options d\'affichage Terminé @@ -163,24 +163,24 @@ Détails - Afficher les dossiers en premier + Dossiers en premier - Afficher les fichiers cachés + Fichiers cachés - Afficher les fichiers systèmes + Fichiers systèmes - Afficher les raccourcis + Raccourcis - Pas d\'information + Aucune information - Il n\'y a pas d\'information disponible pour le système de fichiers. + Aucune information disponible pour le système de fichiers - Le système de fichier ne peut pas être monté/démonté. + Impossible de monter/démonter le système de fichiers - Les opérations de montage du système de fichiers ne sont pas autorisés en mode sécurisé. Appuyez pour passer en mode Root. + Les opérations de montage du système de fichiers ne sont pas autorisées en mode sécurisé. Appuyez pour passer en mode Root. - L\'opération de montage du système de fichiers a échoué. Certains système de fichiers, comme les cartes SD, ne peuvent pas être monté car ils intégrent un système de fichier en lecture seul. + Opération de montage du système de fichiers échouée. Certains systèmes de fichiers, comme les cartes SD, ne peuvent pas être monté car ils intègrent un système de fichier en lecture seul. Information du système de fichiers @@ -188,27 +188,27 @@ Utilisation du disque - Statut: + Statut\u00A0: - Point de montage: + Point de montage\u00A0: - Appareil: + Appareil\u00A0: - Type: + Type\u00A0: - Options: + Options\u00A0: - Dump / Pass: + Dump/Pass\u00A0: - Total: + Total\u00A0: - Utilisé: + Utilisé\u00A0: - Libre: + Libre\u00A0: - Les opération sur les permissions ne sont pas autorisé en mode sécurisé. Appuyez pour passer en mode Root. + Les opérations sur les permissions ne sont pas autorisées en mode sécurisé. Appuyez pour passer en mode Root. Le changement de propriétaire a échoué.\n\nPour des raisons de sécurité, certains systèmes de fichiers, comme les cartes SD, ne permettent pas de changer de propriétaire. @@ -222,27 +222,27 @@ Permissions - Nom: + Nom\u00A0: - Parent: + Parent\u00A0: - Type: + Type\u00A0: - Categorie: + Catégorie\u00A0: - Lien: + Lien\u00A0: - Taille: + Taille\u00A0: - Contenu: + Contenu\u00A0: - Dernière accés: + Dernier accès\u00A0: - Propriétaire: + Propriétaire\u00A0: - Groupe: + Groupe\u00A0: - Autres: + Autres\u00A0: @@ -260,12 +260,12 @@ Historique - L\'historique est vide. + Aucun historique - Elément de l\'historique inconnu. + Elément de l\'historique inconnu - Résultat de la recherche + Résultats de la recherche Recherche @@ -273,23 +273,23 @@ Une erreur s\'est produite lors de la recherche. Aucun résultat trouvé. - Pas de résultat trouvé. + Aucun résultat trouvé - Pas d\'éléments trouvés + Aucun élément trouvé 1 élément trouvé %d éléments trouvés %1$s dans %2$s - Termes:]]> %1$s + Termes :]]> %1$s Confirmer la recherche - Certains des termes de recherche dispose d\'un petit nombre de caractères. L\'opération pourrait être très coûteux en temps et en ressources système.\n\nVoulez-vous continuer? + Certains des termes de recherche disposent d\'un petit nombre de caractères. L\'opération pourrait être très coûteuse en temps et en ressources système.\n\nVoulez-vous continuer\u00A0? - Patientez \u2026; + Veuillez Patienter\u2026 Recherche en cours\u2026 @@ -299,43 +299,43 @@ Editeur - Fichier non valide. + Fichier non valide - Fichier non trouvé. + Fichier non trouvé - Le fichier est trop volumineux pour être ouvert sur votre appareil. + Fichier trop volumineux pour être ouvert sur votre appareil Quitter - Il y a des changements non enregistrés.\n\nQuitter sans enregistrer? + Le fichier a été modifié.\n\nQuitter sans enregistrer\u00A0? - Le fichier a été enregistré. + Modifications enregistrées - Le fichier ouvert est en lecture seul. + Fichier ouvert en lecture seule Favoris - Acceuil + Accueil Dossier Root Dossier système - Choisir le dossier d\'acceuil. + Choisir le dossier d\'accueil. - Supprimer le favoris. + Supprimer le favori - Le favori a été ajouté. + Favori ajouté - Dossier d\'acceuil + Dossier d\'accueil - Choisir le dossier d\'acceuil: + Choisir le dossier d\'accueil - Les chemins relatifs ne sont pas autorisés. + Chemins relatifs non autorisés - Une erreur s\'est produite lors de l\'enregistrement du dossier d\'acceuil. + Erreur lors de l\'enregistrement du dossier d\'accueil Historique @@ -356,41 +356,41 @@ %1$s - nouveau%2$s - Effectuer l\'opération \u2026; + Opération en cours\u2026 - Copie \u2026; + Copie De]]> %1$s]]> à]]> %2$s - Déplacement \u2026; + Déplacement De]]> %1$s]]> à]]> %2$s - Suppression \u2026; + Suppression Fichier]]> %1$s - Extraction \u2026; + Extraction Fichier]]> %1$s - Compression \u2026; + Compression Fichier]]> %1$s - Analyse \u2026;]]> + Analyse\u2026]]> - L\'extraction s\'est terminée correctement. Les donnéees ont été extraite dans %1$s. + Extraction correctement terminée. Les donnéees ont été extraite dans %1$s. - La compression s\'est terminée correctement. Les donnéees ont été compressé dans %1$s. + Compression correctement terminée. Les donnéees ont été compressé dans %1$s. Actions @@ -405,11 +405,11 @@ Tout sélectionner - Tout dé-sélectionner + Tout désélectionner - Selectionner + Sélectionner - Dé-sélectionner + Désélectionner Coller la sélection @@ -425,7 +425,7 @@ Ouvrir avec - Executer + Exécuter Envoyer @@ -437,9 +437,9 @@ Renommer - Créer une copie + Dupliquer - Propriété + Propriétés Ajouter aux favoris @@ -448,18 +448,18 @@ Ouvrir le dossier parent - Cette action ne peut pas être annulé. Voulez-vous continuer? + Cette action ne peut pas être annulée. Voulez-vous continuer\u00A0? - Nom: + Nom\u00A0: - Le nom ne pas être vide. + Nom requis - Le nom n\'est pas valide. Les caractères \'%1$s\' ne sont pas autorisés. + Nom invalide. Les caractères \'%1$s\' ne sont pas autorisés. - Le nom n\'est pas valide. Les noms \'.\' et \'..\' ne sont pas autorisés. + Nom invalide. Les noms \'.\' et \'..\' ne sont pas autorisés. - Le nom existe déjà. + Nom déjà attribué Association @@ -475,17 +475,17 @@ Envoyer - Rien à compléter. + Rien à compléter Console - Scripts: + Scripts\u00A0: - Time: + Durée\u00A0: - Exit code: + Code de sortie\u00A0: %1$s sec. @@ -500,13 +500,13 @@ - %1$s dossier sélectionné. - %1$s dossiers sélectionnés. - %1$s fichier sélectionné. - %1$s fichiers sélectionnés. - %1$s dossier et %2$s fichier sélectionnés. - %1$s dossier et %2$s fichiers sélectionnés. - %1$s dossiers et %2$s fichiers sélectionnés. + %1$s dossier sélectionné + %1$s dossiers sélectionnés + %1$s fichier sélectionné + %1$s fichiers sélectionnés + %1$s dossier et %2$s fichier sélectionnés + %1$s dossier et %2$s fichiers sélectionnés + %1$s dossiers et %2$s fichiers sélectionnés @@ -530,20 +530,22 @@ Mode de compression - Impossible d\'atteindre le raccourci. + Impossible d\'atteindre le raccourci - La création du raccourci a réussi. + Raccourci créé - La création du raccourci a échoué. + Création du raccourci échouée - Paramétres + Paramètres - Paramétres généraux + Paramètres généraux Options de recherche + + Thèmes - A propos + À propos File Manager v%1$s \nCopyright \u00A9 2012 The CyanogenMod Project @@ -551,47 +553,47 @@ Général - Utiliser la casse dans les tris + Tenir compte de la casse - Avertissement d\'utilisation du disque + Avertissement d\'utilisation disque - Afficher une couleur différente dans la barre d\'utilisation du disque quand il atteint %1$s pourcent d\'espace libre + Afficher une couleur différente dans la barre d\'utilisation de l\'espace disque lorsque %1$s pourcent d\'espace est utilisé Calculer les statistiques de dossiers - Attention! Le calcul des statistiques de dossiers est coûteuse en temps et en ressources système + Attention\u00A0! Le calcul des statistiques de dossiers est coûteux en temps et en ressources système. Utiliser les mouvements de glissement - Utiliser le mouvement de gauche à droite pour supprimer un fichier ou un dossier. + Utiliser le mouvement de gauche à droite pour supprimer un fichier ou un dossier Avancé - Mode d\'accés + Mode d\'accès Mode sécurisé - Mode sécurisé\n\nL\'application fonctionne sans privilèges et les systèmes de fichiers accessibles sont les volumes de stockage (cartes SD et USB). + Mode sécurisé\n\nL\'application fonctionne sans privilège et les systèmes de fichiers accessibles sont les volumes de stockage (cartes SD et USB). Demander le mode - Demander le mode\n\nL\'application fonctionne avec un accès complet au système de fichiers, mais vous demandera la permission avant d\'exécuter toutes les actions avec priviléges + Demander le mode\n\nL\'application fonctionne avec un accès complet au système de fichiers, mais demandera la permission avant d\'exécuter toutes les actions avec privilèges. Mode Root - Mode Root\n\nAttention! Ce mode permet des opérations qui pourraient endommager votre appareil. Il est de votre responsabilité de veiller à ce que les opérations effectuées soient sures + Mode Root\n\nAttention\u00A0! Ce mode permet des opérations qui pourraient endommager votre appareil. Il est de votre responsabilité de veiller à ce que les opérations effectuées soient sûres. Résultats Afficher le widget des pertinences - Mettre les termes de recherche en surbrillance + Surbrillance des termes de recherche Mode de tri des résultats - Pas de tri + Aucun tri Par nom @@ -601,21 +603,38 @@ Sauvergarder les termes de recherche - Les termes de recherche ont été sauvegardé et seront suggérés dans les recherches futures + Les termes de recherche seront sauvegardés et seront suggérés dans les recherches futures - Les termes de recherche n\'ont pas été sauvegardé + Les termes de recherche n\'ont pas été sauvegardés - Supprimer les termes de recherche + Effacer l\'historique de recherche - Appuyez pour supprimer tout les termes de recherche sauvergardés + Appuyer pour supprimer tous les termes de recherche sauvergardés - Tout les termes de recherche ont été supprimé. + Historique de recherche effacé + + Thèmes + + Appliquer le thème + + Aucune prévisualisation\ndisponible + + Thème appliqué avec succès + + Thème introuvable - Information de débogage + Informations de débogage + + + Thème Clair + + Un thème clair pour l\'Explorateur de fichiers CyanogenMod. + + CyanogenMod - Attention!\n\n Extraire une archive vers un chemin absolu ou relatif peut causer des dommages sur votre appareil en écrasant des fichiers système.\n\nVoulez-vous continuer? + Attention\u00A0!\n\n Extraire une archive vers un chemin absolu ou relatif peut causer des dommages sur votre appareil en écrasant des fichiers système.\n\nVoulez-vous continuer\u00A0? Note de version @@ -624,9 +643,9 @@ Bienvenue - Bienvenue dans l\'explorateur de fichier CyanogenMod. - \n\nCette application vous permet d\'explorer le système de fichiers et effectuer des opérations qui pourraient endommager votre appareil. Pour éviter tout dommage, l\'application va démarrer dans un mode sécurisé. - \n\nVous pouvez avoir un accés complet, en mode Root via le menu paramètre. Il est de votre responsabilité de veiller à ce que les opérations effectués n\'endommagent pas votre système. - \n\nLa Team CyanogenMod.\n + Bienvenue dans l\'Explorateur de fichiers CyanogenMod. + \n\nCette application vous permet d\'explorer le système de fichiers et d\'effectuer des opérations qui pourraient endommager votre appareil. Pour éviter tout dommage, l\'application va démarrer dans un mode sécurisé. + \n\nVous pouvez avoir un accés complet, en mode Root via les paramètres de l\'application. Il est de votre responsabilité de veiller à ce que les opérations effectuées n\'endommagent pas votre système. + \n\nL\'Équipe CyanogenMod\n diff --git a/themes/res/values-fr/strings.xml b/themes/res/values-fr/strings.xml new file mode 100644 index 000000000..b28dbe631 --- /dev/null +++ b/themes/res/values-fr/strings.xml @@ -0,0 +1,32 @@ + + + + + + + Thèmes de l\'Explorateur de fichier + + Thèmes pour l\'Explorateur de fichier CyanogenMod + + + CyanogenMod + + + Thème Sombre + + Un thème sombre pour l\'Explorateur de fichier CyanogenMod. + + From 8e5fabfb19c43689d776be3abbf2d0f114fa9ab0 Mon Sep 17 00:00:00 2001 From: Jorge Ruesga Date: Sun, 18 Nov 2012 03:41:18 +0100 Subject: [PATCH 10/11] CMFileManager: fr_FR - Remove unnecessary translatable tag See comment on http://review.cyanogenmod.org/#/c/26417/8 Change-Id: I493dd23bc6987aa23d4c2758cc68733e27696fba --- themes/res/values-fr/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/res/values-fr/strings.xml b/themes/res/values-fr/strings.xml index b28dbe631..69b6fcffe 100644 --- a/themes/res/values-fr/strings.xml +++ b/themes/res/values-fr/strings.xml @@ -22,7 +22,7 @@ Thèmes pour l\'Explorateur de fichier CyanogenMod - CyanogenMod + CyanogenMod Thème Sombre From 6bf70025107ad61f7cdfca911e4e6361f55a1331 Mon Sep 17 00:00:00 2001 From: Jorge Ruesga Date: Sun, 18 Nov 2012 04:35:48 +0100 Subject: [PATCH 11/11] CMFileManager: fr_FR - Remove unnecessary translatable string See comment on http://review.cyanogenmod.org/#/c/26616/ Change-Id: I71eafaad82c41bed56166518490f4dcd4d4d20a9 --- themes/res/values-fr/strings.xml | 3 --- 1 file changed, 3 deletions(-) diff --git a/themes/res/values-fr/strings.xml b/themes/res/values-fr/strings.xml index 69b6fcffe..6c665640f 100644 --- a/themes/res/values-fr/strings.xml +++ b/themes/res/values-fr/strings.xml @@ -21,9 +21,6 @@ Thèmes pour l\'Explorateur de fichier CyanogenMod - - CyanogenMod - Thème Sombre