Commit 32cf3054 authored by liuyang's avatar liuyang

APK图片抓取识别及轮播流地址抓取,客户端添加监播控制

#BYLSERVER-1438
parent efefe99f
......@@ -139,7 +139,7 @@ class MainActivity : AppCompatActivity(), IAppBaseCallback {
this.appInfoAdapter.notifyDataSetChanged()
for (apkInfo in appInfoData.apkInfos) {
if (AppUtil.isAppInstalled(this, apkInfo.packageName)) {
if (apkInfo.monitoring && AppUtil.isAppInstalled(this, apkInfo.packageName)) {
val task = Task(this.applicationContext)
task.from(apkInfo)
TaskManager.instance.add(task)
......
......@@ -30,6 +30,8 @@ class ApkInfo: IModel {
// 弹出界面菜单按键,默认确定键
lateinit var menuKeyEvent: String
var monitoring = true
override fun from(json: JSONObject): Boolean {
this.name = json.optString(NAME)
this.packageName = json.optString(PACKAGE_NAME)
......@@ -42,6 +44,7 @@ class ApkInfo: IModel {
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
}
......@@ -69,6 +72,7 @@ class ApkInfo: IModel {
const val MEDIA_EXT = "mediaExt"
const val FILTER_URL = "filterUrl"
const val MENU_KEY_EVENT = "menuKeyEvent"
const val MONITORING = "monitoring"
}
}
\ No newline at end of file
......@@ -48,6 +48,7 @@ class BylRobotService: Service(), IAppBaseCallback {
override fun onCreate() {
super.onCreate()
initBroadcast()
// requestAppList()
}
private fun initBroadcast() {
......@@ -104,7 +105,7 @@ class BylRobotService: Service(), IAppBaseCallback {
val appInfoData = protocol.data as AppInfoData
for (apkInfo in appInfoData.apkInfos) {
if (AppUtil.isAppInstalled(this, apkInfo.packageName)) {
if (apkInfo.monitoring && AppUtil.isAppInstalled(this, apkInfo.packageName)) {
val task = Task(this.applicationContext)
task.from(apkInfo)
TaskManager.instance.add(task)
......
......@@ -16,10 +16,12 @@ class AppConfigListItem(context: Context?) : RelativeLayout(context) {
}
fun setData(apkInfo: ApkInfo) {
var installTips = ""
var tips = ""
if (!AppUtil.isAppInstalled(context, apkInfo.packageName))
installTips = "(未安装)"
this.appName.text = apkInfo.name + installTips
tips = "(未安装)"
else if (!apkInfo.monitoring)
tips = "(监播未启用)"
this.appName.text = apkInfo.name + tips
this.packageName.text = apkInfo.packageName
}
......
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