Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2021-1-capstone-design2
/
2017103957
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
김가영
2021-04-11 21:31:37 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
637c2653a3c3d8f655091f8cb73c76d79fb2d720
637c2653
1 parent
cef5ee06
add function adb command to txt file
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
117 additions
and
52 deletions
source/app/app/.idea/workspace.xml
source/app/app/src/main/AndroidManifest.xml
source/app/app/src/main/java/com/example/dataextraction/LoadingActivity.java
source/app/app/src/main/java/com/example/dataextraction/MainActivity.java
source/app/app/.idea/workspace.xml
View file @
637c265
...
...
@@ -25,7 +25,7 @@
<component
name=
"DefaultGradleProjectSettings"
>
<option
name=
"isMigrated"
value=
"true"
/>
</component>
<component
name=
"ExecutionTargetManager"
SELECTED_TARGET=
"
Pixel_2_API_28
"
/>
<component
name=
"ExecutionTargetManager"
SELECTED_TARGET=
"
ce12160cc327c64005
"
/>
<component
name=
"ExternalProjectsManager"
>
<system
id=
"GRADLE"
>
<state>
...
...
@@ -37,7 +37,12 @@
</task>
<projects_view>
<tree_state>
<expand
/>
<expand>
<path>
<item
name=
""
type=
"6a2764b6:ExternalProjectsStructure$RootNode"
/>
<item
name=
"DataExtraction"
type=
"f1a62948:ProjectNode"
/>
</path>
</expand>
<select
/>
</tree_state>
</projects_view>
...
...
@@ -59,8 +64,8 @@
<entry
file=
"file://$PROJECT_DIR$/src/main/AndroidManifest.xml"
>
<provider
editor-type-id=
"android-manifest"
/>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
207
"
>
<caret
line=
"
38"
column=
"71"
selection-start-line=
"38"
selection-start-column=
"71"
selection-end-line=
"38"
selection-end-column=
"71
"
/>
<state
relative-caret-position=
"
-76
"
>
<caret
line=
"
11"
column=
"80"
selection-start-line=
"11"
selection-start-column=
"80"
selection-end-line=
"11"
selection-end-column=
"80
"
/>
</state>
</provider>
</entry>
...
...
@@ -83,11 +88,11 @@
</provider>
</entry>
</file>
<file
pinned=
"false"
current-in-tab=
"
tru
e"
>
<file
pinned=
"false"
current-in-tab=
"
fals
e"
>
<entry
file=
"file://$PROJECT_DIR$/src/main/java/com/example/dataextraction/MainActivity.java"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"3
42
"
>
<caret
line=
"2
0"
column=
"110"
selection-start-line=
"20"
selection-start-column=
"110"
selection-end-line=
"20"
selection-end-column=
"110
"
/>
<state
relative-caret-position=
"3
66
"
>
<caret
line=
"2
3"
lean-forward=
"true"
selection-start-line=
"23"
selection-end-line=
"23
"
/>
<folding>
<element
signature=
"imports"
expanded=
"true"
/>
</folding>
...
...
@@ -95,11 +100,15 @@
</provider>
</entry>
</file>
<file
pinned=
"false"
current-in-tab=
"
fals
e"
>
<file
pinned=
"false"
current-in-tab=
"
tru
e"
>
<entry
file=
"file://$PROJECT_DIR$/src/main/java/com/example/dataextraction/LoadingActivity.java"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"14193"
>
<caret
line=
"813"
column=
"26"
selection-start-line=
"813"
selection-start-column=
"21"
selection-end-line=
"813"
selection-end-column=
"26"
/>
<state
relative-caret-position=
"209"
>
<caret
line=
"184"
column=
"53"
lean-forward=
"true"
selection-start-line=
"184"
selection-start-column=
"53"
selection-end-line=
"184"
selection-end-column=
"53"
/>
<folding>
<element
signature=
"e#5574#8719#0"
expanded=
"true"
/>
<element
signature=
"e#8718#8719#0"
expanded=
"true"
/>
</folding>
</state>
</provider>
</entry>
...
...
@@ -143,8 +152,8 @@
<list>
<option
value=
"$PROJECT_DIR$/src/main/res/xml/network_security_config.xml"
/>
<option
value=
"$PROJECT_DIR$/src/main/res/layout/activity_main.xml"
/>
<option
value=
"$PROJECT_DIR$/src/main/AndroidManifest.xml"
/>
<option
value=
"$PROJECT_DIR$/build.gradle"
/>
<option
value=
"$PROJECT_DIR$/src/main/AndroidManifest.xml"
/>
<option
value=
"$PROJECT_DIR$/src/main/java/com/example/dataextraction/LoadingActivity.java"
/>
<option
value=
"$PROJECT_DIR$/src/main/java/com/example/dataextraction/MainActivity.java"
/>
</list>
...
...
@@ -222,9 +231,9 @@
</option>
</component>
<component
name=
"ProjectFrameBounds"
extendedState=
"6"
>
<option
name=
"x"
value=
"
952
"
/>
<option
name=
"width"
value=
"
977
"
/>
<option
name=
"height"
value=
"10
3
8"
/>
<option
name=
"x"
value=
"
770
"
/>
<option
name=
"width"
value=
"
1159
"
/>
<option
name=
"height"
value=
"10
4
8"
/>
</component>
<component
name=
"ProjectLevelVcsManager"
settingsEditedManually=
"true"
/>
<component
name=
"ProjectView"
>
...
...
@@ -232,20 +241,24 @@
<foldersAlwaysOnTop
value=
"true"
/>
</navigator>
<panes>
<pane
id=
"Scope"
/>
<pane
id=
"PackagesPane"
/>
<pane
id=
"ProjectPane"
/>
<pane
id=
"AndroidView"
>
<subPane>
<expand>
<path>
<item
name=
"DataExtraction"
type=
"1abcf292:AndroidViewProjectNode"
/>
<item
name=
"app"
type=
"feadf853:AndroidModuleNode"
/>
</path>
<path>
<item
name=
"DataExtraction"
type=
"1abcf292:AndroidViewProjectNode"
/>
<item
name=
"Gradle Scripts"
type=
"ae0cef3a:AndroidBuildScriptsGroupNode"
/>
</path>
</expand>
<select
/>
</subPane>
</pane>
<pane
id=
"PackagesPane"
/>
<pane
id=
"Scope"
/>
<pane
id=
"ProjectPane"
/>
</panes>
</component>
<component
name=
"PropertiesComponent"
>
...
...
@@ -356,7 +369,7 @@
<frame
x=
"-7"
y=
"-7"
width=
"1550"
height=
"838"
extended-state=
"6"
/>
<layout>
<window_info
id=
"Captures"
order=
"0"
side_tool=
"true"
weight=
"0.25"
/>
<window_info
content_ui=
"combo"
id=
"Project"
order=
"1"
visible=
"true"
weight=
"0.
13892618
"
/>
<window_info
content_ui=
"combo"
id=
"Project"
order=
"1"
visible=
"true"
weight=
"0.
020134227
"
/>
<window_info
id=
"Structure"
order=
"2"
side_tool=
"true"
/>
<window_info
id=
"Favorites"
order=
"3"
side_tool=
"true"
/>
<window_info
id=
"Build Variants"
order=
"4"
side_tool=
"true"
/>
...
...
@@ -365,7 +378,7 @@
<window_info
id=
"Resources Explorer"
order=
"7"
/>
<window_info
id=
"Capture Tool"
order=
"8"
/>
<window_info
anchor=
"bottom"
id=
"Run"
order=
"0"
sideWeight=
"0.49932885"
weight=
"0.32907802"
/>
<window_info
anchor=
"bottom"
id=
"Logcat"
order=
"1"
sideWeight=
"0.49798658"
visible=
"true"
weight=
"0.3219858
"
/>
<window_info
anchor=
"bottom"
id=
"Logcat"
order=
"1"
sideWeight=
"0.49798658"
weight=
"0.32056737
"
/>
<window_info
anchor=
"bottom"
id=
"TODO"
order=
"2"
sideWeight=
"0.49932885"
weight=
"0.32907802"
/>
<window_info
anchor=
"bottom"
id=
"Debug"
order=
"3"
/>
<window_info
anchor=
"bottom"
id=
"Terminal"
order=
"4"
sideWeight=
"0.49932885"
weight=
"0.32907802"
/>
...
...
@@ -374,9 +387,9 @@
<window_info
anchor=
"bottom"
id=
"Build"
order=
"7"
sideWeight=
"0.49932885"
weight=
"0.32907802"
/>
<window_info
anchor=
"bottom"
id=
"Android Profiler"
order=
"8"
/>
<window_info
anchor=
"bottom"
id=
"Find"
order=
"9"
/>
<window_info
anchor=
"right"
id=
"Device File Explorer"
order=
"0"
side
_tool=
"true"
weight=
"0.74630874
"
/>
<window_info
anchor=
"right"
id=
"Device File Explorer"
order=
"0"
side
Weight=
"0.6680761"
side_tool=
"true"
weight=
"0.3295302
"
/>
<window_info
anchor=
"right"
id=
"Capture Analysis"
order=
"1"
/>
<window_info
anchor=
"right"
id=
"Gradle"
order=
"2"
weight=
"0.3295302"
/>
<window_info
anchor=
"right"
id=
"Gradle"
order=
"2"
sideWeight=
"0.3319239"
weight=
"0.3295302"
/>
<window_info
anchor=
"right"
id=
"Theme Preview"
order=
"3"
/>
<window_info
anchor=
"right"
id=
"Preview"
order=
"4"
/>
<window_info
anchor=
"right"
id=
"Palette	"
order=
"5"
/>
...
...
@@ -476,6 +489,27 @@
<entry
file=
"file://$USER_HOME$/AppData/Local/Android/Sdk/sources/android-29/android/provider/Browser.java"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
/>
</entry>
<entry
file=
"file://$USER_HOME$/AppData/Local/Android/Sdk/sources/android-29/android/content/Context.java"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"223"
>
<caret
line=
"4748"
column=
"24"
selection-start-line=
"4748"
selection-start-column=
"24"
selection-end-line=
"4748"
selection-end-column=
"24"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$USER_HOME$/AppData/Local/Android/Sdk/sources/android-29/android/content/ContextWrapper.java"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"242"
>
<caret
line=
"777"
column=
"43"
selection-start-line=
"777"
selection-start-column=
"43"
selection-end-line=
"777"
selection-end-column=
"43"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/build.gradle"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"513"
>
<caret
line=
"27"
column=
"60"
selection-start-line=
"27"
selection-start-column=
"60"
selection-end-line=
"27"
selection-end-column=
"60"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/src/main/java/com/example/dataextraction/SMSDataBase.java"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"76"
>
...
...
@@ -505,45 +539,31 @@
<entry
file=
"file://$PROJECT_DIR$/src/main/AndroidManifest.xml"
>
<provider
editor-type-id=
"android-manifest"
/>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"207"
>
<caret
line=
"38"
column=
"71"
selection-start-line=
"38"
selection-start-column=
"71"
selection-end-line=
"38"
selection-end-column=
"71"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$USER_HOME$/AppData/Local/Android/Sdk/sources/android-29/android/content/Context.java"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"223"
>
<caret
line=
"4748"
column=
"24"
selection-start-line=
"4748"
selection-start-column=
"24"
selection-end-line=
"4748"
selection-end-column=
"24"
/>
<state
relative-caret-position=
"-76"
>
<caret
line=
"11"
column=
"80"
selection-start-line=
"11"
selection-start-column=
"80"
selection-end-line=
"11"
selection-end-column=
"80"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$USER_HOME$/AppData/Local/Android/Sdk/sources/android-29/android/content/ContextWrapper.java"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"242"
>
<caret
line=
"777"
column=
"43"
selection-start-line=
"777"
selection-start-column=
"43"
selection-end-line=
"777"
selection-end-column=
"43"
/>
</state>
</provider>
<entry
file=
"file://$USER_HOME$/Documents/AndroidStudio/DeviceExplorer/samsung-sm_g950n-ce12160cc327c64005/sdcard/TestLog/logfile.txt"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
/>
</entry>
<entry
file=
"file://$PROJECT_DIR$/
build.gradle
"
>
<entry
file=
"file://$PROJECT_DIR$/
src/main/java/com/example/dataextraction/MainActivity.java
"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"513"
>
<caret
line=
"27"
column=
"60"
selection-start-line=
"27"
selection-start-column=
"60"
selection-end-line=
"27"
selection-end-column=
"60"
/>
<state
relative-caret-position=
"366"
>
<caret
line=
"23"
lean-forward=
"true"
selection-start-line=
"23"
selection-end-line=
"23"
/>
<folding>
<element
signature=
"imports"
expanded=
"true"
/>
</folding>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/src/main/java/com/example/dataextraction/LoadingActivity.java"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"14193"
>
<caret
line=
"813"
column=
"26"
selection-start-line=
"813"
selection-start-column=
"21"
selection-end-line=
"813"
selection-end-column=
"26"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/src/main/java/com/example/dataextraction/MainActivity.java"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"342"
>
<caret
line=
"20"
column=
"110"
selection-start-line=
"20"
selection-start-column=
"110"
selection-end-line=
"20"
selection-end-column=
"110"
/>
<state
relative-caret-position=
"209"
>
<caret
line=
"184"
column=
"53"
lean-forward=
"true"
selection-start-line=
"184"
selection-start-column=
"53"
selection-end-line=
"184"
selection-end-column=
"53"
/>
<folding>
<element
signature=
"imports"
expanded=
"true"
/>
<element
signature=
"e#5574#8719#0"
expanded=
"true"
/>
<element
signature=
"e#8718#8719#0"
expanded=
"true"
/>
</folding>
</state>
</provider>
...
...
source/app/app/src/main/AndroidManifest.xml
View file @
637c265
...
...
@@ -20,7 +20,6 @@
<uses-permission
android:name=
"android.permission.READ_PHONE_NUMBERS"
/>
<uses-permission
android:name=
"android.permission.ACCESS_WIFI_STATE"
/>
<uses-permission
android:name=
"android.permission.READ_USER_DICTIONARY"
/>
<application
android:allowBackup=
"true"
android:icon=
"@mipmap/ic_launcher"
...
...
source/app/app/src/main/java/com/example/dataextraction/LoadingActivity.java
View file @
637c265
...
...
@@ -5,6 +5,7 @@ import android.Manifest;
import
android.accounts.Account
;
import
android.accounts.AccountManager
;
import
android.app.Activity
;
import
android.app.ActivityManager
;
import
android.app.AppOpsManager
;
import
android.app.usage.NetworkStats
;
import
android.app.usage.NetworkStatsManager
;
...
...
@@ -41,8 +42,12 @@ import android.util.Log;
import
android.widget.Toast
;
import
java.io.BufferedReader
;
import
java.io.BufferedWriter
;
import
java.io.File
;
import
java.io.FileOutputStream
;
import
java.io.IOException
;
import
java.io.InputStreamReader
;
import
java.io.OutputStreamWriter
;
import
java.net.InetAddress
;
import
java.text.DateFormat
;
import
java.text.SimpleDateFormat
;
...
...
@@ -149,6 +154,10 @@ public class LoadingActivity extends Activity {
return
false
;
}
public
void
makeTXT
(
String
content
){
}
private
void
startLoading
()
{
Handler
handler
=
new
Handler
();
handler
.
postDelayed
(
new
Runnable
()
{
...
...
@@ -156,6 +165,43 @@ public class LoadingActivity extends Activity {
public
void
run
()
{
dbHelper
=
new
DBHelper
(
getApplicationContext
());
dbHelper
.
open
();
try
{
StringBuffer
output
=
new
StringBuffer
();
Process
df
=
Runtime
.
getRuntime
().
exec
(
new
String
[]{
"df"
});
// file system get --> USB 꽂힌 것 알아낼 수 있을듯..?
Process
netstat
=
Runtime
.
getRuntime
().
exec
(
new
String
[]{
"netstat"
});
// network stat
Process
p
=
Runtime
.
getRuntime
().
exec
(
new
String
[]{
"uptime"
});
// uptime
p
.
waitFor
();
BufferedReader
reader
=
new
BufferedReader
(
new
InputStreamReader
(
p
.
getInputStream
()));
String
line
=
""
;
while
((
line
=
reader
.
readLine
())
!=
null
){
output
.
append
(
line
+
"\n"
);
}
String
response
=
output
.
toString
();
Log
.
i
(
"MYLOG"
,
response
);
String
foldername
=
"/sdcard"
+
"/TestLog"
;
Log
.
i
(
"MYLOG"
,
foldername
);
String
filename
=
"logfile.txt"
;
File
dir
=
new
File
(
foldername
);
//디렉토리 폴더가 없으면 생성함
if
(!
dir
.
exists
()){
dir
.
mkdir
();
}
//파일 output stream 생성
FileOutputStream
fos
=
new
FileOutputStream
(
foldername
+
"/"
+
filename
,
true
);
//파일쓰기
BufferedWriter
writer
=
new
BufferedWriter
(
new
OutputStreamWriter
(
fos
));
writer
.
write
(
response
);
writer
.
flush
();
writer
.
close
();
fos
.
close
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
}
getPhoto
();
//alert("alert","photo");
Log
.
i
(
"MYLOG"
,
"DB HY Part:1/14"
);
...
...
source/app/app/src/main/java/com/example/dataextraction/MainActivity.java
View file @
637c265
...
...
@@ -18,8 +18,8 @@ public class MainActivity extends AppCompatActivity {
super
.
onCreate
(
savedInstanceState
);
setContentView
(
R
.
layout
.
activity_main
);
copyFile
(
"/data/data/com.example.dataextraction/databases/"
,
"InnerDatabase.db"
,
"/s
torage/UsbDriveA
/InnerDatabase.db"
);
copyFile
(
"/data/data/com.example.dataextraction/databases/"
,
"networkDatabase.db"
,
"/s
torage/UsbDriveA
/networkDatabase.db"
);
copyFile
(
"/data/data/com.example.dataextraction/databases/"
,
"InnerDatabase.db"
,
"/s
dcard/TestLog
/InnerDatabase.db"
);
copyFile
(
"/data/data/com.example.dataextraction/databases/"
,
"networkDatabase.db"
,
"/s
dcard/TestLog
/networkDatabase.db"
);
}
private
void
copyFile
(
String
inputPath
,
String
inputFile
,
String
outputPath
)
{
...
...
Please
register
or
login
to post a comment