Avoid direct references to dalvik.system.DexFile and android.content.res.XResources by using reflection and guarded calls. LSPApplication now constructs and injects the provider dex via reflective DexFile/DexPathList$Element creation inside a try/catch to handle deprecation/compat issues on newer Android versions and log failures. LSPLoader replaces the direct XResources.setPackageNameForResDir call with a reflective invocation (with warning logs) to prevent class resolution failures under strict boot classloader namespace delegation. Also added logging and minor import/constant adjustments to improve robustness and diagnostics.
Co-Authored-By: MrZhongzq <108169409+mrzhongzq@users.noreply.github.com>
Co-Authored-By: Claude <81847+claude@users.noreply.github.com>
Improve startup resilience by selecting the application service according to availability: catch Throwable from manager lookup and clear service on failure, then if service is null check hasEmbeddedModules(context) to prefer IntegrApplicationService when embedded modules exist, otherwise use NeoLocalApplicationService. Also refine logging levels/messages (info on success, warn on failure) to provide clearer diagnostics.
Add a shared Gson instance and harden config/module/asset loading to avoid NPEs and crashes. Guard legacy module iteration, use apply() for SharedPreferences, throw when config asset is missing, reuse GSON for parsing, and null-check resource streams before copying. Also set provider dex file writable only if created and remove some unused imports. These changes improve resilience when manager/asset data is unavailable and clean up file handling.
Added a public method, `replaceApplication`. This method uses Xposed to intercept `android.app.ApplicationPackageManager`'s `getApplicationInfo` and `getApplicationInfoAsUser`. It allows for dynamic changes to the application's `sourceDir` and `publicSourceDir` to redirect the location where the system loads APKs.
Adds a null pointer check for the origApkPath and cacheApkPath arguments in the enableOpenatHook native method.
Previously, passing nullptr to this method would lead to a potential crash. The added checks ensure the function handles invalid input gracefully by logging an error and returning early, thus preventing a potential crash.
To avoid a crash in the fisrt launch (#7), we cannot use PLT
.inline_hooker to DisableBackgroundVerification.
Remove ccache to avoid difference between CI builds and local builds.
1. Use JDK 21
2. Update ksp for compatibility (compulsory)
3. R8 claims that org.lsposed.lspatch.util.ModuleLoader is needed
We use rules in share/lspatch-rules.pro to ensure that LSPatch works
properly after R8 engine