├── app ├── .gitignore ├── app-release.apk ├── src │ └── main │ │ ├── res │ │ ├── layout │ │ │ ├── buttons_view_divider.xml │ │ │ ├── title_view.xml │ │ │ ├── floating.xml │ │ │ └── base_content.xml │ │ ├── drawable │ │ │ ├── icon.png │ │ │ └── ic_dialog_menu_generic.png │ │ ├── values-v14 │ │ │ ├── colors.xml │ │ │ └── styles.xml │ │ ├── values-v11 │ │ │ ├── styles.xml │ │ │ └── colors.xml │ │ ├── values │ │ │ ├── colors.xml │ │ │ ├── styles.xml │ │ │ └── strings.xml │ │ ├── layout-v11 │ │ │ ├── buttons_view_divider.xml │ │ │ └── title_view.xml │ │ ├── values-ru │ │ │ └── strings.xml │ │ ├── values-zh-rCN │ │ │ └── strings.xml │ │ ├── values-zh-rTW │ │ │ └── strings.xml │ │ └── values-it │ │ │ └── strings.xml │ │ ├── java │ │ └── com │ │ │ └── farproc │ │ │ └── wifi │ │ │ └── connecter │ │ │ ├── Version.java │ │ │ ├── ConfigurationSecurities.java │ │ │ ├── ChangingAwareEditText.java │ │ │ ├── ReenableAllApsWhenNetworkStateChanged.java │ │ │ ├── MainActivity.java │ │ │ ├── NewNetworkContent.java │ │ │ ├── ChangePasswordContent.java │ │ │ ├── BaseContent.java │ │ │ ├── Floating.java │ │ │ ├── ConfiguredNetworkContent.java │ │ │ ├── CurrentNetworkContent.java │ │ │ ├── TestWifiScan.java │ │ │ ├── ConfigurationSecuritiesV8.java │ │ │ ├── ConfigurationSecuritiesOld.java │ │ │ └── Wifi.java │ │ └── AndroidManifest.xml ├── proguard-rules.pro └── build.gradle ├── settings.gradle ├── .gitignore ├── gradle.properties ├── gradlew.bat └── gradlew /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /app/app-release.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkch/android-wifi-connecter/HEAD/app/app-release.apk -------------------------------------------------------------------------------- /app/src/main/res/layout/buttons_view_divider.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkch/android-wifi-connecter/HEAD/app/src/main/res/drawable/icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_dialog_menu_generic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mkch/android-wifi-connecter/HEAD/app/src/main/res/drawable/ic_dialog_menu_generic.png -------------------------------------------------------------------------------- /app/src/main/res/values-v14/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | @android:color/holo_blue_dark 6 | 7 | 8 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | .externalNativeBuild 10 | 11 | .idea/ 12 | gradle/wrapper/ 13 | -------------------------------------------------------------------------------- /app/src/main/res/values-v11/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/layout/title_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 13 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/yuanxiaohui/Documents/Android/android-sdk-mac_86/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 24 5 | buildToolsVersion "24.0.2" 6 | defaultConfig { 7 | applicationId "com.farproc.wifi.connecter" 8 | minSdkVersion 3 9 | targetSdkVersion 14 10 | versionCode 16 11 | versionName "2.0.3" 12 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 13 | } 14 | lintOptions { 15 | abortOnError false 16 | } 17 | buildTypes { 18 | release { 19 | minifyEnabled false 20 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 21 | } 22 | } 23 | } 24 | 25 | dependencies { 26 | compile fileTree(dir: 'libs', include: ['*.jar']) 27 | } 28 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | org.gradle.jvmargs=-Xmx1536m 13 | 14 | # When configured, Gradle will run in incubating parallel mode. 15 | # This option should only be used with decoupled projects. More details, visit 16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 17 | # org.gradle.parallel=true 18 | -------------------------------------------------------------------------------- /app/src/main/java/com/farproc/wifi/connecter/Version.java: -------------------------------------------------------------------------------- 1 | package com.farproc.wifi.connecter; 2 | 3 | import java.lang.reflect.Field; 4 | 5 | import android.os.Build.VERSION;; 6 | 7 | /** 8 | * Get Android version in different Android versions. :) 9 | * @author yuanxiaohui 10 | * 11 | */ 12 | public class Version { 13 | 14 | public final static int SDK = get(); 15 | 16 | private static int get() { 17 | final Class versionClass = VERSION.class; 18 | try { 19 | // First try to read the recommended field android.os.Build.VERSION.SDK_INT. 20 | final Field sdkIntField = versionClass.getField("SDK_INT"); 21 | return sdkIntField.getInt(null); 22 | }catch (NoSuchFieldException e) { 23 | // If SDK_INT does not exist, read the deprecated field SDK. 24 | return Integer.valueOf(VERSION.SDK); 25 | } catch (Exception e) { 26 | throw new RuntimeException(e); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /app/src/main/res/layout-v11/title_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 17 | 18 | 24 | 25 | -------------------------------------------------------------------------------- /app/src/main/java/com/farproc/wifi/connecter/ConfigurationSecurities.java: -------------------------------------------------------------------------------- 1 | package com.farproc.wifi.connecter; 2 | 3 | import android.net.wifi.ScanResult; 4 | import android.net.wifi.WifiConfiguration; 5 | 6 | public abstract class ConfigurationSecurities { 7 | /** 8 | * @return The security of a given {@link WifiConfiguration}. 9 | */ 10 | public abstract String getWifiConfigurationSecurity(WifiConfiguration wifiConfig); 11 | /** 12 | * @return The security of a given {@link ScanResult}. 13 | */ 14 | public abstract String getScanResultSecurity(ScanResult scanResult); 15 | /** 16 | * Fill in the security fields of WifiConfiguration config. 17 | * @param config The object to fill. 18 | * @param security If is OPEN, password is ignored. 19 | * @param password Password of the network if security is not OPEN. 20 | */ 21 | public abstract void setupSecurity(WifiConfiguration config, String security, final String password); 22 | public abstract String getDisplaySecirityString(final ScanResult scanResult); 23 | public abstract boolean isOpenNetwork(final String security); 24 | 25 | public static ConfigurationSecurities newInstance() { 26 | if(Version.SDK < 8) { 27 | return new ConfigurationSecuritiesOld(); 28 | } else { 29 | return new ConfigurationSecuritiesV8(); 30 | } 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/java/com/farproc/wifi/connecter/ChangingAwareEditText.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Wifi Connecter 3 | * 4 | * Copyright (c) 2011 Kevin Yuan (farproc@gmail.com) 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in 14 | * all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | * THE SOFTWARE. 23 | * 24 | **/ 25 | 26 | package com.farproc.wifi.connecter; 27 | 28 | import android.content.Context; 29 | import android.util.AttributeSet; 30 | import android.widget.EditText; 31 | 32 | public class ChangingAwareEditText extends EditText { 33 | 34 | public ChangingAwareEditText(Context context, AttributeSet attrs) { 35 | super(context, attrs); 36 | } 37 | 38 | private boolean mChanged = false; 39 | 40 | public boolean getChanged() { 41 | return mChanged; 42 | } 43 | 44 | protected void onTextChanged (CharSequence text, int start, int before, int after) { 45 | mChanged = true; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /app/src/main/res/values-ru/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | Ошибка! 10 | Больше… 11 | Подключить 12 | Подключение к %s 13 | IP-адрес 14 | Сила сигнала 15 | Забыть 16 | Статус 17 | Подключено 18 | Подключение… 19 | Скорость 20 | Отличная 21 | Хорошая 22 | Средняя 23 | Плохая 24 | Безопасность 25 | Открыто 26 | WEP 27 | WPA 28 | WPA2 29 | WPA-EAP 30 | IEEE8021X 31 | Пароль беспроводной сети 32 | Показывать пароль. 33 | Изменить пароль 34 | "Изменить пароль" 35 | (без изменений) 36 | Сохранить 37 | AdHoc еще не поддерживается платформой Android! 38 | 39 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 29 | 30 | 33 | 34 | 35 | 36 | 37 | 40 | 41 | 45 | 49 | 50 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /app/src/main/res/layout/floating.xml: -------------------------------------------------------------------------------- 1 | 2 | 28 | 29 | 33 | 34 | 38 | 39 | 45 | 46 | 47 | 48 | 49 | 57 | 58 |