Skip to content

Commit

Permalink
Updated the project structure along with dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
D4rK7355608 committed Jul 31, 2024
1 parent 3ce9b0e commit f929ef2
Show file tree
Hide file tree
Showing 55 changed files with 808 additions and 628 deletions.
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
.cxx
local.properties
14 changes: 14 additions & 0 deletions .idea/appInsightsSettings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 0 additions & 11 deletions .idea/other.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file.

This file was deleted.

321 changes: 279 additions & 42 deletions .idea/workspace.xml

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
# Version 2.1.0

- **Minor**: Refactored codebase to improve modularity and scalability.
- **Minor**: Upgraded project dependencies to their latest versions for security and performance benefits.
- **Patch**: Migrated to the new compose compiler, resulting in faster build times and access to new language features.
- **Patch**: Enhanced several screens with performance optimizations.

# Version 2.0.0

- Migrated the app to Semantic Versioning (SemVer).
- Reworked the app functionality from the ground.
- Optimized the algorithm.
Expand Down
74 changes: 39 additions & 35 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,92 +1,96 @@
import org.jetbrains.kotlin.gradle.plugin.mpp.pm20.util.archivesName

plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
id("com.google.gms.google-services")
id("com.google.firebase.crashlytics")
id("com.google.android.gms.oss-licenses-plugin")
id("com.google.devtools.ksp")
alias(libs.plugins.androidApplication)
alias(libs.plugins.jetbrainsKotlinAndroid)
alias(libs.plugins.googlePlayServices)
alias(libs.plugins.googleOssServices)
alias(libs.plugins.googleFirebase)
alias(libs.plugins.compose.compiler)
alias(libs.plugins.devToolsKsp)
}

android {
compileSdk = 34
namespace = "com.d4rk.netprobe"
defaultConfig {
applicationId = "com.d4rk.netprobe"
minSdk = 26
targetSdk = 34
versionCode = 14
versionName = "2.0.0"
archivesName = "${applicationId}-v${versionName}"
versionCode = 15
versionName = "2.1.0"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
resourceConfigurations += listOf(
"en" ,
"de" ,
"es" ,
"fr" ,
"hi" ,
"hu" ,
"in" ,
"it" ,
"ja" ,
"ro" ,
"ru" ,
"tr" ,
"sv" ,
"bg" ,
"pl" ,
"uk"
"en",
"de",
"es",
"fr",
"hi",
"hu",
"in",
"it",
"ja",
"ro",
"ru",
"th",
"tr",
"sv",
"bg",
"pl",
"uk",
"pt-rBR",
)
vectorDrawables {
useSupportLibrary = true
}
}

buildTypes {
release {
multiDexEnabled = true
isMinifyEnabled = true
isShrinkResources = true
isDebuggable = false
versionNameSuffix = null
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt") , "proguard-rules.pro"
getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
)
}

debug {
multiDexEnabled = true
isDebuggable = true
versionNameSuffix = null
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt") , "proguard-rules.pro"
getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
)
}
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = "17"
}

buildFeatures {
viewBinding = true
buildConfig = true
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = "1.5.13"
}


packaging {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
}
}

bundle {
storeArchive {
enable = true
}
}
}

