Skip to content

Commit 96174cf

Browse files
committed
Updated to 1.6.1
1 parent 6b3b1ac commit 96174cf

File tree

81 files changed

+2270
-1817
lines changed

Some content is hidden

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

81 files changed

+2270
-1817
lines changed

.gitignore

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
.gradle
2-
.idea
3-
build/
4-
app/build/
5-
app/release/
6-
local.properties
7-
gradle.properties
1+
.gradle/
2+
.idea/
3+
.stignore
4+
.stfolder/
5+
build/
6+
app/build/
7+
app/release/
8+
local.properties
9+
gradle.properties

README.md

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,27 @@
1+
<div align="center">
2+
3+
<img align="center" width="160" height="160" src="https://raw.githubusercontent.com/TrueMLGPro/Wi-Fi_Info/master/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png" alt="App Logo">
14
<h1 align="center">Wi-Fi Info</h1>
25

3-
<p align="center">A powerful network toolset packed into an Android app, which gathers and displays the information about the Wi-Fi network you are connected to!</p>
6+
<p align="center">
7+
A powerful network toolset packed into an Android app, which gathers and displays the information about the Wi-Fi network you are connected to!
8+
</p>
49

510
---
6-
<br>
711

812
<p align="center">
913
<a href="https://github.com/TrueMLGPro/Wi-Fi_Info/releases/">
1014
<img src="https://img.shields.io/github/release/TrueMLGPro/Wi-Fi_Info.svg?style=for-the-badge" alt="GitHub latest release">
11-
</a> <a href="https://github.com/TrueMLGPro/Wi-Fi_Info/releases/">
12-
<img src="https://img.shields.io/github/downloads/TrueMLGPro/Wi-Fi_Info/total.svg?style=for-the-badge" alt="GitHub all releases">
1315
</a>
1416
</p>
1517

18+
<p align="center">
19+
<a href="https://github.com/TrueMLGPro/Wi-Fi_Info/releases/">
20+
<img src="https://img.shields.io/github/downloads/TrueMLGPro/Wi-Fi_Info/total.svg?style=for-the-badge&logo=github" alt="GitHub Release Downloads">
21+
</a> <a href="https://play.google.com/store/apps/details?id=com.truemlgpro.wifiinfo">
22+
<img src="https://img.shields.io/endpoint?style=for-the-badge&color=green&logo=google-play&url=https%3A%2F%2Fplay.cuzi.workers.dev%2Fplay%3Fi%3Dcom.truemlgpro.wifiinfo%26gl%3DUS%26hl%3Den%26l%3DDownloads%26m%3D%24totalinstalls" alt="Play Store Downloads">
23+
</a>
24+
1625
<p align="center">
1726
<a href="https://github.com/TrueMLGPro/Wi-Fi_Info/">
1827
<img src="https://img.shields.io/github/repo-size/TrueMLGPro/Wi-Fi_Info?style=for-the-badge" alt="Github repo size">
@@ -43,9 +52,26 @@
4352
</a>
4453
</p>
4554

55+
</div>
56+
57+
<h2>Screenshots</h2>
58+
59+
<div align="center">
60+
61+
<table style="width:100%;overflow-x:auto;">
62+
<tr>
63+
<td><img src="https://github.com/TrueMLGPro/Wi-Fi_Info/assets/38999995/66d3310b-255b-4952-aa32-9b24b69abd1f" width="300"></td>
64+
<td><img src="https://github.com/TrueMLGPro/Wi-Fi_Info/assets/38999995/b71da31b-659b-4e63-b461-461a3c434c7d" width="300"></td>
65+
<td><img src="https://github.com/TrueMLGPro/Wi-Fi_Info/assets/38999995/84a1f58e-cbea-4b77-9e0e-89895067f35f" width="300"></td>
66+
<td><img src="https://github.com/TrueMLGPro/Wi-Fi_Info/assets/38999995/a77fab82-8dc9-4d4c-9619-2f6e14fc1489" width="300"></td>
67+
</tr>
68+
</table>
69+
70+
</div>
71+
4672
<h2>Downloads</h2>
4773

48-
<p align="center">
74+
<div align="center">
4975
<a href="https://play.google.com/store/apps/details?id=com.truemlgpro.wifiinfo">
5076
<img src="https://github-production-user-asset-6210df.s3.amazonaws.com/38999995/241763872-7a699ba7-5c7e-4e9f-a65a-0a8d2c596ffb.png" alt="Play Store">
5177
</a>
@@ -54,7 +80,7 @@
5480
</a>
5581
<p align="center">or</p>
5682
<h3 align="center"><strong><a href="https://github.com/TrueMLGPro/Wi-Fi_Info/releases/" style="text-align:center">Releases</a></strong></h3>
57-
</p>
83+
</div>
5884

