Skip to content

Commit cc314f9

Browse files
committed
feat: dependency upgrades, allow sharing of files between other apps and DeadHash
1 parent 844dbb6 commit cc314f9

File tree

23 files changed

+81
-33
lines changed

23 files changed

+81
-33
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ This library is maintained by CodeDead. You can find more about us using the fol
3636
* [Twitter](https://twitter.com/C0DEDEAD)
3737
* [Facebook](https://facebook.com/deadlinecodedead)
3838

39-
Copyright © 2024 CodeDead
39+
Copyright © 2025 CodeDead

app/build.gradle

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
apply plugin: 'com.android.application'
22

33
android {
4-
compileSdk 34
4+
compileSdk 35
55
defaultConfig {
66
applicationId "com.codedead.deadhash"
7-
minSdk 28
8-
targetSdk 34
7+
minSdk 30
8+
targetSdk 35
99
versionName '1.8.2'
1010
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1111
versionCode 12
@@ -27,12 +27,12 @@ android {
2727

2828
dependencies {
2929
implementation fileTree(include: ['*.jar'], dir: 'libs')
30-
androidTestImplementation('androidx.test.espresso:espresso-core:3.5.1', {
30+
androidTestImplementation('androidx.test.espresso:espresso-core:3.6.1', {
3131
exclude group: 'com.android.support', module: 'support-annotations'
3232
})
33-
implementation 'androidx.appcompat:appcompat:1.6.1'
34-
implementation 'com.google.android.material:material:1.11.0'
35-
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
33+
implementation 'androidx.appcompat:appcompat:1.7.0'
34+
implementation 'com.google.android.material:material:1.12.0'
35+
implementation 'androidx.constraintlayout:constraintlayout:2.2.1'
3636
implementation 'androidx.cardview:cardview:1.0.0'
3737
implementation 'androidx.preference:preference:1.2.1'
3838
testImplementation 'junit:junit:4.13.2'

app/src/main/AndroidManifest.xml

+6-1
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,14 @@
3333
android:theme="@style/Theme.DeadHash.NoActionBar">
3434
<intent-filter>
3535
<action android:name="android.intent.action.MAIN" />
36-
3736
<category android:name="android.intent.category.LAUNCHER" />
3837
</intent-filter>
38+
39+
<intent-filter>
40+
<action android:name="android.intent.action.SEND" />
41+
<category android:name="android.intent.category.DEFAULT" />
42+
<data android:mimeType="*/*" />
43+
</intent-filter>
3944
</activity>
4045
</application>
4146
</manifest>

app/src/main/java/com/codedead/deadhash/domain/objects/hashgenerator/HashData.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ public HashData[] newArray(final int size) {
3434
throw new NullPointerException("Hash name cannot be null!");
3535
if (hashData == null)
3636
throw new NullPointerException("Hash data cannot be null!");
37-
if (hashName.length() == 0)
37+
if (hashName.isEmpty())
3838
throw new IllegalArgumentException("Hash name cannot be empty!");
39-
if (hashData.length() == 0)
39+
if (hashData.isEmpty())
4040
throw new IllegalArgumentException("Hash data cannot be empty!");
4141

4242
this.hashName = hashName;

app/src/main/java/com/codedead/deadhash/domain/utils/DataAdapter.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ static class DataHolder extends RecyclerView.ViewHolder implements View.OnClickL
7575

7676
copyData.setOnClickListener(this);
7777
compareData.setOnClickListener(v1 -> {
78-
if (originalCompare == null || originalCompare.length() == 0) return;
78+
if (originalCompare == null || originalCompare.isEmpty()) return;
7979
if (originalCompare.equals(encryptionData.getText().toString())) {
8080
Toast.makeText(v1.getContext(), R.string.toast_hash_match, Toast.LENGTH_SHORT).show();
8181
} else {
@@ -105,7 +105,7 @@ void bindData(final HashData data) {
105105
encryptionName.setText(data.getHashName());
106106
encryptionData.setText(data.getHashData());
107107

108-
if (data.getCompareCheck() != null && data.getCompareCheck().length() != 0) {
108+
if (data.getCompareCheck() != null && !data.getCompareCheck().isEmpty()) {
109109
originalCompare = data.getCompareCheck();
110110
if (data.getHashData().equalsIgnoreCase(data.getCompareCheck())) {
111111
compareData.setImageResource(R.drawable.ic_compare_check);

app/src/main/java/com/codedead/deadhash/domain/utils/IntentUtils.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public static void openSite(final Context context, final String site) {
2929
throw new NullPointerException("Context cannot be null!");
3030
if (site == null)
3131
throw new NullPointerException("Site cannot be null!");
32-
if (site.length() == 0)
32+
if (site.isEmpty())
3333
throw new IllegalArgumentException("Site cannot be empty!");
3434

3535
try {

app/src/main/java/com/codedead/deadhash/gui/MainActivity.java

+41-3
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,14 @@ protected void onCreate(final Bundle savedInstanceState) {
167167
}
168168
}
169169
});
170+
171+
final Intent intent = getIntent();
172+
final String action = intent.getAction();
173+
final String type = intent.getType();
174+
175+
if (Intent.ACTION_SEND.equals(action) && type != null) {
176+
handleSendFile(intent);
177+
}
170178
}
171179

172180
/**
@@ -181,13 +189,43 @@ private void loadTheme() {
181189
}
182190
}
183191

192+
/**
193+
* Handle the sending of a file
194+
*
195+
* @param intent The {@link Intent} object
196+
*/
197+
private void handleSendFile(final Intent intent) {
198+
final Uri intentFileUri = intent.getParcelableExtra(Intent.EXTRA_STREAM);
199+
if (intentFileUri != null) {
200+
fileUri = intentFileUri;
201+
try (final Cursor cursor = this.getContentResolver()
202+
.query(intentFileUri, null, null, null, null, null)) {
203+
if (cursor != null && cursor.moveToFirst()) {
204+
@SuppressLint("Range") final String displayName = cursor.getString(cursor.getColumnIndex(OpenableColumns.DISPLAY_NAME));
205+
edtFilePath.setText(displayName);
206+
207+
fileDataArrayList.clear();
208+
mAdapterFile.notifyDataSetChanged();
209+
}
210+
}
211+
} else {
212+
Toast.makeText(getApplicationContext(), R.string.error_open_file, Toast.LENGTH_SHORT).show();
213+
}
214+
}
215+
184216
@Override
185217
public boolean onCreateOptionsMenu(final Menu menu) {
186218
final MenuInflater inflater = getMenuInflater();
187219
inflater.inflate(R.menu.top_menu, menu);
188220
return true;
189221
}
190222

223+
@Override
224+
protected void onNewIntent(final Intent intent) {
225+
super.onNewIntent(intent);
226+
handleSendFile(intent);
227+
}
228+
191229
@Override
192230
public boolean onOptionsItemSelected(final MenuItem item) {
193231
final int itemId = item.getItemId();
@@ -406,7 +444,7 @@ private void loadTextHashContent(final Bundle savedInstance) {
406444
fileDataArrayList.clear();
407445
mAdapterText.notifyDataSetChanged();
408446

409-
if (edtTextData.getText() == null || edtTextData.getText().toString().length() == 0) {
447+
if (edtTextData.getText() == null || edtTextData.getText().toString().isEmpty()) {
410448
Toast.makeText(MainActivity.this, R.string.toast_error_notext, Toast.LENGTH_SHORT).show();
411449
return;
412450
}
@@ -483,13 +521,13 @@ private void loadHelpContent() {
483521
*/
484522
private void loadAboutContent() {
485523
final ImageButton btnFacebook = findViewById(R.id.BtnFacebook);
486-
final ImageButton btnTwitter = findViewById(R.id.BtnTwitter);
524+
final ImageButton btnBluesky = findViewById(R.id.BtnBluesky);
487525
final ImageButton btnWebsite = findViewById(R.id.BtnWebsiteAbout);
488526
final TextView txtAbout = findViewById(R.id.TxtAbout);
489527

490528
btnWebsite.setOnClickListener(v -> IntentUtils.openSite(v.getContext(), "http://codedead.com/"));
491529
btnFacebook.setOnClickListener(v -> IntentUtils.openSite(v.getContext(), "https://facebook.com/deadlinecodedead"));
492-
btnTwitter.setOnClickListener(v -> IntentUtils.openSite(v.getContext(), "https://twitter.com/C0DEDEAD"));
530+
btnBluesky.setOnClickListener(v -> IntentUtils.openSite(v.getContext(), "https://bsky.app/profile/codedead.com"));
493531
txtAbout.setMovementMethod(LinkMovementMethod.getInstance());
494532
}
495533

-755 Bytes
Binary file not shown.
-527 Bytes
Binary file not shown.
-971 Bytes
Binary file not shown.
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="32dp" android:viewportHeight="530" android:viewportWidth="600" android:width="32dp">
2+
3+
<path android:fillColor="#1185fe" android:pathData="m135.72,44.03c66.5,49.92 138.02,151.14 164.28,205.46 26.26,-54.32 97.78,-155.54 164.28,-205.46 47.98,-36.02 125.72,-63.89 125.72,24.8 0,17.71 -10.15,148.79 -16.11,170.07 -20.7,73.98 -96.14,92.85 -163.25,81.43 117.3,19.96 147.14,86.09 82.7,152.22 -122.39,125.59 -175.91,-31.51 -189.63,-71.77 -2.51,-7.38 -3.69,-10.83 -3.71,-7.9 -0.02,-2.94 -1.19,0.52 -3.71,7.9 -13.71,40.26 -67.23,197.36 -189.63,71.77 -64.44,-66.13 -34.6,-132.26 82.7,-152.22 -67.11,11.42 -142.55,-7.45 -163.25,-81.43 -5.96,-21.28 -16.11,-152.36 -16.11,-170.07 0,-88.69 77.74,-60.82 125.72,-24.8z"/>
4+
5+
</vector>

app/src/main/res/layout/content_about.xml

+4-4
Original file line numberDiff line numberDiff line change
@@ -48,18 +48,18 @@
4848
<ImageButton
4949
android:id="@+id/BtnFacebook"
5050
android:layout_width="wrap_content"
51-
android:layout_height="wrap_content"
51+
android:layout_height="match_parent"
5252
android:layout_weight="1"
5353
android:contentDescription="@string/hint_facebook_logo"
5454
app:srcCompat="@drawable/ic_facebook_icon" />
5555

5656
<ImageButton
57-
android:id="@+id/BtnTwitter"
57+
android:id="@+id/BtnBluesky"
5858
android:layout_width="wrap_content"
5959
android:layout_height="wrap_content"
6060
android:layout_weight="1"
61-
android:contentDescription="@string/hint_twitter_logo"
62-
app:srcCompat="@drawable/ic_twitter_icon" />
61+
android:contentDescription="@string/hint_bluesky_logo"
62+
app:srcCompat="@drawable/bluesky_logo" />
6363

6464
<ImageButton
6565
android:id="@+id/BtnWebsiteAbout"

app/src/main/res/values-de/strings.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<string name="nav_tools">Werkzeuge</string>
1717
<string name="navigation_drawer_close">Schliessschloss schließen</string>
1818
<string name="navigation_drawer_open">Öffnen Sie die Schublade</string>
19-
<string name="text_about">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 © 2024 CodeDead</string>
19+
<string name="text_about">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 © 2025 CodeDead</string>
2020
<string name="text_compare">Vergleichen:</string>
2121
<string name="text_compare_hash">Hash vergleichen</string>
2222
<string name="text_compare_hint">Lege deinen Hash hier</string>

app/src/main/res/values-fr/strings.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<string name="text_compare">Comparer:</string>
2626
<string name="navigation_drawer_open">Ouvrir le tiroir de navigation</string>
2727
<string name="navigation_drawer_close">Fermer le tiroir de navigation</string>
28-
<string name="text_about">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 © 2024 CodeDead</string>
28+
<string name="text_about">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 © 2025 CodeDead</string>
2929
<string name="text_help">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!</string>
3030
<string name="text_send_mail">Envoyez-nous un e-mail</string>
3131
<string name="alert_review_text">Envisagez de laisser un commentaire si vous aimez cette application!</string>

app/src/main/res/values-it/strings.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<string name="button_support">Supporto</string>
2626
<string name="text_help">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!</string>
2727
<string name="nav_tools">Strumenti</string>
28-
<string name="text_about">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 © 2024 CodeDead</string>
28+
<string name="text_about">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 © 2025 CodeDead</string>
2929
<string name="text_language">Lingua</string>
3030
<string name="text_send_mail">Inviaci una e-mail</string>
3131
<string name="alert_review_title">Recensione</string>

app/src/main/res/values-kk/strings.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<string name="button_support">Сұрақ қою</string>
2626
<string name="text_help">Файл хешін есептеу үшін DeadHash құрылғы жадын оқуға рұқсат алуы керек. Үлкен файлдың хешін есептеуге біраз уақыт кетуі мүмкін. Хештеу уақыты құрылғыңыздың өнімділігіне ғана байланысты.\n\nМәтін хешін есептеу үшін еш қосымша рұқсат қажет емес. Ұзын мәтіннің хеші де құрылғыңыздың өнімділігіне қарай ұзағырақ есептелуі мүмкін.\n\nҚатеге тап болсаңыз немесе көмек керек болса, бізге хабарласа аласыз.</string>
2727
<string name="nav_tools">Құралдар</string>
28-
<string name="text_about">DeadHash қолданбасын DeadLine жасаған. Оның көмегімен файл не мәтіннің хешін есептеуге болады.\n\nҚолданбаның осы нұсқасында жарнама мен бақылау құралдары жоқ. Барлық сұралған рұқсат қолданба дұрыс жұмыс істеуі үшін қажет.\n\nБарлық сурет Google рұқсатымен қолданылады.\nАудармалар: <a href="https://github.com/Fontan030">Fontan030</a>\n\nCopyright © 2024 CodeDead</string>
28+
<string name="text_about">DeadHash қолданбасын DeadLine жасаған. Оның көмегімен файл не мәтіннің хешін есептеуге болады.\n\nҚолданбаның осы нұсқасында жарнама мен бақылау құралдары жоқ. Барлық сұралған рұқсат қолданба дұрыс жұмыс істеуі үшін қажет.\n\nБарлық сурет Google рұқсатымен қолданылады.\nАудармалар: <a href="https://github.com/Fontan030">Fontan030</a>\n\nCopyright © 2025 CodeDead</string>
2929
<string name="text_language">Тіл</string>
3030
<string name="text_send_mail">Бізге хат жіберу</string>
3131
<string name="alert_review_title">Пікір қалдыру</string>

app/src/main/res/values-nl/strings.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<string name="nav_tools">Gereedschap</string>
1717
<string name="navigation_drawer_close">Sluit navigatie lade</string>
1818
<string name="navigation_drawer_open">Open navigatie lade</string>
19-
<string name="text_about">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 © 2024 CodeDead</string>
19+
<string name="text_about">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 © 2025 CodeDead</string>
2020
<string name="text_compare">Vergelijk:</string>
2121
<string name="text_compare_hash">Vergelijk hash</string>
2222
<string name="text_compare_hint">Plaats uw hash hier</string>

app/src/main/res/values-pt-rBR/strings.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<string name="button_support">Suporte</string>
2626
<string name="text_help">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!</string>
2727
<string name="nav_tools">Ferramentas</string>
28-
<string name="text_about">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 <a href="https://github.com/SnwMds">SnwMds</a>\n\nCopyright © 2024 CodeDead</string>
28+
<string name="text_about">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 <a href="https://github.com/SnwMds">SnwMds</a>\n\nCopyright © 2025 CodeDead</string>
2929
<string name="text_language">Idioma</string>
3030
<string name="text_send_mail">Envie-nos um e-mail</string>
3131
<string name="alert_review_title">Avalie-nos</string>

0 commit comments

Comments
 (0)