jackpal/Android-Terminal-Emulator — pull request #103 by steven676 (2012-05-01 03:25:45+00:00)
Title: Miscellaneous bugfixes and PATH/shell verification improvements

Patch 1 fixes a corner case where the window title displayed in the action bar didn't change after a new window was created from the WindowList activity.

Patch 2 logs shell verification errors to the system log, as you suggested. (Combined with #99, should make debugging shell problems much easier.)

Patches 3, 4, and 5 add a compatibility wrapper for File.canExecute(), introduced in Java 1.6 and made available in Android API level 9. The method basically reduces to access(filename, X_OK), so we also add a native code implementation for use on API 8 and below. To facilitate adding native code methods to more than one class, patch 3 refactors the JNI code to separate JNI initialization from the code defining the methods.

Patch 6 adds a check to make sure the user's shell has the execute bit set. I wanted this in the original version of the shell verification patch, but couldn't use canExecute() at the time.

Patch 7 implements an idea I had in the comments in #81 for preventing the misleading "Permission denied" errors which appear when users try to run nonexistent commands: check the PATH and remove directories for which we don't have execute permission (meaning we can't access them to run commands inside whose names we know). This should be a major usability improvement for most users, but just in case anyone runs as root all the time (bad idea, I know) and really needs /sbin/adbd in their default PATH, there's a preference to turn this off.

Patch 8 is the native code portion of steven676/Android-Terminal-Emulator@6cd2dc8 -- it strictly belongs with that commit, but I'm putting it here to try to avoid bumping the shared library ABI twice.

Patch 9 bumps the shared library ABI to avoid problems with custom ROMs with ATE preinstalled.