Skip to content

Commit d4591a6

Browse files
authored
Merge pull request #5 from CodeDead/feature/upgrades
feat: refactoring, updated icon, added scan progress notification, tr…
2 parents 4627871 + 52b3a27 commit d4591a6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+394
-466
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 0 additions & 33 deletions
This file was deleted.

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 0 additions & 20 deletions
This file was deleted.

CODE_OF_CONDUCT.md

Lines changed: 0 additions & 76 deletions
This file was deleted.

README.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
11
# Advanced PortChecker
2+
23
Advanced PortChecker for Android is a variant of the [desktop application with the same name](https://github.com/CodeDead/Advanced-PortChecker).
34

4-
# Google Play
5+
## Google Play
6+
57
Advanced PortChecker is available in Google Play store, free of charge:
68
https://play.google.com/store/apps/details?id=com.codedead.advancedportchecker
79

8-
# About
9-
This library is maintained by CodeDead. You can find more about us using the following links:
10-
* [Website](https://codedead.com)
11-
* [Twitter](https://twitter.com/C0DEDEAD)
12-
* [Facebook](https://facebook.com/deadlinecodedead)
13-
* [Reddit](https://reddit.com/r/CodeDead/)
14-
1510
## Translations
11+
1612
- Portuguese (Brazil) - [SnwMds](https://github.com/SnwMds)
13+
14+
## About
15+
16+
This library is maintained by CodeDead. You can find more about us using the following links:
17+
* [Website](https://codedead.com/)
18+
* [Twitter](https://twitter.com/C0DEDEAD/)
19+
* [Facebook](https://facebook.com/deadlinecodedead/)
20+
21+
Copyright © 2023 CodeDead

app/build.gradle

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
apply plugin: 'com.android.application'
22

33
android {
4-
compileSdkVersion 30
4+
compileSdk 34
5+
namespace "com.codedead.advancedportchecker"
56
defaultConfig {
67
applicationId "com.codedead.advancedportchecker"
7-
minSdkVersion 24
8-
targetSdkVersion 30
9-
versionCode 12
10-
versionName '1.4.2'
8+
minSdk 28
9+
targetSdk 34
10+
versionCode 13
11+
versionName '1.5.0'
1112
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1213
vectorDrawables.useSupportLibrary = true
1314
}
@@ -20,22 +21,22 @@ android {
2021
productFlavors {
2122
}
2223
compileOptions {
23-
sourceCompatibility JavaVersion.VERSION_1_8
24-
targetCompatibility JavaVersion.VERSION_1_8
24+
sourceCompatibility JavaVersion.VERSION_17
25+
targetCompatibility JavaVersion.VERSION_17
2526
}
2627
}
2728

2829
dependencies {
2930
implementation fileTree(include: ['*.jar'], dir: 'libs')
30-
implementation 'androidx.core:core:1.6.0'
31-
implementation 'androidx.appcompat:appcompat:1.3.0'
32-
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
33-
implementation 'com.google.android.material:material:1.4.0'
31+
implementation 'androidx.core:core:1.12.0'
32+
implementation 'androidx.appcompat:appcompat:1.6.1'
33+
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
34+
implementation 'com.google.android.material:material:1.10.0'
3435
implementation 'androidx.vectordrawable:vectordrawable:1.1.0'
3536
implementation 'androidx.cardview:cardview:1.0.0'
3637
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
37-
implementation "androidx.preference:preference:1.1.1"
38+
implementation 'androidx.preference:preference:1.2.1'
3839
testImplementation 'junit:junit:4.13.2'
39-
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
40-
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
40+
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
41+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
4142
}

app/src/main/AndroidManifest.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
88
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
99
<uses-permission android:name="android.permission.INTERNET" />
10+
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
1011
<uses-permission android:name="android.permission.VIBRATE" />
1112

1213
<application
@@ -27,7 +28,7 @@
2728
<activity
2829
android:name=".gui.activity.LoadingActivity"
2930
android:configChanges="orientation|keyboardHidden|screenSize"
30-
android:label="@string/app_name"
31+
android:exported="true"
3132
android:theme="@style/LoadingTheme">
3233
<intent-filter>
3334
<action android:name="android.intent.action.MAIN" />
@@ -37,11 +38,10 @@
3738
</activity>
3839
<activity
3940
android:name=".gui.activity.ScanActivity"
40-
android:label="@string/app_name"
4141
android:launchMode="singleInstance" />
4242
<activity
4343
android:name=".gui.activity.AboutActivity"
4444
android:label="@string/title_activity_about" />
4545
</application>
4646

47-
</manifest>
47+
</manifest>
15.7 KB
Loading

app/src/main/ic_launcher-web.png

-33.2 KB
Binary file not shown.

app/src/main/java/com/codedead/advancedportchecker/domain/controller/LocaleHelper.java

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
package com.codedead.advancedportchecker.domain.controller;
22

3-
import android.annotation.TargetApi;
43
import android.content.Context;
54
import android.content.SharedPreferences;
65
import android.content.res.Configuration;
7-
import android.content.res.Resources;
8-
import android.os.Build;
96

107
import androidx.preference.PreferenceManager;
118

@@ -45,12 +42,7 @@ public static Context onAttach(final Context context, final String defaultLangua
4542
*/
4643
public static Context setLocale(final Context context, final String language) {
4744
persist(context, language);
48-
49-
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
50-
return updateResources(context, language);
51-
}
52-
53-
return updateResourcesLegacy(context, language);
45+
return updateResources(context, language);
5446
}
5547

5648
/**
@@ -86,7 +78,6 @@ private static void persist(final Context context, final String language) {
8678
* @param language The language code that should be applied to the Context object
8779
* @return The Context object containing correct resource properties
8880
*/
89-
@TargetApi(Build.VERSION_CODES.N)
9081
private static Context updateResources(final Context context, final String language) {
9182
final Locale locale = new Locale(language);
9283
Locale.setDefault(locale);
@@ -96,24 +87,4 @@ private static Context updateResources(final Context context, final String langu
9687

9788
return context.createConfigurationContext(configuration);
9889
}
99-
100-
/**
101-
* Update the resources of a Context object
102-
*
103-
* @param context The Context object that should be configured
104-
* @param language The language code that should be applied to the Context object
105-
* @return The Context object containing correct resource properties
106-
*/
107-
private static Context updateResourcesLegacy(final Context context, final String language) {
108-
final Locale locale = new Locale(language);
109-
Locale.setDefault(locale);
110-
111-
final Resources resources = context.getResources();
112-
final Configuration configuration = resources.getConfiguration();
113-
114-
configuration.locale = locale;
115-
resources.updateConfiguration(configuration, resources.getDisplayMetrics());
116-
117-
return context;
118-
}
11990
}

app/src/main/java/com/codedead/advancedportchecker/gui/activity/AboutActivity.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -127,14 +127,10 @@ private void switchFragment(final int selected) {
127127
Fragment fragment;
128128

129129
selectedFragment = selected;
130-
switch (selected) {
131-
default:
132-
case 0:
133-
fragment = aboutFragment;
134-
break;
135-
case 1:
136-
fragment = infoFragment;
137-
break;
130+
if (selected == 1) {
131+
fragment = infoFragment;
132+
} else {
133+
fragment = aboutFragment;
138134
}
139135

140136
trans.replace(R.id.content, fragment);

0 commit comments

Comments
 (0)