You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The entry class currently used by the API is designed with reference to the working mode and principle of the native Xposed API.
The biggest problem encountered so far is the logical confusion of the entry class.
For example, we cannot clearly get a Host App's lifecycle from the beginning.
The current API solution is to use onAppLifecycle to monitor the Host App's lifecycle method.
So we may adopt a new entry class design pattern in later versions to bring better experience to Xposed Module developers.
The following example
@YukiXposedModule
classYourModule(hookContext:HookContext) : YukiBaseModule(hookContext:HookContext) {
init {
YukiHookAPI.configs {
isDebug =false
}
// HookContext means the global system context
hookContext.packageName // "android"// Listen to the loading events of the native Xposed APIYukiXposedEvent.events {
onInitZygote {
// The it object is [StartupParam]
}
onHandleLoadPackage {
// The it object is [LoadPackageParam]
}
onHandleInitPackageResources {
// The it object is [InitPackageResourcesParam]
}
}
}
overridefunonHook() {
loadApp(name ="com.example.demo") {
// Do something...
}
}
}
Below are the current entry class schemes.
The following example
@InjectYukiHookWithXposed
object HookEntry : IYukiHookXposedInit {
overridefunonInit() = configs {
isDebug =false
}
overridefunonHook() = encase {
loadApp(name ="com.example.demo") {
// Do something...
}
}
overridefunonXposedEvent() {
// Listen to the loading events of the native Xposed APIYukiXposedEvent.events {
onInitZygote {
// The it object is [StartupParam]
}
onHandleLoadPackage {
// The it object is [LoadPackageParam]
}
onHandleInitPackageResources {
// The it object is [InitPackageResourcesParam]
}
}
}
}
新的入口类方案
API 目前采用的入口类参考了原生 Xposed API 的工作模式与原理而设计,目前遇到的最大的问题就是入口类逻辑上的混乱问题。
例如我们无法从开始就明确地得到一个宿主的生命周期,目前 API 给出的解决方案是使用 onAppLifecycle 来监听宿主的生命周期方法。
New Hook Entry Class
The entry class currently used by the API is designed with reference to the working mode and principle of the native Xposed API.
The biggest problem encountered so far is the logical confusion of the entry class.
For example, we cannot clearly get a Host App's lifecycle from the beginning.
The current API solution is to use
onAppLifecycle
to monitor the Host App's lifecycle method.So we may adopt a new entry class design pattern in later versions to bring better experience to Xposed Module developers.
Below are the current entry class schemes.
新的入口类方案
API 目前采用的入口类参考了原生 Xposed API 的工作模式与原理而设计,目前遇到的最大的问题就是入口类逻辑上的混乱问题。
例如我们无法从开始就明确地得到一个宿主的生命周期,目前 API 给出的解决方案是使用
onAppLifecycle
来监听宿主的生命周期方法。所以我们可能会在后期的版本采用一种新的入口类设计模式来给 Xposed 模块开发者带来更好的体验。
以下是目前采取的入口类方案。
The text was updated successfully, but these errors were encountered: