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
1b98a75e
You need to sign in or sign up before continuing.
Commit
1b98a75e
authored
Oct 07, 2018
by
liuyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
APK图片抓取识别及轮播流地址抓取,状态显示
#BYLSERVER-1438
parent
8b713673
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
91 additions
and
4 deletions
+91
-4
ApkInfo.kt
app/src/main/java/com/duolebo/blyrobot/data/ApkInfo.kt
+3
-0
Task.kt
app/src/main/java/com/duolebo/blyrobot/data/Task.kt
+5
-1
ApkReportProtocol.kt
...n/java/com/duolebo/blyrobot/protocol/ApkReportProtocol.kt
+11
-0
AppConfigListItem.kt
...rc/main/java/com/duolebo/blyrobot/ui/AppConfigListItem.kt
+20
-0
activity_main.xml
app/src/main/res/layout/activity_main.xml
+11
-3
app_config_item.xml
app/src/main/res/layout/app_config_item.xml
+41
-0
No files found.
app/src/main/java/com/duolebo/blyrobot/data/ApkInfo.kt
View file @
1b98a75e
...
...
@@ -6,6 +6,7 @@ import org.json.JSONArray
import
org.json.JSONObject
class
ApkInfo
:
IModel
{
lateinit
var
name
:
String
//包名
lateinit
var
packageName
:
String
//启动apk配置信息
...
...
@@ -28,6 +29,7 @@ class ApkInfo: IModel {
lateinit
var
menuKeyEvent
:
String
override
fun
from
(
json
:
JSONObject
):
Boolean
{
this
.
name
=
json
.
optString
(
NAME
)
this
.
packageName
=
json
.
optString
(
PACKAGE_NAME
)
this
.
launcher
=
json
.
optString
(
LAUNCHER
)
this
.
launchDelay
=
json
.
optInt
(
LAUNCH_DELAY
,
15
)
...
...
@@ -53,6 +55,7 @@ class ApkInfo: IModel {
const
val
VIDEO_EXTS
=
"m3u8|.ts|.mp4|.rmvb|.mkv|.wmv"
//data key
const
val
NAME
=
"name"
const
val
PACKAGE_NAME
=
"packageName"
const
val
LAUNCHER
=
"launcher"
const
val
LAUNCH_DELAY
=
"launchDelay"
...
...
app/src/main/java/com/duolebo/blyrobot/data/Task.kt
View file @
1b98a75e
...
...
@@ -64,9 +64,13 @@ class Task : IAppBaseCallback {
fun
start
()
{
this
.
reportJson
=
JSONObject
()
// 启动应用
this
.
launchApp
()
// 频道轮询处理
this
.
processChannels
()
// 上传图片
this
.
uploadImage
()
// 上报服务器
this
.
report
()
}
...
...
@@ -278,7 +282,7 @@ class Task : IAppBaseCallback {
}
private
fun
report
()
{
reportProtocol
.
execute
(
dataHandler
)
reportProtocol
.
withBody
(
reportJson
.
toString
()).
execute
(
dataHandler
)
}
override
fun
onProtocolFailed
(
p0
:
IProtocol
?)
{
...
...
app/src/main/java/com/duolebo/blyrobot/protocol/ApkReportProtocol.kt
View file @
1b98a75e
...
...
@@ -6,15 +6,26 @@ import com.duolebo.appbase.prj.bmtv.protocol.IProtocolConfig
import
com.duolebo.appbase.prj.bmtv.protocol.ProtocolBase
import
com.duolebo.blyrobot.data.ApkReportData
import
com.duolebo.blyrobot.util.Config
import
java.lang.StringBuilder
class
ApkReportProtocol
(
context
:
Context
?,
config
:
IProtocolConfig
?)
:
ProtocolBase
(
context
,
config
)
{
val
model
=
ApkReportData
()
var
body
=
""
fun
withBody
(
body
:
String
):
ApkReportProtocol
{
this
.
body
=
body
return
this
}
override
fun
prepareProtocolBody
(
p0
:
MutableMap
<
String
,
String
>?)
{
}
override
fun
prepareHttpBody
():
ByteArray
{
return
body
.
toByteArray
()
}
override
fun
getData
():
IModel
{
return
model
}
...
...
app/src/main/java/com/duolebo/blyrobot/ui/AppConfigListItem.kt
0 → 100644
View file @
1b98a75e
package
com.duolebo.blyrobot.ui
import
android.content.Context
import
android.view.LayoutInflater
import
android.widget.RelativeLayout
import
com.duolebo.blyrobot.R
import
com.duolebo.blyrobot.data.ApkInfo
import
kotlinx.android.synthetic.main.app_config_item.view.*
class
AppConfigListItem
(
context
:
Context
?)
:
RelativeLayout
(
context
)
{
init
{
LayoutInflater
.
from
(
context
).
inflate
(
R
.
layout
.
app_config_item
,
this
)
}
fun
setData
(
apkInfo
:
ApkInfo
)
{
this
.
appName
.
text
=
apkInfo
.
name
this
.
packageName
.
text
=
apkInfo
.
packageName
}
}
\ No newline at end of file
app/src/main/res/layout/activity_main.xml
View file @
1b98a75e
...
...
@@ -6,10 +6,12 @@
android:layout_width=
"match_parent"
>
<LinearLayout
android:id=
"@+id/btnGroup"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
android:layout_centerInParent=
"true"
>
android:layout_alignParentTop=
"true"
android:layout_centerHorizontal=
"true"
android:orientation=
"horizontal"
>
<Button
android:id=
"@+id/startBtn"
android:layout_width=
"wrap_content"
...
...
@@ -20,7 +22,7 @@
android:id=
"@+id/stopBtn"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_margin
Top
=
"10dp"
android:layout_margin
Left
=
"10dp"
android:text=
"停止"
/>
<TextView
...
...
@@ -31,4 +33,10 @@
android:layout_marginTop=
"20dp"
/>
</LinearLayout>
<ListView
android:id=
"@+id/listView"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_below=
"@id/btnGroup"
/>
</RelativeLayout>
\ No newline at end of file
app/src/main/res/layout/app_config_item.xml
0 → 100644
View file @
1b98a75e
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
<TextView
android:id=
"@+id/appName"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:minHeight=
"40dp"
android:layout_marginLeft=
"10dp"
android:textSize=
"22sp"
android:gravity=
"center_vertical"
tools:text=
"电视家"
/>
<TextView
android:id=
"@+id/packageName"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:minHeight=
"30dp"
android:layout_marginLeft=
"10dp"
android:layout_below=
"@+id/appName"
android:gravity=
"center_vertical"
android:textSize=
"18sp"
tools:text=
"com.elinkway.tvlive2"
/>
<TextView
android:id=
"@+id/status"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:minHeight=
"30dp"
android:layout_marginRight=
"10dp"
android:layout_centerVertical=
"true"
android:layout_alignParentRight=
"true"
android:layout_below=
"@+id/appName"
android:gravity=
"right|center_vertical"
android:textSize=
"18sp"
tools:text=
"执行中"
/>
</RelativeLayout>
\ No newline at end of file
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