Browse Source

Initial commit lol

Wazakindjes 2 years ago
commit
85aca91e8d
61 changed files with 3206 additions and 0 deletions
  1. 40 0
      .gitignore
  2. 241 0
      LICENSE
  3. 59 0
      README.md
  4. BIN
      app/Meqqy.apk
  5. 11 0
      app/src/.gitignore
  6. 29 0
      app/src/.idea/codeStyles/Project.xml
  7. 38 0
      app/src/.idea/misc.xml
  8. 12 0
      app/src/.idea/runConfigurations.xml
  9. 1 0
      app/src/app_Meqqy/.gitignore
  10. 63 0
      app/src/app_Meqqy/build.gradle
  11. 21 0
      app/src/app_Meqqy/proguard-rules.pro
  12. 26 0
      app/src/app_Meqqy/src/androidTest/java/com/jemoeder/lief/meqqy/ExampleInstrumentedTest.java
  13. 43 0
      app/src/app_Meqqy/src/main/AndroidManifest.xml
  14. BIN
      app/src/app_Meqqy/src/main/ic_launcher-web.png
  15. 930 0
      app/src/app_Meqqy/src/main/java/com/jemoeder/lief/meqqy/MainActivity.java
  16. 47 0
      app/src/app_Meqqy/src/main/java/com/jemoeder/lief/meqqy/MuhNumberPicker.java
  17. 58 0
      app/src/app_Meqqy/src/main/java/com/jemoeder/lief/meqqy/SettingsActivity.java
  18. BIN
      app/src/app_Meqqy/src/main/res/drawable-hdpi/ic_action_options.png
  19. BIN
      app/src/app_Meqqy/src/main/res/drawable-hdpi/ic_action_reconnect.png
  20. BIN
      app/src/app_Meqqy/src/main/res/drawable-mdpi/ic_action_reconnect.png
  21. BIN
      app/src/app_Meqqy/src/main/res/drawable-mdpi/ic_action_settings.png
  22. BIN
      app/src/app_Meqqy/src/main/res/drawable-xhdpi/ic_action_reconnect.png
  23. BIN
      app/src/app_Meqqy/src/main/res/drawable-xhdpi/ic_action_settings.png
  24. BIN
      app/src/app_Meqqy/src/main/res/drawable-xxhdpi/ic_action_reconnect.png
  25. BIN
      app/src/app_Meqqy/src/main/res/drawable-xxhdpi/ic_action_settings.png
  26. BIN
      app/src/app_Meqqy/src/main/res/drawable-xxxhdpi/ic_action_reconnect.png
  27. BIN
      app/src/app_Meqqy/src/main/res/drawable-xxxhdpi/ic_action_settings.png
  28. 9 0
      app/src/app_Meqqy/src/main/res/drawable/ic_info_black_24dp.xml
  29. 9 0
      app/src/app_Meqqy/src/main/res/drawable/ic_notifications_black_24dp.xml
  30. 9 0
      app/src/app_Meqqy/src/main/res/drawable/ic_sync_black_24dp.xml
  31. 35 0
      app/src/app_Meqqy/src/main/res/drawable/seekbar.xml
  32. 10 0
      app/src/app_Meqqy/src/main/res/drawable/seekbar_thumb.xml
  33. 472 0
      app/src/app_Meqqy/src/main/res/layout/activity_main.xml
  34. 16 0
      app/src/app_Meqqy/src/main/res/layout/preference_category.xml
  35. 15 0
      app/src/app_Meqqy/src/main/res/menu/main.xml
  36. BIN
      app/src/app_Meqqy/src/main/res/mipmap-hdpi/ic_launcher.png
  37. BIN
      app/src/app_Meqqy/src/main/res/mipmap-mdpi/ic_launcher.png
  38. BIN
      app/src/app_Meqqy/src/main/res/mipmap-xhdpi/ic_launcher.png
  39. BIN
      app/src/app_Meqqy/src/main/res/mipmap-xxhdpi/ic_launcher.png
  40. BIN
      app/src/app_Meqqy/src/main/res/mipmap-xxxhdpi/ic_launcher.png
  41. 9 0
      app/src/app_Meqqy/src/main/res/values/attrs.xml
  42. 29 0
      app/src/app_Meqqy/src/main/res/values/colors.xml
  43. 23 0
      app/src/app_Meqqy/src/main/res/values/dimens.xml
  44. 102 0
      app/src/app_Meqqy/src/main/res/values/strings.xml
  45. 15 0
      app/src/app_Meqqy/src/main/res/values/styles.xml
  46. 9 0
      app/src/app_Meqqy/src/main/res/xml/network_security_config.xml
  47. 76 0
      app/src/app_Meqqy/src/main/res/xml/preferences.xml
  48. 17 0
      app/src/app_Meqqy/src/test/java/com/jemoeder/lief/meqqy/ExampleUnitTest.java
  49. 24 0
      app/src/build.gradle
  50. 14 0
      app/src/gradle.properties
  51. BIN
      app/src/gradle/wrapper/gradle-wrapper.jar
  52. 5 0
      app/src/gradle/wrapper/gradle-wrapper.properties
  53. 172 0
      app/src/gradlew
  54. 84 0
      app/src/gradlew.bat
  55. 1 0
      app/src/settings.gradle
  56. 14 0
      serbur/com.jemoeder.lief.meqqy.plist
  57. 2 0
      serbur/load
  58. 385 0
      serbur/meqqy.pl
  59. 26 0
      serbur/muhconf.ini.example
  60. 3 0
      serbur/reload
  61. 2 0
      serbur/unload

+ 40 - 0
.gitignore

@@ -0,0 +1,40 @@
+.DS_Store
+._.*
+$RECYCLE.BIN
+.*.swp
+*-bak*
+*.ini
+*.conf
+/ssl
+
+/app/release
+/app/src/.idea/assetWizardSettings.xml
+/app/src/.idea/caches
+/app/src/.idea/gradle.xml
+/app/src/.idea/libraries
+/app/src/.idea/modules.xml
+/app/src/.idea/workspace.xml
+
+.gradle/
+build/
+*.class
+*.dex
+local.properties
+proguard/
+*.log
+.navigation/
+captures/
+*.iml
+/app/src/.idea/tasks.xml
+/app/src/.idea/dictionaries
+.externalNativeBuild
+google-services.json
+freeline.py
+freeline/
+freeline_project_description.json
+fastlane/report.xml
+fastlane/Preview.html
+fastlane/screenshots
+fastlane/test_output
+fastlane/readme.md
+

+ 241 - 0
LICENSE

@@ -0,0 +1,241 @@
+GNU AFFERO GENERAL PUBLIC LICENSE 
+Version 3, 19 November 2007
+Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+
+Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
+
+Preamble
+
+The GNU Affero General Public License is a free, copyleft license for software and other kinds of works, specifically designed to ensure cooperation with the community in the case of network server software.
+
+The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, our General Public Licenses are intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users.
+
+When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.
+
+Developers that use our General Public Licenses protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License which gives you legal permission to copy, distribute and/or modify the software.
+
+A secondary benefit of defending all users' freedom is that improvements made in alternate versions of the program, if they receive widespread use, become available for other developers to incorporate. Many developers of free software are heartened and encouraged by the resulting cooperation. However, in the case of software used on network servers, this result may fail to come about. The GNU General Public License permits making a modified version and letting the public access it on a server without ever releasing its source code to the public.
+
+The GNU Affero General Public License is designed specifically to ensure that, in such cases, the modified source code becomes available to the community. It requires the operator of a network server to provide the source code of the modified version running there to the users of that server. Therefore, public use of a modified version, on a publicly accessible server, gives the public access to the source code of the modified version.
+
+An older license, called the Affero General Public License and published by Affero, was designed to accomplish similar goals. This is a different license, not a version of the Affero GPL, but Affero has released a new version of the Affero GPL which permits relicensing under this license.
+
+The precise terms and conditions for copying, distribution and modification follow.
+
+TERMS AND CONDITIONS
+
+0. Definitions.
+
+"This License" refers to version 3 of the GNU Affero General Public License.
+
+"Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.
+
+"The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations.
+
+To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work.
+
+A "covered work" means either the unmodified Program or a work based on the Program.
+
+To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.
+
+To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.
+
+An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.
+
+1. Source Code. 
+The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work.
+
+A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.
+
+The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.
+
+The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those 
+subprograms and other parts of the work.
+
+The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.
+
+The Corresponding Source for a work in source code form is that same work.
+
+2. Basic Permissions. 
+All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.
+
+You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.
+
+Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.
+
+3. Protecting Users' Legal Rights From Anti-Circumvention Law. 
+No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.
+
+When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.
+
+4. Conveying Verbatim Copies. 
+You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.
+
+You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.
+
+5. Conveying Modified Source Versions. 
+You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:
+
+a) The work must carry prominent notices stating that you modified it, and giving a relevant date.
+
+b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices".
+
+c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.
+
+d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.
+
+A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.
+
+6. Conveying Non-Source Forms. 
+You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:
+
+a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.
+
+b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.
+
+c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.
+
+d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.
+
+e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.
+
+A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.
+
+A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.
+
+"Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.
+
+If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).
+
+The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.
+
+Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.
+
+7. Additional Terms. 
+"Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.
+
+When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.
+
+Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:
+
+a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or
+
+b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or
+
+c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or
+
+d) Limiting the use for publicity purposes of names of licensors or authors of the material; or
+
+e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or
+
+f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.
+
+All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.
+
+If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.
+
+Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.
+
+8. Termination.
+
+You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).
+
+However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.
+
+Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.
+
+Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.
+
+9. Acceptance Not Required for Having Copies.
+
+You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.
+
+10. Automatic Licensing of Downstream Recipients.
+
+Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.
+
+An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.
+
+You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.
+
+11. Patents.
+
+A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version".
+
+A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.
+
+Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.
+
+In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to s ue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.
+
+If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent 
+license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.
+
+If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.
+
+A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.
+
+Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.
+
+12. No Surrender of Others' Freedom.
+
+If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may 
+not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.
+
+13. Remote Network Interaction; Use with the GNU General Public License.
+
+Notwithstanding any other provision of this License, if you modify the Program, your modified version must prominently offer all users interacting with it remotely through a computer network (if your version supports such interaction) an opportunity to receive the Corresponding Source of your version by providing access to the Corresponding Source from a network server at no charge, through some standard or customary means of facilitating copying of software. This Corresponding Source shall include the Corresponding Source for any work covered by version 3 of the GNU General Public License that is incorporated pursuant to the following paragraph.
+
+Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the work with which it is combined will remain governed by version 3 of the GNU General Public License.
+
+14. Revised Versions of this License.
+
+The Free Software Foundation may publish revised and/or new versions of the GNU Affero General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU Affero General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU Affero General Public License, you may choose any version ever published by the Free Software Foundation.
+
+If the Program specifies that a proxy can decide which future versions of the GNU Affero General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.
+
+Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.
+
+15. Disclaimer of Warranty.
+
+THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+16. Limitation of Liability.
+
+IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+17. Interpretation of Sections 15 and 16.
+
+If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.
+
+END OF TERMS AND CONDITIONS
+
+How to Apply These Terms to Your New Programs
+
+If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
+
+To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.
+
+<one line to give the program's name and a brief idea of what it does.> 
+Copyright (C) <year> <name of author>
+
+This program is free software: you can redistribute it and/or modify 
+it under the terms of the GNU Affero General Public License as published by 
+the Free Software Foundation, either version 3 of the License, or 
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful, 
+but WITHOUT ANY WARRANTY; without even the implied warranty of 
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
+GNU Affero General Public License for more details.
+
+You should have received a copy of the GNU Affero General Public License 
+along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If your software can interact with users remotely through a computer network, you should also make sure that it provides a way for users to get its source. For example, if your program is a web application, its interface could display a "Source" link that leads users to an archive of the code. There are many ways you could offer source, and different solutions will be better for different programs; see section 13 for the specific requirements.
+
+You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU AGPL, see <http://www.gnu.org/licenses/>.

+ 59 - 0
README.md

