mirror of
https://github.com/moparisthebest/open-keychain
synced 2025-01-12 14:08:24 -05:00
Merge branch 'master' of https://github.com/da-kid/open-keychain
This commit is contained in:
commit
85bf24521d
@ -29,7 +29,6 @@ dependencies {
|
|||||||
testCompile 'com.squareup:fest-android:1.0.8'
|
testCompile 'com.squareup:fest-android:1.0.8'
|
||||||
testCompile 'com.google.android:android:4.1.1.4'
|
testCompile 'com.google.android:android:4.1.1.4'
|
||||||
// compile dependencies are automatically also included in testCompile
|
// compile dependencies are automatically also included in testCompile
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
@ -79,6 +78,11 @@ android {
|
|||||||
htmlReport true
|
htmlReport true
|
||||||
htmlOutput file("lint-report.html")
|
htmlOutput file("lint-report.html")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Disable preDexing, causes com.android.dx.cf.iface.ParseException: bad class file magic (cafebabe) or version (0034.0000) on some systems
|
||||||
|
dexOptions {
|
||||||
|
preDexLibraries = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// NOTE: This disables Lint!
|
// NOTE: This disables Lint!
|
||||||
|
@ -42,6 +42,9 @@ public class KeybaseKeyserver extends Keyserver {
|
|||||||
// cut off "0x" if a user is searching for a key id
|
// cut off "0x" if a user is searching for a key id
|
||||||
query = query.substring(2);
|
query = query.substring(2);
|
||||||
}
|
}
|
||||||
|
if (query.isEmpty()) {
|
||||||
|
throw new QueryTooShortException();
|
||||||
|
}
|
||||||
mQuery = query;
|
mQuery = query;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -47,6 +47,7 @@ import org.sufficientlysecure.keychain.ui.adapter.SubkeysAdapter;
|
|||||||
import org.sufficientlysecure.keychain.ui.adapter.UserIdsAdapter;
|
import org.sufficientlysecure.keychain.ui.adapter.UserIdsAdapter;
|
||||||
import org.sufficientlysecure.keychain.ui.dialog.AddUserIdDialogFragment;
|
import org.sufficientlysecure.keychain.ui.dialog.AddUserIdDialogFragment;
|
||||||
import org.sufficientlysecure.keychain.ui.dialog.EditUserIdDialogFragment;
|
import org.sufficientlysecure.keychain.ui.dialog.EditUserIdDialogFragment;
|
||||||
|
import org.sufficientlysecure.keychain.ui.dialog.SetPassphraseDialogFragment;
|
||||||
import org.sufficientlysecure.keychain.util.Log;
|
import org.sufficientlysecure.keychain.util.Log;
|
||||||
|
|
||||||
public class EditKeyFragment extends LoaderFragment implements
|
public class EditKeyFragment extends LoaderFragment implements
|
||||||
@ -135,69 +136,6 @@ public class EditKeyFragment extends LoaderFragment implements
|
|||||||
loadData(dataUri);
|
loadData(dataUri);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void editUserId(final String userId) {
|
|
||||||
Handler returnHandler = new Handler() {
|
|
||||||
@Override
|
|
||||||
public void handleMessage(Message message) {
|
|
||||||
switch (message.what) {
|
|
||||||
case EditUserIdDialogFragment.MESSAGE_CHANGE_PRIMARY_USER_ID:
|
|
||||||
// toggle
|
|
||||||
if (mSaveKeyringParcel.changePrimaryUserId != null
|
|
||||||
&& mSaveKeyringParcel.changePrimaryUserId.equals(userId)) {
|
|
||||||
mSaveKeyringParcel.changePrimaryUserId = null;
|
|
||||||
} else {
|
|
||||||
mSaveKeyringParcel.changePrimaryUserId = userId;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case EditUserIdDialogFragment.MESSAGE_REVOKE:
|
|
||||||
// toggle
|
|
||||||
if (mSaveKeyringParcel.revokeUserIds.contains(userId)) {
|
|
||||||
mSaveKeyringParcel.revokeUserIds.remove(userId);
|
|
||||||
} else {
|
|
||||||
mSaveKeyringParcel.revokeUserIds.add(userId);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
getLoaderManager().restartLoader(LOADER_ID_USER_IDS, null, EditKeyFragment.this);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// Create a new Messenger for the communication back
|
|
||||||
final Messenger messenger = new Messenger(returnHandler);
|
|
||||||
|
|
||||||
DialogFragmentWorkaround.INTERFACE.runnableRunDelayed(new Runnable() {
|
|
||||||
public void run() {
|
|
||||||
EditUserIdDialogFragment dialogFragment =
|
|
||||||
EditUserIdDialogFragment.newInstance(messenger);
|
|
||||||
|
|
||||||
dialogFragment.show(getActivity().getSupportFragmentManager(), "editUserIdDialog");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private void addUserId() {
|
|
||||||
Handler returnHandler = new Handler() {
|
|
||||||
@Override
|
|
||||||
public void handleMessage(Message message) {
|
|
||||||
if (message.what == AddUserIdDialogFragment.MESSAGE_OK) {
|
|
||||||
|
|
||||||
}
|
|
||||||
// getLoaderManager().restartLoader(LOADER_ID_USER_IDS, null, EditKeyFragment.this);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// Create a new Messenger for the communication back
|
|
||||||
final Messenger messenger = new Messenger(returnHandler);
|
|
||||||
|
|
||||||
DialogFragmentWorkaround.INTERFACE.runnableRunDelayed(new Runnable() {
|
|
||||||
public void run() {
|
|
||||||
AddUserIdDialogFragment dialogFragment =
|
|
||||||
AddUserIdDialogFragment.newInstance(messenger);
|
|
||||||
|
|
||||||
dialogFragment.show(getActivity().getSupportFragmentManager(), "addUserIdDialog");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private void loadData(Uri dataUri) {
|
private void loadData(Uri dataUri) {
|
||||||
mDataUri = dataUri;
|
mDataUri = dataUri;
|
||||||
@ -217,6 +155,13 @@ public class EditKeyFragment extends LoaderFragment implements
|
|||||||
getActivity().finish();
|
getActivity().finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mChangePassphrase.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
changePassphrase();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
mAddUserId.setOnClickListener(new View.OnClickListener() {
|
mAddUserId.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
@ -296,6 +241,105 @@ public class EditKeyFragment extends LoaderFragment implements
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void changePassphrase() {
|
||||||
|
// Message is received after passphrase is cached
|
||||||
|
Handler returnHandler = new Handler() {
|
||||||
|
@Override
|
||||||
|
public void handleMessage(Message message) {
|
||||||
|
if (message.what == SetPassphraseDialogFragment.MESSAGE_OKAY) {
|
||||||
|
Bundle data = message.getData();
|
||||||
|
|
||||||
|
// set new returned passphrase!
|
||||||
|
String newPassphrase = data
|
||||||
|
.getString(SetPassphraseDialogFragment.MESSAGE_NEW_PASSPHRASE);
|
||||||
|
|
||||||
|
// updatePassphraseButtonText();
|
||||||
|
// somethingChanged();
|
||||||
|
mSaveKeyringParcel.newPassphrase = newPassphrase;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Create a new Messenger for the communication back
|
||||||
|
Messenger messenger = new Messenger(returnHandler);
|
||||||
|
|
||||||
|
// set title based on isPassphraseSet()
|
||||||
|
// int title;
|
||||||
|
// if (isPassphraseSet()) {
|
||||||
|
// title = R.string.title_change_passphrase;
|
||||||
|
// } else {
|
||||||
|
// title = R.string.title_set_passphrase;
|
||||||
|
// }
|
||||||
|
|
||||||
|
SetPassphraseDialogFragment setPassphraseDialog = SetPassphraseDialogFragment.newInstance(
|
||||||
|
messenger, R.string.title_change_passphrase);
|
||||||
|
|
||||||
|
setPassphraseDialog.show(getActivity().getSupportFragmentManager(), "setPassphraseDialog");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void editUserId(final String userId) {
|
||||||
|
Handler returnHandler = new Handler() {
|
||||||
|
@Override
|
||||||
|
public void handleMessage(Message message) {
|
||||||
|
switch (message.what) {
|
||||||
|
case EditUserIdDialogFragment.MESSAGE_CHANGE_PRIMARY_USER_ID:
|
||||||
|
// toggle
|
||||||
|
if (mSaveKeyringParcel.changePrimaryUserId != null
|
||||||
|
&& mSaveKeyringParcel.changePrimaryUserId.equals(userId)) {
|
||||||
|
mSaveKeyringParcel.changePrimaryUserId = null;
|
||||||
|
} else {
|
||||||
|
mSaveKeyringParcel.changePrimaryUserId = userId;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case EditUserIdDialogFragment.MESSAGE_REVOKE:
|
||||||
|
// toggle
|
||||||
|
if (mSaveKeyringParcel.revokeUserIds.contains(userId)) {
|
||||||
|
mSaveKeyringParcel.revokeUserIds.remove(userId);
|
||||||
|
} else {
|
||||||
|
mSaveKeyringParcel.revokeUserIds.add(userId);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
getLoaderManager().getLoader(LOADER_ID_USER_IDS).forceLoad();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Create a new Messenger for the communication back
|
||||||
|
final Messenger messenger = new Messenger(returnHandler);
|
||||||
|
|
||||||
|
DialogFragmentWorkaround.INTERFACE.runnableRunDelayed(new Runnable() {
|
||||||
|
public void run() {
|
||||||
|
EditUserIdDialogFragment dialogFragment =
|
||||||
|
EditUserIdDialogFragment.newInstance(messenger);
|
||||||
|
|
||||||
|
dialogFragment.show(getActivity().getSupportFragmentManager(), "editUserIdDialog");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void addUserId() {
|
||||||
|
Handler returnHandler = new Handler() {
|
||||||
|
@Override
|
||||||
|
public void handleMessage(Message message) {
|
||||||
|
if (message.what == AddUserIdDialogFragment.MESSAGE_OK) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Create a new Messenger for the communication back
|
||||||
|
final Messenger messenger = new Messenger(returnHandler);
|
||||||
|
|
||||||
|
DialogFragmentWorkaround.INTERFACE.runnableRunDelayed(new Runnable() {
|
||||||
|
public void run() {
|
||||||
|
AddUserIdDialogFragment dialogFragment =
|
||||||
|
AddUserIdDialogFragment.newInstance(messenger);
|
||||||
|
|
||||||
|
dialogFragment.show(getActivity().getSupportFragmentManager(), "addUserIdDialog");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
private void save() {
|
private void save() {
|
||||||
getActivity().finish();
|
getActivity().finish();
|
||||||
// TODO
|
// TODO
|
||||||
|
@ -6,7 +6,7 @@ buildscript {
|
|||||||
dependencies {
|
dependencies {
|
||||||
// NOTE: Always use fixed version codes not dynamic ones, e.g. 0.7.3 instead of 0.7.+, see README for more information
|
// NOTE: Always use fixed version codes not dynamic ones, e.g. 0.7.3 instead of 0.7.+, see README for more information
|
||||||
classpath 'com.android.tools.build:gradle:0.11.1'
|
classpath 'com.android.tools.build:gradle:0.11.1'
|
||||||
classpath 'org.robolectric:robolectric-gradle-plugin:0.11.0'
|
classpath 'org.robolectric:robolectric-gradle-plugin:0.11.0'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user