don't create OpenKeychain dir on startup
This commit is contained in:
@@ -18,6 +18,15 @@
|
||||
|
||||
package org.sufficientlysecure.keychain.ui;
|
||||
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.security.SecureRandom;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.Locale;
|
||||
import java.util.Random;
|
||||
|
||||
import android.animation.ArgbEvaluator;
|
||||
import android.animation.ValueAnimator;
|
||||
import android.animation.ValueAnimator.AnimatorUpdateListener;
|
||||
@@ -61,14 +70,6 @@ import org.sufficientlysecure.keychain.ui.widget.ToolableViewAnimator;
|
||||
import org.sufficientlysecure.keychain.util.FileHelper;
|
||||
import org.sufficientlysecure.keychain.util.Passphrase;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.security.SecureRandom;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.Locale;
|
||||
import java.util.Random;
|
||||
|
||||
public class BackupCodeFragment extends CryptoOperationFragment<BackupKeyringParcel, ExportResult>
|
||||
implements OnBackStackChangedListener {
|
||||
|
||||
@@ -559,6 +560,11 @@ public class BackupCodeFragment extends CryptoOperationFragment<BackupKeyringPar
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Constants.Path.APP_DIR.mkdirs()) {
|
||||
Notify.create(activity, R.string.snack_backup_error_saving, Style.ERROR).show();
|
||||
return;
|
||||
}
|
||||
|
||||
File file = new File(Constants.Path.APP_DIR, filename);
|
||||
|
||||
if (!overwrite && file.exists()) {
|
||||
|
||||
@@ -254,7 +254,7 @@ public class BackupRestoreFragment extends Fragment {
|
||||
}
|
||||
|
||||
private void restore() {
|
||||
FileHelper.openDocument(this, null, "*/*", false, REQUEST_CODE_INPUT);
|
||||
FileHelper.openDocument(this, "*/*", false, REQUEST_CODE_INPUT);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ public class EncryptDecryptFragment extends Fragment {
|
||||
mDecryptFile.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
FileHelper.openDocument(EncryptDecryptFragment.this, null, "*/*", false, REQUEST_CODE_INPUT);
|
||||
FileHelper.openDocument(EncryptDecryptFragment.this, "*/*", false, REQUEST_CODE_INPUT);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -211,9 +211,7 @@ public class EncryptFilesFragment
|
||||
}
|
||||
|
||||
private void addInputUri() {
|
||||
FileHelper.openDocument(EncryptFilesFragment.this, mFilesAdapter.getModelCount() == 0 ?
|
||||
null : mFilesAdapter.getModelItem(mFilesAdapter.getModelCount() - 1).inputUri,
|
||||
"*/*", true, REQUEST_CODE_INPUT);
|
||||
FileHelper.openDocument(EncryptFilesFragment.this, "*/*", true, REQUEST_CODE_INPUT);
|
||||
}
|
||||
|
||||
public void addInputUri(Intent data) {
|
||||
|
||||
@@ -102,8 +102,7 @@ public class ImportKeysFileFragment extends Fragment {
|
||||
// open .asc or .gpg files
|
||||
// setting it to text/plain prevents Cyanogenmod's file manager from selecting asc
|
||||
// or gpg types!
|
||||
FileHelper.openDocument(ImportKeysFileFragment.this,
|
||||
Uri.fromFile(Constants.Path.APP_DIR), "*/*", false, REQUEST_CODE_FILE);
|
||||
FileHelper.openDocument(ImportKeysFileFragment.this, "*/*", false, REQUEST_CODE_FILE);
|
||||
return true;
|
||||
case R.id.menu_import_keys_file_paste:
|
||||
importFromClipboard();
|
||||
|
||||
@@ -122,7 +122,7 @@ public class AddEditSmartPGPAuthorityDialogFragment extends DialogFragment imple
|
||||
mAuthorityAdd.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
FileHelper.openDocument(AddEditSmartPGPAuthorityDialogFragment.this, null, "*/*", false,
|
||||
FileHelper.openDocument(AddEditSmartPGPAuthorityDialogFragment.this, "*/*", false,
|
||||
EncryptFilesFragment.REQUEST_CODE_INPUT);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -317,7 +317,7 @@ public class ManageSecurityTokenFragment extends Fragment implements ManageSecur
|
||||
|
||||
@Override
|
||||
public void showFileSelectDialog() {
|
||||
FileHelper.openDocument(this, null, "*/*", false, REQUEST_CODE_OPEN_FILE);
|
||||
FileHelper.openDocument(this, "*/*", false, REQUEST_CODE_OPEN_FILE);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user