Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lib_base
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
sikang
lib_base
Commits
049d728b
Commit
049d728b
authored
Sep 17, 2019
by
sikang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update script local_privacy
parent
28f4adf3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
4 deletions
+44
-4
script/privacy/update_local.py
+29
-0
script/privacy/update_privacy.py
+9
-4
script/script_help.sh
+6
-0
No files found.
script/privacy/update_local.py
0 → 100644
View file @
049d728b
# -*-coding:utf-8-*-
import
sys
import
requests
import
io
import
os
import
chardet
privacy_url
=
sys
.
argv
[
1
]
#是否更新本地文件
path
=
"../../../app/src/main/assets/web/"
.
replace
(
"/"
,
os
.
path
.
sep
)
if
not
os
.
path
.
exists
(
path
):
os
.
makedirs
(
path
)
resp
=
requests
.
get
(
privacy_url
);
content
=
resp
.
text
encode
=
chardet
.
detect
(
resp
.
content
)[
'encoding'
]
with
io
.
open
(
path
+
"privacy.html"
,
"w+"
,
encoding
=
encode
)
as
fout
:
fout
.
write
(
content
)
print
(
"本地协议已更新!"
+
privacy_url
)
ksp_url
=
privacy_url
.
replace
(
".html"
,
"Ksp.html"
)
resp
=
requests
.
get
(
ksp_url
)
content
=
resp
.
text
encode
=
chardet
.
detect
(
resp
.
content
)[
'encoding'
]
if
"<Code>NoSuchKey</Code>"
not
in
content
:
with
io
.
open
(
path
+
"privacyKsp.html"
,
"w+"
,
encode
)
as
fout
:
fout
.
write
(
content
)
print
(
"本地KSP协议已更新!"
+
ksp_url
)
script/privacy/update_privacy.py
View file @
049d728b
...
@@ -5,6 +5,7 @@ import requests
...
@@ -5,6 +5,7 @@ import requests
import
io
import
io
import
os
import
os
import
json
import
json
import
chardet
crop_id
=
sys
.
argv
[
1
]
crop_id
=
sys
.
argv
[
1
]
app_name
=
sys
.
argv
[
2
]
app_name
=
sys
.
argv
[
2
]
...
@@ -28,14 +29,18 @@ path = "../../../app/src/main/assets/web/".replace("/",os.path.sep)
...
@@ -28,14 +29,18 @@ path = "../../../app/src/main/assets/web/".replace("/",os.path.sep)
if
not
os
.
path
.
exists
(
path
):
if
not
os
.
path
.
exists
(
path
):
os
.
makedirs
(
path
)
os
.
makedirs
(
path
)
if
success
and
update_local
==
"true"
:
if
success
and
update_local
==
"true"
:
content
=
requests
.
get
(
privacy_url
)
.
text
resp
=
requests
.
get
(
privacy_url
);
with
io
.
open
(
path
+
"privacy.html"
,
"w+"
,
encoding
=
"ISO-8859-1"
)
as
fout
:
content
=
resp
.
text
encode
=
chardet
.
detect
(
resp
.
content
)[
'encoding'
]
with
io
.
open
(
path
+
"privacy.html"
,
"w+"
,
encoding
=
encode
)
as
fout
:
fout
.
write
(
content
)
fout
.
write
(
content
)
print
(
"本地协议已更新!"
+
privacy_url
)
print
(
"本地协议已更新!"
+
privacy_url
)
ksp_url
=
privacy_url
.
replace
(
".html"
,
"Ksp.html"
)
ksp_url
=
privacy_url
.
replace
(
".html"
,
"Ksp.html"
)
content
=
requests
.
get
(
ksp_url
)
.
text
resp
=
requests
.
get
(
ksp_url
)
content
=
resp
.
text
encode
=
chardet
.
detect
(
resp
.
content
)[
'encoding'
]
if
"<Code>NoSuchKey</Code>"
not
in
content
:
if
"<Code>NoSuchKey</Code>"
not
in
content
:
with
io
.
open
(
path
+
"privacyKsp.html"
,
"w+"
,
encoding
=
"UTF-8"
)
as
fout
:
with
io
.
open
(
path
+
"privacyKsp.html"
,
"w+"
,
encoding
=
encode
)
as
fout
:
fout
.
write
(
content
)
fout
.
write
(
content
)
print
(
"本地KSP协议已更新!"
+
ksp_url
)
print
(
"本地KSP协议已更新!"
+
ksp_url
)
script/script_help.sh
View file @
049d728b
...
@@ -29,6 +29,7 @@ echo "24、添加toolbox库"
...
@@ -29,6 +29,7 @@ echo "24、添加toolbox库"
echo
"25、马甲包切换"
echo
"25、马甲包切换"
echo
"26、打印checklist"
echo
"26、打印checklist"
echo
"27、更换隐私协议"
echo
"27、更换隐私协议"
echo
"28、刷新本地协议"
echo
" "
echo
" "
if
[[
"
$app_name
"
==
"
$majia_name
"
]]
;
then
if
[[
"
$app_name
"
==
"
$majia_name
"
]]
;
then
...
@@ -289,6 +290,11 @@ elif (($commod == '27'));then
...
@@ -289,6 +290,11 @@ elif (($commod == '27'));then
cd
privacy
cd
privacy
python update_privacy.py
"
${
corp_id
}
"
"
${
app_name
}
"
"
${
agreement_url
}
"
"true"
python update_privacy.py
"
${
corp_id
}
"
"
${
app_name
}
"
"
${
agreement_url
}
"
"true"
elif
((
$commod
==
'28'
))
;
then
cd
privacy
python update_local.py
"
${
agreement_url
}
"
elif
((
$commod
==
'10000'
))
elif
((
$commod
==
'10000'
))
then
then
cd
..
cd
..
...
...
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