Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
BYLAppRobot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liuyang
BYLAppRobot
Commits
05ae7ce0
Commit
05ae7ce0
authored
Nov 18, 2018
by
liuyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
APK抓包>从频道1开始依次抓取, 一些epg显示时间过长的应用,模拟返回键点击
#BYLSERVER-1693
parent
179ae5e6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
11 deletions
+12
-11
ApkInfo.kt
app/src/main/java/com/duolebo/blyrobot/data/ApkInfo.kt
+8
-9
Task.kt
app/src/main/java/com/duolebo/blyrobot/data/Task.kt
+4
-2
No files found.
app/src/main/java/com/duolebo/blyrobot/data/ApkInfo.kt
View file @
05ae7ce0
...
@@ -43,19 +43,18 @@ class ApkInfo: IModel {
...
@@ -43,19 +43,18 @@ class ApkInfo: IModel {
this
.
captureDelay
=
json
.
optInt
(
CAPTURE_DELAY
,
15
)
this
.
captureDelay
=
json
.
optInt
(
CAPTURE_DELAY
,
15
)
this
.
launchKeyEvent
=
json
.
optString
(
LAUNCH_KEY_EVENT
,
""
)
this
.
launchKeyEvent
=
json
.
optString
(
LAUNCH_KEY_EVENT
,
""
)
this
.
channelCount
=
json
.
optInt
(
CHANNEL_COUNT
,
5
)
this
.
channelCount
=
json
.
optInt
(
CHANNEL_COUNT
,
5
)
this
.
channelKeyEvent
=
json
.
optString
(
CHANNEL_KEY_EVENT
,
"down"
)
this
.
mediaExt
=
json
.
optString
(
MEDIA_EXT
,
VIDEO_EXTS
)
this
.
filterUrl
=
json
.
optString
(
FILTER_URL
,
""
)
this
.
monitoring
=
json
.
optBoolean
(
MONITORING
,
true
)
var
channelKeyEvent
=
json
.
optString
(
CHANNEL
_KEY_EVENT
)
var
menuKeyEvent
=
json
.
optString
(
MENU
_KEY_EVENT
)
// 如果包含百分号则epg需要按返回键
// 如果包含百分号则epg需要按返回键
if
(!
channelKeyEvent
.
isNullOrEmpty
()
&&
channel
KeyEvent
.
contains
(
'%'
))
{
if
(!
menuKeyEvent
.
isNullOrEmpty
()
&&
menu
KeyEvent
.
contains
(
'%'
))
{
this
.
epgBack
=
true
this
.
epgBack
=
true
channelKeyEvent
=
channel
KeyEvent
.
replace
(
"%"
,
""
)
menuKeyEvent
=
menu
KeyEvent
.
replace
(
"%"
,
""
)
}
}
this
.
channelKeyEvent
=
channelKeyEvent
this
.
menuKeyEvent
=
menuKeyEvent
this
.
mediaExt
=
json
.
optString
(
MEDIA_EXT
,
VIDEO_EXTS
)
this
.
filterUrl
=
json
.
optString
(
FILTER_URL
,
""
)
this
.
menuKeyEvent
=
json
.
optString
(
MENU_KEY_EVENT
,
"ok"
)
this
.
monitoring
=
json
.
optBoolean
(
MONITORING
,
true
)
return
true
return
true
}
}
...
...
app/src/main/java/com/duolebo/blyrobot/data/Task.kt
View file @
05ae7ce0
...
@@ -195,12 +195,14 @@ class Task : Thread, IAppBaseCallback {
...
@@ -195,12 +195,14 @@ class Task : Thread, IAppBaseCallback {
AdbUtil
.
launchApp
(
"${this.apkInfo.packageName}/${this.apkInfo.launcher}"
)
AdbUtil
.
launchApp
(
"${this.apkInfo.packageName}/${this.apkInfo.launcher}"
)
// 启动立即抓取,避免第一个频道没有抓到
// 启动立即抓取,避免第一个频道没有抓到
capture
(
this
.
apkInfo
.
captureDelay
,
false
)
capture
(
this
.
apkInfo
.
captureDelay
,
false
)
Thread
.
sleep
(
this
.
apkInfo
.
launchDelay
*
1000L
)
sleepBySeconds
(
this
.
apkInfo
.
launchDelay
)
// 启动后按键事件模拟
// 启动后按键事件模拟
if
(!
this
.
apkInfo
.
launchKeyEvent
.
isNullOrEmpty
())
{
if
(!
this
.
apkInfo
.
launchKeyEvent
.
isNullOrEmpty
())
{
AdbUtil
.
sendMultiKey
(
this
.
apkInfo
.
launchKeyEvent
!!
)
AdbUtil
.
sendMultiKey
(
this
.
apkInfo
.
launchKeyEvent
!!
)
}
}
sleepBySeconds
(
this
.
apkInfo
.
captureDelay
)
}
}
/**
/**
...
@@ -209,8 +211,8 @@ class Task : Thread, IAppBaseCallback {
...
@@ -209,8 +211,8 @@ class Task : Thread, IAppBaseCallback {
*/
*/
private
fun
processChannels
(
index
:
Int
):
Boolean
{
private
fun
processChannels
(
index
:
Int
):
Boolean
{
Log
.
i
(
TAG
,
"processChannels"
)
Log
.
i
(
TAG
,
"processChannels"
)
processChannelItem
()
quitCapture
()
quitCapture
()
processChannelItem
()
for
(
i
in
index
+
1
until
this
.
apkInfo
.
channelCount
)
{
for
(
i
in
index
+
1
until
this
.
apkInfo
.
channelCount
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment