├── .gitignore ├── .idea ├── gradle.xml ├── inspectionProfiles │ └── Project_Default.xml ├── markdown-navigator │ └── profiles_settings.xml ├── misc.xml ├── runConfigurations.xml └── vcs.xml ├── ADBWIFI.zip ├── LICENSE ├── README.md ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro ├── release │ └── output.json └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── sujanpoudel │ │ └── adbwifi │ │ └── ExampleInstrumentedTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── ic_launcher-web.png │ ├── java │ │ └── com │ │ │ └── sujanpoudel │ │ │ └── adbwifi │ │ │ ├── AboutMeActivity.java │ │ │ ├── MainActivity.java │ │ │ ├── SettingsActivity.java │ │ │ ├── Tile.java │ │ │ └── Utils.java │ └── res │ │ ├── drawable │ │ ├── adb_wifi_enabled.xml │ │ ├── adb_wifi_off.xml │ │ ├── ic_launcher_foreground.xml │ │ └── me.png │ │ ├── font │ │ ├── cutive_mono.ttf │ │ ├── roboto.ttf │ │ └── roboto_medium.xml │ │ ├── layout │ │ ├── activity_about_me.xml │ │ ├── activity_main.xml │ │ └── activity_settings.xml │ │ ├── menu │ │ └── toolbar_menu.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── values-night │ │ └── colors.xml │ │ ├── values │ │ ├── colors.xml │ │ ├── font_certs.xml │ │ ├── ic_launcher_background.xml │ │ ├── preloaded_fonts.xml │ │ ├── strings.xml │ │ └── styles.xml │ │ └── xml │ │ └── preference.xml │ └── test │ └── java │ └── com │ └── sujanpoudel │ └── adbwifi │ └── ExampleUnitTest.java ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── graphics ├── Screenshot_20190327-121630_ADB_WIFI.png ├── Screenshot_20190327-121643_ADB_WIFI.png ├── Screenshot_20190327-121651_ADB_WIFI.png ├── Screenshot_20190327-121658_ADB_WIFI.png ├── Screenshot_20190327-121706_ADB_WIFI.png ├── Screenshot_20190327-123020_ADB_WIFI.png ├── Screenshot_20190327-140906_Nova_Launcher.png ├── cover.png ├── cropped quick setting tile.png ├── graphics.svg └── logo.svg └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | # Built application files 2 | *.apk 3 | *.ap_ 4 | 5 | # Files for the ART/Dalvik VM 6 | *.dex 7 | 8 | # Java class files 9 | *.class 10 | 11 | # Generated files 12 | bin/ 13 | gen/ 14 | out/ 15 | 16 | # Gradle files 17 | .gradle/ 18 | build/ 19 | 20 | # Local configuration file (sdk path, etc) 21 | local.properties 22 | 23 | # Proguard folder generated by Eclipse 24 | proguard/ 25 | 26 | # Log Files 27 | *.log 28 | 29 | # Android Studio Navigation editor temp files 30 | .navigation/ 31 | 32 | # Android Studio captures folder 33 | captures/ 34 | 35 | # IntelliJ 36 | *.iml 37 | .idea/modules.xml 38 | .idea/workspace.xml 39 | .idea/tasks.xml 40 | .idea/gradle.xml 41 | .idea/assetWizardSettings.xml 42 | .idea/dictionaries 43 | .idea/libraries 44 | .idea/caches 45 | 46 | # Keystore files 47 | # Uncomment the following line if you do not want to check your keystore files in. 48 | *.jks 49 | 50 | # External native build folder generated in Android Studio 2.2 and later 51 | .externalNativeBuild 52 | 53 | # Google Services (e.g. APIs or Firebase) 54 | google-services.json 55 | 56 | # Freeline 57 | freeline.py 58 | freeline/ 59 | freeline_project_description.json 60 | 61 | # fastlane 62 | fastlane/report.xml 63 | fastlane/Preview.html 64 | fastlane/screenshots 65 | fastlane/test_output 66 | fastlane/readme.md 67 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 19 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/Project_Default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /.idea/markdown-navigator/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /ADBWIFI.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/psuzn/ADB-WiFi/4ada935756dbce828cb2061d1673bcdbfb063dc9/ADBWIFI.zip -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | 294 | Copyright (C) 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | , 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ADB-WiFi 2 | App to enable ADB (Android Debugging Bridge) over wifi. 3 | 4 | ![GitHub release](https://img.shields.io/github/release/psuzn/ADB-WiFi.svg) 5 | 6 | ##### This app works on ROOTED devices only. 7 | 8 | ## Features 9 | - Quickly enable/disable ADB connection over WiFi TCP/IP. 10 | - Quick setting tile for quick enabling. 11 | - Dark mode. 12 | 13 | ## Screenshots 14 | 15 |
16 |
17 | 18 |
Quick Setting Tile.
19 |
20 |

21 | 22 | 23 | 24 | 25 | 26 | 27 |

