diff options
Diffstat (limited to 'minadbd')
-rw-r--r-- | minadbd/Android.mk | 19 | ||||
-rw-r--r-- | minadbd/minadbd.cpp | 2 | ||||
-rw-r--r-- | minadbd/minadbd_services.cpp | 14 |
3 files changed, 29 insertions, 6 deletions
diff --git a/minadbd/Android.mk b/minadbd/Android.mk index 7eef13ee0..fb90f6120 100644 --- a/minadbd/Android.mk +++ b/minadbd/Android.mk @@ -7,11 +7,13 @@ minadbd_cflags := \ -Wno-unused-parameter \ -Wno-missing-field-initializers \ -DADB_HOST=0 \ + -DPLATFORM_SDK_VERSION=$(PLATFORM_SDK_VERSION) include $(CLEAR_VARS) LOCAL_SRC_FILES := \ fuse_adb_provider.cpp \ + ../fuse_sideload.cpp \ minadbd.cpp \ minadbd_services.cpp \ @@ -19,11 +21,20 @@ LOCAL_CLANG := true LOCAL_MODULE := libminadbd LOCAL_CFLAGS := $(minadbd_cflags) LOCAL_CONLY_FLAGS := -Wimplicit-function-declaration -LOCAL_C_INCLUDES := bootable/recovery system/core/adb +LOCAL_C_INCLUDES := $(LOCAL_PATH)/.. system/core/adb LOCAL_WHOLE_STATIC_LIBRARIES := libadbd -LOCAL_STATIC_LIBRARIES := libcrypto libbase - -include $(BUILD_STATIC_LIBRARY) +LOCAL_SHARED_LIBRARIES := libbase liblog libcutils libc + +ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 24; echo $$?),0) + LOCAL_C_INCLUDES += $(LOCAL_PATH)/libmincrypt/includes + LOCAL_SHARED_LIBRARIES += libmincrypttwrp + LOCAL_CFLAGS += -DUSE_MINCRYPT +else + LOCAL_SHARED_LIBRARIES += libcrypto \ + $(if $(WITH_CRYPTO_UTILS),libcrypto_utils) +endif + +include $(BUILD_SHARED_LIBRARY) include $(CLEAR_VARS) diff --git a/minadbd/minadbd.cpp b/minadbd/minadbd.cpp index 349189cc7..d9da1974f 100644 --- a/minadbd/minadbd.cpp +++ b/minadbd/minadbd.cpp @@ -36,7 +36,7 @@ int minadbd_main() { init_transport_registration(); usb_init(); - VLOG(ADB) << "Event loop starting"; + //VLOG(ADB) << "Event loop starting"; fdevent_loop(); return 0; diff --git a/minadbd/minadbd_services.cpp b/minadbd/minadbd_services.cpp index 426d982eb..e558f9702 100644 --- a/minadbd/minadbd_services.cpp +++ b/minadbd/minadbd_services.cpp @@ -72,7 +72,12 @@ static int create_service_thread(void (*func)(int, void *), void *cookie) { sti->cookie = cookie; sti->fd = s[1]; +#if PLATFORM_SDK_VERSION == 23 + adb_thread_t t; + if (adb_thread_create( &t, (adb_thread_func_t)service_bootstrap_func, sti)){ +#else if (!adb_thread_create(service_bootstrap_func, sti)) { +#endif free(sti); adb_close(s[0]); adb_close(s[1]); @@ -80,7 +85,7 @@ static int create_service_thread(void (*func)(int, void *), void *cookie) { return -1; } - VLOG(SERVICES) << "service thread started, " << s[0] << ":" << s[1]; + //VLOG(SERVICES) << "service thread started, " << s[0] << ":" << s[1]; return s[0]; } @@ -101,3 +106,10 @@ int service_to_fd(const char* name, const atransport* transport) { } return ret; } + +#if PLATFORM_SDK_VERSION == 23 +int service_to_fd(const char* name) { + atransport transport; + return service_to_fd(name, &transport); +} +#endif |