2017-04-07 23:37:43 +00:00
|
|
|
/* daemon.h - Utility functions for daemon-client communication
|
|
|
|
*/
|
|
|
|
|
2017-04-08 23:25:10 +00:00
|
|
|
|
|
|
|
// Commands require connecting to daemon
|
|
|
|
typedef enum {
|
|
|
|
LAUNCH_MAGISKHIDE,
|
|
|
|
STOP_MAGISKHIDE,
|
|
|
|
ADD_HIDELIST,
|
|
|
|
RM_HIDELIST,
|
|
|
|
SUPERUSER,
|
|
|
|
TEST
|
|
|
|
} client_request;
|
|
|
|
|
|
|
|
// daemon.c
|
|
|
|
|
|
|
|
void start_daemon();
|
|
|
|
int connect_daemon();
|
|
|
|
|
2017-04-07 23:37:43 +00:00
|
|
|
// socket_trans.c
|
2017-04-08 23:25:10 +00:00
|
|
|
|
2017-04-07 23:37:43 +00:00
|
|
|
int recv_fd(int sockfd);
|
|
|
|
void send_fd(int sockfd, int fd);
|
|
|
|
int read_int(int fd);
|
|
|
|
void write_int(int fd, int val);
|
|
|
|
char* read_string(int fd);
|
|
|
|
void write_string(int fd, const char* val);
|