From 0ccc92dc1e091aa3885fabadec7083e7a485a8a9 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Fri, 9 Dec 2016 15:57:10 +0800 Subject: [PATCH] Minor restructure --- jni/Android.mk | 2 +- jni/{bootimgtools.h => bootimgtools/bootimg.h} | 0 jni/{ => bootimgtools}/extract.c | 2 +- jni/{ => bootimgtools}/hexpatch.c | 2 +- jni/{bootimgtools.c => bootimgtools/main.c} | 2 +- jni/{ => bootimgtools}/repack.c | 2 +- jni/magiskhide.c | 3 ++- 7 files changed, 7 insertions(+), 6 deletions(-) rename jni/{bootimgtools.h => bootimgtools/bootimg.h} (100%) rename jni/{ => bootimgtools}/extract.c (99%) rename jni/{ => bootimgtools}/hexpatch.c (98%) rename jni/{bootimgtools.c => bootimgtools/main.c} (98%) rename jni/{ => bootimgtools}/repack.c (99%) diff --git a/jni/Android.mk b/jni/Android.mk index 229074c52..71e16e263 100644 --- a/jni/Android.mk +++ b/jni/Android.mk @@ -12,7 +12,7 @@ include $(BUILD_EXECUTABLE) include $(CLEAR_VARS) LOCAL_MODULE := bootimgtools LOCAL_MODULE_TAGS := optional -LOCAL_SRC_FILES := bootimgtools.c extract.c repack.c hexpatch.c +LOCAL_SRC_FILES := bootimgtools/main.c bootimgtools/extract.c bootimgtools/repack.c bootimgtools/hexpatch.c LOCAL_CFLAGS += -std=gnu11 include $(BUILD_EXECUTABLE) diff --git a/jni/bootimgtools.h b/jni/bootimgtools/bootimg.h similarity index 100% rename from jni/bootimgtools.h rename to jni/bootimgtools/bootimg.h diff --git a/jni/extract.c b/jni/bootimgtools/extract.c similarity index 99% rename from jni/extract.c rename to jni/bootimgtools/extract.c index 5ec14aefc..2dff91127 100644 --- a/jni/extract.c +++ b/jni/bootimgtools/extract.c @@ -9,7 +9,7 @@ #include #include -#include "bootimgtools.h" +#include "bootimg.h" void dump(uint8_t *ptr, size_t size, char* filename) { unlink(filename); diff --git a/jni/hexpatch.c b/jni/bootimgtools/hexpatch.c similarity index 98% rename from jni/hexpatch.c rename to jni/bootimgtools/hexpatch.c index 469538478..33a0ee10b 100644 --- a/jni/hexpatch.c +++ b/jni/bootimgtools/hexpatch.c @@ -7,7 +7,7 @@ #include #include -#include "bootimgtools.h" +#include "bootimg.h" int hex2int(char c) { int first = c / 16 - 3; diff --git a/jni/bootimgtools.c b/jni/bootimgtools/main.c similarity index 98% rename from jni/bootimgtools.c rename to jni/bootimgtools/main.c index 738a9374d..3155bcefd 100644 --- a/jni/bootimgtools.c +++ b/jni/bootimgtools/main.c @@ -1,7 +1,7 @@ #include #include -#include "bootimgtools.h" +#include "bootimg.h" /******************** Patch Boot Image diff --git a/jni/repack.c b/jni/bootimgtools/repack.c similarity index 99% rename from jni/repack.c rename to jni/bootimgtools/repack.c index c97fae73d..bb9732e8b 100644 --- a/jni/repack.c +++ b/jni/bootimgtools/repack.c @@ -9,7 +9,7 @@ #include #include -#include "bootimgtools.h" +#include "bootimg.h" off_t file_size(char *filename) { struct stat st; diff --git a/jni/magiskhide.c b/jni/magiskhide.c index 112adea42..014ee3bff 100644 --- a/jni/magiskhide.c +++ b/jni/magiskhide.c @@ -150,7 +150,8 @@ void quit_pthread(int sig) { pthread_exit(NULL); } -void *monitor_list(void *listpath) { +void *monitor_list(void *path) { + char* listpath = (char*) path; signal(SIGQUIT, quit_pthread); int inotifyFd = -1;