From 3f9d8e09c3efb358a5f2987e16f48fc5cc1b9686 Mon Sep 17 00:00:00 2001 From: xLaMbChOpSx Date: Mon, 30 Jun 2014 18:42:06 +1000 Subject: [PATCH] Shell & AT Command Fragment Tweaks Small tweaks to the shell system and AT Command fragment. --- .../com/SecUpwN/AIMSICD/fragments/AtCommandFragment.java | 4 ++-- app/src/main/java/com/SecUpwN/AIMSICD/utils/Shell.java | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/SecUpwN/AIMSICD/fragments/AtCommandFragment.java b/app/src/main/java/com/SecUpwN/AIMSICD/fragments/AtCommandFragment.java index 9b96df930..b60840632 100644 --- a/app/src/main/java/com/SecUpwN/AIMSICD/fragments/AtCommandFragment.java +++ b/app/src/main/java/com/SecUpwN/AIMSICD/fragments/AtCommandFragment.java @@ -162,10 +162,10 @@ public void onClick(View v) { if (mAtCommand.getText() != null) { String command = mAtCommand.getText().toString(); if (command.indexOf("AT") == 0 || command.indexOf("at") == 0) { - Log.i("AIMSICD", "AT Command Detected"); + mShell = new Shell(mSerialDevice); new MyAsync().execute(EXECUTE_AT); } else { - Log.i("AIMSICD", "Terminal Command Detected"); + mShell = new Shell(); new MyAsync().execute(EXECUTE_COMMAND); } } diff --git a/app/src/main/java/com/SecUpwN/AIMSICD/utils/Shell.java b/app/src/main/java/com/SecUpwN/AIMSICD/utils/Shell.java index 04cf8adfb..e6e8c2a90 100644 --- a/app/src/main/java/com/SecUpwN/AIMSICD/utils/Shell.java +++ b/app/src/main/java/com/SecUpwN/AIMSICD/utils/Shell.java @@ -23,6 +23,11 @@ public Shell() { openRootShell(true); } + public Shell(String serialDevice) { + openRootShell(true); + setSerialDevice(serialDevice); + } + public List GetStdOut() { if (mShellStdOut == null) { return null;