-
Notifications
You must be signed in to change notification settings - Fork 0
Release v0.3 (squashed) #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
DescriptionThis PR updates BLaDE to version 0.3, introducing significant improvements for performance evaluation of mobile devices. Key changes include support for Parquet output format for better performance with large datasets, data downsampling capabilities through granularity control, removal of deprecated TLS versions, better error handling, and improvements to device power management. The update also includes comprehensive documentation updates and code refactoring to use context-based constants. Possible Issues
Security Hotspots
Privacy Hotspots
ChangesChangesCHANGELOG.md & README.md
src/setup/setup.sh & src/setup/README.md
src/tools/libs/constants.py
src/tools/libs/monsoonlib.py
src/tools/libs/automation/adb_commands.py
src/tools/control-monsoon.py
src/tools/libs/gpiolib.py
src/tools/pageload-inject.py & pageload-server.py
sequenceDiagram
participant User
participant ControlDevice
participant DeviceLib
participant MonsoonLib
participant USBLib
participant ADBLib
User->>ControlDevice: Start measurement with granularity
ControlDevice->>DeviceLib: start_measuring(device, path, granularity)
DeviceLib->>USBLib: Disable USB for measurement
DeviceLib->>ADBLib: Enable ADB over WiFi (Android)
DeviceLib->>MonsoonLib: collect_measurements(file, format, granularity)
loop Data Collection
MonsoonLib->>MonsoonLib: Collect samples batch
alt Format is CSV
MonsoonLib->>MonsoonLib: Write directly to CSV
else Format is Parquet
MonsoonLib->>MonsoonLib: Buffer samples
alt Buffer full
MonsoonLib->>MonsoonLib: Flush to Parquet file
end
end
end
User->>ControlDevice: Stop measurement
ControlDevice->>DeviceLib: stop_measuring(device)
DeviceLib->>MonsoonLib: Stop collection & cleanup
DeviceLib->>USBLib: Re-enable USB
DeviceLib->>ADBLib: Disable ADB over WiFi
|
| def get_device_adb_connection_state(device, port=constants.ADB_OVER_WIFI_DEFAULT_PORT): | ||
|
|
||
| # list adb devices and check if given device is listed (either identifier or ip:port) | ||
| output = os.popen("adb devices").read() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
[semgrep] Starting a process with a shell; seems safe, but may be changed in the future, consider
rewriting without shell
Source: https://semgrep.dev/r/gitlab.bandit.B605
Cc @thypon @kdenhartog
| def get_device_adb_connection_state(device, port=constants.ADB_OVER_WIFI_DEFAULT_PORT): | ||
|
|
||
| # list adb devices and check if given device is listed (either identifier or ip:port) | ||
| output = os.popen("adb devices").read() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
[semgrep] Starting a process with a shell; seems safe, but may be changed in the future, consider
rewriting without shell
Source: https://semgrep.dev/r/gitlab.bandit.B607
Cc @thypon @kdenhartog
| def power_off_device(device, connection): | ||
|
|
||
| adb_identifier = __get_adb_identifier(device, connection) | ||
| os.system(f"adb -s {adb_identifier} reboot -p") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
[semgrep] Starting a process with a shell; seems safe, but may be changed in the future, consider
rewriting without shell
Source: https://semgrep.dev/r/gitlab.bandit.B605
Cc @thypon @kdenhartog
| def reboot_device(device, connection): | ||
|
|
||
| adb_identifier = __get_adb_identifier(device, connection) | ||
| os.system(f"adb -s {adb_identifier} reboot") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
[semgrep] Starting a process with a shell; seems safe, but may be changed in the future, consider
rewriting without shell
Source: https://semgrep.dev/r/gitlab.bandit.B605
Cc @thypon @kdenhartog
| script = os.path.join(__location__, "../bt-connect.py") | ||
| process = subprocess.Popen(["sudo", script, "--device", bt_mac_address]) | ||
| time.sleep(constants.FIVE_SECONDS) | ||
| process = subprocess.Popen(["sudo", script, bt_mac_address]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
[semgrep] Python possesses many mechanisms to invoke an external executable. However,
doing so may present a security issue if appropriate care is not taken to
sanitize any user provided or variable input. This plugin test is part of a
family of tests built to check for process spawning and warn appropriately.
Specifically, this test looks for the spawning of a subprocess without the
use of a command shell. This type of subprocess invocation is not
vulnerable to shell injection attacks, but care should still be taken to
ensure validity of input.
Source: https://semgrep.dev/r/gitlab.bandit.B603
Cc @thypon @kdenhartog
Co-Authored-By: Artem Chaikin <10810135+stoletheminerals@users.noreply.github.com> Co-Authored-By: Ralph Ankele <117092743+ankeleralph@users.noreply.github.com>
--granularityargument.--format parquetargument for improved performance with large datasets.constants.py.