Skip to content

Commit

Permalink
Merge branch 'master' of github.com:ooni/probe-android into issues/2592
Browse files Browse the repository at this point in the history
  • Loading branch information
aanorbel committed Nov 4, 2023
2 parents ef7d7f7 + 7deb8bf commit 3918adb
Show file tree
Hide file tree
Showing 20 changed files with 162 additions and 146 deletions.
6 changes: 3 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ android {
applicationId 'org.openobservatory.ooniprobe'
minSdk libs.versions.minSdk.get().toInteger()
targetSdk libs.versions.targetSdk.get().toInteger()
versionName '3.8.3'
versionCode 102
versionName '3.8.4'
versionCode 106
testInstrumentationRunner "org.openobservatory.ooniprobe.TestAndroidJUnitRunner"
buildConfigField 'String', 'OONI_API_BASE_URL', '"https://api.ooni.io/"'
buildConfigField 'String', 'NOTIFICATION_SERVER', '"https://countly.ooni.io"'
Expand Down Expand Up @@ -126,7 +126,7 @@ dependencies {

implementation libs.xanscale.localhost.toolkit
implementation libs.lottie
implementation libs.markwon
implementation libs.markwon.core
implementation libs.commons.io
//arcview to fragment_dashboard
implementation libs.shapeofview
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import org.openobservatory.ooniprobe.model.database.Network;
import org.openobservatory.ooniprobe.test.suite.PerformanceSuite;
import org.openobservatory.ooniprobe.test.test.*;
import ru.noties.markwon.Markwon;
import io.noties.markwon.Markwon;

import javax.inject.Inject;
import java.io.Serializable;
Expand Down Expand Up @@ -212,7 +212,9 @@ public void onError(String msg) {
binding.log.setVisibility(View.GONE);
if (!measurementsManager.hasReportId(measurement))
binding.explorer.setVisibility(View.GONE);
Markwon.setMarkdown(binding.methodology, getString(R.string.TestResults_Details_Methodology_Paragraph, getString(measurement.getTest().getUrlResId())));
Markwon.builder(this)
.build()
.setMarkdown(binding.methodology, getString(R.string.TestResults_Details_Methodology_Paragraph, getString(measurement.getTest().getUrlResId())));
load();
binding.log.setOnClickListener(v -> logClick());
binding.data.setOnClickListener(v -> dataClick());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ private void loadScreen(String mv, String tn, String ta){
if (versionCompare.compare(version_name, mv) >= 0) {
try {
Attribute attribute = gson.fromJson(ta, Attribute.class);
List<String> urls = (attribute!=null && attribute.urls != null) ? attribute.urls : Collections.emptyList();
List<String> urls = (attribute!=null && attribute.urls != null) ? attribute.urls : null;
AbstractSuite suite = getSuite.get(tn, urls);
if (suite != null) {
loadSuite(suite, urls);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

import javax.inject.Inject;

import ru.noties.markwon.Markwon;
import io.noties.markwon.Markwon;

public class OverviewActivity extends AbstractActivity {
private static final String TEST = "test";
Expand Down Expand Up @@ -54,19 +54,20 @@ public static Intent newIntent(Context context, AbstractSuite testSuite) {
binding.run.setAlpha(0.5F);
binding.run.setEnabled(false);
}
Markwon markwon = Markwon.builder(this).build();
if (testSuite.getName().equals(ExperimentalSuite.NAME)) {
String experimentalLinks =
"\n\n* [STUN Reachability](https://github.com/ooni/spec/blob/master/nettests/ts-025-stun-reachability.md)" +
"\n\n* [DNS Check](https://github.com/ooni/spec/blob/master/nettests/ts-028-dnscheck.md)" +
"\n\n* [ECH Check](https://github.com/ooni/spec/blob/master/nettests/ts-039-echcheck.md)" +
"\n\n* [Tor Snowflake](https://ooni.org/nettest/tor-snowflake/) "+ String.format(" ( %s )",getString(R.string.Settings_TestOptions_LongRunningTest))+
"\n\n* [Vanilla Tor](https://github.com/ooni/spec/blob/master/nettests/ts-016-vanilla-tor.md) " + String.format(" ( %s )",getString(R.string.Settings_TestOptions_LongRunningTest));
Markwon.setMarkdown(binding.desc, getString(testSuite.getDesc1(), experimentalLinks));
markwon.setMarkdown(binding.desc, getString(testSuite.getDesc1(), experimentalLinks));
if (TextUtilsCompat.getLayoutDirectionFromLocale(Locale.getDefault()) == ViewCompat.LAYOUT_DIRECTION_RTL)
binding.desc.setTextDirection(View.TEXT_DIRECTION_RTL);
}
else
Markwon.setMarkdown(binding.desc, getString(testSuite.getDesc1()));
markwon.setMarkdown(binding.desc, getString(testSuite.getDesc1()));
Result lastResult = Result.getLastResult(testSuite.getName());
if (lastResult == null)
binding.lastTime.setText(R.string.Dashboard_Overview_LastRun_Never);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import org.openobservatory.ooniprobe.common.ProxyProtocol;
import org.openobservatory.ooniprobe.common.ProxySettings;
import org.openobservatory.ooniprobe.databinding.ActivityProxyBinding;
import ru.noties.markwon.Markwon;
import io.noties.markwon.Markwon;

import javax.inject.Inject;
import java.net.URISyntaxException;
Expand Down Expand Up @@ -119,7 +119,9 @@ public void onCreate(Bundle savedInstanceState) {
setContentView(binding.getRoot());

// We fill the footer that helps users to understand this settings screen.
Markwon.setMarkdown(binding.proxyFooter, getString(R.string.Settings_Proxy_Footer));
Markwon.builder(this)
.build()
.setMarkdown(binding.proxyFooter, getString(R.string.Settings_Proxy_Footer));

// We read settings and configure the initial view.
loadSettingsAndConfigureInitialView();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
import org.openobservatory.ooniprobe.R;
import org.openobservatory.ooniprobe.databinding.FragmentMeasurementPsiphonBinding;
import org.openobservatory.ooniprobe.model.database.Measurement;
import ru.noties.markwon.Markwon;

import io.noties.markwon.Markwon;

public class PsiphonFragment extends Fragment {
private static final String MEASUREMENT = "measurement";
Expand All @@ -28,7 +29,9 @@ public static PsiphonFragment newInstance(Measurement measurement) {
Measurement measurement = (Measurement) getArguments().getSerializable(MEASUREMENT);
assert measurement != null;
FragmentMeasurementPsiphonBinding binding = FragmentMeasurementPsiphonBinding.inflate(inflater,container,false);
Markwon.setMarkdown(binding.desc,
Markwon.builder(getContext())
.build()
.setMarkdown(binding.desc,
measurement.is_anomaly ?
getString(R.string.TestResults_Details_Circumvention_Psiphon_Blocked_Content_Paragraph) :
getString(R.string.TestResults_Details_Circumvention_Psiphon_Reachable_Content_Paragraph)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
import org.openobservatory.ooniprobe.R;
import org.openobservatory.ooniprobe.databinding.FragmentMeasurementRiseupvpnBinding;
import org.openobservatory.ooniprobe.model.database.Measurement;
import ru.noties.markwon.Markwon;

import io.noties.markwon.Markwon;

public class RiseupVPNFragment extends Fragment {
private static final String MEASUREMENT = "measurement";
Expand All @@ -28,7 +29,9 @@ public static RiseupVPNFragment newInstance(Measurement measurement) {
Measurement measurement = (Measurement) getArguments().getSerializable(MEASUREMENT);
assert measurement != null;
FragmentMeasurementRiseupvpnBinding binding = FragmentMeasurementRiseupvpnBinding.inflate(inflater,container,false);
Markwon.setMarkdown(binding.desc,
Markwon.builder(getContext())
.build()
.setMarkdown(binding.desc,
measurement.is_anomaly ?
getString(R.string.TestResults_Details_Circumvention_RiseupVPN_Blocked_Content_Paragraph) :
getString(R.string.TestResults_Details_Circumvention_RiseupVPN_Reachable_Content_Paragraph)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
import org.openobservatory.ooniprobe.R;
import org.openobservatory.ooniprobe.databinding.FragmentMeasurementTorBinding;
import org.openobservatory.ooniprobe.model.database.Measurement;
import ru.noties.markwon.Markwon;

import io.noties.markwon.Markwon;

public class TorFragment extends Fragment {
private static final String MEASUREMENT = "measurement";
Expand All @@ -30,7 +31,9 @@ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup c
Measurement measurement = (Measurement) getArguments().getSerializable(MEASUREMENT);
assert measurement != null;
FragmentMeasurementTorBinding binding = FragmentMeasurementTorBinding.inflate(inflater,container,false);
Markwon.setMarkdown(binding.desc,
Markwon.builder(getContext())
.build()
.setMarkdown(binding.desc,
measurement.is_anomaly ?
getString(R.string.TestResults_Details_Circumvention_Tor_Blocked_Content_Paragraph) :
getString(R.string.TestResults_Details_Circumvention_Tor_Reachable_Content_Paragraph)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
import org.openobservatory.ooniprobe.R;
import org.openobservatory.ooniprobe.databinding.FragmentMeasurementWebconnectivityBinding;
import org.openobservatory.ooniprobe.model.database.Measurement;
import ru.noties.markwon.Markwon;

import io.noties.markwon.Markwon;

public class WebConnectivityFragment extends Fragment {
private static final String MEASUREMENT = "measurement";
Expand All @@ -30,10 +31,11 @@ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup c
Measurement measurement = (Measurement) getArguments().getSerializable(MEASUREMENT);
assert measurement != null;
FragmentMeasurementWebconnectivityBinding binding = FragmentMeasurementWebconnectivityBinding.inflate(inflater,container,false);
Markwon markwon = Markwon.builder(getContext()).build();
if (measurement.is_anomaly)
Markwon.setMarkdown(binding.desc, getString(R.string.TestResults_Details_Websites_LikelyBlocked_Content_Paragraph, measurement.url.url, getString(measurement.getTestKeys().getWebsiteBlocking())));
markwon.setMarkdown(binding.desc, getString(R.string.TestResults_Details_Websites_LikelyBlocked_Content_Paragraph, measurement.url.url, getString(measurement.getTestKeys().getWebsiteBlocking())));
else
Markwon.setMarkdown(binding.desc, getString(R.string.TestResults_Details_Websites_Reachable_Content_Paragraph, measurement.url.url));
markwon.setMarkdown(binding.desc, getString(R.string.TestResults_Details_Websites_Reachable_Content_Paragraph, measurement.url.url));
return binding.getRoot();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import org.openobservatory.ooniprobe.common.ThirdPartyServices;
import org.openobservatory.ooniprobe.common.service.ServiceUtil;
import org.openobservatory.ooniprobe.databinding.FragmentOnboarding3Binding;
import ru.noties.markwon.Markwon;
import io.noties.markwon.Markwon;

import javax.inject.Inject;

Expand All @@ -31,7 +31,9 @@ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup c
binding.bullet1.setText(getString(R.string.bullet, getString(R.string.Onboarding_DefaultSettings_Bullet_1)));
binding.bullet2.setText(getString(R.string.bullet, getString(R.string.Onboarding_DefaultSettings_Bullet_2)));
binding.bullet3.setText(getString(R.string.bullet, getString(R.string.Onboarding_DefaultSettings_Bullet_3)));
Markwon.setMarkdown(binding.paragraph, getString(R.string.Onboarding_DefaultSettings_Paragraph));
Markwon.builder(getContext())
.build()
.setMarkdown(binding.paragraph, getString(R.string.Onboarding_DefaultSettings_Paragraph));

binding.master.setOnClickListener(v -> masterClick());
binding.slave.setOnClickListener(v -> slaveClick());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import org.openobservatory.ooniprobe.common.PreferenceManager;
import org.openobservatory.ooniprobe.test.test.AbstractTest;
import org.openobservatory.ooniprobe.test.test.Psiphon;
import org.openobservatory.ooniprobe.test.test.RiseupVPN;
import org.openobservatory.ooniprobe.test.test.Tor;

import java.util.ArrayList;
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/res/values-el/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
<string name="Dashboard_Experimental_Card_Description">Εκτέλεση νέων πειραματικών δοκιμών</string>
<string name="Dashboard_Experimental_Overview_Paragraph">Εκτέλεσε τις παρακάτω νέες πειραματικές δοκιμές που αναπτύχθηκαν από την ομάδα του OONI:\n%1$s\n\nΤα αποτελέσματά σου θα δημοσιευθούν στο [OONI Explorer](https://explorer.ooni.org/) και στο [OONI API](https://api.ooni.io/).</string>
<string name="Dashboard_Experimental_Overview_Paragraph_AutomatedTesting">Οι παρακάτω δοκιμές θα εκτελούνται μόνο ως μέρος των αυτοματοποιημένων δοκιμών:</string>
<string name="Dashboard_DisabledTests_Label">Disabled Tests</string>
<string name="Dashboard_DisabledTests_Label">Απενεργοποιημένες δοκιμές</string>
<string name="TestResults_Gbps">Gbit/s</string>
<string name="TestResults_Mbps">Mbit/s</string>
<string name="TestResults_Kbps">kbit/s</string>
Expand Down Expand Up @@ -377,8 +377,8 @@
<string name="Settings_Sharing_Footer">Δημοσιεύοντας αποτελέσματα, αυξάνεις τη διαφάνεια για τυχόν παρεμβολές στο Διαδικτύο, και υποστηρίζεις την κοινότητα του OONI.\n\nΓια την αναγνώριση των παρόχων δικτύου, απαιτούνται πληροφορίες δικτύου (όπως ο Αριθμός Αυτόνομου Συστήματος ASN).</string>
<string name="Settings_TestOptions_Label">Επιλογές δοκιμής</string>
<string name="Settings_TestOptions_Footer">Οι παραμετροποιήσεις που κάνετε μέσω των παραπάνω ρυθμίσεων δοκιμών (π.χ. απενεργοποίηση της δοκιμής WhatsApp) θα εφαρμόζονται τόσο σε δοκιμές που εκτελούνται χειροκίνητα, όσο και σε δοκιμές που εκτελούνται αυτόματα (όταν έχετε ενεργοποιημένες τις αυτοματοποιημένες δοκιμές).</string>
<string name="Settings_TestOptions_LongRunningTest">Long running test</string>
<string name="Settings_TestOptions_RunLongRunningTests">Run long running tests in foreground?</string>
<string name="Settings_TestOptions_LongRunningTest">Δοκιμή μεγάλης διάρκειας</string>
<string name="Settings_TestOptions_RunLongRunningTests">Να εκτελούνται οι δοκιμές μεγάλης διάρκειας στο προσκήνιο;</string>
<string name="Settings_Privacy_Label">Απόρρητο</string>
<string name="Settings_Privacy_SendCrashReports">Αποστολή αναφορών σφαλμάτων</string>
<string name="Settings_Advanced_Label">Ρυθμίσεις για προχωρημένους/ες</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
<string name="TestResults_Details_CopyExplorerURL">Copier l’URL de l’explorateur</string>
<string name="TestResults_Details_ShareExplorerURL">Partager l’URL de l’explorateur</string>
<string name="TestResults_Details_CopyToClipboard">Copier dans le presse-papiers</string>
<string name="TestResults_Details_ShowInExplorer">Afficher dans l’Explorateur OONI</string>
<string name="TestResults_Details_ShowInExplorer"> Dans l’Explorateur OONI</string>
<string name="TestResults_Details_Failed_Title">Échec</string>
<string name="TestResults_Details_Failed_Paragraph">Vous pouvez essayer de relancer ce test</string>
<string name="TestResults_Details_Failed_TryAgain">Réessayer</string>
Expand Down
Loading

0 comments on commit 3918adb

Please sign in to comment.