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
dbf10a1d
Commit
dbf10a1d
authored
Feb 14, 2019
by
swift_gan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
check hooked in java
parent
97828311
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
SandHook.java
hooklib/src/main/java/com/swift/sandhook/SandHook.java
+3
-1
No files found.
hooklib/src/main/java/com/swift/sandhook/SandHook.java
View file @
dbf10a1d
...
...
@@ -59,8 +59,10 @@ public class SandHook {
HookWrapper
.
addHookClass
(
classLoader
,
hookWrapperClass
);
}
public
static
void
hook
(
HookWrapper
.
HookEntity
entity
)
throws
HookErrorException
{
public
static
synchronized
void
hook
(
HookWrapper
.
HookEntity
entity
)
throws
HookErrorException
{
if
(
entity
.
target
!=
null
&&
entity
.
hook
!=
null
)
{
if
(
globalHookEntityMap
.
containsKey
(
entity
.
target
))
throw
new
HookErrorException
(
"method <"
+
entity
.
target
.
getName
()
+
"> has been hooked!"
);
if
(!
SandHook
.
hook
(
entity
.
target
,
entity
.
hook
,
entity
.
backup
))
{
throw
new
HookErrorException
(
"hook method <"
+
entity
.
target
.
getName
()
+
"> error in native!"
);
}
...
...
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