28 | 29 |
30 | 31 | 32 | ## Contributing 33 | 1. Fork it () 34 | 2. Create your feature branch (`git checkout -b feature/fooBar`) 35 | 3. Commit your changes (`git commit -am 'Add some fooBar'`) 36 | 4. Push to the branch (`git push origin feature/fooBar`) 37 | 5. Create a new Pull Request 38 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 28 5 | defaultConfig { 6 | applicationId "com.sujanpoudel.adbwifi" 7 | minSdkVersion 19 8 | targetSdkVersion 28 9 | versionCode 2 10 | versionName "1.0.1" 11 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 12 | vectorDrawables.useSupportLibrary = true 13 | } 14 | lintOptions { 15 | checkReleaseBuilds false 16 | abortOnError false 17 | } 18 | buildTypes { 19 | release { 20 | minifyEnabled false 21 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 22 | } 23 | } 24 | } 25 | 26 | dependencies { 27 | implementation fileTree(include: ['*.jar'], dir: 'libs') 28 | implementation 'androidx.appcompat:appcompat:1.0.0' 29 | implementation 'androidx.constraintlayout:constraintlayout:1.1.3' 30 | implementation 'androidx.legacy:legacy-support-v4:1.0.0' 31 | implementation 'androidx.vectordrawable:vectordrawable:1.0.0' 32 | testImplementation 'junit:junit:4.12' 33 | androidTestImplementation 'androidx.test.ext:junit:1.1.0' 34 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0' 35 | implementation 'com.takisoft.fix:preference-v7-material:28.0.0.0' 36 | implementation 'androidx.cardview:cardview:1.0.0' 37 | implementation 'eu.chainfire:libsuperuser:1.0.0.+' 38 | implementation 'com.github.jrvansuita:MaterialAbout:+' 39 | } 40 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /app/release/output.json: -------------------------------------------------------------------------------- 1 | [{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":2,"versionName":"1.0.1","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}] -------------------------------------------------------------------------------- /app/src/androidTest/java/com/sujanpoudel/adbwifi/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.sujanpoudel.adbwifi; 2 | 3 | import android.content.Context; 4 | import androidx.test.platform.app.InstrumentationRegistry; 5 | import androidx.test.ext.junit.runners.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumented test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("com.sujanpoudel.adbwifi", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 18 | 19 | 20 | 23 | 24 | 25 | 26 | 27 | 28 | 35 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /app/src/main/ic_launcher-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/psuzn/ADB-WiFi/4ada935756dbce828cb2061d1673bcdbfb063dc9/app/src/main/ic_launcher-web.png -------------------------------------------------------------------------------- /app/src/main/java/com/sujanpoudel/adbwifi/AboutMeActivity.java: -------------------------------------------------------------------------------- 1 | package com.sujanpoudel.adbwifi; 2 | 3 | import android.graphics.Bitmap; 4 | import android.graphics.BitmapFactory; 5 | import android.os.Bundle; 6 | import android.view.View; 7 | import android.widget.LinearLayout; 8 | 9 | import androidx.appcompat.app.AppCompatActivity; 10 | import androidx.appcompat.app.AppCompatDelegate; 11 | import androidx.appcompat.widget.Toolbar; 12 | import androidx.core.content.ContextCompat; 13 | 14 | import com.vansuita.materialabout.builder.AboutBuilder; 15 | import com.vansuita.materialabout.util.IntentUtil; 16 | import com.vansuita.materialabout.views.AboutView; 17 | 18 | import static com.sujanpoudel.adbwifi.Utils.darkTheme; 19 | 20 | public class AboutMeActivity extends AppCompatActivity { 21 | 22 | @Override 23 | protected void onCreate(Bundle savedInstanceState) { 24 | super.onCreate(savedInstanceState); 25 | if (darkTheme(getApplicationContext())) { 26 | AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES); 27 | Utils.setupDarkStatusBar(this); 28 | } else { 29 | AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO); 30 | Utils.setupWhiteStatusBar(this); 31 | } 32 | setContentView(R.layout.activity_about_me); 33 | setSupportActionBar((Toolbar) findViewById(R.id.action_bar)); 34 | getSupportActionBar().setDisplayHomeAsUpEnabled(true); 35 | getSupportActionBar().setDisplayShowHomeEnabled(true); 36 | 37 | LinearLayout linearLayout = findViewById(R.id.parent_linearlayout); 38 | linearLayout.addView(getAboutView()); 39 | 40 | } 41 | 42 | View getAboutView() { 43 | IntentUtil util = new IntentUtil(this); 44 | Bitmap photo = BitmapFactory.decodeResource(getResources(), R.drawable.me); 45 | System.out.println(photo.toString()); 46 | AboutView view = AboutBuilder.with(this) 47 | .setPhoto(photo) 48 | .setName("Sujan Poudel") 49 | .setSubTitle("Game Developer | Android Developer | Web Developer") 50 | .setBrief("I am a android developer, fullstack web developer and also game developer available for freelancing as well as fulltime projects. ") 51 | .setAppIcon(R.mipmap.ic_launcher) 52 | .setAppName(R.string.app_name) 53 | .setActionsColumnsCount(4) 54 | .addGooglePlayStoreLink("5547061053835697166") 55 | .addGitHubLink("psuzn") 56 | .addTwitterLink("psuzn") 57 | .addLinkedInLink("psujan") 58 | .addEmailLink("psuzzn@gmail.com") 59 | .setActionsColumnsCount(2) 60 | .addAction(R.mipmap.star, "Rate", util.openPlayStoreAppPage(getPackageName())) 61 | .addAction(R.mipmap.feedback, "Feedback", util.sendEmail("psuzzn@gmail.com", "Feedback for Adb Wifi app", "")) 62 | .setVersionNameAsAppSubTitle() 63 | .setWrapScrollView(true) 64 | .setLinksAnimated(true) 65 | .setShowAsCard(true) 66 | .setBackgroundColor(ContextCompat.getColor(this, R.color.background)) 67 | .build(); 68 | return view; 69 | } 70 | 71 | @Override 72 | public boolean onSupportNavigateUp() { 73 | this.finish(); 74 | return true; 75 | } 76 | 77 | } 78 | -------------------------------------------------------------------------------- /app/src/main/java/com/sujanpoudel/adbwifi/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.sujanpoudel.adbwifi; 2 | 3 | import android.annotation.SuppressLint; 4 | import android.content.BroadcastReceiver; 5 | import android.content.ComponentName; 6 | import android.content.Context; 7 | import android.content.Intent; 8 | import android.content.IntentFilter; 9 | import android.graphics.Color; 10 | import android.os.Build; 11 | import android.os.Bundle; 12 | import android.os.Handler; 13 | import android.preference.PreferenceManager; 14 | import android.service.quicksettings.TileService; 15 | import androidx.appcompat.app.AppCompatActivity; 16 | import androidx.appcompat.app.AppCompatDelegate; 17 | import androidx.appcompat.widget.Toolbar; 18 | import android.view.Menu; 19 | import android.view.MenuItem; 20 | import android.view.View; 21 | import android.widget.CompoundButton; 22 | import android.widget.Switch; 23 | import android.widget.TextView; 24 | import android.widget.Toast; 25 | 26 | import java.io.IOException; 27 | 28 | import static com.sujanpoudel.adbwifi.Utils.darkTheme; 29 | import static com.sujanpoudel.adbwifi.Utils.getIpAndPort; 30 | import static com.sujanpoudel.adbwifi.Utils.isAdbWifiEnabled; 31 | import static com.sujanpoudel.adbwifi.Utils.startAdb; 32 | import static com.sujanpoudel.adbwifi.Utils.stopAdb; 33 | 34 | public class MainActivity extends AppCompatActivity { 35 | 36 | String runTextSuccess = "Run :"; 37 | String runTextFailedNoSuperSu = "App needs rooted phone ro run"; 38 | String runTextFailedNoSuperSuPermission = "App needs root permission ro run"; 39 | String runTextFailedUnknownError = "Something Went Wrong"; 40 | String IPTextSuccess = "adb connect "; 41 | 42 | 43 | Switch runSwitch; 44 | TextView runText, IPText; 45 | Runnable postDelayedRunnable = new Runnable() { 46 | @Override 47 | public void run() { 48 | if (!eu.chainfire.libsuperuser.Shell.SU.available()) { 49 | runText.setText(runTextFailedNoSuperSu); 50 | return; 51 | } 52 | try { 53 | Runtime.getRuntime().exec("su"); 54 | runText.setVisibility(View.GONE); 55 | runSwitch.setClickable(true); 56 | if (isAdbWifiEnabled()) { 57 | onAdbWifiSuccess(); 58 | } else { 59 | onAdbWifiStop(); 60 | } 61 | } catch (IOException e) { 62 | onAdbWifiFailed(runTextFailedNoSuperSuPermission); 63 | e.printStackTrace(); 64 | } 65 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { 66 | findViewById(R.id.info_card).setVisibility(View.VISIBLE); 67 | TileService.requestListeningState(getApplicationContext(), new ComponentName(getApplicationContext(), Tile.class)); 68 | } 69 | IntentFilter intentFilter = new IntentFilter(Utils.BROADCAST_ACTION); 70 | 71 | registerReceiver(new UpdateBroadcastReceiver(), intentFilter); 72 | 73 | } 74 | }; 75 | CompoundButton.OnCheckedChangeListener onCheckedChangeListener = new CompoundButton.OnCheckedChangeListener() { 76 | @SuppressLint("SetTextI18n") 77 | @Override 78 | public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { 79 | if (isChecked) { 80 | try { 81 | if (startAdb(getApplicationContext()) == 0) 82 | onAdbWifiSuccess(); 83 | 84 | } catch (Exception c) { 85 | c.printStackTrace(); 86 | onAdbWifiFailed(runTextFailedUnknownError); 87 | } 88 | } else { 89 | try { 90 | if (stopAdb() == 0) 91 | onAdbWifiStop(); 92 | } catch (Exception c) { 93 | c.printStackTrace(); 94 | onAdbWifiFailed(runTextFailedUnknownError); 95 | } 96 | } 97 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { 98 | TileService.requestListeningState(getApplicationContext(), new ComponentName(getApplicationContext(), Tile.class)); 99 | } 100 | } 101 | }; 102 | 103 | @Override 104 | protected void onCreate(Bundle savedInstanceState) { 105 | super.onCreate(savedInstanceState); 106 | if (darkTheme(getApplicationContext())) { 107 | AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES); 108 | Utils.setupDarkStatusBar(this); 109 | } else { 110 | AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO); 111 | Utils.setupWhiteStatusBar(this); 112 | } 113 | setContentView(R.layout.activity_main); 114 | Toolbar toolbar = findViewById(R.id.action_bar); 115 | setSupportActionBar(toolbar); 116 | PreferenceManager.setDefaultValues(this, R.xml.preference, false); 117 | 118 | runSwitch = findViewById(R.id.run_switch); 119 | runText = findViewById(R.id.run_text); 120 | IPText = findViewById(R.id.ip_text); 121 | runSwitch.setOnCheckedChangeListener(onCheckedChangeListener); 122 | new Handler().postDelayed(postDelayedRunnable, 300); 123 | 124 | 125 | } 126 | 127 | @Override 128 | public boolean onOptionsItemSelected(MenuItem item) { 129 | 130 | if (item.getItemId() == R.id.settings) { 131 | Intent i = new Intent(MainActivity.this, SettingsActivity.class); 132 | startActivity(i); 133 | return true; 134 | } else if (item.getItemId() == R.id.about_me) { 135 | Intent i = new Intent(MainActivity.this, AboutMeActivity.class); 136 | startActivity(i); 137 | return true; 138 | } 139 | return super.onOptionsItemSelected(item); 140 | } 141 | 142 | @Override 143 | public boolean onCreateOptionsMenu(Menu menu) { 144 | getMenuInflater().inflate(R.menu.toolbar_menu, menu); 145 | return true; 146 | } 147 | 148 | @Override 149 | protected void onResume() { 150 | super.onResume(); 151 | if (SettingsActivity.SettingFragment.shouldRecreateMainActivity) { 152 | SettingsActivity.SettingFragment.shouldRecreateMainActivity = false; 153 | recreate(); 154 | } 155 | } 156 | 157 | void onAdbWifiSuccess() { 158 | runText.setText(runTextSuccess); 159 | runSwitch.setChecked(true); 160 | runText.setTextColor(getResources().getColor(R.color.normalTextColor)); 161 | IPText.setText(IPTextSuccess + getIpAndPort(getApplicationContext())); 162 | runText.setVisibility(View.VISIBLE); 163 | IPText.setVisibility(View.VISIBLE); 164 | } 165 | 166 | void onAdbWifiFailed(String error) { 167 | runText.setText(error); 168 | runText.setTextColor(Color.RED); 169 | runText.setVisibility(View.VISIBLE); 170 | IPText.setVisibility(View.GONE); 171 | } 172 | 173 | void onAdbWifiStop() { 174 | runText.setVisibility(View.GONE); 175 | IPText.setVisibility(View.GONE); 176 | runSwitch.setChecked(false); 177 | } 178 | 179 | public class UpdateBroadcastReceiver extends BroadcastReceiver { 180 | @Override 181 | public void onReceive(Context context, Intent intent) { 182 | Toast.makeText(getApplicationContext(), "Received", Toast.LENGTH_SHORT); 183 | 184 | if (intent.getIntExtra(Utils.BROADCAST_INT_KEY, -1) == Tile.Status.Enabled) 185 | onAdbWifiSuccess(); 186 | else if (intent.getIntExtra(Utils.BROADCAST_INT_KEY, -1) == Tile.Status.Disabled) 187 | onAdbWifiStop(); 188 | System.out.println("Broadcast Received with int value:" + intent.getIntExtra(Utils.BROADCAST_INT_KEY, -1)); 189 | } 190 | } 191 | 192 | } 193 | -------------------------------------------------------------------------------- /app/src/main/java/com/sujanpoudel/adbwifi/SettingsActivity.java: -------------------------------------------------------------------------------- 1 | package com.sujanpoudel.adbwifi; 2 | 3 | import android.os.Bundle; 4 | import android.os.Handler; 5 | import android.widget.Toast; 6 | 7 | import androidx.annotation.Nullable; 8 | import androidx.appcompat.app.AppCompatActivity; 9 | import androidx.appcompat.app.AppCompatDelegate; 10 | import androidx.appcompat.widget.Toolbar; 11 | import androidx.preference.Preference; 12 | 13 | import com.takisoft.fix.support.v7.preference.PreferenceFragmentCompat; 14 | 15 | import static com.sujanpoudel.adbwifi.Utils.darkTheme; 16 | 17 | 18 | public class SettingsActivity extends AppCompatActivity { 19 | @Override 20 | protected void onCreate(@Nullable Bundle savedInstanceState) { 21 | super.onCreate(savedInstanceState); 22 | if (darkTheme(getApplicationContext())) { 23 | AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES); 24 | Utils.setupDarkStatusBar(this); 25 | } else { 26 | AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO); 27 | Utils.setupWhiteStatusBar(this); 28 | } 29 | setContentView(R.layout.activity_settings); 30 | Toolbar toolbar = findViewById(R.id.action_bar); 31 | setSupportActionBar(toolbar); 32 | getSupportActionBar().setDisplayHomeAsUpEnabled(true); 33 | getSupportActionBar().setDisplayShowHomeEnabled(true); 34 | } 35 | 36 | @Override 37 | public boolean onSupportNavigateUp() { 38 | this.finish(); 39 | return true; 40 | } 41 | 42 | public static class SettingFragment extends PreferenceFragmentCompat { 43 | static boolean shouldRecreateMainActivity = false; 44 | Preference.OnPreferenceChangeListener portPreferenceChangeListener 45 | = new Preference.OnPreferenceChangeListener() { 46 | @Override 47 | public boolean onPreferenceChange(Preference preference, Object o) { 48 | int intVal = Integer.parseInt(o.toString()); 49 | if (intVal < 1023 | intVal > 65535) { 50 | Toast.makeText(getContext(), o.toString() + " is not allowed value", Toast.LENGTH_SHORT).show(); 51 | return false; 52 | } else { 53 | preference.setSummary("TCP port is " + o.toString()); 54 | return true; 55 | } 56 | } 57 | }; 58 | Preference.OnPreferenceChangeListener themePreferenceChangeListener 59 | = new Preference.OnPreferenceChangeListener() { 60 | @Override 61 | public boolean onPreferenceChange(Preference preference, Object o) { 62 | new Handler().postDelayed(new Runnable() { 63 | @Override 64 | public void run() { 65 | getActivity().recreate(); 66 | shouldRecreateMainActivity = true; 67 | } 68 | }, 10); 69 | return true; 70 | } 71 | }; 72 | 73 | @Override 74 | public void onCreatePreferencesFix(@Nullable Bundle savedInstanceState, String rootKey) { 75 | addPreferencesFromResource(R.xml.preference); 76 | getPreferenceScreen().findPreference(getString(R.string.key_dark_theme)).setOnPreferenceChangeListener(themePreferenceChangeListener); 77 | bindPreferencesToSummary(findPreference(getString(R.string.key_port))); 78 | } 79 | 80 | private void bindPreferencesToSummary(Preference preference) { 81 | preference.setOnPreferenceChangeListener(portPreferenceChangeListener); 82 | portPreferenceChangeListener.onPreferenceChange(preference, Utils.getPort(getContext())); 83 | } 84 | } 85 | 86 | } 87 | -------------------------------------------------------------------------------- /app/src/main/java/com/sujanpoudel/adbwifi/Tile.java: -------------------------------------------------------------------------------- 1 | package com.sujanpoudel.adbwifi; 2 | 3 | 4 | import android.content.Intent; 5 | import android.graphics.drawable.Icon; 6 | import android.os.Build; 7 | import android.service.quicksettings.TileService; 8 | import android.widget.Toast; 9 | 10 | import androidx.annotation.RequiresApi; 11 | 12 | import java.io.IOException; 13 | 14 | import static com.sujanpoudel.adbwifi.Utils.getIpAndPort; 15 | import static com.sujanpoudel.adbwifi.Utils.isAdbWifiEnabled; 16 | 17 | @RequiresApi(api = Build.VERSION_CODES.N) 18 | public class Tile extends TileService { 19 | @Override 20 | public void onClick() { 21 | android.service.quicksettings.Tile tile = getQsTile(); 22 | Intent broadCastIntent = new Intent("com.sujanpoudel.adbwifi.UPDATE_ACTION"); 23 | 24 | if (tile.getState() == android.service.quicksettings.Tile.STATE_ACTIVE) { 25 | try { 26 | onTileDisable(); 27 | Utils.stopAdb(); 28 | broadCastIntent.putExtra(Utils.BROADCAST_INT_KEY, Status.Disabled); 29 | } catch (Exception e) { 30 | tile.setState(android.service.quicksettings.Tile.STATE_ACTIVE); 31 | Toast.makeText(getApplicationContext(), "ADB over Wifi could not be stopped", Toast.LENGTH_LONG).show(); 32 | e.printStackTrace(); 33 | } 34 | } else { 35 | try { 36 | onTileEnable(); 37 | Utils.startAdb(getApplicationContext()); 38 | broadCastIntent.putExtra(Utils.BROADCAST_INT_KEY, Status.Enabled); 39 | } catch (Exception e) { 40 | tile.setState(android.service.quicksettings.Tile.STATE_INACTIVE); 41 | Toast.makeText(getApplicationContext(), "ADB over Wifi could not be started", Toast.LENGTH_LONG).show(); 42 | e.printStackTrace(); 43 | } 44 | } 45 | tile.updateTile(); 46 | sendBroadcast(broadCastIntent); 47 | } 48 | 49 | void onTileDisable() { 50 | android.service.quicksettings.Tile tile = getQsTile(); 51 | tile.setContentDescription("ADB WIFI"); 52 | tile.setState(android.service.quicksettings.Tile.STATE_INACTIVE); 53 | tile.setLabel("ADB WIFI"); 54 | tile.setIcon(Icon.createWithResource(getApplicationContext(), R.drawable.adb_wifi_off)); 55 | tile.updateTile(); // first update tile and perform operation for responsiveness 56 | } 57 | 58 | void onTileEnable() { 59 | android.service.quicksettings.Tile tile = getQsTile(); 60 | tile.setState(android.service.quicksettings.Tile.STATE_ACTIVE); 61 | tile.setContentDescription(getIpAndPort(getApplicationContext())); 62 | tile.setLabel(getIpAndPort(getApplicationContext())); 63 | tile.setIcon(Icon.createWithResource(getApplicationContext(), R.drawable.adb_wifi_enabled)); 64 | tile.updateTile(); // first update tile and perform operation for responsiveness 65 | } 66 | 67 | @Override 68 | public void onTileAdded() { 69 | android.service.quicksettings.Tile tile = getQsTile(); 70 | if (eu.chainfire.libsuperuser.Shell.SU.available()) { 71 | try { 72 | Runtime.getRuntime().exec("su"); 73 | if (isAdbWifiEnabled()) { 74 | onTileEnable(); 75 | } else { 76 | onTileDisable(); 77 | } 78 | } catch (IOException e) { 79 | tile.setState(android.service.quicksettings.Tile.STATE_UNAVAILABLE); 80 | } 81 | } else 82 | getQsTile().setState(android.service.quicksettings.Tile.STATE_UNAVAILABLE); 83 | getQsTile().updateTile(); 84 | } 85 | 86 | @Override 87 | public void onStartListening() { 88 | if (getQsTile() != null) 89 | onTileAdded(); 90 | } 91 | 92 | static class Status { 93 | static int Enabled = 1; 94 | static int Disabled = 2; 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /app/src/main/java/com/sujanpoudel/adbwifi/Utils.java: -------------------------------------------------------------------------------- 1 | package com.sujanpoudel.adbwifi; 2 | 3 | import android.app.Activity; 4 | import android.content.Context; 5 | import android.net.wifi.WifiManager; 6 | import android.os.Build; 7 | import android.text.format.Formatter; 8 | import android.util.Log; 9 | import android.view.View; 10 | import android.view.Window; 11 | import android.view.WindowManager; 12 | 13 | import androidx.preference.PreferenceManager; 14 | 15 | import java.io.BufferedReader; 16 | import java.io.DataOutputStream; 17 | import java.io.IOException; 18 | import java.io.InputStreamReader; 19 | import java.util.Arrays; 20 | import java.util.List; 21 | import java.util.Objects; 22 | 23 | import static android.content.Context.WIFI_SERVICE; 24 | 25 | class Utils { 26 | private static final String TAG = "Uils adb wifis"; 27 | public static String BROADCAST_ACTION = "com.sujanpoudel.adbwifi.UPDATE_ACTION"; 28 | public static String BROADCAST_INT_KEY = "enable"; 29 | private static String DEFAULT_PORT = "5555"; 30 | 31 | static Boolean darkTheme(Context context) { 32 | return PreferenceManager.getDefaultSharedPreferences(Objects.requireNonNull(context.getApplicationContext())). 33 | getBoolean(context.getString(R.string.key_dark_theme), false); 34 | } 35 | 36 | static String getPort(Context context) { 37 | return PreferenceManager.getDefaultSharedPreferences(Objects.requireNonNull(context.getApplicationContext())). 38 | getString(context.getString(R.string.key_port), DEFAULT_PORT); 39 | } 40 | 41 | static String getIpAndPort(Context context) { 42 | WifiManager wm = (WifiManager) context.getApplicationContext().getSystemService(WIFI_SERVICE); 43 | return Formatter.formatIpAddress(wm.getConnectionInfo().getIpAddress()) + ":" + getPort(context); 44 | } 45 | 46 | static int startAdb(Context context) throws Exception { 47 | List commandStart = Arrays.asList("setprop service.adb.tcp.port " + getPort(context), "stop adbd", "start adbd", "exit"); 48 | return doCommands(commandStart); 49 | } 50 | 51 | static int stopAdb() throws Exception { 52 | List commandStop = Arrays.asList("setprop service.adb.tcp.port '' ", "stop adbd", "start adbd", "exit"); 53 | return doCommands(commandStop); 54 | } 55 | 56 | private static int doCommands(List cmds) throws Exception { 57 | Process process = Runtime.getRuntime().exec("su"); 58 | DataOutputStream os = new DataOutputStream(process.getOutputStream()); 59 | 60 | for (String tmpCmd : cmds) { 61 | os.writeBytes(tmpCmd + "\n"); 62 | } 63 | os.writeBytes("exit\n"); 64 | os.flush(); 65 | os.close(); 66 | 67 | process.waitFor(); 68 | System.out.println(process.exitValue()); 69 | return process.exitValue(); 70 | } 71 | 72 | private static String getSystemProps(String propName) { 73 | Process process = null; 74 | BufferedReader bufferedReader = null; 75 | 76 | try { 77 | process = new ProcessBuilder().command("getprop", propName).redirectErrorStream(true).start(); 78 | bufferedReader = new BufferedReader(new InputStreamReader(process.getInputStream())); 79 | String line = bufferedReader.readLine(); 80 | if (line == null) { 81 | line = ""; //prop not set 82 | } 83 | Log.i(TAG, "read System Property: " + propName + "=" + line); 84 | return line; 85 | } catch (Exception e) { 86 | Log.e(TAG, "Failed to read System Property " + propName, e); 87 | return ""; 88 | } finally { 89 | if (bufferedReader != null) { 90 | try { 91 | bufferedReader.close(); 92 | } catch (IOException e) { 93 | e.printStackTrace(); 94 | } 95 | } 96 | if (process != null) { 97 | process.destroy(); 98 | } 99 | } 100 | } 101 | 102 | static boolean isAdbWifiEnabled() { 103 | String port = getSystemProps("service.adb.tcp.port"); 104 | String AdbEnabled = getSystemProps("init.svc.adbd"); 105 | return (!port.equals("")) & AdbEnabled.equals("running"); 106 | } 107 | 108 | static void setupWhiteStatusBar(Activity activity) { 109 | if (Build.VERSION.SDK_INT >= 19 && Build.VERSION.SDK_INT < 21) { 110 | setWindowFlag(activity, WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS, true); 111 | } 112 | if (Build.VERSION.SDK_INT >= 19) { 113 | activity.getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN); 114 | } 115 | //make fully Android Transparent Status bar 116 | if (Build.VERSION.SDK_INT >= 21) { 117 | setWindowFlag(activity, WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION, false); 118 | setWindowFlag(activity, WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS, false); 119 | activity.getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR | View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR); 120 | activity.getWindow().setStatusBarColor(0x00000000); 121 | activity.getWindow().setNavigationBarColor(0x00000000); 122 | } 123 | } 124 | 125 | static void setupDarkStatusBar(Activity activity) { 126 | if (Build.VERSION.SDK_INT >= 19 && Build.VERSION.SDK_INT < 21) { 127 | setWindowFlag(activity, WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS, true); 128 | } 129 | if (Build.VERSION.SDK_INT >= 19) { 130 | activity.getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN); 131 | } 132 | //make fully Android Transparent Status bar 133 | if (Build.VERSION.SDK_INT >= 21) { 134 | setWindowFlag(activity, WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION, true); 135 | setWindowFlag(activity, WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS, true); 136 | activity.getWindow().setStatusBarColor(0x00000000); 137 | activity.getWindow().setNavigationBarColor(0x00000000); 138 | } 139 | } 140 | 141 | static void setWindowFlag(Activity activity, final int bits, boolean on) { 142 | Window win = activity.getWindow(); 143 | WindowManager.LayoutParams winParams = win.getAttributes(); 144 | if (on) { 145 | winParams.flags |= bits; 146 | } else { 147 | winParams.flags &= ~bits; 148 | } 149 | win.setAttributes(winParams); 150 | } 151 | 152 | } 153 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/adb_wifi_enabled.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/adb_wifi_off.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 9 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/me.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/psuzn/ADB-WiFi/4ada935756dbce828cb2061d1673bcdbfb063dc9/app/src/main/res/drawable/me.png -------------------------------------------------------------------------------- /app/src/main/res/font/cutive_mono.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/psuzn/ADB-WiFi/4ada935756dbce828cb2061d1673bcdbfb063dc9/app/src/main/res/font/cutive_mono.ttf -------------------------------------------------------------------------------- /app/src/main/res/font/roboto.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/psuzn/ADB-WiFi/4ada935756dbce828cb2061d1673bcdbfb063dc9/app/src/main/res/font/roboto.ttf -------------------------------------------------------------------------------- /app/src/main/res/font/roboto_medium.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_about_me.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 18 | 19 | 28 | 29 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 19 | 20 | 29 | 30 | 31 | 41 | 42 | 47 | 48 | 56 | 57 | 66 | 67 | 76 | 77 | 91 | 92 | 93 | 94 | 105 | 106 | 111 | 112 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 19 | 20 | 29 | 30 | 31 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /app/src/main/res/menu/toolbar_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 9 | 14 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/psuzn/ADB-WiFi/4ada935756dbce828cb2061d1673bcdbfb063dc9/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/psuzn/ADB-WiFi/4ada935756dbce828cb2061d1673bcdbfb063dc9/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/psuzn/ADB-WiFi/4ada935756dbce828cb2061d1673bcdbfb063dc9/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/psuzn/ADB-WiFi/4ada935756dbce828cb2061d1673bcdbfb063dc9/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/psuzn/ADB-WiFi/4ada935756dbce828cb2061d1673bcdbfb063dc9/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/psuzn/ADB-WiFi/4ada935756dbce828cb2061d1673bcdbfb063dc9/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/psuzn/ADB-WiFi/4ada935756dbce828cb2061d1673bcdbfb063dc9/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/psuzn/ADB-WiFi/4ada935756dbce828cb2061d1673bcdbfb063dc9/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/psuzn/ADB-WiFi/4ada935756dbce828cb2061d1673bcdbfb063dc9/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/psuzn/ADB-WiFi/4ada935756dbce828cb2061d1673bcdbfb063dc9/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/values-night/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #000000 4 | #F6FFFFFF 5 | #FcFFFF 6 | #0083BE 7 | #3F51B5 8 | #FF4901 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | @android:color/white 4 | #EE000000 5 | #616161 6 | #0083BE 7 | #3F51B5 8 | #FF4901 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/values/font_certs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | @array/com_google_android_gms_fonts_certs_dev 5 | @array/com_google_android_gms_fonts_certs_prod 6 | 7 | 8 | 9 | MIIEqDCCA5CgAwIBAgIJANWFuGx90071MA0GCSqGSIb3DQEBBAUAMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEQMA4GA1UEChMHQW5kcm9pZDEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDEiMCAGCSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lkLmNvbTAeFw0wODA0MTUyMzM2NTZaFw0zNTA5MDEyMzM2NTZaMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEQMA4GA1UEChMHQW5kcm9pZDEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDEiMCAGCSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lkLmNvbTCCASAwDQYJKoZIhvcNAQEBBQADggENADCCAQgCggEBANbOLggKv+IxTdGNs8/TGFy0PTP6DHThvbbR24kT9ixcOd9W+EaBPWW+wPPKQmsHxajtWjmQwWfna8mZuSeJS48LIgAZlKkpFeVyxW0qMBujb8X8ETrWy550NaFtI6t9+u7hZeTfHwqNvacKhp1RbE6dBRGWynwMVX8XW8N1+UjFaq6GCJukT4qmpN2afb8sCjUigq0GuMwYXrFVee74bQgLHWGJwPmvmLHC69EH6kWr22ijx4OKXlSIx2xT1AsSHee70w5iDBiK4aph27yH3TxkXy9V89TDdexAcKk/cVHYNnDBapcavl7y0RiQ4biu8ymM8Ga/nmzhRKya6G0cGw8CAQOjgfwwgfkwHQYDVR0OBBYEFI0cxb6VTEM8YYY6FbBMvAPyT+CyMIHJBgNVHSMEgcEwgb6AFI0cxb6VTEM8YYY6FbBMvAPyT+CyoYGapIGXMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEQMA4GA1UEChMHQW5kcm9pZDEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDEiMCAGCSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lkLmNvbYIJANWFuGx90071MAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEEBQADggEBABnTDPEF+3iSP0wNfdIjIz1AlnrPzgAIHVvXxunW7SBrDhEglQZBbKJEk5kT0mtKoOD1JMrSu1xuTKEBahWRbqHsXclaXjoBADb0kkjVEJu/Lh5hgYZnOjvlba8Ld7HCKePCVePoTJBdI4fvugnL8TsgK05aIskyY0hKI9L8KfqfGTl1lzOv2KoWD0KWwtAWPoGChZxmQ+nBli+gwYMzM1vAkP+aayLe0a1EQimlOalO762r0GXO0ks+UeXde2Z4e+8S/pf7pITEI/tP+MxJTALw9QUWEv9lKTk+jkbqxbsh8nfBUapfKqYn0eidpwq2AzVp3juYl7//fKnaPhJD9gs= 10 | 11 | 12 | 13 | 14 | MIIEQzCCAyugAwIBAgIJAMLgh0ZkSjCNMA0GCSqGSIb3DQEBBAUAMHQxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtHb29nbGUgSW5jLjEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDAeFw0wODA4MjEyMzEzMzRaFw0zNjAxMDcyMzEzMzRaMHQxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtHb29nbGUgSW5jLjEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDCCASAwDQYJKoZIhvcNAQEBBQADggENADCCAQgCggEBAKtWLgDYO6IIrgqWbxJOKdoR8qtW0I9Y4sypEwPpt1TTcvZApxsdyxMJZ2JORland2qSGT2y5b+3JKkedxiLDmpHpDsz2WCbdxgxRczfey5YZnTJ4VZbH0xqWVW/8lGmPav5xVwnIiJS6HXk+BVKZF+JcWjAsb/GEuq/eFdpuzSqeYTcfi6idkyugwfYwXFU1+5fZKUaRKYCwkkFQVfcAs1fXA5V+++FGfvjJ/CxURaSxaBvGdGDhfXE28LWuT9ozCl5xw4Yq5OGazvV24mZVSoOO0yZ31j7kYvtwYK6NeADwbSxDdJEqO4k//0zOHKrUiGYXtqw/A0LFFtqoZKFjnkCAQOjgdkwgdYwHQYDVR0OBBYEFMd9jMIhF1Ylmn/Tgt9r45jk14alMIGmBgNVHSMEgZ4wgZuAFMd9jMIhF1Ylmn/Tgt9r45jk14aloXikdjB0MQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLR29vZ2xlIEluYy4xEDAOBgNVBAsTB0FuZHJvaWQxEDAOBgNVBAMTB0FuZHJvaWSCCQDC4IdGZEowjTAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBAUAA4IBAQBt0lLO74UwLDYKqs6Tm8/yzKkEu116FmH4rkaymUIE0P9KaMftGlMexFlaYjzmB2OxZyl6euNXEsQH8gjwyxCUKRJNexBiGcCEyj6z+a1fuHHvkiaai+KL8W1EyNmgjmyy8AW7P+LLlkR+ho5zEHatRbM/YAnqGcFh5iZBqpknHf1SKMXFh4dd239FJ1jWYfbMDMy3NS5CTMQ2XFI1MvcyUTdZPErjQfTbQe3aDQsQcafEQPD+nqActifKZ0Np0IS9L9kR/wbNvyz6ENwPiTrjV2KRkEjH78ZMcUQXg0L3BYHJ3lc69Vs5Ddf9uUGGMYldX3WfMBEmh/9iFBDAaTCK 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /app/src/main/res/values/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #F77500 4 | -------------------------------------------------------------------------------- /app/src/main/res/values/preloaded_fonts.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | @font/cutive_mono 5 | @font/roboto 6 | @font/roboto_medium 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | ADB Wifi 3 | Settings 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | port 14 | darkTheme 15 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /app/src/main/res/xml/preference.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 10 | 11 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /app/src/test/java/com/sujanpoudel/adbwifi/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.sujanpoudel.adbwifi; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | google() 6 | jcenter() 7 | 8 | } 9 | dependencies { 10 | classpath 'com.android.tools.build:gradle:3.6.0-alpha02' 11 | 12 | // NOTE: Do not place your application dependencies here; they belong 13 | // in the individual module build.gradle files 14 | } 15 | } 16 | 17 | allprojects { 18 | repositories { 19 | google() 20 | jcenter() 21 | maven { url "https://jitpack.io" } 22 | } 23 | } 24 | 25 | task clean(type: Delete) { 26 | delete rootProject.buildDir 27 | } 28 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | android.enableJetifier=true 10 | android.useAndroidX=true 11 | org.gradle.jvmargs=-Xmx1536m 12 | # When configured, Gradle will run in incubating parallel mode. 13 | # This option should only be used with decoupled projects. More details, visit 14 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 15 | # org.gradle.parallel=true 16 | 17 | 18 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/psuzn/ADB-WiFi/4ada935756dbce828cb2061d1673bcdbfb063dc9/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Jul 31 11:20:02 NPT 2019 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip 7 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Attempt to set APP_HOME 10 | # Resolve links: $0 may be a link 11 | PRG="$0" 12 | # Need this for relative symlinks. 13 | while [ -h "$PRG" ] ; do 14 | ls=`ls -ld "$PRG"` 15 | link=`expr "$ls" : '.*-> \(.*\)$'` 16 | if expr "$link" : '/.*' > /dev/null; then 17 | PRG="$link" 18 | else 19 | PRG=`dirname "$PRG"`"/$link" 20 | fi 21 | done 22 | SAVED="`pwd`" 23 | cd "`dirname \"$PRG\"`/" >/dev/null 24 | APP_HOME="`pwd -P`" 25 | cd "$SAVED" >/dev/null 26 | 27 | APP_NAME="Gradle" 28 | APP_BASE_NAME=`basename "$0"` 29 | 30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 31 | DEFAULT_JVM_OPTS="" 32 | 33 | # Use the maximum available, or set MAX_FD != -1 to use that value. 34 | MAX_FD="maximum" 35 | 36 | warn () { 37 | echo "$*" 38 | } 39 | 40 | die () { 41 | echo 42 | echo "$*" 43 | echo 44 | exit 1 45 | } 46 | 47 | # OS specific support (must be 'true' or 'false'). 48 | cygwin=false 49 | msys=false 50 | darwin=false 51 | nonstop=false 52 | case "`uname`" in 53 | CYGWIN* ) 54 | cygwin=true 55 | ;; 56 | Darwin* ) 57 | darwin=true 58 | ;; 59 | MINGW* ) 60 | msys=true 61 | ;; 62 | NONSTOP* ) 63 | nonstop=true 64 | ;; 65 | esac 66 | 67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 68 | 69 | # Determine the Java command to use to start the JVM. 70 | if [ -n "$JAVA_HOME" ] ; then 71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 72 | # IBM's JDK on AIX uses strange locations for the executables 73 | JAVACMD="$JAVA_HOME/jre/sh/java" 74 | else 75 | JAVACMD="$JAVA_HOME/bin/java" 76 | fi 77 | if [ ! -x "$JAVACMD" ] ; then 78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 79 | 80 | Please set the JAVA_HOME variable in your environment to match the 81 | location of your Java installation." 82 | fi 83 | else 84 | JAVACMD="java" 85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 86 | 87 | Please set the JAVA_HOME variable in your environment to match the 88 | location of your Java installation." 89 | fi 90 | 91 | # Increase the maximum file descriptors if we can. 92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 93 | MAX_FD_LIMIT=`ulimit -H -n` 94 | if [ $? -eq 0 ] ; then 95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 96 | MAX_FD="$MAX_FD_LIMIT" 97 | fi 98 | ulimit -n $MAX_FD 99 | if [ $? -ne 0 ] ; then 100 | warn "Could not set maximum file descriptor limit: $MAX_FD" 101 | fi 102 | else 103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 104 | fi 105 | fi 106 | 107 | # For Darwin, add options to specify how the application appears in the dock 108 | if $darwin; then 109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 110 | fi 111 | 112 | # For Cygwin, switch paths to Windows format before running java 113 | if $cygwin ; then 114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 116 | JAVACMD=`cygpath --unix "$JAVACMD"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Escape application args 158 | save () { 159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 160 | echo " " 161 | } 162 | APP_ARGS=$(save "$@") 163 | 164 | # Collect all arguments for the java command, following the shell quoting and substitution rules 165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 166 | 167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong 168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then 169 | cd "$(dirname "$0")" 170 | fi 171 | 172 | exec "$JAVACMD" "$@" 173 | -------------------------------------------------------------------------------- /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 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 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 Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /graphics/Screenshot_20190327-121630_ADB_WIFI.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/psuzn/ADB-WiFi/4ada935756dbce828cb2061d1673bcdbfb063dc9/graphics/Screenshot_20190327-121630_ADB_WIFI.png -------------------------------------------------------------------------------- /graphics/Screenshot_20190327-121643_ADB_WIFI.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/psuzn/ADB-WiFi/4ada935756dbce828cb2061d1673bcdbfb063dc9/graphics/Screenshot_20190327-121643_ADB_WIFI.png -------------------------------------------------------------------------------- /graphics/Screenshot_20190327-121651_ADB_WIFI.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/psuzn/ADB-WiFi/4ada935756dbce828cb2061d1673bcdbfb063dc9/graphics/Screenshot_20190327-121651_ADB_WIFI.png -------------------------------------------------------------------------------- /graphics/Screenshot_20190327-121658_ADB_WIFI.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/psuzn/ADB-WiFi/4ada935756dbce828cb2061d1673bcdbfb063dc9/graphics/Screenshot_20190327-121658_ADB_WIFI.png -------------------------------------------------------------------------------- /graphics/Screenshot_20190327-121706_ADB_WIFI.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/psuzn/ADB-WiFi/4ada935756dbce828cb2061d1673bcdbfb063dc9/graphics/Screenshot_20190327-121706_ADB_WIFI.png -------------------------------------------------------------------------------- /graphics/Screenshot_20190327-123020_ADB_WIFI.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/psuzn/ADB-WiFi/4ada935756dbce828cb2061d1673bcdbfb063dc9/graphics/Screenshot_20190327-123020_ADB_WIFI.png -------------------------------------------------------------------------------- /graphics/Screenshot_20190327-140906_Nova_Launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/psuzn/ADB-WiFi/4ada935756dbce828cb2061d1673bcdbfb063dc9/graphics/Screenshot_20190327-140906_Nova_Launcher.png -------------------------------------------------------------------------------- /graphics/cover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/psuzn/ADB-WiFi/4ada935756dbce828cb2061d1673bcdbfb063dc9/graphics/cover.png -------------------------------------------------------------------------------- /graphics/cropped quick setting tile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/psuzn/ADB-WiFi/4ada935756dbce828cb2061d1673bcdbfb063dc9/graphics/cropped quick setting tile.png -------------------------------------------------------------------------------- /graphics/logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 13 | 15 | 17 | 18 | 20 | image/svg+xml 21 | 23 | 24 | 25 | 26 | 27 | 30 | 34 | 38 | 42 | 46 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | --------------------------------------------------------------------------------