diff --git a/briar-android/src/main/java/org/briarproject/briar/android/activity/ActivityComponent.java b/briar-android/src/main/java/org/briarproject/briar/android/activity/ActivityComponent.java
index 2c88bbf79..7b3b9a2ad 100644
--- a/briar-android/src/main/java/org/briarproject/briar/android/activity/ActivityComponent.java
+++ b/briar-android/src/main/java/org/briarproject/briar/android/activity/ActivityComponent.java
@@ -68,6 +68,7 @@ import org.briarproject.briar.android.privategroup.reveal.RevealContactsFragment
import org.briarproject.briar.android.remotewipe.RemoteWipeActivatedActivity;
import org.briarproject.briar.android.remotewipe.RemoteWipeDisplayFragment;
import org.briarproject.briar.android.remotewipe.RemoteWipeSetupActivity;
+import org.briarproject.briar.android.remotewipe.RemoteWipeSetupExplainerFragment;
import org.briarproject.briar.android.remotewipe.RemoteWipeSuccessFragment;
import org.briarproject.briar.android.remotewipe.WiperSelectorFragment;
import org.briarproject.briar.android.remotewipe.activate.ActivateRemoteWipeActivity;
@@ -337,4 +338,6 @@ public interface ActivityComponent {
void inject(ActivateRemoteWipeSuccessFragment activateRemoteWipeSuccessFragment);
void inject(RevokeRemoteWipeSuccessFragment revokeRemoteWipeSuccessFragment);
+
+ void inject(RemoteWipeSetupExplainerFragment remoteWipeSetupExplainerFragment);
}
diff --git a/briar-android/src/main/java/org/briarproject/briar/android/remotewipe/RemoteWipeSetupActivity.java b/briar-android/src/main/java/org/briarproject/briar/android/remotewipe/RemoteWipeSetupActivity.java
index 0f2a287a5..3467643f0 100644
--- a/briar-android/src/main/java/org/briarproject/briar/android/remotewipe/RemoteWipeSetupActivity.java
+++ b/briar-android/src/main/java/org/briarproject/briar/android/remotewipe/RemoteWipeSetupActivity.java
@@ -41,7 +41,7 @@ public class RemoteWipeSetupActivity extends BriarActivity implements
if (viewModel.remoteWipeIsSetup()) {
showInitialFragment(new RemoteWipeDisplayFragment());
} else {
- showInitialFragment(WiperSelectorFragment.newInstance());
+ showInitialFragment(new RemoteWipeSetupExplainerFragment());
}
}
@@ -66,6 +66,8 @@ public class RemoteWipeSetupActivity extends BriarActivity implements
R.string.remote_wipe_setup_failed,
Toast.LENGTH_LONG).show();
finish();
+ } else if (state.equals(RemoteWipeSetupState.SELECTING)) {
+ showNextFragment(WiperSelectorFragment.newInstance());
} else if (state.equals(RemoteWipeSetupState.FINISHED)) {
finish();
} else if (state.equals(RemoteWipeSetupState.MODIFY)) {
diff --git a/briar-android/src/main/java/org/briarproject/briar/android/remotewipe/RemoteWipeSetupExplainerFragment.java b/briar-android/src/main/java/org/briarproject/briar/android/remotewipe/RemoteWipeSetupExplainerFragment.java
new file mode 100644
index 000000000..251ff312f
--- /dev/null
+++ b/briar-android/src/main/java/org/briarproject/briar/android/remotewipe/RemoteWipeSetupExplainerFragment.java
@@ -0,0 +1,57 @@
+package org.briarproject.briar.android.remotewipe;
+
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.Button;
+
+import org.briarproject.briar.R;
+import org.briarproject.briar.android.activity.ActivityComponent;
+import org.briarproject.briar.android.fragment.BaseFragment;
+
+import javax.inject.Inject;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.lifecycle.ViewModelProvider;
+
+public class RemoteWipeSetupExplainerFragment extends
+ BaseFragment {
+
+ public static final String TAG =
+ RemoteWipeSetupExplainerFragment.class.getName();
+
+ @Inject
+ ViewModelProvider.Factory viewModelFactory;
+
+ private RemoteWipeSetupViewModel viewModel;
+
+ @Override
+ public void injectFragment(ActivityComponent component) {
+ component.inject(this);
+ viewModel = new ViewModelProvider(requireActivity(), viewModelFactory)
+ .get(RemoteWipeSetupViewModel.class);
+ }
+
+ @Nullable
+ @Override
+ public View onCreateView(@NonNull LayoutInflater inflater,
+ @Nullable ViewGroup container,
+ @Nullable Bundle savedInstanceState) {
+ View view = inflater.inflate(R.layout.fragment_remote_wipe_setup_explainer,
+ container, false);
+
+ Button confirmButton = view.findViewById(R.id.button_confirm);
+ confirmButton.setOnClickListener(e -> viewModel.onExplainerConfirmed());
+
+ Button cancelButton = view.findViewById(R.id.button_cancel);
+ cancelButton.setOnClickListener(e -> viewModel.onExplainerCancelled());
+ return view;
+ }
+
+ @Override
+ public String getUniqueTag() {
+ return TAG;
+ }
+}
diff --git a/briar-android/src/main/java/org/briarproject/briar/android/remotewipe/RemoteWipeSetupState.java b/briar-android/src/main/java/org/briarproject/briar/android/remotewipe/RemoteWipeSetupState.java
index ace6f3654..2f0da38d8 100644
--- a/briar-android/src/main/java/org/briarproject/briar/android/remotewipe/RemoteWipeSetupState.java
+++ b/briar-android/src/main/java/org/briarproject/briar/android/remotewipe/RemoteWipeSetupState.java
@@ -4,5 +4,6 @@ public enum RemoteWipeSetupState {
FAILED,
SUCCESS,
FINISHED,
+ SELECTING,
MODIFY
}
diff --git a/briar-android/src/main/java/org/briarproject/briar/android/remotewipe/RemoteWipeSetupViewModel.java b/briar-android/src/main/java/org/briarproject/briar/android/remotewipe/RemoteWipeSetupViewModel.java
index 2cf1a0e80..1527ca2ff 100644
--- a/briar-android/src/main/java/org/briarproject/briar/android/remotewipe/RemoteWipeSetupViewModel.java
+++ b/briar-android/src/main/java/org/briarproject/briar/android/remotewipe/RemoteWipeSetupViewModel.java
@@ -69,6 +69,16 @@ public class RemoteWipeSetupViewModel extends AndroidViewModel {
return wiperNames;
}
+ @UiThread
+ public void onExplainerConfirmed() {
+ state.postValue(RemoteWipeSetupState.SELECTING);
+ }
+
+ @UiThread
+ public void onExplainerCancelled() {
+ state.postValue(RemoteWipeSetupState.FINISHED);
+ }
+
@UiThread
public void onSuccessDismissed() {
state.postValue(RemoteWipeSetupState.FINISHED);
diff --git a/briar-android/src/main/res/layout/fragment_remote_wipe_setup_explainer.xml b/briar-android/src/main/res/layout/fragment_remote_wipe_setup_explainer.xml
new file mode 100644
index 000000000..8de9d3edd
--- /dev/null
+++ b/briar-android/src/main/res/layout/fragment_remote_wipe_setup_explainer.xml
@@ -0,0 +1,71 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/briar-android/src/main/res/values/strings.xml b/briar-android/src/main/res/values/strings.xml
index aa6801706..b9e6e4c65 100644
--- a/briar-android/src/main/res/values/strings.xml
+++ b/briar-android/src/main/res/values/strings.xml
@@ -641,23 +641,18 @@
No problem, hope you like it 😀
-
-
-
+
+
Social backupBackup your account using trusted contacts
-
Existing Social backupInformation about your most recent social backup
-
-
+
Select Trusted Contacts:
-
Please select at least %d contactsPlease select at least %d more contacts
-
Choose the minimum number of trusted contacts needed to restore your accountTwo trusted contacts will be needed to restore your accountSecure
@@ -666,13 +661,9 @@
Danger of loss – lower threshold recommendedChoose Threshold%d of %d contacts needed to recover your account
-
Backup pieces sent to trusted contacts
- Backup created 1/6/2020
-
-
-
+
You need to meet your trusted contacts in-person to receive piecesYour trusted contact must scan a QR code to initiate the transfer.\n\nYou must both be connected to the same wifi networkBegin
@@ -687,28 +678,24 @@
You must now set a new password for your accountSending acknowledgement
-
-
+
You need to meet in-person to transfer backup pieceMake sure you are both connected to the same wifi network, and scan the QR code on your contact\'s device to begin transferring the backup pieceFailed to send backup pieceScan codeAccount backup piece transmitted
-
-
+
Social BackupSelect Trusted ContactsThresholdRecovery ModeHelp recover account
-
-
+
Help recover account
-
-
+
Create new accountRestore account from backup
@@ -716,11 +703,11 @@
\u25CF\u25CB
-
+
Social BackupRestore Account
-
+
%1$s has sent you a social backup piece.You have sent a social backup piece to %1$s.
@@ -732,20 +719,22 @@
To make a social backup, you need at least 2 contacts in your contacts listThere was an error reading your contacts list
-
+
-
+
Remote wipe is set upFailed to set up remote wipe
+ Setup remote wipe function
+ You can choose a set of trusted contacts who are able to activate a remote wipe of all Briar data.\nThe wipe may be activated by any two contacts from the set.
-
+
Allow trusted contacts to activate an account wipe remotelyRemote Wipe
-
+
Select Trusted Contacts
-
+
%1$s has added you as a remote wiper.You have added %1$s as a remote wiper.You have sent an activate remote wipe signal to %1$s. It expires
@@ -755,7 +744,7 @@
You have removed %1$s as a remote wiper.You can no longer activate a remote wipe for %1$s.
-
+
Activate Remote WipeRemote wipe signal sentFailed to send remote wipe signal
@@ -764,7 +753,7 @@
Activate a remote wipe of this contact\'s deviceIf confirmed by a second contact, sending this signal will remove all briar contacts and messages from this contact\s device.
-
+
Revoke Remote WipeRevoke remote wipe statusRemote wipe status revoked