Commit Graph

564 Commits

Author SHA1 Message Date
topjohnwu fe6b658c02 Use MenuProvider 2023-03-09 18:05:37 -08:00
topjohnwu 382568bd3c Cleanup filterable list implementation 2023-03-09 17:45:00 -08:00
LoveSy d52ea1b068 Postpone showMainUI when activity has stopped
Co-authored-by: topjohnwu <topjohnwu@gmail.com>
2023-03-07 21:04:04 -08:00
topjohnwu a1ce6f5f12 Fix race condition when switching root manager
Before this change, the root manager package name is only written into
the database after the repackaged APK is installed. In the time between
the repackaged APK being installed and the package name being written
into the database, if some operation calls `get_manager`, the Magisk
daemon will cache this result and ignore the repackaged APK, even if
the package name is set afterwards, because the cache won't be
invalidated. The result is that the repackaged manager APK will not be
recognized as the root manager, breaking the hide manager feature.

This race condition is more likely to happen when Zygisk is enabled,
because `get_manager` is called with a very high frequency in that case.

To fix the issue, we have to set the new package name into the database
BEFORE installing the repackaged APK. We also stop pruning the
database if the repackaged manager is not found, moving this logic into
the Magisk app. By doing so, we can guarantee that the instant after
the repackaged manager APK is installed, the Magisk daemon will
immediately pick it up and treat it as the root manager.

Another small optimization: when the requester is root, simply bypass
the whole database + manager package check. Since the Magisk app hiding
APK installation proces will call `su` several times to run `pm` under
different UIDs, doing this opimization will reduce the amount of
unnecessary database query + filesystem traversals.
2023-03-06 03:58:58 -08:00
topjohnwu a721206c6f Update items in the right thread 2023-02-27 23:00:21 -08:00
vvb2060 5520f0fbf7 Add stub version to apk comment 2023-02-26 14:23:02 -08:00
topjohnwu 78a444d601 Wait for root service to bind 2022-12-30 15:52:41 -08:00
vvb2060 13c2695e98 simplify denylist rm 2022-12-13 14:11:32 -08:00
topjohnwu 357d913f18 Dynamically generate component names at runtime 2022-08-26 06:31:51 -07:00
topjohnwu 87bec70d9f Setup notification on app init
Close #6216
2022-08-25 02:24:30 -07:00
topjohnwu f8395a7dc6 Make sure UI and state is in sync 2022-08-23 05:38:19 -07:00
topjohnwu 7a4a5c8992 Ensure JobService is rescheduled 2022-08-23 04:14:06 -07:00
topjohnwu 928a16d8cc Update app to target API 33
Close #6206
2022-08-23 03:59:09 -07:00
topjohnwu 3f7f6e619a Use VERSION_CODES instead of raw numbers 2022-08-23 01:43:53 -07:00
vvb2060 8bd4760b00 Fix build 2022-08-23 01:32:32 -07:00
canyie fed4f1b50f Collect kernel version and environment variables in log 2022-08-22 12:52:13 -07:00
vvb2060 dd565a11ea Fix outdated state 2022-08-08 13:59:56 -07:00
vvb2060 38abad1e44 Fix app state 2022-07-01 15:12:50 -07:00
topjohnwu 9fd1f41e8b Always relaunch process after package migration 2022-06-19 02:09:14 -07:00
canyie 71205bc530 Anchor Snackbar above reboot FAB in FlashFragment 2022-06-12 11:00:36 -07:00
topjohnwu 515f81944c Move coroutine job into its own class 2022-06-10 04:12:31 -07:00
topjohnwu 46d4708386 Decouple state from BaseViewModel 2022-06-10 02:13:25 -07:00
topjohnwu aabc36f86b Maintain separate flash screen state 2022-06-10 00:33:53 -07:00
nikk gitanes e0d5d90267 fix restart button focus on flash result 2022-06-10 00:33:53 -07:00
topjohnwu 482a5b991b Don't always refresh on network state change 2022-06-09 23:28:46 -07:00
vvb2060 42606efe56 Always remove task 2022-06-09 21:02:31 -07:00
vvb2060 c495b3d183 Remove request uninstall code
unreachable
2022-06-06 02:51:11 -07:00
topjohnwu 317153c53a Better stub launch flow 2022-06-05 19:15:43 -07:00
canyie aadb2d825c Also set snackbar container for FlashFragment 2022-06-05 05:36:04 -07:00
残页 2106751ea4 Fix SnackBar shows behind window insets 2022-06-03 03:21:56 -07:00
topjohnwu 5471147422 Remove usage of BindingCollectionAdapter (part 2) 2022-06-02 23:40:10 -07:00
topjohnwu 6305159c5e Remove usage of BindingCollectionAdapter (part 1) 2022-06-02 20:55:19 -07:00
topjohnwu 2ed092c9db Update contributors in app 2022-06-02 06:08:47 -07:00
topjohnwu 5c6a7ffa6f Simplify context hacks 2022-06-02 04:22:25 -07:00
topjohnwu e029994ef8 Move Zygisk out of beta 2022-06-01 02:59:02 -07:00
vvb2060 9679874874 Disable repack on android 5.0
am does not support -p
2022-06-01 02:05:15 -07:00
topjohnwu 50e2f33d1c More debug indication in UI
Close #5874
2022-05-30 01:53:07 -07:00
topjohnwu 18acb97dfe Make SYSTEM_UID a special case 2022-05-30 00:49:42 -07:00
topjohnwu bf04fa134b Indicate debug builds
Close #5859
2022-05-29 11:14:39 -07:00
topjohnwu c0981174a8 Use LiveData instead of Observable 2022-05-29 03:57:42 -07:00
南宫雪珊 580c993c0b Display module status 2022-05-29 01:40:20 -07:00
topjohnwu 683cfee88b Cleanup and move things around 2022-05-26 22:05:28 -07:00
topjohnwu 3bcaf0ed5b Move more files into core 2022-05-25 05:48:02 -07:00
topjohnwu 756d8356ca Show canary channel option on canary builds 2022-05-15 01:28:49 -07:00
vvb2060 68db366696 Delete outdated policies 2022-05-10 00:11:17 -07:00
topjohnwu 4eb9240806 Handle Activty recreation on content result
Credits to @canyie for the initial PR and finding the bug
Close #5791, fix #5789
2022-05-08 14:29:59 -07:00
topjohnwu 2793d209a4 Allow requesting root from non app process 2022-05-07 00:46:23 -07:00
Kazurin Nanako 42e5f5150a Fix "double install" caused by config changes
Configuration changes in FlashFragment may cause the installation process to be triggered twice. The simplest way to reproduce this behavior is to choose a module ZIP file in landscape mode (which is the default on some tablets).

This commit fixes the problem by ensuring `savedInstanceState == null` before starting installation.
2022-05-06 01:47:02 -07:00
vvb2060 cffd024e9e Ignore the response until showDialog done 2022-05-06 01:04:28 -07:00
topjohnwu cc79a96fa3 Update libsu 2022-05-03 01:25:26 -07:00