mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-11-24 18:45:28 +00:00
Refactoring
This commit is contained in:
parent
bb2c744ec0
commit
7e2ba41c64
2
db.c
2
db.c
@ -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
1
su.h
@ -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[]) {
|
|||||||
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);
|
||||||
|
Loading…
Reference in New Issue
Block a user