@@ -0,0 +1,59 @@
+# The fuck is this
+This shit is a dankass remote control thanggGgGg for Mac OS X (I'll keep saying that instead of macOS, fucking deal w/ it). I mostly started it as a proof of concept for keks, but it's easily expanded to include actually useful features. xd Right now it's mostly for enabling laziness. [=[=[==[[=[
+
+The server side is a Perl skrip which can/should be controlled by `launchctl` to properly make it run as a daemon. The commands it receives are turned into AppleScript cuz that shit has APIs all throughout the OS X system. ;] Also, since the server only runs in SSL/TLS mode you'll need a certificate trusted by the clients used.
+
+The client side can be anything supporting a streaming (TCP) socket with TLS, but I'm using an Android app meinself (incl00ded in the `app` directory lol). This app has a target SDK of 25 which corresponds to Android 7.1 (I'm using 25 cuz that gives me full-size app icons w/o that adaptive cancer). If you're using a self-signed cert, you should be able to import it into `Settings` > `Security` > `Credentials` > `Trusted CAs` or smt similar and it'll be accepted. Alternatively you can just disable the cert check inside the app's settings. =]
+
+# Supported commands
+Many also support shorthand versions, some of which aren't even shown here due to it becoming fucky to read. xd You could also just check the regexes in em Perl if you really wanna kn0.
+
+* `!a[uth] <$key>` => Required before doing anything else lol
+* `!q[uit]`, `!e[xit]` => Attempt clean disconnect
+* `!prev` => Previous music track
+* `!next` => Next tracc
+* `!play[pause]` => Toggle play/pause
+* `!vol[ume] <$volume | +$volume | +$volume>` => Change/set volume (e.g. `!vol -5`, `!vol +9`, `!vol 20`);
+* `!m[ute]` => Toggle mute
+* `!lock[screen]` => Locks the screen (i.e. go back to login/user selection screen)
+* `!bright[ness] <$brightness | up | down | min | max>` => Change/set brightness in a similar fashion as `!volume`
+* `!c[affeinate] <$timestring>` => Prevent system/display sleep and screensaver yo (e.g. `!c 1h 5m 10s`, `!c 1h5m10s`, `!c 30m`)
+* `!decaf[feinate]` => Undo all `caffeinate`s (i.e. kill that shit)
+
+# Dependencies
+Just some good ol' Perl modules:
+* `Config::IniFiles`
+* `File::Basename`
+* `IO::Handle`
+* `IO::Select`
+* `IO::Socket::INET`
+* `IO::Socket::SSL`
+
+# Installation
+Copy `muhconf.ini.example` to `muhconf.ini` and fire up een editor. All the options are explained in there so git to reading fam. The config file must be kept in the same dir as the skrip.
+
+After that change the contents of the `com.jemoeder.lief.meqqy.plist` file, namely the line that says `<string>Users/[user]/[dir]/serbur/meqqy.pl</string>`. Then just copy it to `~/Library/LaunchAgents` and run `./load`. This makes sure it gets restarted after you reboot or log out and in again. Also it has a keepalive flag so if it died it'll be restarted. ;3
+
+# Android specific shit
+So since I included muh Android st00dio projeckt in this repo as well, you'll need to make some adjustments if you want to release signed APKs lol. Also, I left the example testing classes in there just in case lel.
+
+In the `build.gradle` file there are these 4 lines:
+    storeFile file(getPassword(currentUser, "ANDROID_KEY_STORE"))
+    storePassword getPassword(currentUser, "ANDROID_STORE_PASSWORD")
+    keyAlias getPassword(currentUser, "ANDROID_KEY_ALIAS")
+    keyPassword getPassword(currentUser, "ANDROID_KEY_PASSWORD")
+
+These mean that all signing information (key store file, its password, your key alias and the key password) is st0red in the dankass OS X Keychain. So simply fire up the `Keychain Access` br0gram from `Utilities` and unlock the `login` keychain. Then on the bottom-left pick `Passwords` for categ0ry. Finally click on the small plus button at the very bottom and specify the fields as follows:
+* `Keychain Item Name` => one of the four above mentioned names (the `ANDROID_*` ones etc)
+* `Account Name` => your username (__not__ display name), use Terminal > `whoami` to see this or just look at the name of your home directory
+* `Password` => the value
+
+__Example:__
+* `Keychain Item Name` => `ANDROID_KEY_STORE`
+* `Account Name` => `ayylmao`
+* `Password` => `/Users/ayylmao/pki/android_keystore.jks`
+
+Then repeat that shit for the others. ;] By doing it this way, your priv8 shit is never stored in the `build.gradle` file and it's safe to put it under version contr0l. You'll prolly have to enter all info manually the first time, but if you tick `Remember passwords` it'll save that info somehow (and still not in `build.gradle`). ;];]];
+
+# Hurrrr pls halp it's br0ke
+Simply `./unload` that shit and do `./meqqy.pl` in a terminal, you will most likely get some output that will give you an idea of wats goin on. =]

BIN
app/Meqqy.apk


+ 11 - 0
app/src/.gitignore

@@ -0,0 +1,11 @@
+*.iml
+.gradle
+/local.properties
+/.idea/caches/build_file_checksums.ser
+/.idea/libraries
+/.idea/modules.xml
+/.idea/workspace.xml
+.DS_Store
+/build
+/captures
+.externalNativeBuild

+ 29 - 0
app/src/.idea/codeStyles/Project.xml

@@ -0,0 +1,29 @@
+<component name="ProjectCodeStyleConfiguration">
+  <code_scheme name="Project" version="173">
+    <Objective-C-extensions>
+      <file>
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Import" />
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Macro" />
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Typedef" />
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Enum" />
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Constant" />
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Global" />
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Struct" />
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="FunctionPredecl" />
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Function" />
+      </file>
+      <class>
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Property" />
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Synthesize" />
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InitMethod" />
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="StaticMethod" />
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InstanceMethod" />
+        <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="DeallocMethod" />
+      </class>
+      <extensions>
+        <pair source="cpp" header="h" fileNamingConvention="NONE" />
+        <pair source="c" header="h" fileNamingConvention="NONE" />
+      </extensions>
+    </Objective-C-extensions>
+  </code_scheme>
+</component>

+ 38 - 0
app/src/.idea/misc.xml

@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="NullableNotNullManager">
+    <option name="myDefaultNullable" value="android.support.annotation.Nullable" />
+    <option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
+    <option name="myNullables">
+      <value>
+        <list size="7">
+          <item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
+          <item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
+          <item index="2" class="java.lang.String" itemvalue="javax.annotation.CheckForNull" />
+          <item index="3" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
+          <item index="4" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
+          <item index="5" class="java.lang.String" itemvalue="androidx.annotation.Nullable" />
+          <item index="6" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNullable" />
+        </list>
+      </value>
+    </option>
+    <option name="myNotNulls">
+      <value>
+        <list size="6">
+          <item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
+          <item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
+          <item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
+          <item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />
+          <item index="4" class="java.lang.String" itemvalue="androidx.annotation.NonNull" />
+          <item index="5" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNonNull" />
+        </list>
+      </value>
+    </option>
+  </component>
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
+    <output url="file://$PROJECT_DIR$/build/classes" />
+  </component>
+  <component name="ProjectType">
+    <option name="id" value="Android" />
+  </component>
+</project>

+ 12 - 0
app/src/.idea/runConfigurations.xml

@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="RunConfigurationProducerService">
+    <option name="ignoredProducers">
+      <set>
+        <option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
+        <option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
+        <option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
+      </set>
+    </option>
+  </component>
+</project>

+ 1 - 0
app/src/app_Meqqy/.gitignore

@@ -0,0 +1 @@
+/build

+ 63 - 0
app/src/app_Meqqy/build.gradle

@@ -0,0 +1,63 @@
+apply plugin: 'com.android.application'
+
+// Only relevant for signing "release" APKs, retrieves signing key/store information from the Mac OS X keychain ;]
+// Refer to the README for more info on that shit
+def getPassword(String currentUser, String item) {
+    def stdout = new ByteArrayOutputStream()
+    def stderr = new ByteArrayOutputStream()
+    exec {
+        commandLine 'security', '-q', 'find-generic-password', '-a', currentUser, '-gl', item
+        standardOutput = stdout
+        errorOutput = stderr
+        ignoreExitValue true
+    }
+    //noinspection GroovyAssignabilityCheck
+    (stderr.toString().trim() =~ /password: ["'](.*)["']/)[0][1]
+}
+
+// Get username of person currently running (prolly) Android st00dio
+ext.currentUser = System.getenv('USER')
+
+android {
+    signingConfigs {
+        muhconfig {
+            // There are 4 keychain items for the user lol
+            storeFile file(getPassword(currentUser, "ANDROID_KEY_STORE"))
+            storePassword getPassword(currentUser, "ANDROID_STORE_PASSWORD")
+            keyAlias getPassword(currentUser, "ANDROID_KEY_ALIAS")
+            keyPassword getPassword(currentUser, "ANDROID_KEY_PASSWORD")
+        }
+    }
+
+    compileSdkVersion 28
+    defaultConfig {
+        applicationId "com.jemoeder.lief.meqqy"
+        minSdkVersion 25
+        //noinspection ExpiredTargetSdkVersion ZERO FUCKS GIVEN (ain't publishan on Jewgle gay st0re anyways so)
+        targetSdkVersion 25
+        versionCode 1
+        versionName "1.0"
+        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+        signingConfig signingConfigs.muhconfig
+    }
+    buildTypes {
+        release {
+            // Proguard that shit for release APKs
+            minifyEnabled true
+            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+            signingConfig signingConfigs.muhconfig
+        }
+    }
+}
+
+dependencies {
+    implementation fileTree(dir: 'libs', include: ['*.jar'])
+    implementation 'com.android.support:appcompat-v7:28.0.0'
+    implementation 'com.android.support:support-v4:28.0.0'
+    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
+    implementation 'com.android.support:design:28.0.0'
+
+    testImplementation 'junit:junit:4.12'
+    androidTestImplementation 'com.android.support.test:runner:1.0.2'
+    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
+}

+ 21 - 0
app/src/app_Meqqy/proguard-rules.pro

@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+#   http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+#   public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile

+ 26 - 0
app/src/app_Meqqy/src/androidTest/java/com/jemoeder/lief/meqqy/ExampleInstrumentedTest.java

@@ -0,0 +1,26 @@
+package com.jemoeder.lief.meqqy;
+
+import android.content.Context;
+import android.support.test.InstrumentationRegistry;
+import android.support.test.runner.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+    @Test
+    public void useAppContext() {
+        // Context of the app under test.
+        Context appContext = InstrumentationRegistry.getTargetContext();
+
+        assertEquals("com.jemoeder.lief.meqqy", appContext.getPackageName());
+    }
+}

+ 43 - 0
app/src/app_Meqqy/src/main/AndroidManifest.xml

@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    package="com.jemoeder.lief.meqqy">
+
+    <!-- Need an internet connection to work 0bv lol -->
+    <uses-permission android:name="android.permission.INTERNET" />
+
+    <!-- We need a networkSecurityConfig to check for user installed certificate authoritays ;] -->
+    <!-- configChanges is used so when you rotate your phone while inside the app, the layout doesn't get reset to default texts etc -->
+    <application
+        android:networkSecurityConfig="@xml/network_security_config"
+        android:allowBackup="true"
+        android:icon="@mipmap/ic_launcher"
+        android:label="@string/app_name"
+        android:supportsRtl="true"
+        android:theme="@style/MeqqyTheme">
+
+        <activity
+            android:name=".MainActivity"
+            android:label="@string/app_name"
+            android:configChanges="orientation|keyboardHidden"
+            android:windowSoftInputMode="adjustPan">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>
+            <intent-filter>
+                <action android:name="android.intent.action.VIEW" />
+            </intent-filter>
+        </activity>
+
+        <activity
+            android:name=".SettingsActivity"
+            android:label="@string/title_activity_settings"
+            android:parentActivityName=".MainActivity"
+            android:windowSoftInputMode="adjustPan">
+            <meta-data
+                android:name="android.support.PARENT_ACTIVITY"
+                android:value="com.jemoeder.lief.meqqy.MainActivity" />
+        </activity>
+    </application>
+
+</manifest>

BIN
app/src/app_Meqqy/src/main/ic_launcher-web.png


+ 930 - 0
app/src/app_Meqqy/src/main/java/com/jemoeder/lief/meqqy/MainActivity.java

