manadream / AndroidProxySetter

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

Does not work on HTC One #1

Closed eamonnfaherty-productmadness closed 9 years ago

eamonnfaherty-productmadness commented 9 years ago

I am running Android 4.2.2 and HTC Sense version 5.0.

I am running the command like this:

adb -s $DEVICE_ID shell am start -n tk.elevenk.proxysetter/.MainActivity -e host $PROXY_HOST -e port $PROXY_PORT -e ssid $SSID -e key $PASSWORD

When running logcat I see the following: W/HtcNativeFlag( 6330): Fail to get flag string for type 'customer', use default value W/HtcNativeFlag( 6330): Fail to get flag for type 'customer', use default value: 52 W/HtcNativeFlag( 6330): Fail to get flag string for type 'language', use default value W/HtcNativeFlag( 6330): Fail to get flag for type 'language', use default value: 0 W/CpuWake ( 695): >>nativeAcquireCpuPerfWakeLock() W/CpuWake ( 695): <<nativeAcquireCpuPerfWakeLock() I/Intent ( 695): @test_code: getHtcIntentFlag: 0 obj: 1098255728 I/FeedHostManager( 1101): onPause I/FeedProviderManager( 1101): onPause I/ActivityManager( 695): START u0 {flg=0x10000000 cmp=tk.elevenk.proxysetter/.MainActivity (has extras)} from pid 6330 D/PowerManagerService( 695): acquireWakeLock(41bd13c0): PARTIAL_WAKE_LOCK , tag=ActivityManager-Launch, flags=0x1, pid=695, uid=1000 I/SocialFeedProvider( 1101): +onPause I/SocialFeedProvider( 1101): -onPause W/ContextImpl( 695): Calling a method in the system process without a qualified user: android.app.ContextImpl.sendBroadcast:1313 com.android.internal.policy.impl.PhoneWindowManager.setNavigationBarVisibility:7309 com.android.server.wm.WindowManagerService.setNavigationBarVisibility:12416 com.android.server.am.ActivityStack.realStartActivityLocked:697 com.android.server.am.ActivityStack.startSpecificActivityLocked:902 D/WirelessDisplayService( 695): getMirrorDisplayStatus:falsecurState:1 I/Launcher( 1101): updateWallpaperVisibility: true E/WifiStateMachine( 695): SupplicantStartedState - CMD_GET_CONFIGURED_NETWORKS E/WifiService( 695): getConfiguredNetworks() E/WifiStateMachine( 695): syncGetConfiguredNetworks E/ProxySetterApp( 6049): Executing proxy change request... E/ProxySetterApp( 6049): Error: proxy not set. Try clearing the proxy setting manually first. Error Code: 4 D/PowerManagerService( 695): acquireWakeLock(41bd13c0): PARTIAL_WAKE_LOCK , tag=ActivityManager-Launch, flags=0x1, pid=695, uid=1000 I/InputMethodManagerService( 695): Disable input method client, pid: 1101 I/InputMethodManagerService( 695): Enable input method client, pid: 6049 D/qdmemalloc( 222): ion: Allocated buffer base:0x44cb2000 size:8355840 fd:51 D/qdmemalloc( 222): ion: Allocated buffer base:0x400d1000 size:4096 fd:81 D/qdmemalloc( 6049): ion: Mapped buffer base:0x6c657000 size:8355840 offset:0 fd:66 D/qdmemalloc( 6049): ion: Mapped buffer base:0x6514c000 size:4096 offset:0 fd:67 D/PowerManagerService( 695): acquireWakeLock(41986d88): SCREEN_BRIGHT_WAKE_LOCK ON_AFTER_RELEASE, tag=WindowManager, flags=0x2000000a, pid=695, uid=1000 W/WeatherTimeKeeper( 1101): [refreshWeatherData] no weather data W/ContextImpl( 695): Calling a method in the system process without a qualified user: android.app.ContextImpl.sendBroadcast:1313 com.android.internal.policy.impl.PhoneWindowManager.setNavigationBarVisibility:7309 com.android.server.wm.WindowManagerService.setNavigationBarVisibility:12416 com.android.server.am.ActivityStack.resumeTopActivityLocked:1952 com.android.server.am.ActivityStack.resumeTopActivityLocked:1679 I/ActivityManager( 695): Displayed tk.elevenk.proxysetter/.MainActivity: +87ms (total +52s898ms) I/FeedHostManager( 1101): onResume I/FeedProviderManager( 1101): onResume D/qdmemalloc( 222): ion: Allocated buffer base:0x42c76000 size:512000 fd:79 I/SocialFeedProvider( 1101): +onResume I/SocialFeedProvider( 1101): updateAccounts - Accounts is no change I/SocialFeedProvider( 1101): -onResume D/qdmemalloc( 222): ion: Allocated buffer base:0x4005b000 size:4096 fd:34 D/qdmemalloc( 6049): ion: Mapped buffer base:0x6bfae000 size:512000 offset:0 fd:68 D/qdmemalloc( 6049): ion: Mapped buffer base:0x65177000 size:4096 offset:0 fd:69 I/InputMethodManagerService( 695): Disable input method client, pid: 6049 I/InputMethodManagerService( 695): Enable input method client, pid: 1101 D/qdmemalloc( 6049): ion: Unmapping buffer base:0x6c657000 size:8355840 D/qdmemalloc( 6049): ion: Unmapping buffer base:0x6514c000 size:4096 D/qdmemalloc( 222): ion: Unmapping buffer base:0x44cb2000 size:8355840 D/qdmemalloc( 222): ion: Unmapping buffer base:0x400d1000 size:4096 D/qdmemalloc( 222): ion: Freeing buffer base:0x0 size:8355840 fd:51 D/qdmemalloc( 222): ion: Freeing buffer base:0x0 size:4096 fd:81 D/PowerManagerService( 695): releaseWakeLock(41bd13c0): PARTIAL_WAKE_LOCK , tag=ActivityManager-Launch, flags=0x1 I/Launcher( 1101): updateWallpaperVisibility: false

