Commit 7e2ba41c authored by topjohnwu's avatar topjohnwu

Refactoring

parent bb2c744e
...@@ -87,7 +87,7 @@ void database_check(struct su_context *ctx) { ...@@ -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);
......
...@@ -41,7 +41,6 @@ ...@@ -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,
......
...@@ -337,7 +337,7 @@ int su_client_main(int argc, char *argv[]) { ...@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment