2 ** Copyright 2010, Adam Shanks (@ChainsDD)
3 ** Copyright 2008, Zinx Verituse (@zinxv)
5 ** Licensed under the Apache License, Version 2.0 (the "License");
6 ** you may not use this file except in compliance with the License.
7 ** You may obtain a copy of the License at
9 ** http://www.apache.org/licenses/LICENSE-2.0
11 ** Unless required by applicable law or agreed to in writing, software
12 ** distributed under the License is distributed on an "AS IS" BASIS,
13 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 ** See the License for the specific language governing permissions and
15 ** limitations under the License.
21 #define REQUESTOR_DATA_PATH "/data/data/com.noshufou.android.su"
22 #define REQUESTOR_CACHE_PATH REQUESTOR_DATA_PATH "/cache"
24 #define REQUESTOR_DATABASES_PATH REQUESTOR_DATA_PATH "/databases"
25 #define REQUESTOR_DATABASE_PATH REQUESTOR_DATABASES_PATH "/permissions.sqlite"
27 #define DEFAULT_COMMAND "/system/bin/sh"
29 #define SOCKET_PATH_TEMPLATE REQUESTOR_CACHE_PATH "/.socketXXXXXX"
31 #define VERSION "3.0.3.2"
32 #define VERSION_CODE 15
34 #define DATABASE_VERSION 6
54 extern int send_intent(struct su_initiator *from, struct su_request *to, const char *socket_path, int allow, int type);
58 #define LOGE(fmt,args...) fprintf(stderr, fmt , ## args )
60 #define LOGD(fmt,args...) fprintf(stderr, fmt , ## args )
62 #define LOGW(fmt,args...) fprintf(stderr, fmt , ## args )
65 #define PLOGE(fmt,args...) LOGE(fmt " failed with %d: %s" , ## args , errno, strerror(errno))
66 #define PLOGEV(fmt,err,args...) LOGE(fmt " failed with %d: %s" , ## args , err, strerror(err))