Commit 05ae7ce0 authored by liuyang's avatar liuyang

APK抓包>从频道1开始依次抓取, 一些epg显示时间过长的应用,模拟返回键点击

#BYLSERVER-1693
parent 179ae5e6
......@@ -43,19 +43,18 @@ class ApkInfo: IModel {
this.captureDelay = json.optInt(CAPTURE_DELAY, 15)
this.launchKeyEvent = json.optString(LAUNCH_KEY_EVENT, "")
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需要按返回键
if (!channelKeyEvent.isNullOrEmpty() && channelKeyEvent.contains('%')) {
if (!menuKeyEvent.isNullOrEmpty() && menuKeyEvent.contains('%')) {
this.epgBack = true
channelKeyEvent = channelKeyEvent.replace("%", "")
menuKeyEvent = menuKeyEvent.replace("%", "")
}
this.channelKeyEvent = channelKeyEvent
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)
this.menuKeyEvent = menuKeyEvent
return true
}
......
......@@ -195,12 +195,14 @@ class Task : Thread, IAppBaseCallback {
AdbUtil.launchApp("${this.apkInfo.packageName}/${this.apkInfo.launcher}")
// 启动立即抓取,避免第一个频道没有抓到
capture(this.apkInfo.captureDelay, false)
Thread.sleep(this.apkInfo.launchDelay * 1000L)
sleepBySeconds(this.apkInfo.launchDelay)
// 启动后按键事件模拟
if (!this.apkInfo.launchKeyEvent.isNullOrEmpty()) {
AdbUtil.sendMultiKey(this.apkInfo.launchKeyEvent!!)
}
sleepBySeconds(this.apkInfo.captureDelay)
}
/**
......@@ -209,8 +211,8 @@ class Task : Thread, IAppBaseCallback {
*/
private fun processChannels(index: Int): Boolean {
Log.i(TAG, "processChannels")
processChannelItem()
quitCapture()
processChannelItem()
for (i in index + 1 until this.apkInfo.channelCount) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment