manadream / AndroidProxySetter

An android app that sets the proxy settings for a wifi access point by using adb
GNU General Public License v3.0
485 stars 97 forks source link

Not able to set proxy to real device #8

Closed mukeshkabra closed 8 years ago

mukeshkabra commented 8 years ago

Hello

I am not able to set proxy to real device, can you look this issue

mukeshkabra commented 8 years ago

@jpkrause :Can you help me for this

manadream commented 8 years ago

Hello, can you share with me the exact command you are running (obfuscating any private info) as well as the output of logcat from your device when you execute that command? Also the manufacturer, model and OS version of the device you are trying this on. Thanks.

mukeshkabra commented 8 years ago

Hello @jpkrause I am running following command in S3 adb -d shell am start -n tk.elevenk.proxysetter/.MainActivity -e host 192.168.12.128 -e port 8888 -e ssid mobile-test

mukeshkabra commented 8 years ago

Mobile already connected to wifi

manadream commented 8 years ago

@mukeshkabra Is that wifi network open or is it password protected? Also, can you give me the output of running adb logcat after you execute the proxy command?

mukeshkabra commented 8 years ago

it is password protected , and wifi is already connected to wifi

manadream commented 8 years ago

If it is password protected you should add the password to the command like so adb -d shell am start -n tk.elevenk.proxysetter/.MainActivity -e host 192.168.12.128 -e port 8888 -e ssid mobile-test -e key <password> you can also try adding the flag -e reset-wifi true to see if that helps

mukeshkabra commented 8 years ago

Hello @jpkrause I have tried using password and it is working fine, but is there any way to set proxy without setting password,

manadream commented 8 years ago

Unfortunately, no. With the way that proxy changes are made, it is necessary to have all the details required to connect to the access point. If the access point were open, it would not require a password.

yanqian commented 8 years ago

you are awesome, man!!! @jpkrause

manadream commented 8 years ago

Not sure what I did, but thanks, @yanqian! 😄

snowman commented 5 months ago
$ adb
    shell
      am start
        -n tk.elevenk.proxysetter/.MainActivity
        -e host 192.168.0.2
        -e port 8888
        -e ssid Home
        -e key  your_password_here
        -e reset-wifi true

NOT work for me

  1. Mobile already connected to WiFi
  2. Android 11
  3. The proxy still show None screencap
Error resetting wifi
java.lang.RuntimeException: Unable to add or update network configuration for Home
    at tk.elevenk.proxysetter.ProxyChangeExecutor.connectToWifiNetwork(ProxyChangeExecutor.java:282)
    at tk.elevenk.proxysetter.ProxyChangeExecutor.clearAndReconnectWifi(ProxyChangeExecutor.java:232)
    at tk.elevenk.proxysetter.ProxyChangeExecutor.getAPLNetworkId(ProxyChangeExecutor.java:115)
    at tk.elevenk.proxysetter.ProxyChangeExecutor.executeChange(ProxyChangeExecutor.java:95)
    at tk.elevenk.proxysetter.ProxyChangeAsync.doInBackground(ProxyChangeAsync.java:62)
    at tk.elevenk.proxysetter.ProxyChangeAsync.doInBackground(ProxyChangeAsync.java:33)
    at android.os.AsyncTask$3.call(AsyncTask.java:394)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:305)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
    at java.lang.Thread.run(Thread.java:923)
{}
Error getting network ID. Given Network may not exist. Aborting.
Error: proxy not set. Try clearing the proxy setting manually first. Error Code: 4
A resource failed to call release. 
manadream commented 5 months ago

Hm yeah I don't know, I haven't touched this in years. My guess is that it's a permissions thing. Try making sure the permissions are allowed on the app in the Android settings. Otherwise, I have no clue, I'm not maintaining this repo at all. You're welcome to submit a pull request with a fix if you figure it out.