IOsipov / androguard

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

AnalyzeAPK regression: unexpected keyword argument 'magic_file' #75

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I can't use AnalyzeAPK() any longer with Androlyze 1.6 though it used to work 
perfectly well.

This seems to happen on any apk. Strange?

In [2]: a, d, dx = AnalyzeAPK( 
'/home/axelle/prog/isemulator/bin/IsEmulator-debug.apk' )
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
/home/axelle/softs/androguard/androlyze.py in <module>()
----> 1 a, d, dx = AnalyzeAPK( 
'/home/axelle/prog/isemulator/bin/IsEmulator-debug.apk' )

/home/axelle/softs/androguard/androlyze.py in AnalyzeAPK(filename, raw, 
decompiler)
    111     """
    112     androconf.debug("APK ...")
--> 113     a = APK(filename, raw)
    114 
    115     d, dx = AnalyzeDex( a.get_dex(), raw=True, decompiler=decompiler )

/home/axelle/softs/androguard/androguard/core/bytecodes/apk.pyc in 
__init__(self, filename, raw, mode, magic_file, zipmodule)
    194                 self.validAPK = True
    195 

    195 
--> 196         self.get_files_types()
    197 
    198     def get_AndroidManifest(self) :

/home/axelle/softs/androguard/androguard/core/bytecodes/apk.pyc in 
get_files_types(self)
    286                 self.files_crc32[ i ] = crc32( buffer )
    287         else :
--> 288             m = magic.Magic(magic_file=self.magic_file)
    289             for i in self.get_files() :
    290                 buffer = self.zip.read( i )

TypeError: __init__() got an unexpected keyword argument 'magic_file'

Original issue reported on code.google.com by axelle.a...@gmail.com on 25 Sep 2012 at 2:13

GoogleCodeExporter commented 9 years ago
It is a problem with libmagic (one more time, this library is very annoying). 
What is your version ?

Original comment by anthony....@gmail.com on 26 Sep 2012 at 6:20

GoogleCodeExporter commented 9 years ago
This is what I have, and unfortunately, it's up to date...

ii  python-magic                           5.09-2                               
   File type determination library using "magic" numbers (Python bindings)
ii  libmagic1                              5.09-2                               
   File type determination library using "magic" numbers

Original comment by aaforti...@gmail.com on 27 Sep 2012 at 10:51

GoogleCodeExporter commented 9 years ago
Yes, the main reason is that the debian magic library is not the same as 
https://github.com/ahupp/python-magic. I'm working on that.

Original comment by anthony....@gmail.com on 8 Oct 2012 at 1:26

GoogleCodeExporter commented 9 years ago

Original comment by anthony....@gmail.com on 8 Oct 2012 at 1:38