aboutsummaryrefslogtreecommitdiff
path: root/src/com/cyanogenmod/filemanager/console/shell/ShellConsole.java
Commit message (Collapse)AuthorAgeFilesLines
* Flush the shell console after each commandIgor Kalkov2016-06-011-0/+2
| | | | | | | | | | | This patch fixes the file manager on android-n-preview-2 (and maybe other roms/systems). Observed behavior: no output is produced at StdIn or StdErr after writing commands to the shell console. This leads to a timeout and a reallocation of the console in an endless loop. Flushing the output stream fixes the problem. Not sure if there was a good reason for not doing it in general. Change-Id: Ia87aa5065f6c62f133de4bbde4b4a32a4388d784
* Shell console: fix bug in shell output streamRoman Birg2015-06-231-1/+1
| | | | | | | | | | The command is finished and the partial result may also have the command exit code. When the partial stream does have the exit code, we were writing *only* the contents of the exit code, but we need to write everything *until* the exit code, keeping the contents intact. Change-Id: I5e7af1125270c394f42fe7661cbefdd98c6a6052 Signed-off-by: Roman Birg <roman@cyngn.com>
* Fix parsing of shell command output regardless of encodingRoman Birg2015-06-221-34/+136
| | | | | | | | | | | We always know the start and end control patterns will be in UTF-8. However, the content in between could be encoded differently. Search for the patterns in the shell command output using raw bytes, instead of a string pattern match. Change-Id: I6cb019b644d371c37593fe26784f6e9d41844dec Signed-off-by: Roman Birg <roman@cyngn.com>
* Implement ability to cancel file copy.Martin Brabham2015-04-131-2/+7
| | | | | | | | | | - Short circuit Java CopyCommand for move/copy when the user cancels the dialog. - Bubble up CancelledOperationException when the Cancel/Move operation is cancelled. Handle cancellation differently than success. Change-Id: I3e4426aaccf42e12bf299041d489e72b3b76a626 (cherry picked from commit 7e13ec2fa4fc052c2a880a8dba8ed871b3bc10ca)
* Detect text encoding with juniversalchardet.Matt Garnes2015-04-101-45/+63
| | | | | | | | | | - When opening files in the built in editor for display, detect the encoding with juniversalchardet, so that the correct encoding will be used. - Use byte buffers to back ShellConsole instead of StringBuffers Change-Id: I85fa567ef589a82f1c8604f1f215647376c31c9a (cherry picked from commit 55c55835d3bd685dde542b4f5952ce401542ab84)
* cmfm: secure storage and other improvementsJorge Ruesga2014-11-101-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for virtual filesystems and implements a SecureStorage filesystem (a password protected area) mounted in /storage or /sdcard/storage (in chrooted environments). Also includes a better print support and a cleanup of the code and design of the menu drawer. Bump version to 2.0.0 Required: https://github.com/jruesga/android_external_libtruezip located in external/libtruezip Patchset 4: Fix selection of unmounted virtual storages. Fix actions on virtual mount points folders. Fix strings and typos. Change drop for delete secure storage. Patchset 5: Move actionbar buttons to navigation drawer Remove history position Patchset 6: Update theme preview images Fix filesystem status image on theme change Patchset 7: Fix binary file detection in editor (including unicode files) Patchset 8: Fix unsafe operations in virtual mountpoint logic Patchset 9: Rebase Change-Id: I65511352ca649dcbf238c8b07cf8c22465296e8e Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
* Mount emulated storage in root mode.Danny Baumann2013-10-081-3/+5
| | | | | | | | Make sure to tell su to mount the emulated storage. As this means that the su shell lives in its own mount namespace, perform remount operations on both the foreground and the background console. Change-Id: I9372eefa1df91d1ecd3c89a25a391b977d77da45
* CMFM: CYAN-533 - Increase timeout in File ManagerJorge Ruesga2013-03-101-53/+112
| | | | | | | | | | | Fixed timeout problems with list, copy, move and delete commands. Check new data for list commands; use indefinitely wait for copy, move and delete commands. Tested with 5000 and 30000 files. Change-Id: I33cd6c9b7422966cdc4bc0c9cb265f74533ef161 JIRA: https://jira.cyanogenmod.org/browse/CYAN-533 Bugfix: CYAN-533 Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
* CMFM: Wait indefinitely on privileged console allocationJorge Ruesga2013-01-131-83/+120
| | | | | | | | | | Wait indefinitely if a privileged console is being allocated. Wait for the user response to SuperUser or SuperSu prompt (or whatever it is). Change ShellConsole.this access to a private variable in methods of ShellConsole Change-Id: I6752fe8bcd0de3aa6478ad97fb84c9ac8697a970 Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
* CMFM: Do not use cd and pwd commandsJorge Ruesga2013-01-091-29/+2
| | | | | | | | Remove cd and pwd commands and use / as working directory for shell process (this commands are not used). This prevents that storage volumes from get busy on unmount file systems. Signed-off-by: jruesga <jorge@ruesga.com> Change-Id: I772866c00233351f505b61f53d43bac5de02a5e4
* CMFM: Fix AsyncResultProgram deadlockJorge Ruesga2013-01-071-16/+20
| | | | | Change-Id: Idd32ef7902eaf86e573728f7e442c281a47249fc Signed-off-by: jruesga <jorge@ruesga.com>
* CMFM: Fixes and ImprovementsJorge Ruesga2013-01-051-31/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Some performance improvements: - Use stat instead of ls. This allow improve listing of directories with symlinks. Symlinks are resolved by File.getCanonicalFile. - Simplify ls, fileinfo, find and readlink command - Simplify the parsing of FolderUsage (only type, size and category is required), and avoid to load a lot of on unused objects - Add new file datetime information from stat: access, change and modify - Improve list, find and resolvelink java commands * FadeEffect and symlink handling * Remove context from AIDHelper and add new helpful methods * New getAbsolutePath method * Use file separator for paths and ROOT_DIRECTORY for root directory path * Organize startup - Initialize variables prior to register receivers - Load AID data for improve performance through caching - Load the theme base used by AOSP widgets * Allow Editor to show zero-length files Allow the editor to load zero-length files (like /proc/mounts) and change the buffer type to no editable in binary files. * Invert allowed mount points detection. This change inverts the algorithm for prevent unmount needed rw filesystems. Now uses known restricted filesystems instead of known allowed filesystems. Now filesystems like yaffs2, fuse, and other linux filesystems are allowed by default. * Remove unused xliff namespace * Add flagNoFullscreen to EditText widgets * Fix listview selectors of history and bookmarks * Fix race condition When the command was executed prior to block the execution, the thread wait for the timeout. Add a sync access check to ensure that prior to lock and wait the program executed is not finished. * Fix for async programs When the partial buffer received for an async program is not complete (ends with a EOL), the partial buffer was discarded. Add a new buffer with this lost chars to complete this bytes next time * Fix list command Use -n1 for xargs in list command to prevent "argument line too long" * If parent is null then assume that it is the root folder * Use only name and parent for equals method on FileSystemObject A FileSystemObject is the same if his name and path are the same. * Increase performance of adapters Use argument data when possible to avoid call the adapter methods * Do not clear selection on some actions Actions like create new file/folder, show properties and other actions that explicit requires clear the active selection, shouldn't removed the active selection. * Add a new additional line to dialog messages to fill the dialog * Fix spanish translations * Fix theme roulette on tablets * Clean NLS and Override warnings * Fix parse size data with dots * Add listeners after set the values to avoid raising triggers * Increase performance of adapters. Notify the data changed at the end of the changes, and only to super adapters (the internal structure has already been updated) * Ensure that all the Cursor references were closed after used them. * Remove unused SuppressLint * Clean up Change-Id: I4326e97cbc942c767829f1a0ff6b380ad768cfef Signed-off-by: jruesga <jorge@ruesga.com>
* CMFileManager: Make groups command optionalJorge Ruesga2012-12-211-6/+14
| | | | | | | | | Groups command command is causing problems on some implementations (maybe toolbox?) which don't recognize the root AID and returns an error, and avoid to get root access. Patchset 2: Fix typo Change-Id: Idc17b18c34b8be263a1739dbad2921f60101fa09
* CMFileManager: Themes support + Dark themeJorge Ruesga2012-11-111-6/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change enabled the theme support, and added a new dark theme under the package CMFileManagerThemes. To compile under build system, it must be enabled in vendor/cm/config/common.mk or vendor/cm/config/themes_common.mk (this was requested in change http://review.cyanogenmod.org/#/c/26311/) Themes were enabled in a new settings option. Under this setting the application show the user the available themes installed in the system. -------------------- For build new themes, developers should: - Create a new package that contains an activity with: * Permission: com.cyanogenmod.filemanager.permissions.READ_THEME * Action: com.cyanogenmod.filemanager.actions.MAIN_THEME * Category: com.cyanogenmod.filemanager.categories.THEME - Define the themes_ids, themes_names and themes_descriptions arrays-strings definitions for the themes that the package support. - Create a xxx_theme.xml for every theme that the package support, where the xxx is the id of the theme. Put your resources in this file, prefixing the resource with the id of the theme (xxx_). For a list of all supported resources see theme.xml in res/values of CMFileManager project. ------------------- Other fixes: * Protect console buffers from NPE * Fix code style of xmls (layouts, drawables, ...) Patchset 2: Fixed code style and added Christian suggestion Patchset 3: Added forgotten READ_THEME permission check as described in the note above. Patchset 4: Use centerInside in theme preview for better image fit Change-Id: I4142da6d9ed1b06318e47ff9c05f9a874c62f3ae
* CMFileManager: Fix mv operation on Cross-device link failureJorge Ruesga2012-11-051-3/+7
| | | | | | | | | | | | | | Issue https://github.com/jruesga/CMFileManager/issues/31. The busybox mv command returns a failure when files are moved between filesystem (Cross-device link failure). This changes fix this failure by: * Replace mv command for a "mv or cp+rm" operation. * rm operation occurs over source mount point so this need to be mounted prior to execute this new command. * Fix the stderr buffer filling on error. Change-Id: If113ad810e7daffeb8379589789b2855eda14908
* CMFileManager : Fix duplicate debugging outputJorge Ruesga2012-11-041-5/+4
| | | | | | Fix duplicate debugging output for synchronous command. Change-Id: I83ffe804a789a38a429681360bba9786c36f9cc6
* Change application name to 'File Manager' (issue #20)jruesga2012-10-261-0/+1233
Full refactoring of package from explorer to filemanager