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
9c8012cd
Commit
9c8012cd
authored
Jan 25, 2019
by
swift_gan
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
5524b33b
01c73697
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
82 additions
and
0 deletions
+82
-0
README.md
README.md
+82
-0
No files found.
README.md
0 → 100644
View file @
9c8012cd
# SandHook
Android ART Hook
# arch support
-
ARM64
-
ARM32(no tested)
-
Thumb-2
# OS
5.
0 - 9.0
# Scope
-
Object Methods/Virtual Methods
-
Static Methods
-
Constructors
-
System Methods
cant hook if lined
# how to use
-
hook method must be a static method
-
first par must be this if method is not static
-
method description must "same"(can be isAssignableFrom) with origin method
-
backup method same with above
```
java
@HookClass
(
Activity
.
class
)
//@HookReflectClass("android.app.Activity")
public
class
ActivityHooker
{
// can invoke to call origin
@HookMethodBackup
(
"onCreate"
)
@MethodParams
(
Bundle
.
class
)
static
Method
onCreateBackup
;
@HookMethodBackup
(
"onPause"
)
static
Method
onPauseBackup
;
@HookMethod
(
"onCreate"
)
@MethodParams
(
Bundle
.
class
)
//@MethodReflectParams("android.os.Bundle")
public
static
void
onCreate
(
Activity
thiz
,
Bundle
bundle
)
{
Log
.
e
(
"ActivityHooker"
,
"hooked onCreate success "
+
thiz
);
onCreateBackup
(
thiz
,
bundle
);
}
@HookMethodBackup
(
"onCreate"
)
@MethodParams
(
Bundle
.
class
)
public
static
void
onCreateBackup
(
Activity
thiz
,
Bundle
bundle
)
{
//invoke self to kill inline
onCreateBackup
(
thiz
,
bundle
);
}
@HookMethod
(
"onPause"
)
public
static
void
onPause
(
Activity
thiz
)
{
Log
.
e
(
"ActivityHooker"
,
"hooked onPause success "
+
thiz
);
onPauseBackup
(
thiz
);
}
@HookMethodBackup
(
"onPause"
)
public
static
void
onPauseBackup
(
Activity
thiz
)
{
//invoke self to kill inline
onPauseBackup
(
thiz
);
}
}
and
SandHook
.
addHookClass
(
CtrHook
.
class
,
LogHooker
.
class
,
CustmizeHooker
.
class
,
ActivityHooker
.
class
,
ObjectHooker
.
class
);
you
can
also
use:
SanHook
.
public
static
boolean
hook
(
Member
target
,
Method
hook
,
Method
backup
)
{}
```
if OS <= 5.1
backup method can call itself to avoid be inlining
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