Bark encrypted push client
Project description
Encrypted Push Notification Client for Bark / Bark加密推送通知客户端
Features / 特性
- 支持 AES-128/192/256
- 支持 加密策略(CBC / ECB,可自定义 GCM 等)
Installation / 安装
pip3 install bark-python
或者
git clone https://github.com/horennel/bark-python.git
python3 setup.py install
Usage / 用法示例
from bark_python import BarkClient, CBCStrategy, EncryptionStrategy
client = BarkClient(device_key="your_device_key", api_url="https://api.day.app")
# 设置加密方式(可选,默认明文)
client.set_encryption(
key="1234567890abcdef", # 默认空,AES128[16位]|AES192[24位]|AES256[32位] 字符串
iv="abcdef1234567890", # 默认空,CBC和ECB都为16为字符串
strategy_cls=CBCStrategy, # 也可以用 ECBStrategy,或者自定义
other_params={"自定义其他参数": "自定义其他参数"} # 可以添加自定义参数,用于自定义加密策略
)
# 发送推送通知
client.send_notification(
title="🔒 Secure Title",
body="Hello from encrypted Bark client!",
sound="shake"
)
# 自定义加密策略(可选)
class MyNewStrategy(EncryptionStrategy):
def encrypt(self, key: str, iv: str, data: str, other_params: dict) -> bytes:
# 返回加密后的bytes数据
pass
Credits / 致谢
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
bark_python-0.0.3.tar.gz
(5.3 kB
view details)
File details
Details for the file bark_python-0.0.3.tar.gz.
File metadata
- Download URL: bark_python-0.0.3.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7faa3d88a2427f0280cdf834f298596d346423036f0516d78709ea0c9e086cbd
|
|
| MD5 |
130f3f757ba6e54dd151210cc7751bb7
|
|
| BLAKE2b-256 |
ee09f08a085a40933bf306e6b6873b46f7fbb79bb034a3dcbc1379559fa98b71
|