Skip to content

Commit e11625f

Browse files
committed
Update docs
1 parent a0d7c7a commit e11625f

4 files changed

Lines changed: 17 additions & 34 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ public interface XposedInterface {
4040
* API version 102.
4141
* <p>API additions:</p>
4242
* <ul>
43-
* <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.</li>
43+
* <li>Hot reloading callbacks are available for modules that declare exactly one Java entry class;
44+
* modules that do not declare exactly one Java entry class are not hot-reloadable.</li>
4545
* <li>Module entries can stop receiving subsequent lifecycle callbacks through
4646
* {@link XposedInterfaceWrapper#detach()}.</li>
4747
* <li>Hooks can be assigned an id through {@link HookBuilder#setId(String)}. Hook ids are

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,9 @@ private void ensureAttached() {
6262
*
6363
* <p>If the module expects its classloader to become collectible after detaching, it must also
6464
* remove module-owned references and execution contexts that keep module objects reachable, such
65-
* as installed hooks, Java threads and callbacks held by system or app objects. Be careful if
66-
* native code is still running after all Java references to the module classloader are cleared,
67-
* later runtime unloading of native libraries may crash the process; this is a module lifecycle
68-
* bug.</p>
65+
* as installed hooks, Java threads, and callbacks held by system or app objects. If native code
66+
* is still running after all Java references to the module classloader are cleared, later runtime
67+
* unloading of native libraries may crash the process; this is a module lifecycle bug.</p>
6968
*
7069
* <p>Typical use cases include:</p>
7170
* <ul>

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

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,6 @@ interface SystemServerStartingParam {
112112

113113
/**
114114
* Wraps information about the hot reloading event.
115-
* <p>
116-
* Hot reloading is supported only for modules that declare exactly one Java entry class.
117-
* Modules with zero or multiple Java entry classes are rejected before hot reload callbacks
118-
* are invoked.
119-
* </p>
120115
*/
121116
@SinceApi(XposedInterface.API_102)
122117
interface HotReloadingParam {
@@ -245,10 +240,6 @@ default void onSystemServerStarting(@NonNull SystemServerStartingParam param) {
245240
* returns {@code true}.
246241
* <p>This callback runs in <b>old</b> code.</p>
247242
* <p>
248-
* Hot reloading is supported only for modules that declare exactly one Java entry class.
249-
* Modules with zero or multiple Java entry classes are rejected before this callback is invoked.
250-
* </p>
251-
* <p>
252243
* Hot reloads are serialized per target. Before the old hook handle list is captured, the
253244
* framework freezes old code so further hook registrations from old code fail. In-flight hook
254245
* calls keep using the hook chain snapshot that was active when they started.
@@ -280,11 +271,6 @@ default boolean onHotReloading(@NonNull HotReloadingParam param) {
280271
* Gets notified when the module has been reloaded.
281272
* <p>This callback runs in <b>new</b> code.</p>
282273
* <p>
283-
* Hot reloading is supported only for modules that declare exactly one Java entry class.
284-
* Modules with zero or multiple Java entry classes are rejected before hot reload callbacks
285-
* are invoked.
286-
* </p>
287-
* <p>
288274
* Package lifecycle callbacks are not automatically replayed after hot reload. Override this
289275
* method to atomically replace old hooks through
290276
* {@link XposedInterface.HookHandle#replaceHook(XposedInterface.Hooker)}, remove hooks that

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

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,8 @@
4141
* apply the module on apps outside the scope list</li>
4242
* <li>{@code exceptionMode} (string) [protective|passthrough] - Default to protective, see
4343
* {@link io.github.libxposed.api.XposedInterface.ExceptionMode}</li>
44-
* <li>{@code autoHotReload} (boolean, API 102+) - whether app updates should automatically trigger hot
45-
* reloading. Hot reloading is supported only for modules that declare exactly one Java entry
46-
* class, and still proceeds only when
44+
* <li>{@code autoHotReload} (boolean, API 102+) - whether app updates should automatically
45+
* trigger hot reloading. App-update hot reloading still proceeds only when
4746
* {@link io.github.libxposed.api.XposedModuleInterface#onHotReloading(XposedModuleInterface.HotReloadingParam)
4847
* onHotReloading()} returns {@code true}.</li>
4948
* </ul>
@@ -122,12 +121,9 @@
122121
* onSystemServerStarting()} – called once when system server is starting. This callback
123122
* replaces the first package load phase.</li>
124123
* <li>{@link io.github.libxposed.api.XposedModuleInterface#onHotReloading(XposedModuleInterface.HotReloadingParam)
125-
* onHotReloading()} - called in old code before hot reloading proceeds. Hot reloading is
126-
* supported only for modules that declare exactly one Java entry class.</li>
124+
* onHotReloading()} - called in old code before hot reloading proceeds.</li>
127125
* <li>{@link io.github.libxposed.api.XposedModuleInterface#onHotReloaded(XposedModuleInterface.HotReloadedParam)
128-
* onHotReloaded()} - called in new code after hot reloading completes. Package lifecycle
129-
* callbacks are not automatically replayed; modules that opt into hot reload should install or
130-
* replace their hooks explicitly from this callback.</li>
126+
* onHotReloaded()} - called in new code after hot reloading completes.</li>
131127
* </ul>
132128
*
133129
* <p>Since API 102, an entry can call
@@ -136,14 +132,16 @@
136132
* the framework also removes its reference to that entry instance. Hooks and other
137133
* {@link io.github.libxposed.api.XposedInterface} APIs remain available. A module that expects its
138134
* classloader to become collectible after detaching must also remove module-owned references and
139-
* execution contexts that keep module objects reachable, such as installed hooks, Java or native
140-
* threads, callbacks held by system or app objects, JNI global references, and native state. If
141-
* native code is still running after all Java references to the module classloader are cleared,
142-
* later runtime unloading of native libraries may crash the process; this is a module lifecycle
143-
* bug.</p>
135+
* execution contexts that keep module objects reachable, such as installed hooks, Java threads,
136+
* and callbacks held by system or app objects. If native code is still running after all Java
137+
* references to the module classloader are cleared, later runtime unloading of native libraries
138+
* may crash the process; this is a module lifecycle bug.</p>
144139
*
145140
* <p>Hot reload is supported only for modules that declare exactly one Java entry class. Modules
146-
* with zero or multiple Java entry classes are not hot-reloadable.</p>
141+
* with zero or multiple Java entry classes are not hot-reloadable. Framework implementations may
142+
* also report hot reload as unsupported when they cannot provide a valid new module generation for
143+
* the requested module or target. The API does not mandate how frameworks stage code or native
144+
* libraries across generations.</p>
147145
*
148146
* <p>State passed from {@code onHotReloading()} to {@code onHotReloaded()} through
149147
* {@code setSavedInstanceState()} must be classloader-neutral. It must not contain objects created

0 commit comments

Comments
 (0)