Skip to content

Commit

Permalink
kpatch: mv -> cp
Browse files Browse the repository at this point in the history
  • Loading branch information
bmax committed Mar 5, 2024
2 parents f49a24b + df23c45 commit 971ade9
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 103 deletions.
19 changes: 0 additions & 19 deletions kpm-demo/shmem/.gitignore

This file was deleted.

30 changes: 0 additions & 30 deletions kpm-demo/shmem/Makefile

This file was deleted.

5 changes: 0 additions & 5 deletions kpm-demo/shmem/link.lds

This file was deleted.

41 changes: 0 additions & 41 deletions kpm-demo/shmem/main.c

This file was deleted.

13 changes: 5 additions & 8 deletions user/android/android_user.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ struct allow_pkg_info
static char magiskpolicy_path[] = APATCH_BIN_FLODER "magiskpolicy";
static char pkg_cfg_path[] = APATCH_FLODER "package_config";
static char su_path_path[] = APATCH_FLODER "su_path";
static char skip_sepolicy_path[] = APATCH_FLODER "skip_sepolicy";

static char post_fs_data_log_0[] = APATCH_LOG_FLODER "post_fs_data_0.log";
static char post_fs_data_log_1[] = APATCH_LOG_FLODER "post_fs_data_1.log";
Expand Down Expand Up @@ -230,7 +229,7 @@ static void post_fs_data_init()
log_kernel("%d starting android user post-fs-data-init, exec: %s\n", getpid(), current_exe);

if (!strcmp(current_exe, KPATCH_DEV_PATH)) {
char *const args[] = { "/system/bin/mv", current_exe, KPATCH_DATA_PATH, NULL };
char *const args[] = { "/system/bin/cp", "-f", current_exe, KPATCH_DATA_PATH, NULL };
fork_for_result(args[0], args);
return;
}
Expand All @@ -240,16 +239,14 @@ static void post_fs_data_init()

save_dmegs(post_fs_data_log_0);

char *log_args[] = { "/system/bin/mv", EARLY_INIT_LOG_0, APATCH_LOG_FLODER, NULL };
char *log_args[] = { "/system/bin/cp", "-f", EARLY_INIT_LOG_0, APATCH_LOG_FLODER, NULL };
fork_for_result(log_args[0], log_args);

log_args[1] = EARLY_INIT_LOG_1;
log_args[2] = EARLY_INIT_LOG_1;
fork_for_result(log_args[0], log_args);

if (!access(skip_sepolicy_path, F_OK)) {
char *argv[] = { magiskpolicy_path, "--magisk", "--live", NULL };
fork_for_result(magiskpolicy_path, argv);
}
char *argv[] = { magiskpolicy_path, "--magisk", "--live", NULL };
fork_for_result(magiskpolicy_path, argv);

load_config_su_path();
load_config_allow_uids();
Expand Down

0 comments on commit 971ade9

Please sign in to comment.