Skip to content

Commit b6583d3

Browse files
adding project
1 parent b9cb527 commit b6583d3

19 files changed

+697
-0
lines changed

AndroidManifest.xml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="org.umit.android.psniffer"
4+
android:versionCode="1"
5+
android:versionName="1.0">
6+
<uses-sdk android:minSdkVersion="8" />
7+
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
8+
<uses-permission android:name="android.permission.INTERNET" />
9+
10+
11+
<application android:debuggable="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name">
12+
<activity android:name=".tcpdump"
13+
android:label="@string/app_name">
14+
<intent-filter>
15+
<action android:name="android.intent.action.MAIN" />
16+
<category android:name="android.intent.category.LAUNCHER" />
17+
</intent-filter>
18+
</activity>
19+
20+
21+
<activity android:name=".resultView"
22+
android:label="@string/app_name">
23+
<intent-filter>
24+
<action android:name="android.intent.action.MAIN" />
25+
<category android:name="android.intent.category.LAUNCHER" />
26+
</intent-filter>
27+
</activity>
28+
</application>
29+
</manifest>

lint.xml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<lint>
3+
</lint>

proguard.cfg

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
-optimizationpasses 5
2+
-dontusemixedcaseclassnames
3+
-dontskipnonpubliclibraryclasses
4+
-dontpreverify
5+
-verbose
6+
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
7+
8+
-keep public class * extends android.app.Activity
9+
-keep public class * extends android.app.Application
10+
-keep public class * extends android.app.Service
11+
-keep public class * extends android.content.BroadcastReceiver
12+
-keep public class * extends android.content.ContentProvider
13+
-keep public class * extends android.app.backup.BackupAgentHelper
14+
-keep public class * extends android.preference.Preference
15+
-keep public class com.android.vending.licensing.ILicensingService
16+
17+
-keepclasseswithmembernames class * {
18+
native <methods>;
19+
}
20+
21+
-keepclasseswithmembers class * {
22+
public <init>(android.content.Context, android.util.AttributeSet);
23+
}
24+
25+
-keepclasseswithmembers class * {
26+
public <init>(android.content.Context, android.util.AttributeSet, int);
27+
}
28+
29+
-keepclassmembers class * extends android.app.Activity {
30+
public void *(android.view.View);
31+
}
32+
33+
-keepclassmembers enum * {
34+
public static **[] values();
35+
public static ** valueOf(java.lang.String);
36+
}
37+
38+
-keep class * implements android.os.Parcelable {
39+
public static final android.os.Parcelable$Creator *;
40+
}

project.properties

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# This file is automatically generated by Android Tools.
2+
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3+
#
4+
# This file must be checked in Version Control Systems.
5+
#
6+
# To customize properties used by the Ant build system use,
7+
# "ant.properties", and override values to adapt the script to your
8+
# project structure.
9+
10+
# Project target.
11+
target=android-15

res/drawable-hdpi/call.jpg

15.4 KB
Loading

res/drawable-hdpi/ic_launcher.png

4.05 KB
Loading

res/drawable-hdpi/wi2.jpg

41.3 KB
Loading

res/drawable-hdpi/wire.jpg

33.7 KB
Loading

res/drawable-ldpi/ic_launcher.png

1.68 KB
Loading

res/drawable-mdpi/ic_launcher.png

2.51 KB
Loading

res/layout/main.xml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
3+
4+
5+
6+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
7+
android:orientation="vertical"
8+
android:layout_width="fill_parent"
9+
android:layout_height="fill_parent"
10+
android:background="@drawable/wire"
11+
>
12+
<TextView android:id="@+id/textView1" android:layout_height="wrap_content" android:layout_width="fill_parent" android:text="@string/hello"></TextView>
13+
14+
<Button
15+
android:id="@+id/start"
16+
android:layout_width="475px"
17+
android:layout_height="40dp"
18+
android:layout_marginTop="250dp"
19+
android:text="Start Capturing"
20+
android:textColor="#00000000" />
21+
22+
<Button
23+
android:id="@+id/stop"
24+
android:layout_width="475px"
25+
android:layout_height="40dp"
26+
android:layout_marginTop="30dp"
27+
android:text="Stop Capturing"
28+
android:textColor="#00000000" />
29+
30+
<Button
31+
android:id="@+id/view"
32+
android:layout_width="475px"
33+
android:layout_height="40dp"
34+
android:layout_marginTop="30dp"
35+
android:text="View Captured"
36+
android:textColor="#00000000" />
37+
38+
39+
40+
</LinearLayout>
41+

res/layout/result.xml

