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
de263333
Commit
de263333
authored
Mar 14, 2019
by
swift_gan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
support Android Q
parent
3c957c8e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
2 deletions
+24
-2
MyApp.java
app/src/main/java/com/swift/sandhook/MyApp.java
+14
-0
art_method.cpp
hooklib/src/main/cpp/art/art_method.cpp
+6
-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
-0
No files found.
app/src/main/java/com/swift/sandhook/MyApp.java
View file @
de263333
...
...
@@ -20,12 +20,20 @@ import de.robv.android.xposed.XC_MethodHook;
import
de.robv.android.xposed.XposedHelpers
;
public
class
MyApp
extends
Application
{
//if you want test Android Q, please set true, because SDK_INT of Android Q is still 28
public
final
static
boolean
testAndroidQ
=
false
;
@Override
public
void
onCreate
()
{
super
.
onCreate
();
SandHookConfig
.
DEBUG
=
BuildConfig
.
DEBUG
;
if
(
testAndroidQ
)
{
SandHookConfig
.
SDK_INT
=
29
;
}
SandHook
.
disableVMInline
();
try
{
...
...
@@ -46,6 +54,12 @@ public class MyApp extends Application {
XposedCompat
.
classLoader
=
getClassLoader
();
XposedCompat
.
isFirstApplication
=
true
;
//some error when invoke backup in Android Q
if
(
SandHookConfig
.
SDK_INT
>=
29
)
{
XposedCompat
.
useNewDexMaker
=
false
;
XposedCompat
.
useInternalStub
=
false
;
}
XposedHelpers
.
findAndHookMethod
(
Activity
.
class
,
"onResume"
,
new
XC_MethodHook
()
{
@Override
protected
void
beforeHookedMethod
(
MethodHookParam
param
)
throws
Throwable
{
...
...
hooklib/src/main/cpp/art/art_method.cpp
View file @
de263333
...
...
@@ -54,7 +54,12 @@ bool ArtMethod::isStatic() {
}
bool
ArtMethod
::
isCompiled
()
{
return
getQuickCodeEntry
()
!=
CastArtMethod
::
quickToInterpreterBridge
&&
getQuickCodeEntry
()
!=
CastArtMethod
::
genericJniStub
;
if
(
SDK_INT
>=
ANDROID_Q
)
{
return
getQuickCodeEntry
()
!=
CastArtMethod
::
quickToInterpreterBridge
;
}
else
{
return
getQuickCodeEntry
()
!=
CastArtMethod
::
quickToInterpreterBridge
&&
getQuickCodeEntry
()
!=
CastArtMethod
::
genericJniStub
;
}
}
bool
ArtMethod
::
isThumbCode
()
{
...
...
hooklib/src/main/java/com/swift/sandhook/SandHook.java
View file @
de263333
...
...
@@ -54,7 +54,7 @@ public class SandHook {
initTestOffset
();
initThreadPeer
();
SandHookMethodResolver
.
init
();
return
initNative
(
Build
.
VERSION
.
SDK_INT
,
SandHookConfig
.
DEBUG
);
return
initNative
(
SandHookConfig
.
SDK_INT
,
SandHookConfig
.
DEBUG
);
}
private
static
void
initThreadPeer
()
{
...
...
hooklib/src/main/java/com/swift/sandhook/SandHookConfig.java
View file @
de263333
package
com
.
swift
.
sandhook
;
import
android.os.Build
;
import
com.swift.sandhook.lib.BuildConfig
;
public
class
SandHookConfig
{
public
volatile
static
int
SDK_INT
=
Build
.
VERSION
.
SDK_INT
;
public
volatile
static
String
libSandHookPath
;
public
volatile
static
boolean
DEBUG
=
BuildConfig
.
DEBUG
;
}
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