## 3 Chidroid Architecture
### AppOpsManager and Privilege Extraction
As an illustration, the \"time\" value for the \"READ_CLIPBOARD\" permission reveals that the user authorisation was granted 38 days, 16 h, 15 min, 20 s, and 598 ms prior to the current time. Conversely, the \"duration\" value for the \"START_FOREGROUND\" permission demonstrates that the application has been in possession of the permission for a period of 40 s and 7 ms. In conclusion, these values furnish insight into the manner in which applications obtain the permissions granted by the user. The \"Uid mode\" values for each permission indicate how the application will handle the permission. For example, the \"ignore\" value for the \"ACCESS_MEDIA_LOCATION\" permission indicates that the application will not use the permission, even if it is granted by the user. The \"default\" value for the \"MANAGE_EXTERNAL_STORAGE\" permission indicates that the application will use the default system behaviour for permission, which may be to ask the user for permission when the application attempts to access the protected data or resource. ### System Metrics

System or device metrics (Listing 18) are essential for monitoring the performance and general status of an Android device. These metrics can provide valuable information about various aspects of the device's hardware, software, and network configuration, which can be useful for troubleshooting issues, identifying trends, and optimising performance. ```
1202-11-2815:19:00@date:11/28/2022 CoreID:0 Cores:1 Flags:fpasimdevttstrmaespmull\(\leftrightarrow\)sha1 sha2 crc32 MHz:1872 Model:0 xd03 Stepping:4 VendorID:ARMmetric:cpuinfo
2202-11-2815:19:00@date:11/28/2022 CPU:1 CoreID:1 Cores:1 Flags:fpasimdevttstrmaes\(\leftrightarrow\)pmulshshshzarc32 Mhz:1872 Model:0 xd03 Stepping:4 VendorID:ARMmetric:cpuinfo
2202-11-2815:19:00@date:11/28/2022 CPU:2 CoreID:1 Flags:fpasimdevttstrmaes\(\leftrightarrow\)pmulshshshzarc32 Mhz:1872 Model:0 xd03 Stepping:4 VendorID:ARMmetric:cpuinfo
22022-11-2815:19:00@date:11/28/2022 CPU:3 CoreID:3 Cores:1 Flags:fpasimdevttstrmaes\(\leftrightarrow\)pmulshshshzarc32 Mhz:1872 Model:0 xd03 Stepping:4 VendorID:ARMmetric:cpuinfo
2202-11-2815:19:00@date:11/28/2022 evalable:1526226944 free:133947392 metric:\(\leftrightarrow\)virtualmemtotal:2952015872 used:1327394816
26202-11-2815:19:00@date:11/28/2022 load1:478955078125 load15:0.2024609375 load5:4.78125\(\leftrightarrow\)metric:loadavg
27202-11-2815:19:00@date:11/28/2022 bytesBecw:288737228 bytesSent:11125292 metric:netname\(\leftrightarrow\):valmapcetsRecv:234757 packetsSent:81621
28202-11-2815:19:00@date:11/28/2022 bytesBecw:176 bytesSent:176 metric:netname:\(\leftrightarrow\)topacketsRecv:2 packetsSent:2
29202-11-2815:19:00@date:11/28/2022 metric:netname:rmnet2
30202-11-2815:19:00@date:11/28/2022 dst_ip:213.63.130.243 dst_port:443 family:2 fd:75\(\leftrightarrow\)metric:connectionspid:21859 src_ip:192.168.1.88 src_port:48582 status:SYN_SENTtype:1
```

Listing 18: Example output of the system metrics retrieved from Android. The log messages (Listing 18) provide information about the device's CPU, including the core ID, the number of cores, the CPU flags, the CPU speed, and the CPU vendor ID (Lines 1 to 5 in Listing 18). Other log messages provide information about the device's memory usage, load average (Line 6), network traffic (Line 7), and network connections (Line 10). For example, one of the log messages indicates that the device has four CPU cores, each with a speed of 1872 MHz. The log message also indicates that the CPU supports various instruction sets, and details regarding the CPU (ARMv8-A) are provided. Other log messages provide information about the device's memory usage, including the total amount of memory, free memory, and used memory. The log message indicates that the device has 2.952.015.872 bytes of memory, with 1.327.394.816 bytes currently in use. Finally, the log messages provide information about the device's network connections, including the source and destination IP addresses, the port numbers, the protocol family, and the connection status.