mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 04:43:54 +01:00
Removed unnecessary comments
This commit is contained in:
parent
d2982845ff
commit
630eebeeac
2 changed files with 1 additions and 41 deletions
|
|
@ -79,43 +79,6 @@ public class Utils {
|
||||||
Log.e(TAG, "Exception on closing MD5 input stream", e);
|
Log.e(TAG, "Exception on closing MD5 input stream", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean testSHA1(String sha1, InputStream is) {
|
|
||||||
MessageDigest digest;
|
|
||||||
try {
|
|
||||||
digest = MessageDigest.getInstance("SHA1");
|
|
||||||
} catch (NoSuchAlgorithmException e) {
|
|
||||||
Log.e(TAG, "Exception while getting Digest", e);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
byte[] buffer = new byte[8192];
|
|
||||||
int read;
|
|
||||||
try {
|
|
||||||
while ((read = is.read(buffer)) > 0) {
|
|
||||||
digest.update(buffer, 0, read);
|
|
||||||
}
|
|
||||||
byte[] md5sum = digest.digest();
|
|
||||||
BigInteger bigInt = new BigInteger(1, md5sum);
|
|
||||||
String output = bigInt.toString(16);
|
|
||||||
// Fill to 40 chars
|
|
||||||
output = String.format("%40s", output).replace(' ', '0');
|
|
||||||
|
|
||||||
Log.i(TAG, "Test: " + sha1);
|
|
||||||
Log.i(TAG, "Generated: " + output);
|
|
||||||
|
|
||||||
return (sha1.equals(output));
|
|
||||||
} catch (IOException e) {
|
|
||||||
throw new RuntimeException("Unable to process file for MD5", e);
|
|
||||||
} finally {
|
|
||||||
try {
|
|
||||||
is.close();
|
|
||||||
} catch (IOException e) {
|
|
||||||
Log.e(TAG, "Exception on closing MD5 input stream", e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Date parseMWDate(String mwDate) {
|
public static Date parseMWDate(String mwDate) {
|
||||||
|
|
|
||||||
|
|
@ -259,10 +259,7 @@ public class ShareActivity
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
Log.d(TAG, "IO Exception: ", e);
|
Log.d(TAG, "IO Exception: ", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//File imageFile = new File(mediaUri.getPath());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(savedInstanceState != null) {
|
if(savedInstanceState != null) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue