Skip to content

Commit

Permalink
Updated to 1.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
TrueMLGPro committed Feb 8, 2024
1 parent 6b3b1ac commit 96174cf
Show file tree
Hide file tree
Showing 81 changed files with 2,270 additions and 1,817 deletions.
16 changes: 9 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
.gradle
.idea
build/
app/build/
app/release/
local.properties
gradle.properties
.gradle/
.idea/
.stignore
.stfolder/
build/
app/build/
app/release/
local.properties
gradle.properties
40 changes: 33 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,27 @@
<div align="center">

<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">
<h1 align="center">Wi-Fi Info</h1>

<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>
<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>

---
<br>

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

<p align="center">
<a href="https://github.com/TrueMLGPro/Wi-Fi_Info/releases/">
<img src="https://img.shields.io/github/downloads/TrueMLGPro/Wi-Fi_Info/total.svg?style=for-the-badge&logo=github" alt="GitHub Release Downloads">
</a> <a href="https://play.google.com/store/apps/details?id=com.truemlgpro.wifiinfo">
<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">
</a>

<p align="center">
<a href="https://github.com/TrueMLGPro/Wi-Fi_Info/">
<img src="https://img.shields.io/github/repo-size/TrueMLGPro/Wi-Fi_Info?style=for-the-badge" alt="Github repo size">
Expand Down Expand Up @@ -43,9 +52,26 @@
</a>
</p>

</div>

<h2>Screenshots</h2>

<div align="center">

<table style="width:100%;overflow-x:auto;">
<tr>
<td><img src="https://github.com/TrueMLGPro/Wi-Fi_Info/assets/38999995/66d3310b-255b-4952-aa32-9b24b69abd1f" width="300"></td>
<td><img src="https://github.com/TrueMLGPro/Wi-Fi_Info/assets/38999995/b71da31b-659b-4e63-b461-461a3c434c7d" width="300"></td>
<td><img src="https://github.com/TrueMLGPro/Wi-Fi_Info/assets/38999995/84a1f58e-cbea-4b77-9e0e-89895067f35f" width="300"></td>
<td><img src="https://github.com/TrueMLGPro/Wi-Fi_Info/assets/38999995/a77fab82-8dc9-4d4c-9619-2f6e14fc1489" width="300"></td>
</tr>
</table>

</div>

<h2>Downloads</h2>

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

<h2>Features</h2>

Expand Down Expand Up @@ -117,7 +143,7 @@ For contributor guidelines, see <code><a href="CONTRIBUTING.md">CONTRIBUTING.md<
</a>
</p>

<pre><code>Copyright 2022 TrueMLGPro
<pre><code>Copyright 2020-2024 TrueMLGPro

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

Expand Down
32 changes: 17 additions & 15 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ apply plugin: 'com.android.application'

