Android Skip Ads Android Project

作为安卓自动跳过广告三部曲的第二部分,主要是实现系统截屏功能。继《Android Skip Ads Yolov5 Project》之后,下一步就是获取当前屏幕的截图,把截图传入分析引擎实现广告跳过按钮的识别,最后一步是按钮点击。

要在安卓系统上实现截图(截取整个屏幕,并且需要截取其他app的界面),通常有下面三个方法:

1.直接调用系统的截屏工具,需要root权限

adb shell screencap -p /sdcard/sreenshot1.png
Continue Reading

Android Skip Ads Yolov5 Project

YOLOv5 🚀 is a family of object detection architectures and models pretrained on the COCO dataset, and represents Ultralytics open-source research into future vision AI methods, incorporating lessons learned and best practices evolved over thousands of hours of research and development.

1. 环境搭建
自动广告跳过这个想法,不过由于各种原因一直没有实时。知道最近才又重新开始折腾这个东西,yolov5的安装这里就不再说明了,建议使用anaconda安装。我创建了一个conda环境可以直接下载之后通过conda安装:

# 1. conda 环境地址:https://anaconda.org/obaby/yolov5 
# 2. 下载对应操作系统的环境yml脚本 
# 3. 在Terminal 或者 an Anaconda Prompt内执行 
conda env create user/my-environment source activate my-environment

badge

 如果不想使用上面的安装方法可以参考:https://blog.csdn.net/oJiWuXuan/article/details/107558286 和https://github.com/ultralytics/yolov5 按照官方指导进行安装。

Continue Reading

百度语音识别 ASR 收费导致的bug

[ERROR][bds_asr_response_agent.cpp:419][ASRResponse::get_server_err_desc]err_no is: -3004
[DEBUG][bds_EventManagerAsr.cpp:1031]Encounter error: Server app name unknown.
[DEBUG][bds_EventManagerAsr.cpp:936]vr_handler work_status=8, encoded_err=2225220, err_desc=Server app name unknown., need_finish=1, need_stop=0, need_loop=0
[DEBUG][bds_EventManagerAsr.cpp:937]vr_handler m_has_cancelled=0, m_need_cancelled_callback=0
[DEBUG][bds_EventManagerAsr.cpp:654]1cancel_internal m_vr_is_running=1
[DEBUG][bds_EventManagerAsr.cpp:660]2cancel_internal m_vr_is_running=0
[TRACE][bds_Chunk_Connection.mm:194][bds_Chunk_Connection] uptask finished.
2021-09-03 20:26:05.888644+0800 BDSClientSample[13947:7119533] EVoiceRecognitionClientWorkStatusError:33
[TRACE][bds_Chunk_Connection.mm:556][bds_Chunk_Connection] downtask finished.
[TRACE][AppThread.cpp:329]Thread end (SP ~ 0x16d62ef98, threadID: 0x16d62f000

[TRACE][AppThread.cpp:47]============================================= AppThread::~AppThread() ====================================
[TRACE][AppThread.cpp:329]Thread end (SP ~ 0x16dea6f98, threadID: 0x16dea7000

[TRACE][AppThread.cpp:47]============================================= AppThread::~AppThread() ====================================
[DEBUG][BDVRReachability.mm:74]BDVRReachability Flag Status: -R ------- networkStatusForFlags
[DEBUG][BDVRReachability.mm:74]BDVRReachability Flag Status: -R ------- networkStatusForFlags
[DEBUG][bds_EventManagerAsr.cpp:471]start sn=72A104F8-DAAE-4226-8DEE-B7F43402FF4C
[TRACE][bds_EventManagerAsr.cpp:1134][EventManagerAsr::resolve_property_list]PROPERTY:10005
[TRACE][bds_EventManagerAsr.cpp:909]ASR_ONLINE_PARAM_KEY_APPCODE = 24797995
[TRACE][bds_EventManagerAsr.cpp:917]ASR_ONLINE_PARAM_KEY_APPCODE = fxAfMkwQk4gu3RpmgE4Oxhy2
[TRACE][bds_EventManagerMic.cpp:119][Mic:]start recorder prepare cost: 1
[TRACE][bds_EventManagerMic.cpp:121][Mic:]start recorder cost: 102
[TRACE][bds_vad_proxy.cpp:110][VADProxy::init_vad]current vad: ModelVAD
[TRACE][bds_EventManagerDec_Chunk.cpp:370][setupConnection]Cached IP: 
[TRACE][bds_AddressResolver_getaddrinfo.cpp:194]PROTO: https:// HOST: vop.baidu.com PATH: /v2

今天晚上使用语音助理切换影院模式的时候提示错误,Server app name unknown.这特喵的就神奇了,当时各种appkey id之类的都换成自己的了,应该也不会有人删除这些东西。但是就是提示错误,真是人生何处不坑爹。登陆百度后台发现创建的key依旧存在,不过后面语音技术显示的是无!

Continue Reading

一个加号(+)引发的血案

之前做的一个项目,由于阿里的旺信服务停了,最近想找个替代方案,于是找到了野火IM,看了下demo效果还不错,主要是ui部分可以复用。于是下载源代码看了一眼,比较奇怪的一点是昨天在windows已经把代码跑起来了,结果今天在mac上死活运行不聊了,提示下面的错误:

Execution failed for task ':chat:processDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > Android resource linking failed
     C:\Users\obaby\.gradle\caches\transforms-2\files-2.1\87575f1e55fb95ae83d67cbd526a722c\core-1.7.0-alpha02\res\values\values.xml:105:5-114:25: AAPT: error: resource android:attr/lStar not found.
Continue Reading

UniApp Android高德地图黑屏

如何在uniapp中引入高德地图可以参考这篇文章,http://www.xiongdalin.com/2019/11/27/unaipp-amap/。不过引入之后如果离线打包那么很可能在安卓系统上会黑屏,因为没有引入对应的sdk。

如果要解决这个问题需要引入:

implementation files('libs/map-amap-release.aar')
implementation files('libs/amap-libs-release.aar')
# 不要同时引入amap-gp-libs-release

官方文档中没有说明如何引入高德的sdk,如果通过高德下载sdk导入会导致各种冲突,同样引入上面的amap-gp-libs-release也会导致各种冲突。

Continue Reading