Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
R
RatelApi
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
ratel
RatelApi
Commits
6b0ac144
Commit
6b0ac144
authored
Feb 25, 2020
by
Administrator
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
支持Zelda引擎
parent
a51f9d8f
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
9 deletions
+24
-9
HookProvider.java
src/main/java/com/virjar/ratel/api/HookProvider.java
+1
-1
RatelEngine.java
src/main/java/com/virjar/ratel/api/RatelEngine.java
+15
-0
RatelToolKit.java
src/main/java/com/virjar/ratel/api/RatelToolKit.java
+1
-0
RposedBridge.java
src/main/java/com/virjar/ratel/api/rposed/RposedBridge.java
+4
-6
RposedHelpers.java
src/main/java/com/virjar/ratel/api/rposed/RposedHelpers.java
+3
-2
No files found.
src/main/java/com/virjar/ratel/api/HookProvider.java
View file @
6b0ac144
...
...
@@ -7,7 +7,7 @@ import java.lang.reflect.Member;
public
interface
HookProvider
{
void
hookMethod
(
Member
method
,
RC_MethodHook
callback
);
RC_MethodHook
.
Unhook
hookMethod
(
Member
method
,
RC_MethodHook
callback
);
void
unhookMethod
(
Member
method
,
RC_MethodHook
callback
);
...
...
src/main/java/com/virjar/ratel/api/RatelEngine.java
0 → 100644
View file @
6b0ac144
package
com
.
virjar
.
ratel
.
api
;
/**
* ratel框架支持的四种引擎
*/
public
enum
RatelEngine
{
//入口重编
REBUILD_DEX
,
//修改AndroidManifest.xml,并植入新的dex
APPEND_DEX
,
//通过shell包裹,这种引擎线上使用此时非常少
SHELL
,
//zelda引擎,这里指商业版,开源版引擎: https://github.com/virjar/zelda
ZELDA
}
src/main/java/com/virjar/ratel/api/RatelToolKit.java
View file @
6b0ac144
...
...
@@ -92,6 +92,7 @@ public class RatelToolKit {
*/
public
static
boolean
killAppIfDetectANR
=
false
;
/**
* 虚拟化环境下,sdcard将会被隔离,导致无法往sdcard写入数据。但是如果ratel模块期望通过sdcard和其他app交换数据,那么需要通过一个sdcard白名单进行放行<br>
* 该路径规则为: /sdcard/ratel_white_dir/packageName/ <br>
...
...
src/main/java/com/virjar/ratel/api/rposed/RposedBridge.java
View file @
6b0ac144
...
...
@@ -3,9 +3,7 @@ package com.virjar.ratel.api.rposed;
import
android.util.Log
;
import
com.virjar.ratel.api.RatelToolKit
;
import
com.virjar.ratel.api.rposed.callbacks.RC_LoadPackage
;
import
java.io.IOException
;
import
java.lang.reflect.AccessibleObject
;
import
java.lang.reflect.InvocationTargetException
;
import
java.lang.reflect.Member
;
...
...
@@ -102,9 +100,8 @@ public final class RposedBridge {
* @see #hookAllConstructors
*/
public
static
RC_MethodHook
.
Unhook
hookMethod
(
Member
hookMethod
,
RC_MethodHook
callback
)
{
RatelToolKit
.
usedHookProvider
.
hookMethod
(
hookMethod
,
callback
);
return
callback
.
new
Unhook
(
hookMethod
);
return
RatelToolKit
.
usedHookProvider
.
hookMethod
(
hookMethod
,
callback
);
// return callback.new Unhook(hookMethod);
}
/**
...
...
@@ -113,7 +110,8 @@ public final class RposedBridge {
* @param hookMethod The method for which the callback should be removed.
* @param callback The reference to the callback as specified in {@link #hookMethod}.
* @deprecated Use {@link RC_MethodHook.Unhook#unhook} instead. An instance of the {@code Unhook}
* class is returned when you hook the method.
* class is returned when you hook the method.<br>
* 请注意,不要通过这个方法调用unhook,底层并没有实现他,请使用
*/
@Deprecated
public
static
void
unhookMethod
(
Member
hookMethod
,
RC_MethodHook
callback
)
{
...
...
src/main/java/com/virjar/ratel/api/rposed/RposedHelpers.java
View file @
6b0ac144
...
...
@@ -926,9 +926,10 @@ public final class RposedHelpers {
/**
* Returns the value of an object field in the given object instance. A class reference is not sufficient! See also {@link #findField}.
*/
public
static
Object
getObjectField
(
Object
obj
,
String
fieldName
)
{
@SuppressWarnings
(
"unchecked"
)
public
static
<
T
>
T
getObjectField
(
Object
obj
,
String
fieldName
)
{
try
{
return
findField
(
obj
.
getClass
(),
fieldName
).
get
(
obj
);
return
(
T
)
findField
(
obj
.
getClass
(),
fieldName
).
get
(
obj
);
}
catch
(
IllegalAccessException
e
)
{
// should not happen
RposedBridge
.
log
(
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