/* * Copyright (C) 2026 SlopRoot Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef SU_H #define SU_H #define SU_VERSION_CODE 1 #define SU_VERSION_NAME "1.0-sumanager" #define DAEMON_SOCKET_ABSTRACT "sumanager_daemon" #define DAEMON_SOCKET_DEV "/dev/sumanager_daemon.sock" #define MANAGER_PACKAGE "org.sloproot.sumanager" #define MANAGER_DATA_DIR "/data/data/" MANAGER_PACKAGE #define MANAGER_REQUEST_ACTIVITY "org.sloproot.sumanager/.RequestActivity" #define PACKAGES_LIST_PATH "/data/system/packages.list" #define REQ_SOCKET_PREFIX "/dev/sumanager_req_" #define REQ_TOKEN_BYTES 16 #define REQ_TOKEN_HEX_LEN (REQ_TOKEN_BYTES * 2) #define POLICY_PATH_SYSTEM "/data/system/sumanager/policy.conf" #define POLICY_PATH_APP "/data/data/org.sloproot.sumanager/files/policy.conf" enum policy_action { POLICY_INTERACTIVE = 0, POLICY_ALLOW = 1, POLICY_DENY = 2 }; struct su_request { pid_t from_pid; uid_t from_uid; uid_t to_uid; char from_name[128]; char command[4096]; char shell[128]; }; #endif /* SU_H */