Browse Source

Ayy first version y0: dankass receiver app for push notifications (Andr0id only L M A O)

Wazakindjes 1 year ago
commit
73f11f3178
65 changed files with 2064 additions and 0 deletions
  1. 5 0
      .gitignore
  2. 241 0
      LICENSE
  3. BIN
      Pushem.apk
  4. 54 0
      README.md
  5. BIN
      ass/icinz/ic_action_settings.png
  6. BIN
      ass/icinz/ic_launcher.png
  7. BIN
      ass/logos/onesignal.png
  8. BIN
      ass/scr0ts/main.png
  9. 92 0
      src/.gitignore
  10. 113 0
      src/.idea/codeStyles/Project.xml
  11. 5 0
      src/.idea/codeStyles/codeStyleConfig.xml
  12. 45 0
      src/.idea/jarRepositories.xml
  13. 48 0
      src/.idea/misc.xml
  14. 12 0
      src/.idea/runConfigurations.xml
  15. 3 0
      src/.idea/scopes/Project_sauce.xml
  16. 109 0
      src/app_pushem/build.gradle
  17. 21 0
      src/app_pushem/proguard-rules.pro
  18. 26 0
      src/app_pushem/src/androidTest/java/com/jemoeder/lief/pushem/ExampleInstrumentedTest.java
  19. 52 0
      src/app_pushem/src/main/AndroidManifest.xml
  20. BIN
      src/app_pushem/src/main/ic_launcher-web.png
  21. 491 0
      src/app_pushem/src/main/java/com/jemoeder/lief/pushem/MainActivity.java
  22. 43 0
      src/app_pushem/src/main/java/com/jemoeder/lief/pushem/PushemWrapper.java
  23. 60 0
      src/app_pushem/src/main/java/com/jemoeder/lief/pushem/SettingsActivity.java
  24. 37 0
      src/app_pushem/src/main/java/com/onesignal/OneSignalBigHecks.java
  25. BIN
      src/app_pushem/src/main/res/drawable-hdpi/ic_action_settings.png
  26. BIN
      src/app_pushem/src/main/res/drawable-hdpi/ic_pushsvc_onesignal.png
  27. BIN
      src/app_pushem/src/main/res/drawable-hdpi/ic_stat_onesignal_default.png
  28. BIN
      src/app_pushem/src/main/res/drawable-ldpi/ic_pushsvc_onesignal.png
  29. BIN
      src/app_pushem/src/main/res/drawable-mdpi/ic_action_settings.png
  30. BIN
      src/app_pushem/src/main/res/drawable-mdpi/ic_pushsvc_onesignal.png
  31. BIN
      src/app_pushem/src/main/res/drawable-mdpi/ic_stat_onesignal_default.png
  32. BIN
      src/app_pushem/src/main/res/drawable-xhdpi/ic_action_settings.png
  33. BIN
      src/app_pushem/src/main/res/drawable-xhdpi/ic_pushsvc_onesignal.png
  34. BIN
      src/app_pushem/src/main/res/drawable-xhdpi/ic_stat_onesignal_default.png
  35. BIN
      src/app_pushem/src/main/res/drawable-xxhdpi/ic_action_settings.png
  36. BIN
      src/app_pushem/src/main/res/drawable-xxhdpi/ic_pushsvc_onesignal.png
  37. BIN
      src/app_pushem/src/main/res/drawable-xxhdpi/ic_stat_onesignal_default.png
  38. BIN
      src/app_pushem/src/main/res/drawable-xxxhdpi/ic_action_settings.png
  39. BIN
      src/app_pushem/src/main/res/drawable-xxxhdpi/ic_pushsvc_onesignal.png
  40. BIN
      src/app_pushem/src/main/res/drawable-xxxhdpi/ic_stat_onesignal_default.png
  41. 15 0
      src/app_pushem/src/main/res/drawable/layout_border.xml
  42. 7 0
      src/app_pushem/src/main/res/drawable/mainact_pushsvc_img_onesignal.xml
  43. 100 0
      src/app_pushem/src/main/res/layout/activity_main.xml
  44. 16 0
      src/app_pushem/src/main/res/layout/preference_category.xml
  45. 10 0
      src/app_pushem/src/main/res/menu/main.xml
  46. BIN
      src/app_pushem/src/main/res/mipmap-hdpi/ic_launcher.png
  47. BIN
      src/app_pushem/src/main/res/mipmap-mdpi/ic_launcher.png
  48. BIN
      src/app_pushem/src/main/res/mipmap-xhdpi/ic_launcher.png
  49. BIN
      src/app_pushem/src/main/res/mipmap-xxhdpi/ic_launcher.png
  50. BIN
      src/app_pushem/src/main/res/mipmap-xxxhdpi/ic_launcher.png
  51. 11 0
      src/app_pushem/src/main/res/values/colors.xml
  52. 24 0
      src/app_pushem/src/main/res/values/dimens.xml
  53. 25 0
      src/app_pushem/src/main/res/values/strings.xml
  54. 27 0
      src/app_pushem/src/main/res/values/styles.xml
  55. 11 0
      src/app_pushem/src/main/res/xml/network_security_config.xml
  56. 41 0
      src/app_pushem/src/main/res/xml/preferences.xml
  57. 17 0
      src/app_pushem/src/test/java/com/jemoeder/lief/pushem/ExampleUnitTest.java
  58. 2 0
      src/app_pushem/version.properties
  59. 24 0
      src/build.gradle
  60. 14 0
      src/gradle.properties
  61. BIN
      src/gradle/wrapper/gradle-wrapper.jar
  62. 6 0
      src/gradle/wrapper/gradle-wrapper.properties
  63. 172 0
      src/gradlew
  64. 84 0
      src/gradlew.bat
  65. 1 0
      src/settings.gradle

+ 5 - 0
.gitignore

@@ -0,0 +1,5 @@
+.DS_Store
+._.*
+$RECYCLE.BIN
+.*.swp
+*-bak*

+ 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/>.

BIN
Pushem.apk


+ 54 - 0
README.md

@@ -0,0 +1,54 @@
+# The fuck is this
+This shit is a dankass receiver app for push notifications from (eventually) multiple sources. [=[=[==[[=[
+
+You can (de)register per service whenever you want. The corresponding device UUID will also be displayed and can be copied just by tapping on it (you might need to longpress). ;]
+
+# Supported push services
+Currently it only works with OneSignal, which in turn connects to platforms such as Firebase Cloud Messaging (FCM) for Android and Apple Push Notification Service (APNS) for iOS to actually distribute the notifications to devices. I prefer using OneSignal instead of connecting to FCM and APNS meinself, since you'll have 1 dashboard where you can see all users at once instead of having to log into every one separately. =]
+
+As of writing this shit, [OneSignal is free for](https://onesignal.com/pricing):
+* 30k web push subscribers (sent to a browser, like Whatsapp Web does)
+* Unlimited mobile subscribers
+
+Which is p gucci. ;]
+
+Also, if you deregister, all it actually does is __unsubscribe__ you. Meaning your device will still be listed in the dashboard but it won't be able to receive notifications.
+
+# Setting up that shit
+Alright, so this is necessary to make sure your device(s) won't end up in __my__ OneSignal account, but rather your own.
+* Obviously, install [the app](./Pushem.apk) first (__but don't do anything inside it yet__)
+* Go to the [OneSignal website](https://onesignal.com)
+* Sign up and create an app, prolly just wanna name it `Pushem` as well ;]
+* It will guide you through setting up your first platform connection, so use the `Google Android (FCM)` platform and set up the Firebase connection by following OneSignal's directions
+* After that it will ask what SDK you're using, choose `Server API` (at the bottom y0) because at least the Android one requires you to check for a subscriber at the end
+* When that's done you need to configure an application somewhere to use the app ID and/or REST API key (depending on application): in the OneSignal dashboard while viewing the `Pushem` app, go to `Settings` > `Keys & IDs` to see that inf0rmation
+* Go into the settings of the Pushem app on y0 phone and update __only__ the `App ID` with the corresponding value from above, __keep the settings screen open/active until later__
+* Now create a "notification channel" for Android within the OneSignal dashboard (`Messaging` tab), this helps down the road when more push services are added
+* First, create a group and name it something like `OneSignal` (we'll be using one group per pr0vidur ;])
+* Go back to the Android app and update the `Notification channel group name` with the name you just entered (it's not case-sensitive but otherwise it needs to match eggzactly)
+* Add a category within that group (prolly best named after the sending application, e.g. `temp_sensor`) and set some defaults, these settings can later be changed within Android through the regular `Settings` app > `Apps` > `Pushem` > `App notifications` (or something similar, prolly differs per device/vendor lol)
+* After you've saved the category, reopen its settings, look for the `Channel ID` on the bottom right and again slam that in the config of the sending application (if necessary/available 0bv m8)
+* Now close the settings in the Android app and register your device with OneSignal
+* Wait a couple of seconds and in your OneSignal dashboard go to `Audience` > `All Users`, where you should see your device
+* You should now be able to receive push notifications (e.g. my [temp_sensor shit](https://gitgud.malvager.net/Wazakindjes/temp_sensor) makes an API call to OneSignal, which relays it to mein ph0ne through FCM, gg ez)
+
+__Muy importante:__
+* The notification channel group name __must be set before receiving even 1 (U N O) notification__. OneSignal uses a __group-less category__ called `Restored` for already received but not dismissed notifications. Pushem tries to move it to the group you created above to keep everything from 1 provider together. If you fail to set the group __before__ receiving notifications, it will be unchangeable and it will remain under `Other`. The only """fix""" is to uninstall the app so Android will clear these notification channels, then reinstall and do it right. ;] I could have Pushem delete and recreate the channel, but if multiple providers create an ungrouped category with the same name, shit gets funky. ;] So I won't bother.
+* If you change an app ID in the settings of Pushem, it will attempt to deregister from the old one and prompt you to restart the app, since many SDKs don't really expect that shit to change on the fly. It also won't automatically reregister with the new app ID after reopening the app, there are many reasons why you would want to hold off on that for a bit. I doubt people would change it often anyways but might as well letchu kno. ;];]];;]];];];
+* You may have noticed you can also set up segments, which is entirely optional but might help telling receivers apart. I'm using a segment named `temp_sensor` to make sure that it only sends __me__ shit.
+
+# Usage
+![scr0t](./ass/scr0ts/main.png)
+Shit should be p self-explanatory imo tbh. ;]
+
+# Releasing modified (and signed) APKs
+You'll need to make some adjustments if you want to release signed APKs lol. Refer to the section [right here](https://gitgud.malvager.net/Wazakindjes/Meqqy#android-specific-shit) (only applies to Mac OS X, if you're on Windows then idk how to do something similar :>).
+
+# Hurrrr pls halp it's br0ke
+Simply change the build variant in your Andr0id IDE to `debug`, then it'll have OneSignal using debug mode too and you can see all the requests it's doing (and the responses it receives).
+
+Alternatively, if your problem is that notifications don't arrive, check deez ~~nuts~~ docs from OneSignal:
+* [Notifications show successful but are not being shown](https://documentation.onesignal.com/docs/notifications-show-successful-but-are-not-being-shown)
+* [Notifications delayed](https://documentation.onesignal.com/docs/notifications-delayed)
+
+So far I haven't yet had this problem though. =]]]]

BIN
ass/icinz/ic_action_settings.png


BIN
ass/icinz/ic_launcher.png


BIN
ass/logos/onesignal.png


BIN
ass/scr0ts/main.png


+ 92 - 0
src/.gitignore

@@ -0,0 +1,92 @@
+# .gitignore to put in the rewt of an Android Studio pr0ject dir ;]
+# Got this shit from: https://github.com/github/gitignore/blob/master/Android.gitignore
+
+# Built application files
+*.apk
+*.aar
+*.ap_
+*.aab
+
+# Files for the ART/Dalvik VM
+*.dex
+
+# Java class files
+*.class
+
+# Generated files
+bin/
+gen/
+out/
+
+# Any release files should be generated and stored outside the project dir, e.g. in the *git tree* rewtt dir
+release/
+
+# Gradle files
+.gradle/
+build/
+
+# Local configuration file (sdk path, etc)
+local.properties
+
+# Proguard folder generated by Eclipse
+proguard/
+
+# Log Files
+*.log
+
+# Android Studio Navigation editor temp files
+.navigation/
+
+# Android Studio captures folder
+captures/
+
+# IntelliJ
+*.iml
+.idea/workspace.xml
+.idea/tasks.xml
+.idea/gradle.xml
+.idea/assetWizardSettings.xml
+.idea/dictionaries
+.idea/libraries
+# Android Studio 3 in .gitignore file.
+.idea/caches
+.idea/modules.xml
+# Comment next line if keeping position of elements in Navigation Editor is relevant for you
+.idea/navEditor.xml
+
+# Keystore files
+# The project is set up to read the necessary information from Keychain shit instead =]
+*.jks
+*.keystore
+
+# External native build folder generated in Android Studio 2.2 and later
+.externalNativeBuild
+.cxx/
+
+# Google Services (e.g. APIs or Firebase)
+google-services.json
+
+# Freeline
+freeline.py
+freeline/
+freeline_project_description.json
+
+# fastlane
+fastlane/report.xml
+fastlane/Preview.html
+fastlane/screenshots
+fastlane/test_output
+fastlane/readme.md
+
+# Version control
+vcs.xml
+
+# lint
+lint/intermediates/
+lint/generated/
+lint/outputs/
+lint/tmp/
+lint/reports/
+
+# Android Profiling
+*.hprof

+ 113 - 0
src/.idea/codeStyles/Project.xml

@@ -0,0 +1,113 @@
+<component name="ProjectCodeStyleConfiguration">
+  <code_scheme name="Project" version="173">
+    <codeStyleSettings language="XML">
+      <arrangement>
+        <rules>
+          <section>
+            <rule>
+              <match>
+                <AND>
+                  <NAME>xmlns:android</NAME>
+                  <XML_ATTRIBUTE />
+                  <XML_NAMESPACE>^$</XML_NAMESPACE>
+                </AND>
+              </match>
+            </rule>
+          </section>
+          <section>
+            <rule>
+              <match>
+                <AND>
+                  <NAME>xmlns:.*</NAME>
+                  <XML_ATTRIBUTE />
+                  <XML_NAMESPACE>^$</XML_NAMESPACE>
+                </AND>
+              </match>
+              <order>BY_NAME</order>
+            </rule>
+          </section>
+          <section>
+            <rule>
+              <match>
+                <AND>
+                  <NAME>.*:id</NAME>
+                  <XML_ATTRIBUTE />
+                  <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
+                </AND>
+              </match>
+            </rule>
+          </section>
+          <section>
+            <rule>
+              <match>
+                <AND>
+                  <NAME>.*:name</NAME>
+                  <XML_ATTRIBUTE />
+                  <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
+                </AND>
+              </match>
+            </rule>
+          </section>
+          <section>
+            <rule>
+              <match>
+                <AND>
+                  <NAME>name</NAME>
+                  <XML_ATTRIBUTE />
+                  <XML_NAMESPACE>^$</XML_NAMESPACE>
+                </AND>
+              </match>
+            </rule>
+          </section>
+          <section>
+            <rule>
+              <match>
+                <AND>
+                  <NAME>style</NAME>
+                  <XML_ATTRIBUTE />
+                  <XML_NAMESPACE>^$</XML_NAMESPACE>
+                </AND>
+              </match>
+            </rule>
+          </section>
+          <section>
+            <rule>
+              <match>
+                <AND>
+                  <NAME>.*</NAME>
+                  <XML_ATTRIBUTE />
+                  <XML_NAMESPACE>^$</XML_NAMESPACE>
+                </AND>
+              </match>
+              <order>BY_NAME</order>
+            </rule>
+          </section>
+          <section>
+            <rule>
+              <match>
+                <AND>
+                  <NAME>.*</NAME>
+                  <XML_ATTRIBUTE />
+                  <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
+                </AND>
+              </match>
+              <order>ANDROID_ATTRIBUTE_ORDER</order>
+            </rule>
+          </section>
+          <section>
+            <rule>
+              <match>
+                <AND>
+                  <NAME>.*</NAME>
+                  <XML_ATTRIBUTE />
+                  <XML_NAMESPACE>.*</XML_NAMESPACE>
+                </AND>
+              </match>
+              <order>BY_NAME</order>
+            </rule>
+          </section>
+        </rules>
+      </arrangement>
+    </codeStyleSettings>
+  </code_scheme>
+</component>

+ 5 - 0
src/.idea/codeStyles/codeStyleConfig.xml

@@ -0,0 +1,5 @@
+<component name="ProjectCodeStyleConfiguration">
+  <state>
+    <option name="PREFERRED_PROJECT_CODE_STYLE" value="MuhScheme" />
+  </state>
+</component>

+ 45 - 0
src/.idea/jarRepositories.xml

@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="RemoteRepositoriesConfiguration">
+    <remote-repository>
+      <option name="id" value="central" />
+      <option name="name" value="Maven Central repository" />
+      <option name="url" value="https://repo1.maven.org/maven2" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="jboss.community" />
+      <option name="name" value="JBoss Community repository" />
+      <option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="BintrayJCenter" />
+      <option name="name" value="BintrayJCenter" />
+      <option name="url" value="https://jcenter.bintray.com/" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="Google" />
+      <option name="name" value="Google" />
+      <option name="url" value="https://dl.google.com/dl/android/maven2/" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="$USER_HOME$/Library/Android/sdk/extras/google/m2repository" />
+      <option name="name" value="$USER_HOME$/Library/Android/sdk/extras/google/m2repository" />
+      <option name="url" value="file:$USER_HOME$/Library/Android/sdk/extras/google/m2repository/" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="$USER_HOME$/Library/Android/sdk/extras/m2repository" />
+      <option name="name" value="$USER_HOME$/Library/Android/sdk/extras/m2repository" />
+      <option name="url" value="file:$USER_HOME$/Library/Android/sdk/extras/m2repository/" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="$USER_HOME$/Library/Android/sdk/extras/android/m2repository" />
+      <option name="name" value="$USER_HOME$/Library/Android/sdk/extras/android/m2repository" />
+      <option name="url" value="file:$USER_HOME$/Library/Android/sdk/extras/android/m2repository/" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="maven" />
+      <option name="name" value="maven" />
+      <option name="url" value="https://maven.google.com" />
+    </remote-repository>
+  </component>
+</project>

+ 48 - 0
src/.idea/misc.xml

@@ -0,0 +1,48 @@
+<?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="12">
+          <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" />
+          <item index="7" class="java.lang.String" itemvalue="android.annotation.Nullable" />
+          <item index="8" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.qual.Nullable" />
+          <item index="9" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NullableDecl" />
+          <item index="10" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NullableType" />
+          <item index="11" class="java.lang.String" itemvalue="com.android.annotations.Nullable" />
+        </list>
+      </value>
+    </option>
+    <option name="myNotNulls">
+      <value>
+        <list size="11">
+          <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" />
+          <item index="6" class="java.lang.String" itemvalue="android.annotation.NonNull" />
+          <item index="7" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.qual.NonNull" />
+          <item index="8" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NonNullDecl" />
+          <item index="9" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NonNullType" />
+          <item index="10" class="java.lang.String" itemvalue="com.android.annotations.NonNull" />
+        </list>
+      </value>
+    </option>
+  </component>
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" 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
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>

+ 3 - 0
src/.idea/scopes/Project_sauce.xml

@@ -0,0 +1,3 @@
+<component name="DependencyValidationManager">
+  <scope name="Project sauce" pattern="file:src/main/java//*||file:src/main/res//*||file:*.gradle||file:AndroidManifest.xml" />
+</component>

+ 109 - 0
src/app_pushem/build.gradle

@@ -0,0 +1,109 @@
+buildscript {
+	repositories {
+		maven { url 'https://plugins.gradle.org/m2/'}
+	}
+	dependencies {
+		classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:0.12.8'
+	}
+}
+plugins {
+	id 'com.onesignal.androidsdk.onesignal-gradle-plugin' version '0.8.1'
+}
+apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
+
+repositories {
+	maven { url 'https://maven.google.com' }
+}
+
+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 user, String entryName) {
+	def stdout = new ByteArrayOutputStream()
+	//def stderr = new ByteArrayOutputStream()
+	exec {
+		//commandLine 'security', '-q', 'find-generic-password', '-a', user, '-gl', entryName
+		commandLine 'security', '-q', 'find-generic-password', '-a', user, '-ws', entryName
+		standardOutput = stdout
+		//errorOutput = stderr
+		ignoreExitValue true
+	}
+	//noinspection GroovyAssignabilityCheck
+	stdout.toString().trim()
+	//(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')
+		}
+	}
+
+	def versionPropsFile = file('version.properties')
+	def vcode = 0 // Apparently Gradle builds it twice the initial time, so by setting this to 0 it will become 1 when Gradle's done
+	Properties versionProps = new Properties()
+	if(versionPropsFile.canRead()) {
+		versionProps.load(new FileInputStream(versionPropsFile))
+		vcode = versionProps['VERSION_CODE'].toInteger() + 1
+	}
+	versionProps['VERSION_CODE'] = vcode.toString()
+	versionProps.store(versionPropsFile.newWriter(), null)
+
+	compileSdkVersion 28
+	defaultConfig {
+		applicationId 'com.jemoeder.lief.pushem'
+		minSdkVersion 25
+		//noinspection ExpiredTargetSdkVersion ZERO FUCKS GIVEN (ain't publishan on Jewgle gay st0re anyways so)
+		targetSdkVersion 25
+		testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner'
+		signingConfig signingConfigs.muhconfig
+		versionCode vcode
+
+		manifestPlaceholders = [
+			onesignal_app_id: '', // Is required for proper compilation, but we'll set it to user-specified values laturd ;]
+			onesignal_google_project_number: 'REMOTE', // Jewgle project number is pulled from el dashboard yo
+		]
+	}
+	buildTypes {
+		release {
+			// Proguard that shit for release APKs
+			minifyEnabled true
+			proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+			signingConfig signingConfigs.muhconfig
+		}
+		debug {
+			signingConfig signingConfigs.muhconfig
+		}
+
+		// Lazy m00d =]]]]]]]]
+		applicationVariants.all { variant ->
+			if(variant.buildType.name == 'release') {
+				variant.outputs.each { output ->
+					output.outputFileName = '../../../../../../Pushem.apk'
+				}
+			}
+		}
+	}
+}
+
+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'
+	implementation 'com.onesignal:OneSignal:3.15.1'
+
+	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
src/app_pushem/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
src/app_pushem/src/androidTest/java/com/jemoeder/lief/pushem/ExampleInstrumentedTest.java

