summaryrefslogtreecommitdiffstats
path: root/cmds
diff options
context:
space:
mode:
Diffstat (limited to 'cmds')
-rw-r--r--cmds/dumpstate/Android.mk8
-rw-r--r--cmds/dumpstate/dumpstate.c4
-rw-r--r--cmds/dumpstate/dumpstate.h9
-rw-r--r--cmds/dumpsys/dumpsys.cpp24
-rw-r--r--cmds/keystore/keystore.c23
-rw-r--r--cmds/stagefright/Android.mk6
-rw-r--r--cmds/stagefright/stagefright.cpp6
7 files changed, 50 insertions, 30 deletions
diff --git a/cmds/dumpstate/Android.mk b/cmds/dumpstate/Android.mk
index f8b37a8..27891ec 100644
--- a/cmds/dumpstate/Android.mk
+++ b/cmds/dumpstate/Android.mk
@@ -3,9 +3,13 @@ ifneq ($(TARGET_SIMULATOR),true)
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
-LOCAL_SRC_FILES:= dumpstate.c utils.c
+ifdef BOARD_WLAN_DEVICE
+LOCAL_CFLAGS := -DFWDUMP_$(BOARD_WLAN_DEVICE)
+endif
+
+LOCAL_SRC_FILES := dumpstate.c utils.c
-LOCAL_MODULE:= dumpstate
+LOCAL_MODULE := dumpstate
LOCAL_SHARED_LIBRARIES := libcutils
diff --git a/cmds/dumpstate/dumpstate.c b/cmds/dumpstate/dumpstate.c
index 5a485e4..236c0fe 100644
--- a/cmds/dumpstate/dumpstate.c
+++ b/cmds/dumpstate/dumpstate.c
@@ -78,6 +78,10 @@ static void dumpstate(int full) {
PRINT("");
PRINT("Routes:");
DUMP("/proc/net/route");
+#ifdef FWDUMP_bcm4329
+ PRINT("Dump wlan FW log");
+ EXEC_XBIN6("su", "root","dhdutil","-i","eth0","upload","/data/local/tmp/wlan_crash.dump");
+#endif
PRINT("------ SYSTEM PROPERTIES ------");
print_properties();
PRINT("------ KERNEL LOG ------");
diff --git a/cmds/dumpstate/dumpstate.h b/cmds/dumpstate/dumpstate.h
index b99b6d7..ed1f005 100644
--- a/cmds/dumpstate/dumpstate.h
+++ b/cmds/dumpstate/dumpstate.h
@@ -124,6 +124,15 @@
run_command(&c, TIMEOUT); \
}
+#define EXEC_XBIN6(cmd, a1, a2, a3, a4, a5, a6) \
+{ \
+ static struct Command c = { \
+ "/system/xbin/" cmd, \
+ { cmd, a1, a2, a3, a4, a5, a6, 0 } \
+ }; \
+ run_command(&c, TIMEOUT); \
+}
+
#define PROPERTY(name) print_property(name)
struct Command {
diff --git a/cmds/dumpsys/dumpsys.cpp b/cmds/dumpsys/dumpsys.cpp
index 945a690..fdc5d5d 100644
--- a/cmds/dumpsys/dumpsys.cpp
+++ b/cmds/dumpsys/dumpsys.cpp
@@ -51,22 +51,26 @@ int main(int argc, char* const argv[])
const size_t N = services.size();
- // first print a list of the current services
- aout << "Currently running services:" << endl;
-
- for (size_t i=0; i<N; i++) {
- sp<IBinder> service = sm->checkService(services[i]);
- if (service != NULL) {
- aout << " " << services[i] << endl;
+ if (N > 1) {
+ // first print a list of the current services
+ aout << "Currently running services:" << endl;
+
+ for (size_t i=0; i<N; i++) {
+ sp<IBinder> service = sm->checkService(services[i]);
+ if (service != NULL) {
+ aout << " " << services[i] << endl;
+ }
}
}
for (size_t i=0; i<N; i++) {
sp<IBinder> service = sm->checkService(services[i]);
if (service != NULL) {
- aout << "------------------------------------------------------------"
- "-------------------" << endl;
- aout << "DUMP OF SERVICE " << services[i] << ":" << endl;
+ if (N > 1) {
+ aout << "------------------------------------------------------------"
+ "-------------------" << endl;
+ aout << "DUMP OF SERVICE " << services[i] << ":" << endl;
+ }
int err = service->dump(STDOUT_FILENO, args);
if (err != 0) {
aerr << "Error dumping service info: (" << strerror(err)
diff --git a/cmds/keystore/keystore.c b/cmds/keystore/keystore.c
index ba74c78..4426874 100644
--- a/cmds/keystore/keystore.c
+++ b/cmds/keystore/keystore.c
@@ -163,19 +163,19 @@ static struct __attribute__((packed)) {
static int8_t encrypt_blob(char *name, AES_KEY *aes_key)
{
uint8_t vector[AES_BLOCK_SIZE];
- int length = blob.length;
+ int length;
int fd;
if (read(the_entropy, vector, AES_BLOCK_SIZE) != AES_BLOCK_SIZE) {
return SYSTEM_ERROR;
}
- length += blob.value - blob.digested;
+ length = blob.length + blob.value - blob.encrypted;
+ length = (length + AES_BLOCK_SIZE - 1) / AES_BLOCK_SIZE * AES_BLOCK_SIZE;
+
blob.length = htonl(blob.length);
- MD5(blob.digested, length, blob.digest);
+ MD5(blob.digested, length - (blob.digested - blob.encrypted), blob.digest);
- length += blob.digested - blob.encrypted;
- length = (length + AES_BLOCK_SIZE - 1) / AES_BLOCK_SIZE * AES_BLOCK_SIZE;
memcpy(vector, blob.vector, AES_BLOCK_SIZE);
AES_cbc_encrypt(blob.encrypted, blob.encrypted, length, aes_key, vector,
AES_ENCRYPT);
@@ -184,11 +184,9 @@ static int8_t encrypt_blob(char *name, AES_KEY *aes_key)
length += blob.encrypted - (uint8_t *)&blob;
fd = open(".tmp", O_WRONLY | O_TRUNC | O_CREAT, S_IRUSR | S_IWUSR);
- if (fd == -1 || write(fd, &blob, length) != length) {
- return SYSTEM_ERROR;
- }
+ length -= write(fd, &blob, length);
close(fd);
- return rename(".tmp", name) ? SYSTEM_ERROR : NO_ERROR;
+ return (length || rename(".tmp", name)) ? SYSTEM_ERROR : NO_ERROR;
}
static int8_t decrypt_blob(char *name, AES_KEY *aes_key)
@@ -210,14 +208,15 @@ static int8_t decrypt_blob(char *name, AES_KEY *aes_key)
AES_cbc_encrypt(blob.encrypted, blob.encrypted, length, aes_key,
blob.vector, AES_DECRYPT);
length -= blob.digested - blob.encrypted;
- if (!memcmp(blob.digest, MD5(blob.digested, length, NULL),
- MD5_DIGEST_LENGTH)) {
+ if (memcmp(blob.digest, MD5(blob.digested, length, NULL),
+ MD5_DIGEST_LENGTH)) {
return VALUE_CORRUPTED;
}
length -= blob.value - blob.digested;
blob.length = ntohl(blob.length);
- return (length < blob.length) ? VALUE_CORRUPTED : NO_ERROR;
+ return (blob.length < 0 || blob.length > length) ? VALUE_CORRUPTED :
+ NO_ERROR;
}
/* Here are the actions. Each of them is a function without arguments. All
diff --git a/cmds/stagefright/Android.mk b/cmds/stagefright/Android.mk
index 100af89..68d8bb0 100644
--- a/cmds/stagefright/Android.mk
+++ b/cmds/stagefright/Android.mk
@@ -8,7 +8,7 @@ LOCAL_SRC_FILES:= \
stagefright.cpp
LOCAL_SHARED_LIBRARIES := \
- libstagefright
+ libstagefright libmedia libutils libbinder
LOCAL_C_INCLUDES:= \
$(JNI_H_INCLUDE) \
@@ -30,7 +30,7 @@ LOCAL_SRC_FILES:= \
record.cpp
LOCAL_SHARED_LIBRARIES := \
- libstagefright
+ libstagefright liblog libutils libbinder
LOCAL_C_INCLUDES:= \
$(JNI_H_INCLUDE) \
@@ -52,7 +52,7 @@ LOCAL_SRC_FILES:= \
audioloop.cpp
LOCAL_SHARED_LIBRARIES := \
- libstagefright
+ libstagefright liblog libutils libbinder
LOCAL_C_INCLUDES:= \
$(JNI_H_INCLUDE) \
diff --git a/cmds/stagefright/stagefright.cpp b/cmds/stagefright/stagefright.cpp
index 376f3d9..ad6540a 100644
--- a/cmds/stagefright/stagefright.cpp
+++ b/cmds/stagefright/stagefright.cpp
@@ -345,12 +345,12 @@ int main(int argc, char **argv) {
sp<IOMX> omx = service->getOMX();
CHECK(omx.get() != NULL);
- List<String8> list;
+ List<IOMX::ComponentInfo> list;
omx->listNodes(&list);
- for (List<String8>::iterator it = list.begin();
+ for (List<IOMX::ComponentInfo>::iterator it = list.begin();
it != list.end(); ++it) {
- printf("%s\n", (*it).string());
+ printf("%s\n", (*it).mName.string());
}
}