woogi / androguard

Automatically exported from code.google.com/p/androguard
Apache License 2.0
0 stars 0 forks source link

Leading '[' in some Class Names #129

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
In some APKs, Androguard reports an incorrect class name for methods that are 
called. 

With d being a DalvikVMFormat, try:
for met in d.get_methods():
            for inst in met.get_instructions():
                if inst.get_name().startswith('invoke'):
                    if inst.get_translated_kind().startswith('['):
                       print("Oops! a leading [  in <%s>" % (inst.get_translated_kind(),))

This leading '[' should not be in this string. 

Tested with up-to-date mercurial repo.

Notes: 
d.get_classes_names() does not exhibit this problem.
The leading '[' is already present when ClassManager.add_type_item() is called. 
I can provide APKs (many) for wich I encouter this issue. 

Original issue reported on code.google.com by kal...@gmail.com on 8 Jul 2013 at 3:47

GoogleCodeExporter commented 9 years ago
OK, This clearly was a misconception on my side. 
The behaviour of Androguard is actually correct. 

I know so little about Java that I did't know there was no real Array class, 
therefore calling a method of Array (or its superclass Object) on an Array of 
Strings will result in an invoke [Ljava/lang/String;->method() (I originaly 
expected an invoke Array;->method() )

Anyway...Please close this bug as invalid.

Original comment by kal...@gmail.com on 19 Jul 2013 at 9:25