@@ -0,0 +1,26 @@
+package com.jemoeder.lief.pushem;
+
+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());
+    }
+}

+ 52 - 0
src/app_pushem/src/main/AndroidManifest.xml

@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+	xmlns:tools="http://schemas.android.com/tools"
+	package="com.jemoeder.lief.pushem"
+	android:versionName="1.0.0">
+
+	<!-- Many permissions are injected by the OneSignal SDK by means of a merged manifest ;] -->
+
+	<!-- 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:name="com.jemoeder.lief.pushem.PushemWrapper"
+		android:supportsRtl="true"
+		android:theme="@style/PushemTheme"
+		tools:ignore="AllowBackup">
+
+		<!-- When tapping on a notification from OneSignal, simply dismiss it and never open the app itself =] -->
+		<meta-data android:name="com.onesignal.NotificationOpened.DEFAULT" android:value="DISABLE" />
+
+		<!-- Also set small icon col0ur, can't be a @color/ thing cuz we need the value w/o the leading # -.- -->
+		<meta-data android:name="com.onesignal.NotificationAccentColor.DEFAULT" android:value="FF3586FF" />
+
+		<activity
+			android:name="com.jemoeder.lief.pushem.MainActivity"
+			android:label="@string/app_name"
+			android:launchMode="singleTask"
+			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="com.jemoeder.lief.pushem.SettingsActivity"
+			android:label="@string/title_activity_settings"
+			android:parentActivityName="com.jemoeder.lief.pushem.MainActivity"
+			android:windowSoftInputMode="adjustPan">
+			<meta-data
+				android:name="android.support.PARENT_ACTIVITY"
+				android:value="com.jemoeder.lief.pushem.MainActivity" />
+		</activity>
+	</application>
+</manifest>

BIN
src/app_pushem/src/main/ic_launcher-web.png


+ 491 - 0
src/app_pushem/src/main/java/com/jemoeder/lief/pushem/MainActivity.java

