Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2020-1-capstone-design2
/
2016104137
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
유희정
2020-04-21 18:00:21 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
ecf3798c63171b9922df35f8e0fd61c8de4cd63e
ecf3798c
1 parent
ce920f41
network_db
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
6 deletions
source/DataExtraction/app/src/main/java/com/example/dataextraction/MainActivity.java
source/DataExtraction/app/src/main/java/com/example/dataextraction/MobileNetworkDataBase.java
source/DataExtraction/app/src/main/java/com/example/dataextraction/networkDBHelper.java
source/DataExtraction/app/src/main/java/com/example/dataextraction/MainActivity.java
View file @
ecf3798
...
...
@@ -358,7 +358,7 @@ public class MainActivity extends AppCompatActivity {
String
domain
=
linkProperties
.
getDomains
();
String
interfacrName
=
linkProperties
.
getInterfaceName
();
//String DnsServerName = linkProperties.getPrivateDnsServerName();
dbNHelper
.
insertColumn0
(
network
.
toString
(),
domain
,
interfacrName
,
null
);
dbNHelper
.
insertColumn0
(
network
.
toString
(),
domain
,
interfacrName
);
List
<
InetAddress
>
inetAddresses
=
linkProperties
.
getDnsServers
();
for
(
InetAddress
address
:
inetAddresses
){
dbNHelper
.
insertColumn1
(
network
.
toString
(),
address
.
getHostAddress
());
...
...
source/DataExtraction/app/src/main/java/com/example/dataextraction/MobileNetworkDataBase.java
View file @
ecf3798
...
...
@@ -7,7 +7,6 @@ public final class MobileNetworkDataBase {
public
static
final
String
NET_ID
=
"net_id"
;
public
static
final
String
DOMAIN
=
"domain"
;
public
static
final
String
INTERFACE_NAME
=
"interface_name"
;
public
static
final
String
DNS_SERVER_NAME
=
"dns_server_name"
;
public
static
final
String
HOST_ADDRESS
=
"host_address"
;
public
static
final
String
PREFIX_LENGTH
=
"prefix_length"
;
public
static
final
String
DESTINATION
=
"destination"
;
...
...
@@ -21,8 +20,7 @@ public final class MobileNetworkDataBase {
+
_TABLENAME0
+
" ( "
+
NET_ID
+
" text not null, "
+
DOMAIN
+
" text, "
+
INTERFACE_NAME
+
" text, "
+
DNS_SERVER_NAME
+
" text);"
;
+
INTERFACE_NAME
+
" text); "
;
public
static
final
String
_CREATE1
=
"create table if not exists "
+
_TABLENAME1
+
" ( "
+
NET_ID
+
" text not null, "
...
...
source/DataExtraction/app/src/main/java/com/example/dataextraction/networkDBHelper.java
View file @
ecf3798
...
...
@@ -51,12 +51,11 @@ public class networkDBHelper {
mDB
.
close
();
}
public
long
insertColumn0
(
String
id
,
String
domain
,
String
interface_name
,
String
dns_server_name
){
public
long
insertColumn0
(
String
id
,
String
domain
,
String
interface_name
){
ContentValues
values
=
new
ContentValues
();
values
.
put
(
MobileNetworkDataBase
.
CreateDB
.
NET_ID
,
id
);
values
.
put
(
MobileNetworkDataBase
.
CreateDB
.
DOMAIN
,
domain
);
values
.
put
(
MobileNetworkDataBase
.
CreateDB
.
INTERFACE_NAME
,
interface_name
);
values
.
put
(
MobileNetworkDataBase
.
CreateDB
.
DNS_SERVER_NAME
,
dns_server_name
);
return
mDB
.
insert
(
MobileNetworkDataBase
.
CreateDB
.
_TABLENAME0
,
null
,
values
);
}
...
...
Please
register
or
login
to post a comment