eni9889 / iphonetunnel-mac

Automatically exported from code.google.com/p/iphonetunnel-mac
1 stars 2 forks source link

Running iPhoneTunnel on Tiger #9

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I don't know if anyone is interested, but I had to make the following changes:

File "tcprelay.py", line 104:
    parser.add_option("-s", "--socket", dest='sockpath', action='store',
metavar='PATH', type='str', default=None, help="specify the path of the
usbmuxd socket")

Here the type 'str' has to be changed to 'string'.

I had also to include a recent plistlib.py. I attached one. (The method
writePlistToString is not implemented in the Python version shipped with Tiger)

Original issue reported on code.google.com by Christop...@gmail.com on 27 Jan 2010 at 2:51

Attachments:

GoogleCodeExporter commented 8 years ago
For PPC I had to change usbmux.py:

diff -r -Bbu --ignore-all-space iphonetunnel-mac-read-only/gui/usbmux.py
iphonetunnel-mac-read-only 2/gui/usbmux.py
--- iphonetunnel-mac-read-only/gui/usbmux.py    2010-01-27 17:42:39.000000000 
+0100
+++ iphonetunnel-mac-read-only 2/gui/usbmux.py  2010-01-27 17:10:47.000000000 
+0100
@@ -201,7 +201,9 @@
                if rlo:
                        self._processpacket()
        def connect(self, device, port):
-               ret = self._exchange(self.proto.TYPE_CONNECT,
{'DeviceID':device.devid, 'PortNumber':((port<<8) & 0xFF00) | (port>>8)})
+               if sys.byteorder == "little":
+                       port=(((port<<8) & 0xFF00) | (port>>8))
+               ret = self._exchange(self.proto.TYPE_CONNECT,
{'DeviceID':device.devid, 'PortNumber':port})
                if ret != 0:
                        raise MuxError("Connect failed: error %d"%ret)
                self.proto.connected = True

Original comment by Christop...@gmail.com on 27 Jan 2010 at 4:46

GoogleCodeExporter commented 8 years ago
Better solution:
socket.htonl(port)

The diff is now:
diff -r -Bbu --ignore-all-space iphonetunnel-mac-read-only/gui/usbmux.py
iphonetunnel-mac-read-only 2/gui/usbmux.py
--- iphonetunnel-mac-read-only/gui/usbmux.py    2010-01-27 17:58:21.000000000 
+0100
+++ iphonetunnel-mac-read-only 2/gui/usbmux.py  2010-01-27 17:56:50.000000000 
+0100
@@ -201,7 +201,7 @@
                if rlo:
                        self._processpacket()
        def connect(self, device, port):
-               ret = self._exchange(self.proto.TYPE_CONNECT,
{'DeviceID':device.devid, 'PortNumber':((port<<8) & 0xFF00) | (port>>8)})
+               ret = self._exchange(self.proto.TYPE_CONNECT,
{'DeviceID':device.devid, 'PortNumber':socket.htonl(port)})
                if ret != 0:
                        raise MuxError("Connect failed: error %d"%ret)
                self.proto.connected = True

Original comment by Christop...@gmail.com on 27 Jan 2010 at 4:58

GoogleCodeExporter commented 8 years ago
It's htons, of course:

-               ret = self._exchange(self.proto.TYPE_CONNECT,
{'DeviceID':device.devid, 'PortNumber':((port<<8) & 0xFF00) | (port>>8)})
+               ret = self._exchange(self.proto.TYPE_CONNECT,
{'DeviceID':device.devid, 'PortNumber':socket.htons(port)})

Original comment by Christop...@gmail.com on 27 Jan 2010 at 5:09

GoogleCodeExporter commented 8 years ago
I have Leopard on PPC and changing 
iPhoneTunnel.app/Contents/Resources/usbmux.py in the way described in Comment 3 
fixed the "ssh_exchange_identification: Connection closed by remote host" error
Thanks heaps!

Original comment by chy...@googlemail.com on 1 Dec 2010 at 5:59

GoogleCodeExporter commented 8 years ago
heelp. poor guy w/ ibook G4 PPC w/o Airport running osx 10.4 Tiger, and 
iPodTouch 1gen needs to put this into practice. Ready modified package would be 
greatly appreciated if made available,
also don't know where to replace plistlib.py, found correspinding pyc and pyo 
in .../lib/python2.3/plat-mac/ , still don't understand python enough to know 
how to proceed.

thaaanx

Original comment by juanflau...@gmail.com on 22 Aug 2013 at 5:37