dependencies {
// Firebase
implementation(platform(libs.firebase.bom))
Expand Down
5 changes: 3 additions & 2 deletions app/src/main/kotlin/com/d4rk/netprobe/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,12 @@ class MainActivity : AppCompatActivity() {
*
* Consider utilizing alternative approaches for handling back button events.
*/
@Deprecated("Deprecated in Java")

@Deprecated("This method has been deprecated in favor of using the\n {@link OnBackPressedDispatcher} via {@link #getOnBackPressedDispatcher()}.\n The OnBackPressedDispatcher controls how back button events are dispatched\n to one or more {@link OnBackPressedCallback} objects.")
@Suppress("DEPRECATION")
override fun onBackPressed() {
MaterialAlertDialogBuilder(this).setTitle(R.string.close).setMessage(R.string.summary_close)
.setPositiveButton(android.R.string.yes) { _ , _ ->
.setPositiveButton(android.R.string.ok) { _ , _ ->
super.onBackPressed()
moveTaskToBack(true)
}.setNegativeButton(android.R.string.no , null).apply { show() }
Expand Down
32 changes: 16 additions & 16 deletions app/src/main/kotlin/com/d4rk/netprobe/MainComposable.kt
Original file line number Diff line number Diff line change
Expand Up @@ -42,36 +42,36 @@ import androidx.navigation.compose.currentBackStackEntryAsState
import androidx.navigation.compose.rememberNavController
import com.d4rk.netprobe.ads.FullBannerAdsComposable
import com.d4rk.netprobe.data.datastore.DataStore
import com.d4rk.netprobe.data.navigation.NavigationItem
import com.d4rk.netprobe.data.navigation.Screen
import com.d4rk.netprobe.data.model.ui.navigation.NavigationDrawerItem
import com.d4rk.netprobe.data.model.ui.navigation.BottomNavigationScreen
import com.d4rk.netprobe.ui.help.HelpActivity
import com.d4rk.netprobe.ui.scanner.HomeComposable
import com.d4rk.netprobe.ui.settings.SettingsActivity
import com.d4rk.netprobe.ui.speedtest.SpeedTestComposable
import com.d4rk.netprobe.ui.support.SupportActivity
import com.d4rk.netprobe.utils.Utils
import com.d4rk.netprobe.utils.IntentUtils
import kotlinx.coroutines.launch

@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun MainComposable() {
val bottomBarItems = listOf(
Screen.SpeedTest , Screen.LinkScan
BottomNavigationScreen.SpeedTest , BottomNavigationScreen.LinkScan
)
val drawerItems = listOf(
NavigationItem(
NavigationDrawerItem(
title = R.string.settings ,
selectedIcon = Icons.Outlined.Settings ,
) ,
NavigationItem(
NavigationDrawerItem(
title = R.string.help_and_feedback ,
selectedIcon = Icons.AutoMirrored.Outlined.HelpOutline ,
) ,
NavigationItem(
NavigationDrawerItem(
title = R.string.updates ,
selectedIcon = Icons.AutoMirrored.Outlined.EventNote ,
) ,
NavigationItem(
NavigationDrawerItem(
title = R.string.share , selectedIcon = Icons.Outlined.Share
) ,
)
Expand All @@ -92,26 +92,26 @@ fun MainComposable() {
when (item.title) {

R.string.settings -> {
Utils.openActivity(
IntentUtils.openActivity(
context , SettingsActivity::class.java
)
}

R.string.help_and_feedback -> {
Utils.openActivity(
IntentUtils.openActivity(
context , HelpActivity::class.java
)
}

R.string.updates -> {
Utils.openUrl(
IntentUtils.openUrl(
context ,
"https://github.com/D4rK7355608/${context.packageName}/blob/master/CHANGELOG.md"
)
}

R.string.share -> {
Utils.shareApp(context)
IntentUtils.shareApp(context)
}
}
scope.launch {
Expand Down Expand Up @@ -149,7 +149,7 @@ fun MainComposable() {
}
} , actions = {
IconButton(onClick = {
Utils.openActivity(context , SupportActivity::class.java)
IntentUtils.openActivity(context , SupportActivity::class.java)
}) {
Icon(
Icons.Outlined.VolunteerActivism , contentDescription = "Support"
Expand Down Expand Up @@ -180,13 +180,13 @@ fun MainComposable() {
}
}
}) { innerPadding ->
NavHost(navController , startDestination = Screen.SpeedTest.route) {
composable(Screen.SpeedTest.route) {
NavHost(navController , startDestination = BottomNavigationScreen.SpeedTest.route) {
composable(BottomNavigationScreen.SpeedTest.route) {
Box(modifier = Modifier.padding(innerPadding)) {
SpeedTestComposable()
}
}
composable(Screen.LinkScan.route) {
composable(BottomNavigationScreen.LinkScan.route) {
Box(modifier = Modifier.padding(innerPadding)) {
HomeComposable()
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.d4rk.netprobe.constants.permissions

object PermissionsConstants {
const val REQUEST_CODE_NOTIFICATION_PERMISSION = 2
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.d4rk.netprobe.constants.ui.bottombar

object BottomBarRoutes {
const val SPEED_TEST = "speed_test"
const val IP_ANALYZER = "ip_analyzer"
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package com.d4rk.netprobe.data.model.ui.button

enum class ButtonState { Pressed , Idle }
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.d4rk.netprobe.data.model
package com.d4rk.netprobe.data.model.ui.ipscan

data class ScanResult(
val ipAddress : String ,
Expand Down
Loading

0 comments on commit f929ef2

Please sign in to comment.