[
  {
    "path": ".gitignore",
    "content": "# Built application files\n*.apk\n*.ap_\n\n# Files for the Dalvik VM\n*.dex\n\n# Java class files\n*.class\n\n# Generated files\nbin/\ngen/\n\n# Gradle files\n.gradle/\nbuild/\n\n# Local configuration file (sdk path, etc)\nlocal.properties\n\n# Proguard folder generated by Eclipse\nproguard/\n\n# Log Files\n*.log\n\n# Android Studio Navigation editor temp files\n.navigation/\n\n# Android Studio captures folder\ncaptures/\n\n# Others\n.idea/\n*.DS_Store\n*.iml"
  },
  {
    "path": "LICENSE",
    "content": "                    GNU GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n                            Preamble\n\n  The GNU General Public License is a free, copyleft license for\nsoftware and other kinds of works.\n\n  The licenses for most software and other practical works are designed\nto take away your freedom to share and change the works.  By contrast,\nthe GNU General Public License is intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users.  We, the Free Software Foundation, use the\nGNU General Public License for most of our software; it applies also to\nany other work released this way by its authors.  You can apply it to\nyour programs, too.\n\n  When we speak of free software, we are referring to freedom, not\nprice.  Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\n  To protect your rights, we need to prevent others from denying you\nthese rights or asking you to surrender the rights.  Therefore, you have\ncertain responsibilities if you distribute copies of the software, or if\nyou modify it: responsibilities to respect the freedom of others.\n\n  For example, if you distribute copies of such a program, whether\ngratis or for a fee, you must pass on to the recipients the same\nfreedoms that you received.  You must make sure that they, too, receive\nor can get the source code.  And you must show them these terms so they\nknow their rights.\n\n  Developers that use the GNU GPL protect your rights with two steps:\n(1) assert copyright on the software, and (2) offer you this License\ngiving you legal permission to copy, distribute and/or modify it.\n\n  For the developers' and authors' protection, the GPL clearly explains\nthat there is no warranty for this free software.  For both users' and\nauthors' sake, the GPL requires that modified versions be marked as\nchanged, so that their problems will not be attributed erroneously to\nauthors of previous versions.\n\n  Some devices are designed to deny users access to install or run\nmodified versions of the software inside them, although the manufacturer\ncan do so.  This is fundamentally incompatible with the aim of\nprotecting users' freedom to change the software.  The systematic\npattern of such abuse occurs in the area of products for individuals to\nuse, which is precisely where it is most unacceptable.  Therefore, we\nhave designed this version of the GPL to prohibit the practice for those\nproducts.  If such problems arise substantially in other domains, we\nstand ready to extend this provision to those domains in future versions\nof the GPL, as needed to protect the freedom of users.\n\n  Finally, every program is threatened constantly by software patents.\nStates should not allow patents to restrict development and use of\nsoftware on general-purpose computers, but in those that do, we wish to\navoid the special danger that patents applied to a free program could\nmake it effectively proprietary.  To prevent this, the GPL assures that\npatents cannot be used to render the program non-free.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.\n\n                       TERMS AND CONDITIONS\n\n  0. Definitions.\n\n  \"This License\" refers to version 3 of the GNU General Public License.\n\n  \"Copyright\" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\n  \"The Program\" refers to any copyrightable work licensed under this\nLicense.  Each licensee is addressed as \"you\".  \"Licensees\" and\n\"recipients\" may be individuals or organizations.\n\n  To \"modify\" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy.  The resulting work is called a \"modified version\" of the\nearlier work or a work \"based on\" the earlier work.\n\n  A \"covered work\" means either the unmodified Program or a work based\non the Program.\n\n  To \"propagate\" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy.  Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\n\n  To \"convey\" a work means any kind of propagation that enables other\nparties to make or receive copies.  Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\n\n  An interactive user interface displays \"Appropriate Legal Notices\"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License.  If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n\n  1. Source Code.\n\n  The \"source code\" for a work means the preferred form of the work\nfor making modifications to it.  \"Object code\" means any non-source\nform of a work.\n\n  A \"Standard Interface\" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\n\n  The \"System Libraries\" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form.  A\n\"Major Component\", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\n\n  The \"Corresponding Source\" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities.  However, it does not include the work's\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work.  For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\n\n  The Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\n\n  The Corresponding Source for a work in source code form is that\nsame work.\n\n  2. Basic Permissions.\n\n  All rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met.  This License explicitly affirms your unlimited\npermission to run the unmodified Program.  The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work.  This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\n\n  You may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force.  You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright.  Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\n\n  Conveying under any other circumstances is permitted solely under\nthe conditions stated below.  Sublicensing is not allowed; section 10\nmakes it unnecessary.\n\n  3. Protecting Users' Legal Rights From Anti-Circumvention Law.\n\n  No covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\n\n  When you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work's\nusers, your or third parties' legal rights to forbid circumvention of\ntechnological measures.\n\n  4. Conveying Verbatim Copies.\n\n  You may convey verbatim copies of the Program's source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\n\n  You may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n\n  5. Conveying Modified Source Versions.\n\n  You may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\n\n    a) The work must carry prominent notices stating that you modified\n    it, and giving a relevant date.\n\n    b) The work must carry prominent notices stating that it is\n    released under this License and any conditions added under section\n    7.  This requirement modifies the requirement in section 4 to\n    \"keep intact all notices\".\n\n    c) You must license the entire work, as a whole, under this\n    License to anyone who comes into possession of a copy.  This\n    License will therefore apply, along with any applicable section 7\n    additional terms, to the whole of the work, and all its parts,\n    regardless of how they are packaged.  This License gives no\n    permission to license the work in any other way, but it does not\n    invalidate such permission if you have separately received it.\n\n    d) If the work has interactive user interfaces, each must display\n    Appropriate Legal Notices; however, if the Program has interactive\n    interfaces that do not display Appropriate Legal Notices, your\n    work need not make them do so.\n\n  A compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n\"aggregate\" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation's users\nbeyond what the individual works permit.  Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n\n  6. Conveying Non-Source Forms.\n\n  You may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\n\n    a) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by the\n    Corresponding Source fixed on a durable physical medium\n    customarily used for software interchange.\n\n    b) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by a\n    written offer, valid for at least three years and valid for as\n    long as you offer spare parts or customer support for that product\n    model, to give anyone who possesses the object code either (1) a\n    copy of the Corresponding Source for all the software in the\n    product that is covered by this License, on a durable physical\n    medium customarily used for software interchange, for a price no\n    more than your reasonable cost of physically performing this\n    conveying of source, or (2) access to copy the\n    Corresponding Source from a network server at no charge.\n\n    c) Convey individual copies of the object code with a copy of the\n    written offer to provide the Corresponding Source.  This\n    alternative is allowed only occasionally and noncommercially, and\n    only if you received the object code with such an offer, in accord\n    with subsection 6b.\n\n    d) Convey the object code by offering access from a designated\n    place (gratis or for a charge), and offer equivalent access to the\n    Corresponding Source in the same way through the same place at no\n    further charge.  You need not require recipients to copy the\n    Corresponding Source along with the object code.  If the place to\n    copy the object code is a network server, the Corresponding Source\n    may be on a different server (operated by you or a third party)\n    that supports equivalent copying facilities, provided you maintain\n    clear directions next to the object code saying where to find the\n    Corresponding Source.  Regardless of what server hosts the\n    Corresponding Source, you remain obligated to ensure that it is\n    available for as long as needed to satisfy these requirements.\n\n    e) Convey the object code using peer-to-peer transmission, provided\n    you inform other peers where the object code and Corresponding\n    Source of the work are being offered to the general public at no\n    charge under subsection 6d.\n\n  A separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\n\n  A \"User Product\" is either (1) a \"consumer product\", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling.  In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage.  For a particular\nproduct received by a particular user, \"normally used\" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product.  A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\n  \"Installation Information\" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source.  The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\n\n  If you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information.  But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\n\n  The requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed.  Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\n\n  Corresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n\n  7. Additional Terms.\n\n  \"Additional permissions\" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law.  If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\n\n  When you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit.  (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.)  You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\n\n  Notwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\n\n    a) Disclaiming warranty or limiting liability differently from the\n    terms of sections 15 and 16 of this License; or\n\n    b) Requiring preservation of specified reasonable legal notices or\n    author attributions in that material or in the Appropriate Legal\n    Notices displayed by works containing it; or\n\n    c) Prohibiting misrepresentation of the origin of that material, or\n    requiring that modified versions of such material be marked in\n    reasonable ways as different from the original version; or\n\n    d) Limiting the use for publicity purposes of names of licensors or\n    authors of the material; or\n\n    e) Declining to grant rights under trademark law for use of some\n    trade names, trademarks, or service marks; or\n\n    f) Requiring indemnification of licensors and authors of that\n    material by anyone who conveys the material (or modified versions of\n    it) with contractual assumptions of liability to the recipient, for\n    any liability that these contractual assumptions directly impose on\n    those licensors and authors.\n\n  All other non-permissive additional terms are considered \"further\nrestrictions\" within the meaning of section 10.  If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term.  If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\n\n  If you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\n\n  Additional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n\n  8. Termination.\n\n  You may not propagate or modify a covered work except as expressly\nprovided under this License.  Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\n\n  However, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\n\n  Moreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\n  Termination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License.  If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n\n  9. Acceptance Not Required for Having Copies.\n\n  You are not required to accept this License in order to receive or\nrun a copy of the Program.  Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance.  However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work.  These actions infringe copyright if you do\nnot accept this License.  Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n\n  10. Automatic Licensing of Downstream Recipients.\n\n  Each time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License.  You are not responsible\nfor enforcing compliance by third parties with this License.\n\n  An \"entity transaction\" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations.  If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party's predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\n\n  You may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License.  For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n\n  11. Patents.\n\n  A \"contributor\" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based.  The\nwork thus licensed is called the contributor's \"contributor version\".\n\n  A contributor's \"essential patent claims\" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version.  For\npurposes of this definition, \"control\" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\n\n  Each contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor's essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\n\n  In the following three paragraphs, a \"patent license\" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement).  To \"grant\" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\n\n  If you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients.  \"Knowingly relying\" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient's use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\n\n  If, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\n\n  A patent license is \"discriminatory\" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License.  You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\n  Nothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n\n  12. No Surrender of Others' Freedom.\n\n  If conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all.  For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n\n  13. Use with the GNU Affero General Public License.\n\n  Notwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU Affero General Public License into a single\ncombined work, and to convey the resulting work.  The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the special requirements of the GNU Affero General Public License,\nsection 13, concerning interaction through a network will apply to the\ncombination as such.\n\n  14. Revised Versions of this License.\n\n  The Free Software Foundation may publish revised and/or new versions of\nthe GNU General Public License from time to time.  Such new versions will\nbe similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\n  Each version is given a distinguishing version number.  If the\nProgram specifies that a certain numbered version of the GNU General\nPublic License \"or any later version\" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation.  If the Program does not specify a version number of the\nGNU General Public License, you may choose any version ever published\nby the Free Software Foundation.\n\n  If the Program specifies that a proxy can decide which future\nversions of the GNU General Public License can be used, that proxy's\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\n\n  Later license versions may give you additional or different\npermissions.  However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n\n  15. Disclaimer of Warranty.\n\n  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n  16. Limitation of Liability.\n\n  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n  17. Interpretation of Sections 15 and 16.\n\n  If the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n\n                     END OF TERMS AND CONDITIONS\n\n            How to Apply These Terms to Your New Programs\n\n  If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n  To do so, attach the following notices to the program.  It is safest\nto attach them to the start of each source file to most effectively\nstate the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n\n    App Mount, mount/umount apps that you don't like on Android, without root.\n    Copyright (C) 2017 Matthew Lee\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <http://www.gnu.org/licenses/>.\n\nAlso add information on how to contact you by electronic and paper mail.\n\n  If the program does terminal interaction, make it output a short\nnotice like this when it starts in an interactive mode:\n\n    App Mount Copyright (C) 2017 Matthew Lee\n    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\n    This is free software, and you are welcome to redistribute it\n    under certain conditions; type `show c' for details.\n\nThe hypothetical commands `show w' and `show c' should show the appropriate\nparts of the General Public License.  Of course, your program's commands\nmight be different; for a GUI interface, you would use an \"about box\".\n\n  You should also get your employer (if you work as a programmer) or school,\nif any, to sign a \"copyright disclaimer\" for the program, if necessary.\nFor more information on this, and how to apply and follow the GNU GPL, see\n<http://www.gnu.org/licenses/>.\n\n  The GNU General Public License does not permit incorporating your program\ninto proprietary programs.  If your program is a subroutine library, you\nmay consider it more useful to permit linking proprietary applications with\nthe library.  If this is what you want to do, use the GNU Lesser General\nPublic License instead of this License.  But first, please read\n<http://www.gnu.org/philosophy/why-not-lgpl.html>.\n"
  },
  {
    "path": "README.md",
    "content": "App Mount\n===\n\n![App Mount](https://github.com/mthli/Mount/blob/master/app/src/main/res/mipmap-xhdpi/ic_launcher.png \"App Mount\")\n\nmount/umount apps that you don't like on Android, **without** root.\n\nmount: available for use as normal.\n\numount: unavailable for use, but the data and actual package file remain.\n\nYou can run app temporary, when screen off app will be automatically umounted.\n\n**Support Android Lollipop+**.\n\n## Tutorial | 教程\n\n 0. [Download](https://github.com/mthli/Mount/releases \"mthli/Mount/releases\") and install App Mount;\n \n    [下载](https://github.com/mthli/Mount/releases \"mthli/Mount/releases\")并安装应用挂载器；\n\n 1. System Settings > Accounts, remove all accounts here;\n\n    系统设置 > 帐号，移除当前所有帐号；\n\n 2. Run adb command below in your computer, once and for all:\n \n    在电脑上运行如下 adb 命令，除非卸载重装，否则只需要授权一次即可：\n\n    `adb shell dpm set-device-owner io.github.mthli.mount/.app.MountReceiver`\n\n 3. Goto App Mount's settings, allow UsageAccess/NotificationAccess for ignore;\n \n    前往应用挂载器的设置界面，为忽略选项进行授权；\n\n 4. In App Mount, click list item, dialog right-top switch mount/umount.\n \n    在应用挂载器中点击列表项，在出现的对话框右上角进行挂载/弹出操作。\n\nCheers🍻 \n\n## Thanks\n\n - [ReactiveX/RxJava](https://github.com/ReactiveX/RxJava \"ReactiveX/RxJava\"), *Apache License, Version 2.0*.\n\n - [ReactiveX/RxAndroid](https://github.com/ReactiveX/RxAndroid \"ReactiveX/RxAndroid\"), *Apache License, Version 2.0*.\n\n - [satyan/sugar](https://github.com/satyan/sugar \"satyan/sugar\"), *The MIT License*.\n\n## License\n\n    App Mount, mount/umount apps that you don't like on Android, without root.\n    Copyright (C) 2017 Matthew Lee\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <http://www.gnu.org/licenses/>."
  },
  {
    "path": "app/.gitignore",
    "content": "/build\n"
  },
  {
    "path": "app/build.gradle",
    "content": "/*\n * App Mount, mount/umount apps that you don't like on Android, without root.\n * Copyright (C) 2017 Matthew Lee\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\napply plugin: 'com.android.application'\n\nandroid {\n    compileSdkVersion 25\n    buildToolsVersion \"25.0.2\"\n\n    defaultConfig {\n        applicationId \"io.github.mthli.mount\"\n        minSdkVersion 21\n        targetSdkVersion 25\n        versionCode 8\n        versionName \"1.1.1\"\n    }\n\n    buildTypes {\n        release {\n            minifyEnabled true\n            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'\n        }\n    }\n\n    lintOptions {\n        disable 'MissingTranslation'\n    }\n}\n\ndependencies {\n    compile fileTree(include: ['*.jar'], dir: 'libs')\n    compile 'com.android.support:support-annotations:25.2.0'\n    compile 'io.reactivex.rxjava2:rxjava:2.0.6'\n    compile 'io.reactivex.rxjava2:rxandroid:2.0.1'\n    compile 'com.github.satyan:sugar:1.5'\n}\n"
  },
  {
    "path": "app/proguard-rules.pro",
    "content": "# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in /Users/matthew/Library/Android/sdk/tools/proguard/proguard-android.txt\n# You can edit the include path and order by changing the proguardFiles\n# directive in build.gradle.\n#\n# For more details, see\n#   http://developer.android.com/guide/developing/tools/proguard.html\n\n# Add any project specific keep options here:\n\n# If your project uses WebView with JS, uncomment the following\n# and specify the fully qualified class name to the JavaScript interface\n# class:\n#-keepclassmembers class fqcn.of.javascript.interface.for.webview {\n#   public *;\n#}\n\n# SugarORM\n-keep class io.github.mthli.mount.model.** { *; }"
  },
  {
    "path": "app/src/main/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<!--\n  ~ App Mount, mount/umount apps that you don't like on Android, without root.\n  ~ Copyright (C) 2017 Matthew Lee\n  ~\n  ~ This program is free software: you can redistribute it and/or modify\n  ~ it under the terms of the GNU General Public License as published by\n  ~ the Free Software Foundation, either version 3 of the License, or\n  ~ (at your option) any later version.\n  ~\n  ~ This program is distributed in the hope that it will be useful,\n  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of\n  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n  ~ GNU General Public License for more details.\n  ~\n  ~ You should have received a copy of the GNU General Public License\n  ~ along with this program.  If not, see <http://www.gnu.org/licenses/>.\n  -->\n\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n          package=\"io.github.mthli.mount\">\n\n    <uses-permission android:name=\"android.permission.RECEIVE_BOOT_COMPLETED\" />\n    <uses-permission android:name=\"android.permission.PACKAGE_USAGE_STATS\" />\n    <uses-permission android:name=\"com.android.launcher.permission.INSTALL_SHORTCUT\" />\n\n    <application android:name=\".app.MountApplication\"\n                 android:icon=\"@mipmap/ic_launcher\"\n                 android:label=\"@string/app_name\"\n                 android:allowBackup=\"true\"\n                 android:supportsRtl=\"true\">\n\n        <!-- SugarORM -->\n        <meta-data android:name=\"DATABASE\" android:value=\"mount.db\" />\n        <meta-data android:name=\"VERSION\" android:value=\"1\" />\n        <meta-data android:name=\"QUERY_LOG\" android:value=\"true\" />\n        <meta-data android:name=\"DOMAIN_PACKAGE_NAME\" android:value=\"io.github.mthli\" />\n\n        <activity android:name=\".app.MainActivity\"\n                  android:launchMode=\"singleInstance\"\n                  android:excludeFromRecents=\"true\"\n                  android:theme=\"@style/MainActivityTheme\">\n            <intent-filter>\n                <action android:name=\"android.intent.action.MAIN\" />\n                <category android:name=\"android.intent.category.LAUNCHER\" />\n            </intent-filter>\n        </activity>\n\n        <activity android:name=\".app.MountActivity\"\n                  android:theme=\"@style/CocaActivityTheme\">\n        </activity>\n\n        <activity android:name=\".app.SettingsActivity\"\n                  android:label=\"@string/settings_label\"\n                  android:theme=\"@style/SettingsActivityTheme\">\n        </activity>\n\n        <service android:name=\".app.MountService\"\n                 android:label=\"@string/mount_service_label\"\n                 android:description=\"@string/mount_service_description\">\n        </service>\n\n        <service android:name=\".app.NotificationService\"\n                 android:label=\"@string/notification_service_label\"\n                 android:description=\"@string/notification_service_description\"\n                 android:permission=\"android.permission.BIND_NOTIFICATION_LISTENER_SERVICE\">\n            <intent-filter>\n                <action android:name=\"android.service.notification.NotificationListenerService\" />\n            </intent-filter>\n        </service>\n\n        <receiver android:name=\".app.MountReceiver\"\n                  android:label=\"@string/device_policy_label\"\n                  android:description=\"@string/device_policy_description\"\n                  android:permission=\"android.permission.BIND_DEVICE_ADMIN\">\n            <meta-data android:name=\"android.app.device_admin\"\n                       android:resource=\"@xml/device_policy\">\n            </meta-data>\n            <intent-filter>\n                <action android:name=\"android.app.action.DEVICE_ADMIN_ENABLED\" />\n                <action android:name=\"android.app.action.DEVICE_ADMIN_DISABLE_REQUESTED\" />\n                <action android:name=\"android.app.action.DEVICE_ADMIN_DISABLED\" />\n            </intent-filter>\n            <intent-filter>\n                <action android:name=\"android.intent.action.BOOT_COMPLETED\" />\n                <action android:name=\"android.intent.action.ACTION_SHUTDOWN\" />\n            </intent-filter>\n            <intent-filter>\n                <action android:name=\"android.intent.action.PACKAGE_REMOVED\" />\n                <action android:name=\"android.intent.action.PACKAGE_FULLY_REMOVED\" />\n                <data android:scheme=\"package\" />\n            </intent-filter>\n        </receiver>\n\n    </application>\n\n</manifest>"
  },
  {
    "path": "app/src/main/java/io/github/mthli/mount/app/MainActivity.java",
    "content": "/*\n * App Mount, mount/umount apps that you don't like on Android, without root.\n * Copyright (C) 2017 Matthew Lee\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\npackage io.github.mthli.mount.app;\n\nimport android.app.Activity;\nimport android.content.Intent;\nimport android.os.Bundle;\nimport android.text.TextUtils;\n\nimport io.github.mthli.mount.R;\nimport io.github.mthli.mount.util.IntentUtils;\nimport io.github.mthli.mount.util.PolicyUtils;\nimport io.github.mthli.mount.util.ToastUtils;\n\npublic class MainActivity extends Activity {\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        IntentUtils.startCocaService(this);\n\n        if (getIntent() == null || getIntent().getData() == null\n                || TextUtils.isEmpty(getIntent().getData().toString())\n                || !PolicyUtils.isDeviceOwnerApp(this)) {\n            IntentUtils.startCocaActivity(this);\n            finish();\n            return;\n        }\n\n        if (TextUtils.equals(getIntent().getAction(), Intent.ACTION_MAIN)\n                && (getIntent().hasCategory(Intent.CATEGORY_LAUNCHER)\n                || getIntent().hasCategory(Intent.CATEGORY_LEANBACK_LAUNCHER))) {\n            IntentUtils.startCocaActivity(this);\n            finish();\n            return;\n        }\n\n        // deal with schema\n        String data = getIntent().getData().toString();\n        if (TextUtils.equals(data, IntentUtils.SCHEMA_MOUNT_NOTIFICATION)) {\n            PolicyUtils.umountAll(this, null);\n            ToastUtils.showWithShortTime(this, R.string.toast_umount_all_ok);\n        } else if (data.startsWith(IntentUtils.SCHEMA_MOUNT_SHORTCUT)) {\n            String packageName = data.substring(IntentUtils.SCHEMA_MOUNT_SHORTCUT.length(), data.length());\n            IntentUtils.runApplication(this, packageName);\n        } else {\n            IntentUtils.startCocaActivity(this);\n        }\n\n        finish();\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/io/github/mthli/mount/app/MountActivity.java",
    "content": "/*\n * App Mount, mount/umount apps that you don't like on Android, without root.\n * Copyright (C) 2017 Matthew Lee\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\npackage io.github.mthli.mount.app;\n\nimport android.app.Activity;\nimport android.app.AlertDialog;\nimport android.content.ClipData;\nimport android.content.ClipboardManager;\nimport android.content.DialogInterface;\nimport android.content.Intent;\nimport android.content.pm.ApplicationInfo;\nimport android.content.pm.ResolveInfo;\nimport android.graphics.Bitmap;\nimport android.os.Bundle;\nimport android.text.TextUtils;\nimport android.view.Menu;\nimport android.view.MenuItem;\nimport android.view.View;\nimport android.view.WindowManager;\nimport android.widget.AbsListView;\nimport android.widget.AdapterView;\nimport android.widget.ListView;\n\nimport java.text.Collator;\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.Comparator;\nimport java.util.HashSet;\nimport java.util.List;\nimport java.util.Set;\nimport java.util.concurrent.TimeUnit;\n\nimport io.github.mthli.mount.R;\nimport io.github.mthli.mount.model.PackageRecord;\nimport io.github.mthli.mount.util.DisplayUtils;\nimport io.github.mthli.mount.util.ImageUtils;\nimport io.github.mthli.mount.util.IntentUtils;\nimport io.github.mthli.mount.util.PolicyUtils;\nimport io.github.mthli.mount.util.RxUtils;\nimport io.github.mthli.mount.util.ToastUtils;\nimport io.github.mthli.mount.widget.PackageSettingLayout;\nimport io.github.mthli.mount.widget.PolicyHintLayout;\nimport io.github.mthli.mount.widget.PackageItemAdapter;\nimport io.reactivex.Observable;\nimport io.reactivex.ObservableEmitter;\nimport io.reactivex.ObservableOnSubscribe;\nimport io.reactivex.android.schedulers.AndroidSchedulers;\nimport io.reactivex.disposables.Disposable;\nimport io.reactivex.functions.Consumer;\nimport io.reactivex.schedulers.Schedulers;\n\npublic class MountActivity extends Activity implements AbsListView.OnScrollListener,\n        AdapterView.OnItemClickListener, PackageSettingLayout.PackageSettingLayoutListener {\n    private ListView mListView;\n    private PolicyHintLayout mHeaderView;\n    private PackageItemAdapter mPackageAdapter;\n    private List<PackageRecord> mPackageList;\n\n    private AlertDialog mSettingDialog;\n    private MenuItem mLoadingItem;\n    private MenuItem mSettingsItem;\n    private MenuItem mDonateItem;\n\n    private PackageRecord mCurrentRecord;\n    private Disposable mFastScrollDisposable;\n    private Disposable mFetchPackageRecordDisposable;\n    private Disposable mHeaderViewDisposable;\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_main);\n\n        setupListView();\n        setupHeaderView();\n    }\n\n    private void setupListView() {\n        mListView = (ListView) findViewById(R.id.list);\n\n        mPackageList = new ArrayList<>();\n        mPackageAdapter = new PackageItemAdapter(this, mPackageList);\n        mListView.setAdapter(mPackageAdapter);\n        mListView.setHeaderDividersEnabled(false);\n\n        mListView.setOnScrollListener(this); // not show fast scroll always\n        mListView.setOnItemClickListener(this);\n    }\n\n    @Override\n    public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {\n        // DO NOTHING\n    }\n\n    @Override\n    public void onScrollStateChanged(final AbsListView view, int scrollState) {\n        RxUtils.disposeSafety(mFastScrollDisposable);\n        if (scrollState != SCROLL_STATE_IDLE) {\n            view.setFastScrollAlwaysVisible(true);\n            return;\n        }\n\n        mFastScrollDisposable = Observable.timer(1000L, TimeUnit.MILLISECONDS)\n                .observeOn(AndroidSchedulers.mainThread())\n                .subscribe(new Consumer<Long>() {\n                    @Override\n                    public void accept(Long aLong) throws Exception {\n                        view.setFastScrollAlwaysVisible(false);\n                    }\n                });\n    }\n\n    @Override\n    public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n        dismissSettingDialogSafety();\n        if (!PolicyUtils.isDeviceOwnerApp(this)) {\n            IntentUtils.showTutorial(this);\n            return;\n        }\n\n        mCurrentRecord = mPackageList.get(position);\n        PackageSettingLayout layout = (PackageSettingLayout) getLayoutInflater()\n                .inflate(R.layout.layout_package_setting, null, false);\n        layout.setPackageRecord(mCurrentRecord);\n        layout.setPackageSettingLayoutListener(this);\n\n        mSettingDialog = new AlertDialog.Builder(this)\n                .setCancelable(true)\n                .setView(layout)\n                .create();\n        mSettingDialog.setOnShowListener(new DialogInterface.OnShowListener() {\n            @Override\n            public void onShow(DialogInterface dialog) {\n                mSettingDialog.getWindow().setLayout(DisplayUtils.dp2px(MountActivity.this, 322.0F),\n                        WindowManager.LayoutParams.WRAP_CONTENT);\n            }\n        });\n        mSettingDialog.show();\n    }\n\n    private void dismissSettingDialogSafety() {\n        if (mSettingDialog != null && mSettingDialog.isShowing()) {\n            mSettingDialog.dismiss();\n        }\n    }\n\n    @Override\n    public void onMountSwitchChanged(boolean umount) {\n        if (umount) {\n            mCurrentRecord.umount = true;\n            mCurrentRecord.update();\n        } else {\n            mCurrentRecord.umount = false;\n            mCurrentRecord.delete();\n        }\n\n        mPackageAdapter.notifyDataSetChanged();\n        PolicyUtils.setApplicationMount(this, mCurrentRecord.name, !umount);\n        ToastUtils.showWithShortTime(this, getString(umount ? R.string.toast_umount\n                : R.string.toast_mount, mCurrentRecord.label));\n    }\n\n    @Override\n    public void onClickRunView() {\n        dismissSettingDialogSafety();\n        IntentUtils.runApplication(this, mCurrentRecord.name);\n    }\n\n    @Override\n    public void onClickInfoView() {\n        dismissSettingDialogSafety();\n        IntentUtils.showApplicationInfo(this, mCurrentRecord.name);\n    }\n\n    @Override\n    public void onClickAddToLauncher() {\n        dismissSettingDialogSafety();\n\n        Bitmap icon = ImageUtils.bytes2Bitmap(mCurrentRecord.icon);\n        float width = icon.getWidth();\n        float height = icon.getHeight();\n        float max = width > height ? width : height;\n        if (max > ImageUtils.LAUNCHER_ICON_MAX_SIZE) {\n            float ratio = ImageUtils.LAUNCHER_ICON_MAX_SIZE / max;\n            icon = ImageUtils.resize(icon, (int) (width * ratio), (int) (height * ratio));\n        }\n\n        IntentUtils.createShortcut(this, mCurrentRecord.name, icon, mCurrentRecord.label);\n        ToastUtils.showWithShortTime(this, getString(R.string.toast_add_to_launcher, mCurrentRecord.label));\n    }\n\n    private void setupHeaderView() {\n        mHeaderView = (PolicyHintLayout) getLayoutInflater().inflate(R.layout.layout_device_hint,\n                mListView, false);\n        if (!PolicyUtils.isDeviceOwnerApp(this)) {\n            mListView.addHeaderView(mHeaderView);\n            hideOptions();\n        }\n\n        RxUtils.disposeSafety(mHeaderViewDisposable);\n        mHeaderViewDisposable = Observable.interval(200L, TimeUnit.MILLISECONDS)\n                .observeOn(AndroidSchedulers.mainThread())\n                .subscribe(new Consumer<Long>() {\n                    @Override\n                    public void accept(Long aLong) throws Exception {\n                        if (!PolicyUtils.isDeviceOwnerApp(MountActivity.this)) {\n                            hideOptions();\n                            if (mListView.getHeaderViewsCount() <= 0){\n                                mListView.addHeaderView(mHeaderView);\n                            }\n                        } else {\n                            showOptions();\n                            if (mListView.getHeaderViewsCount() > 0) {\n                                mListView.removeHeaderView(mHeaderView);\n                            }\n                        }\n                    }\n                });\n    }\n\n    @Override\n    public boolean onCreateOptionsMenu(Menu menu) {\n        getMenuInflater().inflate(R.menu.menu_main, menu);\n\n        mLoadingItem = menu.findItem(R.id.loading);\n        mSettingsItem = menu.findItem(R.id.settings);\n        mDonateItem = menu.findItem(R.id.donate);\n\n        showLoading();\n        hideOptions();\n\n        return true;\n    }\n\n    private void showLoading() {\n        if (mLoadingItem != null) {\n            mLoadingItem.setVisible(true);\n        }\n    }\n\n    public void hideLoading() {\n        if (mLoadingItem != null) {\n            mLoadingItem.setVisible(false);\n        }\n    }\n\n    private void showOptions() {\n        if (mSettingsItem != null) {\n            mSettingsItem.setVisible(true);\n        }\n\n        if (mDonateItem != null) {\n            mDonateItem.setVisible(true);\n        }\n    }\n\n    private void hideOptions() {\n        if (mSettingsItem != null) {\n            mSettingsItem.setVisible(false);\n        }\n\n        if (mDonateItem != null) {\n            mDonateItem.setVisible(false);\n        }\n    }\n\n    @Override\n    public boolean onOptionsItemSelected(MenuItem item) {\n        switch (item.getItemId()) {\n            case R.id.settings:\n                IntentUtils.startSettingsActivity(this);\n                break;\n            case R.id.donate:\n                showDonateDialog();\n                break;\n            default:\n                break;\n        }\n\n        return true;\n    }\n\n    private void showDonateDialog() {\n        final AlertDialog dialog = new AlertDialog.Builder(this)\n                .setCancelable(true)\n                .setTitle(R.string.donate_dialog_title)\n                .setMessage(R.string.alipay_account)\n                .setPositiveButton(R.string.donate_dialog_positive, new DialogInterface.OnClickListener() {\n                    @Override\n                    public void onClick(DialogInterface dialog, int which) {\n                        ClipboardManager manager = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE);\n                        ClipData data = ClipData.newPlainText(\"\", getString(R.string.alipay_account));\n                        manager.setPrimaryClip(data);\n                        ToastUtils.showWithShortTime(MountActivity.this, R.string.toast_copied);\n                    }\n                })\n                .create();\n        dialog.setOnShowListener(new DialogInterface.OnShowListener() {\n            @Override\n            public void onShow(DialogInterface dialogInterface) {\n                dialog.getWindow().setLayout(DisplayUtils.dp2px(MountActivity.this, 322.0F),\n                        WindowManager.LayoutParams.WRAP_CONTENT);\n            }\n        });\n        dialog.show();\n    }\n\n    @Override\n    public void onResume() {\n        super.onResume();\n        fetchPackageRecord();\n    }\n\n    private void fetchPackageRecord() {\n        RxUtils.disposeSafety(mFetchPackageRecordDisposable);\n        showLoading();\n\n        mFetchPackageRecordDisposable = Observable.create(\n                new ObservableOnSubscribe<List<PackageRecord>>() {\n                    @Override\n                    public void subscribe(ObservableEmitter<List<PackageRecord>> e) throws Exception {\n                        // list all umount apps first\n                        List<PackageRecord> recordList = PackageRecord.listAll(PackageRecord.class);\n                        Set<String> nameSet = new HashSet<>();\n                        for (PackageRecord record : recordList) {\n                            nameSet.add(record.name);\n                        }\n\n                        // query all apps can launched from launcher\n                        Intent intent = new Intent(Intent.ACTION_MAIN);\n                        intent.addCategory(Intent.CATEGORY_LAUNCHER);\n                        List<ResolveInfo> resolveInfoList = getPackageManager().queryIntentActivities(intent, 0);\n\n                        // get all apps' application info\n                        List<ApplicationInfo> applicationInfoList = new ArrayList<>();\n                        for (ResolveInfo info : resolveInfoList) {\n                            applicationInfoList.add(info.activityInfo.applicationInfo);\n                        }\n\n                        // filter we don't want\n                        for (ApplicationInfo info : applicationInfoList) {\n                            if (TextUtils.equals(info.packageName, getPackageName())\n                                    || nameSet.contains(info.packageName)) {\n                                continue;\n                            }\n\n                            nameSet.add(info.packageName);\n                            recordList.add(new PackageRecord(info.packageName,\n                                    ImageUtils.drawable2Bytes(info.loadIcon(getPackageManager())),\n                                    info.loadLabel(getPackageManager()).toString(),\n                                    getPackageManager().getPackageInfo(info.packageName, 0).versionName,\n                                    false));\n                        }\n\n                        // sort by language\n                        Collections.sort(recordList, new Comparator<PackageRecord>() {\n                            @Override\n                            public int compare(PackageRecord record1, PackageRecord record2) {\n                                return Collator.getInstance().compare(record1.label, record2.label);\n                            }\n                        });\n\n                        e.onNext(recordList);\n                        e.onComplete();\n                    }\n                })\n                .subscribeOn(Schedulers.newThread())\n                .observeOn(AndroidSchedulers.mainThread())\n                .subscribe(new Consumer<List<PackageRecord>>() {\n                    @Override\n                    public void accept(List<PackageRecord> list) throws Exception {\n                        mPackageList.clear();\n                        mPackageList.addAll(list);\n                        mPackageAdapter.notifyDataSetChanged();\n                        hideLoading();\n                    }\n                });\n    }\n\n    @Override\n    public void onDestroy() {\n        super.onDestroy();\n\n        RxUtils.disposeSafety(mFastScrollDisposable);\n        RxUtils.disposeSafety(mFetchPackageRecordDisposable);\n        RxUtils.disposeSafety(mHeaderViewDisposable);\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/io/github/mthli/mount/app/MountApplication.java",
    "content": "/*\n * App Mount, mount/umount apps that you don't like on Android, without root.\n * Copyright (C) 2017 Matthew Lee\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\npackage io.github.mthli.mount.app;\n\nimport android.app.Application;\nimport android.app.Notification;\nimport android.service.notification.StatusBarNotification;\n\nimport com.orm.SugarContext;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\npublic class MountApplication extends Application {\n    private NotificationService mNotificationService;\n\n    @Override\n    public void onCreate() {\n        super.onCreate();\n        SugarContext.init(this);\n    }\n\n    @Override\n    public void onTerminate() {\n        super.onTerminate();\n        SugarContext.terminate();\n    }\n\n    public void registerNotificationService(NotificationService service) {\n        mNotificationService = service;\n    }\n\n    public void unregisterNotificationService() {\n        mNotificationService = null;\n    }\n\n    public List<String> getForegroundServiceList() {\n        List<String> list = new ArrayList<>();\n\n        if (mNotificationService != null) {\n            StatusBarNotification[] notifications = mNotificationService.getActiveNotifications();\n            for (StatusBarNotification notification : notifications) {\n                int mask = Notification.FLAG_FOREGROUND_SERVICE;\n                if ((notification.getNotification().flags & mask) != 0) {\n                    list.add(notification.getPackageName());\n                }\n            }\n        }\n\n        return list;\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/io/github/mthli/mount/app/MountReceiver.java",
    "content": "/*\n * App Mount, mount/umount apps that you don't like on Android, without root.\n * Copyright (C) 2017 Matthew Lee\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\npackage io.github.mthli.mount.app;\n\nimport android.app.admin.DeviceAdminReceiver;\nimport android.content.Context;\nimport android.content.Intent;\nimport android.text.TextUtils;\n\nimport java.util.List;\n\nimport io.github.mthli.mount.model.PackageRecord;\nimport io.github.mthli.mount.util.IntentUtils;\nimport io.github.mthli.mount.util.PolicyUtils;\nimport io.reactivex.Observable;\nimport io.reactivex.ObservableEmitter;\nimport io.reactivex.ObservableOnSubscribe;\nimport io.reactivex.functions.Consumer;\nimport io.reactivex.schedulers.Schedulers;\n\npublic class MountReceiver extends DeviceAdminReceiver {\n    @Override\n    public void onReceive(Context context, Intent intent) {\n        super.onReceive(context, intent);\n\n        if (TextUtils.equals(intent.getAction(), Intent.ACTION_BOOT_COMPLETED)) {\n            onBootCompleted(context);\n        } else if (TextUtils.equals(intent.getAction(), Intent.ACTION_PACKAGE_FULLY_REMOVED)) {\n            onActionPackageFullyRemoved(intent);\n        } else if (TextUtils.equals(intent.getAction(), Intent.ACTION_SHUTDOWN)) {\n            onActionShutdown(context);\n        }\n    }\n\n    private void onBootCompleted(final Context context) {\n        PolicyUtils.umountAll(context, new Consumer<Boolean>() {\n            @Override\n            public void accept(Boolean aBoolean) throws Exception {\n                IntentUtils.startCocaService(context);\n            }\n        });\n    }\n\n    private void onActionPackageFullyRemoved(final Intent intent) {\n        Observable.create(\n                new ObservableOnSubscribe<Boolean>() {\n                    @Override\n                    public void subscribe(ObservableEmitter<Boolean> e) throws Exception {\n                        // prefix \"package:\"\n                        String packageName = intent.getData().toString().substring(8);\n                        List<PackageRecord> list = PackageRecord.listAll(PackageRecord.class);\n                        for (PackageRecord record : list) {\n                            if (TextUtils.equals(record.name, packageName)) {\n                                record.delete();\n                            }\n                        }\n\n                        e.onNext(true);\n                        e.onComplete();\n                    }\n                })\n                .subscribeOn(Schedulers.newThread())\n                .subscribe();\n    }\n\n    private void onActionShutdown(Context context) {\n        PolicyUtils.umountAll(context, null);\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/io/github/mthli/mount/app/MountService.java",
    "content": "/*\n * App Mount, mount/umount apps that you don't like on Android, without root.\n * Copyright (C) 2017 Matthew Lee\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\npackage io.github.mthli.mount.app;\n\nimport android.app.Notification;\nimport android.app.Service;\nimport android.content.BroadcastReceiver;\nimport android.content.Context;\nimport android.content.Intent;\nimport android.content.IntentFilter;\nimport android.content.SharedPreferences;\nimport android.os.IBinder;\nimport android.text.TextUtils;\n\nimport io.github.mthli.mount.R;\nimport io.github.mthli.mount.util.IntentUtils;\nimport io.github.mthli.mount.util.PolicyUtils;\nimport io.github.mthli.mount.util.PreferenceUtils;\n\npublic class MountService extends Service implements SharedPreferences.OnSharedPreferenceChangeListener {\n    private static final int NOTIFICATION_ID = 0x01;\n\n    private BroadcastReceiver mScreenOffReceiver;\n\n    @Override\n    public IBinder onBind(Intent intent) {\n        return null;\n    }\n\n    @Override\n    public void onCreate() {\n        mScreenOffReceiver = new BroadcastReceiver() {\n            @Override\n            public void onReceive(Context context, Intent intent) {\n                if (TextUtils.equals(intent.getAction(), Intent.ACTION_SCREEN_OFF)) {\n                    PolicyUtils.umountAll(MountService.this, null);\n                }\n            }\n        };\n\n        registerReceiver(mScreenOffReceiver, new IntentFilter(Intent.ACTION_SCREEN_OFF));\n        PreferenceUtils.register(this, this);\n    }\n\n    @Override\n    public int onStartCommand(Intent intent, int flags, int startId) {\n        updateForeground();\n        return START_STICKY;\n    }\n\n    @Override\n    public void onDestroy() {\n        unregisterReceiver(mScreenOffReceiver);\n        PreferenceUtils.unregister(this, this);\n    }\n\n    @Override\n    public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {\n        if (TextUtils.equals(key, getString(R.string.preference_key_notification_quick_action))) {\n            updateForeground();\n        }\n    }\n\n    private void updateForeground() {\n        if (!PolicyUtils.isDeviceOwnerApp(this) || !PreferenceUtils.isNotificationQuickAction(this)) {\n            stopForeground(true);\n            return;\n        }\n\n        Notification notification = new Notification.Builder(this)\n                .setAutoCancel(false)\n                .setPriority(Notification.PRIORITY_MIN)\n                .setSmallIcon(R.drawable.ic_notification_android)\n                .setContentTitle(getString(R.string.mount_service_notification_title))\n                .setContentText(getString(R.string.mount_service_notification_text))\n                .setContentIntent(IntentUtils.createNotificationIntent(this))\n                .build();\n        startForeground(NOTIFICATION_ID, notification);\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/io/github/mthli/mount/app/NotificationService.java",
    "content": "/*\n * App Mount, mount/umount apps that you don't like on Android, without root.\n * Copyright (C) 2017 Matthew Lee\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\npackage io.github.mthli.mount.app;\n\nimport android.content.Intent;\nimport android.os.IBinder;\nimport android.service.notification.NotificationListenerService;\n\npublic class NotificationService extends NotificationListenerService {\n    @Override\n    public IBinder onBind(Intent intent) {\n        ((MountApplication) getApplication()).registerNotificationService(this);\n        return super.onBind(intent);\n    }\n\n    @Override\n    public boolean onUnbind(Intent intent) {\n        ((MountApplication) getApplication()).unregisterNotificationService();\n        return super.onUnbind(intent);\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/io/github/mthli/mount/app/SettingsActivity.java",
    "content": "/*\n * App Mount, mount/umount apps that you don't like on Android, without root.\n * Copyright (C) 2017 Matthew Lee\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\npackage io.github.mthli.mount.app;\n\nimport android.app.Activity;\nimport android.app.FragmentTransaction;\nimport android.app.ProgressDialog;\nimport android.os.Bundle;\nimport android.preference.Preference;\nimport android.preference.PreferenceFragment;\nimport android.preference.PreferenceScreen;\n\nimport io.github.mthli.mount.BuildConfig;\nimport io.github.mthli.mount.R;\nimport io.github.mthli.mount.util.IntentUtils;\nimport io.github.mthli.mount.util.PolicyUtils;\nimport io.github.mthli.mount.util.ToastUtils;\nimport io.reactivex.functions.Consumer;\n\npublic class SettingsActivity extends Activity {\n    public static class SettingsFragment extends PreferenceFragment {\n        private ProgressDialog mProgressDialog;\n        private boolean mIsProgressDialogShowing;\n\n        public boolean isProgressDialogShowing() {\n            return mIsProgressDialogShowing;\n        }\n\n        @Override\n        public void onCreate(Bundle savedInstanceState) {\n            super.onCreate(savedInstanceState);\n            addPreferencesFromResource(R.xml.preferences);\n        }\n\n        @Override\n        public void onResume() {\n            super.onResume();\n\n            // update version\n            Preference preference = findPreference(getString(R.string.preference_key_version));\n            preference.setSummary(BuildConfig.VERSION_NAME);\n        }\n\n        @Override\n        public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) {\n            switch (preference.getTitleRes()) {\n                case R.string.preference_title_ignore_foreground_app:\n                    IntentUtils.showUsageStatsAccess(getActivity());\n                    break;\n                case R.string.preference_title_ignore_foreground_service:\n                    IntentUtils.showNotificationAccess(getActivity());\n                    break;\n                case R.string.preference_title_mount_all_temporary:\n                    onClickMountAllTemporary();\n                    break;\n                case R.string.preference_title_pre_uninstall:\n                    onClickPreUninstall();\n                    break;\n                case R.string.preference_title_version:\n                    IntentUtils.showVersion(getActivity());\n                    break;\n                case R.string.preference_title_tutorial:\n                    IntentUtils.showTutorial(getActivity());\n                    break;\n                default:\n                    break;\n            }\n\n            return super.onPreferenceTreeClick(preferenceScreen, preference);\n        }\n\n        private void onClickMountAllTemporary() {\n            showProgressDialog();\n            PolicyUtils.mountAll(getActivity(), true, new Consumer<Boolean>() {\n                @Override\n                public void accept(Boolean aBoolean) throws Exception {\n                    hideProgressDialog();\n                    ToastUtils.showWithShortTime(getActivity(), R.string.toast_mount_all_temporary_ok);\n                }\n            });\n        }\n\n        private void onClickPreUninstall() {\n            showProgressDialog();\n            PolicyUtils.mountAll(getActivity(), false, new Consumer<Boolean>() {\n                @Override\n                public void accept(Boolean aBoolean) throws Exception {\n                    hideProgressDialog();\n                    PolicyUtils.clearDeviceOwnerApp(getActivity());\n                    ToastUtils.showWithShortTime(getActivity(), R.string.toast_pre_uninstall_ok);\n                }\n            });\n        }\n\n        private void showProgressDialog() {\n            mIsProgressDialogShowing = true;\n            if (mProgressDialog != null) {\n                mProgressDialog.dismiss();\n            }\n\n            mProgressDialog = new ProgressDialog(getActivity());\n            mProgressDialog.setMessage(getString(R.string.dialog_message_wait_a_minute));\n            mProgressDialog.setCancelable(false);\n            mProgressDialog.show();\n        }\n\n        private void hideProgressDialog() {\n            mIsProgressDialogShowing = false;\n            if (mProgressDialog != null) {\n                mProgressDialog.dismiss();\n            }\n        }\n    }\n\n    private SettingsFragment mSettingsFragment;\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_settings);\n\n        FragmentTransaction transaction = getFragmentManager().beginTransaction();\n        mSettingsFragment = new SettingsFragment();\n        transaction.replace(R.id.content, mSettingsFragment);\n        transaction.commit();\n    }\n\n    @Override\n    public void onBackPressed() {\n        if (!mSettingsFragment.isProgressDialogShowing()) {\n            super.onBackPressed();\n        }\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/io/github/mthli/mount/model/PackageRecord.java",
    "content": "/*\n * App Mount, mount/umount apps that you don't like on Android, without root.\n * Copyright (C) 2017 Matthew Lee\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\npackage io.github.mthli.mount.model;\n\nimport com.orm.SugarRecord;\nimport com.orm.dsl.Unique;\n\npublic class PackageRecord extends SugarRecord {\n    @Unique\n    public String name;\n    public byte[] icon;\n    public String label;\n    public String version;\n    public boolean umount;\n\n    public PackageRecord() {}\n\n    public PackageRecord(String name, byte[] icon, String label, String version, boolean umount) {\n        this.name = name;\n        this.icon = icon;\n        this.label = label;\n        this.version = version;\n        this.umount = umount;\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/io/github/mthli/mount/util/DisplayUtils.java",
    "content": "/*\n * App Mount, mount/umount apps that you don't like on Android, without root.\n * Copyright (C) 2017 Matthew Lee\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\npackage io.github.mthli.mount.util;\n\nimport android.content.Context;\n\npublic class DisplayUtils {\n    public static float getScreenDensity(Context context) {\n        return context.getResources().getDisplayMetrics().density;\n    }\n\n    public static int dp2px(Context context, float dp) {\n        return (int) (getScreenDensity(context) * dp + 0.5F);\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/io/github/mthli/mount/util/ImageUtils.java",
    "content": "/*\n * App Mount, mount/umount apps that you don't like on Android, without root.\n * Copyright (C) 2017 Matthew Lee\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\npackage io.github.mthli.mount.util;\n\nimport android.graphics.Bitmap;\nimport android.graphics.BitmapFactory;\nimport android.graphics.Canvas;\nimport android.graphics.Matrix;\nimport android.graphics.drawable.Drawable;\n\nimport java.io.ByteArrayOutputStream;\nimport java.io.IOException;\n\npublic class ImageUtils {\n    public static final int LAUNCHER_ICON_MAX_SIZE = 192; // px\n\n    public static Bitmap drawable2Bitmap(Drawable drawable) {\n        Bitmap bitmap = Bitmap.createBitmap(drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight(),\n                Bitmap.Config.ARGB_8888);\n        Canvas canvas = new Canvas(bitmap);\n        drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight());\n        drawable.draw(canvas);\n        return bitmap;\n    }\n\n    public static byte[] bitmap2Bytes(Bitmap bitmap) {\n        ByteArrayOutputStream stream = new ByteArrayOutputStream();\n        bitmap.compress(Bitmap.CompressFormat.PNG, 100, stream);\n\n        byte[] bytes = stream.toByteArray();\n        try {\n            stream.close();\n        } catch (IOException e) {\n            e.printStackTrace();\n        }\n\n        return bytes;\n    }\n\n    public static byte[] drawable2Bytes(Drawable drawable) {\n        return bitmap2Bytes(drawable2Bitmap(drawable));\n    }\n\n    public static Bitmap bytes2Bitmap(byte[] bytes) {\n        return BitmapFactory.decodeByteArray(bytes, 0, bytes.length);\n    }\n\n    public static Bitmap resize(Bitmap bitmap, int newWidth, int newHeight) {\n        bitmap = bitmap.copy(bitmap.getConfig(), true);\n\n        int bitmapWidth = bitmap.getWidth();\n        int bitmapHeight = bitmap.getHeight();\n        float scaleWidth = ((float) newWidth) / bitmapWidth;\n        float scaleHeight = ((float) newHeight) / bitmapHeight;\n        Matrix matrix = new Matrix();\n        matrix.postScale(scaleWidth, scaleHeight);\n\n        Bitmap resizedBitmap = Bitmap.createBitmap(bitmap, 0, 0,\n                bitmapWidth, bitmapHeight, matrix, false);\n        bitmap.recycle();\n        return resizedBitmap;\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/io/github/mthli/mount/util/IntentUtils.java",
    "content": "/*\n * App Mount, mount/umount apps that you don't like on Android, without root.\n * Copyright (C) 2017 Matthew Lee\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\npackage io.github.mthli.mount.util;\n\nimport android.app.PendingIntent;\nimport android.content.Context;\nimport android.content.Intent;\nimport android.graphics.Bitmap;\nimport android.net.Uri;\nimport android.provider.Settings;\n\nimport io.github.mthli.mount.app.MountActivity;\nimport io.github.mthli.mount.app.MountService;\nimport io.github.mthli.mount.app.MainActivity;\nimport io.github.mthli.mount.app.SettingsActivity;\n\npublic class IntentUtils {\n    // historical issues, should be \"mount://\"\n    public static final String SCHEMA_MOUNT = \"coca://\";\n    public static final String SCHEMA_MOUNT_NOTIFICATION = SCHEMA_MOUNT + \"notification/\";\n    public static final String SCHEMA_MOUNT_SHORTCUT = SCHEMA_MOUNT + \"shortcut/\";\n\n    public static PendingIntent createNotificationIntent(Context context) {\n        Intent intent = new Intent(context, MainActivity.class);\n        intent.setData(Uri.parse(IntentUtils.SCHEMA_MOUNT_NOTIFICATION));\n        return PendingIntent.getActivity(context, 0, intent, 0);\n    }\n\n    public static void createShortcut(Context context, String packageName, Bitmap icon, String label) {\n        Intent shortcutIntent = new Intent(context, MainActivity.class);\n        shortcutIntent.setData(Uri.parse(SCHEMA_MOUNT_SHORTCUT + packageName));\n\n        Intent addIntent = new Intent();\n        addIntent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcutIntent);\n        addIntent.putExtra(Intent.EXTRA_SHORTCUT_ICON, icon);\n        addIntent.putExtra(Intent.EXTRA_SHORTCUT_NAME, label);\n        addIntent.setAction(\"com.android.launcher.action.INSTALL_SHORTCUT\");\n        context.sendBroadcast(addIntent);\n    }\n\n    public static void runApplication(Context context, String packageName) {\n        if (!PolicyUtils.isApplicationMount(context, packageName)) {\n            PolicyUtils.setApplicationMount(context, packageName, true);\n        }\n\n        try {\n            Intent intent = context.getPackageManager().getLaunchIntentForPackage(packageName);\n            intent.addCategory(Intent.CATEGORY_LAUNCHER);\n            context.startActivity(intent);\n        } catch (Exception e) {\n            e.printStackTrace();\n        }\n    }\n\n    public static void showApplicationInfo(Context context, String packageName) {\n        Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);\n        intent.setData(Uri.parse(\"package:\" + packageName));\n        context.startActivity(intent);\n    }\n\n    public static void showUsageStatsAccess(Context context) {\n        context.startActivity(new Intent(Settings.ACTION_USAGE_ACCESS_SETTINGS));\n    }\n\n    public static void showNotificationAccess(Context context) {\n        context.startActivity(new Intent(\"android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS\"));\n    }\n\n    public static void showVersion(Context context) {\n        context.startActivity(new Intent(Intent.ACTION_VIEW,\n                Uri.parse(\"https://github.com/mthli/Mount/releases\")));\n    }\n\n    public static void showTutorial(Context context) {\n        context.startActivity(new Intent(Intent.ACTION_VIEW,\n                Uri.parse(\"https://github.com/mthli/Mount/blob/master/README.md\")));\n    }\n\n    public static void startCocaActivity(Context context) {\n        context.startActivity(new Intent(context, MountActivity.class));\n    }\n\n    public static void startCocaService(Context context) {\n        context.startService(new Intent(context, MountService.class));\n    }\n\n    public static void startSettingsActivity(Context context) {\n        context.startActivity(new Intent(context, SettingsActivity.class));\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/io/github/mthli/mount/util/PolicyUtils.java",
    "content": "/*\n * App Mount, mount/umount apps that you don't like on Android, without root.\n * Copyright (C) 2017 Matthew Lee\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\npackage io.github.mthli.mount.util;\n\nimport android.app.admin.DevicePolicyManager;\nimport android.app.usage.UsageStats;\nimport android.app.usage.UsageStatsManager;\nimport android.content.ComponentName;\nimport android.content.Context;\nimport android.content.pm.ApplicationInfo;\nimport android.text.TextUtils;\n\nimport java.util.List;\nimport java.util.SortedMap;\nimport java.util.TreeMap;\n\nimport io.github.mthli.mount.app.MountApplication;\nimport io.github.mthli.mount.app.MountReceiver;\nimport io.github.mthli.mount.model.PackageRecord;\nimport io.reactivex.Observable;\nimport io.reactivex.ObservableEmitter;\nimport io.reactivex.ObservableOnSubscribe;\nimport io.reactivex.android.schedulers.AndroidSchedulers;\nimport io.reactivex.functions.Consumer;\nimport io.reactivex.schedulers.Schedulers;\n\npublic class PolicyUtils {\n    public static boolean isDeviceOwnerApp(Context context) {\n        DevicePolicyManager manager = (DevicePolicyManager) context.getSystemService(Context.DEVICE_POLICY_SERVICE);\n        return manager.isDeviceOwnerApp(context.getPackageName());\n    }\n\n    public static void clearDeviceOwnerApp(Context context) {\n        try {\n            DevicePolicyManager manager = (DevicePolicyManager) context.getSystemService(Context.DEVICE_POLICY_SERVICE);\n            manager.clearDeviceOwnerApp(context.getPackageName());\n        } catch (SecurityException e) {\n            e.printStackTrace();\n        }\n    }\n\n    // http://stackoverflow.com/a/14665381/4696820\n    public static boolean isSystemApp(ApplicationInfo info) {\n        int mask = ApplicationInfo.FLAG_SYSTEM | ApplicationInfo.FLAG_UPDATED_SYSTEM_APP;\n        return (info.flags & mask) != 0;\n    }\n\n    public static boolean isApplicationMount(Context context, String packageName) {\n        DevicePolicyManager manager = (DevicePolicyManager) context.getSystemService(Context.DEVICE_POLICY_SERVICE);\n        return !manager.isApplicationHidden(new ComponentName(context, MountReceiver.class), packageName);\n    }\n\n    public static void setApplicationMount(Context context, String packageName, boolean mount) {\n        DevicePolicyManager manager = (DevicePolicyManager) context.getSystemService(Context.DEVICE_POLICY_SERVICE);\n        ComponentName admin = new ComponentName(context, MountReceiver.class);\n        manager.setApplicationHidden(admin, packageName, !mount);\n        manager.setUninstallBlocked(admin, packageName, !mount);\n    }\n\n    public static void mountAll(final Context context, final boolean temporary, Consumer<Boolean> consumer) {\n        if (consumer == null) {\n            consumer = new Consumer<Boolean>() {\n                @Override\n                public void accept(Boolean aBoolean) throws Exception {\n                    // DO NOTHING\n                }\n            };\n        }\n\n        Observable.create(\n                new ObservableOnSubscribe<Boolean>() {\n                    @Override\n                    public void subscribe(ObservableEmitter<Boolean> e) throws Exception {\n                        List<PackageRecord> list = PackageRecord.listAll(PackageRecord.class);\n                        for (PackageRecord record : list) {\n                            setApplicationMount(context, record.name, true);\n                            if (!temporary) {\n                                record.delete();\n                            }\n                        }\n\n                        e.onNext(true);\n                        e.onComplete();\n                    }\n                })\n                .subscribeOn(Schedulers.newThread())\n                .observeOn(AndroidSchedulers.mainThread())\n                .subscribe(consumer);\n    }\n\n    public static void umountAll(final Context context, Consumer<Boolean> consumer) {\n        if (consumer == null) {\n            consumer = new Consumer<Boolean>() {\n                @Override\n                public void accept(Boolean aBoolean) throws Exception {\n                    // DO NOTHING\n                }\n            };\n        }\n\n        final String foregroundPackageName = getForegroundAppPackageName(context);\n        final List<String> foregroundServiceList = getForegroundServiceList(context);\n        Observable.create(\n                new ObservableOnSubscribe<Boolean>() {\n                    @Override\n                    public void subscribe(ObservableEmitter<Boolean> e) throws Exception {\n                        List<PackageRecord> list = PackageRecord.listAll(PackageRecord.class);\n                        for (PackageRecord record : list) {\n                            if (!TextUtils.equals(record.name, foregroundPackageName)\n                                    && !foregroundServiceList.contains(record.name)) {\n                                setApplicationMount(context, record.name, false);\n                            }\n                        }\n\n                        e.onNext(true);\n                        e.onComplete();\n                    }\n                })\n                .subscribeOn(Schedulers.newThread())\n                .observeOn(AndroidSchedulers.mainThread())\n                .subscribe(consumer);\n    }\n\n    @SuppressWarnings(\"WrongConstant\")\n    public static String getForegroundAppPackageName(Context context) {\n        UsageStatsManager manager = (UsageStatsManager) context.getSystemService(\"usagestats\");\n        long time = System.currentTimeMillis();\n        List<UsageStats> list = manager.queryUsageStats(UsageStatsManager.INTERVAL_DAILY,\n                time - 1000 * 1000, time);\n        if (list != null && !list.isEmpty()) {\n            SortedMap<Long, UsageStats> map = new TreeMap<>();\n            for (UsageStats stats : list) {\n                map.put(stats.getLastTimeUsed(), stats);\n            }\n\n            if (!map.isEmpty()) {\n                return map.get(map.lastKey()).getPackageName();\n            }\n        }\n\n        return null;\n    }\n\n    public static List<String> getForegroundServiceList(Context context) {\n        return ((MountApplication) context.getApplicationContext()).getForegroundServiceList();\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/io/github/mthli/mount/util/PreferenceUtils.java",
    "content": "/*\n * App Mount, mount/umount apps that you don't like on Android, without root.\n * Copyright (C) 2017 Matthew Lee\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\npackage io.github.mthli.mount.util;\n\nimport android.content.Context;\nimport android.content.SharedPreferences;\nimport android.preference.PreferenceManager;\n\nimport io.github.mthli.mount.R;\n\npublic class PreferenceUtils {\n    public static void register(Context context, SharedPreferences.OnSharedPreferenceChangeListener listener) {\n        PreferenceManager.getDefaultSharedPreferences(context).registerOnSharedPreferenceChangeListener(listener);\n    }\n\n    public static void unregister(Context context, SharedPreferences.OnSharedPreferenceChangeListener listener) {\n        PreferenceManager.getDefaultSharedPreferences(context).unregisterOnSharedPreferenceChangeListener(listener);\n    }\n\n    public static boolean isNotificationQuickAction(Context context) {\n        String key = context.getString(R.string.preference_key_notification_quick_action);\n        return PreferenceManager.getDefaultSharedPreferences(context).getBoolean(key, false);\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/io/github/mthli/mount/util/RxUtils.java",
    "content": "/*\n * App Mount, mount/umount apps that you don't like on Android, without root.\n * Copyright (C) 2017 Matthew Lee\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\npackage io.github.mthli.mount.util;\n\nimport io.reactivex.disposables.Disposable;\n\npublic class RxUtils {\n    public static void disposeSafety(Disposable disposable) {\n        if (disposable != null && !disposable.isDisposed()) {\n            disposable.dispose();\n        }\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/io/github/mthli/mount/util/ToastUtils.java",
    "content": "/*\n * App Mount, mount/umount apps that you don't like on Android, without root.\n * Copyright (C) 2017 Matthew Lee\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\npackage io.github.mthli.mount.util;\n\nimport android.content.Context;\nimport android.widget.Toast;\n\nimport java.util.concurrent.TimeUnit;\n\nimport io.reactivex.Observable;\nimport io.reactivex.android.schedulers.AndroidSchedulers;\nimport io.reactivex.disposables.Disposable;\nimport io.reactivex.functions.Consumer;\n\npublic class ToastUtils {\n    private static final long SHORT_DELAY = 2000L; // ms; Toast.LENGTH_SHORT\n    private static final long LONG_DELAY = 3500L; // ms; Toast.LENGTH_LONG\n\n    private static Toast sToast;\n    private static Disposable sDisposable;\n\n    public static void showWithShortTime(Context context, int stringResId) {\n        showWithShortTime(context, context.getString(stringResId));\n    }\n\n    public static void showWithShortTime(Context context, String text) {\n        show(context, text, false);\n    }\n\n    public static void showWithLongTime(Context context, int stringResId) {\n        showWithLongTime(context, context.getString(stringResId));\n    }\n\n    public static void showWithLongTime(Context context, String text) {\n        show(context, text, true);\n    }\n\n    private static void show(Context context, String text, boolean isLong) {\n        RxUtils.disposeSafety(sDisposable);\n\n        if (sToast != null) {\n            sToast.setText(text);\n        } else {\n            sToast = Toast.makeText(context, text, !isLong ? Toast.LENGTH_SHORT : Toast.LENGTH_LONG);\n        }\n\n        sToast.show();\n        sDisposable = Observable.timer(!isLong ? SHORT_DELAY : LONG_DELAY, TimeUnit.MILLISECONDS)\n                .observeOn(AndroidSchedulers.mainThread())\n                .subscribe(new Consumer<Long>() {\n                    @Override\n                    public void accept(Long aLong) throws Exception {\n                        sToast.cancel();\n                    }\n                }, new Consumer<Throwable>() {\n                    @Override\n                    public void accept(Throwable throwable) throws Exception {\n                        throwable.printStackTrace();\n                    }\n                });\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/io/github/mthli/mount/widget/PackageItemAdapter.java",
    "content": "/*\n * App Mount, mount/umount apps that you don't like on Android, without root.\n * Copyright (C) 2017 Matthew Lee\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\npackage io.github.mthli.mount.widget;\n\nimport android.content.Context;\nimport android.support.annotation.NonNull;\nimport android.view.LayoutInflater;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.widget.ArrayAdapter;\nimport android.widget.SectionIndexer;\n\nimport java.text.Collator;\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.Comparator;\nimport java.util.LinkedHashMap;\nimport java.util.List;\nimport java.util.Map;\n\nimport io.github.mthli.mount.R;\nimport io.github.mthli.mount.model.PackageRecord;\n\npublic class PackageItemAdapter extends ArrayAdapter<PackageRecord> implements SectionIndexer {\n    private Context mContext;\n    private List<PackageRecord> mPackageList;\n    private Map<String, Integer> mSectionMap;\n    private String[] mSectionArray;\n\n    public PackageItemAdapter(Context context, List<PackageRecord> list) {\n        super(context, R.layout.layout_package_item, list);\n\n        mContext = context;\n        mPackageList = list;\n        mSectionMap = new LinkedHashMap<>();\n        mSectionArray = new String[0];\n\n        buildSection();\n    }\n\n    @NonNull\n    @Override\n    public View getView(int position, View convertView, @NonNull ViewGroup parent) {\n        View view = convertView;\n        if (!(view instanceof PackageItemLayout)) {\n            view = LayoutInflater.from(mContext).inflate(R.layout.layout_package_item, parent, false);\n        }\n\n        ((PackageItemLayout) view).setPackageRecord(mPackageList.get(position));\n\n        return view;\n    }\n\n    // =============================================================================================\n\n    @Override\n    public int getPositionForSection(int sectionIndex) {\n        return mSectionMap.get(mSectionArray[sectionIndex]);\n    }\n\n    @Override\n    public int getSectionForPosition(int position) {\n        return 0;\n    }\n\n    @Override\n    public Object[] getSections() {\n        return mSectionArray;\n    }\n\n    @Override\n    public void notifyDataSetChanged() {\n        super.notifyDataSetChanged();\n        buildSection();\n    }\n\n    private void buildSection() {\n        mSectionMap.clear();\n        for (int index = 0; index < mPackageList.size(); index++) {\n            mSectionMap.put(mPackageList.get(index).label.substring(0, 1).toUpperCase(), index);\n        }\n\n        List<String> sectionList = new ArrayList<>(mSectionMap.keySet());\n        Collections.sort(sectionList, new Comparator<String>() {\n            @Override\n            public int compare(String o1, String o2) {\n                return Collator.getInstance().compare(o1, o2);\n            }\n        });\n\n        mSectionArray = new String[sectionList.size()];\n        sectionList.toArray(mSectionArray);\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/io/github/mthli/mount/widget/PackageItemLayout.java",
    "content": "/*\n * App Mount, mount/umount apps that you don't like on Android, without root.\n * Copyright (C) 2017 Matthew Lee\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\npackage io.github.mthli.mount.widget;\n\nimport android.content.Context;\nimport android.graphics.PorterDuff;\nimport android.util.AttributeSet;\nimport android.util.TypedValue;\nimport android.widget.ImageView;\nimport android.widget.RelativeLayout;\nimport android.widget.TextView;\n\nimport io.github.mthli.mount.R;\nimport io.github.mthli.mount.model.PackageRecord;\nimport io.github.mthli.mount.util.ImageUtils;\n\npublic class PackageItemLayout extends RelativeLayout {\n    private ImageView mIconView;\n    private ImageView mUmountView;\n    private TextView mLabelView;\n    private TextView mVersionView;\n\n    public PackageItemLayout(Context context) {\n        super(context);\n    }\n\n    public PackageItemLayout(Context context, AttributeSet attrs) {\n        super(context, attrs);\n    }\n\n    public PackageItemLayout(Context context, AttributeSet attrs, int defStyleAttr) {\n        super(context, attrs, defStyleAttr);\n    }\n\n    @Override\n    protected void onFinishInflate() {\n        super.onFinishInflate();\n\n        mIconView = (ImageView) findViewById(R.id.icon);\n        mUmountView = (ImageView) findViewById(R.id.umount);\n        mLabelView = (TextView) findViewById(R.id.label);\n        mVersionView = (TextView) findViewById(R.id.version);\n\n        setupUmountView();\n    }\n\n    private void setupUmountView() {\n        TypedValue value = new TypedValue();\n        getContext().getTheme().resolveAttribute(android.R.attr.colorControlActivated, value, true);\n        mUmountView.getDrawable().mutate().setColorFilter(value.data, PorterDuff.Mode.SRC_IN);\n    }\n\n    public void setPackageRecord(PackageRecord record) {\n        mIconView.setImageBitmap(ImageUtils.bytes2Bitmap(record.icon));\n        mUmountView.setVisibility(record.umount ? VISIBLE : GONE);\n        mLabelView.setText(record.label);\n        mVersionView.setText(record.version);\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/io/github/mthli/mount/widget/PackageSettingLayout.java",
    "content": "/*\n * App Mount, mount/umount apps that you don't like on Android, without root.\n * Copyright (C) 2017 Matthew Lee\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\npackage io.github.mthli.mount.widget;\n\nimport android.content.Context;\nimport android.util.AttributeSet;\nimport android.view.View;\nimport android.widget.CompoundButton;\nimport android.widget.ImageView;\nimport android.widget.LinearLayout;\nimport android.widget.Switch;\nimport android.widget.TextView;\n\nimport io.github.mthli.mount.R;\nimport io.github.mthli.mount.model.PackageRecord;\nimport io.github.mthli.mount.util.ImageUtils;\n\npublic class PackageSettingLayout extends LinearLayout implements CompoundButton.OnCheckedChangeListener,\n        View.OnClickListener {\n    public interface PackageSettingLayoutListener {\n        void onMountSwitchChanged(boolean umount);\n        void onClickRunView();\n        void onClickInfoView();\n        void onClickAddToLauncher();\n    }\n\n    private ImageView mIconView;\n    private Switch mMountSwitch;\n    private TextView mLabelView;\n    private TextView mVersionView;\n    private TextView mRunView;\n    private TextView mInfoView;\n    private TextView mAddToLauncherView;\n\n    private PackageSettingLayoutListener mListener;\n\n    public PackageSettingLayout(Context context) {\n        super(context);\n    }\n\n    public PackageSettingLayout(Context context, AttributeSet attrs) {\n        super(context, attrs);\n    }\n\n    public PackageSettingLayout(Context context, AttributeSet attrs, int defStyleAttr) {\n        super(context, attrs, defStyleAttr);\n    }\n\n    public void setPackageSettingLayoutListener(PackageSettingLayoutListener listener) {\n        mListener = listener;\n    }\n\n    public void setPackageRecord(PackageRecord record) {\n        mIconView.setImageBitmap(ImageUtils.bytes2Bitmap(record.icon));\n        mMountSwitch.setOnCheckedChangeListener(null);\n        mMountSwitch.setChecked(record.umount);\n        mMountSwitch.setOnCheckedChangeListener(this);\n        mLabelView.setText(record.label);\n        mVersionView.setText(record.version);\n    }\n\n    @Override\n    protected void onFinishInflate() {\n        super.onFinishInflate();\n\n        mIconView = (ImageView) findViewById(R.id.icon);\n        mMountSwitch = (Switch) findViewById(R.id.mount_switch);\n        mLabelView = (TextView) findViewById(R.id.label);\n        mVersionView = (TextView) findViewById(R.id.version);\n        mRunView = (TextView) findViewById(R.id.run);\n        mInfoView = (TextView) findViewById(R.id.info);\n        mAddToLauncherView = (TextView) findViewById(R.id.add_to_launcher);\n\n        mMountSwitch.setOnCheckedChangeListener(this);\n        mRunView.setOnClickListener(this);\n        mInfoView.setOnClickListener(this);\n        mAddToLauncherView.setOnClickListener(this);\n    }\n\n    @Override\n    public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {\n        if (buttonView == mMountSwitch && mListener != null) {\n            mListener.onMountSwitchChanged(isChecked);\n        }\n    }\n\n    @Override\n    public void onClick(View view) {\n        if (view == mRunView && mListener != null) {\n            mListener.onClickRunView();\n        } else if (view == mInfoView && mListener != null) {\n            mListener.onClickInfoView();\n        } else if (view == mAddToLauncherView && mListener != null) {\n            mListener.onClickAddToLauncher();\n        }\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/io/github/mthli/mount/widget/PolicyHintLayout.java",
    "content": "/*\n * App Mount, mount/umount apps that you don't like on Android, without root.\n * Copyright (C) 2017 Matthew Lee\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\npackage io.github.mthli.mount.widget;\n\nimport android.content.Context;\nimport android.text.Html;\nimport android.util.AttributeSet;\nimport android.view.View;\nimport android.widget.RelativeLayout;\nimport android.widget.TextView;\n\nimport io.github.mthli.mount.R;\nimport io.github.mthli.mount.util.IntentUtils;\n\npublic class PolicyHintLayout extends RelativeLayout {\n    public PolicyHintLayout(Context context) {\n        super(context);\n    }\n\n    public PolicyHintLayout(Context context, AttributeSet attrs) {\n        super(context, attrs);\n    }\n\n    public PolicyHintLayout(Context context, AttributeSet attrs, int defStyleAttr) {\n        super(context, attrs, defStyleAttr);\n    }\n\n    @Override\n    protected void onFinishInflate() {\n        super.onFinishInflate();\n\n        ((TextView) findViewById(R.id.hint)).setText(Html.fromHtml(\n                getContext().getString(R.string.device_policy_hint)));\n\n        findViewById(R.id.button).setOnClickListener(new OnClickListener() {\n            @Override\n            public void onClick(View v) {\n                IntentUtils.showTutorial(getContext());\n            }\n        });\n    }\n}\n"
  },
  {
    "path": "app/src/main/res/layout/activity_main.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<!--\n  ~ App Mount, mount/umount apps that you don't like on Android, without root.\n  ~ Copyright (C) 2017 Matthew Lee\n  ~\n  ~ This program is free software: you can redistribute it and/or modify\n  ~ it under the terms of the GNU General Public License as published by\n  ~ the Free Software Foundation, either version 3 of the License, or\n  ~ (at your option) any later version.\n  ~\n  ~ This program is distributed in the hope that it will be useful,\n  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of\n  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n  ~ GNU General Public License for more details.\n  ~\n  ~ You should have received a copy of the GNU General Public License\n  ~ along with this program.  If not, see <http://www.gnu.org/licenses/>.\n  -->\n\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n              android:id=\"@+id/activity_main\"\n              android:orientation=\"vertical\"\n              android:layout_width=\"match_parent\"\n              android:layout_height=\"match_parent\"\n              android:fitsSystemWindows=\"true\"\n              android:clipToPadding=\"false\">\n\n    <ListView android:id=\"@+id/list\"\n              android:layout_width=\"match_parent\"\n              android:layout_height=\"match_parent\"\n              android:scrollbars=\"none\"\n              android:fastScrollEnabled=\"true\">\n    </ListView>\n\n</LinearLayout>\n"
  },
  {
    "path": "app/src/main/res/layout/activity_settings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<!--\n  ~ App Mount, mount/umount apps that you don't like on Android, without root.\n  ~ Copyright (C) 2017 Matthew Lee\n  ~\n  ~ This program is free software: you can redistribute it and/or modify\n  ~ it under the terms of the GNU General Public License as published by\n  ~ the Free Software Foundation, either version 3 of the License, or\n  ~ (at your option) any later version.\n  ~\n  ~ This program is distributed in the hope that it will be useful,\n  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of\n  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n  ~ GNU General Public License for more details.\n  ~\n  ~ You should have received a copy of the GNU General Public License\n  ~ along with this program.  If not, see <http://www.gnu.org/licenses/>.\n  -->\n<FrameLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n             android:layout_width=\"match_parent\"\n             android:layout_height=\"match_parent\">\n\n    <FrameLayout android:id=\"@+id/content\"\n                 android:layout_width=\"match_parent\"\n                 android:layout_height=\"match_parent\">\n    </FrameLayout>\n\n</FrameLayout>"
  },
  {
    "path": "app/src/main/res/layout/layout_action_bar_loading.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<!--\n  ~ App Mount, mount/umount apps that you don't like on Android, without root.\n  ~ Copyright (C) 2017 Matthew Lee\n  ~\n  ~ This program is free software: you can redistribute it and/or modify\n  ~ it under the terms of the GNU General Public License as published by\n  ~ the Free Software Foundation, either version 3 of the License, or\n  ~ (at your option) any later version.\n  ~\n  ~ This program is distributed in the hope that it will be useful,\n  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of\n  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n  ~ GNU General Public License for more details.\n  ~\n  ~ You should have received a copy of the GNU General Public License\n  ~ along with this program.  If not, see <http://www.gnu.org/licenses/>.\n  -->\n\n<ProgressBar xmlns:android=\"http://schemas.android.com/apk/res/android\"\n             android:layout_width=\"40dp\"\n             android:layout_height=\"40dp\"\n             android:paddingStart=\"8dp\"\n             android:paddingEnd=\"8dp\"\n             android:layout_gravity=\"center\"\n             android:indeterminate=\"true\"\n             android:indeterminateTint=\"@android:color/white\"\n             android:indeterminateTintMode=\"src_in\">\n</ProgressBar>"
  },
  {
    "path": "app/src/main/res/layout/layout_device_hint.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<!--\n  ~ App Mount, mount/umount apps that you don't like on Android, without root.\n  ~ Copyright (C) 2017 Matthew Lee\n  ~\n  ~ This program is free software: you can redistribute it and/or modify\n  ~ it under the terms of the GNU General Public License as published by\n  ~ the Free Software Foundation, either version 3 of the License, or\n  ~ (at your option) any later version.\n  ~\n  ~ This program is distributed in the hope that it will be useful,\n  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of\n  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n  ~ GNU General Public License for more details.\n  ~\n  ~ You should have received a copy of the GNU General Public License\n  ~ along with this program.  If not, see <http://www.gnu.org/licenses/>.\n  -->\n\n<io.github.mthli.mount.widget.PolicyHintLayout\n        xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:background=\"?android:attr/colorPrimary\"\n        android:descendantFocusability=\"blocksDescendants\">\n\n    <TextView android:id=\"@+id/hint\"\n              android:layout_width=\"match_parent\"\n              android:layout_height=\"wrap_content\"\n              android:layout_alignParentTop=\"true\"\n              android:paddingTop=\"16dp\"\n              android:paddingStart=\"16dp\"\n              android:paddingEnd=\"16dp\"\n              android:textColor=\"@android:color/white\"\n              android:textSize=\"16sp\">\n    </TextView>\n\n    <Button android:id=\"@+id/button\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_alignParentEnd=\"true\"\n            android:layout_below=\"@id/hint\"\n            android:layout_marginEnd=\"4dp\"\n            android:text=\"@string/device_policy_button\"\n            android:textAllCaps=\"true\"\n            android:textColor=\"?android:attr/textColorPrimaryInverse\"\n            style=\"@android:style/Widget.DeviceDefault.Button.Borderless\">\n    </Button>\n\n</io.github.mthli.mount.widget.PolicyHintLayout>"
  },
  {
    "path": "app/src/main/res/layout/layout_package_item.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<!--\n  ~ App Mount, mount/umount apps that you don't like on Android, without root.\n  ~ Copyright (C) 2017 Matthew Lee\n  ~\n  ~ This program is free software: you can redistribute it and/or modify\n  ~ it under the terms of the GNU General Public License as published by\n  ~ the Free Software Foundation, either version 3 of the License, or\n  ~ (at your option) any later version.\n  ~\n  ~ This program is distributed in the hope that it will be useful,\n  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of\n  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n  ~ GNU General Public License for more details.\n  ~\n  ~ You should have received a copy of the GNU General Public License\n  ~ along with this program.  If not, see <http://www.gnu.org/licenses/>.\n  -->\n\n<io.github.mthli.mount.widget.PackageItemLayout\n        xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:padding=\"16dp\"\n        android:descendantFocusability=\"blocksDescendants\">\n\n    <ImageView android:id=\"@+id/icon\"\n               android:contentDescription=\"@null\"\n               android:layout_width=\"40dp\"\n               android:layout_height=\"40dp\"\n               android:layout_centerInParent=\"true\"\n               android:layout_alignParentStart=\"true\"\n               android:scaleType=\"centerInside\">\n    </ImageView>\n\n    <ImageView android:id=\"@+id/umount\"\n               android:contentDescription=\"@null\"\n               android:layout_width=\"32dp\"\n               android:layout_height=\"32dp\"\n               android:layout_marginEnd=\"-8dp\"\n               android:src=\"@drawable/ic_eject\"\n               android:layout_centerInParent=\"true\"\n               android:layout_alignParentEnd=\"true\"\n               android:scaleType=\"centerInside\"\n               android:visibility=\"gone\">\n    </ImageView>\n\n    <LinearLayout android:orientation=\"vertical\"\n                  android:layout_width=\"match_parent\"\n                  android:layout_height=\"wrap_content\"\n                  android:layout_centerInParent=\"true\"\n                  android:layout_toStartOf=\"@id/umount\"\n                  android:layout_toEndOf=\"@id/icon\"\n                  android:paddingStart=\"16dp\"\n                  android:paddingEnd=\"16dp\">\n\n        <TextView android:id=\"@+id/label\"\n                  android:layout_width=\"match_parent\"\n                  android:layout_height=\"wrap_content\"\n                  android:textColor=\"?android:attr/textColorPrimary\"\n                  android:textSize=\"16sp\"\n                  android:maxLines=\"1\"\n                  android:ellipsize=\"end\">\n        </TextView>\n\n        <TextView android:id=\"@+id/version\"\n                  android:layout_width=\"match_parent\"\n                  android:layout_height=\"wrap_content\"\n                  android:textColor=\"?android:attr/textColorSecondary\"\n                  android:textSize=\"14sp\"\n                  android:maxLines=\"1\"\n                  android:ellipsize=\"end\">\n        </TextView>\n\n    </LinearLayout>\n\n</io.github.mthli.mount.widget.PackageItemLayout>"
  },
  {
    "path": "app/src/main/res/layout/layout_package_setting.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<!--\n  ~ App Mount, mount/umount apps that you don't like on Android, without root.\n  ~ Copyright (C) 2017 Matthew Lee\n  ~\n  ~ This program is free software: you can redistribute it and/or modify\n  ~ it under the terms of the GNU General Public License as published by\n  ~ the Free Software Foundation, either version 3 of the License, or\n  ~ (at your option) any later version.\n  ~\n  ~ This program is distributed in the hope that it will be useful,\n  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of\n  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n  ~ GNU General Public License for more details.\n  ~\n  ~ You should have received a copy of the GNU General Public License\n  ~ along with this program.  If not, see <http://www.gnu.org/licenses/>.\n  -->\n\n<io.github.mthli.mount.widget.PackageSettingLayout\n        xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        android:orientation=\"vertical\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:paddingBottom=\"8dp\"\n        android:background=\"@android:color/white\">\n\n    <RelativeLayout android:layout_width=\"match_parent\"\n                    android:layout_height=\"?android:attr/actionBarSize\"\n                    android:layout_marginTop=\"8dp\">\n\n        <Switch android:id=\"@+id/mount_switch\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:layout_centerInParent=\"true\"\n                android:layout_alignParentEnd=\"true\"\n                android:layout_marginEnd=\"8dp\"\n                android:text=\"@null\"\n                android:textOn=\"@null\"\n                android:textOff=\"@null\">\n        </Switch>\n\n        <ImageView android:id=\"@+id/icon\"\n                   android:contentDescription=\"@null\"\n                   android:layout_width=\"40dp\"\n                   android:layout_height=\"40dp\"\n                   android:layout_centerInParent=\"true\"\n                   android:layout_alignParentStart=\"true\"\n                   android:layout_marginStart=\"16dp\"\n                   android:scaleType=\"centerInside\">\n        </ImageView>\n\n        <LinearLayout android:orientation=\"vertical\"\n                      android:layout_width=\"match_parent\"\n                      android:layout_height=\"wrap_content\"\n                      android:layout_centerInParent=\"true\"\n                      android:layout_toStartOf=\"@id/mount_switch\"\n                      android:layout_toEndOf=\"@id/icon\"\n                      android:paddingStart=\"16dp\"\n                      android:paddingEnd=\"16dp\">\n\n            <TextView android:id=\"@+id/label\"\n                      android:layout_width=\"match_parent\"\n                      android:layout_height=\"wrap_content\"\n                      android:textColor=\"?android:attr/textColorPrimary\"\n                      android:textSize=\"16sp\"\n                      android:maxLines=\"1\"\n                      android:ellipsize=\"end\">\n            </TextView>\n\n            <TextView android:id=\"@+id/version\"\n                      android:layout_width=\"match_parent\"\n                      android:layout_height=\"wrap_content\"\n                      android:textColor=\"?android:attr/textColorSecondary\"\n                      android:textSize=\"14sp\"\n                      android:maxLines=\"1\"\n                      android:ellipsize=\"end\">\n            </TextView>\n\n        </LinearLayout>\n\n    </RelativeLayout>\n\n    <TextView android:id=\"@+id/run\"\n              android:layout_width=\"match_parent\"\n              android:layout_height=\"48dp\"\n              android:paddingStart=\"24dp\"\n              android:paddingEnd=\"24dp\"\n              android:text=\"@string/package_setting_run\"\n              android:textColor=\"?android:attr/textColorPrimary\"\n              android:textSize=\"16sp\"\n              android:gravity=\"center|start\"\n              android:background=\"?android:attr/selectableItemBackground\">\n    </TextView>\n\n    <TextView android:id=\"@+id/info\"\n              android:layout_width=\"match_parent\"\n              android:layout_height=\"48dp\"\n              android:paddingStart=\"24dp\"\n              android:paddingEnd=\"24dp\"\n              android:text=\"@string/package_setting_info\"\n              android:textColor=\"?android:attr/textColorPrimary\"\n              android:textSize=\"16sp\"\n              android:gravity=\"center|start\"\n              android:background=\"?android:attr/selectableItemBackground\">\n    </TextView>\n\n    <TextView android:id=\"@+id/add_to_launcher\"\n              android:layout_width=\"match_parent\"\n              android:layout_height=\"48dp\"\n              android:paddingStart=\"24dp\"\n              android:paddingEnd=\"24dp\"\n              android:text=\"@string/package_setting_add_to_launcher\"\n              android:textColor=\"?android:attr/textColorPrimary\"\n              android:textSize=\"16sp\"\n              android:gravity=\"center|start\"\n              android:background=\"?android:attr/selectableItemBackground\">\n    </TextView>\n\n</io.github.mthli.mount.widget.PackageSettingLayout>"
  },
  {
    "path": "app/src/main/res/menu/menu_main.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<!--\n  ~ App Mount, mount/umount apps that you don't like on Android, without root.\n  ~ Copyright (C) 2017 Matthew Lee\n  ~\n  ~ This program is free software: you can redistribute it and/or modify\n  ~ it under the terms of the GNU General Public License as published by\n  ~ the Free Software Foundation, either version 3 of the License, or\n  ~ (at your option) any later version.\n  ~\n  ~ This program is distributed in the hope that it will be useful,\n  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of\n  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n  ~ GNU General Public License for more details.\n  ~\n  ~ You should have received a copy of the GNU General Public License\n  ~ along with this program.  If not, see <http://www.gnu.org/licenses/>.\n  -->\n\n<menu xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n    <item android:id=\"@+id/loading\"\n          android:title=\"@string/menu_main_loading\"\n          android:actionLayout=\"@layout/layout_action_bar_loading\"\n          android:showAsAction=\"ifRoom\">\n    </item>\n\n    <item android:id=\"@+id/settings\"\n          android:title=\"@string/menu_main_settings\"\n          android:showAsAction=\"never\">\n    </item>\n\n    <item android:id=\"@+id/donate\"\n          android:title=\"@string/menu_main_donate\"\n          android:showAsAction=\"never\">\n    </item>\n\n</menu>"
  },
  {
    "path": "app/src/main/res/values/strings.xml",
    "content": "<!--\n  ~ App Mount, mount/umount apps that you don't like on Android, without root.\n  ~ Copyright (C) 2017 Matthew Lee\n  ~\n  ~ This program is free software: you can redistribute it and/or modify\n  ~ it under the terms of the GNU General Public License as published by\n  ~ the Free Software Foundation, either version 3 of the License, or\n  ~ (at your option) any later version.\n  ~\n  ~ This program is distributed in the hope that it will be useful,\n  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of\n  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n  ~ GNU General Public License for more details.\n  ~\n  ~ You should have received a copy of the GNU General Public License\n  ~ along with this program.  If not, see <http://www.gnu.org/licenses/>.\n  -->\n\n<resources>\n\n    <string name=\"app_name\">App Mount</string>\n    <string name=\"alipay_account\">matthewlee0725@gmail.com</string>\n\n    <string name=\"menu_main_loading\">Loading</string>\n    <string name=\"menu_main_settings\">Settings</string>\n    <string name=\"menu_main_donate\">Donate</string>\n    <string name=\"donate_dialog_title\">AliPay</string>\n    <string name=\"donate_dialog_positive\">Copy account</string>\n    <string name=\"toast_copied\">Copied</string>\n\n    <string name=\"package_setting_run\">Run</string>\n    <string name=\"package_setting_info\">App info</string>\n    <string name=\"package_setting_add_to_launcher\">Add to launcher</string>\n    <string name=\"toast_mount\">mount %1$s</string>\n    <string name=\"toast_umount\">umount %1$s</string>\n    <string name=\"toast_add_to_launcher\">Add %1$s to launcher</string>\n    \n    <string name=\"device_policy_label\">App Mount Manager</string>\n    <string name=\"device_policy_description\">Manage chosen apps\\ run in background.</string>\n    <string name=\"device_policy_explanation\">umount chosen apps when screen off.</string>\n    <string name=\"device_policy_hint\">\n        To manage apps run in background, you need to set App Mount as &lt;b>Device Administrator&lt;/b>.\n    </string>\n    <string name=\"device_policy_button\">→ Show tutorial</string>\n\n    <string name=\"mount_service_label\">App Mount Service</string>\n    <string name=\"mount_service_description\">Receive screen off event to umount apps.</string>\n    <string name=\"mount_service_notification_title\">Waiting for the command</string>\n    <string name=\"mount_service_notification_text\">Tap to umount chosen apps.</string>\n    <string name=\"notification_service_label\">Notification Service</string>\n    <string name=\"notification_service_description\">Ignore foreground service when umount apps.</string>\n    <string name=\"toast_umount_all_ok\">umount all OK</string>\n\n    <string name=\"settings_label\">Settings</string>\n    <string name=\"dialog_message_wait_a_minute\">Wait a minute&#8230;</string>\n    <string name=\"toast_mount_all_temporary_ok\">mount all temporary OK</string>\n    <string name=\"toast_pre_uninstall_ok\">Pre uninstall OK</string>\n    <string name=\"preference_category_function\">Function</string>\n    <string name=\"preference_key_notification_quick_action\">preference_key_show_notification</string>\n    <string name=\"preference_title_notification_quick_action\">Notification quick action</string>\n    <string name=\"preference_summary_notification_quick_action\">umount apps manual though notification.</string>\n    <string name=\"preference_key_ignore_foreground_app\">preference_key_ignore_foreground_app</string>\n    <string name=\"preference_title_ignore_foreground_app\">Ignore foreground app</string>\n    <string name=\"preference_summary_ignore_foreground_app\">\n        Ignore current app on screen.\\nClick to enable at Usage Access.\n    </string>\n    <string name=\"preference_key_ignore_foreground_service\">preference_key_ignore_foreground_service</string>\n    <string name=\"preference_title_ignore_foreground_service\">Ignore foreground service</string>\n    <string name=\"preference_summary_ignore_foreground_service\">\n        When music app playing, etc.\\nClick to enable at Notification Access.\n    </string>\n    <string name=\"preference_key_mount_all_temporary\">preference_key_mount_all_temporary</string>\n    <string name=\"preference_title_mount_all_temporary\">mount all temporary</string>\n    <string name=\"preference_summary_mount_all_temporary\">To upgrade apps, etc.</string>\n    <string name=\"preference_key_pre_uninstall\">preference_key_pre_uninstall</string>\n    <string name=\"preference_title_pre_uninstall\">Pre uninstall</string>\n    <string name=\"preference_summary_pre_uninstall\">mount all apps, and then you can uninstall App Mount.</string>\n    <string name=\"preference_category_others\">Others</string>\n    <string name=\"preference_key_version\">preference_key_version</string>\n    <string name=\"preference_title_version\">Version</string>\n    <string name=\"preference_key_tutorial\">preference_key_tutorial</string>\n    <string name=\"preference_title_tutorial\">Tutorial</string>\n\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<!--\n  ~ App Mount, mount/umount apps that you don't like on Android, without root.\n  ~ Copyright (C) 2017 Matthew Lee\n  ~\n  ~ This program is free software: you can redistribute it and/or modify\n  ~ it under the terms of the GNU General Public License as published by\n  ~ the Free Software Foundation, either version 3 of the License, or\n  ~ (at your option) any later version.\n  ~\n  ~ This program is distributed in the hope that it will be useful,\n  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of\n  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n  ~ GNU General Public License for more details.\n  ~\n  ~ You should have received a copy of the GNU General Public License\n  ~ along with this program.  If not, see <http://www.gnu.org/licenses/>.\n  -->\n\n<resources>\n\n    <style name=\"MainActivityTheme\" parent=\"@android:style/Theme.DeviceDefault.Settings\">\n        <item name=\"android:colorBackgroundCacheHint\">@null</item>\n        <item name=\"android:statusBarColor\">@android:color/transparent</item>\n        <item name=\"android:windowBackground\">@android:color/transparent</item>\n        <item name=\"android:windowContentOverlay\">@null</item>\n        <item name=\"android:windowDisablePreview\">true</item>\n        <item name=\"android:windowIsTranslucent\">true</item>\n        <item name=\"android:windowNoDisplay\">true</item>\n        <item name=\"android:windowAnimationStyle\">@null</item>\n    </style>\n\n    <style name=\"CocaActivityTheme\" parent=\"@android:style/Theme.DeviceDefault.Settings\" />\n\n    <style name=\"SettingsActivityTheme\" parent=\"android:style/Theme.DeviceDefault.Settings\" />\n\n</resources>"
  },
  {
    "path": "app/src/main/res/values-v23/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<!--\n  ~ App Mount, mount/umount apps that you don't like on Android, without root.\n  ~ Copyright (C) 2017 Matthew Lee\n  ~\n  ~ This program is free software: you can redistribute it and/or modify\n  ~ it under the terms of the GNU General Public License as published by\n  ~ the Free Software Foundation, either version 3 of the License, or\n  ~ (at your option) any later version.\n  ~\n  ~ This program is distributed in the hope that it will be useful,\n  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of\n  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n  ~ GNU General Public License for more details.\n  ~\n  ~ You should have received a copy of the GNU General Public License\n  ~ along with this program.  If not, see <http://www.gnu.org/licenses/>.\n  -->\n\n<resources>\n\n    <!-- http://stackoverflow.com/questions/32169303/activity-did-not-call-finish-api-23 -->\n    <style name=\"MainActivityTheme\" parent=\"@android:style/Theme.DeviceDefault.Settings\">\n        <item name=\"android:colorBackgroundCacheHint\">@null</item>\n        <item name=\"android:statusBarColor\">@android:color/transparent</item>\n        <item name=\"android:windowBackground\">@android:color/transparent</item>\n        <item name=\"android:windowContentOverlay\">@null</item>\n        <item name=\"android:windowDisablePreview\">true</item>\n        <item name=\"android:windowIsTranslucent\">true</item>\n        <item name=\"android:windowAnimationStyle\">@null</item>\n    </style>\n\n</resources>"
  },
  {
    "path": "app/src/main/res/values-zh-rCN/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<!--\n  ~ App Mount, mount/umount apps that you don't like on Android, without root.\n  ~ Copyright (C) 2017 Matthew Lee\n  ~\n  ~ This program is free software: you can redistribute it and/or modify\n  ~ it under the terms of the GNU General Public License as published by\n  ~ the Free Software Foundation, either version 3 of the License, or\n  ~ (at your option) any later version.\n  ~\n  ~ This program is distributed in the hope that it will be useful,\n  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of\n  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n  ~ GNU General Public License for more details.\n  ~\n  ~ You should have received a copy of the GNU General Public License\n  ~ along with this program.  If not, see <http://www.gnu.org/licenses/>.\n  -->\n\n<resources>\n\n    <string name=\"app_name\">应用挂载器</string>\n\n    <string name=\"menu_main_loading\">加载中</string>\n    <string name=\"menu_main_settings\">设置</string>\n    <string name=\"menu_main_donate\">赞助</string>\n    <string name=\"donate_dialog_title\">支付宝</string>\n    <string name=\"donate_dialog_positive\">复制帐号</string>\n    <string name=\"toast_copied\">已复制</string>\n\n    <string name=\"package_setting_run\">运行</string>\n    <string name=\"package_setting_info\">应用信息</string>\n    <string name=\"package_setting_add_to_launcher\">添加到桌面</string>\n    <string name=\"toast_mount\">挂载 %1$s</string>\n    <string name=\"toast_umount\">弹出 %1$s</string>\n    <string name=\"toast_add_to_launcher\">添加 %1$s 到桌面</string>\n\n    <string name=\"device_policy_label\">应用挂载器</string>\n    <string name=\"device_policy_description\">管理在后台运行的所有被选中的应用。</string>\n    <string name=\"device_policy_explanation\">当屏幕关闭时，将所有被选中的应用弹出。</string>\n    <string name=\"device_policy_hint\">\n        为了管理在后台运行的应用，你需要把应用挂载器设置为&lt;b>系统管理员&lt;/b>。\n    </string>\n    <string name=\"device_policy_button\">→ 查看教程</string>\n\n    <string name=\"mount_service_label\">应用弹出服务</string>\n    <string name=\"mount_service_description\">接收屏幕关闭事件，用于应用弹出。</string>\n    <string name=\"mount_service_notification_title\">随时等待命令</string>\n    <string name=\"mount_service_notification_text\">手动将所有被选中的应用弹出。</string>\n    <string name=\"notification_service_label\">通知服务</string>\n    <string name=\"notification_service_description\">忽略可能被弹出的前台服务。</string>\n    <string name=\"toast_umount_all_ok\">弹出完毕</string>\n\n    <string name=\"settings_label\">设置</string>\n    <string name=\"dialog_message_wait_a_minute\">稍等片刻&#8230;</string>\n    <string name=\"toast_mount_all_temporary_ok\">已临时挂载所有被选中的应用</string>\n    <string name=\"toast_pre_uninstall_ok\">预备卸载操作完毕</string>\n    <string name=\"preference_category_function\">功能</string>\n    <string name=\"preference_title_notification_quick_action\">通知栏快捷操作</string>\n    <string name=\"preference_summary_notification_quick_action\">点击通知弹出所有被选中的应用。</string>\n    <string name=\"preference_title_ignore_foreground_app\">忽略当前屏幕应用</string>\n    <string name=\"preference_summary_ignore_foreground_app\">点击前往设置使用情况访问权限。</string>\n    <string name=\"preference_title_ignore_foreground_service\">忽略前台服务</string>\n    <string name=\"preference_summary_ignore_foreground_service\">\n        比如正在播放音乐等情况，\\n点击前往设置通知使用权限。\n    </string>\n    <string name=\"preference_title_mount_all_temporary\">临时挂载所有应用</string>\n    <string name=\"preference_summary_mount_all_temporary\">用于更新应用等情况。</string>\n    <string name=\"preference_title_pre_uninstall\">预备卸载</string>\n    <string name=\"preference_summary_pre_uninstall\">将所有被弹出的应用挂载，接着你可以卸载这款应用。</string>\n    <string name=\"preference_category_others\">其他</string>\n    <string name=\"preference_title_version\">版本</string>\n    <string name=\"preference_title_tutorial\">教程</string>\n\n</resources>"
  },
  {
    "path": "app/src/main/res/values-zh-rTW/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<!--\n  ~ App Mount, mount/umount apps that you don't like on Android, without root.\n  ~ Copyright (C) 2017 Matthew Lee\n  ~\n  ~ This program is free software: you can redistribute it and/or modify\n  ~ it under the terms of the GNU General Public License as published by\n  ~ the Free Software Foundation, either version 3 of the License, or\n  ~ (at your option) any later version.\n  ~\n  ~ This program is distributed in the hope that it will be useful,\n  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of\n  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n  ~ GNU General Public License for more details.\n  ~\n  ~ You should have received a copy of the GNU General Public License\n  ~ along with this program.  If not, see <http://www.gnu.org/licenses/>.\n  -->\n\n<resources>\n\n    <string name=\"app_name\">應用挂載器</string>\n\n    <string name=\"menu_main_loading\">加載中</string>\n    <string name=\"menu_main_settings\">設置</string>\n    <string name=\"menu_main_donate\">贊助</string>\n    <string name=\"donate_dialog_title\">支付寶</string>\n    <string name=\"donate_dialog_positive\">複制帳號</string>\n    <string name=\"toast_copied\">已複制</string>\n\n    <string name=\"package_setting_run\">運行</string>\n    <string name=\"package_setting_info\">應用信息</string>\n    <string name=\"package_setting_add_to_launcher\">添加到桌面</string>\n    <string name=\"toast_mount\">挂載 %1$s</string>\n    <string name=\"toast_umount\">彈出 %1$s</string>\n    <string name=\"toast_add_to_launcher\">添加 %1$s 到桌面</string>\n\n    <string name=\"device_policy_label\">應用挂載器</string>\n    <string name=\"device_policy_description\">管理在後台運行的所有被選中的應用。</string>\n    <string name=\"device_policy_explanation\">當屏幕關閉時，將所有被選中的應用彈出。</string>\n    <string name=\"device_policy_hint\">\n        爲了管理在後台運行的應用，你需要把應用挂載器設置爲&lt;b>系統管理員&lt;/b>。\n    </string>\n    <string name=\"device_policy_button\">→ 查看教程</string>\n\n    <string name=\"mount_service_label\">應用彈出服務</string>\n    <string name=\"mount_service_description\">接收屏幕關閉事件，用于應用彈出。</string>\n    <string name=\"mount_service_notification_title\">隨時等待命令</string>\n    <string name=\"mount_service_notification_text\">手動將所有被選中的應用彈出。</string>\n    <string name=\"notification_service_label\">通知服務</string>\n    <string name=\"notification_service_description\">忽略可能被彈出的前台服務。</string>\n    <string name=\"toast_umount_all_ok\">彈出完畢</string>\n\n    <string name=\"settings_label\">設置</string>\n    <string name=\"dialog_message_wait_a_minute\">稍等片刻&#8230;</string>\n    <string name=\"toast_mount_all_temporary_ok\">已臨時挂載所有被選中的應用</string>\n    <string name=\"toast_pre_uninstall_ok\">預備卸載操作完畢</string>\n    <string name=\"preference_category_function\">功能</string>\n    <string name=\"preference_title_notification_quick_action\">通知欄快捷操作</string>\n    <string name=\"preference_summary_notification_quick_action\">點擊通知彈出所有被選中的應用。</string>\n    <string name=\"preference_title_ignore_foreground_app\">忽略當前屏幕應用</string>\n    <string name=\"preference_summary_ignore_foreground_app\">點擊前往設置使用情況訪問權限。</string>\n    <string name=\"preference_title_ignore_foreground_service\">忽略前台服務</string>\n    <string name=\"preference_summary_ignore_foreground_service\">\n        比如正在播放音樂等情況，\\n點擊前往設置通知使用權限。\n    </string>\n    <string name=\"preference_title_mount_all_temporary\">臨時挂載所有應用</string>\n    <string name=\"preference_summary_mount_all_temporary\">用于更新應用等情況。</string>\n    <string name=\"preference_title_pre_uninstall\">預備卸載</string>\n    <string name=\"preference_summary_pre_uninstall\">將所有被彈出的應用挂載，接著你可以卸載這款應用。</string>\n    <string name=\"preference_category_others\">其他</string>\n    <string name=\"preference_title_version\">版本</string>\n    <string name=\"preference_title_tutorial\">教程</string>\n\n</resources>"
  },
  {
    "path": "app/src/main/res/xml/device_policy.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<!--\n  ~ App Mount, mount/umount apps that you don't like on Android, without root.\n  ~ Copyright (C) 2017 Matthew Lee\n  ~\n  ~ This program is free software: you can redistribute it and/or modify\n  ~ it under the terms of the GNU General Public License as published by\n  ~ the Free Software Foundation, either version 3 of the License, or\n  ~ (at your option) any later version.\n  ~\n  ~ This program is distributed in the hope that it will be useful,\n  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of\n  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n  ~ GNU General Public License for more details.\n  ~\n  ~ You should have received a copy of the GNU General Public License\n  ~ along with this program.  If not, see <http://www.gnu.org/licenses/>.\n  -->\n\n<device-admin>\n    <uses-policies>\n        <force-lock />\n    </uses-policies>\n</device-admin>"
  },
  {
    "path": "app/src/main/res/xml/preferences.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<!--\n  ~ App Mount, mount/umount apps that you don't like on Android, without root.\n  ~ Copyright (C) 2017 Matthew Lee\n  ~\n  ~ This program is free software: you can redistribute it and/or modify\n  ~ it under the terms of the GNU General Public License as published by\n  ~ the Free Software Foundation, either version 3 of the License, or\n  ~ (at your option) any later version.\n  ~\n  ~ This program is distributed in the hope that it will be useful,\n  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of\n  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n  ~ GNU General Public License for more details.\n  ~\n  ~ You should have received a copy of the GNU General Public License\n  ~ along with this program.  If not, see <http://www.gnu.org/licenses/>.\n  -->\n\n<PreferenceScreen xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n    <PreferenceCategory android:title=\"@string/preference_category_function\">\n\n        <SwitchPreference\n                android:key=\"@string/preference_key_notification_quick_action\"\n                android:title=\"@string/preference_title_notification_quick_action\"\n                android:summary=\"@string/preference_summary_notification_quick_action\"\n                android:defaultValue=\"false\">\n        </SwitchPreference>\n\n        <Preference\n                android:key=\"@string/preference_key_ignore_foreground_app\"\n                android:title=\"@string/preference_title_ignore_foreground_app\"\n                android:summary=\"@string/preference_summary_ignore_foreground_app\">\n        </Preference>\n\n        <Preference\n                android:key=\"@string/preference_key_ignore_foreground_service\"\n                android:title=\"@string/preference_title_ignore_foreground_service\"\n                android:summary=\"@string/preference_summary_ignore_foreground_service\">\n        </Preference>\n\n        <Preference\n                android:key=\"@string/preference_key_mount_all_temporary\"\n                android:title=\"@string/preference_title_mount_all_temporary\"\n                android:summary=\"@string/preference_summary_mount_all_temporary\">\n        </Preference>\n\n        <Preference\n                android:key=\"@string/preference_key_pre_uninstall\"\n                android:title=\"@string/preference_title_pre_uninstall\"\n                android:summary=\"@string/preference_summary_pre_uninstall\">\n        </Preference>\n\n    </PreferenceCategory>\n\n    <PreferenceCategory android:title=\"@string/preference_category_others\">\n\n        <Preference\n                android:key=\"@string/preference_key_version\"\n                android:title=\"@string/preference_title_version\">\n        </Preference>\n\n        <Preference\n                android:key=\"@string/preference_key_tutorial\"\n                android:title=\"@string/preference_title_tutorial\">\n        </Preference>\n\n    </PreferenceCategory>\n\n</PreferenceScreen>"
  },
  {
    "path": "build.gradle",
    "content": "/*\n * App Mount, mount/umount apps that you don't like on Android, without root.\n * Copyright (C) 2017 Matthew Lee\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\nbuildscript {\n    repositories {\n        jcenter()\n    }\n\n    dependencies {\n        classpath 'com.android.tools.build:gradle:2.2.3'\n    }\n}\n\nallprojects {\n    repositories {\n        jcenter()\n    }\n}\n\ntask clean(type: Delete) {\n    delete rootProject.buildDir\n}\n"
  },
  {
    "path": "gradle/wrapper/gradle-wrapper.properties",
    "content": "#\n# App Mount, mount/umount apps that you don't like on Android, without root.\n# Copyright (C) 2017 Matthew Lee\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program.  If not, see <http://www.gnu.org/licenses/>.\n#\n\n#Mon Dec 28 10:00:20 PST 2015\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-2.14.1-all.zip\n"
  },
  {
    "path": "gradle.properties",
    "content": "#\n# App Mount, mount/umount apps that you don't like on Android, without root.\n# Copyright (C) 2017 Matthew Lee\n#\n# This program is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with this program.  If not, see <http://www.gnu.org/licenses/>.\n#\n\n# Project-wide Gradle settings.\n\n# IDE (e.g. Android Studio) users:\n# Gradle settings configured through the IDE *will override*\n# any settings specified in this file.\n\n# For more details on how to configure your build environment visit\n# http://www.gradle.org/docs/current/userguide/build_environment.html\n\n# Specifies the JVM arguments used for the daemon process.\n# The setting is particularly useful for tweaking memory settings.\norg.gradle.jvmargs=-Xmx1536m\n\n# When configured, Gradle will run in incubating parallel mode.\n# This option should only be used with decoupled projects. More details, visit\n# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects\n# org.gradle.parallel=true\n"
  },
  {
    "path": "gradlew",
    "content": "#!/usr/bin/env bash\n\n##############################################################################\n##\n##  Gradle start up script for UN*X\n##\n##############################################################################\n\n# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nDEFAULT_JVM_OPTS=\"\"\n\nAPP_NAME=\"Gradle\"\nAPP_BASE_NAME=`basename \"$0\"`\n\n# Use the maximum available, or set MAX_FD != -1 to use that value.\nMAX_FD=\"maximum\"\n\nwarn ( ) {\n    echo \"$*\"\n}\n\ndie ( ) {\n    echo\n    echo \"$*\"\n    echo\n    exit 1\n}\n\n# OS specific support (must be 'true' or 'false').\ncygwin=false\nmsys=false\ndarwin=false\ncase \"`uname`\" in\n  CYGWIN* )\n    cygwin=true\n    ;;\n  Darwin* )\n    darwin=true\n    ;;\n  MINGW* )\n    msys=true\n    ;;\nesac\n\n# Attempt to set APP_HOME\n# Resolve links: $0 may be a link\nPRG=\"$0\"\n# Need this for relative symlinks.\nwhile [ -h \"$PRG\" ] ; do\n    ls=`ls -ld \"$PRG\"`\n    link=`expr \"$ls\" : '.*-> \\(.*\\)$'`\n    if expr \"$link\" : '/.*' > /dev/null; then\n        PRG=\"$link\"\n    else\n        PRG=`dirname \"$PRG\"`\"/$link\"\n    fi\ndone\nSAVED=\"`pwd`\"\ncd \"`dirname \\\"$PRG\\\"`/\" >/dev/null\nAPP_HOME=\"`pwd -P`\"\ncd \"$SAVED\" >/dev/null\n\nCLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar\n\n# Determine the Java command to use to start the JVM.\nif [ -n \"$JAVA_HOME\" ] ; then\n    if [ -x \"$JAVA_HOME/jre/sh/java\" ] ; then\n        # IBM's JDK on AIX uses strange locations for the executables\n        JAVACMD=\"$JAVA_HOME/jre/sh/java\"\n    else\n        JAVACMD=\"$JAVA_HOME/bin/java\"\n    fi\n    if [ ! -x \"$JAVACMD\" ] ; then\n        die \"ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n    fi\nelse\n    JAVACMD=\"java\"\n    which java >/dev/null 2>&1 || die \"ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\nfi\n\n# Increase the maximum file descriptors if we can.\nif [ \"$cygwin\" = \"false\" -a \"$darwin\" = \"false\" ] ; then\n    MAX_FD_LIMIT=`ulimit -H -n`\n    if [ $? -eq 0 ] ; then\n        if [ \"$MAX_FD\" = \"maximum\" -o \"$MAX_FD\" = \"max\" ] ; then\n            MAX_FD=\"$MAX_FD_LIMIT\"\n        fi\n        ulimit -n $MAX_FD\n        if [ $? -ne 0 ] ; then\n            warn \"Could not set maximum file descriptor limit: $MAX_FD\"\n        fi\n    else\n        warn \"Could not query maximum file descriptor limit: $MAX_FD_LIMIT\"\n    fi\nfi\n\n# For Darwin, add options to specify how the application appears in the dock\nif $darwin; then\n    GRADLE_OPTS=\"$GRADLE_OPTS \\\"-Xdock:name=$APP_NAME\\\" \\\"-Xdock:icon=$APP_HOME/media/gradle.icns\\\"\"\nfi\n\n# For Cygwin, switch paths to Windows format before running java\nif $cygwin ; then\n    APP_HOME=`cygpath --path --mixed \"$APP_HOME\"`\n    CLASSPATH=`cygpath --path --mixed \"$CLASSPATH\"`\n    JAVACMD=`cygpath --unix \"$JAVACMD\"`\n\n    # We build the pattern for arguments to be converted via cygpath\n    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`\n    SEP=\"\"\n    for dir in $ROOTDIRSRAW ; do\n        ROOTDIRS=\"$ROOTDIRS$SEP$dir\"\n        SEP=\"|\"\n    done\n    OURCYGPATTERN=\"(^($ROOTDIRS))\"\n    # Add a user-defined pattern to the cygpath arguments\n    if [ \"$GRADLE_CYGPATTERN\" != \"\" ] ; then\n        OURCYGPATTERN=\"$OURCYGPATTERN|($GRADLE_CYGPATTERN)\"\n    fi\n    # Now convert the arguments - kludge to limit ourselves to /bin/sh\n    i=0\n    for arg in \"$@\" ; do\n        CHECK=`echo \"$arg\"|egrep -c \"$OURCYGPATTERN\" -`\n        CHECK2=`echo \"$arg\"|egrep -c \"^-\"`                                 ### Determine if an option\n\n        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition\n            eval `echo args$i`=`cygpath --path --ignore --mixed \"$arg\"`\n        else\n            eval `echo args$i`=\"\\\"$arg\\\"\"\n        fi\n        i=$((i+1))\n    done\n    case $i in\n        (0) set -- ;;\n        (1) set -- \"$args0\" ;;\n        (2) set -- \"$args0\" \"$args1\" ;;\n        (3) set -- \"$args0\" \"$args1\" \"$args2\" ;;\n        (4) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" ;;\n        (5) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" ;;\n        (6) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" ;;\n        (7) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" ;;\n        (8) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" ;;\n        (9) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" \"$args8\" ;;\n    esac\nfi\n\n# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules\nfunction splitJvmOpts() {\n    JVM_OPTS=(\"$@\")\n}\neval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS\nJVM_OPTS[${#JVM_OPTS[*]}]=\"-Dorg.gradle.appname=$APP_BASE_NAME\"\n\nexec \"$JAVACMD\" \"${JVM_OPTS[@]}\" -classpath \"$CLASSPATH\" org.gradle.wrapper.GradleWrapperMain \"$@\"\n"
  },
  {
    "path": "gradlew.bat",
    "content": "@if \"%DEBUG%\" == \"\" @echo off\r\n@rem ##########################################################################\r\n@rem\r\n@rem  Gradle startup script for Windows\r\n@rem\r\n@rem ##########################################################################\r\n\r\n@rem Set local scope for the variables with windows NT shell\r\nif \"%OS%\"==\"Windows_NT\" setlocal\r\n\r\n@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\r\nset DEFAULT_JVM_OPTS=\r\n\r\nset DIRNAME=%~dp0\r\nif \"%DIRNAME%\" == \"\" set DIRNAME=.\r\nset APP_BASE_NAME=%~n0\r\nset APP_HOME=%DIRNAME%\r\n\r\n@rem Find java.exe\r\nif defined JAVA_HOME goto findJavaFromJavaHome\r\n\r\nset JAVA_EXE=java.exe\r\n%JAVA_EXE% -version >NUL 2>&1\r\nif \"%ERRORLEVEL%\" == \"0\" goto init\r\n\r\necho.\r\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:findJavaFromJavaHome\r\nset JAVA_HOME=%JAVA_HOME:\"=%\r\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\r\n\r\nif exist \"%JAVA_EXE%\" goto init\r\n\r\necho.\r\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:init\r\n@rem Get command-line arguments, handling Windowz variants\r\n\r\nif not \"%OS%\" == \"Windows_NT\" goto win9xME_args\r\nif \"%@eval[2+2]\" == \"4\" goto 4NT_args\r\n\r\n:win9xME_args\r\n@rem Slurp the command line arguments.\r\nset CMD_LINE_ARGS=\r\nset _SKIP=2\r\n\r\n:win9xME_args_slurp\r\nif \"x%~1\" == \"x\" goto execute\r\n\r\nset CMD_LINE_ARGS=%*\r\ngoto execute\r\n\r\n:4NT_args\r\n@rem Get arguments from the 4NT Shell from JP Software\r\nset CMD_LINE_ARGS=%$\r\n\r\n:execute\r\n@rem Setup the command line\r\n\r\nset CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\r\n\r\n@rem Execute Gradle\r\n\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% \"-Dorg.gradle.appname=%APP_BASE_NAME%\" -classpath \"%CLASSPATH%\" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%\r\n\r\n:end\r\n@rem End local scope for the variables with windows NT shell\r\nif \"%ERRORLEVEL%\"==\"0\" goto mainEnd\r\n\r\n:fail\r\nrem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\r\nrem the _cmd.exe /c_ return code!\r\nif  not \"\" == \"%GRADLE_EXIT_CONSOLE%\" exit 1\r\nexit /b 1\r\n\r\n:mainEnd\r\nif \"%OS%\"==\"Windows_NT\" endlocal\r\n\r\n:omega\r\n"
  },
  {
    "path": "settings.gradle",
    "content": "/*\n * App Mount, mount/umount apps that you don't like on Android, without root.\n * Copyright (C) 2017 Matthew Lee\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program.  If not, see <http://www.gnu.org/licenses/>.\n */\n\ninclude ':app'\n"
  }
]