julian-klode / dns66

DNS-based Host Blocker (and lightweight ad blocker) for Android
https://jak-linux.org/projects/dns66/
GNU General Public License v3.0
2.14k stars 200 forks source link

DownloadManager does not work in Nougat with VPN running #31

Closed saket closed 7 years ago

saket commented 8 years ago

So I just spent several hours trying to debug an issue where Play Store wasn't downloading any app, including an hour long phone call with Google's support rep. Turns out, it was DNS66! Disabling it instantly fixed the issue. This is unacceptable. Any ideas why this is happening?

FernandoMiguel commented 8 years ago

i can confirm that with the vpn on i cant install or update apps from play store

julian-klode commented 8 years ago

There's a bug in Nougat, as far as I can tell from the comments on reddit, that prevents it from downloading stuff while a VPN is on. That's not a DNS66 specific issue, it also happens with other VPN services.

saket commented 8 years ago

Is there any way we can help you with this issue? At the very least the app should show a warning to Nougat users instead of leaving them confused.

julian-klode commented 8 years ago

I have no clue what's going on right now. I'm now at the same place as my OnePlus One, so I can setup Nougat there over the weekend and see if I can reproduce it.

I always wonder if you guys also happen to run in an IPv6 enabled network, as IPv6 is currently not routed via the VPN (#4). I can test both IPv4-only and dual-stack (IPv4+IPv6) networking this weekend.

saket commented 8 years ago

Alright! Alternatively, you can also install an emulator on your machine if that helps :)

Also, how do I find out if I'm in an IPv6 environment?

FernandoMiguel commented 8 years ago

@julian-klode IPv4 network here , sadly

julian-klode commented 8 years ago

@Saketme Emulators on my ThinkPad X230 don't work well.I have 8 GB RAM, just running the OS + Chrome takes away 4. An emulator takes away 1.5 GB for the guest RAM, and another 1.5 GB or so (or more) for a temporary copy of the system image. Meaning: My system locks up because it's out of memory. I really need to get 16 GB RAM at some point :/

@FernandoMiguel Thanks, that at least gets rid of one possible cause.

saket commented 8 years ago

@julian-klode Ouch! Yea, development for Android is an expensive affair. Will wait for your update, thanks for the work!

julian-klode commented 8 years ago

I can reproduce the issue on Nougat just by trying to download new filter lists while the VPN is on. I basically removed every option from the VPN, and it still happens, so that really looks like an Android bug to me.

julian-klode commented 8 years ago

See https://code.google.com/p/android/issues/detail?id=213341

julian-klode commented 8 years ago

So, I could disallow the playstore from using the VPN, that should make it work again. That does not solve any other instance of the Download manager, though. For example, downloads in a web browser should still not work.

julian-klode commented 8 years ago

So, I committed a work around for the Play Store and DNS66 host file fetching. Other apps might still have broken downloads, but at least we're not blocking the major things right now. Chrome seems to work fine, BTW.

saket commented 8 years ago

Thanks! Will wait for a release.

julian-klode commented 8 years ago

@Saketme I just verified the workaround and released 0.1.3. Binaries here are available now, the F-Droid builds usually occur in the next 12-14 hours.

julian-klode commented 8 years ago

Apparently on the real hardware, Chrome downloads seem affected too. So you can browse now and get Play Store updates, but you cannot download stuff on Nougat. I hope Google fixes that sooner than later.

saket commented 8 years ago

Is blocking the download manager from using the VPN not an option? Because I think both the play store and chrome use it for handling downloads.

FernandoMiguel commented 8 years ago

I tried to update apps with Opera VPN which also does ad blocking, on 7.1.1 and it worked fine

julian-klode commented 8 years ago

@Saketme It's not possible to block the download manager. The download manager chooses the network from the app that launched the request.

@FernandoMiguel That sounds weird. But maybe they also work around it. In any case, they don't do ad blocking, not sure how you get that idea (it can block trackers - ads would not be allowed on the Play Store). I can't check it though, as I don't get past the welcome screen...

julian-klode commented 8 years ago

@FernandoMiguel I can now confirm that downloads work with Opera VPN. That's really odd.

jb0nez commented 8 years ago

On Android 7.1.1 I'm using the ES File Explorer's downloader. Seems to work fine and is better than stock IMO.

But I can see this being a bug for those who don't use ES.

I'd rather see whitelists implemented first myself, since the ES workaround seems to be fine.

julian-klode commented 7 years ago

44 is merged, so you can whitelist specific apps now in v0.2.0.

StSav012 commented 6 years ago

NoRoot Firewall (https://play.google.com/store/apps/details?id=app.greyshirts.firewall) doesn't break anything working almost like dns66, though. Could you nail the problem down by yourself? Not fix it but at least find. A year is over since the issue was opened. Yet, Download Manager doesn't work even being marked to bypass.