@@ -0,0 +1,930 @@
+/* Copyright (C) All Rights Reserved
+ ** Written by Wazakindjes <waza@malvager.net>
+ ** Website: https://gitgud.malvager.net/Wazakindjes/Meqqy
+ ** License: https://gitgud.malvager.net/Wazakindjes/Meqqy/raw/master/LICENSE
+*/
+package com.jemoeder.lief.meqqy;
+
+// A shitload of imports l m a o
+import android.content.Context;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.content.res.Configuration;
+import android.content.res.Resources;
+import android.os.AsyncTask;
+import android.os.Bundle;
+import android.preference.PreferenceManager;
+
+import android.support.design.widget.CoordinatorLayout;
+import android.support.design.widget.Snackbar;
+import android.support.v4.content.ContextCompat;
+import android.support.v7.app.AppCompatActivity;
+
+import android.view.Menu;
+import android.view.MenuItem;
+import android.view.MotionEvent;
+import android.view.View;
+import android.widget.Button;
+import android.widget.NumberPicker;
+import android.widget.SeekBar;
+import android.widget.TextView;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.PrintWriter;
+import java.net.InetAddress;
+import java.net.Socket;
+import java.net.SocketTimeoutException;
+import java.net.UnknownHostException;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLEngine;
+import javax.net.ssl.SSLSocket;
+import javax.net.ssl.SSLSocketFactory;
+import javax.net.ssl.TrustManager;
+import javax.net.ssl.X509ExtendedTrustManager;
+
+import java.util.Vector;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import static java.lang.System.currentTimeMillis;
+
+public class MainActivity extends AppCompatActivity {
+    // Also a l0ad of global variables =]]]]
+    // Preferences related
+    private SharedPreferences muhprefs;
+    private SharedPreferences.Editor muhprefs_ed;
+    private String authkey;
+    private String serbur;
+    private String pot;
+    private int ping;
+
+    // Socket shit fam
+    private boolean coldstart = true;
+    private boolean connecting = false;
+    private boolean reconnecting = false;
+    private boolean sockerr = false;
+    private SSLSocket muhsock;
+    private PrintWriter muhsock_out;
+    private BufferedReader muhsock_in;
+
+    // Sending sommands and getting em output
+    private boolean sentcmd;
+    private muhSender lolsender;
+    private muhReceiver lolreceiver;
+    private Vector<String> muhcmds = new Vector<>();
+
+    // Snackbar yo
+    private CoordinatorLayout muhparent;
+    private int sb_bgcol;
+    private int sb_bgcol_err;
+    private int sb_tcol;
+
+    // Some important View stuff
+    private Button firstview;
+    private Vector<Object> muhviews = new Vector<>();
+    private TextView connstatus;
+    private TextView errortxt;
+
+    // Also seekbars lel
+    private boolean block_seekbars = true;
+    private SeekBar volbar;
+    private TextView vb_label;
+    private int vb_pos = 0;
+    private int vb_last = 0;
+    private boolean volinit = false;
+    private int volstep = 1;
+
+    private SeekBar brightbar;
+    private TextView bb_label;
+    private int bb_pos = 0;
+    private int bb_last = 0;
+    private boolean brightinit = false;
+
+    // Misc
+    private Resources muhres;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_main);
+
+        // Initialise (most of) the global vars right hur phambly
+        Context ctx = getApplicationContext();
+        muhparent = findViewById(R.id.muhparent);
+        sb_bgcol = ContextCompat.getColor(ctx, R.color.snackbar_background);
+        sb_bgcol_err = ContextCompat.getColor(ctx, R.color.snackbar_background_err);
+        sb_tcol = ContextCompat.getColor(ctx, R.color.snackbar_text);
+
+        volbar = findViewById(R.id.mainact_volumebar);
+        vb_label = findViewById(R.id.mainact_label_volume);
+        brightbar = findViewById(R.id.mainact_brightnessbar);
+        bb_label = findViewById(R.id.mainact_label_brightness);
+
+        firstview = findViewById(R.id.mainact_button_playpause);
+        muhviews.add(firstview);
+        muhviews.add(findViewById(R.id.mainact_button_muteunmute));
+        muhviews.add(findViewById(R.id.mainact_button_prev));
+        muhviews.add(findViewById(R.id.mainact_button_next));
+        muhviews.add(volbar);
+        muhviews.add(findViewById(R.id.mainact_button_voldown));
+        muhviews.add(findViewById(R.id.mainact_button_volup));
+        muhviews.add(findViewById(R.id.mainact_button_lockscreen));
+        muhviews.add(brightbar);
+        muhviews.add(findViewById(R.id.mainact_button_brightdown));
+        muhviews.add(findViewById(R.id.mainact_button_brightup));
+        muhviews.add(findViewById(R.id.mainact_button_brightmin));
+        muhviews.add(findViewById(R.id.mainact_button_brightmax));
+        muhviews.add(findViewById(R.id.mainact_nosleep_h));
+        muhviews.add(findViewById(R.id.mainact_nosleep_m));
+        muhviews.add(findViewById(R.id.mainact_nosleep_s));
+        muhviews.add(findViewById(R.id.mainact_button_nosleep));
+        muhviews.add(findViewById(R.id.mainact_button_nosleep_undo));
+
+        connstatus = findViewById(R.id.mainact_connstatus);
+        errortxt = findViewById(R.id.mainact_connstatus_errortxt);
+
+        muhres = getResources();
+        muhprefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
+        muhprefs_ed = muhprefs.edit();
+
+        // When dragging seekbars, gotta update the value label on the right of it as well as send the !volume command on release
+        volbar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
+            @Override
+            public void onStopTrackingTouch(SeekBar seekBar) {
+                if(!block_seekbars && vb_pos != vb_last) {
+                    seekBar.setTag(muhres.getString(R.string.cmd_volume) + " " + String.valueOf(vb_pos));
+                    mainact_docmd(seekBar);
+                }
+            }
+
+            @Override
+            public void onStartTrackingTouch(SeekBar seekBar) {
+                vb_last = seekBar.getProgress();
+                volinit = true;
+            }
+
+            @Override
+            public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
+                vb_pos = progress;
+                vb_label.setText(String.valueOf(progress));
+                muhprefs_ed.putInt("lastval_volumebar", progress);
+                muhprefs_ed.apply();
+            }
+        });
+
+        // Also prevent draggin if we're not even connected lol
+        //noinspection AndroidLintClickableViewAccessibility ZERO FUCKS GIVEN
+        volbar.setOnTouchListener(new View.OnTouchListener() {
+            @Override
+            public boolean onTouch(View v, MotionEvent me) {
+                return block_seekbars;
+            }
+        });
+
+        // Same listeners for brightness bar obv ;]
+        brightbar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
+            @Override
+            public void onStopTrackingTouch(SeekBar seekBar) {
+                if(!block_seekbars && bb_pos != bb_last) {
+                    seekBar.setTag(muhres.getString(R.string.cmd_brightness) + " " + String.valueOf(bb_pos));
+                    mainact_docmd(seekBar);
+                }
+            }
+
+            @Override
+            public void onStartTrackingTouch(SeekBar seekBar) {
+                bb_last = seekBar.getProgress();
+                brightinit = true;
+            }
+
+            @Override
+            public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
+                bb_pos = progress;
+                bb_label.setText(String.valueOf(progress));
+                muhprefs_ed.putInt("lastval_brightnessbar", progress);
+                muhprefs_ed.apply();
+            }
+        });
+        //noinspection AndroidLintClickableViewAccessibility ZERO FUCKS GIVEN
+        brightbar.setOnTouchListener(new View.OnTouchListener() {
+            @Override
+            public boolean onTouch(View v, MotionEvent me) {
+                return block_seekbars;
+            }
+        });
+
+        // Initialise bars w/ last stored progress
+        volbar.setProgress(muhprefs.getInt("lastval_volumebar", 20));
+        brightbar.setProgress(muhprefs.getInt("lastval_brightnessbar", 8));
+
+        // Also enable em controls right away if the socket managed to connect already xd
+        if(muhsock != null) {
+            setStatus(R.color.gucci, R.string.main_status_gucci, "");
+            setControlsEnabled(true);
+        }
+    }
+
+    @Override
+    public void onConfigurationChanged(Configuration newConfig) {
+        // Just a qt lil hack so the layout texts don't get refreshed on orientation changes lol
+        super.onConfigurationChanged(newConfig);
+    }
+
+    @Override
+    protected void onResume() {
+        // Gotta reinitialise some preferences every time we go from the Settings screen back to hur
+        authkey = muhprefs.getString("prefs_authkey", "LOLNOPE");
+        serbur = muhprefs.getString("prefs_serbur", "LOLNOPE");
+        pot = muhprefs.getString("prefs_pot", "6969");
+
+        // Some integer values are stored as a string so try to convert that shit, also make sure the result isn't out of dem pre-set bounds
+        String ping_s = muhprefs.getString("prefs_ping", "30");
+        try { ping = Integer.parseInt(ping_s); } catch(Exception fuckoff) { /* No flying fucks given */ }
+        if(ping_s == null || ping <= 0 || ping >= 100) {
+            ping = 30;
+        }
+
+        String volstep_s = muhprefs.getString("prefs_volstep", "1");
+        try { volstep = Integer.parseInt(volstep_s); } catch(Exception fuckoff) { /* No flying fucks given */ }
+        if(volstep_s == null || volstep <= 0) {
+            volstep_s = "1";
+            volstep = 1;
+        }
+        else if(volstep > 10) {
+            volstep_s = "10";
+            volstep = 10;
+        }
+
+        // Make sure the view tags (which are used for passing along the command) contain the proper volume step size imo
+        findViewById(R.id.mainact_button_voldown).setTag(muhres.getString(R.string.cmd_voldown) + volstep_s);
+        findViewById(R.id.mainact_button_volup).setTag(muhres.getString(R.string.cmd_volup) + volstep_s);
+
+        // We process autoconnect from onResume and not onCreate cuz I cbf resetting prefs etc in multiple places ;]
+        if(coldstart) {
+            coldstart = false;
+            if(muhprefs.getBoolean("prefs_autoconnect", false) && !connecting) {
+                connectem();
+            }
+        }
+        super.onResume();
+    }
+
+    @Override
+    public boolean onCreateOptionsMenu(Menu menu) {
+        // Create menu obv
+        menu.clear();
+        getMenuInflater().inflate(R.menu.main, menu);
+        return true;
+    }
+
+    @Override
+    public boolean onOptionsItemSelected(MenuItem item) {
+        // Checkem menu options
+        switch(item.getItemId()) {
+            case R.id.action_settings:
+                startActivity(new Intent(getApplicationContext(), SettingsActivity.class));
+                return true;
+
+            case R.id.action_reconnect:
+                // Don't do double reconnects ;]
+                if(connecting) {
+                    return false;
+                }
+                connectem();
+                return true;
+        }
+        return false;
+    }
+
+    // Wrapper function for setting the status text up top
+    private void _setstatuslol(int col, int status) {
+        connstatus.setTextColor(ContextCompat.getColor(getApplicationContext(), col));
+        connstatus.setText(status);
+    }
+
+    // Overl0aded shit so we can pass an R.string as well as a literal string for the status description ;]
+    public void setStatus(int col, int status, String err) {
+        errortxt.setTextColor(ContextCompat.getColor(getApplicationContext(), col));
+        errortxt.setText(err);
+        _setstatuslol(col, status);
+    }
+
+    public void setStatus(int col, int status, int err) {
+        errortxt.setTextColor(ContextCompat.getColor(getApplicationContext(), col));
+        errortxt.setText(err);
+        _setstatuslol(col, status);
+    }
+
+    // Also a simple wrappur for displaying em snackbars
+    public void doSnackbar(String pm, int pl, boolean waserr) {
+        Snackbar allahu_snackbar = Snackbar.make(muhparent, pm, pl);
+        TextView tv = allahu_snackbar.getView().findViewById(android.support.design.R.id.snackbar_text);
+        if(waserr) {
+            tv.setBackgroundColor(sb_bgcol_err);
+        }
+        else {
+            tv.setBackgroundColor(sb_bgcol);
+        }
+        tv.setTextColor(sb_tcol);
+        allahu_snackbar.show();
+    }
+
+    // Flips enabled status for all editable and button controls =]]
+    private void setControlsEnabled(boolean flag) {
+        if(firstview.isEnabled() == flag) {
+            return;
+        }
+        float alpha = (flag ? 1.0f : 0.5f);
+        for(Object o : muhviews) {
+            View v = (View)o;
+            v.setEnabled(flag);
+            v.setAlpha(alpha);
+        }
+        block_seekbars = !flag; // Also make sure seekbars get blocked if we're disabling em controls
+    }
+
+    // Function called by tapping on buttons for firing commands
+    public void mainact_docmd(View v) {
+        int id = v.getId();
+        String vid = muhres.getResourceEntryName(id);
+        String cmd = v.getTag().toString();
+        boolean undo = false;
+
+        // Function shouldn't be able to get fired when controls are disabled, but just in case =]
+        if(muhsock == null) {
+            setStatus(R.color.RIP, R.string.main_status_rip, R.string.main_status_errtxt_notconnected);
+            return;
+        }
+
+        // Volume and brightness are a little special in that we initialise it to an exact integer the first time you use em up/down buttons
+        // This is so the value displayed in-app matches what the Mac is actually using xd
+        Pattern p_vol = Pattern.compile("^mainact_button_vol(up|down)$");
+        Matcher m_vol = p_vol.matcher(vid);
+        if(m_vol.find()) {
+            String dir = m_vol.group(1);
+            int vol = volbar.getProgress();
+            if(dir.equals("up")) {
+                vol += volstep;
+            }
+            else {
+                vol -= volstep;
+            }
+            if(vol > 100 || vol < 0) {
+                return;
+            }
+
+            if(!volinit) {
+                cmd = muhres.getString(R.string.cmd_volume) + " " + String.valueOf(vol);
+                volinit = true;
+            }
+            volbar.setProgress(vol);
+        }
+
+        Pattern p_bright = Pattern.compile("^mainact_button_bright(up|down|min|max)$");
+        Matcher m_bright = p_bright.matcher(vid);
+        if(m_bright.find()) {
+            String dir = m_bright.group(1);
+            int bright = brightbar.getProgress();
+            switch(dir) {
+                case "up":
+                    bright++;
+                    if(!brightinit) {
+                        cmd = cmd.replace("up", String.valueOf(bright));
+                    }
+                    break;
+                case "down":
+                    bright--;
+                    if(!brightinit) {
+                        cmd = cmd.replace("down", String.valueOf(bright));
+                    }
+                    break;
+                case "min":
+                    bright = 1;
+                    break;
+                case "max":
+                    bright = 16;
+                    break;
+                default:
+                    break;
+            }
+
+            if(bright > 16 || bright < 0) {
+                return;
+            }
+            brightinit = true;
+            brightbar.setProgress(bright);
+        }
+
+        // For the nosleep buttons we gotta extract the numberpickers' values and create a "time string" (1h2m3s etc)
+        if(id == R.id.mainact_button_nosleep || (undo = (id == R.id.mainact_button_nosleep_undo))) {
+            String time = "";
+
+            NumberPicker v_h = findViewById(R.id.mainact_nosleep_h);
+            int h_i = v_h.getValue();
+            if(h_i > 0) {
+                if(h_i > 24) {
+                    h_i = 24;
+                }
+                time += String.valueOf(h_i) + "h";
+            }
+
+            NumberPicker v_m = findViewById(R.id.mainact_nosleep_m);
+            int m_i = v_m.getValue();
+            if(m_i > 0) {
+                if(m_i >= 60) {
+                    m_i = 59;
+                }
+                time += String.valueOf(m_i) + "m";
+            }
+
+            NumberPicker v_s = findViewById(R.id.mainact_nosleep_s);
+            int s_i = v_s.getValue();
+            if(s_i > 0) {
+                if(s_i >= 60) {
+                    s_i = 59;
+                }
+                time += String.valueOf(s_i) + "s";
+            }
+
+            // Shit's empty if all pickers are set to 0 lol
+            if(time.isEmpty()) {
+                doSnackbar(muhres.getString(R.string.mainact_snackbar_nosleep_empty), Snackbar.LENGTH_LONG, false);
+                return;
+            }
+
+            if(undo) {
+                v_h.setValue(0);
+                v_m.setValue(0);
+                v_s.setValue(0);
+            }
+            else {
+                cmd += " " + time;
+            }
+        }
+
+        muhcmds.add(cmd); // Add to vector so it gets picked up by the sender thread
+    }
+
+    // Connects to the "API" imo tbh fam
+    private void connectem() {
+        connecting = true;
+
+        // Only need to check these settings at connect-time =]
+        int pot_i = 0;
+        try { pot_i = Integer.parseInt(pot); } catch(Exception fuckoff) { /* No flying fucks given */ }
+        if(authkey == null || authkey.isEmpty() || authkey.equals("LOLNOPE") || authkey.equals("1234567890abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQR")) {
+            setStatus(R.color.RIP, R.string.main_status_rip, R.string.main_status_errtxt_default_authkey);
+            connecting = false;
+            return;
+        } else if(serbur == null || serbur.isEmpty() || serbur.equals("LOLNOPE") || serbur.equals("192.168.1.0")) {
+            setStatus(R.color.RIP, R.string.main_status_rip, R.string.main_status_errtxt_default_serbur);
+            connecting = false;
+            return;
+        } else if(authkey.length() != 64) {
+            setStatus(R.color.RIP, R.string.main_status_rip, R.string.main_status_errtxt_key);
+            connecting = false;
+            return;
+        } else if(pot == null || pot_i <= 1024 || pot_i >= 65535) {
+            setStatus(R.color.RIP, R.string.main_status_rip, R.string.main_status_errtxt_invalidport);
+            connecting = false;
+            return;
+        }
+
+        // Gotta initialise AnyTrust here (to ignore TLS errors) cuz no can do from an AsyncTask apparently
+        boolean fucktls = muhprefs.getBoolean("prefs_fucktls", false);
+        AnyTrust at = (fucktls ? new AnyTrust() : null);
+
+        // If we're already connected, make sure we disconnect and show additional messages
+        if(muhsock != null) {
+            reconnecting = true;
+            setControlsEnabled(false);
+            muhcmds.add(muhres.getString(R.string.cmd_quit));
+        }
+
+        // Display message and do that shit
+        setStatus(R.color.colorAccent, R.string.main_status_connecting, (reconnecting ? R.string.main_status_errtxt_reconnect : R.string.NOSTRING));
+        connectAPI capi = new connectAPI(this, authkey, serbur, pot_i, at);
+        capi.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
+    }
+
+    // Sender thread =]
+    public static class muhSender extends AsyncTask<Void, Void, Void> {
+        // Some globals cuz we check some of these in onPostExecute as well
+        private int col;
+        private int status;
+        private int err;
+        private String errstr;
+        private MainActivity main;
+
+        muhSender(MainActivity a) {
+            col = R.color.colorAccent; // Just a default colour imo
+            status = -1; // For easy checking of what/when to display something
+            err = -1;
+            errstr = "";
+            main = a; // Gotta communicate w/ MainActivity sometimes
+        }
+
+        @Override
+        protected Void doInBackground(Void... arg0) {
+            String pingcmd = main.muhres.getString(R.string.cmd_ping) + "\r\n"; // So we don't keep concatenating this shit in a loop
+            long keepalive = currentTimeMillis() + 1000; // Set socket-alive check interval
+            long gottaping = (keepalive - 1000) + (main.ping * 1000); // Also ping interval
+            boolean quit; // Gotta break some shit if we did !quit
+            String quitstr = main.muhres.getString(R.string.cmd_quit);
+            while(main.muhsock != null) {
+                boolean sentcmd = false; // No need for keepalive if we sent a command ;]
+                try { Thread.sleep(100); } catch(Exception fuckoff) { /* No flying fucks given */ }
+                try {
+                    int cmdsize = main.muhcmds.size(); // Cuz cbf accessing this in a (for) loop either ;]
+                    quit = false;
+                    if(cmdsize > 0) {
+                        for(int cmdi = 0; cmdi < cmdsize; cmdi++) {
+                            // Don't change the status text when we quitting due to conflicting messages being displayed otherwise xd
+                            String cmd = main.muhcmds.elementAt(cmdi);
+                            if(cmd.equals(quitstr)) {
+                                quit = true;
+                                setMainStatus(0, 0, "", "Sending: " + cmd, Snackbar.LENGTH_SHORT);
+                            }
+                            else {
+                                setMainStatus(R.color.colorAccent, R.string.main_status_working, "", "Sending: " + cmd, Snackbar.LENGTH_SHORT);
+                            }
+
+                            // Write that shit and check for socket errors
+                            main.muhsock_out.write(cmd + "\r\n");
+                            if(main.muhsock_out.checkError()) {
+                                throw new Exception("reeeEeEEEeEEEE");
+                            }
+                            if(quit) {
+                                // Gotta make sure the receiver thread also fucks off y0 =]]]]
+                                main.reconnecting = true;
+                                break;
+                            }
+                            sentcmd = main.sentcmd = true;
+                        }
+
+                        // If we quitting, make sure to remove _all_ currently buffered commands by getting the size again ;]
+                        if(quit) {
+                            cmdsize = main.muhcmds.size();
+                        }
+                        for(int i = 0; i < cmdsize; i++) {
+                            main.muhcmds.remove(0);
+                        }
+                        if(quit) {
+                            // Gonna attempt een clean shutdown imo
+                            col = R.color.colorAccent;
+                            status = R.string.main_status_connecting;
+                            err = R.string.main_status_errtxt_cleansocketclose;
+                            throw new Exception("Quitting lol"); // Let the exception handler close errythang ;]
+                        }
+                    }
+
+                    // Check if we need to send ping or keepalive hax
+                    // Ping is always relative to the start time while keepalive uses the current time, to make sure ping doesn't drift and keepalive doesn't spam its shit
+                    long curms = currentTimeMillis();
+                    if(curms < gottaping) {
+                        // Only do keepalive if we're not pinging or sent any other commands obv
+                        if(curms >= keepalive) {
+                            main.muhsock_out.write("\r\n");
+                            if(main.muhsock_out.checkError()) {
+                                throw new Exception("reeeEeEEEeEEEE");
+                            }
+                            keepalive = curms + 1000;
+                        }
+                        else if(sentcmd) {
+                            keepalive = curms + 1000;
+                        }
+                        continue;
+                    }
+                    gottaping += (main.ping * 1000);
+                    keepalive = curms + 1000;
+                    main.muhsock_out.write(pingcmd);
+                    if(main.muhsock_out.checkError()) {
+                        throw new Exception("reeeEeEEEeEEEE");
+                    }
+                } catch(Exception fuckoff) {
+                    // Always try to close the socket because either A) someting went w0ng anyways or B) we're !quitting
+                    try {
+                        main.muhsock_out.close();
+                        main.muhsock_in.close();
+                        main.muhsock.close();
+                    } catch(Exception fuckoff2) {
+                        // No flying fucks given
+                    }
+                    main.muhsock = null;
+                    if(!main.reconnecting) {
+                        col = R.color.RIP;
+                        status = R.string.main_status_rip;
+                        err = R.string.main_status_errtxt_ripsocket;
+                    }
+                    break; // LOL KBAI
+                }
+            }
+            return null;
+        }
+
+        @Override
+        protected void onPostExecute(Void result) {
+            // sockerr is already set by the receiver thread if it happens to notice the error before this sender thread
+            // Also make sure we have at least some status message lol
+            if(main.sockerr || status == -1) {
+                return;
+            }
+            if(err != -1) {
+                if(err == R.string.main_status_errtxt_ripsocket) {
+                    main.sockerr = true;
+                    main.doSnackbar("Aye rip socket lol", Snackbar.LENGTH_LONG, true);
+                }
+                main.setStatus(col, status, err);
+            }
+            else {
+                main.setStatus(col, status, errstr);
+            }
+            main.setControlsEnabled(false); // Since this thread is rip we're not connected anymore sooooooo
+        }
+
+        // Lil wrapper for setting the text messages in MainActivity (has to be done on the UI thread, thanks Google)
+        // This either A) displays a snackbar B) changes the status message C) both
+        private void setMainStatus(final int c, final int s, final String e, final String pm, final int pl) {
+            main.runOnUiThread(new Runnable() {
+                @Override
+                public void run() {
+                    // Supported Snackbar lengths are -2, -1 and 0 so when it's 99 we know not to send one ;]
+                    if(pl != 99) {
+                        main.doSnackbar(pm, pl, (c == R.color.RIP));
+                    }
+
+                    // Status message should be set before we even attempt to change it obv
+                    if(s != 0) {
+                        main.setStatus(c, s, e);
+                    }
+                }
+            });
+        }
+    }
+
+    // Receiver thread lol, logic is mostly the same as for the sender ;];];]
+    public static class muhReceiver extends AsyncTask<Void, Void, Void> {
+        private int col;
+        private int status;
+        private int err;
+        private String errstr;
+        private MainActivity main;
+
+        muhReceiver(MainActivity a) {
+            col = R.color.colorAccent;
+            status = -1;
+            err = -1;
+            errstr = "";
+            main = a;
+
+            // Set the underlying read() call's timeout to 100ms so it doesn't keep fucking blocking until it has data
+            try { main.muhsock.setSoTimeout(100); } catch(Exception fuckoff) { /* No flying fucks given */ }
+        }
+
+        @Override
+        protected Void doInBackground(Void... arg0) {
+            while(main.muhsock != null) {
+                // Let's poll every 100ms with a max polling time of 100ms to prevent using too many CPU cycles
+                try { Thread.sleep(100); } catch(Exception fuckoff) { /* No flying fucks given */ }
+                try {
+                    // Data is null or is of zero length if we reached the 100ms read timeout =]
+                    String muhdata = null;
+                    try {
+                        muhdata = main.muhsock_in.readLine();
+                    } catch(SocketTimeoutException fuckoff) {
+                        // No flying fucks given (happens when readLine() don't return shit lol)
+                    } catch(Exception fuckoff2) {
+                        // Something else went wrong, also break the outer try =]]]
+                        throw new Exception(fuckoff2.getMessage());
+                    }
+
+                    // If we have data this is a response to a certain command and it's an error :DDDDDDD
+                    if(muhdata != null && muhdata.length() > 0) {
+                        main.sentcmd = false; // Make sure the error doesn't get overwritten by WE GUCCI ;]
+
+                        // The snackbar with "Sending: !cmd" is probs still in view, so give it some time to be properly animated
+                        try { Thread.sleep(500); } catch(Exception fuckoff) { /* No flying fucks given */ }
+
+                        // The error might be too long for a snackbar so let's just say shit rip'd and change the status text to hold the full error
+                        setMainStatus(R.color.RIP, R.string.main_status_rip, muhdata, "Got an error lol (see em at the top)", Snackbar.LENGTH_LONG);
+                    }
+                    else {
+                        // If we sent a command before and didn't receive a response, set the status message accordingly
+                        if(main.sentcmd) {
+                            main.sentcmd = false; // Also make sure we don't keep doing this until another command is sent
+                            setMainStatus(R.color.gucci, R.string.main_status_gucci, "", "", 99);
+                        }
+                    }
+                } catch(Exception fuckoff) {
+                    // Always try to close here too ;]
+                    try {
+                        main.muhsock_out.close();
+                        main.muhsock_in.close();
+                        main.muhsock.close();
+                    } catch(Exception fuckoff2) {
+                        // No flying fucks given
+                    }
+                    main.muhsock = null;
+                    if(!main.reconnecting) {
+                        col = R.color.RIP;
+                        status = R.string.main_status_rip;
+                        err = R.string.main_status_errtxt_ripsocket;
+                    }
+                    break; // LOL KBAI
+                }
+            }
+            return null;
+        }
+
+        @Override
+        protected void onPostExecute(Void result) {
+            if(main.sockerr || status == -1) {
+                return;
+            }
+            if(err != -1) {
+                if(err == R.string.main_status_errtxt_ripsocket) {
+                    main.sockerr = true;
+                    main.doSnackbar("Aye rip socket lol", Snackbar.LENGTH_LONG, true);
+                }
+                main.setStatus(col, status, err);
+            }
+            else {
+                main.setStatus(col, status, errstr);
+            }
+            main.setControlsEnabled(false);
+        }
+
+        private void setMainStatus(final int c, final int s, final String e, final String pm, final int pl) {
+            main.runOnUiThread(new Runnable() {
+                @Override
+                public void run() {
+                    if(pl != 99) {
+                        main.doSnackbar(pm, pl, (c == R.color.RIP));
+                    }
+                    if(c != 0) {
+                        main.setStatus(c, s, e);
+                    }
+                }
+            });
+        }
+    }
+
+    // Thread for setting up the connecting
+    public static class connectAPI extends AsyncTask<Void, Void, Void> {
+        // Gotta pass along some preferences
+        private String authkey;
+        private String serbur;
+        private int pot;
+
+        // Same globals as before lol
+        private int status;
+        private int err;
+        private String errstr;
+        private MainActivity main;
+
+        // Also some only relevant for this thread
+        private AnyTrust at;
+        SSLSocket muhsock;
+        PrintWriter muhsock_out;
+        BufferedReader muhsock_in;
+
+        connectAPI(MainActivity a, String b, String c, int d, AnyTrust e) {
+            status = R.string.main_status_rip;
+            err = R.string.NOSTRING;
+            errstr = "";
+            main = a;
+            authkey = b;
+            serbur = c;
+            pot = d;
+            at = e;
+        }
+
+        @Override
+        protected Void doInBackground(Void... arg0) {
+            // Cancel the running sender/receiver threads if we're reconnecting and give them both some time to gtfo
+            if(main.muhsock != null) {
+                try { Thread.sleep(500); } catch(Exception fuckoff) { /* No flying fucks given */ }
+                if(main.lolreceiver != null) {
+                    main.lolreceiver.cancel(true);
+                }
+                if(main.lolsender != null) {
+                    main.lolsender.cancel(true);
+                }
+                try { main.muhsock.close(); } catch(Exception fuckoff) { /* No flying fucks given */ }
+                try { Thread.sleep(500); } catch(Exception fuckoff) { /* No flying fucks given */ }
+                main.muhsock = null;
+            }
+
+            // Connectem y0
+            try {
+                InetAddress serverAddr = InetAddress.getByName(serbur); // Cuz we prolly wanna support DNS too and not just IPs xd
+                SSLSocketFactory sslf;
+
+                // Some fucking bs for ignoring TLS errors .-.
+                final SSLContext sslContext = SSLContext.getInstance("TLS");
+                if(at != null) {
+                    sslContext.init(null, new TrustManager[]{at}, null);
+                    sslf = sslContext.getSocketFactory();
+                }
+                else {
+                    sslf = (SSLSocketFactory)SSLSocketFactory.getDefault();
+                }
+
+                // Set up a socket and start em handshaek (give it 5 seconds to complete a read for this)
+                muhsock = (SSLSocket)sslf.createSocket(serverAddr, pot);
+                muhsock.setSoTimeout(5000);
+                muhsock.startHandshake();
+
+                // 15 seconds for reading the authentication response
+                muhsock.setSoTimeout(15000);
+
+                // Set up IO streams and write that shit fam
+                muhsock_out = new PrintWriter(muhsock.getOutputStream());
+                muhsock_in = new BufferedReader(new InputStreamReader(muhsock.getInputStream()));
+                muhsock_out.write("!auth " + authkey + "\r\n");
+                if(muhsock_out.checkError()) {
+                    throw new IOException("Unable to write to socket (unknown error)");
+                }
+
+                String muhdata = muhsock_in.readLine();
+                if(muhdata == null || !muhdata.matches("Accepted.*")) {
+                    // Not actually a null pointer but cbf setting up a custom Exception class just for these 2 lines xd
+                    // Also there's actually zero chance of there being an actuall null pointer here sooo
+                    throw new NullPointerException("Auth failed lol");
+                }
+                errstr = muhdata;
+                status = R.string.main_status_gucci;
+            } catch(UnknownHostException e) {
+                err = R.string.main_status_errtxt_invalidserver;
+            } catch(IOException e) {
+                errstr = "IO error: " + e.getMessage();
+            } catch(NullPointerException e) {
+                err = R.string.main_status_errtxt_auth;
+            } catch(Exception e) {
+                errstr = "Misc error: " + e.getMessage();
+            }
+            return null;
+        }
+
+        @Override
+        protected void onPostExecute(Void result) {
+            // Set status messages according to connection results =]
+            int col = (status == R.string.main_status_gucci ? R.color.gucci : R.color.RIP);
+            if(!errstr.isEmpty()) {
+                main.setStatus(col, status, errstr);
+            }
+            else {
+                main.setStatus(col, status, err);
+            }
+
+            // We rip, try to close w/e we had lol
+            if(col == R.color.RIP) {
+                try {
+                    // Double try cuz we might not have open streams but we might have an open socket
+                    try {
+                        muhsock_out.close();
+                        muhsock_in.close();
+                    } catch(Exception fuckoff2) {
+                        // No flying fucks given
+                    }
+                    muhsock.close();
+                } catch(Exception fuckoff) {
+                    // No flying fucks given
+                }
+            }
+
+            // W E   G O O D, (re)set some globals used throughout all threads
+            else {
+                main.reconnecting = false;
+                main.sockerr = false;
+                main.muhsock = muhsock;
+                main.muhsock_out = muhsock_out;
+                main.muhsock_in = muhsock_in;
+
+                // Set up send/receive threads
+                main.lolsender = new muhSender(main);
+                main.lolreceiver = new muhReceiver(main);
+                main.lolsender.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
+                main.lolreceiver.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
+                main.setControlsEnabled(true); // Also enable controls lol
+            }
+            main.connecting = false;
+            super.onPostExecute(result);
+        }
+    }
+
+    // Custom AnyTrust class to just trust everything
+    public class AnyTrust extends X509ExtendedTrustManager {
+        private final java.security.cert.X509Certificate[] ANY_CA = {};
+        @Override public java.security.cert.X509Certificate[] getAcceptedIssuers() { return ANY_CA; }
+        @Override public void checkServerTrusted(final java.security.cert.X509Certificate[] c, final String t)  {}
+        @Override public void checkClientTrusted(final java.security.cert.X509Certificate[] c, final String t)  { }
+        @Override public void checkServerTrusted(final java.security.cert.X509Certificate[] c, final String t, final SSLEngine e)  { }
+        @Override public void checkServerTrusted(final java.security.cert.X509Certificate[] c, final String t, final Socket e)  { }
+        @Override public void checkClientTrusted(final java.security.cert.X509Certificate[] c, final String t, final SSLEngine e)  { }
+        @Override public void checkClientTrusted(final java.security.cert.X509Certificate[] c, final String t, final Socket    e)  { }
+    }
+
+}

+ 47 - 0
app/src/app_Meqqy/src/main/java/com/jemoeder/lief/meqqy/MuhNumberPicker.java

@@ -0,0 +1,47 @@
+/* Copyright (C) All Rights Reserved
+ ** Written by Wazakindjes <waza@malvager.net>
+ ** Website: https://gitgud.malvager.net/Wazakindjes/Meqqy
+ ** License: https://gitgud.malvager.net/Wazakindjes/Meqqy/raw/master/LICENSE
+*/
+package com.jemoeder.lief.meqqy;
+
+import android.content.Context;
+import android.content.res.TypedArray;
+import android.util.AttributeSet;
+import android.widget.NumberPicker;
+
+// Custom number picker so we can have min/max values and _properly_ disable em -.-
+public class MuhNumberPicker extends NumberPicker {
+
+    public MuhNumberPicker(Context context) {
+        super(context);
+    }
+
+    public MuhNumberPicker(Context context, AttributeSet attrs) {
+        super(context, attrs);
+        processAttributeSet(attrs, 0, 0);
+    }
+
+    public MuhNumberPicker(Context context, AttributeSet attrs, int defStyleAttr) {
+        super(context, attrs, defStyleAttr);
+        processAttributeSet(attrs, defStyleAttr, 0);
+    }
+
+    public MuhNumberPicker(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
+        super(context, attrs, defStyleAttr, defStyleRes);
+        processAttributeSet(attrs, defStyleAttr, defStyleRes);
+    }
+
+    private void processAttributeSet(AttributeSet attrs, int defStyleAttr, int defStyleRes) {
+        TypedArray attributes = getContext().getTheme().obtainStyledAttributes(attrs, R.styleable.MuhNumberPicker, defStyleAttr, defStyleRes);
+
+        // This is the only interesting part LMAO
+        try {
+            this.setMinValue(attrs.getAttributeIntValue(null, "minimum", 0));
+            this.setMaxValue(attrs.getAttributeIntValue(null, "maximum", 0));
+            this.setEnabled(attrs.getAttributeBooleanValue(null, "enabled", true));
+        } finally {
+            attributes.recycle();
+        }
+    }
+}