@@ -0,0 +1,491 @@
+/* Copyright (C) All Rights Reserved
+ ** Written by Wazakindjes <waza@malvager.net>
+ ** Website: https://gitgud.malvager.net/Wazakindjes/Pushem
+ ** License: https://gitgud.malvager.net/Wazakindjes/Pushem/raw/master/LICENSE
+ */
+package com.jemoeder.lief.pushem;
+
+// A shitload of imports l m a o
+import android.annotation.SuppressLint;
+import android.app.Dialog;
+import android.support.v7.app.AlertDialog;
+import android.app.NotificationChannel;
+import android.app.NotificationChannelGroup;
+import android.app.NotificationManager;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.content.pm.PackageInfo;
+import android.content.res.Configuration;
+import android.os.Build;
+import android.os.Bundle;
+import android.preference.PreferenceManager;
+
+import android.support.constraint.ConstraintLayout;
+import android.support.v7.app.AppCompatActivity;
+
+import android.support.v7.widget.ButtonBarLayout;
+import android.view.Gravity;
+import android.view.Menu;
+import android.view.MenuItem;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.Button;
+import android.widget.FrameLayout;
+import android.widget.TextView;
+import com.onesignal.OSSubscriptionObserver;
+import com.onesignal.OSSubscriptionState;
+import com.onesignal.OSSubscriptionStateChanges;
+import com.onesignal.OneSignal;
+import com.onesignal.OneSignalBigHecks;
+
+public class MainActivity extends AppCompatActivity {
+	// Some important View stuff
+	private String btntxt_register;
+	private String btntxt_deregister;
+
+	// Misc
+	private PushemWrapper wrapass;
+
+	// OneSignal specific shit lol
+	private OSSubscriptionObserver monitorOneSignalSubscription = null;
+	private Button registerBtnOneSignal = null;
+
+	// For all services (although there's only 1 rn kek)
+	private boolean needDeregisterOneSignal = false;
+	private int numNeedsDeregister = 0;
+
+	@SuppressLint({"CommitPrefEdits", "ApplySharedPref", "DefaultLocale"})
+	@Override
+	protected void onCreate(Bundle savedInstanceState) {
+		super.onCreate(savedInstanceState);
+		setContentView(R.layout.activity_main);
+
+		// Initialise (most of) the global vars right hur phambly
+		wrapass = (PushemWrapper)getApplication();
+		wrapass.muhctx = getApplicationContext();
+
+		wrapass.muhprefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
+		wrapass.muhprefs_ed = wrapass.muhprefs.edit();
+
+		wrapass.notifMan = (NotificationManager)getSystemService(NOTIFICATION_SERVICE);
+
+		// We can set some global settings for all alerts y0
+		wrapass.alerter = new AlertDialog.Builder(MainActivity.this);
+		wrapass.alerter.setIcon(R.mipmap.ic_launcher);
+		wrapass.alerter.setCancelable(true);
+		wrapass.alerter.setNeutralButton(wrapass.ALERTEM_NEUTRALBTN_TXT, new DialogInterface.OnClickListener() {
+			@Override
+			public void onClick(DialogInterface dial0g, int index) {
+				dial0g.dismiss();
+			}
+		});
+
+		wrapass.muhres = getResources();
+		btntxt_register = wrapass.muhres.getString(R.string.main_btntxt_register);
+		btntxt_deregister = wrapass.muhres.getString(R.string.main_btntxt_deregister);
+
+		registerBtnOneSignal = findViewById(R.id.mainact_pushsvc_btn_onesignal);
+
+		// These try blocks can't really fail, it's mostly to silence the warnings/possibly err0rs you'd otherwise get
+		try {
+			// Get a full version + build number string to display on em preferences screen lol
+			wrapass.packageMan = wrapass.muhctx.getPackageManager();
+			wrapass.packageNaem = wrapass.muhctx.getPackageName();
+
+			PackageInfo pInfo = wrapass.packageMan.getPackageInfo(wrapass.packageNaem, 0);
+			String version = pInfo.versionName;
+			int build = pInfo.versionCode;
+			String buildtype = BuildConfig.BUILD_TYPE;
+
+			wrapass.muhprefs_ed.putString("prefs_versionbuild", String.format("v%s build %d (%s)", version, build, buildtype)).commit();
+		} catch(Exception fuckoff) { /* No flying fucks given */ }
+
+		initServiceStatusViews((ViewGroup)findViewById(R.id.muhcontainer));
+	}
+
+	@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() {
+		checkPrefsChanged();
+		super.onResume();
+	}
+
+	/*@Override
+	protected void onDestroy() {
+		super.onDestroy();
+	}*/
+
+	@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
+		if(item.getItemId() == R.id.action_settings) {
+			startActivity(new Intent(wrapass.muhctx, SettingsActivity.class));
+			return true;
+		}
+		return false;
+	}
+
+	private void alertem(String title, String message, boolean cancellable, DialogInterface.OnClickListener neutralBtn) {
+		AlertDialog dial0g = wrapass.alerter.create();
+		dial0g.setTitle(title);
+		dial0g.setMessage(message);
+
+		// Already set that shit to tr00 by default, so only do shit if this function gets passed false =]
+		if(!cancellable) {
+			dial0g.setCancelable(false);
+			dial0g.setCanceledOnTouchOutside(false);
+		}
+
+		// Default 0k button simply dismisses em dial0g
+		if(neutralBtn != null)
+			dial0g.setButton(Dialog.BUTTON_NEUTRAL, wrapass.ALERTEM_NEUTRALBTN_TXT, neutralBtn);
+
+		dial0g.show();
+
+		// Cuz it's too hard for Google to make the corresponding style XML values work, we need to do some shit from Java every dial0g -.-
+		Button btn;
+		if((btn = dial0g.getButton(DialogInterface.BUTTON_POSITIVE)) != null || (btn = dial0g.getButton(DialogInterface.BUTTON_NEGATIVE)) != null ||
+				(btn = dial0g.getButton(DialogInterface.BUTTON_NEUTRAL)) != null) {
+			ButtonBarLayout bb = (ButtonBarLayout)btn.getParent();
+			ViewGroup.LayoutParams curparams = bb.getLayoutParams();
+			FrameLayout.LayoutParams newparams = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, curparams.height);
+			newparams.gravity = Gravity.END;
+			bb.setLayoutParams(newparams);
+		}
+	}
+
+	private void checkPrefsChanged() {
+		String onesignal_pref_prefix = "prefs_" + wrapass.TAG_ONESIGNAL + "_";
+		String onesignal_tmppref_prefix = "prefs_tmp_" + wrapass.TAG_ONESIGNAL + "_";
+
+		// A notification channel can only be associated with a group once, so no need to even check for differences if we already did that shit
+		if(!wrapass.muhprefs.getBoolean("n0pref_hack_" + wrapass.TAG_ONESIGNAL + "_restoredchannelgroup", false)) {
+			String tmp_onesignal_channelgroup_name = wrapass.muhprefs.getString(onesignal_tmppref_prefix + "channelgroup_name", wrapass.ONESIGNAL_DEFAULT_GROUPNAME);
+			String onesignal_channelgroup_name = wrapass.muhprefs.getString(onesignal_pref_prefix + "channelgroup_name", null);
+			if(tmp_onesignal_channelgroup_name != null) { // Can't really be null anyways tho ;]
+				tmp_onesignal_channelgroup_name = tmp_onesignal_channelgroup_name.trim();
+				if(!tmp_onesignal_channelgroup_name.equals(onesignal_channelgroup_name)) {
+					// No deregistration required for this shit ;];];];]
+					wrapass.muhprefs_ed.putString(onesignal_pref_prefix + "channelgroup_name", tmp_onesignal_channelgroup_name.toLowerCase()).commit();
+					hackOneSignalRestoredChannelGroup();
+				}
+			}
+		}
+
+		// If the SDK is initialised multiple times with different app IDs, shit gets funky so you'll need to restart el app [=[[==[=[=[=[
+		String tmp_onesignal_app_id = wrapass.muhprefs.getString(onesignal_tmppref_prefix + "app_id", wrapass.ONESIGNAL_DEFAULT_APPID);
+		String onesignal_app_id = wrapass.muhprefs.getString(onesignal_pref_prefix + "app_id", null);
+		if(tmp_onesignal_app_id != null) {
+			tmp_onesignal_app_id = tmp_onesignal_app_id.trim();
+			if(!tmp_onesignal_app_id.equals(onesignal_app_id)) {
+				wrapass.muhprefs_ed.putString(onesignal_pref_prefix + "app_id", tmp_onesignal_app_id).commit();
+				if(monitorOneSignalSubscription != null) { // This is basically our "OneSignal initialised" tracker :>
+					setButtonState(registerBtnOneSignal, false); // Disable that shit asap brah
+					needDeregisterOneSignal = true;
+					numNeedsDeregister++;
+				}
+			}
+		}
+
+		if(numNeedsDeregister == 0)
+			return;
+
+		@SuppressLint("DefaultLocale")
+		String msg = String.format("Ayy some essential settings have been changed for %d push service%s, which cannot be updated after the push connection " +
+						"has already been set up with different values.\n\n" +
+						"We now need to deregister from all affected services and finally this app has to be restarted. It's highly advised to *not* close " +
+						"the app while it's doing this, simply wait for the final alert saying it's all gucci. ;]",
+				numNeedsDeregister, (numNeedsDeregister > 1 ? "s" : ""));
+
+		alertem("Deregistration required", msg, false, new DialogInterface.OnClickListener() {
+			// Gotta wait for the 0k button being pressed before actually doing shit lol
+			@Override
+			public void onClick(DialogInterface dial0g, int index) {
+				dial0g.dismiss();
+				
+				// In case someone opens the app, registers, deregisters, changes the app ID and registers again, we still need to
+				// restart the app but not actually deregister ;];];];]];];]
+				if(needDeregisterOneSignal) {
+					if(wrapass.muhprefs.getBoolean("n0pref_svc_registered_" + wrapass.TAG_ONESIGNAL, false))
+						deregisterOneSignal();
+					else // Decrement that shit so that if this is the only one, the thread below would run immediately :>
+						numNeedsDeregister--;
+				}
+
+				// Ayy now let's keep checking if the deregistrations have been br0cessed, and if so issue a final alert about em restart
+				new Thread(new Runnable() {
+					@Override
+					public void run() {
+						// Wait at least once timed lol
+						try { Thread.sleep(wrapass.ALERTEM_DEREGISTER_W8_INITIAL); } catch(Exception fuckoff) { /* No flying fucks given */ }
+						while(numNeedsDeregister > 0) {
+							try { Thread.sleep(wrapass.ALERTEM_DEREGISTER_W8); } catch(Exception fuckoff) { /* No flying fucks given */ }
+						}
+
+						// Just run the alerter on the main thread so we don't have to fuck with loopers inside this tiny ass thread ;]
+						runOnUiThread(new Runnable() {
+							@Override
+							public void run() {
+								String msg = "Ayy we gucci, all necessary deregistrations should now have been processed.\n\n" +
+										"Slam that 0k button below to restart Pushem (may not or may not work on all devices tho kek). ;]";
+								alertem("Deregistrations complete", msg, false, new DialogInterface.OnClickListener() {
+									// I don't care about exceptions here, those will make the app crash anyways :DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
+									@SuppressWarnings("ConstantConditions")
+									@Override
+									public void onClick(DialogInterface dial0g, int index) {
+										Intent restartemActivity = wrapass.packageMan.getLaunchIntentForPackage(wrapass.packageNaem);
+										restartemActivity.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
+										restartemActivity.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
+										restartemActivity.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+
+										if(needDeregisterOneSignal)
+											OneSignalBigHecks.clearAllPrefs();
+
+										finish();
+										startActivity(restartemActivity);
+										System.exit(0);
+									}
+								});
+							}
+						});
+					}
+				}).start();
+			}
+		});
+	}
+
+	private void hackOneSignalRestoredChannelGroup() {
+		// This is just a qt lil hack to make the "Restored" notification channel appear under the OneSignal group,
+		// since I cbf having multiple "Restored" channels down the r0ad lmao
+		// OneSignal doesn't set a group so we can still do that ourselves, and it's impossible to change it laturd
+		// Also, the group should be created immediately upon first registration, so it should exist prior to this being called ;]
+
+		// Only Ore0 and up have notification channels tho lmao
+		if(Build.VERSION.SDK_INT < Build.VERSION_CODES.O)
+			return;
+
+		// Already h4x3d this shit, fuck off
+		if(wrapass.muhprefs.getBoolean("n0pref_hack_" + wrapass.TAG_ONESIGNAL + "_restoredchannelgroup", false))
+			return;
+
+		// Not even registered so the proper group doesn't even exist yet, fuck off again
+		if(!wrapass.muhprefs.getBoolean("n0pref_svc_registered_" + wrapass.TAG_ONESIGNAL, false))
+			return;
+
+		// Until someone finally sets that shit, don't even bother either lol (even just going into settings will make it take effect anyways)
+		String groupName = wrapass.muhprefs.getString("prefs_" + wrapass.TAG_ONESIGNAL + "_channelgroup_name", null);
+		if(groupName == null || groupName.isEmpty())
+			return;
+
+		NotificationChannel channel = new NotificationChannel(wrapass.OS_RESTORE_CHANNEL_ID, "Restored", NotificationManager.IMPORTANCE_LOW);
+		String groupID = null;
+		for(NotificationChannelGroup notifGroup : wrapass.notifMan.getNotificationChannelGroups()) {
+			if(notifGroup.getName().toString().toLowerCase().equals(groupName)) {
+				groupID = notifGroup.getId();
+				break;
+			}
+		}
+		if(groupID == null)
+			return;
+
+		channel.setGroup(groupID);
+		wrapass.notifMan.createNotificationChannel(channel);
+		wrapass.muhprefs_ed.putBoolean("n0pref_hack_" + wrapass.TAG_ONESIGNAL + "_restoredchannelgroup", true).commit();
+	}
+
+	@SuppressWarnings("BooleanMethodIsAlwaysInverted")
+	private boolean hackOneSignalInit(boolean withopts) {
+		// Ayy time for some m0ar big hecks to pass the app ID programmatically while also properly setting up OneSignal, and only once ;];;];];];];];];];]
+		String app_id = wrapass.muhprefs.getString("prefs_" + wrapass.TAG_ONESIGNAL + "_app_id", null);
+		if(app_id == null || app_id.isEmpty() || app_id.equals(wrapass.ONESIGNAL_DEFAULT_APPID)) {
+			String msg = String.format("Invalid app ID: %s\n", (app_id == null || app_id.isEmpty() ? "<NULL>" : app_id));
+			alertem("OneSignal err0r", msg, true,null);
+			setServiceStatusViews(wrapass.TAG_ONESIGNAL, false); // Reset views obv lol
+			return false;
+		}
+
+		OneSignal.setLogLevel(OneSignal.LOG_LEVEL.NONE, OneSignal.LOG_LEVEL.NONE); // stfu pls lol
+		try {
+			// So this *will* fail because the app ID specified in the manifest placeholder is invalid, but it's necessary to set up some preferences
+			OneSignal.Builder os = OneSignal.startInit(wrapass.muhctx);
+			if(withopts) {
+				os.inFocusDisplaying(OneSignal.OSInFocusDisplayOption.Notification)
+						.unsubscribeWhenNotificationsAreDisabled(false); // Always have to use the deregister button to unsubscribe ;]
+			}
+			os.init();
+		}
+		catch(Exception fuckoff) { /* No flying fucks given */ }
+
+		// Let OneSignal be much more verbose if we're running a debug build of Pushem
+		// Either way though, make sure OneSignal outputs only warnings and anything less verbose (errors, fatal shit, etc) as alert dialogs
+		if(BuildConfig.DEBUG)
+			OneSignal.setLogLevel(OneSignal.LOG_LEVEL.VERBOSE, OneSignal.LOG_LEVEL.WARN);
+		else
+			OneSignal.setLogLevel(OneSignal.LOG_LEVEL.WARN, OneSignal.LOG_LEVEL.WARN);
+
+		// Pass a null Google project numba so it'll fall back to what's specified in em build.gradle (onesignal_google_project_number: 'REMOTE')
+		// Also using the longest form of all overl0ads for maximum clarity
+		// This *should not* fail, so let's not silence exceptions here ;]
+		OneSignal.init(wrapass.muhctx, null, app_id, null, null);
+		return true;
+	}
+
+	private void initServiceStatusViews(ViewGroup rewt) {
+		for(int i = 0; i < rewt.getChildCount(); i++) {
+			View v = rewt.getChildAt(i);
+			if(v instanceof ConstraintLayout) {
+				initServiceStatusViews((ViewGroup)v);
+				continue;
+			}
+			if(!(v instanceof Button) || v.getTag() == null)
+				continue;
+			setButtonState((Button)v, false);
+			setServiceStatusViews(v.getTag().toString(), true);
+		}
+	}
+
+	private void setServiceStatusViews(String tag, boolean initem) {
+		String n0pref_registered = "n0pref_svc_registered_" + tag;
+		String n0pref_uuid = "n0pref_svc_uuid_" + tag;
+		boolean registered = wrapass.muhprefs.getBoolean(n0pref_registered, false);
+		String uuid = wrapass.muhprefs.getString(n0pref_uuid, "");
+		TextView uuidView;
+
+		if(tag.equals(wrapass.TAG_ONESIGNAL)) {
+			uuidView = findViewById(R.id.mainact_pushsvc_uuid_onesignal);
+			if(initem) {
+				// Make sure we set the proper status everytime lol, but not if uuid is empty (meaning we have never registered) to prevent registering anyways
+				if(registered)
+					registerOneSignal();
+				else if(uuid != null && !uuid.isEmpty())
+					deregisterOneSignal();
+			}
+		}
+		else
+			return; // Just return silently lol
+
+		if(registered)
+			registerBtnOneSignal.setText(btntxt_deregister);
+		else
+			registerBtnOneSignal.setText(btntxt_register);
+		uuidView.setText(uuid);
+		setButtonState(registerBtnOneSignal, true);
+	}
+
+	private void setButtonState(Button btn, boolean enabled) {
+		if(enabled) {
+			btn.setEnabled(true);
+			btn.setClickable(true);
+			btn.setAlpha(1.0f);
+		}
+		else {
+			btn.setEnabled(false);
+			btn.setClickable(false);
+			btn.setAlpha(0.5f);
+		}
+	}
+
+	private void registerOneSignal() {
+		// lolnope
+		// Just in case someone changes settings and doesn't return to this activity, but rather closes and reopens the app
+		// Doing it the latter way causes the init functions to try and register w/ OneSignal before the new prefs have been applied ;]
+		if(needDeregisterOneSignal)
+			return;
+
+		if(!hackOneSignalInit(true))
+			return;
+
+		// Always gotta reattach the subscription listener lol
+		if(monitorOneSignalSubscription == null) {
+			monitorOneSignalSubscription = new OneSignalSubscriptionObserver();
+			OneSignal.addSubscriptionObserver(monitorOneSignalSubscription);
+		}
+
+		OneSignal.setSubscription(true); // Let's make sure to (re)subscribe lol
+	}
+
+	private void deregisterOneSignal() {
+		// No need to reinitialise OneSignal if we already did so earlier in registerOneSignal(), which also creates the observer ;]
+		// I doubt it could happen, but this way if the SDK hasn't been initialised for some reason and you're able to deregister, we'll init it anyways =]
+		if(monitorOneSignalSubscription == null) {
+			if(!hackOneSignalInit(false))
+				return;
+			monitorOneSignalSubscription = new OneSignalSubscriptionObserver();
+			OneSignal.addSubscriptionObserver(monitorOneSignalSubscription);
+		}
+		OneSignal.setSubscription(false);
+	}
+
+	public void mainact_handle_btn(View v) {
+		Button registerBtn = (Button)v;
+		setButtonState(registerBtn, false);
+
+		String tag = v.getTag().toString();
+		String n0pref_registered = "n0pref_svc_registered_" + tag;
+		boolean registered = wrapass.muhprefs.getBoolean(n0pref_registered, false);
+
+		if(tag.equals(wrapass.TAG_ONESIGNAL)) {
+			if(!registered)
+				registerOneSignal();
+			else
+				deregisterOneSignal();
+		}
+		else
+			setButtonState(registerBtn, true);
+	}
+
+	private class OneSignalSubscriptionObserver implements OSSubscriptionObserver {
+		public OneSignalSubscriptionObserver() {
+		}
+
+		public void onOSSubscriptionChanged(OSSubscriptionStateChanges stateChanges) {
+			String n0pref_registered = "n0pref_svc_registered_" + wrapass.TAG_ONESIGNAL;
+			String n0pref_uuid = "n0pref_svc_uuid_" + wrapass.TAG_ONESIGNAL;
+
+			OSSubscriptionState stateNew = stateChanges.getTo();
+			String uuid = stateNew.getUserId();
+			if(uuid == null) // The initial few requests may be without a user ID, so let's ignore th0se ;]
+				return;
+
+			// We're not checking stateChanges.getFrom() here; if for some reason your phone lost the connection but it's still known as
+			// "subscribed" in the OneSignal dashboard, you'll never be able to reregister if we checked for !from.getSubscribed() ;];;];];]
+			if(stateNew.getSubscribed()) {
+				// We might sometimes get a different UUID, so let's not bother checking if we're already/still registered
+				wrapass.muhprefs_ed.putBoolean(n0pref_registered, true);
+				wrapass.muhprefs_ed.putString(n0pref_uuid, uuid);
+				wrapass.muhprefs_ed.commit();
+				setServiceStatusViews(wrapass.TAG_ONESIGNAL, false);
+				hackOneSignalRestoredChannelGroup(); // Only add the notification channel if someone actually wants to use OneSignal ;];];];];];];]
+			}
+
+			else if(!stateNew.getSubscribed()) {
+				if(!wrapass.muhprefs.getBoolean(n0pref_registered, false))
+					return;
+
+				wrapass.muhprefs_ed.putBoolean(n0pref_registered, false);
+				wrapass.muhprefs_ed.putString(n0pref_uuid, "");
+				wrapass.muhprefs_ed.commit();
+
+				// When prefs are updated we might deregister, so re-disable the buttons since you have to restart the app anyways lol
+				setServiceStatusViews(wrapass.TAG_ONESIGNAL, false);
+				if(needDeregisterOneSignal) {
+					numNeedsDeregister--;
+					setButtonState(registerBtnOneSignal, false);
+				}
+			}
+		}
+	}
+}

