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
3f258fca
Commit
3f258fca
authored
Oct 25, 2019
by
sikang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
2f5c1d8c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
16 deletions
+22
-16
python/config.json
+3
-3
python/help.py
+7
-2
python/tools/garble/api_garble.py
+12
-11
No files found.
python/config.json
View file @
3f258fca
...
...
@@ -5,14 +5,14 @@
"//properties"
:
"gradle.properties路径"
,
"properties"
:
"../../gradle.properties"
,
"//lib_main"
:
"所有加入混淆的library main目录,
上面 'root' 配置
下的相对路径"
,
"//lib_main"
:
"所有加入混淆的library main目录,
'root'
下的相对路径"
,
"lib_main"
:[
"app/src/main"
,
"lib_base/src/main"
],
"//
"
:
"
"
,
"
"
:
"
"
,
"//
api_mapping"
:
"api混淆文件的路径 'root' 下的相对路径
"
,
"
api_mapping"
:
"script/api_mapping
"
,
"//"
:
""
,
""
:
""
,
...
...
python/help.py
View file @
3f258fca
import
json
from
tools.garble.activity_garble
import
ActivityGarble
from
tools.garble.api_garble
import
ApiGarble
from
func
import
Function
...
...
@@ -16,9 +17,13 @@ config.update(properties)
print
(
" 使用帮助 "
)
print
(
"1、activity类名混淆"
)
print
(
"2、api混淆(针对 Retrofit 注解)"
)
command
=
int
(
input
(
"请输入指令编号:"
))
if
command
==
1
:
#配置参数 config.json - activities
ActivityGarble
()
.
activity_garble
(
config
)
\ No newline at end of file
ActivityGarble
()
.
activity_garble
(
config
)
elif
command
==
2
:
ApiGarble
()
.
api_garble
(
config
)
\ No newline at end of file
python/tools/garble/api_garble.py
View file @
3f258fca
...
...
@@ -44,18 +44,19 @@ class ApiGarble:
return
def
api_garble
(
self
,
config
):
if
not
os
.
path
.
exists
(
"
%
s/
script/api_mapping"
%
config
[
'root'
]
):
print
(
"api_mapping not found"
)
if
not
os
.
path
.
exists
(
"
%
s/
%
s"
%
(
config
[
'root'
],
config
[
'api_mapping'
])
):
print
(
"api_mapping not found
!
"
)
return
#java目录的路径
for
root
,
dirs
,
files
in
os
.
walk
(
"
%
s/lib_base/src/main"
%
config
[
'root'
]):
directory
=
os
.
path
.
join
(
os
.
getcwd
(),
root
)
for
file
in
files
:
#要检索的文件名
if
file
.
endswith
(
"LoanApi.java"
)
or
file
.
endswith
(
"UploadApi.java"
)
or
file
.
endswith
(
"UserApi.java"
):
# get the path of the java file
path
=
os
.
path
.
join
(
directory
,
file
)
self
.
__rename_api
(
path
,
config
)
for
main_dir
in
config
[
'lib_main'
]:
for
root
,
dirs
,
files
in
os
.
walk
(
"
%
s/
%
s"
%
(
config
[
'root'
],
main_dir
)):
directory
=
os
.
path
.
join
(
os
.
getcwd
(),
root
)
for
file
in
files
:
#要检索的文件名
if
file
.
endswith
(
"LoanApi.java"
)
or
file
.
endswith
(
"UploadApi.java"
)
or
file
.
endswith
(
"UserApi.java"
):
# get the path of the java file
path
=
os
.
path
.
join
(
directory
,
file
)
self
.
__rename_api
(
path
,
config
)
...
...
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