5985
<h2>Features</h2>
6086

@@ -117,7 +143,7 @@ For contributor guidelines, see <code><a href="CONTRIBUTING.md">CONTRIBUTING.md<
117143
</a>
118144
</p>
119145

120-
<pre><code>Copyright 2022 TrueMLGPro
146+
<pre><code>Copyright 2020-2024 TrueMLGPro
121147

122148
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
123149

app/build.gradle

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ apply plugin: 'com.android.application'
22

33
android {
44
namespace "com.truemlgpro.wifiinfo"
5-
compileSdk 33
6-
buildToolsVersion '33.0.2'
5+
compileSdk 34
6+
buildToolsVersion = '34.0.0'
77

88
signingConfigs {
99
release {
@@ -14,13 +14,13 @@ android {
1414
}
1515
}
1616
compileOptions {
17-
sourceCompatibility 1.8
18-
targetCompatibility 1.8
17+
sourceCompatibility JavaVersion.VERSION_17
18+
targetCompatibility JavaVersion.VERSION_17
1919
}
2020
defaultConfig {
2121
applicationId "com.truemlgpro.wifiinfo"
2222
minSdkVersion 21
23-
targetSdkVersion 33
23+
targetSdkVersion 34
2424
versionCode 1610
2525
versionName "1.6.1"
2626
}
@@ -47,9 +47,9 @@ android {
4747
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
4848
}
4949
}
50-
applicationVariants.all { variant ->
51-
variant.outputs.all {
52-
outputFileName = "${APP_NAME}_${defaultConfig.versionName}_${variant.buildType.name}.apk"
50+
applicationVariants.configureEach { variant ->
51+
variant.outputs.configureEach {
52+
outputFileName = "${APP_NAME}_v${defaultConfig.versionName}_${variant.buildType.name}.apk"
5353
}
5454
}
5555
lint {
@@ -62,21 +62,23 @@ android {
6262
}
6363

6464
dependencies {
65-
implementation 'androidx.appcompat:appcompat:1.7.0-alpha01'
66-
implementation 'com.google.android.material:material:1.9.0'
65+
implementation 'androidx.appcompat:appcompat:1.7.0-alpha03'
66+
implementation 'com.google.android.material:material:1.11.0'
6767
implementation 'androidx.cardview:cardview:1.0.0'
68-
implementation "androidx.recyclerview:recyclerview:1.3.0"
69-
implementation 'androidx.preference:preference:1.2.0'
68+
implementation "androidx.recyclerview:recyclerview:1.3.2"
69+
implementation 'androidx.preference:preference:1.2.1'
7070
implementation 'androidx.core:core-splashscreen:1.0.1'
7171

7272
implementation 'com.github.AnwarShahriar:Calligrapher:master'
7373
implementation 'com.mikhaellopez:circularimageview:4.3.1'
7474
implementation 'com.github.sougata-chatterjee:FloatingActionButton:1.7.1'
7575

7676
implementation 'com.github.TrueMLGPro:AndroidNetworkTools:76b8feabb6' // Fork of a Kotlin rewrite of stealthcopter/AndroidNetworkTools
77-
implementation 'com.github.100rabhkr:TCWHOIS:master' // Minimum SDK version is 22, ignored in AndroidManifest.xml
78-
implementation 'com.readystatesoftware.sqliteasset:sqliteassethelper:+'
79-
implementation 'org.minidns:minidns-hla:1.0.4'
77+
implementation 'com.github.100rabhkr:TCWHOIS:master' // Whois lookups (minimum SDK version is 22, ignored in AndroidManifest.xml)
78+
implementation 'com.readystatesoftware.sqliteasset:sqliteassethelper:2.0.1' // Helper for working with databases located in assets folder
79+
// implementation 'org.fourthline.cling:cling-core:2.1.2' // Library for locating UPnP devices on the local network; for 1.6.2
80+
implementation 'eu.agno3.jcifs:jcifs-ng:2.1.9' // Library used for locating NetBIOS devices on the local network
81+
implementation 'org.minidns:minidns-hla:1.0.4' // DNS lookups
8082
implementation 'org.minidns:minidns-android21:1.0.4'
8183

8284
implementation fileTree(dir: 'libs', include: ['*.jar'])

app/proguard-rules.pro

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,5 @@
1515
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
1616
# public *;
1717
#}
18+
19+
-dontwarn org.slf4j.impl.StaticLoggerBinder

app/src/main/AndroidManifest.xml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<uses-sdk
66
android:minSdkVersion="21"
7-
android:targetSdkVersion="33"
7+
android:targetSdkVersion="34"
88
tools:overrideLibrary="thecollectiveweb.com.tcwhois"
99
tools:ignore="GradleOverrides" />
1010

@@ -15,16 +15,19 @@
1515
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
1616
<uses-permission android:name="android.permission.INTERNET" />
1717
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
18+
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_SPECIAL_USE" />
19+
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
1820
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
1921

2022
<application
23+
android:name=".App"
2124
android:icon="@mipmap/ic_launcher"
2225
android:label="@string/app_name"
2326
android:theme="@style/DarkTheme"
2427
android:largeHeap="true"
2528
android:usesCleartextTraffic="true"
26-
tools:targetApi="tiramisu"
27-
android:localeConfig="@xml/locale_config">
29+
android:localeConfig="@xml/locale_config"
30+
tools:targetApi="tiramisu">
2831

2932
<meta-data android:name="android.webkit.WebView.MetricsOptOut"
3033
android:value="true" />
@@ -33,7 +36,7 @@
3336
android:name="com.truemlgpro.wifiinfo.ui.MainActivity"
3437
android:screenOrientation="unspecified"
3538
android:configChanges="orientation|screenSize|screenLayout|smallestScreenSize"
36-
android:theme="@style/SplashDark"
39+
android:theme="@style/Theme.App.Starting"
3740
android:exported="true">
3841
<intent-filter>
3942
<action android:name="android.intent.action.MAIN" />
@@ -128,12 +131,18 @@
128131

129132
<service
130133
android:name=".services.ConnectionStateService"
131-
android:enabled="true">
134+
android:enabled="true"
135+
android:foregroundServiceType="specialUse">
136+
<property android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE"
137+
android:value="This service listens to the state of the Wi-Fi connection and manages the lifecycle of the NotificationService based on the changes of this state. When the user disconnects from a Wi-Fi network, this service stops the NotificationService to avoid unnecessary battery drain. Likewise, when the user reconnects to a Wi-Fi network, this service restarts the NotificationService." />
132138
</service>
133139

134140
<service
135141
android:name=".services.NotificationService"
136-
android:enabled="true">
142+
android:enabled="true"
143+
android:foregroundServiceType="specialUse">
144+
<property android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE"
145+
android:value="This service provides real-time updates of the current Wi-Fi connection information such as SSID, BSSID, RSSI, etc., even when the application is not running or is in the background." />
137146
</service>
138147

139148
<service
0 Bytes
Binary file not shown.

app/src/main/assets/databases/oui.db

40 KB
Binary file not shown.
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
package com.truemlgpro.wifiinfo;
2+
3+
import android.app.Activity;
4+
import android.app.Application;
5+
import android.content.Context;
6+
import android.content.Intent;
7+
import android.content.SharedPreferences;
8+
import android.os.Build;
9+
import android.os.Bundle;
10+
11+
import androidx.annotation.NonNull;
12+
import androidx.annotation.Nullable;
13+
import androidx.preference.PreferenceManager;
14+
15+
import com.truemlgpro.wifiinfo.interfaces.PreferenceDefaults;
16+
import com.truemlgpro.wifiinfo.interfaces.PreferenceKeys;
17+
import com.truemlgpro.wifiinfo.services.ConnectionStateService;
18+
import com.truemlgpro.wifiinfo.services.NotificationService;
19+
import com.truemlgpro.wifiinfo.ui.SettingsActivity;
20+
21+
public class App extends Application {
22+
private SharedPreferences.OnSharedPreferenceChangeListener sharedPrefChangeListener;
23+
Intent connectionStateServiceIntent;
24+
Intent notificationServiceIntent;
25+
26+
@Override
27+
public void onCreate() {
28+
super.onCreate();
29+
registerActivityLifecycleCallbacks(new ActivityLifecycleCallbacks() {
30+
@Override
31+
public void onActivityCreated(@NonNull Activity activity, @Nullable Bundle savedInstanceState) {
32+
// Stub
33+
}
34+
35+
@Override
36+
public void onActivityStarted(Activity activity) {
37+
// Stub
38+
}
39+
40+
@Override
41+
public void onActivityResumed(Activity activity) {
42+
if (activity.getClass().equals(SettingsActivity.class))
43+
initSharedPrefs(activity);
44+
}
45+
46+
@Override
47+
public void onActivityPaused(Activity activity) {
48+
if (activity.getClass().equals(SettingsActivity.class)) {
49+
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
50+
prefs.unregisterOnSharedPreferenceChangeListener(sharedPrefChangeListener);
51+
}
52+
}
53+
54+
@Override
55+
public void onActivityStopped(Activity activity) {
56+
// Stub
57+
}
58+
59+
@Override
60+
public void onActivitySaveInstanceState(Activity activity, Bundle bundle) {
61+
// Stub
62+
}
63+
64+
@Override
65+
public void onActivityDestroyed(Activity activity) {
66+
// Stub
67+
}
68+
});
69+
}
70+
71+
private void initSharedPrefs(Activity activity) {
72+
connectionStateServiceIntent = new Intent(this, ConnectionStateService.class);
73+
notificationServiceIntent = new Intent(this, NotificationService.class);
74+
sharedPrefChangeListener = (prefs, key) -> {
75+
switch (key) {
76+
case PreferenceKeys.KEY_PREF_DARK_MODE,
77+
PreferenceKeys.KEY_PREF_AMOLED_MODE,
78+
PreferenceKeys.KEY_PREF_APP_FONT,
79+
PreferenceKeys.KEY_PREF_KEEP_SCREEN_ON ->
80+
restartSettingsActivity(activity);
81+
case PreferenceKeys.KEY_PREF_APP_LANGUAGE -> {
82+
restartSettingsActivity(activity);
83+
if (prefs.getBoolean(PreferenceKeys.KEY_PREF_SHOW_NTFC, PreferenceDefaults.SHOW_NTFC))
84+
restartServices(this);
85+
}
86+
case PreferenceKeys.KEY_PREF_SHOW_NTFC -> {
87+
if (prefs.getBoolean(PreferenceKeys.KEY_PREF_SHOW_NTFC, PreferenceDefaults.SHOW_NTFC)) {
88+
startServices(this);
89+
} else {
90+
stopServices(this);
91+
}
92+
}
93+
case PreferenceKeys.KEY_PREF_START_STOP_SVC -> restartServices(this);
94+
}
95+
};
96+
97+
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
98+
prefs.registerOnSharedPreferenceChangeListener(sharedPrefChangeListener);
99+
}
100+
101+
private void startServices(Context context) {
102+
if (!ConnectionStateService.isConnectionStateServiceRunning) {
103+
if (Build.VERSION.SDK_INT < 26) {
104+
context.startService(connectionStateServiceIntent);
105+
} else {
106+
context.startForegroundService(connectionStateServiceIntent);
107+
}
108+
}
109+
}
110+
111+
private void stopServices(Context context) {
112+
context.stopService(notificationServiceIntent);
113+
context.stopService(connectionStateServiceIntent);
114+
}
115+
116+
private void restartServices(Context context) {
117+
context.stopService(notificationServiceIntent);
118+
context.stopService(connectionStateServiceIntent);
119+
if (Build.VERSION.SDK_INT < 26) {
120+
context.startService(connectionStateServiceIntent);
121+
} else {
122+
context.startForegroundService(connectionStateServiceIntent);
123+
}
124+
}
125+
126+
private void restartSettingsActivity(Activity activity) {
127+
if (activity.getClass().equals(SettingsActivity.class)) {
128+
Intent activityRestartIntent = new Intent(this, SettingsActivity.class);
129+
activity.finish();
130+
activity.overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out);
131+
activity.startActivity(activityRestartIntent);
132+
activity.overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out);
133+
}
134+
}
135+
}

app/src/main/java/com/truemlgpro/wifiinfo/adapters/PortScannerAdapter.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ public PortScannerAdapter(ArrayList<DiscoveredPort> discoveredPortsArrayList) {
2121
}
2222

2323
public static class ViewHolder extends RecyclerView.ViewHolder {
24-
public TextView textview_open_port;
25-
public TextView textview_port_service_name;
26-
public TextView textview_port_service_desc;
27-
public TextView textview_port_service_protocol;
24+
public final TextView textview_open_port;
25+
public final TextView textview_port_service_name;
26+
public final TextView textview_port_service_desc;
27+
public final TextView textview_port_service_protocol;
2828

2929
public ViewHolder(View itemView) {
3030
super(itemView);
@@ -45,10 +45,10 @@ public PortScannerAdapter.ViewHolder onCreateViewHolder(@NonNull ViewGroup paren
4545
@Override
4646
public void onBindViewHolder(@NonNull PortScannerAdapter.ViewHolder holder, int position) {
4747
DiscoveredPort discoveredPort = discoveredPortsArrayList.get(position);
48-
holder.textview_open_port.setText(discoveredPort.getOpenPort());
49-
holder.textview_port_service_name.setText(discoveredPort.getPortServiceName());
50-
holder.textview_port_service_desc.setText(discoveredPort.getPortServiceDescription());
51-
holder.textview_port_service_protocol.setText(discoveredPort.getPortServiceProtocol());
48+
holder.textview_open_port.setText(discoveredPort.openPort());
49+
holder.textview_port_service_name.setText(discoveredPort.portServiceName());
50+
holder.textview_port_service_desc.setText(discoveredPort.portServiceDescription());
51+
holder.textview_port_service_protocol.setText(discoveredPort.portServiceProtocol());
5252
}
5353

5454
@Override

0 commit comments

Comments
 (0)