+ 43 - 0
src/app_pushem/src/main/java/com/jemoeder/lief/pushem/PushemWrapper.java

@@ -0,0 +1,43 @@
+/* Copyright (C) All Rights Reserved
+ ** Written by Wazakindjes <waza@malvager.net>
+ ** Website: https://gitgud.malvager.net/Wazakindjes/Pushem
+ ** License: https://gitgud.malvager.net/Wazakindjes/Pushem/raw/master/LICENSE
+ */
+package com.jemoeder.lief.pushem;
+
+import android.app.Application;
+import android.app.NotificationManager;
+import android.content.Context;
+import android.content.SharedPreferences;
+import android.content.pm.PackageManager;
+import android.content.res.Resources;
+import android.support.v7.app.AlertDialog;
+
+public class PushemWrapper extends Application {
+	// Preferences related
+	public SharedPreferences muhprefs;
+	public SharedPreferences.Editor muhprefs_ed;
+
+	// Misc
+	public Resources muhres;
+	public NotificationManager notifMan;
+	public AlertDialog.Builder alerter;
+	public Context muhctx;
+	public PackageManager packageMan;
+	public String packageNaem;
+
+	// Default alert shit lol
+	public final String ALERTEM_NEUTRALBTN_TXT = "0k";
+	public final int ALERTEM_DEREGISTER_W8_INITIAL = 5000; // 5 sec lol
+	public final int ALERTEM_DEREGISTER_W8 = 3000;
+
+	// Tags for em buttons in el MainActivity y0, must match the android:tag value in XML
+	public final String TAG_ONESIGNAL = "onesignal";
+
+	// Also some defaults imo tbh famlamlam
+	public final String ONESIGNAL_DEFAULT_APPID = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";
+	public final String ONESIGNAL_DEFAULT_GROUPNAME = "OneSignal";
+
+	// Found this shit in NotificationChannelManager.java from the OneSignal SDK ;];]];];;];]];];
+	public final String OS_RESTORE_CHANNEL_ID = "restored_OS_notifications";
+}

