From bb97cc594d551bdf18ee51a83a8e8b2e5720db9f Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Mon, 4 Dec 2017 18:05:07 +0800 Subject: [PATCH] Cleanup and small fixes --- .gitignore | 4 +--- build.py | 6 +++--- core/.gitignore | 2 ++ core/jni/core/bootstages.c | 2 -- core/jni/core/daemon.c | 1 - core/jni/core/log_monitor.c | 1 - core/jni/magiskhide/hide_utils.c | 2 -- core/jni/utils/cpio.c | 1 + core/jni/utils/list.c | 3 --- 9 files changed, 7 insertions(+), 15 deletions(-) diff --git a/.gitignore b/.gitignore index 2865ee369..bf50f8ac5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,4 @@ -/out -/obj -/libs +out *.zip *.jks *.apk diff --git a/build.py b/build.py index b3027eecc..b299532c2 100755 --- a/build.py +++ b/build.py @@ -58,7 +58,7 @@ def cp(source, target): def rm(file): try: - os.remove(file) + os.remove(file) except OSError as e: if e.errno != errno.ENOENT: raise @@ -435,8 +435,8 @@ clean_parser.add_argument('target', nargs='*') clean_parser.set_defaults(func=cleanup) if len(sys.argv) == 1: - parser.print_help() - sys.exit(1) + parser.print_help() + sys.exit(1) args = parser.parse_args() diff --git a/core/.gitignore b/core/.gitignore index 796b96d1c..c6f79a7c4 100644 --- a/core/.gitignore +++ b/core/.gitignore @@ -1 +1,3 @@ /build +obj +libs \ No newline at end of file diff --git a/core/jni/core/bootstages.c b/core/jni/core/bootstages.c index ba4c8bf33..f0c51654a 100644 --- a/core/jni/core/bootstages.c +++ b/core/jni/core/bootstages.c @@ -11,8 +11,6 @@ #include #include #include -#include -#include #include #include #include diff --git a/core/jni/core/daemon.c b/core/jni/core/daemon.c index 4418e2ee0..6b9a9e732 100644 --- a/core/jni/core/daemon.c +++ b/core/jni/core/daemon.c @@ -8,7 +8,6 @@ #include #include #include -#include #include #include #include diff --git a/core/jni/core/log_monitor.c b/core/jni/core/log_monitor.c index 300f3d0c5..44d7f9ae7 100644 --- a/core/jni/core/log_monitor.c +++ b/core/jni/core/log_monitor.c @@ -6,7 +6,6 @@ */ #include -#include #include #include #include diff --git a/core/jni/magiskhide/hide_utils.c b/core/jni/magiskhide/hide_utils.c index 249b81ef0..e37e4c14d 100644 --- a/core/jni/magiskhide/hide_utils.c +++ b/core/jni/magiskhide/hide_utils.c @@ -4,10 +4,8 @@ #include #include #include -#include #include #include -#include #include #include #include diff --git a/core/jni/utils/cpio.c b/core/jni/utils/cpio.c index 045801f49..3d9947417 100644 --- a/core/jni/utils/cpio.c +++ b/core/jni/utils/cpio.c @@ -168,6 +168,7 @@ void cpio_ln(struct vector *v, const char *target, const char *entry) { cpio_entry *f = xcalloc(sizeof(*f), 1); f->mode = S_IFLNK; f->filename = strdup(entry); + f->filesize = strlen(target) + 1; f->data = strdup(target); cpio_vec_insert(v, f); fprintf(stderr, "Create symlink [%s] -> [%s]\n", entry, target); diff --git a/core/jni/utils/list.c b/core/jni/utils/list.c index 1181024e4..c54d532c8 100644 --- a/core/jni/utils/list.c +++ b/core/jni/utils/list.c @@ -1,9 +1,6 @@ /* list.h - Double link list implementation */ -#include -#include - #include "list.h" void init_list_head(struct list_head *head) {