|
38 | 38 | * {@link io.github.libxposed.api.XposedInterface.ExceptionMode}</li> |
39 | 39 | * </ul> |
40 | 40 | * |
| 41 | + * <h2>Scope</h2> |
| 42 | + * |
| 43 | + * <p>Module scope is defined by a list of package names in {@code META-INF/xposed/scope.list}. |
| 44 | + * The framework injects the module into all regular processes declared by those packages. |
| 45 | + * After injection, every loaded package in that process will trigger callbacks. |
| 46 | + * As a result, modules may receive callbacks beyond the originally scoped packages, so they |
| 47 | + * should always filter by process name and package name.</p> |
| 48 | + * |
| 49 | + * <p>A special case applies to components declared with {@code android:process="system"} in a |
| 50 | + * {@code android:sharedUserId="android.uid.system"} package: they run in system server. |
| 51 | + * For packages whose components all run in system server, adding the package name itself to the |
| 52 | + * scope has no effect. Instead, system server is represented by the special virtual package name |
| 53 | + * {@code system}, which should be used explicitly. </p> |
| 54 | + * |
| 55 | + * <p>Note that {@code android} package is still a valid scope target because some of its |
| 56 | + * components declare {@code android:process=":ui"} and therefore do not run in system server. |
| 57 | + * Modules scoped to {@code android} can still receive events for {@code android} package loading |
| 58 | + * even though {@code android} package has no code. By contrast, {@code com.android.providers.settings} |
| 59 | + * is not a valid scope target, modules should use the {@code system} scope and then wait |
| 60 | + * for the {@code com.android.providers.settings} package loading event.</p> |
| 61 | + * |
41 | 62 | * <h2>Hook Model</h2> |
42 | 63 | * |
43 | 64 | * <p>The API uses an <b>interceptor-chain</b> model (similar to OkHttp interceptors). Modules |
|
80 | 101 | * <li>{@link io.github.libxposed.api.XposedModuleInterface#onPackageReady(XposedModuleInterface.PackageReadyParam) |
81 | 102 | * onPackageReady()} – called after the app classloader is created.</li> |
82 | 103 | * <li>{@link io.github.libxposed.api.XposedModuleInterface#onSystemServerStarting(XposedModuleInterface.SystemServerStartingParam) |
83 | | - * onSystemServerStarting()} – called when system server is starting.</li> |
| 104 | + * onSystemServerStarting()} – called once when system server is starting. This callback |
| 105 | + * replaces the first package load phase.</li> |
84 | 106 | * </ul> |
85 | 107 | * |
86 | 108 | * <h2>Error Handling</h2> |
|
0 commit comments