Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 0 additions & 33 deletions .github/ISSUE_TEMPLATE/bug_report.md

This file was deleted.

20 changes: 0 additions & 20 deletions .github/ISSUE_TEMPLATE/feature_request.md

This file was deleted.

76 changes: 0 additions & 76 deletions CODE_OF_CONDUCT.md

This file was deleted.

21 changes: 13 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
# Advanced PortChecker

Advanced PortChecker for Android is a variant of the [desktop application with the same name](https://github.com/CodeDead/Advanced-PortChecker).

# Google Play
## Google Play

Advanced PortChecker is available in Google Play store, free of charge:
https://play.google.com/store/apps/details?id=com.codedead.advancedportchecker

# About
This library is maintained by CodeDead. You can find more about us using the following links:
* [Website](https://codedead.com)
* [Twitter](https://twitter.com/C0DEDEAD)
* [Facebook](https://facebook.com/deadlinecodedead)
* [Reddit](https://reddit.com/r/CodeDead/)

## Translations

- Portuguese (Brazil) - [SnwMds](https://github.com/SnwMds)

## About

This library is maintained by CodeDead. You can find more about us using the following links:
* [Website](https://codedead.com/)
* [Twitter](https://twitter.com/C0DEDEAD/)
* [Facebook](https://facebook.com/deadlinecodedead/)

Copyright © 2023 CodeDead
29 changes: 15 additions & 14 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 30
compileSdk 34
namespace "com.codedead.advancedportchecker"
defaultConfig {
applicationId "com.codedead.advancedportchecker"
minSdkVersion 24
targetSdkVersion 30
versionCode 12
versionName '1.4.2'
minSdk 28
targetSdk 34
versionCode 13
versionName '1.5.0'
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
Expand All @@ -20,22 +21,22 @@ android {
productFlavors {
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.core:core:1.6.0'
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.core:core:1.12.0'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'com.google.android.material:material:1.10.0'
implementation 'androidx.vectordrawable:vectordrawable:1.1.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation "androidx.preference:preference:1.1.1"
implementation 'androidx.preference:preference:1.2.1'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
}
6 changes: 3 additions & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.VIBRATE" />

<application
Expand All @@ -27,7 +28,7 @@
<activity
android:name=".gui.activity.LoadingActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:label="@string/app_name"
android:exported="true"
android:theme="@style/LoadingTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand All @@ -37,11 +38,10 @@
</activity>
<activity
android:name=".gui.activity.ScanActivity"
android:label="@string/app_name"
android:launchMode="singleInstance" />
<activity
android:name=".gui.activity.AboutActivity"
android:label="@string/title_activity_about" />
</application>

</manifest>
</manifest>
Binary file added app/src/main/ic_launcher-playstore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed app/src/main/ic_launcher-web.png
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
package com.codedead.advancedportchecker.domain.controller;

import android.annotation.TargetApi;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.os.Build;

import androidx.preference.PreferenceManager;

Expand Down Expand Up @@ -45,12 +42,7 @@ public static Context onAttach(final Context context, final String defaultLangua
*/
public static Context setLocale(final Context context, final String language) {
persist(context, language);

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
return updateResources(context, language);
}

return updateResourcesLegacy(context, language);
return updateResources(context, language);
}

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

return context.createConfigurationContext(configuration);
}

/**
* Update the resources of a Context object
*
* @param context The Context object that should be configured
* @param language The language code that should be applied to the Context object
* @return The Context object containing correct resource properties
*/
private static Context updateResourcesLegacy(final Context context, final String language) {
final Locale locale = new Locale(language);
Locale.setDefault(locale);

final Resources resources = context.getResources();
final Configuration configuration = resources.getConfiguration();

configuration.locale = locale;
resources.updateConfiguration(configuration, resources.getDisplayMetrics());

return context;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,10 @@ private void switchFragment(final int selected) {
Fragment fragment;

selectedFragment = selected;
switch (selected) {
default:
case 0:
fragment = aboutFragment;
break;
case 1:
fragment = infoFragment;
break;
if (selected == 1) {
fragment = infoFragment;
} else {
fragment = aboutFragment;
}

trans.replace(R.id.content, fragment);
Expand Down
Loading