[
  {
    "path": ".gitignore",
    "content": "*.iml\n.gradle\n/local.properties\n/.idea/workspace.xml\n/.idea/libraries\n.DS_Store\n/build\n/captures\n.externalNativeBuild\n"
  },
  {
    "path": ".idea/compiler.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"CompilerConfiguration\">\n    <resourceExtensions />\n    <wildcardResourcePatterns>\n      <entry name=\"!?*.java\" />\n      <entry name=\"!?*.form\" />\n      <entry name=\"!?*.class\" />\n      <entry name=\"!?*.groovy\" />\n      <entry name=\"!?*.scala\" />\n      <entry name=\"!?*.flex\" />\n      <entry name=\"!?*.kt\" />\n      <entry name=\"!?*.clj\" />\n      <entry name=\"!?*.aj\" />\n    </wildcardResourcePatterns>\n    <annotationProcessing>\n      <profile default=\"true\" name=\"Default\" enabled=\"false\">\n        <processorPath useClasspath=\"true\" />\n      </profile>\n    </annotationProcessing>\n  </component>\n</project>"
  },
  {
    "path": ".idea/copyright/profiles_settings.xml",
    "content": "<component name=\"CopyrightManager\">\n  <settings default=\"\" />\n</component>"
  },
  {
    "path": ".idea/gradle.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"GradleSettings\">\n    <option name=\"linkedExternalProjectsSettings\">\n      <GradleProjectSettings>\n        <option name=\"distributionType\" value=\"DEFAULT_WRAPPED\" />\n        <option name=\"externalProjectPath\" value=\"$PROJECT_DIR$\" />\n        <option name=\"modules\">\n          <set>\n            <option value=\"$PROJECT_DIR$\" />\n            <option value=\"$PROJECT_DIR$/app\" />\n          </set>\n        </option>\n        <option name=\"resolveModulePerSourceSet\" value=\"false\" />\n      </GradleProjectSettings>\n    </option>\n  </component>\n</project>"
  },
  {
    "path": ".idea/inspectionProfiles/Project_Default.xml",
    "content": "<component name=\"InspectionProjectProfileManager\">\n  <profile version=\"1.0\">\n    <option name=\"myName\" value=\"Project Default\" />\n    <inspection_tool class=\"AliAccessStaticViaInstance\" enabled=\"true\" level=\"BLOCKER\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"AliAccessToNonThreadSafeStaticFieldFromInstance\" enabled=\"true\" level=\"CRITICAL\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"AliArrayNamingShouldHaveBracket\" enabled=\"true\" level=\"MAJOR\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"AliControlFlowStatementWithoutBraces\" enabled=\"true\" level=\"BLOCKER\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"AliDeprecation\" enabled=\"true\" level=\"CRITICAL\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"AliEqualsAvoidNull\" enabled=\"true\" level=\"CRITICAL\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"AliLongLiteralsEndingWithLowercaseL\" enabled=\"true\" level=\"BLOCKER\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"AliMissingOverrideAnnotation\" enabled=\"true\" level=\"BLOCKER\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"AliWrapperTypeEquality\" enabled=\"true\" level=\"BLOCKER\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"AlibabaAbstractClassShouldStartWithAbstractNaming\" enabled=\"true\" level=\"CRITICAL\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"AlibabaAbstractMethodOrInterfaceMethodMustUseJavadoc\" enabled=\"true\" level=\"MAJOR\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"AlibabaAvoidApacheBeanUtilsCopy\" enabled=\"true\" level=\"BLOCKER\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"AlibabaAvoidCommentBehindStatement\" enabled=\"true\" level=\"MAJOR\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"AlibabaAvoidComplexCondition\" enabled=\"true\" level=\"MAJOR\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"AlibabaAvoidConcurrentCompetitionRandom\" enabled=\"true\" level=\"MAJOR\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"AlibabaAvoidManuallyCreateThread\" enabled=\"true\" level=\"CRITICAL\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"AlibabaAvoidMissUseOfMathRandom\" enabled=\"true\" level=\"MAJOR\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"AlibabaAvoidNewDateGetTime\" enabled=\"true\" level=\"BLOCKER\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"AlibabaAvoidPatternCompileInMethod\" enabled=\"true\" level=\"BLOCKER\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"AlibabaAvoidReturnInFinally\" enabled=\"true\" level=\"CRITICAL\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"AlibabaAvoidStartWithDollarAndUnderLineNaming\" enabled=\"true\" level=\"CRITICAL\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"AlibabaAvoidUseTimer\" enabled=\"true\" level=\"BLOCKER\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"AlibabaBooleanPropertyShouldNotStartWithIs\" enabled=\"true\" level=\"CRITICAL\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"AlibabaClassCastExceptionWithSubListToArrayList\" enabled=\"true\" level=\"CRITICAL\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"AlibabaClassCastExceptionWithToArray\" enabled=\"true\" level=\"CRITICAL\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"AlibabaClassMustHaveAuthor\" enabled=\"true\" level=\"MAJOR\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"AlibabaClassNamingShouldBeCamel\" enabled=\"true\" level=\"MAJOR\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"AlibabaCollectionInitShouldAssignCapacity\" enabled=\"true\" level=\"MAJOR\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"AlibabaCommentsMustBeJavadocFormat\" enabled=\"true\" level=\"MAJOR\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"AlibabaConcurrentExceptionWithModifyOriginSubList\" enabled=\"true\" level=\"CRITICAL\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"AlibabaConstantFieldShouldBeUpperCase\" enabled=\"true\" level=\"CRITICAL\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"AlibabaCountDownShouldInFinally\" enabled=\"true\" level=\"MAJOR\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"AlibabaDontModifyInForeachCircle\" enabled=\"true\" level=\"BLOCKER\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"AlibabaEnumConstantsMustHaveComment\" enabled=\"true\" level=\"CRITICAL\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"AlibabaExceptionClassShouldEndWithException\" enabled=\"true\" level=\"CRITICAL\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"AlibabaIbatisMethodQueryForList\" enabled=\"true\" level=\"MAJOR\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"AlibabaLowerCamelCaseVariableNaming\" enabled=\"true\" level=\"CRITICAL\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"AlibabaMethodReturnWrapperType\" enabled=\"true\" level=\"MAJOR\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"AlibabaPackageNaming\" enabled=\"true\" level=\"MAJOR\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"AlibabaPojoMustOverrideToString\" enabled=\"true\" level=\"MAJOR\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"AlibabaPojoMustUsePrimitiveField\" enabled=\"true\" level=\"MAJOR\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"AlibabaPojoNoDefaultValue\" enabled=\"true\" level=\"MAJOR\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"AlibabaRemoveCommentedCode\" enabled=\"true\" level=\"MAJOR\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"AlibabaServiceOrDaoClassShouldEndWithImpl\" enabled=\"true\" level=\"CRITICAL\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"AlibabaStringConcat\" enabled=\"true\" level=\"MAJOR\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"AlibabaSwitchStatement\" enabled=\"true\" level=\"CRITICAL\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"AlibabaTestClassShouldEndWithTestNaming\" enabled=\"true\" level=\"MAJOR\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"AlibabaThreadLocalShouldRemove\" enabled=\"true\" level=\"CRITICAL\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"AlibabaThreadPoolCreation\" enabled=\"true\" level=\"BLOCKER\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"AlibabaThreadShouldSetName\" enabled=\"true\" level=\"CRITICAL\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"AlibabaTransactionMustHaveRollback\" enabled=\"true\" level=\"MAJOR\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"AlibabaUndefineMagicConstant\" enabled=\"true\" level=\"MAJOR\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"AlibabaUnsupportedExceptionWithModifyAsList\" enabled=\"true\" level=\"CRITICAL\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"AlibabaUseQuietReferenceNotation\" enabled=\"true\" level=\"MAJOR\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"AndroidLintProtectedPermissions\" enabled=\"false\" level=\"ERROR\" enabled_by_default=\"false\" />\n    <inspection_tool class=\"LoggerInitializedWithForeignClass\" enabled=\"false\" level=\"WARNING\" enabled_by_default=\"false\">\n      <option name=\"loggerClassName\" value=\"org.apache.log4j.Logger,org.slf4j.LoggerFactory,org.apache.commons.logging.LogFactory,java.util.logging.Logger\" />\n      <option name=\"loggerFactoryMethodName\" value=\"getLogger,getLogger,getLog,getLogger\" />\n    </inspection_tool>\n    <inspection_tool class=\"MapOrSetKeyShouldOverrideHashCodeEquals\" enabled=\"true\" level=\"CRITICAL\" enabled_by_default=\"false\" />\n  </profile>\n</component>"
  },
  {
    "path": ".idea/inspectionProfiles/profiles_settings.xml",
    "content": "<component name=\"InspectionProjectProfileManager\">\n  <settings>\n    <option name=\"PROJECT_PROFILE\" value=\"Project Default\" />\n    <option name=\"USE_PROJECT_PROFILE\" value=\"true\" />\n    <version value=\"1.0\" />\n  </settings>\n</component>"
  },
  {
    "path": ".idea/misc.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"EntryPointsManager\">\n    <entry_points version=\"2.0\" />\n  </component>\n  <component name=\"NullableNotNullManager\">\n    <option name=\"myDefaultNullable\" value=\"android.support.annotation.Nullable\" />\n    <option name=\"myDefaultNotNull\" value=\"android.support.annotation.NonNull\" />\n    <option name=\"myNullables\">\n      <value>\n        <list size=\"4\">\n          <item index=\"0\" class=\"java.lang.String\" itemvalue=\"org.jetbrains.annotations.Nullable\" />\n          <item index=\"1\" class=\"java.lang.String\" itemvalue=\"javax.annotation.Nullable\" />\n          <item index=\"2\" class=\"java.lang.String\" itemvalue=\"edu.umd.cs.findbugs.annotations.Nullable\" />\n          <item index=\"3\" class=\"java.lang.String\" itemvalue=\"android.support.annotation.Nullable\" />\n        </list>\n      </value>\n    </option>\n    <option name=\"myNotNulls\">\n      <value>\n        <list size=\"4\">\n          <item index=\"0\" class=\"java.lang.String\" itemvalue=\"org.jetbrains.annotations.NotNull\" />\n          <item index=\"1\" class=\"java.lang.String\" itemvalue=\"javax.annotation.Nonnull\" />\n          <item index=\"2\" class=\"java.lang.String\" itemvalue=\"edu.umd.cs.findbugs.annotations.NonNull\" />\n          <item index=\"3\" class=\"java.lang.String\" itemvalue=\"android.support.annotation.NonNull\" />\n        </list>\n      </value>\n    </option>\n  </component>\n  <component name=\"ProjectLevelVcsManager\" settingsEditedManually=\"false\">\n    <OptionsSetting value=\"true\" id=\"Add\" />\n    <OptionsSetting value=\"true\" id=\"Remove\" />\n    <OptionsSetting value=\"true\" id=\"Checkout\" />\n    <OptionsSetting value=\"true\" id=\"Update\" />\n    <OptionsSetting value=\"true\" id=\"Status\" />\n    <OptionsSetting value=\"true\" id=\"Edit\" />\n    <ConfirmationsSetting value=\"0\" id=\"Add\" />\n    <ConfirmationsSetting value=\"0\" id=\"Remove\" />\n  </component>\n  <component name=\"ProjectRootManager\" version=\"2\" languageLevel=\"JDK_1_7\" default=\"true\" assert-keyword=\"true\" jdk-15=\"true\" project-jdk-name=\"JDK\" project-jdk-type=\"JavaSDK\">\n    <output url=\"file://$PROJECT_DIR$/build/classes\" />\n  </component>\n  <component name=\"ProjectType\">\n    <option name=\"id\" value=\"Android\" />\n  </component>\n  <component name=\"masterDetails\">\n    <states>\n      <state key=\"ProjectJDKs.UI\">\n        <settings>\n          <last-edited>Android API 22 Platform</last-edited>\n          <splitter-proportions>\n            <option name=\"proportions\">\n              <list>\n                <option value=\"0.2\" />\n              </list>\n            </option>\n          </splitter-proportions>\n        </settings>\n      </state>\n    </states>\n  </component>\n</project>"
  },
  {
    "path": ".idea/modules.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"ProjectModuleManager\">\n    <modules>\n      <module fileurl=\"file://$PROJECT_DIR$/WifiListConnect.iml\" filepath=\"$PROJECT_DIR$/WifiListConnect.iml\" />\n      <module fileurl=\"file://$PROJECT_DIR$/app/app.iml\" filepath=\"$PROJECT_DIR$/app/app.iml\" />\n    </modules>\n  </component>\n</project>"
  },
  {
    "path": ".idea/runConfigurations.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"RunConfigurationProducerService\">\n    <option name=\"ignoredProducers\">\n      <set>\n        <option value=\"org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer\" />\n        <option value=\"org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer\" />\n        <option value=\"org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer\" />\n      </set>\n    </option>\n  </component>\n</project>"
  },
  {
    "path": ".idea/smartfox_info.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"SmartFoxProjectConfig\">\n    <option name=\"projectInspectionClosed\" value=\"true\" />\n  </component>\n</project>"
  },
  {
    "path": ".idea/vcs.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"VcsDirectoryMappings\">\n    <mapping directory=\"$PROJECT_DIR$\" vcs=\"Git\" />\n  </component>\n</project>"
  },
  {
    "path": "README.md",
    "content": "# WifiListConnect\n\n<b>定期分享国内外别人家技术赚钱的案例，希望能给你启发。可以关注一波 保证不坑，坑了取消就是啦 :) </b>\n\n### 最新分享\n【案例】这些日赚上万美金Youtube油管从业者 技术人的福音 https://www.jianshu.com/p/18a25b4dcd40\n<br/>\n【案例】FFMPEG大神的机会 一套油管自动生产视频赚钱方法详解 [https://guozh.net/anlibierenmai1000daoyitaoyouguanzidongshengchanshipinzhuanqian/](https://guozh.net/anlibierenmai1000daoyitaoyouguanzidongshengchanshipinzhuanqian/)\n<br/>\n【案例】FFMPEG GIF音乐搞笑视频自动生成 内含视频体验 [https://guozh.net/youtube-funny-gif-auto-product-make-money/](https://guozh.net/youtube-funny-gif-auto-product-make-money/)\n<br/>\n![第一勺金](https://upload-images.jianshu.io/upload_images/5415899-fcb0f0ad7b8e1df9.jpg)\n<br/>\n适配android6.0 获取wifi 列表，连接wifi\n## 效果图\n![](https://github.com/GuoZhaoHui628/WifiListConnect/blob/master/QQ%E6%88%AA%E5%9B%BE20171127182222.png)\n![](https://github.com/GuoZhaoHui628/WifiListConnect/blob/master/device-2017-11-27-181017.gif)\n## 详情\n[csdn博客](http://blog.csdn.net/guozhaohui628/article/details/78644150)\n<br/>\n如果帮到你了给个star支持下，谢谢了\n"
  },
  {
    "path": "app/.gitignore",
    "content": "/build\n"
  },
  {
    "path": "app/build.gradle",
    "content": "apply plugin: 'com.android.application'\n\nandroid {\n    compileSdkVersion 26\n    buildToolsVersion \"26.0.2\"\n    defaultConfig {\n        applicationId \"guo.wifilistconnect\"\n        minSdkVersion 15\n        targetSdkVersion 26\n        versionCode 1\n        versionName \"1.0\"\n    }\n    buildTypes {\n        release {\n            minifyEnabled false\n            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'\n        }\n    }\n}\n\ndependencies {\n    compile fileTree(dir: 'libs', include: ['*.jar'])\n    compile 'com.android.support:appcompat-v7:26.+'\n    compile 'com.android.support:recyclerview-v7:24.1.1'\n\n}\n"
  },
  {
    "path": "app/proguard-rules.pro",
    "content": "# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in D:\\MyDownLoad\\as\\android\\sdk/tools/proguard/proguard-android.txt\n# You can edit the include path and order by changing the proguardFiles\n# directive in build.gradle.\n#\n# For more details, see\n#   http://developer.android.com/guide/developing/tools/proguard.html\n\n# Add any project specific keep options here:\n\n# If your project uses WebView with JS, uncomment the following\n# and specify the fully qualified class name to the JavaScript interface\n# class:\n#-keepclassmembers class fqcn.of.javascript.interface.for.webview {\n#   public *;\n#}\n\n# Uncomment this to preserve the line number information for\n# debugging stack traces.\n#-keepattributes SourceFile,LineNumberTable\n\n# If you keep the line number information, uncomment this to\n# hide the original source file name.\n#-renamesourcefileattribute SourceFile\n"
  },
  {
    "path": "app/src/androidTest/java/guo/wifilistconnect/ExampleInstrumentedTest.java",
    "content": "package guo.wifilistconnect;\n\nimport android.content.Context;\nimport android.support.test.InstrumentationRegistry;\nimport android.support.test.runner.AndroidJUnit4;\n\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\n\nimport static org.junit.Assert.*;\n\n/**\n * Instrumentation test, which will execute on an Android device.\n *\n * @see <a href=\"http://d.android.com/tools/testing\">Testing documentation</a>\n */\n@RunWith(AndroidJUnit4.class)\npublic class ExampleInstrumentedTest {\n    @Test\n    public void useAppContext() throws Exception {\n        // Context of the app under test.\n        Context appContext = InstrumentationRegistry.getTargetContext();\n\n        assertEquals(\"guo.wifilistconnect\", appContext.getPackageName());\n    }\n}\n"
  },
  {
    "path": "app/src/main/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"guo.wifilistconnect\">\n\n    <uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\" />\n    <uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\" />\n    <uses-permission android:name=\"android.permission.WRITE_SECURE_SETTINGS\" />\n    <uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>\n    <uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\" />\n\n    <application\n        android:allowBackup=\"true\"\n        android:icon=\"@mipmap/ic_launcher\"\n        android:label=\"@string/app_name\"\n        android:roundIcon=\"@mipmap/ic_launcher_round\"\n        android:supportsRtl=\"true\"\n        android:theme=\"@style/AppTheme\">\n        <activity android:name=\".MainActivity\">\n            <intent-filter>\n                <action android:name=\"android.intent.action.MAIN\" />\n\n                <category android:name=\"android.intent.category.LAUNCHER\" />\n            </intent-filter>\n        </activity>\n    </application>\n\n</manifest>"
  },
  {
    "path": "app/src/main/java/guo/wifilistconnect/MainActivity.java",
    "content": "package guo.wifilistconnect;\n\nimport android.Manifest;\nimport android.content.BroadcastReceiver;\nimport android.content.Context;\nimport android.content.Intent;\nimport android.content.IntentFilter;\nimport android.content.pm.PackageManager;\nimport android.net.NetworkInfo;\nimport android.net.wifi.ScanResult;\nimport android.net.wifi.WifiConfiguration;\nimport android.net.wifi.WifiInfo;\nimport android.net.wifi.WifiManager;\nimport android.support.annotation.NonNull;\nimport android.support.v4.app.ActivityCompat;\nimport android.support.v7.app.AppCompatActivity;\nimport android.os.Bundle;\nimport android.support.v7.widget.LinearLayoutManager;\nimport android.support.v7.widget.RecyclerView;\nimport android.util.Log;\nimport android.view.View;\nimport android.widget.ProgressBar;\nimport android.widget.Toast;\n\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.List;\n\nimport guo.wifilistconnect.adapter.WifiListAdapter;\nimport guo.wifilistconnect.app.AppContants;\nimport guo.wifilistconnect.bean.WifiBean;\nimport guo.wifilistconnect.dialog.WifiLinkDialog;\nimport guo.wifilistconnect.utils.CollectionUtils;\n\npublic class MainActivity extends AppCompatActivity {\n\n    private static final String TAG = \"MainActivity\";\n    //权限请求码\n    private static final int PERMISSION_REQUEST_CODE = 0;\n    //两个危险权限需要动态申请\n    private static final String[] NEEDED_PERMISSIONS = new String[]{\n            Manifest.permission.ACCESS_COARSE_LOCATION,\n            Manifest.permission.ACCESS_FINE_LOCATION\n    };\n\n    private boolean mHasPermission;\n\n    ProgressBar pbWifiLoading;\n\n    List<WifiBean> realWifiList = new ArrayList<>();\n\n    private WifiListAdapter adapter;\n\n    private RecyclerView recyWifiList;\n\n    private WifiBroadcastReceiver wifiReceiver;\n\n    private int connectType = 0;//1：连接成功？ 2 正在连接（如果wifi热点列表发生变需要该字段）\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_main);\n        pbWifiLoading = (ProgressBar) this.findViewById(R.id.pb_wifi_loading);\n\n        hidingProgressBar();\n        mHasPermission = checkPermission();\n        if (!mHasPermission && WifiSupport.isOpenWifi(MainActivity.this)) {  //未获取权限，申请权限\n            requestPermission();\n        }else if(mHasPermission && WifiSupport.isOpenWifi(MainActivity.this)){  //已经获取权限\n            initRecycler();\n        }else{\n            Toast.makeText(MainActivity.this,\"WIFI处于关闭状态\",Toast.LENGTH_SHORT).show();\n        }\n\n\n    }\n\n    private void initRecycler() {\n        recyWifiList = (RecyclerView) this.findViewById(R.id.recy_list_wifi);\n        adapter = new WifiListAdapter(this,realWifiList);\n        recyWifiList.setLayoutManager(new LinearLayoutManager(this));\n        recyWifiList.setAdapter(adapter);\n\n        if(WifiSupport.isOpenWifi(MainActivity.this) && mHasPermission){\n            sortScaResult();\n        }else{\n            Toast.makeText(MainActivity.this,\"WIFI处于关闭状态或权限获取失败22222\",Toast.LENGTH_SHORT).show();\n        }\n\n        adapter.setOnItemClickListener(new WifiListAdapter.onItemClickListener() {\n            @Override\n            public void onItemClick(View view, int postion, Object o) {\n                WifiBean wifiBean = realWifiList.get(postion);\n                if(wifiBean.getState().equals(AppContants.WIFI_STATE_UNCONNECT) || wifiBean.getState().equals(AppContants.WIFI_STATE_CONNECT)){\n                    String capabilities = realWifiList.get(postion).getCapabilities();\n                    if(WifiSupport.getWifiCipher(capabilities) == WifiSupport.WifiCipherType.WIFICIPHER_NOPASS){//无需密码\n                        WifiConfiguration tempConfig  = WifiSupport.isExsits(wifiBean.getWifiName(),MainActivity.this);\n                        if(tempConfig == null){\n                            WifiConfiguration exsits = WifiSupport.createWifiConfig(wifiBean.getWifiName(), null, WifiSupport.WifiCipherType.WIFICIPHER_NOPASS);\n                            WifiSupport.addNetWork(exsits, MainActivity.this);\n                        }else{\n                            WifiSupport.addNetWork(tempConfig, MainActivity.this);\n                        }\n                    }else{   //需要密码，弹出输入密码dialog\n                        noConfigurationWifi(postion);\n                    }\n                }\n            }\n        });\n    }\n\n\n    private void noConfigurationWifi(int position) {//之前没配置过该网络， 弹出输入密码界面\n        WifiLinkDialog linkDialog = new WifiLinkDialog(this,R.style.dialog_download,realWifiList.get(position).getWifiName(), realWifiList.get(position).getCapabilities());\n        if(!linkDialog.isShowing()){\n            linkDialog.show();\n        }\n    }\n\n    @Override\n    protected void onResume() {\n        super.onResume();\n        //注册广播\n        wifiReceiver = new WifiBroadcastReceiver();\n        IntentFilter filter = new IntentFilter();\n        filter.addAction(WifiManager.WIFI_STATE_CHANGED_ACTION);//监听wifi是开关变化的状态\n        filter.addAction(WifiManager.NETWORK_STATE_CHANGED_ACTION);//监听wifi连接状态广播,是否连接了一个有效路由\n        filter.addAction(WifiManager.SCAN_RESULTS_AVAILABLE_ACTION);//监听wifi列表变化（开启一个热点或者关闭一个热点）\n        this.registerReceiver(wifiReceiver, filter);\n    }\n\n    @Override\n    protected void onPause() {\n        super.onPause();\n        this.unregisterReceiver(wifiReceiver);\n    }\n\n    //监听wifi状态\n    public class WifiBroadcastReceiver extends BroadcastReceiver {\n        @Override\n        public void onReceive(Context context, Intent intent) {\n            if(WifiManager.WIFI_STATE_CHANGED_ACTION.equals(intent.getAction())){\n                int state = intent.getIntExtra(WifiManager.EXTRA_WIFI_STATE, 0);\n                switch (state){\n                    /**\n                     * WIFI_STATE_DISABLED    WLAN已经关闭\n                     * WIFI_STATE_DISABLING   WLAN正在关闭\n                     * WIFI_STATE_ENABLED     WLAN已经打开\n                     * WIFI_STATE_ENABLING    WLAN正在打开\n                     * WIFI_STATE_UNKNOWN     未知\n                     */\n                    case WifiManager.WIFI_STATE_DISABLED:{\n                        Log.d(TAG,\"已经关闭\");\n                        Toast.makeText(MainActivity.this,\"WIFI处于关闭状态\",Toast.LENGTH_SHORT).show();\n                        break;\n                    }\n                    case WifiManager.WIFI_STATE_DISABLING:{\n                        Log.d(TAG,\"正在关闭\");\n                        break;\n                    }\n                    case WifiManager.WIFI_STATE_ENABLED:{\n                        Log.d(TAG,\"已经打开\");\n                        sortScaResult();\n                        break;\n                    }\n                    case WifiManager.WIFI_STATE_ENABLING:{\n                        Log.d(TAG,\"正在打开\");\n                        break;\n                    }\n                    case WifiManager.WIFI_STATE_UNKNOWN:{\n                        Log.d(TAG,\"未知状态\");\n                        break;\n                    }\n                }\n            }else if(WifiManager.NETWORK_STATE_CHANGED_ACTION.equals(intent.getAction())){\n                NetworkInfo info = intent.getParcelableExtra(WifiManager.EXTRA_NETWORK_INFO);\n                Log.d(TAG, \"--NetworkInfo--\" + info.toString());\n                if(NetworkInfo.State.DISCONNECTED == info.getState()){//wifi没连接上\n                    Log.d(TAG,\"wifi没连接上\");\n                    hidingProgressBar();\n                    for(int i = 0;i < realWifiList.size();i++){//没连接上将 所有的连接状态都置为“未连接”\n                        realWifiList.get(i).setState(AppContants.WIFI_STATE_UNCONNECT);\n                    }\n                    adapter.notifyDataSetChanged();\n                }else if(NetworkInfo.State.CONNECTED == info.getState()){//wifi连接上了\n                    Log.d(TAG,\"wifi连接上了\");\n                    hidingProgressBar();\n                    WifiInfo connectedWifiInfo = WifiSupport.getConnectedWifiInfo(MainActivity.this);\n\n                    //连接成功 跳转界面 传递ip地址\n                    Toast.makeText(MainActivity.this,\"wifi连接上了\",Toast.LENGTH_SHORT).show();\n\n                    connectType = 1;\n                    wifiListSet(connectedWifiInfo.getSSID(),connectType);\n                }else if(NetworkInfo.State.CONNECTING == info.getState()){//正在连接\n                    Log.d(TAG,\"wifi正在连接\");\n                    showProgressBar();\n                    WifiInfo connectedWifiInfo = WifiSupport.getConnectedWifiInfo(MainActivity.this);\n                    connectType = 2;\n                    wifiListSet(connectedWifiInfo.getSSID(),connectType );\n                }\n            }else if(WifiManager.SCAN_RESULTS_AVAILABLE_ACTION.equals(intent.getAction())){\n                Log.d(TAG,\"网络列表变化了\");\n                wifiListChange();\n            }\n        }\n    }\n\n    /**\n     * //网络状态发生改变 调用此方法！\n     */\n    public void wifiListChange(){\n        sortScaResult();\n        WifiInfo connectedWifiInfo = WifiSupport.getConnectedWifiInfo(this);\n        if(connectedWifiInfo != null){\n            wifiListSet(connectedWifiInfo.getSSID(),connectType);\n        }\n    }\n\n    /**\n     * 将\"已连接\"或者\"正在连接\"的wifi热点放置在第一个位置\n     * @param wifiName\n     * @param type\n     */\n    public void wifiListSet(String wifiName , int type){\n        int index = -1;\n        WifiBean wifiInfo = new WifiBean();\n        if(CollectionUtils.isNullOrEmpty(realWifiList)){\n            return;\n        }\n        for(int i = 0;i < realWifiList.size();i++){\n            realWifiList.get(i).setState(AppContants.WIFI_STATE_UNCONNECT);\n        }\n        Collections.sort(realWifiList);//根据信号强度排序\n        for(int i = 0;i < realWifiList.size();i++){\n            WifiBean wifiBean = realWifiList.get(i);\n            if(index == -1 && (\"\\\"\" + wifiBean.getWifiName() + \"\\\"\").equals(wifiName)){\n                index = i;\n                wifiInfo.setLevel(wifiBean.getLevel());\n                wifiInfo.setWifiName(wifiBean.getWifiName());\n                wifiInfo.setCapabilities(wifiBean.getCapabilities());\n                if(type == 1){\n                    wifiInfo.setState(AppContants.WIFI_STATE_CONNECT);\n                }else{\n                    wifiInfo.setState(AppContants.WIFI_STATE_ON_CONNECTING);\n                }\n            }\n        }\n        if(index != -1){\n            realWifiList.remove(index);\n            realWifiList.add(0, wifiInfo);\n            adapter.notifyDataSetChanged();\n        }\n    }\n\n    /**\n     * 检查是否已经授予权限\n     * @return\n     */\n    private boolean checkPermission() {\n        for (String permission : NEEDED_PERMISSIONS) {\n            if (ActivityCompat.checkSelfPermission(this, permission)\n                    != PackageManager.PERMISSION_GRANTED) {\n                return false;\n            }\n        }\n        return true;\n    }\n\n    /**\n     * 申请权限\n     */\n    private void requestPermission() {\n        ActivityCompat.requestPermissions(this,\n                NEEDED_PERMISSIONS, PERMISSION_REQUEST_CODE);\n    }\n\n    /**\n     * 获取wifi列表然后将bean转成自己定义的WifiBean\n     */\n    public void sortScaResult(){\n        List<ScanResult> scanResults = WifiSupport.noSameName(WifiSupport.getWifiScanResult(this));\n        realWifiList.clear();\n        if(!CollectionUtils.isNullOrEmpty(scanResults)){\n            for(int i = 0;i < scanResults.size();i++){\n                WifiBean wifiBean = new WifiBean();\n                wifiBean.setWifiName(scanResults.get(i).SSID);\n                wifiBean.setState(AppContants.WIFI_STATE_UNCONNECT);   //只要获取都假设设置成未连接，真正的状态都通过广播来确定\n                wifiBean.setCapabilities(scanResults.get(i).capabilities);\n                wifiBean.setLevel(WifiSupport.getLevel(scanResults.get(i).level)+\"\");\n                realWifiList.add(wifiBean);\n\n                //排序\n                Collections.sort(realWifiList);\n                adapter.notifyDataSetChanged();\n            }\n        }\n    }\n\n    @Override\n    public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {\n        super.onRequestPermissionsResult(requestCode, permissions, grantResults);\n        boolean hasAllPermission = true;\n        if (requestCode == PERMISSION_REQUEST_CODE) {\n            for (int i : grantResults) {\n                if (i != PackageManager.PERMISSION_GRANTED) {\n                    hasAllPermission = false;   //判断用户是否同意获取权限\n                    break;\n                }\n            }\n\n            //如果同意权限\n            if (hasAllPermission) {\n                mHasPermission = true;\n                if(WifiSupport.isOpenWifi(MainActivity.this) && mHasPermission){  //如果wifi开关是开 并且 已经获取权限\n                    initRecycler();\n                }else{\n                    Toast.makeText(MainActivity.this,\"WIFI处于关闭状态或权限获取失败1111\",Toast.LENGTH_SHORT).show();\n                }\n\n            } else {  //用户不同意权限\n                mHasPermission = false;\n                Toast.makeText(MainActivity.this,\"获取权限失败\",Toast.LENGTH_SHORT).show();\n            }\n        }\n    }\n\n\n    public void showProgressBar() {\n        pbWifiLoading.setVisibility(View.VISIBLE);\n    }\n\n    public void hidingProgressBar() {\n        pbWifiLoading.setVisibility(View.GONE);\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/guo/wifilistconnect/WifiSupport.java",
    "content": "package guo.wifilistconnect;\n\nimport android.content.Context;\nimport android.net.wifi.ScanResult;\nimport android.net.wifi.WifiConfiguration;\nimport android.net.wifi.WifiInfo;\nimport android.net.wifi.WifiManager;\nimport android.text.TextUtils;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\nimport guo.wifilistconnect.bean.WifiBean;\n\n/**\n * Created by ${GuoZhaoHui} on 2017/11/27.\n * Email:guozhaohui628@gmail.com\n */\n\npublic class WifiSupport {\n\n    private static final String TAG = \"WifiSupport\";\n\n    public enum WifiCipherType {\n        WIFICIPHER_WEP, WIFICIPHER_WPA, WIFICIPHER_NOPASS, WIFICIPHER_INVALID\n    }\n\n    public WifiSupport() {\n    }\n\n    public static List<ScanResult> getWifiScanResult(Context context) {\n        boolean b = context == null;\n        return ((WifiManager) context.getSystemService(Context.WIFI_SERVICE)).getScanResults();\n    }\n\n    public static boolean isWifiEnable(Context context) {\n        return ((WifiManager) context.getSystemService(Context.WIFI_SERVICE)).isWifiEnabled();\n    }\n\n    public static WifiInfo getConnectedWifiInfo(Context context) {\n        return ((WifiManager) context.getSystemService(Context.WIFI_SERVICE)).getConnectionInfo();\n    }\n\n    public static List getConfigurations(Context context) {\n        return ((WifiManager) context.getSystemService(Context.WIFI_SERVICE)).getConfiguredNetworks();\n    }\n\n\n    public static WifiConfiguration createWifiConfig(String SSID, String password, WifiCipherType type) {\n\n        WifiConfiguration config = new WifiConfiguration();\n        config.allowedAuthAlgorithms.clear();\n        config.allowedGroupCiphers.clear();\n        config.allowedKeyManagement.clear();\n        config.allowedPairwiseCiphers.clear();\n        config.allowedProtocols.clear();\n        config.SSID = \"\\\"\" + SSID + \"\\\"\";\n\n        if (type == WifiCipherType.WIFICIPHER_NOPASS) {\n//            config.wepKeys[0] = \"\";  //注意这里\n            config.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE);\n//            config.wepTxKeyIndex = 0;\n        }\n\n        if (type == WifiCipherType.WIFICIPHER_WEP) {\n            config.preSharedKey = \"\\\"\" + password + \"\\\"\";\n            config.hiddenSSID = true;\n            config.allowedAuthAlgorithms.set(WifiConfiguration.AuthAlgorithm.OPEN);\n            config.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.CCMP);\n            config.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.TKIP);\n            config.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.WEP40);\n            config.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.WEP104);\n            config.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.NONE);\n            config.wepTxKeyIndex = 0;\n        }\n\n        if (type == WifiCipherType.WIFICIPHER_WPA) {\n            config.preSharedKey = \"\\\"\" + password + \"\\\"\";\n            config.hiddenSSID = true;\n            config.allowedAuthAlgorithms.set(WifiConfiguration.AuthAlgorithm.OPEN);\n            config.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.TKIP);\n            config.allowedGroupCiphers.set(WifiConfiguration.GroupCipher.CCMP);\n            config.allowedKeyManagement.set(WifiConfiguration.KeyMgmt.WPA_PSK);\n            config.allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.TKIP);\n            config.allowedPairwiseCiphers.set(WifiConfiguration.PairwiseCipher.CCMP);\n            config.status = WifiConfiguration.Status.ENABLED;\n\n        }\n\n        return config;\n\n    }\n\n    /**\n     * 接入某个wifi热点\n     */\n    public static boolean addNetWork(WifiConfiguration config, Context context) {\n\n        WifiManager wifimanager = (WifiManager)context.getSystemService(Context.WIFI_SERVICE);\n\n        WifiInfo wifiinfo = wifimanager.getConnectionInfo();\n\n        if (null != wifiinfo) {\n            wifimanager.disableNetwork(wifiinfo.getNetworkId());\n        }\n\n        boolean result = false;\n\n        if (config.networkId > 0) {\n            result = wifimanager.enableNetwork(config.networkId, true);\n            wifimanager.updateNetwork(config);\n        } else {\n\n            int i = wifimanager.addNetwork(config);\n            result = false;\n\n            if (i > 0) {\n\n                wifimanager.saveConfiguration();\n                return wifimanager.enableNetwork(i, true);\n            }\n        }\n\n        return result;\n\n    }\n\n    /**\n     * 判断wifi热点支持的加密方式\n     */\n    public static WifiCipherType getWifiCipher(String s) {\n\n        if (s.isEmpty()) {\n            return WifiCipherType.WIFICIPHER_INVALID;\n        } else if (s.contains(\"WEP\")) {\n            return WifiCipherType.WIFICIPHER_WEP;\n        } else if (s.contains(\"WPA\") || s.contains(\"WPA2\") || s.contains(\"WPS\")) {\n            return WifiCipherType.WIFICIPHER_WPA;\n        } else {\n            return WifiCipherType.WIFICIPHER_NOPASS;\n        }\n    }\n\n    //查看以前是否也配置过这个网络\n    public static WifiConfiguration isExsits(String SSID, Context context) {\n        WifiManager wifimanager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);\n        List<WifiConfiguration> existingConfigs = wifimanager.getConfiguredNetworks();\n        for (WifiConfiguration existingConfig : existingConfigs) {\n            if (existingConfig.SSID.equals(\"\\\"\" + SSID + \"\\\"\")) {\n                return existingConfig;\n            }\n        }\n        return null;\n    }\n\n    // 打开WIFI\n    public static void openWifi(Context context) {\n        WifiManager wifimanager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);\n        if (!wifimanager.isWifiEnabled()) {\n            wifimanager.setWifiEnabled(true);\n        }\n    }\n\n    // 关闭WIFI\n    public static void closeWifi(Context context) {\n        WifiManager wifimanager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);\n        if (wifimanager.isWifiEnabled()) {\n            wifimanager.setWifiEnabled(false);\n        }\n    }\n\n    public static boolean isOpenWifi(Context context){\n        WifiManager wifimanager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);\n        boolean b = wifimanager.isWifiEnabled();\n        return b;\n    }\n\n    /**\n     * 将idAddress转化成string类型的Id字符串\n     *\n     * @param idString\n     * @return\n     */\n    public static String getStringId(int idString) {\n        StringBuffer sb = new StringBuffer();\n        int b = (idString >> 0) & 0xff;\n        sb.append(b + \".\");\n        b = (idString >> 8) & 0xff;\n        sb.append(b + \".\");\n        b = (idString >> 16) & 0xff;\n        sb.append(b + \".\");\n        b = (idString >> 24) & 0xff;\n        sb.append(b);\n        return sb.toString();\n    }\n\n    /**\n     * 设置安全性\n     *\n     * @param capabilities\n     * @return\n     */\n    public static String getCapabilitiesString(String capabilities) {\n        if (capabilities.contains(\"WEP\")) {\n            return \"WEP\";\n        } else if (capabilities.contains(\"WPA\") || capabilities.contains(\"WPA2\") || capabilities.contains(\"WPS\")) {\n            return \"WPA/WPA2\";\n        } else {\n            return \"OPEN\";\n        }\n    }\n\n    public static boolean getIsWifiEnabled(Context context) {\n        WifiManager wifimanager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);\n        return wifimanager.isWifiEnabled();\n    }\n\n    public static void getReplace(Context context, List<WifiBean> list) {\n        WifiInfo wifi = WifiSupport.getConnectedWifiInfo(context);\n        List<WifiBean> listCopy = new ArrayList<>();\n        listCopy.addAll(list);\n        for (int i = 0; i < list.size(); i++) {\n            if ((\"\\\"\" + list.get(i).getWifiName() + \"\\\"\").equals(wifi.getSSID())) {\n                listCopy.add(0, list.get(i));\n                listCopy.remove(i + 1);\n                listCopy.get(0).setState(\"已连接\");\n            }\n        }\n        list.clear();\n        list.addAll(listCopy);\n    }\n    /**\n     * 去除同名WIFI\n     *\n     * @param oldSr 需要去除同名的列表\n     * @return 返回不包含同命的列表\n     */\n    public static List<ScanResult> noSameName(List<ScanResult> oldSr)\n    {\n        List<ScanResult> newSr = new ArrayList<ScanResult>();\n        for (ScanResult result : oldSr)\n        {\n            if (!TextUtils.isEmpty(result.SSID) && !containName(newSr, result.SSID))\n                newSr.add(result);\n        }\n        return newSr;\n    }\n    /**\n     * 判断一个扫描结果中，是否包含了某个名称的WIFI\n     * @param sr 扫描结果\n     * @param name 要查询的名称\n     * @return 返回true表示包含了该名称的WIFI，返回false表示不包含\n     */\n    public static boolean containName(List<ScanResult> sr, String name)\n    {\n        for (ScanResult result : sr)\n        {\n            if (!TextUtils.isEmpty(result.SSID) && result.SSID.equals(name))\n                return true;\n        }\n        return false;\n    }\n\n    /**\n     * 返回level 等级\n     */\n    public static int getLevel(int level){\n        if (Math.abs(level) < 50) {\n            return 1;\n        } else if (Math.abs(level) < 75) {\n            return 2;\n        } else if (Math.abs(level) < 90) {\n            return 3;\n        } else {\n            return 4;\n        }\n    }\n\n}\n"
  },
  {
    "path": "app/src/main/java/guo/wifilistconnect/adapter/WifiListAdapter.java",
    "content": "package guo.wifilistconnect.adapter;\n\nimport android.content.Context;\nimport android.support.v7.widget.RecyclerView;\nimport android.view.LayoutInflater;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.widget.TextView;\n\nimport java.util.List;\n\nimport guo.wifilistconnect.R;\nimport guo.wifilistconnect.app.AppContants;\nimport guo.wifilistconnect.bean.WifiBean;\n\n\n/**\n * Created by ${GuoZhaoHui} on 2017/11/7.\n * Email:guozhaohui628@gmail.com\n */\n\npublic class WifiListAdapter extends RecyclerView.Adapter<WifiListAdapter.MyViewHolder> {\n\n    private Context mContext;\n    private List<WifiBean> resultList;\n    private onItemClickListener onItemClickListener;\n\n    public void setOnItemClickListener(WifiListAdapter.onItemClickListener onItemClickListener) {\n        this.onItemClickListener = onItemClickListener;\n    }\n\n    public WifiListAdapter(Context mContext, List<WifiBean> resultList) {\n        this.mContext = mContext;\n        this.resultList = resultList;\n    }\n\n\n    @Override\n    public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {\n        View view = LayoutInflater.from(mContext).inflate(R.layout.item_wifi_list, parent, false);\n        MyViewHolder vh = new MyViewHolder(view);\n        return vh;\n    }\n\n    @Override\n    public void onBindViewHolder(MyViewHolder holder, final int position) {\n        final WifiBean bean = resultList.get(position);\n        holder.tvItemWifiName.setText(bean.getWifiName());\n        holder.tvItemWifiStatus.setText(\"(\"+bean.getState()+\")\");\n\n        //可以传递给adapter的数据都是经过处理的，已连接或者正在连接状态的wifi都是处于集合中的首位，所以可以写出如下判断\n        if(position == 0  && (AppContants.WIFI_STATE_ON_CONNECTING.equals(bean.getState()) || AppContants.WIFI_STATE_CONNECT.equals(bean.getState()))){\n            holder.tvItemWifiName.setTextColor(mContext.getResources().getColor(R.color.homecolor1));\n            holder.tvItemWifiStatus.setTextColor(mContext.getResources().getColor(R.color.homecolor1));\n        }else{\n            holder.tvItemWifiName.setTextColor(mContext.getResources().getColor(R.color.gray_home));\n            holder.tvItemWifiStatus.setTextColor(mContext.getResources().getColor(R.color.gray_home));\n        }\n\n        holder.itemview.setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View view) {\n                onItemClickListener.onItemClick(view,position,bean);\n            }\n        });\n    }\n\n    public void replaceAll(List<WifiBean> datas) {\n        if (resultList.size() > 0) {\n            resultList.clear();\n        }\n        resultList.addAll(datas);\n        notifyDataSetChanged();\n    }\n\n    @Override\n    public int getItemCount() {\n        return resultList.size();\n    }\n\n\n    static class MyViewHolder extends RecyclerView.ViewHolder{\n\n        View itemview;\n        TextView tvItemWifiName, tvItemWifiStatus;\n\n        public MyViewHolder(View itemView) {\n            super(itemView);\n            itemview = itemView;\n            tvItemWifiName = (TextView) itemView.findViewById(R.id.tv_item_wifi_name);\n            tvItemWifiStatus = (TextView) itemView.findViewById(R.id.tv_item_wifi_status);\n        }\n\n    }\n\n    public interface onItemClickListener{\n        void onItemClick(View view, int postion, Object o);\n    }\n\n}\n"
  },
  {
    "path": "app/src/main/java/guo/wifilistconnect/app/AppContants.java",
    "content": "package guo.wifilistconnect.app;\n\n/**\n * Created by ${GuoZhaoHui} on 2017/11/27.\n * Email:guozhaohui628@gmail.com\n */\n\npublic class AppContants {\n\n    public static final String WIFI_STATE_CONNECT = \"已连接\";\n    public static final String WIFI_STATE_ON_CONNECTING = \"正在连接\";\n    public static final String WIFI_STATE_UNCONNECT = \"未连接\";\n\n\n}\n"
  },
  {
    "path": "app/src/main/java/guo/wifilistconnect/bean/WifiBean.java",
    "content": "package guo.wifilistconnect.bean;\n\n/**\n * Created by John on 2017/4/7.\n */\n\npublic class WifiBean implements Comparable<WifiBean> {\n    private String wifiName;\n    private String level;\n    private String state;  //已连接  正在连接  未连接 三种状态\n    private String capabilities;//加密方式\n\n    @Override\n    public String toString() {\n        return \"WifiBean{\" +\n                \"wifiName='\" + wifiName + '\\'' +\n                \", level='\" + level + '\\'' +\n                \", state='\" + state + '\\'' +\n                \", capabilities='\" + capabilities + '\\'' +\n                '}';\n    }\n\n    public String getCapabilities() {\n        return capabilities;\n    }\n\n    public void setCapabilities(String capabilities) {\n        this.capabilities = capabilities;\n    }\n\n    public String getWifiName() {\n        return wifiName;\n    }\n\n    public void setWifiName(String wifiName) {\n        this.wifiName = wifiName;\n    }\n\n    public String getLevel() {\n        return level;\n    }\n\n    public void setLevel(String level) {\n        this.level = level;\n    }\n\n    public String getState() {\n        return state;\n    }\n\n    public void setState(String state) {\n        this.state = state;\n    }\n\n    @Override\n    public int compareTo(WifiBean o) {\n        int level1 = Integer.parseInt(this.getLevel());\n        int level2 = Integer.parseInt(o.getLevel());\n        return level1 - level2;\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/guo/wifilistconnect/dialog/WifiLinkDialog.java",
    "content": "package guo.wifilistconnect.dialog;\n\nimport android.app.Dialog;\nimport android.content.Context;\nimport android.net.wifi.WifiConfiguration;\nimport android.os.Bundle;\nimport android.support.annotation.NonNull;\nimport android.support.annotation.StyleRes;\nimport android.text.Editable;\nimport android.text.TextWatcher;\nimport android.view.LayoutInflater;\nimport android.view.View;\nimport android.widget.Button;\nimport android.widget.EditText;\nimport android.widget.TextView;\n\nimport guo.wifilistconnect.MainActivity;\nimport guo.wifilistconnect.R;\nimport guo.wifilistconnect.WifiSupport;\n\n\n/**\n * Created by John on 2017/4/7.\n */\n\npublic class WifiLinkDialog extends Dialog implements View.OnClickListener{\n\n\n    private TextView text_name;\n\n    private EditText password_edit;\n\n    private Button cancel_button;\n\n    private Button cofirm_button;\n\n    private String text_nameString = null;\n\n    private String capabilities;\n\n    private Context mContext;\n\n\n    public WifiLinkDialog(@NonNull Context context, @StyleRes int themeResId, String text_nameString, String capabilities) {\n        super(context, themeResId);\n        this.text_nameString = text_nameString;\n        this.capabilities = capabilities;\n\n        mContext = context;\n\n    }\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        View view = LayoutInflater.from(mContext).inflate(R.layout.setting_wifi_link_dialog, null);\n        setContentView(view);\n        initView(view);\n        text_name.setText(text_nameString);\n        initListener();\n    }\n\n\n\n    private void initListener() {\n        cancel_button.setOnClickListener(this);\n        cofirm_button.setOnClickListener(this);\n        password_edit.addTextChangedListener(new TextWatcher() {\n            @Override\n            public void beforeTextChanged(CharSequence s, int start, int count, int after) {\n\n            }\n\n            @Override\n            public void onTextChanged(CharSequence s, int start, int before, int count) {\n\n            }\n\n            @Override\n            public void afterTextChanged(Editable s) {\n                if((capabilities.contains(\"WPA\") || capabilities.contains(\"WPA2\") || capabilities.contains(\"WPS\"))){\n                    if(password_edit.getText() == null && password_edit.getText().toString().length() < 8){\n                        cofirm_button.setClickable(false);\n                    }else{\n                        cofirm_button.setClickable(true);\n                    }\n                }else if(capabilities.contains(\"WEP\")){\n                    if(password_edit.getText() == null && password_edit.getText().toString().length() < 8){\n                        cofirm_button.setClickable(false);\n                    }else{\n                        cofirm_button.setClickable(true);\n                    }\n                }\n            }\n        });\n    }\n\n    private void initView(View view) {\n        text_name = (TextView) view.findViewById(R.id.wifi_title);\n        password_edit = (EditText) view.findViewById(R.id.password_edit);\n        cancel_button = (Button) view.findViewById(R.id.cancel_button);\n        cofirm_button = (Button)view.findViewById(R.id.cofirm_button);\n    }\n\n    @Override\n    public void onClick(View v) {\n        switch (v.getId()){\n            case R.id.cofirm_button:{\n                WifiConfiguration tempConfig  = WifiSupport.isExsits(text_nameString,getContext());\n                if(tempConfig == null){\n                    WifiConfiguration wifiConfiguration =  WifiSupport.createWifiConfig(text_nameString,password_edit.getText().toString(),WifiSupport.getWifiCipher(capabilities));\n                    WifiSupport.addNetWork(wifiConfiguration,getContext());\n                }else{\n                    WifiSupport.addNetWork(tempConfig,getContext());\n                }\n                dismiss();\n                break;\n            }\n            case R.id.cancel_button:{\n                dismiss();\n                break;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/guo/wifilistconnect/utils/CollectionUtils.java",
    "content": "package guo.wifilistconnect.utils;\n\nimport java.util.Collection;\n\n/**\n * 集合操作工具类\n */\npublic class CollectionUtils {\n\n    /**\n     * 判断集合是否为null或者0个元素\n     *\n     * @param c\n     * @return\n     */\n    public static boolean isNullOrEmpty(Collection c) {\n        if (null == c || c.isEmpty()) {\n            return true;\n        }\n        return false;\n    }\n}\n"
  },
  {
    "path": "app/src/main/res/layout/activity_main.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:orientation=\"vertical\"\n   >\n\n    <RelativeLayout\n        android:background=\"@color/gray1\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\">\n\n        <TextView\n            android:textColor=\"@color/gray_home\"\n            android:layout_marginTop=\"9dp\"\n            android:layout_marginBottom=\"9dp\"\n            android:layout_alignParentLeft=\"true\"\n            android:layout_centerVertical=\"true\"\n            android:layout_marginLeft=\"12dp\"\n            android:text=\"WiFi列表\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\" />\n\n        <ProgressBar\n            android:id=\"@+id/pb_wifi_loading\"\n            android:layout_marginRight=\"12dp\"\n            style=\"@android:style/Widget.ProgressBar.Small\"\n            android:layout_centerVertical=\"true\"\n            android:layout_alignParentRight=\"true\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\" />\n\n    </RelativeLayout>\n\n    <android.support.v7.widget.RecyclerView\n        android:id=\"@+id/recy_list_wifi\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\">\n\n    </android.support.v7.widget.RecyclerView>\n\n\n\n</LinearLayout>\n"
  },
  {
    "path": "app/src/main/res/layout/item_wifi_list.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<RelativeLayout\n    xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:background=\"@color/white\"\n    android:gravity=\"center_vertical\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"wrap_content\">\n\n\n   <TextView\n       android:layout_centerVertical=\"true\"\n       android:id=\"@+id/tv_item_wifi_name\"\n       android:layout_marginLeft=\"12dp\"\n       android:textSize=\"14sp\"\n       android:layout_width=\"wrap_content\"\n       android:layout_height=\"wrap_content\" />\n\n   <TextView\n       android:id=\"@+id/tv_item_wifi_status\"\n       android:textSize=\"12sp\"\n       android:layout_centerVertical=\"true\"\n       android:layout_toRightOf=\"@+id/tv_item_wifi_name\"\n       android:layout_width=\"wrap_content\"\n       android:layout_height=\"wrap_content\" />\n\n\n   <ImageView\n       android:layout_marginTop=\"8dp\"\n       android:layout_marginBottom=\"8dp\"\n       android:src=\"@mipmap/icon_wifi_right\"\n       android:layout_marginRight=\"12dp\"\n       android:layout_centerVertical=\"true\"\n       android:layout_alignParentRight=\"true\"\n       android:layout_width=\"22dp\"\n       android:layout_height=\"22dp\" />\n\n</RelativeLayout>"
  },
  {
    "path": "app/src/main/res/layout/setting_wifi_link_dialog.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:orientation=\"vertical\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"wrap_content\"\n  >\n\n    <LinearLayout\n        android:layout_gravity=\"center\"\n        android:background=\"@color/white\"\n        android:orientation=\"vertical\"\n\n        android:layout_width=\"300dp\"\n        android:layout_height=\"wrap_content\">\n\n\n   <TextView\n       android:id=\"@+id/wifi_title\"\n       android:layout_marginTop=\"15dp\"\n       android:layout_marginLeft=\"15dp\"\n       android:layout_marginBottom=\"15dp\"\n       android:textColor=\"@color/homecolor1\"\n       android:textSize=\"14sp\"\n       android:layout_width=\"wrap_content\"\n       android:layout_height=\"wrap_content\" />\n\n    <View\n        android:background=\"@color/color_red\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"3dp\" />\n\n    <EditText\n        android:id=\"@+id/password_edit\"\n        android:textColor=\"@color/black_home\"\n        android:lines=\"1\"\n        android:textSize=\"12sp\"\n        android:hint=\"请输入WIFI密码\"\n        android:background=\"@null\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"36dp\" />\n\n\n    <View\n        android:background=\"@color/homecolor1\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"0.2dp\" />\n\n    <LinearLayout\n        android:orientation=\"horizontal\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"36dp\">\n\n        <Button\n            android:id=\"@+id/cancel_button\"\n            android:gravity=\"center\"\n            android:textSize=\"14sp\"\n            android:text=\"取消\"\n            style=\"?android:attr/borderlessButtonStyle\"\n            android:layout_weight=\"1\"\n            android:layout_width=\"0dp\"\n            android:layout_height=\"match_parent\" />\n\n        <Button\n            android:id=\"@+id/cofirm_button\"\n            android:gravity=\"center\"\n            android:textSize=\"14sp\"\n            android:text=\"确定\"\n            style=\"?android:attr/borderlessButtonStyle\"\n            android:layout_weight=\"1\"\n            android:layout_width=\"0dp\"\n            android:layout_height=\"match_parent\" />\n\n    </LinearLayout>\n    </LinearLayout>\n</LinearLayout>"
  },
  {
    "path": "app/src/main/res/values/colors.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <color name=\"colorPrimary\">#3F51B5</color>\n    <color name=\"colorPrimaryDark\">#303F9F</color>\n    <color name=\"colorAccent\">#FF4081</color>\n    <color name=\"gray1\">#F8F8F8</color>\n    <color name=\"gray_home\">#909090</color>\n    <color name=\"white\">#FFFFFFFF</color>\n    <color name=\"homecolor1\">#1a5cc0 </color>\n    <color name=\"color_red\">#FF5722</color>\n    <color name=\"black_home\">#484848</color>\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values/strings.xml",
    "content": "<resources>\n    <string name=\"app_name\">WifiListConnect</string>\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values/styles.xml",
    "content": "<resources>\n\n    <!-- Base application theme. -->\n    <style name=\"AppTheme\" parent=\"Theme.AppCompat.Light.DarkActionBar\">\n        <!-- Customize your theme here. -->\n        <item name=\"colorPrimary\">@color/colorPrimary</item>\n        <item name=\"colorPrimaryDark\">@color/colorPrimaryDark</item>\n        <item name=\"colorAccent\">@color/colorAccent</item>\n    </style>\n\n    <style name=\"dialog_download\" parent=\"android:Theme.Dialog\">\n        <item name=\"android:windowFrame\">@null</item>\n        <item name=\"android:windowIsFloating\">true</item>\n        <item name=\"android:windowContentOverlay\">@null</item>\n        <item name=\"android:windowIsTranslucent\">false</item>\n        <item name=\"android:windowAnimationStyle\">@android:style/Animation.Dialog</item>\n        <item name=\"android:windowSoftInputMode\">stateUnspecified|adjustPan</item>\n        <item name=\"android:windowBackground\">@android:color/transparent</item>\n        <item name=\"android:windowNoTitle\">true</item>\n        <item name=\"android:backgroundDimEnabled\">true</item>\n    </style>\n\n</resources>\n"
  },
  {
    "path": "app/src/test/java/guo/wifilistconnect/ExampleUnitTest.java",
    "content": "package guo.wifilistconnect;\n\nimport org.junit.Test;\n\nimport static org.junit.Assert.*;\n\n/**\n * Example local unit test, which will execute on the development machine (host).\n *\n * @see <a href=\"http://d.android.com/tools/testing\">Testing documentation</a>\n */\npublic class ExampleUnitTest {\n    @Test\n    public void addition_isCorrect() throws Exception {\n        assertEquals(4, 2 + 2);\n    }\n}"
  },
  {
    "path": "build.gradle",
    "content": "// Top-level build file where you can add configuration options common to all sub-projects/modules.\n\nbuildscript {\n    repositories {\n        jcenter()\n    }\n    dependencies {\n        classpath 'com.android.tools.build:gradle:2.3.3'\n\n        // NOTE: Do not place your application dependencies here; they belong\n        // in the individual module build.gradle files\n    }\n}\n\nallprojects {\n    repositories {\n        jcenter()\n    }\n}\n\ntask clean(type: Delete) {\n    delete rootProject.buildDir\n}\n"
  },
  {
    "path": "gradle/wrapper/gradle-wrapper.properties",
    "content": "#Mon Nov 27 11:24:26 CST 2017\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-3.3-all.zip\n"
  },
  {
    "path": "gradle.properties",
    "content": "# Project-wide Gradle settings.\n\n# IDE (e.g. Android Studio) users:\n# Gradle settings configured through the IDE *will override*\n# any settings specified in this file.\n\n# For more details on how to configure your build environment visit\n# http://www.gradle.org/docs/current/userguide/build_environment.html\n\n# Specifies the JVM arguments used for the daemon process.\n# The setting is particularly useful for tweaking memory settings.\norg.gradle.jvmargs=-Xmx1536m\n\n# When configured, Gradle will run in incubating parallel mode.\n# This option should only be used with decoupled projects. More details, visit\n# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects\n# org.gradle.parallel=true\n"
  },
  {
    "path": "gradlew",
    "content": "#!/usr/bin/env bash\n\n##############################################################################\n##\n##  Gradle start up script for UN*X\n##\n##############################################################################\n\n# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nDEFAULT_JVM_OPTS=\"\"\n\nAPP_NAME=\"Gradle\"\nAPP_BASE_NAME=`basename \"$0\"`\n\n# Use the maximum available, or set MAX_FD != -1 to use that value.\nMAX_FD=\"maximum\"\n\nwarn ( ) {\n    echo \"$*\"\n}\n\ndie ( ) {\n    echo\n    echo \"$*\"\n    echo\n    exit 1\n}\n\n# OS specific support (must be 'true' or 'false').\ncygwin=false\nmsys=false\ndarwin=false\ncase \"`uname`\" in\n  CYGWIN* )\n    cygwin=true\n    ;;\n  Darwin* )\n    darwin=true\n    ;;\n  MINGW* )\n    msys=true\n    ;;\nesac\n\n# Attempt to set APP_HOME\n# Resolve links: $0 may be a link\nPRG=\"$0\"\n# Need this for relative symlinks.\nwhile [ -h \"$PRG\" ] ; do\n    ls=`ls -ld \"$PRG\"`\n    link=`expr \"$ls\" : '.*-> \\(.*\\)$'`\n    if expr \"$link\" : '/.*' > /dev/null; then\n        PRG=\"$link\"\n    else\n        PRG=`dirname \"$PRG\"`\"/$link\"\n    fi\ndone\nSAVED=\"`pwd`\"\ncd \"`dirname \\\"$PRG\\\"`/\" >/dev/null\nAPP_HOME=\"`pwd -P`\"\ncd \"$SAVED\" >/dev/null\n\nCLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar\n\n# Determine the Java command to use to start the JVM.\nif [ -n \"$JAVA_HOME\" ] ; then\n    if [ -x \"$JAVA_HOME/jre/sh/java\" ] ; then\n        # IBM's JDK on AIX uses strange locations for the executables\n        JAVACMD=\"$JAVA_HOME/jre/sh/java\"\n    else\n        JAVACMD=\"$JAVA_HOME/bin/java\"\n    fi\n    if [ ! -x \"$JAVACMD\" ] ; then\n        die \"ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n    fi\nelse\n    JAVACMD=\"java\"\n    which java >/dev/null 2>&1 || die \"ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\nfi\n\n# Increase the maximum file descriptors if we can.\nif [ \"$cygwin\" = \"false\" -a \"$darwin\" = \"false\" ] ; then\n    MAX_FD_LIMIT=`ulimit -H -n`\n    if [ $? -eq 0 ] ; then\n        if [ \"$MAX_FD\" = \"maximum\" -o \"$MAX_FD\" = \"max\" ] ; then\n            MAX_FD=\"$MAX_FD_LIMIT\"\n        fi\n        ulimit -n $MAX_FD\n        if [ $? -ne 0 ] ; then\n            warn \"Could not set maximum file descriptor limit: $MAX_FD\"\n        fi\n    else\n        warn \"Could not query maximum file descriptor limit: $MAX_FD_LIMIT\"\n    fi\nfi\n\n# For Darwin, add options to specify how the application appears in the dock\nif $darwin; then\n    GRADLE_OPTS=\"$GRADLE_OPTS \\\"-Xdock:name=$APP_NAME\\\" \\\"-Xdock:icon=$APP_HOME/media/gradle.icns\\\"\"\nfi\n\n# For Cygwin, switch paths to Windows format before running java\nif $cygwin ; then\n    APP_HOME=`cygpath --path --mixed \"$APP_HOME\"`\n    CLASSPATH=`cygpath --path --mixed \"$CLASSPATH\"`\n    JAVACMD=`cygpath --unix \"$JAVACMD\"`\n\n    # We build the pattern for arguments to be converted via cygpath\n    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`\n    SEP=\"\"\n    for dir in $ROOTDIRSRAW ; do\n        ROOTDIRS=\"$ROOTDIRS$SEP$dir\"\n        SEP=\"|\"\n    done\n    OURCYGPATTERN=\"(^($ROOTDIRS))\"\n    # Add a user-defined pattern to the cygpath arguments\n    if [ \"$GRADLE_CYGPATTERN\" != \"\" ] ; then\n        OURCYGPATTERN=\"$OURCYGPATTERN|($GRADLE_CYGPATTERN)\"\n    fi\n    # Now convert the arguments - kludge to limit ourselves to /bin/sh\n    i=0\n    for arg in \"$@\" ; do\n        CHECK=`echo \"$arg\"|egrep -c \"$OURCYGPATTERN\" -`\n        CHECK2=`echo \"$arg\"|egrep -c \"^-\"`                                 ### Determine if an option\n\n        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition\n            eval `echo args$i`=`cygpath --path --ignore --mixed \"$arg\"`\n        else\n            eval `echo args$i`=\"\\\"$arg\\\"\"\n        fi\n        i=$((i+1))\n    done\n    case $i in\n        (0) set -- ;;\n        (1) set -- \"$args0\" ;;\n        (2) set -- \"$args0\" \"$args1\" ;;\n        (3) set -- \"$args0\" \"$args1\" \"$args2\" ;;\n        (4) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" ;;\n        (5) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" ;;\n        (6) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" ;;\n        (7) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" ;;\n        (8) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" ;;\n        (9) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" \"$args8\" ;;\n    esac\nfi\n\n# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules\nfunction splitJvmOpts() {\n    JVM_OPTS=(\"$@\")\n}\neval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS\nJVM_OPTS[${#JVM_OPTS[*]}]=\"-Dorg.gradle.appname=$APP_BASE_NAME\"\n\nexec \"$JAVACMD\" \"${JVM_OPTS[@]}\" -classpath \"$CLASSPATH\" org.gradle.wrapper.GradleWrapperMain \"$@\"\n"
  },
  {
    "path": "gradlew.bat",
    "content": "@if \"%DEBUG%\" == \"\" @echo off\n@rem ##########################################################################\n@rem\n@rem  Gradle startup script for Windows\n@rem\n@rem ##########################################################################\n\n@rem Set local scope for the variables with windows NT shell\nif \"%OS%\"==\"Windows_NT\" setlocal\n\n@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nset DEFAULT_JVM_OPTS=\n\nset DIRNAME=%~dp0\nif \"%DIRNAME%\" == \"\" set DIRNAME=.\nset APP_BASE_NAME=%~n0\nset APP_HOME=%DIRNAME%\n\n@rem Find java.exe\nif defined JAVA_HOME goto findJavaFromJavaHome\n\nset JAVA_EXE=java.exe\n%JAVA_EXE% -version >NUL 2>&1\nif \"%ERRORLEVEL%\" == \"0\" goto init\n\necho.\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\necho.\necho Please set the JAVA_HOME variable in your environment to match the\necho location of your Java installation.\n\ngoto fail\n\n:findJavaFromJavaHome\nset JAVA_HOME=%JAVA_HOME:\"=%\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\n\nif exist \"%JAVA_EXE%\" goto init\n\necho.\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%\necho.\necho Please set the JAVA_HOME variable in your environment to match the\necho location of your Java installation.\n\ngoto fail\n\n:init\n@rem Get command-line arguments, handling Windowz variants\n\nif not \"%OS%\" == \"Windows_NT\" goto win9xME_args\nif \"%@eval[2+2]\" == \"4\" goto 4NT_args\n\n:win9xME_args\n@rem Slurp the command line arguments.\nset CMD_LINE_ARGS=\nset _SKIP=2\n\n:win9xME_args_slurp\nif \"x%~1\" == \"x\" goto execute\n\nset CMD_LINE_ARGS=%*\ngoto execute\n\n:4NT_args\n@rem Get arguments from the 4NT Shell from JP Software\nset CMD_LINE_ARGS=%$\n\n:execute\n@rem Setup the command line\n\nset CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\n\n@rem Execute Gradle\n\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% \"-Dorg.gradle.appname=%APP_BASE_NAME%\" -classpath \"%CLASSPATH%\" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%\n\n:end\n@rem End local scope for the variables with windows NT shell\nif \"%ERRORLEVEL%\"==\"0\" goto mainEnd\n\n:fail\nrem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\nrem the _cmd.exe /c_ return code!\nif  not \"\" == \"%GRADLE_EXIT_CONSOLE%\" exit 1\nexit /b 1\n\n:mainEnd\nif \"%OS%\"==\"Windows_NT\" endlocal\n\n:omega\n"
  },
  {
    "path": "settings.gradle",
    "content": "include ':app'\n"
  }
]