android - Why are global proxy settings cleared after restarting the phone? -


i've built app once set device owner turns around , sets global proxy settings using setrecommendedglobalproxy() function this:

string pacurl = "http://my-proxy-server.com:65011/proxy.pac?a=zgtyzwl89xyy1qazw15"; uri pacurl = uri.parse(proxypacurl); proxyinfo newproxy = proxyinfo.buildpacproxy(pacurl);  try {      log.i("admin", "setting global proxy " + newproxy.tostring());     mdpm.setrecommendedglobalproxy(admincomponent, newproxy);   } catch (exception e) {      log.w("admin", "caught exception while setting global proxy: " + e.tostring());  } 

it works great until restart phone , global proxy settings gone. if check global proxy settings via connectivitymanager.getdefaultproxy(), returns proxy pac url app set earlier so, no network traffic being proxified.

interestingly enough, if go settings -> google -> security -> verify apps, disable "scan device security threats", reboot device, clear global proxy settings , reset global proxy settings work until re-enable "scan device security threats" , restart it. makes no sense me because states notified if security risks found , sure haven't seen notifications yet.

a few things worth mentioning:

  1. i've tested on various devices , can reproduce issue on of them.

  2. properly signing apk , installing doesn't fix issue.

  3. once global proxy settings have been broke, have first clear , reset them before they'll work again.

any suggestions or possible ideas i'm doing wrong welcomed!


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -