Skip to main content

iClick Automation Tool Without Jailbreak Python Package.

Project description

iclick-auto

PyPI version PyPI license

English | 中文

用于iOS免越狱自动化的 Python SDK。除了 API 调用功能外,实现了断线重连和事件监听机制以及二进制meta数据包解析。

官方网站: https://iosclick.com/

安装

pip install iclick-auto

快速开始

from iclick import client as iclient

# 创建客户端实例
client = iclient()

# 监听设备事件
client.on('device:online', lambda data: print('设备上线:', data))
client.on('device:offline', lambda data: print('设备下线:', data))

# 连接服务器
client.connect()

# 调用 API
result = client.invoke('getDevices', {'deviceId': 'P60904DC8D3F'})

print('结果:', result)

API 文档

client(options)

创建客户端实例。

参数:

参数 类型 可选 说明 默认值
options.host str WebSocket 服务器地址 127.0.0.1
options.port int WebSocket 服务器端口 23188
options.autoReconnect bool 是否启用自动重连 True
options.reconnectDelay int 重连延迟(秒) 3
options.maxReconnectAttempts int 最大重连次数,0表示无限 8

示例:

from iclick import client as iclient

client = iclient({
    'host': '192.168.31.15',
    'port': 23188,
    'autoReconnect': True,
    'reconnectDelay': 5
})

client.connect()

连接到 WebSocket 服务器。

示例:

try:
    client.connect()
    print('连接成功')
except Exception as error:
    print('连接失败:', error)

client.invoke(type, params, timeout)

调用 API 方法。

参数:

  • type (str): API 类型
  • params (dict, 可选): 请求参数,默认 {}
  • timeout (int, 可选): 超时时间(秒),默认 18

返回: 响应数据

示例:

# 发送按键
result = client.invoke('sendKey', {
    'deviceId': 'P60904DC8D3F',
    'key': 'h',
    'fnkey': 'COMMAND'
})

# 自定义超时时间
result = client.invoke('someType', {'param': 'value'}, 30)

client.on(event_name, callback)

注册事件监听器。

参数:

  • event_name (str): 事件名称
  • callback (callable): 回调函数,接收事件数据作为参数

示例:

client.on('device:online', lambda data: print('设备上线:', data))
client.on('device:offline', lambda data: print('设备下线:', data))

client.off(event_name, callback)

移除事件监听器。

参数:

  • event_name (str): 事件名称
  • callback (callable, 可选): 要移除的回调函数。如果不提供,将移除该事件的所有监听器

示例:

def handler(data):
    print('收到事件:', data)

# 注册监听器
client.on('someEvent', handler)

# 移除特定监听器
client.off('someEvent', handler)

# 移除事件的所有监听器
client.off('someEvent')

client.destroy()

销毁客户端,断开连接并清理所有资源。

示例:

client.destroy()
print('客户端已销毁')

License

MIT

相关链接

问题反馈

如有问题,请在 Issues 中反馈。

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

iclick_auto-1.0.1.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

iclick_auto-1.0.1-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file iclick_auto-1.0.1.tar.gz.

File metadata

  • Download URL: iclick_auto-1.0.1.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for iclick_auto-1.0.1.tar.gz
Algorithm Hash digest
SHA256 0b7af446c19a92c839e19f48e76abf01e42bc7b807050db842951511712964bd
MD5 acfd5998035e1166543d443bb7893bce
BLAKE2b-256 5df2dce812854530299a229e80a84feb1641be638a8513ccd6ac96408ff138cc

See more details on using hashes here.

Provenance

The following attestation bundles were made for iclick_auto-1.0.1.tar.gz:

Publisher: publish-pypi.yml on Undefined-Token/iclick-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file iclick_auto-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: iclick_auto-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for iclick_auto-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2ab80db15a3fe2d9b2bde4ab72b9e4794c498cb7d39653d59ef6848fb6372a45
MD5 25f3a1b3f4ca69aed1ea4c3512a3d23d
BLAKE2b-256 26e9b35c07775edbf7ed49e75a235a0744f64a52ab98a22fcbbf80f527bfe4ff

See more details on using hashes here.

Provenance

The following attestation bundles were made for iclick_auto-1.0.1-py3-none-any.whl:

Publisher: publish-pypi.yml on Undefined-Token/iclick-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page