android {
namespace "com.truemlgpro.wifiinfo"
compileSdk 33
buildToolsVersion '33.0.2'
compileSdk 34
buildToolsVersion = '34.0.0'

signingConfigs {
release {
Expand All @@ -14,13 +14,13 @@ android {
}
}
compileOptions {
sourceCompatibility 1.8
targetCompatibility 1.8
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
defaultConfig {
applicationId "com.truemlgpro.wifiinfo"
minSdkVersion 21
targetSdkVersion 33
targetSdkVersion 34
versionCode 1610
versionName "1.6.1"
}
Expand All @@ -47,9 +47,9 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
applicationVariants.all { variant ->
variant.outputs.all {
outputFileName = "${APP_NAME}_${defaultConfig.versionName}_${variant.buildType.name}.apk"
applicationVariants.configureEach { variant ->
variant.outputs.configureEach {
outputFileName = "${APP_NAME}_v${defaultConfig.versionName}_${variant.buildType.name}.apk"
}
}
lint {
Expand All @@ -62,21 +62,23 @@ android {
}

dependencies {
implementation 'androidx.appcompat:appcompat:1.7.0-alpha01'
implementation 'com.google.android.material:material:1.9.0'
implementation 'androidx.appcompat:appcompat:1.7.0-alpha03'
implementation 'com.google.android.material:material:1.11.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation "androidx.recyclerview:recyclerview:1.3.0"
implementation 'androidx.preference:preference:1.2.0'
implementation "androidx.recyclerview:recyclerview:1.3.2"
implementation 'androidx.preference:preference:1.2.1'
implementation 'androidx.core:core-splashscreen:1.0.1'

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

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

implementation fileTree(dir: 'libs', include: ['*.jar'])
Expand Down
2 changes: 2 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

-dontwarn org.slf4j.impl.StaticLoggerBinder
21 changes: 15 additions & 6 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<uses-sdk
android:minSdkVersion="21"
android:targetSdkVersion="33"
android:targetSdkVersion="34"
tools:overrideLibrary="thecollectiveweb.com.tcwhois"
tools:ignore="GradleOverrides" />

Expand All @@ -15,16 +15,19 @@
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_SPECIAL_USE" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />

<application
android:name=".App"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/DarkTheme"
android:largeHeap="true"
android:usesCleartextTraffic="true"
tools:targetApi="tiramisu"
android:localeConfig="@xml/locale_config">
android:localeConfig="@xml/locale_config"
tools:targetApi="tiramisu">

<meta-data android:name="android.webkit.WebView.MetricsOptOut"
android:value="true" />
Expand All @@ -33,7 +36,7 @@
android:name="com.truemlgpro.wifiinfo.ui.MainActivity"
android:screenOrientation="unspecified"
android:configChanges="orientation|screenSize|screenLayout|smallestScreenSize"
android:theme="@style/SplashDark"
android:theme="@style/Theme.App.Starting"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand Down Expand Up @@ -128,12 +131,18 @@

<service
android:name=".services.ConnectionStateService"
android:enabled="true">
android:enabled="true"
android:foregroundServiceType="specialUse">
<property android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE"
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." />
</service>

<service
android:name=".services.NotificationService"
android:enabled="true">
android:enabled="true"
android:foregroundServiceType="specialUse">
<property android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE"
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." />
</service>

<service
Expand Down
Binary file modified app/src/main/assets/databases/iana_ports.db
Binary file not shown.
Binary file modified app/src/main/assets/databases/oui.db
Binary file not shown.
135 changes: 135 additions & 0 deletions app/src/main/java/com/truemlgpro/wifiinfo/App.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
package com.truemlgpro.wifiinfo;

import android.app.Activity;
import android.app.Application;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Build;
import android.os.Bundle;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.preference.PreferenceManager;

import com.truemlgpro.wifiinfo.interfaces.PreferenceDefaults;
import com.truemlgpro.wifiinfo.interfaces.PreferenceKeys;
import com.truemlgpro.wifiinfo.services.ConnectionStateService;
import com.truemlgpro.wifiinfo.services.NotificationService;
import com.truemlgpro.wifiinfo.ui.SettingsActivity;

public class App extends Application {
private SharedPreferences.OnSharedPreferenceChangeListener sharedPrefChangeListener;
Intent connectionStateServiceIntent;
Intent notificationServiceIntent;

@Override
public void onCreate() {
super.onCreate();
registerActivityLifecycleCallbacks(new ActivityLifecycleCallbacks() {
@Override
public void onActivityCreated(@NonNull Activity activity, @Nullable Bundle savedInstanceState) {
// Stub
}

@Override
public void onActivityStarted(Activity activity) {
// Stub
}

@Override
public void onActivityResumed(Activity activity) {
if (activity.getClass().equals(SettingsActivity.class))
initSharedPrefs(activity);
}

@Override
public void onActivityPaused(Activity activity) {
if (activity.getClass().equals(SettingsActivity.class)) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
prefs.unregisterOnSharedPreferenceChangeListener(sharedPrefChangeListener);
}
}

@Override
public void onActivityStopped(Activity activity) {
// Stub
}

@Override
public void onActivitySaveInstanceState(Activity activity, Bundle bundle) {
// Stub
}

@Override
public void onActivityDestroyed(Activity activity) {
// Stub
}
});
}

private void initSharedPrefs(Activity activity) {
connectionStateServiceIntent = new Intent(this, ConnectionStateService.class);
notificationServiceIntent = new Intent(this, NotificationService.class);
sharedPrefChangeListener = (prefs, key) -> {
switch (key) {
case PreferenceKeys.KEY_PREF_DARK_MODE,
PreferenceKeys.KEY_PREF_AMOLED_MODE,
PreferenceKeys.KEY_PREF_APP_FONT,
PreferenceKeys.KEY_PREF_KEEP_SCREEN_ON ->
restartSettingsActivity(activity);
case PreferenceKeys.KEY_PREF_APP_LANGUAGE -> {
restartSettingsActivity(activity);
if (prefs.getBoolean(PreferenceKeys.KEY_PREF_SHOW_NTFC, PreferenceDefaults.SHOW_NTFC))
restartServices(this);
}
case PreferenceKeys.KEY_PREF_SHOW_NTFC -> {
if (prefs.getBoolean(PreferenceKeys.KEY_PREF_SHOW_NTFC, PreferenceDefaults.SHOW_NTFC)) {
startServices(this);
} else {
stopServices(this);
}
}
case PreferenceKeys.KEY_PREF_START_STOP_SVC -> restartServices(this);
}
};

SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
prefs.registerOnSharedPreferenceChangeListener(sharedPrefChangeListener);
}

private void startServices(Context context) {
if (!ConnectionStateService.isConnectionStateServiceRunning) {
if (Build.VERSION.SDK_INT < 26) {
context.startService(connectionStateServiceIntent);
} else {
context.startForegroundService(connectionStateServiceIntent);
}
}
}

private void stopServices(Context context) {
context.stopService(notificationServiceIntent);
context.stopService(connectionStateServiceIntent);
}

private void restartServices(Context context) {
context.stopService(notificationServiceIntent);
context.stopService(connectionStateServiceIntent);
if (Build.VERSION.SDK_INT < 26) {
context.startService(connectionStateServiceIntent);
} else {
context.startForegroundService(connectionStateServiceIntent);
}
}

private void restartSettingsActivity(Activity activity) {
if (activity.getClass().equals(SettingsActivity.class)) {
Intent activityRestartIntent = new Intent(this, SettingsActivity.class);
activity.finish();
activity.overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out);
activity.startActivity(activityRestartIntent);
activity.overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ public PortScannerAdapter(ArrayList<DiscoveredPort> discoveredPortsArrayList) {
}

public static class ViewHolder extends RecyclerView.ViewHolder {
public TextView textview_open_port;
public TextView textview_port_service_name;
public TextView textview_port_service_desc;
public TextView textview_port_service_protocol;
public final TextView textview_open_port;
public final TextView textview_port_service_name;
public final TextView textview_port_service_desc;
public final TextView textview_port_service_protocol;

public ViewHolder(View itemView) {
super(itemView);
Expand All @@ -45,10 +45,10 @@ public PortScannerAdapter.ViewHolder onCreateViewHolder(@NonNull ViewGroup paren
@Override
public void onBindViewHolder(@NonNull PortScannerAdapter.ViewHolder holder, int position) {
DiscoveredPort discoveredPort = discoveredPortsArrayList.get(position);
holder.textview_open_port.setText(discoveredPort.getOpenPort());
holder.textview_port_service_name.setText(discoveredPort.getPortServiceName());
holder.textview_port_service_desc.setText(discoveredPort.getPortServiceDescription());
holder.textview_port_service_protocol.setText(discoveredPort.getPortServiceProtocol());
holder.textview_open_port.setText(discoveredPort.openPort());
holder.textview_port_service_name.setText(discoveredPort.portServiceName());
holder.textview_port_service_desc.setText(discoveredPort.portServiceDescription());
holder.textview_port_service_protocol.setText(discoveredPort.portServiceProtocol());
}

@Override
Expand Down
Loading

0 comments on commit 96174cf

Please sign in to comment.