Skip to content
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

Snowflake Proxy Limiting is Misleading/Doesn't Work #548

Open
bitmold opened this issue Dec 10, 2021 · 1 comment
Open

Snowflake Proxy Limiting is Misleading/Doesn't Work #548

bitmold opened this issue Dec 10, 2021 · 1 comment

Comments

@bitmold
Copy link
Collaborator

bitmold commented Dec 10, 2021

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:

  public static boolean isChargingAndWifi(Context context) {
        Intent intent = context.registerReceiver(null, new IntentFilter(Intent.ACTION_BATTERY_CHANGED));
        int plugged = intent.getIntExtra(BatteryManager.EXTRA_PLUGGED, -1);
        boolean isCharging = plugged == BatteryManager.BATTERY_PLUGGED_AC || plugged == BatteryManager.BATTERY_PLUGGED_USB || plugged == BatteryManager.BATTERY_PLUGGED_WIRELESS;

        ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);

        boolean isUnmetered = cm.getActiveNetworkInfo() != null
                && cm.getActiveNetworkInfo().isConnected()
                && (!cm.isActiveNetworkMetered());

        return isCharging && isUnmetered;
    }

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???
@bitmold
Copy link
Collaborator Author

bitmold commented Dec 17, 2021

For the upcoming release this limiting feature is disabled ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant