Refactoring

This commit is contained in:
topjohnwu 2018-04-22 02:16:16 +08:00
parent bb2c744ec0
commit 7e2ba41c64
3 changed files with 2 additions and 3 deletions

2
db.c
View File

@ -87,7 +87,7 @@ void database_check(struct su_context *ctx) {
strcpy(ctx->info->pkg_name, "???"); /* bad string so it doesn't exist */ strcpy(ctx->info->pkg_name, "???"); /* bad string so it doesn't exist */
// Open database // Open database
ret = sqlite3_open_v2(DATABASE_PATH, &db, SQLITE_OPEN_READONLY, NULL); ret = sqlite3_open_v2(MAGISKDB, &db, SQLITE_OPEN_READONLY, NULL);
if (ret) { if (ret) {
LOGE("sqlite3 open failure: %s\n", sqlite3_errstr(ret)); LOGE("sqlite3 open failure: %s\n", sqlite3_errstr(ret));
sqlite3_close(db); sqlite3_close(db);

1
su.h
View File

@ -41,7 +41,6 @@
#define REQUESTOR_PREFIX JAVA_PACKAGE_NAME ".superuser" #define REQUESTOR_PREFIX JAVA_PACKAGE_NAME ".superuser"
#define DEFAULT_SHELL "/system/bin/sh" #define DEFAULT_SHELL "/system/bin/sh"
#define DATABASE_PATH "/data/adb/magisk.db"
typedef enum { typedef enum {
QUERY = 0, QUERY = 0,

View File

@ -337,7 +337,7 @@ int su_client_main(int argc, char *argv[]) {
int ptmx, socketfd; int ptmx, socketfd;
// Connect to client // Connect to client
socketfd = connect_daemon(); socketfd = connect_daemon(0);
// Tell the daemon we are su // Tell the daemon we are su
write_int(socketfd, SUPERUSER); write_int(socketfd, SUPERUSER);