diff paraspace/tests/injection_test.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 835336632aba
line wrap: on
line diff
--- a/paraspace/tests/injection_test.py	Fri Jul 29 16:17:15 2011 +0800
+++ b/paraspace/tests/injection_test.py	Sat Jul 30 22:59:09 2011 +0800
@@ -140,6 +140,9 @@
         fakefile_linked.find_class_name('Lcom/codemud/fakefile/fakefile;')
     clone = dexfile_insert_class(helloworld_linked, fakefile_def)
 
+    init_method = fakefile_linked.find_method_name('<init>', fakefile_def)
+    init_protoid = init_method.methodIdx.protoIdx
+
     File_typeid = helloworld_linked.find_typeid_name('Ljava/io/File;')
     assert File_typeid
     File_typeidx = helloworld_linked.get_idx_typeid(File_typeid)
@@ -163,7 +166,6 @@
                 pass
             elif opcode == dalvik_opcodes.all_opcodes.OP_INVOKE_DIRECT:
                 methodid = helloworld_linked.find_methodid_idx(args[2])
-                print fakefile_codes, code, args[2]
                 assert methodid.classIdx != File_typeid or \
                     code in fakefile_codes
                 pass