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
e1484940
Commit
e1484940
authored
Oct 30, 2019
by
sikang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
1a8ef3c3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
1 deletions
+11
-1
python/help.py
+6
-0
python/main.py
+2
-0
python/tools/garble/java_garble.py
+3
-1
No files found.
python/help.py
View file @
e1484940
...
@@ -5,6 +5,7 @@ from tools.garble.manifest_grable import ManifestGarble
...
@@ -5,6 +5,7 @@ from tools.garble.manifest_grable import ManifestGarble
from
tools.garble.package_garble
import
PackageGarble
from
tools.garble.package_garble
import
PackageGarble
from
tools.garble.string_garble
import
StringGarble
from
tools.garble.string_garble
import
StringGarble
from
tools.garble.img_garble
import
ImageGarble
from
tools.garble.img_garble
import
ImageGarble
from
tools.garble.java_garble
import
JavaGarble
from
func
import
Function
from
func
import
Function
import
os
import
os
...
@@ -27,6 +28,7 @@ print("3、manifest混淆 在包路径中随机插入Activity并注册 (支持
...
@@ -27,6 +28,7 @@ print("3、manifest混淆 在包路径中随机插入Activity并注册 (支持
print
(
"4、包路径混淆(支持kotlin 但是kotlin的源码必须在src/main/java下)"
)
print
(
"4、包路径混淆(支持kotlin 但是kotlin的源码必须在src/main/java下)"
)
print
(
"5、字符串插入/加密"
)
print
(
"5、字符串插入/加密"
)
print
(
"6、插入混淆图片( 体积会增加1-2M )"
)
print
(
"6、插入混淆图片( 体积会增加1-2M )"
)
print
(
"7、java文件插入乱码(慎用,必须全流程测试)"
)
print
(
"21、还原代码"
)
print
(
"21、还原代码"
)
print
(
" "
)
print
(
" "
)
...
@@ -37,6 +39,7 @@ if command == 0:
...
@@ -37,6 +39,7 @@ if command == 0:
ApiGarble
()
.
api_garble
(
config
)
ApiGarble
()
.
api_garble
(
config
)
PackageGarble
()
.
pkg_garble
(
config
)
PackageGarble
()
.
pkg_garble
(
config
)
ManifestGarble
()
.
manifest_garble
(
config
)
ManifestGarble
()
.
manifest_garble
(
config
)
JavaGarble
()
.
java_garble
(
config
)
StringGarble
()
.
str_grable
(
config
)
StringGarble
()
.
str_grable
(
config
)
ImageGarble
()
.
img_garble
(
config
)
ImageGarble
()
.
img_garble
(
config
)
...
@@ -62,6 +65,9 @@ elif command == 5:
...
@@ -62,6 +65,9 @@ elif command == 5:
elif
command
==
6
:
elif
command
==
6
:
ImageGarble
()
.
img_garble
(
config
)
ImageGarble
()
.
img_garble
(
config
)
elif
command
==
7
:
JavaGarble
()
.
java_garble
(
config
)
elif
command
==
21
:
elif
command
==
21
:
#每行一个shell命令,参考自行修改
#每行一个shell命令,参考自行修改
command
=
"
%
s
\n
%
s
\n
%
s
\n
%
s
\n
%
s
\n
%
s
\n
%
s
\n
%
s
\n
%
s
\n
"
\
command
=
"
%
s
\n
%
s
\n
%
s
\n
%
s
\n
%
s
\n
%
s
\n
%
s
\n
%
s
\n
%
s
\n
"
\
...
...
python/main.py
View file @
e1484940
...
@@ -78,6 +78,8 @@ if command == 1 or command == 111:
...
@@ -78,6 +78,8 @@ if command == 1 or command == 111:
PackageGarble
()
.
pkg_garble
(
config
)
PackageGarble
()
.
pkg_garble
(
config
)
# Manifest混淆
# Manifest混淆
ManifestGarble
()
.
manifest_garble
(
config
)
ManifestGarble
()
.
manifest_garble
(
config
)
# 插入乱码
JavaGarble
()
.
java_garble
(
config
)
#图片混淆
#图片混淆
ImageGarble
()
.
img_garble
(
config
)
ImageGarble
()
.
img_garble
(
config
)
...
...
python/tools/garble/java_garble.py
View file @
e1484940
...
@@ -174,7 +174,7 @@ class JavaGarble:
...
@@ -174,7 +174,7 @@ class JavaGarble:
if
"return"
in
line
or
"throw"
in
line
:
if
"return"
in
line
or
"throw"
in
line
:
curly_braces
=
-
10000
curly_braces
=
-
10000
elif
";
\n
"
in
line
and
len
(
line
.
replace
(
" "
,
""
))
>
10
and
"//"
not
in
line
:
elif
";
\n
"
in
line
and
len
(
line
.
replace
(
" "
,
""
))
>
10
and
"//"
not
in
line
:
#随机取余
觉得
是否插入乱码
#随机取余
决定
是否插入乱码
if
random
.
randint
(
1
,
10
)
%
random
.
randint
(
1
,
3
)
==
0
:
if
random
.
randint
(
1
,
10
)
%
random
.
randint
(
1
,
3
)
==
0
:
line
+=
self
.
__insert_code
()
line
+=
self
.
__insert_code
()
...
@@ -185,8 +185,10 @@ class JavaGarble:
...
@@ -185,8 +185,10 @@ class JavaGarble:
with
open
(
"tools/garble/model/logic_model.java"
,
"r"
,
encoding
=
"utf-8"
)
as
fin
:
with
open
(
"tools/garble/model/logic_model.java"
,
"r"
,
encoding
=
"utf-8"
)
as
fin
:
self
.
__logic_model
=
fin
.
read
()
.
replace
(
"
\n\n
"
,
"
\n
"
)
.
replace
(
"
\n\n
"
,
"
\n
"
)
self
.
__logic_model
=
fin
.
read
()
.
replace
(
"
\n\n
"
,
"
\n
"
)
.
replace
(
"
\n\n
"
,
"
\n
"
)
print
(
"ccode inserting ..."
)
for
main_dir
in
config
[
'lib_main'
]:
for
main_dir
in
config
[
'lib_main'
]:
for
root
,
dirs
,
files
in
os
.
walk
(
"
%
s/
%
s"
%
(
config
[
"root"
],
main_dir
)):
for
root
,
dirs
,
files
in
os
.
walk
(
"
%
s/
%
s"
%
(
config
[
"root"
],
main_dir
)):
for
file
in
files
:
for
file
in
files
:
if
file
.
endswith
(
".java"
):
if
file
.
endswith
(
".java"
):
self
.
__garble_java_file
(
os
.
path
.
join
(
root
,
file
))
self
.
__garble_java_file
(
os
.
path
.
join
(
root
,
file
))
print
(
"done"
)
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