private void OnSelectedApps(IPhoneApp app)
 {
     if (SelectedApps != null)
     {
         SelectedApps(this, new IPhoneAppSelectedArgs(app));
     }
 }
示例#2
0
        void export_Click(object sender, EventArgs e)
        {
            FolderBrowserDialog dialog = new FolderBrowserDialog();

            dialog.Description = "Select a place to export the application data";
            if (dialog.ShowDialog(Model.Window) == DialogResult.OK)
            {
                IPhoneApp    app    = SelectedApp;
                IPhoneBackup backup = SelectedBackup;
                string       path   = dialog.SelectedPath;
                Model.InvokeAsync(app.Files, delegate(IPhoneFile file)
                {
                    string source = Path.Combine(backup.Path, file.Key);
                    string dest   = Path.Combine(path, app.Name, file.Path.Replace("/", Path.DirectorySeparatorChar.ToString()));

                    // If there is a folder structur
                    // create it.
                    int lastIndex = file.Path.LastIndexOf("/");
                    if (lastIndex >= 0)
                    {
                        string fileFolder = file.Path.Substring(0, lastIndex);
                        Directory.CreateDirectory(Path.Combine(path, app.Name, fileFolder.Replace("/", Path.DirectorySeparatorChar.ToString())));
                    }

                    // Copy the file (overwrite)
                    File.Copy(source, dest, true);
                }, "Export: " + app.Name, Cursors.WaitCursor);
            }
        }
示例#3
0
        void open_Click(object sender, EventArgs e)
        {
            IPhoneApp app = SelectedApp;

            if (app != null)
            {
                Model.Select(app);
            }
        }
示例#4
0
 public static void Stop()
 {
     if (currentApp != null)
     {
         currentApp.Stop();
         Audio.ReleaseSound(Audio.PlaySoundFrontend("Hang_Up", "Phone_SoundSet_Michael"));
         currentApp = null;
     }
 }
        void show_Click(object sender, EventArgs e)
        {
            IPhoneBackup backup      = SelectedBackup;
            IPhoneApp    app         = backup.GetApps().FirstOrDefault(t => t.Name == "System");
            IPhoneFile   dbFile      = app.Files.FirstOrDefault(t => t.Path.Contains("sms.db"));
            MMSAnalyzer  mmsAnalyzer = new MMSAnalyzer(backup, dbFile);

            mmsAnalyzer.Show();
        }
