Skip to content

Commit

Permalink
updated kotlin,gradle,version
Browse files Browse the repository at this point in the history
  • Loading branch information
lavahasif committed Oct 28, 2022
0 parents commit 9e61400
Show file tree
Hide file tree
Showing 81 changed files with 4,780 additions and 0 deletions.
Binary file added .README.MD_images/1677a230.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 added .README.MD_images/port.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
3 changes: 3 additions & 0 deletions .idea/.gitignore

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

1 change: 1 addition & 0 deletions .idea/.name

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

6 changes: 6 additions & 0 deletions .idea/compiler.xml

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

21 changes: 21 additions & 0 deletions .idea/gradle.xml

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

20 changes: 20 additions & 0 deletions .idea/misc.xml

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

6 changes: 6 additions & 0 deletions .idea/vcs.xml

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

200 changes: 200 additions & 0 deletions README.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
*****ShowDevice IP in a Wi-Fi Network && Show PortAvailable IP***** <br/>
======================
**build.gradle(app)**
![image](https://user-images.githubusercontent.com/22430922/185182801-5e8c864e-3597-40a2-a631-6cb1edc7b1ef.png)

```groovy
dependencies {
//..........
implementation 'com.github.lavahasif:PortScan_Android:1.0.11'
// -----------
}
```
**------------------IF gradle greater than 7------------------------**
<br/>
**settings.gradle**


![image](https://user-images.githubusercontent.com/22430922/185182646-c1cf1b55-ebf5-4a9a-97ef-c7e611bedb79.png)

```groovy
import org.gradle.api.initialization.resolve.RepositoriesMode
dependencyResolutionManagement {
repositories {
google()
// notice here -------------------------
repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
mavenCentral()
maven { url 'https://jitpack.io' }
jcenter() // Warning: this repository is going to shut down soon
// notice here -------------------------
}
}
rootProject.name = "My Application"
include ':app'
```

**build.gradle**
![image](https://user-images.githubusercontent.com/22430922/185183139-ef1dadd1-50f0-41e0-b173-d91dc904ec16.png)

```groovy
allprojects {
repositories {
google()
mavenCentral()
maven { url "https://jitpack.io" }
}
}
```
**------------------IF gradle greater than 7------------------------**
<br/>
**Add Manifest**

```xml

<uses-permission android:name="android.permission.INTERNET" />
```


<h4>For showing port enabled Ip</h4>
***Using In Kotlin***

```kotlin
fun ShowIp() {
val timeout_port = 1500
val timeout_ip = 1500
var type = 2;
var ip = "";
var port = "3389";//empty means automatically select port 1433
val newFragment: NoticeDialogFragment =
NoticeDialogFragment(
timeout_ip,
timeout_port,
type,
ip,
port,
object : NoticeDialogFragment.NoticeDialogListener {
override fun onDialogPositiveClick(dialog: DialogFragment?, ip: String) {
// textviewStatus.text = ip;
dialog?.dismiss()

}

override fun onDialogNegativeClick(dialog: DialogFragment?) {
dialog?.dismiss()

}

override fun onIpClicked(ip: String, dialog: DialogFragment?) {
// textviewStatus.text = ip;
dialog?.dismiss()
}

})
newFragment.isCancelable = false
val fr = supportFragmentManager
newFragment.show(fr, "missiles")


}
```

![](.README.MD_images/port.png)

<h4>showing devices</h4>

```kotlin
fun showPort() {
val timeout_port = 1500
val timeout_ip = 1500
var type = 1;
var ip = ""; //empty means automatically select wifi or hotspost ip
var port = "3389"; //empty means automatically select port 1433
val newFragment: NoticeDialogFragment =
NoticeDialogFragment(
timeout_ip,
timeout_port,
type,
ip,
port,
object : NoticeDialogFragment.NoticeDialogListener {
override fun onDialogPositiveClick(dialog: DialogFragment?, ip: String) {
// textviewStatus.text = ip;
dialog?.dismiss()

}

override fun onDialogNegativeClick(dialog: DialogFragment?) {
dialog?.dismiss()

}

override fun onIpClicked(ip: String, dialog: DialogFragment?) {
// textviewStatus.text = ip;
dialog?.dismiss()
}

})
newFragment.isCancelable = false
val fr = supportFragmentManager
newFragment.show(fr, "missiles")


}
```
**Using Java**
```java
private void showDevice(int i) {
int timeout_port = 3000;
int timeout_ip = 3000;
//type 1 -for show all device
// 2 -for show port available device
int type = i;
String ip = "";
String port = "1433";//empty means automatically select port 1433
NoticeDialogFragment newFragment =
new NoticeDialogFragment(
timeout_ip,
timeout_port,
type,
ip,
port,
new NoticeDialogFragment.NoticeDialogListener() {
@Override
public void onIpClicked(@NonNull String s, @Nullable DialogFragment dialogFragment) {
IP.setText(s);
assert dialogFragment != null;
dialogFragment.dismiss();
}

@Override
public void onDialogPositiveClick(@Nullable DialogFragment dialogFragment, @NonNull String s) {
IP.setText(s);
assert dialogFragment != null;
dialogFragment.dismiss();
}

@Override
public void onDialogNegativeClick(@Nullable DialogFragment dialogFragment) {

assert dialogFragment != null;
dialogFragment.dismiss();
}
}
);
newFragment.setCancelable(false);
FragmentManager fr = getSupportFragmentManager();
newFragment.show(fr, "missiles");


}
```


![](.README.MD_images/1677a230.png)
1 change: 1 addition & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
69 changes: 69 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'maven-publish'
}



android {
compileSdk 33

defaultConfig {
applicationId "com.lava.portscan_android"
minSdk 19
targetSdk 33
versionCode 1
versionName "1.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
buildFeatures {
viewBinding true
}
namespace 'com.lava.portscan_android'
}

dependencies {

implementation 'androidx.core:core-ktx:1.9.0'
implementation 'androidx.appcompat:appcompat:1.5.1'
implementation 'com.google.android.material:material:1.7.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation project(path: ':portscan')
implementation 'androidx.navigation:navigation-fragment-ktx:2.5.3'
implementation 'androidx.navigation:navigation-ui-ktx:2.5.3'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
task androidSourcesJar(type: Jar) {
classifier 'sources'
from android.sourceSets.main.java.srcDirs
}
project.afterEvaluate {
publishing {
publications {
// release(MavenPublication) {
// from components.productionRelease
// groupId = 'com.lava.portscan_android'
// artifactId = 'id'
// version = Config.libraryVersion
// }
}
}
}
21 changes: 21 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
Loading

0 comments on commit 9e61400

Please sign in to comment.