Make kill() public
Prevent kill() from throwing an exception if already killed
Extra check before WATCHDOG EXIT, race could cause this to occur

Added another check for watchdogTimeout being 0, as the watchdog
callback could occur due to a race condition when this was actually
0, and cause the shell to be killed
Fixed high eight bits of every character being discarded by writeBytes(), it was breaking commands containing non-English characters
Merge pull request #7 from ZhDev/master

Fixed high eight bits of every character being discarded by writeBytes()...
Create new postCallback() helper method

This just eliminates some repetition.  No change to functionality.
Missing callbacks if shell dies in Interactive mode

libsuperuser is currently able to handle failures in several different
stages:

1) If the shell cannot be started at all (e.g. missing "su" binary),
Runtime.exec() should throw an exception, causing our open() method to
return failure.

2) If the shell dies while a command is executing, and the watchdog timer
is enabled, the onCommandResult() callback will get invoked so that the
caller can handle the error.

3) If the device operator denies a Superuser request, this typically
falls under case #2 as the "su" executable will stay alive for a couple
of seconds until the operator clicks "deny."

But if the shell dies when there is no active command, any queued commands
will get stuck in limbo and the caller will never receive a status
indication.  This will probably cause the app to freeze until the
operator kills it, resulting in a subpar user experience.

The easiest way to reproduce the problem is to try running
libsuperuser_example in interactive mode on the SDK emulator (which has
a trivial "su" implementation that instantly denies root access to all
apps).  It will hang at "Requesting root privilege" forever.

So, we'll add an extra loop to send the bad news to the calling app if
libsuperuser isn't able to execute the requested commands.
Run dos2unix on *.java

Currently these source files have a mix of CRLF and LF (even inside the
same file), which causes problems with patching/merging.  Pick one format
for consistency's sake.
Merge pull request #8 from cernekee/missing-callbacks-v1

Looks good to me
Eclipse stuff
More intelligent detection if the running shell is "su"
Move su shell detection from Shell to Shell.SU
Fix another instance of shell == su detection
Add utility function create shell command from uid and SELinux context

The shell command is normally just "sh" or "su", but sometimes you need
to switch to a specific uid or SELinux context. The Shell.SU.shell(...)
method will construct a string in this format: "su[ --context
<context>][ <uid>]". 

Currently only SuperSU v1.90 supports the context parameter, so the code
auto-detects if that is the su binary currently being used. Update the
command format for other su binaries if/when that feature becomes
available. 

To reduce the chance of issues, the uid is only passed if not 0 (root,
this is the default case), and the SELinux context is only passed if
SELinux is detected to be in enforcing mode (otherwise it may be useful
for development/logging purposes only, but not end-user)
Change version checking behavior to prevent stall

In some cases, calling "su -[v|V]" could result in a broken pipe,
preventing the containing shell from receiving the exit command and
terminating, resulting in an infinite wait. Instead of calling su from
sh now, we directly call su, and work-around the entire problem.
Whitespace: tabs to spaces, as per Android guidelines