diff --git a/README.md b/README.md index 862f026..eb8f833 100644 --- a/README.md +++ b/README.md @@ -31,4 +31,4 @@ This library is maintained by CodeDead. You can find more about us using the fol * [Twitter](https://twitter.com/C0DEDEAD) * [Facebook](https://facebook.com/deadlinecodedead) -Copyright © 2022 CodeDead +Copyright © 2023 CodeDead diff --git a/app/build.gradle b/app/build.gradle index 470560e..b5223a2 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,15 +1,14 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 31 - buildToolsVersion '30.0.3' + compileSdk 34 defaultConfig { applicationId "com.codedead.deadhash" - minSdkVersion 24 - targetSdkVersion 31 - versionName '1.7.8' + minSdk 28 + targetSdk 34 + versionName '1.8.0' testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - versionCode 9 + versionCode 10 } buildTypes { release { @@ -20,20 +19,21 @@ android { productFlavors { } compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 } + namespace 'com.codedead.deadhash' } dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') - androidTestImplementation('androidx.test.espresso:espresso-core:3.4.0', { + androidTestImplementation('androidx.test.espresso:espresso-core:3.5.1', { exclude group: 'com.android.support', module: 'support-annotations' }) - implementation 'androidx.appcompat:appcompat:1.4.1' - implementation 'com.google.android.material:material:1.5.0' - implementation 'androidx.constraintlayout:constraintlayout:2.1.3' + implementation 'androidx.appcompat:appcompat:1.6.1' + implementation 'com.google.android.material:material:1.10.0' + implementation 'androidx.constraintlayout:constraintlayout:2.1.4' implementation 'androidx.cardview:cardview:1.0.0' - implementation "androidx.preference:preference:1.2.0" + implementation 'androidx.preference:preference:1.2.1' testImplementation 'junit:junit:4.13.2' } diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 7ff828b..63a83ab 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,9 +1,10 @@ + xmlns:tools="http://schemas.android.com/tools"> - + + + hashAlgorithms, final String compare) { + super(hashAlgorithms, compare); + + if (uri == null) + throw new NullPointerException("File cannot be null!"); + if (contentResolver == null) + throw new NullPointerException("ContentResolver cannot be null!"); + + this.uri = uri; + this.contentResolver = contentResolver; + } + + /** + * Generate the List of HashData for the given input data + * + * @return The List of HashData for the given input data + */ + @Override + public List generateHashes() { + for (final HashAlgorithm algorithm : super.getHashAlgorithms()) { + switch (algorithm) { + case md5 -> { + final String md5 = HashUtil.calculateHash(uri, contentResolver, "MD5"); + getHashData().add(new HashData("MD5", md5, getCompare())); + } + case sha1 -> { + final String sha1 = HashUtil.calculateHash(uri, contentResolver, "SHA-1"); + getHashData().add(new HashData("SHA-1", sha1, getCompare())); + } + case sha224 -> { + final String sha224 = HashUtil.calculateHash(uri, contentResolver, "SHA-224"); + getHashData().add(new HashData("SHA-224", sha224, getCompare())); + } + case sha256 -> { + final String sha256 = HashUtil.calculateHash(uri, contentResolver, "SHA-256"); + getHashData().add(new HashData("SHA-256", sha256, getCompare())); + } + case sha384 -> { + final String sha384 = HashUtil.calculateHash(uri, contentResolver, "SHA-384"); + getHashData().add(new HashData("SHA-384", sha384, getCompare())); + } + case sha512 -> { + final String sha512 = HashUtil.calculateHash(uri, contentResolver, "SHA-512"); + getHashData().add(new HashData("SHA-512", sha512, getCompare())); + } + case crc32 -> { + final String crc32 = HashUtil.calculateCRC32(uri, contentResolver); + getHashData().add(new HashData("CRC32", crc32, getCompare())); + } + } + } + + return getHashData(); + } +} diff --git a/app/src/main/java/com/codedead/deadhash/domain/objects/hashgenerator/HashData.java b/app/src/main/java/com/codedead/deadhash/domain/objects/hashgenerator/HashData.java index 6078211..732b899 100644 --- a/app/src/main/java/com/codedead/deadhash/domain/objects/hashgenerator/HashData.java +++ b/app/src/main/java/com/codedead/deadhash/domain/objects/hashgenerator/HashData.java @@ -10,7 +10,7 @@ public class HashData implements Parcelable { private final String compareCheck; - public static final Creator CREATOR = new Creator() { + public static final Creator CREATOR = new Creator<>() { @Override public HashData createFromParcel(final Parcel in) { return new HashData(in); diff --git a/app/src/main/java/com/codedead/deadhash/domain/objects/hashgenerator/HashGenerator.java b/app/src/main/java/com/codedead/deadhash/domain/objects/hashgenerator/HashGenerator.java index 5a13ba8..b8fb5ad 100644 --- a/app/src/main/java/com/codedead/deadhash/domain/objects/hashgenerator/HashGenerator.java +++ b/app/src/main/java/com/codedead/deadhash/domain/objects/hashgenerator/HashGenerator.java @@ -1,16 +1,9 @@ package com.codedead.deadhash.domain.objects.hashgenerator; -import com.codedead.deadhash.domain.utils.HashUtil; - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; import java.util.ArrayList; import java.util.List; -public final class HashGenerator { - - private final byte[] data; +public abstract class HashGenerator implements IHashGenerator { private final List hashAlgorithms; private final List hashData; private final String compare; @@ -18,100 +11,39 @@ public final class HashGenerator { /** * Initialize a new HashGenerator * - * @param data The byte array that should be hashed * @param hashAlgorithms The List of HashingAlgorithm enums that should be used to calculate hashes * @param compare The compare String for the calculated hashes */ - public HashGenerator(final byte[] data, final List hashAlgorithms, final String compare) { + public HashGenerator(final List hashAlgorithms, final String compare) { hashData = new ArrayList<>(); - this.data = data; - this.hashAlgorithms = hashAlgorithms; this.compare = compare; } /** - * Initialize a new HashGenerator + * Get the List of HashData for the given input data * - * @param data The byte array that should be hashed - * @param hashAlgorithms The List of HashingAlgorithm enums that should be used to calculate hashes - * @param compare The compare String for the calculated hashes - * @throws IOException When the File could not be read + * @return The List of HashData for the given input data */ - public HashGenerator(final File data, final List hashAlgorithms, final String compare) throws IOException { - hashData = new ArrayList<>(); - this.data = readFileToBytes(data); - this.hashAlgorithms = hashAlgorithms; - this.compare = compare; + public List getHashAlgorithms() { + return hashAlgorithms; } /** - * Read a file and return a byte array that represents the given File + * Get the List of HashData for the given input data * - * @param file The File that should be read - * @return The byte array that represents the given File - * @throws IOException When the File could not be read + * @return The List of HashData for the given input data */ - private byte[] readFileToBytes(final File file) throws IOException { - if (file == null) - throw new NullPointerException("File cannot be null!"); - - final int size = (int) file.length(); - final byte[] bytes = new byte[size]; - final byte[] tmpBuff = new byte[size]; - try (final FileInputStream fis = new FileInputStream(file)) { - int read = fis.read(bytes, 0, size); - if (read < size) { - int remain = size - read; - while (remain > 0) { - read = fis.read(tmpBuff, 0, remain); - System.arraycopy(tmpBuff, 0, bytes, size - remain, read); - remain -= read; - } - } - } - - return bytes; + public List getHashData() { + return hashData; } /** - * Generate the List of HashData for the given input data - * @return The List of HashData for the given input data + * Get the compare String for the calculated hashes + * + * @return The compare String for the calculated hashes */ - public final List generateHashes() { - for (final HashAlgorithm algorithm : hashAlgorithms) { - switch (algorithm) { - case md5: - final String md5 = HashUtil.calculateHash(data, "MD5"); - hashData.add(new HashData("MD5", md5, compare)); - break; - case sha1: - final String sha1 = HashUtil.calculateHash(data, "SHA-1"); - hashData.add(new HashData("SHA-1", sha1, compare)); - break; - case sha224: - final String sha224 = HashUtil.calculateHash(data, "SHA-224"); - hashData.add(new HashData("SHA-224", sha224, compare)); - break; - case sha256: - final String sha256 = HashUtil.calculateHash(data, "SHA-256"); - hashData.add(new HashData("SHA-256", sha256, compare)); - break; - case sha384: - final String sha384 = HashUtil.calculateHash(data, "SHA-384"); - hashData.add(new HashData("SHA-384", sha384, compare)); - break; - case sha512: - final String sha512 = HashUtil.calculateHash(data, "SHA-512"); - hashData.add(new HashData("SHA-512", sha512, compare)); - break; - case crc32: - final String crc32 = HashUtil.calculateCRC32(data); - hashData.add(new HashData("CRC32", crc32, compare)); - break; - } - } - - return hashData; + public String getCompare() { + return compare; } } diff --git a/app/src/main/java/com/codedead/deadhash/domain/objects/hashgenerator/IHashGenerator.java b/app/src/main/java/com/codedead/deadhash/domain/objects/hashgenerator/IHashGenerator.java new file mode 100644 index 0000000..b59e143 --- /dev/null +++ b/app/src/main/java/com/codedead/deadhash/domain/objects/hashgenerator/IHashGenerator.java @@ -0,0 +1,7 @@ +package com.codedead.deadhash.domain.objects.hashgenerator; + +import java.util.List; + +public interface IHashGenerator { + List generateHashes(); +} diff --git a/app/src/main/java/com/codedead/deadhash/domain/objects/hashgenerator/TextHashGenerator.java b/app/src/main/java/com/codedead/deadhash/domain/objects/hashgenerator/TextHashGenerator.java new file mode 100644 index 0000000..851ea78 --- /dev/null +++ b/app/src/main/java/com/codedead/deadhash/domain/objects/hashgenerator/TextHashGenerator.java @@ -0,0 +1,71 @@ +package com.codedead.deadhash.domain.objects.hashgenerator; + +import com.codedead.deadhash.domain.utils.HashUtil; + +import java.util.List; + +public final class TextHashGenerator extends HashGenerator { + + private final String data; + + /** + * Initialize a new TextHashGenerator + * + * @param data The String that should be hashed + * @param hashAlgorithms The List of HashingAlgorithm enums that should be used to calculate hashes + * @param compare The compare String for the calculated hashes + */ + public TextHashGenerator(final String data, List hashAlgorithms, String compare) { + super(hashAlgorithms, compare); + + if (data == null) + throw new NullPointerException("Data cannot be null!"); + if (data.isEmpty()) + throw new IllegalArgumentException("Data cannot be empty!"); + + this.data = data; + } + + /** + * Generate the List of HashData for the given input data + * + * @return The List of HashData for the given input data + */ + @Override + public List generateHashes() { + for (final HashAlgorithm algorithm : super.getHashAlgorithms()) { + switch (algorithm) { + case md5 -> { + final String md5 = HashUtil.calculateHash(data.getBytes(), "MD5"); + getHashData().add(new HashData("MD5", md5, getCompare())); + } + case sha1 -> { + final String sha1 = HashUtil.calculateHash(data.getBytes(), "SHA-1"); + getHashData().add(new HashData("SHA-1", sha1, getCompare())); + } + case sha224 -> { + final String sha224 = HashUtil.calculateHash(data.getBytes(), "SHA-224"); + getHashData().add(new HashData("SHA-224", sha224, getCompare())); + } + case sha256 -> { + final String sha256 = HashUtil.calculateHash(data.getBytes(), "SHA-256"); + getHashData().add(new HashData("SHA-256", sha256, getCompare())); + } + case sha384 -> { + final String sha384 = HashUtil.calculateHash(data.getBytes(), "SHA-384"); + getHashData().add(new HashData("SHA-384", sha384, getCompare())); + } + case sha512 -> { + final String sha512 = HashUtil.calculateHash(data.getBytes(), "SHA-512"); + getHashData().add(new HashData("SHA-512", sha512, getCompare())); + } + case crc32 -> { + final String crc32 = HashUtil.calculateCRC32(data.getBytes()); + getHashData().add(new HashData("CRC32", crc32, getCompare())); + } + } + } + + return getHashData(); + } +} diff --git a/app/src/main/java/com/codedead/deadhash/domain/utils/HashUtil.java b/app/src/main/java/com/codedead/deadhash/domain/utils/HashUtil.java index 7f906c1..0c20410 100644 --- a/app/src/main/java/com/codedead/deadhash/domain/utils/HashUtil.java +++ b/app/src/main/java/com/codedead/deadhash/domain/utils/HashUtil.java @@ -1,6 +1,12 @@ package com.codedead.deadhash.domain.utils; +import android.content.ContentResolver; +import android.net.Uri; + +import java.io.IOException; +import java.io.InputStream; import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; import java.util.zip.CRC32; public final class HashUtil { @@ -49,6 +55,36 @@ public static String calculateHash(final byte[] bytes, final String kind) { } } + /** + * Calculate the hash of a specified file using the specified message digest + * + * @param uri The Uri of the file that should be hashed + * @param contentResolver The ContentResolver that should be used to open the file + * @param kind The message digest + * @return The String object that contains the hash of the file using the specified message digest + */ + public static String calculateHash(final Uri uri, final ContentResolver contentResolver, final String kind) { + try { + final MessageDigest md = MessageDigest.getInstance(kind); + try (final InputStream fis = contentResolver.openInputStream(uri)) { + if (fis == null) + return null; + + final byte[] dataBytes = new byte[1024]; + + int nread; + while ((nread = fis.read(dataBytes)) != -1) { + md.update(dataBytes, 0, nread); + } + + final byte[] mdBytes = md.digest(); + return convertToHex(mdBytes); + } + } catch (final NoSuchAlgorithmException | IOException ex) { + return null; + } + } + /** * Calculate the CRC32 value of a specified byte array * @@ -64,4 +100,32 @@ public static String calculateCRC32(final byte[] bytes) { return null; } } + + /** + * Calculate the CRC32 value of a specified file + * + * @param uri The Uri of the file that should be hashed + * @param contentResolver The ContentResolver that should be used to open the file + * @return The String object that represents the CRC32 value of the given file + */ + public static String calculateCRC32(final Uri uri, final ContentResolver contentResolver) { + try { + final CRC32 crc = new CRC32(); + try (final InputStream fis = contentResolver.openInputStream(uri)) { + if (fis == null) + return null; + + final byte[] dataBytes = new byte[1024]; + + int nread; + while ((nread = fis.read(dataBytes)) != -1) { + crc.update(dataBytes, 0, nread); + } + + return Long.toHexString(crc.getValue()); + } + } catch (final IOException ex) { + return null; + } + } } diff --git a/app/src/main/java/com/codedead/deadhash/gui/MainActivity.java b/app/src/main/java/com/codedead/deadhash/gui/MainActivity.java index 1219ab8..3211c59 100644 --- a/app/src/main/java/com/codedead/deadhash/gui/MainActivity.java +++ b/app/src/main/java/com/codedead/deadhash/gui/MainActivity.java @@ -1,14 +1,16 @@ package com.codedead.deadhash.gui; import android.Manifest; +import android.annotation.SuppressLint; import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; import android.content.res.Configuration; +import android.database.Cursor; import android.net.Uri; +import android.os.Build; import android.os.Bundle; import android.os.CountDownTimer; -import android.os.Handler; import androidx.activity.result.ActivityResultLauncher; import androidx.activity.result.contract.ActivityResultContracts; @@ -21,10 +23,11 @@ import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; +import com.codedead.deadhash.domain.objects.hashgenerator.FileHashGenerator; import com.codedead.deadhash.domain.objects.hashgenerator.HashAlgorithm; +import com.codedead.deadhash.domain.objects.hashgenerator.TextHashGenerator; import com.codedead.deadhash.domain.objects.settings.SettingsContainer; import com.codedead.deadhash.domain.utils.IntentUtils; -import com.codedead.deadhash.domain.utils.StreamUtility; import com.google.android.material.navigation.NavigationView; import androidx.core.view.GravityCompat; @@ -33,11 +36,12 @@ import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.widget.Toolbar; -import android.os.Looper; +import android.provider.OpenableColumns; import android.text.method.LinkMovementMethod; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; +import android.view.SubMenu; import android.view.View; import android.widget.Button; import android.widget.EditText; @@ -50,20 +54,14 @@ import com.codedead.deadhash.R; import com.codedead.deadhash.domain.utils.DataAdapter; import com.codedead.deadhash.domain.objects.hashgenerator.HashData; -import com.codedead.deadhash.domain.objects.hashgenerator.HashGenerator; import com.codedead.deadhash.domain.utils.LocaleHelper; -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; import java.util.ArrayList; import java.util.List; import java.util.Random; import java.util.concurrent.CompletableFuture; public class MainActivity extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener { - private boolean doubleBackToExitPressedOnce; private ViewFlipper viewFlipper; private EditText edtFileCompare; @@ -91,10 +89,8 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On private boolean textLoading; private boolean paused; - - private final String tmpFile = "tmpFile"; private String lastLanguage; - + private Uri fileUri; private ActivityResultLauncher activityResultLauncher; @Override @@ -125,17 +121,22 @@ protected void onCreate(final Bundle savedInstanceState) { viewFlipper.setDisplayedChild(flipperPosition); if (flipperPosition > 1) { - navigationView.setCheckedItem(navigationView.getMenu().getItem(1).getSubMenu().getItem(flipperPosition - 2).getItemId()); + final SubMenu menu = navigationView.getMenu().getItem(1).getSubMenu(); + if (menu != null) { + navigationView.setCheckedItem(menu.getItem(flipperPosition - 2).getItemId()); + } } else { - navigationView.setCheckedItem(navigationView.getMenu().getItem(0).getSubMenu().getItem(flipperPosition).getItemId()); + final SubMenu menu = navigationView.getMenu().getItem(0).getSubMenu(); + if (menu != null) { + navigationView.setCheckedItem(menu.getItem(flipperPosition).getItemId()); + } } + } else { + final SubMenu menu = navigationView.getMenu().getItem(0).getSubMenu(); - if (!savedInstanceState.getBoolean("KEEP_FILE")) { - deleteTempFile(); + if (menu != null) { + navigationView.setCheckedItem(menu.getItem(0).getItemId()); } - } else { - navigationView.setCheckedItem(navigationView.getMenu().getItem(0).getSubMenu().getItem(0).getItemId()); - deleteTempFile(); } loadFileHashContent(savedInstanceState); @@ -149,24 +150,14 @@ protected void onCreate(final Bundle savedInstanceState) { new ActivityResultContracts.StartActivityForResult(), result -> { if (result.getData() != null) { - final Uri selectedFileUri = result.getData().getData(); - if (selectedFileUri != null) { - try (final InputStream selectedFileStream = getContentResolver().openInputStream(selectedFileUri)) { - final File outputFile = new File(getApplicationContext().getCacheDir(), tmpFile); - - try (final FileOutputStream outputStream = new FileOutputStream(outputFile, false)) { - if (selectedFileStream != null) { - StreamUtility.copyStream(selectedFileStream, outputStream); - edtFilePath.setText(selectedFileUri.getPath()); - } else { - Toast.makeText(getApplicationContext(), R.string.error_open_file, Toast.LENGTH_SHORT).show(); - } - } catch (final IOException ex) { - Toast.makeText(getApplicationContext() - , R.string.error_copy_file, Toast.LENGTH_SHORT).show(); + fileUri = result.getData().getData(); + if (fileUri != null) { + try (Cursor cursor = this.getContentResolver() + .query(fileUri, null, null, null, null, null)) { + if (cursor != null && cursor.moveToFirst()) { + @SuppressLint("Range") String displayName = cursor.getString(cursor.getColumnIndex(OpenableColumns.DISPLAY_NAME)); + edtFilePath.setText(displayName); } - } catch (final IOException ex) { - Toast.makeText(getApplicationContext(), R.string.error_open_file, Toast.LENGTH_SHORT).show(); } } else { Toast.makeText(getApplicationContext(), R.string.error_open_file, Toast.LENGTH_SHORT).show(); @@ -180,15 +171,10 @@ protected void onCreate(final Bundle savedInstanceState) { */ private void loadTheme() { switch (settingsContainer.getTheme()) { - case "0": - AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO); - break; - case "1": - AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES); - break; - case "2": - AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM); - break; + case "0" -> AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO); + case "1" -> AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES); + case "2" -> + AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM); } } @@ -208,17 +194,6 @@ public boolean onOptionsItemSelected(final MenuItem item) { return super.onOptionsItemSelected(item); } - /** - * Delete the temporary file to save storage - */ - private void deleteTempFile() { - final File f = new File(getApplicationContext().getCacheDir(), tmpFile); - if (f.exists()) { - //noinspection ResultOfMethodCallIgnored - f.delete(); - } - } - /** * Load the content and logic for AlertDialog objects */ @@ -309,10 +284,6 @@ protected void onPause() { * @param savedInstance The Bundle that contains saved information */ private void loadFileHashContent(final Bundle savedInstance) { - if (ContextCompat.checkSelfPermission(MainActivity.this, Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) { - ActivityCompat.requestPermissions(MainActivity.this, new String[]{Manifest.permission.READ_EXTERNAL_STORAGE}, 0); - } - pgbFile = findViewById(R.id.PgbFile); mRecyclerViewFile = findViewById(R.id.file_recycler); mRecyclerViewFile.setHasFixedSize(true); @@ -342,22 +313,13 @@ private void loadFileHashContent(final Bundle savedInstance) { mRecyclerViewFile.setAdapter(mAdapterFile); - btnOpenFile.setOnClickListener(v -> { - if (ContextCompat.checkSelfPermission(MainActivity.this, Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) { - ActivityCompat.requestPermissions(MainActivity.this, new String[]{Manifest.permission.READ_EXTERNAL_STORAGE}, 0); - } else { - final Intent intent = new Intent() - .setType("*/*") - .setAction(Intent.ACTION_GET_CONTENT) - .addCategory(Intent.CATEGORY_OPENABLE); - - activityResultLauncher.launch(Intent.createChooser(intent, getString(R.string.dialog_select_file))); - } - }); + btnOpenFile.setOnClickListener(this::onClickSelectFile); + edtFilePath.setOnClickListener(this::onClickSelectFile); btnGenerate.setOnClickListener(v -> { - if (fileLoading) return; - if (!new File(getBaseContext().getCacheDir(), tmpFile).exists()) { + if (fileLoading) + return; + if (fileUri == null) { Toast.makeText(getApplicationContext(), R.string.error_no_file, Toast.LENGTH_LONG).show(); return; } @@ -377,26 +339,21 @@ private void loadFileHashContent(final Bundle savedInstance) { compare = edtFileCompare.getText().toString(); } - try { - final HashGenerator fileHashGenerator = new HashGenerator(new File(getApplicationContext().getCacheDir(), tmpFile), getHashAlgorithms(), compare); - fileLoading = true; + final FileHashGenerator fileHashGenerator = new FileHashGenerator(fileUri, getContentResolver(), getHashAlgorithms(), compare); + fileLoading = true; - CompletableFuture.supplyAsync(fileHashGenerator::generateHashes) - .thenAccept(s -> runOnUiThread(() -> { - fileLoading = false; - pgbFile.setVisibility(View.GONE); + CompletableFuture.supplyAsync(fileHashGenerator::generateHashes) + .thenAccept(s -> runOnUiThread(() -> { + fileLoading = false; + pgbFile.setVisibility(View.GONE); - for (final HashData d : s) { - fileDataArrayList.add(d); - mAdapterFile.notifyItemInserted(fileDataArrayList.size()); - } - })); + for (final HashData d : s) { + fileDataArrayList.add(d); + mAdapterFile.notifyItemInserted(fileDataArrayList.size()); + } + })); - pgbFile.setVisibility(View.VISIBLE); - } catch (final IOException e) { - Toast.makeText(MainActivity.this, e.getMessage(), Toast.LENGTH_SHORT).show(); - pgbFile.setVisibility(View.GONE); - } + pgbFile.setVisibility(View.VISIBLE); }); } @@ -458,7 +415,7 @@ private void loadTextHashContent(final Bundle savedInstance) { } - final HashGenerator textHashGenerator = new HashGenerator(data.getBytes(), getHashAlgorithms(), compare); + final TextHashGenerator textHashGenerator = new TextHashGenerator(data, getHashAlgorithms(), compare); textLoading = true; CompletableFuture.supplyAsync(textHashGenerator::generateHashes) @@ -511,7 +468,7 @@ private void loadHelpContent() { btnSupport.setOnClickListener(v -> new ShareCompat.IntentBuilder(MainActivity.this) .setType("message/rfc822") - .addEmailTo("admin@codedead.com") + .addEmailTo("support@codedead.com") .setSubject("DeadHash - Android") .setText("") .setChooserTitle(R.string.text_send_mail) @@ -557,24 +514,6 @@ protected void attachBaseContext(final Context base) { super.attachBaseContext(LocaleHelper.onAttach(base)); } - @Override - public void onBackPressed() { - final DrawerLayout drawer = findViewById(R.id.drawer_layout); - if (drawer.isDrawerOpen(GravityCompat.START)) { - drawer.closeDrawer(GravityCompat.START); - } else { - if (doubleBackToExitPressedOnce) { - super.onBackPressed(); - return; - } - - this.doubleBackToExitPressedOnce = true; - Toast.makeText(this, R.string.toast_back_again, Toast.LENGTH_SHORT).show(); - - new Handler(Looper.getMainLooper()).postDelayed(() -> doubleBackToExitPressedOnce = false, 2000); - } - } - @Override public boolean onNavigationItemSelected(@NonNull final MenuItem item) { int page = 0; @@ -594,4 +533,31 @@ public boolean onNavigationItemSelected(@NonNull final MenuItem item) { drawer.closeDrawer(GravityCompat.START); return true; } + + private void onClickSelectFile(final View v) { + if (ContextCompat.checkSelfPermission(MainActivity.this, Manifest.permission.READ_MEDIA_AUDIO) != PackageManager.PERMISSION_GRANTED + || ContextCompat.checkSelfPermission(MainActivity.this, Manifest.permission.READ_MEDIA_IMAGES) != PackageManager.PERMISSION_GRANTED + || ContextCompat.checkSelfPermission(MainActivity.this, Manifest.permission.READ_MEDIA_VIDEO) != PackageManager.PERMISSION_GRANTED) { + Toast.makeText(getApplicationContext(), R.string.toast_no_permissions, Toast.LENGTH_LONG).show(); + + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { + ActivityCompat.requestPermissions(MainActivity.this, new String[]{ + Manifest.permission.READ_MEDIA_AUDIO, + Manifest.permission.READ_MEDIA_IMAGES, + Manifest.permission.READ_MEDIA_VIDEO + }, 0); + } else { + ActivityCompat.requestPermissions(MainActivity.this, new String[]{ + Manifest.permission.READ_EXTERNAL_STORAGE + }, 0); + } + } else { + final Intent intent = new Intent() + .setType("*/*") + .setAction(Intent.ACTION_OPEN_DOCUMENT) + .addCategory(Intent.CATEGORY_OPENABLE); + + activityResultLauncher.launch(Intent.createChooser(intent, getString(R.string.dialog_select_file))); + } + } } diff --git a/app/src/main/java/com/codedead/deadhash/gui/SettingsActivity.java b/app/src/main/java/com/codedead/deadhash/gui/SettingsActivity.java index d6a53de..b8eda51 100644 --- a/app/src/main/java/com/codedead/deadhash/gui/SettingsActivity.java +++ b/app/src/main/java/com/codedead/deadhash/gui/SettingsActivity.java @@ -51,21 +51,19 @@ protected void onCreate(final Bundle savedInstanceState) { } private final SharedPreferences.OnSharedPreferenceChangeListener listener = (prefs, key) -> { + if (key == null) + return; + if (key.equals("language")) { LocaleHelper.setLocale(getApplicationContext(), prefs.getString("language", "en")); recreate(); } else if (key.equals("theme")) { final String theme = prefs.getString("theme", "0"); switch (theme) { - case "0": - AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO); - break; - case "1": - AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES); - break; - case "2": - AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM); - break; + case "0" -> AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO); + case "1" -> AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES); + case "2" -> + AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM); } } }; diff --git a/app/src/main/res/drawable/ic_launcher_foreground.xml b/app/src/main/res/drawable/ic_launcher_foreground.xml index 74e5b3a..2354d52 100644 --- a/app/src/main/res/drawable/ic_launcher_foreground.xml +++ b/app/src/main/res/drawable/ic_launcher_foreground.xml @@ -1,15 +1,15 @@ - + + android:pathData="M9.4,16.6L4.8,12l4.6,-4.6L8,6l-6,6 6,6 1.4,-1.4zM14.6,16.6l4.6,-4.6 -4.6,-4.6L16,6l6,6 -6,6 -1.4,-1.4z"/> diff --git a/app/src/main/res/layout/content_file.xml b/app/src/main/res/layout/content_file.xml index aa42b29..f8a43af 100644 --- a/app/src/main/res/layout/content_file.xml +++ b/app/src/main/res/layout/content_file.xml @@ -34,7 +34,8 @@ android:id="@+id/EdtFile_name" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_weight="0.85" + android:layout_weight="0.90" + android:lines="1" android:clickable="false" android:cursorVisible="false" android:focusable="false" @@ -44,10 +45,10 @@ android:inputType="none" /> diff --git a/app/src/main/res/layout/content_text.xml b/app/src/main/res/layout/content_text.xml index e5c9283..7514567 100644 --- a/app/src/main/res/layout/content_text.xml +++ b/app/src/main/res/layout/content_text.xml @@ -30,6 +30,7 @@ android:paddingTop="5dp"> + - + \ No newline at end of file diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/app/src/main/res/mipmap-anydpi/ic_launcher_round.xml similarity index 93% rename from app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml rename to app/src/main/res/mipmap-anydpi/ic_launcher_round.xml index 5ed0a2d..7353dbd 100644 --- a/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +++ b/app/src/main/res/mipmap-anydpi/ic_launcher_round.xml @@ -2,4 +2,4 @@ - + \ No newline at end of file diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.webp b/app/src/main/res/mipmap-hdpi/ic_launcher.webp new file mode 100644 index 0000000..c45aac8 Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher.webp differ diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp new file mode 100644 index 0000000..a4e9626 Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.webp b/app/src/main/res/mipmap-mdpi/ic_launcher.webp new file mode 100644 index 0000000..3973427 Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher.webp differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp new file mode 100644 index 0000000..2595355 Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.webp b/app/src/main/res/mipmap-xhdpi/ic_launcher.webp new file mode 100644 index 0000000..00ed3a3 Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher.webp differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..df1992a Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp new file mode 100644 index 0000000..03ca8cc Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..bba4aab Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp new file mode 100644 index 0000000..31d149c Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp new file mode 100644 index 0000000..379239c Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp differ diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 5be80bf..04f6356 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -16,14 +16,13 @@ Werkzeuge Schliessschloss schließen Öffnen Sie die Schublade - DeadHash wurde von DeadLine erstellt. Diese App kann verwendet werden, um Hashes von Dateien und Strings zu erzeugen.\n\nIn dieser Version sind keine Anzeigen oder Tracking-Geräte enthalten. Alle erforderlichen Berechtigungen sind erforderlich, um diese App richtig nutzen zu können.\n\nAlle Bilder sind mit freundlicher Genehmigung von Google.\n\nCopyright © 2022 CodeDead + DeadHash wurde von DeadLine erstellt. Diese App kann verwendet werden, um Hashes von Dateien und Strings zu erzeugen.\n\nIn dieser Version sind keine Anzeigen oder Tracking-Geräte enthalten. Alle erforderlichen Berechtigungen sind erforderlich, um diese App richtig nutzen zu können.\n\nAlle Bilder sind mit freundlicher Genehmigung von Google.\n\nCopyright © 2023 CodeDead Vergleichen: Hash vergleichen Lege deinen Hash hier Geben Sie hier Ihren Text ein Das Erstellen von Aktenhacken kann nur durchgeführt werden, wenn DeadHash die Berechtigung zum Lesen deines Speichers erhalten hat. Das Erzeugen von Hashes für größere Dateien kann eine Weile dauern. Dies hängt ganz von der Rechenleistung Ihres Gerätes ab.\n\nBei der Erstellung von Text-Hashes sind keine zusätzlichen Berechtigungen erforderlich. Das Erzeugen von Hashes für größere Saiten kann eine Weile dauern. Dies hängt ganz von der Rechenleistung Ihres Gerätes ab.\n\nWenn du zufällig über einen Bug kommst oder wenn du Unterstützung brauchst, kannst du uns jederzeit kontaktieren! Sprache - Drücken Sie erneut \'ZURÜCK\', um zu beenden. Daten in die Zwischenablage kopiert! Bitte zuerst einen Text eingeben! Hash passt zu Ihrer Eingabe! @@ -48,4 +47,5 @@ Dunkel Systemfehler + Für die Nutzung von DeadHash sind Speicherberechtigungen erforderlich diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 85aefb1..fa19a7d 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -18,7 +18,6 @@ Le hash correspond à votre saisie! Entrez d\'abord un texte! Les données sont copiées dans le presse-papiers. - Appuyez de nouveau sur \'RETOURNER\' pour quitter. Langue Entrez votre texte ici Placez votre hash ici @@ -26,7 +25,7 @@ Comparer: Ouvrir le tiroir de navigation Fermer le tiroir de navigation - DeadHash a été créé par DeadLine. Cette application peut être utilisée pour générer des hachages de fichiers et de chaînes.\n\nAucune publicité ou périphérique de suivi n\'est inclus dans cette version. Toutes les autorisations requises sont nécessaires pour utiliser correctement cette application.\n\nToutes les images sont gracieusement fournies par Google.\n\nCopyright © 2022 CodeDead + DeadHash a été créé par DeadLine. Cette application peut être utilisée pour générer des hachages de fichiers et de chaînes.\n\nAucune publicité ou périphérique de suivi n\'est inclus dans cette version. Toutes les autorisations requises sont nécessaires pour utiliser correctement cette application.\n\nToutes les images sont gracieusement fournies par Google.\n\nCopyright © 2023 CodeDead La génération de hachages de fichiers ne peut être effectuée que lorsque DeadHash a été autorisé à lire votre stockage. Génération hash pour des fichiers plus volumineux peut prendre un certain temps. Cela dépend entièrement du pouvoir de traitement de votre appareil.\n\nLa génération de hachages de texte ne nécessite aucune autorisation supplémentaire. La génération de hachis pour un texte plus grand peut prendre un certain temps. Cela dépend entièrement du pouvoir de traitement de votre appareil.\n\nSi vous rencontrez un bug ou si vous avez besoin de soutien, vous pouvez toujours nous contacter! Envoyez-nous un e-mail Envisagez de laisser un commentaire si vous aimez cette application! @@ -48,4 +47,5 @@ Foncé Défaillance du système + Des autorisations de stockage sont requises pour utiliser DeadHash diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 8538690..287fddb 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -17,7 +17,6 @@ Confronta: Inserisci il tuo hash qui Confronta hash - Premere nuovamente \'BACK\' per uscire. Hash corrisponde al tuo input! Hash non corrisponde al tuo input! Inserisci il tuo testo qui @@ -26,7 +25,7 @@ Supporto La generazione di hash di file può essere eseguita solo quando DeadHash è stato autorizzato a leggere la propria memoria. La generazione di hash per file più grandi può richiedere un po \'di tempo. Questo dipende interamente dalla potenza di elaborazione del dispositivo.\n\nLa generazione di hash di testo non richiede autorizzazioni aggiuntive. La generazione di hash per stringhe più grandi può richiedere un po \'di tempo. Ciò dipende interamente dalla potenza di elaborazione del dispositivo.\n\nSe si verifica un errore o se hai bisogno di supporto, puoi sempre contattarci! Strumenti - DeadHash è stato creato da DeadLine. Questa applicazione può essere utilizzata per generare hash di file e stringhe.\n\nNon sono inclusi dispositivi di pubblicità o di rilevamento in questa versione. Tutte le autorizzazioni richieste sono necessarie per utilizzare correttamente questa applicazione.\n\nTutte le immagini sono a cura di Google.\n\nCopyright © 2022 CodeDead + DeadHash è stato creato da DeadLine. Questa applicazione può essere utilizzata per generare hash di file e stringhe.\n\nNon sono inclusi dispositivi di pubblicità o di rilevamento in questa versione. Tutte le autorizzazioni richieste sono necessarie per utilizzare correttamente questa applicazione.\n\nTutte le immagini sono a cura di Google.\n\nCopyright © 2023 CodeDead Lingua Inviaci una e-mail Recensione @@ -48,4 +47,5 @@ Buio Default del sistema + Per utilizzare DeadHash sono necessarie autorizzazioni di archiviazione diff --git a/app/src/main/res/values-night/themes.xml b/app/src/main/res/values-night/themes.xml index b38fc0a..4578d0b 100644 --- a/app/src/main/res/values-night/themes.xml +++ b/app/src/main/res/values-night/themes.xml @@ -1,4 +1,4 @@ - + diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index 658939d..ad7390d 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -16,14 +16,13 @@ Gereedschap Sluit navigatie lade Open navigatie lade - DeadHash werd gemaakt door DeadLine. Deze app kan gebruikt worden om hashes te genereren van bestanden en tekst.\n\nAdvertenties of trackers werden niet toegevoegd in deze release. Alle aangevraagde permissies zijn nodig om de app correct te laten functioneren.\n\nAlle gebruikte afbeeldingen waren gemaakt door Google.\n\nCopyright © 2022 CodeDead + DeadHash werd gemaakt door DeadLine. Deze app kan gebruikt worden om hashes te genereren van bestanden en tekst.\n\nAdvertenties of trackers werden niet toegevoegd in deze release. Alle aangevraagde permissies zijn nodig om de app correct te laten functioneren.\n\nAlle gebruikte afbeeldingen waren gemaakt door Google.\n\nCopyright © 2023 CodeDead Vergelijk: Vergelijk hash Plaats uw hash hier Plaats uw tekst hier Bestand hashes kunnen alleen gegenereerd worden indien DeadHash toegang heeft tot uw bestanden. Het genereren van hashes voor grotere bestanden kan enige tijd in beslag nemen. Dit is volledig afhankelijk van de kracht van uw toestel.\n\nHet genereren van tekst hashes heeft geen nood aan additionele permissies. Het genereren van tekst hashes kan enige tijd in beslag nemen. Dit is volledig afhankelijk van de kracht van uw toestel.\n\nIndien u een fout tegenkomt of indien u hulp nodig heeft kunt u ons steeds contacteren! Taal - Druk nogmaals op \'TERUG\' om de app te sluiten. Data gekopieerd naar het klembord. Gelieve eerst tekst op te geven! Hash is gelijk aan uw input! @@ -48,4 +47,5 @@ Donker Systeemstandaard + Om DeadHash te kunnen gebruiken zijn opslagrechten vereist diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index ccbbd94..d8095aa 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -17,7 +17,6 @@ Compare: Insira seu hash aqui Comparar hash - Pressione \'VOLTAR\' novamente para sair. Este hash corresponde ao que você inseriu! Este hash não corresponde ao que você inseriu! Insira seu texto aqui @@ -26,7 +25,7 @@ Suporte A geração de hashes para arquivos só pode ser feita se o DeadHash tiver permissão para ler o seu armazenamento. A geração de hashes para arquivos grandes poderá demorar um pouco. Isso dependerá exclusivamente do poder de processamento do seu dispositivo.\n\nA geração de hashes para textos não necessita que nenhuma permissão seja concedida. A geração de hashes para textos grandes poderá demorar um pouco. Isso dependerá exclusivamente do poder de processamento do seu dispositivo.\n\nSe chegar à encontrar algum bug ou precisar de suporte, você sempre poderá em contato conosco! Ferramentas - DeadHash foi criado por DeadLine. Este aplicativo pode ser utilizado para gerar hashes de arquivos e textos.\n\nNenhum anúncio ou serviço de coleta de dados está incluído nesta versão. Todas as permissões requisitadas pelo aplicativo são necessárias para que ele funcione corretamente.\n\nTodas as imagens são cortesia do Google.\nTraduções fornecidas por SnwMds\n\nCopyright © 2022 CodeDead + DeadHash foi criado por DeadLine. Este aplicativo pode ser utilizado para gerar hashes de arquivos e textos.\n\nNenhum anúncio ou serviço de coleta de dados está incluído nesta versão. Todas as permissões requisitadas pelo aplicativo são necessárias para que ele funcione corretamente.\n\nTodas as imagens são cortesia do Google.\nTraduções fornecidas por SnwMds\n\nCopyright © 2023 CodeDead Idioma Envie-nos um e-mail Avalie-nos @@ -48,4 +47,5 @@ Escuro Sistema padrão + Permissões de armazenamento são necessárias para usar DeadHash diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 46e9551..e457cb9 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -18,7 +18,6 @@ Введённый хеш совпадает с хешем ваших данных! Пожалуйста, сначала введите текст! Данные скопированы в буфер обмена! - Нажмите \'НАЗАД\' ещё раз, чтобы выйти из приложения. Язык Введите ваш текст сюда Введите ваш хеш сюда @@ -26,7 +25,7 @@ Сравнить: Открыть панель навигации Закрыть панель навигации - Приложение DeadHash было создано DeadLine. Это приложение может генерировать хеши для файлов и текста.\n\nЗдесь отсутствуют реклама и отслеживание. Все требуемые разрешения нужны только для правильной работы приложения.\n\nВсе изображения предоставлены Google.\nПереводы:\nРусский язык - Nickoriginal\n\nВсе права защищены © 2022 CodeDead + Приложение DeadHash было создано DeadLine. Это приложение может генерировать хеши для файлов и текста.\n\nЗдесь отсутствуют реклама и отслеживание. Все требуемые разрешения нужны только для правильной работы приложения.\n\nВсе изображения предоставлены Google.\nПереводы:\nРусский язык - Nickoriginal\n\nВсе права защищены © 2023 CodeDead DeadHash может генерировать хеши файлов только после получения разрешения на чтение памяти. Генерирование хешей для больших файлов может занять больше времени. Это полностью зависит от вычислительной мощности вашего устройства.\n\nГенерирование хешей для текста не требует дополнительных разрешений. Генерирование хешей для больших строк текста может занять больше времени. Это полностью зависит от вычислительной мощности вашего устройства.\n\nЕсли вы столкнулись с ошибкой или если вам нужна помощь, вы всегда можете связаться с нами! Отправьте нам электронное письмо Если вам понравилось приложение, вы можете оставить отзыв! @@ -48,4 +47,5 @@ Тёмная Системная + Для использования DeadHash необходимы разрешения на хранение diff --git a/app/src/main/res/values/ic_launcher_background.xml b/app/src/main/res/values/ic_launcher_background.xml index cdde88f..beab31f 100644 --- a/app/src/main/res/values/ic_launcher_background.xml +++ b/app/src/main/res/values/ic_launcher_background.xml @@ -1,4 +1,4 @@ #000000 - + \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 557916c..bd81416 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -18,7 +18,6 @@ Compare: Place your hash here Compare hash - Press \'BACK\' again to exit. Hash matches your input! Hash does not match your input! Enter your text here @@ -27,7 +26,7 @@ Support Generating file hashes can only be done when DeadHash has been given permission to read your storage. Generating hashes for larger files may take a while. This depends entirely on the processing power of your device.\n\nGenerating text hashes does not require any additional permissions to be granted. Generating hashes for larger strings may take a while. This depends entirely on the processing power of your device.\n\nIf you happen to come across a bug or if you need support, you can always contact us! Tools - DeadHash was created by DeadLine. This app can be used to generate hashes of files and strings.\n\nNo ads or tracking devices are included in this release. All requested permissions are required in order to properly use this app.\n\nAll images are courtesy of Google.\n\nCopyright © 2022 CodeDead + DeadHash was created by DeadLine. This app can be used to generate hashes of files and strings.\n\nNo ads or tracking devices are included in this release. All requested permissions are required in order to properly use this app.\n\nAll images are courtesy of Google.\n\nCopyright © 2023 CodeDead Language MD5 SHA-1 @@ -60,4 +59,5 @@ Dark System default + Storage permissions are required in order to use DeadHash diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml index 20e0589..ef45f57 100644 --- a/app/src/main/res/values/themes.xml +++ b/app/src/main/res/values/themes.xml @@ -1,4 +1,4 @@ - + diff --git a/build.gradle b/build.gradle index cdf8d5c..a0d028f 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,7 @@ buildscript { google() } dependencies { - classpath 'com.android.tools.build:gradle:7.1.3' + classpath 'com.android.tools.build:gradle:8.2.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files @@ -20,6 +20,6 @@ allprojects { } } -task clean(type: Delete) { +tasks.register('clean', Delete) { delete rootProject.buildDir } diff --git a/fastlane/metadata/android/en-US/changelogs/9.txt b/fastlane/metadata/android/en-US/changelogs/9.txt new file mode 100644 index 0000000..05e0b05 --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/9.txt @@ -0,0 +1,4 @@ +- Added a settings activity +- Removed deprecated code +- Refactoring +- Improved UI diff --git a/fastlane/metadata/android/en-US/full_description.txt b/fastlane/metadata/android/en-US/full_description.txt new file mode 100644 index 0000000..f08f4fc --- /dev/null +++ b/fastlane/metadata/android/en-US/full_description.txt @@ -0,0 +1,18 @@ +DeadHash is an utility to calculate hashes. + +Features: +
    +
  • Generate hashes for files and texts
  • +
  • Dark theme support
  • +
  • Compare your hashes
  • +
  • Supports multiple hashes
  • +
+ +Supported hashes: +* MD5 +* SHA-1 +* SHA-224 +* SHA-256 +* SHA-384 +* SHA-512 +* CRC32 diff --git a/fastlane/metadata/android/en-US/images/icon.png b/fastlane/metadata/android/en-US/images/icon.png new file mode 100644 index 0000000..ebc24c7 Binary files /dev/null and b/fastlane/metadata/android/en-US/images/icon.png differ diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/1.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/1.png new file mode 100644 index 0000000..2faea9b Binary files /dev/null and b/fastlane/metadata/android/en-US/images/phoneScreenshots/1.png differ diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/2.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/2.png new file mode 100644 index 0000000..57d9c45 Binary files /dev/null and b/fastlane/metadata/android/en-US/images/phoneScreenshots/2.png differ diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/3.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/3.png new file mode 100644 index 0000000..8c3a112 Binary files /dev/null and b/fastlane/metadata/android/en-US/images/phoneScreenshots/3.png differ diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/4.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/4.png new file mode 100644 index 0000000..a6c68cf Binary files /dev/null and b/fastlane/metadata/android/en-US/images/phoneScreenshots/4.png differ diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/5.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/5.png new file mode 100644 index 0000000..8b81a53 Binary files /dev/null and b/fastlane/metadata/android/en-US/images/phoneScreenshots/5.png differ diff --git a/fastlane/metadata/android/en-US/short_description.txt b/fastlane/metadata/android/en-US/short_description.txt new file mode 100644 index 0000000..4827d1e --- /dev/null +++ b/fastlane/metadata/android/en-US/short_description.txt @@ -0,0 +1 @@ +Hashsum calculation utility. diff --git a/fastlane/metadata/android/en-US/title.txt b/fastlane/metadata/android/en-US/title.txt new file mode 100644 index 0000000..0ac942f --- /dev/null +++ b/fastlane/metadata/android/en-US/title.txt @@ -0,0 +1 @@ +DeadHash diff --git a/gradle.properties b/gradle.properties index 9e6fce1..f6720ae 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,7 +9,10 @@ # Specifies the JVM arguments used for the daemon process. # The setting is particularly useful for tweaking memory settings. +android.defaults.buildfeatures.buildconfig=true android.enableJetifier=true +android.nonFinalResIds=false +android.nonTransitiveRClass=false android.useAndroidX=true org.gradle.jvmargs=-Xmx1536m diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 105209b..8d06be9 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Tue Jul 06 16:47:53 CEST 2021 +#Fri Dec 08 03:09:45 CET 2023 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip distributionPath=wrapper/dists -zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists