Prune unused UIDs from su policies

This commit is contained in:
topjohnwu
2022-05-18 01:55:58 -07:00
parent e11508f84d
commit 975b1a5e36
12 changed files with 165 additions and 80 deletions

View File

@@ -9,6 +9,10 @@
#include <socket.hpp>
#define AID_APP_START 10000
#define AID_APP_END 19999
#define AID_USER_OFFSET 100000
// Daemon command codes
namespace MainRequest {
enum : int {
@@ -81,6 +85,11 @@ void denylist_handler(int client, const sock_cred *cred);
void su_daemon_handler(int client, const sock_cred *cred);
void zygisk_handler(int client, const sock_cred *cred);
// Package
bool need_pkg_refresh();
std::vector<bool> get_app_no_list();
int get_manager(int user_id = 0, std::string *pkg = nullptr);
// Denylist
void initialize_denylist();
int denylist_cli(int argc, char **argv);

View File

@@ -125,9 +125,6 @@ using db_row_cb = std::function<bool(db_row&)>;
int get_db_settings(db_settings &cfg, int key = -1);
int get_db_strings(db_strings &str, int key = -1);
bool get_manager(int user_id, std::string *pkg, struct stat *st);
bool get_manager(std::string *pkg = nullptr);
int get_manager_app_id();
void exec_sql(int client);
char *db_exec(const char *sql);
char *db_exec(const char *sql, const db_row_cb &fn);