Improve adb sideload - use storage vs tmp
diff --git a/minadbd/adb.c b/minadbd/adb.c
index 0e8fd2a..54adba0 100644
--- a/minadbd/adb.c
+++ b/minadbd/adb.c
@@ -40,6 +40,8 @@
 
 static const char *adb_device_banner = "sideload";
 
+char ADB_SIDELOAD_FILENAME[255];
+
 void fatal(const char *fmt, ...)
 {
     va_list ap;
@@ -378,8 +380,9 @@
     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.
@@ -394,6 +397,7 @@
         usb_init();
     }
 
+/* Remove this so that perms work properly
     if (setgid(AID_SHELL) != 0) {
         fprintf(stderr, "failed to setgid to shell\n");
         exit(1);
@@ -402,8 +406,9 @@
         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 98fa597..19c22e8 100644
--- a/minadbd/adb.h
+++ b/minadbd/adb.h
@@ -217,7 +217,7 @@
 
 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 @@
 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