Commit Graph

37 Commits

Author SHA1 Message Date
ping2A
f8daa928e3 Format all python files with black + isort 2024-11-05 11:00:52 +01:00
erev0s
ca26897594 Revert "Fix syntax + dynamic part"
This reverts commit e73ee65fc9.
2024-11-02 17:25:54 +02:00
Ping2A
e73ee65fc9 Fix syntax + dynamic part 2024-10-31 15:50:52 +01:00
Ruffalo Lavoisier
e31c3265c8 Fix some typo 2024-05-31 18:21:16 +09:00
Branden Ehrenreich
319c398768
Apply type annotations (#1042)
* progress on typing

* finish typing analysis.py

* progress on typing dex/__init__.py

* finish pass at dex.__init__.py typing

* more types

* more typing, and fix circular imports using 'if TYPE_CHECKING' checking

* begin to change Generator->Iterator for typing, begin to returns that are type|None to Union[type,None] since that convention started in Python3.10 and Androguard supports 3.9+, and note current circular import issue.

* type|None only works in Python3.10+, which is too high of an assumption for Androguard..change these to Union[type,None]

* withoffset->with_offset

* fix circular import issue due to adding imports for typing

* types for permission loading

* apply type hints to bytecode module

* convert | to Union for further backwards compatibility, progress towards typing axml

* finish typing axml

* order imports, standardize type|None -> Union[type,None]

* fix type for get_certificate_name_string param

* explicitly import Name for typing

* standardize type|None -> Union[type,None]

* type annotate main

* fix some inaccurate hints

* type hint fixes

* add imports for typing

* remove unused import

* remove explicit dependence on typing_extensions, as we can do self-referencing type hints using 'from __future__ import annotations'..however note that typing_extensions is still installed by some underlying package.
2024-04-28 09:40:27 +03:00
ehrenb
167ef191d8 fix comment 2024-03-09 20:19:48 -05:00
ehrenb
126bac4605 ensure .show() works for MethodAnalysis that are External. Add logging when creating new ClassAnalysis instance. Similar to wrapping all fields into FieldAnalysis, also add and wrap all strings into StringAnalysis. Create explicit methods for getting internal/external methods. Updated expected outputs for test_analysis, as underlying implementations have changed 2024-03-09 15:27:51 -05:00
ehrenb
8fdb6f939d update all tests to use explicit functions for encoded methods/fields. fix failing test mentioned in https://github.com/androguard/androguard/issues/989\#issuecomment-1925512272 so that it assumes testing for wrapped fields. make new tests for DEX-class level testing that tests counts of parsed values in the DEX header 2024-02-25 18:12:46 -05:00
erev0s
8031ed355e test_analysis.py 2023-12-23 20:34:24 +02:00
totoag
ca1c12b94f Clean up and add some ui for dynamic analysis 2023-06-10 07:00:04 -07:00
Meir Komet
2c403e5638 Added support for Android 10's Dalvik 039 (hidden api annotation) 2020-10-24 04:16:45 -07:00
Jakob
b91ac1c150 Add new xrefs: new_instance, const_class and xref_read/write to MethodAnalysis
To avoid iterating over all fields in order to find the ones a method
can read/write from/to, the Fields are now available through a
MethodAnalysis object. Additionally, the _new_instance and _cons_class
references are added to MethodAnalysis and ClassAnalysis for the same
reason as well as to avoid using xref_to to a non-existent method.
2019-11-22 11:51:10 +01:00
Sebastian Bachmann
477ea10951 fixing the broken stuff 2019-10-18 08:18:40 +02:00
Sebastian Bachmann
add1a5b2f0 Merging MethodAnalysis and MethodClassAnalysis
Dropped MethodClassAnalysis and pulled all functions
into MethodAnalysis.
This should also be slightly faster when creating xrefs,
as the method can not be looked up directly instead of using
an exhaustive search.

resolves #412
2019-10-17 15:18:06 +02:00
Sebastian Bachmann
597890448d adding tests for offsets 2019-09-01 18:26:16 +02:00
Sebastian Bachmann
ce8cce9394 add offsets to xrefs 2019-09-01 15:36:17 +02:00
Neakxs
132f314f48 Changing MUTF8String for a bytes subclass 2019-05-23 12:08:56 -07:00
Sebastian Bachmann
ef94f00606 fixing tests 2019-05-10 09:21:42 +02:00
Sebastian Bachmann
ad74d91e87 sort all the lists 2019-04-03 11:05:45 +02:00
Sebastian Bachmann
7ca12dac9d Re-implement permission based lookup of API methods
This should:
* resolve #222

The naming has changed and also the returned values are different now!

Note that these methods might not catch all occurences of API usage
2019-04-03 10:19:24 +02:00
reox
2a3b6621e9
Merge pull request #648 from reox/master
Changes to XREFs
2019-02-24 18:44:10 +01:00
Hugo
38bd0ef771 Upgrade Python syntax with pyupgrade --py3-plus https://github.com/asottile/pyupgrade 2019-02-23 19:36:45 +02:00
Sebastian Bachmann
0c96c4217b adding more tests 2019-02-20 20:54:30 +01:00
Sebastian Bachmann
28e7ab7702 resolve #527 2019-01-28 21:16:05 +01:00
Sebastian Bachmann
4311a6d447 go one level higher 2019-01-25 22:30:06 +01:00
Sebastian Bachmann
647879e1db tests 2019-01-25 22:24:08 +01:00
Sebastian Bachmann
1d41a252b1 short test 2018-06-04 14:28:10 +02:00
Sebastian Bachmann
3e3b1a7593 fix test 2018-03-09 10:24:44 +01:00
Sebastian Bachmann
a28b3f75bf adding new test 2018-03-08 12:08:06 +01:00
Sebastian Bachmann
ecfa46a17a fixing methods and add more test cases 2017-12-20 12:21:37 +01:00
Sebastian Bachmann
86caa734d3 some crude test cases 2017-12-19 11:37:33 +01:00
Sebastian Bachmann
2583e9c29a use nosetests 2017-11-24 22:45:05 +01:00
Sebastian Bachmann
1ce2a7f1ae auto format code 2017-06-14 12:04:10 +02:00
adesnos
d7f88bb47a Start analysis refactoring #219 2017-03-17 07:14:25 +01:00
Sebastian Bachmann
5ae9b256c1 all files should be read as binary 2017-02-09 09:48:34 +00:00
adesnos
376b990d06 Fix syntax 2015-09-14 15:52:30 +02:00
adesnos
33923d032e update 2015-09-11 12:02:37 +02:00