summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--etc/init.rc8
-rw-r--r--minadbd/adb.h4
-rw-r--r--minadbd/services.c4
-rw-r--r--minadbd/transport.c21
-rw-r--r--minui/graphics.c2
-rw-r--r--minzip/Zip.c4
6 files changed, 12 insertions, 31 deletions
diff --git a/etc/init.rc b/etc/init.rc
index 8d49f24e6..6e0595b44 100644
--- a/etc/init.rc
+++ b/etc/init.rc
@@ -28,9 +28,15 @@ on init
chown root shell /tmp
chmod 0775 /tmp
+on fs
+ mkdir /dev/usb-ffs 0770 shell shell
+ mkdir /dev/usb-ffs/adb 0770 shell shell
+ mount functionfs adb /dev/usb-ffs/adb uid=2000,gid=2000
+
write /sys/class/android_usb/android0/enable 0
write /sys/class/android_usb/android0/idVendor 18D1
write /sys/class/android_usb/android0/idProduct D001
+ write /sys/class/android_usb/android0/f_ffs/aliases adb
write /sys/class/android_usb/android0/functions adb
write /sys/class/android_usb/android0/iManufacturer ${ro.product.manufacturer}
write /sys/class/android_usb/android0/iProduct ${ro.product.model}
@@ -59,7 +65,7 @@ service healthd /sbin/healthd -n
service recovery /sbin/recovery
seclabel u:r:recovery:s0
-service adbd /sbin/adbd recovery
+service adbd /sbin/adbd --root_seclabel=u:r:su:s0 --device_banner=recovery
disabled
socket adbd stream 660 system system
seclabel u:r:adbd:s0
diff --git a/minadbd/adb.h b/minadbd/adb.h
index 1f28279d3..d389165ae 100644
--- a/minadbd/adb.h
+++ b/minadbd/adb.h
@@ -244,15 +244,11 @@ void kick_transport( atransport* t );
#if ADB_HOST
int get_available_local_transport_index();
#endif
-int init_socket_transport(atransport *t, int s, int port, int local);
void init_usb_transport(atransport *t, usb_handle *usb, int state);
/* for MacOS X cleanup */
void close_usb_devices();
-/* cause new transports to be init'd and added to the list */
-void register_socket_transport(int s, const char *serial, int port, int local);
-
/* these should only be used for the "adb disconnect" command */
void unregister_transport(atransport *t);
void unregister_all_tcp_transports();
diff --git a/minadbd/services.c b/minadbd/services.c
index aef37f7e4..4698528ef 100644
--- a/minadbd/services.c
+++ b/minadbd/services.c
@@ -46,7 +46,7 @@ void *service_bootstrap_func(void *x)
static void sideload_service(int s, void *cookie)
{
unsigned char buf[4096];
- unsigned count = (unsigned) cookie;
+ unsigned count = (unsigned)(uintptr_t)cookie;
int fd;
fprintf(stderr, "sideload_service invoked\n");
@@ -149,7 +149,7 @@ int service_to_fd(const char *name)
int ret = -1;
if (!strncmp(name, "sideload:", 9)) {
- ret = create_service_thread(sideload_service, (void*) atoi(name + 9));
+ ret = create_service_thread(sideload_service, (void*)(uintptr_t)atoi(name + 9));
#if 0
} else if(!strncmp(name, "echo:", 5)){
ret = create_service_thread(echo_service, 0);
diff --git a/minadbd/transport.c b/minadbd/transport.c
index ff2004932..4c0c97f75 100644
--- a/minadbd/transport.c
+++ b/minadbd/transport.c
@@ -678,27 +678,6 @@ retry:
return result;
}
-void register_socket_transport(int s, const char *serial, int port, int local)
-{
- atransport *t = calloc(1, sizeof(atransport));
- char buff[32];
-
- if (!serial) {
- snprintf(buff, sizeof buff, "T-%p", t);
- serial = buff;
- }
- D("transport: %s init'ing for socket %d, on port %d\n", serial, s, port);
- if ( init_socket_transport(t, s, port, local) < 0 ) {
- adb_close(s);
- free(t);
- return;
- }
- if(serial) {
- t->serial = strdup(serial);
- }
- register_transport(t);
-}
-
void register_usb_transport(usb_handle *usb, const char *serial, unsigned writeable)
{
atransport *t = calloc(1, sizeof(atransport));
diff --git a/minui/graphics.c b/minui/graphics.c
index d75716531..a2014dca3 100644
--- a/minui/graphics.c
+++ b/minui/graphics.c
@@ -157,7 +157,7 @@ static int get_framebuffer(GGLSurface *fb)
fb->width = vi.xres;
fb->height = vi.yres;
fb->stride = fi.line_length/PIXEL_SIZE;
- fb->data = (void*) (((unsigned) bits) + vi.yres * fi.line_length);
+ fb->data = (void*) (((char*) bits) + vi.yres * fi.line_length);
fb->format = PIXEL_FORMAT;
memset(fb->data, 0, vi.yres * fi.line_length);
diff --git a/minzip/Zip.c b/minzip/Zip.c
index 439e5d9cd..f4f38a9ff 100644
--- a/minzip/Zip.c
+++ b/minzip/Zip.c
@@ -772,7 +772,7 @@ bool mzReadZipEntry(const ZipArchive* pArchive, const ZipEntry* pEntry,
static bool writeProcessFunction(const unsigned char *data, int dataLen,
void *cookie)
{
- int fd = (int)cookie;
+ int fd = (int)(intptr_t)cookie;
ssize_t soFar = 0;
while (true) {
@@ -802,7 +802,7 @@ bool mzExtractZipEntryToFile(const ZipArchive *pArchive,
const ZipEntry *pEntry, int fd)
{
bool ret = mzProcessZipEntryContents(pArchive, pEntry, writeProcessFunction,
- (void*)fd);
+ (void*)(intptr_t)fd);
if (!ret) {
LOGE("Can't extract entry to file.\n");
return false;