+101
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
3+
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
4+
android:layout_width="fill_parent"
5+
android:layout_height="fill_parent" >
6+
7+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
8+
android:orientation="vertical"
9+
android:layout_width="fill_parent"
10+
android:layout_height="fill_parent"
11+
android:background="@drawable/call"
12+
>
13+
14+
<TextView
15+
android:id="@+id/title4"
16+
android:layout_width="wrap_content"
17+
android:layout_height="wrap_content"
18+
android:layout_marginTop="20dp"
19+
android:text="" />
20+
21+
22+
<LinearLayout android:id="@+id/pie_container"
23+
android:layout_width="fill_parent" android:layout_height="wrap_content"
24+
android:layout_marginLeft="50dp"
25+
android:layout_marginTop="20dp"
26+
android:orientation="vertical">
27+
</LinearLayout>
28+
29+
<TextView
30+
android:id="@+id/title3"
31+
android:layout_width="wrap_content"
32+
android:layout_height="wrap_content"
33+
android:layout_marginTop="20dp"
34+
android:text="" />
35+
36+
<LinearLayout
37+
android:id="@+id/pie_container2"
38+
android:layout_width="wrap_content"
39+
android:layout_height="wrap_content"
40+
android:layout_marginTop="20dp"
41+
android:layout_marginLeft="50dp"
42+
android:orientation="vertical" >
43+
</LinearLayout>
44+
45+
46+
47+
<TextView
48+
android:id="@+id/title"
49+
android:layout_width="wrap_content"
50+
android:layout_height="wrap_content"
51+
android:layout_marginTop="20dp"
52+
android:text="" />
53+
54+
<TextView
55+
android:id="@+id/capture1"
56+
android:layout_width="wrap_content"
57+
android:layout_height="wrap_content"
58+
android:layout_marginTop="10dp"
59+
android:text="" />
60+
61+
62+
63+
64+
<TextView
65+
android:id="@+id/capture2"
66+
android:layout_width="wrap_content"
67+
android:layout_height="wrap_content"
68+
android:layout_marginTop="20dp"
69+
android:text="" />
70+
71+
<TextView
72+
android:id="@+id/title2"
73+
android:layout_width="wrap_content"
74+
android:layout_height="wrap_content"
75+
android:layout_marginTop="20dp"
76+
android:text="" />
77+
78+
79+
<TextView
80+
android:id="@+id/capture3"
81+
android:layout_width="wrap_content"
82+
android:layout_height="wrap_content"
83+
android:layout_marginTop="20dp"
84+
android:text="" />
85+
<TextView
86+
android:id="@+id/capture4"
87+
android:layout_width="wrap_content"
88+
android:layout_height="wrap_content"
89+
android:layout_marginTop="20dp"
90+
android:text="" />
91+
92+
93+
<TextView
94+
android:id="@+id/textView3"
95+
android:layout_width="fill_parent"
96+
android:layout_height="fill_parent"
97+
android:layout_marginTop="20dp"
98+
android:text="" />
99+
</LinearLayout>
100+
</ScrollView>
101+

res/values/strings.xml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
4+
<string name="hello">Wireless Monitoring Device</string>
5+
<string name="app_name">Network packet Filter</string>
6+
7+
</resources>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package org.umit.android.psniffer;
2+
3+
import android.net.TrafficStats;
4+
5+
public class KillProcessThread implements Runnable {
6+
7+
Process p;
8+
@Override
9+
public void run() {
10+
try{
11+
p.destroy();
12+
}catch (Exception e) {
13+
// TODO: handle exception
14+
e.printStackTrace();
15+
16+
}
17+
18+
}
19+
20+
public KillProcessThread(Process p)
21+
{
22+
this.p = p;
23+
}
24+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package org.umit.android.psniffer;
2+
3+
public class PieDetailsItem {
4+
5+
public int count, color;
6+
public float percent;
7+
public String label;
8+
9+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package org.umit.android.psniffer;
2+
3+
import java.io.BufferedReader;
4+
import java.io.IOException;
5+
import java.net.Socket;
6+
7+
import android.net.TrafficStats;
8+
import android.util.Log;
9+
import android.widget.TextView;
10+
11+
public class PrintingThread {
12+
TextView tv;
13+
BufferedReader reader;
14+
public static long TotalTxBytes,TotalRxBytes,TotalRxPackets,TotalTxPackets;
15+
16+
17+
18+
public PrintingThread(BufferedReader reader)
19+
{
20+
this.reader = reader;
21+
}
22+
23+
public void capture(){
24+
TotalRxBytes=TrafficStats.getTotalRxBytes();
25+
TotalTxBytes=TrafficStats.getTotalTxBytes();
26+
TotalRxPackets=TrafficStats.getTotalRxPackets();
27+
TotalTxPackets=TrafficStats.getTotalTxPackets();
28+
29+
30+
}
31+
32+
}

0 commit comments

Comments
 (0)