diff options
author | steckbrief <steckbrief@chefmail.de> | 2015-11-20 22:41:30 +0100 |
---|---|---|
committer | steckbrief <steckbrief@chefmail.de> | 2015-11-20 22:41:30 +0100 |
commit | 2531c88f2c8a992aa0c40c9f96e88099dc94139e (patch) | |
tree | e3815b7f1ef0bbd227df8c4452d4aa52b54830e4 /src/main/java/de/thedevstack/conversationsplus/entities | |
parent | 8838a5094812e0540ccfef3334e49e1a5c1a564b (diff) |
Implements FS#67: Introduce central logging class to use log prefix, new activity to show logcat output and button to copy contents
Diffstat (limited to 'src/main/java/de/thedevstack/conversationsplus/entities')
-rw-r--r-- | src/main/java/de/thedevstack/conversationsplus/entities/DownloadableFile.java | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/main/java/de/thedevstack/conversationsplus/entities/DownloadableFile.java b/src/main/java/de/thedevstack/conversationsplus/entities/DownloadableFile.java index 9a677cd0..8d608ae7 100644 --- a/src/main/java/de/thedevstack/conversationsplus/entities/DownloadableFile.java +++ b/src/main/java/de/thedevstack/conversationsplus/entities/DownloadableFile.java @@ -22,7 +22,7 @@ import javax.crypto.spec.SecretKeySpec; import de.thedevstack.conversationsplus.Config; import de.thedevstack.conversationsplus.utils.MimeUtils; -import android.util.Log; +import de.thedevstack.conversationsplus.utils.Logging; public class DownloadableFile extends File { @@ -114,19 +114,19 @@ public class DownloadableFile extends File { IvParameterSpec ips = new IvParameterSpec(iv); Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding"); cipher.init(Cipher.ENCRYPT_MODE, this.getKey(), ips); - Log.d(Config.LOGTAG, "opening encrypted input stream"); + Logging.d(Config.LOGTAG, "opening encrypted input stream"); return new CipherInputStream(new FileInputStream(this), cipher); } catch (NoSuchAlgorithmException e) { - Log.d(Config.LOGTAG, "no such algo: " + e.getMessage()); + Logging.d(Config.LOGTAG, "no such algo: " + e.getMessage()); return null; } catch (NoSuchPaddingException e) { - Log.d(Config.LOGTAG, "no such padding: " + e.getMessage()); + Logging.d(Config.LOGTAG, "no such padding: " + e.getMessage()); return null; } catch (InvalidKeyException e) { - Log.d(Config.LOGTAG, "invalid key: " + e.getMessage()); + Logging.d(Config.LOGTAG, "invalid key: " + e.getMessage()); return null; } catch (InvalidAlgorithmParameterException e) { - Log.d(Config.LOGTAG, "invavid iv:" + e.getMessage()); + Logging.d(Config.LOGTAG, "invavid iv:" + e.getMessage()); return null; } catch (FileNotFoundException e) { return null; @@ -146,20 +146,20 @@ public class DownloadableFile extends File { IvParameterSpec ips = new IvParameterSpec(this.iv); Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding"); cipher.init(Cipher.DECRYPT_MODE, this.getKey(), ips); - Log.d(Config.LOGTAG, "opening encrypted output stream"); + Logging.d(Config.LOGTAG, "opening encrypted output stream"); return new CipherOutputStream(new FileOutputStream(this), cipher); } catch (NoSuchAlgorithmException e) { - Log.d(Config.LOGTAG, "no such algo: " + e.getMessage()); + Logging.d(Config.LOGTAG, "no such algo: " + e.getMessage()); return null; } catch (NoSuchPaddingException e) { - Log.d(Config.LOGTAG, "no such padding: " + e.getMessage()); + Logging.d(Config.LOGTAG, "no such padding: " + e.getMessage()); return null; } catch (InvalidKeyException e) { - Log.d(Config.LOGTAG, "invalid key: " + e.getMessage()); + Logging.d(Config.LOGTAG, "invalid key: " + e.getMessage()); return null; } catch (InvalidAlgorithmParameterException e) { - Log.d(Config.LOGTAG, "invavid iv:" + e.getMessage()); + Logging.d(Config.LOGTAG, "invavid iv:" + e.getMessage()); return null; } catch (FileNotFoundException e) { return null; |