-
Notifications
You must be signed in to change notification settings - Fork 127
Install patched APKs via system API #46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
https: //github.com/JingMatrix/LSPatch/pull/46 Co-Authored-By: xihan123 <srxqzxs@vip.qq.com>
你试过这个能否正常安装吗,我的ONEPLUS 7 - 15 一切正常 |
|
安装 apk 已经成功,可以合并 (话说佬的免后台能不能教下🥵不会) |
|
apks 也没问题,但依赖系统安装管理器API,部分系统安装apks可能会有问题 |
这个我没遇到过,可能是api被魔改了所以没法安装? |
理论上肯定有这种情况的,不过一般是比较旧的设备,或者像鸿蒙这种深度魔改管理器了的,所以是建议添加 |
问题是这个api好像没法获取到结果,我看文档也没看明白 |
这也带来了一个问题,有时候安装可能会导致循环跳转系统安装器,无法关闭,只能强制停止NPatch然后再次启动 |

This pull request introduces significant improvements to the patch installation flow in the Android app, mainly by adding support for installing split APKs and handling installation results more robustly. It also refactors the installation UI to allow users to choose between system and Shizuku installation methods, and introduces new utility functions for APK management. Additionally, necessary AndroidManifest updates are made to support these new features.
Split APK installation and result handling:
InstallDialog2composable and supporting logic to handle split APK installation, including uninstalling the previous app version if needed and listening for installation results via a broadcast receiver. (manager/src/main/java/org/lsposed/lspatch/ui/page/NewPatchScreen.kt, manager/src/main/java/org/lsposed/lspatch/ui/page/NewPatchScreen.ktR588-R700)InstallResultReceiverclass to handle installation status broadcasts and pending intents, enabling robust feedback on installation outcomes. (manager/src/main/java/org/lsposed/lspatch/ui/util/Utils.kt, manager/src/main/java/org/lsposed/lspatch/ui/util/Utils.ktR29-R159)installApk,installApks,uninstallApkByPackageName, andcheckIsApkFixedByLSPfor streamlined APK management and installation logic. (manager/src/main/java/org/lsposed/lspatch/ui/util/Utils.kt, manager/src/main/java/org/lsposed/lspatch/ui/util/Utils.ktR29-R159)UI and installation method selection improvements:
manager/src/main/java/org/lsposed/lspatch/ui/page/NewPatchScreen.kt, [1] [2] [3]InstallMethodenum toNewPatchViewModelto track the chosen installation method. (manager/src/main/java/org/lsposed/lspatch/ui/viewmodel/NewPatchViewModel.kt, manager/src/main/java/org/lsposed/lspatch/ui/viewmodel/NewPatchViewModel.ktR27-R30)AndroidManifest and file handling updates:
REQUEST_INSTALL_PACKAGES) and registered theInstallResultReceiverand aFileProviderto support split APK installation and secure file access. (manager/src/main/AndroidManifest.xml, [1] [2] [3]manager/src/main/java/org/lsposed/lspatch/Patcher.kt, [1] [2]These changes collectively enable the app to handle more complex patching scenarios, improve user experience during installation, and ensure compatibility with modern Android requirements.