-
Notifications
You must be signed in to change notification settings - Fork 5
Variables
Variables can be used while defining <run>, <result> or <path> sub-elements of a <tool> element inside configuration files. They will be replaced with their actual values once these values are available and requested.
Which variables can be used can be seen by the lists contained in the respective TaskInfo classes:
| Context |
TaskInfo class |
|---|---|
| Always available | TaskInfo.java |
| Preprocessors | PreprocessorTaskInfo.java |
| - Analysis tools | ToolTaskInfo.java |
| - Converters | ConverterTaskInfo.java |
| Operators | OperatorTaskInfo.java |
| - Filter-Operators | FilterOperatorTaskInfo.java |
The list of available variables can be extended by WITH definitions inside AQL-Questions. For example, if the question Flows IN App('A.apk') WITH 'SourcesAndSinks' = 'SourcesAndSinks.txt' ? is asked, the variable %SourcesAndSinks% becomes available. It will be replaced with SourcesAndSinks.txt once the content of a tag using it is resolved.
Variables can have arbitrary names, however, if they follow the naming convention %FILE_*% they will be treated as files. Variables will also be treated as files if they reference an existing file and their value has the following format: x.y (where x, y only include Aa0-Zz9, but x may also hold path separators as well as - or _ and y must have a length of 1-5). By default variables are treated like strings.
If two tools have the same priority to answer a question, the following is done to break the tie:
- Internal tools are preferred over external tools
- If one of two internal tools uses more variables (denotes more in its
<run>-tag) than this one is selected.- On another tie, the one which requires less custom variables is selected.
- Again on another tie, the one that uses more default variables is selected.
- In any other case the first (mentioned earlier in the respective configuration file) tool is selected.