+ 58 - 0
app/src/app_Meqqy/src/main/java/com/jemoeder/lief/meqqy/SettingsActivity.java

@@ -0,0 +1,58 @@
+/* Copyright (C) All Rights Reserved
+ ** Written by Wazakindjes <waza@malvager.net>
+ ** Website: https://gitgud.malvager.net/Wazakindjes/Meqqy
+ ** License: https://gitgud.malvager.net/Wazakindjes/Meqqy/raw/master/LICENSE
+*/
+package com.jemoeder.lief.meqqy;
+
+import android.os.Bundle;
+import android.preference.Preference;
+import android.preference.PreferenceFragment;
+import android.preference.PreferenceManager;
+import android.support.v7.app.AppCompatActivity;
+
+// Ayyyy settings lol
+public class SettingsActivity extends AppCompatActivity {
+    private static Preference.OnPreferenceChangeListener sBindPreferenceSummaryToValueListener = new Preference.OnPreferenceChangeListener() {
+        @Override
+        public boolean onPreferenceChange(Preference preference, Object value) {
+            // Just store as string so we don't have to do fucky checks and just cast to w/e we need later =]
+            String stringValue = value.toString();
+            preference.setSummary(stringValue);
+            return true;
+        }
+    };
+
+    private static void bindPreferenceSummaryToValue(Preference preference) {
+        preference.setOnPreferenceChangeListener(sBindPreferenceSummaryToValueListener);
+        sBindPreferenceSummaryToValueListener.onPreferenceChange(preference,
+                PreferenceManager
+                        .getDefaultSharedPreferences(preference.getContext())
+                        .getString(preference.getKey(), ""));
+    }
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        // Initialise the fragment y0
+        getFragmentManager().beginTransaction().replace(android.R.id.content, new MainPreferenceFragment()).commit();
+    }
+
+    public static class MainPreferenceFragment extends PreferenceFragment {
+        @Override
+        public void onCreate(Bundle savedInstanceState) {
+            super.onCreate(savedInstanceState);
+
+            addPreferencesFromResource(R.xml.preferences); // Load XML fambi
+            setHasOptionsMenu(false); // Also make sure we don't show a menu
+
+            // Gotta replace the summaries w/ the actual values cuz apparently that's how it should be done ._.
+            bindPreferenceSummaryToValue(findPreference("prefs_authkey"));
+            bindPreferenceSummaryToValue(findPreference("prefs_serbur"));
+            bindPreferenceSummaryToValue(findPreference("prefs_pot"));
+            bindPreferenceSummaryToValue(findPreference("prefs_ping"));
+            bindPreferenceSummaryToValue(findPreference("prefs_volstep"));
+        }
+    }
+}

BIN
app/src/app_Meqqy/src/main/res/drawable-hdpi/ic_action_options.png


BIN
app/src/app_Meqqy/src/main/res/drawable-hdpi/ic_action_reconnect.png


BIN
app/src/app_Meqqy/src/main/res/drawable-mdpi/ic_action_reconnect.png


BIN
app/src/app_Meqqy/src/main/res/drawable-mdpi/ic_action_settings.png


BIN
app/src/app_Meqqy/src/main/res/drawable-xhdpi/ic_action_reconnect.png


BIN
app/src/app_Meqqy/src/main/res/drawable-xhdpi/ic_action_settings.png


BIN
app/src/app_Meqqy/src/main/res/drawable-xxhdpi/ic_action_reconnect.png


BIN
app/src/app_Meqqy/src/main/res/drawable-xxhdpi/ic_action_settings.png


BIN
app/src/app_Meqqy/src/main/res/drawable-xxxhdpi/ic_action_reconnect.png


BIN
app/src/app_Meqqy/src/main/res/drawable-xxxhdpi/ic_action_settings.png


+ 9 - 0
app/src/app_Meqqy/src/main/res/drawable/ic_info_black_24dp.xml

@@ -0,0 +1,9 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:width="24dp"
+    android:height="24dp"
+    android:viewportWidth="24.0"
+    android:viewportHeight="24.0">
+    <path
+        android:fillColor="#FF000000"
+        android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zm1,15h-2v-6h2v6zm0,-8h-2V7h2v2z" />
+</vector>

+ 9 - 0
app/src/app_Meqqy/src/main/res/drawable/ic_notifications_black_24dp.xml

@@ -0,0 +1,9 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:width="24dp"
+    android:height="24dp"
+    android:viewportWidth="24.0"
+    android:viewportHeight="24.0">
+    <path
+        android:fillColor="#FF000000"
+        android:pathData="M11.5,22c1.1,0 2,-0.9 2,-2h-4c0,1.1 0.9,2 2,2zm6.5,-6v-5.5c0,-3.07 -2.13,-5.64 -5,-6.32V3.5c0,-0.83 -0.67,-1.5 -1.5,-1.5S10,2.67 10,3.5v0.68c-2.87,0.68 -5,3.25 -5,6.32V16l-2,2v1h17v-1l-2,-2z" />
+</vector>

+ 9 - 0
app/src/app_Meqqy/src/main/res/drawable/ic_sync_black_24dp.xml

@@ -0,0 +1,9 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:width="24dp"
+    android:height="24dp"
+    android:viewportWidth="24.0"
+    android:viewportHeight="24.0">
+    <path
+        android:fillColor="#FF000000"
+        android:pathData="M12 4V1L8 5l4 4V6c3.31 0 6 2.69 6 6 0 1.01,-.25 1.97,-.7 2.8l1.46 1.46C19.54 15.03 20 13.57 20 12c0,-4.42,-3.58,-8,-8,-8zm0 14c-3.31 0,-6,-2.69,-6,-6 0,-1.01.25,-1.97.7,-2.8L5.24 7.74C4.46 8.97 4 10.43 4 12c0 4.42 3.58 8 8 8v3l4,-4,-4,-4v3z" />
+</vector>

+ 35 - 0
app/src/app_Meqqy/src/main/res/drawable/seekbar.xml

@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+    <!-- Premium seekbar styling ;];]]; -->
+    <item android:id="@android:id/background">
+        <shape
+            android:shape="line">
+            <stroke
+                android:color="@color/seekbar_progressback"
+                android:width="@dimen/seekbar_thiccness"/>
+        </shape>
+    </item>
+
+    <item android:id="@android:id/progress">
+        <clip>
+            <shape
+                android:shape="line">
+                <stroke
+                    android:color="@color/seekbar_progress"
+                    android:width="@dimen/seekbar_thiccness"/>
+            </shape>
+        </clip>
+    </item>
+
+    <!-- Not entirely sure wtf this is supposed to be, but it's required afaik so ye =] -->
+    <item android:id="@android:id/secondaryProgress">
+        <clip>
+            <shape
+                android:shape="line">
+                <stroke
+                    android:color="@color/seekbar_progress2"
+                    android:width="@dimen/seekbar_thiccness"/>
+            </shape>
+        </clip>
+    </item>
+</layer-list>

+ 10 - 0
app/src/app_Meqqy/src/main/res/drawable/seekbar_thumb.xml

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="oval">
+    <!-- Styles of the seekbar thumb has to be a different file apparently -->
+    <size
+        android:height="@dimen/seekbar_thumbsize"
+        android:width="@dimen/seekbar_thumbsize"
+        />
+    <solid android:color="@color/seekbar_thumb"/>
+</shape>

+ 472 - 0
app/src/app_Meqqy/src/main/res/layout/activity_main.xml