This used to work and still does on my Nexus 4 running Android 4.2

eamonnfaherty-productmadness commented 9 years ago

This also doesn't work on my Nexus 5 which is running Android 5.0

benoitjadinon commented 9 years ago

it says error '4' which could happen if the SSID doesn't exist, OR a password was provided for an AP that is open, OR no password was provided for an AP that requires one, could this be your case ?

Shnitzelil commented 9 years ago

I'm also facing the same issue... with Nexus 5 with secured wifi

manadream commented 9 years ago

Sorry I haven't gotten back to you sooner. I'll take a look at this and get back to you (I should have access to a Nexus 5 to try it out).

manadream commented 9 years ago

@eamonnfaherty-productmadness @Shnitzelil I don't have the 5 available right now, but I tried on a Galaxy S5 and it works fine for me. I was able to reproduce your error by, as @benoitjadinon pointed out, providing a password for an open wifi network, NOT providing a password for a secure wifi network and providing a non-existent wifi network name. Note that the SSID name is case sensitive.

I was also able to reproduce the error by not being connected to any network at all when issuing this command. In order for this tool to forcefully connect to the given network (in the current implementation) you must also pass in the extra -e reset-wifi true. This seems like undesirable behavior and it should try to connect to the network regardless I would think. I'll change this soon.

Also, I have not tested this against any secure networks other than WPA/WPA2 security methods for the wifi network. WEP networks may or may not work as I have not verified this and I'm pretty sure EAP wifi networks will not work either since there's not currently a way to provide the username to the tool for it to even try connecting to an EAP protected network.

I'll have access to a Nexus 5 sometime next week to try it out on that, but take a close look at your command to make sure everything is correct and also try adding the -e reset-wifi true extra and see if that solves your problem.

manadream commented 9 years ago

@eamonnfaherty-productmadness @Shnitzelil actually, I just went ahead and made a fix for it :laughing: In addition to my comment above you can simply try the latest release in the releases section.

eamonnfaherty-productmadness commented 9 years ago

I am very happy and grateful to confirm your thoughts were correct!

I have run the latest version on my HTC One and it works perfectly!

Thanks a million!