mirror of
https://github.com/HighCapable/YukiHookAPI.git
synced 2025-09-06 10:45:47 +08:00
155 lines
92 KiB
HTML
155 lines
92 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="en-US">
|
||
<head>
|
||
<meta charset="utf-8">
|
||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||
<meta name="generator" content="VuePress 2.0.0-beta.51">
|
||
<style>
|
||
:root {
|
||
--c-bg: #fff;
|
||
}
|
||
html.dark {
|
||
--c-bg: #22272e;
|
||
}
|
||
html, body {
|
||
background-color: var(--c-bg);
|
||
}
|
||
</style>
|
||
<script>
|
||
const userMode = localStorage.getItem('vuepress-color-scheme');
|
||
const systemDarkMode = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
|
||
if (userMode === 'dark' || (userMode !== 'light' && systemDarkMode)) {
|
||
document.documentElement.classList.toggle('dark', true);
|
||
}
|
||
</script>
|
||
<link rel="icon" href="/images/logo.png"><title>Host Resource Injection Extension | Yuki Hook API</title><meta name="description" content="An efficient Kotlin version of the Xposed Hook API">
|
||
<link rel="modulepreload" href="/YukiHookAPI/assets/app.0df13dd9.js"><link rel="modulepreload" href="/YukiHookAPI/assets/host-inject.html.57cb2662.js"><link rel="modulepreload" href="/YukiHookAPI/assets/host-inject.html.c5fc5faf.js"><link rel="prefetch" href="/YukiHookAPI/assets/index.html.1b76ac9e.js"><link rel="prefetch" href="/YukiHookAPI/assets/index.html.872aa7a1.js"><link rel="prefetch" href="/YukiHookAPI/assets/index.html.6cc32291.js"><link rel="prefetch" href="/YukiHookAPI/assets/about.html.7638d3a2.js"><link rel="prefetch" href="/YukiHookAPI/assets/changelog.html.86d916d5.js"><link rel="prefetch" href="/YukiHookAPI/assets/contacts.html.5dc8225c.js"><link rel="prefetch" href="/YukiHookAPI/assets/future.html.94bd226b.js"><link rel="prefetch" href="/YukiHookAPI/assets/home.html.f6b9c2a4.js"><link rel="prefetch" href="/YukiHookAPI/assets/api-example.html.47c311e0.js"><link rel="prefetch" href="/YukiHookAPI/assets/api-exception.html.72ebad13.js"><link rel="prefetch" href="/YukiHookAPI/assets/api-using.html.c794f69e.js"><link rel="prefetch" href="/YukiHookAPI/assets/r8-proguard.html.15e04e11.js"><link rel="prefetch" href="/YukiHookAPI/assets/xposed-using.html.cd65195d.js"><link rel="prefetch" href="/YukiHookAPI/assets/example.html.a036bda1.js"><link rel="prefetch" href="/YukiHookAPI/assets/home.html.f6f658d0.js"><link rel="prefetch" href="/YukiHookAPI/assets/knowledge.html.437816ed.js"><link rel="prefetch" href="/YukiHookAPI/assets/move-to-new-api.html.78f39fa5.js"><link rel="prefetch" href="/YukiHookAPI/assets/quick-start.html.e309979a.js"><link rel="prefetch" href="/YukiHookAPI/assets/yukihookapi-projectbuilder.html.ed4fa356.js"><link rel="prefetch" href="/YukiHookAPI/assets/about.html.c0115524.js"><link rel="prefetch" href="/YukiHookAPI/assets/changelog.html.05a4745e.js"><link rel="prefetch" href="/YukiHookAPI/assets/contacts.html.3df7cacf.js"><link rel="prefetch" href="/YukiHookAPI/assets/future.html.2cf8d6de.js"><link rel="prefetch" href="/YukiHookAPI/assets/home.html.cad3998c.js"><link rel="prefetch" href="/YukiHookAPI/assets/api-example.html.f5361b1b.js"><link rel="prefetch" href="/YukiHookAPI/assets/api-exception.html.ac2a5859.js"><link rel="prefetch" href="/YukiHookAPI/assets/api-using.html.0a59e2e0.js"><link rel="prefetch" href="/YukiHookAPI/assets/r8-proguard.html.683a5429.js"><link rel="prefetch" href="/YukiHookAPI/assets/xposed-using.html.557dcdf1.js"><link rel="prefetch" href="/YukiHookAPI/assets/example.html.13ac887a.js"><link rel="prefetch" href="/YukiHookAPI/assets/home.html.4d8cac8a.js"><link rel="prefetch" href="/YukiHookAPI/assets/knowledge.html.821f04b5.js"><link rel="prefetch" href="/YukiHookAPI/assets/move-to-new-api.html.508c5312.js"><link rel="prefetch" href="/YukiHookAPI/assets/quick-start.html.eacb83f2.js"><link rel="prefetch" href="/YukiHookAPI/assets/yukihookapi-projectbuilder.html.d499d226.js"><link rel="prefetch" href="/YukiHookAPI/assets/host-lifecycle.html.412bbdd6.js"><link rel="prefetch" href="/YukiHookAPI/assets/logger.html.2d57680b.js"><link rel="prefetch" href="/YukiHookAPI/assets/reflection.html.ff24950f.js"><link rel="prefetch" href="/YukiHookAPI/assets/xposed-channel.html.96712a39.js"><link rel="prefetch" href="/YukiHookAPI/assets/xposed-storage.html.c35a7041.js"><link rel="prefetch" href="/YukiHookAPI/assets/host-inject.html.83f072dc.js"><link rel="prefetch" href="/YukiHookAPI/assets/host-lifecycle.html.09c0b222.js"><link rel="prefetch" href="/YukiHookAPI/assets/logger.html.e8fab6a3.js"><link rel="prefetch" href="/YukiHookAPI/assets/reflection.html.2e612549.js"><link rel="prefetch" href="/YukiHookAPI/assets/xposed-channel.html.b798a8f8.js"><link rel="prefetch" href="/YukiHookAPI/assets/xposed-storage.html.5fd9a913.js"><link rel="prefetch" href="/YukiHookAPI/assets/YukiHookAPI.html.77b2a461.js"><link rel="prefetch" href="/YukiHookAPI/assets/YukiHookAPI.html.476693ca.js"><link rel="prefetch" href="/YukiHookAPI/assets/InjectYukiHookWithXposed.html.56391530.js"><link rel="prefetch" href="/YukiHookAPI/assets/CurrentClass.html.16c29272.js"><link rel="prefetch" href="/YukiHookAPI/assets/GenericClass.html.7b666428.js"><link rel="prefetch" href="/YukiHookAPI/assets/HookClass.html.52e59cf0.js"><link rel="prefetch" href="/YukiHookAPI/assets/HookResources.html.2486cf29.js"><link rel="prefetch" href="/YukiHookAPI/assets/VariousClass.html.bd237fa4.js"><link rel="prefetch" href="/YukiHookAPI/assets/YukiMemberHookCreator.html.d3b181da.js"><link rel="prefetch" href="/YukiHookAPI/assets/YukiResourcesHookCreator.html.8aaa9934.js"><link rel="prefetch" href="/YukiHookAPI/assets/YukiBaseHooker.html.99eec744.js"><link rel="prefetch" href="/YukiHookAPI/assets/ReflectionFactory.html.a9e6e2d7.js"><link rel="prefetch" href="/YukiHookAPI/assets/YukiHookFactory.html.61db5860.js"><link rel="prefetch" href="/YukiHookAPI/assets/LoggerFactory.html.914e1c34.js"><link rel="prefetch" href="/YukiHookAPI/assets/HookParam.html.b19d4ad2.js"><link rel="prefetch" href="/YukiHookAPI/assets/PackageParam.html.7a64d58c.js"><link rel="prefetch" href="/YukiHookAPI/assets/InjectYukiHookWithXposed.html.cf9b500d.js"><link rel="prefetch" href="/YukiHookAPI/assets/CurrentClass.html.641fcd58.js"><link rel="prefetch" href="/YukiHookAPI/assets/GenericClass.html.3a0e1ac6.js"><link rel="prefetch" href="/YukiHookAPI/assets/HookClass.html.486aa6ea.js"><link rel="prefetch" href="/YukiHookAPI/assets/HookResources.html.4f07fd98.js"><link rel="prefetch" href="/YukiHookAPI/assets/VariousClass.html.7c81aa10.js"><link rel="prefetch" href="/YukiHookAPI/assets/YukiMemberHookCreator.html.37dcaec4.js"><link rel="prefetch" href="/YukiHookAPI/assets/YukiResourcesHookCreator.html.46168b72.js"><link rel="prefetch" href="/YukiHookAPI/assets/YukiBaseHooker.html.b68236f9.js"><link rel="prefetch" href="/YukiHookAPI/assets/ReflectionFactory.html.f7b7c82c.js"><link rel="prefetch" href="/YukiHookAPI/assets/YukiHookFactory.html.64f654a6.js"><link rel="prefetch" href="/YukiHookAPI/assets/LoggerFactory.html.72d1861a.js"><link rel="prefetch" href="/YukiHookAPI/assets/HookParam.html.f98d02d2.js"><link rel="prefetch" href="/YukiHookAPI/assets/PackageParam.html.37aae471.js"><link rel="prefetch" href="/YukiHookAPI/assets/ComponentTypeFactory.html.5af05d7d.js"><link rel="prefetch" href="/YukiHookAPI/assets/GraphicsTypeFactory.html.a3936b7c.js"><link rel="prefetch" href="/YukiHookAPI/assets/ViewTypeFactory.html.7da3eef4.js"><link rel="prefetch" href="/YukiHookAPI/assets/DefinedTypeFactory.html.8137c32c.js"><link rel="prefetch" href="/YukiHookAPI/assets/VariableTypeFactory.html.d4c9dbd1.js"><link rel="prefetch" href="/YukiHookAPI/assets/ModuleApplication.html.57573770.js"><link rel="prefetch" href="/YukiHookAPI/assets/YukiHookDataChannel.html.75c012dd.js"><link rel="prefetch" href="/YukiHookAPI/assets/YukiHookModulePrefs.html.e0f278fe.js"><link rel="prefetch" href="/YukiHookAPI/assets/IYukiHookXposedInit.html.b37a852b.js"><link rel="prefetch" href="/YukiHookAPI/assets/ComponentTypeFactory.html.0026a7b8.js"><link rel="prefetch" href="/YukiHookAPI/assets/GraphicsTypeFactory.html.bfb4e259.js"><link rel="prefetch" href="/YukiHookAPI/assets/ViewTypeFactory.html.612b6202.js"><link rel="prefetch" href="/YukiHookAPI/assets/DefinedTypeFactory.html.ba3bdd0b.js"><link rel="prefetch" href="/YukiHookAPI/assets/VariableTypeFactory.html.550d3346.js"><link rel="prefetch" href="/YukiHookAPI/assets/ModuleApplication.html.a386b8db.js"><link rel="prefetch" href="/YukiHookAPI/assets/YukiHookDataChannel.html.74e08a45.js"><link rel="prefetch" href="/YukiHookAPI/assets/YukiHookModulePrefs.html.5eb62ec3.js"><link rel="prefetch" href="/YukiHookAPI/assets/IYukiHookXposedInit.html.78a55860.js"><link rel="prefetch" href="/YukiHookAPI/assets/BaseFinder.html.a5dbb7a7.js"><link rel="prefetch" href="/YukiHookAPI/assets/DexClassFinder.html.5d8e12f0.js"><link rel="prefetch" href="/YukiHookAPI/assets/ConstructorFinder.html.0c13dc47.js"><link rel="prefetch" href="/YukiHookAPI/assets/FieldFinder.html.4410e26c.js"><link rel="prefetch" href="/YukiHookAPI/assets/MethodFinder.html.97f89f93.js"><link rel="prefetch" href="/YukiHookAPI/assets/YukiModuleResources.html.e5c5fb30.js"><link rel="prefetch" href="/YukiHookAPI/assets/YukiResForwarder.html.4e23df75.js"><link rel="prefetch" href="/YukiHookAPI/assets/YukiResources.html.afb6fb92.js"><link rel="prefetch" href="/YukiHookAPI/assets/YukiXposedEvent.html.560fa41c.js"><link rel="prefetch" href="/YukiHookAPI/assets/ChannelData.html.f8f818f6.js"><link rel="prefetch" href="/YukiHookAPI/assets/PrefsData.html.dfd7c23c.js"><link rel="prefetch" href="/YukiHookAPI/assets/ModulePreferenceFragment.html.764fecc3.js"><link rel="prefetch" href="/YukiHookAPI/assets/BaseFinder.html.8f275c85.js"><link rel="prefetch" href="/YukiHookAPI/assets/DexClassFinder.html.78c5f805.js"><link rel="prefetch" href="/YukiHookAPI/assets/ConstructorFinder.html.7de4f560.js"><link rel="prefetch" href="/YukiHookAPI/assets/FieldFinder.html.25713065.js"><link rel="prefetch" href="/YukiHookAPI/assets/MethodFinder.html.03ce70ab.js"><link rel="prefetch" href="/YukiHookAPI/assets/YukiModuleResources.html.d8e27a7f.js"><link rel="prefetch" href="/YukiHookAPI/assets/YukiResForwarder.html.0dadd8db.js"><link rel="prefetch" href="/YukiHookAPI/assets/YukiResources.html.7b0a4824.js"><link rel="prefetch" href="/YukiHookAPI/assets/YukiXposedEvent.html.a93ee4ef.js"><link rel="prefetch" href="/YukiHookAPI/assets/ChannelData.html.194718a1.js"><link rel="prefetch" href="/YukiHookAPI/assets/PrefsData.html.d3cf97f9.js"><link rel="prefetch" href="/YukiHookAPI/assets/ModulePreferenceFragment.html.0c7dadc7.js"><link rel="prefetch" href="/YukiHookAPI/assets/CountRules.html.2d5ab94d.js"><link rel="prefetch" href="/YukiHookAPI/assets/ModifierRules.html.c36dff17.js"><link rel="prefetch" href="/YukiHookAPI/assets/NameRules.html.00ac96fb.js"><link rel="prefetch" href="/YukiHookAPI/assets/ConstructorRules.html.d62bae6c.js"><link rel="prefetch" href="/YukiHookAPI/assets/FieldRules.html.9b04521f.js"><link rel="prefetch" href="/YukiHookAPI/assets/MemberRules.html.a071b3c6.js"><link rel="prefetch" href="/YukiHookAPI/assets/MethodRules.html.c10f9770.js"><link rel="prefetch" href="/YukiHookAPI/assets/ModuleAppActivity.html.90d3c4e6.js"><link rel="prefetch" href="/YukiHookAPI/assets/ModuleAppCompatActivity.html.a20d9206.js"><link rel="prefetch" href="/YukiHookAPI/assets/ModuleContextThemeWrapper.html.0879426b.js"><link rel="prefetch" href="/YukiHookAPI/assets/CountRules.html.2639d392.js"><link rel="prefetch" href="/YukiHookAPI/assets/ModifierRules.html.f7582dc2.js"><link rel="prefetch" href="/YukiHookAPI/assets/NameRules.html.47e512e4.js"><link rel="prefetch" href="/YukiHookAPI/assets/ConstructorRules.html.f8d7dd83.js"><link rel="prefetch" href="/YukiHookAPI/assets/FieldRules.html.6858f0d6.js"><link rel="prefetch" href="/YukiHookAPI/assets/MemberRules.html.b3e5d297.js"><link rel="prefetch" href="/YukiHookAPI/assets/MethodRules.html.146b27be.js"><link rel="prefetch" href="/YukiHookAPI/assets/ModuleAppActivity.html.09451ff7.js"><link rel="prefetch" href="/YukiHookAPI/assets/ModuleAppCompatActivity.html.dd9e40e9.js"><link rel="prefetch" href="/YukiHookAPI/assets/ModuleContextThemeWrapper.html.229a46ac.js"><link rel="prefetch" href="/YukiHookAPI/assets/MemberRulesResult.html.e79843c3.js"><link rel="prefetch" href="/YukiHookAPI/assets/MemberRulesResult.html.58e81c94.js"><link rel="prefetch" href="/YukiHookAPI/assets/404.html.c038a05a.js"><link rel="prefetch" href="/YukiHookAPI/assets/index.html.f87dff36.js"><link rel="prefetch" href="/YukiHookAPI/assets/index.html.dba95f53.js"><link rel="prefetch" href="/YukiHookAPI/assets/index.html.28055f14.js"><link rel="prefetch" href="/YukiHookAPI/assets/about.html.ec944f6b.js"><link rel="prefetch" href="/YukiHookAPI/assets/changelog.html.5916c03b.js"><link rel="prefetch" href="/YukiHookAPI/assets/contacts.html.9f3689a6.js"><link rel="prefetch" href="/YukiHookAPI/assets/future.html.df588ccb.js"><link rel="prefetch" href="/YukiHookAPI/assets/home.html.6242e42f.js"><link rel="prefetch" href="/YukiHookAPI/assets/api-example.html.b1d683b5.js"><link rel="prefetch" href="/YukiHookAPI/assets/api-exception.html.d56d5dc2.js"><link rel="prefetch" href="/YukiHookAPI/assets/api-using.html.2ef4fec2.js"><link rel="prefetch" href="/YukiHookAPI/assets/r8-proguard.html.a2895591.js"><link rel="prefetch" href="/YukiHookAPI/assets/xposed-using.html.6797ee59.js"><link rel="prefetch" href="/YukiHookAPI/assets/example.html.26a270e0.js"><link rel="prefetch" href="/YukiHookAPI/assets/home.html.48798952.js"><link rel="prefetch" href="/YukiHookAPI/assets/knowledge.html.29291093.js"><link rel="prefetch" href="/YukiHookAPI/assets/move-to-new-api.html.ad792dba.js"><link rel="prefetch" href="/YukiHookAPI/assets/quick-start.html.ccfd4ff5.js"><link rel="prefetch" href="/YukiHookAPI/assets/yukihookapi-projectbuilder.html.64c29e0b.js"><link rel="prefetch" href="/YukiHookAPI/assets/about.html.8a4bd1cf.js"><link rel="prefetch" href="/YukiHookAPI/assets/changelog.html.2ad14763.js"><link rel="prefetch" href="/YukiHookAPI/assets/contacts.html.467b3b1e.js"><link rel="prefetch" href="/YukiHookAPI/assets/future.html.6c82d90b.js"><link rel="prefetch" href="/YukiHookAPI/assets/home.html.1f82ac07.js"><link rel="prefetch" href="/YukiHookAPI/assets/api-example.html.3ac1f245.js"><link rel="prefetch" href="/YukiHookAPI/assets/api-exception.html.24b090c9.js"><link rel="prefetch" href="/YukiHookAPI/assets/api-using.html.b96abc22.js"><link rel="prefetch" href="/YukiHookAPI/assets/r8-proguard.html.a9b6bc06.js"><link rel="prefetch" href="/YukiHookAPI/assets/xposed-using.html.d7f1ce46.js"><link rel="prefetch" href="/YukiHookAPI/assets/example.html.86220fdf.js"><link rel="prefetch" href="/YukiHookAPI/assets/home.html.77e47ab3.js"><link rel="prefetch" href="/YukiHookAPI/assets/knowledge.html.5502b750.js"><link rel="prefetch" href="/YukiHookAPI/assets/move-to-new-api.html.ee3f0644.js"><link rel="prefetch" href="/YukiHookAPI/assets/quick-start.html.5203205b.js"><link rel="prefetch" href="/YukiHookAPI/assets/yukihookapi-projectbuilder.html.49b545cf.js"><link rel="prefetch" href="/YukiHookAPI/assets/host-lifecycle.html.d612070c.js"><link rel="prefetch" href="/YukiHookAPI/assets/logger.html.5a2aa1f5.js"><link rel="prefetch" href="/YukiHookAPI/assets/reflection.html.a4fc68b3.js"><link rel="prefetch" href="/YukiHookAPI/assets/xposed-channel.html.028f78e7.js"><link rel="prefetch" href="/YukiHookAPI/assets/xposed-storage.html.3ea584df.js"><link rel="prefetch" href="/YukiHookAPI/assets/host-inject.html.093fe63e.js"><link rel="prefetch" href="/YukiHookAPI/assets/host-lifecycle.html.8377b46c.js"><link rel="prefetch" href="/YukiHookAPI/assets/logger.html.f8d2e3d9.js"><link rel="prefetch" href="/YukiHookAPI/assets/reflection.html.56eb733c.js"><link rel="prefetch" href="/YukiHookAPI/assets/xposed-channel.html.061b939f.js"><link rel="prefetch" href="/YukiHookAPI/assets/xposed-storage.html.6343c101.js"><link rel="prefetch" href="/YukiHookAPI/assets/YukiHookAPI.html.7e3d7b76.js"><link rel="prefetch" href="/YukiHookAPI/assets/YukiHookAPI.html.3e36ea05.js"><link rel="prefetch" href="/YukiHookAPI/assets/InjectYukiHookWithXposed.html.f7e1836a.js"><link rel="prefetch" href="/YukiHookAPI/assets/CurrentClass.html.a389a3d0.js"><link rel="prefetch" href="/YukiHookAPI/assets/GenericClass.html.7b82953b.js"><link rel="prefetch" href="/YukiHookAPI/assets/HookClass.html.983f59fb.js"><link rel="prefetch" href="/YukiHookAPI/assets/HookResources.html.4ab46bdc.js"><link rel="prefetch" href="/YukiHookAPI/assets/VariousClass.html.02d837fe.js"><link rel="prefetch" href="/YukiHookAPI/assets/YukiMemberHookCreator.html.5e94cfde.js"><link rel="prefetch" href="/YukiHookAPI/assets/YukiResourcesHookCreator.html.f26e6364.js"><link rel="prefetch" href="/YukiHookAPI/assets/YukiBaseHooker.html.128a2f25.js"><link rel="prefetch" href="/YukiHookAPI/assets/ReflectionFactory.html.297ae241.js"><link rel="prefetch" href="/YukiHookAPI/assets/YukiHookFactory.html.68073ac3.js"><link rel="prefetch" href="/YukiHookAPI/assets/LoggerFactory.html.3e555bbf.js"><link rel="prefetch" href="/YukiHookAPI/assets/HookParam.html.559576ed.js"><link rel="prefetch" href="/YukiHookAPI/assets/PackageParam.html.bfa9296c.js"><link rel="prefetch" href="/YukiHookAPI/assets/InjectYukiHookWithXposed.html.60f0a3aa.js"><link rel="prefetch" href="/YukiHookAPI/assets/CurrentClass.html.711a40f2.js"><link rel="prefetch" href="/YukiHookAPI/assets/GenericClass.html.c4fb6c2e.js"><link rel="prefetch" href="/YukiHookAPI/assets/HookClass.html.3ef6e2d7.js"><link rel="prefetch" href="/YukiHookAPI/assets/HookResources.html.e3d41966.js"><link rel="prefetch" href="/YukiHookAPI/assets/VariousClass.html.15db1ce1.js"><link rel="prefetch" href="/YukiHookAPI/assets/YukiMemberHookCreator.html.40bc75c6.js"><link rel="prefetch" href="/YukiHookAPI/assets/YukiResourcesHookCreator.html.eb23f097.js"><link rel="prefetch" href="/YukiHookAPI/assets/YukiBaseHooker.html.32ab46f8.js"><link rel="prefetch" href="/YukiHookAPI/assets/ReflectionFactory.html.1d924c4c.js"><link rel="prefetch" href="/YukiHookAPI/assets/YukiHookFactory.html.8d68c665.js"><link rel="prefetch" href="/YukiHookAPI/assets/LoggerFactory.html.002fba9a.js"><link rel="prefetch" href="/YukiHookAPI/assets/HookParam.html.5371a89f.js"><link rel="prefetch" href="/YukiHookAPI/assets/PackageParam.html.28223ebb.js"><link rel="prefetch" href="/YukiHookAPI/assets/ComponentTypeFactory.html.c42743fb.js"><link rel="prefetch" href="/YukiHookAPI/assets/GraphicsTypeFactory.html.418b19e4.js"><link rel="prefetch" href="/YukiHookAPI/assets/ViewTypeFactory.html.f8235dd2.js"><link rel="prefetch" href="/YukiHookAPI/assets/DefinedTypeFactory.html.7372b7e8.js"><link rel="prefetch" href="/YukiHookAPI/assets/VariableTypeFactory.html.47a395fe.js"><link rel="prefetch" href="/YukiHookAPI/assets/ModuleApplication.html.eaa9a358.js"><link rel="prefetch" href="/YukiHookAPI/assets/YukiHookDataChannel.html.21574fa0.js"><link rel="prefetch" href="/YukiHookAPI/assets/YukiHookModulePrefs.html.5e823d24.js"><link rel="prefetch" href="/YukiHookAPI/assets/IYukiHookXposedInit.html.cec96d9f.js"><link rel="prefetch" href="/YukiHookAPI/assets/ComponentTypeFactory.html.0d6aa95d.js"><link rel="prefetch" href="/YukiHookAPI/assets/GraphicsTypeFactory.html.3fa6b8e1.js"><link rel="prefetch" href="/YukiHookAPI/assets/ViewTypeFactory.html.fdb04388.js"><link rel="prefetch" href="/YukiHookAPI/assets/DefinedTypeFactory.html.643bdf7e.js"><link rel="prefetch" href="/YukiHookAPI/assets/VariableTypeFactory.html.257348c7.js"><link rel="prefetch" href="/YukiHookAPI/assets/ModuleApplication.html.0dcec518.js"><link rel="prefetch" href="/YukiHookAPI/assets/YukiHookDataChannel.html.f882779e.js"><link rel="prefetch" href="/YukiHookAPI/assets/YukiHookModulePrefs.html.dc0abd82.js"><link rel="prefetch" href="/YukiHookAPI/assets/IYukiHookXposedInit.html.ddcf2e6e.js"><link rel="prefetch" href="/YukiHookAPI/assets/BaseFinder.html.81e6af7f.js"><link rel="prefetch" href="/YukiHookAPI/assets/DexClassFinder.html.a23a6b3b.js"><link rel="prefetch" href="/YukiHookAPI/assets/ConstructorFinder.html.95fa4927.js"><link rel="prefetch" href="/YukiHookAPI/assets/FieldFinder.html.34b8847b.js"><link rel="prefetch" href="/YukiHookAPI/assets/MethodFinder.html.5e6ef1ae.js"><link rel="prefetch" href="/YukiHookAPI/assets/YukiModuleResources.html.13685b10.js"><link rel="prefetch" href="/YukiHookAPI/assets/YukiResForwarder.html.b02ab1a2.js"><link rel="prefetch" href="/YukiHookAPI/assets/YukiResources.html.611ee389.js"><link rel="prefetch" href="/YukiHookAPI/assets/YukiXposedEvent.html.416f6fb0.js"><link rel="prefetch" href="/YukiHookAPI/assets/ChannelData.html.6c55c7f7.js"><link rel="prefetch" href="/YukiHookAPI/assets/PrefsData.html.a3449f85.js"><link rel="prefetch" href="/YukiHookAPI/assets/ModulePreferenceFragment.html.eb223136.js"><link rel="prefetch" href="/YukiHookAPI/assets/BaseFinder.html.6a4c6fcf.js"><link rel="prefetch" href="/YukiHookAPI/assets/DexClassFinder.html.cf7a4c98.js"><link rel="prefetch" href="/YukiHookAPI/assets/ConstructorFinder.html.9e028ebf.js"><link rel="prefetch" href="/YukiHookAPI/assets/FieldFinder.html.246ff846.js"><link rel="prefetch" href="/YukiHookAPI/assets/MethodFinder.html.978bf9d3.js"><link rel="prefetch" href="/YukiHookAPI/assets/YukiModuleResources.html.1fb21b7d.js"><link rel="prefetch" href="/YukiHookAPI/assets/YukiResForwarder.html.9e2aae53.js"><link rel="prefetch" href="/YukiHookAPI/assets/YukiResources.html.e1c60542.js"><link rel="prefetch" href="/YukiHookAPI/assets/YukiXposedEvent.html.44364a03.js"><link rel="prefetch" href="/YukiHookAPI/assets/ChannelData.html.e8ab194d.js"><link rel="prefetch" href="/YukiHookAPI/assets/PrefsData.html.b0f51540.js"><link rel="prefetch" href="/YukiHookAPI/assets/ModulePreferenceFragment.html.2fb15822.js"><link rel="prefetch" href="/YukiHookAPI/assets/CountRules.html.d451ac3b.js"><link rel="prefetch" href="/YukiHookAPI/assets/ModifierRules.html.a34b373b.js"><link rel="prefetch" href="/YukiHookAPI/assets/NameRules.html.3d42ddb5.js"><link rel="prefetch" href="/YukiHookAPI/assets/ConstructorRules.html.754c8c85.js"><link rel="prefetch" href="/YukiHookAPI/assets/FieldRules.html.933437a0.js"><link rel="prefetch" href="/YukiHookAPI/assets/MemberRules.html.9f36c4a7.js"><link rel="prefetch" href="/YukiHookAPI/assets/MethodRules.html.fddb0825.js"><link rel="prefetch" href="/YukiHookAPI/assets/ModuleAppActivity.html.a81c85fc.js"><link rel="prefetch" href="/YukiHookAPI/assets/ModuleAppCompatActivity.html.35cdd0c9.js"><link rel="prefetch" href="/YukiHookAPI/assets/ModuleContextThemeWrapper.html.f3a0add2.js"><link rel="prefetch" href="/YukiHookAPI/assets/CountRules.html.a6750383.js"><link rel="prefetch" href="/YukiHookAPI/assets/ModifierRules.html.25b1119e.js"><link rel="prefetch" href="/YukiHookAPI/assets/NameRules.html.1d83da45.js"><link rel="prefetch" href="/YukiHookAPI/assets/ConstructorRules.html.ffecd8e1.js"><link rel="prefetch" href="/YukiHookAPI/assets/FieldRules.html.99e868fb.js"><link rel="prefetch" href="/YukiHookAPI/assets/MemberRules.html.6ea88e97.js"><link rel="prefetch" href="/YukiHookAPI/assets/MethodRules.html.60518e05.js"><link rel="prefetch" href="/YukiHookAPI/assets/ModuleAppActivity.html.bc223c7e.js"><link rel="prefetch" href="/YukiHookAPI/assets/ModuleAppCompatActivity.html.f2964701.js"><link rel="prefetch" href="/YukiHookAPI/assets/ModuleContextThemeWrapper.html.24974166.js"><link rel="prefetch" href="/YukiHookAPI/assets/MemberRulesResult.html.11d6508d.js"><link rel="prefetch" href="/YukiHookAPI/assets/MemberRulesResult.html.b4f9e857.js"><link rel="prefetch" href="/YukiHookAPI/assets/404.html.3ca9e9ba.js">
|
||
<link rel="stylesheet" href="/YukiHookAPI/assets/style.e115708c.css">
|
||
</head>
|
||
<body>
|
||
<div id="app"><!--[--><div class="theme-container"><!--[--><header class="navbar"><div class="toggle-sidebar-button" title="toggle sidebar" aria-expanded="false" role="button" tabindex="0"><div class="icon" aria-hidden="true"><span></span><span></span><span></span></div></div><span><a href="/YukiHookAPI/en/" class=""><img class="logo" src="/YukiHookAPI/images/logo.png" alt="Yuki Hook API"><span class="site-name can-hide">Yuki Hook API</span></a></span><div class="navbar-items-wrapper" style=""><!--[--><!--]--><nav class="navbar-items can-hide"><!--[--><div class="navbar-item"><div class="navbar-dropdown-wrapper"><button class="navbar-dropdown-title" type="button" aria-label="Navigation"><span class="title">Navigation</span><span class="arrow down"></span></button><button class="navbar-dropdown-title-mobile" type="button" aria-label="Navigation"><span class="title">Navigation</span><span class="right arrow"></span></button><ul style="display:none;" class="navbar-dropdown"><!--[--><li class="navbar-dropdown-item"><!--[--><h4 class="navbar-dropdown-subtitle"><span>Get Started</span></h4><ul class="navbar-dropdown-subitem-wrapper"><!--[--><li class="navbar-dropdown-subitem"><a href="/YukiHookAPI/en/guide/home" class="" aria-label="Introduce"><!--[--><!--]--> Introduce <!--[--><!--]--></a></li><li class="navbar-dropdown-subitem"><a href="/YukiHookAPI/en/guide/knowledge" class="" aria-label="Basic Knowledge"><!--[--><!--]--> Basic Knowledge <!--[--><!--]--></a></li><li class="navbar-dropdown-subitem"><a href="/YukiHookAPI/en/guide/quick-start" class="" aria-label="Quick Start"><!--[--><!--]--> Quick Start <!--[--><!--]--></a></li><li class="navbar-dropdown-subitem"><a href="/YukiHookAPI/en/guide/example" class="" aria-label="Usage Example"><!--[--><!--]--> Usage Example <!--[--><!--]--></a></li><li class="navbar-dropdown-subitem"><a href="/YukiHookAPI/en/guide/move-to-new-api" class="" aria-label="Migrate from Xposed API"><!--[--><!--]--> Migrate from Xposed API <!--[--><!--]--></a></li><!--]--></ul><!--]--></li><li class="navbar-dropdown-item"><!--[--><h4 class="navbar-dropdown-subtitle"><span>Configs</span></h4><ul class="navbar-dropdown-subitem-wrapper"><!--[--><li class="navbar-dropdown-subitem"><a href="/YukiHookAPI/en/config/api-example" class="" aria-label="API Basic Configs"><!--[--><!--]--> API Basic Configs <!--[--><!--]--></a></li><li class="navbar-dropdown-subitem"><a href="/YukiHookAPI/en/config/api-exception" class="" aria-label="API Exception Handling"><!--[--><!--]--> API Exception Handling <!--[--><!--]--></a></li><li class="navbar-dropdown-subitem"><a href="/YukiHookAPI/en/config/xposed-using" class="" aria-label="Use as Xposed Module Configs"><!--[--><!--]--> Use as Xposed Module Configs <!--[--><!--]--></a></li><li class="navbar-dropdown-subitem"><a href="/YukiHookAPI/en/config/api-using" class="" aria-label="Use as Hook API Configs"><!--[--><!--]--> Use as Hook API Configs <!--[--><!--]--></a></li><li class="navbar-dropdown-subitem"><a href="/YukiHookAPI/en/config/r8-proguard" class="" aria-label="R8 & Proguard Obfuscate"><!--[--><!--]--> R8 & Proguard Obfuscate <!--[--><!--]--></a></li><!--]--></ul><!--]--></li><li class="navbar-dropdown-item"><!--[--><h4 class="navbar-dropdown-subtitle"><span>Tools</span></h4><ul class="navbar-dropdown-subitem-wrapper"><!--[--><li class="navbar-dropdown-subitem"><a href="/YukiHookAPI/en/tools/yukihookapi-projectbuilder" class="" aria-label="YukiHookAPI Project Builder"><!--[--><!--]--> YukiHookAPI Project Builder <!--[--><!--]--></a></li><!--]--></ul><!--]--></li><li class="navbar-dropdown-item"><!--[--><h4 class="navbar-dropdown-subtitle"><span>API Document</span></h4><ul class="navbar-dropdown-subitem-wrapper"><!--[--><li class="navbar-dropdown-subitem"><a href="/YukiHookAPI/en/api/home" class="" aria-label="Document Introduction"><!--[--><!--]--> Document Introduction <!--[--><!--]--></a></li><li class="navbar-dropdown-subitem"><a href="/YukiHookAPI/en/api/public/com/highcapable/yukihookapi/YukiHookAPI" class="" aria-label="Public API"><!--[--><!--]--> Public API <!--[--><!--]--></a></li><li class="navbar-dropdown-subitem"><a href="/YukiHookAPI/en/api/special-features/reflection" class="router-link-active" aria-label="Special Features"><!--[--><!--]--> Special Features <!--[--><!--]--></a></li><!--]--></ul><!--]--></li><li class="navbar-dropdown-item"><!--[--><h4 class="navbar-dropdown-subtitle"><span>About</span></h4><ul class="navbar-dropdown-subitem-wrapper"><!--[--><li class="navbar-dropdown-subitem"><a href="/YukiHookAPI/en/about/changelog" class="" aria-label="Changelog"><!--[--><!--]--> Changelog <!--[--><!--]--></a></li><li class="navbar-dropdown-subitem"><a href="/YukiHookAPI/en/about/future" class="" aria-label="Looking for Future"><!--[--><!--]--> Looking for Future <!--[--><!--]--></a></li><li class="navbar-dropdown-subitem"><a href="/YukiHookAPI/en/about/contacts" class="" aria-label="Contact Us"><!--[--><!--]--> Contact Us <!--[--><!--]--></a></li><li class="navbar-dropdown-subitem"><a href="/YukiHookAPI/en/about/about" class="" aria-label="About this Document"><!--[--><!--]--> About this Document <!--[--><!--]--></a></li><!--]--></ul><!--]--></li><!--]--></ul></div></div><div class="navbar-item"><a href="/YukiHookAPI/en/about/contacts" class="" aria-label="Contact Us"><!--[--><!--]--> Contact Us <!--[--><!--]--></a></div><div class="navbar-item"><div class="navbar-dropdown-wrapper"><button class="navbar-dropdown-title" type="button" aria-label="Select language"><span class="title">English (US)</span><span class="arrow down"></span></button><button class="navbar-dropdown-title-mobile" type="button" aria-label="Select language"><span class="title">English (US)</span><span class="right arrow"></span></button><ul style="display:none;" class="navbar-dropdown"><!--[--><li class="navbar-dropdown-item"><a aria-current="page" href="/YukiHookAPI/en/api/special-features/host-inject.html" class="router-link-active router-link-exact-active router-link-active" aria-label="English"><!--[--><!--]--> English <!--[--><!--]--></a></li><li class="navbar-dropdown-item"><a href="/YukiHookAPI/zh-cn/api/special-features/host-inject.html" class="" aria-label="简体中文"><!--[--><!--]--> 简体中文 <!--[--><!--]--></a></li><!--]--></ul></div></div><div class="navbar-item"><a class="external-link" href="https://github.com/fankes/YukiHookAPI" rel="noopener noreferrer" target="_blank" aria-label="GitHub"><!--[--><!--]--> GitHub <span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span><!--[--><!--]--></a></div><!--]--></nav><!--[--><!--]--><button class="toggle-color-mode-button" title="toggle color mode"><svg style="" class="icon" focusable="false" viewBox="0 0 32 32"><path d="M16 12.005a4 4 0 1 1-4 4a4.005 4.005 0 0 1 4-4m0-2a6 6 0 1 0 6 6a6 6 0 0 0-6-6z" fill="currentColor"></path><path d="M5.394 6.813l1.414-1.415l3.506 3.506L8.9 10.318z" fill="currentColor"></path><path d="M2 15.005h5v2H2z" fill="currentColor"></path><path d="M5.394 25.197L8.9 21.691l1.414 1.415l-3.506 3.505z" fill="currentColor"></path><path d="M15 25.005h2v5h-2z" fill="currentColor"></path><path d="M21.687 23.106l1.414-1.415l3.506 3.506l-1.414 1.414z" fill="currentColor"></path><path d="M25 15.005h5v2h-5z" fill="currentColor"></path><path d="M21.687 8.904l3.506-3.506l1.414 1.415l-3.506 3.505z" fill="currentColor"></path><path d="M15 2.005h2v5h-2z" fill="currentColor"></path></svg><svg style="display:none;" class="icon" focusable="false" viewBox="0 0 32 32"><path d="M13.502 5.414a15.075 15.075 0 0 0 11.594 18.194a11.113 11.113 0 0 1-7.975 3.39c-.138 0-.278.005-.418 0a11.094 11.094 0 0 1-3.2-21.584M14.98 3a1.002 1.002 0 0 0-.175.016a13.096 13.096 0 0 0 1.825 25.981c.164.006.328 0 .49 0a13.072 13.072 0 0 0 10.703-5.555a1.01 1.01 0 0 0-.783-1.565A13.08 13.08 0 0 1 15.89 4.38A1.015 1.015 0 0 0 14.98 3z" fill="currentColor"></path></svg></button><form class="search-box" role="search"><input type="search" placeholder="Search" autocomplete="off" spellcheck="false" value><!----></form></div></header><!--]--><div class="sidebar-mask"></div><!--[--><aside class="sidebar"><nav class="navbar-items"><!--[--><div class="navbar-item"><div class="navbar-dropdown-wrapper"><button class="navbar-dropdown-title" type="button" aria-label="Navigation"><span class="title">Navigation</span><span class="arrow down"></span></button><button class="navbar-dropdown-title-mobile" type="button" aria-label="Navigation"><span class="title">Navigation</span><span class="right arrow"></span></button><ul style="display:none;" class="navbar-dropdown"><!--[--><li class="navbar-dropdown-item"><!--[--><h4 class="navbar-dropdown-subtitle"><span>Get Started</span></h4><ul class="navbar-dropdown-subitem-wrapper"><!--[--><li class="navbar-dropdown-subitem"><a href="/YukiHookAPI/en/guide/home" class="" aria-label="Introduce"><!--[--><!--]--> Introduce <!--[--><!--]--></a></li><li class="navbar-dropdown-subitem"><a href="/YukiHookAPI/en/guide/knowledge" class="" aria-label="Basic Knowledge"><!--[--><!--]--> Basic Knowledge <!--[--><!--]--></a></li><li class="navbar-dropdown-subitem"><a href="/YukiHookAPI/en/guide/quick-start" class="" aria-label="Quick Start"><!--[--><!--]--> Quick Start <!--[--><!--]--></a></li><li class="navbar-dropdown-subitem"><a href="/YukiHookAPI/en/guide/example" class="" aria-label="Usage Example"><!--[--><!--]--> Usage Example <!--[--><!--]--></a></li><li class="navbar-dropdown-subitem"><a href="/YukiHookAPI/en/guide/move-to-new-api" class="" aria-label="Migrate from Xposed API"><!--[--><!--]--> Migrate from Xposed API <!--[--><!--]--></a></li><!--]--></ul><!--]--></li><li class="navbar-dropdown-item"><!--[--><h4 class="navbar-dropdown-subtitle"><span>Configs</span></h4><ul class="navbar-dropdown-subitem-wrapper"><!--[--><li class="navbar-dropdown-subitem"><a href="/YukiHookAPI/en/config/api-example" class="" aria-label="API Basic Configs"><!--[--><!--]--> API Basic Configs <!--[--><!--]--></a></li><li class="navbar-dropdown-subitem"><a href="/YukiHookAPI/en/config/api-exception" class="" aria-label="API Exception Handling"><!--[--><!--]--> API Exception Handling <!--[--><!--]--></a></li><li class="navbar-dropdown-subitem"><a href="/YukiHookAPI/en/config/xposed-using" class="" aria-label="Use as Xposed Module Configs"><!--[--><!--]--> Use as Xposed Module Configs <!--[--><!--]--></a></li><li class="navbar-dropdown-subitem"><a href="/YukiHookAPI/en/config/api-using" class="" aria-label="Use as Hook API Configs"><!--[--><!--]--> Use as Hook API Configs <!--[--><!--]--></a></li><li class="navbar-dropdown-subitem"><a href="/YukiHookAPI/en/config/r8-proguard" class="" aria-label="R8 & Proguard Obfuscate"><!--[--><!--]--> R8 & Proguard Obfuscate <!--[--><!--]--></a></li><!--]--></ul><!--]--></li><li class="navbar-dropdown-item"><!--[--><h4 class="navbar-dropdown-subtitle"><span>Tools</span></h4><ul class="navbar-dropdown-subitem-wrapper"><!--[--><li class="navbar-dropdown-subitem"><a href="/YukiHookAPI/en/tools/yukihookapi-projectbuilder" class="" aria-label="YukiHookAPI Project Builder"><!--[--><!--]--> YukiHookAPI Project Builder <!--[--><!--]--></a></li><!--]--></ul><!--]--></li><li class="navbar-dropdown-item"><!--[--><h4 class="navbar-dropdown-subtitle"><span>API Document</span></h4><ul class="navbar-dropdown-subitem-wrapper"><!--[--><li class="navbar-dropdown-subitem"><a href="/YukiHookAPI/en/api/home" class="" aria-label="Document Introduction"><!--[--><!--]--> Document Introduction <!--[--><!--]--></a></li><li class="navbar-dropdown-subitem"><a href="/YukiHookAPI/en/api/public/com/highcapable/yukihookapi/YukiHookAPI" class="" aria-label="Public API"><!--[--><!--]--> Public API <!--[--><!--]--></a></li><li class="navbar-dropdown-subitem"><a href="/YukiHookAPI/en/api/special-features/reflection" class="router-link-active" aria-label="Special Features"><!--[--><!--]--> Special Features <!--[--><!--]--></a></li><!--]--></ul><!--]--></li><li class="navbar-dropdown-item"><!--[--><h4 class="navbar-dropdown-subtitle"><span>About</span></h4><ul class="navbar-dropdown-subitem-wrapper"><!--[--><li class="navbar-dropdown-subitem"><a href="/YukiHookAPI/en/about/changelog" class="" aria-label="Changelog"><!--[--><!--]--> Changelog <!--[--><!--]--></a></li><li class="navbar-dropdown-subitem"><a href="/YukiHookAPI/en/about/future" class="" aria-label="Looking for Future"><!--[--><!--]--> Looking for Future <!--[--><!--]--></a></li><li class="navbar-dropdown-subitem"><a href="/YukiHookAPI/en/about/contacts" class="" aria-label="Contact Us"><!--[--><!--]--> Contact Us <!--[--><!--]--></a></li><li class="navbar-dropdown-subitem"><a href="/YukiHookAPI/en/about/about" class="" aria-label="About this Document"><!--[--><!--]--> About this Document <!--[--><!--]--></a></li><!--]--></ul><!--]--></li><!--]--></ul></div></div><div class="navbar-item"><a href="/YukiHookAPI/en/about/contacts" class="" aria-label="Contact Us"><!--[--><!--]--> Contact Us <!--[--><!--]--></a></div><div class="navbar-item"><div class="navbar-dropdown-wrapper"><button class="navbar-dropdown-title" type="button" aria-label="Select language"><span class="title">English (US)</span><span class="arrow down"></span></button><button class="navbar-dropdown-title-mobile" type="button" aria-label="Select language"><span class="title">English (US)</span><span class="right arrow"></span></button><ul style="display:none;" class="navbar-dropdown"><!--[--><li class="navbar-dropdown-item"><a aria-current="page" href="/YukiHookAPI/en/api/special-features/host-inject.html" class="router-link-active router-link-exact-active router-link-active" aria-label="English"><!--[--><!--]--> English <!--[--><!--]--></a></li><li class="navbar-dropdown-item"><a href="/YukiHookAPI/zh-cn/api/special-features/host-inject.html" class="" aria-label="简体中文"><!--[--><!--]--> 简体中文 <!--[--><!--]--></a></li><!--]--></ul></div></div><div class="navbar-item"><a class="external-link" href="https://github.com/fankes/YukiHookAPI" rel="noopener noreferrer" target="_blank" aria-label="GitHub"><!--[--><!--]--> GitHub <span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span><!--[--><!--]--></a></div><!--]--></nav><!--[--><!--]--><ul class="sidebar-items"><!--[--><li><p tabindex="0" class="sidebar-item sidebar-heading collapsible">Get Started <span class="right arrow"></span></p><ul style="display:none;" class="sidebar-item-children"><!--[--><li><a href="/YukiHookAPI/en/guide/home.html" class="sidebar-item" aria-label="Introduce"><!--[--><!--]--> Introduce <!--[--><!--]--></a><!----></li><li><a href="/YukiHookAPI/en/guide/knowledge.html" class="sidebar-item" aria-label="Basic Knowledge"><!--[--><!--]--> Basic Knowledge <!--[--><!--]--></a><!----></li><li><a href="/YukiHookAPI/en/guide/quick-start.html" class="sidebar-item" aria-label="Quick Start"><!--[--><!--]--> Quick Start <!--[--><!--]--></a><!----></li><li><a href="/YukiHookAPI/en/guide/example.html" class="sidebar-item" aria-label="Usage Example"><!--[--><!--]--> Usage Example <!--[--><!--]--></a><!----></li><li><a href="/YukiHookAPI/en/guide/move-to-new-api.html" class="sidebar-item" aria-label="Migrate from Xposed API"><!--[--><!--]--> Migrate from Xposed API <!--[--><!--]--></a><!----></li><!--]--></ul></li><li><p tabindex="0" class="sidebar-item sidebar-heading collapsible">Configs <span class="right arrow"></span></p><ul style="display:none;" class="sidebar-item-children"><!--[--><li><a href="/YukiHookAPI/en/config/api-example.html" class="sidebar-item" aria-label="API Basic Configs"><!--[--><!--]--> API Basic Configs <!--[--><!--]--></a><!----></li><li><a href="/YukiHookAPI/en/config/api-exception.html" class="sidebar-item" aria-label="API Exception Handling"><!--[--><!--]--> API Exception Handling <!--[--><!--]--></a><!----></li><li><a href="/YukiHookAPI/en/config/xposed-using.html" class="sidebar-item" aria-label="Use as Xposed Module Configs"><!--[--><!--]--> Use as Xposed Module Configs <!--[--><!--]--></a><!----></li><li><a href="/YukiHookAPI/en/config/api-using.html" class="sidebar-item" aria-label="Use as Hook API Configs"><!--[--><!--]--> Use as Hook API Configs <!--[--><!--]--></a><!----></li><li><a href="/YukiHookAPI/en/config/r8-proguard.html" class="sidebar-item" aria-label="R8 & Proguard Obfuscate"><!--[--><!--]--> R8 & Proguard Obfuscate <!--[--><!--]--></a><!----></li><!--]--></ul></li><li><p tabindex="0" class="sidebar-item sidebar-heading collapsible">Tools <span class="right arrow"></span></p><ul style="display:none;" class="sidebar-item-children"><!--[--><li><a href="/YukiHookAPI/en/tools/yukihookapi-projectbuilder.html" class="sidebar-item" aria-label="YukiHookAPI Project Builder"><!--[--><!--]--> YukiHookAPI Project Builder <!--[--><!--]--></a><!----></li><!--]--></ul></li><li><p tabindex="0" class="sidebar-item sidebar-heading active collapsible">API Document <span class="down arrow"></span></p><ul style="" class="sidebar-item-children"><!--[--><li><a href="/YukiHookAPI/en/api/home.html" class="sidebar-item" aria-label="Document Introduce"><!--[--><!--]--> Document Introduce <!--[--><!--]--></a><!----></li><li><p tabindex="0" class="sidebar-item collapsible">Public API <span class="right arrow"></span></p><ul style="display:none;" class="sidebar-item-children"><!--[--><li><a href="/YukiHookAPI/en/api/public/com/highcapable/yukihookapi/YukiHookAPI.html" class="sidebar-item" aria-label="YukiHookAPI - object"><!--[--><!--]--> YukiHookAPI - object <!--[--><!--]--></a><!----></li><li><a href="/YukiHookAPI/en/api/public/com/highcapable/yukihookapi/hook/param/PackageParam.html" class="sidebar-item" aria-label="PackageParam - class"><!--[--><!--]--> PackageParam - class <!--[--><!--]--></a><!----></li><li><a href="/YukiHookAPI/en/api/public/com/highcapable/yukihookapi/hook/param/HookParam.html" class="sidebar-item" aria-label="HookParam - class"><!--[--><!--]--> HookParam - class <!--[--><!--]--></a><!----></li><li><a href="/YukiHookAPI/en/api/public/com/highcapable/yukihookapi/annotation/xposed/InjectYukiHookWithXposed.html" class="sidebar-item" aria-label="InjectYukiHookWithXposed - annotation"><!--[--><!--]--> InjectYukiHookWithXposed - annotation <!--[--><!--]--></a><!----></li><li><a href="/YukiHookAPI/en/api/public/com/highcapable/yukihookapi/hook/xposed/proxy/IYukiHookXposedInit.html" class="sidebar-item" aria-label="IYukiHookXposedInit - interface"><!--[--><!--]--> IYukiHookXposedInit - interface <!--[--><!--]--></a><!----></li><li><a href="/YukiHookAPI/en/api/public/com/highcapable/yukihookapi/hook/xposed/prefs/YukiHookModulePrefs.html" class="sidebar-item" aria-label="YukiHookModulePrefs - class"><!--[--><!--]--> YukiHookModulePrefs - class <!--[--><!--]--></a><!----></li><li><a href="/YukiHookAPI/en/api/public/com/highcapable/yukihookapi/hook/xposed/prefs/ui/ModulePreferenceFragment.html" class="sidebar-item" aria-label="ModulePreferenceFragment - class"><!--[--><!--]--> ModulePreferenceFragment - class <!--[--><!--]--></a><!----></li><li><a href="/YukiHookAPI/en/api/public/com/highcapable/yukihookapi/hook/xposed/prefs/data/PrefsData.html" class="sidebar-item" aria-label="PrefsData - class"><!--[--><!--]--> PrefsData - class <!--[--><!--]--></a><!----></li><li><a href="/YukiHookAPI/en/api/public/com/highcapable/yukihookapi/hook/xposed/channel/YukiHookDataChannel.html" class="sidebar-item" aria-label="YukiHookDataChannel - class"><!--[--><!--]--> YukiHookDataChannel - class <!--[--><!--]--></a><!----></li><li><a href="/YukiHookAPI/en/api/public/com/highcapable/yukihookapi/hook/xposed/channel/data/ChannelData.html" class="sidebar-item" aria-label="ChannelData - class"><!--[--><!--]--> ChannelData - class <!--[--><!--]--></a><!----></li><li><a href="/YukiHookAPI/en/api/public/com/highcapable/yukihookapi/hook/xposed/application/ModuleApplication.html" class="sidebar-item" aria-label="ModuleApplication - class"><!--[--><!--]--> ModuleApplication - class <!--[--><!--]--></a><!----></li><li><a href="/YukiHookAPI/en/api/public/com/highcapable/yukihookapi/hook/xposed/parasitic/activity/base/ModuleAppActivity.html" class="sidebar-item" aria-label="ModuleAppActivity - class"><!--[--><!--]--> ModuleAppActivity - class <!--[--><!--]--></a><!----></li><li><a href="/YukiHookAPI/en/api/public/com/highcapable/yukihookapi/hook/xposed/parasitic/activity/base/ModuleAppCompatActivity.html" class="sidebar-item" aria-label="ModuleAppCompatActivity - class"><!--[--><!--]--> ModuleAppCompatActivity - class <!--[--><!--]--></a><!----></li><li><a href="/YukiHookAPI/en/api/public/com/highcapable/yukihookapi/hook/xposed/parasitic/context/wrapper/ModuleContextThemeWrapper.html" class="sidebar-item" aria-label="ModuleContextThemeWrapper - class"><!--[--><!--]--> ModuleContextThemeWrapper - class <!--[--><!--]--></a><!----></li><li><a href="/YukiHookAPI/en/api/public/com/highcapable/yukihookapi/hook/xposed/bridge/dummy/YukiModuleResources.html" class="sidebar-item" aria-label="YukiModuleResources - class"><!--[--><!--]--> YukiModuleResources - class <!--[--><!--]--></a><!----></li><li><a href="/YukiHookAPI/en/api/public/com/highcapable/yukihookapi/hook/xposed/bridge/dummy/YukiResources.html" class="sidebar-item" aria-label="YukiResources - class"><!--[--><!--]--> YukiResources - class <!--[--><!--]--></a><!----></li><li><a href="/YukiHookAPI/en/api/public/com/highcapable/yukihookapi/hook/xposed/bridge/dummy/YukiResForwarder.html" class="sidebar-item" aria-label="YukiResForwarder - class"><!--[--><!--]--> YukiResForwarder - class <!--[--><!--]--></a><!----></li><li><a href="/YukiHookAPI/en/api/public/com/highcapable/yukihookapi/hook/xposed/bridge/event/YukiXposedEvent.html" class="sidebar-item" aria-label="YukiXposedEvent - object"><!--[--><!--]--> YukiXposedEvent - object <!--[--><!--]--></a><!----></li><li><a href="/YukiHookAPI/en/api/public/com/highcapable/yukihookapi/hook/type/android/ComponentTypeFactory.html" class="sidebar-item" aria-label="ComponentTypeFactory - kt"><!--[--><!--]--> ComponentTypeFactory - kt <!--[--><!--]--></a><!----></li><li><a href="/YukiHookAPI/en/api/public/com/highcapable/yukihookapi/hook/type/android/GraphicsTypeFactory.html" class="sidebar-item" aria-label="GraphicsTypeFactory - kt"><!--[--><!--]--> GraphicsTypeFactory - kt <!--[--><!--]--></a><!----></li><li><a href="/YukiHookAPI/en/api/public/com/highcapable/yukihookapi/hook/type/android/ViewTypeFactory.html" class="sidebar-item" aria-label="ViewTypeFactory - kt"><!--[--><!--]--> ViewTypeFactory - kt <!--[--><!--]--></a><!----></li><li><a href="/YukiHookAPI/en/api/public/com/highcapable/yukihookapi/hook/type/java/VariableTypeFactory.html" class="sidebar-item" aria-label="VariableTypeFactory - kt"><!--[--><!--]--> VariableTypeFactory - kt <!--[--><!--]--></a><!----></li><li><a href="/YukiHookAPI/en/api/public/com/highcapable/yukihookapi/hook/type/defined/DefinedTypeFactory.html" class="sidebar-item" aria-label="DefinedTypeFactory - kt"><!--[--><!--]--> DefinedTypeFactory - kt <!--[--><!--]--></a><!----></li><li><a href="/YukiHookAPI/en/api/public/com/highcapable/yukihookapi/hook/log/LoggerFactory.html" class="sidebar-item" aria-label="LoggerFactory - kt"><!--[--><!--]--> LoggerFactory - kt <!--[--><!--]--></a><!----></li><li><a href="/YukiHookAPI/en/api/public/com/highcapable/yukihookapi/hook/factory/ReflectionFactory.html" class="sidebar-item" aria-label="ReflectionFactory - kt"><!--[--><!--]--> ReflectionFactory - kt <!--[--><!--]--></a><!----></li><li><a href="/YukiHookAPI/en/api/public/com/highcapable/yukihookapi/hook/factory/YukiHookFactory.html" class="sidebar-item" aria-label="YukiHookFactory - kt"><!--[--><!--]--> YukiHookFactory - kt <!--[--><!--]--></a><!----></li><li><a href="/YukiHookAPI/en/api/public/com/highcapable/yukihookapi/hook/entity/YukiBaseHooker.html" class="sidebar-item" aria-label="YukiBaseHooker - class"><!--[--><!--]--> YukiBaseHooker - class <!--[--><!--]--></a><!----></li><li><a href="/YukiHookAPI/en/api/public/com/highcapable/yukihookapi/hook/core/YukiMemberHookCreator.html" class="sidebar-item" aria-label="YukiMemberHookCreator - class"><!--[--><!--]--> YukiMemberHookCreator - class <!--[--><!--]--></a><!----></li><li><a href="/YukiHookAPI/en/api/public/com/highcapable/yukihookapi/hook/core/YukiResourcesHookCreator.html" class="sidebar-item" aria-label="YukiResourcesHookCreator - class"><!--[--><!--]--> YukiResourcesHookCreator - class <!--[--><!--]--></a><!----></li><li><a href="/YukiHookAPI/en/api/public/com/highcapable/yukihookapi/hook/core/finder/members/MethodFinder.html" class="sidebar-item" aria-label="MethodFinder - class"><!--[--><!--]--> MethodFinder - class <!--[--><!--]--></a><!----></li><li><a href="/YukiHookAPI/en/api/public/com/highcapable/yukihookapi/hook/core/finder/members/ConstructorFinder.html" class="sidebar-item" aria-label="ConstructorFinder - class"><!--[--><!--]--> ConstructorFinder - class <!--[--><!--]--></a><!----></li><li><a href="/YukiHookAPI/en/api/public/com/highcapable/yukihookapi/hook/core/finder/members/FieldFinder.html" class="sidebar-item" aria-label="FieldFinder - class"><!--[--><!--]--> FieldFinder - class <!--[--><!--]--></a><!----></li><li><a href="/YukiHookAPI/en/api/public/com/highcapable/yukihookapi/hook/core/finder/classes/DexClassFinder.html" class="sidebar-item" aria-label="DexClassFinder - class"><!--[--><!--]--> DexClassFinder - class <!--[--><!--]--></a><!----></li><li><a href="/YukiHookAPI/en/api/public/com/highcapable/yukihookapi/hook/core/finder/classes/rules/result/MemberRulesResult.html" class="sidebar-item" aria-label="MemberRulesResult - class"><!--[--><!--]--> MemberRulesResult - class <!--[--><!--]--></a><!----></li><li><a href="/YukiHookAPI/en/api/public/com/highcapable/yukihookapi/hook/core/finder/classes/rules/MemberRules.html" class="sidebar-item" aria-label="MemberRules - class"><!--[--><!--]--> MemberRules - class <!--[--><!--]--></a><!----></li><li><a href="/YukiHookAPI/en/api/public/com/highcapable/yukihookapi/hook/core/finder/classes/rules/FieldRules.html" class="sidebar-item" aria-label="FieldRules - class"><!--[--><!--]--> FieldRules - class <!--[--><!--]--></a><!----></li><li><a href="/YukiHookAPI/en/api/public/com/highcapable/yukihookapi/hook/core/finder/classes/rules/MethodRules.html" class="sidebar-item" aria-label="MethodRules - class"><!--[--><!--]--> MethodRules - class <!--[--><!--]--></a><!----></li><li><a href="/YukiHookAPI/en/api/public/com/highcapable/yukihookapi/hook/core/finder/classes/rules/ConstructorRules.html" class="sidebar-item" aria-label="ConstructorRules - class"><!--[--><!--]--> ConstructorRules - class <!--[--><!--]--></a><!----></li><li><a href="/YukiHookAPI/en/api/public/com/highcapable/yukihookapi/hook/core/finder/base/BaseFinder.html" class="sidebar-item" aria-label="BaseFinder - class"><!--[--><!--]--> BaseFinder - class <!--[--><!--]--></a><!----></li><li><a href="/YukiHookAPI/en/api/public/com/highcapable/yukihookapi/hook/core/finder/base/rules/CountRules.html" class="sidebar-item" aria-label="CountRules - class"><!--[--><!--]--> CountRules - class <!--[--><!--]--></a><!----></li><li><a href="/YukiHookAPI/en/api/public/com/highcapable/yukihookapi/hook/core/finder/base/rules/ModifierRules.html" class="sidebar-item" aria-label="ModifierRules - class"><!--[--><!--]--> ModifierRules - class <!--[--><!--]--></a><!----></li><li><a href="/YukiHookAPI/en/api/public/com/highcapable/yukihookapi/hook/core/finder/base/rules/NameRules.html" class="sidebar-item" aria-label="NameRules - class"><!--[--><!--]--> NameRules - class <!--[--><!--]--></a><!----></li><li><a href="/YukiHookAPI/en/api/public/com/highcapable/yukihookapi/hook/bean/HookClass.html" class="sidebar-item" aria-label="HookClass - class"><!--[--><!--]--> HookClass - class <!--[--><!--]--></a><!----></li><li><a href="/YukiHookAPI/en/api/public/com/highcapable/yukihookapi/hook/bean/VariousClass.html" class="sidebar-item" aria-label="VariousClass - class"><!--[--><!--]--> VariousClass - class <!--[--><!--]--></a><!----></li><li><a href="/YukiHookAPI/en/api/public/com/highcapable/yukihookapi/hook/bean/CurrentClass.html" class="sidebar-item" aria-label="CurrentClass - class"><!--[--><!--]--> CurrentClass - class <!--[--><!--]--></a><!----></li><li><a href="/YukiHookAPI/en/api/public/com/highcapable/yukihookapi/hook/bean/GenericClass.html" class="sidebar-item" aria-label="GenericClass - class"><!--[--><!--]--> GenericClass - class <!--[--><!--]--></a><!----></li><li><a href="/YukiHookAPI/en/api/public/com/highcapable/yukihookapi/hook/bean/HookResources.html" class="sidebar-item" aria-label="HookResources - class"><!--[--><!--]--> HookResources - class <!--[--><!--]--></a><!----></li><!--]--></ul></li><li><p tabindex="0" class="sidebar-item active collapsible">Special Features <span class="down arrow"></span></p><ul style="" class="sidebar-item-children"><!--[--><li><a href="/YukiHookAPI/en/api/special-features/reflection.html" class="sidebar-item" aria-label="Reflection Extensions"><!--[--><!--]--> Reflection Extensions <!--[--><!--]--></a><!----></li><li><a href="/YukiHookAPI/en/api/special-features/logger.html" class="sidebar-item" aria-label="Debug Logs"><!--[--><!--]--> Debug Logs <!--[--><!--]--></a><!----></li><li><a href="/YukiHookAPI/en/api/special-features/xposed-storage.html" class="sidebar-item" aria-label="Xposed Module Data Storage"><!--[--><!--]--> Xposed Module Data Storage <!--[--><!--]--></a><!----></li><li><a href="/YukiHookAPI/en/api/special-features/xposed-channel.html" class="sidebar-item" aria-label="Xposed Module and Host Channel"><!--[--><!--]--> Xposed Module and Host Channel <!--[--><!--]--></a><!----></li><li><a href="/YukiHookAPI/en/api/special-features/host-lifecycle.html" class="sidebar-item" aria-label="Host Lifecycle Extension"><!--[--><!--]--> Host Lifecycle Extension <!--[--><!--]--></a><!----></li><li><a aria-current="page" href="/YukiHookAPI/en/api/special-features/host-inject.html" class="router-link-active router-link-exact-active router-link-active sidebar-item active" aria-label="Host Resource Injection Extension"><!--[--><!--]--> Host Resource Injection Extension <!--[--><!--]--></a><ul style="" class="sidebar-item-children"><!--[--><li><a aria-current="page" href="/YukiHookAPI/en/api/special-features/host-inject.html#inject-module-app-s-resources" class="router-link-active router-link-exact-active sidebar-item" aria-label="Inject Module App's Resources"><!--[--><!--]--> Inject Module App's Resources <!--[--><!--]--></a><!----></li><li><a aria-current="page" href="/YukiHookAPI/en/api/special-features/host-inject.html#register-module-app-s-activity" class="router-link-active router-link-exact-active sidebar-item" aria-label="Register Module App's Activity"><!--[--><!--]--> Register Module App's Activity <!--[--><!--]--></a><!----></li><li><a aria-current="page" href="/YukiHookAPI/en/api/special-features/host-inject.html#create-contextthemewrapper-proxy" class="router-link-active router-link-exact-active sidebar-item" aria-label="Create ContextThemeWrapper Proxy"><!--[--><!--]--> Create ContextThemeWrapper Proxy <!--[--><!--]--></a><!----></li><!--]--></ul></li><!--]--></ul></li><!--]--></ul></li><li><p tabindex="0" class="sidebar-item sidebar-heading collapsible">About <span class="right arrow"></span></p><ul style="display:none;" class="sidebar-item-children"><!--[--><li><a href="/YukiHookAPI/en/about/changelog.html" class="sidebar-item" aria-label="Changelog"><!--[--><!--]--> Changelog <!--[--><!--]--></a><!----></li><li><a href="/YukiHookAPI/en/about/future.html" class="sidebar-item" aria-label="Looking for Future"><!--[--><!--]--> Looking for Future <!--[--><!--]--></a><!----></li><li><a href="/YukiHookAPI/en/about/contacts.html" class="sidebar-item" aria-label="Contact Us"><!--[--><!--]--> Contact Us <!--[--><!--]--></a><!----></li><li><a href="/YukiHookAPI/en/about/about.html" class="sidebar-item" aria-label="About this Document"><!--[--><!--]--> About this Document <!--[--><!--]--></a><!----></li><!--]--></ul></li><!--]--></ul><!--[--><!--]--></aside><!--]--><!--[--><main class="page"><!--[--><!--]--><div class="theme-default-content"><!--[--><!--]--><div><h1 id="host-resource-injection-extension" tabindex="-1"><a class="header-anchor" href="#host-resource-injection-extension" aria-hidden="true">#</a> Host Resource Injection Extension</h1><blockquote><p>This is an extension that injects Module App's Resources, <code>Activity</code> components, and <code>Context</code> topics into the Host App.</p></blockquote><p>Before using the following functions, in order to prevent Resource Id from conflicting with each other, you need to modify the Resource Id in the <code>build.gradle</code> of the current Xposed Module project.</p><ul><li>Kotlin Gradle DSL</li></ul><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#ADBAC7;">android {</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> androidResources.additionalParameters(</span><span style="color:#96D0FF;">"--allow-reserved-package-id"</span><span style="color:#ADBAC7;">, </span><span style="color:#96D0FF;">"--package-id"</span><span style="color:#ADBAC7;">, </span><span style="color:#96D0FF;">"0x64"</span><span style="color:#ADBAC7;">)</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;">}</span></span>
|
||
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><ul><li>Groovy</li></ul><div class="language-groovy ext-groovy line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#ADBAC7;">android {</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> aaptOptions</span><span style="color:#F47067;">.</span><span style="color:#ADBAC7;">additionalParameters </span><span style="color:#96D0FF;">'--allow-reserved-package-id'</span><span style="color:#ADBAC7;">, </span><span style="color:#96D0FF;">'--package-id'</span><span style="color:#ADBAC7;">, </span><span style="color:#96D0FF;">'0x64'</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;">}</span></span>
|
||
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><div class="custom-container warning"><p class="custom-container-title">Notice</p><p>The sample Resource Id value provided is for reference only, <strong>0x7f</strong> cannot be used, the default is <strong>0x64</strong>.</p><p>In order to prevent the existence of multiple Xposed Modules in the current Host App, it is recommended to customize your own Resource Id.</p></div><h2 id="inject-module-app-s-resources" tabindex="-1"><a class="header-anchor" href="#inject-module-app-s-resources" aria-hidden="true">#</a> Inject Module App's Resources</h2><p>After the Host App is hooked, we can directly inject the <code>Context</code> obtained in the Hooker into the current Module App's Resources.</p><blockquote><p>The following example</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#ADBAC7;">injectMember {</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> method {</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> name </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#96D0FF;">"onCreate"</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> param(</span><span style="color:#F69D50;">BundleClass</span><span style="color:#ADBAC7;">)</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> }</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> afterHook {</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> instance</span><span style="color:#F47067;"><</span><span style="color:#F69D50;">Activity</span><span style="color:#F47067;">></span><span style="color:#ADBAC7;">().</span><span style="color:#6CB6FF;">also</span><span style="color:#ADBAC7;"> {</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> </span><span style="color:#768390;">// <Scenario 1> Inject Module App's Resources through Context</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> it.injectModuleAppResources()</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> </span><span style="color:#768390;">// <Scenario 2> Get the Host App's Resources directly and inject the Module App's Resources</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> it.resources.injectModuleAppResources()</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> </span><span style="color:#768390;">// Use the Module App's Resource Id directly</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> it.getString(</span><span style="color:#F69D50;">R</span><span style="color:#ADBAC7;">.id.app_name)</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> }</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> }</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;">}</span></span>
|
||
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>You can also inject current Module App's Resources directly in <code>AppLifecycle</code>.</p><blockquote><p>The following example</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#ADBAC7;">onAppLifecycle {</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> onCreate {</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> </span><span style="color:#768390;">// Globally inject Module App's Resources, but only in the global lifecycle</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> </span><span style="color:#768390;">// Methods like ImageView.setImageResource need to be injected separately in Activity</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> </span><span style="color:#768390;">// <Scenario 1> Inject Module App's Resources through Context</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> injectModuleAppResources()</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> </span><span style="color:#768390;">// <Scenario 2> Get the Host App's Resources directly and inject the Module App's Resources</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> resources.injectModuleAppResources()</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> </span><span style="color:#768390;">// Use the Module App's Resource Id directly</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> getString(</span><span style="color:#F69D50;">R</span><span style="color:#ADBAC7;">.id.app_name)</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> }</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;">}</span></span>
|
||
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><div class="custom-container tip"><p class="custom-container-title">Tips</p><p>For more functions, please refer to the <a href="../public/com/highcapable/yukihookapi/hook/factory/YukiHookFactory#context-resources-injectmoduleappresources-ext-method">Context+Resources.injectModuleAppResources</a> method.</p></div><h2 id="register-module-app-s-activity" tabindex="-1"><a class="header-anchor" href="#register-module-app-s-activity" aria-hidden="true">#</a> Register Module App's Activity</h2><p>When the <code>Activity</code> of all applications in the Android system starts, it needs to be registered in <code>AndroidManifest.xml</code>.</p><p>During the Hook process, if we want to directly start the unregistered <code>Activity</code> in the Module App through the Host App, what should we do?</p><p>After the Host App is hooked, we can directly register the <code>Activity</code> proxy of the current Module App in the <code>Context</code> obtained in the Hooker.</p><blockquote><p>The following example</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#ADBAC7;">injectMember {</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> method {</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> name </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#96D0FF;">"onCreate"</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> param(</span><span style="color:#F69D50;">BundleClass</span><span style="color:#ADBAC7;">)</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> }</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> afterHook {</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> instance</span><span style="color:#F47067;"><</span><span style="color:#F69D50;">Activity</span><span style="color:#F47067;">></span><span style="color:#ADBAC7;">().registerModuleAppActivities()</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> }</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;">}</span></span>
|
||
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>You can also register the current Module App's <code>Activity</code> proxy directly in <code>AppLifecycle</code>.</p><blockquote><p>The following example</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#ADBAC7;">onAppLifecycle {</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> onCreate {</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> registerModuleAppActivities()</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> }</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;">}</span></span>
|
||
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>If the <code>proxy</code> parameter is not filled in, the API will automatically obtain the current Host App's launching entry <code>Activity</code> for proxying according to the current <code>Context</code>.</p><p>Usually, it works, but the above situation will fail in some apps, for example, some <code>Activity</code> will add launching parameters to the registration list, so we need to use another solution.</p><p>If the unregistered <code>Activity</code> cannot be launched correctly, we can manually get the Host App's <code>AndroidManifest.xml</code> for analysis to get a registered <code>Activity</code> tag and get the <code>name</code>.</p><p>You need to choose an unneeded <code>Activity</code> that may not be used by the current Host App as a "puppet" to proxy it, which usually works.</p><p>For example, we have found a suitable <code>Activity</code> that can be proxied.</p><blockquote><p>The following example</p></blockquote><div class="language-xml ext-xml line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#ADBAC7;"><</span><span style="color:#8DDB8C;">activity</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">android:name</span><span style="color:#ADBAC7;">=</span><span style="color:#96D0FF;">"com.demo.test.activity.TestActivity"</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> ...></span></span>
|
||
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>According to the <code>name</code>, we only need to add this parameter to the method for registration.</p><blockquote><p>The following example</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#ADBAC7;">registerModuleAppActivities(proxy </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#96D0FF;">"com.demo.test.activity.TestActivity"</span><span style="color:#ADBAC7;">)</span></span>
|
||
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><p>Alternatively, if you write a <code>stub</code> for the Host App's class, you can register it directly through the <code>Class</code> object.</p><blockquote><p>The following example</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#ADBAC7;">registerModuleAppActivities(TestActivity::</span><span style="color:#6CB6FF;">class</span><span style="color:#ADBAC7;">.java)</span></span>
|
||
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div></div></div><p>After the registration is complete, extends the <code>Activity</code> in the Module App you need to use the Host App to start by <code>ModuleAppActivity</code> or <code>ModuleAppCompatActivity</code>.</p><p>These <code>Activity</code> now live seamlessly in the Host App without registration.</p><blockquote><p>The following example</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">class</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">HostTestActivity</span><span style="color:#ADBAC7;"> </span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">ModuleAppActivity</span><span style="color:#ADBAC7;">() {</span></span>
|
||
<span class="line"></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> </span><span style="color:#F47067;">override</span><span style="color:#ADBAC7;"> </span><span style="color:#F47067;">fun</span><span style="color:#ADBAC7;"> </span><span style="color:#DCBDFB;">onCreate</span><span style="color:#ADBAC7;">(savedInstanceState</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">Bundle?</span><span style="color:#ADBAC7;">) {</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">super</span><span style="color:#ADBAC7;">.onCreate(savedInstanceState)</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> </span><span style="color:#768390;">// Module App's Resources have been injected automatically</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> </span><span style="color:#768390;">// You can directly use xml to load the layout</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> setContentView(</span><span style="color:#F69D50;">R</span><span style="color:#ADBAC7;">.layout.activity_main)</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> }</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;">}</span></span>
|
||
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>If you need to extends <code>ModuleAppCompatActivity</code>, you need to set the AppCompat theme manually.</p><blockquote><p>The following example</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">class</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">HostTestActivity</span><span style="color:#ADBAC7;"> </span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">ModuleAppCompatActivity</span><span style="color:#ADBAC7;">() {</span></span>
|
||
<span class="line"></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> </span><span style="color:#768390;">// The theme name here is for reference only</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> </span><span style="color:#768390;">// Please fill in the theme name already in your Module App</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> </span><span style="color:#F47067;">override</span><span style="color:#ADBAC7;"> </span><span style="color:#F47067;">val</span><span style="color:#ADBAC7;"> moduleTheme get() </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">R</span><span style="color:#ADBAC7;">.</span><span style="color:#F69D50;">style</span><span style="color:#F47067;">.</span><span style="color:#F69D50;">Theme_AppCompat</span></span>
|
||
<span class="line"></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> </span><span style="color:#F47067;">override</span><span style="color:#ADBAC7;"> </span><span style="color:#F47067;">fun</span><span style="color:#ADBAC7;"> </span><span style="color:#DCBDFB;">onCreate</span><span style="color:#ADBAC7;">(savedInstanceState</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">Bundle?</span><span style="color:#ADBAC7;">) {</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> </span><span style="color:#6CB6FF;">super</span><span style="color:#ADBAC7;">.onCreate(savedInstanceState)</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> </span><span style="color:#768390;">// Module App's Resources have been injected automatically</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> </span><span style="color:#768390;">// You can directly use xml to load the layout</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> setContentView(</span><span style="color:#F69D50;">R</span><span style="color:#ADBAC7;">.layout.activity_main)</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> }</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;">}</span></span>
|
||
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>After all the above steps are completed, you can happily call <code>startActivity</code> anywhere in the (Xposed) Host environment where a <code>Context</code> exists.</p><blockquote><p>The following example</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#F47067;">val</span><span style="color:#ADBAC7;"> context</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">Context</span><span style="color:#ADBAC7;"> </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> ... </span><span style="color:#768390;">// Assume this is your Context</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;">context.startActivity(context, HostTestActivity::</span><span style="color:#6CB6FF;">class</span><span style="color:#ADBAC7;">.java)</span></span>
|
||
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div></div></div><div class="custom-container tip"><p class="custom-container-title">Tips</p><p>For more functions, please refer to the <a href="../public/com/highcapable/yukihookapi/hook/factory/YukiHookFactory#context-registermoduleappactivities-ext-method">Context.registerModuleAppActivities</a> method.</p></div><h2 id="create-contextthemewrapper-proxy" tabindex="-1"><a class="header-anchor" href="#create-contextthemewrapper-proxy" aria-hidden="true">#</a> Create ContextThemeWrapper Proxy</h2><p>Sometimes, we need to use <code>MaterialAlertDialogBuilder</code> to beautify our own dialogs in the Host App, but we can't create them without the AppCompat theme.</p><ul><li>Will got the following exception</li></ul><div class="language-text ext-text"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#adbac7;">The style on this component requires your app theme to be Theme.AppCompat (or a descendant).</span></span>
|
||
<span class="line"><span style="color:#adbac7;"></span></span></code></pre></div><p>At this time, we want to use <code>MaterialAlertDialogBuilder</code> to create a dialog in the current <code>Activity</code> of the Host App being hooked, you can have the following methods.</p><blockquote><p>The following example</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#ADBAC7;">injectMember {</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> method {</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> name </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#96D0FF;">"onCreate"</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> param(</span><span style="color:#F69D50;">BundleClass</span><span style="color:#ADBAC7;">)</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> }</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> afterHook {</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> </span><span style="color:#768390;">// Use applyModuleTheme to create a theme resource in the current Module App</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> </span><span style="color:#F47067;">val</span><span style="color:#ADBAC7;"> appCompatContext </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> instance</span><span style="color:#F47067;"><</span><span style="color:#F69D50;">Activity</span><span style="color:#F47067;">></span><span style="color:#ADBAC7;">().applyModuleTheme(</span><span style="color:#F69D50;">R</span><span style="color:#ADBAC7;">.</span><span style="color:#F69D50;">style</span><span style="color:#F47067;">.</span><span style="color:#F69D50;">Theme_AppCompat</span><span style="color:#ADBAC7;">)</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> </span><span style="color:#768390;">// Directly use this Context that wraps the Module App's theme to create a dialog</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">MaterialAlertDialogBuilder</span><span style="color:#ADBAC7;">(appCompatContext)</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> .setTitle(</span><span style="color:#96D0FF;">"AppCompat Theme Dialog"</span><span style="color:#ADBAC7;">)</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> .setMessage(</span><span style="color:#96D0FF;">"I am an AppCompat theme dialog displayed in the Host App."</span><span style="color:#ADBAC7;">)</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> .setPositiveButton(</span><span style="color:#96D0FF;">"OK"</span><span style="color:#ADBAC7;">, </span><span style="color:#6CB6FF;">null</span><span style="color:#ADBAC7;">)</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> .show()</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> }</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;">}</span></span>
|
||
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>You can also set the system (native) night mode and day mode on the current <code>Context</code> through <code>uiMode</code>.</p><p>Which requires at least Android 10 and above system version support and the current theme contains night mode related elements.</p><blockquote><p>The following example</p></blockquote><div class="language-kotlin ext-kt line-numbers-mode"><pre class="shiki" style="background-color:#22272e;"><code><span class="line"><span style="color:#ADBAC7;">injectMember {</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> method {</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> name </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#96D0FF;">"onCreate"</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> param(</span><span style="color:#F69D50;">BundleClass</span><span style="color:#ADBAC7;">)</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> }</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> afterHook {</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> </span><span style="color:#768390;">// Define the theme resource in the current Module App</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> </span><span style="color:#F47067;">var</span><span style="color:#ADBAC7;"> appCompatContext</span><span style="color:#F47067;">:</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">ModuleContextThemeWrapper</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> </span><span style="color:#768390;">// <Scenario 1> Get the Configuration object directly to set</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> appCompatContext </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> instance</span><span style="color:#F47067;"><</span><span style="color:#F69D50;">Activity</span><span style="color:#F47067;">></span><span style="color:#ADBAC7;">()</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> .applyModuleTheme(</span><span style="color:#F69D50;">R</span><span style="color:#ADBAC7;">.</span><span style="color:#F69D50;">style</span><span style="color:#F47067;">.</span><span style="color:#F69D50;">Theme_AppCompat</span><span style="color:#ADBAC7;">)</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> .applyConfiguration { uiMode </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">Configuration</span><span style="color:#ADBAC7;">.</span><span style="color:#F69D50;">UI_MODE_NIGHT_YES</span><span style="color:#ADBAC7;"> }</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> </span><span style="color:#768390;">// <Scenario 2> Create a new Configuration object</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> </span><span style="color:#768390;">// This solution will destroy the original font scaling and other settings in the current Host App</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> </span><span style="color:#768390;">// You need to manually re-pass parameters such as densityDpi</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> appCompatContext </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> instance</span><span style="color:#F47067;"><</span><span style="color:#F69D50;">Activity</span><span style="color:#F47067;">></span><span style="color:#ADBAC7;">().applyModuleTheme(</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> theme </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">R</span><span style="color:#ADBAC7;">.</span><span style="color:#F69D50;">style</span><span style="color:#F47067;">.</span><span style="color:#F69D50;">Theme_AppCompat</span><span style="color:#ADBAC7;">,</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> configuration </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">Configuration</span><span style="color:#ADBAC7;">().</span><span style="color:#6CB6FF;">apply</span><span style="color:#ADBAC7;"> { uiMode </span><span style="color:#F47067;">=</span><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">Configuration</span><span style="color:#ADBAC7;">.</span><span style="color:#F69D50;">UI_MODE_NIGHT_YES</span><span style="color:#ADBAC7;"> }</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> )</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> </span><span style="color:#768390;">// Directly use this Context that wraps the Module App's theme to create a dialog</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> </span><span style="color:#F69D50;">MaterialAlertDialogBuilder</span><span style="color:#ADBAC7;">(appCompatContext)</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> .setTitle(</span><span style="color:#96D0FF;">"AppCompat Theme Dialog"</span><span style="color:#ADBAC7;">)</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> .setMessage(</span><span style="color:#96D0FF;">"I am an AppCompat theme dialog displayed in the Host App."</span><span style="color:#ADBAC7;">)</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> .setPositiveButton(</span><span style="color:#96D0FF;">"OK"</span><span style="color:#ADBAC7;">, </span><span style="color:#6CB6FF;">null</span><span style="color:#ADBAC7;">)</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> .show()</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;"> }</span></span>
|
||
<span class="line"><span style="color:#ADBAC7;">}</span></span>
|
||
<span class="line"></span></code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>This way, we can create dialogs in the Host App very simply using <code>MaterialAlertDialogBuilder</code>.</p><div class="custom-container warning"><p class="custom-container-title">Possible Problems</p><p>Because some <strong>androidx</strong> dependent libraries or custom themes used by some apps may interfere with the actual style of the current <strong>MaterialAlertDialog</strong>, such as the button style of the dialog.</p><p>You can refer to the <strong>Module App Demo</strong> in this case and see <a href="https://github.com/fankes/YukiHookAPI/tree/master/demo-module/src/main/java/com/highcapable/yukihookapi/demo_module/hook/factory/ComponentCompatFactory.kt" target="_blank" rel="noopener noreferrer">here is the sample code<span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span></a> to fix this problem.</p><p><strong>ClassCastException</strong> may occur when some apps are created, please manually specify a new <strong>Configuration</strong> instance to fix.</p></div><div class="custom-container tip"><p class="custom-container-title">Tips</p><p>For more functions, please refer to the <a href="../public/com/highcapable/yukihookapi/hook/factory/YukiHookFactory#context-applymoduletheme-ext-method">Context.applyModuleTheme</a> method.</p></div></div><!--[--><!--]--></div><footer class="page-meta"><div class="meta-item edit-link"><a class="external-link meta-item-label" href="https://github.com/fankes/YukiHookAPI/edit/master/docs-source/src/en/api/special-features/host-inject.md" rel="noopener noreferrer" target="_blank" aria-label="Edit this page on Github"><!--[--><!--]--> Edit this page on Github <span><svg class="external-link-icon" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewbox="0 0 100 100" width="15" height="15"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path><polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg><span class="external-link-icon-sr-only">open in new window</span></span><!--[--><!--]--></a></div><div class="meta-item last-updated"><span class="meta-item-label">Last Updated: </span><!----></div><div class="meta-item contributors"><span class="meta-item-label">Contributors: </span><span class="meta-item-info"><!--[--><!--[--><span class="contributor" title="email: qzmmcn@163.com">fankesyooni</span><!----><!--]--><!--]--></span></div></footer><nav class="page-nav"><p class="inner"><span class="prev"><a href="/YukiHookAPI/en/api/special-features/host-lifecycle.html" class="" aria-label="Host Lifecycle Extension"><!--[--><!--]--> Host Lifecycle Extension <!--[--><!--]--></a></span><!----></p></nav><!--[--><!--]--></main><!--]--></div><!----><!--]--></div>
|
||
<script type="module" src="/YukiHookAPI/assets/app.0df13dd9.js" defer></script>
|
||
</body>
|
||
</html>
|