Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
S
SandHook
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
SandHook
Commits
e084449d
Commit
e084449d
authored
Mar 04, 2019
by
swift_gan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix crash in Android 5
parent
43cffaa5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
HookWrapper.java
...src/main/java/com/swift/sandhook/wrapper/HookWrapper.java
+11
-3
No files found.
hooklib/src/main/java/com/swift/sandhook/wrapper/HookWrapper.java
View file @
e084449d
...
@@ -39,7 +39,11 @@ public class HookWrapper {
...
@@ -39,7 +39,11 @@ public class HookWrapper {
if
(
targetHookClass
==
null
)
if
(
targetHookClass
==
null
)
throw
new
HookErrorException
(
"error hook wrapper class :"
+
clazz
.
getName
());
throw
new
HookErrorException
(
"error hook wrapper class :"
+
clazz
.
getName
());
Map
<
Member
,
HookEntity
>
hookEntityMap
=
getHookMethods
(
classLoader
,
targetHookClass
,
clazz
);
Map
<
Member
,
HookEntity
>
hookEntityMap
=
getHookMethods
(
classLoader
,
targetHookClass
,
clazz
);
fillBackupMethod
(
classLoader
,
clazz
,
hookEntityMap
);
try
{
fillBackupMethod
(
classLoader
,
clazz
,
hookEntityMap
);
}
catch
(
Throwable
throwable
)
{
throw
new
HookErrorException
(
"fillBackupMethod error!"
,
throwable
);
}
for
(
HookEntity
entity:
hookEntityMap
.
values
())
{
for
(
HookEntity
entity:
hookEntityMap
.
values
())
{
SandHook
.
hook
(
entity
);
SandHook
.
hook
(
entity
);
}
}
...
@@ -79,8 +83,12 @@ public class HookWrapper {
...
@@ -79,8 +83,12 @@ public class HookWrapper {
private
static
Map
<
Member
,
HookEntity
>
getHookMethods
(
ClassLoader
classLoader
,
Class
targetHookClass
,
Class
<?>
hookWrapperClass
)
throws
HookErrorException
{
private
static
Map
<
Member
,
HookEntity
>
getHookMethods
(
ClassLoader
classLoader
,
Class
targetHookClass
,
Class
<?>
hookWrapperClass
)
throws
HookErrorException
{
Map
<
Member
,
HookEntity
>
hookEntityMap
=
new
HashMap
<>();
Map
<
Member
,
HookEntity
>
hookEntityMap
=
new
HashMap
<>();
Method
[]
methods
=
hookWrapperClass
.
getDeclaredMethods
();
Method
[]
methods
=
null
;
if
(
methods
==
null
&&
methods
.
length
==
0
)
try
{
methods
=
hookWrapperClass
.
getDeclaredMethods
();
}
catch
(
Throwable
throwable
)
{
}
if
(
methods
==
null
||
methods
.
length
==
0
)
throw
new
HookErrorException
(
"error hook wrapper class :"
+
targetHookClass
.
getName
());
throw
new
HookErrorException
(
"error hook wrapper class :"
+
targetHookClass
.
getName
());
for
(
Method
method:
methods
)
{
for
(
Method
method:
methods
)
{
HookMethod
hookMethodAnno
=
method
.
getAnnotation
(
HookMethod
.
class
);
HookMethod
hookMethodAnno
=
method
.
getAnnotation
(
HookMethod
.
class
);
...
...
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