Skip to content

Conversation

@xihan123
Copy link

@xihan123 xihan123 commented Aug 9, 2025

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:

UI and installation method selection improvements:

  • Refactored the patch installation UI to allow users to select between system and Shizuku installation methods, and improved the feedback and flow for both paths. (manager/src/main/java/org/lsposed/lspatch/ui/page/NewPatchScreen.kt, [1] [2] [3]
  • Added InstallMethod enum to NewPatchViewModel to 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:

  • Added new permissions (REQUEST_INSTALL_PACKAGES) and registered the InstallResultReceiver and a FileProvider to support split APK installation and secure file access. (manager/src/main/AndroidManifest.xml, [1] [2] [3]
  • Updated patcher logic to track and save target APK files for installation, supporting split APK scenarios. (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.

@JingMatrix JingMatrix changed the title Enhance installation and cleanup processes#29 Install patched APKs via system API Aug 9, 2025
HSSkyBoy added a commit to 7723mod/NPatch that referenced this pull request Aug 18, 2025
https: //github.com/JingMatrix/LSPatch/pull/46
Co-Authored-By: xihan123 <srxqzxs@vip.qq.com>
@xihan123
Copy link
Author

xihan123 commented Aug 18, 2025

点击安装打包出来的 apk 无法自动返回到主页面,会一直循环调用系统API,只能强制关闭应用 https://github.com/7723mod/NPatch/actions/runs/17041425455

你试过这个能否正常安装吗,我的ONEPLUS 7 - 15 一切正常

@HSSkyBoy
Copy link

HSSkyBoy commented Sep 7, 2025

![Screenshot_2025-09-07-15-03-09-07_c31b32364ce19ca8fcd150a417ecce58](https://github.com/user-attachments/assets/580863b0-9a26-4b62-9435-0db3904e61d5)

安装 apk 已经成功,可以合并

(话说佬的免后台能不能教下🥵不会)

@xihan123
Copy link
Author

xihan123 commented Sep 7, 2025

Screenshot_2025-09-07-15-03-09-07_c31b32364ce19ca8fcd150a417ecce58

已经成功,可以合并 (话说佬的免后台能不能教下🥵不会)

我也只是把之前那个npatch的代码照抄过来,但是太多人反馈这个免后台问题多,所以我又没搞了

@HSSkyBoy
Copy link

HSSkyBoy commented Sep 7, 2025

apks 也没问题,但依赖系统安装管理器API,部分系统安装apks可能会有问题
安装分包的时候有个提示会不会比较好?

@xihan123
Copy link
Author

xihan123 commented Sep 7, 2025

apks 也没问题,但依赖系统安装管理器API,部分系统安装apks可能会有问题 安装分包的时候有个提示会不会比较好?

这个我没遇到过,可能是api被魔改了所以没法安装?

@HSSkyBoy
Copy link

HSSkyBoy commented Sep 7, 2025

apks 也没问题,但依赖系统安装管理器API,部分系统安装apks可能会有问题 安装分包的时候有个提示会不会比较好?

这个我没遇到过,可能是api被魔改了所以没法安装?

理论上肯定有这种情况的,不过一般是比较旧的设备,或者像鸿蒙这种深度魔改管理器了的,所以是建议添加

@xihan123
Copy link
Author

xihan123 commented Sep 7, 2025

apks 也没问题,但依赖系统安装管理器API,部分系统安装apks可能会有问题 安装分包的时候有个提示会不会比较好?

这个我没遇到过,可能是api被魔改了所以没法安装?

理论上肯定有这种情况的,不过一般是比较旧的设备,或者像鸿蒙这种深度魔改管理器了的,所以是建议添加

问题是这个api好像没法获取到结果,我看文档也没看明白

@HSSkyBoy
Copy link

HSSkyBoy commented Sep 7, 2025

apks 也没问题,但依赖系统安装管理器API,部分系统安装apks可能会有问题 安装分包的时候有个提示会不会比较好?

这个我没遇到过,可能是api被魔改了所以没法安装?

理论上肯定有这种情况的,不过一般是比较旧的设备,或者像鸿蒙这种深度魔改管理器了的,所以是建议添加

问题是这个api好像没法获取到结果,我看文档也没看明白

这也带来了一个问题,有时候安装可能会导致循环跳转系统安装器,无法关闭,只能强制停止NPatch然后再次启动

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants