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
7a2d02e3
Commit
7a2d02e3
authored
Nov 06, 2019
by
swift_gan
Committed by
ganyao114
Nov 06, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tweak for edxp
parent
1799d815
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
4 deletions
+14
-4
PendingHookHandler.java
.../src/main/java/com/swift/sandhook/PendingHookHandler.java
+10
-1
SandHook.java
hooklib/src/main/java/com/swift/sandhook/SandHook.java
+1
-1
SandHookConfig.java
hooklib/src/main/java/com/swift/sandhook/SandHookConfig.java
+3
-2
No files found.
hooklib/src/main/java/com/swift/sandhook/PendingHookHandler.java
View file @
7a2d02e3
...
...
@@ -17,10 +17,15 @@ public class PendingHookHandler {
static
{
//init native hook
canUsePendingHook
=
SandHook
.
initForPendingHook
();
if
(!
SandHookConfig
.
edxpEnv
)
{
canUsePendingHook
=
SandHook
.
initForPendingHook
();
}
}
public
static
boolean
canWork
()
{
if
(
SandHookConfig
.
edxpEnv
)
{
return
true
;
}
return
canUsePendingHook
&&
SandHook
.
canGetObject
()
&&
!
SandHookConfig
.
DEBUG
;
}
...
...
@@ -37,6 +42,10 @@ public class PendingHookHandler {
if
(
clazz_ptr
==
0
)
return
;
Class
clazz
=
(
Class
)
SandHook
.
getObject
(
clazz_ptr
);
onClassInit
(
clazz
);
}
public
static
void
onClassInit
(
Class
clazz
)
{
if
(
clazz
==
null
)
return
;
Vector
<
HookWrapper
.
HookEntity
>
entities
=
pendingHooks
.
get
(
clazz
);
...
...
hooklib/src/main/java/com/swift/sandhook/SandHook.java
View file @
7a2d02e3
...
...
@@ -336,7 +336,7 @@ public class SandHook {
if
(
SandHookConfig
.
SDK_INT
<
Build
.
VERSION_CODES
.
N
)
return
false
;
try
{
File
profile
=
new
File
(
"/data/misc/profiles/cur/"
+
SandHookConfig
.
curUse
+
"/"
+
selfPackageName
+
"/primary.prof"
);
File
profile
=
new
File
(
"/data/misc/profiles/cur/"
+
SandHookConfig
.
curUse
r
+
"/"
+
selfPackageName
+
"/primary.prof"
);
if
(!
profile
.
getParentFile
().
exists
())
return
false
;
try
{
profile
.
delete
();
...
...
hooklib/src/main/java/com/swift/sandhook/SandHookConfig.java
View file @
7a2d02e3
...
...
@@ -13,8 +13,10 @@ public class SandHookConfig {
//Enable compile with jit
public
volatile
static
boolean
compiler
=
true
;
public
volatile
static
ClassLoader
initClassLoader
;
public
volatile
static
int
curUse
=
0
;
public
volatile
static
int
curUse
r
=
0
;
public
volatile
static
boolean
delayHook
=
true
;
//is for edxposed?
public
volatile
static
boolean
edxpEnv
=
false
;
public
volatile
static
String
libSandHookPath
;
public
volatile
static
LibLoader
libLoader
=
new
LibLoader
()
{
...
...
@@ -29,7 +31,6 @@ public class SandHookConfig {
}
};
public
interface
LibLoader
{
void
loadLib
();
}
...
...
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