@@ -0,0 +1,472 @@
+<?xml version="1.0" encoding="utf-8"?>
+<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:id="@+id/muhparent"
+    tools:context=".MainActivity">
+
+    <!-- I could probs do this entire XML a little differently/more elegant but idc xd -->
+    <ScrollView
+        android:layout_width="match_parent"
+        android:layout_height="match_parent">
+
+        <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+            xmlns:app="http://schemas.android.com/apk/res-auto"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content">
+
+            <TextView
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:id="@+id/mainact_intro"
+                android:layout_marginTop="8dp"
+                android:layout_marginStart="8dp"
+                android:text="@string/app_intro"
+                android:textStyle="bold"
+                android:textSize="@dimen/text_header1"
+                app:layout_constraintTop_toTopOf="parent"
+                app:layout_constraintStart_toStartOf="parent"
+                app:layout_constraintEnd_toEndOf="parent" />
+
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:id="@+id/mainact_connstatus_text"
+                android:layout_marginTop="20dp"
+                android:text="@string/main_status_text"
+                android:textStyle="bold"
+                android:textSize="@dimen/text_header2"
+                app:layout_constraintTop_toBottomOf="@id/mainact_intro"
+                app:layout_constraintStart_toStartOf="@id/mainact_intro" />
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:id="@+id/mainact_connstatus"
+                android:layout_marginStart="8dp"
+                android:text="@string/main_status_disconnected"
+                android:textStyle="bold"
+                android:textSize="@dimen/text_header2"
+                android:textColor="@color/RIP"
+                app:layout_constraintTop_toTopOf="@id/mainact_connstatus_text"
+                app:layout_constraintStart_toEndOf="@id/mainact_connstatus_text" />
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:id="@+id/mainact_connstatus_errortxt"
+                android:text=""
+                android:textStyle="bold"
+                android:textSize="@dimen/text_content"
+                android:textColor="@color/RIP"
+                app:layout_constraintTop_toBottomOf="@id/mainact_connstatus_text"
+                app:layout_constraintStart_toStartOf="@id/mainact_connstatus_text" />
+
+
+            <View
+                android:layout_width="match_parent"
+                android:layout_height="1dp"
+                android:id="@+id/mainact_divider_media"
+                android:layout_marginTop="64dp"
+                android:layout_marginStart="10dp"
+                android:layout_marginEnd="10dp"
+                android:background="@color/divider"
+                app:layout_constraintTop_toBottomOf="@id/mainact_connstatus_text"
+                app:layout_constraintStart_toStartOf="@id/mainact_connstatus_text" />
+
+
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:id="@+id/mainact_header_media"
+                android:layout_marginTop="@dimen/main_divider_spacing"
+                android:text="@string/header_main_media"
+                android:textStyle="bold"
+                android:textSize="@dimen/text_header1"
+                android:textColor="@color/text_header1"
+                app:layout_constraintTop_toBottomOf="@id/mainact_divider_media"
+                app:layout_constraintStart_toStartOf="@id/mainact_connstatus_text" />
+            <Button
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:id="@+id/mainact_button_playpause"
+                android:enabled="false"
+                android:alpha="0.5"
+                android:minWidth="@dimen/button_minwidth"
+                android:layout_marginTop="4dp"
+                android:text="@string/mainact_button_playpause"
+                android:textAllCaps="false"
+                android:onClick="mainact_docmd"
+                android:tag="@string/cmd_playpause"
+                app:layout_constraintTop_toBottomOf="@id/mainact_header_media"
+                app:layout_constraintStart_toStartOf="@id/mainact_header_media" />
+            <Button
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:id="@+id/mainact_button_muteunmute"
+                android:enabled="false"
+                android:alpha="0.5"
+                android:minWidth="@dimen/button_minwidth"
+                android:text="@string/mainact_button_muteunmute"
+                android:textAllCaps="false"
+                android:onClick="mainact_docmd"
+                android:tag="@string/cmd_muteunmute"
+                app:layout_constraintTop_toTopOf="@id/mainact_button_playpause"
+                app:layout_constraintStart_toEndOf="@id/mainact_button_playpause" />
+            <Button
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:id="@+id/mainact_button_prev"
+                android:enabled="false"
+                android:alpha="0.5"
+                android:minWidth="@dimen/button_minwidth"
+                android:text="@string/mainact_button_prev"
+                android:textAllCaps="false"
+                android:onClick="mainact_docmd"
+                android:tag="@string/cmd_prev"
+                app:layout_constraintTop_toTopOf="@id/mainact_button_muteunmute"
+                app:layout_constraintStart_toEndOf="@id/mainact_button_muteunmute" />
+            <Button
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:id="@+id/mainact_button_next"
+                android:enabled="false"
+                android:alpha="0.5"
+                android:minWidth="@dimen/button_minwidth"
+                android:text="@string/mainact_button_next"
+                android:textAllCaps="false"
+                android:onClick="mainact_docmd"
+                android:tag="@string/cmd_next"
+                app:layout_constraintTop_toTopOf="@id/mainact_button_prev"
+                app:layout_constraintStart_toEndOf="@id/mainact_button_prev" />
+
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:id="@+id/mainact_volumetxt"
+                android:layout_marginTop="@dimen/main_subcategory_spacing"
+                android:layout_marginEnd="16dp"
+                android:textSize="@dimen/text_header2"
+                android:text="@string/mainact_seekbar_volumetxt"
+                android:textColor="@color/text_header2"
+                app:layout_constraintTop_toBottomOf="@id/mainact_button_next"
+                app:layout_constraintStart_toStartOf="@id/mainact_button_playpause" />
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:id="@+id/mainact_label_volume"
+                android:layout_marginEnd="16dp"
+                android:textSize="@dimen/text_header2"
+                android:text=""
+                android:textColor="@color/text_header2"
+                app:layout_constraintTop_toBottomOf="@id/mainact_volumetxt"
+                app:layout_constraintEnd_toEndOf="parent" />
+            <SeekBar
+                android:layout_width="match_parent"
+                android:layout_height="30dp"
+                android:id="@+id/mainact_volumebar"
+                android:enabled="false"
+                android:alpha="0.5"
+                android:max="100"
+                android:progress="999"
+                android:layout_marginEnd="48dp"
+                android:textAllCaps="false"
+                android:tag="@string/cmd_volume"
+                app:layout_constraintTop_toTopOf="@id/mainact_label_volume"
+                app:layout_constraintStart_toStartOf="@id/mainact_button_playpause"
+                app:layout_constraintEnd_toStartOf="@id/mainact_label_volume"
+                android:progressDrawable="@drawable/seekbar"
+                android:thumb="@drawable/seekbar_thumb" />
+            <Button
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:id="@+id/mainact_button_voldown"
+                android:enabled="false"
+                android:alpha="0.5"
+                android:minWidth="@dimen/button_minwidth"
+                android:text="@string/mainact_button_voldown"
+                android:textAllCaps="false"
+                android:onClick="mainact_docmd"
+                android:tag="@string/cmd_voldown"
+                app:layout_constraintTop_toBottomOf="@id/mainact_volumebar"
+                app:layout_constraintStart_toStartOf="@id/mainact_volumetxt" />
+            <Button
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:id="@+id/mainact_button_volup"
+                android:enabled="false"
+                android:alpha="0.5"
+                android:minWidth="@dimen/button_minwidth"
+                android:text="@string/mainact_button_volup"
+                android:textAllCaps="false"
+                android:onClick="mainact_docmd"
+                android:tag="@string/cmd_voldown"
+                app:layout_constraintTop_toBottomOf="@id/mainact_volumebar"
+                app:layout_constraintStart_toEndOf="@id/mainact_button_voldown" />
+
+
+            <View
+                android:layout_width="match_parent"
+                android:layout_height="1dp"
+                android:id="@+id/mainact_divider_screen"
+                android:layout_marginTop="24dp"
+                android:layout_marginStart="10dp"
+                android:layout_marginEnd="10dp"
+                android:background="@color/divider"
+                app:layout_constraintTop_toBottomOf="@id/mainact_button_volup"
+                app:layout_constraintStart_toStartOf="@id/mainact_button_volup" />
+
+
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:id="@+id/mainact_header_screen"
+                android:layout_marginTop="@dimen/main_divider_spacing"
+                android:text="@string/header_main_screen"
+                android:textStyle="bold"
+                android:textSize="@dimen/text_header1"
+                android:textColor="@color/text_header1"
+                app:layout_constraintTop_toBottomOf="@id/mainact_divider_screen"
+                app:layout_constraintStart_toStartOf="@id/mainact_connstatus_text" />
+            <Button
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:id="@+id/mainact_button_lockscreen"
+                android:enabled="false"
+                android:alpha="0.5"
+                android:minWidth="@dimen/button_minwidth"
+                android:text="@string/mainact_button_lockscreen"
+                android:textAllCaps="false"
+                android:onClick="mainact_docmd"
+                android:tag="@string/cmd_lockscreen"
+                app:layout_constraintTop_toBottomOf="@id/mainact_header_screen"
+                app:layout_constraintStart_toStartOf="@id/mainact_header_screen" />
+
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:id="@+id/mainact_brightnesstxt"
+                android:layout_marginTop="8dp"
+                android:layout_marginEnd="16dp"
+                android:textSize="@dimen/text_header2"
+                android:text="@string/mainact_seekbar_brightnesstxt"
+                android:textColor="@color/text_header2"
+                app:layout_constraintTop_toBottomOf="@id/mainact_button_lockscreen"
+                app:layout_constraintStart_toStartOf="@id/mainact_button_lockscreen" />
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:id="@+id/mainact_label_brightness"
+                android:layout_marginEnd="16dp"
+                android:textSize="@dimen/text_header2"
+                android:text=""
+                android:textColor="@color/text_header2"
+                app:layout_constraintTop_toBottomOf="@id/mainact_brightnesstxt"
+                app:layout_constraintEnd_toEndOf="parent" />
+            <SeekBar
+                android:layout_width="match_parent"
+                android:layout_height="30dp"
+                android:id="@+id/mainact_brightnessbar"
+                android:enabled="false"
+                android:alpha="0.5"
+                android:max="16"
+                android:progress="999"
+                android:layout_marginEnd="48dp"
+                android:textAllCaps="false"
+                android:tag="@string/cmd_brightness"
+                app:layout_constraintTop_toTopOf="@id/mainact_label_brightness"
+                app:layout_constraintStart_toStartOf="@id/mainact_button_lockscreen"
+                app:layout_constraintEnd_toStartOf="@id/mainact_label_brightness"
+                android:progressDrawable="@drawable/seekbar"
+                android:thumb="@drawable/seekbar_thumb" />
+            <Button
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:id="@+id/mainact_button_brightdown"
+                android:enabled="false"
+                android:alpha="0.5"
+                android:minWidth="@dimen/button_minwidth"
+                android:text="@string/mainact_button_brightdown"
+                android:textAllCaps="false"
+                android:onClick="mainact_docmd"
+                android:tag="@string/cmd_brightdown"
+                app:layout_constraintTop_toBottomOf="@id/mainact_brightnessbar"
+                app:layout_constraintStart_toStartOf="@id/mainact_brightnesstxt" />
+            <Button
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:id="@+id/mainact_button_brightup"
+                android:enabled="false"
+                android:alpha="0.5"
+                android:minWidth="@dimen/button_minwidth"
+                android:text="@string/mainact_button_brightup"
+                android:textAllCaps="false"
+                android:onClick="mainact_docmd"
+                android:tag="@string/cmd_brightup"
+                app:layout_constraintTop_toBottomOf="@id/mainact_brightnessbar"
+                app:layout_constraintStart_toEndOf="@id/mainact_button_brightdown" />
+            <Button
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:id="@+id/mainact_button_brightmin"
+                android:enabled="false"
+                android:alpha="0.5"
+                android:minWidth="@dimen/button_minwidth"
+                android:text="@string/mainact_button_brightmin"
+                android:textAllCaps="false"
+                android:onClick="mainact_docmd"
+                android:tag="@string/cmd_brightmin"
+                app:layout_constraintTop_toBottomOf="@id/mainact_brightnessbar"
+                app:layout_constraintStart_toEndOf="@id/mainact_button_brightup" />
+            <Button
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:id="@+id/mainact_button_brightmax"
+                android:enabled="false"
+                android:alpha="0.5"
+                android:minWidth="@dimen/button_minwidth"
+                android:text="@string/mainact_button_brightmax"
+                android:textAllCaps="false"
+                android:onClick="mainact_docmd"
+                android:tag="@string/cmd_brightmax"
+                app:layout_constraintTop_toBottomOf="@id/mainact_brightnessbar"
+                app:layout_constraintStart_toEndOf="@id/mainact_button_brightmin" />
+
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:id="@+id/mainact_nosleeptxt"
+                android:layout_marginTop="@dimen/main_subcategory_spacing"
+                android:layout_marginEnd="16dp"
+                android:textSize="@dimen/text_header2"
+                android:text="@string/mainact_nosleeptxt"
+                android:textColor="@color/text_header2"
+                app:layout_constraintTop_toBottomOf="@id/mainact_button_brightmax"
+                app:layout_constraintStart_toStartOf="@id/mainact_button_lockscreen" />
+
+            <com.jemoeder.lief.meqqy.MuhNumberPicker
+                android:layout_width="25dp"
+                android:layout_height="55dp"
+                android:id="@+id/mainact_nosleep_h"
+                android:alpha="0.5"
+                android:textSize="@dimen/text_content"
+                android:descendantFocusability="blocksDescendants"
+                enabled="false"
+                minimum="0"
+                maximum="24"
+                app:layout_constraintTop_toBottomOf="@id/mainact_nosleeptxt"
+                app:layout_constraintStart_toStartOf="@id/mainact_nosleeptxt" />
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:id="@+id/mainact_nosleeptxt_h"
+                android:layout_marginTop="@dimen/numberpicker_labelmargin"
+                android:textSize="@dimen/text_header2"
+                android:text="@string/mainact_nosleeptxt_h"
+                android:textColor="@color/text_header2"
+                app:layout_constraintTop_toTopOf="@id/mainact_nosleep_h"
+                app:layout_constraintStart_toEndOf="@id/mainact_nosleep_h" />
+
+            <com.jemoeder.lief.meqqy.MuhNumberPicker
+                android:layout_width="25dp"
+                android:layout_height="55dp"
+                android:id="@+id/mainact_nosleep_m"
+                android:alpha="0.5"
+                android:layout_marginStart="16dp"
+                android:textSize="@dimen/text_content"
+                android:descendantFocusability="blocksDescendants"
+                enabled="false"
+                minimum="0"
+                maximum="59"
+                app:layout_constraintTop_toBottomOf="@id/mainact_nosleeptxt"
+                app:layout_constraintStart_toEndOf="@id/mainact_nosleeptxt_h" />
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:id="@+id/mainact_nosleeptxt_m"
+                android:layout_marginTop="@dimen/numberpicker_labelmargin"
+                android:textSize="@dimen/text_header2"
+                android:text="@string/mainact_nosleeptxt_m"
+                android:textColor="@color/text_header2"
+                app:layout_constraintTop_toTopOf="@id/mainact_nosleep_m"
+                app:layout_constraintStart_toEndOf="@id/mainact_nosleep_m" />
+
+            <com.jemoeder.lief.meqqy.MuhNumberPicker
+                android:layout_width="25dp"
+                android:layout_height="55dp"
+                android:id="@+id/mainact_nosleep_s"
+                android:alpha="0.5"
+                android:layout_marginStart="16dp"
+                android:textSize="@dimen/text_content"
+                android:descendantFocusability="blocksDescendants"
+                enabled="false"
+                minimum="0"
+                maximum="59"
+                app:layout_constraintTop_toBottomOf="@id/mainact_nosleeptxt"
+                app:layout_constraintStart_toEndOf="@id/mainact_nosleeptxt_m" />
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:id="@+id/mainact_nosleeptxt_s"
+                android:layout_marginTop="@dimen/numberpicker_labelmargin"
+                android:textSize="@dimen/text_header2"
+                android:text="@string/mainact_nosleeptxt_s"
+                android:textColor="@color/text_header2"
+                app:layout_constraintTop_toTopOf="@id/mainact_nosleep_s"
+                app:layout_constraintStart_toEndOf="@id/mainact_nosleep_s" />
+
+            <Button
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:id="@+id/mainact_button_nosleep"
+                android:enabled="false"
+                android:alpha="0.5"
+                android:minWidth="@dimen/button_minwidth"
+                android:layout_marginStart="16dp"
+                android:text="@string/mainact_button_nosleep"
+                android:textAllCaps="false"
+                android:onClick="mainact_docmd"
+                android:tag="@string/cmd_nosleep"
+                app:layout_constraintStart_toStartOf="@id/mainact_nosleeptxt_s"
+                app:layout_constraintBottom_toBottomOf="@id/mainact_nosleep_s" />
+            <Button
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:id="@+id/mainact_button_nosleep_undo"
+                android:enabled="false"
+                android:alpha="0.5"
+                android:minWidth="@dimen/button_minwidth"
+                android:text="@string/mainact_button_nosleep_undo"
+                android:textAllCaps="false"
+                android:onClick="mainact_docmd"
+                android:tag="@string/cmd_nosleep_undo"
+                app:layout_constraintStart_toEndOf="@id/mainact_button_nosleep"
+                app:layout_constraintTop_toTopOf="@id/mainact_button_nosleep" />
+
+
+            <View
+                android:layout_width="match_parent"
+                android:layout_height="1dp"
+                android:id="@+id/mainact_divider_footer"
+                android:layout_marginTop="24dp"
+                android:layout_marginStart="10dp"
+                android:layout_marginEnd="10dp"
+                android:background="@color/divider"
+                app:layout_constraintTop_toBottomOf="@id/mainact_button_nosleep_undo"
+                app:layout_constraintStart_toStartOf="@id/mainact_nosleeptxt" />
+
+
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:id="@+id/mainact_footer"
+                android:layout_marginTop="@dimen/main_divider_spacing"
+                android:textStyle="bold"
+                android:textSize="@dimen/text_header2"
+                android:textColor="@color/text_header2"
+                app:layout_constraintTop_toBottomOf="@id/mainact_divider_footer"
+                app:layout_constraintStart_toStartOf="@id/mainact_connstatus_text" />
+
+        </android.support.constraint.ConstraintLayout>
+    </ScrollView>
+</android.support.design.widget.CoordinatorLayout>

+ 16 - 0
app/src/app_Meqqy/src/main/res/layout/preference_category.xml

@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:orientation="vertical"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent">
+
+    <!-- Custom layout for preference headers (mostly just colouring lol) ;3 -->
+    <TextView android:id="@android:id/title"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="16dp"
+        android:layout_marginStart="16dp"
+        android:textSize="@dimen/text_prefheader"
+        android:textStyle="bold"
+        android:textColor="@color/text_prefheader" />
+</LinearLayout>

+ 15 - 0
app/src/app_Meqqy/src/main/res/menu/main.xml

@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<menu xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto">
+
+    <!-- Main menu yo, always show cuz there should be plenty of space and ifRoom sometimes get fucky -->
+    <item android:id="@+id/action_reconnect"
+        app:showAsAction="always"
+        android:title="@string/menuact_reconnect"
+        android:icon="@drawable/ic_action_reconnect" />
+
+    <item android:id="@+id/action_settings"
+        app:showAsAction="always"
+        android:title="@string/menuact_settings"
+        android:icon="@drawable/ic_action_settings" />
+</menu>

BIN
app/src/app_Meqqy/src/main/res/mipmap-hdpi/ic_launcher.png


BIN
app/src/app_Meqqy/src/main/res/mipmap-mdpi/ic_launcher.png


BIN
app/src/app_Meqqy/src/main/res/mipmap-xhdpi/ic_launcher.png


BIN
app/src/app_Meqqy/src/main/res/mipmap-xxhdpi/ic_launcher.png


BIN
app/src/app_Meqqy/src/main/res/mipmap-xxxhdpi/ic_launcher.png


+ 9 - 0
app/src/app_Meqqy/src/main/res/values/attrs.xml

@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <!-- Actuall defines the custom attrib00ts for muh numberpicker ;] -->
+    <declare-styleable name="MuhNumberPicker">
+        <attr name="minimum" format="integer" />
+        <attr name="maximum" format="integer" />
+        <attr name="enabled" format="boolean" />
+    </declare-styleable>
+</resources>

+ 29 - 0
app/src/app_Meqqy/src/main/res/values/colors.xml

@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <!-- Required for themes etc lol -->
+    <color name="colorText">#F2F2F4</color>
+    <color name="colorPrimary">#00574B</color>
+    <color name="colorPrimaryDark">#00574B</color>
+    <color name="colorAccent">#88EE88</color>
+
+    <!-- Some global custom col0urs -->
+    <color name="gucci">#00CC36</color>
+    <color name="RIP">#CC0036</color>
+    <color name="divider">#ABABAB</color>
+
+    <!-- Other text related shit 0bv -->
+    <color name="text_prefheader">@color/colorAccent</color>
+    <color name="text_header1">@color/colorAccent</color>
+    <color name="text_header2">@color/colorAccent</color>
+
+    <!-- We also hav cust0m stylin for seekbars ;];] -->
+    <color name="seekbar_thumb">@color/colorAccent</color>
+    <color name="seekbar_progressback">@color/divider</color>
+    <color name="seekbar_progress">@color/gucci</color>
+    <color name="seekbar_progress2">@color/RIP</color>
+
+    <!-- As well as Snackbar notification popups -->
+    <color name="snackbar_background">@color/colorPrimary</color>
+    <color name="snackbar_background_err">#6B0000</color>
+    <color name="snackbar_text">@color/colorText</color>
+</resources>

+ 23 - 0
app/src/app_Meqqy/src/main/res/values/dimens.xml

@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <!-- prefheader and header1 are always in bold -->
+    <dimen name="text_prefheader">20sp</dimen>
+    <dimen name="text_header1">18sp</dimen>
+    <dimen name="text_header2">16sp</dimen>
+    <dimen name="text_content">14sp</dimen>
+
+    <!-- Vertical space below a divider -->
+    <dimen name="main_divider_spacing">16dp</dimen>
+
+    <!-- Also between the end of one subcategory and the start of next (e.g. "Brightness" and "Prevent sleep" under "Screen shit" are subcategories) -->
+    <dimen name="main_subcategory_spacing">20dp</dimen>
+
+    <!-- Some default dimensions for some widgets -->
+    <!-- button_minwidth is so button w/ little text aren't fucking massive -->
+    <dimen name="button_minwidth">60dp</dimen>
+    <dimen name="seekbar_thiccness">6dp</dimen>
+    <dimen name="seekbar_thumbsize">22dp</dimen>
+
+    <!-- Horizontal space between a numberpicker and its description label (h/m/s) -->
+    <dimen name="numberpicker_labelmargin">16dp</dimen>
+</resources>

+ 102 - 0
app/src/app_Meqqy/src/main/res/values/strings.xml

@@ -0,0 +1,102 @@
+<resources>
+    <!-- Lil hack so we can pass this an empty string as an int xd -->
+    <string name="NOSTRING"></string>
+
+    <!-- Some app basic strings -->
+    <string name="app_name">Meqqy</string>
+    <string name="app_intro">Aye my dude, set yo authkey in em settings and d0e d1e d1ng</string>
+
+    <!-- Main menu action names -->
+    <string name="menuact_settings">Settings</string>
+    <string name="menuact_reconnect">Reconnect</string>
+
+    <!-- Other activity names -->
+    <string name="title_activity_settings">Settings</string>
+
+    <!-- Settings related labels/summaries -->
+    <string name="prefs_authkey">Auth key</string>
+    <string name="prefs_serbur">Server</string>
+    <string name="prefs_pot">Port</string>
+    <string name="prefs_autoconnect">Autoc0nnect on start</string>
+    <string name="prefs_autoconnect_summary">Automatically connect when you open the app obv fam</string>
+    <string name="prefs_fucktls">Fuck TLS err0rs</string>
+    <string name="prefs_fucktls_summary">Allow _any_ certificate, otherwise it must be signed by een system/user installed CA</string>
+    <string name="prefs_ping">Ping interval</string>
+    <string name="prefs_volstep">Volume step size</string>
+
+    <!-- Status texts in main activity (first line) -->
+    <string name="main_status_text">Status:</string>
+    <string name="main_status_rip">R I P</string>
+    <string name="main_status_gucci">W E   G U C C I</string>
+
+    <!-- disconnected is the default text, only really shown on app open if you don't have autoconnect on -->
+    <string name="main_status_disconnected">disc0nnected</string>
+
+    <!-- Difference between working and connecting is that the former is for sending commands only ;] -->
+    <string name="main_status_working">Working...</string>
+    <string name="main_status_connecting">Connecting...</string>
+
+    <!-- Description texts (second line etc) -->
+    <string name="main_status_errtxt_key">Invalid key length</string>
+    <string name="main_status_errtxt_invalidport">Invalid port (must be between 1024 and 65535)</string>
+    <string name="main_status_errtxt_auth">Authentication failure</string>
+    <string name="main_status_errtxt_invalidserver">Server unreachable (unknown host)</string>
+    <string name="main_status_errtxt_ripsocket">Socket closed unexpectedly (ping timeout?)</string>
+    <string name="main_status_errtxt_default_authkey">Auth key not configured</string>
+    <string name="main_status_errtxt_default_serbur">Server not configured</string>
+    <string name="main_status_errtxt_cleansocketclose">Socket cleanly closed</string>
+    <string name="main_status_errtxt_reconnect">Attempting to close socket cleanly before reconnecting</string>
+    <string name="main_status_errtxt_notconnected">You\'re not connected lol</string>
+
+    <!-- Command strings (or prefixes for certain ones) -->
+    <string name="cmd_ping">!ping</string>
+    <string name="cmd_quit">!quit</string>
+    <string name="cmd_playpause">!playpause</string>
+    <string name="cmd_muteunmute">!mute</string>
+    <string name="cmd_prev">!prev</string>
+    <string name="cmd_next">!next</string>
+    <string name="cmd_volume">!volume</string>
+
+    <!-- Said prefixes, volstep is appended to these to get the proper command ;] -->
+    <string name="cmd_voldown">!volume -</string>
+    <string name="cmd_volup">!volume +</string>
+
+    <string name="cmd_lockscreen">!lock</string>
+    <string name="cmd_brightness">!brightness</string>
+    <string name="cmd_brightdown">!brightness down</string>
+    <string name="cmd_brightup">!brightness up</string>
+    <string name="cmd_brightmin">!brightness min</string>
+    <string name="cmd_brightmax">!brightness max</string>
+    <string name="cmd_nosleep">!caffeinate</string>
+    <string name="cmd_nosleep_undo">!decaffeinate</string>
+
+    <!-- Strings for the media section -->
+    <string name="header_main_media">Media shit lol</string>
+    <string name="mainact_button_playpause">Play/Pause</string>
+    <string name="mainact_button_muteunmute">Mute/Unmute</string>
+    <string name="mainact_button_prev">Prev</string>
+    <string name="mainact_button_next">Next</string>
+    <string name="mainact_seekbar_volumetxt">v0lume</string>
+    <string name="mainact_button_voldown">--</string>
+    <string name="mainact_button_volup">++</string>
+
+    <!-- Also screen secti0n -->
+    <string name="header_main_screen">Screen hax y0</string>
+    <string name="mainact_button_lockscreen">l0ckem</string>
+    <string name="mainact_seekbar_brightnesstxt">Brightness</string>
+    <string name="mainact_button_brightdown">--</string>
+    <string name="mainact_button_brightup">++</string>
+    <string name="mainact_button_brightmin">Min</string>
+    <string name="mainact_button_brightmax">Max</string>
+    <string name="mainact_button_nosleep">d0it</string>
+    <string name="mainact_button_nosleep_undo">und0</string>
+
+    <string name="mainact_nosleeptxt">Prevent sleep im0</string>
+    <string name="mainact_nosleeptxt_h">h</string>
+    <string name="mainact_nosleeptxt_m">m</string>
+    <string name="mainact_nosleeptxt_s">s</string>
+
+    <!-- Some misc strings -->
+    <!-- Snackbar message if nosleep is attempted with values set to 0h 0m 0s -->
+    <string name="mainact_snackbar_nosleep_empty">No time wuz set niQQa</string>
+</resources>

+ 15 - 0
app/src/app_Meqqy/src/main/res/values/styles.xml

@@ -0,0 +1,15 @@
+<resources>
+    <!-- Global theme -->
+    <style name="MeqqyTheme" parent="Theme.AppCompat">
+        <item name="android:textColor">@color/colorText</item>
+        <item name="colorPrimary">@color/colorPrimary</item>
+        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
+        <item name="colorAccent">@color/colorAccent</item>
+    </style>
+
+    <!-- Cuz the settings screen needs a few extra changes -->
+    <style name="MuhPrefs" parent="MeqqyTheme">
+        <item name="android:textSize">16sp</item>
+        <item name="android:textStyle">bold</item>
+    </style>
+</resources>

+ 9 - 0
app/src/app_Meqqy/src/main/res/xml/network_security_config.xml

@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<network-security-config>
+    <base-config>
+        <trust-anchors>
+            <!-- Trust all user-installed certificate authorities found under system settings (Settings > Security > Credentials > Trusted CAs or smt similar) -->
+            <certificates src="user" />
+        </trust-anchors>
+    </base-config>
+</network-security-config>

+ 76 - 0
app/src/app_Meqqy/src/main/res/xml/preferences.xml

@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="utf-8"?>
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
+    <PreferenceCategory
+        android:title="Connection"
+        android:layout="@layout/preference_category">
+
+        <EditTextPreference
+            android:defaultValue="1234567890abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQR"
+            android:inputType="text"
+            android:key="prefs_authkey"
+            android:maxLines="1"
+            android:selectAllOnFocus="true"
+            android:singleLine="true"
+            android:maxLength="64"
+            android:title="@string/prefs_authkey"
+            android:summary="@string/prefs_authkey" />
+
+        <EditTextPreference
+            android:defaultValue="192.168.1.0"
+            android:inputType="text"
+            android:key="prefs_serbur"
+            android:maxLines="1"
+            android:selectAllOnFocus="true"
+            android:singleLine="true"
+            android:title="@string/prefs_serbur"
+            android:summary="@string/prefs_serbur" />
+
+        <EditTextPreference
+            android:defaultValue="6969"
+            android:inputType="number"
+            android:key="prefs_pot"
+            android:maxLines="1"
+            android:maxLength="5"
+            android:selectAllOnFocus="true"
+            android:singleLine="true"
+            android:title="@string/prefs_pot"
+            android:summary="@string/prefs_pot" />
+
+        <CheckBoxPreference
+            android:key="prefs_autoconnect"
+            android:title="@string/prefs_autoconnect"
+            android:summary="@string/prefs_autoconnect_summary"
+            android:defaultValue="false"/>
+
+        <CheckBoxPreference
+            android:key="prefs_fucktls"
+            android:title="@string/prefs_fucktls"
+            android:summary="@string/prefs_fucktls_summary"
+            android:defaultValue="false"/>
+
+        <EditTextPreference
+            android:defaultValue="30"
+            android:inputType="number"
+            android:key="prefs_ping"
+            android:maxLines="1"
+            android:maxLength="2"
+            android:selectAllOnFocus="true"
+            android:singleLine="true"
+            android:title="@string/prefs_ping" />
+
+    </PreferenceCategory>
+
+    <PreferenceCategory
+        android:title="Media shit lol"
+        android:layout="@layout/preference_category">
+        <EditTextPreference
+            android:defaultValue="1"
+            android:inputType="number"
+            android:key="prefs_volstep"
+            android:maxLines="1"
+            android:maxLength="2"
+            android:selectAllOnFocus="true"
+            android:singleLine="true"
+            android:title="@string/prefs_volstep" />
+    </PreferenceCategory>
+</PreferenceScreen>

+ 17 - 0
app/src/app_Meqqy/src/test/java/com/jemoeder/lief/meqqy/ExampleUnitTest.java

@@ -0,0 +1,17 @@
+package com.jemoeder.lief.meqqy;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * Example local unit test, which will execute on the development machine (host).
+ *
+ * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
+ */
+public class ExampleUnitTest {
+    @Test
+    public void addition_isCorrect() {
+        assertEquals(4, 2 + 2);
+    }
+}

+ 24 - 0
app/src/build.gradle

@@ -0,0 +1,24 @@
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+
+buildscript {
+    repositories {
+        google()
+        jcenter()
+    }
+    dependencies {
+        classpath 'com.android.tools.build:gradle:3.2.0'
+        // NOTE: Do not place your application dependencies here; they belong
+        // in the individual module build.gradle files
+    }
+}
+
+allprojects {
+    repositories {
+        google()
+        jcenter()
+    }
+}
+
+task clean(type: Delete) {
+    delete rootProject.buildDir
+}

+ 14 - 0
app/src/gradle.properties

@@ -0,0 +1,14 @@
+# Project-wide Gradle settings.
+# IDE (e.g. Android Studio) users:
+# Gradle settings configured through the IDE *will override*
+# any settings specified in this file.
+# For more details on how to configure your build environment visit
+# http://www.gradle.org/docs/current/userguide/build_environment.html
+# Specifies the JVM arguments used for the daemon process.
+# The setting is particularly useful for tweaking memory settings.
+org.gradle.jvmargs=-Xmx1536m
+# When configured, Gradle will run in incubating parallel mode.
+# This option should only be used with decoupled projects. More details, visit
+# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
+# org.gradle.parallel=true
+

BIN
app/src/gradle/wrapper/gradle-wrapper.jar


+ 5 - 0
app/src/gradle/wrapper/gradle-wrapper.properties

@@ -0,0 +1,5 @@
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists

+ 172 - 0
app/src/gradlew

@@ -0,0 +1,172 @@
+#!/usr/bin/env sh
+
+##############################################################################
+##
+##  Gradle start up script for UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+    ls=`ls -ld "$PRG"`
+    link=`expr "$ls" : '.*-> \(.*\)$'`
+    if expr "$link" : '/.*' > /dev/null; then
+        PRG="$link"
+    else
+        PRG=`dirname "$PRG"`"/$link"
+    fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+    echo "$*"
+}
+
+die () {
+    echo
+    echo "$*"
+    echo
+    exit 1
+}