diff paraspace/dexfile.py @ 109:835336632aba

Add collect_typeidxs_in_method()
author Thinker K.F. Li <thinker@codemud.net>
date Mon, 01 Aug 2011 14:37:04 +0800
parents 18be67af7f1e
children 6380730a80b4
line wrap: on
line diff
--- a/paraspace/dexfile.py	Mon Aug 01 12:27:28 2011 +0800
+++ b/paraspace/dexfile.py	Mon Aug 01 14:37:04 2011 +0800
@@ -1902,6 +1902,19 @@
                    for tl_typeid in tl_typeids]
         return typeids
 
+    ## \brief Return code block of given method.
+    #
+    # Code block is a string of byte code instructions for Dalvik VM.
+    #
+    @staticmethod
+    def get_code_block_method(method):
+        if not method.codeOffRef.is_true:
+            return ''
+
+        code = method.codeOffRef.value
+        insns = code.insns.data
+        return insns
+
     ## \brief Dump content of a proto ID.
     @staticmethod
     def dump_protoid(protoid):