Fixing lint complaints, removing unused resources

This commit is contained in:
Dominik Schürmann 2014-08-04 16:29:16 +02:00
parent 3a6ac2a16a
commit a2c1221397
38 changed files with 19 additions and 93 deletions

View File

@ -1,4 +1,4 @@
apply plugin: 'android'
apply plugin: 'com.android.application'
dependencies {
// NOTE: Always use fixed version codes not dynamic ones, e.g. 0.7.3 instead of 0.7.+, see README for more information

View File

@ -29,6 +29,7 @@ import org.sufficientlysecure.keychain.service.KeychainIntentService;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
import java.util.Set;
public class EmailKeyHelper {
@ -86,7 +87,7 @@ public class EmailKeyHelper {
for (ImportKeysListEntry key : keyServer.search(mail)) {
if (key.isRevoked() || key.isExpired()) continue;
for (String userId : key.getUserIds()) {
if (userId.toLowerCase().contains(mail.toLowerCase())) {
if (userId.toLowerCase().contains(mail.toLowerCase(Locale.ENGLISH))) {
keys.add(key);
}
}

View File

@ -251,14 +251,14 @@ public class HkpKeyserver extends Keyserver {
data = query(request);
} catch (HttpError e) {
if (e.getData() != null) {
Log.d(Constants.TAG, "returned error data: " + e.getData().toLowerCase(Locale.US));
Log.d(Constants.TAG, "returned error data: " + e.getData().toLowerCase(Locale.ENGLISH));
if (e.getData().toLowerCase(Locale.US).contains("no keys found")) {
if (e.getData().toLowerCase(Locale.ENGLISH).contains("no keys found")) {
// NOTE: This is also a 404 error for some keyservers!
return results;
} else if (e.getData().toLowerCase(Locale.US).contains("too many")) {
} else if (e.getData().toLowerCase(Locale.ENGLISH).contains("too many")) {
throw new TooManyResponsesException();
} else if (e.getData().toLowerCase(Locale.US).contains("insufficient")) {
} else if (e.getData().toLowerCase(Locale.ENGLISH).contains("insufficient")) {
throw new QueryTooShortException();
} else if (e.getCode() == 404) {
// NOTE: handle this 404 at last, maybe it was a "no keys found" error
@ -285,7 +285,7 @@ public class HkpKeyserver extends Keyserver {
// group 1 contains the full fingerprint (v4) or the long key id if available
// see http://bit.ly/1d4bxbk and http://bit.ly/1gD1wwr
String fingerprintOrKeyId = matcher.group(1).toLowerCase(Locale.US);
String fingerprintOrKeyId = matcher.group(1).toLowerCase(Locale.ENGLISH);
if (fingerprintOrKeyId.length() > 16) {
entry.setFingerprintHex(fingerprintOrKeyId);
entry.setKeyIdHex("0x" + fingerprintOrKeyId.substring(fingerprintOrKeyId.length()

View File

@ -104,7 +104,7 @@ public class PgpKeyHelper {
* @return
*/
public static String convertFingerprintToHex(byte[] fingerprint) {
String hexString = Hex.toHexString(fingerprint).toLowerCase(Locale.US);
String hexString = Hex.toHexString(fingerprint).toLowerCase(Locale.ENGLISH);
return hexString;
}
@ -133,7 +133,7 @@ public class PgpKeyHelper {
}
private static String convertKeyIdToHex32bit(long keyId) {
String hexString = Long.toHexString(keyId & 0xffffffffL).toLowerCase(Locale.US);
String hexString = Long.toHexString(keyId & 0xffffffffL).toLowerCase(Locale.ENGLISH);
while (hexString.length() < 8) {
hexString = "0" + hexString;
}

View File

@ -388,8 +388,8 @@ public class PassphraseCacheService extends Service {
} else {
// Fallback, since expandable notifications weren't available back then
builder.setSmallIcon(R.drawable.ic_launcher)
.setContentTitle(String.format(getString(R.string.passp_cache_notif_n_keys,
mPassphraseCache.size())))
.setContentTitle(String.format(getString(R.string.passp_cache_notif_n_keys),
mPassphraseCache.size()))
.setContentText(getString(R.string.passp_cache_notif_click_to_clear));
Intent intent = new Intent(getApplicationContext(), PassphraseCacheService.class);

View File

@ -103,7 +103,7 @@ public class ViewKeyActivity extends ActionBarActivity implements
@Override
protected void onCreate(Bundle savedInstanceState) {
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
supportRequestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
super.onCreate(savedInstanceState);
mExportHelper = new ExportHelper(this);

View File

@ -32,6 +32,7 @@ import org.sufficientlysecure.keychain.util.Log;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Locale;
public class EncryptKeyCompletionView extends TokenCompleteTextView {
public EncryptKeyCompletionView(Context context) {
@ -242,8 +243,8 @@ public class EncryptKeyCompletionView extends TokenCompleteTextView {
@Override
protected boolean keepObject(EncryptionKey obj, String mask) {
String m = mask.toLowerCase();
return obj.getUserId().toLowerCase().contains(m) ||
String m = mask.toLowerCase(Locale.ENGLISH);
return obj.getUserId().toLowerCase(Locale.ENGLISH).contains(m) ||
obj.getKeyIdHex().contains(m) ||
obj.getKeyIdHexShort().startsWith(m);
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 450 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 485 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 473 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 916 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 922 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 335 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 343 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 361 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 858 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 863 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 538 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 566 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 623 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 760 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 823 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 890 B

View File

@ -53,7 +53,7 @@
android:text="@string/api_settings_create_key"
android:background="@drawable/button_edgy"
android:drawableLeft="@drawable/ic_action_accounts"
android:textSize="14dip"/>
android:textSize="14sp"/>
<org.sufficientlysecure.keychain.ui.widget.FoldableLinearLayout
android:layout_width="match_parent"

View File

@ -15,7 +15,7 @@
android:text="@string/api_settings_select_key"
android:drawableLeft="@drawable/ic_action_accounts"
android:background="@drawable/button_edgy"
android:textSize="14dp"/>
android:textSize="14sp"/>
<LinearLayout
android:layout_width="match_parent"

View File

@ -143,8 +143,7 @@
android:layout_weight="1"
android:drawableRight="@drawable/ic_action_upload"
android:drawablePadding="8dp"
android:gravity="center_vertical"
android:editable="false" />
android:gravity="center_vertical" />
<View
android:layout_width="match_parent"

View File

@ -13,8 +13,6 @@
<string name="title_api_registered_apps">Apps</string>
<string name="title_key_server_preference">Keyserver Preference</string>
<string name="title_change_passphrase">Change Passphrase</string>
<string name="title_set_passphrase">Set Passphrase</string>
<string name="title_share_with">Share with…</string>
<string name="title_share_fingerprint_with">Share fingerprint with…</string>
<string name="title_share_key">Share key with…</string>
<string name="title_share_file">Share file with…</string>
@ -37,23 +35,17 @@
<string name="section_general">General</string>
<string name="section_defaults">Defaults</string>
<string name="section_advanced">Advanced</string>
<string name="section_master_key">Master Key</string>
<string name="section_master_user_id">Primary Identity</string>
<string name="section_actions">Actions</string>
<string name="section_share_key">Whole key</string>
<string name="section_certification_key">Your Key used for certification</string>
<string name="section_upload_key">Upload Key</string>
<string name="section_key_server">Keyserver</string>
<string name="section_encrypt_and_or_sign">Encrypt and/or Sign</string>
<string name="section_decrypt_verify">Decrypt and Verify</string>
<string name="section_fingerprint">Fingerprint</string>
<string name="section_key_to_certify">Key to be certified</string>
<!-- button -->
<string name="btn_certify">Certify</string>
<string name="btn_decrypt_verify_file">Decrypt, verify, and save file</string>
<string name="btn_decrypt_verify_message">Decrypt and verify message</string>
<string name="btn_decrypt_verify_clipboard">From Clipboard</string>
<string name="btn_encrypt_file">Encrypt and save file</string>
<string name="btn_encrypt_share_file">Encrypt and share file</string>
<string name="btn_save">Save</string>
@ -61,16 +53,10 @@
<string name="btn_delete">Delete</string>
<string name="btn_no_date">None</string>
<string name="btn_okay">Okay</string>
<string name="btn_change_passphrase">Change New Passphrase</string>
<string name="btn_set_passphrase">Set New Passphrase</string>
<string name="btn_export_to_server">Upload To Keyserver</string>
<string name="btn_next">Next</string>
<string name="btn_back">Back</string>
<string name="btn_clipboard">Clipboard</string>
<string name="btn_share">Share with…</string>
<string name="btn_lookup_key">Lookup key</string>
<string name="btn_encryption_advanced_settings_show">Show advanced settings</string>
<string name="btn_encryption_advanced_settings_hide">Hide advanced settings</string>
<string name="btn_share_encrypted_signed">Encrypt and share message</string>
<string name="btn_view_cert_key">View certification key</string>
<string name="btn_create_key">Create key</string>
@ -84,16 +70,6 @@
<string name="menu_create_key">Create my key</string>
<string name="menu_import_existing_key">Import existing key</string>
<string name="menu_search">Search</string>
<string name="menu_key_server">Keyserver…</string>
<string name="menu_share">Share…</string>
<string name="menu_share_title_fingerprint">Share fingerprint…</string>
<string name="menu_share_title">Share whole key…</string>
<string name="menu_share_default_fingerprint">with…</string>
<string name="menu_share_default">with…</string>
<string name="menu_share_qr_code">with QR Code</string>
<string name="menu_share_qr_code_fingerprint">with QR Code</string>
<string name="menu_share_nfc">with NFC</string>
<string name="menu_copy_to_clipboard">Copy to clipboard</string>
<string name="menu_beam_preferences">Beam settings</string>
<string name="menu_key_edit_cancel">Cancel</string>
<string name="menu_encrypt_to">Encrypt to…</string>
@ -103,7 +79,6 @@
<string name="menu_advanced">Show advanced info</string>
<!-- label -->
<string name="label_sign">Sign</string>
<string name="label_message">Message</string>
<string name="label_file">File</string>
<string name="label_files">File(s)</string>
@ -116,12 +91,10 @@
<string name="label_file_ascii_armor">Files: ASCII Armor</string>
<string name="label_conceal_pgp_application">Let others know that you\'re using OpenKeychain</string>
<string name="label_conceal_pgp_application_summary">Writes \'OpenKeychain v2.7\' to OpenPGP signatures, ciphertext, and exported keys</string>
<string name="label_select_public_keys">Recipients</string>
<string name="label_asymmetric_from">From:</string>
<string name="label_to">To</string>
<string name="label_delete_after_encryption">Files: Delete After Encryption</string>
<string name="label_delete_after_decryption">Delete After Decryption</string>
<string name="label_share_after_encryption">Share After Encryption</string>
<string name="label_encryption_algorithm">Encryption Algorithm</string>
<string name="label_hash_algorithm">Hash Algorithm</string>
<string name="label_asymmetric">With Public Key</string>
@ -142,14 +115,8 @@
<string name="label_email">Email</string>
<string name="label_send_key">Upload key to selected keyserver after certification</string>
<string name="label_fingerprint">Fingerprint</string>
<string name="select_keys_button_default">Select</string>
<string name="expiry_date_dialog_title">Set expiry date</string>
<plurals name="select_keys_button">
<item quantity="one">%d selected</item>
<item quantity="other">%d selected</item>
</plurals>
<string name="user_id_no_name">&lt;no name&gt;</string>
<string name="none">&lt;none&gt;</string>
<string name="no_key">&lt;no key&gt;</string>
@ -202,9 +169,7 @@
<!-- sentences -->
<string name="wrong_passphrase">Wrong passphrase.</string>
<string name="set_a_passphrase">Set a passphrase first.</string>
<string name="no_filemanager_installed">No compatible file manager installed.</string>
<string name="filemanager_no_write">The file manager does not support saving files.</string>
<string name="passphrases_do_not_match">The passphrases didn\'t match.</string>
<string name="passphrase_must_not_be_empty">Please enter a passphrase.</string>
<string name="passphrase_for_symmetric_encryption">Symmetric encryption.</string>
@ -222,8 +187,6 @@
<string name="specify_file_to_export_to">Please specify which file to export to.\nWARNING: File will be overwritten if it exists.</string>
<string name="key_deletion_confirmation_multi">Do you really want to delete all selected public keys?\nYou can\'t undo this!</string>
<string name="secret_key_deletion_confirmation">Do you really want to delete the SECRET key \'%s\'?\nYou can\'t undo this!</string>
<string name="ask_save_changed_key">You have made changes to the keyring, would you like to save it?</string>
<string name="ask_empty_id_ok">You have added an empty identity, are you sure you want to continue?</string>
<string name="public_key_deletetion_confirmation">Do you really want to delete the public key \'%s\'?\nYou can\'t undo this!</string>
<string name="also_export_secret_keys">Also export secret keys</string>
@ -244,7 +207,6 @@
<string name="nfc_successful">Successfully sent key with NFC Beam!</string>
<string name="key_copied_to_clipboard">Key has been copied to the clipboard!</string>
<string name="fingerprint_copied_to_clipboard">Fingerprint has been copied to the clipboard!</string>
<string name="key_has_already_been_certified">Key has already been certified!</string>
<string name="select_key_to_certify">Please select a key to be used for certification!</string>
<string name="key_too_big_for_sharing">Key is too big to be shared this way!</string>
@ -258,23 +220,17 @@
<string name="error_no_secret_key_found">no suitable secret key found</string>
<string name="error_external_storage_not_ready">external storage not ready</string>
<string name="error_key_size_minimum512bit">key size must be at least 512bit</string>
<string name="error_master_key_must_not_be_el_gamal">the master key cannot be an ElGamal key</string>
<string name="error_unknown_algorithm_choice">unknown algorithm choice</string>
<string name="error_user_id_no_email">no email found</string>
<string name="error_key_needs_a_user_id">need at least one identity</string>
<string name="error_main_user_id_must_not_be_empty">primary identity must not be empty</string>
<string name="error_key_needs_master_key">need at least a master key</string>
<string name="error_no_signature_passphrase">no passphrase given</string>
<string name="error_no_signature_key">no signature key given</string>
<string name="error_invalid_data">not valid encryption data</string>
<string name="error_integrity_check_failed">integrity check failed! Data has been modified!</string>
<string name="error_wrong_passphrase">wrong passphrase</string>
<string name="error_saving_keys">error saving some keys</string>
<string name="error_could_not_extract_private_key">could not extract private key</string>
<string name="error_expiry_must_come_after_creation">expiry date must come after creation date</string>
<!-- errors without preceeding Error: -->
<string name="error_only_files_are_supported">Direct binary data without actual file in filesystem is not supported.</string>
<string name="error_jelly_bean_needed">You need Android 4.1 to use Android\'s NFC Beam feature!</string>
<string name="error_nfc_needed">NFC is not available on your device!</string>
<string name="error_nothing_import">No keys found!</string>
@ -289,7 +245,6 @@
<item quantity="one">part of the loaded file is a valid OpenPGP object but not a OpenPGP key</item>
<item quantity="other">parts of the loaded file are valid OpenPGP objects but not OpenPGP keys</item>
</plurals>
<string name="error_change_something_first">You must make changes to the keyring before you can save it</string>
<!-- results shown after decryption/verification -->
<string name="decrypt_result_invalid_signature">Invalid signature!</string>
@ -309,10 +264,7 @@
<string name="progress_exporting">exporting…</string>
<string name="progress_uploading">uploading…</string>
<string name="progress_building_key">building key…</string>
<string name="progress_certifying_master_key">certifying master key…</string>
<string name="progress_building_master_key">building master ring…</string>
<string name="progress_adding_sub_keys">adding sub keys…</string>
<string name="progress_saving_key_ring">saving key…</string>
<string name="progress_generating_rsa">generating new RSA key…</string>
<string name="progress_generating_dsa">generating new DSA key…</string>
<string name="progress_generating_elgamal">generating new ElGamal key…</string>
@ -333,11 +285,6 @@
<item quantity="other">exporting keys…</item>
</plurals>
<plurals name="progress_generating">
<item quantity="one">generating key, this can take up to 3 minutes…</item>
<item quantity="other">generating keys, this can take up to 3 minutes…</item>
</plurals>
<string name="progress_extracting_signature_key">extracting signature key…</string>
<string name="progress_extracting_key">extracting key…</string>
<string name="progress_preparing_streams">preparing streams…</string>
@ -357,7 +304,6 @@
<!-- action strings -->
<string name="hint_public_keys">Name/Email/Key ID…</string>
<string name="action_share_key_with">Share Key with…</string>
<string name="hint_keybase_search">Name/Keybase.io username…</string>
<!-- key bit length selections -->
@ -393,23 +339,9 @@
<string name="import_tab_qr_code">QR Code/NFC</string>
<string name="import_tab_keybase">Keybase.io</string>
<string name="import_import">Import selected keys</string>
<string name="import_from_clipboard">Import from clipboard</string>
<plurals name="import_qr_code_missing">
<item quantity="one">Missing QR Code with ID %s</item>
<item quantity="other">Missing QR Codes with IDs %s</item>
</plurals>
<string name="import_qr_code_start_with_one">Please start with QR Code with ID 1</string>
<string name="import_qr_code_wrong">QR Code malformed! Please try again!</string>
<string name="import_qr_code_finished">QR Code scanning finished!</string>
<string name="import_qr_code_too_short_fingerprint">Fingerprint is too short (&lt; 16 characters)</string>
<string name="import_qr_scan_button">Scan QR Code with \'Barcode Scanner\'</string>
<string name="import_nfc_text">To receive keys via NFC, the device needs to be unlocked.</string>
<string name="import_nfc_help_button">Help</string>
<string name="import_qr_code_button">Scan QR Code…</string>
<string name="import_clipboard_button">Get key from clipboard</string>
<string name="import_keybase_button">Get key from Keybase.io</string>
<!-- Import result toast -->
<plurals name="import_keys_added_and_updated_1">
@ -469,9 +401,6 @@
<!-- Share -->
<string name="share_qr_code_dialog_title">Share with QR Code</string>
<string name="share_qr_code_dialog_start">Go through all QR Codes using \'Next\', and scan them one by one.</string>
<string name="share_qr_code_dialog_fingerprint_text">Fingerprint:</string>
<string name="share_qr_code_dialog_progress">QR Code with ID %1$d of %2$d</string>
<string name="share_nfc_dialog">Share with NFC</string>
<!-- Key list -->
@ -531,11 +460,9 @@
<string name="nav_keys">Keys</string>
<string name="nav_encrypt">Sign and Encrypt</string>
<string name="nav_decrypt">Decrypt and Verify</string>
<string name="nav_import">Import Keys</string>
<string name="nav_apps">Apps</string>
<string name="drawer_open">Open navigation drawer</string>
<string name="drawer_close">Close navigation drawer</string>
<string name="edit">Edit</string>
<string name="my_keys">My Keys</string>
<!-- hints -->
@ -736,13 +663,11 @@
<string name="label_cert_type">Type</string>
<string name="error_key_not_found">Key not found!</string>
<string name="error_key_processing">Error processing key!</string>
<string name="no_subkey">subkey unavailable</string>
<string name="key_stripped">stripped</string>
<string name="secret_cannot_multiple">Your own keys can only be deleted individually!</string>
<string name="title_view_cert">View Certificate Details</string>
<string name="unknown_algorithm">unknown</string>
<string name="can_sign_not">cannot sign</string>
<string name="error_encoding">Encoding error</string>
<string name="error_no_encrypt_subkey">No encryption subkey available!</string>
<string name="info_no_manual_account_creation">Do not create OpenKeychain-Accounts manually.\nFor more information, see Help.</string>
<string name="contact_show_key">Show key (%s)</string>