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
43ada919
Commit
43ada919
authored
Mar 01, 2019
by
swift_gan
Committed by
swift_gan
Mar 01, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tweak bridge exception
parent
5d50e0ba
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
4 deletions
+21
-4
build.gradle
build.gradle
+1
-1
SandHook.java
hooklib/src/main/java/com/swift/sandhook/SandHook.java
+19
-2
HookStubManager.java
...swift/sandhook/xposedcompat/hookstub/HookStubManager.java
+1
-1
No files found.
build.gradle
View file @
43ada919
...
...
@@ -30,7 +30,7 @@ ext {
userOrg
=
'ganyao114'
groupId
=
'com.swift.sandhook'
repoName
=
'SandHook'
publishVersion
=
'2.
5.2
'
publishVersion
=
'2.
9.5
'
desc
=
'android art hook'
website
=
'https://github.com/ganyao114/SandHook'
licences
=
[
'Apache-2.0'
]
...
...
hooklib/src/main/java/com/swift/sandhook/SandHook.java
View file @
43ada919
...
...
@@ -9,6 +9,7 @@ import com.swift.sandhook.wrapper.HookErrorException;
import
com.swift.sandhook.wrapper.HookWrapper
;
import
java.lang.reflect.Field
;
import
java.lang.reflect.InvocationTargetException
;
import
java.lang.reflect.Member
;
import
java.lang.reflect.Method
;
import
java.lang.reflect.Modifier
;
...
...
@@ -149,9 +150,25 @@ public class SandHook {
public
static
Object
callOriginMethod
(
Member
originMethod
,
Method
backupMethod
,
Object
thiz
,
Object
[]
args
)
throws
Throwable
{
backupMethod
.
setAccessible
(
true
);
if
(
Modifier
.
isStatic
(
originMethod
.
getModifiers
()))
{
return
backupMethod
.
invoke
(
null
,
args
);
try
{
return
backupMethod
.
invoke
(
null
,
args
);
}
catch
(
InvocationTargetException
throwable
)
{
if
(
throwable
.
getCause
()
!=
null
)
{
throw
throwable
.
getCause
();
}
else
{
throw
throwable
;
}
}
}
else
{
return
backupMethod
.
invoke
(
thiz
,
args
);
try
{
return
backupMethod
.
invoke
(
thiz
,
args
);
}
catch
(
InvocationTargetException
throwable
)
{
if
(
throwable
.
getCause
()
!=
null
)
{
throw
throwable
.
getCause
();
}
else
{
throw
throwable
;
}
}
}
}
...
...
xposedcompat/src/main/java/com/swift/sandhook/xposedcompat/hookstub/HookStubManager.java
View file @
43ada919
...
...
@@ -293,7 +293,7 @@ public class HookStubManager {
}
else
{
param
.
setResult
(
SandHook
.
callOriginMethod
(
originMethod
,
thiz
,
param
.
args
));
}
}
catch
(
Exception
e
)
{
}
catch
(
Throwable
e
)
{
XposedBridge
.
log
(
e
);
param
.
setThrowable
(
e
);
}
...
...
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