Example #1
0
        static void ccallback(object sender, EventArgs args)
        {
            Console.WriteLine("Connected.");
            bool available = iph.IsConnected;

            Console.WriteLine(available);
            string dn = iph.RequestProperty <string>(null, "DeviceName");

            Console.WriteLine("Device: " + dn);
            Console.Write("Enter new name: ");
            string nn = Console.ReadLine();

            if (nn != "")
            {
                bool s = iph.SetProperty(null, "DeviceName", nn);
                Console.WriteLine(s);
            }
            PList pl = new PList(iph.RequestProperties(null), false);

            foreach (KeyValuePair <string, dynamic> kvp in pl)
            {
                Console.WriteLine("{0} : {1}", kvp.Key, kvp.Value);
            }
            string[] dirlist = iph.GetContents("/");
            Console.WriteLine("\n\nDirectory Listing:");
            foreach (string path in dirlist)
            {
                Console.WriteLine(path);
            }
            string[] afcinfo = iph.GetAFCInfo();
            Console.WriteLine("\n\nAFC Info:");
            foreach (string key in afcinfo)
            {
                Console.WriteLine(key);
            }
            Dictionary <string, string> info;

            info = iph.GetFileInfo("/DCIM");
            Console.WriteLine("\n\nDCIM Info:");
            foreach (KeyValuePair <string, string> kvp in info)
            {
                Console.WriteLine("{0} : {1}", kvp.Key, kvp.Value);
            }
            info = iph.GetFileInfo("test");
            Console.WriteLine("\n\ntest file Info:");
            foreach (KeyValuePair <string, string> kvp in info)
            {
                Console.WriteLine("{0} : {1}", kvp.Key, kvp.Value);
            }

            Console.WriteLine("Writing File to Device...");
            Console.WriteLine(iph.CopyFileToDevice("MK.MobileDevice.dll", "test"));
            Console.WriteLine("Fetching File from Device...");
            Console.WriteLine(iph.CopyFileFromDevice("test.dll", "test"));
            Console.WriteLine(iph.IsLink("/"));

            //System.Threading.Thread.Sleep(10);
        }
Example #2
0
        private static void Mdv_HostAttached(object sender, MK.MobileDevice.USBMultiplexArgs args)
        {
            Console.WriteLine("libimobiledevice.dll detected device attached to host.");
            Console.WriteLine("Device Locked: {0}", args.IsLocked);
            //Console.WriteLine("Uninstalled.");
            Console.WriteLine("FMIP: {0}", mdv.FindMyiPhoneEnabled);
            //Console.WriteLine("PurpleBuddy GetValue: {0}", mdv.RequestProperty<string>("com.apple.PurpleBuddy", "SetupState"));
            var pb = mdv.RequestProperties("com.apple.PurpleBuddy");

            mdv.EnableWifiConnection();
        }