mirror of
https://github.com/Finb/Bark.git
synced 2025-12-08 21:36:01 +00:00
update docs
This commit is contained in:
parent
6094c501ca
commit
7b12197174
@ -19,9 +19,10 @@ deviceKey='F5u42Bd3HyW8KxkUqo2gRA'
|
|||||||
# push payload
|
# push payload
|
||||||
json='{"body": "test", "sound": "birdsong"}'
|
json='{"body": "test", "sound": "birdsong"}'
|
||||||
|
|
||||||
# must be 16 bit long
|
# Must be 16 bit long
|
||||||
key='1234567890123456'
|
key='1234567890123456'
|
||||||
iv='1111111111111111'
|
# IV can be randomly generated, but if it is random, it needs to be passed in the iv parameter.
|
||||||
|
iv='1234567890123456'
|
||||||
|
|
||||||
# openssl requires Hex encoding of manual keys and IVs, not ASCII encoding.
|
# openssl requires Hex encoding of manual keys and IVs, not ASCII encoding.
|
||||||
key=$(printf $key | xxd -ps -c 200)
|
key=$(printf $key | xxd -ps -c 200)
|
||||||
@ -29,9 +30,9 @@ iv=$(printf $iv | xxd -ps -c 200)
|
|||||||
|
|
||||||
ciphertext=$(echo -n $json | openssl enc -aes-128-cbc -K $key -iv $iv | base64)
|
ciphertext=$(echo -n $json | openssl enc -aes-128-cbc -K $key -iv $iv | base64)
|
||||||
|
|
||||||
# The console will print "d3QhjQjP5majvNt5CjsvFWwqqj2gKl96RFj5OO+u6ynTt7lkyigDYNA3abnnCLpr"
|
# The console will print "+aPt5cwN9GbTLLSFri60l3h1X00u/9j1FENfWiTxhNHVLGU+XoJ15JJG5W/d/yf0"
|
||||||
echo $ciphertext
|
echo $ciphertext
|
||||||
|
|
||||||
# URL encoding the ciphertext, there may be special characters.
|
# URL encoding the ciphertext, there may be special characters.
|
||||||
curl --data-urlencode "ciphertext=$ciphertext" http://api.day.app/$deviceKey
|
curl --data-urlencode "ciphertext=$ciphertext" --data-urlencode "iv=1234567890123456" https://api.day.app/$deviceKey
|
||||||
```
|
```
|
||||||
Loading…
x
Reference in New Issue
Block a user