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
ec18314b
Commit
ec18314b
authored
Nov 14, 2019
by
sikang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update script
parent
2a275821
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
3 deletions
+32
-3
app_build.gradle
+8
-0
python/func.py
+13
-3
python/main.py
+4
-0
src/main/java/com/common/utils/Collector.java
+7
-0
No files found.
app_build.gradle
View file @
ec18314b
...
@@ -25,6 +25,14 @@ android {
...
@@ -25,6 +25,14 @@ android {
}
}
try
{
try
{
buildConfigField
'Boolean'
,
'keystoreSign'
,
"${keystore_sign}"
}
catch
(
Exception
e
)
{
buildConfigField
'Boolean'
,
'keystoreSign'
,
"\"\""
}
try
{
buildConfigField
'Boolean'
,
'OPEN_LIVENESS'
,
"${open_liveness}"
buildConfigField
'Boolean'
,
'OPEN_LIVENESS'
,
"${open_liveness}"
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
buildConfigField
'Boolean'
,
'OPEN_LIVENESS'
,
"true"
buildConfigField
'Boolean'
,
'OPEN_LIVENESS'
,
"true"
...
...
python/func.py
View file @
ec18314b
...
@@ -85,6 +85,13 @@ class Function:
...
@@ -85,6 +85,13 @@ class Function:
self
.
update_properties
(
config
,
reset
)
self
.
update_properties
(
config
,
reset
)
def
upate_keytore_sign
(
self
,
config
):
jks_path
=
"
%
s/jks/
%
s"
%
(
config
[
'root'
],
config
[
'signing_certificate'
]
.
split
(
"/"
)[
2
])
output
=
os
.
popen
(
"keytool -list -v -keystore
%
s -keypass
%
s -storepass
%
s"
%
(
jks_path
,
config
[
'signing_keyAlias'
],
config
[
'signing_keyAlias'
]))
sha1
=
output
.
read
()
.
split
(
"SHA1:"
)[
1
]
.
split
(
"SHA256"
)[
0
]
.
replace
(
" "
,
""
)
.
replace
(
"
\n
"
,
""
)
.
replace
(
"
\t
"
,
""
)
self
.
update_properties
(
config
,
{
"keystore_sign"
:
"
\"
%
s
\"
"
%
sha1
})
# 更新properties字段
# 更新properties字段
def
update_properties
(
self
,
config
,
dict
):
def
update_properties
(
self
,
config
,
dict
):
file_content
=
""
file_content
=
""
...
@@ -107,6 +114,9 @@ class Function:
...
@@ -107,6 +114,9 @@ class Function:
with
open
(
"
%
s/gradle.properties"
%
config
[
'root'
],
"w"
,
encoding
=
"utf-8"
)
as
f_w
:
with
open
(
"
%
s/gradle.properties"
%
config
[
'root'
],
"w"
,
encoding
=
"utf-8"
)
as
f_w
:
f_w
.
write
(
file_content
)
f_w
.
write
(
file_content
)
properties
=
self
.
load_properties
(
"
%
s/gradle.properties"
%
config
[
'root'
])
new_config
=
config
.
copy
()
config
=
new_config
.
update
(
properties
)
# 移动apk
# 移动apk
def
move_apk
(
self
,
config
):
def
move_apk
(
self
,
config
):
...
@@ -212,7 +222,7 @@ class Function:
...
@@ -212,7 +222,7 @@ class Function:
self
.
update_gateway
(
config
)
self
.
update_gateway
(
config
)
# 创建描述文件
# 创建描述文件
def
create_desc
(
self
,
config
):
def
create_desc
(
self
,
config
):
desc
=
""
desc
=
""
with
open
(
"/Users/connor/StudioProjects/WorkSpace/app_desc.txt"
,
"r"
)
as
f
:
with
open
(
"/Users/connor/StudioProjects/WorkSpace/app_desc.txt"
,
"r"
)
as
f
:
...
@@ -258,7 +268,7 @@ class Function:
...
@@ -258,7 +268,7 @@ class Function:
if
not
os
.
path
.
exists
(
target
+
"/"
+
file_name
):
if
not
os
.
path
.
exists
(
target
+
"/"
+
file_name
):
os
.
makedirs
(
target
+
"/"
+
file_name
)
os
.
makedirs
(
target
+
"/"
+
file_name
)
self
.
create_desc
(
config
)
self
.
create_desc
(
config
)
try
:
try
:
shutil
.
move
(
"
%
s/
%
s.apk"
%
(
target
,
file_name
),
shutil
.
move
(
"
%
s/
%
s.apk"
%
(
target
,
file_name
),
...
@@ -326,7 +336,7 @@ class Function:
...
@@ -326,7 +336,7 @@ class Function:
target
=
"/Users/connor/Documents/apks"
target
=
"/Users/connor/Documents/apks"
img_path
=
"../../app/src/main/res/drawable-xxhdpi"
img_path
=
"../../app/src/main/res/drawable-xxhdpi"
if
not
os
.
path
.
exists
(
target
+
"/cache"
):
if
not
os
.
path
.
exists
(
target
+
"/cache"
):
os
.
makedirs
(
target
+
"/cache"
)
os
.
makedirs
(
target
+
"/cache"
)
else
:
else
:
...
...
python/main.py
View file @
ec18314b
...
@@ -57,6 +57,7 @@ print("23、插入混淆图片")
...
@@ -57,6 +57,7 @@ print("23、插入混淆图片")
print
(
"24、插入混淆代码"
)
print
(
"24、插入混淆代码"
)
print
(
"25、插入混淆layout"
)
print
(
"25、插入混淆layout"
)
print
(
"26、启用/禁用代码"
)
print
(
"26、启用/禁用代码"
)
print
(
"27、签名SHA1"
)
command
=
int
(
input
(
"请输入指令编号:"
))
command
=
int
(
input
(
"请输入指令编号:"
))
...
@@ -168,3 +169,6 @@ elif command == 25:
...
@@ -168,3 +169,6 @@ elif command == 25:
elif
command
==
26
:
elif
command
==
26
:
SdkManager
()
.
sdk_manage
(
config
)
SdkManager
()
.
sdk_manage
(
config
)
elif
command
==
27
:
Function
()
.
upate_keytore_sign
(
config
)
src/main/java/com/common/utils/Collector.java
View file @
ec18314b
...
@@ -24,6 +24,8 @@ import tech.starwin.database.DataBaseHelper;
...
@@ -24,6 +24,8 @@ import tech.starwin.database.DataBaseHelper;
import
tech.starwin.database.entity.CallLogEntity
;
import
tech.starwin.database.entity.CallLogEntity
;
import
com.common.bean.CollectInfoEntity
;
import
com.common.bean.CollectInfoEntity
;
import
com.common.toolbox.app_utils.DeviceInfo
;
import
com.google.gson.Gson
;
import
tech.starwin.database.entity.ContactEntity
;
import
tech.starwin.database.entity.ContactEntity
;
import
tech.starwin.database.entity.SmsEntity
;
import
tech.starwin.database.entity.SmsEntity
;
...
@@ -155,6 +157,11 @@ public class Collector {
...
@@ -155,6 +157,11 @@ public class Collector {
// infos1.add(location);
// infos1.add(location);
// }
// }
CollectInfoEntity
deviceInfoEntity
=
new
CollectInfoEntity
();
deviceInfoEntity
.
setType
(
"DEVICE_INFO"
);
deviceInfoEntity
.
setUpdate_time
(
System
.
currentTimeMillis
());
deviceInfoEntity
.
setBody
(
new
Gson
().
toJson
(
DeviceInfo
.
getDeviceInfo
(
context
)));
infos1
.
add
(
deviceInfoEntity
);
return
infos1
;
return
infos1
;
}
}
...
...
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