+ 60 - 0
src/app_pushem/src/main/java/com/jemoeder/lief/pushem/SettingsActivity.java

@@ -0,0 +1,60 @@
+/* Copyright (C) All Rights Reserved
+ ** Written by Wazakindjes <waza@malvager.net>
+ ** Website: https://gitgud.malvager.net/Wazakindjes/Pushem
+ ** License: https://gitgud.malvager.net/Wazakindjes/Pushem/raw/master/LICENSE
+*/
+package com.jemoeder.lief.pushem;
+
+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 final 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);
+		try {
+			//noinspection ConstantConditions
+			sBindPreferenceSummaryToValueListener.onPreferenceChange(preference,
+					PreferenceManager
+							.getDefaultSharedPreferences(preference.getContext())
+							.getString(preference.getKey(), ""));
+		}
+		catch(Exception fuckoff) { /* No flying fucks given */ }
+	}
+
+	@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_tmp_onesignal_app_id"));
+			bindPreferenceSummaryToValue(findPreference("prefs_tmp_onesignal_channelgroup_name"));
+			bindPreferenceSummaryToValue(findPreference("prefs_versionbuild"));
+		}
+	}
+}

+ 37 - 0
src/app_pushem/src/main/java/com/onesignal/OneSignalBigHecks.java

