mirror of
https://github.com/moparisthebest/open-keychain
synced 2024-11-27 19:22:14 -05:00
removed useless semicolons, fixed some parameters in documenation, simplified some conditionals
This commit is contained in:
parent
c1c462db4f
commit
477d06c43a
@ -59,7 +59,6 @@ public class ClipboardReflection {
|
|||||||
* Wrapper around ClipboardManager based on Android version using Reflection API
|
* Wrapper around ClipboardManager based on Android version using Reflection API
|
||||||
*
|
*
|
||||||
* @param context
|
* @param context
|
||||||
* @param text
|
|
||||||
*/
|
*/
|
||||||
public static CharSequence getClipboardText(Context context) {
|
public static CharSequence getClipboardText(Context context) {
|
||||||
Object clipboard = context.getSystemService(Context.CLIPBOARD_SERVICE);
|
Object clipboard = context.getSystemService(Context.CLIPBOARD_SERVICE);
|
||||||
|
@ -160,7 +160,7 @@ public class ExportHelper {
|
|||||||
Toast.makeText(activity, toastMessage, Toast.LENGTH_SHORT).show();
|
Toast.makeText(activity, toastMessage, Toast.LENGTH_SHORT).show();
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Create a new Messenger for the communication back
|
// Create a new Messenger for the communication back
|
||||||
|
@ -76,7 +76,7 @@ public class PgpConversionHelper {
|
|||||||
*
|
*
|
||||||
* Singles keys are encoded as keyRings with one single key in it by Bouncy Castle
|
* Singles keys are encoded as keyRings with one single key in it by Bouncy Castle
|
||||||
*
|
*
|
||||||
* @param keysBytes
|
* @param keyBytes
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public static PGPSecretKey BytesToPGPSecretKey(byte[] keyBytes) {
|
public static PGPSecretKey BytesToPGPSecretKey(byte[] keyBytes) {
|
||||||
@ -125,7 +125,7 @@ public class PgpConversionHelper {
|
|||||||
/**
|
/**
|
||||||
* Convert from PGPSecretKey to byte[]
|
* Convert from PGPSecretKey to byte[]
|
||||||
*
|
*
|
||||||
* @param keysBytes
|
* @param key
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public static byte[] PGPSecretKeyToBytes(PGPSecretKey key) {
|
public static byte[] PGPSecretKeyToBytes(PGPSecretKey key) {
|
||||||
@ -141,7 +141,7 @@ public class PgpConversionHelper {
|
|||||||
/**
|
/**
|
||||||
* Convert from PGPSecretKeyRing to byte[]
|
* Convert from PGPSecretKeyRing to byte[]
|
||||||
*
|
*
|
||||||
* @param keysBytes
|
* @param keyRing
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public static byte[] PGPSecretKeyRingToBytes(PGPSecretKeyRing keyRing) {
|
public static byte[] PGPSecretKeyRingToBytes(PGPSecretKeyRing keyRing) {
|
||||||
|
@ -304,7 +304,7 @@ public class KeychainProvider extends ContentProvider {
|
|||||||
/**
|
/**
|
||||||
* Returns type of the query (secret/public)
|
* Returns type of the query (secret/public)
|
||||||
*
|
*
|
||||||
* @param uri
|
* @param match
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private int getKeyType(int match) {
|
private int getKeyType(int match) {
|
||||||
@ -862,7 +862,8 @@ public class KeychainProvider extends ContentProvider {
|
|||||||
* Build default selection statement for KeyRings. If no extra selection is specified only build
|
* Build default selection statement for KeyRings. If no extra selection is specified only build
|
||||||
* where clause with rowId
|
* where clause with rowId
|
||||||
*
|
*
|
||||||
* @param uri
|
* @param defaultSelection
|
||||||
|
* @param keyType
|
||||||
* @param selection
|
* @param selection
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@ -249,7 +249,7 @@ public class CertifyKeyActivity extends ActionBarActivity implements
|
|||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Create a new Messenger for the communication back
|
// Create a new Messenger for the communication back
|
||||||
@ -295,7 +295,7 @@ public class CertifyKeyActivity extends ActionBarActivity implements
|
|||||||
setResult(RESULT_OK);
|
setResult(RESULT_OK);
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Create a new Messenger for the communication back
|
// Create a new Messenger for the communication back
|
||||||
|
@ -744,8 +744,6 @@ public class DecryptActivity extends DrawerActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Create a new Messenger for the communication back
|
// Create a new Messenger for the communication back
|
||||||
|
@ -224,7 +224,7 @@ public class EditKeyActivity extends ActionBarActivity {
|
|||||||
|
|
||||||
buildLayout();
|
buildLayout();
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Create a new Messenger for the communication back
|
// Create a new Messenger for the communication back
|
||||||
@ -561,7 +561,7 @@ public class EditKeyActivity extends ActionBarActivity {
|
|||||||
setResult(RESULT_OK, data);
|
setResult(RESULT_OK, data);
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Create a new Messenger for the communication back
|
// Create a new Messenger for the communication back
|
||||||
|
@ -669,8 +669,6 @@ public class EncryptActivity extends DrawerActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Create a new Messenger for the communication back
|
// Create a new Messenger for the communication back
|
||||||
|
@ -59,19 +59,19 @@ public class HelpActivity extends ActionBarActivity {
|
|||||||
Bundle startBundle = new Bundle();
|
Bundle startBundle = new Bundle();
|
||||||
startBundle.putInt(HelpHtmlFragment.ARG_HTML_FILE, R.raw.help_start);
|
startBundle.putInt(HelpHtmlFragment.ARG_HTML_FILE, R.raw.help_start);
|
||||||
mTabsAdapter.addTab(actionBar.newTab().setText(getString(R.string.help_tab_start)),
|
mTabsAdapter.addTab(actionBar.newTab().setText(getString(R.string.help_tab_start)),
|
||||||
HelpHtmlFragment.class, startBundle, (selectedTab == 0 ? true : false));
|
HelpHtmlFragment.class, startBundle, (selectedTab == 0) );
|
||||||
|
|
||||||
Bundle nfcBundle = new Bundle();
|
Bundle nfcBundle = new Bundle();
|
||||||
nfcBundle.putInt(HelpHtmlFragment.ARG_HTML_FILE, R.raw.help_nfc_beam);
|
nfcBundle.putInt(HelpHtmlFragment.ARG_HTML_FILE, R.raw.help_nfc_beam);
|
||||||
mTabsAdapter.addTab(actionBar.newTab().setText(getString(R.string.help_tab_nfc_beam)),
|
mTabsAdapter.addTab(actionBar.newTab().setText(getString(R.string.help_tab_nfc_beam)),
|
||||||
HelpHtmlFragment.class, nfcBundle, (selectedTab == 1 ? true : false));
|
HelpHtmlFragment.class, nfcBundle, (selectedTab == 1) );
|
||||||
|
|
||||||
Bundle changelogBundle = new Bundle();
|
Bundle changelogBundle = new Bundle();
|
||||||
changelogBundle.putInt(HelpHtmlFragment.ARG_HTML_FILE, R.raw.help_changelog);
|
changelogBundle.putInt(HelpHtmlFragment.ARG_HTML_FILE, R.raw.help_changelog);
|
||||||
mTabsAdapter.addTab(actionBar.newTab().setText(getString(R.string.help_tab_changelog)),
|
mTabsAdapter.addTab(actionBar.newTab().setText(getString(R.string.help_tab_changelog)),
|
||||||
HelpHtmlFragment.class, changelogBundle, (selectedTab == 2 ? true : false));
|
HelpHtmlFragment.class, changelogBundle, (selectedTab == 2) );
|
||||||
|
|
||||||
mTabsAdapter.addTab(actionBar.newTab().setText(getString(R.string.help_tab_about)),
|
mTabsAdapter.addTab(actionBar.newTab().setText(getString(R.string.help_tab_about)),
|
||||||
HelpAboutFragment.class, null, (selectedTab == 3 ? true : false));
|
HelpAboutFragment.class, null, (selectedTab == 3) );
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -113,7 +113,7 @@ public class UploadKeyActivity extends ActionBarActivity {
|
|||||||
Toast.LENGTH_SHORT).show();
|
Toast.LENGTH_SHORT).show();
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Create a new Messenger for the communication back
|
// Create a new Messenger for the communication back
|
||||||
|
@ -88,12 +88,12 @@ public class ViewKeyActivity extends ActionBarActivity {
|
|||||||
Bundle mainBundle = new Bundle();
|
Bundle mainBundle = new Bundle();
|
||||||
mainBundle.putParcelable(ViewKeyMainFragment.ARG_DATA_URI, mDataUri);
|
mainBundle.putParcelable(ViewKeyMainFragment.ARG_DATA_URI, mDataUri);
|
||||||
mTabsAdapter.addTab(actionBar.newTab().setText(getString(R.string.key_view_tab_main)),
|
mTabsAdapter.addTab(actionBar.newTab().setText(getString(R.string.key_view_tab_main)),
|
||||||
ViewKeyMainFragment.class, mainBundle, (selectedTab == 0 ? true : false));
|
ViewKeyMainFragment.class, mainBundle, (selectedTab == 0));
|
||||||
|
|
||||||
Bundle certBundle = new Bundle();
|
Bundle certBundle = new Bundle();
|
||||||
certBundle.putParcelable(ViewKeyCertsFragment.ARG_DATA_URI, mDataUri);
|
certBundle.putParcelable(ViewKeyCertsFragment.ARG_DATA_URI, mDataUri);
|
||||||
mTabsAdapter.addTab(actionBar.newTab().setText(getString(R.string.key_view_tab_certs)),
|
mTabsAdapter.addTab(actionBar.newTab().setText(getString(R.string.key_view_tab_certs)),
|
||||||
ViewKeyCertsFragment.class, certBundle, (selectedTab == 1 ? true : false));
|
ViewKeyCertsFragment.class, certBundle, (selectedTab == 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -152,9 +152,7 @@ public class ImportKeysListEntry implements Serializable, Parcelable {
|
|||||||
// selected is default
|
// selected is default
|
||||||
this.selected = true;
|
this.selected = true;
|
||||||
|
|
||||||
if (pgpKeyRing instanceof PGPSecretKeyRing) {
|
if ( !(pgpKeyRing instanceof PGPSecretKeyRing) ) {
|
||||||
secretKey = true;
|
|
||||||
} else {
|
|
||||||
secretKey = false;
|
secretKey = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -95,7 +95,7 @@ public class DeleteFileDialogFragment extends DialogFragment {
|
|||||||
Toast.makeText(activity, R.string.file_delete_successful,
|
Toast.makeText(activity, R.string.file_delete_successful,
|
||||||
Toast.LENGTH_SHORT).show();
|
Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Create a new Messenger for the communication back
|
// Create a new Messenger for the communication back
|
||||||
|
@ -158,7 +158,7 @@ public class PassphraseDialogFragment extends DialogFragment implements OnEditor
|
|||||||
PGPSecretKey clickSecretKey = secretKey;
|
PGPSecretKey clickSecretKey = secretKey;
|
||||||
|
|
||||||
if (clickSecretKey != null) {
|
if (clickSecretKey != null) {
|
||||||
while (keyOK == true) {
|
while (keyOK) {
|
||||||
if (clickSecretKey != null) { // check again for loop
|
if (clickSecretKey != null) { // check again for loop
|
||||||
try {
|
try {
|
||||||
PBESecretKeyDecryptor keyDecryptor = new JcePBESecretKeyDecryptorBuilder()
|
PBESecretKeyDecryptor keyDecryptor = new JcePBESecretKeyDecryptorBuilder()
|
||||||
@ -207,7 +207,7 @@ public class PassphraseDialogFragment extends DialogFragment implements OnEditor
|
|||||||
// cache the new passphrase
|
// cache the new passphrase
|
||||||
Log.d(Constants.TAG, "Everything okay! Caching entered passphrase");
|
Log.d(Constants.TAG, "Everything okay! Caching entered passphrase");
|
||||||
PassphraseCacheService.addCachedPassphrase(activity, keyId, passphrase);
|
PassphraseCacheService.addCachedPassphrase(activity, keyId, passphrase);
|
||||||
if (keyOK == false && clickSecretKey.getKeyID() != keyId) {
|
if ( !keyOK && clickSecretKey.getKeyID() != keyId) {
|
||||||
PassphraseCacheService.addCachedPassphrase(activity, clickSecretKey.getKeyID(),
|
PassphraseCacheService.addCachedPassphrase(activity, clickSecretKey.getKeyID(),
|
||||||
passphrase);
|
passphrase);
|
||||||
}
|
}
|
||||||
|
@ -261,7 +261,7 @@ public class SectionView extends LinearLayout implements OnClickListener, Editor
|
|||||||
.getByteArray(KeychainIntentService.RESULT_NEW_KEY));
|
.getByteArray(KeychainIntentService.RESULT_NEW_KEY));
|
||||||
addGeneratedKeyToView(newKey);
|
addGeneratedKeyToView(newKey);
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Create a new Messenger for the communication back
|
// Create a new Messenger for the communication back
|
||||||
|
Loading…
Reference in New Issue
Block a user