Added option (-z) to generate a zipfile with the bugreport.

Currently, dumpstate generates a text file and Shell zips it, but that
breaks the android.intent.action.BUGREPORT_FINISHED contract.

Also changed some string variables from char* to std::string.

BUG: 25563823
Change-Id: I6e61798bf559fa9f79f629b22fd410752da2bbf7
diff --git a/cmds/dumpstate/Android.mk b/cmds/dumpstate/Android.mk
index 6442701..4ab8d3d 100644
--- a/cmds/dumpstate/Android.mk
+++ b/cmds/dumpstate/Android.mk
@@ -15,6 +15,8 @@
 LOCAL_MODULE := dumpstate
 
 LOCAL_SHARED_LIBRARIES := libcutils liblog libselinux
+# ZipArchive support, the order matters here to get all symbols.
+LOCAL_STATIC_LIBRARIES := libziparchive libz libbase
 LOCAL_HAL_STATIC_LIBRARIES := libdumpstate
 LOCAL_CFLAGS += -Wall -Wno-unused-parameter -std=gnu99
 LOCAL_INIT_RC := dumpstate.rc