* Call `set_catch_type` on both nodes to ensure the attribute is not empty
Nodes with `catch_type` set to the default `None` cause exceptions when the user requests human-readable source code.
Fix for issue #1079.
* Ensure nodes in the same catch edge inherit non-empty `catch_type` from each other
Some areas in the code call `add_catch_edge` without calling `set_catch_type`. Nodes with `catch_type` set to the default `None` cause exceptions when the user requests human-readable source code.
Fix for issue #1079.
* Convert `visit_ins` into a method
This commit is part of a series of changes that convert functions in `androguard.decompiler.dast` into instance or static methods.
With the previous version of the code it was difficult to alter the functionality of the `JSONWriter` class.
For some methods in `JSONWriter`, expanding the behaviour would require re-implementing entire code blocks or using monkey patching.
Example:
In the original version of the code the `dast` module contains a function called `method_invocation`. It is used in another function called `visit_expr`. `visit_expr` is called by `JSONWriter` in `get_cond` and `visit_switch_node` instance methods.
If a developer wanted to add extra logic for cases when `JSONWriter` detects a method invocation (e.g. to dynamically log callers), the procedure would be very complicated:
1. Use some form of monkey patching to modify the `method_invocation` and `visit_expr` functions.
2. Override `get_cond` and `visit_switch_node` methods in a way that ensures the new versions of `method_invocation` and `visit_expr` are called.
If `method_invocation` is a method inside `JSONWriter`, the procedure is much simpler - the developer only needs to override `method_invocation`.
* Convert `write_inplace_if_possible` and `visit_expr` into methods
This commit is part of a series of changes that convert functions in `androguard.decompiler.dast` into instance or static methods.
With the previous version of the code it was difficult to alter the functionality of the `JSONWriter` class.
For some methods in `JSONWriter`, expanding the behaviour would require re-implementing entire code blocks or using monkey patching.
Example:
In the original version of the code the `dast` module contains a function called `method_invocation`. It is used in another function called `visit_expr`. `visit_expr` is called by `JSONWriter` in `get_cond` and `visit_switch_node` instance methods.
If a developer wanted to add extra logic for cases when `JSONWriter` detects a method invocation (e.g. to dynamically log callers), the procedure would be very complicated:
1. Use some form of monkey patching to modify the `method_invocation` and `visit_expr` functions.
2. Override `get_cond` and `visit_switch_node` methods in a way that ensures the new versions of `method_invocation` and `visit_expr` are called.
If `method_invocation` is a method inside `JSONWriter`, the procedure is much simpler - the developer only needs to override `method_invocation`.
* Convert `visit_arr_data` into a method
This commit is part of a series of changes that convert functions in `androguard.decompiler.dast` into instance or static methods.
With the previous version of the code it was difficult to alter the functionality of the `JSONWriter` class.
For some methods in `JSONWriter`, expanding the behaviour would require re-implementing entire code blocks or using monkey patching.
Example:
In the original version of the code the `dast` module contains a function called `method_invocation`. It is used in another function called `visit_expr`. `visit_expr` is called by `JSONWriter` in `get_cond` and `visit_switch_node` instance methods.
If a developer wanted to add extra logic for cases when `JSONWriter` detects a method invocation (e.g. to dynamically log callers), the procedure would be very complicated:
1. Use some form of monkey patching to modify the `method_invocation` and `visit_expr` functions.
2. Override `get_cond` and `visit_switch_node` methods in a way that ensures the new versions of `method_invocation` and `visit_expr` are called.
If `method_invocation` is a method inside `JSONWriter`, the procedure is much simpler - the developer only needs to override `method_invocation`.
* Convert `visit_decl` into a method
This commit is part of a series of changes that convert functions in `androguard.decompiler.dast` into instance or static methods.
With the previous version of the code it was difficult to alter the functionality of the `JSONWriter` class.
For some methods in `JSONWriter`, expanding the behaviour would require re-implementing entire code blocks or using monkey patching.
Example:
In the original version of the code the `dast` module contains a function called `method_invocation`. It is used in another function called `visit_expr`. `visit_expr` is called by `JSONWriter` in `get_cond` and `visit_switch_node` instance methods.
If a developer wanted to add extra logic for cases when `JSONWriter` detects a method invocation (e.g. to dynamically log callers), the procedure would be very complicated:
1. Use some form of monkey patching to modify the `method_invocation` and `visit_expr` functions.
2. Override `get_cond` and `visit_switch_node` methods in a way that ensures the new versions of `method_invocation` and `visit_expr` are called.
If `method_invocation` is a method inside `JSONWriter`, the procedure is much simpler - the developer only needs to override `method_invocation`.
* Convert `literal_null` into a static method
This commit is part of a series of changes that convert functions in `androguard.decompiler.dast` into instance or static methods.
With the previous version of the code it was difficult to alter the functionality of the `JSONWriter` class.
For some methods in `JSONWriter`, expanding the behaviour would require re-implementing entire code blocks or using monkey patching.
Example:
In the original version of the code the `dast` module contains a function called `method_invocation`. It is used in another function called `visit_expr`. `visit_expr` is called by `JSONWriter` in `get_cond` and `visit_switch_node` instance methods.
If a developer wanted to add extra logic for cases when `JSONWriter` detects a method invocation (e.g. to dynamically log callers), the procedure would be very complicated:
1. Use some form of monkey patching to modify the `method_invocation` and `visit_expr` functions.
2. Override `get_cond` and `visit_switch_node` methods in a way that ensures the new versions of `method_invocation` and `visit_expr` are called.
If `method_invocation` is a method inside `JSONWriter`, the procedure is much simpler - the developer only needs to override `method_invocation`.
* Convert `literal_double` into a static method
This commit is part of a series of changes that convert functions in `androguard.decompiler.dast` into instance or static methods.
With the previous version of the code it was difficult to alter the functionality of the `JSONWriter` class.
For some methods in `JSONWriter`, expanding the behaviour would require re-implementing entire code blocks or using monkey patching.
Example:
In the original version of the code the `dast` module contains a function called `method_invocation`. It is used in another function called `visit_expr`. `visit_expr` is called by `JSONWriter` in `get_cond` and `visit_switch_node` instance methods.
If a developer wanted to add extra logic for cases when `JSONWriter` detects a method invocation (e.g. to dynamically log callers), the procedure would be very complicated:
1. Use some form of monkey patching to modify the `method_invocation` and `visit_expr` functions.
2. Override `get_cond` and `visit_switch_node` methods in a way that ensures the new versions of `method_invocation` and `visit_expr` are called.
If `method_invocation` is a method inside `JSONWriter`, the procedure is much simpler - the developer only needs to override `method_invocation`.
* Convert `literal_float` into a static method
This commit is part of a series of changes that convert functions in `androguard.decompiler.dast` into instance or static methods.
With the previous version of the code it was difficult to alter the functionality of the `JSONWriter` class.
For some methods in `JSONWriter`, expanding the behaviour would require re-implementing entire code blocks or using monkey patching.
Example:
In the original version of the code the `dast` module contains a function called `method_invocation`. It is used in another function called `visit_expr`. `visit_expr` is called by `JSONWriter` in `get_cond` and `visit_switch_node` instance methods.
If a developer wanted to add extra logic for cases when `JSONWriter` detects a method invocation (e.g. to dynamically log callers), the procedure would be very complicated:
1. Use some form of monkey patching to modify the `method_invocation` and `visit_expr` functions.
2. Override `get_cond` and `visit_switch_node` methods in a way that ensures the new versions of `method_invocation` and `visit_expr` are called.
If `method_invocation` is a method inside `JSONWriter`, the procedure is much simpler - the developer only needs to override `method_invocation`.
* Convert `literal_long` into a static method
This commit is part of a series of changes that convert functions in `androguard.decompiler.dast` into instance or static methods.
With the previous version of the code it was difficult to alter the functionality of the `JSONWriter` class.
For some methods in `JSONWriter`, expanding the behaviour would require re-implementing entire code blocks or using monkey patching.
Example:
In the original version of the code the `dast` module contains a function called `method_invocation`. It is used in another function called `visit_expr`. `visit_expr` is called by `JSONWriter` in `get_cond` and `visit_switch_node` instance methods.
If a developer wanted to add extra logic for cases when `JSONWriter` detects a method invocation (e.g. to dynamically log callers), the procedure would be very complicated:
1. Use some form of monkey patching to modify the `method_invocation` and `visit_expr` functions.
2. Override `get_cond` and `visit_switch_node` methods in a way that ensures the new versions of `method_invocation` and `visit_expr` are called.
If `method_invocation` is a method inside `JSONWriter`, the procedure is much simpler - the developer only needs to override `method_invocation`.
* Convert `literal_hex_int` into a static method
This commit is part of a series of changes that convert functions in `androguard.decompiler.dast` into instance or static methods.
With the previous version of the code it was difficult to alter the functionality of the `JSONWriter` class.
For some methods in `JSONWriter`, expanding the behaviour would require re-implementing entire code blocks or using monkey patching.
Example:
In the original version of the code the `dast` module contains a function called `method_invocation`. It is used in another function called `visit_expr`. `visit_expr` is called by `JSONWriter` in `get_cond` and `visit_switch_node` instance methods.
If a developer wanted to add extra logic for cases when `JSONWriter` detects a method invocation (e.g. to dynamically log callers), the procedure would be very complicated:
1. Use some form of monkey patching to modify the `method_invocation` and `visit_expr` functions.
2. Override `get_cond` and `visit_switch_node` methods in a way that ensures the new versions of `method_invocation` and `visit_expr` are called.
If `method_invocation` is a method inside `JSONWriter`, the procedure is much simpler - the developer only needs to override `method_invocation`.
* Convert `literal_int` into a static method
This commit is part of a series of changes that convert functions in `androguard.decompiler.dast` into instance or static methods.
With the previous version of the code it was difficult to alter the functionality of the `JSONWriter` class.
For some methods in `JSONWriter`, expanding the behaviour would require re-implementing entire code blocks or using monkey patching.
Example:
In the original version of the code the `dast` module contains a function called `method_invocation`. It is used in another function called `visit_expr`. `visit_expr` is called by `JSONWriter` in `get_cond` and `visit_switch_node` instance methods.
If a developer wanted to add extra logic for cases when `JSONWriter` detects a method invocation (e.g. to dynamically log callers), the procedure would be very complicated:
1. Use some form of monkey patching to modify the `method_invocation` and `visit_expr` functions.
2. Override `get_cond` and `visit_switch_node` methods in a way that ensures the new versions of `method_invocation` and `visit_expr` are called.
If `method_invocation` is a method inside `JSONWriter`, the procedure is much simpler - the developer only needs to override `method_invocation`.
* Convert `literal_bool` into a static method
This commit is part of a series of changes that convert functions in `androguard.decompiler.dast` into instance or static methods.
With the previous version of the code it was difficult to alter the functionality of the `JSONWriter` class.
For some methods in `JSONWriter`, expanding the behaviour would require re-implementing entire code blocks or using monkey patching.
Example:
In the original version of the code the `dast` module contains a function called `method_invocation`. It is used in another function called `visit_expr`. `visit_expr` is called by `JSONWriter` in `get_cond` and `visit_switch_node` instance methods.
If a developer wanted to add extra logic for cases when `JSONWriter` detects a method invocation (e.g. to dynamically log callers), the procedure would be very complicated:
1. Use some form of monkey patching to modify the `method_invocation` and `visit_expr` functions.
2. Override `get_cond` and `visit_switch_node` methods in a way that ensures the new versions of `method_invocation` and `visit_expr` are called.
If `method_invocation` is a method inside `JSONWriter`, the procedure is much simpler - the developer only needs to override `method_invocation`.
* Convert `literal_class` into a static method
This commit is part of a series of changes that convert functions in `androguard.decompiler.dast` into instance or static methods.
With the previous version of the code it was difficult to alter the functionality of the `JSONWriter` class.
For some methods in `JSONWriter`, expanding the behaviour would require re-implementing entire code blocks or using monkey patching.
Example:
In the original version of the code the `dast` module contains a function called `method_invocation`. It is used in another function called `visit_expr`. `visit_expr` is called by `JSONWriter` in `get_cond` and `visit_switch_node` instance methods.
If a developer wanted to add extra logic for cases when `JSONWriter` detects a method invocation (e.g. to dynamically log callers), the procedure would be very complicated:
1. Use some form of monkey patching to modify the `method_invocation` and `visit_expr` functions.
2. Override `get_cond` and `visit_switch_node` methods in a way that ensures the new versions of `method_invocation` and `visit_expr` are called.
If `method_invocation` is a method inside `JSONWriter`, the procedure is much simpler - the developer only needs to override `method_invocation`.
* Convert `literal_string` into a static method
This commit is part of a series of changes that convert functions in `androguard.decompiler.dast` into instance or static methods.
With the previous version of the code it was difficult to alter the functionality of the `JSONWriter` class.
For some methods in `JSONWriter`, expanding the behaviour would require re-implementing entire code blocks or using monkey patching.
Example:
In the original version of the code the `dast` module contains a function called `method_invocation`. It is used in another function called `visit_expr`. `visit_expr` is called by `JSONWriter` in `get_cond` and `visit_switch_node` instance methods.
If a developer wanted to add extra logic for cases when `JSONWriter` detects a method invocation (e.g. to dynamically log callers), the procedure would be very complicated:
1. Use some form of monkey patching to modify the `method_invocation` and `visit_expr` functions.
2. Override `get_cond` and `visit_switch_node` methods in a way that ensures the new versions of `method_invocation` and `visit_expr` are called.
If `method_invocation` is a method inside `JSONWriter`, the procedure is much simpler - the developer only needs to override `method_invocation`.
* Convert `parse_descriptor` into a static method
This commit is part of a series of changes that convert functions in `androguard.decompiler.dast` into instance or static methods.
With the previous version of the code it was difficult to alter the functionality of the `JSONWriter` class.
For some methods in `JSONWriter`, expanding the behaviour would require re-implementing entire code blocks or using monkey patching.
Example:
In the original version of the code the `dast` module contains a function called `method_invocation`. It is used in another function called `visit_expr`. `visit_expr` is called by `JSONWriter` in `get_cond` and `visit_switch_node` instance methods.
If a developer wanted to add extra logic for cases when `JSONWriter` detects a method invocation (e.g. to dynamically log callers), the procedure would be very complicated:
1. Use some form of monkey patching to modify the `method_invocation` and `visit_expr` functions.
2. Override `get_cond` and `visit_switch_node` methods in a way that ensures the new versions of `method_invocation` and `visit_expr` are called.
If `method_invocation` is a method inside `JSONWriter`, the procedure is much simpler - the developer only needs to override `method_invocation`.
* Convert `_append` into a static method
This commit is part of a series of changes that convert functions in `androguard.decompiler.dast` into instance or static methods.
With the previous version of the code it was difficult to alter the functionality of the `JSONWriter` class.
For some methods in `JSONWriter`, expanding the behaviour would require re-implementing entire code blocks or using monkey patching.
Example:
In the original version of the code the `dast` module contains a function called `method_invocation`. It is used in another function called `visit_expr`. `visit_expr` is called by `JSONWriter` in `get_cond` and `visit_switch_node` instance methods.
If a developer wanted to add extra logic for cases when `JSONWriter` detects a method invocation (e.g. to dynamically log callers), the procedure would be very complicated:
1. Use some form of monkey patching to modify the `method_invocation` and `visit_expr` functions.
2. Override `get_cond` and `visit_switch_node` methods in a way that ensures the new versions of `method_invocation` and `visit_expr` are called.
If `method_invocation` is a method inside `JSONWriter`, the procedure is much simpler - the developer only needs to override `method_invocation`.
* Convert `statement_block` into a static method
This commit is part of a series of changes that convert functions in `androguard.decompiler.dast` into instance or static methods.
With the previous version of the code it was difficult to alter the functionality of the `JSONWriter` class.
For some methods in `JSONWriter`, expanding the behaviour would require re-implementing entire code blocks or using monkey patching.
Example:
In the original version of the code the `dast` module contains a function called `method_invocation`. It is used in another function called `visit_expr`. `visit_expr` is called by `JSONWriter` in `get_cond` and `visit_switch_node` instance methods.
If a developer wanted to add extra logic for cases when `JSONWriter` detects a method invocation (e.g. to dynamically log callers), the procedure would be very complicated:
1. Use some form of monkey patching to modify the `method_invocation` and `visit_expr` functions.
2. Override `get_cond` and `visit_switch_node` methods in a way that ensures the new versions of `method_invocation` and `visit_expr` are called.
If `method_invocation` is a method inside `JSONWriter`, the procedure is much simpler - the developer only needs to override `method_invocation`.
* Convert `switch_stmt` into a static method
This commit is part of a series of changes that convert functions in `androguard.decompiler.dast` into instance or static methods.
With the previous version of the code it was difficult to alter the functionality of the `JSONWriter` class.
For some methods in `JSONWriter`, expanding the behaviour would require re-implementing entire code blocks or using monkey patching.
Example:
In the original version of the code the `dast` module contains a function called `method_invocation`. It is used in another function called `visit_expr`. `visit_expr` is called by `JSONWriter` in `get_cond` and `visit_switch_node` instance methods.
If a developer wanted to add extra logic for cases when `JSONWriter` detects a method invocation (e.g. to dynamically log callers), the procedure would be very complicated:
1. Use some form of monkey patching to modify the `method_invocation` and `visit_expr` functions.
2. Override `get_cond` and `visit_switch_node` methods in a way that ensures the new versions of `method_invocation` and `visit_expr` are called.
If `method_invocation` is a method inside `JSONWriter`, the procedure is much simpler - the developer only needs to override `method_invocation`.
* Convert `if_stmt` into a static method
This commit is part of a series of changes that convert functions in `androguard.decompiler.dast` into instance or static methods.
With the previous version of the code it was difficult to alter the functionality of the `JSONWriter` class.
For some methods in `JSONWriter`, expanding the behaviour would require re-implementing entire code blocks or using monkey patching.
Example:
In the original version of the code the `dast` module contains a function called `method_invocation`. It is used in another function called `visit_expr`. `visit_expr` is called by `JSONWriter` in `get_cond` and `visit_switch_node` instance methods.
If a developer wanted to add extra logic for cases when `JSONWriter` detects a method invocation (e.g. to dynamically log callers), the procedure would be very complicated:
1. Use some form of monkey patching to modify the `method_invocation` and `visit_expr` functions.
2. Override `get_cond` and `visit_switch_node` methods in a way that ensures the new versions of `method_invocation` and `visit_expr` are called.
If `method_invocation` is a method inside `JSONWriter`, the procedure is much simpler - the developer only needs to override `method_invocation`.
* Convert `try_stmt` into a static method
This commit is part of a series of changes that convert functions in `androguard.decompiler.dast` into instance or static methods.
With the previous version of the code it was difficult to alter the functionality of the `JSONWriter` class.
For some methods in `JSONWriter`, expanding the behaviour would require re-implementing entire code blocks or using monkey patching.
Example:
In the original version of the code the `dast` module contains a function called `method_invocation`. It is used in another function called `visit_expr`. `visit_expr` is called by `JSONWriter` in `get_cond` and `visit_switch_node` instance methods.
If a developer wanted to add extra logic for cases when `JSONWriter` detects a method invocation (e.g. to dynamically log callers), the procedure would be very complicated:
1. Use some form of monkey patching to modify the `method_invocation` and `visit_expr` functions.
2. Override `get_cond` and `visit_switch_node` methods in a way that ensures the new versions of `method_invocation` and `visit_expr` are called.
If `method_invocation` is a method inside `JSONWriter`, the procedure is much simpler - the developer only needs to override `method_invocation`.
* Convert `loop_stmt` into a static method
This commit is part of a series of changes that convert functions in `androguard.decompiler.dast` into instance or static methods.
With the previous version of the code it was difficult to alter the functionality of the `JSONWriter` class.
For some methods in `JSONWriter`, expanding the behaviour would require re-implementing entire code blocks or using monkey patching.
Example:
In the original version of the code the `dast` module contains a function called `method_invocation`. It is used in another function called `visit_expr`. `visit_expr` is called by `JSONWriter` in `get_cond` and `visit_switch_node` instance methods.
If a developer wanted to add extra logic for cases when `JSONWriter` detects a method invocation (e.g. to dynamically log callers), the procedure would be very complicated:
1. Use some form of monkey patching to modify the `method_invocation` and `visit_expr` functions.
2. Override `get_cond` and `visit_switch_node` methods in a way that ensures the new versions of `method_invocation` and `visit_expr` are called.
If `method_invocation` is a method inside `JSONWriter`, the procedure is much simpler - the developer only needs to override `method_invocation`.
* Convert `jump_stmt` into a static method
This commit is part of a series of changes that convert functions in `androguard.decompiler.dast` into instance or static methods.
With the previous version of the code it was difficult to alter the functionality of the `JSONWriter` class.
For some methods in `JSONWriter`, expanding the behaviour would require re-implementing entire code blocks or using monkey patching.
Example:
In the original version of the code the `dast` module contains a function called `method_invocation`. It is used in another function called `visit_expr`. `visit_expr` is called by `JSONWriter` in `get_cond` and `visit_switch_node` instance methods.
If a developer wanted to add extra logic for cases when `JSONWriter` detects a method invocation (e.g. to dynamically log callers), the procedure would be very complicated:
1. Use some form of monkey patching to modify the `method_invocation` and `visit_expr` functions.
2. Override `get_cond` and `visit_switch_node` methods in a way that ensures the new versions of `method_invocation` and `visit_expr` are called.
If `method_invocation` is a method inside `JSONWriter`, the procedure is much simpler - the developer only needs to override `method_invocation`.
* Convert `throw_stmt` into a static method
This commit is part of a series of changes that convert functions in `androguard.decompiler.dast` into instance or static methods.
With the previous version of the code it was difficult to alter the functionality of the `JSONWriter` class.
For some methods in `JSONWriter`, expanding the behaviour would require re-implementing entire code blocks or using monkey patching.
Example:
In the original version of the code the `dast` module contains a function called `method_invocation`. It is used in another function called `visit_expr`. `visit_expr` is called by `JSONWriter` in `get_cond` and `visit_switch_node` instance methods.
If a developer wanted to add extra logic for cases when `JSONWriter` detects a method invocation (e.g. to dynamically log callers), the procedure would be very complicated:
1. Use some form of monkey patching to modify the `method_invocation` and `visit_expr` functions.
2. Override `get_cond` and `visit_switch_node` methods in a way that ensures the new versions of `method_invocation` and `visit_expr` are called.
If `method_invocation` is a method inside `JSONWriter`, the procedure is much simpler - the developer only needs to override `method_invocation`.
* Convert `return_stmt` into a static method
This commit is part of a series of changes that convert functions in `androguard.decompiler.dast` into instance or static methods.
With the previous version of the code it was difficult to alter the functionality of the `JSONWriter` class.
For some methods in `JSONWriter`, expanding the behaviour would require re-implementing entire code blocks or using monkey patching.
Example:
In the original version of the code the `dast` module contains a function called `method_invocation`. It is used in another function called `visit_expr`. `visit_expr` is called by `JSONWriter` in `get_cond` and `visit_switch_node` instance methods.
If a developer wanted to add extra logic for cases when `JSONWriter` detects a method invocation (e.g. to dynamically log callers), the procedure would be very complicated:
1. Use some form of monkey patching to modify the `method_invocation` and `visit_expr` functions.
2. Override `get_cond` and `visit_switch_node` methods in a way that ensures the new versions of `method_invocation` and `visit_expr` are called.
If `method_invocation` is a method inside `JSONWriter`, the procedure is much simpler - the developer only needs to override `method_invocation`.
* Convert `local_decl_stmt` into a static method
This commit is part of a series of changes that convert functions in `androguard.decompiler.dast` into instance or static methods.
With the previous version of the code it was difficult to alter the functionality of the `JSONWriter` class.
For some methods in `JSONWriter`, expanding the behaviour would require re-implementing entire code blocks or using monkey patching.
Example:
In the original version of the code the `dast` module contains a function called `method_invocation`. It is used in another function called `visit_expr`. `visit_expr` is called by `JSONWriter` in `get_cond` and `visit_switch_node` instance methods.
If a developer wanted to add extra logic for cases when `JSONWriter` detects a method invocation (e.g. to dynamically log callers), the procedure would be very complicated:
1. Use some form of monkey patching to modify the `method_invocation` and `visit_expr` functions.
2. Override `get_cond` and `visit_switch_node` methods in a way that ensures the new versions of `method_invocation` and `visit_expr` are called.
If `method_invocation` is a method inside `JSONWriter`, the procedure is much simpler - the developer only needs to override `method_invocation`.
* Convert `expression_stmt` into a static method
This commit is part of a series of changes that convert functions in `androguard.decompiler.dast` into instance or static methods.
With the previous version of the code it was difficult to alter the functionality of the `JSONWriter` class.
For some methods in `JSONWriter`, expanding the behaviour would require re-implementing entire code blocks or using monkey patching.
Example:
In the original version of the code the `dast` module contains a function called `method_invocation`. It is used in another function called `visit_expr`. `visit_expr` is called by `JSONWriter` in `get_cond` and `visit_switch_node` instance methods.
If a developer wanted to add extra logic for cases when `JSONWriter` detects a method invocation (e.g. to dynamically log callers), the procedure would be very complicated:
1. Use some form of monkey patching to modify the `method_invocation` and `visit_expr` functions.
2. Override `get_cond` and `visit_switch_node` methods in a way that ensures the new versions of `method_invocation` and `visit_expr` are called.
If `method_invocation` is a method inside `JSONWriter`, the procedure is much simpler - the developer only needs to override `method_invocation`.
* Convert `dummy` into a static method
This commit is part of a series of changes that convert functions in `androguard.decompiler.dast` into instance or static methods.
With the previous version of the code it was difficult to alter the functionality of the `JSONWriter` class.
For some methods in `JSONWriter`, expanding the behaviour would require re-implementing entire code blocks or using monkey patching.
Example:
In the original version of the code the `dast` module contains a function called `method_invocation`. It is used in another function called `visit_expr`. `visit_expr` is called by `JSONWriter` in `get_cond` and `visit_switch_node` instance methods.
If a developer wanted to add extra logic for cases when `JSONWriter` detects a method invocation (e.g. to dynamically log callers), the procedure would be very complicated:
1. Use some form of monkey patching to modify the `method_invocation` and `visit_expr` functions.
2. Override `get_cond` and `visit_switch_node` methods in a way that ensures the new versions of `method_invocation` and `visit_expr` are called.
If `method_invocation` is a method inside `JSONWriter`, the procedure is much simpler - the developer only needs to override `method_invocation`.
* Convert `var_decl` into a static method
This commit is part of a series of changes that convert functions in `androguard.decompiler.dast` into instance or static methods.
With the previous version of the code it was difficult to alter the functionality of the `JSONWriter` class.
For some methods in `JSONWriter`, expanding the behaviour would require re-implementing entire code blocks or using monkey patching.
Example:
In the original version of the code the `dast` module contains a function called `method_invocation`. It is used in another function called `visit_expr`. `visit_expr` is called by `JSONWriter` in `get_cond` and `visit_switch_node` instance methods.
If a developer wanted to add extra logic for cases when `JSONWriter` detects a method invocation (e.g. to dynamically log callers), the procedure would be very complicated:
1. Use some form of monkey patching to modify the `method_invocation` and `visit_expr` functions.
2. Override `get_cond` and `visit_switch_node` methods in a way that ensures the new versions of `method_invocation` and `visit_expr` are called.
If `method_invocation` is a method inside `JSONWriter`, the procedure is much simpler - the developer only needs to override `method_invocation`.
* Convert `unary_postfix` into a static method
This commit is part of a series of changes that convert functions in `androguard.decompiler.dast` into instance or static methods.
With the previous version of the code it was difficult to alter the functionality of the `JSONWriter` class.
For some methods in `JSONWriter`, expanding the behaviour would require re-implementing entire code blocks or using monkey patching.
Example:
In the original version of the code the `dast` module contains a function called `method_invocation`. It is used in another function called `visit_expr`. `visit_expr` is called by `JSONWriter` in `get_cond` and `visit_switch_node` instance methods.
If a developer wanted to add extra logic for cases when `JSONWriter` detects a method invocation (e.g. to dynamically log callers), the procedure would be very complicated:
1. Use some form of monkey patching to modify the `method_invocation` and `visit_expr` functions.
2. Override `get_cond` and `visit_switch_node` methods in a way that ensures the new versions of `method_invocation` and `visit_expr` are called.
If `method_invocation` is a method inside `JSONWriter`, the procedure is much simpler - the developer only needs to override `method_invocation`.
* Convert `unary_prefix` into a static method
This commit is part of a series of changes that convert functions in `androguard.decompiler.dast` into instance or static methods.
With the previous version of the code it was difficult to alter the functionality of the `JSONWriter` class.
For some methods in `JSONWriter`, expanding the behaviour would require re-implementing entire code blocks or using monkey patching.
Example:
In the original version of the code the `dast` module contains a function called `method_invocation`. It is used in another function called `visit_expr`. `visit_expr` is called by `JSONWriter` in `get_cond` and `visit_switch_node` instance methods.
If a developer wanted to add extra logic for cases when `JSONWriter` detects a method invocation (e.g. to dynamically log callers), the procedure would be very complicated:
1. Use some form of monkey patching to modify the `method_invocation` and `visit_expr` functions.
2. Override `get_cond` and `visit_switch_node` methods in a way that ensures the new versions of `method_invocation` and `visit_expr` are called.
If `method_invocation` is a method inside `JSONWriter`, the procedure is much simpler - the developer only needs to override `method_invocation`.
* Convert `typen` into a static method
This commit is part of a series of changes that convert functions in `androguard.decompiler.dast` into instance or static methods.
With the previous version of the code it was difficult to alter the functionality of the `JSONWriter` class.
For some methods in `JSONWriter`, expanding the behaviour would require re-implementing entire code blocks or using monkey patching.
Example:
In the original version of the code the `dast` module contains a function called `method_invocation`. It is used in another function called `visit_expr`. `visit_expr` is called by `JSONWriter` in `get_cond` and `visit_switch_node` instance methods.
If a developer wanted to add extra logic for cases when `JSONWriter` detects a method invocation (e.g. to dynamically log callers), the procedure would be very complicated:
1. Use some form of monkey patching to modify the `method_invocation` and `visit_expr` functions.
2. Override `get_cond` and `visit_switch_node` methods in a way that ensures the new versions of `method_invocation` and `visit_expr` are called.
If `method_invocation` is a method inside `JSONWriter`, the procedure is much simpler - the developer only needs to override `method_invocation`.
* Convert `parenthesis` into a static method
This commit is part of a series of changes that convert functions in `androguard.decompiler.dast` into instance or static methods.
With the previous version of the code it was difficult to alter the functionality of the `JSONWriter` class.
For some methods in `JSONWriter`, expanding the behaviour would require re-implementing entire code blocks or using monkey patching.
Example:
In the original version of the code the `dast` module contains a function called `method_invocation`. It is used in another function called `visit_expr`. `visit_expr` is called by `JSONWriter` in `get_cond` and `visit_switch_node` instance methods.
If a developer wanted to add extra logic for cases when `JSONWriter` detects a method invocation (e.g. to dynamically log callers), the procedure would be very complicated:
1. Use some form of monkey patching to modify the `method_invocation` and `visit_expr` functions.
2. Override `get_cond` and `visit_switch_node` methods in a way that ensures the new versions of `method_invocation` and `visit_expr` are called.
If `method_invocation` is a method inside `JSONWriter`, the procedure is much simpler - the developer only needs to override `method_invocation`.
* Convert `method_invocation` into a static method
This commit is part of a series of changes that convert functions in `androguard.decompiler.dast` into instance or static methods.
With the previous version of the code it was difficult to alter the functionality of the `JSONWriter` class.
For some methods in `JSONWriter`, expanding the behaviour would require re-implementing entire code blocks or using monkey patching.
Example:
In the original version of the code the `dast` module contains a function called `method_invocation`. It is used in another function called `visit_expr`. `visit_expr` is called by `JSONWriter` in `get_cond` and `visit_switch_node` instance methods.
If a developer wanted to add extra logic for cases when `JSONWriter` detects a method invocation (e.g. to dynamically log callers), the procedure would be very complicated:
1. Use some form of monkey patching to modify the `method_invocation` and `visit_expr` functions.
2. Override `get_cond` and `visit_switch_node` methods in a way that ensures the new versions of `method_invocation` and `visit_expr` are called.
If `method_invocation` is a method inside `JSONWriter`, the procedure is much simpler - the developer only needs to override `method_invocation`.
* Convert `local` into a static method
This commit is part of a series of changes that convert functions in `androguard.decompiler.dast` into instance or static methods.
With the previous version of the code it was difficult to alter the functionality of the `JSONWriter` class.
For some methods in `JSONWriter`, expanding the behaviour would require re-implementing entire code blocks or using monkey patching.
Example:
In the original version of the code the `dast` module contains a function called `method_invocation`. It is used in another function called `visit_expr`. `visit_expr` is called by `JSONWriter` in `get_cond` and `visit_switch_node` instance methods.
If a developer wanted to add extra logic for cases when `JSONWriter` detects a method invocation (e.g. to dynamically log callers), the procedure would be very complicated:
1. Use some form of monkey patching to modify the `method_invocation` and `visit_expr` functions.
2. Override `get_cond` and `visit_switch_node` methods in a way that ensures the new versions of `method_invocation` and `visit_expr` are called.
If `method_invocation` is a method inside `JSONWriter`, the procedure is much simpler - the developer only needs to override `method_invocation`.
* Convert `literal` into a static method
This commit is part of a series of changes that convert functions in `androguard.decompiler.dast` into instance or static methods.
With the previous version of the code it was difficult to alter the functionality of the `JSONWriter` class.
For some methods in `JSONWriter`, expanding the behaviour would require re-implementing entire code blocks or using monkey patching.
Example:
In the original version of the code the `dast` module contains a function called `method_invocation`. It is used in another function called `visit_expr`. `visit_expr` is called by `JSONWriter` in `get_cond` and `visit_switch_node` instance methods.
If a developer wanted to add extra logic for cases when `JSONWriter` detects a method invocation (e.g. to dynamically log callers), the procedure would be very complicated:
1. Use some form of monkey patching to modify the `method_invocation` and `visit_expr` functions.
2. Override `get_cond` and `visit_switch_node` methods in a way that ensures the new versions of `method_invocation` and `visit_expr` are called.
If `method_invocation` is a method inside `JSONWriter`, the procedure is much simpler - the developer only needs to override `method_invocation`.
* Convert `field_access` into a static method
This commit is part of a series of changes that convert functions in `androguard.decompiler.dast` into instance or static methods.
With the previous version of the code it was difficult to alter the functionality of the `JSONWriter` class.
For some methods in `JSONWriter`, expanding the behaviour would require re-implementing entire code blocks or using monkey patching.
Example:
In the original version of the code the `dast` module contains a function called `method_invocation`. It is used in another function called `visit_expr`. `visit_expr` is called by `JSONWriter` in `get_cond` and `visit_switch_node` instance methods.
If a developer wanted to add extra logic for cases when `JSONWriter` detects a method invocation (e.g. to dynamically log callers), the procedure would be very complicated:
1. Use some form of monkey patching to modify the `method_invocation` and `visit_expr` functions.
2. Override `get_cond` and `visit_switch_node` methods in a way that ensures the new versions of `method_invocation` and `visit_expr` are called.
If `method_invocation` is a method inside `JSONWriter`, the procedure is much simpler - the developer only needs to override `method_invocation`.
* Convert `cast` into a static method
This commit is part of a series of changes that convert functions in `androguard.decompiler.dast` into instance or static methods.
With the previous version of the code it was difficult to alter the functionality of the `JSONWriter` class.
For some methods in `JSONWriter`, expanding the behaviour would require re-implementing entire code blocks or using monkey patching.
Example:
In the original version of the code the `dast` module contains a function called `method_invocation`. It is used in another function called `visit_expr`. `visit_expr` is called by `JSONWriter` in `get_cond` and `visit_switch_node` instance methods.
If a developer wanted to add extra logic for cases when `JSONWriter` detects a method invocation (e.g. to dynamically log callers), the procedure would be very complicated:
1. Use some form of monkey patching to modify the `method_invocation` and `visit_expr` functions.
2. Override `get_cond` and `visit_switch_node` methods in a way that ensures the new versions of `method_invocation` and `visit_expr` are called.
If `method_invocation` is a method inside `JSONWriter`, the procedure is much simpler - the developer only needs to override `method_invocation`.
* Convert `binary_infix` into a static method
This commit is part of a series of changes that convert functions in `androguard.decompiler.dast` into instance or static methods.
With the previous version of the code it was difficult to alter the functionality of the `JSONWriter` class.
For some methods in `JSONWriter`, expanding the behaviour would require re-implementing entire code blocks or using monkey patching.
Example:
In the original version of the code the `dast` module contains a function called `method_invocation`. It is used in another function called `visit_expr`. `visit_expr` is called by `JSONWriter` in `get_cond` and `visit_switch_node` instance methods.
If a developer wanted to add extra logic for cases when `JSONWriter` detects a method invocation (e.g. to dynamically log callers), the procedure would be very complicated:
1. Use some form of monkey patching to modify the `method_invocation` and `visit_expr` functions.
2. Override `get_cond` and `visit_switch_node` methods in a way that ensures the new versions of `method_invocation` and `visit_expr` are called.
If `method_invocation` is a method inside `JSONWriter`, the procedure is much simpler - the developer only needs to override `method_invocation`.
* Convert `assignment` into a static method
This commit is part of a series of changes that convert functions in `androguard.decompiler.dast` into instance or static methods.
With the previous version of the code it was difficult to alter the functionality of the `JSONWriter` class.
For some methods in `JSONWriter`, expanding the behaviour would require re-implementing entire code blocks or using monkey patching.
Example:
In the original version of the code the `dast` module contains a function called `method_invocation`. It is used in another function called `visit_expr`. `visit_expr` is called by `JSONWriter` in `get_cond` and `visit_switch_node` instance methods.
If a developer wanted to add extra logic for cases when `JSONWriter` detects a method invocation (e.g. to dynamically log callers), the procedure would be very complicated:
1. Use some form of monkey patching to modify the `method_invocation` and `visit_expr` functions.
2. Override `get_cond` and `visit_switch_node` methods in a way that ensures the new versions of `method_invocation` and `visit_expr` are called.
If `method_invocation` is a method inside `JSONWriter`, the procedure is much simpler - the developer only needs to override `method_invocation`.
* Convert `array_initializer` into a static method
This commit is part of a series of changes that convert functions in `androguard.decompiler.dast` into instance or static methods.
With the previous version of the code it was difficult to alter the functionality of the `JSONWriter` class.
For some methods in `JSONWriter`, expanding the behaviour would require re-implementing entire code blocks or using monkey patching.
Example:
In the original version of the code the `dast` module contains a function called `method_invocation`. It is used in another function called `visit_expr`. `visit_expr` is called by `JSONWriter` in `get_cond` and `visit_switch_node` instance methods.
If a developer wanted to add extra logic for cases when `JSONWriter` detects a method invocation (e.g. to dynamically log callers), the procedure would be very complicated:
1. Use some form of monkey patching to modify the `method_invocation` and `visit_expr` functions.
2. Override `get_cond` and `visit_switch_node` methods in a way that ensures the new versions of `method_invocation` and `visit_expr` are called.
If `method_invocation` is a method inside `JSONWriter`, the procedure is much simpler - the developer only needs to override `method_invocation`.
* Convert `array_creation` into a static method
This commit is part of a series of changes that convert functions in `androguard.decompiler.dast` into instance or static methods.
With the previous version of the code it was difficult to alter the functionality of the `JSONWriter` class.
For some methods in `JSONWriter`, expanding the behaviour would require re-implementing entire code blocks or using monkey patching.
Example:
In the original version of the code the `dast` module contains a function called `method_invocation`. It is used in another function called `visit_expr`. `visit_expr` is called by `JSONWriter` in `get_cond` and `visit_switch_node` instance methods.
If a developer wanted to add extra logic for cases when `JSONWriter` detects a method invocation (e.g. to dynamically log callers), the procedure would be very complicated:
1. Use some form of monkey patching to modify the `method_invocation` and `visit_expr` functions.
2. Override `get_cond` and `visit_switch_node` methods in a way that ensures the new versions of `method_invocation` and `visit_expr` are called.
If `method_invocation` is a method inside `JSONWriter`, the procedure is much simpler - the developer only needs to override `method_invocation`.
* Convert `array_access` into a static method
This commit is part of a series of changes that convert functions in `androguard.decompiler.dast` into instance or static methods.
With the previous version of the code it was difficult to alter the functionality of the `JSONWriter` class.
For some methods in `JSONWriter`, expanding the behaviour would require re-implementing entire code blocks or using monkey patching.
Example:
In the original version of the code the `dast` module contains a function called `method_invocation`. It is used in another function called `visit_expr`. `visit_expr` is called by `JSONWriter` in `get_cond` and `visit_switch_node` instance methods.
If a developer wanted to add extra logic for cases when `JSONWriter` detects a method invocation (e.g. to dynamically log callers), the procedure would be very complicated:
1. Use some form of monkey patching to modify the `method_invocation` and `visit_expr` functions.
2. Override `get_cond` and `visit_switch_node` methods in a way that ensures the new versions of `method_invocation` and `visit_expr` are called.
If `method_invocation` is a method inside `JSONWriter`, the procedure is much simpler - the developer only needs to override `method_invocation`.