mirror of
https://github.com/beemdevelopment/Aegis.git
synced 2025-05-14 14:02:49 +00:00
Start the intro if the database file was not found
This commit is contained in:
parent
41bafba596
commit
f09d227378
2 changed files with 13 additions and 8 deletions
|
@ -159,7 +159,6 @@ public class IntroActivity extends AppIntro {
|
||||||
setResult(RESULT_OK, result);
|
setResult(RESULT_OK, result);
|
||||||
|
|
||||||
// skip the intro from now on
|
// skip the intro from now on
|
||||||
// TODO: show the intro if we can't find any database files
|
|
||||||
SharedPreferences prefs = this.getSharedPreferences("me.impy.aegis", Context.MODE_PRIVATE);
|
SharedPreferences prefs = this.getSharedPreferences("me.impy.aegis", Context.MODE_PRIVATE);
|
||||||
prefs.edit().putBoolean("passedIntro", true).apply();
|
prefs.edit().putBoolean("passedIntro", true).apply();
|
||||||
finish();
|
finish();
|
||||||
|
|
|
@ -26,6 +26,7 @@ import android.view.View;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import java.io.FileNotFoundException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.lang.reflect.UndeclaredThrowableException;
|
import java.lang.reflect.UndeclaredThrowableException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -69,17 +70,22 @@ public class MainActivity extends AppCompatActivity {
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
_db.load();
|
_db.load();
|
||||||
|
if (!_db.isDecrypted()) {
|
||||||
|
Intent intent = new Intent(this, AuthActivity.class);
|
||||||
|
intent.putExtra("slots", _db.getFile().getSlots());
|
||||||
|
startActivityForResult(intent, CODE_DECRYPT);
|
||||||
|
} else {
|
||||||
|
loadKeyProfiles();
|
||||||
|
}
|
||||||
|
} catch (FileNotFoundException e) {
|
||||||
|
// start the intro if the db file was not found
|
||||||
|
Toast.makeText(this, "Database file not found, starting over...", Toast.LENGTH_SHORT).show();
|
||||||
|
Intent intro = new Intent(this, IntroActivity.class);
|
||||||
|
startActivityForResult(intro, CODE_DO_INTRO);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// TODO: feedback
|
// TODO: feedback
|
||||||
throw new UndeclaredThrowableException(e);
|
throw new UndeclaredThrowableException(e);
|
||||||
}
|
}
|
||||||
if (!_db.isDecrypted()) {
|
|
||||||
Intent intent = new Intent(this, AuthActivity.class);
|
|
||||||
intent.putExtra("slots", _db.getFile().getSlots());
|
|
||||||
startActivityForResult(intent, CODE_DECRYPT);
|
|
||||||
} else {
|
|
||||||
loadKeyProfiles();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
|
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue