// Path: src/com/sprintwind/packetcapturetool/ShellUtils.java
// public static class CommandResult { 
// 
// 
//     /** result of command **/ 
//     public int    result; 
//     /** success message of command result **/ 
//     public String successMsg; 
//     /** error message of command result **/ 
//     public String errorMsg; 
// 
// 
//     public CommandResult(int result) { 
//         this.result = result; 
//     } 
// 
// 
//     public CommandResult(int result, String successMsg, String errorMsg) { 
//         this.result = result; 
//         this.successMsg = successMsg; 
//         this.errorMsg = errorMsg; 
//     } 
// } 


import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.Locale;
import com.sprintwind.packetcapturetool.ShellUtils.CommandResult;
import android.text.Spannable;
import android.text.SpannableStringBuilder;
import android.text.style.BackgroundColorSpan;
import android.annotation.TargetApi;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.Fragment;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
import android.graphics.Color;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.os.Handler;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ListView;
import android.widget.SimpleAdapter;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.AdapterView.OnItemClickListener;
	
	private enum CaptureStatus{
		STATUS_IDLE,
		STATUS_STARTING,
		STATUS_CAPTURING,
		STATUS_STOPPING
	};

	private ArrayAdapter<String> arradpInterface;
	private ArrayAdapter<CharSequence> arradpProtocol;
	private ConnectionChangeReceiver broadcastReceiver;
	
	
	private Button btnStartCapture;
	private EditText etFileName;
	private Button btnReGenerateFileName;
	private ListView lvSettings;
	
	private Dialog	dlgCapturing;
	private TextView txtvwCaptureAmount;
	private Button btnStopCapture;
	
	private ArrayList<HashMap<String, Object>> lstItems;
	private Handler handler;
	private Process process;
	private String  captoolDir;
	private String sdcardDir;
	private String saveFilePath;
	private String[] strArrIfName;
	
// Path: src/com/sprintwind/packetcapturetool/ShellUtils.java
// public static class CommandResult { 
// 
// 
//     /** result of command **/ 
//     public int    result; 
//     /** success message of command result **/ 
//     public String successMsg; 
//     /** error message of command result **/ 
//     public String errorMsg; 
// 
// 
//     public CommandResult(int result) { 
//         this.result = result; 
//     } 
// 
// 
//     public CommandResult(int result, String successMsg, String errorMsg) { 
//         this.result = result; 
//         this.successMsg = successMsg; 
//         this.errorMsg = errorMsg; 
//     } 
// } 


// Path: src/com/sprintwind/packetcapturetool/CaptureActivity.java
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.Locale;
import com.sprintwind.packetcapturetool.ShellUtils.CommandResult;
import android.text.Spannable;
import android.text.SpannableStringBuilder;
import android.text.style.BackgroundColorSpan;
import android.annotation.TargetApi;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.Fragment;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
import android.graphics.Color;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.os.Handler;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ListView;
import android.widget.SimpleAdapter;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.AdapterView.OnItemClickListener;

	
	private enum CaptureStatus{
		STATUS_IDLE,
		STATUS_STARTING,
		STATUS_CAPTURING,
		STATUS_STOPPING
	};

	private ArrayAdapter<String> arradpInterface;
	private ArrayAdapter<CharSequence> arradpProtocol;
	private ConnectionChangeReceiver broadcastReceiver;
	
	
	private Button btnStartCapture;
	private EditText etFileName;
	private Button btnReGenerateFileName;
	private ListView lvSettings;
	
	private Dialog	dlgCapturing;
	private TextView txtvwCaptureAmount;
	private Button btnStopCapture;
	
	private ArrayList<HashMap<String, Object>> lstItems;
	private Handler handler;
	private Process process;
	private String  captoolDir;
	private String sdcardDir;
	private String saveFilePath;
	private String[] strArrIfName;
	
	private CommandResult cmdResult;