Skip to content

Commit

Permalink
actually only export AFTER pressing Yes
Browse files Browse the repository at this point in the history
  • Loading branch information
zoff99 committed Jan 8, 2025
1 parent 25a1e08 commit 4a5bb30
Showing 1 changed file with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1132,16 +1132,28 @@ public static void export_savedata_unsecure(final Context context)
catch (Exception e)
{
}
// passphrase is unused for now!
export_savedata_file_unsecure("_", SD_CARD_FILES_EXPORT_DIR + "/" + "unsecure_export_savedata.tox");

AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setTitle("Export Tox Savedata");
builder.setMessage(
"Tox Savedata File will be exported unencrypted to this location:" + "\n\n" + SD_CARD_FILES_EXPORT_DIR +
"/" + "unsecure_export_savedata.tox");

builder.setPositiveButton("OK", null);
builder.setPositiveButton("Yes, I want to export", new DialogInterface.OnClickListener()
{
public void onClick(DialogInterface dialog, int id)
{
try
{
// passphrase is unused for now!
export_savedata_file_unsecure("_", SD_CARD_FILES_EXPORT_DIR + "/" + "unsecure_export_savedata.tox");
}
catch(Exception ignored)
{
}
}
});
builder.setNegativeButton("Cancel", null);

// create and show the alert dialog
AlertDialog dialog = builder.create();
Expand Down

0 comments on commit 4a5bb30

Please sign in to comment.