[GH-ISSUE #263] 推送加密,当level为critical,并设置volume时,volume不生效 #232

Closed
opened 2026-03-03 11:38:09 +03:00 by kerem · 4 comments
Owner

Originally created by @penruins on GitHub (Dec 10, 2024).
Original GitHub issue: https://github.com/Finb/Bark/issues/263

声音大小默认为5

Originally created by @penruins on GitHub (Dec 10, 2024). Original GitHub issue: https://github.com/Finb/Bark/issues/263 声音大小默认为5
kerem closed this issue 2026-03-03 11:38:10 +03:00
Author
Owner

@Finb commented on GitHub (Dec 10, 2024):

请求下 app 自带示例,只修改音量参数看是否有效
再提供下你是怎么发的,给一下例子

<!-- gh-comment-id:2531758925 --> @Finb commented on GitHub (Dec 10, 2024): 请求下 app 自带示例,只修改音量参数看是否有效 再提供下你是怎么发的,给一下例子
Author
Owner

@penruins commented on GitHub (Dec 10, 2024):

我使用app生成的bash脚本进行的测试,level为critical,volume设置为0,消息应该只有振动没有声音才对。但是加密的推送会有声音

#!/usr/bin/env bash

# Documentation: https://bark.day.app/#/en-us/encryption

set -e

# bark key
deviceKey=''
# push payload
json='{"body": "test", "level": "critical", "volume": 0}'

# Must be 32 bit long
key=''
# IV can be randomly generated, but if it is random, it needs to be passed in the iv parameter.
iv=''

# openssl requires Hex encoding of manual keys and IVs, not ASCII encoding.
key=$(printf $key | xxd -ps -c 200)
iv=$(printf $iv | xxd -ps -c 200)

# If you get a 'Decryption Failed' prompt, try adding '-w 0' after the base64 command.
ciphertext=$(echo -n $json | openssl enc -aes-256-cbc -K $key -iv $iv | base64)

# The console will print "PGKwPn9LgFgTER7ZeIdJ4Y7dCPSsFQPcfPgo3bd2P5kCCW7NcoQ9KG5UpxW2xzPG"
echo $ciphertext

# URL encoding the ciphertext, there may be special characters.

# 加密推送 有声音
curl --data-urlencode "ciphertext=$ciphertext" --data-urlencode "iv=1234567812345678" https://api.day.app/$deviceKey

# 不加密加密 没有声音
#curl -X POST https://api.day.app/$deviceKey -H "Content-Type: application/json" -d "$json"
<!-- gh-comment-id:2531816788 --> @penruins commented on GitHub (Dec 10, 2024): 我使用app生成的bash脚本进行的测试,level为critical,volume设置为0,消息应该只有振动没有声音才对。但是加密的推送会有声音 ``` #!/usr/bin/env bash # Documentation: https://bark.day.app/#/en-us/encryption set -e # bark key deviceKey='' # push payload json='{"body": "test", "level": "critical", "volume": 0}' # Must be 32 bit long key='' # IV can be randomly generated, but if it is random, it needs to be passed in the iv parameter. iv='' # openssl requires Hex encoding of manual keys and IVs, not ASCII encoding. key=$(printf $key | xxd -ps -c 200) iv=$(printf $iv | xxd -ps -c 200) # If you get a 'Decryption Failed' prompt, try adding '-w 0' after the base64 command. ciphertext=$(echo -n $json | openssl enc -aes-256-cbc -K $key -iv $iv | base64) # The console will print "PGKwPn9LgFgTER7ZeIdJ4Y7dCPSsFQPcfPgo3bd2P5kCCW7NcoQ9KG5UpxW2xzPG" echo $ciphertext # URL encoding the ciphertext, there may be special characters. # 加密推送 有声音 curl --data-urlencode "ciphertext=$ciphertext" --data-urlencode "iv=1234567812345678" https://api.day.app/$deviceKey # 不加密加密 没有声音 #curl -X POST https://api.day.app/$deviceKey -H "Content-Type: application/json" -d "$json" ```
Author
Owner

@Finb commented on GitHub (Dec 10, 2024):

改成 "volume": "0" 试试

<!-- gh-comment-id:2531824803 --> @Finb commented on GitHub (Dec 10, 2024): 改成 "volume": "0" 试试
Author
Owner

@penruins commented on GitHub (Dec 10, 2024):

改成 "volume": "0" 试试

改成字符串就ok了,感谢~

<!-- gh-comment-id:2531839991 --> @penruins commented on GitHub (Dec 10, 2024): > 改成 "volume": "0" 试试 改成字符串就ok了,感谢~
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/Bark#232
No description provided.