Exemple #1
0
        /// <summary>
        /// Gets the status of the device
        /// </summary>
        /// <returns></returns>
        private DeviceInfo GetDeviceInfo()
        {
            //Declrations
            DeviceInfo deviceInfo = new DeviceInfo();
            String     output     = String.Empty;

            String[] splitted;

            output = ADBUtility.SendMessage("devices");

            if (output != String.Empty)
            {
                splitted = output.Split(new String[] { "List of devices attached" }, StringSplitOptions.RemoveEmptyEntries);

                if (splitted.Length > 0)
                {
                    //Check whether there is a device which is connected
                    if (splitted[splitted.Length - 1].Contains("device"))
                    {
                        splitted = splitted[splitted.Length - 1].Split(new String[] { "device" }, StringSplitOptions.RemoveEmptyEntries);

                        //Set the device ID
                        deviceInfo.DeviceID = splitted[0].Trim();
                        deviceInfo.Status   = DeviceInfo.DeviceStatus.Connected;
                    }
                }
            }

            return(deviceInfo);
        }
Exemple #2
0
        /// <summary>
        /// Extracts the Telephony Information
        /// </summary>
        private void ExtractData(String strSourcePath, String strDatabaseFile)
        {
            //Declarations
            ADBShellCommand command;
            String          strInputFile;
            String          strOutputFile;
            String          strOutput;

            //Construct the command
            strInputFile  = "data/data/" + strSourcePath + "/" + strDatabaseFile;
            strOutputFile = _SDCard + "/" + strDatabaseFile;
            command       = new ADBShellCommand.DD(strInputFile, strOutputFile);
            //Send the command
            strOutput = ADBUtility.SendShellCommands(command);

            //Display to UI
            ShowExtractionMessage(strOutput);

            //Pull the file
            strOutput = ADBUtility.RetrieveFile(strOutputFile, _outputPath);

            //Display to UI
            ShowExtractionMessage(strOutput);

            //Construct the command to remove the file
            command = new ADBShellCommand.RM(strOutputFile);
            //Send the command to remove the file
            strOutput = ADBUtility.SendShellCommands(command);


            //Display to UI
            ShowExtractionMessage(strOutput);
        }