## 3 Chidroid Architecture
### Android Permission Retrieval
*)']
3 Field=\"_raw\"
4
5[sourcetypes.logcat]#Define the Time Format of the logs
6 Format=\"METAO\"
7 TimeFormat=\"MMDD hh:mm:ss.SSS\"
8 TimeField=\"timestamp\"
9 TimeZone=\"Europe/Lisbon\"
```
Listing 8: Configuration of the regular expressions and source types. The \"[sourcetypes.logcat]\" configuration stanza (Listing 8) creates a new SourceType named \"logcat\". The SourceType contains a set of properties that hint at how logs should be parsed, of particular importance for detecting and extracting correct timestamps for each entry. The timezone, timestamp format, and other configuration details are also defined. ### Performance Assessment and Compatibility

Chidroid allows the usage of multiple pipelines and sends data in multiple outputs with one execution. Chidroid is compatible with Android smartphones running Version 8.0 or later and has been designed to have minimal impact on system resources. It was assessed through empirical analysis that the system under consideration exhibits a memory footprint of approximately 62 MB in terms of RAM consumption while displaying low CPUutilisation of approximately 1% on an Octa-core architecture comprised of 1 \(\times\) 2.84 GHz Cortex-X1, 3 \(\times\) 2.42 GHz Cortex-A78, and 4\(\times\)1.80 GHz Cortex-A55 processors. The values in the outputs (Listing 9) represent the mean CPU and RAM usage of the Android process. The date and time of the results of the assessment are included in each output, along with the mean CPU usage and mean RAM usage in percentage. These metrics give information on the resource utilisation of the process at a specific moment. **Listing 9:** Example structure of TOML files. ```
1#OutputfromthelowerCPUusageduringtheassessment{\"date\":\"2023-02-11_18-59-45\",\"mean_cpu_usage\":3%,\"mean_ram_usage\":1.8%}
3#OutputfromthemeanCPUusageduringtheassessment{\"date\":\"2023-02-11_19-20-01\",\"mean_cpu_usage\":6.2%,\"mean_ram_usage\":1.6%}
5#OutputfromthehigherCPUusageduringtheassessment{\"date\":\"2023-02-11_18-48-44\",\"mean_cpu_usage\":10.3%,\"mean_ram_usage\":1.8%}
```
**Listing 10:** Explanation of the Logcat default structure. In this section, a collection of sample log files is presented that was retrieved from various Android devices. These logs serve as exemplars of the Chidroid execution process and demonstrate the data types that can be obtained through this methodology. The log files can be extracted from Android devices and transmitted to the edge server for further analysis. Through the utilisation of regular expression matching, the data contained within the logs can be transformed into a structured format, enabling the ease of monitoring. Additionally, the data can be exported in a variety of formats, including JSON and CSV, for further analysis and manipulation. ### Logcat Example

The following snippet presents an example output using Logcat. These logs contain different events, including system events, application events, and debugging messages. They can be useful for detecting security issues such as unauthorised access attempts or abnormal application behaviour. The default Logcat structure is explained below (Listing 10). ```
1[08-01-202210:15:23][DEBUG][MyApp][MainActivity]:Startingactivity:Intent{cmp=com.texample.myapp/.MainActivity}
2[08-01-202210:15:24][INFO][MyApp][MainActivity]:Successfullyconnectedtotadabase
3[08-01-202210:15:29][WARNING][MyApp][MainActivity]:Invalidinputdetected
4[08-01-202210:15:32][ERROR][MyApp][MainActivity]:Failedtotretrievedatafromserver
```
**Listing 10:** Explanation of the Logcat default structure. In the sample Logcat output, there are four log messages (DEBUG, INFO, WARNING, ERROR), each with a different log level. The first log message is a debug message indicating that the application is starting an activity. The second log message is an info log message, indicating that the application has successfully connected to a database. The third log message is a warning message indicating that the application has received invalid user input.