@@ -0,0 +1,37 @@
+package com.onesignal;
+
+import android.annotation.SuppressLint;
+
+import static com.onesignal.OneSignalPrefs.PREFS_ONESIGNAL;
+import static com.onesignal.OneSignalPrefs.prefsHandler;
+import static com.onesignal.OneSignalPrefs.prefsToApply;
+import static com.onesignal.OneSignalStateSynchronizer.getEmailStateSynchronizer;
+import static com.onesignal.OneSignalStateSynchronizer.getPushStateSynchronizer;
+
+// M0ar haccs in order to properly access variables inside the class lol
+public class OneSignalBigHecks {
+	@SuppressWarnings("ConstantConditions")
+	@SuppressLint("ApplySharedPref")
+	public static void clearAllPrefs() {
+		// Make sure OneSignal doesn't later attempt to update the preferences itself lol
+		try {
+			prefsHandler.quit();
+
+			// Also clear out all pending prefs, just in case
+			try {
+				prefsToApply.get(PREFS_ONESIGNAL).clear();
+			} catch(Exception fuckoff) { /* No flying fucks given */ }
+
+			prefsHandler = new OneSignalPrefs.WritePrefHandlerThread("OSH_WritePrefs");
+		} catch(Exception fuckoff) { /* No flying fucks given */ }
+
+		// Also flush states and shit kek
+		try {
+			getPushStateSynchronizer().resetCurrentState();
+			getEmailStateSynchronizer().resetCurrentState();
+		} catch(Exception fuckoff) { /* No flying fucks given */ }
+
+		// Need a direct commit so we can do this shit before actually restarting the app lmao
+		try { OneSignalPrefs.getSharedPrefsByName(PREFS_ONESIGNAL).edit().clear().commit(); } catch(Exception fuckoff) { /* No flying fucks given */ }
+	}
+}

BIN
src/app_pushem/src/main/res/drawable-hdpi/ic_action_settings.png


BIN
src/app_pushem/src/main/res/drawable-hdpi/ic_pushsvc_onesignal.png


BIN
src/app_pushem/src/main/res/drawable-hdpi/ic_stat_onesignal_default.png


BIN
src/app_pushem/src/main/res/drawable-ldpi/ic_pushsvc_onesignal.png


BIN
src/app_pushem/src/main/res/drawable-mdpi/ic_action_settings.png


BIN
src/app_pushem/src/main/res/drawable-mdpi/ic_pushsvc_onesignal.png


BIN
src/app_pushem/src/main/res/drawable-mdpi/ic_stat_onesignal_default.png


BIN
src/app_pushem/src/main/res/drawable-xhdpi/ic_action_settings.png


BIN
src/app_pushem/src/main/res/drawable-xhdpi/ic_pushsvc_onesignal.png


BIN
src/app_pushem/src/main/res/drawable-xhdpi/ic_stat_onesignal_default.png


BIN
src/app_pushem/src/main/res/drawable-xxhdpi/ic_action_settings.png


BIN
src/app_pushem/src/main/res/drawable-xxhdpi/ic_pushsvc_onesignal.png


BIN
src/app_pushem/src/main/res/drawable-xxhdpi/ic_stat_onesignal_default.png


BIN
src/app_pushem/src/main/res/drawable-xxxhdpi/ic_action_settings.png


BIN
src/app_pushem/src/main/res/drawable-xxxhdpi/ic_pushsvc_onesignal.png


BIN
src/app_pushem/src/main/res/drawable-xxxhdpi/ic_stat_onesignal_default.png


+ 15 - 0
src/app_pushem/src/main/res/drawable/layout_border.xml

@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+	<stroke
+		android:width="@dimen/main_svc_border_width"
+		android:color="@color/colorAccent" />
+
+	<corners
+		android:radius="@dimen/main_svc_border_cornerradius" />
+
+	<padding
+		android:left="@dimen/main_svc_border_padding"
+		android:top="@dimen/main_svc_border_padding"
+		android:right="@dimen/main_svc_border_padding"
+		android:bottom="@dimen/main_svc_border_padding" />
+</shape>

+ 7 - 0
src/app_pushem/src/main/res/drawable/mainact_pushsvc_img_onesignal.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
+	<item
+		android:drawable="@drawable/ic_pushsvc_onesignal"
+		android:width="@dimen/logo_size"
+		android:height="@dimen/logo_size" />
+</layer-list>

+ 100 - 0
src/app_pushem/src/main/res/layout/activity_main.xml

@@ -0,0 +1,100 @@
+<?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"
+	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
+			android:layout_width="match_parent"
+			android:layout_height="wrap_content"
+			android:id="@+id/muhcontainer"
+			android:focusable="true"
+			android:focusableInTouchMode="true">
+
+			<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" />
+
+
+
+			<android.support.constraint.ConstraintLayout
+				android:layout_width="@dimen/main_svc_width"
+				android:layout_height="wrap_content"
+				android:id="@+id/mainact_pushsvc_onesignal_container"
+				app:layout_constraintTop_toBottomOf="@id/mainact_intro"
+				app:layout_constraintStart_toStartOf="parent"
+				app:layout_constraintEnd_toEndOf="parent"
+				android:layout_marginTop="@dimen/main_svc_spacing"
+				android:background="@drawable/layout_border">
+
+				<ImageView
+					android:layout_width="wrap_content"
+					android:layout_height="wrap_content"
+					android:id="@+id/mainact_pushsvc_img_onesignal"
+					android:src="@drawable/mainact_pushsvc_img_onesignal"
+					app:layout_constraintTop_toTopOf="parent"
+					app:layout_constraintStart_toStartOf="parent"
+					app:layout_constraintEnd_toEndOf="parent"
+					tools:ignore="ContentDescription" />
+				<Button
+					android:layout_width="wrap_content"
+					android:layout_height="wrap_content"
+					android:id="@+id/mainact_pushsvc_btn_onesignal"
+					android:tag="onesignal"
+					android:enabled="false"
+					android:clickable="false"
+					android:alpha="0.5"
+					android:minWidth="@dimen/button_minwidth"
+					android:layout_marginTop="@dimen/logo_btn_margin"
+					android:text="@string/main_btntxt_register"
+					android:textAllCaps="false"
+					android:textColor="@color/colorAccent"
+					android:onClick="mainact_handle_btn"
+					app:layout_constraintTop_toBottomOf="@id/mainact_pushsvc_img_onesignal"
+					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_pushsvc_uuid_onesignal"
+					android:layout_marginTop="@dimen/logo_btn_margin"
+					android:textIsSelectable="true"
+					android:focusable="true"
+					android:focusableInTouchMode="true"
+					android:selectAllOnFocus="true"
+					android:textSize="@dimen/text_uuid"
+					android:textColor="@color/colorAccent"
+					android:hint="@string/main_uuid_placeholder"
+					app:layout_constraintTop_toBottomOf="@id/mainact_pushsvc_btn_onesignal"
+					app:layout_constraintStart_toStartOf="parent"
+					app:layout_constraintEnd_toEndOf="parent" />
+			</android.support.constraint.ConstraintLayout>
+
+
+			<View
+				android:layout_width="match_parent"
+				android:layout_height="1dp"
+				android:layout_marginTop="@dimen/main_divider_margintop"
+				android:layout_marginStart="@dimen/main_divider_marginside"
+				android:layout_marginEnd="@dimen/main_divider_marginside"
+				app:layout_constraintTop_toBottomOf="@id/mainact_pushsvc_onesignal_container"
+				app:layout_constraintStart_toStartOf="@id/mainact_intro" />
+		</android.support.constraint.ConstraintLayout>
+	</ScrollView>
+</android.support.design.widget.CoordinatorLayout>

+ 16 - 0
src/app_pushem/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>

+ 10 - 0
src/app_pushem/src/main/res/menu/main.xml

@@ -0,0 +1,10 @@
+<?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_settings"
+		app:showAsAction="always"
+		android:title="@string/menuact_settings"
+		android:icon="@drawable/ic_action_settings" />
+</menu>

BIN
src/app_pushem/src/main/res/mipmap-hdpi/ic_launcher.png


BIN
src/app_pushem/src/main/res/mipmap-mdpi/ic_launcher.png


BIN
src/app_pushem/src/main/res/mipmap-xhdpi/ic_launcher.png


BIN
src/app_pushem/src/main/res/mipmap-xxhdpi/ic_launcher.png


BIN
src/app_pushem/src/main/res/mipmap-xxxhdpi/ic_launcher.png


+ 11 - 0
src/app_pushem/src/main/res/values/colors.xml

