Skip to content

A file transfer and clipboard synchronization tool between Windows and iOS devices implemented by Python and Shortcuts.

License

Notifications You must be signed in to change notification settings

yeyt97/AirDropPlus

Repository files navigation

AirDrop Plus

A file transfer and clipboard synchronization tool between Windows and iOS devices implemented using Python and Shortcuts.

中文

Buy the author a coffee

Alipay

Image

WechatPay

Image

Requirements

flask==3.0.0
flask-babel==4.0.0
pillow==10.1.0
pystray==0.19.5
pyinstaller==6.2.0
windows-toasts==1.3.1
pyperclip==1.8.2

Packaging

python build.py

Usage

  1. Network

    • Your iPhone and PC must be on the same LAN, or the PC can connect to the iOS hotspot, or vice versa.
    • (It doesn't use data when transferring files via a hotspot.)
  2. Install Bonjour on PC (optional)

    • Bonjour allows you to access Windows using the 'hostname.local' instead of an IP address.
    • The latest version of Bonjour may encounter issues accessing 'hostname.local'. Please use an older version instead.
    Image
  3. Start AirDropPlus.exe

    Start 'AirDropPlus.exe', and when prompted with the following pop-up, please click to allow.

    Image
  4. Set up AirdropPlus

    • Right click on the tray icon and open the web configration with settings.
  5. Get the shortcut on your iPhone. version: 1.5.4 https://www.icloud.com/shortcuts/c499c9a3d9b04e189cce38d9560b3e2e

    Image
  6. Set up the shortcut:

    • host:'hostname.local'
    • port:The same port as that in the PC-side settings
    • key:The same key as that in the PC-side settings
    Image
    If your PC does not support access via 'hostname.local', you can use the PC's IP address instead. Fill in the combinations of WiFi names and PC IP addresses for all your scenarios in the list below.
    Image
  7. Set the trigger method of the shortcut (choose one of the three methods):

    1. Set it up in 'Settings-Accessibility-Touch-BackTap' to trigger with a double-tap on the back of the iPhone.
    2. The iPhone 15 Pro series can set it to trigger with the side button.
      Image
    3. Newer versions of iOS can add 'AirDrop Plus' shortcuts to the Control Center.
      Image
  8. Remove the limit on the number of files sent via Shortcuts (Not performing this setting will cause an error when sending multiple images) iPhone - Settings - App - Shortcuts - Advanced - Allow Sharing Large Amounts of Data

  9. Functionality Testing:

    • Send files: Add the 'AirDrop Plus' shortcut to the file sharing menu.
      Image
      Image
      Tap the 'AirDrop Plus' shortcut from the file sharing menu.
      Image
      PC will receive the file and show a notification.
      Image
    • Send texts:
      1. Copy the text which you want to send.
      2. Trigger the shortcut, then tap the 'Send' option.
      Image
    • Receive files or texts:
      1. Trigger the shortcut
      2. Tap the 'Receive' option to receive file or text from PC's clipboard.
      Image

Issues and solutions

1. Shortcut Timeout:

  1. Check if the local area network (LAN) environment is unobstructed. In campus network environments, communication with LAN devices may be prohibited.
  2. Check if the port in the PC-side settings is the same as that set in the shortcut commands.
  3. Ensure that the hostname set in the shortcut is consistent with the PC's hostname (the hostname should not be in Chinese and should not contain '-'). You can also try changing hostname.local to IP address.
  4. Check if the PC's firewall is blocking the port set in the config.ini file. Remove all entries related to AirDropPlus and restart AirDropPlus. After the restart, please allow the pop-up for network requests.
    Image Image

2. No notification after startup, but the process is running in the background:

  1. It's possible that the PC's system version is too old to support interactive notifications. Try changing to basic notifications in the config.ini file.
    Image

API

0. Request Header Parameters

Arg Name Type Description
ShortcutVersion String The version of the shortcut. It must match the 'version' in the config.ini file.
Authorization String The key. It must match the first two segments of the 'key' in the config.ini file. For example, if the config.ini file has a version 1.5.1, this should be 1.5.

1. Send File

Send a file from the mobile device to the PC.

URL

[POST] /file

Request Body: Form

Arg Name Type Description
file File The File to Send

Return

  • Return Type: JSON
  • Return Content:
    {
        "success": true,
        "msg": "发送成功",
        "data": null
    }

2. Retrieve File

Retrieve a file on the PC

URL

[GET] /file/[path]

Arg Name Type Description
path String Base64 encoding of the file path

Return

  • Return Type: File

3. Send Clipboard

Send the clipboard to PC

URL

[POST] /clipboard

Request Parameters

  • Request Body: Form
Arg Name Type Description
clipboard String Mobile Clipboard Content

Return

  • Return Type: JSON
  • Return Content:
    {
        "success": true,
        "msg": "发送成功",
        "data": null
    }

4. Retrieve Clipboard Content

Retrieve the Clipboard Content on PC

URL

[GET] /clipboard

Return

  • Return Type: JSON
  • Return Content:
    • When the Clipboard Contains Text:
      {
          "success": true,
          "msg": "",
          "data": {
            "type": "text",
            "data": "clipboard_text"
          } 
      }
    • When the Clipboard Contains File:
      {
          "success": true,
          "msg": "",
          "data": {
            "type": "file",
            "data": ["file1_path_base64", "file2_path_base64", "file3_path_base64"]
          }
      }
    • When the Clipboard Contains Image:
      {
          "success": true,
          "msg": "",
          "data": {
            "type": "img",
            "data": "img_base64_code"
          }
      }

5. Test

Test Connection

URL

[GET] /

Return

  • Return Type: Text
  • Return Content: Hello world!

About

A file transfer and clipboard synchronization tool between Windows and iOS devices implemented by Python and Shortcuts.

Resources

License

Stars

Watchers

Forks

Packages

No packages published