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
3f8a6ea3
Commit
3f8a6ea3
authored
Mar 07, 2020
by
Administrator
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
支持访问模块资源
parent
fdc7d731
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
58 additions
and
1 deletion
+58
-1
RatelResourceInterface.java
...ain/java/com/virjar/ratel/api/RatelResourceInterface.java
+33
-0
RatelToolKit.java
src/main/java/com/virjar/ratel/api/RatelToolKit.java
+16
-1
RatelEngineHistory.java
...in/java/com/virjar/ratel/api/hint/RatelEngineHistory.java
+1
-0
RC_LoadPackage.java
...com/virjar/ratel/api/rposed/callbacks/RC_LoadPackage.java
+8
-0
No files found.
src/main/java/com/virjar/ratel/api/RatelResourceInterface.java
0 → 100644
View file @
3f8a6ea3
package
com
.
virjar
.
ratel
.
api
;
import
android.content.Context
;
import
android.content.res.Resources
;
import
com.virjar.ratel.api.hint.RatelEngineHistory
;
import
com.virjar.ratel.api.hint.RatelEngineVersion
;
/**
* 提供访问模块资源的功能,包括皮肤,字体,图片,布局等<br>
* 如果资源已经加载过,那么本接口返回的是缓存对象
*/
@RatelEngineVersion
(
RatelEngineHistory
.
V_1_3_8
)
public
interface
RatelResourceInterface
{
/**
* 以一个特定的apk创建一个Resource对象
*
* @param moduleApkPath apk路径,一般为模块apk地址。Ratel框架下,可以在模块入口得到模块地址: com.virjar.ratel.api.rposed.callbacks.RC_LoadPackage.LoadPackageParam#modulePath
* @param moduleClassLoader 指向这个apk的classloader
* @return resource对象
*/
Resources
createResource
(
String
moduleApkPath
,
ClassLoader
moduleClassLoader
);
/**
* 以一个特定的apk创建一个Context对象
*
* @param moduleApkPath apk路径,一般为模块apk地址。Ratel框架下,可以在模块入口得到模块地址: com.virjar.ratel.api.rposed.callbacks.RC_LoadPackage.LoadPackageParam#modulePath
* @param moduleClassLoader 指向这个apk的classloader,如果你不需要通过inflater创建view对象,classloader可以为空
* @param baseContext context需要有一个父context,创建的context仅仅替换资源相关环境
* @return context对象
*/
Context
createContext
(
String
moduleApkPath
,
ClassLoader
moduleClassLoader
,
Context
baseContext
);
}
src/main/java/com/virjar/ratel/api/RatelToolKit.java
View file @
3f8a6ea3
...
...
@@ -56,12 +56,22 @@ public class RatelToolKit {
/**
* 也是用户ID,不过转化为一个long类型,方便在ID空间震荡算法中作为随机数起点种子
* 请注意他是PostInited的
* 请注意他是PostInited的<br>
* 另外请注意这个字段废弃了,请使用int类型的
*
* @see RatelToolKit#userIdentifierSeedInt
*/
@PostInited
@Deprecated
public
static
long
userIdentifierSeed
;
/**
* 也是用户ID,不过转化为一个int类型,方便在ID空间震荡算法中作为随机数起点种子
* 请注意他是PostInited的
*/
@PostInited
public
static
int
userIdentifierSeedInt
;
/**
* 虚拟化环境功能支持
*/
public
static
VirtualEnv
virtualEnv
=
null
;
...
...
@@ -88,6 +98,11 @@ public class RatelToolKit {
public
static
SchedulerTaskBeanHandler
schedulerTaskBeanHandler
=
null
;
/**
* 提供主动访问模块布局资源的能力
*/
public
static
RatelResourceInterface
ratelResourceInterface
=
null
;
/**
* 设置为true之后,框架将会自动检测apk处于ANR态,并且ANR态将会自杀程序,避免apk卡屏
*/
public
static
boolean
killAppIfDetectANR
=
false
;
...
...
src/main/java/com/virjar/ratel/api/hint/RatelEngineHistory.java
View file @
3f8a6ea3
...
...
@@ -5,4 +5,5 @@ public class RatelEngineHistory {
public
static
final
String
V_1_2_5
=
"1.2.5"
;
public
static
final
String
V_1_2_7
=
"1.2.7"
;
public
static
final
String
V_1_2_8
=
"1.2.8"
;
public
static
final
String
V_1_3_8
=
"1.3.8"
;
}
src/main/java/com/virjar/ratel/api/rposed/callbacks/RC_LoadPackage.java
View file @
3f8a6ea3
...
...
@@ -2,6 +2,8 @@ package com.virjar.ratel.api.rposed.callbacks;
import
android.content.pm.ApplicationInfo
;
import
com.virjar.ratel.api.hint.RatelEngineHistory
;
import
com.virjar.ratel.api.hint.RatelEngineVersion
;
import
com.virjar.ratel.api.rposed.IRposedHookLoadPackage
;
import
com.virjar.ratel.api.rposed.RposedBridge
;
...
...
@@ -53,6 +55,12 @@ public abstract class RC_LoadPackage extends RCallback implements IRposedHookLoa
/** Set to {@code true} if this is the first (and main) application for this process. */
public
boolean
isFirstApplication
;
/**
* The path to the module's APK. ratel增加,请注意需要在引擎版本高于 1.3.8之后才可以使用
*/
@RatelEngineVersion
(
RatelEngineHistory
.
V_1_3_8
)
public
String
modulePath
;
}
/** @hide */
...
...
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