@@ -0,0 +1,11 @@
+<?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>
+
+	<!-- Other text related shit 0bv -->
+	<color name="text_prefheader">@color/colorAccent</color>
+</resources>

+ 24 - 0
src/app_pushem/src/main/res/values/dimens.xml

@@ -0,0 +1,24 @@
+<?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_uuid">12sp</dimen>
+
+	<dimen name="logo_size">90dp</dimen>
+	<dimen name="logo_btn_margin">4dp</dimen>
+
+	<!-- Margins for a divider -->
+	<dimen name="main_divider_margintop">24dp</dimen>
+	<dimen name="main_divider_marginside">10dp</dimen>
+
+	<dimen name="main_svc_spacing">20dp</dimen>
+	<dimen name="main_svc_width">250dp</dimen>
+	<dimen name="main_svc_border_width">2dp</dimen>
+	<dimen name="main_svc_border_padding">8dp</dimen>
+	<dimen name="main_svc_border_cornerradius">10dp</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>
+</resources>

+ 25 - 0
src/app_pushem/src/main/res/values/strings.xml

@@ -0,0 +1,25 @@
+<!--suppress CheckTagEmptyBody -->
+<resources xmlns:tools="http://schemas.android.com/tools">
+	<!-- Lil hack so we can pass this an empty string as an int xd -->
+	<string name="NOSTRING" tools:keep="@string/NOSTRING"></string>
+
+	<!-- Some app basic strings -->
+	<string name="app_name">Pushem</string>
+	<string name="app_intro">Aye my dude, check below for the supported push notification services and register to the ones you want. You can also deregister at any time.</string>
+
+	<!-- Main menu action names -->
+	<string name="menuact_settings">Settings</string>
+
+	<!-- Other activity names -->
+	<string name="title_activity_settings">Settings</string>
+
+	<!-- Settings related labels/summaries -->
+	<string name="prefs_onesignal_channelgroup_name">Notification channel group name</string>
+	<string name="prefs_onesignal_app_id">App ID</string>
+
+	<!-- Button texts in main activity -->
+	<string name="main_btntxt_register">Register</string>
+	<string name="main_btntxt_deregister">Deregister</string>
+
+	<string name="main_uuid_placeholder">Device UUID will appear here</string>
+</resources>

+ 27 - 0
src/app_pushem/src/main/res/values/styles.xml

@@ -0,0 +1,27 @@
+<resources>
+	<!-- Global theme -->
+	<style name="PushemTheme" 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>
+
+		<item name="alertDialogTheme">@style/PushemDialog</item>
+	</style>
+
+	<!-- For AlertDialogs lol -->
+	<style name="PushemDialog" parent="Theme.AppCompat.Dialog.Alert">
+		<!-- Even though this implies content text colour, it's actually for the title and buttons lmoa -->
+		<item name="android:textColor">@color/colorAccent</item>
+
+		<!-- THIS is for the contents xd -->
+		<item name="android:textColorPrimary">@color/colorText</item>
+
+		<item name="buttonBarButtonStyle">@style/PushemDialog.Button</item>
+	</style>
+
+	<style name="PushemDialog.Button" parent="Theme.AppCompat.Dialog.Alert">
+		<!-- Yes, an almost empty theme but we need the parent's values to get the proper background colour etc ;];];];];];];] -->
+		<item name="textAllCaps">false</item>
+	</style>
+</resources>

+ 11 - 0
src/app_pushem/src/main/res/xml/network_security_config.xml

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<network-security-config xmlns:tools="http://schemas.android.com/tools">
+	<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"
+				tools:ignore="AcceptsUserCertificates" />
+			<certificates src="system" />
+		</trust-anchors>
+	</base-config>
+</network-security-config>

+ 41 - 0
src/app_pushem/src/main/res/xml/preferences.xml

@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="utf-8"?>
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
+	<PreferenceCategory
+		android:title="OneSignal"
+		android:layout="@layout/preference_category">
+
+		<EditTextPreference
+			android:defaultValue="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
+			android:inputType="text"
+			android:key="prefs_tmp_onesignal_app_id"
+			android:maxLines="1"
+			android:selectAllOnFocus="true"
+			android:singleLine="true"
+			android:maxLength="64"
+			android:title="@string/prefs_onesignal_app_id"
+			android:summary="@string/prefs_onesignal_app_id" />
+
+		<EditTextPreference
+			android:defaultValue="OneSignal"
+			android:inputType="textCapWords"
+			android:key="prefs_tmp_onesignal_channelgroup_name"
+			android:maxLines="1"
+			android:selectAllOnFocus="true"
+			android:singleLine="true"
+			android:maxLength="64"
+			android:title="@string/prefs_onesignal_channelgroup_name"
+			android:summary="@string/prefs_onesignal_channelgroup_name" />
+	</PreferenceCategory>
+
+	<PreferenceCategory
+		android:title="Not really settings lel"
+		android:layout="@layout/preference_category">
+
+		<Preference
+			android:textIsSelectable="false"
+			android:key="prefs_versionbuild"
+			android:selectable="false"
+			android:title="Version/Build"
+			android:summary=""/>
+	</PreferenceCategory>
+</PreferenceScreen>

+ 17 - 0
src/app_pushem/src/test/java/com/jemoeder/lief/pushem/ExampleUnitTest.java

@@ -0,0 +1,17 @@
+package com.jemoeder.lief.pushem;
+
+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);
+    }
+}

+ 2 - 0
src/app_pushem/version.properties

@@ -0,0 +1,2 @@
+#Thu Aug 13 16:42:36 CEST 2020
+VERSION_CODE=432

+ 24 - 0
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:4.0.1'
+		// 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
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
src/gradle/wrapper/gradle-wrapper.jar


+ 6 - 0
src/gradle/wrapper/gradle-wrapper.properties

@@ -0,0 +1,6 @@
+#Sun Aug 09 11:51:43 CEST 2020
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip

+ 172 - 0
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
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "`uname`" in
+  CYGWIN* )
+    cygwin=true
+    ;;
+  Darwin* )
+    darwin=true
+    ;;
+  MINGW* )
+    msys=true
+    ;;
+  NONSTOP* )
+    nonstop=true
+    ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+        # IBM's JDK on AIX uses strange locations for the executables
+        JAVACMD="$JAVA_HOME/jre/sh/java"
+    else
+        JAVACMD="$JAVA_HOME/bin/java"
+    fi
+    if [ ! -x "$JAVACMD" ] ; then
+        die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+    fi
+else
+    JAVACMD="java"
+    which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+    MAX_FD_LIMIT=`ulimit -H -n`
+    if [ $? -eq 0 ] ; then
+        if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+            MAX_FD="$MAX_FD_LIMIT"
+        fi
+        ulimit -n $MAX_FD
+        if [ $? -ne 0 ] ; then
+            warn "Could not set maximum file descriptor limit: $MAX_FD"
+        fi
+    else
+        warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+    fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+    GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+    APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+    CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+    JAVACMD=`cygpath --unix "$JAVACMD"`
+
+    # We build the pattern for arguments to be converted via cygpath
+    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+    SEP=""
+    for dir in $ROOTDIRSRAW ; do
+        ROOTDIRS="$ROOTDIRS$SEP$dir"
+        SEP="|"
+    done
+    OURCYGPATTERN="(^($ROOTDIRS))"
+    # Add a user-defined pattern to the cygpath arguments
+    if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+        OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+    fi
+    # Now convert the arguments - kludge to limit ourselves to /bin/sh
+    i=0
+    for arg in "$@" ; do
+        CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+        CHECK2=`echo "$arg"|egrep -c "^-"`                                 ### Determine if an option
+
+        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition
+            eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+        else
+            eval `echo args$i`="\"$arg\""
+        fi
+        i=$((i+1))
+    done
+    case $i in
+        (0) set -- ;;
+        (1) set -- "$args0" ;;
+        (2) set -- "$args0" "$args1" ;;
+        (3) set -- "$args0" "$args1" "$args2" ;;
+        (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+        (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+        (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+        (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+        (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+        (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+    esac
+fi
+
+# Escape application args
+save () {
+    for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+    echo " "
+}
+APP_ARGS=$(save "$@")
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
+if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
+  cd "$(dirname "$0")"
+fi
+
+exec "$JAVACMD" "$@"

+ 84 - 0
src/gradlew.bat

@@ -0,0 +1,84 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem  Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if  not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega

+ 1 - 0
src/settings.gradle

@@ -0,0 +1 @@
+include ':app_pushem'