Beispiel #1
0
        public static void itmdTest()
        {
            Console.WriteLine("Starting ITMD Test...");
            //Console.ReadKey();
            iph = new iTMDiPhone();
            lliph = new iTMDiPhoneLL();
            try
            {
                mdv = new iPhone();
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
            tai = new TAIiPhone();

            mdv.Connect += Mdv_Connect;
            mdv.HostAttached += Mdv_HostAttached;
            iph.Connect += Iph_Connect;
            tai.Connect += Tai_Connect;

            lliph.HostAttached += Lliph_HostAttached;

            iph.DfuConnect += Iph_DfuConnect;
            while (true)
            {
                if (mdv.attachedToHost ^ mdv.IsConnected)
                {
                    //Console.Clear();
                    //Console.WriteLine("Device attached but not paired. Enter passcode on device to pair.");
                }
            }
        }
Beispiel #2
0
        public static unsafe iPhoneFile Open(TAIiPhone phone, string path, FileAccess openmode)
        {
            long     num2;
            OpenMode none = OpenMode.None;

            switch (openmode)
            {
            case FileAccess.Read:
                none = OpenMode.Read;
                break;

            case FileAccess.Write:
                none = OpenMode.Write;
                break;

            case FileAccess.ReadWrite:
                throw new NotImplementedException("Read+Write not (yet) implemented");
            }
            string str = phone.FullPath(phone.CurrentDirectory, path);
            int    num = MobileDevice.AFCFileRefOpen(phone.AFCHandle, System.Text.Encoding.UTF8.GetBytes(str), (int)none, 0, out num2);

            if (num != 0)
            {
                phone.ReConnect();
                throw new IOException("AFCFileRefOpen failed with error " + num.ToString());
            }
            return(new iPhoneFile(phone, num2, none));
        }
Beispiel #3
0
        public static unsafe iPhoneFile Open(TAIiPhone phone, string path, FileAccess openmode)
        {
            long num2;
            OpenMode none = OpenMode.None;
            switch (openmode)
            {
                case FileAccess.Read:
                    none = OpenMode.Read;
                    break;

                case FileAccess.Write:
                    none = OpenMode.Write;
                    break;

                case FileAccess.ReadWrite:
                    throw new NotImplementedException("Read+Write not (yet) implemented");
            }
            string str = phone.FullPath(phone.CurrentDirectory, path);
            int num = MobileDevice.AFCFileRefOpen(phone.AFCHandle,System.Text.Encoding.UTF8.GetBytes(str), (int) none, 0, out num2);
            if (num != 0)
            {
                phone.ReConnect();
                throw new IOException("AFCFileRefOpen failed with error " + num.ToString());
            }
            return new iPhoneFile(phone, num2, none);
        }
Beispiel #4
0
 public static iPhoneFile OpenWrite(TAIiPhone phone, string path)
 {
     return(Open(phone, path, FileAccess.Write));
 }
Beispiel #5
0
 public static iPhoneFile OpenRead(TAIiPhone phone, string path)
 {
     return(Open(phone, path, FileAccess.Read));
 }
Beispiel #6
0
 private iPhoneFile(TAIiPhone phone, long handle, OpenMode mode)
 {
     this.phone  = phone;
     this.mode   = mode;
     this.handle = handle;
 }
Beispiel #7
0
 public static iPhoneFile OpenWrite(TAIiPhone phone, string path)
 {
     return Open(phone, path, FileAccess.Write);
 }
Beispiel #8
0
 public static iPhoneFile OpenRead(TAIiPhone phone, string path)
 {
     return Open(phone, path, FileAccess.Read);
 }
Beispiel #9
0
 private iPhoneFile(TAIiPhone phone, long handle, OpenMode mode)
 {
     this.phone = phone;
     this.mode = mode;
     this.handle = handle;
 }