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
2b6d5ff5
Commit
2b6d5ff5
authored
Oct 18, 2019
by
sikang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update script
parent
145212d7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
69 additions
and
10 deletions
+69
-10
python/func.py
+40
-2
python/main.py
+5
-0
python/shell.py
+24
-8
No files found.
python/func.py
View file @
2b6d5ff5
...
@@ -202,12 +202,13 @@ class Function:
...
@@ -202,12 +202,13 @@ class Function:
with
open
(
"/Users/connor/StudioProjects/WorkSpace/app_desc.txt"
,
"r"
)
as
f
:
with
open
(
"/Users/connor/StudioProjects/WorkSpace/app_desc.txt"
,
"r"
)
as
f
:
file_content
=
f
.
read
()
.
replace
(
"
\n
"
,
"--line--"
)
file_content
=
f
.
read
()
.
replace
(
"
\n
"
,
"--line--"
)
index
=
random
.
randint
(
1
,
41
)
index
=
random
.
randint
(
1
,
41
)
info
=
re
.
compile
(
r''
+
"@Example
%
d--line--(.*)@End
%
d"
%
(
index
,
index
))
info
=
re
.
compile
(
r''
+
"@Example
%
d--line--(.*)@End
%
d"
%
(
index
,
index
))
desc
=
info
.
search
(
file_content
)
.
group
()
desc
=
info
.
search
(
file_content
)
.
group
()
desc
=
desc
.
replace
(
"--line--"
,
"
\n
"
)
\
desc
=
desc
.
replace
(
"--line--"
,
"
\n
"
)
\
.
replace
(
"@Example
%
d
\n
"
%
index
,
""
)
\
.
replace
(
"@Example
%
d
\n
"
%
index
,
""
)
\
.
replace
(
"@End
%
d"
%
index
,
""
)
.
replace
(
"@End
%
d"
%
index
,
""
)
file_name
=
"
%
s_
%
s"
\
file_name
=
"
%
s_
%
s"
\
%
(
config
[
'corp_id'
],
config
[
'app_name'
]
.
replace
(
" "
,
"_"
))
%
(
config
[
'corp_id'
],
config
[
'app_name'
]
.
replace
(
" "
,
"_"
))
...
@@ -300,3 +301,40 @@ class Function:
...
@@ -300,3 +301,40 @@ class Function:
with
open
(
"/Users/connor/Documents/apks/
%
s.html"
%
file_name
,
"wt"
)
as
fout
:
with
open
(
"/Users/connor/Documents/apks/
%
s.html"
%
file_name
,
"wt"
)
as
fout
:
fout
.
write
(
file_content
)
fout
.
write
(
file_content
)
print
(
"privacy done
\n
"
)
print
(
"privacy done
\n
"
)
# 转移出所有素材
@staticmethod
def
move_resources
(
config
):
file_name
=
"
%
s_
%
s"
\
%
(
config
[
'corp_id'
],
config
[
'app_name'
]
.
replace
(
" "
,
"_"
))
target
=
"/Users/connor/Documents/apks"
img_path
=
"../../app/src/main/res/drawable-xxhdpi"
if
not
os
.
path
.
exists
(
target
+
"/cache"
):
os
.
makedirs
(
target
+
"/cache"
)
# 移除
shutil
.
copy
(
"
%
s/logo.png"
%
img_path
,
"
%
s/cache/logo.png"
%
target
)
shutil
.
copy
(
"
%
s/top.png"
%
img_path
,
"
%
s/cache/top.png"
%
target
)
shutil
.
copy
(
"
%
s/script/api_mapping"
%
config
[
'root'
],
"
%
s/cache/api_mapping"
%
target
)
new_config
=
Function
.
load_properties
(
"../../gradle.properties"
)
os
.
system
(
"git reset --hard origin/
%
s"
%
config
[
'git_branch'
])
# 还原
shutil
.
copy
(
"
%
s/cache/logo.png"
%
target
,
"
%
s/logo.png"
%
img_path
)
shutil
.
copy
(
"
%
s/cache/top.png"
%
target
,
"
%
s/top.png"
%
img_path
)
shutil
.
copy
(
"
%
s/cache/api_mapping"
%
target
,
"
%
s/script/api_mapping"
%
config
[
'root'
])
Function
.
update_gateway
(
new_config
)
lines
=
{
"app_id"
,
"
\"
%
s
\"
"
%
new_config
[
'app_id'
],
"app_name"
,
"
\"
%
s
\"
"
%
new_config
[
'app_name'
],
"signing_keyAlias"
,
"
\"
%
s
\"
"
%
new_config
[
'signing_keyAlias'
],
"signing_certificate"
,
"
\"
%
s
\"
"
%
new_config
[
'signing_certificate'
],
"signging_certificatePassword"
,
"
\"
%
s
\"
"
%
new_config
[
'signging_certificatePassword'
],
"signging_storePassword"
,
"
\"
%
s
\"
"
%
new_config
[
'signging_storePassword'
],
}
Function
.
update_properties
(
config
,
lines
)
python/main.py
View file @
2b6d5ff5
...
@@ -21,6 +21,7 @@ print("5、pull lib_base & cash_plugin_toolbox")
...
@@ -21,6 +21,7 @@ print("5、pull lib_base & cash_plugin_toolbox")
print
(
"6、commit & push lib_base"
)
print
(
"6、commit & push lib_base"
)
print
(
"7、获取签名秘钥散列"
)
print
(
"7、获取签名秘钥散列"
)
print
(
"8、提交一个渠道包Tag"
)
print
(
"8、提交一个渠道包Tag"
)
print
(
"9、还原某一次提交的包名、logo、gw、name、但保持最新代码"
)
print
(
"11、copy apk"
)
print
(
"11、copy apk"
)
print
(
"12、马甲包切换"
)
print
(
"12、马甲包切换"
)
print
(
"13、打印checklist"
)
print
(
"13、打印checklist"
)
...
@@ -55,6 +56,10 @@ elif command == 7:
...
@@ -55,6 +56,10 @@ elif command == 7:
elif
command
==
8
:
elif
command
==
8
:
Shell
.
push_with_tag
(
config
)
Shell
.
push_with_tag
(
config
)
elif
command
==
9
:
Shell
.
reset_by_pkgname
(
config
)
Function
.
move_resources
(
config
)
elif
command
==
11
:
elif
command
==
11
:
Function
.
move_apk
(
config
)
Function
.
move_apk
(
config
)
...
...
python/shell.py
View file @
2b6d5ff5
...
@@ -3,6 +3,18 @@ import os
...
@@ -3,6 +3,18 @@ import os
class
Shell
:
class
Shell
:
#编译 待开发
@staticmethod
def
build_release
():
command
=
"
%
s
\n
%
s
\n
"
\
%
(
"cd ../script"
,
"./release_builder.sh"
)
os
.
system
(
command
)
#commit&push project
#commit&push project
@staticmethod
@staticmethod
def
push_project
(
config
):
def
push_project
(
config
):
...
@@ -63,12 +75,15 @@ class Shell:
...
@@ -63,12 +75,15 @@ class Shell:
os
.
system
(
command
)
os
.
system
(
command
)
#编译 待开发
#push with tag
@staticmethod
@staticmethod
def
build_release
():
def
reset_by_pkgname
(
config
):
command
=
"
%
s
\n
%
s
\n
"
\
pkgname
=
input
(
"输入包名: "
)
%
(
os
.
system
(
"git log --grep
%
s"
%
pkgname
)
"cd ../script"
,
print
(
" "
)
"./release_builder.sh"
)
commit_id
=
input
(
"输入commit id: "
)
os
.
system
(
command
)
os
.
system
(
"git reset --hard
%
s"
%
commit_id
)
print
(
" "
)
\ No newline at end of file
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