diff paraspace/dexfile.py @ 107:4b3573d039af

Fix bug of DEXFile_linked.find_method_name_proto(). - It miss understood structure of _DEX_Method to get associated _DEX_ProtoId.
author Thinker K.F. Li <thinker@codemud.net>
date Sat, 30 Jul 2011 22:59:09 +0800
parents 7821c6e89622
children 18be67af7f1e
line wrap: on
line diff
--- a/paraspace/dexfile.py	Fri Jul 29 16:17:15 2011 +0800
+++ b/paraspace/dexfile.py	Sat Jul 30 22:59:09 2011 +0800
@@ -1808,6 +1808,12 @@
             pass
         pass
 
+    ## \brief Return index of given method.
+    def get_idx_method(self, method):
+        methodid = method.methodIdx
+        idx = self.methodIds.items.index(methodid)
+        return idx
+
     ## \brief Get name of given method ID.
     @staticmethod
     def get_methodid_name(methoid):
@@ -1858,7 +1864,8 @@
             wmethod_name = DEXFile_linked.get_method_name(wmethod)
             if method_name != wmethod_name:
                 continue
-            if DEXFile_linked._proto_is_compatible(wmethod.protoIdx, proto):
+            wmethodid = wmethod.methodIdx
+            if DEXFile_linked._proto_is_compatible(wmethodid.protoIdx, proto):
                 return wmethod
             pass
         raise ValueError, 'can not find a method for given name and prototype'