nythepegasus/SideJITServer

ConnectionResetError

bxDroid opened this issue · 2 comments

Tried to create a JIT server with the tool, but it kept failing for some reason.

Device: iPad Pro 11 M2, iPadOS 17.5.1

INFO:     Started server process [172]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://127.0.0.1:49151 (Press CTRL+C to quit)
D:\SideJITServer-1.3.1\venv\Lib\site-packages\pymobiledevice3\utils.py:55: DeprecationWarning: There is no current event loop
  loop = asyncio.get_event_loop()
INFO:     127.0.0.1:57352 - "GET / HTTP/1.1" 200 OK
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "D:\SideJITServer-1.3.1\venv\scripts\SideJITServer.exe\__main__.py", line 7, in <module>
  File "D:\SideJITServer-1.3.1\venv\Lib\site-packages\click\core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\SideJITServer-1.3.1\venv\Lib\site-packages\click\core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "D:\SideJITServer-1.3.1\venv\Lib\site-packages\click\core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\SideJITServer-1.3.1\venv\Lib\site-packages\click\core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\SideJITServer-1.3.1\venv\Lib\site-packages\SideJITServer\__init__.py", line 251, in start_server
    refresh_devs()
  File "D:\SideJITServer-1.3.1\venv\Lib\site-packages\SideJITServer\__init__.py", line 123, in refresh_devs
    auto_mount_personalized(dev)
  File "D:\SideJITServer-1.3.1\venv\Lib\site-packages\pymobiledevice3\services\mobile_image_mounter.py", line 355, in auto_mount_personalized
    PersonalizedImageMounter(lockdown=lockdown).mount(image, build_manifest, trustcache)
  File "D:\SideJITServer-1.3.1\venv\Lib\site-packages\pymobiledevice3\services\mobile_image_mounter.py", line 213, in mount
    self.upload_image(self.IMAGE_TYPE, image, manifest)
  File "D:\SideJITServer-1.3.1\venv\Lib\site-packages\pymobiledevice3\services\mobile_image_mounter.py", line 118, in upload_image
    result = self.service.recv_plist()
             ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\SideJITServer-1.3.1\venv\Lib\site-packages\pymobiledevice3\service_connection.py", line 169, in recv_plist
    return parse_plist(self.recv_prefixed(endianity=endianity))
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\SideJITServer-1.3.1\venv\Lib\site-packages\pymobiledevice3\service_connection.py", line 139, in recv_prefixed
    size = self.recvall(4)
           ^^^^^^^^^^^^^^^
  File "D:\SideJITServer-1.3.1\venv\Lib\site-packages\pymobiledevice3\service_connection.py", line 131, in recvall
    chunk = self.recv(size - len(data))
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\SideJITServer-1.3.1\venv\Lib\site-packages\pymobiledevice3\service_connection.py", line 116, in recv
    return self.socket.recv(length)
           ^^^^^^^^^^^^^^^^^^^^^^^^
ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host

I don't know if this will help you but here you go:

Requirements:

  • Operating System: Windows 11
  • Applications: iTunes and iCloud applications directly from Apple (not from Microsoft Store).
  • Python Version: Latest version (3.11.9 works for this setup). Use the following commands in PowerShell to verify:
    • which python to locate the Python installation.
    • python --version to check the installed Python version.

Setting Up the Environment

  1. Launch PowerShell as an Administrator.

  2. Navigate to your Desktop:

    cd ~\Desktop
    
  3. Clone the repository:

    git clone https://github.com/nythepegasus/SideJITServer.git
    
  4. Change directory to the cloned repository and set up a Python virtual environment:

    cd ~\Desktop\SideJITServer
    python -m venv venv
    .\venv\Scripts\Activate.ps1
    

    You should now see: (venv) PS indicating that the virtual environment is activated.

  5. Install required packages:

    pip install -r requirements.txt
    pip install SideJITServer
    
  6. Check the installed version of SideJITServer:

    SideJITServer --version
    

    Expected output: pymobiledevice3: 4.2.3 and SideJITServer: 1.3.1

  7. Connect your iPad:

    • Plug in your iPad and wait for the 'Trust' prompt on the device.
    • It may help to sync the iPad with your computer first. Consider rebooting if things don’t behave as expected.

Troubleshooting

  • Ensure PowerShell is launched as Administrator.
  • Navigate to the cloned repository directory.
  • Activate the Python virtual environment.
  • Run the Activate.ps1 script.
  • Install necessary packages and the server.
  • Keep the iPad screen on at all times; do not let the screen lock.

Pairing Devices

  1. Pair the device:

    SideJITServer --pair
    
    • The iPad will prompt with a 'Trust' window after running the command.
  2. Verification:

  • On the iPad open the default browser and navigate to the third IP address provided by SideJITServer (e.g., http://192.168.1.164:8080). You should see a JSON response like:
    {"usbmux-########-################-USB":"########-################"}
    
  1. Follow through:
  • Go to the GitHub page, click on the shortcut link, and enter the 25-character UDID found between usbmux- and -USB.
  • You'll need to give it the SideJITServer IP when prompted. (e.g., http://192.168.1.164:8080).
  • Save it and find 'All Shortcuts' on the left. Select the shortcut named 'SideJIT'.
  • Choose AltStore or another application to which you want to grant access.