Example #1
0
        protected void OnDisconnect(ConnectEventArgs args)
        {
            ConnectEventHandler disconnect = this.Disconnect;

            if (disconnect != null)
            {
                disconnect(this, args);
            }
        }
Example #2
0
        protected void OnConnect(ConnectEventArgs args)
        {
            ConnectEventHandler connect = this.Connect;

            if (connect != null)
            {
                connect(this, args);
            }
        }
 private void iDevice_Disconnected(object sender, ConnectEventArgs e)
 {
     this.Invoke((MethodInvoker)delegate
     {
         lblPlug.Text = "Please plug your iDevice in via USB cable!\r\nWaiting for your iDevice...";
         lblPlug.Visible = true;
         wBrowser.Visible = false;
         wBrowser.Navigate("http://mobi.jakurepo.com/");
         btnBrowse.Enabled = false;
         btnRespring.Enabled = false;
         txtSearch.Enabled = false;
     });
 }
 private void iDevice_Connected(object sender, ConnectEventArgs e)
 {
     if (new[] { "iPhone1,1", "iPhone1,2", "iPhone2,1", "iPod1,1", "iPod2,1", "iPod3,1" }.Contains(iDevice.DeviceProductType) || iDevice.DeviceProductType.StartsWith("iPad", true, System.Globalization.CultureInfo.CreateSpecificCulture("en")))
         lblPlug.Text = "An iDevice has been plugged in!\r\nHowever, Jaku Theme does not support your device yet!";
     else if (!iDevice.IsJailbreak)
         lblPlug.Text = "Your iDevice must be jailbroken in order to install custom themes!";
     else
     {
         this.Invoke((MethodInvoker)delegate
         {
             lblPlug.Visible = false;
             wBrowser.Visible = true;
             btnBrowse.Enabled = true;
             btnRespring.Enabled = true;
             txtSearch.Enabled = true;
             // User Apps
             foreach (var dir in iDevice.GetDirectories("/var/mobile/Applications"))
                 foreach (var dir2 in iDevice.GetDirectories("/var/mobile/Applications/" + dir))
                     if (dir2.EndsWith(".app"))
                     {
                         string finalPath = "/var/mobile/Applications/" + dir + "/" + dir2;
                         getFile(finalPath + "/Info.plist", "tmp\\Info.plist"); // Get Info.plist so we can continue
                         // Use iTunes PlUtil from iTunes Libraries to convert bplist to plist
                         ProcessStartInfo procStartInfo = new ProcessStartInfo(Path.Combine(ApplicationSupportDirectory, "plutil.exe"), @"-convert xml1 """ +
                             Path.Combine(Environment.CurrentDirectory, "tmp\\Info.plist") + @"""")
                         {
                             UseShellExecute = false,
                             CreateNoWindow = true,
                             RedirectStandardOutput = true,
                             Verb = "runas"
                         };
                         var p = new Process();
                         p.StartInfo = procStartInfo;
                         p.Start();
                         string output = p.StandardOutput.ReadToEnd();
                         p.WaitForExit();
                         //MessageBox.Show(output);
                         Plist plist = new Plist();
                         plist.Load("tmp\\Info.plist"); //now load
                         dynamic search;
                         // get icon names, download them until we found perfect 114x114 image size
                         if (plist.ContainsKey("CFBundleIconFiles"))
                             search = plist["CFBundleIconFiles"];
                         else
                             search = plist["CFBundleIcons"]["CFBundlePrimaryIcon"]["CFBundleIconFiles"];
                         foreach (var item in search)
                         {
                             string appName = plist["CFBundleDisplayName"];
                             string bundleName = plist["CFBundleIdentifier"];
                             getFile(finalPath + "/" + item, "tmp\\" + appName + ".png");
                             using (Bitmap bitmap = new Bitmap("tmp\\" + appName + ".png"))
                                 if (bitmap.Height == 114)
                                 {
                                     Data.dictIcon[appName] = new string[] { item, bundleName }; //1st: icon name, 2nd: bundle name
                                     break;
                                 }
                         }
                     }
             // Start iPIN to de-optimize PNGs
             Process p2 = new Process();
             p2.StartInfo.CreateNoWindow = true;
             p2.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
             p2.StartInfo.FileName = "tmp\\ipin.exe";
             p2.Start();
         });
     }
 }
Example #5
0
 protected void OnDisconnect(ConnectEventArgs args)
 {
     ConnectEventHandler disconnect = this.Disconnect;
     if (disconnect != null)
     {
         disconnect(this, args);
     }
 }
Example #6
0
 protected void OnConnect(ConnectEventArgs args)
 {
     ConnectEventHandler connect = this.Connect;
     if (connect != null)
     {
         connect(this, args);
     }
 }
Example #7
0
	private void oniPhoneDisconnect(object Sender, ConnectEventArgs args)
	{
		if (iLeft == true) {
			return;
		}
		try {
			DoIgiveAshit = true;
			MDIMain.Activate();
			this.Invoke((MethodInvoker)Cleanup);
		} catch (Exception ex) {
		}
	}
Example #8
0
	private void oniPhoneConnected(object sender, ConnectEventArgs args)
	{
		if (iLeft == true) {
			return;
		}
		try {
			FileSystem.FreeFile();
			if (DoIgiveAshit == true) {
				DoIgiveAshit = false;
				ECID = Conversion.Hex(iPhoneInterface.CopyValue("UniqueChipID"));
				while (!(ECID.Length == 16)) {
					ECID = "0" + ECID;
				}
				MDIMain.Activate();
				this.Invoke((MethodInvoker)PluggedinGrabber);
			}
		} catch (Exception ex) {
		}
	}