summaryrefslogtreecommitdiffstats
path: root/minadbd
diff options
context:
space:
mode:
Diffstat (limited to 'minadbd')
-rw-r--r--minadbd/Android.mk9
-rw-r--r--minadbd/adb.c9
-rw-r--r--minadbd/adb.h5
3 files changed, 15 insertions, 8 deletions
diff --git a/minadbd/Android.mk b/minadbd/Android.mk
index 5a4de6828..c08fd46b0 100644
--- a/minadbd/Android.mk
+++ b/minadbd/Android.mk
@@ -18,15 +18,16 @@ 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_MODULE_TAGS := eng
LOCAL_MODULE := libminadbd
-LOCAL_STATIC_LIBRARIES := libcutils libc
-include $(BUILD_STATIC_LIBRARY)
+LOCAL_SHARED_LIBRARIES := libcutils libc
+include $(BUILD_SHARED_LIBRARY)
diff --git a/minadbd/adb.c b/minadbd/adb.c
index 948f4b755..4cd05ed3c 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,7 @@ 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);
@@ -400,8 +404,9 @@ int adb_main()
fprintf(stderr, "failed to setuid to shell\n");
exit(1);
}
- fprintf(stderr, "userid is %d\n", getuid());
+ 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 98fa5972e..19c22e8ea 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
@@ -413,6 +413,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"
+//#define ADB_SIDELOAD_FILENAME "/tmp/update.zip"
+extern char ADB_SIDELOAD_FILENAME[255];
#endif