示例#6
0
 public static void InitApp(IPhoneApp app)
 {
     if (currentApp != null)
     {
         currentApp.Stop();
     }
     currentApp = app;
     app.Init(PhoneState.PhoneScaleform);
 }
        void start_Click(object sender, EventArgs e)
        {
            IPhoneBackup backup = SelectedBackup;

            if (backup == null)
            {
                return;
            }

            IPhoneApp  app      = backup.GetApps().FirstOrDefault(t => t.Name == "System");
            IPhoneFile dbFile   = app.Files.FirstOrDefault(t => t.Path.Contains("sms.db"));
            FileInfo   fileInfo = FileManager.GetWorkingFile(backup, dbFile, true);

            SMSAnalyzer analyzer = new SMSAnalyzer(backup, fileInfo.FullName);

            analyzer.Show();
        }
        public void SelectApp(IPhoneApp app)
        {
            fileList.Items.Clear();

            if (app.Files == null)
            {
                return;
            }

            fileList.BeginUpdate();
            Cursor.Current = Cursors.WaitCursor;

            try
            {
                ListViewItem[] lvic = new ListViewItem[app.Files.Count];
                int            idx  = 0;

                foreach (IPhoneFile ff in app.Files)
                {
                    ListViewItem lvi = new ListViewItem();
                    lvi.Tag  = ff;
                    lvi.Text = ff.Path;
                    lvi.SubItems.Add(ff.FileLength.ToString());
                    lvi.SubItems.Add(ff.ModificationTime);
                    lvi.SubItems.Add(ff.Domain);
                    lvi.SubItems.Add(ff.Key);

                    lvic[idx++] = lvi;
                }

                fileList.Items.AddRange(lvic);
            }
            finally
            {
                fileList.EndUpdate();
                Cursor.Current = Cursors.Default;
            }
        }
        void _worker_DoWork(object sender, DoWorkEventArgs e)
        {
            BackgroundWorker worker = sender as BackgroundWorker;
            IPhoneBackup     backup = e.Argument as IPhoneBackup;

            IPhoneApp system = backup.GetApps().FirstOrDefault(app => app.Name == "System");
            IEnumerable <IPhoneFile> images = system.Files.Where(file => file.Domain == "MediaDomain" && file.Path.Contains("DCIM/100APPLE"));
            FileManager fm = FileManager.Current;

            ImageList imgList = new ImageList();

            imgList.ImageSize  = new Size(64, 64);
            imgList.ColorDepth = ColorDepth.Depth32Bit;

            List <ListViewItem> listViewItems = new List <ListViewItem>();
            int length = images.Count(), current = 0;

            foreach (IPhoneFile file in images)
            {
                if (worker.CancellationPending)
                {
                    return;
                }
                FileInfo     info = fm.GetWorkingFileCurrentClass(_backup, file);
                ListViewItem itm  = new ListViewItem();
                itm.Tag      = new Bitmap(info.FullName);
                itm.Text     = info.Name;
                itm.ImageKey = info.Name;

                imgList.Images.Add(info.Name, (Bitmap)itm.Tag);
                listViewItems.Add(itm);

                worker.ReportProgress(Util.Percent(current++, length));
            }

            e.Result = new { ImageList = imgList, ListViewItems = listViewItems.ToArray() };
        }
 public IPhoneAppSelectedArgs(IPhoneApp selected)
 {
     Selected = selected;
 }
        /// <summary>
        /// Select an app when selection changes
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void folderList_SelectedIndexChanged(object sender, EventArgs e)
        {
            IPhoneApp app = folderList.FocusedItem.Tag as IPhoneApp;

            OnSelectedApps(app);
        }
        /// <summary>
        /// Select an app on double click
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void folderList_DoubleClick(object sender, EventArgs e)
        {
            IPhoneApp app = (IPhoneApp)folderList.FocusedItem.Tag;

            SelectApp(app);
        }
        void _analyze_Click(object sender, EventArgs e)
        {
            IPhoneBackup             backup = SelectedBackup;
            IPhoneApp                app    = backup.GetApps().FirstOrDefault(t => t.Name == "System");
            IPhoneFile               dbFile = app.Files.FirstOrDefault(t => t.Path.Contains("consolidated"));
            IEnumerable <IPhoneFile> imgs   = app.Files.Where(t => t.Path.Contains("DCIM/100APPLE") && t.Domain == "MediaDomain");
            FileInfo fileInfo = FileManager.GetWorkingFile(backup, dbFile);

            Model.InvokeAsync(delegate(object w, DoWorkEventArgs a)
            {
                BackgroundWorker worker = w as BackgroundWorker;
                if (!worker.CancellationPending)
                {
                    List <Location> locations = new List <Location>();
                    using (SQLiteConnection con = new SQLiteConnection(@"Data Source=" + fileInfo.FullName))
                    {
                        con.Open();
                        var cmd         = new SQLiteCommand();
                        cmd.Connection  = con;
                        cmd.CommandText = "SELECT * FROM WifiLocation;";

                        var reader = cmd.ExecuteReader();
                        while (reader.Read())
                        {
                            locations.Add(new Location
                            {
                                Name      = "[Wifi] MAC: " + reader.GetString(0),
                                Time      = new DateTime(2001, 1, 1, 0, 0, 0).AddSeconds(reader.GetDouble(1)),
                                Latitude  = reader.GetDouble(2),
                                Longitude = reader.GetDouble(3)
                            });
                        }
                        reader.Close();

                        worker.ReportProgress(33);

                        cmd.CommandText = "SELECT * FROM CellLocation";
                        reader          = cmd.ExecuteReader();
                        while (reader.Read())
                        {
                            locations.Add(new Location
                            {
                                Name = "[Cell] MCC: " + reader.GetInt32(0) + " MNC: " +
                                       reader.GetInt32(1) + " LAC: " +
                                       reader.GetInt32(2) + " CELL ID:" +
                                       reader.GetInt32(3),
                                Time      = new DateTime(2001, 1, 1, 0, 0, 0).AddSeconds(reader.GetDouble(4)),
                                Latitude  = reader.GetDouble(5),
                                Longitude = reader.GetDouble(6)
                            });
                        }

                        worker.ReportProgress(33);
                    }

                    //Gives incorrect results.. FIXIT
                    //int count = imgs.Count() + 66, current = 66;
                    //foreach (IPhoneFile file in imgs)
                    //{
                    //    FileInfo info = FileManager.GetWorkingFile(backup, file);
                    //    ExifTagCollection er = new ExifTagCollection(info.FullName);

                    //    //not working...
                    //    Location location = new Location();
                    //    double lat = 0, lon = 0;
                    //    foreach (ExifTag tag in er)
                    //    {
                    //        if (tag.FieldName == "GPSLatitude")
                    //        {
                    //            string dec = Regex.Match(tag.Value, @"\d+\.\d+").ToString();
                    //            double.TryParse(dec, out lat);
                    //        }
                    //        else if (tag.FieldName == "GPSLongitude")
                    //        {
                    //            string dec = Regex.Match(tag.Value, @"\d+\.\d+").ToString();
                    //            double.TryParse(dec, out lon);
                    //        }
                    //    }
                    //    location.Latitude = lat;
                    //    location.Longitude = lon;
                    //    location.Name = "[Image] " + info.Name;
                    //    locations.Add(location);

                    //    worker.ReportProgress(Util.Percent(current++, count));
                    //}

                    geKML kml = Location.ToKML(locations.OrderBy(x => x.Time));
                    a.Result  = kml;
                }
                else
                {
                    a.Cancel = true;
                    return;
                }
            },
                              delegate(object w, RunWorkerCompletedEventArgs a)
            {
                geKML kml = a.Result as geKML;

                FileDialog dialog = new SaveFileDialog();
                dialog.DefaultExt = "kmz";
                dialog.FileName   = "locations.kmz";
                dialog.Filter     = "Google earth|*.kmz";
                if (dialog.ShowDialog(Model.Window) == DialogResult.OK)
                {
                    using (FileStream s = new FileStream(dialog.FileName, FileMode.Create))
                    {
                        using (BinaryWriter wr = new BinaryWriter(s))
                        {
                            wr.Write(kml.ToKMZ());
                        }
                    }
                }
            }, "Analyzing location", false);
        }
示例#14
0
 public void RunApplication(IPhoneApp app)
 {
 }
示例#15
0
 /// <summary>
 /// Select an iphone app in the gui
 /// </summary>
 /// <param name="app"></param>
 public void Select(IPhoneApp app)
 {
     _browser.SelectApp(app);
 }