Skip to content

Commit fa3c1d9

Browse files
committed
Update docs
1 parent 3201d41 commit fa3c1d9

3 files changed

Lines changed: 35 additions & 5 deletions

File tree

api/src/main/java/io/github/libxposed/api/XposedInterface.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,17 @@ public interface XposedInterface {
4141
* <p>API additions:</p>
4242
* <ul>
4343
* <li>Hot reloading callbacks are available for modules that declare exactly one Java entry class.</li>
44+
* <li>Hot reload is disabled for modules that do not declare exactly one Java entry class,
45+
* modules that declare native entries, and targets where module code has successfully loaded
46+
* a native library.</li>
4447
* <li>Module entries can stop receiving subsequent lifecycle callbacks through
4548
* {@link XposedInterfaceWrapper#detach()}.</li>
4649
* <li>Hooks can be assigned an id through {@link HookBuilder#setId(String)}. Hook ids are
4750
* scoped to the current module and executable, and can be queried through
4851
* {@link HookHandle#getId()}.</li>
4952
* <li>Hooks can be atomically replaced through {@link HookHandle#replaceHook(Hooker)}.</li>
50-
* <li>{@link #PROP_RT_HOT_RELOAD} indicates whether hot reload is currently permitted.</li>
53+
* <li>{@link #PROP_RT_HOT_RELOAD} indicates whether framework policy allows this module to
54+
* request hot reload.</li>
5155
* </ul>
5256
* <p>Behavior changes: Modules targeting 102 or higher</p>
5357
* <ul>
@@ -76,7 +80,11 @@ public interface XposedInterface {
7680
long PROP_RT_API_PROTECTION = 1L << 2;
7781

7882
/**
79-
* The framework currently permits hot reload through the service.
83+
* Framework policy allows this module to request hot reload through the service.
84+
* <p>
85+
* This property only describes framework policy, such as a safety option. It does not
86+
* guarantee that any target is hot-reloadable or that a hot reload request can complete.
87+
* </p>
8088
*/
8189
long PROP_RT_HOT_RELOAD = 1L << 3;
8290

api/src/main/java/io/github/libxposed/api/XposedModuleInterface.java

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,10 @@ interface SystemServerStartingParam {
114114
* Wraps information about the hot reloading event.
115115
* <p>
116116
* Hot reloading is supported only for modules that declare exactly one Java entry class.
117-
* Modules with multiple Java entry classes are rejected before hot reload callbacks are invoked.
117+
* Modules with zero or multiple Java entry classes are rejected before hot reload callbacks
118+
* are invoked. Modules that declare native entries are not hot-reloadable. If module code
119+
* successfully loads a native library in a target process, that target is no longer
120+
* hot-reloadable until it restarts.
118121
* </p>
119122
*/
120123
@SinceApi(XposedInterface.API_102)
@@ -240,13 +243,21 @@ default void onSystemServerStarting(@NonNull SystemServerStartingParam param) {
240243
* <p>This callback runs in <b>old</b> code.</p>
241244
* <p>
242245
* Hot reloading is supported only for modules that declare exactly one Java entry class.
243-
* Modules with multiple Java entry classes are rejected before this callback is invoked.
246+
* Modules with zero or multiple Java entry classes and modules that declare native entries
247+
* are rejected before this callback is invoked. If module code successfully loads a native
248+
* library in a target process, that target is no longer hot-reloadable until it restarts.
244249
* </p>
245250
* <p>
246251
* Hot reloads are serialized per target. Before the old hook handle list is captured, the
247252
* framework freezes old code so further hook registrations from old code fail. In-flight hook
248253
* calls keep using the hook chain snapshot that was active when they started.
249254
* </p>
255+
* <p>
256+
* Returning {@code false} rejects the hot reload request. For service-triggered requests, this
257+
* is reported as {@code HotReloadResult.Status.FAILED} with a null message. If this callback
258+
* or the subsequent reload operation throws, the request is reported as failed with a
259+
* framework-provided diagnostic message.
260+
* </p>
250261
*
251262
* @param param Information about the hot reloading event
252263
* @return {@code true} to allow hot reloading to proceed, {@code false} to cancel hot reloading
@@ -261,7 +272,9 @@ default boolean onHotReloading(@NonNull HotReloadingParam param) {
261272
* <p>This callback runs in <b>new</b> code.</p>
262273
* <p>
263274
* Hot reloading is supported only for modules that declare exactly one Java entry class.
264-
* Modules with multiple Java entry classes are rejected before hot reload callbacks are invoked.
275+
* Modules with zero or multiple Java entry classes are rejected before hot reload callbacks
276+
* are invoked. Modules that declare native entries are not hot-reloadable. Hot reload also
277+
* does not unload, reload, or replace native libraries loaded by module code.
265278
* </p>
266279
* <p>
267280
* Package lifecycle callbacks are not automatically replayed after hot reload. Override this

api/src/main/java/io/github/libxposed/api/package-info.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,15 @@
135135
* needs lifecycle callbacks. This stops subsequent lifecycle callbacks only for the current entry;
136136
* hooks and other {@link io.github.libxposed.api.XposedInterface} APIs remain available.</p>
137137
*
138+
* <p>Hot reload is supported only for modules that declare exactly one Java entry class. Modules
139+
* with zero or multiple Java entry classes are not hot-reloadable.</p>
140+
*
141+
* <p>Hot reload is not supported for modules that declare native entries. If module code
142+
* successfully loads a native library in a hooked target process through
143+
* {@link java.lang.System#load(String)} or {@link java.lang.System#loadLibrary(String)}, that
144+
* target is no longer hot-reloadable until it restarts. Hot reload never unloads, reloads, or
145+
* replaces native libraries loaded by a previous module generation.</p>
146+
*
138147
* <h2>Error Handling</h2>
139148
*
140149
* <p>Framework-level errors are reported via subclasses of

0 commit comments

Comments
 (0)