简体   繁体   中英

How to listen in Android when the browser or some app started downloading a files?

I need an application which will listen when some application starts downloading files (it will be evaluated like malicious behavior).

I was trying to do this with BroadcastReceiver and Intents, when I was filtering the " android.intent.action.DOWNLOAD_COMPLETE " (in xml) and show it into Toast , when some item was downloaded to the device, but it was not working for me.

I found now that there is exist a DownloadListener , which contains a onDownloadStart(..) method.

Do you think, that this can solve my problem?

Short of a custom version of the OS, you can't. At best, you could get a subset of requests that use DownloadManager. But most downloads don't use that- they just make direct HTTP requests. There's no way to track those from another application. If you were to use a custom version of the OS you could, but to get everything you'd pretty much need to be built into the Linux networking subsystem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM