Skip to content

Commit

Permalink
Updated comments on riseupvpn test
Browse files Browse the repository at this point in the history
  • Loading branch information
aanorbel committed Nov 29, 2023
1 parent 1a751d4 commit 8155de5
Showing 1 changed file with 15 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,30 +17,38 @@
import org.openobservatory.ooniprobe.model.jsonresult.JsonResult;
import org.openobservatory.ooniprobe.model.settings.Settings;

@Deprecated
/**
* Represents the RiseupVPN test.
*
* @deprecated This test has been demoted to experimental in <a href="https://github.com/ooni/probe-android/pull/632">Chore: Moved riseup vpn to experimental suite and correct tests</a>.
* This test has been moved to experimental because it causes too many false positive.
*/
public class RiseupVPN extends AbstractTest {
public static final String NAME = "riseupvpn";

public RiseupVPN() {
// NOTE: this test has been demoted to experimental and such the icon resource `R.drawable.test_riseupvpn` is not displayed anymore.
// NOTE: this test has been demoted to experimental (see https://github.com/ooni/probe-android/pull/632)
// and such the icon resource `R.drawable.test_riseupvpn` is not displayed anymore.
super(NAME, R.string.Test_Experimental_Fullname, 0, R.string.urlTestRvpn, 15);
}

@Override public void run(Context c, PreferenceManager pm, AppLogger logger, Gson gson, Result result, int index, AbstractTest.TestCallback testCallback) {
@Override
public void run(Context c, PreferenceManager pm, AppLogger logger, Gson gson, Result result, int index, AbstractTest.TestCallback testCallback) {
Settings settings = new Settings(c, pm, isAutoRun());
run(c, pm,logger, gson, settings, result, index, testCallback);
run(c, pm, logger, gson, settings, result, index, testCallback);
}

@Override public void onEntry(Context c, PreferenceManager pm, @NonNull JsonResult json, Measurement measurement) {
@Override
public void onEntry(Context c, PreferenceManager pm, @NonNull JsonResult json, Measurement measurement) {
super.onEntry(c, pm, json, measurement);
//When json.test_keys.transport_status is null the test is failed so the result of is_anomaly doesn't matter.
if (json.test_keys == null || json.test_keys.transport_status == null) {
measurement.is_failed = true;
return;
}
boolean isTransportBlocked = false;
isTransportBlocked = MapUtility.getOrDefaultCompat(json.test_keys.transport_status, "openvpn", "ok").equals(BLOCKED) ||
MapUtility.getOrDefaultCompat(json.test_keys.transport_status, "obfs4", "ok").equals(BLOCKED);
isTransportBlocked = MapUtility.getOrDefaultCompat(json.test_keys.transport_status, "openvpn", "ok").equals(BLOCKED) ||
MapUtility.getOrDefaultCompat(json.test_keys.transport_status, "obfs4", "ok").equals(BLOCKED);
measurement.is_anomaly = !json.test_keys.ca_cert_status || json.test_keys.api_failure != null || isTransportBlocked;
}

Expand Down

0 comments on commit 8155de5

Please sign in to comment.