Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
upgradeSFA
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王岩
upgradeSFA
Commits
7331fd57
Commit
7331fd57
authored
Oct 29, 2024
by
王岩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
3.4.0+102相关内容
parent
b1bdb390
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
9 deletions
+42
-9
notifications.sh
+41
-8
upgradeInfo.json
+1
-1
No files found.
notifications.sh
View file @
7331fd57
#!/bin/sh
jq
=
"./jq-win64.exe"
#日志输入
log
()
{
case
$2
in
...
...
@@ -41,28 +43,59 @@ get_current_branch() {
echo
$branch
}
#通过账号获取token
getToken
()
{
token
=(
$(
curl
-X
POST
"https://testapi.gzsle.com/auth/user/login"
\
-H
"Content-Type: application/json"
\
-d
'{"user_name":"wangyan", "password":"gzsle888", "login_type":2}'
\
--compressed
| awk
-F
'"authorization":"'
'{print $2}'
| awk
-F
'"},'
'{print $1}'
)
)
echo
$token
}
#获取所有在线用户的userId
getUserId
()
{
# echo '{"name": "ACGKAKA"}' | $jq -r
data
=(
$(
curl
-X
GET
"https://testapi.gzsle.com/auth/user/getAuthUsersList?page_size=1&page_no=1"
\
-H
"Content-Type: text/plain;charset=UTF-8"
\
-H
"Authorization: Bearer
$1
"
\
--compressed
)
)
echo
$data
|
$jq
-r
}
#发送消息通知
jPush
()
{
echo
$(
curl
-s
"https://api.jpush.cn/v3/push"
\
-H
"Authorization: Basic YjhiNjcyZmY3MjkyNjM1MTkzZjFhNjgwOmJmYWExYTg3YTEwZTNlMTJjNTI0ZmI0OQ=="
\
-H
"Content-Type: text/plain;charset=UTF-8"
\
-d
'{"platform":["android", "ios"],"audience":{"alias":["test_8
3916
"]},"message":{"title":"Update","msg_content":"Update"}}'
\
-d
'{"platform":["android", "ios"],"audience":{"alias":["test_8
4192
"]},"message":{"title":"Update","msg_content":"Update"}}'
\
--compressed
)
}
main
()
{
current_branch
=
$(
get_current_branch
)
DART_DEFINES
=
$(
getToken
)
echo
$current_branch
getUserId
$DART_DEFINES
if
[[
"
${
current_branch
}
"
==
"test"
]]
;
then
jPush
else
echo
"发送通知"
fi
# echo "获取的token为:$DART_DEFINES"
# current_branch=$(get_current_branch)
# echo $current_branch
# if [[ "${current_branch}" == "test" ]]; then
# jPush
# else
# echo "发送通知"
# fi
}
...
...
upgradeInfo.json
View file @
7331fd57
{
"android_version"
:
"3.4.0+10
1
"
,
"android_version"
:
"3.4.0+10
2
"
,
"android_forceUpdate"
:
false
,
"android_msg"
:
"2.3.4相关内容"
,
"android_url"
:
"https://gitlab.gzsle.com/wangyan/upgradeSFA/raw/test/app.apk"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment