Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2020-2-capstone-design1
/
JJS_project1
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-11-08 15:40:41 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
045de767b397be818dae4c6b240b00b3325a429c
045de767
1 parent
d2fe6dfc
data 전송 기능 추가
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
7 deletions
source/batch/adb_shell.bat
source/batch/data.js
source/batch/data_sender.py
source/batch/adb_shell.bat
View file @
045de76
@echo
cd C:\Users\%USERNAME%\Desktop\batch_file
adb devices > C:\Users\%USERNAME%\Desktop\batch_file\device.
csv
adb shell dumpsys alarm > C:\Users\%USERNAME%\Desktop\batch_file\alarm.
csv
adb shell ps -A > C:\Users\%USERNAME%\Desktop\batch_file\process.
csv
adb shell uptime > C:\Users\%USERNAME%\Desktop\batch_file\uptime.
csv
adb shell getprop ro.product.model > C:\Users\%USERNAME%\Desktop\batch_file\model.
csv
adb shell getprop ro.build.version.release > C:\Users\%USERNAME%\Desktop\batch_file\sdk_version.
csv
adb shell getprop ro.build.version.sdk > C:\Users\%USERNAME%\Desktop\batch_file\android_version.
csv
adb devices > C:\Users\%USERNAME%\Desktop\batch_file\device.
txt
adb shell dumpsys alarm > C:\Users\%USERNAME%\Desktop\batch_file\alarm.
txt
adb shell ps -A > C:\Users\%USERNAME%\Desktop\batch_file\process.
txt
adb shell uptime > C:\Users\%USERNAME%\Desktop\batch_file\uptime.
txt
adb shell getprop ro.product.model > C:\Users\%USERNAME%\Desktop\batch_file\model.
txt
adb shell getprop ro.build.version.release > C:\Users\%USERNAME%\Desktop\batch_file\sdk_version.
txt
adb shell getprop ro.build.version.sdk > C:\Users\%USERNAME%\Desktop\batch_file\android_version.
txt
adb install -r app-release.apk
start cmd.exe /k "node data.js"
adb shell am start -n com.example.dataextraction/com.example.dataextraction.LoadingActivity
...
...
source/batch/data.js
View file @
045de76
...
...
@@ -18,6 +18,15 @@ function extractDB () {
console
.
log
(
"move innerDB"
);
cmd_moveNdb
=
fs
.
rename
(
'apps/com.example.dataextraction/db/networkDatabase.db'
,
'networkDatabase.db'
,
function
(){
console
.
log
(
"move network db"
);
python_execute
=
exec
(
'python data_sender.py'
,
function
(
error
,
stdout
,
stderr
)
{
console
.
log
(
"python code execute"
)
console
.
log
(
'stdout: '
+
stdout
);
console
.
log
(
'stderr: '
+
stderr
);
if
(
error
!==
null
)
{
console
.
log
(
'exec error: '
+
error
);
}
});
})
})
})
...
...
source/batch/data_sender.py
0 → 100644
View file @
045de76
import
os.path
import
requests
def
data_check
(
data_path
):
while
(
True
):
if
(
os
.
path
.
isfile
(
data_path
)):
print
(
"file"
)
break
else
:
print
(
"x"
)
continue
data_transfer
(
data_path
)
def
data_transfer
(
data_path
):
with
open
(
data_path
,
'rb'
)
as
files
:
header
=
{
'Authorization'
:
'Bearer '
,}
upload
=
{
'file'
:
files
}
response
=
requests
.
post
(
'http://13.209.3.132/extractions'
,
files
=
upload
,
headers
=
header
)
print
(
response
.
text
)
def
main
():
path
=
os
.
path
.
expanduser
(
'~'
)
+
"
\\
Desktop
\\
batch_file
\\
"
data_tup
=
[
path
+
"android_version.txt"
,
path
+
"alarm.txt"
,
path
+
"device.txt"
,
path
+
"model.txt"
,
path
+
"process.txt"
,
path
+
"sdk_version.txt"
,
path
+
"uptime.txt"
,
path
+
"InnerDatabase_test.db"
,
path
+
"networkDatabase_test.db"
]
for
i
in
data_tup
:
print
(
i
)
data_check
(
i
)
main
()
Please
register
or
login
to post a comment