diff options
Diffstat (limited to 'minadbd')
-rw-r--r-- | minadbd/Android.mk | 11 | ||||
-rw-r--r-- | minadbd/adb.c | 18 | ||||
-rw-r--r-- | minadbd/adb.h | 5 |
3 files changed, 26 insertions, 8 deletions
diff --git a/minadbd/Android.mk b/minadbd/Android.mk index 04956d870..4430a2baa 100644 --- a/minadbd/Android.mk +++ b/minadbd/Android.mk @@ -19,14 +19,13 @@ LOCAL_SRC_FILES := \ sockets.c \ services.c \ usb_linux_client.c \ - utils.c + utils.c \ + ../../../system/core/adb/transport_local.c LOCAL_CFLAGS := -O2 -g -DADB_HOST=0 -Wall -Wno-unused-parameter LOCAL_CFLAGS += -D_XOPEN_SOURCE -D_GNU_SOURCE -LOCAL_C_INCLUDES += bootable/recovery - +LOCAL_MODULE_TAGS := eng LOCAL_MODULE := libminadbd -LOCAL_STATIC_LIBRARIES := libfusesideload libcutils libc - -include $(BUILD_STATIC_LIBRARY) +LOCAL_SHARED_LIBRARIES := libfusesideload libcutils libc +include $(BUILD_SHARED_LIBRARY) diff --git a/minadbd/adb.c b/minadbd/adb.c index 127d072be..c35e8300b 100644 --- a/minadbd/adb.c +++ b/minadbd/adb.c @@ -38,6 +38,8 @@ int HOST = 0; static const char *adb_device_banner = "sideload"; +char ADB_SIDELOAD_FILENAME[255]; + void fatal(const char *fmt, ...) { va_list ap; @@ -376,8 +378,9 @@ static void adb_cleanup(void) usb_cleanup(); } -int adb_main() +int adb_main(const char* path) { + strcpy(ADB_SIDELOAD_FILENAME, path); atexit(adb_cleanup); #if defined(HAVE_FORKEXEC) // No SIGCHLD. Let the service subproc handle its children. @@ -392,6 +395,19 @@ int adb_main() usb_init(); } +/* Remove this so that perms work properly + if (setgid(AID_SHELL) != 0) { + fprintf(stderr, "failed to setgid to shell\n"); + exit(1); + } + if (setuid(AID_SHELL) != 0) { + fprintf(stderr, "failed to setuid to shell\n"); + exit(1); + } + + fprintf(stderr, "userid is %d\n", getuid()); +*/ + D("Event loop starting\n"); fdevent_loop(); diff --git a/minadbd/adb.h b/minadbd/adb.h index 714868f5c..08ee989d6 100644 --- a/minadbd/adb.h +++ b/minadbd/adb.h @@ -217,7 +217,7 @@ void send_packet(apacket *p, atransport *t); void get_my_path(char *s, size_t maxLen); int launch_server(int server_port); -int adb_main(); +int adb_main(const char* path); /* transports are ref-counted @@ -421,4 +421,7 @@ extern int SHELL_EXIT_NOTIFY_FD; int sendfailmsg(int fd, const char *reason); int handle_host_request(char *service, transport_type ttype, char* serial, int reply_fd, asocket *s); +//#define ADB_SIDELOAD_FILENAME "/tmp/update.zip" +extern char ADB_SIDELOAD_FILENAME[255]; + #endif |