forked from SeattleTestbed/repy_v2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
For the sensors that I currenlty mark as "bad", I see a RunBuiltinException in my vessel log.
- Loading branch information
1 parent
e945ca6
commit 8f354ac
Showing
1 changed file
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
list_of_noargs_sensor_calls = [ | ||
get_bluetooth_info, | ||
get_bluetooth_scan_info, | ||
is_wifi_enabled, | ||
get_wifi_state, | ||
get_wifi_connection_info, | ||
get_wifi_scan_info, | ||
get_network_info, | ||
get_cellular_provider_info, | ||
get_cell_info, get_sim_info, | ||
get_phone_info, get_mode_settings, | ||
get_display_info, | ||
get_volume_info, | ||
get_battery_info, | ||
get_sensor_list, | ||
get_acceleration, | ||
get_ambient_temperature, | ||
get_game_rotation_vector, | ||
get_geomagnetic_rotation_vector, | ||
get_gravity, | ||
get_gyroscope, | ||
get_gyroscope_uncalibrated, | ||
get_heart_rate, | ||
get_light, | ||
get_linear_acceleration, | ||
get_magnetic_field, | ||
get_magnetic_field_uncalibrated, | ||
get_pressure, | ||
get_proximity, | ||
get_relative_humidity, | ||
get_rotation_vector, | ||
get_step_counter, | ||
is_media_playing, | ||
is_tts_speaking, | ||
get_location, | ||
get_lastknown_location, | ||
] | ||
|
||
# On my Nexus 6 with Android 7.1.1, these sensors currently fail: | ||
# get_wifi_connection_info, get_network_info, get_cell_info, | ||
# get_sensor_list, get_lastknown_location | ||
bad_sensor_indices = [4, 6, 8, 15, 36] | ||
|
||
for sensor_number in range(len(list_of_noargs_sensor_calls)): | ||
if sensor_number in bad_sensor_indices: | ||
continue | ||
sensor_call_void = list_of_noargs_sensor_calls[sensor_number] | ||
log(getruntime(), sensor_number) | ||
try: | ||
log(sensor_call_void(), "\n") | ||
except Exception, e: | ||
log("FAILED with exception", repr(e), "\n") | ||
|
8f354ac
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.
After (re-?)applying 93d4e7a, the traceback turns into something actually useful for the "bad" sensor calls.
get_wifi_connection_info
(number 4 in the bad sensors list) fails because my current SSID contains Unicode characters.get_network_info
(number 6) fails for the same reason, although the return value is a list containing an uncopyable Unicode char this time.get_cell_info
(number 8) is far more interesting and points at a bug in our handling / requesting of permissions. (When I switch into the Sensibility app often enough so that I can finally enable the location permission request, things work out smoothly!)get_sensor_list
(number 15) shows a puzzlingget_lastknown_location
(number 36) sometimes blocks to death (see below), and sometimes returnsNone
:8f354ac
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.
These issues are all fixed now!
get_wifi_connection_info
andget_network_info
are scrubbed from Unicode characters, seerepy_v2/repysensors.py
Lines 301 to 303 in 7350a00
get_cell_info
is fixed as per Handlingjava.lang.SecurityException
s from sensors #4.get_sensor_list
is fixed as per Sanitize Java sensor readings before JSONifying them #6.get_lastknown_location
wasn't really the culprit; the sandbox shutting down by itself and the monitor trying to kill it at around the same time caused the fuzz, as the sandbox'sprocfs
entry might have disappeared already. See ce553c4.