Bug 1255527 - Remove sutagent/watcher; r=jmaher
authorGeoff Brown <gbrown@mozilla.com>
Tue, 15 Mar 2016 08:21:30 -0600
changeset 312555 97f8dcf6582ce95698ad38ea94326831d5552b64
parent 312554 2763d1d24a4ed9258298c2c7ae3903706868b21d
child 312556 6b3093fbaa8a968c3f51989890aeac9ed9e031b7
push id9480
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 17:12:58 +0000
treeherdermozilla-aurora@0d6a91c76a9e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmaher
bugs1255527
milestone48.0a1
Bug 1255527 - Remove sutagent/watcher; r=jmaher
build/mobile/sutagent/android/ASMozStub.java
build/mobile/sutagent/android/AlertLooperThread.java
build/mobile/sutagent/android/AndroidManifest.xml
build/mobile/sutagent/android/CmdWorkerThread.java
build/mobile/sutagent/android/DataWorkerThread.java
build/mobile/sutagent/android/DoAlert.java
build/mobile/sutagent/android/DoCommand.java
build/mobile/sutagent/android/FindProcThread.java
build/mobile/sutagent/android/Makefile.in
build/mobile/sutagent/android/Power.java
build/mobile/sutagent/android/RedirOutputThread.java
build/mobile/sutagent/android/RunCmdThread.java
build/mobile/sutagent/android/RunDataThread.java
build/mobile/sutagent/android/SUTAgentAndroid.java
build/mobile/sutagent/android/WifiConfiguration.java
build/mobile/sutagent/android/default.properties
build/mobile/sutagent/android/fencp/AndroidManifest.xml
build/mobile/sutagent/android/fencp/DirCursor.java
build/mobile/sutagent/android/fencp/FenCP.java
build/mobile/sutagent/android/fencp/FenCPFP.java
build/mobile/sutagent/android/fencp/FileCursor.java
build/mobile/sutagent/android/fencp/Makefile.in
build/mobile/sutagent/android/fencp/default.properties
build/mobile/sutagent/android/fencp/moz.build
build/mobile/sutagent/android/fencp/res/drawable-hdpi/icon.png
build/mobile/sutagent/android/fencp/res/drawable-ldpi/icon.png
build/mobile/sutagent/android/fencp/res/drawable-mdpi/icon.png
build/mobile/sutagent/android/fencp/res/layout/main.xml
build/mobile/sutagent/android/fencp/res/values/strings.xml
build/mobile/sutagent/android/ffxcp/AndroidManifest.xml
build/mobile/sutagent/android/ffxcp/DirCursor.java
build/mobile/sutagent/android/ffxcp/FfxCPFP.java
build/mobile/sutagent/android/ffxcp/FileCursor.java
build/mobile/sutagent/android/ffxcp/Makefile.in
build/mobile/sutagent/android/ffxcp/default.properties
build/mobile/sutagent/android/ffxcp/ffxcp.java
build/mobile/sutagent/android/ffxcp/moz.build
build/mobile/sutagent/android/ffxcp/res/drawable-hdpi/icon.png
build/mobile/sutagent/android/ffxcp/res/drawable-ldpi/icon.png
build/mobile/sutagent/android/ffxcp/res/drawable-mdpi/icon.png
build/mobile/sutagent/android/ffxcp/res/layout/main.xml
build/mobile/sutagent/android/ffxcp/res/values/strings.xml
build/mobile/sutagent/android/moz.build
build/mobile/sutagent/android/network-libs/commons-net-2.0-javadoc.jar
build/mobile/sutagent/android/network-libs/commons-net-2.0-sources.jar
build/mobile/sutagent/android/network-libs/commons-net-2.0.jar
build/mobile/sutagent/android/network-libs/commons-net-ftp-2.0.jar
build/mobile/sutagent/android/network-libs/jmdns.jar
build/mobile/sutagent/android/res/drawable/ateamlogo.png
build/mobile/sutagent/android/res/drawable/ic_stat_first.png
build/mobile/sutagent/android/res/drawable/ic_stat_neterror.png
build/mobile/sutagent/android/res/drawable/ic_stat_second.png
build/mobile/sutagent/android/res/drawable/ic_stat_warning.png
build/mobile/sutagent/android/res/drawable/icon.png
build/mobile/sutagent/android/res/layout/main.xml
build/mobile/sutagent/android/res/values/strings.xml
build/mobile/sutagent/android/watcher/AndroidManifest.xml
build/mobile/sutagent/android/watcher/IWatcherService.java
build/mobile/sutagent/android/watcher/Makefile.in
build/mobile/sutagent/android/watcher/RedirOutputThread.java
build/mobile/sutagent/android/watcher/WatcherMain.java
build/mobile/sutagent/android/watcher/WatcherReceiver.java
build/mobile/sutagent/android/watcher/WatcherService.java
build/mobile/sutagent/android/watcher/default.properties
build/mobile/sutagent/android/watcher/moz.build
build/mobile/sutagent/android/watcher/res/drawable-hdpi/ateamlogo.png
build/mobile/sutagent/android/watcher/res/drawable-hdpi/icon.png
build/mobile/sutagent/android/watcher/res/drawable-ldpi/ateamlogo.png
build/mobile/sutagent/android/watcher/res/drawable-ldpi/icon.png
build/mobile/sutagent/android/watcher/res/drawable-mdpi/ateamlogo.png
build/mobile/sutagent/android/watcher/res/drawable-mdpi/icon.png
build/mobile/sutagent/android/watcher/res/layout/main.xml
build/mobile/sutagent/android/watcher/res/values/strings.xml
build/moz.build
testing/testsuite-targets.mk
deleted file mode 100755
--- a/build/mobile/sutagent/android/ASMozStub.java
+++ /dev/null
@@ -1,327 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-package com.mozilla.SUTAgentAndroid.service;
-
-import java.io.File;
-import java.io.IOException;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.net.InetAddress;
-import java.net.ServerSocket;
-import java.util.Timer;
-
-import com.mozilla.SUTAgentAndroid.SUTAgentAndroid;
-import com.mozilla.SUTAgentAndroid.R;
-
-import android.app.Notification;
-import android.app.NotificationManager;
-import android.content.Context;
-import android.content.Intent;
-import android.net.wifi.WifiManager;
-import android.os.Handler;
-import android.os.IBinder;
-import android.util.Log;
-import android.view.Gravity;
-import android.widget.Toast;
-
-import javax.jmdns.JmDNS;
-import javax.jmdns.ServiceInfo;
-
-public class ASMozStub extends android.app.Service {
-    private final static int COMMAND_PORT = 20701;
-    private final static int DATA_PORT = 20700;
-
-    private ServerSocket cmdChnl = null;
-    private ServerSocket dataChnl = null;
-    private Handler handler = new Handler();
-    RunCmdThread runCmdThrd = null;
-    RunDataThread runDataThrd = null;
-    Thread monitor = null;
-    Timer timer = null;
-    boolean doZeroConfig = false;
-
-    @SuppressWarnings("unchecked")
-    private static final Class<?>[] mSetForegroundSignature = new Class[] {
-    boolean.class};
-    @SuppressWarnings("unchecked")
-    private static final Class<?>[] mStartForegroundSignature = new Class[] {
-        int.class, Notification.class};
-    @SuppressWarnings("unchecked")
-    private static final Class<?>[] mStopForegroundSignature = new Class[] {
-        boolean.class};
-
-    private NotificationManager mNM;
-    private Method mSetForeground;
-    private Method mStartForeground;
-    private Method mStopForeground;
-    private Object[] mSetForegroundArgs = new Object[1];
-    private Object[] mStartForegroundArgs = new Object[2];
-    private Object[] mStopForegroundArgs = new Object[1];
-
-    @Override
-    public IBinder onBind(Intent intent)
-        {
-        return null;
-        }
-
-    @Override
-    public void onCreate() {
-        super.onCreate();
-
-        mNM = (NotificationManager)getSystemService(NOTIFICATION_SERVICE);
-        try {
-            mStartForeground = getClass().getMethod("startForeground", mStartForegroundSignature);
-            mStopForeground = getClass().getMethod("stopForeground", mStopForegroundSignature);
-            }
-        catch (NoSuchMethodException e) {
-            // Might be running on an older platform.
-            mStartForeground = mStopForeground = null;
-            Log.w("SUTAgent", "unable to find start/stopForeground method(s) -- older platform?");
-            }
-
-        try {
-            mSetForeground = getClass().getMethod("setForeground", mSetForegroundSignature);
-            }
-        catch (NoSuchMethodException e) {
-            mSetForeground = null;
-            Log.e("SUTAgent", "unable to find setForeground method!");
-            }
-
-        doToast("Listener Service created...");
-        }
-
-    WifiManager.MulticastLock multicastLock;
-    JmDNS jmdns;
-
-    void startZeroConf() {
-        if (multicastLock == null) {
-            WifiManager wifi = (WifiManager) getSystemService(Context.WIFI_SERVICE);
-            multicastLock = wifi.createMulticastLock("SUTAgent");
-            multicastLock.setReferenceCounted(true);
-        }
-
-        multicastLock.acquire();
-
-        try {
-            InetAddress inetAddress = SUTAgentAndroid.getLocalInetAddress();
-
-            if (jmdns == null) {
-                jmdns = JmDNS.create(inetAddress, null);
-            }
-
-            if (jmdns != null) {
-                String name = "SUTAgent";
-
-                String hwid = SUTAgentAndroid.getHWID(this);
-                if (hwid != null) {
-                    name += " [hwid:" + hwid + "]";
-                }
-
-                // multicast reception is broken for some reason, so
-                // this service can't be resolved; it can only be
-                // broadcast.  So, we cheat -- we put the IP address
-                // in the broadcast that we can pull out later.
-                // However, periods aren't legal, so replace them.
-                // The IP address will show up as [ip:127_0_0_1]
-                name += " [ip:" + inetAddress.getHostAddress().toString().replace('.', '_') + "]";
-
-                final ServiceInfo serviceInfo = ServiceInfo.create("_sutagent._tcp.local.",
-                                                                   name,
-                                                                   COMMAND_PORT,
-                                                                   "Android SUTAgent");
-                final JmDNS dns = jmdns;
-                // we want to call registerService on a new thread, because it can block
-                // for a little while.
-                Thread registerThread = new Thread() {
-                        public void run() {
-                            try {
-                                dns.registerService(serviceInfo);
-                            } catch (IOException e) {
-                                Log.e("SUTAgent", "Failed to register JmDNS service!", e);
-                            }
-                        }
-                    };
-                registerThread.setDaemon(true);
-                registerThread.start();
-            }
-        } catch (IOException e) {
-            Log.e("SUTAgent", "Failed to register JmDNS service!", e);
-        }
-    }
-
-    void stopZeroConf() {
-        if (jmdns != null) {
-            try {
-                jmdns.unregisterAllServices();
-                jmdns.close();
-            } catch (IOException e) {
-                Log.e("SUTAgent", "Failed to close JmDNS service!", e);
-            }
-            jmdns = null;
-        }
-
-        if (multicastLock != null) {
-            multicastLock.release();
-            multicastLock = null;
-        }
-    }
-
-    public void onStart(Intent intent, int startId) {
-        super.onStart(intent, startId);
-
-        try {
-            cmdChnl = new ServerSocket(COMMAND_PORT);
-            runCmdThrd = new RunCmdThread(cmdChnl, this, handler);
-            runCmdThrd.start();
-            doToast(String.format("Command channel port %d ...", COMMAND_PORT));
-
-            dataChnl = new ServerSocket(DATA_PORT);
-            runDataThrd = new RunDataThread(dataChnl, this);
-            runDataThrd.start();
-            doToast(String.format("Data channel port %d ...", DATA_PORT));
-
-            DoCommand tmpdc = new DoCommand(getApplication());
-            File dir = getFilesDir();
-            File iniFile = new File(dir, "SUTAgent.ini");
-            String sIniFile = iniFile.getAbsolutePath();
-            String zeroconf = tmpdc.GetIniData("General", "ZeroConfig", sIniFile);
-            if (zeroconf != "" && Integer.parseInt(zeroconf) == 1) {
-                this.doZeroConfig = true;
-            }
-
-            if (this.doZeroConfig) {
-                startZeroConf();
-            }
-
-            Notification notification = new Notification();
-            startForegroundCompat(R.string.foreground_service_started, notification);
-            }
-        catch (Exception e) {
-            doToast(e.toString());
-            }
-
-        return;
-        }
-
-    public void onDestroy()
-        {
-        super.onDestroy();
-
-        if (this.doZeroConfig) {
-            stopZeroConf();
-        }
-
-        if (runCmdThrd.isAlive())
-            {
-            runCmdThrd.StopListening();
-            }
-
-        if (runDataThrd.isAlive())
-            {
-            runDataThrd.StopListening();
-            }
-
-        NotificationManager notificationManager = (NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);
-        notificationManager.cancel(1959);
-
-        stopForegroundCompat(R.string.foreground_service_started);
-
-        doToast("Listener Service destroyed...");
-
-        System.exit(0);
-        }
-
-    public void SendToDataChannel(String strToSend)
-        {
-        if (runDataThrd.isAlive())
-            runDataThrd.SendToDataChannel(strToSend);
-        }
-
-    public void doToast(String sMsg) {
-        Toast toast = Toast.makeText(this, sMsg, Toast.LENGTH_LONG);
-        toast.setGravity(Gravity.TOP|Gravity.CENTER_HORIZONTAL, 0, 100);
-        toast.show();
-    }
-
-    /**
-     * This is a wrapper around the new startForeground method, using the older
-     * APIs if it is not available.
-     */
-    void startForegroundCompat(int id, Notification notification) {
-        // If we have the new startForeground API, then use it.
-        if (mStartForeground != null) {
-            mStartForegroundArgs[0] = Integer.valueOf(id);
-            mStartForegroundArgs[1] = notification;
-            try {
-                mStartForeground.invoke(this, mStartForegroundArgs);
-            } catch (InvocationTargetException e) {
-                // Should not happen.
-                Log.e("SUTAgent", "Unable to invoke startForeground", e);
-            } catch (IllegalAccessException e) {
-                // Should not happen.
-                Log.e("SUTAgent", "Unable to invoke startForeground", e);
-            }
-            return;
-        }
-
-        // Fall back on the old API.
-        if  (mSetForeground != null) {
-            try {
-                mSetForegroundArgs[0] = Boolean.TRUE;
-                mSetForeground.invoke(this, mSetForegroundArgs);
-            } catch (IllegalArgumentException e) {
-                Log.e("SUTAgent", "Unable to invoke setForeground", e);
-                e.printStackTrace();
-            } catch (IllegalAccessException e) {
-                Log.e("SUTAgent", "Unable to invoke setForeground", e);
-                e.printStackTrace();
-            } catch (InvocationTargetException e) {
-                Log.e("SUTAgent", "Unable to invoke setForeground", e);
-                e.printStackTrace();
-            }
-        }
-        mNM.notify(id, notification);
-    }
-
-    /**
-     * This is a wrapper around the new stopForeground method, using the older
-     * APIs if it is not available.
-     */
-    void stopForegroundCompat(int id) {
-        // If we have the new stopForeground API, then use it.
-        if (mStopForeground != null) {
-            mStopForegroundArgs[0] = Boolean.TRUE;
-            try {
-                mStopForeground.invoke(this, mStopForegroundArgs);
-            } catch (InvocationTargetException e) {
-                // Should not happen.
-                Log.e("SUTAgent", "Unable to invoke stopForeground", e);
-            } catch (IllegalAccessException e) {
-                // Should not happen.
-                Log.e("SUTAgent", "Unable to invoke stopForeground", e);
-            }
-            return;
-        }
-
-        // Fall back on the old API.  Note to cancel BEFORE changing the
-        // foreground state, since we could be killed at that point.
-        mNM.cancel(id);
-        if  (mSetForeground != null) {
-            try {
-                mSetForegroundArgs[0] = Boolean.FALSE;
-                mSetForeground.invoke(this, mSetForegroundArgs);
-            } catch (IllegalArgumentException e) {
-                Log.e("SUTAgent", "Unable to invoke setForeground", e);
-                e.printStackTrace();
-            } catch (IllegalAccessException e) {
-                Log.e("SUTAgent", "Unable to invoke setForeground", e);
-                e.printStackTrace();
-            } catch (InvocationTargetException e) {
-                Log.e("SUTAgent", "Unable to invoke setForeground", e);
-                e.printStackTrace();
-            }
-        }
-    }
-}
deleted file mode 100755
--- a/build/mobile/sutagent/android/AlertLooperThread.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-package com.mozilla.SUTAgentAndroid.service;
-
-import java.util.Timer;
-
-import android.content.ContextWrapper;
-import android.os.Handler;
-import android.os.Looper;
-import android.os.Message;
-
-class AlertLooperThread extends Thread
-    {
-    public Handler mHandler;
-    private Looper looper = null;
-    private DoAlert da    = null;
-    private Timer alertTimer = null;
-    private ContextWrapper contextWrapper = null;
-
-    AlertLooperThread(ContextWrapper ctxW)
-        {
-        this.contextWrapper = ctxW;
-        }
-
-    public Timer getAlertTimer()
-        {
-        return alertTimer;
-        }
-
-    public void term()
-        {
-        if (da != null)
-            da.term();
-        }
-
-    public void quit()
-        {
-        if (looper != null)
-            looper.quit();
-        }
-
-    public void run()
-        {
-        Looper.prepare();
-
-        looper = Looper.myLooper();
-
-        mHandler = new Handler()
-            {
-            public void handleMessage(Message msg)
-                {
-                // process incoming messages here
-                }
-            };
-
-        alertTimer = new Timer();
-        da = new DoAlert(contextWrapper);
-        alertTimer.scheduleAtFixedRate(da, 0, 5000);
-        Looper.loop();
-        }
-    }
deleted file mode 100644
--- a/build/mobile/sutagent/android/AndroidManifest.xml
+++ /dev/null
@@ -1,57 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
-   - License, v. 2.0. If a copy of the MPL was not distributed with this
-   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-      package="com.mozilla.SUTAgentAndroid"
-      android:versionCode="1" android:versionName="1.01">
-    <application android:icon="@drawable/icon" android:label="@string/app_name" android:debuggable="true">
-        <activity android:name=".SUTAgentAndroid"
-                  android:screenOrientation="nosensor"
-                  android:label="@string/app_name">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-        <service android:name=".service.ASMozStub">
-		    <intent-filter>
-			    <action android:name="com.mozilla.SUTAgentAndroid.service.LISTENER_SERVICE" />
-		    </intent-filter>
-	    </service>
-	</application>
-    
-    <uses-sdk android:minSdkVersion="5" android:targetSdkVersion="8"/>
-
-<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"></uses-permission>
-<uses-permission android:name="android.permission.INTERNET"></uses-permission>
-<uses-permission android:name="android.permission.REBOOT"></uses-permission>
-<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"></uses-permission>
-<uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE"></uses-permission>
-<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"></uses-permission>
-<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses-permission>
-<uses-permission android:name="android.permission.RESTART_PACKAGES"></uses-permission>
-<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"></uses-permission>
-<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE"></uses-permission>
-<uses-permission android:name="android.permission.CHANGE_CONFIGURATION"></uses-permission>
-<uses-permission android:name="android.permission.READ_PHONE_STATE"></uses-permission>
-<uses-permission android:name="android.permission.BATTERY_STATS"></uses-permission>
-<uses-permission android:name="android.permission.DEVICE_POWER"></uses-permission>
-<uses-permission android:name="android.permission.DISABLE_KEYGUARD"></uses-permission>
-<uses-permission android:name="android.permission.WAKE_LOCK"></uses-permission>
-<uses-permission android:name="android.permission.WRITE_SETTINGS"></uses-permission>
-<uses-permission android:name="android.permission.READ_SYNC_SETTINGS"></uses-permission>
-<uses-permission android:name="android.permission.BLUETOOTH"></uses-permission>
-<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"></uses-permission>
-<uses-permission android:name="android.permission.INSTALL_PACKAGES"></uses-permission>
-<uses-permission android:name="android.permission.STATUS_BAR"></uses-permission>
-<uses-permission android:name="android.permission.VIBRATE"></uses-permission>
-<uses-permission android:name="android.permission.SET_TIME"></uses-permission>
-<uses-permission android:name="android.permission.SET_TIME_ZONE"></uses-permission>
-
-<uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS"></uses-permission>
-<uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS"></uses-permission>
-<uses-permission android:name="android.permission.GET_TASKS"></uses-permission>
-
-</manifest> 
deleted file mode 100755
--- a/build/mobile/sutagent/android/CmdWorkerThread.java
+++ /dev/null
@@ -1,181 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-package com.mozilla.SUTAgentAndroid.service;
-
-import java.io.BufferedInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.PrintWriter;
-import java.net.Socket;
-import java.net.SocketTimeoutException;
-
-import com.mozilla.SUTAgentAndroid.SUTAgentAndroid;
-
-import android.util.Log;
-
-// import com.mozilla.SUTAgentAndroid.DoCommand;
-
-public class CmdWorkerThread extends Thread
-{
-    private RunCmdThread theParent = null;
-    private Socket socket    = null;
-    private String prompt = null;
-    boolean bListening    = true;
-
-    public CmdWorkerThread(RunCmdThread theParent, Socket workerSocket)
-        {
-        super("CmdWorkerThread");
-        this.theParent = theParent;
-        this.socket = workerSocket;
-        byte pr [] = new byte [3];
-        pr[0] = '$';
-        pr[1] = '>';
-        pr[2] = 0;
-        prompt = new String(pr,0,3);
-        }
-
-    public void StopListening()
-        {
-        bListening = false;
-        }
-
-    private String readLine(BufferedInputStream in)
-        {
-        String sRet = "";
-        int nByte = 0;
-        char cChar = 0;
-
-        try
-            {
-            nByte = in.read();
-            while (nByte != -1)
-                {
-                cChar = ((char)(nByte & 0xFF));
-                if ((cChar != '\r') && (cChar != '\n'))
-                    sRet += cChar;
-                else
-                    break;
-                nByte = in.read();
-                }
-
-            if ((in.available() > 0) && (cChar != '\n'))
-                {
-                in.mark(1024);
-                nByte = in.read();
-
-                if (nByte != -1)
-                    {
-                    cChar = ((char)(nByte & 0xFF));
-                    if (cChar != '\n')
-                        {
-                        in.reset();
-                        }
-                    }
-                }
-            }
-        catch (IOException e)
-            {
-            // TODO Auto-generated catch block
-            e.printStackTrace();
-            }
-
-        if (sRet.length() == 0)
-            sRet = null;
-
-        return(sRet);
-        }
-
-    public void run()
-        {
-        try {
-            OutputStream cmdOut = socket.getOutputStream();
-            InputStream cmdIn = socket.getInputStream();
-            PrintWriter out = new PrintWriter(cmdOut, true);
-            BufferedInputStream in = new BufferedInputStream(cmdIn);
-            String inputLine, outputLine;
-            DoCommand dc = new DoCommand(theParent.svc);
-
-            SUTAgentAndroid.log(dc, "CmdWorkerThread starts: "+getId());
-
-            int nAvail = cmdIn.available();
-            cmdIn.skip(nAvail);
-
-            out.print(prompt);
-            out.flush();
-
-            while (bListening)
-                {
-                if (!(in.available() > 0))
-                    {
-                    socket.setSoTimeout(500);
-                    try {
-                        int nRead = cmdIn.read();
-                        if (nRead == -1)
-                            {
-                            bListening = false;
-                            continue;
-                            }
-                        else
-                            {
-                            inputLine = ((char)nRead) + "";
-                            socket.setSoTimeout(120000);
-                            }
-                        }
-                    catch(SocketTimeoutException toe)
-                        {
-                        continue;
-                        }
-                    }
-                else
-                    inputLine = "";
-
-                if ((inputLine += readLine(in)) != null)
-                    {
-                    String message = String.format("%s : %s",
-                                     socket.getInetAddress().getHostAddress(), inputLine);
-                    SUTAgentAndroid.log(dc, message);
-
-                    outputLine = dc.processCommand(inputLine, out, in, cmdOut);
-                    if (outputLine == null)
-                        {
-                        outputLine = "";
-                        }
-                    if (outputLine.length() > 0)
-                        {
-                        out.print(outputLine + "\n" + prompt);
-                        }
-                    else
-                        out.print(prompt);
-                    out.flush();
-                    if (outputLine.equals("exit"))
-                        {
-                        theParent.StopListening();
-                        bListening = false;
-                        }
-                    if (outputLine.equals("quit"))
-                        {
-                        bListening = false;
-                        }
-                    outputLine = null;
-                    System.gc();
-                    }
-                else
-                    break;
-                }
-            out.close();
-            out = null;
-            in.close();
-            in = null;
-            socket.close();
-            SUTAgentAndroid.log(dc, "CmdWorkerThread ends: "+getId());
-        }
-    catch (IOException e)
-        {
-        // TODO Auto-generated catch block
-        e.printStackTrace();
-        }
-    }
-}
deleted file mode 100755
--- a/build/mobile/sutagent/android/DataWorkerThread.java
+++ /dev/null
@@ -1,208 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-package com.mozilla.SUTAgentAndroid.service;
-
-import java.io.BufferedInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.PrintWriter;
-import java.net.Socket;
-import java.net.SocketTimeoutException;
-import java.text.SimpleDateFormat;
-import java.util.Calendar;
-
-// import com.mozilla.SUTAgentAndroid.DoCommand;
-import com.mozilla.SUTAgentAndroid.SUTAgentAndroid;
-
-public class DataWorkerThread extends Thread
-{
-    private RunDataThread theParent = null;
-    private Socket socket    = null;
-    boolean bListening    = true;
-    PrintWriter out = null;
-    SimpleDateFormat sdf = null;
-
-    public DataWorkerThread(RunDataThread theParent, Socket workerSocket)
-        {
-        super("DataWorkerThread");
-        this.theParent = theParent;
-        this.socket = workerSocket;
-        this.sdf = new SimpleDateFormat("yyyyMMdd-HH:mm:ss");
-        }
-
-    public void StopListening()
-        {
-        bListening = false;
-        }
-
-    public void SendString(String strToSend)
-        {
-        if (this.out != null)
-            {
-            Calendar cal = Calendar.getInstance();
-            String strOut = sdf.format(cal.getTime());
-            strOut += " " + strToSend + "\r\n";
-
-            out.write(strOut);
-            out.flush();
-            }
-        }
-
-    private String readLine(BufferedInputStream in)
-        {
-        String sRet = "";
-        int nByte = 0;
-        char cChar = 0;
-
-        try
-            {
-            nByte = in.read();
-            while (nByte != -1)
-                {
-                cChar = ((char)(nByte & 0xFF));
-                if ((cChar != '\r') && (cChar != '\n'))
-                    sRet += cChar;
-                else
-                    break;
-                nByte = in.read();
-                }
-
-            if (in.available() > 0)
-                {
-                in.mark(1024);
-                nByte = in.read();
-
-                while (nByte != -1)
-                    {
-                    cChar = ((char)(nByte & 0xFF));
-                    if ((cChar == '\r') || (cChar == '\n'))
-                        {
-                        if (in.available() > 0)
-                            {
-                            in.mark(1024);
-                            nByte = in.read();
-                            }
-                        else
-                            nByte = -1;
-                        }
-                    else
-                        {
-                        in.reset();
-                        break;
-                        }
-                    }
-                }
-            }
-        catch (IOException e)
-            {
-            // TODO Auto-generated catch block
-            e.printStackTrace();
-            }
-
-        if (sRet.length() == 0)
-            sRet = null;
-
-        return(sRet);
-        }
-
-    public void run()
-        {
-        String    sRet = "";
-        long lEndTime = System.currentTimeMillis() + 60000;
-
-        try {
-            while(bListening)
-                {
-                OutputStream cmdOut = socket.getOutputStream();
-                InputStream cmdIn = socket.getInputStream();
-                this.out = new PrintWriter(cmdOut, true);
-                BufferedInputStream in = new BufferedInputStream(cmdIn);
-                String inputLine, outputLine;
-                DoCommand dc = new DoCommand(theParent.svc);
-
-                Calendar cal = Calendar.getInstance();
-                sRet = sdf.format(cal.getTime());
-                sRet += " trace output";
-
-                out.println(sRet);
-                out.flush();
-                int nAvail = cmdIn.available();
-                cmdIn.skip(nAvail);
-
-                while (bListening)
-                    {
-                    if (System.currentTimeMillis() > lEndTime)
-                        {
-                        cal = Calendar.getInstance();
-                        sRet = sdf.format(cal.getTime());
-                        sRet += " Thump thump - " + SUTAgentAndroid.sUniqueID + "\r\n";
-
-                        out.write(sRet);
-                        out.flush();
-
-                        lEndTime = System.currentTimeMillis() + 60000;
-                        }
-
-                    if (!(in.available() > 0))
-                        {
-                        socket.setSoTimeout(500);
-                        try {
-                            int nRead = cmdIn.read();
-                            if (nRead == -1)
-                                {
-                                bListening = false;
-                                continue;
-                                }
-                            else
-                                inputLine = (char)nRead + "";
-                            }
-                        catch(SocketTimeoutException toe)
-                            {
-                            continue;
-                            }
-                        }
-                    else
-                        inputLine = "";
-
-                    if ((inputLine += readLine(in)) != null)
-                        {
-                        outputLine = dc.processCommand(inputLine, out, in, cmdOut);
-                        if (outputLine == null)
-                            {
-                            outputLine = "";
-                            }
-                        out.print(outputLine + "\n");
-                        out.flush();
-                        if (outputLine.equals("exit"))
-                            {
-                            theParent.StopListening();
-                            bListening = false;
-                            }
-                        if (outputLine.equals("quit"))
-                            {
-                            bListening = false;
-                            }
-                        outputLine = null;
-                        System.gc();
-                        }
-                    else
-                        break;
-                    }
-
-                out.close();
-                out = null;
-                in.close();
-                in = null;
-                socket.close();
-                }
-            }
-        catch (IOException e)
-            {
-            // TODO Auto-generated catch block
-            e.printStackTrace();
-            }
-        }
-}
deleted file mode 100755
--- a/build/mobile/sutagent/android/DoAlert.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-package com.mozilla.SUTAgentAndroid.service;
-
-import java.util.TimerTask;
-
-import android.content.Context;
-import android.content.ContextWrapper;
-import android.media.Ringtone;
-import android.media.RingtoneManager;
-import android.widget.Toast;
-
-class DoAlert extends TimerTask
-    {
-    int    lcv = 0;
-    Toast toast = null;
-    Ringtone rt = null;
-
-    DoAlert(ContextWrapper contextWrapper)
-        {
-        Context    ctx = contextWrapper.getApplicationContext();
-        this.toast = Toast.makeText(ctx, "Help me!", Toast.LENGTH_LONG);
-        rt = RingtoneManager.getRingtone(ctx, RingtoneManager.getDefaultUri(RingtoneManager.TYPE_ALARM));
-        }
-
-    public void term()
-        {
-        if (rt != null)
-            {
-            if (rt.isPlaying())
-                rt.stop();
-            }
-
-        if (toast != null)
-            toast.cancel();
-        }
-
-    public void run ()
-        {
-        String sText =(((lcv++ % 2) == 0)  ? "Help me!" : "I've fallen down!" );
-        toast.setText(sText);
-        toast.show();
-        if (rt != null)
-            rt.play();
-        }
-    }
deleted file mode 100755
--- a/build/mobile/sutagent/android/DoCommand.java
+++ /dev/null
@@ -1,3998 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-package com.mozilla.SUTAgentAndroid.service;
-
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
-import java.io.BufferedReader;
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.FileReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.OutputStream;
-import java.io.PrintWriter;
-import java.io.RandomAccessFile;
-import java.net.DatagramPacket;
-import java.net.DatagramSocket;
-import java.net.InetAddress;
-import java.net.Socket;
-import java.net.SocketException;
-import java.net.UnknownHostException;
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.GregorianCalendar;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.StringTokenizer;
-import java.util.TimeZone;
-import java.util.zip.Adler32;
-import java.util.zip.CheckedInputStream;
-import java.util.zip.CheckedOutputStream;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
-import java.util.zip.ZipInputStream;
-import java.util.zip.ZipOutputStream;
-
-import org.apache.commons.net.ftp.FTP;
-import org.apache.commons.net.ftp.FTPClient;
-import org.apache.commons.net.ftp.FTPFile;
-import org.apache.commons.net.ftp.FTPReply;
-
-import com.mozilla.SUTAgentAndroid.R;
-import com.mozilla.SUTAgentAndroid.SUTAgentAndroid;
-
-import android.app.Activity;
-import android.app.ActivityManager;
-import android.app.AlarmManager;
-import android.app.Notification;
-import android.app.NotificationManager;
-import android.app.PendingIntent;
-import android.content.ActivityNotFoundException;
-import android.content.ComponentName;
-import android.content.ContentResolver;
-import android.content.ContentValues;
-import android.content.Context;
-import android.content.ContextWrapper;
-import android.content.Intent;
-import android.content.pm.ActivityInfo;
-import android.content.pm.PackageInfo;
-import android.content.pm.PackageManager;
-import android.content.pm.ServiceInfo;
-import android.content.pm.PackageManager.NameNotFoundException;
-import android.database.Cursor;
-import android.net.Uri;
-import android.os.Build;
-import android.os.Debug;
-import android.os.Environment;
-import android.os.StatFs;
-import android.os.SystemClock;
-import android.text.TextUtils;
-import android.util.DisplayMetrics;
-import android.util.Log;
-import android.view.Surface;
-import android.view.WindowManager;
-
-public class DoCommand {
-
-    String lineSep = System.getProperty("line.separator");
-    Process    pProc;
-    OutputStream sutIn;
-    InputStream    sutErr;
-    InputStream    sutOut;
-    AlertLooperThread alrt = null;
-    ContextWrapper    contextWrapper = null;
-
-    String    currentDir = "/";
-    String    sErrorPrefix = "##AGENT-WARNING## ";
-    boolean bTraceOn = false;
-
-    String ffxProvider = "org.mozilla.ffxcp";
-    String fenProvider = "org.mozilla.fencp";
-
-    private static final int DEFAULT_STARTPRG_TIMEOUT_SECONDS = 300;
-
-    public final String prgVersion = "SUTAgentAndroid Version 1.20";
-
-    public enum Command
-        {
-        RUN ("run"),
-        EXEC ("exec"),
-        EXECSU ("execsu"),
-        EXECCWD ("execcwd"),
-        EXECCWDSU ("execcwdsu"),
-        EXECEXT ("execext"),
-        ENVRUN ("envrun"),
-        KILL ("kill"),
-        PS ("ps"),
-        DEVINFO ("info"),
-        OS ("os"),
-        ID ("id"),
-        UPTIME ("uptime"),
-        UPTIMEMILLIS ("uptimemillis"),
-        SUTUPTIMEMILLIS ("sutuptimemillis"),
-        SETTIME ("settime"),
-        SYSTIME ("systime"),
-        SCREEN ("screen"),
-        ROTATION ("rotation"),
-        MEMORY ("memory"),
-        POWER ("power"),
-        PROCESS ("process"),
-        SUTUSERINFO ("sutuserinfo"),
-        TEMPERATURE ("temperature"),
-        GETAPPROOT ("getapproot"),
-        TESTROOT ("testroot"),
-        ALRT ("alrt"),
-        DISK ("disk"),
-        CP ("cp"),
-        TIME ("time"),
-        HASH ("hash"),
-        CD ("cd"),
-        CAT ("cat"),
-        CWD ("cwd"),
-        MV ("mv"),
-        PUSH ("push"),
-        PULL ("pull"),
-        RM ("rm"),
-        PRUNE ("rmdr"),
-        MKDR ("mkdr"),
-        DIRWRITABLE ("dirw"),
-        ISDIR ("isdir"),
-        DEAD ("dead"),
-        MEMS ("mems"),
-        LS ("ls"),
-        TMPD ("tmpd"),
-        PING ("ping"),
-        REBT ("rebt"),
-        UNZP ("unzp"),
-        ZIP ("zip"),
-        CLOK ("clok"),
-        STAT ("stat"),
-        QUIT ("quit"),
-        EXIT ("exit"),
-        HELP ("help"),
-        FTPG ("ftpg"),
-        FTPP ("ftpp"),
-        INST ("inst"),
-        UPDT ("updt"),
-        UNINST ("uninst"),
-        UNINSTALL ("uninstall"),
-        TEST ("test"),
-        DBG ("dbg"),
-        TRACE ("trace"),
-        VER ("ver"),
-        TZGET ("tzget"),
-        TZSET ("tzset"),
-        ADB ("adb"),
-        CHMOD ("chmod"),
-        TOPACTIVITY ("activity"),
-        UNKNOWN ("unknown");
-
-        private final String theCmd;
-
-        Command(String theCmd) { this.theCmd = theCmd; }
-
-        public String theCmd() {return theCmd;}
-
-        public static Command getCmd(String sCmd)
-            {
-            Command retCmd = UNKNOWN;
-            for (Command cmd : Command.values())
-                {
-                if (cmd.theCmd().equalsIgnoreCase(sCmd))
-                    {
-                    retCmd = cmd;
-                    break;
-                    }
-                }
-            return (retCmd);
-            }
-        }
-
-    public DoCommand(ContextWrapper service)
-        {
-        this.contextWrapper = service;
-        }
-
-    public String processCommand(String theCmdLine, PrintWriter out, BufferedInputStream in, OutputStream cmdOut)
-        {
-        String     strReturn = "";
-        Command    cCmd = null;
-        Command cSubCmd = null;
-
-        if (bTraceOn)
-            ((ASMozStub)this.contextWrapper).SendToDataChannel(theCmdLine);
-
-        String [] Argv = parseCmdLine2(theCmdLine);
-
-        int Argc = Argv.length;
-
-        cCmd = Command.getCmd(Argv[0]);
-
-        switch(cCmd)
-            {
-            case TRACE:
-                if (Argc == 2)
-                    bTraceOn = (Argv[1].equalsIgnoreCase("on") ? true : false);
-                else
-                    strReturn = sErrorPrefix + "Wrong number of arguments for trace command!";
-                break;
-
-            case VER:
-                strReturn = prgVersion;
-                break;
-
-            case CLOK:
-                strReturn = GetClok();
-                break;
-
-            case TZGET:
-                strReturn = GetTimeZone();
-                break;
-
-            case TZSET:
-                if (Argc == 2)
-                    strReturn = SetTimeZone(Argv[1]);
-                else
-                    strReturn = sErrorPrefix + "Wrong number of arguments for settz command!";
-                break;
-
-            case UPDT:
-                if (Argc >= 2)
-                    strReturn = StrtUpdtOMatic(Argv[1], Argv[2], (Argc > 3 ? Argv[3] : null), (Argc > 4 ? Argv[4] : null));
-                else
-                    strReturn = sErrorPrefix + "Wrong number of arguments for updt command!";
-                break;
-
-            case SETTIME:
-                strReturn = SetSystemTime(Argv[1], (Argc > 2 ? Argv[2] : null), cmdOut);
-                break;
-
-            case CWD:
-                try {
-                    strReturn = new java.io.File(currentDir).getCanonicalPath();
-                    }
-                catch (IOException e)
-                    {
-                    e.printStackTrace();
-                    }
-                break;
-
-            case CD:
-                if (Argc == 2)
-                    strReturn = changeDir(Argv[1]);
-                else
-                    strReturn = sErrorPrefix + "Wrong number of arguments for cd command!";
-                break;
-
-            case LS:
-                strReturn = PrintDir(((Argc > 1) ? Argv[1] : currentDir));
-                break;
-
-            case GETAPPROOT:
-                if (Argc == 2)
-                    strReturn = GetAppRoot(Argv[1]);
-                else
-                    strReturn = sErrorPrefix + "Wrong number of arguments for getapproot command!";
-                break;
-
-            case ISDIR:
-                if (Argc == 2)
-                    strReturn = isDirectory(Argv[1]);
-                else
-                    strReturn = sErrorPrefix + "Wrong number of arguments for isdir command!";
-                break;
-
-            case TESTROOT:
-                strReturn = GetTestRoot();
-                break;
-
-            case DEAD:
-                if (Argc == 2)
-                    strReturn = (IsProcessDead(Argv[1]) ? (Argv[1] + " is hung or unresponsive") : (Argv[1] + " is ok"));
-                else
-                    strReturn = sErrorPrefix + "Wrong number of arguments for dead command!";
-                break;
-
-            case PS:
-                strReturn = GetProcessInfo();
-                break;
-
-            case PULL:
-                if (Argc >= 2) {
-                    long lOff = 0;
-                    long lLen = -1;
-                    if (Argc > 2) {
-                        try {
-                            lOff = Long.parseLong(Argv[2].trim());
-                        } catch (NumberFormatException nfe) {
-                            lOff = 0;
-                            System.out.println("NumberFormatException: " + nfe.getMessage());
-                        }
-                    }
-                    if (Argc == 4) {
-                        try {
-                            lLen = Long.parseLong(Argv[3].trim());
-                        } catch (NumberFormatException nfe) {
-                            lLen = -1;
-                            System.out.println("NumberFormatException: " + nfe.getMessage());
-                        }
-                    }
-                    strReturn = Pull(Argv[1], lOff, lLen, cmdOut);
-                } else {
-                    strReturn = sErrorPrefix + "Wrong number of arguments for pull command!";
-                }
-                break;
-
-            case PUSH:
-                if (Argc == 3)
-                    {
-                    long lArg = 0;
-                    try
-                        {
-                        lArg = Long.parseLong(Argv[2].trim());
-                        }
-                    catch (NumberFormatException nfe)
-                        {
-                        System.out.println("NumberFormatException: " + nfe.getMessage());
-                        }
-
-                    strReturn = Push(Argv[1], in, lArg);
-                    }
-                else
-                    strReturn = sErrorPrefix + "Wrong number of arguments for push command!";
-                break;
-
-            case INST:
-                if (Argc >= 2)
-                    strReturn = InstallApp(Argv[1], cmdOut);
-                else
-                    strReturn = sErrorPrefix + "Wrong number of arguments for inst command!";
-                break;
-
-            case UNINST:
-                if (Argc >= 2)
-                    strReturn = UnInstallApp(Argv[1], cmdOut, true);
-                else
-                    strReturn = sErrorPrefix + "Wrong number of arguments for uninst command!";
-                break;
-
-            case UNINSTALL:
-                if (Argc >= 2)
-                    strReturn = UnInstallApp(Argv[1], cmdOut, false);
-                else
-                    strReturn = sErrorPrefix + "Wrong number of arguments for uninstall command!";
-                break;
-
-            case ALRT:
-                if (Argc > 1)
-                    {
-                    if (Argv[1].contentEquals("on"))
-                        {
-                        String sTitle = "Agent Alert";
-                        String sMsg = "The Agent Alert System has been activated!";
-                        if (Argc == 3) {
-                            sTitle = Argv[2];
-                            sMsg = "";
-                        } else if (Argc == 4) {
-                            sTitle = Argv[2];
-                            sMsg = Argv[3];
-                        }
-                        StartAlert(sTitle, sMsg);
-                        }
-                    else
-                        {
-                        StopAlert();
-                        }
-                    }
-                else
-                    {
-                    strReturn = sErrorPrefix + "Wrong number of arguments for alrt command!";
-                    }
-                break;
-
-            case REBT:
-                if (Argc >= 1)
-                    strReturn = RunReboot(cmdOut, (Argc > 1 ? Argv[1] : null), (Argc > 2 ? Argv[2] : null));
-                else
-                    strReturn = sErrorPrefix + "Wrong number of arguments for rebt command!";
-//                RunReboot(cmdOut);
-                break;
-
-            case TMPD:
-                strReturn = GetTmpDir();
-                break;
-
-            case DEVINFO:
-                if (Argc == 1)
-                    {
-                    strReturn += SUTAgentAndroid.sUniqueID;
-                    strReturn += "\n";
-                    strReturn += GetOSInfo();
-                    strReturn += "\n";
-                    strReturn += GetSystemTime();
-                    strReturn += "\n";
-                    strReturn += GetUptime();
-                    strReturn += "\n";
-                    strReturn += GetUptimeMillis();
-                    strReturn += "\n";
-                    strReturn += GetSutUptimeMillis();
-                    strReturn += "\n";
-                    strReturn += GetScreenInfo();
-                    strReturn += "\n";
-                    strReturn += GetRotationInfo();
-                    strReturn += "\n";
-                    strReturn += GetMemoryInfo();
-                    strReturn += "\n";
-                    strReturn += GetPowerInfo();
-                    strReturn += "\n";
-                    strReturn += GetTemperatureInfo();
-                    strReturn += "\n";
-                    strReturn += GetProcessInfo();
-                    strReturn += "\n";
-                    strReturn += GetSutUserInfo();
-                    strReturn += "\n";
-                    strReturn += GetDiskInfo("/data");
-                    strReturn += "\n";
-                    strReturn += GetDiskInfo("/system");
-                    strReturn += "\n";
-                    strReturn += GetDiskInfo("/mnt/sdcard");
-                    }
-                else
-                    {
-                    cSubCmd = Command.getCmd(Argv[1]);
-                    switch(cSubCmd)
-                        {
-                        case ID:
-                            strReturn = SUTAgentAndroid.sUniqueID;
-                            break;
-
-                        case SCREEN:
-                            strReturn = GetScreenInfo();
-                            break;
-
-                        case ROTATION:
-                            strReturn = GetRotationInfo();
-                            break;
-
-                        case PROCESS:
-                            strReturn = GetProcessInfo();
-                            break;
-
-                        case OS:
-                            strReturn = GetOSInfo();
-                            break;
-
-                        case SYSTIME:
-                            strReturn = GetSystemTime();
-                            break;
-
-                        case UPTIME:
-                            strReturn = GetUptime();
-                            break;
-
-                        case UPTIMEMILLIS:
-                            strReturn = GetUptimeMillis();
-                            break;
-
-                        case SUTUPTIMEMILLIS:
-                            strReturn = GetSutUptimeMillis();
-                            break;
-
-                        case MEMORY:
-                            strReturn = GetMemoryInfo();
-                            break;
-
-                        case POWER:
-                            strReturn += GetPowerInfo();
-                            break;
-
-                        case SUTUSERINFO:
-                            strReturn += GetSutUserInfo();
-                            break;
-
-                        case TEMPERATURE:
-                            strReturn += GetTemperatureInfo();
-                            break;
-
-                        case DISK:
-                            strReturn += "\n";
-                            strReturn += GetDiskInfo("/data");
-                            strReturn += "\n";
-                            strReturn += GetDiskInfo("/system");
-                            strReturn += "\n";
-                            strReturn += GetDiskInfo("/mnt/sdcard");
-                            break;
-
-                        default:
-                            break;
-                        }
-                    }
-                break;
-
-            case STAT:
-                if (Argc == 2)
-                    strReturn = StatProcess(Argv[1]);
-                else
-                    strReturn = sErrorPrefix + "Wrong number of arguments for ping command!";
-                break;
-
-            case PING:
-                if (Argc == 2)
-                    strReturn = SendPing(Argv[1], cmdOut);
-                else
-                    strReturn = sErrorPrefix + "Wrong number of arguments for ping command!";
-                break;
-
-            case HASH:
-                if (Argc == 2)
-                    strReturn = HashFile(Argv[1]);
-                else
-                    strReturn = sErrorPrefix + "Wrong number of arguments for hash command!";
-                break;
-
-            case PRUNE:
-                if (Argc == 2)
-                    strReturn = PruneDir(Argv[1]);
-                else
-                    strReturn = sErrorPrefix + "Wrong number of arguments for prune command!";
-                break;
-
-            case FTPG:
-                if (Argc == 4)
-                    strReturn = FTPGetFile(Argv[1], Argv[2], Argv[3], cmdOut);
-                else
-                    strReturn = sErrorPrefix + "Wrong number of arguments for ftpg command!";
-                break;
-
-            case CAT:
-                if (Argc == 2)
-                    strReturn = Cat(Argv[1], cmdOut);
-                else
-                    strReturn = sErrorPrefix + "Wrong number of arguments for cat command!";
-                break;
-
-            case DIRWRITABLE:
-                if (Argc == 2)
-                    strReturn = IsDirWritable(Argv[1]);
-                else
-                    strReturn = sErrorPrefix + "Wrong number of arguments for dirwritable command!";
-                break;
-
-            case TIME:
-                if (Argc == 2)
-                    strReturn = PrintFileTimestamp(Argv[1]);
-                else
-                    strReturn = sErrorPrefix + "Wrong number of arguments for time command!";
-                break;
-
-            case MKDR:
-                if (Argc == 2)
-                    strReturn = MakeDir(Argv[1]);
-                else
-                    strReturn = sErrorPrefix + "Wrong number of arguments for mkdr command!";
-                break;
-
-            case RM:
-                if (Argc == 2)
-                    strReturn = RemoveFile(Argv[1]);
-                else
-                    strReturn = sErrorPrefix + "Wrong number of arguments for rm command!";
-                break;
-
-            case MV:
-                if (Argc == 3)
-                    strReturn = Move(Argv[1], Argv[2]);
-                else
-                    strReturn = sErrorPrefix + "Wrong number of arguments for mv command!";
-                break;
-
-            case CP:
-                if (Argc == 3)
-                    strReturn = CopyFile(Argv[1], Argv[2]);
-                else
-                    strReturn = sErrorPrefix + "Wrong number of arguments for cp command!";
-                break;
-
-            case QUIT:
-            case EXIT:
-                strReturn = Argv[0];
-                break;
-
-            case DBG:
-                Debug.waitForDebugger();
-                strReturn = "waitForDebugger on";
-                break;
-
-            case ADB:
-                if (Argc == 2) {
-                    if (Argv[1].contains("ip") || Argv[1].contains("usb")) {
-                        strReturn = SetADB(Argv[1]);
-                    } else {
-                        strReturn = sErrorPrefix + "Unrecognized argument for adb command!";
-                    }
-                } else {
-                    strReturn = sErrorPrefix + "Wrong number of arguments for adb command!";
-                }
-                break;
-
-            case TEST:
-                long lFreeMemory = Runtime.getRuntime().freeMemory();
-                long lTotMemory = Runtime.getRuntime().totalMemory();
-                long lMaxMemory = Runtime.getRuntime().maxMemory();
-
-
-                if (lFreeMemory > 0) {
-                    strReturn = "Max memory: " + lMaxMemory + "\nTotal Memory: " + lTotMemory + "\nFree memory: " + lFreeMemory;
-                    break;
-                }
-
-                ContentResolver cr = contextWrapper.getContentResolver();
-                Uri ffxFiles = null;
-
-                if (Argv[1].contains("fennec")) {
-                    ffxFiles = Uri.parse("content://" + fenProvider + "/dir");
-                } else if (Argv[1].contains("firefox")) {
-                    ffxFiles = Uri.parse("content://" + ffxProvider + "/dir");
-                }
-
-//                Uri ffxFiles = Uri.parse("content://org.mozilla.fencp/file");
-                String[] columns = new String[] {
-                        "_id",
-                        "isdir",
-                        "filename",
-                        "length"
-                    };
-//                String[] columns = new String[] {
-//                        "_id",
-//                        "chunk"
-//                     };
-                Cursor myCursor = cr.query(    ffxFiles,
-                                            columns,                         // Which columns to return
-                                            (Argc > 1 ? Argv[1] : null),    // Which rows to return (all rows)
-                                            null,                           // Selection arguments (none)
-                                            null);                            // Put the results in ascending order by name
-/*
-                if (myCursor != null) {
-                    int nRows = myCursor.getCount();
-                    String [] colNames = myCursor.getColumnNames();
-                    int    nID = 0;
-                    int nBytesRecvd = 0;
-
-                    for (int lcv = 0; lcv < nRows; lcv++) {
-                        if  (myCursor.moveToPosition(lcv)) {
-                            nID = myCursor.getInt(0);
-                            byte [] buf = myCursor.getBlob(1);
-                            if (buf != null) {
-                                nBytesRecvd += buf.length;
-                                strReturn += new String(buf);
-                                buf = null;
-                            }
-                        }
-                    }
-                    strReturn += "[eof - " + nBytesRecvd + "]";
-                    myCursor.close();
-                }
-
-*/
-                if (myCursor != null)
-                    {
-                    int nRows = myCursor.getCount();
-                    int    nID = 0;
-                    String sFileName = "";
-                    long lFileSize = 0;
-                    boolean bIsDir = false;
-
-                    for (int lcv = 0; lcv < nRows; lcv++)
-                        {
-                        if  (myCursor.moveToPosition(lcv))
-                            {
-                            nID = myCursor.getInt(0);
-                            bIsDir = (myCursor.getInt(1) == 1 ? true : false);
-                            sFileName = myCursor.getString(2);
-                            lFileSize = myCursor.getLong(3);
-                            strReturn += "" + nID + "\t" + (bIsDir ? "<dir> " : "      ") + sFileName + "\t" + lFileSize + "\n";
-                            }
-                        }
-                    myCursor.close();
-                    }
-                break;
-
-            case EXEC:
-            case ENVRUN:
-                if (Argc >= 2)
-                    {
-                    String [] theArgs = new String [Argc - 1];
-
-                    for (int lcv = 1; lcv < Argc; lcv++)
-                        {
-                        theArgs[lcv - 1] = Argv[lcv];
-                        }
-
-                    strReturn = StartPrg2(theArgs, cmdOut, null, false, DEFAULT_STARTPRG_TIMEOUT_SECONDS);
-                    }
-                else
-                    {
-                    strReturn = sErrorPrefix + "Wrong number of arguments for " + Argv[0] + " command!";
-                    }
-                break;
-
-            case EXECSU:
-                if (Argc >= 2)
-                    {
-                    String [] theArgs = new String [Argc - 1];
-
-                    for (int lcv = 1; lcv < Argc; lcv++)
-                        {
-                        theArgs[lcv - 1] = Argv[lcv];
-                        }
-
-                    strReturn = StartPrg2(theArgs, cmdOut, null, true, DEFAULT_STARTPRG_TIMEOUT_SECONDS);
-                    }
-                else
-                    {
-                    strReturn = sErrorPrefix + "Wrong number of arguments for " + Argv[0] + " command!";
-                    }
-                break;
-
-            case EXECCWD:
-                if (Argc >= 3)
-                    {
-                    String [] theArgs = new String [Argc - 2];
-
-                    for (int lcv = 2; lcv < Argc; lcv++)
-                        {
-                        theArgs[lcv - 2] = Argv[lcv];
-                        }
-
-                    strReturn = StartPrg2(theArgs, cmdOut, Argv[1], false, DEFAULT_STARTPRG_TIMEOUT_SECONDS);
-                    }
-                else
-                    {
-                    strReturn = sErrorPrefix + "Wrong number of arguments for " + Argv[0] + " command!";
-                    }
-                break;
-
-            case EXECCWDSU:
-                if (Argc >= 3)
-                    {
-                    String [] theArgs = new String [Argc - 2];
-
-                    for (int lcv = 2; lcv < Argc; lcv++)
-                        {
-                        theArgs[lcv - 2] = Argv[lcv];
-                        }
-
-                    strReturn = StartPrg2(theArgs, cmdOut, Argv[1], true, DEFAULT_STARTPRG_TIMEOUT_SECONDS);
-                    }
-                else
-                    {
-                    strReturn = sErrorPrefix + "Wrong number of arguments for " + Argv[0] + " command!";
-                    }
-                break;
-
-            case RUN:
-                if (Argc >= 2)
-                    {
-                    String [] theArgs = new String [Argc - 1];
-
-                    for (int lcv = 1; lcv < Argc; lcv++)
-                        {
-                        theArgs[lcv - 1] = Argv[lcv];
-                        }
-
-                    if (Argv[1].contains("/") || Argv[1].contains("\\") || !Argv[1].contains("."))
-                        strReturn = StartPrg(theArgs, cmdOut, false, DEFAULT_STARTPRG_TIMEOUT_SECONDS);
-                    else
-                        strReturn = StartJavaPrg(theArgs, null);
-                    }
-                else
-                    {
-                    strReturn = sErrorPrefix + "Wrong number of arguments for " + Argv[0] + " command!";
-                    }
-                break;
-
-            case EXECEXT:
-                // An "extended" exec command with format:
-                //    execext [su] [cwd=<path>] [t=<timeout in seconds>] arg1 ...
-                if (Argc >= 2)
-                    {
-                    boolean su = false;
-                    String cwd = null;
-                    int timeout = DEFAULT_STARTPRG_TIMEOUT_SECONDS;
-                    int extra;
-                    for (extra = 1; extra < Argc; extra++)
-                        {
-                        if (Argv[extra].equals("su"))
-                            {
-                            su = true;
-                            }
-                        else if (Argv[extra].startsWith("cwd="))
-                            {
-                            cwd = Argv[extra].substring(4);
-                            }
-                        else if (Argv[extra].startsWith("t="))
-                            {
-                            timeout = Integer.parseInt(Argv[extra].substring(2));
-                            if (timeout < 1 || timeout > 4*60*60)
-                                {
-                                Log.e("SUTAgentAndroid", 
-                                  "invalid execext timeout "+Argv[extra].substring(2)+"; using default instead");
-                                timeout = DEFAULT_STARTPRG_TIMEOUT_SECONDS;
-                                }
-                            }
-                        else
-                            {
-                            break;
-                            }
-                        }
-
-                    if (extra < Argc)
-                        {
-                        String [] theArgs = new String [Argc - extra];
-                        for (int lcv = extra; lcv < Argc; lcv++)
-                            {
-                            theArgs[lcv - extra] = Argv[lcv];
-                            }
-
-                        strReturn = StartPrg2(theArgs, cmdOut, cwd, su, timeout);
-                        }
-                    else
-                        {
-                        strReturn = sErrorPrefix + "No regular arguments for " + Argv[0] + " command!";
-                        }
-                    }
-                else
-                    {
-                    strReturn = sErrorPrefix + "Wrong number of arguments for " + Argv[0] + " command!";
-                    }
-                break;
-
-            case KILL:
-                if (Argc == 2)
-                    strReturn = KillProcess(Argv[1], cmdOut);
-                else
-                    strReturn = sErrorPrefix + "Wrong number of arguments for kill command!";
-                break;
-
-            case DISK:
-                strReturn = GetDiskInfo((Argc == 2 ? Argv[1] : "/"));
-                break;
-
-            case UNZP:
-                strReturn = Unzip(Argv[1], (Argc == 3 ? Argv[2] : ""));
-                break;
-
-            case ZIP:
-                strReturn = Zip(Argv[1], (Argc == 3 ? Argv[2] : ""));
-                break;
-
-            case CHMOD:
-                if (Argc == 2)
-                    strReturn = ChmodDir(Argv[1]);
-                else
-                    strReturn = sErrorPrefix + "Wrong number of arguments for chmod command!";
-                break;
-
-            case TOPACTIVITY:
-                strReturn = TopActivity();
-                break;
-
-            case HELP:
-                strReturn = PrintUsage();
-                break;
-
-            default:
-                strReturn = sErrorPrefix + "[" + Argv[0] + "] command";
-                if (Argc > 1)
-                    {
-                    strReturn += " with arg(s) =";
-                    for (int lcv = 1; lcv < Argc; lcv++)
-                        {
-                        strReturn += " [" + Argv[lcv] + "]";
-                        }
-                    }
-                strReturn += " is currently not implemented.";
-                break;
-            }
-
-        return(strReturn);
-        }
-
-    private void SendNotification(String tickerText, String expandedText) {
-        NotificationManager notificationManager = (NotificationManager)contextWrapper.getSystemService(Context.NOTIFICATION_SERVICE);
-        int icon = R.drawable.ateamlogo;
-        long when = System.currentTimeMillis();
-
-        Context context = contextWrapper.getApplicationContext();
-
-        // Intent to launch an activity when the extended text is clicked
-        Intent intent2 = new Intent(contextWrapper, SUTAgentAndroid.class);
-        PendingIntent launchIntent = PendingIntent.getActivity(context, 0, intent2, 0);
-
-        Notification notification = new Notification.Builder(context)
-            .setContentTitle(tickerText)
-            .setContentText(expandedText)
-            .setSmallIcon(icon)
-            .setWhen(when)
-            .setContentIntent(launchIntent)
-            .build();
-
-        notification.flags |= (Notification.FLAG_INSISTENT | Notification.FLAG_AUTO_CANCEL);
-        notification.defaults |= Notification.DEFAULT_SOUND;
-        notification.defaults |= Notification.DEFAULT_VIBRATE;
-        notification.defaults |= Notification.DEFAULT_LIGHTS;
-
-        notificationManager.notify(1959, notification);
-    }
-
-private void CancelNotification()
-    {
-    NotificationManager notificationManager = (NotificationManager)contextWrapper.getSystemService(Context.NOTIFICATION_SERVICE);
-    notificationManager.cancel(1959);
-    }
-
-    public void StartAlert(String sTitle, String sMsg)
-        {
-        // start the alert message
-        SendNotification(sTitle, sMsg);
-        }
-
-    public void StopAlert()
-        {
-        CancelNotification();
-        }
-
-    public String [] parseCmdLine2(String theCmdLine)
-        {
-        String    cmdString;
-        String    workingString;
-        String    workingString2;
-        String    workingString3;
-        List<String> lst = new ArrayList<String>();
-        int nLength = 0;
-        int nFirstSpace = -1;
-
-        // Null cmd line
-        if (theCmdLine == null)
-            {
-            String [] theArgs = new String [1];
-            theArgs[0] = new String("");
-            return(theArgs);
-            }
-        else
-            {
-            nLength = theCmdLine.length();
-            nFirstSpace = theCmdLine.indexOf(' ');
-            }
-
-        if (nFirstSpace == -1)
-            {
-            String [] theArgs = new String [1];
-            theArgs[0] = new String(theCmdLine);
-            return(theArgs);
-            }
-
-        // Get the command
-        cmdString = new String(theCmdLine.substring(0, nFirstSpace));
-        lst.add(cmdString);
-
-        // Jump past the command and trim
-        workingString = (theCmdLine.substring(nFirstSpace + 1, nLength)).trim();
-
-        while ((nLength = workingString.length()) > 0)
-            {
-            int nEnd = 0;
-            int    nStart = 0;
-
-            // if we have a quote
-            if (workingString.startsWith("\"") || workingString.startsWith("'"))
-                {
-                char quoteChar = '"';
-                if (workingString.startsWith("\'"))
-                    quoteChar = '\'';
-
-                // point to the first non quote char
-                nStart = 1;
-                // find the matching quote
-                nEnd = workingString.indexOf(quoteChar, nStart);
-
-                char prevChar;
-
-                while(nEnd != -1)
-                    {
-                    // check to see if the quotation mark has been escaped
-                    prevChar = workingString.charAt(nEnd - 1);
-                    if (prevChar == '\\')
-                        {
-                        // if escaped, point past this quotation mark and find the next
-                        nEnd++;
-                        if (nEnd < nLength)
-                            nEnd = workingString.indexOf(quoteChar, nEnd);
-                        else
-                            nEnd = -1;
-                        }
-                    else
-                        break;
-                    }
-
-                // there isn't one
-                if (nEnd == -1)
-                    {
-                    // point at the quote
-                    nStart = 0;
-                    // so find the next space
-                    nEnd = workingString.indexOf(' ', nStart);
-                    // there isn't one of those either
-                    if (nEnd == -1)
-                        nEnd = nLength;    // Just grab the rest of the cmdline
-                    }
-                }
-            else // no quote so find the next space
-                {
-                nEnd = workingString.indexOf(' ', nStart);
-                // there isn't one of those
-                if (nEnd == -1)
-                    nEnd = nLength;    // Just grab the rest of the cmdline
-                }
-
-            // get the substring
-            workingString2 = workingString.substring(nStart, nEnd);
-
-            // if we have escaped quotes, convert them into standard ones
-            while (workingString2.contains("\\\"") || workingString2.contains("\\'"))
-                {
-                    workingString2 = workingString2.replace("\\\"", "\"");
-                    workingString2 = workingString2.replace("\\'", "'");
-                }
-
-            // add it to the list
-            lst.add(new String(workingString2));
-
-            // if we are dealing with a quote
-            if (nStart > 0)
-                nEnd++; //  point past the end one
-
-            // jump past the substring and trim it
-            workingString = (workingString.substring(nEnd)).trim();
-            }
-
-        // ok we're done package up the results
-        int nItems = lst.size();
-
-        String [] theArgs = new String [nItems];
-
-        for (int lcv = 0; lcv < nItems; lcv++)
-            {
-            theArgs[lcv] = lst.get(lcv);
-            }
-
-        return(theArgs);
-        }
-
-    public String [] parseCmdLine(String theCmdLine) {
-        String    cmdString;
-        String    workingString;
-        String    workingString2;
-        List<String> lst = new ArrayList<String>();
-        int nLength = 0;
-        int nFirstSpace = -1;
-
-        // Null cmd line
-        if (theCmdLine == null)
-            {
-            String [] theArgs = new String [1];
-            theArgs[0] = new String("");
-            return(theArgs);
-            }
-        else
-            {
-            nLength = theCmdLine.length();
-            nFirstSpace = theCmdLine.indexOf(' ');
-            }
-
-        if (nFirstSpace == -1)
-            {
-            String [] theArgs = new String [1];
-            theArgs[0] = new String(theCmdLine);
-            return(theArgs);
-            }
-
-        // Get the command
-        cmdString = new String(theCmdLine.substring(0, nFirstSpace));
-        lst.add(cmdString);
-
-        // Jump past the command and trim
-        workingString = (theCmdLine.substring(nFirstSpace + 1, nLength)).trim();
-
-        while ((nLength = workingString.length()) > 0)
-            {
-            int nEnd = 0;
-            int    nStart = 0;
-
-            // if we have a quote
-            if (workingString.startsWith("\""))
-                {
-                // point to the first non quote char
-                nStart = 1;
-                // find the matching quote
-                nEnd = workingString.indexOf('"', nStart);
-                // there isn't one
-                if (nEnd == -1)
-                    {
-                    // point at the quote
-                    nStart = 0;
-                    // so find the next space
-                    nEnd = workingString.indexOf(' ', nStart);
-                    // there isn't one of those either
-                    if (nEnd == -1)
-                        nEnd = nLength;    // Just grab the rest of the cmdline
-                    }
-                else
-                    {
-                    nStart = 0;
-                    nEnd++;
-                    }
-                }
-            else // no quote so find the next space
-                {
-                nEnd = workingString.indexOf(' ', nStart);
-
-                // there isn't one of those
-                if (nEnd == -1)
-                    nEnd = nLength;    // Just grab the rest of the cmdline
-                }
-
-            // get the substring
-            workingString2 = workingString.substring(nStart, nEnd);
-
-            // add it to the list
-            lst.add(new String(workingString2));
-
-            // jump past the substring and trim it
-            workingString = (workingString.substring(nEnd)).trim();
-            }
-
-        int nItems = lst.size();
-
-        String [] theArgs = new String [nItems];
-
-        for (int lcv = 0; lcv < nItems; lcv++)
-            {
-            theArgs[lcv] = lst.get(lcv);
-            }
-
-        return(theArgs);
-        }
-
-    public String fixFileName(String fileName)
-        {
-        String    sRet = "";
-        String    sTmpFileName = "";
-
-        sRet = fileName.replace('\\', '/');
-
-        if (sRet.startsWith("/"))
-            sTmpFileName = sRet;
-        else
-            sTmpFileName = currentDir + "/" + sRet;
-
-        sRet = sTmpFileName.replace('\\', '/');
-        sTmpFileName = sRet;
-        sRet = sTmpFileName.replace("//", "/");
-
-        return(sRet);
-        }
-
-    public String AddFilesToZip(ZipOutputStream out, String baseDir, String relDir)
-    {
-        final int             BUFFER     = 2048;
-        String                sRet    = "";
-        String                 curDir     = "";
-        String                relFN    = "";
-        BufferedInputStream origin = null;
-        byte                 data[] = new byte[BUFFER];
-
-        if (relDir.length() > 0)
-            curDir = baseDir + "/" + relDir;
-        else
-            curDir = baseDir;
-
-        File f = new File(curDir);
-
-        if (f.isFile())
-            {
-            try {
-                relFN = ((relDir.length() > 0) ? relDir + "/" + f.getName() : f.getName());
-                System.out.println("Adding: "+relFN);
-                sRet += "Adding: "+    relFN + lineSep;
-                FileInputStream fi = new FileInputStream(curDir);
-                origin = new BufferedInputStream(fi, BUFFER);
-                ZipEntry entry = new ZipEntry(relFN);
-                out.putNextEntry(entry);
-                int count;
-                while((count = origin.read(data, 0, BUFFER)) != -1)
-                    {
-                    out.write(data, 0, count);
-                    }
-                origin.close();
-                }
-            catch(Exception e)
-                {
-                e.printStackTrace();
-                }
-
-            return(sRet);
-            }
-
-        String    files[] = f.list();
-
-        if (files != null)
-            {
-            try {
-                for(int i = 0; i < files.length; i++)
-                    {
-                    f = new File(curDir + "/" + files[i]);
-                    if (f.isDirectory())
-                        {
-                        if (relDir.length() > 0)
-                            sRet += AddFilesToZip(out, baseDir, relDir + "/" + files[i]);
-                        else
-                            sRet += AddFilesToZip(out, baseDir, files[i]);
-                        }
-                    else
-                        {
-                        relFN = ((relDir.length() > 0) ? relDir + "/" + files[i] : files[i]);
-                        System.out.println("Adding: "+relFN);
-                        sRet += "Adding: "+    relFN + lineSep;
-                        FileInputStream fi = new FileInputStream(curDir + "/" + files[i]);
-                        origin = new BufferedInputStream(fi, BUFFER);
-                        ZipEntry entry = new ZipEntry(relFN);
-                        out.putNextEntry(entry);
-                        int count;
-                        while((count = origin.read(data, 0, BUFFER)) != -1)
-                            {
-                            out.write(data, 0, count);
-                            }
-                        origin.close();
-                        }
-                    }
-                }
-            catch(Exception e)
-                {
-                e.printStackTrace();
-                }
-            }
-
-        return(sRet);
-    }
-
-    public String Zip(String zipFileName, String srcName)
-        {
-        String    fixedZipFileName = fixFileName(zipFileName);
-        String    fixedSrcName = fixFileName(srcName);
-        String sRet = "";
-
-        try {
-            FileOutputStream dest = new FileOutputStream(fixedZipFileName);
-            CheckedOutputStream checksum = new CheckedOutputStream(dest, new Adler32());
-            ZipOutputStream out = new ZipOutputStream(new BufferedOutputStream(checksum));
-            out.setMethod(ZipOutputStream.DEFLATED);
-
-            sRet += AddFilesToZip(out, fixedSrcName, "");
-
-            out.close();
-            System.out.println("checksum:                   "+checksum.getChecksum().getValue());
-            sRet += "checksum:                   "+checksum.getChecksum().getValue();
-            }
-        catch(Exception e)
-            {
-            e.printStackTrace();
-            }
-
-        return(sRet);
-    }
-
-    public String Unzip(String zipFileName, String dstDirectory)
-        {
-        String     sRet = "";
-        String    fixedZipFileName = fixFileName(zipFileName);
-        String    fixedDstDirectory = fixFileName(dstDirectory);
-        String    dstFileName = "";
-        int        nNumExtracted = 0;
-        boolean bRet = false;
-
-        try {
-            final int BUFFER = 2048;
-            BufferedOutputStream dest = null;
-            ZipFile zipFile = new ZipFile(fixedZipFileName);
-            int nNumEntries = zipFile.size();
-            zipFile.close();
-
-            FileInputStream fis = new FileInputStream(fixedZipFileName);
-            CheckedInputStream checksum = new CheckedInputStream(fis, new Adler32());
-            ZipInputStream zis = new ZipInputStream(new BufferedInputStream(checksum));
-            ZipEntry entry;
-
-            byte [] data = new byte[BUFFER];
-
-            while((entry = zis.getNextEntry()) != null)
-                {
-                System.out.println("Extracting: " + entry);
-                int count;
-                if (fixedDstDirectory.length() > 0)
-                    dstFileName = fixedDstDirectory + entry.getName();
-                else
-                    dstFileName = entry.getName();
-
-                String tmpDir = dstFileName.substring(0, dstFileName.lastIndexOf('/'));
-                File tmpFile = new File(tmpDir);
-                if (!tmpFile.exists())
-                    {
-                    bRet = tmpFile.mkdirs();
-                    }
-                else
-                    bRet = true;
-
-                if (bRet)
-                    {
-                    // if we aren't just creating a directory
-                    if (dstFileName.lastIndexOf('/') != (dstFileName.length() - 1))
-                        {
-                        // write out the file
-                        FileOutputStream fos = new FileOutputStream(dstFileName);
-                        dest = new BufferedOutputStream(fos, BUFFER);
-                        while ((count = zis.read(data, 0, BUFFER)) != -1)
-                            {
-                            dest.write(data, 0, count);
-                            }
-                        dest.flush();
-                        dest.close();
-                        dest = null;
-                        fos.close();
-                        fos = null;
-                        }
-                    nNumExtracted++;
-                    }
-                else
-                    sRet += " - failed" + lineSep;
-                }
-
-            data = null;
-            zis.close();
-            System.out.println("Checksum:          "+checksum.getChecksum().getValue());
-            sRet += "Checksum:          "+checksum.getChecksum().getValue();
-            sRet += lineSep + nNumExtracted + " of " + nNumEntries + " successfully extracted";
-            }
-        catch(Exception e)
-            {
-            e.printStackTrace();
-            }
-
-        return(sRet);
-        }
-
-    public String StatProcess(String string)
-        {
-        String sRet = "";
-        ActivityManager aMgr = (ActivityManager) contextWrapper.getSystemService(Activity.ACTIVITY_SERVICE);
-        int    [] nPids = new int [1];
-
-        nPids[0] = Integer.parseInt(string);
-
-        android.os.Debug.MemoryInfo[] mi = aMgr.getProcessMemoryInfo(nPids);
-
-        sRet  = "Dalvik Private Dirty pages         " + mi[0].dalvikPrivateDirty     + " kb\n";
-        sRet += "Dalvik Proportional Set Size       " + mi[0].dalvikPss              + " kb\n";
-        sRet += "Dalvik Shared Dirty pages          " + mi[0].dalvikSharedDirty      + " kb\n\n";
-        sRet += "Native Private Dirty pages heap    " + mi[0].nativePrivateDirty     + " kb\n";
-        sRet += "Native Proportional Set Size heap  " + mi[0].nativePss              + " kb\n";
-        sRet += "Native Shared Dirty pages heap     " + mi[0].nativeSharedDirty      + " kb\n\n";
-        sRet += "Other Private Dirty pages          " + mi[0].otherPrivateDirty      + " kb\n";
-        sRet += "Other Proportional Set Size        " + mi[0].otherPss               + " kb\n";
-        sRet += "Other Shared Dirty pages           " + mi[0].otherSharedDirty       + " kb\n\n";
-        sRet += "Total Private Dirty Memory         " + mi[0].getTotalPrivateDirty() + " kb\n";
-        sRet += "Total Proportional Set Size Memory " + mi[0].getTotalPss()          + " kb\n";
-        sRet += "Total Shared Dirty Memory          " + mi[0].getTotalSharedDirty()  + " kb";
-
-
-        return(sRet);
-        }
-
-    public void FixDataLocalPermissions()
-        {
-        String chmodResult;
-        File localDir = new java.io.File("/data/local");
-        if (!localDir.canWrite()) {
-            chmodResult = ChmodDir("/data/local");
-            Log.i("SUTAgentAndroid", "Changed permissions on /data/local to make it writable: " + chmodResult);
-        }
-        File tmpDir = new java.io.File("/data/local/tmp");
-        if (tmpDir.exists() && !tmpDir.isDirectory()) {
-            if (!tmpDir.delete()) {
-                Log.e("SUTAgentAndroid", "Could not delete file /data/local/tmp");
-            }
-        }
-        if (!tmpDir.exists() && !tmpDir.mkdirs()) {
-            Log.e("SUTAgentAndroid", "Could not create directory /data/local/tmp");
-        }
-        chmodResult = ChmodDir("/data/local/tmp");
-        Log.i("SUTAgentAndroid", "Changed permissions on /data/local/tmp to make it writable: " + chmodResult);
-        }
-
-    private Boolean _SetTestRoot(String testroot)
-        {
-        String isWritable = IsDirWritable(testroot);
-        if (isWritable.contains(sErrorPrefix) || isWritable.contains("is not writable")) {
-            Log.w("SUTAgentAndroid", isWritable);
-            Log.w("SUTAgentAndroid", "Unable to set device root to " + testroot);
-            return false;
-        }
-
-        Log.i("SUTAgentAndroid", "Set device root to " + testroot);
-        SUTAgentAndroid.sTestRoot = testroot;
-        return true;
-        }
-
-    public void SetTestRoot(String testroot)
-        {
-        Boolean success = false;
-        if (!testroot.equals("")) {
-            // Device specified the required testroot.
-            success = _SetTestRoot(testroot);
-            if (!success) {
-                Log.e("SUTAgentAndroid", "Unable to set device root to " + testroot);
-            }
-        } else {
-            // Detect the testroot.
-            // Attempt external storage.
-            success = _SetTestRoot(Environment.getExternalStorageDirectory().getAbsolutePath());
-            if (!success) {
-                Log.e("SUTAgentAndroid", "Cannot access world writeable test root");
-            }
-        }
-        }
-
-    public String GetTestRoot()
-        {
-        if (SUTAgentAndroid.sTestRoot.equals("")) {
-            SetTestRoot("");
-        }
-        return SUTAgentAndroid.sTestRoot;
-        }
-
-    public String GetAppRoot(String AppName)
-        {
-        String sRet = sErrorPrefix + " internal error [no context]";
-        Context ctx = contextWrapper.getApplicationContext();
-
-        if (ctx != null)
-            {
-            try {
-                Context appCtx = ctx.createPackageContext(AppName, 0);
-                ContextWrapper appCtxW = new ContextWrapper(appCtx);
-                sRet = appCtxW.getApplicationInfo().dataDir;
-                appCtxW = null;
-                appCtx = null;
-                ctx = null;
-                System.gc();
-                }
-            catch (NameNotFoundException e)
-                {
-                e.printStackTrace();
-                }
-            }
-        return(sRet);
-        }
-
-    public String isDirectory(String sDir)
-        {
-        String    sRet = sErrorPrefix + sDir + " does not exist";
-        String    tmpDir    = fixFileName(sDir);
-        int    nFiles = 0;
-
-        if (tmpDir.contains("org.mozilla.fennec") || tmpDir.contains("org.mozilla.firefox")) {
-            ContentResolver cr = contextWrapper.getContentResolver();
-            Uri ffxFiles = Uri.parse("content://" + (tmpDir.contains("fennec") ? fenProvider : ffxProvider) + "/dir");
-
-            String[] columns = new String[] {
-                    "_id",
-                    "isdir",
-                    "filename",
-                    "length"
-                };
-
-            Cursor myCursor = cr.query(    ffxFiles,
-                                        columns,     // Which columns to return
-                                        tmpDir,     // Which rows to return (all rows)
-                                        null,       // Selection arguments (none)
-                                        null);        // Order clause (none)
-            if (myCursor != null) {
-                nFiles = myCursor.getCount();
-
-                // If no entries the dir is empty
-                if (nFiles > 0) {
-                    if  (myCursor.moveToPosition(0)) {
-                        sRet = ((myCursor.getLong(myCursor.getColumnIndex("isdir")) == 1) ? "TRUE" : "FALSE");
-                    }
-                }
-                myCursor.close();
-            }
-        } else {
-            File tmpFile = new java.io.File(tmpDir);
-
-            if (tmpFile.exists()) {
-                sRet = (tmpFile.isDirectory() ? "TRUE" : "FALSE");
-            }
-            else {
-                try {
-                    pProc = Runtime.getRuntime().exec(this.getSuArgs("ls -l " + sDir));
-                    RedirOutputThread outThrd = new RedirOutputThread(pProc, null);
-                    outThrd.start();
-                    outThrd.joinAndStopRedirect(5000);
-                    sRet = outThrd.strOutput;
-                    if (!sRet.contains("No such file or directory") && sRet.startsWith("l"))
-                        sRet = "FALSE";
-                }
-                catch (IOException e) {
-                    sRet = e.getMessage();
-                    e.printStackTrace();
-                }
-                catch (InterruptedException e) {
-                    e.printStackTrace();
-                }
-            }
-        }
-
-        return(sRet);
-        }
-
-
-    public String changeDir(String newDir)
-        {
-        String    tmpDir    = fixFileName(newDir);
-        String    sRet = sErrorPrefix + "Couldn't change directory to " + tmpDir;
-        int    nFiles = 0;
-
-        if (tmpDir.contains("org.mozilla.fennec") || tmpDir.contains("org.mozilla.firefox")) {
-            ContentResolver cr = contextWrapper.getContentResolver();
-            Uri ffxFiles = Uri.parse("content://" + (tmpDir.contains("fennec") ? fenProvider : ffxProvider) + "/dir");
-
-            String[] columns = new String[] {
-                    "_id",
-                    "isdir",
-                    "filename"
-                };
-
-            Cursor myCursor = cr.query(    ffxFiles,
-                                        columns,     // Which columns to return
-                                        tmpDir,     // Which rows to return (all rows)
-                                        null,       // Selection arguments (none)
-                                        null);        // Order clause (none)
-            if (myCursor != null) {
-                nFiles = myCursor.getCount();
-
-                if (nFiles > 0) {
-                    if  (myCursor.moveToPosition(0)) {
-                        if (myCursor.getLong(myCursor.getColumnIndex("isdir")) == 1) {
-                            currentDir = myCursor.getString(myCursor.getColumnIndex("filename"));
-                            sRet = "";
-                        }
-                    }
-                } else {
-                    sRet = sErrorPrefix + tmpDir + " is not a valid directory";
-                }
-                myCursor.close();
-            }
-        } else {
-            File tmpFile = new java.io.File(tmpDir);
-
-            if (tmpFile.exists()) {
-                try {
-                    if (tmpFile.isDirectory()) {
-                        currentDir = tmpFile.getCanonicalPath();
-                        sRet = "";
-                    }
-                else
-                    sRet = sErrorPrefix + tmpDir + " is not a valid directory";
-                } catch (IOException e) {
-                    e.printStackTrace();
-                }
-            }
-        }
-
-        return(sRet);
-        }
-
-    static final String HEXES = "0123456789abcdef";
-
-    public static String getHex( byte [] raw )
-        {
-        if ( raw == null )
-            {
-            return null;
-            }
-
-        final StringBuilder hex = new StringBuilder( 2 * raw.length );
-        for ( final byte b : raw )
-            {
-            hex.append(HEXES.charAt((b & 0xF0) >> 4)).append(HEXES.charAt((b & 0x0F)));
-            }
-        return hex.toString();
-        }
-
-    public String HashFile(String fileName)
-        {
-        String            sTmpFileName = fixFileName(fileName);
-        String            sRet         = sErrorPrefix + "Couldn't calculate hash for file " + sTmpFileName;
-        byte[]             buffer         = new byte [4096];
-        int                nRead         = 0;
-        long             lTotalRead     = 0;
-        MessageDigest    digest         = null;
-
-        try {
-            digest = java.security.MessageDigest.getInstance("MD5");
-            }
-        catch (NoSuchAlgorithmException e)
-            {
-            e.printStackTrace();
-            }
-
-        if (sTmpFileName.contains("org.mozilla.fennec") || sTmpFileName.contains("org.mozilla.firefox")) {
-            ContentResolver cr = contextWrapper.getContentResolver();
-            Uri ffxFiles = null;
-
-            ffxFiles = Uri.parse("content://" + (sTmpFileName.contains("fennec") ? fenProvider : ffxProvider) + "/file");
-
-            String[] columns = new String[] {
-                    "_id",
-                    "chunk"
-                    };
-
-            Cursor myCursor = cr.query(    ffxFiles,
-                                        columns,         // Which columns to return
-                                        sTmpFileName,   // Which rows to return (all rows)
-                                        null,           // Selection arguments (none)
-                                        null);            // Order clause (none)
-            if (myCursor != null) {
-                int nRows = myCursor.getCount();
-                int nBytesRecvd = 0;
-
-                for (int lcv = 0; lcv < nRows; lcv++) {
-                    if  (myCursor.moveToPosition(lcv)) {
-                        byte [] buf = myCursor.getBlob(1);
-                        if (buf != null) {
-                            nBytesRecvd += buf.length;
-                            digest.update(buf, 0, buf.length);
-                            lTotalRead += nRead;
-                            buf = null;
-                        }
-                    }
-                }
-                myCursor.close();
-                byte [] hash = digest.digest();
-
-                sRet = getHex(hash);
-            }
-        } else {
-            try {
-                FileInputStream srcFile  = new FileInputStream(sTmpFileName);
-                while((nRead = srcFile.read(buffer)) != -1) {
-                    digest.update(buffer, 0, nRead);
-                    lTotalRead += nRead;
-                }
-                srcFile.close();
-                byte [] hash = digest.digest();
-
-                sRet = getHex(hash);
-            }
-            catch (FileNotFoundException e) {
-                sRet += " file not found";
-            }
-            catch (IOException e) {
-                sRet += " io exception";
-                e.printStackTrace();
-            }
-        }
-        return(sRet);
-    }
-
-    public String RemoveFile(String fileName)
-        {
-        String    sTmpFileName = fixFileName(fileName);
-        String    sRet = sErrorPrefix + "Couldn't delete file " + sTmpFileName;
-
-        if (sTmpFileName.contains("org.mozilla.fennec") || sTmpFileName.contains("org.mozilla.firefox")) {
-            ContentResolver cr = contextWrapper.getContentResolver();
-            Uri ffxFiles = Uri.parse("content://" + (sTmpFileName.contains("fennec") ? fenProvider : ffxProvider) + "/file");
-            if (cr.delete(ffxFiles, sTmpFileName, null) == 1) {
-                sRet = "deleted " + sTmpFileName;
-            }
-        } else {
-            File f = new File(sTmpFileName);
-
-            if (f.delete())
-                sRet = "deleted " + sTmpFileName;
-        }
-
-        return(sRet);
-        }
-
-    public String PruneDir(String sDir)
-        {
-        String    sRet = "";
-        int nFiles = 0;
-        String sSubDir = null;
-        String    sTmpDir = fixFileName(sDir);
-
-        if (sTmpDir.contains("org.mozilla.fennec") || sTmpDir.contains("org.mozilla.firefox")) {
-            ContentResolver cr = contextWrapper.getContentResolver();
-            Uri ffxFiles = Uri.parse("content://" + (sTmpDir.contains("fennec") ? fenProvider : ffxProvider) + "/dir");
-            if (cr.delete(ffxFiles, sTmpDir, null) > 0) {
-                sRet = "deleted " + sTmpDir;
-            }
-        } else {
-            File dir = new File(sTmpDir);
-
-            if (dir.isDirectory()) {
-                sRet = "Deleting file(s) from " + sTmpDir;
-
-                File [] files = dir.listFiles();
-                if (files != null) {
-                    if ((nFiles = files.length) > 0) {
-                        for (int lcv = 0; lcv < nFiles; lcv++) {
-                            if (files[lcv].isDirectory()) {
-                                sSubDir = files[lcv].getAbsolutePath();
-                                sRet += "\n" + PruneDir(sSubDir);
-                            }
-                            else {
-                                if (files[lcv].delete()) {
-                                sRet += "\n\tDeleted " + files[lcv].getName();
-                                }
-                                else {
-                                    sRet += "\n\tUnable to delete " + files[lcv].getName();
-                                }
-                            }
-                        }
-                    }
-                    else
-                        sRet += "\n\t<empty>";
-                }
-
-                if (dir.delete()) {
-                    sRet += "\nDeleting directory " + sTmpDir;
-                }
-                else {
-                    sRet += "\nUnable to delete directory " + sTmpDir;
-                }
-            }
-            else {
-                sRet += sErrorPrefix + sTmpDir + " is not a directory";
-            }
-        }
-
-        return(sRet);
-        }
-
-    public String PrintDir(String sDir)
-        {
-        String    sRet = "";
-        int nFiles = 0;
-        String    sTmpDir = fixFileName(sDir);
-
-        if (sTmpDir.contains("org.mozilla.fennec") || sTmpDir.contains("org.mozilla.firefox")) {
-            ContentResolver cr = contextWrapper.getContentResolver();
-            Uri ffxFiles = null;
-
-            ffxFiles = Uri.parse("content://" + (sTmpDir.contains("fennec") ? fenProvider : ffxProvider) + "/dir");
-
-            String[] columns = new String[] {
-                    "_id",
-                    "isdir",
-                    "filename",
-                    "length"
-                };
-
-            Cursor myCursor = cr.query(    ffxFiles,
-                                        columns,     // Which columns to return
-                                        sTmpDir,    // Which rows to return (all rows)
-                                        null,       // Selection arguments (none)
-                                        null);        // Order clause (none)
-            if (myCursor != null) {
-                nFiles = myCursor.getCount();
-
-                // If only one entry and the index is -1 this is not a directory
-                int nNdx = myCursor.getColumnIndex("_id");
-                // If no entries the dir is empty
-                if (nFiles == 1) {
-                    sRet = "<empty>";
-                } else {
-                    // Show the entries
-                    for (int lcv = 1; lcv < nFiles; lcv++) {
-                        if  (myCursor.moveToPosition(lcv)) {
-                            if ((lcv == 0) && (myCursor.getLong(nNdx) == -1)) {
-                                sRet = sErrorPrefix + sTmpDir + " is not a directory";
-                            } else {
-                                sRet += myCursor.getString(2);
-                                if (lcv < (nFiles - 1))
-                                    sRet += "\n";
-                            }
-                        }
-                    }
-                }
-                myCursor.close();
-            }
-        } else {
-            File dir = new File(sTmpDir);
-
-            if (dir.isDirectory()) {
-                File [] files = dir.listFiles();
-
-                if (files != null) {
-                    if ((nFiles = files.length) > 0) {
-                        for (int lcv = 0; lcv < nFiles; lcv++) {
-                            sRet += files[lcv].getName();
-                            if (lcv < (nFiles - 1)) {
-                                sRet += "\n";
-                            }
-                        }
-                    }
-                    else {
-                        sRet = "<empty>";
-                    }
-                }
-            }
-            else {
-                sRet = sErrorPrefix + sTmpDir + " is not a directory";
-            }
-        }
-        return(sRet);
-    }
-
-    public String Move(String sTmpSrcFileName, String sTmpDstFileName) {
-        String sRet = sErrorPrefix + "Could not move " + sTmpSrcFileName + " to " + sTmpDstFileName;
-        String sTmp = CopyFile(sTmpSrcFileName, sTmpDstFileName);
-        if (sTmp.contains(" copied to ")) {
-            sTmp = RemoveFile(sTmpSrcFileName);
-            if (sTmp.startsWith("deleted ")) {
-                sRet = sTmpSrcFileName + " moved to " + sTmpDstFileName;
-            }
-        }
-
-        return(sRet);
-    }
-
-    public String CopyFile(String sTmpSrcFileName, String sTmpDstFileName) {
-        String sRet = sErrorPrefix + "Could not copy " + sTmpSrcFileName + " to " + sTmpDstFileName;
-        ContentValues cv = null;
-        File destFile = null;
-        Uri ffxSrcFiles = null;
-        Uri ffxDstFiles = null;
-        FileInputStream srcFile  = null;
-        FileOutputStream dstFile  = null;
-        byte[] buffer = new byte [4096];
-        int    nRead = 0;
-        long lTotalRead = 0;
-        long lTotalWritten = 0;
-        ContentResolver crIn = null;
-        ContentResolver crOut = null;
-
-        if (sTmpSrcFileName.contains("org.mozilla.fennec") || sTmpSrcFileName.contains("org.mozilla.firefox")) {
-            ffxSrcFiles = Uri.parse("content://" + (sTmpSrcFileName.contains("fennec") ? fenProvider : ffxProvider) + "/file");
-            crIn = contextWrapper.getContentResolver();
-        } else {
-            try {
-                srcFile  = new FileInputStream(sTmpSrcFileName);
-            } catch (FileNotFoundException e) {
-                e.printStackTrace();
-            }
-        }
-
-        if (sTmpDstFileName.contains("org.mozilla.fennec") || sTmpDstFileName.contains("org.mozilla.firefox")) {
-            ffxDstFiles = Uri.parse("content://" + (sTmpDstFileName.contains("fennec") ? fenProvider : ffxProvider) + "/file");
-            crOut = contextWrapper.getContentResolver();
-            cv = new ContentValues();
-        } else {
-            try {
-                dstFile  = new FileOutputStream(sTmpDstFileName);
-            } catch (FileNotFoundException e) {
-                e.printStackTrace();
-            }
-        }
-
-        if (srcFile != null) {
-            try {
-                while((nRead = srcFile.read(buffer)) != -1)    {
-                    lTotalRead += nRead;
-                    if (dstFile != null) {
-                        dstFile.write(buffer, 0, nRead);
-                        dstFile.flush();
-                    } else {
-                        cv.put("length", nRead);
-                        cv.put("chunk", buffer);
-                        if (crOut.update(ffxDstFiles, cv, sTmpDstFileName, null) == 0)
-                            break;
-                        lTotalWritten += nRead;
-                    }
-                }
-
-                srcFile.close();
-
-                if (dstFile != null) {
-                    dstFile.flush();
-                    dstFile.close();
-
-                    destFile = new File(sTmpDstFileName);
-                    lTotalWritten = destFile.length();
-                }
-
-                if (lTotalWritten == lTotalRead) {
-                    sRet = sTmpSrcFileName + " copied to " + sTmpDstFileName;
-                }
-                else {
-                    sRet = sErrorPrefix + "Failed to copy " + sTmpSrcFileName + " [length = " + lTotalWritten + "] to " + sTmpDstFileName + " [length = " + lTotalRead + "]";
-                }
-            } catch (IOException e) {
-                e.printStackTrace();
-            }
-
-        } else {
-            String[] columns = new String[] {
-                    "_id",
-                    "chunk",
-                    "length"
-                    };
-
-            Cursor myCursor = crIn.query(ffxSrcFiles,
-                                        columns,             // Which columns to return
-                                        sTmpSrcFileName,       // Which rows to return (all rows)
-                                        null,               // Selection arguments (none)
-                                        null);                // Order clause (none)
-            if (myCursor != null) {
-                int nRows = myCursor.getCount();
-
-                byte [] buf = null;
-
-                for (int lcv = 0; lcv < nRows; lcv++) {
-                    if  (myCursor.moveToPosition(lcv)) {
-                        buf = myCursor.getBlob(myCursor.getColumnIndex("chunk"));
-                        if (buf != null) {
-                            nRead = buf.length;
-                            try {
-                                lTotalRead += nRead;
-                                if (dstFile != null) {
-                                    dstFile.write(buffer, 0, nRead);
-                                    dstFile.flush();
-                                } else {
-                                    cv.put("length", nRead);
-                                    cv.put("chunk", buffer);
-                                    if (crOut.update(ffxDstFiles, cv, sTmpDstFileName, null) == 0)
-                                        break;
-                                    lTotalWritten += nRead;
-                                }
-                            } catch (IOException e) {
-                                e.printStackTrace();
-                            }
-                            buf = null;
-                        }
-                    }
-                }
-
-                if (nRows == -1) {
-                    sRet = sErrorPrefix + sTmpSrcFileName + ",-1\nNo such file or directory";
-                }
-                else {
-                    myCursor.close();
-
-                    if (dstFile != null) {
-                        try {
-                            dstFile.flush();
-                            dstFile.close();
-
-                            destFile = new File(sTmpDstFileName);
-                            lTotalWritten = destFile.length();
-                        } catch (IOException e) {
-                            e.printStackTrace();
-                        }
-                    }
-
-                    if (lTotalWritten == lTotalRead) {
-                        sRet = sTmpSrcFileName + " copied to " + sTmpDstFileName;
-                    }
-                    else {
-                        sRet = sErrorPrefix + "Failed to copy " + sTmpSrcFileName + " [length = " + lTotalWritten + "] to " + sTmpDstFileName + " [length = " + lTotalRead + "]";
-                    }
-                }
-            }
-            else {
-                sRet = sErrorPrefix + sTmpSrcFileName + ",-1\nUnable to access file (internal error)";
-            }
-        }
-
-        return (sRet);
-    }
-
-    public String IsDirWritable(String sDir)
-        {
-        String    sTmpDir = fixFileName(sDir);
-        String sRet = sErrorPrefix + "[" + sTmpDir + "] is not a directory";
-
-        if (sTmpDir.contains("org.mozilla.fennec") || sTmpDir.contains("org.mozilla.firefox")) {
-            ContentResolver cr = contextWrapper.getContentResolver();
-            Uri ffxFiles = null;
-
-            ffxFiles = Uri.parse("content://" + (sTmpDir.contains("fennec") ? fenProvider : ffxProvider) + "/dir");
-
-            String[] columns = new String[] {
-                    "_id",
-                    "isdir",
-                    "filename",
-                    "length",
-                    "writable"
-                };
-
-            Cursor myCursor = cr.query(    ffxFiles,
-                                        columns,     // Which columns to return
-                                        sTmpDir,    // Which rows to return (all rows)
-                                        null,       // Selection arguments (none)
-                                        null);        // Order clause (none)
-            if (myCursor != null) {
-                if (myCursor.getCount() > 0) {
-                    if (myCursor.moveToPosition(0)) {
-                        if (myCursor.getLong(myCursor.getColumnIndex("isdir")) == 1) {
-                            sRet = "[" + sTmpDir + "] " + ((myCursor.getLong(myCursor.getColumnIndex("writable")) == 1) ? "is" : "is not") + " writable";
-                        }
-                    }
-                }
-            }
-        } else {
-            File dir = new File(sTmpDir);
-
-            if (dir.isDirectory()) {
-                sRet = "[" + sTmpDir + "] " + (dir.canWrite() ? "is" : "is not") + " writable";
-            } else {
-                sRet = sErrorPrefix + "[" + sTmpDir + "] is not a directory";
-            }
-        }
-        return(sRet);
-    }
-
-    public String Push(String fileName, BufferedInputStream bufIn, long lSize)
-    {
-        byte []                buffer             = new byte [8192];
-        int                    nRead            = 0;
-        long                lRead            = 0;
-        String                sTmpFileName     = fixFileName(fileName);
-        FileOutputStream     dstFile            = null;
-        ContentResolver     cr                 = null;
-        ContentValues        cv                = null;
-        Uri                 ffxFiles         = null;
-        String                sRet            = sErrorPrefix + "Push failed!";
-
-        try {
-            if (sTmpFileName.contains("org.mozilla.fennec") || sTmpFileName.contains("org.mozilla.firefox")) {
-                cr = contextWrapper.getContentResolver();
-                ffxFiles = Uri.parse("content://" + (sTmpFileName.contains("fennec") ? fenProvider : ffxProvider) + "/file");
-                cv = new ContentValues();
-            }
-            else {
-                dstFile = new FileOutputStream(sTmpFileName, false);
-            }
-
-            while((nRead != -1) && (lRead < lSize))
-                {
-                nRead = bufIn.read(buffer);
-                if (nRead != -1) {
-                    if (dstFile != null) {
-                        dstFile.write(buffer, 0, nRead);
-                        dstFile.flush();
-                    }
-                    else {
-                        cv.put("offset", lRead);
-                        cv.put("length", nRead);
-                        cv.put("chunk", buffer);
-                        cr.update(ffxFiles, cv, sTmpFileName, null);
-                    }
-                    lRead += nRead;
-                }
-            }
-
-            if (dstFile != null) {
-                dstFile.flush();
-                dstFile.close();
-            }
-
-            if (lRead == lSize)    {
-                sRet = HashFile(sTmpFileName);
-            }
-        }
-        catch (IOException e) {
-            e.printStackTrace();
-        }
-
-        buffer = null;
-
-        return(sRet);
-    }
-
-    public String FTPGetFile(String sServer, String sSrcFileName, String sDstFileName, OutputStream out)
-        {
-        byte[] buffer = new byte [4096];
-        int    nRead = 0;
-        long lTotalRead = 0;
-        String sRet = sErrorPrefix + "FTP Get failed for " + sSrcFileName;
-        String strRet = "";
-        int    reply = 0;
-        FileOutputStream outStream = null;
-        String    sTmpDstFileName = fixFileName(sDstFileName);
-
-        FTPClient ftp = new FTPClient();
-        try
-            {
-            ftp.connect(sServer);
-            reply = ftp.getReplyCode();
-            if(FTPReply.isPositiveCompletion(reply))
-                {
-                ftp.login("anonymous", "b@t.com");
-                reply = ftp.getReplyCode();
-                if(FTPReply.isPositiveCompletion(reply))
-                    {
-                    ftp.enterLocalPassiveMode();
-                    if (ftp.setFileType(FTP.BINARY_FILE_TYPE))
-                        {
-                        File dstFile = new File(sTmpDstFileName);
-                        outStream = new FileOutputStream(dstFile);
-                        FTPFile [] ftpFiles = ftp.listFiles(sSrcFileName);
-                        if (ftpFiles.length > 0)
-                            {
-                            long lFtpSize = ftpFiles[0].getSize();
-                            if (lFtpSize <= 0)
-                                lFtpSize = 1;
-
-                            InputStream ftpIn = ftp.retrieveFileStream(sSrcFileName);
-                            while ((nRead = ftpIn.read(buffer)) != -1)
-                                {
-                                lTotalRead += nRead;
-                                outStream.write(buffer, 0, nRead);
-                                strRet = "\r" + lTotalRead + " of " + lFtpSize + " bytes received " + ((lTotalRead * 100) / lFtpSize) + "% completed";
-                                out.write(strRet.getBytes());
-                                out.flush();
-                                }
-                            ftpIn.close();
-                            @SuppressWarnings("unused")
-                            boolean bRet = ftp.completePendingCommand();
-                            outStream.flush();
-                            outStream.close();
-                            strRet = ftp.getReplyString();
-                            reply = ftp.getReplyCode();
-                            }
-                        else
-                            {
-                            strRet = sRet;
-                            }
-                        }
-                    ftp.logout();
-                    ftp.disconnect();
-                    sRet = "\n" + strRet;
-                    }
-                else
-                    {
-                    ftp.disconnect();
-                    System.err.println("FTP server refused login.");
-                    }
-                }
-            else
-                {
-                ftp.disconnect();
-                System.err.println("FTP server refused connection.");
-                }
-            }
-        catch (SocketException e)
-            {
-            sRet = e.getMessage();
-            strRet = ftp.getReplyString();
-            reply = ftp.getReplyCode();
-            sRet += "\n" + strRet;
-            e.printStackTrace();
-            }
-        catch (IOException e)
-            {
-            sRet = e.getMessage();
-            strRet = ftp.getReplyString();
-            reply = ftp.getReplyCode();
-            sRet += "\n" + strRet;
-            e.printStackTrace();
-            }
-        return (sRet);
-    }
-
-    public String Pull(String fileName, long lOffset, long lLength, OutputStream out)
-        {
-        String    sTmpFileName = fixFileName(fileName);
-        String    sRet = sErrorPrefix + "Could not read the file " + sTmpFileName;
-        byte[]    buffer = new byte [4096];
-        int        nRead = 0;
-        long    lSent = 0;
-
-        if (sTmpFileName.contains("org.mozilla.fennec") || sTmpFileName.contains("org.mozilla.firefox")) {
-            ContentResolver cr = contextWrapper.getContentResolver();
-            Uri ffxFiles = null;
-
-            ffxFiles = Uri.parse("content://" + (sTmpFileName.contains("fennec") ? fenProvider : ffxProvider) + "/file");
-
-            String[] columns = new String[] {
-                    "_id",
-                    "chunk",
-                    "length"
-                    };
-
-            String [] args = new String [2];
-            args[0] = Long.toString(lOffset);
-            args[1] = Long.toString(lLength);
-
-            Cursor myCursor = cr.query(    ffxFiles,
-                                        columns,         // Which columns to return
-                                        sTmpFileName,   // Which rows to return (all rows)
-                                        args,           // Selection arguments (none)
-                                        null);            // Order clause (none)
-            if (myCursor != null) {
-                int nRows = myCursor.getCount();
-                long lFileLength = 0;
-
-                for (int lcv = 0; lcv < nRows; lcv++) {
-                    if  (myCursor.moveToPosition(lcv)) {
-                        if (lcv == 0) {
-                            lFileLength = myCursor.getLong(2);
-                            String sTmp = sTmpFileName + "," + lFileLength + "\n";
-                            try {
-                                out.write(sTmp.getBytes());
-                            } catch (IOException e) {
-                                e.printStackTrace();
-                                break;
-                            }
-                        }
-
-                        if (lLength != 0) {
-                            byte [] buf = myCursor.getBlob(1);
-                            if (buf != null) {
-                                nRead = buf.length;
-                                try {
-                                    if ((lSent + nRead) <= lFileLength)    {
-                                        out.write(buf,0,nRead);
-                                        lSent += nRead;
-                                    }
-                                    else {
-                                        nRead = (int) (lFileLength - lSent);
-                                        out.write(buf,0,nRead);
-                                        Log.d("pull warning", "more bytes read than expected");
-                                        break;
-                                    }
-                                } catch (IOException e) {
-                                    e.printStackTrace();
-                                    sRet = sErrorPrefix + "Could not write to out " + sTmpFileName;
-                                }
-                                buf = null;
-                            }
-                        }
-                    }
-                }
-                if (nRows == 0) {
-                    String sTmp = sTmpFileName + "," + lFileLength + "\n";
-                    try {
-                        out.write(sTmp.getBytes());
-                    } catch (IOException e) {
-                        e.printStackTrace();
-                    }
-                }
-                if (nRows == -1) {
-                    sRet = sErrorPrefix + sTmpFileName + ",-1\nNo such file or directory";
-                }
-                else {
-                    myCursor.close();
-                    sRet = "";
-                }
-            }
-            else {
-                sRet = sErrorPrefix + sTmpFileName + ",-1\nUnable to access file (internal error)";
-            }
-        }
-        else {
-            try {
-                File f = new File(sTmpFileName);
-                long lFileLength = f.length();
-                FileInputStream fin = new FileInputStream(f);
-                if (lFileLength == 0) {
-                    while ((nRead = fin.read(buffer)) != -1) {
-                        lFileLength += nRead;
-                    }
-                    fin.close();
-                    fin = new FileInputStream(f);
-                }
-
-                // lLength == -1 return everything between lOffset and eof
-                // lLength == 0 return file length
-                // lLength > 0 return lLength bytes
-                if (lLength == -1) {
-                    lFileLength = lFileLength - lOffset;
-                } else if (lLength == 0) {
-                    // just return the file length
-                } else {
-                    lFileLength = ((lLength <= (lFileLength - lOffset)) ? lLength : (lFileLength - lOffset));
-                }
-
-                String sTmp = sTmpFileName + "," + lFileLength + "\n";
-                out.write(sTmp.getBytes());
-                if (lLength != 0) {
-                    if  (lOffset > 0) {
-                        fin.skip(lOffset);
-                    }
-                    while ((nRead = fin.read(buffer)) != -1) {
-                        if ((lSent + nRead) <= lFileLength)    {
-                            out.write(buffer,0,nRead);
-                            lSent += nRead;
-                        }
-                        else {
-                            nRead = (int) (lFileLength - lSent);
-                            out.write(buffer,0,nRead);
-                            if (lLength != -1)
-                                Log.d("pull warning", "more bytes read than sent");
-                            break;
-                        }
-                    }
-                }
-                fin.close();
-                out.flush();
-                sRet = "";
-                }
-            catch (FileNotFoundException e)    {
-                sRet = sErrorPrefix + sTmpFileName + ",-1\nNo such file or directory";
-            }
-            catch (IOException e) {
-                sRet = e.toString();
-            }
-        }
-        return (sRet);
-    }
-
-    public String Cat(String fileName, OutputStream out)
-        {
-        String    sTmpFileName = fixFileName(fileName);
-        String    sRet = sErrorPrefix + "Could not read the file " + sTmpFileName;
-        byte[]    buffer = new byte [4096];
-        int        nRead = 0;
-
-        if (sTmpFileName.contains("org.mozilla.fennec") || sTmpFileName.contains("org.mozilla.firefox")) {
-            ContentResolver cr = contextWrapper.getContentResolver();
-            Uri ffxFiles = null;
-
-            ffxFiles = Uri.parse("content://" + (sTmpFileName.contains("fennec") ? fenProvider : ffxProvider) + "/file");
-
-            String[] columns = new String[] {
-                    "_id",
-                    "chunk"
-                    };
-
-            Cursor myCursor = cr.query(    ffxFiles,
-                                        columns,         // Which columns to return
-                                        sTmpFileName,   // Which rows to return (all rows)
-                                        null,           // Selection arguments (none)
-                                        null);            // Order clause (none)
-            if (myCursor != null) {
-                int nRows = myCursor.getCount();
-                int nBytesRecvd = 0;
-
-                for (int lcv = 0; lcv < nRows; lcv++) {
-                    if  (myCursor.moveToPosition(lcv)) {
-                        byte [] buf = myCursor.getBlob(1);
-                        if (buf != null) {
-                            nBytesRecvd += buf.length;
-                            try {
-                                out.write(buf);
-                                sRet = "";
-                            } catch (IOException e) {
-                                e.printStackTrace();
-                                sRet = sErrorPrefix + "Could not write to out " + sTmpFileName;
-                            }
-                            buf = null;
-                        }
-                    }
-                }
-                if (nRows == 0) {
-                    sRet = "";
-                }
-
-                myCursor.close();
-            }
-        } else {
-            try {
-                FileInputStream fin = new FileInputStream(sTmpFileName);
-                while ((nRead = fin.read(buffer)) != -1) {
-                    out.write(buffer,0,nRead);
-                }
-                fin.close();
-                out.flush();
-                sRet = "";
-                }
-            catch (FileNotFoundException e) {
-                sRet = sErrorPrefix + sTmpFileName + " No such file or directory";
-            }
-            catch (IOException e) {
-                sRet = e.toString();
-            }
-        }
-        return (sRet);
-    }
-
-    public String MakeDir(String sDir)
-        {
-        String    sTmpDir = fixFileName(sDir);
-        String sRet = sErrorPrefix + "Could not create the directory " + sTmpDir;
-        if (sTmpDir.contains("org.mozilla.fennec") || sTmpDir.contains("org.mozilla.firefox")) {
-            ContentResolver cr = contextWrapper.getContentResolver();
-            Uri ffxFiles = Uri.parse("content://" + (sTmpDir.contains("fennec") ? fenProvider : ffxProvider) + "/dir");
-            ContentValues cv = new ContentValues();
-
-            if (cr.update(ffxFiles, cv, sTmpDir, null) == 1) {
-                sRet = sDir + " successfully created";
-            }
-        }
-        else {
-            File dir = new File(sTmpDir);
-
-            if (dir.mkdirs()) {
-                sRet = sDir + " successfully created";
-            }
-        }
-
-        return (sRet);
-        }
-    // move this to SUTAgentAndroid.java
-    public String GetScreenInfo()
-        {
-        String sRet = "";
-        DisplayMetrics metrics = new DisplayMetrics();
-        WindowManager wMgr = (WindowManager) contextWrapper.getSystemService(Context.WINDOW_SERVICE);
-        wMgr.getDefaultDisplay().getMetrics(metrics);
-        sRet = "X:" + metrics.widthPixels + " Y:" + metrics.heightPixels;
-        return (sRet);
-        }
-    // move this to SUTAgentAndroid.java
-    public int [] GetScreenXY()
-        {
-            int [] nRetXY = new int [2];
-            DisplayMetrics metrics = new DisplayMetrics();
-            WindowManager wMgr = (WindowManager) contextWrapper.getSystemService(Context.WINDOW_SERVICE);
-            wMgr.getDefaultDisplay().getMetrics(metrics);
-            nRetXY[0] = metrics.widthPixels;
-            nRetXY[1] = metrics.heightPixels;
-            return(nRetXY);
-        }
-
-    public String GetRotationInfo()
-        {
-            WindowManager wMgr = (WindowManager) contextWrapper.getSystemService(Context.WINDOW_SERVICE);
-            int nRotationDegrees = 0; // default
-            switch(wMgr.getDefaultDisplay().getRotation())
-                {
-                case Surface.ROTATION_90:
-                    nRotationDegrees = 90;
-                    break;
-                case Surface.ROTATION_180:
-                    nRotationDegrees = 180;
-                    break;
-                case Surface.ROTATION_270:
-                    nRotationDegrees = 270;
-                    break;
-                }
-            return "ROTATION:" + nRotationDegrees;
-        }
-
-    public String SetADB(String sWhat) {
-        String sRet = "";
-        String sTmp = "";
-        String sCmd;
-
-        if (sWhat.contains("ip")) {
-            sCmd = "setprop service.adb.tcp.port 5555";
-        } else {
-            sCmd = "setprop service.adb.tcp.port -1";
-        }
-
-        try {
-            pProc = Runtime.getRuntime().exec(this.getSuArgs(sCmd));
-            RedirOutputThread outThrd = new RedirOutputThread(pProc, null);
-            outThrd.start();
-            outThrd.joinAndStopRedirect(5000);
-            sTmp = outThrd.strOutput;
-            Log.e("ADB", sTmp);
-            if (outThrd.nExitCode == 0) {
-                pProc = Runtime.getRuntime().exec(this.getSuArgs("stop adbd"));
-                outThrd = new RedirOutputThread(pProc, null);
-                outThrd.start();
-                outThrd.joinAndStopRedirect(5000);
-                sTmp = outThrd.strOutput;
-                Log.e("ADB", sTmp);
-                if (outThrd.nExitCode == 0) {
-                    pProc = Runtime.getRuntime().exec(this.getSuArgs("start adbd"));
-                    outThrd = new RedirOutputThread(pProc, null);
-                    outThrd.start();
-                    outThrd.joinAndStopRedirect(5000);
-                    sTmp = outThrd.strOutput;
-                    Log.e("ADB", sTmp);
-                    if (outThrd.nExitCode == 0) {
-                        sRet = "Successfully set adb to " + sWhat + "\n";
-                    } else {
-                        sRet = sErrorPrefix + "Failed to start adbd\n";
-                    }
-                } else {
-                    sRet = sErrorPrefix + "Failed to stop adbd\n";
-                }
-            } else {
-                sRet = sErrorPrefix + "Failed to setprop service.adb.tcp.port 5555\n";
-            }
-
-        }
-    catch (IOException e)
-        {
-        sRet = e.getMessage();
-        e.printStackTrace();
-        }
-    catch (InterruptedException e)
-        {
-        e.printStackTrace();
-        }
-        return(sRet);
-    }
-
-    public String KillProcess(String sProcName, OutputStream out)
-        {
-        String sRet = sErrorPrefix + "Unable to kill " + sProcName + "\n";
-        ActivityManager aMgr = (ActivityManager) contextWrapper.getSystemService(Activity.ACTIVITY_SERVICE);
-        List <ActivityManager.RunningAppProcessInfo> lProcesses = aMgr.getRunningAppProcesses();
-        int lcv = 0;
-        String sFoundProcName = "";
-        int nProcs = 0;
-        boolean bFoundAppProcess = false;
-
-        if (lProcesses != null)
-            nProcs = lProcesses.size();
-
-        for (lcv = 0; lcv < nProcs; lcv++)
-            {
-            if (lProcesses.get(lcv).processName.contains(sProcName))
-                {
-                sFoundProcName = lProcesses.get(lcv).processName;
-                bFoundAppProcess = true;
-
-                try
-                    {
-                    pProc = Runtime.getRuntime().exec(this.getSuArgs("kill " + lProcesses.get(lcv).pid));
-                    RedirOutputThread outThrd = new RedirOutputThread(pProc, null);
-                    outThrd.start();
-                    outThrd.joinAndStopRedirect(15000);
-                    String sTmp = outThrd.strOutput;
-                    Log.e("KILLPROCESS", sTmp);
-                    }
-                catch (IOException e)
-                    {
-                    sRet = e.getMessage();
-                    e.printStackTrace();
-                    }
-                catch (InterruptedException e)
-                    {
-                    e.printStackTrace();
-                    }
-                }
-            }
-
-        if (bFoundAppProcess)
-            {
-            // Give the messages a chance to be processed
-            try {
-                Thread.sleep(2000);
-                }
-            catch (InterruptedException e)
-                {
-                e.printStackTrace();
-                }
-
-            sRet = "Successfully killed " + sProcName + "\n";
-            lProcesses = aMgr.getRunningAppProcesses();
-            nProcs = 0;
-            if (lProcesses != null)
-                nProcs = lProcesses.size();
-            for (lcv = 0; lcv < nProcs; lcv++)
-                {
-                if (lProcesses.get(lcv).processName.contains(sProcName))
-                    {
-                    sRet = sErrorPrefix + "Unable to kill " + sProcName + " (couldn't kill " + sFoundProcName +")\n";
-                    break;
-                    }
-                }
-            }
-        else
-            {
-            // To kill processes other than Java applications - processes
-            // like xpcshell - a different strategy is necessary: use ps
-            // to find the process' PID.
-            try
-                {
-                pProc = Runtime.getRuntime().exec("ps");
-                RedirOutputThread outThrd = new RedirOutputThread(pProc, null);
-                outThrd.start();
-                outThrd.joinAndStopRedirect(10000);
-                String sTmp = outThrd.strOutput;
-                StringTokenizer stokLines = new StringTokenizer(sTmp, "\n");
-                while(stokLines.hasMoreTokens())
-                    {
-                    String sLine = stokLines.nextToken();
-                    StringTokenizer stokColumns = new StringTokenizer(sLine, " \t\n");
-                    stokColumns.nextToken();
-                    String sPid = stokColumns.nextToken();
-                    stokColumns.nextToken();
-                    stokColumns.nextToken();
-                    stokColumns.nextToken();
-                    stokColumns.nextToken();
-                    stokColumns.nextToken();
-                    stokColumns.nextToken();
-                    String sName = null;
-                    if (stokColumns.hasMoreTokens())
-                        {
-                        sName = stokColumns.nextToken();
-                        if (sName.contains(sProcName))
-                            {
-                            NewKillProc(sPid, out);
-                            sRet = "Successfully killed " + sName + "\n";
-                            }
-                        }
-                    }
-                }
-            catch (Exception e)
-                {
-                e.printStackTrace();
-                }
-            }
-
-        return (sRet);
-        }
-
-    public boolean IsProcessDead(String sProcName)
-        {
-        boolean bRet = false;
-        ActivityManager aMgr = (ActivityManager) contextWrapper.getSystemService(Activity.ACTIVITY_SERVICE);
-        List <ActivityManager.ProcessErrorStateInfo> lProcesses = aMgr.getProcessesInErrorState();
-        int lcv = 0;
-
-        if (lProcesses != null)
-            {
-            for (lcv = 0; lcv < lProcesses.size(); lcv++)
-                {
-                if (lProcesses.get(lcv).processName.contentEquals(sProcName) &&
-                    lProcesses.get(lcv).condition != ActivityManager.ProcessErrorStateInfo.NO_ERROR)
-                    {
-                    bRet = true;
-                    break;
-                    }
-                }
-            }
-
-        return (bRet);
-        }
-
-    public String GetProcessInfo()
-        {
-        String sRet = "";
-        ActivityManager aMgr = (ActivityManager) contextWrapper.getSystemService(Activity.ACTIVITY_SERVICE);
-        List <ActivityManager.RunningAppProcessInfo> lProcesses = aMgr.getRunningAppProcesses();
-        int    nProcs = 0;
-        int lcv = 0;
-        String strProcName = "";
-        int    nPID = 0;
-        int nUser = 0;
-
-        if (lProcesses != null) 
-            nProcs = lProcesses.size();
-
-        for (lcv = 0; lcv < nProcs; lcv++)
-            {
-            strProcName = lProcesses.get(lcv).processName;
-            nPID = lProcesses.get(lcv).pid;
-            nUser = lProcesses.get(lcv).uid;
-            sRet += nUser + "\t" + nPID + "\t" + strProcName;
-            if (lcv < (nProcs - 1))
-                sRet += "\n";
-            }
-
-        return (sRet);
-        }
-
-    public String GetOSInfo()
-        {
-        String sRet = "";
-
-        sRet = Build.DISPLAY;
-
-        return (sRet);
-        }
-
-    public String GetPowerInfo()
-        {
-        String sRet = "";
-
-        sRet = "Power status:\n  AC power " + SUTAgentAndroid.sACStatus + "\n";
-        sRet += "  Battery charge " + SUTAgentAndroid.sPowerStatus + "\n";
-        sRet += "  Remaining charge:      " + SUTAgentAndroid.nChargeLevel + "%\n";
-        sRet += "  Battery Temperature:   " + (((float)(SUTAgentAndroid.nBatteryTemp))/10) + " (c)\n";
-        return (sRet);
-        }
-
-    public String GetSutUserInfo()
-        {
-        String sRet = "";
-        try {
-            // based on patch in https://bugzilla.mozilla.org/show_bug.cgi?id=811763
-            Context context = contextWrapper.getApplicationContext();
-            Object userManager = context.getSystemService("user");
-            if (userManager != null) {
-                // if userManager is non-null that means we're running on 4.2+ and so the rest of this
-                // should just work
-                Object userHandle = android.os.Process.class.getMethod("myUserHandle", (Class[])null).invoke(null);
-                Object userSerial = userManager.getClass().getMethod("getSerialNumberForUser", userHandle.getClass()).invoke(userManager, userHandle);
-                sRet += "User Serial:" + userSerial.toString();
-            }
-        } catch (Exception e) {
-            // Guard against any unexpected failures
-            e.printStackTrace();
-        }
-
-        return sRet;
-        }
-
-    public String GetTemperatureInfo()
-        {
-        String sTempVal = "unknown";
-        String sDeviceFile = "/sys/bus/platform/devices/temp_sensor_hwmon.0/temp1_input";
-        try {
-            pProc = Runtime.getRuntime().exec(this.getSuArgs("cat " + sDeviceFile));
-            RedirOutputThread outThrd = new RedirOutputThread(pProc, null);
-            outThrd.start();
-            outThrd.joinAndStopRedirect(5000);
-            String output = outThrd.strOutput;
-            // this only works on pandas (with the temperature sensors turned
-            // on), other platforms we just get a file not found error... we'll
-            // just return "unknown" for that case
-            try {
-                sTempVal = String.valueOf(Integer.parseInt(output.trim()) / 1000.0);
-            } catch (NumberFormatException e) {
-                // not parsed! probably not a panda
-            }
-        } catch (IOException e) {
-            e.printStackTrace();
-        } catch (InterruptedException e) {
-            e.printStackTrace();
-        }
-
-        return "Temperature: " + sTempVal;
-        }
-
-    public String GetDiskInfo(String sPath)
-        {
-        String sRet = "";
-        StatFs statFS = new StatFs(sPath);
-
-        long nBlockCount = statFS.getBlockCount();
-        long nBlockSize = statFS.getBlockSize();
-        long nBlocksAvail = statFS.getAvailableBlocks();
-        // Free is often the same as Available, but can include reserved
-        // blocks that are not available to normal applications.
-        // long nBlocksFree = statFS.getFreeBlocks();
-
-        sRet = sPath + ": " + (nBlockCount * nBlockSize) + " total, " + (nBlocksAvail * nBlockSize) + " available";
-
-        return (sRet);
-        }
-
-    public String GetMemoryInfo()
-        {
-        String sRet = "PA:" + GetMemoryConfig() + ", FREE: " + GetMemoryUsage();
-        return (sRet);
-        }
-
-    public long GetMemoryConfig()
-        {
-        ActivityManager aMgr = (ActivityManager) contextWrapper.getSystemService(Activity.ACTIVITY_SERVICE);
-        ActivityManager.MemoryInfo outInfo = new ActivityManager.MemoryInfo();
-        aMgr.getMemoryInfo(outInfo);
-        long lMem = outInfo.availMem;
-
-        return (lMem);
-        }
-
-    public long GetMemoryUsage()
-        {
-
-        String load = "";
-        try {
-            RandomAccessFile reader = new RandomAccessFile("/proc/meminfo", "r");
-            load = reader.readLine(); // Read in the MemTotal
-            load = reader.readLine(); // Read in the MemFree
-        } catch (IOException ex) {
-            return (0);
-        }
-
-        String[] toks = load.split(" ");
-        int i = 1;
-        for (i=1; i < toks.length; i++) {
-            String val = toks[i].trim();
-            if (!val.equals("")) {
-                break;
-            }
-        }
-        if (i <= toks.length) {
-            long lMem = Long.parseLong(toks[i].trim());
-            return (lMem * 1024);
-        }
-        return (0);
-        }
-
-    public String UpdateCallBack(String sFileName)
-        {
-        String sRet = sErrorPrefix + "No file specified";
-        String sIP = "";
-        String sPort = "";
-        int nEnd = 0;
-        int nStart = 0;
-        FileInputStream fis = null;
-
-        if ((sFileName == null) || (sFileName.length() == 0))
-            return(sRet);
-
-        Context ctx = contextWrapper.getApplicationContext();
-        try {
-            fis = ctx.openFileInput(sFileName);
-            int nBytes = fis.available();
-            if (nBytes > 0)
-                {
-                byte [] buffer = new byte [nBytes + 1];
-                int nRead = fis.read(buffer, 0, nBytes);
-                ctx.deleteFile(sFileName);
-                if (nRead > 0)
-                    {
-                    String sBuffer = new String(buffer);
-                    nEnd = sBuffer.indexOf(',');
-                    if (nEnd > 0)
-                        {
-                        sIP = (sBuffer.substring(0, nEnd)).trim();
-                        nStart = nEnd + 1;
-                        nEnd = sBuffer.indexOf('\r', nStart);
-                        if (nEnd > 0)
-                            {
-                            sPort = (sBuffer.substring(nStart, nEnd)).trim();
-                            Thread.sleep(5000);
-                            sRet = RegisterTheDevice(sIP, sPort, sBuffer.substring(nEnd + 1));
-                            }
-                        }
-                    }
-                }
-            }
-        catch (FileNotFoundException e)
-            {
-            sRet = sErrorPrefix + "Nothing to do";
-            }
-        catch (IOException e)
-            {
-            sRet = sErrorPrefix + "Couldn't send info to " + sIP + ":" + sPort;
-            }
-        catch (InterruptedException e)
-            {
-            e.printStackTrace();
-            }
-        finally
-            {
-            if (fis != null)
-                {
-                try {
-                    fis.close();
-                    }
-                catch(IOException e)
-                    {
-                    e.printStackTrace();
-                    }
-                }
-            }
-        return(sRet);
-        }
-
-    public String RegisterTheDevice(String sSrvr, String sPort, String sData)
-        {
-        String sRet = "";
-        String line = "";
-
-//        Debug.waitForDebugger();
-
-        if (sSrvr != null && sPort != null && sData != null)
-            {
-            try
-                {
-                int nPort = Integer.parseInt(sPort);
-                Socket socket = new Socket(sSrvr, nPort);
-                PrintWriter out = new PrintWriter(socket.getOutputStream(), false);
-                BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
-                out.println(sData);
-                if ( out.checkError() == false )
-                    {
-                    socket.setSoTimeout(30000);
-                    while (socket.isInputShutdown() == false)
-                        {
-                        line = in.readLine();
-
-                        if (line != null)
-                            {
-                            line = line.toLowerCase();
-                            sRet += line;
-                            // ok means we're done
-                            if (line.contains("ok"))
-                                break;
-                            }
-                        else
-                            {
-                            // end of stream reached
-                            break;
-                            }
-                        }
-                    }
-                out.close();
-                in.close();
-                socket.close();
-                }
-            catch(NumberFormatException e)
-                {
-                sRet += "reg NumberFormatException thrown [" + e.getLocalizedMessage() + "]";
-                e.printStackTrace();
-                }
-            catch (UnknownHostException e)
-                {
-                sRet += "reg UnknownHostException thrown [" + e.getLocalizedMessage() + "]";
-                e.printStackTrace();
-                }
-            catch (IOException e)
-                {
-                sRet += "reg IOException thrown [" + e.getLocalizedMessage() + "]";
-                e.printStackTrace();
-                }
-            }
-        return(sRet);
-        }
-
-    public String GetTimeZone()
-        {
-        String    sRet = "";
-        TimeZone tz;
-
-        tz = TimeZone.getDefault();
-        Date now = new Date();
-        sRet = tz.getDisplayName(tz.inDaylightTime(now), TimeZone.LONG);
-
-        return(sRet);
-        }
-
-    public String SetTimeZone(String sTimeZone)
-        {
-        String            sRet = "Unable to set timezone to " + sTimeZone;
-        TimeZone         tz = null;
-        AlarmManager     amgr = null;
-
-        if ((sTimeZone.length() > 0) && (sTimeZone.startsWith("GMT")))
-            {
-            amgr = (AlarmManager) contextWrapper.getSystemService(Context.ALARM_SERVICE);
-            if (amgr != null)
-                amgr.setTimeZone(sTimeZone);
-            }
-        else
-            {
-            String [] zoneNames = TimeZone.getAvailableIDs();
-            int nNumMatches = zoneNames.length;
-            int    lcv = 0;
-
-            for (lcv = 0; lcv < nNumMatches; lcv++)
-                {
-                if (zoneNames[lcv].equalsIgnoreCase(sTimeZone))
-                    break;
-                }
-
-            if (lcv < nNumMatches)
-                {
-                amgr = (AlarmManager) contextWrapper.getSystemService(Context.ALARM_SERVICE);
-                if (amgr != null)
-                    amgr.setTimeZone(zoneNames[lcv]);
-                }
-            }
-
-        if (amgr != null)
-            {
-            tz = TimeZone.getDefault();
-            Date now = new Date();
-            sRet = tz.getDisplayName(tz.inDaylightTime(now), TimeZone.LONG);
-            }
-
-        return(sRet);
-        }
-
-    public String GetSystemTime()
-        {
-        String sRet = "";
-        Calendar cal = Calendar.getInstance();
-        SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd hh:mm:ss:SSS");
-        sRet = sdf.format(cal.getTime());
-
-        return (sRet);
-        }
-
-    public String SetSystemTime(String sDate, String sTime, OutputStream out) {
-        String sRet = "";
-        String sM = "";
-        String sMillis = "";
-
-        if (((sDate != null) && (sTime != null)) &&
-            (sDate.contains("/") || sDate.contains(".")) &&
-            (sTime.contains(":"))) {
-            int year = Integer.parseInt(sDate.substring(0,4));
-            int month = Integer.parseInt(sDate.substring(5,7));
-            int day = Integer.parseInt(sDate.substring(8,10));
-
-            int hour = Integer.parseInt(sTime.substring(0,2));
-            int mins = Integer.parseInt(sTime.substring(3,5));
-            int secs = Integer.parseInt(sTime.substring(6,8));
-
-            Calendar cal = new GregorianCalendar(TimeZone.getDefault());
-            cal.set(year, month - 1, day, hour, mins, secs);
-            long lMillisecs = cal.getTime().getTime();
-
-            sM = Long.toString(lMillisecs);
-            sMillis = sM.substring(0, sM.length() - 3) + "." + sM.substring(sM.length() - 3);
-
-        } else {
-            sRet += "Invalid argument(s)";
-        }
-
-        // if we have an argument
-        if (sMillis.length() > 0) {
-            try {
-                pProc = Runtime.getRuntime().exec(this.getSuArgs("date -u " + sMillis));
-                RedirOutputThread outThrd = new RedirOutputThread(pProc, null);
-                outThrd.start();
-                outThrd.joinAndStopRedirect(10000);
-                sRet += GetSystemTime();
-            } catch (IOException e) {
-                sRet = e.getMessage();
-                e.printStackTrace();
-            } catch (InterruptedException e) {
-                e.printStackTrace();
-            }
-        }
-
-        return (sRet);
-    }
-
-    public String GetClok()
-        {
-        long lMillisecs = System.currentTimeMillis();
-        String sRet = "";
-
-        if (lMillisecs > 0)
-            sRet = Long.toString(lMillisecs);
-
-        return(sRet);
-        }
-
-    public String GetUptime()
-        {
-        String sRet = "";
-        long lHold = 0;
-        long lUptime = SystemClock.elapsedRealtime();
-        int    nDays = 0;
-        int    nHours = 0;
-        int nMinutes = 0;
-        int nSecs = 0;
-        int nMilliseconds = 0;
-
-        if (lUptime > 0)
-            {
-            nDays = (int)(lUptime / (24L * 60L * 60L * 1000L));
-            lHold = lUptime % (24L * 60L * 60L * 1000L);
-            nHours = (int)(lHold / (60L * 60L * 1000L));
-            lHold %= 60L * 60L * 1000L;
-            nMinutes = (int)(lHold / (60L * 1000L));
-            lHold %= 60L * 1000L;
-            nSecs = (int)(lHold / 1000L);
-            nMilliseconds = (int)(lHold % 1000);
-            sRet = "" + nDays + " days " + nHours + " hours " + nMinutes + " minutes " + nSecs + " seconds " + nMilliseconds + " ms";
-            }
-
-        return (sRet);
-        }
-
-    public String GetUptimeMillis()
-        {
-        return Long.toString(SystemClock.uptimeMillis());
-        }
- 
-    public String GetSutUptimeMillis()
-        {
-        long now = System.currentTimeMillis();
-        return "SUTagent running for "+Long.toString(now - SUTAgentAndroid.nCreateTimeMillis)+" ms";
-        }
- 
-    public String NewKillProc(String sProcId, OutputStream out)
-        {
-        String sRet = "";
-
-        try
-            {
-            pProc = Runtime.getRuntime().exec("kill "+sProcId);
-            RedirOutputThread outThrd = new RedirOutputThread(pProc, out);
-            outThrd.start();
-            outThrd.joinAndStopRedirect(5000);
-            }
-        catch (IOException e)
-            {
-            sRet = e.getMessage();
-            e.printStackTrace();
-            }
-        catch (InterruptedException e)
-            {
-            e.printStackTrace();
-            }
-
-        return(sRet);
-        }
-
-    public String SendPing(String sIPAddr, OutputStream out)
-        {
-        String sRet = "";
-        String [] theArgs = new String [4];
-
-        theArgs[0] = "ping";
-        theArgs[1] = "-c";
-        theArgs[2] = "3";
-        theArgs[3] = sIPAddr;
-
-        try
-            {
-            pProc = Runtime.getRuntime().exec(theArgs);
-            RedirOutputThread outThrd = new RedirOutputThread(pProc, out);
-            outThrd.start();
-            outThrd.joinAndStopRedirect(5000);
-            if (out == null)
-                sRet = outThrd.strOutput;
-            }
-        catch (IOException e)
-            {
-            sRet = e.getMessage();
-            e.printStackTrace();
-            }
-        catch (InterruptedException e)
-            {
-            e.printStackTrace();
-            }
-
-        return (sRet);
-        }
-
-    public String GetTmpDir()
-    {
-        String     sRet = "";
-        Context ctx = contextWrapper.getApplicationContext();
-        File dir = ctx.getFilesDir();
-        ctx = null;
-        try {
-            sRet = dir.getCanonicalPath();
-            }
-        catch (IOException e)
-            {
-            e.printStackTrace();
-            }
-        return(sRet);
-    }
-
-    public String PrintFileTimestamp(String sFile)
-        {
-        String     sRet = "";
-        String    sTmpFileName = fixFileName(sFile);
-        long    lModified = -1;
-
-        if (sTmpFileName.contains("org.mozilla.fennec") || sTmpFileName.contains("org.mozilla.firefox")) {
-            ContentResolver cr = contextWrapper.getContentResolver();
-            Uri ffxFiles = Uri.parse("content://" + (sTmpFileName.contains("fennec") ? fenProvider : ffxProvider) + "/dir");
-
-            String[] columns = new String[] {
-                    "_id",
-                    "isdir",
-                    "filename",
-                    "length",
-                    "ts"
-                };
-
-            Cursor myCursor = cr.query(    ffxFiles,
-                                        columns,         // Which columns to return
-                                        sTmpFileName,   // Which rows to return (all rows)
-                                        null,           // Selection arguments (none)
-                                        null);            // Order clause (none)
-            if (myCursor != null) {
-                if (myCursor.getCount() > 0) {
-                    if (myCursor.moveToPosition(0)) {
-                        lModified = myCursor.getLong(myCursor.getColumnIndex("ts"));
-                    }
-                }
-                myCursor.close();
-            }
-        }
-        else {
-            File theFile = new File(sTmpFileName);
-
-            if (theFile.exists()) {
-                lModified = theFile.lastModified();
-            }
-        }
-
-        if (lModified != -1) {
-            Date dtModified = new Date(lModified);
-            SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd hh:mm:ss:SSS");
-            sRet = "Last modified: " + sdf.format(dtModified);
-        }
-        else {
-            sRet = sErrorPrefix + "[" + sTmpFileName + "] doesn't exist";
-        }
-
-        return(sRet);
-        }
-
-    public String GetIniData(String sSection, String sKey, String sFile)
-        {
-        String sRet = "";
-        String sComp = "";
-        String sLine = "";
-        boolean bFound = false;
-        BufferedReader in = null;
-        String    sTmpFileName = fixFileName(sFile);
-
-        try {
-            in = new BufferedReader(new FileReader(sTmpFileName));
-            sComp = "[" + sSection + "]";
-            while ((sLine = in.readLine()) != null)
-                {
-                if (sLine.equalsIgnoreCase(sComp))
-                    {
-                    bFound = true;
-                    break;
-                    }
-                }
-
-            if (bFound)
-                {
-                sComp = (sKey + " =").toLowerCase();
-                while ((sLine = in.readLine()) != null)
-                    {
-                    if (sLine.toLowerCase().contains(sComp))
-                        {
-                        String [] temp = null;
-                        temp = sLine.split("=");
-                        if (temp != null)
-                            {
-                            if (temp.length > 1)
-                                sRet = temp[1].trim();
-                            }
-                        break;
-                        }
-                    }
-                }
-            in.close();
-            }
-        catch (FileNotFoundException e)
-            {
-            sComp = e.toString();
-            }
-        catch (IOException e)
-            {
-            sComp = e.toString();
-            }
-        return (sRet);
-        }
-
-    public String RunReboot(OutputStream out, String sCallBackIP, String sCallBackPort)
-        {
-        String sRet = "";
-        Context ctx = contextWrapper.getApplicationContext();
-
-        try {
-            if ((sCallBackIP != null) && (sCallBackPort != null) &&
-                (sCallBackIP.length() > 0) && (sCallBackPort.length() > 0))    {
-                FileOutputStream fos = ctx.openFileOutput("update.info", Context.MODE_WORLD_READABLE | Context.MODE_WORLD_WRITEABLE);
-                String sBuffer = sCallBackIP + "," + sCallBackPort + "\rSystem rebooted\r";
-                fos.write(sBuffer.getBytes());
-                fos.flush();
-                fos.close();
-                fos = null;
-            }
-        } catch (FileNotFoundException e) {
-            sRet = sErrorPrefix + "Callback file creation error [rebt] call failed " + e.getMessage();
-            e.printStackTrace();
-        } catch (IOException e) {
-            sRet = sErrorPrefix + "Callback file error [rebt] call failed " + e.getMessage();
-            e.printStackTrace();
-        }
-
-        try {
-            // Tell all of the data channels we are rebooting
-            ((ASMozStub)this.contextWrapper).SendToDataChannel("Rebooting ...");
-
-            pProc = Runtime.getRuntime().exec(this.getSuArgs("reboot"));
-            RedirOutputThread outThrd = new RedirOutputThread(pProc, out);
-            outThrd.start();
-            outThrd.joinAndStopRedirect(10000);
-        } catch (IOException e) {
-            sRet = e.getMessage();
-            e.printStackTrace();
-        } catch (InterruptedException e) {
-            e.printStackTrace();
-        }
-
-        return (sRet);
-        }
-
-    private String [] getSuArgs(String cmdString)
-        {
-        String [] theArgs = new String [3];
-        theArgs[0] = "su";
-        theArgs[1] = "-c";
-        // as a security measure, ICS and later resets LD_LIBRARY_PATH. reset
-        // it here when executing the command
-        theArgs[2] = "LD_LIBRARY_PATH=/vendor/lib:/system/lib " + cmdString;
-        return theArgs;
-        }
-
-    public String UnInstallApp(String sApp, OutputStream out, boolean reboot)
-        {
-        String sRet = "";
-
-        try
-            {
-            if (reboot == true) {
-                pProc = Runtime.getRuntime().exec(this.getSuArgs("pm uninstall " + sApp + ";reboot;exit"));
-            } else {
-                pProc = Runtime.getRuntime().exec(this.getSuArgs("pm uninstall " + sApp + ";exit"));
-            }
-
-            RedirOutputThread outThrd = new RedirOutputThread(pProc, out);
-            outThrd.start();
-            try {
-                outThrd.joinAndStopRedirect(60000);
-                int nRet = pProc.exitValue();
-                sRet = "\nuninst complete [" + nRet + "]";
-                }
-            catch (IllegalThreadStateException itse) {
-                itse.printStackTrace();
-                sRet = "\nuninst command timed out";
-                }
-            }
-        catch (IOException e)
-            {
-            sRet = e.getMessage();
-            e.printStackTrace();
-            }
-        catch (InterruptedException e)
-            {
-            e.printStackTrace();
-            }
-
-        return (sRet);
-    }
-
-    public String InstallApp(String sApp, OutputStream out)
-        {
-        String sRet = "";
-        File    srcFile = new File(sApp);
-
-        try
-            {
-            // on android 4.2 and above, we want to pass the "-d" argument to pm so that version
-            // downgrades are allowed... (option unsupported in earlier versions)
-            String sPmCmd;
-
-            if (android.os.Build.VERSION.SDK_INT >= 17) { // JELLY_BEAN_MR1
-                sPmCmd = "pm install -r -d " + sApp + " Cleanup;exit";
-            } else {
-                sPmCmd = "pm install -r " + sApp + " Cleanup;exit";
-            }
-            pProc = Runtime.getRuntime().exec(this.getSuArgs(sPmCmd));
-            RedirOutputThread outThrd3 = new RedirOutputThread(pProc, out);
-            outThrd3.start();
-            try {
-                outThrd3.joinAndStopRedirect(60000);
-                int nRet3 = pProc.exitValue();
-                if (nRet3 == 0) {
-                    sRet = "\ninstallation complete [0]\n";
-                }
-                else {
-                    sRet = "\nFailure pm install [" + nRet3 + "]\n";
-                }
-                }
-            catch (IllegalThreadStateException itse) {
-                itse.printStackTrace();
-                sRet = "\nFailure pm install command timed out\n";
-            }
-            try {
-                out.write(sRet.getBytes());
-                out.flush();
-                }
-            catch (IOException e1)
-                {
-                e1.printStackTrace();
-                }
-            }
-        catch (IOException e)
-            {
-            sRet = e.getMessage();
-            e.printStackTrace();
-            }
-        catch (InterruptedException e)
-            {
-            e.printStackTrace();
-            }
-
-        return (sRet);
-        }
-
-    public String StrtUpdtOMatic(String sPkgName, String sPkgFileName, String sCallBackIP, String sCallBackPort)
-        {
-        String sRet = "";
-
-        Context ctx = contextWrapper.getApplicationContext();
-        PackageManager pm = ctx.getPackageManager();
-
-        Intent prgIntent = new Intent();
-        prgIntent.setPackage("com.mozilla.watcher");
-
-        try {
-            PackageInfo pi = pm.getPackageInfo("com.mozilla.watcher", PackageManager.GET_SERVICES | PackageManager.GET_INTENT_FILTERS);
-            ServiceInfo [] si = pi.services;
-            for (int i = 0; i < si.length; i++)
-                {
-                ServiceInfo s = si[i];
-                if (s.name.length() > 0)
-                    {
-                    prgIntent.setClassName(s.packageName, s.name);
-                    break;
-                    }
-                }
-            }
-        catch (NameNotFoundException e)
-            {
-            e.printStackTrace();
-            sRet = sErrorPrefix + "watcher is not properly installed";
-            return(sRet);
-            }
-
-        prgIntent.putExtra("command", "updt");
-        prgIntent.putExtra("pkgName", sPkgName);
-        prgIntent.putExtra("pkgFile", sPkgFileName);
-        prgIntent.putExtra("reboot", true);
-
-        try
-            {
-            if ((sCallBackIP != null) && (sCallBackPort != null) &&
-                (sCallBackIP.length() > 0) && (sCallBackPort.length() > 0))
-                {
-                FileOutputStream fos = ctx.openFileOutput("update.info", Context.MODE_WORLD_READABLE | Context.MODE_WORLD_WRITEABLE);
-                String sBuffer = sCallBackIP + "," + sCallBackPort + "\rupdate started " + sPkgName + " " + sPkgFileName + "\r";
-                fos.write(sBuffer.getBytes());
-                fos.flush();
-                fos.close();
-                fos = null;
-                prgIntent.putExtra("outFile", ctx.getFilesDir() + "/update.info");
-                }
-            else {
-                if (prgIntent.hasExtra("outFile")) {
-                    System.out.println("outFile extra unset from intent");
-                    prgIntent.removeExtra("outFile");
-                }
-            }
-
-            ComponentName cn = contextWrapper.startService(prgIntent);
-            if (cn != null)
-                sRet = "exit";
-            else
-                sRet = sErrorPrefix + "Unable to use watcher service";
-            }
-        catch(ActivityNotFoundException anf)
-            {
-            sRet = sErrorPrefix + "Activity Not Found Exception [updt] call failed";
-            anf.printStackTrace();
-            }
-        catch (FileNotFoundException e)
-            {
-            sRet = sErrorPrefix + "File creation error [updt] call failed";
-            e.printStackTrace();
-            }
-        catch (IOException e)
-            {
-            sRet = sErrorPrefix + "File error [updt] call failed";
-            e.printStackTrace();
-            }
-
-        ctx = null;
-
-        return (sRet);
-        }
-
-    public String StartJavaPrg(String [] sArgs, Intent preIntent)
-        {
-        String sRet = "";
-        String sArgList = "";
-        String sUrl = "";
-//        String sRedirFileName = "";
-        Intent prgIntent = null;
-
-        Context ctx = contextWrapper.getApplicationContext();
-        PackageManager pm = ctx.getPackageManager();
-
-        if (preIntent == null)
-            prgIntent = new Intent();
-        else
-            prgIntent = preIntent;
-
-        prgIntent.setPackage(sArgs[0]);
-        prgIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
-
-        // Get the main activity for this package
-        try {
-            final ComponentName c = pm.getLaunchIntentForPackage(sArgs[0]).getComponent();
-            prgIntent.setClassName(c.getPackageName(), c.getClassName());
-        } catch (Exception e) {
-            e.printStackTrace();
-            return "Unable to find main activity for package: " + sArgs[0];
-        }
-
-        if (sArgs.length > 1)
-            {
-            if (sArgs[0].contains("android.browser"))
-                prgIntent.setAction(Intent.ACTION_VIEW);
-            else
-                prgIntent.setAction(Intent.ACTION_MAIN);
-
-            if (sArgs[0].contains("fennec") || sArgs[0].contains("firefox"))
-                {
-                sArgList = "";
-                sUrl = "";
-
-                for (int lcv = 1; lcv < sArgs.length; lcv++)
-                    {
-                    if (sArgs[lcv].contains("://"))
-                        {
-                        prgIntent.setAction(Intent.ACTION_VIEW);
-                        sUrl = sArgs[lcv];
-                        }
-                    else
-                        {
-                        if (sArgs[lcv].equals(">"))
-                            {
-                            lcv++;
-                            if (lcv < sArgs.length)
-                                lcv++;
-//                                sRedirFileName = sArgs[lcv++];
-                            }
-                        else
-                            sArgList += " " + sArgs[lcv];
-                        }
-                    }
-
-                if (sArgList.length() > 0)
-                    prgIntent.putExtra("args", sArgList.trim());
-
-                if (sUrl.length() > 0)
-                    prgIntent.setData(Uri.parse(sUrl.trim()));
-                }
-            else
-                {
-                for (int lcv = 1; lcv < sArgs.length; lcv++)
-                    sArgList += " " + sArgs[lcv];
-
-                prgIntent.setData(Uri.parse(sArgList.trim()));
-                }
-            }
-        else
-            {
-            prgIntent.setAction(Intent.ACTION_MAIN);
-            }
-
-        try
-            {
-            contextWrapper.startActivity(prgIntent);
-            FindProcThread findProcThrd = new FindProcThread(contextWrapper, sArgs[0]);
-            findProcThrd.start();
-            findProcThrd.join(7000);
-            if (!findProcThrd.bFoundIt && !findProcThrd.bStillRunning) {
-                sRet = "Unable to start " + sArgs[0] + "";
-                }
-            }
-        catch(ActivityNotFoundException anf)
-            {
-            anf.printStackTrace();
-            }
-        catch (InterruptedException e) {
-            e.printStackTrace();
-        }
-
-        ctx = null;
-        return (sRet);
-        }
-
-    public String StartPrg(String [] progArray, OutputStream out, boolean startAsRoot, int timeoutSeconds)
-        {
-        String sRet = "";
-        int    lcv = 0;
-
-        try {
-            if (startAsRoot)
-                {
-                    // we need to requote the program string here, in case
-                    // there's spaces or other characters which need quoting
-                    // before being passed to su
-                    List<String> quotedProgList = new ArrayList<String>();
-                    for (String arg : progArray)
-                        {
-                            String quotedArg = arg;
-                            quotedArg = quotedArg.replace("\"", "\\\"");
-                            quotedArg = quotedArg.replace("\'", "\\\'");
-                            if (quotedArg.contains(" "))
-                                {
-                                    quotedArg = "\"" + quotedArg + "\"";
-                                }
-                            quotedProgList.add(quotedArg);
-                        }
-                    pProc = Runtime.getRuntime().exec(this.getSuArgs(TextUtils.join(" ", quotedProgList)));
-                }
-            else
-                {
-                    pProc = Runtime.getRuntime().exec(progArray);
-                }
-            RedirOutputThread outThrd = new RedirOutputThread(pProc, out);
-            outThrd.start();
-            try {
-                outThrd.join(timeoutSeconds * 1000);
-                int nRetCode = pProc.exitValue();
-                sRet = "return code [" + nRetCode + "]";
-                }
-            catch (IllegalThreadStateException itse) {
-                }
-            outThrd.stopRedirect();
-            }
-        catch (IOException e)
-            {
-            e.printStackTrace();
-            }
-        catch (InterruptedException e)
-            {
-            e.printStackTrace();
-            sRet = "Timed out!";
-            }
-
-        return (sRet);
-        }
-
-    public String StartPrg2(String [] progArray, OutputStream out, String cwd, boolean startAsRoot, int timeoutSeconds)
-        {
-        String sRet = "";
-
-        int    nArraySize = 0;
-        int    nArgs = progArray.length - 1; // 1st arg is the environment string
-        int    lcv    = 0;
-        int    temp = 0;
-
-        String sEnvString = progArray[0];
-
-        if (!sEnvString.contains("=") && (sEnvString.length() > 0))
-            {
-            if (sEnvString.contains("/") || sEnvString.contains("\\") || !sEnvString.contains("."))
-                sRet = StartPrg(progArray, out, startAsRoot, timeoutSeconds);
-            else
-                sRet = StartJavaPrg(progArray, null);
-            return(sRet);
-            }
-
-        // Set up command line args stripping off the environment string
-        String [] theArgs = new String [nArgs];
-        for (lcv = 0; lcv < nArgs; lcv++)
-            {
-            theArgs[lcv] = progArray[lcv + 1];
-            }
-
-        try
-            {
-            String [] envStrings = sEnvString.split(",");
-            Map<String, String> newEnv = new HashMap<String, String>();
-
-            for (lcv = 0; lcv < envStrings.length; lcv++)
-                {
-                temp = envStrings[lcv].indexOf("=");
-                if (temp > 0)
-                    {
-                    newEnv.put(    envStrings[lcv].substring(0, temp),
-                                envStrings[lcv].substring(temp + 1, envStrings[lcv].length()));
-                    }
-                }
-
-            Map<String, String> sysEnv = System.getenv();
-
-            nArraySize = sysEnv.size();
-
-            for (Map.Entry<String, String> entry : newEnv.entrySet())
-                {
-                if (!sysEnv.containsKey(entry.getKey()))
-                    {
-                    nArraySize++;
-                    }
-                }
-
-            String[] envArray = new String[nArraySize];
-
-            int        i = 0;
-            int        offset;
-            String    sKey = "";
-            String     sValue = "";
-
-            for (Map.Entry<String, String> entry : sysEnv.entrySet())
-                {
-                sKey = entry.getKey();
-                if (newEnv.containsKey(sKey))
-                    {
-                    sValue = newEnv.get(sKey);
-                    if ((offset = sValue.indexOf("$" + sKey)) != -1)
-                        {
-                        envArray[i++] = sKey +
-                                        "=" +
-                                        sValue.substring(0, offset) +
-                                        entry.getValue() +
-                                        sValue.substring(offset + sKey.length() + 1);
-                        }
-                    else
-                        envArray[i++] = sKey + "=" + sValue;
-                    newEnv.remove(sKey);
-                    }
-                else
-                    envArray[i++] = entry.getKey() + "=" + entry.getValue();
-                }
-
-            for (Map.Entry<String, String> entry : newEnv.entrySet())
-                {
-                envArray[i++] = entry.getKey() + "=" + entry.getValue();
-                }
-
-            if (theArgs[0].contains("/") || theArgs[0].contains("\\") || !theArgs[0].contains("."))
-                {
-                if (cwd != null)
-                    {
-                    File f = new File(cwd);
-                    pProc = Runtime.getRuntime().exec(theArgs, envArray, f);
-                    }
-                else
-                    {
-                    pProc = Runtime.getRuntime().exec(theArgs, envArray);
-                    }
-
-                RedirOutputThread outThrd = new RedirOutputThread(pProc, out);
-                outThrd.start();
-
-                try {
-                    outThrd.join(timeoutSeconds * 1000);
-                    int nRetCode = pProc.exitValue();
-                    sRet = "return code [" + nRetCode + "]";
-                    }
-                catch (IllegalThreadStateException itse) {
-                    }
-                outThrd.stopRedirect();
-                }
-            else
-                {
-                Intent preIntent = new Intent();
-                for (lcv = 0; lcv < envArray.length; lcv++)
-                    {
-                    preIntent.putExtra("env" + lcv, envArray[lcv]);
-                    }
-                sRet = StartJavaPrg(theArgs, preIntent);
-                }
-            }
-        catch(UnsupportedOperationException e)
-            {
-            if (e != null)
-                e.printStackTrace();
-            }
-        catch(ClassCastException e)
-            {
-            if (e != null)
-                e.printStackTrace();
-            }
-        catch(IllegalArgumentException e)
-            {
-            if (e != null)
-                e.printStackTrace();
-            }
-        catch(NullPointerException e)
-            {
-            if (e != null)
-                e.printStackTrace();
-            }
-        catch (IOException e)
-            {
-            e.printStackTrace();
-            }
-        catch (InterruptedException e)
-            {
-            e.printStackTrace();
-            sRet = "Timed out!";
-            }
-
-        return (sRet);
-        }
-
-    public String ChmodDir(String sDir)
-        {
-        String sRet = "";
-        int nFiles = 0;
-        String sSubDir = null;
-        String sTmpDir = fixFileName(sDir);
-
-        File dir = new File(sTmpDir);
-
-        if (dir.isDirectory()) {
-            sRet = "Changing permissions for " + sTmpDir;
-
-            File [] files = dir.listFiles();
-            if (files != null) {
-                if ((nFiles = files.length) > 0) {
-                    for (int lcv = 0; lcv < nFiles; lcv++) {
-                        if (files[lcv].isDirectory()) {
-                            sSubDir = files[lcv].getAbsolutePath();
-                            sRet += "\n" + ChmodDir(sSubDir);
-                        }
-                        else {
-                            // set the new file's permissions to rwxrwxrwx, if possible
-                            try {
-                                Process pProc = Runtime.getRuntime().exec(this.getSuArgs("chmod 777 "+files[lcv]));
-                                RedirOutputThread outThrd = new RedirOutputThread(pProc, null);
-                                outThrd.start();
-                                outThrd.joinAndStopRedirect(5000);
-                                sRet += "\n\tchmod " + files[lcv].getName() + " ok";
-                            } catch (InterruptedException e) {
-                                sRet += "\n\ttimeout waiting for chmod " + files[lcv].getName();
-                            } catch (IOException e) {
-                                sRet += "\n\tunable to chmod " + files[lcv].getName();
-                            }
-                        }
-                    }
-                }
-                else
-                    sRet += "\n\t<empty>";
-                }
-            }
-
-        // set the new directory's (or file's) permissions to rwxrwxrwx, if possible
-        try {
-            Process pProc = Runtime.getRuntime().exec(this.getSuArgs("chmod 777 "+sTmpDir));
-            RedirOutputThread outThrd = new RedirOutputThread(pProc, null);
-            outThrd.start();
-            outThrd.joinAndStopRedirect(5000);
-            sRet += "\n\tchmod " + sTmpDir + " ok";
-        } catch (InterruptedException e) {
-            sRet += "\n\ttimeout waiting for chmod " + sTmpDir;
-        } catch (IOException e) {
-            sRet += "\n\tunable to chmod " + sTmpDir;
-        }
-
-        return(sRet);
-        }
-
-    public String TopActivity()
-        {
-        String sRet = "";
-        ActivityManager aMgr = (ActivityManager) contextWrapper.getSystemService(Activity.ACTIVITY_SERVICE);
-        List< ActivityManager.RunningTaskInfo > taskInfo = null;
-        ComponentName componentInfo = null;
-        if (aMgr != null)
-            {
-            taskInfo = aMgr.getRunningTasks(1);
-            }
-        if (taskInfo != null)
-            {
-            // topActivity: "The activity component at the top of the history stack of the task.
-            // This is what the user is currently doing."
-            componentInfo = taskInfo.get(0).topActivity;
-            }
-        if (componentInfo != null)
-            {
-            sRet = componentInfo.getPackageName();
-            }
-        return(sRet);
-        }
-
-    private String PrintUsage()
-        {
-        String sRet =
-            "run [cmdline]                   - start program no wait\n" +
-            "exec [env pairs] [cmdline]      - start program no wait optionally pass env\n" +
-            "                                  key=value pairs (comma separated)\n" +
-            "execcwd <dir> [env pairs] [cmdline] - start program from specified directory\n" +
-            "execsu [env pairs] [cmdline]    - start program as privileged user\n" +
-            "execcwdsu <dir> [env pairs] [cmdline] - start program from specified directory as privileged user\n" +
-            "execext [su] [cwd=<dir>] [t=<timeout>] [env pairs] [cmdline] - start program with extended options\n" +
-            "kill [program name]             - kill program no path\n" +
-            "killall                         - kill all processes started\n" +
-            "ps                              - list of running processes\n" +
-            "info                            - list of device info\n" +
-            "        [os]                    - os version for device\n" +
-            "        [id]                    - unique identifier for device\n" +
-            "        [uptime]                - uptime for device\n" +
-            "        [uptimemillis]          - uptime for device in milliseconds\n" +
-            "        [sutuptimemillis]       - uptime for SUT in milliseconds\n" +
-            "        [systime]               - current system time\n" +
-            "        [screen]                - width, height and bits per pixel for device\n" +
-            "        [memory]                - physical, free, available, storage memory\n" +
-            "                                  for device\n" +
-            "        [processes]             - list of running processes see 'ps'\n" +
-            "alrt [on/off]                   - start or stop sysalert behavior\n" +
-            "disk [arg]                      - prints disk space info\n" +
-            "cp file1 file2                  - copy file1 to file2\n" +
-            "time file                       - timestamp for file\n" +
-            "hash file                       - generate hash for file\n" +
-            "cd directory                    - change cwd\n" +
-            "cat file                        - cat file\n" +
-            "cwd                             - display cwd\n" +
-            "mv file1 file2                  - move file1 to file2\n" +
-            "push filename                   - push file to device\n" +
-            "rm file                         - delete file\n" +
-            "rmdr directory                  - delete directory even if not empty\n" +
-            "mkdr directory                  - create directory\n" +
-            "dirw directory                  - tests whether the directory is writable\n" +
-            "isdir directory                 - test whether the directory exists\n" +
-            "chmod directory|file            - change permissions of directory and contents (or file) to 777\n" +
-            "stat processid                  - stat process\n" +
-            "dead processid                  - print whether the process is alive or hung\n" +
-            "mems                            - dump memory stats\n" +
-            "ls                              - print directory\n" +
-            "tmpd                            - print temp directory\n" +
-            "ping [hostname/ipaddr]          - ping a network device\n" +
-            "unzp zipfile destdir            - unzip the zipfile into the destination dir\n" +
-            "zip zipfile src                 - zip the source file/dir into zipfile\n" +
-            "rebt                            - reboot device\n" +
-            "inst /path/filename.apk         - install the referenced apk file\n" +
-            "uninst packagename              - uninstall the referenced package and reboot\n" +
-            "uninstall packagename           - uninstall the referenced package without a reboot\n" +
-            "updt pkgname pkgfile            - unpdate the referenced package\n" +
-            "clok                            - the current device time expressed as the" +
-            "                                  number of millisecs since epoch\n" +
-            "settime date time               - sets the device date and time\n" +
-            "                                  (YYYY/MM/DD HH:MM:SS)\n" +
-            "tzset timezone                  - sets the device timezone format is\n" +
-            "                                  GMTxhh:mm x = +/- or a recognized Olsen string\n" +
-            "tzget                           - returns the current timezone set on the device\n" +
-            "rebt                            - reboot device\n" +
-            "adb ip|usb                      - set adb to use tcp/ip on port 5555 or usb\n" +
-            "activity                        - print package name of top (foreground) activity\n" +
-            "quit                            - disconnect SUTAgent\n" +
-            "exit                            - close SUTAgent\n" +
-            "ver                             - SUTAgent version\n" +
-            "help                            - you're reading it";
-        return (sRet);
-        }
-}
deleted file mode 100644
--- a/build/mobile/sutagent/android/FindProcThread.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-package com.mozilla.SUTAgentAndroid.service;
-
-import java.util.List;
-
-import android.app.Activity;
-import android.app.ActivityManager;
-import android.content.ContextWrapper;
-
-public class FindProcThread extends Thread {
-    ContextWrapper    contextWrapper = null;
-    String sProcNameToFind = "";
-    boolean bFoundIt = false;
-    boolean bStillRunning = true;
-
-    public FindProcThread(ContextWrapper ctx, String sProcessName) {
-        super("FindProcThread");
-        this.contextWrapper = ctx;
-        this.sProcNameToFind = sProcessName;
-        this.bFoundIt = false;
-    }
-
-    public void run() {
-        ActivityManager aMgr = (ActivityManager) contextWrapper.getSystemService(Activity.ACTIVITY_SERVICE);
-        List <ActivityManager.RunningAppProcessInfo> lProcesses;
-        int lcv = 0;
-        int nNumLoops = 0;
-        String strProcName = "";
-        int    nPID = 0;
-
-        if (aMgr == null)
-            return;
-
-
-        // While we are still looping looking for the process in the list and we haven't found it
-        while (bStillRunning && !bFoundIt) {
-            lProcesses = aMgr.getRunningAppProcesses();
-            if (lProcesses != null) {
-                for (lcv = 0; lcv < lProcesses.size(); lcv++) {
-                    if (lProcesses.get(lcv).processName.contains(sProcNameToFind)) {
-                        strProcName = lProcesses.get(lcv).processName;
-                        nPID = lProcesses.get(lcv).pid;
-                        bFoundIt = true;
-                        break;
-                    }
-                }
-                if (bFoundIt)             // This saves you half a second of wait time if we've found it in the list
-                    continue;
-            }
-            try {
-                Thread.sleep(500);         // Sleep half a second
-                if (++nNumLoops > 10) { // loop up to 10 times
-                    bStillRunning = false;
-                }
-                lProcesses = null;
-                System.gc();
-                Thread.yield();
-            } catch (InterruptedException e) {
-                e.printStackTrace();
-                bStillRunning = false;
-            }
-        }
-    }
-
-}
deleted file mode 100644
--- a/build/mobile/sutagent/android/Makefile.in
+++ /dev/null
@@ -1,28 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-include $(topsrcdir)/config/config.mk
-
-JAVAFILES = \
-  AlertLooperThread.java \
-  ASMozStub.java \
-  CmdWorkerThread.java \
-  DataWorkerThread.java \
-  DoAlert.java \
-  DoCommand.java \
-  FindProcThread.java \
-  Power.java \
-  RedirOutputThread.java \
-  RunCmdThread.java \
-  RunDataThread.java \
-  SUTAgentAndroid.java \
-  WifiConfiguration.java \
-  $(NULL)
-
-ANDROID_EXTRA_JARS = \
-  $(srcdir)/network-libs/commons-net-2.0.jar \
-  $(srcdir)/network-libs/jmdns.jar \
-  $(NULL)
-
-tools:: $(ANDROID_APK_NAME).apk
deleted file mode 100755
--- a/build/mobile/sutagent/android/Power.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.os;
-
-import java.io.IOException;
-
-/**
- * Class that provides access to some of the power management functions.
- *
- * {@hide}
- */
-public class Power
-{
-    // can't instantiate this class
-    private Power()
-    {
-    }
-
-    /**
-     * Wake lock that ensures that the CPU is running.  The screen might
-     * not be on.
-     */
-    public static final int PARTIAL_WAKE_LOCK = 1;
-
-    /**
-     * Wake lock that ensures that the screen is on.
-     */
-    public static final int FULL_WAKE_LOCK = 2;
-
-    public static native void acquireWakeLock(int lock, String id);
-    public static native void releaseWakeLock(String id);
-
-    /**
-     * Brightness value for fully off
-     */
-    public static final int BRIGHTNESS_OFF = 0;
-
-    /**
-     * Brightness value for dim backlight
-     */
-    public static final int BRIGHTNESS_DIM = 20;
-
-    /**
-     * Brightness value for fully on
-     */
-    public static final int BRIGHTNESS_ON = 255;
-
-    /**
-     * Brightness value to use when battery is low
-     */
-    public static final int BRIGHTNESS_LOW_BATTERY = 10;
-
-    /**
-     * Threshold for BRIGHTNESS_LOW_BATTERY (percentage)
-     * Screen will stay dim if battery level is <= LOW_BATTERY_THRESHOLD
-     */
-    public static final int LOW_BATTERY_THRESHOLD = 10;
-
-    /**
-     * Turn the screen on or off
-     *
-     * @param on Whether you want the screen on or off
-     */
-    public static native int setScreenState(boolean on);
-
-    public static native int setLastUserActivityTimeout(long ms);
-
-    /**
-     * Turn the device off.
-     *
-     * This method is considered deprecated in favor of
-     * {@link android.policy.ShutdownThread.shutdownAfterDisablingRadio()}.
-     *
-     * @deprecated
-     * @hide
-     */
-    @Deprecated
-    public static native void shutdown();
-
-    /**
-     * Reboot the device.
-     * @param reason code to pass to the kernel (e.g. "recovery"), or null.
-     *
-     * @throws IOException if reboot fails for some reason (eg, lack of
-     *         permission)
-     */
-    public static native void reboot(String reason) throws IOException;
-}
deleted file mode 100755
--- a/build/mobile/sutagent/android/RedirOutputThread.java
+++ /dev/null
@@ -1,197 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-package com.mozilla.SUTAgentAndroid.service;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.PrintWriter;
-
-public class RedirOutputThread extends Thread
-    {
-    OutputStream out;
-    InputStream    sutErr;
-    InputStream    sutOut;
-    Process pProc;
-    String    strOutput;
-    int    nExitCode = -1;
-    private volatile boolean stopRedirRequested = false;
-    private volatile boolean redirStopped = false;
-
-    public RedirOutputThread(Process pProc, OutputStream out)
-        {
-        super("RedirOutputThread");
-        if (pProc != null)
-            {
-            this.pProc = pProc;
-            sutErr = pProc.getErrorStream(); // Stderr
-            sutOut = pProc.getInputStream(); // Stdout
-            }
-        if (out != null)
-            this.out = out;
-
-        strOutput = "";
-        }
-
-    public void run()
-        {
-        boolean bStillRunning = true;
-        int    nBytesOut = 0;
-        int nBytesErr = 0;
-        int nBytesRead = 0;
-        PrintWriter pOut = null;
-        byte[] buffer = new byte[1024];
-
-        if (out != null)
-            pOut = new PrintWriter(out);
-        else
-            bStillRunning = true;
-
-        while (bStillRunning)
-            {
-            try
-                {
-                // If there's no output to collect, sleep for a while
-                // rather than checking again immediately, to avoid 
-                // using up cpu capacity in a tight loop.
-                if (sutOut.available() == 0 && sutErr.available() == 0)
-                    {
-                    Thread.sleep(50);
-                    }
-                if ((nBytesOut = sutOut.available()) > 0)
-                    {
-                    if (nBytesOut > buffer.length)
-                        {
-                        buffer = null;
-                        System.gc();
-                        buffer = new byte[nBytesOut];
-                        }
-                    nBytesRead = sutOut.read(buffer, 0, nBytesOut);
-                    if (nBytesRead == -1)
-                        bStillRunning = false;
-                    else
-                        {
-                        String sRep = new String(buffer,0,nBytesRead).replace("\n", "\r\n");
-                        if (pOut != null)
-                            {
-                            pOut.print(sRep);
-                            pOut.flush();
-                            }
-                        else
-                            strOutput += sRep;
-                        }
-                    }
-
-                if ((nBytesErr = sutErr.available()) > 0)
-                    {
-                    if (nBytesErr > buffer.length)
-                        {
-                        buffer = null;
-                        System.gc();
-                        buffer = new byte[nBytesErr];
-                        }
-                    nBytesRead = sutErr.read(buffer, 0, nBytesErr);
-                    if (nBytesRead == -1)
-                        bStillRunning = false;
-                    else
-                        {
-                        String sRep = new String(buffer,0,nBytesRead).replace("\n", "\r\n");
-                        if (pOut != null)
-                            {
-                            pOut.print(sRep);
-                            pOut.flush();
-                            }
-                        else
-                            strOutput += sRep;
-                        }
-                    }
-
-                bStillRunning = (stopRedirRequested == false) &&
-                    (IsProcRunning(pProc) || (sutOut.available() > 0) || (sutErr.available() > 0));
-                }
-            catch (IOException e)
-                {
-                e.printStackTrace();
-                }
-            catch (java.lang.IllegalArgumentException e)
-                {
-                // Bug 743766: InputStream.available() unexpectedly throws this sometimes
-                e.printStackTrace();
-                }
-            catch (InterruptedException e) 
-                {
-                e.printStackTrace();
-                }
-            }
-
-        // notify stopRedirect that redirection has stopped
-        redirStopped = true;
-        if (stopRedirRequested)
-            {
-            synchronized(this) 
-                {
-                notifyAll();
-                }
-            }
-
-        // wait for process to end; if it has not already ended, then destroy it
-        try
-            {
-            pProc.waitFor();
-            }
-        catch (InterruptedException e) 
-            {
-            e.printStackTrace();
-            pProc.destroy();
-            }
-        buffer = null;
-        System.gc();
-        }
-
-    private boolean IsProcRunning(Process pProc)
-        {
-        boolean bRet = false;
-
-        try
-            {
-            nExitCode = pProc.exitValue();
-            }
-        catch (IllegalThreadStateException z)
-            {
-            nExitCode = -1;
-            bRet = true;
-            }
-
-        return(bRet);
-        }
-
-    public synchronized void stopRedirect()
-        {
-        stopRedirRequested = true;
-        // wait for notification that redirection has stopped
-        if (!redirStopped)
-            {
-            try 
-                {
-                // max wait time is somewhat arbitrary and provided "just in case";
-                // we expect to be notified as soon as run() completes its current
-                // sleep and checks the stopRedirRequested flag
-                wait(500);
-                }
-            catch (InterruptedException e) 
-                {
-                e.printStackTrace();
-                }
-            }
-        }
-
-    public void joinAndStopRedirect(long millis) throws InterruptedException
-        {
-        super.join(millis);
-        if (out != null)
-            stopRedirect();
-        }
-
-    }
deleted file mode 100755
--- a/build/mobile/sutagent/android/RunCmdThread.java
+++ /dev/null
@@ -1,278 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-package com.mozilla.SUTAgentAndroid.service;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.ServerSocket;
-import java.net.Socket;
-import java.net.SocketTimeoutException;
-import java.util.ArrayList;
-import java.util.List;
-
-import com.mozilla.SUTAgentAndroid.R;
-import com.mozilla.SUTAgentAndroid.SUTAgentAndroid;
-
-import android.app.Notification;
-import android.app.NotificationManager;
-import android.app.PendingIntent;
-import android.content.Context;
-import android.content.Intent;
-import android.os.Handler;
-
-public class RunCmdThread extends Thread
-    {
-    private ServerSocket SvrSocket = null;
-    private Socket socket    = null;
-    private Handler handler = null;
-    boolean bListening    = true;
-    boolean bNetError = false;
-    List<CmdWorkerThread> theWorkers = new ArrayList<CmdWorkerThread>();
-    android.app.Service    svc = null;
-
-    public RunCmdThread(ServerSocket socket, android.app.Service service, Handler handler)
-        {
-        super("RunCmdThread");
-        this.SvrSocket = socket;
-        this.svc = service;
-        this.handler = handler;
-        }
-
-    public void StopListening()
-        {
-        bListening = false;
-        }
-
-    public void run() {
-        try {
-            SvrSocket.setSoTimeout(5000);
-            while (bListening)
-                {
-                try
-                    {
-                    socket = SvrSocket.accept();
-                    CmdWorkerThread theWorker = new CmdWorkerThread(this, socket);
-                    theWorker.start();
-                    theWorkers.add(theWorker);
-                    }
-                catch (SocketTimeoutException toe)
-                    {
-                    continue;
-                    }
-                catch (IOException e)
-                    {
-                    e.printStackTrace();
-                    continue;
-                    }
-                }
-
-            int nNumWorkers = theWorkers.size();
-            for (int lcv = 0; lcv < nNumWorkers; lcv++)
-                {
-                if (theWorkers.get(lcv).isAlive())
-                    {
-                    theWorkers.get(lcv).StopListening();
-                    while(theWorkers.get(lcv).isAlive())
-                        ;
-                    }
-                }
-
-            theWorkers.clear();
-
-            SvrSocket.close();
-
-            svc.stopSelf();
-
-//            SUTAgentAndroid.me.finish();
-            }
-        catch (IOException e)
-            {
-            e.printStackTrace();
-            }
-        return;
-        }
-
-    private String SendPing(String sIPAddr)
-        {
-        Process    pProc;
-        String sRet = "";
-        String [] theArgs = new String [4];
-        boolean bStillRunning = true;
-        int    nBytesOut = 0;
-        int nBytesErr = 0;
-        int nBytesRead = 0;
-        byte[] buffer = new byte[1024];
-
-        theArgs[0] = "ping";
-        theArgs[1] = "-c";
-        theArgs[2] = "3";
-        theArgs[3] = sIPAddr;
-
-        try
-            {
-            pProc = Runtime.getRuntime().exec(theArgs);
-
-            InputStream sutOut = pProc.getInputStream();
-            InputStream sutErr = pProc.getErrorStream();
-
-            while (bStillRunning)
-                {
-                try
-                    {
-                    if ((nBytesOut = sutOut.available()) > 0)
-                        {
-                        if (nBytesOut > buffer.length)
-                            {
-                            buffer = null;
-                            System.gc();
-                            buffer = new byte[nBytesOut];
-                            }
-                        nBytesRead = sutOut.read(buffer, 0, nBytesOut);
-                        if (nBytesRead == -1)
-                            bStillRunning = false;
-                        else
-                            {
-                            String sRep = new String(buffer,0,nBytesRead).replace("\n", "\r\n");
-                            sRet += sRep;
-                            sRep = null;
-                            }
-                        }
-
-                    if ((nBytesErr = sutErr.available()) > 0)
-                        {
-                        if (nBytesErr > buffer.length)
-                            {
-                            buffer = null;
-                            System.gc();
-                            buffer = new byte[nBytesErr];
-                            }
-                        nBytesRead = sutErr.read(buffer, 0, nBytesErr);
-                        if (nBytesRead == -1)
-                            bStillRunning = false;
-                        else
-                            {
-                            String sRep = new String(buffer,0,nBytesRead).replace("\n", "\r\n");
-                            sRet += sRep;
-                            sRep = null;
-                            }
-                        }
-
-                    bStillRunning = (IsProcRunning(pProc) || (sutOut.available() > 0) || (sutErr.available() > 0));
-                    }
-                catch (IOException e)
-                    {
-                    e.printStackTrace();
-                    }
-
-                if ((bStillRunning == true) && (nBytesErr == 0) && (nBytesOut == 0))
-                    {
-                    try {
-                        sleep(2000);
-                        }
-                    catch (InterruptedException e) {
-                        e.printStackTrace();
-                        }
-                    }
-                }
-
-            pProc.destroy();
-            pProc = null;
-            }
-        catch (IOException e)
-            {
-            sRet = e.getMessage();
-            e.printStackTrace();
-            }
-
-        return (sRet);
-        }
-
-    private boolean IsProcRunning(Process pProc)
-        {
-        boolean bRet = false;
-        @SuppressWarnings("unused")
-        int nExitCode = 0;
-
-        try
-            {
-            nExitCode = pProc.exitValue();
-            }
-        catch (IllegalThreadStateException z)
-            {
-            bRet = true;
-            }
-        catch (Exception e)
-            {
-            e.printStackTrace();
-            }
-
-        return(bRet);
-        }
-
-    private void SendNotification(String tickerText, String expandedText)
-        {
-        NotificationManager notificationManager = (NotificationManager)svc.getSystemService(Context.NOTIFICATION_SERVICE);
-
-//        int icon = android.R.drawable.stat_notify_more;
-//        int icon = R.drawable.ic_stat_first;
-//        int icon = R.drawable.ic_stat_second;
-//        int icon = R.drawable.ic_stat_neterror;
-        int icon = R.drawable.ateamlogo;
-        long when = System.currentTimeMillis();
-
-        Context context = svc.getApplicationContext();
-
-        // Intent to launch an activity when the extended text is clicked
-        Intent intent2 = new Intent(svc, SUTAgentAndroid.class);
-        PendingIntent launchIntent = PendingIntent.getActivity(context, 0, intent2, 0);
-
-
-        Notification notification = new Notification.Builder(context)
-            .setSmallIcon(icon)
-            .setContentTitle(tickerText)
-            .setContentText(expandedText)
-            .setContentIntent(launchIntent)
-            .setWhen(when)
-            .build();
-
-        notification.flags |= (Notification.FLAG_INSISTENT | Notification.FLAG_AUTO_CANCEL);
-        notification.defaults |= Notification.DEFAULT_SOUND;
-        notification.defaults |= Notification.DEFAULT_VIBRATE;
-        notification.defaults |= Notification.DEFAULT_LIGHTS;
-
-        notificationManager.notify(1959, notification);
-        }
-
-    private void CancelNotification()
-        {
-        NotificationManager notificationManager = (NotificationManager)svc.getSystemService(Context.NOTIFICATION_SERVICE);
-        notificationManager.cancel(1959);
-        }
-
-    class doCancelNotification implements Runnable
-        {
-        public void run()
-            {
-            CancelNotification();
-            }
-        };
-
-    class doSendNotification implements Runnable
-        {
-        private String sTitle = "";
-        private String sBText = "";
-
-        doSendNotification(String sTitle, String sBodyText)
-            {
-            this.sTitle = sTitle;
-            this.sBText = sBodyText;
-            }
-
-        public void run()
-            {
-            SendNotification(sTitle, sBText);
-            }
-        };
-}
deleted file mode 100755
--- a/build/mobile/sutagent/android/RunDataThread.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-package com.mozilla.SUTAgentAndroid.service;
-
-import java.io.IOException;
-import java.net.ServerSocket;
-import java.net.Socket;
-import java.net.SocketTimeoutException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Timer;
-
-public class RunDataThread extends Thread
-    {
-    Timer heartBeatTimer;
-
-    private ServerSocket SvrSocket = null;
-    private Socket socket    = null;
-    boolean bListening    = true;
-    List<DataWorkerThread> theWorkers = new ArrayList<DataWorkerThread>();
-    android.app.Service    svc = null;
-
-    public RunDataThread(ServerSocket socket, android.app.Service service)
-        {
-        super("RunDataThread");
-        this.SvrSocket = socket;
-        this.svc = service;
-        }
-
-    public void StopListening()
-        {
-        bListening = false;
-        }
-
-    public void SendToDataChannel(String strToSend)
-        {
-        int nNumWorkers = theWorkers.size();
-        for (int lcv = 0; lcv < nNumWorkers; lcv++)
-            {
-            if (theWorkers.get(lcv).isAlive())
-                {
-                theWorkers.get(lcv).SendString(strToSend);
-                }
-            }
-        return;
-        }
-
-    public void run() {
-        try {
-            SvrSocket.setSoTimeout(5000);
-            while (bListening)
-                {
-                try
-                    {
-                    socket = SvrSocket.accept();
-                    DataWorkerThread theWorker = new DataWorkerThread(this, socket);
-                    theWorker.start();
-                    theWorkers.add(theWorker);
-                    }
-                catch (SocketTimeoutException toe)
-                    {
-                    continue;
-                    }
-                }
-
-            int nNumWorkers = theWorkers.size();
-            for (int lcv = 0; lcv < nNumWorkers; lcv++)
-                {
-                if (theWorkers.get(lcv).isAlive())
-                    {
-                    theWorkers.get(lcv).StopListening();
-                    while(theWorkers.get(lcv).isAlive())
-                        ;
-                    }
-                }
-
-            theWorkers.clear();
-
-            SvrSocket.close();
-
-            svc.stopSelf();
-            }
-        catch (IOException e)
-            {
-//            Toast.makeText(SUTAgentAndroid.me.getApplicationContext(), e.getMessage(), Toast.LENGTH_LONG).show();
-            e.printStackTrace();
-            }
-        return;
-        }
-    }
deleted file mode 100755
--- a/build/mobile/sutagent/android/SUTAgentAndroid.java
+++ /dev/null
@@ -1,903 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-package com.mozilla.SUTAgentAndroid;
-
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.net.InetAddress;
-import java.net.NetworkInterface;
-import java.net.SocketException;
-import java.net.UnknownHostException;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.Enumeration;
-import java.util.Formatter;
-import java.util.List;
-import java.util.regex.Pattern;
-import java.util.Timer;
-
-import com.mozilla.SUTAgentAndroid.service.ASMozStub;
-import com.mozilla.SUTAgentAndroid.service.DoCommand;
-import android.app.Activity;
-import android.bluetooth.BluetoothAdapter;
-import android.content.BroadcastReceiver;
-import android.content.Context;
-import android.content.Intent;
-import android.content.IntentFilter;
-import android.content.pm.ActivityInfo;
-import android.content.res.Configuration;
-import android.net.Uri;
-import android.net.wifi.SupplicantState;
-import android.net.wifi.WifiConfiguration;
-import android.net.wifi.WifiInfo;
-import android.net.wifi.WifiManager;
-import android.net.wifi.WifiManager.WifiLock;
-import android.os.BatteryManager;
-import android.os.Build;
-import android.os.Build.VERSION;
-import android.os.Bundle;
-import android.os.Handler;
-import android.telephony.TelephonyManager;
-import android.util.Log;
-import android.view.Menu;
-import android.view.MenuItem;
-import android.view.View;
-import android.view.View.OnClickListener;
-import android.widget.Button;
-import android.widget.TextView;
-import android.widget.Toast;
-
-public class SUTAgentAndroid extends Activity
-    {
-    final Handler mHandler = new Handler();
-
-    private static final Pattern IPV4_PATTERN = Pattern.compile("^(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)(\\.(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)){3}$");
-
-    public static final int START_PRG = 1959;
-    MenuItem mExitMenuItem;
-    Timer timer = null;
-
-    public static String sUniqueID = null;
-    public static String sLocalIPAddr = null;
-    public static String sACStatus = null;
-    public static String sPowerStatus = null;
-    public static int    nChargeLevel = 0;
-    public static int    nBatteryTemp = 0;
-    public static long   nCreateTimeMillis = System.currentTimeMillis();
-    public static String sTestRoot = "";
-
-    String lineSep = System.getProperty("line.separator");
-    public PrintWriter dataOut = null;
-
-    private static boolean bNetworkingStarted = false;
-    private static String RegSvrIPAddr = "";
-    private static String RegSvrIPPort = "";
-    private static String HardwareID = "";
-    private static String Pool = "";
-    private static String Abi = "";
-    private static String sRegString = "";
-    private static boolean LogCommands = false;
-
-    private WifiLock wl = null;
-
-    private BroadcastReceiver battReceiver = null;
-
-    private TextView  tv = null;
-
-    public boolean onCreateOptionsMenu(Menu menu)
-        {
-        mExitMenuItem = menu.add("Exit");
-        mExitMenuItem.setIcon(android.R.drawable.ic_menu_close_clear_cancel);
-        return super.onCreateOptionsMenu(menu);
-        }
-
-    public boolean onMenuItemSelected(int featureId, MenuItem item)
-        {
-        if (item == mExitMenuItem)
-            {
-            finish();
-            }
-        return super.onMenuItemSelected(featureId, item);
-        }
-
-    public static String getRegSvrIPAddr()
-        {
-        return(RegSvrIPAddr);
-        }
-
-    public void pruneCommandLog(String datestamp, String testroot)
-        {
-
-        String today = "";
-        String yesterday = "";
-
-        // test root can be null (if getTestRoot fails), handle that:
-        if (testroot == null) {
-            testroot = "";
-        }
-
-        try {
-            SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss:SSS");
-            Date dateObj = sdf.parse(datestamp);
-            SimpleDateFormat sdf_file = new SimpleDateFormat("yyyy-MM-dd");
-
-            today     = sdf_file.format(dateObj);
-            yesterday = sdf_file.format(new Date(dateObj.getTime() - 1000*60*60*24));
-        } catch (ParseException pe) {}
-
-        File dir = new File(testroot);
-
-        if (!dir.isDirectory())
-            return;
-
-        File [] files = dir.listFiles();
-        if (files == null)
-            return;
-
-        for (int iter = 0; iter < files.length; iter++) {
-            String fName = files[iter].getName();
-            if (fName.endsWith("sutcommands.txt")) {
-                if (fName.endsWith(today + "-sutcommands.txt") || fName.endsWith(yesterday + "-sutcommands.txt"))
-                    continue;
-
-                if (files[iter].delete())
-                    Log.i("SUTAgentAndroid", "Deleted old command logfile: " + files[iter]);
-                else
-                    Log.e("SUTAgentAndroid", "Unable to delete old command logfile: " + files[iter]);
-            }
-        }
-        }
-
-    /** Called when the activity is first created. */
-    @Override
-    public void onCreate(Bundle savedInstanceState)
-        {
-        super.onCreate(savedInstanceState);
-
-        setContentView(R.layout.main);
-
-        fixScreenOrientation();
-
-        DoCommand dc = new DoCommand(getApplication());
-
-        Log.i("SUTAgentAndroid", dc.prgVersion);
-        dc.FixDataLocalPermissions();
-
-        // Get configuration settings from "ini" file
-        File dir = getFilesDir();
-        File iniFile = new File(dir, "SUTAgent.ini");
-        String sIniFile = iniFile.getAbsolutePath();
-
-        String lc = dc.GetIniData("General", "LogCommands", sIniFile);
-        if (lc != "" && Integer.parseInt(lc) == 1) {
-            SUTAgentAndroid.LogCommands = true;
-        }
-        SUTAgentAndroid.RegSvrIPAddr = dc.GetIniData("Registration Server", "IPAddr", sIniFile);
-        SUTAgentAndroid.RegSvrIPPort = dc.GetIniData("Registration Server", "PORT", sIniFile);
-        SUTAgentAndroid.HardwareID = dc.GetIniData("Registration Server", "HARDWARE", sIniFile);
-        SUTAgentAndroid.Pool = dc.GetIniData("Registration Server", "POOL", sIniFile);
-        SUTAgentAndroid.sTestRoot = dc.GetIniData("Device", "TestRoot", sIniFile);
-        SUTAgentAndroid.Abi = android.os.Build.CPU_ABI;
-        log(dc, "onCreate");
-
-        dc.SetTestRoot(SUTAgentAndroid.sTestRoot);
-
-        Log.i("SUTAgentAndroid", "Test Root: " + SUTAgentAndroid.sTestRoot);
-
-        tv = (TextView) this.findViewById(R.id.Textview01);
-
-        if (getLocalIpAddress() == null)
-            setUpNetwork(sIniFile);
-
-        String macAddress = "Unknown";
-        if (android.os.Build.VERSION.SDK_INT > 8) {
-            try {
-                NetworkInterface iface = NetworkInterface.getByInetAddress(InetAddress.getAllByName(getLocalIpAddress())[0]);
-                if (iface != null)
-                    {
-                        byte[] mac = iface.getHardwareAddress();
-                        if (mac != null)
-                            {
-                                StringBuilder sb = new StringBuilder();
-                                Formatter f = new Formatter(sb);
-                                for (int i = 0; i < mac.length; i++)
-                                    {
-                                        f.format("%02x%s", mac[i], (i < mac.length - 1) ? ":" : "");
-                                    }
-                                macAddress = sUniqueID = sb.toString();
-                            }
-                    }
-            }
-            catch (UnknownHostException ex) {}
-            catch (SocketException ex) {}
-        }
-        else
-            {
-                // Fall back to getting info from wifiman on older versions of Android,
-                // which don't support the NetworkInterface interface
-                WifiManager wifiMan = (WifiManager)getSystemService(Context.WIFI_SERVICE);
-                if (wifiMan != null)
-                    {
-                        WifiInfo wifi = wifiMan.getConnectionInfo();
-                        if (wifi != null)
-                            macAddress = wifi.getMacAddress();
-                        if (macAddress != null)
-                            sUniqueID = macAddress;
-                    }
-            }
-
-        if (sUniqueID == null)
-            {
-            BluetoothAdapter ba = BluetoothAdapter.getDefaultAdapter();
-            if ((ba != null) && (ba.isEnabled() != true))
-                {
-                ba.enable();
-                while(ba.getState() != BluetoothAdapter.STATE_ON)
-                    {
-                    try {
-                        Thread.sleep(1000);
-                        }
-                    catch (InterruptedException e)
-                        {
-                        e.printStackTrace();
-                        }
-                    }
-
-                sUniqueID = ba.getAddress();
-
-                ba.disable();
-                while(ba.getState() != BluetoothAdapter.STATE_OFF)
-                    {
-                    try {
-                        Thread.sleep(1000);
-                        }
-                    catch (InterruptedException e)
-                        {
-                        e.printStackTrace();
-                        }
-                    }
-                }
-            else
-                {
-                if (ba != null)
-                    {
-                    sUniqueID = ba.getAddress().toLowerCase();
-                    }
-                }
-            }
-
-        if (sUniqueID == null)
-            {
-            TelephonyManager mTelephonyMgr = (TelephonyManager)getSystemService(TELEPHONY_SERVICE);
-            if (mTelephonyMgr != null)
-                {
-                sUniqueID = mTelephonyMgr.getDeviceId();
-                if (sUniqueID == null)
-                    {
-                    sUniqueID = "0011223344556677";
-                    }
-                }
-            }
-
-        String hwid = getHWID(this);
-
-        sLocalIPAddr = getLocalIpAddress();
-        Toast.makeText(getApplication().getApplicationContext(), "SUTAgent [" + sLocalIPAddr + "] ...", Toast.LENGTH_LONG).show();
-
-        String sConfig = dc.prgVersion + lineSep;
-        sConfig += "Test Root: " + sTestRoot + lineSep;
-        sConfig += "Unique ID: " + sUniqueID + lineSep;
-        sConfig += "HWID: " + hwid + lineSep;
-        sConfig += "ABI: " + Abi + lineSep;
-        sConfig += "OS Info" + lineSep;
-        sConfig += "\t" + dc.GetOSInfo() + lineSep;
-        sConfig += "Screen Info" + lineSep;
-        int [] xy = dc.GetScreenXY();
-        sConfig += "\t Width: " + xy[0] + lineSep;
-        sConfig += "\t Height: " + xy[1] + lineSep;
-        sConfig += "Memory Info" + lineSep;
-        sConfig += "\t" + dc.GetMemoryInfo() + lineSep;
-        sConfig += "Network Info" + lineSep;
-        sConfig += "\tMac Address: " + macAddress + lineSep;
-        sConfig += "\tIP Address: " + sLocalIPAddr + lineSep;
-
-        displayStatus(sConfig);
-
-        sRegString = "NAME=" + sUniqueID;
-        sRegString += "&IPADDR=" + sLocalIPAddr;
-        sRegString += "&CMDPORT=" + 20701;
-        sRegString += "&DATAPORT=" + 20700;
-        sRegString += "&OS=Android-" + dc.GetOSInfo();
-        sRegString += "&SCRNWIDTH=" + xy[0];
-        sRegString += "&SCRNHEIGHT=" + xy[1];
-        sRegString += "&BPP=8";
-        sRegString += "&MEMORY=" + dc.GetMemoryConfig();
-        sRegString += "&HARDWARE=" + HardwareID;
-        sRegString += "&POOL=" + Pool;
-        sRegString += "&ABI=" + Abi;
-
-        String sTemp = Uri.encode(sRegString,"=&");
-        sRegString = "register " + sTemp;
-
-        pruneCommandLog(dc.GetSystemTime(), dc.GetTestRoot());
-
-        if (!bNetworkingStarted)
-            {
-            Thread thread = new Thread(null, doStartService, "StartServiceBkgnd");
-            thread.start();
-            bNetworkingStarted = true;
-
-            Thread thread2 = new Thread(null, doRegisterDevice, "RegisterDeviceBkgnd");
-            thread2.start();
-            }
-
-        monitorBatteryState();
-
-        // If we are returning from an update let'em know we're back
-        Thread thread3 = new Thread(null, doUpdateCallback, "UpdateCallbackBkgnd");
-        thread3.start();
-
-        final Button goButton = (Button) findViewById(R.id.Button01);
-        goButton.setOnClickListener(new OnClickListener() {
-            public void onClick(View v) {
-                finish();
-                }
-            });
-        }
-
-    private class UpdateStatus implements Runnable {
-        public String sText = "";
-
-        UpdateStatus(String sStatus) {
-            sText = sStatus;
-        }
-
-        public void run() {
-            displayStatus(sText);
-        }
-    }
-
-    public synchronized void displayStatus(String sStatus) {
-        String sTVText = (String) tv.getText();
-        sTVText += sStatus;
-        tv.setText(sTVText);
-    }
-
-    public void fixScreenOrientation()
-        {
-        setRequestedOrientation((getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) ?
-                                ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE : ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
-        }
-
-    protected void onActivityResult(int requestCode, int resultCode, Intent data)
-        {
-        if (requestCode == START_PRG)
-            {
-               Toast.makeText(getApplication().getApplicationContext(), "SUTAgent startprg finished ...", Toast.LENGTH_LONG).show();
-            }
-        }
-
-    @Override
-    public void onDestroy()
-        {
-        DoCommand dc = new DoCommand(getApplication());
-        super.onDestroy();
-        if (isFinishing())
-            {
-            log(dc, "onDestroy - finishing");
-            Intent listenerSvc = new Intent(this, ASMozStub.class);
-            listenerSvc.setAction("com.mozilla.SUTAgentAndroid.service.LISTENER_SERVICE");
-            stopService(listenerSvc);
-            bNetworkingStarted = false;
-
-            unregisterReceiver(battReceiver);
-
-            if (wl != null)
-                wl.release();
-
-            System.exit(0);
-            }
-        else
-            {
-            log(dc, "onDestroy - not finishing");
-            }
-        }
-
-    private void logMemory(String caller)
-        {
-        DoCommand dc = new DoCommand(getApplication());
-        if (dc != null)
-            {
-            log(dc, caller);
-            log(dc, dc.GetMemoryInfo());
-            String procInfo = dc.GetProcessInfo();
-            if (procInfo != null)
-                {
-                String lines[] = procInfo.split("\n");
-                for (String line : lines) 
-                    {
-                    if (line.contains("mozilla"))
-                        {
-                        log(dc, line);
-                        String words[] = line.split("\t");
-                        if ((words != null) && (words.length > 1))
-                            {
-                            log(dc, dc.StatProcess(words[1]));
-                            }
-                        }
-                    }
-                }
-            }
-        else
-            {
-            Log.e("SUTAgentAndroid", "logMemory: unable to log to file!");
-            }
-        }
-
-    @Override
-    public void onLowMemory()
-        {
-        System.gc();
-        logMemory("onLowMemory");
-        }
-
-    @Override
-    public void onTrimMemory(int level)
-        {
-        System.gc();
-        logMemory("onTrimMemory"+level);
-        }
-
-    private void monitorBatteryState()
-        {
-        battReceiver = new BroadcastReceiver()
-            {
-            public void onReceive(Context context, Intent intent)
-                {
-                StringBuilder sb = new StringBuilder();
-
-                int rawlevel = intent.getIntExtra(BatteryManager.EXTRA_LEVEL, -1); // charge level from 0 to scale inclusive
-                int scale = intent.getIntExtra(BatteryManager.EXTRA_SCALE, -1); // Max value for charge level
-                int status = intent.getIntExtra(BatteryManager.EXTRA_STATUS, -1);
-                int health = intent.getIntExtra(BatteryManager.EXTRA_HEALTH, -1);
-                boolean present = intent.getBooleanExtra(BatteryManager.EXTRA_PRESENT, false);
-                int plugged = intent.getIntExtra(BatteryManager.EXTRA_PLUGGED, -1); //0 if the device is not plugged in; 1 if plugged into an AC power adapter; 2 if plugged in via USB.
-//                int voltage = intent.getIntExtra(BatteryManager.EXTRA_VOLTAGE, -1); // voltage in millivolts
-                nBatteryTemp = intent.getIntExtra(BatteryManager.EXTRA_TEMPERATURE, -1); // current battery temperature in tenths of a degree Centigrade
-//                String technology = intent.getStringExtra(BatteryManager.EXTRA_TECHNOLOGY);
-
-                nChargeLevel = -1;  // percentage, or -1 for unknown
-                if (rawlevel >= 0 && scale > 0)
-                    {
-                    nChargeLevel = (rawlevel * 100) / scale;
-                    }
-
-                if (plugged > 0)
-                    sACStatus = "ONLINE";
-                else
-                    sACStatus = "OFFLINE";
-
-                if (present == false)
-                    sb.append("NO BATTERY");
-                else
-                    {
-                    if (nChargeLevel < 10)
-                        sb.append("Critical");
-                    else if (nChargeLevel < 33)
-                        sb.append("LOW");
-                    else if (nChargeLevel > 80)
-                        sb.append("HIGH");
-                    }
-
-                if (BatteryManager.BATTERY_HEALTH_OVERHEAT == health)
-                    {
-                    sb.append("Overheated ");
-                    sb.append((((float)(nBatteryTemp))/10));
-                    sb.append("(C)");
-                    }
-                else
-                    {
-                    switch(status)
-                        {
-                        case BatteryManager.BATTERY_STATUS_UNKNOWN:
-                            // old emulator; maybe also when plugged in with no battery
-                            if (present == true)
-                                sb.append(" UNKNOWN");
-                            break;
-                        case BatteryManager.BATTERY_STATUS_CHARGING:
-                            sb.append(" CHARGING");
-                            break;
-                        case BatteryManager.BATTERY_STATUS_DISCHARGING:
-                            sb.append(" DISCHARGING");
-                            break;
-                        case BatteryManager.BATTERY_STATUS_NOT_CHARGING:
-                            sb.append(" NOTCHARGING");
-                            break;
-                        case BatteryManager.BATTERY_STATUS_FULL:
-                            sb.append(" FULL");
-                            break;
-                        default:
-                            if (present == true)
-                                sb.append("Unknown");
-                            break;
-                        }
-                    }
-
-                sPowerStatus = sb.toString();
-                }
-            };
-
-        IntentFilter battFilter = new IntentFilter(Intent.ACTION_BATTERY_CHANGED);
-        registerReceiver(battReceiver, battFilter);
-        }
-
-    public boolean setUpNetwork(String sIniFile)
-        {
-        boolean    bRet = false;
-        int    lcv    = 0;
-        int    lcv2 = 0;
-        WifiManager wifi = (WifiManager) getSystemService(Context.WIFI_SERVICE);
-        WifiConfiguration wc = new WifiConfiguration();
-        DoCommand tmpdc = new DoCommand(getApplication());
-
-        String ssid = tmpdc.GetIniData("Network Settings", "SSID", sIniFile);
-        String auth = tmpdc.GetIniData("Network Settings", "AUTH", sIniFile);
-        String encr = tmpdc.GetIniData("Network Settings", "ENCR", sIniFile);
-        String key = tmpdc.GetIniData("Network Settings", "KEY", sIniFile);
-        String eap = tmpdc.GetIniData("Network Settings", "EAP", sIniFile);
-        String adhoc = tmpdc.GetIniData("Network Settings", "ADHOC", sIniFile);
-
-        Toast.makeText(getApplication().getApplicationContext(), "Starting and configuring network", Toast.LENGTH_LONG).show();
-/*
-        ContentResolver cr = getContentResolver();
-        int nRet;
-        try {
-            nRet = Settings.System.getInt(cr, Settings.System.WIFI_USE_STATIC_IP);
-            String foo2 = "" + nRet;
-        } catch (SettingNotFoundException e1) {
-            e1.printStackTrace();
-        }
-*/
-/*
-        wc.SSID = "\"Mozilla-Build\"";
-        wc.preSharedKey  = "\"MozillaBuildQA500\"";
-        wc.hiddenSSID = true;
-        wc.status = WifiConfiguration.Status.ENABLED;
-        wc.allowedAuthAlgorithms.set(WifiConfiguration.AuthAlgorithm.OPEN);
-        wc.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.TKIP);
-        wc.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.CCMP);
-        wc.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.WPA_PSK);
-        wc.allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.TKIP);
-        wc.allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.CCMP);
-        wc.allowedProtocols.set(WifiConfiguration.Protocol.RSN);
-*/
-        wc.SSID = "\"" + ssid + "\"";
-//        wc.SSID = "\"Mozilla-G\"";
-//        wc.SSID = "\"Mozilla\"";
-
-        if (auth.contentEquals("wpa2"))
-            {
-            wc.allowedProtocols.set(WifiConfiguration.Protocol.RSN);
-            wc.preSharedKey  = null;
-            }
-
-        if (encr.contentEquals("aes"))
-            {
-            wc.allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.CCMP);
-            wc.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.CCMP);
-            }
-
-        if (eap.contentEquals("peap"))
-            {
-            wc.eap.setValue("PEAP");
-            wc.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.WPA_EAP);
-            wc.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.IEEE8021X);
-            }
-
-        wc.status = WifiConfiguration.Status.ENABLED;
-
-        if (!wifi.isWifiEnabled())
-            wifi.setWifiEnabled(true);
-
-        while(wifi.getWifiState() != WifiManager.WIFI_STATE_ENABLED)
-            {
-            Thread.yield();
-            if (++lcv > 10000)
-                return(bRet);
-            }
-
-        wl = wifi.createWifiLock(WifiManager.WIFI_MODE_FULL, "SUTAgent");
-        if (wl != null)
-            wl.acquire();
-
-        WifiConfiguration    foo = null;
-        int                    nNetworkID = -1;
-
-        List<WifiConfiguration> connsLst =  wifi.getConfiguredNetworks();
-        int nConns = connsLst.size();
-        for (int i = 0; i < nConns; i++)
-            {
-
-            foo = connsLst.get(i);
-            if (foo.SSID.equalsIgnoreCase(wc.SSID))
-                {
-                nNetworkID = foo.networkId;
-                wc.networkId = foo.networkId;
-                break;
-                }
-            }
-
-        int res;
-
-        if (nNetworkID != -1)
-            {
-            res = wifi.updateNetwork(wc);
-            }
-        else
-            {
-            res = wifi.addNetwork(wc);
-            }
-
-        Log.d("WifiPreference", "add Network returned " + res );
-
-        boolean b = wifi.enableNetwork(res, true);
-        Log.d("WifiPreference", "enableNetwork returned " + b );
-
-        wifi.saveConfiguration();
-
-        WifiInfo wi = wifi.getConnectionInfo();
-        SupplicantState ss = wi.getSupplicantState();
-
-        lcv = 0;
-        lcv2 = 0;
-
-        while (ss.compareTo(SupplicantState.COMPLETED) != 0)
-            {
-            try {
-                Thread.sleep(1000);
-                }
-            catch (InterruptedException e)
-                {
-                e.printStackTrace();
-                }
-
-            if (wi != null)
-                wi = null;
-            if (ss != null)
-                ss = null;
-            wi = wifi.getConnectionInfo();
-            ss = wi.getSupplicantState();
-            if (++lcv > 60)
-                {
-                if (++lcv2 > 5)
-                    {
-                    Toast.makeText(getApplication().getApplicationContext(), "Unable to start and configure network", Toast.LENGTH_LONG).show();
-                    return(bRet);
-                    }
-                else
-                    {
-                    Toast.makeText(getApplication().getApplicationContext(), "Resetting wifi interface", Toast.LENGTH_LONG).show();
-                    if (wl != null)
-                        wl.release();
-                    wifi.setWifiEnabled(false);
-                    while(wifi.getWifiState() != WifiManager.WIFI_STATE_DISABLED)
-                        {
-                        Thread.yield();
-                        }
-
-                    wifi.setWifiEnabled(true);
-                    while(wifi.getWifiState() != WifiManager.WIFI_STATE_ENABLED)
-                        {
-                        Thread.yield();
-                        }
-                    b = wifi.enableNetwork(res, true);
-                    Log.d("WifiPreference", "enableNetwork returned " + b );
-                    if (wl != null)
-                        wl.acquire();
-                    lcv = 0;
-                    }
-                }
-            }
-
-        lcv = 0;
-        while(getLocalIpAddress() == null)
-            {
-            if (++lcv > 10000)
-                return(bRet);
-            }
-
-        Toast.makeText(getApplication().getApplicationContext(), "Network started and configured", Toast.LENGTH_LONG).show();
-        bRet = true;
-
-        return(bRet);
-        }
-
-    // If there is an update.info file callback the server and send the status
-    private Runnable doUpdateCallback = new Runnable() {
-        public void run() {
-            DoCommand dc = new DoCommand(getApplication());
-            String sRet = dc.UpdateCallBack("update.info");
-            if (sRet.length() > 0) {
-                if (sRet.contains("ok")) {
-                    sRet = "Callback Server contacted successfully" + lineSep;
-                } else if (sRet.contains("Nothing to do")) {
-                    sRet = "";
-                } else {
-                    sRet = "Callback Server NOT contacted successfully" + lineSep;
-                }
-            }
-            if (sRet.length() > 0)
-                mHandler.post(new UpdateStatus(sRet));
-            dc = null;
-        }
-    };
-
-    // registers with the reg server defined in the SUTAgent.ini file
-    private Runnable doRegisterDevice = new Runnable() {
-        public void run() {
-            DoCommand dc = new DoCommand(getApplication());
-            String sRet = "";
-            if (RegSvrIPAddr.length() > 0) {
-                String sRegRet = dc.RegisterTheDevice(RegSvrIPAddr, RegSvrIPPort, sRegString);
-                if (sRegRet.contains("ok")) {
-                    sRet += "Registered with testserver" + lineSep;
-                    sRet += "\tIPAddress: " + RegSvrIPAddr + lineSep;
-                    if (RegSvrIPPort.length() > 0)
-                        sRet += "\tPort: " + RegSvrIPPort + lineSep;
-                } else {
-                    sRet += "Not registered with testserver" + lineSep;
-                }
-            } else {
-                sRet += "Not registered with testserver" + lineSep;
-            }
-
-        if (sRet.length() > 0)
-            mHandler.post(new UpdateStatus(sRet));
-        dc = null;
-        }
-    };
-
-    // this starts the listener service for the command and data channels
-    private Runnable doStartService = new Runnable()
-        {
-        public void run()
-            {
-            Intent listenerService = new Intent();
-            listenerService.setAction("com.mozilla.SUTAgentAndroid.service.LISTENER_SERVICE");
-            startService(listenerService);
-            }
-        };
-
-    static String sHWID = null;
-    public static String getHWID(Context cx) {
-        if (sHWID != null)
-            return sHWID;
-
-        // If we're on SDK version > 8, use Build.SERIAL
-        if (android.os.Build.VERSION.SDK_INT > 8) {
-            sHWID = android.os.Build.SERIAL;
-        }
-
-        if (sHWID != null)
-            return sHWID;
-
-        // Otherwise, try from the telephony manager
-        TelephonyManager mTelephonyMgr = (TelephonyManager) cx.getSystemService(TELEPHONY_SERVICE);
-        if (mTelephonyMgr != null) {
-            sHWID = mTelephonyMgr.getDeviceId();
-        }
-
-        if (sHWID != null)
-            return sHWID;
-
-        // Otherwise, try WIFI_SERVICE and use the wifi manager
-        WifiManager wifiMan = (WifiManager) cx.getSystemService(Context.WIFI_SERVICE);
-        if (wifiMan != null) {
-            WifiInfo wifi = wifiMan.getConnectionInfo();
-            if (wifi != null) {
-                sHWID = "wifimac" + wifi.getMacAddress();
-            }
-        }
-
-        if (sHWID != null)
-            return sHWID;
-
-        sHWID = "0011223344556677";
-
-        return sHWID;
-    }
-
-    public static boolean isIPv4Address(final String input) {
-        return IPV4_PATTERN.matcher(input).matches();
-    }
-
-    public static InetAddress getLocalInetAddress() throws SocketException
-        {
-        for (Enumeration<NetworkInterface> en = NetworkInterface.getNetworkInterfaces(); en.hasMoreElements();)
-            {
-            NetworkInterface intf = en.nextElement();
-            for (Enumeration<InetAddress> enumIpAddr = intf.getInetAddresses(); enumIpAddr.hasMoreElements();)
-                {
-                InetAddress inetAddress = enumIpAddr.nextElement();
-                if (!inetAddress.isLoopbackAddress() && isIPv4Address(inetAddress.getHostAddress()))
-                    {
-                        return inetAddress;
-                    }
-                }
-            }
-
-        return null;
-        }
-
-    public String getLocalIpAddress()
-        {
-        try {
-            InetAddress inetAddress = getLocalInetAddress();
-            if (inetAddress != null)
-                return inetAddress.getHostAddress().toString();
-            }
-        catch (SocketException ex)
-            {
-            Toast.makeText(getApplication().getApplicationContext(), ex.toString(), Toast.LENGTH_LONG).show();
-            }
-        return null;
-        }
-
-    public static void log(DoCommand dc, String message)
-        {
-        Log.i("SUTAgentAndroid", message);
-
-        if (SUTAgentAndroid.LogCommands == false)
-            {
-            return;
-            }
-
-        if (message == null)
-            {
-            Log.e("SUTAgentAndroid", "bad arguments in log()!");
-            return;
-            }
-        String fileDateStr = "00";
-        String testRoot = dc.GetTestRoot();
-        String datestamp = dc.GetSystemTime();
-        if (testRoot == null || datestamp == null)
-            {
-            Log.e("SUTAgentAndroid", "Unable to get testRoot or datestamp in log!");
-            return;
-            }
-
-
-        try 
-            {
-            SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss:SSS");
-            Date dateStr = sdf.parse(datestamp);
-            SimpleDateFormat sdf_file = new SimpleDateFormat("yyyy-MM-dd");
-            fileDateStr = sdf_file.format(dateStr);
-            } 
-        catch (ParseException pe) {}
-        String logFile = testRoot + "/" + fileDateStr + "-sutcommands.txt";
-        PrintWriter pw = null;
-        try 
-            {
-            pw = new PrintWriter(new FileWriter(logFile, true));
-            pw.println(datestamp + " : " + message);
-            } 
-            catch (IOException ioe) 
-            {
-                Log.e("SUTAgentAndroid", "exception with file writer on: " + logFile);
-            } 
-            finally 
-            {
-                if (pw != null)
-                {
-                    pw.close();
-                }
-            }
-
-        }
-}
deleted file mode 100755
--- a/build/mobile/sutagent/android/WifiConfiguration.java
+++ /dev/null
@@ -1,480 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.net.wifi;
-
-import android.os.Parcelable;
-import android.os.Parcel;
-
-import java.util.BitSet;
-
-/**
- * A class representing a configured Wi-Fi network, including the
- * security configuration. Android will not necessarily support
- * all of these security schemes initially.
- */
-public class WifiConfiguration implements Parcelable {
-
-    /** {@hide} */
-    public static final String ssidVarName = "ssid";
-    /** {@hide} */
-    public static final String bssidVarName = "bssid";
-    /** {@hide} */
-    public static final String pskVarName = "psk";
-    /** {@hide} */
-    public static final String[] wepKeyVarNames = { "wep_key0", "wep_key1", "wep_key2", "wep_key3" };
-    /** {@hide} */
-    public static final String wepTxKeyIdxVarName = "wep_tx_keyidx";
-    /** {@hide} */
-    public static final String priorityVarName = "priority";
-    /** {@hide} */
-    public static final String hiddenSSIDVarName = "scan_ssid";
-
-    public class EnterpriseField {
-        private String varName;
-        private String value;
-
-        private EnterpriseField(String varName) {
-            this.varName = varName;
-            this.value = null;
-        }
-
-        public void setValue(String value) {
-            this.value = value;
-        }
-
-        public String varName() {
-            return varName;
-        }
-
-        public String value() {
-            return value;
-        }
-    }
-
-    public EnterpriseField eap = new EnterpriseField("eap");
-    public EnterpriseField phase2 = new EnterpriseField("phase2");
-    public EnterpriseField identity = new EnterpriseField("identity");
-    public EnterpriseField anonymous_identity = new EnterpriseField("anonymous_identity");
-    public EnterpriseField password = new EnterpriseField("password");
-    public EnterpriseField client_cert = new EnterpriseField("client_cert");
-    public EnterpriseField private_key = new EnterpriseField("private_key");
-    public EnterpriseField ca_cert = new EnterpriseField("ca_cert");
-
-    public EnterpriseField[] enterpriseFields = {
-            eap, phase2, identity, anonymous_identity, password, client_cert,
-            private_key, ca_cert };
-
-    /**
-     * Recognized key management schemes.
-     */
-    public static class KeyMgmt {
-        private KeyMgmt() { }
-
-        /** WPA is not used; plaintext or static WEP could be used. */
-        public static final int NONE = 0;
-        /** WPA pre-shared key (requires {@code preSharedKey} to be specified). */
-        public static final int WPA_PSK = 1;
-        /** WPA using EAP authentication. Generally used with an external authentication server. */
-        public static final int WPA_EAP = 2;
-        /** IEEE 802.1X using EAP authentication and (optionally) dynamically
-         * generated WEP keys. */
-        public static final int IEEE8021X = 3;
-
-        public static final String varName = "key_mgmt";
-
-        public static final String[] strings = { "NONE", "WPA_PSK", "WPA_EAP", "IEEE8021X" };
-    }
-
-    /**
-     * Recognized security protocols.
-     */
-    public static class Protocol {
-        private Protocol() { }
-
-        /** WPA/IEEE 802.11i/D3.0 */
-        public static final int WPA = 0;
-        /** WPA2/IEEE 802.11i */
-        public static final int RSN = 1;
-
-        public static final String varName = "proto";
-
-        public static final String[] strings = { "WPA", "RSN" };
-    }
-
-    /**
-     * Recognized IEEE 802.11 authentication algorithms.
-     */
-    public static class AuthAlgorithm {
-        private AuthAlgorithm() { }
-
-        /** Open System authentication (required for WPA/WPA2) */
-        public static final int OPEN = 0;
-        /** Shared Key authentication (requires static WEP keys) */
-        public static final int SHARED = 1;
-        /** LEAP/Network EAP (only used with LEAP) */
-        public static final int LEAP = 2;
-
-        public static final String varName = "auth_alg";
-
-        public static final String[] strings = { "OPEN", "SHARED", "LEAP" };
-    }
-
-    /**
-     * Recognized pairwise ciphers for WPA.
-     */
-    public static class PairwiseCipher {
-        private PairwiseCipher() { }
-
-        /** Use only Group keys (deprecated) */
-        public static final int NONE = 0;
-        /** Temporal Key Integrity Protocol [IEEE 802.11i/D7.0] */
-        public static final int TKIP = 1;
-        /** AES in Counter mode with CBC-MAC [RFC 3610, IEEE 802.11i/D7.0] */
-        public static final int CCMP = 2;
-
-        public static final String varName = "pairwise";
-
-        public static final String[] strings = { "NONE", "TKIP", "CCMP" };
-    }
-
-    /**
-     * Recognized group ciphers.
-     * <pre>
-     * CCMP = AES in Counter mode with CBC-MAC [RFC 3610, IEEE 802.11i/D7.0]
-     * TKIP = Temporal Key Integrity Protocol [IEEE 802.11i/D7.0]
-     * WEP104 = WEP (Wired Equivalent Privacy) with 104-bit key
-     * WEP40 = WEP (Wired Equivalent Privacy) with 40-bit key (original 802.11)
-     * </pre>
-     */
-    public static class GroupCipher {
-        private GroupCipher() { }
-
-        /** WEP40 = WEP (Wired Equivalent Privacy) with 40-bit key (original 802.11) */
-        public static final int WEP40 = 0;
-        /** WEP104 = WEP (Wired Equivalent Privacy) with 104-bit key */
-        public static final int WEP104 = 1;
-        /** Temporal Key Integrity Protocol [IEEE 802.11i/D7.0] */
-        public static final int TKIP = 2;
-        /** AES in Counter mode with CBC-MAC [RFC 3610, IEEE 802.11i/D7.0] */
-        public static final int CCMP = 3;
-
-        public static final String varName = "group";
-
-        public static final String[] strings = { "WEP40", "WEP104", "TKIP", "CCMP" };
-    }
-
-    /** Possible status of a network configuration. */
-    public static class Status {
-        private Status() { }
-
-        /** this is the network we are currently connected to */
-        public static final int CURRENT = 0;
-        /** supplicant will not attempt to use this network */
-        public static final int DISABLED = 1;
-        /** supplicant will consider this network available for association */
-        public static final int ENABLED = 2;
-
-        public static final String[] strings = { "current", "disabled", "enabled" };
-    }
-
-    /**
-     * The ID number that the supplicant uses to identify this
-     * network configuration entry. This must be passed as an argument
-     * to most calls into the supplicant.
-     */
-    public int networkId;
-
-    /**
-     * The current status of this network configuration entry.
-     * @see Status
-     */
-    public int status;
-    /**
-     * The network's SSID. Can either be an ASCII string,
-     * which must be enclosed in double quotation marks
-     * (e.g., {@code &quot;MyNetwork&quot;}, or a string of
-     * hex digits,which are not enclosed in quotes
-     * (e.g., {@code 01a243f405}).
-     */
-    public String SSID;
-    /**
-     * When set, this network configuration entry should only be used when
-     * associating with the AP having the specified BSSID. The value is
-     * a string in the format of an Ethernet MAC address, e.g.,
-     * <code>XX:XX:XX:XX:XX:XX</code> where each <code>X</code> is a hex digit.
-     */
-    public String BSSID;
-
-    /**
-     * Pre-shared key for use with WPA-PSK.
-     * <p/>
-     * When the value of this key is read, the actual key is
-     * not returned, just a "*" if the key has a value, or the null
-     * string otherwise.
-     */
-    public String preSharedKey;
-    /**
-     * Up to four WEP keys. Either an ASCII string enclosed in double
-     * quotation marks (e.g., {@code &quot;abcdef&quot;} or a string
-     * of hex digits (e.g., {@code 0102030405}).
-     * <p/>
-     * When the value of one of these keys is read, the actual key is
-     * not returned, just a "*" if the key has a value, or the null
-     * string otherwise.
-     */
-    public String[] wepKeys;
-
-    /** Default WEP key index, ranging from 0 to 3. */
-    public int wepTxKeyIndex;
-
-    /**
-     * Priority determines the preference given to a network by {@code wpa_supplicant}
-     * when choosing an access point with which to associate.
-     */
-    public int priority;
-
-    /**
-     * This is a network that does not broadcast its SSID, so an
-     * SSID-specific probe request must be used for scans.
-     */
-    public boolean hiddenSSID;
-
-    /**
-     * The set of key management protocols supported by this configuration.
-     * See {@link KeyMgmt} for descriptions of the values.
-     * Defaults to WPA-PSK WPA-EAP.
-     */
-    public BitSet allowedKeyManagement;
-    /**
-     * The set of security protocols supported by this configuration.
-     * See {@link Protocol} for descriptions of the values.
-     * Defaults to WPA RSN.
-     */
-    public BitSet allowedProtocols;
-    /**
-     * The set of authentication protocols supported by this configuration.
-     * See {@link AuthAlgorithm} for descriptions of the values.
-     * Defaults to automatic selection.
-     */
-    public BitSet allowedAuthAlgorithms;
-    /**
-     * The set of pairwise ciphers for WPA supported by this configuration.
-     * See {@link PairwiseCipher} for descriptions of the values.
-     * Defaults to CCMP TKIP.
-     */
-    public BitSet allowedPairwiseCiphers;
-    /**
-     * The set of group ciphers supported by this configuration.
-     * See {@link GroupCipher} for descriptions of the values.
-     * Defaults to CCMP TKIP WEP104 WEP40.
-     */
-    public BitSet allowedGroupCiphers;
-
-
-    public WifiConfiguration() {
-        networkId = -1;
-        SSID = null;
-        BSSID = null;
-        priority = 0;
-        hiddenSSID = false;
-        allowedKeyManagement = new BitSet();
-        allowedProtocols = new BitSet();
-        allowedAuthAlgorithms = new BitSet();
-        allowedPairwiseCiphers = new BitSet();
-        allowedGroupCiphers = new BitSet();
-        wepKeys = new String[4];
-        for (int i = 0; i < wepKeys.length; i++)
-            wepKeys[i] = null;
-        for (EnterpriseField field : enterpriseFields) {
-            field.setValue(null);
-        }
-    }
-
-    public String toString() {
-        StringBuilder sbuf = new StringBuilder();
-        if (this.status == WifiConfiguration.Status.CURRENT) {
-            sbuf.append("* ");
-        } else if (this.status == WifiConfiguration.Status.DISABLED) {
-            sbuf.append("- ");
-        }
-        sbuf.append("ID: ").append(this.networkId).append(" SSID: ").append(this.SSID).
-                append(" BSSID: ").append(this.BSSID).append(" PRIO: ").append(this.priority).
-                append('\n');
-        sbuf.append(" KeyMgmt:");
-        for (int k = 0; k < this.allowedKeyManagement.size(); k++) {
-            if (this.allowedKeyManagement.get(k)) {
-                sbuf.append(" ");
-                if (k < KeyMgmt.strings.length) {
-                    sbuf.append(KeyMgmt.strings[k]);
-                } else {
-                    sbuf.append("??");
-                }
-            }
-        }
-        sbuf.append(" Protocols:");
-        for (int p = 0; p < this.allowedProtocols.size(); p++) {
-            if (this.allowedProtocols.get(p)) {
-                sbuf.append(" ");
-                if (p < Protocol.strings.length) {
-                    sbuf.append(Protocol.strings[p]);
-                } else {
-                    sbuf.append("??");
-                }
-            }
-        }
-        sbuf.append('\n');
-        sbuf.append(" AuthAlgorithms:");
-        for (int a = 0; a < this.allowedAuthAlgorithms.size(); a++) {
-            if (this.allowedAuthAlgorithms.get(a)) {
-                sbuf.append(" ");
-                if (a < AuthAlgorithm.strings.length) {
-                    sbuf.append(AuthAlgorithm.strings[a]);
-                } else {
-                    sbuf.append("??");
-                }
-            }
-        }
-        sbuf.append('\n');
-        sbuf.append(" PairwiseCiphers:");
-        for (int pc = 0; pc < this.allowedPairwiseCiphers.size(); pc++) {
-            if (this.allowedPairwiseCiphers.get(pc)) {
-                sbuf.append(" ");
-                if (pc < PairwiseCipher.strings.length) {
-                    sbuf.append(PairwiseCipher.strings[pc]);
-                } else {
-                    sbuf.append("??");
-                }
-            }
-        }
-        sbuf.append('\n');
-        sbuf.append(" GroupCiphers:");
-        for (int gc = 0; gc < this.allowedGroupCiphers.size(); gc++) {
-            if (this.allowedGroupCiphers.get(gc)) {
-                sbuf.append(" ");
-                if (gc < GroupCipher.strings.length) {
-                    sbuf.append(GroupCipher.strings[gc]);
-                } else {
-                    sbuf.append("??");
-                }
-            }
-        }
-        sbuf.append('\n').append(" PSK: ");
-        if (this.preSharedKey != null) {
-            sbuf.append('*');
-        }
-
-        for (EnterpriseField field : enterpriseFields) {
-            sbuf.append('\n').append(" " + field.varName() + ": ");
-            String value = field.value();
-            if (value != null) sbuf.append(value);
-        }
-        sbuf.append('\n');
-        return sbuf.toString();
-    }
-
-    /**
-     * Construct a WifiConfiguration from a scanned network
-     * @param scannedAP the scan result used to construct the config entry
-     * TODO: figure out whether this is a useful way to construct a new entry.
-     *
-    public WifiConfiguration(ScanResult scannedAP) {
-        networkId = -1;
-        SSID = scannedAP.SSID;
-        BSSID = scannedAP.BSSID;
-    }
-    */
-
-    private static BitSet readBitSet(Parcel src) {
-        int cardinality = src.readInt();
-
-        BitSet set = new BitSet();
-        for (int i = 0; i < cardinality; i++)
-            set.set(src.readInt());
-
-        return set;
-    }
-
-    private static void writeBitSet(Parcel dest, BitSet set) {
-        int nextSetBit = -1;
-
-        dest.writeInt(set.cardinality());
-
-        while ((nextSetBit = set.nextSetBit(nextSetBit + 1)) != -1)
-            dest.writeInt(nextSetBit);
-    }
-
-    /** Implement the Parcelable interface {@hide} */
-    public int describeContents() {
-        return 0;
-    }
-
-    /** Implement the Parcelable interface {@hide} */
-    public void writeToParcel(Parcel dest, int flags) {
-        dest.writeInt(networkId);
-        dest.writeInt(status);
-        dest.writeString(SSID);
-        dest.writeString(BSSID);
-        dest.writeString(preSharedKey);
-        for (String wepKey : wepKeys)
-            dest.writeString(wepKey);
-        dest.writeInt(wepTxKeyIndex);
-        dest.writeInt(priority);
-        dest.writeInt(hiddenSSID ? 1 : 0);
-
-        writeBitSet(dest, allowedKeyManagement);
-        writeBitSet(dest, allowedProtocols);
-        writeBitSet(dest, allowedAuthAlgorithms);
-        writeBitSet(dest, allowedPairwiseCiphers);
-        writeBitSet(dest, allowedGroupCiphers);
-
-        for (EnterpriseField field : enterpriseFields) {
-            dest.writeString(field.value());
-        }
-    }
-
-    /** Implement the Parcelable interface {@hide} */
-    public static final Creator<WifiConfiguration> CREATOR =
-        new Creator<WifiConfiguration>() {
-            public WifiConfiguration createFromParcel(Parcel in) {
-                WifiConfiguration config = new WifiConfiguration();
-                config.networkId = in.readInt();
-                config.status = in.readInt();
-                config.SSID = in.readString();
-                config.BSSID = in.readString();
-                config.preSharedKey = in.readString();
-                for (int i = 0; i < config.wepKeys.length; i++)
-                    config.wepKeys[i] = in.readString();
-                config.wepTxKeyIndex = in.readInt();
-                config.priority = in.readInt();
-                config.hiddenSSID = in.readInt() != 0;
-                config.allowedKeyManagement   = readBitSet(in);
-                config.allowedProtocols       = readBitSet(in);
-                config.allowedAuthAlgorithms  = readBitSet(in);
-                config.allowedPairwiseCiphers = readBitSet(in);
-                config.allowedGroupCiphers    = readBitSet(in);
-
-                for (EnterpriseField field : config.enterpriseFields) {
-                    field.setValue(in.readString());
-                }
-                return config;
-            }
-
-            public WifiConfiguration[] newArray(int size) {
-                return new WifiConfiguration[size];
-            }
-        };
-}
deleted file mode 100644
--- a/build/mobile/sutagent/android/default.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-# This file is automatically generated by Android Tools.
-# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
-# 
-# This file must be checked in Version Control Systems.
-# 
-# To customize properties used by the Ant build system use,
-# "build.properties", and override values to adapt the script to your
-# project structure.
-
-# Indicates whether an apk should be generated for each density.
-split.density=false
-# Project target.
-target=android-5
deleted file mode 100644
--- a/build/mobile/sutagent/android/fencp/AndroidManifest.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
-   - License, v. 2.0. If a copy of the MPL was not distributed with this
-   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-      package="org.mozilla.fencp"
-      android:versionCode="1"
-      android:versionName="1.0" android:sharedUserId="org.mozilla.fennec.sharedID">
-    <application android:icon="@drawable/icon" android:label="@string/app_name" android:debuggable="true">
-        <activity android:label="@string/app_name" android:name="FenCP">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-
-    <provider android:name="FenCPFP" 
-              android:enabled="true" 
-              android:authorities="org.mozilla.fencp" 
-              android:exported="true">
-	</provider>
-</application>
-    <uses-sdk android:minSdkVersion="6" />
-
-</manifest> 
\ No newline at end of file
deleted file mode 100644
--- a/build/mobile/sutagent/android/fencp/DirCursor.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-package org.mozilla.fencp;
-
-import java.io.File;
-import java.io.IOException;
-
-import android.database.MatrixCursor;
-
-public class DirCursor extends MatrixCursor {
-    public static final String _ID = "_id";
-    public static final String ISDIR = "isdir";
-    public static final String FILENAME = "filename";
-    public static final String LENGTH = "length";
-    public static final String TIMESTAMP = "ts";
-    public static final String WRITABLE = "writable";
-    static final String[] DEFCOLUMNS = new String[] {
-            _ID,
-            ISDIR,
-            FILENAME,
-            LENGTH,
-            TIMESTAMP,
-            WRITABLE
-         };
-    private String dirPath = null;
-    private String [] theColumns = null;
-
-    public DirCursor(String[] columnNames, String sPath) {
-        super((columnNames == null ? DEFCOLUMNS : columnNames));
-        theColumns = (columnNames == null ? DEFCOLUMNS : columnNames);
-        dirPath = sPath;
-        doLoadCursor(dirPath);
-    }
-
-    public DirCursor(String[] columnNames, int initialCapacity, String sPath) {
-        super((columnNames == null ? DEFCOLUMNS : columnNames), initialCapacity);
-        theColumns = (columnNames == null ? DEFCOLUMNS : columnNames);
-        dirPath = sPath;
-        doLoadCursor(dirPath);
-    }
-    
-    private void doLoadCursor(String sDir) {
-        File dir = new File(sDir);
-        int    nFiles = 0;
-        int nCols = theColumns.length;
-        int    lcvFiles = 0;
-        int    nCIndex = 0;
-        Object [] vals = new Object[nCols];
-        
-        if (dir.isDirectory()) {
-            try {
-                nCIndex = getColumnIndex(_ID);
-                if (nCIndex > -1)
-                    vals[nCIndex] = -1;
-
-                nCIndex = getColumnIndex(ISDIR);
-                if (nCIndex > -1)
-                    vals[nCIndex] = 1;
-                
-                nCIndex = getColumnIndex(FILENAME);
-                if (nCIndex > -1)
-                    try {
-                        vals[nCIndex] = dir.getCanonicalPath();
-                    } catch (IOException e) {
-                        vals[nCIndex] = dir.getName();
-                    }
-
-                nCIndex = getColumnIndex(LENGTH);
-                if (nCIndex > -1)
-                    vals[nCIndex] = 0;
-                
-                nCIndex = getColumnIndex(TIMESTAMP);
-                if (nCIndex > -1)
-                    vals[nCIndex] = 0;
-                
-                nCIndex = getColumnIndex(WRITABLE);
-                if (nCIndex > -1)
-                    vals[nCIndex] = (dir.canWrite() ? 1 : 0);
-                
-                addRow(vals);
-                }
-            catch (IllegalArgumentException iae) {
-                iae.printStackTrace();
-            }
-            
-            File [] files = dir.listFiles();
-            if (files != null) {
-                if ((nFiles = files.length) > 0) {
-                    for (lcvFiles = 0; lcvFiles < nFiles; lcvFiles++) {
-                        nCIndex = getColumnIndex(_ID);
-                        if (nCIndex > -1)
-                            vals[nCIndex] = lcvFiles;
-
-                        nCIndex = getColumnIndex(ISDIR);
-                        if (nCIndex > -1)
-                            vals[nCIndex] = (files[lcvFiles].isDirectory() ? 1 : 0);
-                        
-                        nCIndex = getColumnIndex(FILENAME);
-                        if (nCIndex > -1)
-                                vals[nCIndex] = files[lcvFiles].getName();
-
-                        nCIndex = getColumnIndex(LENGTH);
-                        if (nCIndex > -1)
-                            vals[nCIndex] = (files[lcvFiles].isDirectory() ? -1 : files[lcvFiles].length());
-
-                        try {
-                            addRow(vals);
-                        } catch (IllegalArgumentException iae) {
-                            iae.printStackTrace();
-                        }
-                    }
-                }
-            }
-        } else {
-            if (dir.isFile()) {
-                nCIndex = getColumnIndex(_ID);
-                if (nCIndex > -1)
-                    vals[nCIndex] = -1;
-
-                nCIndex = getColumnIndex(ISDIR);
-                if (nCIndex > -1)
-                    vals[nCIndex] = 0;
-                
-                nCIndex = getColumnIndex(FILENAME);
-                if (nCIndex > -1)
-                    vals[nCIndex] = dir.getName();
-
-                nCIndex = getColumnIndex(LENGTH);
-                if (nCIndex > -1)
-                    vals[nCIndex] = dir.length();
-
-                nCIndex = getColumnIndex(TIMESTAMP);
-                if (nCIndex > -1) {
-                    vals[nCIndex] = dir.lastModified();
-                }
-                
-                try {
-                    addRow(vals);
-                    }
-                catch (IllegalArgumentException iae) {
-                    iae.printStackTrace();
-                }
-            }
-            else {
-                try {
-                    nCIndex = getColumnIndex(_ID);
-                    if (nCIndex > -1)
-                        vals[nCIndex] = -1;
-
-                    nCIndex = getColumnIndex(ISDIR);
-                    if (nCIndex > -1)
-                        vals[nCIndex] = 0;
-                    
-                    nCIndex = getColumnIndex(FILENAME);
-                    if (nCIndex > -1)
-                        vals[nCIndex] = null;
-
-                    nCIndex = getColumnIndex(LENGTH);
-                    if (nCIndex > -1)
-                        vals[nCIndex] = 0;
-                    
-                    nCIndex = getColumnIndex(TIMESTAMP);
-                    if (nCIndex > -1)
-                        vals[nCIndex] = 0;
-                    
-                    addRow(vals);
-                    }
-                catch (IllegalArgumentException iae) {
-                    iae.printStackTrace();
-                }
-            }
-        }
-    }
-}
deleted file mode 100644
--- a/build/mobile/sutagent/android/fencp/FenCP.java
+++ /dev/null
@@ -1,16 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-package org.mozilla.fencp;
-
-import android.app.Activity;
-import android.os.Bundle;
-
-public class FenCP extends Activity {
-    /** Called when the activity is first created. */
-    @Override
-    public void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        setContentView(R.layout.main);
-    }
-}
\ No newline at end of file
deleted file mode 100644
--- a/build/mobile/sutagent/android/fencp/FenCPFP.java
+++ /dev/null
@@ -1,193 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-package org.mozilla.fencp;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-
-import android.content.ContentProvider;
-import android.content.ContentValues;
-import android.content.UriMatcher;
-import android.database.Cursor;
-import android.net.Uri;
-
-public class FenCPFP extends ContentProvider {
-    public static final String PROVIDER_NAME = "org.mozilla.fencp";
-    public static final Uri CONTENT_URI = Uri.parse("content://" + PROVIDER_NAME + "/file");
-
-    public static final String _ID = "_id";
-    public static final String ISDIR = "isdir";
-    public static final String FILENAME = "filename";
-    public static final String LENGTH = "length";
-    public static final String CHUNK = "chunk";
-    static String[] dircolumns = new String[] {
-        _ID,
-        ISDIR,
-        FILENAME,
-        LENGTH
-     };
-
-    static String[] filecolumns = new String[] {
-        _ID,
-        CHUNK
-     };
-
-    private static final int DIR = 1;
-    private static final int FILE_NAME = 2;
-
-    private static final UriMatcher uriMatcher;
-    static {
-        uriMatcher = new UriMatcher(UriMatcher.NO_MATCH);
-           uriMatcher.addURI(PROVIDER_NAME, "dir", DIR);
-           uriMatcher.addURI(PROVIDER_NAME, "file", FILE_NAME);
-        }
-
-    public int PruneDir(String sTmpDir) {
-        int    nRet = 0;
-        int nFiles = 0;
-        String sSubDir = null;
-
-        File dir = new File(sTmpDir);
-
-        if (dir.isDirectory()) {
-            File [] files = dir.listFiles();
-            if (files != null) {
-                if ((nFiles = files.length) > 0) {
-                    for (int lcv = 0; lcv < nFiles; lcv++) {
-                        if (files[lcv].isDirectory()) {
-                            sSubDir = files[lcv].getAbsolutePath();
-                            nRet += PruneDir(sSubDir);
-                        }
-                        else {
-                            if (files[lcv].delete()) {
-                                nRet++;
-                            }
-                        }
-                    }
-                }
-            }
-            if (dir.delete()) {
-                nRet++;
-            }
-            if ((nFiles + 1) > nRet) {
-                nRet = -1;
-            }
-        }
-
-    return(nRet);
-    }
-
-    @Override
-    public int delete(Uri uri, String selection, String[] selectionArgs) {
-        int nFiles = 0;
-        switch (uriMatcher.match(uri)) {
-            case FILE_NAME:
-                File f = new File(selection);
-                if (f.delete())
-                    nFiles = 1;
-                break;
-
-            case DIR:
-                nFiles = PruneDir(selection);
-                break;
-
-            default:
-                break;
-        }
-        return nFiles;
-    }
-
-    @Override
-    public String getType(Uri uri)
-        {
-        switch (uriMatcher.match(uri))
-            {
-            //---get directory---
-            case DIR:
-                return "vnd.android.cursor.dir/vnd.mozilla.dir ";
-            //---get a particular file---
-            case FILE_NAME:
-                return "vnd.android.cursor.item/vnd.mozilla.file ";
-            //---Unknown---
-            default:
-                throw new IllegalArgumentException("Unsupported URI: " + uri);
-            }
-    }
-
-    @Override
-    public Uri insert(Uri uri, ContentValues values) {
-        return null;
-    }
-
-    @Override
-    public boolean onCreate() {
-        return true;
-    }
-
-    @Override
-    public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) {
-        Cursor retCursor = null;
-
-        switch(uriMatcher.match(uri)) {
-            case DIR:
-                retCursor = new DirCursor(projection, selection);
-                break;
-
-            case FILE_NAME:
-                retCursor = new FileCursor(projection, selection, selectionArgs);
-                break;
-
-            default:
-                break;
-        }
-        return (retCursor);
-    }
-
-    @Override
-    public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) {
-        int    nRet = 0;
-        FileOutputStream dstFile = null;
-
-        switch(uriMatcher.match(uri)) {
-            case DIR:
-                File dir = new File(selection);
-                if (dir.mkdirs())
-                    nRet = 1;
-                break;
-
-            case FILE_NAME:
-                try {
-                    long lOffset = values.getAsLong("offset");
-                    byte [] buf = values.getAsByteArray(CHUNK);
-                    int    nLength = values.getAsInteger(LENGTH);
-                    if ((buf != null) && (nLength > 0)) {
-                        File f = new File(selection);
-                        dstFile = new FileOutputStream(f, (lOffset == 0 ? false : true));
-                        dstFile.write(buf,0, nLength);
-                        dstFile.flush();
-                        dstFile.close();
-                        nRet = nLength;
-                    }
-                } catch (FileNotFoundException fnfe) {
-                    fnfe.printStackTrace();
-                } catch (IOException ioe) {
-                    try {
-                        dstFile.flush();
-                    } catch (IOException e) {
-                    }
-                    try {
-                        dstFile.close();
-                    } catch (IOException e) {
-                    }
-                }
-                break;
-
-            default:
-                break;
-        }
-        return nRet;
-    }
-}
deleted file mode 100644
--- a/build/mobile/sutagent/android/fencp/FileCursor.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-package org.mozilla.fencp;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import android.database.AbstractWindowedCursor;
-import android.database.CursorWindow;
-
-public class FileCursor extends AbstractWindowedCursor {
-    public static final String _ID = "_id";
-    public static final String CHUNK = "chunk";
-    public static final String LENGTH = "length";
-    static final String[] DEFCOLUMNS = new String[] {
-            _ID,
-            CHUNK,
-            LENGTH
-         };
-    private String filePath = null;
-    private String [] theColumns = null;
-
-    private static final int BUFSIZE = 4096;
-    private long lFileSize = 0;
-    private int nCount = 0;
-    private File theFile = null;
-    private byte [] theBuffer = null;
-    private long lOffset = 0;
-    private long lLength = -1;
-
-    public FileCursor(String[] columnNames, String sFilePath, String [] selectionArgs) {
-        super();
-        theColumns = (columnNames == null ? DEFCOLUMNS : columnNames);
-        filePath = sFilePath;
-        nCount = -1;
-
-        if ((selectionArgs != null) && (selectionArgs.length > 0)) {
-            lOffset = Long.parseLong(selectionArgs[0]);
-            lLength = Long.parseLong(selectionArgs[1]);
-        }
-
-        if (filePath.length() > 0) {
-            theFile = new File(filePath);
-            if (theFile.exists() && theFile.canRead()) {
-                lFileSize = theFile.length();
-
-                // lLength == -1 return everything between lOffset and eof
-                // lLength == 0 return file length
-                // lLength > 0 return lLength bytes
-                if (lLength == -1) {
-                    lFileSize = lFileSize - lOffset;
-                } else if (lLength == 0) {
-                    // just return the file length
-                } else {
-                    lFileSize = ((lLength <= (lFileSize - lOffset)) ? lLength : (lFileSize - lOffset));
-                }
-
-                if (lLength != 0) {
-                    nCount = (int) (lFileSize / BUFSIZE);
-                    if ((lFileSize % BUFSIZE) > 0)
-                        nCount++;
-                } else {
-                    nCount = 1;
-                }
-
-            }
-        }
-    }
-
-    public String getColumnName (int columnIndex) {
-        return theColumns[columnIndex];
-    }
-
-    @Override
-    public String[] getColumnNames() {
-        return theColumns;
-    }
-
-    @Override
-    public int getCount() {
-        return nCount;
-    }
-
-    @Override
-    public boolean onMove(int oldPosition, int newPosition) {
-        boolean bRet = true;
-
-        // get rid of old data
-        mWindow.clear();
-        bRet = mWindow.setNumColumns(theColumns.length);
-        fillWindow(newPosition, mWindow);
-
-        return bRet;
-    }
-
-    @Override
-    public void fillWindow (int pos, CursorWindow window) {
-        int    nNumRows = window.getNumRows();
-        int nCIndex = 0;
-        window.setStartPosition(0);
-
-        if (pos > -1) {
-            if (nNumRows == 0) {
-                window.allocRow();
-                nNumRows = window.getNumRows();
-            }
-
-            if (nNumRows == 1) {
-                nCIndex = getColumnIndex(LENGTH);
-                if (nCIndex > -1) {
-                    window.putLong(lFileSize, 0, nCIndex);
-                }
-                nCIndex = getColumnIndex(_ID);
-                if (nCIndex > -1) {
-                    window.putLong((long)pos, 0, nCIndex);
-                }
-                nCIndex = getColumnIndex(CHUNK);
-                if (nCIndex > -1) {
-                    if (lLength != 0) {
-                        byte[] value = getABlob (pos, 1);
-                        window.putBlob(value, 0, nCIndex);
-                    }
-                }
-            }
-            window.setStartPosition(pos);
-        }
-        return;
-    }
-
-    public byte[] getABlob (int row, int column) {
-        int    nRead = 0;
-        int    nOffset = 0;
-        int nBufSize = 0;
-
-        if ((column == 1) && (theFile != null)) {
-            try {
-                FileInputStream fin = new FileInputStream(theFile);
-                nOffset = row * BUFSIZE;
-                if (row < (nCount - 1)) {
-                    nBufSize = BUFSIZE;
-                } else {
-                    nBufSize = (int) (lFileSize - nOffset);
-                }
-                theBuffer = new byte[nBufSize];
-
-                if (theBuffer != null) {
-                    if (fin.skip(nOffset + lOffset) == (nOffset + lOffset)) {
-                        if ((nRead = fin.read(theBuffer, 0, nBufSize)) != -1) {
-                            if (nRead != nBufSize) {
-                                return null;
-                            }
-                        }
-                    }
-                }
-
-            fin.close();
-            } catch (FileNotFoundException e) {
-                e.printStackTrace();
-            } catch (IOException e) {
-                e.printStackTrace();
-            }
-        }
-
-        return theBuffer;
-    }
-}
deleted file mode 100644
--- a/build/mobile/sutagent/android/fencp/Makefile.in
+++ /dev/null
@@ -1,14 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-include $(topsrcdir)/config/config.mk
-
-JAVAFILES = \
-  DirCursor.java \
-  FenCP.java \
-  FenCPFP.java \
-  FileCursor.java \
-  $(NULL)
-
-tools:: $(ANDROID_APK_NAME).apk
deleted file mode 100644
--- a/build/mobile/sutagent/android/fencp/default.properties
+++ /dev/null
@@ -1,15 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-# This file is automatically generated by Android Tools.
-# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
-# 
-# This file must be checked in Version Control Systems.
-# 
-# To customize properties used by the Ant build system use,
-# "build.properties", and override values to adapt the script to your
-# project structure.
-
-# Project target.
-target=android-6
deleted file mode 100644
--- a/build/mobile/sutagent/android/fencp/moz.build
+++ /dev/null
@@ -1,8 +0,0 @@
-# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-ANDROID_APK_NAME = 'FenCP'
-ANDROID_APK_PACKAGE = 'org.mozilla.fencp'
deleted file mode 100644
index 8074c4c571b8cd19e27f4ee5545df367420686d7..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index 1095584ec21f71cd0afc9e0993aa2209671b590c..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index a07c69fa5a0f4da5d5efe96eea12a543154dbab6..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
--- a/build/mobile/sutagent/android/fencp/res/layout/main.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
-   - License, v. 2.0. If a copy of the MPL was not distributed with this
-   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:orientation="vertical"
-    android:layout_width="fill_parent"
-    android:layout_height="fill_parent"
-    >
-<TextView  
-    android:layout_width="fill_parent" 
-    android:layout_height="wrap_content" 
-    android:text="@string/hello"
-    />
-</LinearLayout>
deleted file mode 100644
--- a/build/mobile/sutagent/android/fencp/res/values/strings.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
-   - License, v. 2.0. If a copy of the MPL was not distributed with this
-   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-
-<resources>
-    <string name="hello">Hello World, FennecCP!</string>
-    <string name="app_name">FennecCP</string>
-</resources>
deleted file mode 100644
--- a/build/mobile/sutagent/android/ffxcp/AndroidManifest.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
-   - License, v. 2.0. If a copy of the MPL was not distributed with this
-   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-      package="org.mozilla.ffxcp"
-      android:versionCode="1"
-      android:versionName="1.0" android:sharedUserId="org.mozilla.firefox.sharedID">
-    <application android:icon="@drawable/icon" android:label="@string/app_name" android:debuggable="true">
-        <activity android:label="@string/app_name" android:name="ffxcp">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-
-    <provider android:name="FfxCPFP" 
-              android:enabled="true" 
-              android:authorities="org.mozilla.ffxcp" 
-              android:exported="true">
-	</provider>
-    </application>
-    <uses-sdk android:minSdkVersion="6" />
-
-</manifest> 
\ No newline at end of file
deleted file mode 100644
--- a/build/mobile/sutagent/android/ffxcp/DirCursor.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-package org.mozilla.ffxcp;
-
-import java.io.File;
-import java.io.IOException;
-
-import android.database.MatrixCursor;
-
-public class DirCursor extends MatrixCursor {
-    public static final String _ID = "_id";
-    public static final String ISDIR = "isdir";
-    public static final String FILENAME = "filename";
-    public static final String LENGTH = "length";
-    public static final String TIMESTAMP = "ts";
-    public static final String WRITABLE = "writable";
-    static final String[] DEFCOLUMNS = new String[] {
-            _ID,
-            ISDIR,
-            FILENAME,
-            LENGTH,
-            TIMESTAMP,
-            WRITABLE
-         };
-    private String dirPath = null;
-    private String [] theColumns = null;
-
-    public DirCursor(String[] columnNames, String sPath) {
-        super((columnNames == null ? DEFCOLUMNS : columnNames));
-        theColumns = (columnNames == null ? DEFCOLUMNS : columnNames);
-        dirPath = sPath;
-        doLoadCursor(dirPath);
-    }
-
-    public DirCursor(String[] columnNames, int initialCapacity, String sPath) {
-        super((columnNames == null ? DEFCOLUMNS : columnNames), initialCapacity);
-        theColumns = (columnNames == null ? DEFCOLUMNS : columnNames);
-        dirPath = sPath;
-        doLoadCursor(dirPath);
-    }
-
-    private void doLoadCursor(String sDir) {
-        File dir = new File(sDir);
-        int    nFiles = 0;
-        int nCols = theColumns.length;
-        int    lcvFiles = 0;
-        int    nCIndex = 0;
-        Object [] vals = new Object[nCols];
-
-        if (dir.isDirectory()) {
-            try {
-                nCIndex = getColumnIndex(_ID);
-                if (nCIndex > -1)
-                    vals[nCIndex] = -1;
-
-                nCIndex = getColumnIndex(ISDIR);
-                if (nCIndex > -1)
-                    vals[nCIndex] = 1;
-
-                nCIndex = getColumnIndex(FILENAME);
-                if (nCIndex > -1)
-                    try {
-                        vals[nCIndex] = dir.getCanonicalPath();
-                    } catch (IOException e) {
-                        vals[nCIndex] = dir.getName();
-                    }
-
-                nCIndex = getColumnIndex(LENGTH);
-                if (nCIndex > -1)
-                    vals[nCIndex] = 0;
-
-                nCIndex = getColumnIndex(TIMESTAMP);
-                if (nCIndex > -1)
-                    vals[nCIndex] = 0;
-
-                nCIndex = getColumnIndex(WRITABLE);
-                if (nCIndex > -1)
-                    vals[nCIndex] = (dir.canWrite() ? 1 : 0);
-
-                addRow(vals);
-                }
-            catch (IllegalArgumentException iae) {
-                iae.printStackTrace();
-            }
-
-            File [] files = dir.listFiles();
-            if (files != null) {
-                if ((nFiles = files.length) > 0) {
-                    for (lcvFiles = 0; lcvFiles < nFiles; lcvFiles++) {
-                        nCIndex = getColumnIndex(_ID);
-                        if (nCIndex > -1)
-                            vals[nCIndex] = lcvFiles;
-
-                        nCIndex = getColumnIndex(ISDIR);
-                        if (nCIndex > -1)
-                            vals[nCIndex] = (files[lcvFiles].isDirectory() ? 1 : 0);
-
-                        nCIndex = getColumnIndex(FILENAME);
-                        if (nCIndex > -1)
-                                vals[nCIndex] = files[lcvFiles].getName();
-
-                        nCIndex = getColumnIndex(LENGTH);
-                        if (nCIndex > -1)
-                            vals[nCIndex] = (files[lcvFiles].isDirectory() ? -1 : files[lcvFiles].length());
-
-                        try {
-                            addRow(vals);
-                        } catch (IllegalArgumentException iae) {
-                            iae.printStackTrace();
-                        }
-                    }
-                }
-            }
-        } else {
-            if (dir.isFile()) {
-                nCIndex = getColumnIndex(_ID);
-                if (nCIndex > -1)
-                    vals[nCIndex] = -1;
-
-                nCIndex = getColumnIndex(ISDIR);
-                if (nCIndex > -1)
-                    vals[nCIndex] = 0;
-
-                nCIndex = getColumnIndex(FILENAME);
-                if (nCIndex > -1)
-                    vals[nCIndex] = dir.getName();
-
-                nCIndex = getColumnIndex(LENGTH);
-                if (nCIndex > -1)
-                    vals[nCIndex] = dir.length();
-
-                nCIndex = getColumnIndex(TIMESTAMP);
-                if (nCIndex > -1) {
-                    vals[nCIndex] = dir.lastModified();
-                }
-
-                try {
-                    addRow(vals);
-                    }
-                catch (IllegalArgumentException iae) {
-                    iae.printStackTrace();
-                }
-            }
-            else {
-                try {
-                    nCIndex = getColumnIndex(_ID);
-                    if (nCIndex > -1)
-                        vals[nCIndex] = -1;
-
-                    nCIndex = getColumnIndex(ISDIR);
-                    if (nCIndex > -1)
-                        vals[nCIndex] = 0;
-
-                    nCIndex = getColumnIndex(FILENAME);
-                    if (nCIndex > -1)
-                        vals[nCIndex] = null;
-
-                    nCIndex = getColumnIndex(LENGTH);
-                    if (nCIndex > -1)
-                        vals[nCIndex] = 0;
-
-                    nCIndex = getColumnIndex(TIMESTAMP);
-                    if (nCIndex > -1)
-                        vals[nCIndex] = 0;
-
-                    addRow(vals);
-                    }
-                catch (IllegalArgumentException iae) {
-                    iae.printStackTrace();
-                }
-            }
-        }
-    }
-}
deleted file mode 100644
--- a/build/mobile/sutagent/android/ffxcp/FfxCPFP.java
+++ /dev/null
@@ -1,193 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-package org.mozilla.ffxcp;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-
-import android.content.ContentProvider;
-import android.content.ContentValues;
-import android.content.UriMatcher;
-import android.database.Cursor;
-import android.net.Uri;
-
-public class FfxCPFP extends ContentProvider {
-    public static final String PROVIDER_NAME = "org.mozilla.ffxcp";
-    public static final Uri CONTENT_URI = Uri.parse("content://" + PROVIDER_NAME + "/file");
-
-    public static final String _ID = "_id";
-    public static final String ISDIR = "isdir";
-    public static final String FILENAME = "filename";
-    public static final String LENGTH = "length";
-    public static final String CHUNK = "chunk";
-    static String[] dircolumns = new String[] {
-        _ID,
-        ISDIR,
-        FILENAME,
-        LENGTH
-     };
-
-    static String[] filecolumns = new String[] {
-        _ID,
-        CHUNK
-     };
-
-    private static final int DIR = 1;
-    private static final int FILE_NAME = 2;
-
-    private static final UriMatcher uriMatcher;
-    static {
-        uriMatcher = new UriMatcher(UriMatcher.NO_MATCH);
-           uriMatcher.addURI(PROVIDER_NAME, "dir", DIR);
-           uriMatcher.addURI(PROVIDER_NAME, "file", FILE_NAME);
-        }
-
-    public int PruneDir(String sTmpDir) {
-        int    nRet = 0;
-        int nFiles = 0;
-        String sSubDir = null;
-
-        File dir = new File(sTmpDir);
-
-        if (dir.isDirectory()) {
-            File [] files = dir.listFiles();
-            if (files != null) {
-                if ((nFiles = files.length) > 0) {
-                    for (int lcv = 0; lcv < nFiles; lcv++) {
-                        if (files[lcv].isDirectory()) {
-                            sSubDir = files[lcv].getAbsolutePath();
-                            nRet += PruneDir(sSubDir);
-                        }
-                        else {
-                            if (files[lcv].delete()) {
-                                nRet++;
-                            }
-                        }
-                    }
-                }
-            }
-            if (dir.delete()) {
-                nRet++;
-            }
-            if ((nFiles + 1) > nRet) {
-                nRet = -1;
-            }
-        }
-
-    return(nRet);
-    }
-
-    @Override
-    public int delete(Uri uri, String selection, String[] selectionArgs) {
-        int nFiles = 0;
-        switch (uriMatcher.match(uri)) {
-            case FILE_NAME:
-                File f = new File(selection);
-                if (f.delete())
-                    nFiles = 1;
-                break;
-
-            case DIR:
-                nFiles = PruneDir(selection);
-                break;
-
-            default:
-                break;
-        }
-        return nFiles;
-    }
-
-    @Override
-    public String getType(Uri uri)
-        {
-        switch (uriMatcher.match(uri))
-            {
-            //---get directory---
-            case DIR:
-                return "vnd.android.cursor.dir/vnd.mozilla.dir ";
-            //---get a particular file---
-            case FILE_NAME:
-                return "vnd.android.cursor.item/vnd.mozilla.file ";
-            //---Unknown---
-            default:
-                throw new IllegalArgumentException("Unsupported URI: " + uri);
-            }
-    }
-
-    @Override
-    public Uri insert(Uri uri, ContentValues values) {
-        return null;
-    }
-
-    @Override
-    public boolean onCreate() {
-        return true;
-    }
-
-    @Override
-    public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) {
-        Cursor retCursor = null;
-
-        switch(uriMatcher.match(uri)) {
-            case DIR:
-                retCursor = new DirCursor(projection, selection);
-                break;
-
-            case FILE_NAME:
-                retCursor = new FileCursor(projection, selection, selectionArgs);
-                break;
-
-            default:
-                break;
-        }
-        return (retCursor);
-    }
-
-    @Override
-    public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) {
-        int    nRet = 0;
-        FileOutputStream dstFile = null;
-
-        switch(uriMatcher.match(uri)) {
-            case DIR:
-                File dir = new File(selection);
-                if (dir.mkdirs())
-                    nRet = 1;
-                break;
-
-            case FILE_NAME:
-                try {
-                    long lOffset = values.getAsLong("offset");
-                    byte [] buf = values.getAsByteArray(CHUNK);
-                    int    nLength = values.getAsInteger(LENGTH);
-                    if ((buf != null) && (nLength > 0)) {
-                        File f = new File(selection);
-                        dstFile = new FileOutputStream(f, (lOffset == 0 ? false : true));
-                        dstFile.write(buf,0, nLength);
-                        dstFile.flush();
-                        dstFile.close();
-                        nRet = nLength;
-                    }
-                } catch (FileNotFoundException fnfe) {
-                    fnfe.printStackTrace();
-                } catch (IOException ioe) {
-                    try {
-                        dstFile.flush();
-                    } catch (IOException e) {
-                    }
-                    try {
-                        dstFile.close();
-                    } catch (IOException e) {
-                    }
-                }
-                break;
-
-            default:
-                break;
-        }
-        return nRet;
-    }
-}
deleted file mode 100644
--- a/build/mobile/sutagent/android/ffxcp/FileCursor.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-package org.mozilla.ffxcp;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-
-import android.database.AbstractWindowedCursor;
-import android.database.CursorWindow;
-
-public class FileCursor extends AbstractWindowedCursor {
-    public static final String _ID = "_id";
-    public static final String CHUNK = "chunk";
-    public static final String LENGTH = "length";
-    static final String[] DEFCOLUMNS = new String[] {
-            _ID,
-            CHUNK,
-            LENGTH
-         };
-    private String filePath = null;
-    private String [] theColumns = null;
-
-    private static final int BUFSIZE = 4096;
-    private long lFileSize = 0;
-    private int nCount = 0;
-    private File theFile = null;
-    private byte [] theBuffer = null;
-    private long lOffset = 0;
-    private long lLength = -1;
-
-    public FileCursor(String[] columnNames, String sFilePath, String [] selectionArgs) {
-        super();
-        theColumns = (columnNames == null ? DEFCOLUMNS : columnNames);
-        filePath = sFilePath;
-        nCount = -1;
-
-        if ((selectionArgs != null) && (selectionArgs.length > 0)) {
-            lOffset = Long.parseLong(selectionArgs[0]);
-            lLength = Long.parseLong(selectionArgs[1]);
-        }
-
-        if (filePath.length() > 0) {
-            theFile = new File(filePath);
-            if (theFile.exists() && theFile.canRead()) {
-                lFileSize = theFile.length();
-
-                // lLength == -1 return everything between lOffset and eof
-                // lLength == 0 return file length
-                // lLength > 0 return lLength bytes
-                if (lLength == -1) {
-                    lFileSize = lFileSize - lOffset;
-                } else if (lLength == 0) {
-                    // just return the file length
-                } else {
-                    lFileSize = ((lLength <= (lFileSize - lOffset)) ? lLength : (lFileSize - lOffset));
-                }
-
-                if (lLength != 0) {
-                    nCount = (int) (lFileSize / BUFSIZE);
-                    if ((lFileSize % BUFSIZE) > 0)
-                        nCount++;
-                } else {
-                    nCount = 1;
-                }
-
-            }
-        }
-    }
-
-    public String getColumnName (int columnIndex) {
-        return theColumns[columnIndex];
-    }
-
-    @Override
-    public String[] getColumnNames() {
-        return theColumns;
-    }
-
-    @Override
-    public int getCount() {
-        return nCount;
-    }
-
-    @Override
-    public boolean onMove(int oldPosition, int newPosition) {
-        boolean bRet = true;
-
-        // get rid of old data
-        mWindow.clear();
-        bRet = mWindow.setNumColumns(theColumns.length);
-        fillWindow(newPosition, mWindow);
-
-        return bRet;
-    }
-
-    @Override
-    public void fillWindow (int pos, CursorWindow window) {
-        int    nNumRows = window.getNumRows();
-        int nCIndex = 0;
-        window.setStartPosition(0);
-
-        if (pos > -1) {
-            if (nNumRows == 0) {
-                window.allocRow();
-                nNumRows = window.getNumRows();
-            }
-
-            if (nNumRows == 1) {
-                nCIndex = getColumnIndex(LENGTH);
-                if (nCIndex > -1) {
-                    window.putLong(lFileSize, 0, nCIndex);
-                }
-                nCIndex = getColumnIndex(_ID);
-                if (nCIndex > -1) {
-                    window.putLong((long)pos, 0, nCIndex);
-                }
-                nCIndex = getColumnIndex(CHUNK);
-                if (nCIndex > -1) {
-                    if (lLength != 0) {
-                        byte[] value = getABlob (pos, 1);
-                        window.putBlob(value, 0, nCIndex);
-                    }
-                }
-            }
-            window.setStartPosition(pos);
-        }
-        return;
-    }
-
-    public byte[] getABlob (int row, int column) {
-        int    nRead = 0;
-        int    nOffset = 0;
-        int nBufSize = 0;
-
-        if ((column == 1) && (theFile != null)) {
-            try {
-                FileInputStream fin = new FileInputStream(theFile);
-                nOffset = row * BUFSIZE;
-                if (row < (nCount - 1)) {
-                    nBufSize = BUFSIZE;
-                } else {
-                    nBufSize = (int) (lFileSize - nOffset);
-                }
-                theBuffer = new byte[nBufSize];
-
-                if (theBuffer != null) {
-                    if (fin.skip(nOffset + lOffset) == (nOffset + lOffset)) {
-                        if ((nRead = fin.read(theBuffer, 0, nBufSize)) != -1) {
-                            if (nRead != nBufSize) {
-                                return null;
-                            }
-                        }
-                    }
-                }
-
-            fin.close();
-            } catch (FileNotFoundException e) {
-                e.printStackTrace();
-            } catch (IOException e) {
-                e.printStackTrace();
-            }
-        }
-
-        return theBuffer;
-    }
-}
deleted file mode 100644
--- a/build/mobile/sutagent/android/ffxcp/Makefile.in
+++ /dev/null
@@ -1,14 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-include $(topsrcdir)/config/config.mk
-
-JAVAFILES = \
-  DirCursor.java \
-  ffxcp.java \
-  FfxCPFP.java \
-  FileCursor.java \
-  $(NULL)
-
-tools:: $(ANDROID_APK_NAME).apk
deleted file mode 100644
--- a/build/mobile/sutagent/android/ffxcp/default.properties
+++ /dev/null
@@ -1,15 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-# This file is automatically generated by Android Tools.
-# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
-# 
-# This file must be checked in Version Control Systems.
-# 
-# To customize properties used by the Ant build system use,
-# "build.properties", and override values to adapt the script to your
-# project structure.
-
-# Project target.
-target=android-6
deleted file mode 100644
--- a/build/mobile/sutagent/android/ffxcp/ffxcp.java
+++ /dev/null
@@ -1,16 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-package org.mozilla.ffxcp;
-
-import android.app.Activity;
-import android.os.Bundle;
-
-public class ffxcp extends Activity {
-    /** Called when the activity is first created. */
-    @Override
-    public void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        setContentView(R.layout.main);
-    }
-}
\ No newline at end of file
deleted file mode 100644
--- a/build/mobile/sutagent/android/ffxcp/moz.build
+++ /dev/null
@@ -1,8 +0,0 @@
-# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-ANDROID_APK_NAME = 'FfxCP'
-ANDROID_APK_PACKAGE = 'org.mozilla.ffxcp'
deleted file mode 100644
index 8074c4c571b8cd19e27f4ee5545df367420686d7..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index 1095584ec21f71cd0afc9e0993aa2209671b590c..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index a07c69fa5a0f4da5d5efe96eea12a543154dbab6..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
--- a/build/mobile/sutagent/android/ffxcp/res/layout/main.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
-   - License, v. 2.0. If a copy of the MPL was not distributed with this
-   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:orientation="vertical"
-    android:layout_width="fill_parent"
-    android:layout_height="fill_parent"
-    >
-<TextView  
-    android:layout_width="fill_parent" 
-    android:layout_height="wrap_content" 
-    android:text="@string/hello"
-    />
-</LinearLayout>
deleted file mode 100644
--- a/build/mobile/sutagent/android/ffxcp/res/values/strings.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
-   - License, v. 2.0. If a copy of the MPL was not distributed with this
-   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-
-<resources>
-    <string name="hello">Hello World, firefoxcp!</string>
-    <string name="app_name">FirefoxCP</string>
-</resources>
deleted file mode 100644
--- a/build/mobile/sutagent/android/moz.build
+++ /dev/null
@@ -1,8 +0,0 @@
-# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-ANDROID_APK_NAME = 'sutAgentAndroid'
-ANDROID_APK_PACKAGE = 'com.mozilla.SUTAgentAndroid'
deleted file mode 100755
index c68405dcd258e618cb9db8886bed618166ecc6f9..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100755
index 50cc21098b252ca14a8d193aa5b03dbec473a9f9..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100755
index dd7a52a6939d659094a5211058c9aef2874a0d9b..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100755
index f697534cfa357fd0258fa07410a41c55020d75f2..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100755
index ec1c26354a40bc5c1dcb2b83f151f3d2879977f4..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index 6f65bd6e971379d331efd2ff162f2b61938085f1..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index 95b0904338c35d1b27b98600bd7c2c1fbb342a6d..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index 90c0bf85058c0a650533147f43b083c8f156f695..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index e3304e50fc53726a21e35c29cce796ecd054ac80..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index be00f470ad6a596d0054a6f95b112b835d1c21e0..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index a07c69fa5a0f4da5d5efe96eea12a543154dbab6..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100755
--- a/build/mobile/sutagent/android/res/layout/main.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
-   - License, v. 2.0. If a copy of the MPL was not distributed with this
-   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-    android:orientation="vertical"
-    android:layout_width="fill_parent"
-    android:layout_height="fill_parent"
-    >
-<TextView  
-    android:layout_width="fill_parent" 
-    android:layout_height="wrap_content" 
-    android:id="@+id/Textview01"/>
-
-
-
-
-<Button android:id="@+id/Button01" android:layout_width="wrap_content" android:layout_height="wrap_content" android:clickable="true" android:text="Exit"></Button>
-
-
-
-</LinearLayout>
deleted file mode 100755
--- a/build/mobile/sutagent/android/res/values/strings.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
-   - License, v. 2.0. If a copy of the MPL was not distributed with this
-   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-
-<resources>
-    
-    <string name="hello">Hello World, SUTAgentAndroid!</string>
-    <string name="app_name">SUTAgentAndroid</string>
-	
-
-<string name="foreground_service_started">Foreground Service Started (ASMozStub)</string>
-
-</resources>
deleted file mode 100644
--- a/build/mobile/sutagent/android/watcher/AndroidManifest.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
-   - License, v. 2.0. If a copy of the MPL was not distributed with this
-   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-      package="com.mozilla.watcher"
-      android:versionCode="1"
-      android:versionName="1.0">
-    <uses-permission android:name="android.permission.WRITE_SETTINGS"></uses-permission>
-    <application android:icon="@drawable/icon" android:label="@string/app_name">
-        <activity android:name=".WatcherMain"
-                  android:label="@string/app_name">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-        </activity>
-        <receiver android:name=".WatcherReceiver">
-            <intent-filter>
-                 <action android:value="android.intent.action.BOOT_COMPLETED" android:name="android.intent.action.BOOT_COMPLETED"/>
-                 <category android:value="android.intent.category.HOME" android:name="android.intent.category.HOME"/>
-            </intent-filter>
-        </receiver>
-	<service android:name="WatcherService">
-		<intent-filter>
-			<action android:name="com.mozilla.watcher.LISTENER_SERVICE" />
-		</intent-filter>
-	</service>
-
-    </application>
-    <uses-sdk android:minSdkVersion="5" />
-    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> 
-
-
-<uses-permission android:name="android.permission.INTERNET"></uses-permission>
-
-<uses-permission android:name="android.permission.DISABLE_KEYGUARD"></uses-permission>
-
-<uses-permission android:name="android.permission.WAKE_LOCK"></uses-permission>
-
-<uses-permission android:name="android.permission.VIBRATE"></uses-permission>
-
-</manifest> 
\ No newline at end of file
deleted file mode 100644
--- a/build/mobile/sutagent/android/watcher/IWatcherService.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/*
- * This file is auto-generated.  DO NOT MODIFY.
- * Original file: C:\\Users\\Bob\\workspace\\Watcher\\src\\com\\mozilla\\watcher\\IWatcherService.aidl
- */
-package com.mozilla.watcher;
-public interface IWatcherService extends android.os.IInterface
-{
-/** Local-side IPC implementation stub class. */
-public static abstract class Stub extends android.os.Binder implements com.mozilla.watcher.IWatcherService
-{
-private static final java.lang.String DESCRIPTOR = "com.mozilla.watcher.IWatcherService";
-/** Construct the stub at attach it to the interface. */
-public Stub()
-{
-this.attachInterface(this, DESCRIPTOR);
-}
-/**
- * Cast an IBinder object into an com.mozilla.watcher.IWatcherService interface,
- * generating a proxy if needed.
- */
-public static com.mozilla.watcher.IWatcherService asInterface(android.os.IBinder obj)
-{
-if ((obj==null)) {
-return null;
-}
-android.os.IInterface iin = (android.os.IInterface)obj.queryLocalInterface(DESCRIPTOR);
-if (((iin!=null)&&(iin instanceof com.mozilla.watcher.IWatcherService))) {
-return ((com.mozilla.watcher.IWatcherService)iin);
-}
-return new com.mozilla.watcher.IWatcherService.Stub.Proxy(obj);
-}
-public android.os.IBinder asBinder()
-{
-return this;
-}
-@Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
-{
-switch (code)
-{
-case INTERFACE_TRANSACTION:
-{
-reply.writeString(DESCRIPTOR);
-return true;
-}
-case TRANSACTION_UpdateApplication:
-{
-data.enforceInterface(DESCRIPTOR);
-java.lang.String _arg0;
-_arg0 = data.readString();
-java.lang.String _arg1;
-_arg1 = data.readString();
-java.lang.String _arg2;
-_arg2 = data.readString();
-int _arg3;
-_arg3 = data.readInt();
-int _result = this.UpdateApplication(_arg0, _arg1, _arg2, _arg3);
-reply.writeNoException();
-reply.writeInt(_result);
-return true;
-}
-}
-return super.onTransact(code, data, reply, flags);
-}
-private static class Proxy implements com.mozilla.watcher.IWatcherService
-{
-private android.os.IBinder mRemote;
-Proxy(android.os.IBinder remote)
-{
-mRemote = remote;
-}
-public android.os.IBinder asBinder()
-{
-return mRemote;
-}
-public java.lang.String getInterfaceDescriptor()
-{
-return DESCRIPTOR;
-}
-public int UpdateApplication(java.lang.String sPkgName, java.lang.String sPkgFileName, java.lang.String sOutFile, int bReboot) throws android.os.RemoteException
-{
-android.os.Parcel _data = android.os.Parcel.obtain();
-android.os.Parcel _reply = android.os.Parcel.obtain();
-int _result;
-try {
-_data.writeInterfaceToken(DESCRIPTOR);
-_data.writeString(sPkgName);
-_data.writeString(sPkgFileName);
-_data.writeString(sOutFile);
-_data.writeInt(bReboot);
-mRemote.transact(Stub.TRANSACTION_UpdateApplication, _data, _reply, 0);
-_reply.readException();
-_result = _reply.readInt();
-}
-finally {
-_reply.recycle();
-_data.recycle();
-}
-return _result;
-}
-}
-static final int TRANSACTION_UpdateApplication = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0);
-}
-public int UpdateApplication(java.lang.String sPkgName, java.lang.String sPkgFileName, java.lang.String sOutFile, int bReboot) throws android.os.RemoteException;
-}
deleted file mode 100644
--- a/build/mobile/sutagent/android/watcher/Makefile.in
+++ /dev/null
@@ -1,15 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-include $(topsrcdir)/config/config.mk
-
-JAVAFILES = \
-  IWatcherService.java \
-  RedirOutputThread.java \
-  WatcherMain.java \
-  WatcherReceiver.java \
-  WatcherService.java \
-  $(NULL)
-
-tools:: $(ANDROID_APK_NAME).apk
deleted file mode 100644
--- a/build/mobile/sutagent/android/watcher/RedirOutputThread.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-package com.mozilla.watcher;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.PrintWriter;
-
-public class RedirOutputThread extends Thread
-    {
-    OutputStream out;
-    InputStream    sutErr;
-    InputStream    sutOut;
-    Process pProc;
-    String    strOutput;
-
-    public RedirOutputThread(Process pProc, OutputStream out)
-        {
-        if (pProc != null)
-            {
-            this.pProc = pProc;
-            sutErr = pProc.getErrorStream(); // Stderr
-            sutOut = pProc.getInputStream(); // Stdout
-            }
-        if (out != null)
-            this.out = out;
-
-        strOutput = "";
-        }
-
-    public void run()
-        {
-        boolean bStillRunning = true;
-        int    nBytesOut = 0;
-        int nBytesErr = 0;
-        int nBytesRead = 0;
-        PrintWriter pOut = null;
-        byte[] buffer = new byte[1024];
-
-        if (out != null)
-            pOut = new PrintWriter(out);
-        else
-            bStillRunning = true;
-
-        while (bStillRunning)
-            {
-            try
-                {
-                if ((nBytesOut = sutOut.available()) > 0)
-                    {
-                    if (nBytesOut > buffer.length)
-                        {
-                        buffer = null;
-                        System.gc();
-                        buffer = new byte[nBytesOut];
-                        }
-                    nBytesRead = sutOut.read(buffer, 0, nBytesOut);
-                    if (nBytesRead == -1)
-                        bStillRunning = false;
-                    else
-                        {
-                        String sRep = new String(buffer,0,nBytesRead).replace("\n", "\r\n");
-                        if (pOut != null)
-                            {
-                            pOut.print(sRep);
-                            pOut.flush();
-                            }
-                        else
-                            strOutput += sRep;
-                        }
-                    }
-
-                if ((nBytesErr = sutErr.available()) > 0)
-                    {
-                    if (nBytesErr > buffer.length)
-                        {
-                        buffer = null;
-                        System.gc();
-                        buffer = new byte[nBytesErr];
-                        }
-                    nBytesRead = sutErr.read(buffer, 0, nBytesErr);
-                    if (nBytesRead == -1)
-                        bStillRunning = false;
-                    else
-                        {
-                        String sRep = new String(buffer,0,nBytesRead).replace("\n", "\r\n");
-                        if (pOut != null)
-                            {
-                            pOut.print(sRep);
-                            pOut.flush();
-                            }
-                        else
-                            strOutput += sRep;
-                        }
-                    }
-
-                bStillRunning = (IsProcRunning(pProc) || (sutOut.available() > 0) || (sutErr.available() > 0));
-                }
-            catch (IOException e)
-                {
-                e.printStackTrace();
-                }
-            }
-
-        pProc.destroy();
-        buffer = null;
-        System.gc();
-        }
-
-    private boolean IsProcRunning(Process pProc)
-        {
-        boolean bRet = false;
-        @SuppressWarnings("unused")
-        int nExitCode = 0;
-
-        try
-            {
-            nExitCode = pProc.exitValue();
-            }
-        catch (IllegalThreadStateException z)
-            {
-            bRet = true;
-            }
-
-        return(bRet);
-        }
-    }
deleted file mode 100644
--- a/build/mobile/sutagent/android/watcher/WatcherMain.java
+++ /dev/null
@@ -1,16 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-package com.mozilla.watcher;
-
-import android.app.Activity;
-import android.os.Bundle;
-
-public class WatcherMain extends Activity {
-    /** Called when the activity is first created. */
-    @Override
-    public void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        setContentView(R.layout.main);
-    }
-}
\ No newline at end of file
deleted file mode 100644
--- a/build/mobile/sutagent/android/watcher/WatcherReceiver.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-package com.mozilla.watcher;
-
-import android.content.BroadcastReceiver;
-import android.content.Context;
-import android.content.Intent;
-// import android.os.Debug;
-
-public class WatcherReceiver extends BroadcastReceiver {
-
-    @Override
-    public void onReceive(Context context, Intent intent) {
-//        Debug.waitForDebugger();
-        Intent serviceIntent = new Intent();
-        serviceIntent.putExtra("command", "start");
-        serviceIntent.setAction("com.mozilla.watcher.LISTENER_SERVICE");
-        context.startService(serviceIntent);
-    }
-
-}
deleted file mode 100644
--- a/build/mobile/sutagent/android/watcher/WatcherService.java
+++ /dev/null
@@ -1,1034 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-package com.mozilla.watcher;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.FileReader;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.PrintWriter;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.Date;
-import java.util.List;
-import java.util.Timer;
-import java.util.TimerTask;
-
-import android.app.Activity;
-import android.app.ActivityManager;
-import android.app.KeyguardManager;
-import android.app.Notification;
-import android.app.NotificationManager;
-import android.app.PendingIntent;
-import android.app.Service;
-import android.content.ActivityNotFoundException;
-import android.content.ContentResolver;
-import android.content.Context;
-import android.content.ContextWrapper;
-import android.content.Intent;
-import android.content.pm.ActivityInfo;
-import android.content.pm.PackageInfo;
-import android.content.pm.PackageManager;
-import android.content.pm.PackageManager.NameNotFoundException;
-import android.os.BatteryManager;
-import android.os.Debug;
-import android.os.IBinder;
-import android.os.PowerManager;
-import android.os.RemoteException;
-import android.provider.Settings;
-import android.util.Log;
-import android.os.Environment;
-
-public class WatcherService extends Service
-{
-    private final String prgVersion = "Watcher Version 1.17";
-    private final String LOGTAG = "Watcher";
-
-    String sErrorPrefix = "##Installer Error## ";
-    String currentDir = "/";
-    String sPingTarget = "";
-    long lDelay = 60000;
-    long lPeriod = 300000;
-    int nMaxStrikes = 0; // maximum number of tries before we consider network unreachable (0 means don't check)
-    boolean bStartSUTAgent = true;
-    boolean bStartedTimer = false;
-
-    Process pProc;
-    Context myContext = null;
-    Timer myTimer = null;
-    private PowerManager.WakeLock pwl = null;
-    public static final int NOTIFICATION_ID = 1964;
-    boolean bInstalling = false;
-
-    @SuppressWarnings("unchecked")
-    private static final Class<?>[] mSetForegroundSignature = new Class[] {
-        boolean.class};
-    @SuppressWarnings("unchecked")
-    private static final Class<?>[] mStartForegroundSignature = new Class[] {
-        int.class, Notification.class};
-    @SuppressWarnings("unchecked")
-    private static final Class<?>[] mStopForegroundSignature = new Class[] {
-        boolean.class};
-
-    private NotificationManager mNM;
-    private Method mSetForeground;
-    private Method mStartForeground;
-    private Method mStopForeground;
-    private Object[] mSetForegroundArgs = new Object[1];
-    private Object[] mStartForegroundArgs = new Object[2];
-    private Object[] mStopForegroundArgs = new Object[1];
-
-
-    private IWatcherService.Stub stub = new IWatcherService.Stub() {
-        public int UpdateApplication(String sAppName, String sFileName, String sOutFile, int bReboot) throws RemoteException
-            {
-            return UpdtApp(sAppName, sFileName, sOutFile, bReboot);
-            }
-    };
-
-    @Override
-    public IBinder onBind(Intent arg0) {
-        return stub;
-    }
-
-    @Override
-    public void onCreate()
-        {
-        super.onCreate();
-
-        Log.i(LOGTAG, prgVersion);
-
-        myContext = this;
-
-        getKeyGuardAndWakeLock();
-
-        File dir = getFilesDir();
-        File iniFile = new File(dir, "watcher.ini");
-        String sIniFile = iniFile.getAbsolutePath();
-        String sHold = "";
-
-        Log.i(LOGTAG, String.format("Loading settings from %s", sIniFile));
-        this.sPingTarget = GetIniData("watcher", "PingTarget", sIniFile, "www.mozilla.org");
-        sHold = GetIniData("watcher", "delay", sIniFile, "60000");
-        this.lDelay = Long.parseLong(sHold.trim());
-        sHold = GetIniData("watcher", "period", sIniFile,"300000");
-        this.lPeriod = Long.parseLong(sHold.trim());
-        sHold = GetIniData("watcher", "strikes", sIniFile,"0");
-        this.nMaxStrikes = Integer.parseInt(sHold.trim());
-        Log.i(LOGTAG, String.format("Pinging %s after a delay of %s sec, period of %s sec, max number of failed attempts is %s (if max # of failed attempts is 0, then no checking)",
-             this.sPingTarget, this.lDelay / 1000.0, this.lPeriod / 1000.0, nMaxStrikes));
-
-        sHold = GetIniData("watcher", "StartSUTAgent", sIniFile, "true");
-        this.bStartSUTAgent = Boolean.parseBoolean(sHold.trim());
-
-        sHold = GetIniData("watcher", "stayon", sIniFile,"0");
-        int nStayOn = Integer.parseInt(sHold.trim());
-        
-        try {
-            if (nStayOn != 0) {
-                if (!Settings.System.putInt(getContentResolver(), Settings.System.STAY_ON_WHILE_PLUGGED_IN, BatteryManager.BATTERY_PLUGGED_AC | BatteryManager.BATTERY_PLUGGED_USB)) {
-                    Log.e(LOGTAG, "Screen couldn't be set to Always On [stay on while plugged in]");
-                }
-            }
-        } catch (Exception e) {
-            e.printStackTrace();
-            String sExcept = e.getMessage();
-            Log.e(LOGTAG, "Screen couldn't be set to Always On [exception " + sExcept + "]");
-        }
-
-        Log.i(LOGTAG, "WatcherService created");
-        }
-
-    public String GetIniData(String sSection, String sKey, String sFile, String sDefault)
-        {
-        String sRet = sDefault;
-        String sComp = "";
-        String sLine = "";
-        boolean bFound = false;
-        BufferedReader in = null;
-        String sTmpFileName = fixFileName(sFile);
-
-        try {
-            in = new BufferedReader(new FileReader(sTmpFileName));
-            sComp = "[" + sSection + "]";
-            while ((sLine = in.readLine()) != null)
-                {
-                if (sLine.equalsIgnoreCase(sComp))
-                    {
-                    bFound = true;
-                    break;
-                    }
-                }
-
-            if (bFound)
-                {
-                sComp = (sKey + " =").toLowerCase();
-                while ((sLine = in.readLine()) != null)
-                    {
-                    if (sLine.toLowerCase().contains(sComp))
-                        {
-                        String [] temp = null;
-                        temp = sLine.split("=");
-                        if (temp != null)
-                            {
-                            if (temp.length > 1)
-                                sRet = temp[1].trim();
-                            }
-                        break;
-                        }
-                    }
-                }
-            in.close();
-            }
-        catch (FileNotFoundException e)
-            {
-            sComp = e.toString();
-            }
-        catch (IOException e)
-            {
-            sComp = e.toString();
-            }
-        return (sRet);
-        }
-
-    private void handleCommand(Intent intent)