Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Commit

Permalink
little refactor and version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
zeapo committed May 8, 2017
1 parent 87a26c8 commit 81c63e9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
12 changes: 6 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ android {
applicationId "com.zeapo.pwdstore"
minSdkVersion 15
targetSdkVersion 25
versionCode 77
versionName "1.2.0.57"
versionCode 78
versionName "1.2.0.58"
}

compileOptions {
Expand Down Expand Up @@ -58,10 +58,10 @@ android {
}

dependencies {
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.android.support:recyclerview-v7:24.2.1'
compile 'com.android.support:cardview-v7:24.2.1'
compile 'com.android.support:design:24.2.1'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'org.sufficientlysecure:openpgp-api:11.0'
compile 'com.nononsenseapps:filepicker:2.4.2'
compile('org.eclipse.jgit:org.eclipse.jgit:3.7.1.201504261725-r') {
Expand Down
14 changes: 7 additions & 7 deletions app/src/main/java/com/zeapo/pwdstore/PasswordStore.java
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ public void onClick(DialogInterface dialogInterface, int i) {
it.remove();
adapter.updateSelectedItems(position, selectedItems);

commitAdd("[ANDROID PwdStore] Remove " + item + " from store.");
commitChange("[ANDROID PwdStore] Remove " + item + " from store.");
deletePasswords(adapter, selectedItems);
}
})
Expand Down Expand Up @@ -532,7 +532,7 @@ private File getCurrentDir() {
return PasswordRepository.getRepositoryDirectory(getApplicationContext());
}

private void commitAdd(final String message) {
private void commitChange(final String message) {
new GitOperation(PasswordRepository.getRepositoryDirectory(activity), activity) {
@Override
public void execute() {
Expand All @@ -556,18 +556,18 @@ protected void onActivityResult(int requestCode, int resultCode,
settings.edit().putBoolean("repository_initialized", true).apply();
break;
case PgpHandler.REQUEST_CODE_DECRYPT_AND_VERIFY:
// if went from decrypt->edit and user saved changes, we need to commitAdd
// if went from decrypt->edit and user saved changes, we need to commitChange
if (data.getBooleanExtra("needCommit", false)) {
commitAdd(this.getResources().getString(R.string.edit_commit_text) + data.getExtras().getString("NAME"));
commitChange(this.getResources().getString(R.string.edit_commit_text) + data.getExtras().getString("NAME"));
refreshListAdapter();
}
break;
case PgpHandler.REQUEST_CODE_ENCRYPT:
commitAdd(this.getResources().getString(R.string.add_commit_text) + data.getExtras().getString("NAME") + this.getResources().getString(R.string.from_store));
commitChange(this.getResources().getString(R.string.add_commit_text) + data.getExtras().getString("NAME") + this.getResources().getString(R.string.from_store));
refreshListAdapter();
break;
case PgpHandler.REQUEST_CODE_EDIT:
commitAdd(this.getResources().getString(R.string.edit_commit_text) + data.getExtras().getString("NAME"));
commitChange(this.getResources().getString(R.string.edit_commit_text) + data.getExtras().getString("NAME"));
refreshListAdapter();
break;
case GitActivity.REQUEST_INIT:
Expand Down Expand Up @@ -622,7 +622,7 @@ protected void onActivityResult(int requestCode, int resultCode,
// TODO this should show a warning to the user
Log.e("Moving", "Something went wrong while moving.");
} else {
commitAdd("[ANDROID PwdStore] Moved "
commitChange("[ANDROID PwdStore] Moved "
+ string.replace(PasswordRepository.getRepositoryDirectory(getApplicationContext()) + "/", "")
+ " to "
+ target.getAbsolutePath().replace(PasswordRepository.getRepositoryDirectory(getApplicationContext()) + "/", "")
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/java/com/zeapo/pwdstore/git/GitAsyncTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import android.app.Activity;
import android.app.ProgressDialog;
import android.os.AsyncTask;
import android.util.Log;

import com.zeapo.pwdstore.PasswordStore;
import com.zeapo.pwdstore.R;
Expand Down Expand Up @@ -38,6 +39,7 @@ protected void onPreExecute() {
protected String doInBackground(GitCommand... commands) {
Integer nbChanges = null;
for (GitCommand command : commands) {
Log.d("doInBackground", "Executing the command <" + command.toString() + ">");
try {
if (command instanceof StatusCommand) {
// in case we have changes, we want to keep track of it
Expand Down

0 comments on commit 81c63e9

Please sign in to comment.