By default there is a setting for using your device as a snowflake that's enabled called "Snowflake Proxy Limits". It reads "Only when device is plugged in and on wifi".
There are several things wrong with this appraoch:
Firstly isChargingAndWifi(Context) is called just when tor starts. If you lose power or lose wifi over night Orbot will continue to be a Snowflake proxy. While you're less likely to suddenly lose power, people with limited data plans could get hurt here if their wifi goes out... OrbotService needs to listen for events and turn off Snowflake if the user has this set
This method doesn't actually check if the device is on WiFi. Limited cellular data plans can appear as unmetered. Users can be hurt here since they would assume Snowflake would not be running.
WiFi networks can be metered so there are scenarios where the user is on WiFi and plugged in but Snowflake won't start. There are probably other scenarios where Android treats a WiFi network as "metered", but one is that Access Points can apparently hint to their clients that their connection is metered. Basically if the "Vendor Info" of a DHCP lease (code 43) contains the text "ANDROID_METERED" the system will treat the wifi connection as metered. Android does this with mobile hotspots.
What probably needs to happen:
The limiting feature should check to see if the device is plugged in, if the device is actually on wifi, and ensure that the wifi connection is unmetered
If any of these things go away Snowflake should definitely stop.
If these things return should snowflake start back up???
By default there is a setting for using your device as a snowflake that's enabled called "Snowflake Proxy Limits". It reads "Only when device is plugged in and on wifi".
In
OrbotService
:There are several things wrong with this appraoch:
isChargingAndWifi(Context)
is called just when tor starts. If you lose power or lose wifi over night Orbot will continue to be a Snowflake proxy. While you're less likely to suddenly lose power, people with limited data plans could get hurt here if their wifi goes out...OrbotService
needs to listen for events and turn off Snowflake if the user has this set"ANDROID_METERED"
the system will treat the wifi connection as metered. Android does this with mobile hotspots.What probably needs to happen: