mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-10-15 19:50:47 +00:00
Try to use broadcast for su logging and notify
In commit 8d4c407
, native Magisk always launches an activity for
communicating with Magisk Manager. While this works extremely well,
since it also workaround stupid OEMs that blocks broadcasts, it has a
problem: launching an activity will claim the focus of the device,
which could be super annoying in some circumstances.
This commit adds a new feature to run a broadcast test on boot complete.
If Magisk Manager successfully receives the broadcast, it will toggle
a setting in magiskd so all future su loggings and notifies will always
use broadcasts instead of launching activities.
Fix #1412
This commit is contained in:
@@ -17,7 +17,7 @@ enum {
|
||||
BOOT_COMPLETE,
|
||||
MAGISKHIDE,
|
||||
SQLITE_CMD,
|
||||
ZYGOTE_NOTIFY,
|
||||
BROADCAST_ACK,
|
||||
};
|
||||
|
||||
// Return codes for daemon
|
||||
@@ -82,6 +82,8 @@ void magiskhide_handler(int client);
|
||||
*************/
|
||||
|
||||
void su_daemon_handler(int client, struct ucred *credential);
|
||||
void broadcast_test();
|
||||
|
||||
extern int SDK_INT;
|
||||
extern bool RECOVERY_MODE;
|
||||
extern bool CONNECT_BROADCAST;
|
||||
|
@@ -154,7 +154,7 @@ typedef std::function<bool(db_row&)> db_row_cb;
|
||||
|
||||
int get_db_settings(db_settings &cfg, int key = -1);
|
||||
int get_db_strings(db_strings &str, int key = -1);
|
||||
int get_uid_policy(int uid, su_access &su);
|
||||
int get_uid_policy(su_access &su, int uid);
|
||||
int validate_manager(std::string &alt_pkg, int userid, struct stat *st);
|
||||
void exec_sql(int client);
|
||||
char *db_exec(const char *sql);
|
||||
|
Reference in New Issue
Block a user