jack51706 / androguard

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

test_analysis_offset.py can't run #155

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.cd androguard-1.9
2.python ./tests/test_analysis_offset.py
3.
  File "./tests/test_analysis_offset.py", line 139, in <module>
    a = AndroguardS( TEST_CASE )
  File "./androguard/core/androgen.py", line 239, in __init__
    self.__orig_a = Androguard( [ filename ], raw )
  File "./androguard/core/androgen.py", line 99, in __init__
    self._analyze()
  File "./androguard/core/androgen.py", line 123, in _analyze
    raise( "Unknown format" )
TypeError: exceptions must be old-style classes or derived from BaseException, 
not str

What is the expected output? What do you see instead?

     i expect the program can run correctly. and i track the problem,and

find that the Androguard class can't deal with the .class file ( only judge the 
file whose suffix in (apk,dex,dey,elf)

What version of the product are you using? On what operating system?
 androguard-1.9  
 Linux ubuntu 3.2.0-23-generic-pae #36-Ubuntu SMP Tue Apr 10 22:19:09 UTC 2012 i686 i686 i386 GNU/Linux
Please provide any additional information below.

Original issue reported on code.google.com by wangjiay...@gmail.com on 31 Mar 2014 at 3:18

GoogleCodeExporter commented 8 years ago
me either.

sx@sx-R408P:~/androguard$ ./androdd.py -i ~/crackme0502.apk -o ~/out/ -d -f png
Dump information /home/sx/crackme0502.apk in /home/sx/out/
Clean directory /home/sx/out/
Analysis ... End
Decompilation ...
Traceback (most recent call last):
  File "./androdd.py", line 222, in <module>
    main(options, arguments)
  File "./androdd.py", line 207, in main
    export_apps_to_format(options.input, a, options.output, options.limit, options.jar, options.decompiler, options.format)
  File "./androdd.py", line 127, in export_apps_to_format
    raise("invalid decompiler !")
TypeError: exceptions must be old-style classes or derived from BaseException, 
not str

Ubuntu 13.10 + python2.7.5 + hg clone https://androguard.googlecode.com/hg/ 
androguard (so I cloned the latest androguard) 

 I have done my homework. Python 2.5 shows 'deprecation' .Python 2.7 /3.0 just do not support str-based anomaly.

Still don't know how to deal.Must install Python 2.5 ?

Original comment by shang.xu...@gmail.com on 30 Apr 2014 at 3:21

GoogleCodeExporter commented 8 years ago
change raise 'String' with raise Exception('string') in your androdd.py script

Original comment by amriabde...@gmail.com on 16 Jul 2014 at 9:31