tabs to spaces

This commit is contained in:
Brian Pellin
2016-03-01 22:12:27 -06:00
parent c86a1814f6
commit 97aa02cfa8

View File

@@ -39,78 +39,78 @@ import com.keepassdroid.database.exception.InvalidPasswordException;
import com.keepassdroid.database.exception.KeyFileEmptyException;
public class LoadDB extends RunnableOnFinish {
private String mFileName;
private String mPass;
private String mKey;
private Database mDb;
private Context mCtx;
private boolean mRememberKeyfile;
private String mFileName;
private String mPass;
private String mKey;
private Database mDb;
private Context mCtx;
private boolean mRememberKeyfile;
public LoadDB(Database db, Context ctx, String fileName, String pass, String key, OnFinish finish) {
super(finish);
public LoadDB(Database db, Context ctx, String fileName, String pass, String key, OnFinish finish) {
super(finish);
mDb = db;
mCtx = ctx;
mFileName = fileName;
mPass = pass;
mKey = key;
mDb = db;
mCtx = ctx;
mFileName = fileName;
mPass = pass;
mKey = key;
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(ctx);
mRememberKeyfile = prefs.getBoolean(ctx.getString(R.string.keyfile_key), ctx.getResources().getBoolean(R.bool.keyfile_default));
}
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(ctx);
mRememberKeyfile = prefs.getBoolean(ctx.getString(R.string.keyfile_key), ctx.getResources().getBoolean(R.bool.keyfile_default));
}
@Override
public void run() {
try {
mDb.LoadData(mCtx, mFileName, mPass, mKey, mStatus);
@Override
public void run() {
try {
mDb.LoadData(mCtx, mFileName, mPass, mKey, mStatus);
saveFileData(mFileName, mKey);
saveFileData(mFileName, mKey);
} catch (ArcFourException e) {
finish(false, mCtx.getString(R.string.error_arc4));
return;
} catch (InvalidPasswordException e) {
finish(false, mCtx.getString(R.string.InvalidPassword));
return;
} catch (FileNotFoundException e) {
finish(false, mCtx.getString(R.string.FileNotFound));
return;
} catch (IOException e) {
finish(false, e.getMessage());
return;
} catch (KeyFileEmptyException e) {
finish(false, mCtx.getString(R.string.keyfile_is_empty));
return;
} catch (InvalidAlgorithmException e) {
finish(false, mCtx.getString(R.string.invalid_algorithm));
return;
} catch (InvalidKeyFileException e) {
finish(false, mCtx.getString(R.string.keyfile_does_not_exist));
return;
} catch (InvalidDBSignatureException e) {
finish(false, mCtx.getString(R.string.invalid_db_sig));
return;
} catch (InvalidDBVersionException e) {
finish(false, mCtx.getString(R.string.unsupported_db_version));
return;
} catch (InvalidDBException e) {
finish(false, mCtx.getString(R.string.error_invalid_db));
return;
} catch (OutOfMemoryError e) {
finish(false, mCtx.getString(R.string.error_out_of_memory));
return;
}
} catch (ArcFourException e) {
finish(false, mCtx.getString(R.string.error_arc4));
return;
} catch (InvalidPasswordException e) {
finish(false, mCtx.getString(R.string.InvalidPassword));
return;
} catch (FileNotFoundException e) {
finish(false, mCtx.getString(R.string.FileNotFound));
return;
} catch (IOException e) {
finish(false, e.getMessage());
return;
} catch (KeyFileEmptyException e) {
finish(false, mCtx.getString(R.string.keyfile_is_empty));
return;
} catch (InvalidAlgorithmException e) {
finish(false, mCtx.getString(R.string.invalid_algorithm));
return;
} catch (InvalidKeyFileException e) {
finish(false, mCtx.getString(R.string.keyfile_does_not_exist));
return;
} catch (InvalidDBSignatureException e) {
finish(false, mCtx.getString(R.string.invalid_db_sig));
return;
} catch (InvalidDBVersionException e) {
finish(false, mCtx.getString(R.string.unsupported_db_version));
return;
} catch (InvalidDBException e) {
finish(false, mCtx.getString(R.string.error_invalid_db));
return;
} catch (OutOfMemoryError e) {
finish(false, mCtx.getString(R.string.error_out_of_memory));
return;
}
finish(true);
}
finish(true);
}
private void saveFileData(String fileName, String key) {
if ( ! mRememberKeyfile ) {
key = "";
}
private void saveFileData(String fileName, String key) {
if ( ! mRememberKeyfile ) {
key = "";
}
App.getFileHistory().createFile(fileName, key);
}
App.getFileHistory().createFile(fileName, key);
}