Update genfiles script

Support directories with spaces and a few more file types.

Change-Id: I90741779eaf7ed386e79be54e8ead927107b9662
diff --git a/tools/genfiles/genfiles.sh b/tools/genfiles/genfiles.sh
index 32d2352..ebf995d 100755
--- a/tools/genfiles/genfiles.sh
+++ b/tools/genfiles/genfiles.sh
@@ -64,6 +64,10 @@
     then
         # png
         echo "cat /storage/sdcard0/proto.png > \"$data\"" >> $CPFILES
+    elif [ "$format" == "14340" ]
+    then
+        # bmp
+        echo "cat /storage/sdcard0/proto.bmp > \"$data\"" >> $CPFILES
     elif [ "$format" == "14343" -a "$mediatype" == "0" ]
     then
         # gif
@@ -100,7 +104,15 @@
     then
         # 3gp
         echo "cat /storage/sdcard0/proto.3gp > \"$data\"" >> $CPFILES
-    elif [ "$format" == "47362" -a "$mediatype" == "2" ]
+    elif [ "$format" == "47747" ]
+    then
+        # doc
+        echo "cat /storage/sdcard0/proto.doc > \"$data\"" >> $CPFILES
+    elif [ "$format" == "47749" ]
+    then
+        # xls
+        echo "cat /storage/sdcard0/proto.xls > \"$data\"" >> $CPFILES
+    elif [ "$format" == "47362" ]
     then
         # ogg
         echo "cat /storage/sdcard0/proto.ogg > \"$data\"" >> $CPFILES
@@ -108,6 +120,10 @@
     then
         # unknown type
         echo "cat /storage/sdcard0/proto.dat > \"$data\"" >> $CPFILES
+    elif [ "$format" == "12288" -a "$mediatype" == "1" ]
+    then
+        # some kind of image file
+        echo "cat /storage/sdcard0/proto.jpg > \"$data\"" >> $CPFILES
     elif [ "$format" == "12289" -a "$mediatype" == "0" ]
     then
         # directory, ignore
@@ -119,7 +135,7 @@
     else
         echo ignored: $format '|' $mediatype '|' $mimetype '|' $data
     fi
-    echo mkdir -p \"$(dirname $data)\" >> $MKDIRS
+    echo mkdir -p \"$(dirname "$data")\" >> $MKDIRS
 done
 
 sort -u $MKDIRS > mkfiles.sh
diff --git a/tools/genfiles/protos/proto.bmp b/tools/genfiles/protos/proto.bmp
new file mode 100644
index 0000000..a430175
--- /dev/null
+++ b/tools/genfiles/protos/proto.bmp
Binary files differ
diff --git a/tools/genfiles/protos/proto.doc b/tools/genfiles/protos/proto.doc
new file mode 100644
index 0000000..7387300
--- /dev/null
+++ b/tools/genfiles/protos/proto.doc
Binary files differ
diff --git a/tools/genfiles/protos/proto.xls b/tools/genfiles/protos/proto.xls
new file mode 100644
index 0000000..11caec9
--- /dev/null
+++ b/tools/genfiles/protos/proto.xls
Binary files differ