[
  {
    "path": ".gitignore",
    "content": "*.iml\n.gradle\n/local.properties\n/.idea\n.DS_Store\n/build\n/captures\n.externalNativeBuild\napp/release\n"
  },
  {
    "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    <one line to give the program's name and a brief idea of what it does.>\n    Copyright (C) <year>  <name of author>\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    <program>  Copyright (C) <year>  <name of author>\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": "# FileTransfer\n![](https://github.com/CPPAlien/FileTransfer/raw/master/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png)\n\nTransfer any files from PC to your phone easily.\n\nhttps://www.youtube.com/watch?v=NUNaORa1YzM\n\n[![](http://7xq276.com2.z0.glb.qiniucdn.com/google_play.png)](https://play.google.com/store/apps/details?id=me.pengtao.filetransfer)\n\n**If you are banned by GFW. You can watch the video or download apk by ways below:**\n\nVideo: https://v.qq.com/x/page/x0618rp8w9x.html\n\nAPK: http://d.6short.com/transfer\n\n### What Next\n1, Two-way transfer between PC and Phone. \n\n2, Support plain text send.\n\n### We Need you\nIf you have any ideas for this app, welcome to submit an issue. \n\nIf you want to add some features, welcome to pull request. \n\n## Thanks\nThe idea and some code of this app are from [WifiTransfer](https://github.com/baidusoso/WifiTransfer).\nThanks for [baidusoso](https://github.com/baidusoso).\n\n## LICENSE\n```\nCopyright (c) 2018 CPPAlien\n\nLicensed under the GNU GENERAL PUBLIC LICENSE, Version 3, 29 June 2007 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    https://github.com/CPPAlien/FileTransfer/blob/master/LICENSE\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n\n"
  },
  {
    "path": "app/.gitignore",
    "content": "/build\n"
  },
  {
    "path": "app/build.gradle",
    "content": "plugins {\n    id 'com.android.application'\n    id 'com.google.gms.google-services'\n    id 'com.google.firebase.crashlytics'\n}\ndef cmd = 'git rev-list --no-merges --count HEAD master'\ndef gitVersion = Integer.parseInt(cmd.execute().text.trim())\n\nandroid {\n    compileSdkVersion 33\n\n    defaultConfig {\n        minSdkVersion 19\n        targetSdkVersion 33\n        versionCode gitVersion\n        versionName \"1.4.0\"\n    }\n    compileOptions {\n        sourceCompatibility JavaVersion.VERSION_1_8\n        targetCompatibility JavaVersion.VERSION_1_8\n    }\n    dataBinding {\n        enabled = true\n    }\n    buildTypes {\n        release {\n            minifyEnabled false\n            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'\n        }\n    }\n}\n\ndependencies {\n    implementation fileTree(dir: 'libs', include: \"*.jar\")\n    implementation platform('com.google.firebase:firebase-bom:30.2.0')\n    implementation 'com.google.firebase:firebase-analytics'\n    implementation 'com.google.firebase:firebase-crashlytics'\n    implementation 'com.google.android.material:material:1.6.1'\n    implementation 'com.chauthai.swipereveallayout:swipe-reveal-layout:1.4.1'\n    implementation 'com.jakewharton:butterknife:10.2.3'\n    annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.3'\n    implementation 'com.github.bumptech.glide:glide:4.13.0'\n    annotationProcessor 'com.github.bumptech.glide:compiler:4.13.0'\n    implementation(\"com.hwangjr.rxbus:rxbus:1.0.5\") {\n        exclude group: 'com.jakewharton.timber', module: 'timber'\n    }\n    implementation \"com.koushikdutta.async:androidasync:3.1.0\"\n    implementation 'com.jakewharton.timber:timber:4.1.2'\n}\n"
  },
  {
    "path": "app/google-services.json",
    "content": "{\n  \"project_info\": {\n    \"project_number\": \"316341165060\",\n    \"project_id\": \"filetransfer-94133\",\n    \"storage_bucket\": \"filetransfer-94133.appspot.com\"\n  },\n  \"client\": [\n    {\n      \"client_info\": {\n        \"mobilesdk_app_id\": \"1:316341165060:android:2e482b94aa90d4cb39e951\",\n        \"android_client_info\": {\n          \"package_name\": \"me.pengtao.filetransfer\"\n        }\n      },\n      \"oauth_client\": [\n        {\n          \"client_id\": \"316341165060-a1m5kcjqdj9tsmttcjkvelb5dqnq2kaf.apps.googleusercontent.com\",\n          \"client_type\": 3\n        }\n      ],\n      \"api_key\": [\n        {\n          \"current_key\": \"AIzaSyAROoKJ20QLdInkc9fq0-uCSESAfGIVxRA\"\n        }\n      ],\n      \"services\": {\n        \"appinvite_service\": {\n          \"other_platform_oauth_client\": [\n            {\n              \"client_id\": \"316341165060-a1m5kcjqdj9tsmttcjkvelb5dqnq2kaf.apps.googleusercontent.com\",\n              \"client_type\": 3\n            }\n          ]\n        }\n      }\n    }\n  ],\n  \"configuration_version\": \"1\"\n}"
  },
  {
    "path": "app/proguard-rules.pro",
    "content": "# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in D:\\program\\AndroidSdk/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-keep public class * implements com.bumptech.glide.module.GlideModule\n-keep public class * extends com.bumptech.glide.module.AppGlideModule\n-keep public enum com.bumptech.glide.load.ImageHeaderParser$** {\n  **[] $VALUES;\n  public *;\n}\n\n-keep class com.growingio.android.sdk.** {\n    *;\n}\n-dontwarn com.growingio.android.sdk.**\n-keepnames class * extends android.view.View\n-keep class * extends android.app.Fragment {\n    public void setUserVisibleHint(boolean);\n    public void onHiddenChanged(boolean);\n    public void onResume();\n    public void onPause();\n}\n-keep class android.support.v4.app.Fragment {\n    public void setUserVisibleHint(boolean);\n    public void onHiddenChanged(boolean);\n    public void onResume();\n    public void onPause();\n}\n-keep class * extends android.support.v4.app.Fragment {\n    public void setUserVisibleHint(boolean);\n    public void onHiddenChanged(boolean);\n    public void onResume();\n    public void onPause();\n}"
  },
  {
    "path": "app/src/main/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest package=\"me.pengtao.filetransfer\"\n    xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n    <uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\" />\n    <uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\" />\n    <uses-permission android:name=\"android.permission.SYSTEM_ALERT_WINDOW\" />\n    <uses-permission android:name=\"android.permission.INTERNET\" />\n    <uses-permission android:name=\"android.permission.READ_EXTERNAL_STORAGE\" />\n    <uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\" />\n    <uses-permission android:name=\"android.permission.REQUEST_INSTALL_PACKAGES\" />\n\n    <application\n        android:name=\".TransferApp\"\n        android:allowBackup=\"true\"\n        android:icon=\"@mipmap/ic_launcher\"\n        android:label=\"@string/app_name\"\n        android:supportsRtl=\"true\"\n        android:requestLegacyExternalStorage=\"true\"\n        android:theme=\"@style/AppTheme\">\n        <activity\n            android:name=\".MainActivity\"\n            android:exported=\"true\"\n            android:label=\"@string/app_name\">\n            <intent-filter>\n                <data android:scheme=\"growing.1f3e3791e1d6aee5\" />\n                <action android:name=\"android.intent.action.VIEW\" />\n\n                <category android:name=\"android.intent.category.DEFAULT\" />\n                <category android:name=\"android.intent.category.BROWSABLE\" />\n            </intent-filter>\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        <service\n            android:name=\".WebService\"\n            android:enabled=\"true\" />\n        <receiver android:exported=\"true\" android:name=\".receiver.PackageStateReceiver\">\n            <intent-filter>\n                <category android:name=\"android.intent.category.DEFAULT\" />\n\n                <action android:name=\"android.intent.action.PACKAGE_ADDED\" />\n                <action android:name=\"android.intent.action.PACKAGE_CHANGED\" />\n                <action android:name=\"android.intent.action.PACKAGE_INSTALL\" />\n                <action android:name=\"android.intent.action.PACKAGE_REMOVED\" />\n                <action android:name=\"android.intent.action.PACKAGE_REPLACED\" />\n\n                <data android:scheme=\"package\" />\n            </intent-filter>\n        </receiver>\n        <provider\n            android:name=\"androidx.core.content.FileProvider\"\n            android:authorities=\"${applicationId}.fileprovider\"\n            android:exported=\"false\"\n            android:grantUriPermissions=\"true\">\n            <meta-data\n                android:name=\"android.support.FILE_PROVIDER_PATHS\"\n                android:resource=\"@xml/install_file\" />\n        </provider>\n    </application>\n</manifest>"
  },
  {
    "path": "app/src/main/assets/wifi/css/style.css",
    "content": "html { margin: 0px; padding: 0px; overflow: visible; }\nbody {  background-image: url('../images/bg1_01.jpg'); padding: 0px;margin: 0px; overflow: hidden; font-size: 14px; font-family:tahoma,  宋体, Arial, \"MS Trebuchet\", sans-serif;}/*background-image: url('../images/bg1_02.jpg');background-color: #376cab;*/\n#wrapper {  height: 768px; }\n#content { margin: 0px auto 0px auto; width:950px; height:768px; position: relative; }\n#left { margin: 0px 0px 0px 50px; }\n#logo { position: relative; height:417; }\n#logo .wifi { position:absolute;font-size:48px; line-height:48px; color:#ffffff; text-align:center; top:10px; }\n.hint { font-size: 12px; color: #FFF; width:243px; height:30px; text-align: center; line-height:15px; }\n#upload_form { position:absolute;left:50px;top:400px;  }\n.file_upload_warper { position: absolute; top:0px; left:0px; width:212px; height:92px; overflow: hidden; }\n.file_upload { cursor: pointer; position: absolute; top:0px; left:-250px; width:500px; height:500px;font-size: 500px; opacity: 0; -moz-opacity: 0; filter:alpha(opacity=0); }\n#copyright { margin-top: 170px; font-size: 14px; color: #FFF; width:243px; text-align: center; }\n#right_wrapper { background-image: url('../images/bg_files2.jpg'); background-repeat: repeat-y; width:559px; height:5000px;position: absolute;top: 0px; left:350px }\n#right { background-image: url('../images/bg_files.jpg'); background-repeat: no-repeat; height:100%; width:100%; }\n#right .content_title { margin-left:37px;width:483px; height:40px; background-color: #96abbe; background-image: url('../images/bg_title.jpg'); line-height:40px;text-indent: 10px; font-size:14px; color:#FFFFFF;border-bottom: 1px solid #87a2b8; }\n#right .content_title .drag_hint { padding-left:10px; font-size:12px; color:#FFCC00 }\n#right .table_header { margin-left:37px;width:483px; height:34px; background-image: url('../images/table_header_bg2.jpg'); border-bottom: 1px solid #bac8d2; }\n#right .table_header .separator { background-image: url('../images/table_header_bg.jpg'); background-repeat: no-repeat; }\n#right .table_header .column { text-indent: 10px; float: left; height:34px; line-height:34px; color:#607589; font-size:12px }\n#right .table_header .filename { width:313px; }\n#right .table_header .size { width:80px; }\n#right .table_header .operate { width:80px; text-align:center; }\n#right .files { background-image: url('../images/bg_file_list.jpg'); margin-left:37px; width:483px; overflow: auto;}\n#right .file { line-height:40px; height:40px; line-height:40px; color:#000; font-size:12px; position: relative; }\n#right .progress_wrapper { color:#FFF; background-image: url('../images/progress_bg.jpg'); background-repeat: repeat-x;}\n#right .progress { position: absolute; top:0px; left:0px; height: 40px; width: 0px;  background-image: url('../images/progress.jpg'); background-repeat: repeat-x; z-index: 1; }\n#right .files .even { background-color: #dadfe4; }\n#right .files .column { position:relative; text-indent: 10px; float: left; height:40px; overflow: hidden; z-index:2; }\n#right .files .filename { width:313px; }\n#right .files .size { width:80px; }\n#right .files .precent { width:44px; text-align:right;}\n#right .files .trash { margin-left: 0px; width:20px; height:40px; background-position: center; background-repeat: no-repeat; background-image: url('../images/trash.gif'); cursor: pointer; }\n#right .files .trash_white { margin-left: 0px; width:20px; height:40px; background-position: center; background-repeat: no-repeat; background-image: url('../images/trash_white.png'); cursor: pointer; }\n#right .files .download { margin-left: 0px; width:44px; height:40px; background-position: right; background-repeat: no-repeat; background-image: url('../images/download.gif'); cursor: pointer; }\n\n#drag_area { position:absolute;left:0;top:200px;width:180px; height:180px; margin-left:30px; background-image: url(\"../images/bg_drag.png\"); background-repeat:no-repeat; }\n#drag_area.normal { background-position: 0px 0px; }\n#drag_area.active { background-position: 0px -181px; }\n\n#upload_button { width:210px; height:90px; margin-left: 17px; background-image: url(\"../images/button_status.png\");background-repeat:no-repeat;  }\n#upload_button.normal   { background-position: 0px 0px; }\n#upload_button.pressed  { background-position: 0px -91px; }\n#upload_button.rollover { background-position: 0px -182px; }\n\n#drag_area .drag_hint { font-size:20px; text-shadow:0px 4px 4px rgba(0,0,0,0.4); color:#ffffff; text-align: center; padding-top:130px; -moz-user-select: none;-khtml-user-select: none; user-select: none; }\n.button_lables { position: absolute; top:26px; left:0px; width:212px; height:92px; }\n.button_lables .button_lable1 {font-size:18px; line-height:18px; color:#ffffff; text-align:center; -moz-user-select: none;-khtml-user-select: none; user-select: none;}\n.button_lables .button_lable2 {font-size:12px; line-height:16px; color:#ffffff; text-align:center; -moz-user-select: none;-khtml-user-select: none; user-select: none;}\n.button_lable { position: absolute; width:210px; height:90px; font-size:20px; line-height:80px; color:#ffffff; text-align:center;}"
  },
  {
    "path": "app/src/main/assets/wifi/index.html",
    "content": "<!DOCTYPE html>\n<head>\n    <meta http-equiv=\"Content-type\" content=\"text/html; charset=utf-8\">\n    <link rel=\"stylesheet\" href=\"css/style.css\" type=\"text/css\" charset=\"utf-8\">\n    <script src=\"scripts/jquery-3.5.1.min.js\" type=\"text/javascript\"></script>\n    <script>\n        var htmlObject =document.getElementsByTagName(\"html\")[0];\n        var script = document.createElement(\"script\");\n        script.async=\"async\"\n        if (navigator.language && navigator.language.startsWith('zh')) {\n            script.src=\"scripts/lang.zh-Hans.js\"\n        } else {\n            script.src=\"scripts/lang.en-US.js\"\n        }\n\n        htmlObject.appendChild(script);\n\n        var script1 = document.createElement(\"script\");\n        script1.async=\"async\"\n        script1.src=\"scripts/transfer.js\"\n\n        htmlObject.appendChild(script1);\n    </script>\n    <script src=\"scripts/ajaxfileupload.js\" type=\"text/javascript\"></script>\n    <script src=\"scripts/bitcandies.upload5.js\" type=\"text/javascript\"></script>\n</head>\n<body>\n<div id=\"wrapper\">\n    <div id=\"content\">\n        <div id=\"left\">\n            <div id=\"logo\">\n                <div class=\"wifi\">文件传输助手</div>\n            </div>\n            <div id=\"upload_hint\" class=\"hint\"></div>\n            <div id=\"upload_form\">\n                <div id=\"upload_button\" />\n                <div class=\"file_upload_warper\">\n                    <input type=\"file\" name=\"newfile\" value=\"\" id=\"newfile_0\" class=\"file_upload\" multiple=\"multiple\" />\n                </div>\n            </div>\n        </div>\n        <div id=\"right_wrapper\">\n            <div id=\"right\">\n                <div class=\"content_title\">您设备上的文件列表</div>\n                <div class=\"table_header\">\n                    <div class=\"filename column\">文件名</div>\n                    <div class=\"size column separator\">大小</div>\n                    <div class=\"operate column separator\">操作</div>\n                </div>\n                <div class=\"files\">\n                </div>\n            </div>\n        </div>\n    </div>\n</div>\n</body>\n</html>"
  },
  {
    "path": "app/src/main/assets/wifi/scripts/ajaxfileupload.js",
    "content": "\njQuery.extend({\n\t\n\n    createUploadIframe: function(id, uri)\n\t{\n\t\t\t//create frame\n            var frameId = 'jUploadFrame' + id;\n            var iframeHtml = '<iframe id=\"' + frameId + '\" name=\"' + frameId + '\" style=\"position:absolute; top:-9999px; left:-9999px\"';\n\t\t\tif(window.ActiveXObject)\n\t\t\t{\n                if(typeof uri== 'boolean'){\n\t\t\t\t\tiframeHtml += ' src=\"' + 'javascript:false' + '\"';\n\n                }\n                else if(typeof uri== 'string'){\n\t\t\t\t\tiframeHtml += ' src=\"' + uri + '\"';\n\n                }\t\n\t\t\t}\n\t\t\tiframeHtml += ' />';\n\t\t\tjQuery(iframeHtml).appendTo(document.body);\n\n            return jQuery('#' + frameId).get(0);\t\t\t\n    },\n    createUploadForm: function(id, fileElementId, data)\n\t{\n\t\t//create form\t\n\t\tvar formId = 'jUploadForm' + id;\n\t\tvar fileId = 'jUploadFile' + id;\n\t\tvar form = jQuery('<form  action=\"\" method=\"POST\" name=\"' + formId + '\" id=\"' + formId + '\" enctype=\"multipart/form-data\"></form>');\t\n\t\tif(data)\n\t\t{\n\t\t\tfor(var i in data)\n\t\t\t{\n\t\t\t\tjQuery('<input type=\"hidden\" name=\"' + i + '\" value=\"' + data[i] + '\" />').appendTo(form);\n\t\t\t}\t\t\t\n\t\t}\t\t\n\t\tvar oldElement = jQuery('#' + fileElementId);\n\t\tvar newElement = jQuery(oldElement).clone();\n\t\tjQuery(oldElement).attr('id', fileId);\n\t\tjQuery(oldElement).before(newElement);\n\t\tjQuery(oldElement).appendTo(form);\n\n\n\t\t\n\t\t//set attributes\n\t\tjQuery(form).css('position', 'absolute');\n\t\tjQuery(form).css('top', '-1200px');\n\t\tjQuery(form).css('left', '-1200px');\n\t\tjQuery(form).appendTo('body');\t\t\n\t\treturn form;\n    },\n\n    ajaxFileUpload: function(s) {\n        // TODO introduce global settings, allowing the client to modify them for all requests, not only timeout\t\t\n        s = jQuery.extend({}, jQuery.ajaxSettings, s);\n        var id = new Date().getTime()        \n\t\tvar form = jQuery.createUploadForm(id, s.fileElementId, (typeof(s.data)=='undefined'?false:s.data));\n\t\tvar io = jQuery.createUploadIframe(id, s.secureuri);\n\t\tvar frameId = 'jUploadFrame' + id;\n\t\tvar formId = 'jUploadForm' + id;\t\t\n        // Watch for a new set of requests\n        if ( s.global && ! jQuery.active++ )\n\t\t{\n\t\t\tjQuery.event.trigger( \"ajaxStart\" );\n\t\t}            \n        var requestDone = false;\n        // Create the request object\n        var xml = {}   \n        if ( s.global )\n            jQuery.event.trigger(\"ajaxSend\", [xml, s]);\n        // Wait for a response to come back\n        var uploadCallback = function(isTimeout)\n\t\t{\t\t\t\n\t\t\tvar io = document.getElementById(frameId);\n            try \n\t\t\t{\t\t\t\t\n\t\t\t\tif(io.contentWindow)\n\t\t\t\t{\n\t\t\t\t\t xml.responseText = io.contentWindow.document.body?io.contentWindow.document.body.innerHTML:null;\n                \t xml.responseXML = io.contentWindow.document.XMLDocument?io.contentWindow.document.XMLDocument:io.contentWindow.document;\n\t\t\t\t\t \n\t\t\t\t}else if(io.contentDocument)\n\t\t\t\t{\n\t\t\t\t\t xml.responseText = io.contentDocument.document.body?io.contentDocument.document.body.innerHTML:null;\n                \txml.responseXML = io.contentDocument.document.XMLDocument?io.contentDocument.document.XMLDocument:io.contentDocument.document;\n\t\t\t\t}\t\t\t\t\t\t\n            }catch(e)\n\t\t\t{\n\t\t\t\tjQuery.handleError(s, xml, null, e);\n\t\t\t}\n            if ( xml || isTimeout == \"timeout\") \n\t\t\t{\t\t\t\t\n                requestDone = true;\n                var status;\n                try {\n                    status = isTimeout != \"timeout\" ? \"success\" : \"error\";\n                    // Make sure that the request was successful or notmodified\n                    if ( status != \"error\" )\n\t\t\t\t\t{\n                        // process the data (runs the xml through httpData regardless of callback)\n                        var data = jQuery.uploadHttpData( xml, s.dataType );    \n                        // If a local callback was specified, fire it and pass it the data\n                        if ( s.success )\n                            s.success( data, status );\n    \n                        // Fire the global callback\n                        if( s.global )\n                            jQuery.event.trigger( \"ajaxSuccess\", [xml, s] );\n                    } else\n                        jQuery.handleError(s, xml, status);\n                } catch(e) \n\t\t\t\t{\n                    status = \"error\";\n                    jQuery.handleError(s, xml, status, e);\n                }\n\n                // The request was completed\n                if( s.global )\n                    jQuery.event.trigger( \"ajaxComplete\", [xml, s] );\n\n                // Handle the global AJAX counter\n                if ( s.global && ! --jQuery.active )\n                    jQuery.event.trigger( \"ajaxStop\" );\n\n                // Process result\n                if ( s.complete )\n                    s.complete(xml, status);\n\n                jQuery(io).unbind()\n\n                setTimeout(function()\n\t\t\t\t\t\t\t\t\t{\ttry \n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tjQuery(io).remove();\n\t\t\t\t\t\t\t\t\t\t\tjQuery(form).remove();\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t} catch(e) \n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tjQuery.handleError(s, xml, null, e);\n\t\t\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\t\t}, 100)\n\n                xml = null\n\n            }\n        }\n        // Timeout checker\n        if ( s.timeout > 0 ) \n\t\t{\n            setTimeout(function(){\n                // Check to see if the request is still happening\n                if( !requestDone ) uploadCallback( \"timeout\" );\n            }, s.timeout);\n        }\n        try \n\t\t{\n\n\t\t\tvar form = jQuery('#' + formId);\n\t\t\tjQuery(form).attr('action', s.url);\n\t\t\tjQuery(form).attr('method', 'POST');\n\t\t\tjQuery(form).attr('target', frameId);\n            if(form.encoding)\n\t\t\t{\n\t\t\t\tjQuery(form).attr('encoding', 'multipart/form-data');      \t\t\t\n            }\n            else\n\t\t\t{\t\n\t\t\t\tjQuery(form).attr('enctype', 'multipart/form-data');\t\t\t\n            }\t\t\t\n            jQuery(form).submit();\n\n        } catch(e) \n\t\t{\t\t\t\n            jQuery.handleError(s, xml, null, e);\n        }\n\t\t\n\t\tjQuery('#' + frameId).load(uploadCallback\t);\n        return {abort: function () {}};\t\n\n    },\n\n    uploadHttpData: function( r, type ) {\n        var data = !type;\n        data = type == \"xml\" || data ? r.responseXML : r.responseText;\n        // If the type is \"script\", eval it in global context\n        if ( type == \"script\" )\n            jQuery.globalEval( data );\n        // Get the JavaScript object, if JSON is used.\n        if ( type == \"json\" )\n            eval( \"data = \" + data );\n        // evaluate scripts within html\n        if ( type == \"html\" )\n            jQuery(\"<div>\").html(data).evalScripts();\n\n        return data;\n    }\n})\n\n"
  },
  {
    "path": "app/src/main/assets/wifi/scripts/bitcandies.upload5.js",
    "content": "/**\n* Upload5 0.1.0\n* (c) 2011 BitCandies\n* http://github.com/bitcandies/upload5\n*\n* Upload5 is a flexible HTML5/JavaScript library that handles multiple file uploads.\n*\n* Upload5 is freely distributable under the MIT license,\n* see LICENSE.\n*\n* http://www.bitcandies.com/\n*/\n\nvar bitcandies = bitcandies || {};\n\nbitcandies.defaults = function (dest, source) {\n    for (var i in source) {\n        if (typeof dest[i] == 'undefined') {\n            dest[i] = source[i];\n        }\n    }\n};\n\nbitcandies.FileUploader = function (options) {\n    var default_options = {\n        fieldname: 'file',\n        maxconnections: 2,\n        //maxfilesize: 1024,\n        method: 'POST',\n        default_params: {},\n        url: '',\n\n        enqueued: function (item) { },\n        aborted: function (item) { },\n        start: function (item, xhr) { },\n        progress: function (item, loaded, total, xhr) { },\n        success: function (item, xhr) { },\n        error: function (item, xhr) { },\n        complete: function (item, xhr) { }\n    };\n    this.options = options || {};\n    bitcandies.defaults(this.options, default_options);\n\n    this.queue = [];\n    this.running = [];\n    this.completed = [];\n\n    this._curid = 1;\n};\n\nbitcandies.FileUploader.Statuses = {\n    QUEUED: 'queued',\n    ABORTED: 'aborted',\n    UPLOADING: 'uploading',\n    COMPLETED: 'completed'\n};\n\nbitcandies.FileUploader.QueuedFile = function (uploader, file, params, id) {\n    if (!(file instanceof File)) {\n        throw new Error('Cannot add a non-File object to upload queue.');\n    }\n    this.uploader = uploader;\n    this.file = file;\n    this.params = params || {};\n    this.id = id;\n    this.status = bitcandies.FileUploader.Statuses.QUEUED;\n}\n\nbitcandies.FileUploader.QueuedFile.prototype = {\n    getFilename: function () {\n        return this.file.fileName ? this.file.fileName : this.file.name;\n    },\n\n    getSize: function () {\n        return this.file.fileSize ? this.file.fileSize : this.file.size;\n    },\n\n    getFile: function () {\n        return this.file;\n    },\n\n    getParams: function () {\n        return this.params;\n    },\n\n    getStatus: function () {\n        return this.status;\n    }\n};\n\nbitcandies.FileUploader.prototype = {\n    add: function (file, params) {\n        params = params || {};\n        bitcandies.defaults(params, this.options.default_params);\n        var item = new bitcandies.FileUploader.QueuedFile(this, file, params, this._curid);\n        this._curid++;\n        this.queue.push(item);\n        this.options.enqueued.call(this, item);\n        this.run();\n        return item;\n    },\n\n    abort: function (item) {\n        if (item.status !== bitcandies.FileUploader.Statuses.COMPLETED && item.status !== bitcandies.FileUploader.Statuses.ABORTED) {\n            for (var i = 0; i < this.queue.length; ++i) {\n                if (item.id === this.queue[i].id) {\n                    this.queue.splice(i, 1);\n                    item.status = bitcandies.FileUploader.Statuses.ABORTED;\n                    this.options.aborted.call(this, item);\n                    return;\n                }\n            }\n            for (var i = 0; i < this.running.length; ++i) {\n                if (item.id === this.running[i].id) {\n                    item.status = bitcandies.FileUploader.Statuses.ABORTED;\n                    item.xhr.abort();\n                    this.options.aborted.call(this, item);\n                    return;\n                }\n            }\n        }\n    },\n\n    doUpload: function (item) {\n        var self = this,\n            xhr = new XMLHttpRequest(),\n            formData = new FormData();\n\n        item.status = bitcandies.FileUploader.Statuses.UPLOADING;\n        item.xhr = xhr;\n\n        this.options.start.call(this, item, xhr);\n\n        xhr.onreadystatechange = function () {\n            if (xhr.readyState == 4) {\n                self.onComplete(item, xhr);\n            }\n        };\n\n        xhr.upload.onprogress = function (e) {\n            if (e.lengthComputable) {\n                self.options.progress.call(self, item, e.loaded, e.total, xhr);\n            }\n        };\n\n        xhr.open(this.options.method, this.options.url, true);\n\n        for (var key in item.params) {\n            formData.append(key, item.params[key]);\n        }\n        formData.append(\"fileName\",encodeURI(item.file.name));\n        formData.append(this.options.fieldname, item.file);\n\n        xhr.send(formData);\n    },\n\n    isRunning: function () {\n        return this.queue.length || this.running.length;\n    },\n\n    onComplete: function (item, xhr) {\n        if (item.status !== bitcandies.FileUploader.Statuses.ABORTED) {\n            item.status = bitcandies.FileUploader.Statuses.COMPLETED;\n            this.options.progress.call(this, item, item.getSize(), item.getSize(), xhr);\n            if (xhr.status == 200) {\n                this.options.success.call(this, item, xhr);\n            }\n            else {\n                this.options.error.call(this, item, xhr);\n            }\n            this.options.complete.call(this, item, xhr);\n        }\n        if (item.xhr) {\n            delete item.xhr;\n        }\n\n        for (var i in this.running) {\n            if (this.running[i].id === item.id) {\n                this.running.splice(i, 1);\n                break;\n            }\n        }\n        this.run();\n    },\n\n    run: function () {\n        if (this.queue.length > 0 && this.running.length < this.options.maxconnections) {\n            for (var i = 0; i < this.options.maxconnections - this.running.length; ++i) {\n                var item = this.queue.shift();\n                this.running.push(item);\n                this.doUpload(item);\n            }\n        }\n    }\n};\n"
  },
  {
    "path": "app/src/main/assets/wifi/scripts/lang.en-US.js",
    "content": "var STRINGS = {};\n\nSTRINGS.WIFI_TRANS_TITLE = 'File Transfer';\nSTRINGS.FILES_ON_DEVICE = 'File list';\nSTRINGS.FILENAME = 'Name';\nSTRINGS.FILE_SIZE = 'Size';\nSTRINGS.FILE_OPER = 'Action';\nSTRINGS.CONFIRM_DELETE_BOOK = 'Delete？';\nSTRINGS.DOWNLOAD_FILE = 'Download file';\nSTRINGS.DELETE_FILE = 'Delete file';\nSTRINGS.USE_ONE_BROWSER = 'Upload failed. Please do not upload on multiple browser same time.';\nSTRINGS.UPLOAD_FAILED = 'Upload failed. Reopen this page and try again';\nSTRINGS.UNSUPPORTED_FILE_TYPE = 'The file type is unsupported';\nSTRINGS.FILE_IN_QUEUE = 'File is uploading';\nSTRINGS.FILE_EXISTS = 'File is exist, please delete and try again';\nSTRINGS.YOU_CHOOSE = 'You chose';\nSTRINGS.CHOSEN_FILE_COUNT = 'file(s)，but limit';\nSTRINGS.VALID_CHOSEN_FILE_COUNT = 'file(s)。\\nPlease choose file，file name cannot be same';\nSTRINGS.CANCEL = 'Cancel';\nSTRINGS.SELECT_YOUR_FILES = 'Choose the files you want to upload';\nSTRINGS.SUPPORTED_FILE_TYPES = 'Support the type';\nSTRINGS.CANNOT_CONNECT_SERVER = 'Connect failed, refresh the page and try again.';\nSTRINGS.DRAG_TO_HERE = \"drag files here\";\nSTRINGS.SELECT_BUTTON_LABLE1 = \"Choose files\";\nSTRINGS.SELECT_BUTTON_LABLE2 = \"multiple files supported\";\nSTRINGS.SELECT_BUTTON_LABLE = \"Choose files\";\nSTRINGS.WIFI_AVAILABLE = \"WiFi is connected\";\n"
  },
  {
    "path": "app/src/main/assets/wifi/scripts/lang.zh-Hans.js",
    "content": "var STRINGS = {};\n\nSTRINGS.WIFI_TRANS_TITLE = '文件传输助手';\nSTRINGS.FILES_ON_DEVICE = '您设备上的文件列表';\nSTRINGS.FILENAME = '文件名';\nSTRINGS.FILE_SIZE = '大小';\nSTRINGS.FILE_OPER = '操作';\nSTRINGS.CONFIRM_DELETE_BOOK = '是否删除文件？';\nSTRINGS.DOWNLOAD_FILE = '下载文件';\nSTRINGS.DELETE_FILE = '删除文件';\nSTRINGS.USE_ONE_BROWSER = '无法上传文件，请勿使用多个浏览器窗口同时上传。';\nSTRINGS.UPLOAD_FAILED = '上传失败，请重新打开文件传输助手并刷新此页重新上传。';\nSTRINGS.UNSUPPORTED_FILE_TYPE = '请选择APK文件。';\nSTRINGS.FILE_IN_QUEUE = '文件已经在上传列队中。';\nSTRINGS.FILE_EXISTS = '文件已存在，请先删除再重新上传。';\nSTRINGS.YOU_CHOOSE = '您选择了';\nSTRINGS.CHOSEN_FILE_COUNT = '个文件，只能上传';\nSTRINGS.VALID_CHOSEN_FILE_COUNT = '个文件。\\n请选择文件，文件名不能重复。';\nSTRINGS.CANCEL = '取消';\nSTRINGS.SELECT_YOUR_FILES = '请选择您要上传到文件传输助手的文件';\nSTRINGS.SUPPORTED_FILE_TYPES = '支持APK';\nSTRINGS.CANNOT_CONNECT_SERVER = '无法连接到文件传输助手，请重新文件传输服务并刷新此页后重新上传。';\nSTRINGS.DRAG_TO_HERE = \"拖拽到此处上传\";\nSTRINGS.SELECT_BUTTON_LABLE1 = \"选择文件\";\nSTRINGS.SELECT_BUTTON_LABLE2 = \"可同时上传多个文件\";\nSTRINGS.SELECT_BUTTON_LABLE = \"选择文件\";\nSTRINGS.WIFI_AVAILABLE = \"WiFi连接已启用\";"
  },
  {
    "path": "app/src/main/assets/wifi/scripts/transfer.js",
    "content": "$(function() {\n\tvar isDragOver = false;\n\t\n\tvar files = [];\n\tvar currentFileName;\n\n\tvar uploadQueue = [];\n\tvar currentQueueIndex = 0;\n\tvar isUploading = false;\n\tvar getProgressReties = 0;\n\t\n\tvar html5Uploader = null;\n\tvar items = {};\n\t\n\tfunction initPageStrings() {\n\t\tdocument.title = STRINGS.WIFI_TRANS_TITLE;\n\t\t$('#logo .wifi').text(STRINGS.WIFI_TRANS_TITLE);\n\t\t$('.content_title').text(STRINGS.FILES_ON_DEVICE);\n\t\t$('.table_header .filename').text(STRINGS.FILENAME);\n\t\t$('.table_header .size').text(STRINGS.FILE_SIZE);\n\t\t$('.table_header .operate').text(STRINGS.FILE_OPER);\n\t}\n    \n\tfunction deleteBook(_event) {\n\t\tif (!confirm(STRINGS.CONFIRM_DELETE_BOOK)) {\n\t\t\treturn;\n\t\t}\n\t\tvar $node =  $(_event.currentTarget);\n\t\tvar fileName = $node.siblings(':first').text();\n\t\tvar deleteUrl = \"files/\" + encodeURI(fileName);\n\t\tvar fileInfoContainer = $node.parent();\n\t\tfileInfoContainer.css({ 'color':'#fff', 'background-color': '#cb4638' });\n\t\tfileInfoContainer.find('.trash').removeClass('trash').unbind();\n\t\tfileInfoContainer.find('.download').removeClass('download').unbind();\n\t\t$.post(deleteUrl, { '_method' : 'delete' }, function() {\n\t\t\tsetTimeout(function() { \n\t\t\t\tfileInfoContainer.slideUp('fast', function() {\n\t\t\t\t\tfileInfoContainer.remove();\n\t\t\t\t});\n\t\t\t}, 300);\n\t\t});\n\t}\n\t\n\tfunction downloadBook(_event) {\n\t\tvar $node =  $(_event.currentTarget);\n\t\tvar fileName = $node.siblings(':first').text();\n\t\tvar url = \"files/\" + fileName;\n\t\twindow.location = url;\n\t}\n\n\tfunction loadFileList() {\n\t\tvar now = new Date();\n\t\tvar url = \"files?\";\n\t\t$.getJSON(url + now.getTime(), function(data) {\n\t\t\tfiles = data;\n\t\t\tfillFilesContainer();\n\t\t\t//$(\".download\").click(downloadBook);\n\t\t\t//$(\".trash\").click(deleteBook);\n\t\t});\n\t}\n\n\tfunction fillFilesContainer() {\n\t\tvar height = $(window).height() - $(\"#right .content_title\").height() - $(\"#right .table_header\").height();\n\t\tvar filesContainer = $(\"#right .files\");\n\t\tfilesContainer.empty();\n\t\tfilesContainer.height(height);\n\t\tvar rowsCount = Math.floor(height / 40);\n\t\n\t\tfor (var i = 0; i < files.length;i ++) {\n\t\t\tvar row = $('<div class=\"file\"></div>');\n\t\t\tvar fileInfo = files[i];\n\t\t\trow.append('<div class=\"column filename\" filename=\"' + escape(fileInfo.name) + '\">' + fileInfo.name +'</div>');\n\t\t\trow.append('<div class=\"column size\">' + fileInfo.size + '</div>');\n\t\t\trow.append('<div class=\"column download\" title=\"'+STRINGS.DOWNLOAD_FILE+'\"></div>');\n\t\t\trow.append('<div class=\"column trash\" title=\"'+STRINGS.DELETE_FILE+'\"></div>');\n\t\t\tfilesContainer.append(row);\n\t\t}\n\t\n\t\treturn height;\n\t}\n\n\tfunction getUploadProgress() {\n\t\tvar time = new Date().getTime();\n\t\tvar url = 'progress/' + encodeURI(currentFileName) + '?' + time;\n\t\t$.getJSON(url, function(data) {\n\t\t\tif (!data) {\n\t\t\t\tgetProgressReties ++\n\t\t\t\tif (getProgressReties < 5) {\n\t\t\t\t\tsetTimeout(getUploadProgress, 500);\n\t\t\t\t\treturn;\n\t\t\t\t} else {\n\t\t\t\t\talert(STRINGS.USE_ONE_BROWSER);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tgetProgressReties = 0;\n\t\t\tvar ele = $(\"#right .file [filename='\" + escape(data.fileName) + \"']\")\n\t\t\tvar eleSize = ele.next()\n\t\t\teleSize.text(data.size);\n\t\t\tvar elePrecent = eleSize.next()\n\t\t\telePrecent.text(Math.round(data.progress * 100) + \"%\");\n\t\t\tvar eleProgress = ele.prev();\n\t\t\teleProgress.animate({ width:Math.round(483 * data.progress) }, 280);\n\t\t\n\t\t\tif (data.progress < 1) {\n\t\t\t\tsetTimeout(getUploadProgress, 300);\n\t\t\t} else {\n\t\t\t\telePrecent.text('');\n\t\t\t}\n\t\t});\n\t}\n\n\tfunction startAjaxUpload() {\n\t\tif (isUploading || currentQueueIndex >= uploadQueue.length) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tisUploading = true;\n\t\tvar eleFile = $(uploadQueue[currentQueueIndex]);\n\t\tvar eleFileId = eleFile.attr('id');\n\t\tvar fileName = eleFile.val();\n\t\tvar arr = fileName.split(\"\\\\\");\n\t\tfileName = arr[arr.length - 1];\n\t\t\n\t\tcurrentQueueIndex ++;\n\t\t\n\t\tvar row = $(\"#right .file [filename='\" + escape(fileName) + \"']\").parent();\n\t\t$.ajaxFileUpload({\n\t\t\turl:'files',\n\t\t\tdata:{\"fileName\":encodeURI(fileName)},\n\t\t\tsecureuri:false,\n\t\t\tfileElementId:eleFileId,\n\t\t\tdataType: 'text',\n\t\t\tsuccess: function (data, status) {\n\t\t\t\trow.removeClass('progress_wrapper');\n\t\t\t\trow.find('.progress').remove();\n\t\t\t\trow.find('.precent').text('').remove();\n\t\t\t\t$('<div class=\"column download\" title=\"'+STRINGS.DOWNLOAD_FILE+'\"></div>')\n\t\t\t\t\t//.click(downloadBook)\n\t\t\t\t\t.appendTo(row);\n\t\t\t\t$('<div class=\"column trash\" title=\"'+STRINGS.DELETE_FILE+'\"></div>')\n\t\t\t\t\t//.click(deleteBook)\n\t\t\t\t\t.appendTo(row);\n\t\t\t\tisUploading = false;\n\t\t\t\t\n\t\t\t\t//IE的诡异情况\n\t\t\t\trow.find('.download').text('');\n\t\t\t\tstartAjaxUpload();\n\t\t\t},\n\t\t\terror: function (data, status, e) {\n\t\t\t\tisUploading = false;\n\t\t\t\talert(STRINGS.UPLOAD_FAILED);\n\t\t\t\trow.remove();\n\t\t\t\tstartAjaxUpload();\n\t\t\t}\n\t\t});\n\t\n\t\tcurrentFileName = fileName;\n\t\tsetTimeout(getUploadProgress, 300);\n\t}\n\t\n\tfunction checkFileName(fileName) {\n\t\tif (!fileName || !fileName.toLowerCase().match('(apk)$')) {\n\t\t\t//return STRINGS.UNSUPPORTED_FILE_TYPE;\n\t\t}\n\t\t\n\t\tvar arr = fileName.split(\"\\\\\");\n\t\tfileName = arr[arr.length - 1];\n\t\t\n\t\tvar hasFile = false;\n\t\tvar existFile = $(\"#right .file [filename='\" + escape(fileName) + \"']\");\n\t\tif (existFile.length > 0) {\n            $(this).val(\"\");\n\t\t\tif (existFile.parent().hasClass('progress_wrapper')) {\n\t\t\t\treturn STRINGS.FILE_IN_QUEUE;\n\t\t\t} else {\n\t\t\t\treturn STRINGS.FILE_EXISTS;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\t\n\tfunction uploadFiles(files) {\n\t\tvar uploader = getHtml5Uploader();\n\t\tif (files.length == 1) {\n\t\t\tvar msg = checkFileName(files[0].name || files[0].fileName);\n\t\t\tif (msg) {\n\t\t\t\talert(msg);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tuploader.add(files[0]);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tvar totalFiles = files.length;\n\t\tvar actualFiles = 0;\n        for (var i = 0; i < files.length; ++i) {\n\t\t\tif (!checkFileName(files[i].name || files[i].fileName)) {\n\t\t\t\tuploader.add(files[i]);\n\t\t\t\tactualFiles ++;\n\t\t\t}\n        }\n\t\tif (totalFiles != actualFiles) {\n\t\t\tvar msg = STRINGS.YOU_CHOOSE + totalFiles + STRINGS.CHOSEN_FILE_COUNT + actualFiles + STRINGS.VALID_CHOSEN_FILE_COUNT;\n\t\t\talert(msg);\n\t\t}\n\t}\n\n\tfunction bindAjaxUpload(fileSelector) {\n\t\t$(fileSelector).unbind();\n\t\t$(fileSelector).change(function() {\n\t\t\tif (this.files) {\n\t\t\t\tuploadFiles(this.files);\n\t\t\t\t//优先使用HTML5上传方式\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar fileName = $(this).val();\n\t\t\t//alert(fileName);\n            \n\t\t\tvar msg = checkFileName(fileName);\n\t\t\tif (msg) {\n\t\t\t\talert(msg);\n\t\t\t\treturn;\n\t\t\t}\n                               \n            var arr = fileName.split(\"\\\\\");\n            fileName = arr[arr.length - 1];\n\t\t\n\t\t\tvar row = $('<div class=\"file progress_wrapper\"></div>');\n\t\t\trow.append('<div class=\"progress\"></div>');\n\t\t\trow.append('<div class=\"column filename\" filename=\"' + escape(fileName) + '\">' + fileName +'</div>');\n\t\t\trow.append('<div class=\"column size\"> - </div>');\n\t\t\trow.append('<div class=\"column precent\">0%</div>');\n\t\t\t$(\"#right .files\").prepend(row);\n\t\t\t\n\t\t\tuploadQueue.push(fileSelector);\n\t\t\t$(fileSelector).css({ top: '-9999px', left: '-9999px' });\n\t\t\t$('.file_upload_warper').append('<input type=\"file\" name=\"newfile\" value=\"\" id=\"newfile_' + uploadQueue.length + '\" class=\"file_upload\" />');\n\t\t\tbindAjaxUpload('#newfile_' + uploadQueue.length);\n\t\t\tstartAjaxUpload();\n\t\t});\n\t\t\n\t\tif (typeof(Worker) !== \"undefined\") {\n\t\t\t$(fileSelector)\n\t\t\t\t.mouseover(function() { $('#upload_button').removeClass('normal').addClass('pressed'); })\n\t\t\t\t.mouseout(function() { $('#upload_button').removeClass('pressed').addClass('normal'); })\n\t\t\t\t.mousedown(function() { $('#upload_button').removeClass('normal').addClass('pressed'); })\n\t\t\t\t.mouseup(function() { $('#upload_button').removeClass('pressed').addClass('normal'); });\n\t\t} else {\n\t\t\t$(fileSelector)\n\t\t\t\t.mouseover(function() { $('#upload_button').css('background-image', 'url(\"images/select_file1_rollover.jpg\")'); })\n\t\t\t\t.mouseout(function() { $('#upload_button').css('background-image', 'url(\"images/select_file1.jpg\")'); })\n\t\t\t\t.mousedown(function() { $('#upload_button').css('background-image', 'url(\"images/select_file1_pressed.jpg\")'); })\n\t\t\t\t.mouseup(function() { $('#upload_button').css('background-image', 'url(\"images/select_file1.jpg\")'); });\n\t\t}\n\t}\n\t\n\tfunction formatFileSize(value) {\n\t    var multiplyFactor = 0;\n\t    var tokens = [\"bytes\",\"KB\",\"MB\",\"GB\",\"TB\"];\n    \n\t    while (value > 1024) {\n\t        value /= 1024;\n\t        multiplyFactor++;\n\t    }\n    \n\t    return value.toFixed(1) + \" \" + tokens[multiplyFactor];\n\t}\n    \n    function cancelUpload() {\n        var uploader = getHtml5Uploader();\n        var fileName = $(this).parent().find('.filename').attr('filename');\n        if (fileName) {\n            item = items[fileName];\n            if (item) {\n                uploader.abort(item);\n            }\n        }\n    }\n\t\n\tfunction getHtml5Uploader() {\n\t\tif (!html5Uploader) {\n\t\t\thtml5Uploader = new bitcandies.FileUploader({\n\t\t\t\turl: 'files',\n\t\t\t\tmaxconnections: 1,\n\t\t\t\tfieldname: 'newfile',\n                enqueued: function (item) {\n\t\t\t\t\tvar fileName = item.getFilename();\n                    items[escape(fileName)] = item;\n\t\t\t\t\tvar size = item.getSize();\n\t\t\t\t\tvar row = $('<div class=\"file progress_wrapper\"></div>');\n\t\t\t\t\trow.append('<div class=\"progress\"></div>');\n\t\t\t\t\trow.append('<div class=\"column filename\" filename=\"' + escape(fileName) + '\">' + fileName +'</div>');\n\t\t\t\t\trow.append('<div class=\"column size\">' + formatFileSize(size) +'</div>');\n\t\t\t\t\trow.append('<div class=\"column precent\">0%</div>');\n                    $('<div class=\"column trash_white\" title=\"'+STRINGS.CANCEL+'\"></div>')\n                        .click(cancelUpload)\n                        .appendTo(row);\n\t\t\t\t\t$(\"#right .files\").prepend(row);\n                },\n                progress: function (item, loaded, total) {\n\t\t\t\t\tvar fileName = item.getFilename();\n\t\t\t\t\tvar progress = loaded / total;\n\t\t\t\t\t\n\t\t\t\t\tvar ele = $(\"#right .file [filename='\" + escape(fileName) + \"']\")\n\t\t\t\t\tvar elePrecent = ele.next().next();\n\t\t\t\t\telePrecent.text(Math.round(progress * 100) + \"%\");\n\t\t\t\t\tvar eleProgress = ele.prev();\n\t\t\t\t\teleProgress.width(483 * progress);\n                },\n                success: function (item) {\n\t\t\t\t\tvar fileName = item.getFilename();\n\t\t\t\t\tvar row = $(\"#right .file [filename='\" + escape(fileName) + \"']\").parent();\n\t\t\t\t\t\n\t\t\t\t\trow.removeClass('progress_wrapper');\n\t\t\t\t\trow.find('.progress').remove();\n\t\t\t\t\trow.find('.precent').text('').remove();\n                    row.find('.trash_white').remove();\n\t\t\t\t\t$('<div class=\"column download\" title=\"'+STRINGS.DOWNLOAD_FILE+'\"></div>')\n\t\t\t\t\t\t//.click(downloadBook)\n\t\t\t\t\t\t.appendTo(row);\n\t\t\t\t\t$('<div class=\"column trash\" title=\"'+STRINGS.DELETE_FILE+'\"></div>')\n\t\t\t\t\t\t//.click(deleteBook)\n\t\t\t\t\t\t.appendTo(row);\n                },\n                error: function (item) {\n\t\t\t\t\tvar fileName = item.getFilename();\n\t\t\t\t\tvar row = $(\"#right .file [filename='\" + escape(fileName) + \"']\").parent();\n\t\t\t\t\trow.remove();\n                },\n                aborted: function (item) {\n                    var fileName = item.getFilename();\n\t\t\t\t\tvar row = $(\"#right .file [filename='\" + escape(fileName) + \"']\").parent();\n\t\t\t\t\trow.remove();\n                }\n\t\t\t});\n\t\t}\n\t\treturn html5Uploader;\n\t}\n\t\n    function handleDragOver(evt) {\n        evt.stopPropagation();\n        evt.preventDefault();\n\t\tif (!isDragOver) {\n            $(this).removeClass('normal').addClass('active');\n\t\t\tisDragOver = true;\n\t\t}\n    }\n\t\n    function handleDragLeave(evt) {\n        evt.stopPropagation();\n        evt.preventDefault();\n\t\t\n\t\t$(this).removeClass('active').addClass('normal');\n\t\tisDragOver = false;\n    }\n\t\n    function handleDrop(evt) {\n        evt.stopPropagation();\n        evt.preventDefault();\n\t\tvar uploader = getHtml5Uploader();\n\t\t\n\t\t$(this).removeClass('active').addClass('normal');\n\t\tisDragOver = false;\n\t\t\n\t\tif (evt.dataTransfer && evt.dataTransfer.files) {\n\t\t\tuploadFiles(evt.dataTransfer.files);\n\t\t}\n    }\n\t\n\tfunction dragUpload() {\n        var dropArea = document.getElementById('drag_area');\n\t\tif (dropArea && dropArea.addEventListener) {\n\t        dropArea.addEventListener('dragover', handleDragOver, false);\n\t\t\tdropArea.addEventListener('dragleave', handleDragLeave, false);\n\t        dropArea.addEventListener('drop', handleDrop, false);\n\t\t}\n\t}\n\t\n\tfunction showHtml5View() {\n\t\tvar dragAree = $('<div id=\"drag_area\"><div class=\"drag_hint\">' + STRINGS.DRAG_TO_HERE + '</div></div)').addClass('normal').appendTo('#logo');\n        $('#upload_hint').empty();\n\t\t$('<div>'+STRINGS.SELECT_YOUR_FILES+'</div>')\n\t\t\t.addClass('hint')\n\t\t\t.insertAfter('#upload_button');\n            \n        var buttonLabels = $('<div class=\"button_lables\"></div>').prependTo(\"#upload_button\")\n        $('<div class=\"button_lable1\"></div>').text(STRINGS.SELECT_BUTTON_LABLE1).appendTo(buttonLabels);\n        $('<div class=\"button_lable2\"></div>').text(STRINGS.SELECT_BUTTON_LABLE2).appendTo(buttonLabels);\n        \n\t\tdragUpload();\n\t}\n\t\n\tfunction showHtml4View() {\n        $('#upload_button').css('background-image', 'url(\"images/select_file1_rollover.jpg\")');\n\t\t$('#upload_hint').html(STRINGS.SELECT_YOUR_FILES);\n        $('<div class=\"button_lable\">' + STRINGS.SELECT_BUTTON_LABLE + '</div>').prependTo(\"#upload_button\")\n\t}\n\n\t$(document).ready(function() {\n\t\t// events delegate\n\t\t$('.files').on('click', '.trash', deleteBook);\n\t\t$('.files').on('click', '.download', downloadBook);\n\t\t\n\t\tinitPageStrings();\n\t\tfillFilesContainer();\n\t\tloadFileList();\n\t\t$(window).resize(function() {\n\t\t\tfillFilesContainer();\n\t\t});\n\t\tbindAjaxUpload('#newfile_0');\n\t\t\n\t\tif (typeof(Worker) !== \"undefined\") {\n\t\t\tshowHtml5View();\n\t\t} else {\n\t\t\tshowHtml4View();\n\t\t}\n\t\t\n\t\t$(document).ajaxError(function(event, request, settings){\n\t\t\talert(STRINGS.CANNOT_CONNECT_SERVER);\n\t\t\t$('.progress_wrapper, .progress').css( { 'background':'#f00' });\n\t\t});\n\t});\n});"
  },
  {
    "path": "app/src/main/java/me/pengtao/filetransfer/Constants.java",
    "content": "package me.pengtao.filetransfer;\n\nimport android.os.Environment;\n\nimport java.io.File;\n\npublic class Constants {\n    public static final int HTTP_PORT = 12345;\n    public static final String DIR_IN_SDCARD = \"FileTransfer\";\n    public static final int MSG_DIALOG_DISMISS = 0;\n    public static final File DIR = new File(Environment.getExternalStorageDirectory() + File\n            .separator + Constants.DIR_IN_SDCARD);\n\n    public static final class RxBusEventType {\n        public static final String POPUP_MENU_DIALOG_SHOW_DISMISS = \"POPUP MENU DIALOG SHOW \" +\n                \"DISMISS\";\n        public static final String WIFI_CONNECT_CHANGE_EVENT = \"WIFI CONNECT CHANGE EVENT\";\n        public static final String LOAD_BOOK_LIST = \"LOAD BOOK LIST\";\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/me/pengtao/filetransfer/FileListAdapter.java",
    "content": "/*\n * Copyright (c) 2018 CPPAlien\n *\n * Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3, 29 June 2007 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     https://github.com/CPPAlien/FileTransfer/blob/master/LICENSE\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage me.pengtao.filetransfer;\n\nimport android.content.Context;\nimport android.content.Intent;\nimport android.net.Uri;\nimport android.view.LayoutInflater;\nimport android.view.View;\nimport android.view.ViewGroup;\n\nimport androidx.annotation.NonNull;\nimport androidx.databinding.DataBindingUtil;\nimport androidx.recyclerview.widget.RecyclerView;\n\nimport com.bumptech.glide.Glide;\nimport com.chauthai.swipereveallayout.ViewBinderHelper;\nimport com.hwangjr.rxbus.RxBus;\n\nimport java.io.File;\nimport java.util.List;\n\nimport me.pengtao.filetransfer.databinding.LayoutFileItemBinding;\nimport me.pengtao.filetransfer.util.FileType;\nimport me.pengtao.filetransfer.util.FileUtils;\n\n/**\n * @author CPPAlien\n */\nclass FileListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {\n    private Context mContext;\n    private List<FileModel> mFileModelList;\n    private final ViewBinderHelper viewBinderHelper = new ViewBinderHelper();\n\n    public FileListAdapter(Context context, List<FileModel> fileModelList) {\n        mContext = context;\n        mFileModelList = fileModelList;\n        viewBinderHelper.setOpenOnlyOne(true);\n    }\n\n    @Override\n    public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {\n        LayoutInflater inflater = LayoutInflater.from(parent.getContext());\n        if (viewType == 1) {\n            View view = inflater.inflate(R.layout.empty_view, parent, false);\n            return new EmptyViewHolder(view);\n        } else {\n            return new MyViewHolder(LayoutInflater.from(\n                    mContext).inflate(R.layout.layout_file_item, parent,\n                    false));\n        }\n    }\n\n    @Override\n    public void onBindViewHolder(@NonNull final RecyclerView.ViewHolder holder, int position) {\n        if (holder instanceof MyViewHolder) {\n            ((MyViewHolder) holder).onBindViewHolder(position);\n        }\n    }\n\n    class EmptyViewHolder extends RecyclerView.ViewHolder {\n        public EmptyViewHolder(View itemView) {\n            super(itemView);\n        }\n    }\n\n    @Override\n    public int getItemCount() {\n        return mFileModelList.size() > 0 ? mFileModelList.size() : 1;\n    }\n\n    class MyViewHolder extends RecyclerView.ViewHolder {\n        LayoutFileItemBinding mBinding;\n\n        public MyViewHolder(View view) {\n            super(view);\n            mBinding = DataBindingUtil.bind(view);\n        }\n\n        public void onBindViewHolder(int position) {\n            FileModel infoModel = mFileModelList.get(position);\n            if (infoModel.getFileType() == FileType.TYPE_APK) {\n                mBinding.tvName.setText(mContext.getString(R.string.app_name_format,\n                        infoModel.getName(), infoModel.getVersion()));\n                mBinding.tvDelete.setVisibility(infoModel.isInstalled() ? View.VISIBLE : View.GONE);\n                mBinding.tvDelete.setOnClickListener(v ->\n                        delete(mContext, infoModel.getPackageName()));\n            } else {\n                mBinding.tvDelete.setVisibility(View.GONE);\n                mBinding.tvName.setText(infoModel.getName());\n            }\n            viewBinderHelper.bind(mBinding.swipeRevealLayout, infoModel.getPath());\n\n            mBinding.tvSize.setText(infoModel.getSize());\n            mBinding.tvPath.setText(infoModel.getPath());\n            if (infoModel.getFileType() == FileType.TYPE_IMAGE) {\n                Glide.with(mContext).load(new File(infoModel.getPath())).into(mBinding.ivIcon);\n            } else {\n                mBinding.ivIcon.setImageDrawable(infoModel.getIcon());\n            }\n\n            mBinding.mainLayout.setOnClickListener(v ->\n                    FileUtils.openFile(infoModel.getPath(), mContext));\n\n            mBinding.delete.setOnClickListener(view -> {\n                File file = new File(infoModel.getPath());\n                if (file.exists() && file.isFile() && file.delete()) {\n                    RxBus.get().post(Constants.RxBusEventType.LOAD_BOOK_LIST, 0);\n                }\n            });\n            mBinding.share.setOnClickListener(view -> share(mContext, infoModel.getPath()));\n            mBinding.executePendingBindings();\n        }\n    }\n\n    @Override\n    public int getItemViewType(int position) {\n        if (mFileModelList.size() == 0) {\n            return 1;\n        }\n        return super.getItemViewType(position);\n    }\n\n    private void delete(Context context, String packageName) {\n        Uri uri = Uri.fromParts(\"package\", packageName, null);\n        Intent intent = new Intent(Intent.ACTION_DELETE, uri);\n        context.startActivity(intent);\n    }\n\n    private void share(Context context, String filePath) {\n        Intent shareIntent = new Intent();\n        shareIntent.setAction(Intent.ACTION_SEND);\n        shareIntent.putExtra(Intent.EXTRA_STREAM, FileUtils.getFileUri(context, filePath));\n        shareIntent.setType(FileUtils.getShareType(filePath));\n        context.startActivity(Intent.createChooser(shareIntent, \"\"));\n    }\n}"
  },
  {
    "path": "app/src/main/java/me/pengtao/filetransfer/FileModel.java",
    "content": "/*\n * Copyright (c) 2018 CPPAlien\n *\n * Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3, 29 June 2007 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     https://github.com/CPPAlien/FileTransfer/blob/master/LICENSE\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage me.pengtao.filetransfer;\n\nimport android.graphics.drawable.Drawable;\n\n/**\n * @author CPPAlien\n */\npublic class FileModel {\n    private String path;\n    private String version;\n    private String size;\n    private String name;\n    private String packageName;\n    private int fileType;\n    private boolean installed;\n    private Drawable icon;\n\n    public Drawable getIcon() {\n        return icon;\n    }\n\n    public void setIcon(Drawable icon) {\n        this.icon = icon;\n    }\n\n    public String getPath() {\n        return path;\n    }\n\n    public void setPath(String path) {\n        this.path = path;\n    }\n\n    public String getVersion() {\n        return version;\n    }\n\n    public void setVersion(String version) {\n        this.version = version;\n    }\n\n    public String getSize() {\n        return size;\n    }\n\n    public void setSize(String size) {\n        this.size = size;\n    }\n\n    public String getName() {\n        return name;\n    }\n\n    public void setName(String name) {\n        this.name = name;\n    }\n\n    public String getPackageName() {\n        return packageName;\n    }\n\n    public void setPackageName(String packageName) {\n        this.packageName = packageName;\n    }\n\n    public boolean isInstalled() {\n        return installed;\n    }\n\n    public void setInstalled(boolean installed) {\n        this.installed = installed;\n    }\n\n    public int getFileType() {\n        return fileType;\n    }\n\n    public FileModel setFileType(final int fileType) {\n        this.fileType = fileType;\n        return this;\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/me/pengtao/filetransfer/MainActivity.java",
    "content": "package me.pengtao.filetransfer;\n\nimport android.Manifest;\nimport android.animation.Animator;\nimport android.animation.ObjectAnimator;\nimport android.app.Activity;\nimport android.content.ContentResolver;\nimport android.content.Context;\nimport android.content.Intent;\nimport android.content.pm.ApplicationInfo;\nimport android.content.pm.PackageInfo;\nimport android.content.pm.PackageManager;\nimport android.content.res.Resources;\nimport android.graphics.drawable.Drawable;\nimport android.net.Uri;\nimport android.os.Build;\nimport android.os.Bundle;\nimport android.provider.Settings;\nimport android.text.TextUtils;\nimport android.util.DisplayMetrics;\nimport android.view.Menu;\nimport android.view.View;\nimport android.view.animation.AccelerateInterpolator;\nimport android.widget.Toast;\n\nimport androidx.appcompat.app.AlertDialog;\nimport androidx.appcompat.app.AppCompatActivity;\nimport androidx.appcompat.widget.Toolbar;\nimport androidx.core.app.ActivityCompat;\nimport androidx.core.content.ContextCompat;\nimport androidx.recyclerview.widget.LinearLayoutManager;\nimport androidx.recyclerview.widget.RecyclerView;\nimport androidx.swiperefreshlayout.widget.SwipeRefreshLayout;\n\nimport com.google.android.material.floatingactionbutton.FloatingActionButton;\nimport com.hwangjr.rxbus.RxBus;\nimport com.hwangjr.rxbus.annotation.Subscribe;\nimport com.hwangjr.rxbus.annotation.Tag;\nimport com.hwangjr.rxbus.thread.EventThread;\n\nimport java.io.File;\nimport java.io.IOException;\nimport java.text.DecimalFormat;\nimport java.util.ArrayList;\nimport java.util.List;\n\nimport butterknife.BindView;\nimport butterknife.ButterKnife;\nimport butterknife.OnClick;\nimport butterknife.Unbinder;\nimport me.pengtao.filetransfer.util.FileType;\nimport me.pengtao.filetransfer.util.FileUtils;\nimport timber.log.Timber;\n\n/**\n * @author chris\n */\npublic class MainActivity extends AppCompatActivity implements Animator.AnimatorListener {\n    private static final int WRITE_PERMISSION_CODE = 1;\n    private static final int FILE_FETCH_CODE = 2;\n    private String mAlreadyWrited = \"\";\n    Unbinder mUnbinder;\n    @BindView(R.id.toolbar)\n    Toolbar mToolbar;\n    @BindView(R.id.fab)\n    FloatingActionButton mFab;\n    @BindView(R.id.recyclerview)\n    RecyclerView mAppList;\n    @BindView(R.id.content_main)\n    SwipeRefreshLayout mSwipeRefreshLayout;\n    List<FileModel> mFileModelList = new ArrayList<>();\n    FileListAdapter mAppshelfAdapter;\n\n    public synchronized static Drawable getIconFromPackageName(String packageName, Context\n            context) {\n        PackageManager pm = context.getPackageManager();\n        try {\n            PackageInfo pi = pm.getPackageInfo(packageName, 0);\n            Context otherAppCtx = context.createPackageContext(packageName, Context\n                    .CONTEXT_IGNORE_SECURITY);\n            List<Integer> displayMetrics = new ArrayList<>();\n            displayMetrics.add(DisplayMetrics.DENSITY_XXXHIGH);\n            displayMetrics.add(DisplayMetrics.DENSITY_XXHIGH);\n            displayMetrics.add(DisplayMetrics.DENSITY_XHIGH);\n            displayMetrics.add(DisplayMetrics.DENSITY_HIGH);\n            displayMetrics.add(DisplayMetrics.DENSITY_TV);\n            for (int displayMetric : displayMetrics) {\n                try {\n                    Drawable d = otherAppCtx.getResources().getDrawableForDensity(pi\n                            .applicationInfo.icon, displayMetric);\n                    if (d != null) {\n                        return d;\n                    }\n                } catch (Resources.NotFoundException e) {\n                    // ignore\n                }\n            }\n        } catch (Exception e) {\n            // Handle Error here\n        }\n        ApplicationInfo appInfo;\n        try {\n            appInfo = pm.getApplicationInfo(packageName, 0);\n        } catch (PackageManager.NameNotFoundException e) {\n            return null;\n        }\n        return appInfo.loadIcon(pm);\n    }\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_main);\n        mUnbinder = ButterKnife.bind(this);\n        setSupportActionBar(mToolbar);\n\n        mToolbar.setOnMenuItemClickListener(item -> {\n            switch (item.getItemId()) {\n                case R.id.delete_all:\n                    if (!mFileModelList.isEmpty()) {\n                        showDialog();\n                    }\n                    break;\n                case R.id.add_files:\n                    Intent intent = new Intent();\n                    intent.setAction(Intent.ACTION_GET_CONTENT);\n                    intent.setType(\"*/*\");\n                    intent.addCategory(Intent.CATEGORY_OPENABLE);\n                    startActivityForResult(intent, FILE_FETCH_CODE);\n                    break;\n                default:\n                    break;\n            }\n            return false;\n        });\n        Timber.plant(new Timber.DebugTree());\n        RxBus.get().register(this);\n        initRecyclerView();\n        ActivityCompat.requestPermissions(this,\n                new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, WRITE_PERMISSION_CODE);\n    }\n\n    @Override\n    protected void onResume() {\n        super.onResume();\n        /*ClipboardManager clipboard = (ClipboardManager)getSystemService(Context.CLIPBOARD_SERVICE);\n        if (clipboard != null && clipboard.hasPrimaryClip() && clipboard.getPrimaryClip() != null) {\n            ClipData.Item item = clipboard.getPrimaryClip().getItemAt(0);\n            if (item != null && item.getText() != null && item.getText().length() > 0 && !item.getText().equals(mAlreadyWrited)) {\n                File file = new File(Constants.DIR, \"clipboard_\" + String.valueOf(System.currentTimeMillis()) + \".txt\");\n                try {\n                    FileUtils.writeByteArrayToFile(file, item.getText().toString().getBytes(), false);\n                    Toast.makeText(this, \"已把剪切板中内容写入到该文件中\", Toast.LENGTH_SHORT).show();\n                    RxBus.get().post(Constants.RxBusEventType.LOAD_BOOK_LIST, 0);\n                    mAlreadyWrited = item.getText().toString();\n                } catch (IOException e) {\n                    e.printStackTrace();\n                    Toast.makeText(this, \"文件写入失败\", Toast.LENGTH_SHORT).show();\n                }\n            }\n        }*/\n    }\n\n    @Override\n    public boolean onCreateOptionsMenu(Menu menu) {\n        getMenuInflater().inflate(R.menu.item_menu, menu);\n        return true;\n    }\n\n    @OnClick(R.id.fab)\n    public void onClick(View view) {\n        if (ActivityCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE)\n                == PackageManager.PERMISSION_GRANTED) {\n            ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(mFab, \"translationY\", 0, mFab\n                    .getHeight() * 2).setDuration(200L);\n            objectAnimator.setInterpolator(new AccelerateInterpolator());\n            objectAnimator.addListener(this);\n            objectAnimator.start();\n        } else {\n            AlertDialog.Builder builder = new AlertDialog.Builder(this);\n            builder.setTitle(R.string.permission_setting);\n            builder.setMessage(R.string.permission_need_des);\n            builder.setPositiveButton(R.string.permission_go, (dialog, which) -> {\n                Intent intent = new Intent();\n                intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);\n                Uri uri = Uri.fromParts(\"package\", getPackageName(), null);\n                intent.setData(uri);\n                startActivity(intent);\n            });\n            builder.setNegativeButton(R.string.cancel, null);\n            builder.show();\n        }\n    }\n\n    @Override\n    protected void onDestroy() {\n        super.onDestroy();\n        if (mUnbinder != null) {\n            mUnbinder.unbind();\n        }\n        RxBus.get().unregister(this);\n    }\n\n    @SuppressWarnings(\"unused\")\n    @Subscribe(tags = {@Tag(Constants.RxBusEventType.POPUP_MENU_DIALOG_SHOW_DISMISS)})\n    public void onPopupMenuDialogDismiss(Integer type) {\n        if (type == Constants.MSG_DIALOG_DISMISS) {\n            ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(mFab, \"translationY\", mFab\n                    .getHeight() * 2, 0).setDuration(200L);\n            objectAnimator.setInterpolator(new AccelerateInterpolator());\n            objectAnimator.start();\n        }\n    }\n\n    private void showDialog() {\n        AlertDialog.Builder builder = new AlertDialog.Builder(this);\n        builder.setTitle(R.string.sure_delete_all);\n        builder.setPositiveButton(R.string.ok, (dialog, which) -> deleteAll());\n        builder.setNegativeButton(R.string.cancel, null);\n        builder.show();\n    }\n\n    @Override\n    public void onAnimationStart(Animator animation) {\n        new PopupMenuDialog(this).builder().setCancelable(false)\n                .setCanceledOnTouchOutside(true).show();\n    }\n\n    @Override\n    public void onAnimationEnd(Animator animation) {\n    }\n\n    @Override\n    public void onAnimationCancel(Animator animation) {\n    }\n\n    @Override\n    public void onAnimationRepeat(Animator animation) {\n    }\n\n    void initRecyclerView() {\n        mAppshelfAdapter = new FileListAdapter(this, mFileModelList);\n        mAppList.setHasFixedSize(true);\n        mAppList.setLayoutManager(new LinearLayoutManager(this));\n        mAppList.setAdapter(mAppshelfAdapter);\n        RxBus.get().post(Constants.RxBusEventType.LOAD_BOOK_LIST, 0);\n\n        mSwipeRefreshLayout.setColorSchemeResources(\n                android.R.color.holo_blue_bright,\n                android.R.color.holo_green_light,\n                android.R.color.holo_orange_light,\n                android.R.color.holo_red_light);\n        mSwipeRefreshLayout.setOnRefreshListener(() ->\n                RxBus.get().post(Constants.RxBusEventType.LOAD_BOOK_LIST, 0));\n    }\n\n    private void handleFiles(String path, long length) {\n        FileModel fileModel = new FileModel();\n        PackageManager pm = getPackageManager();\n        PackageInfo info = pm.getPackageArchiveInfo(path, 0);\n\n        if (info != null) {\n            ApplicationInfo appInfo = info.applicationInfo;\n            appInfo.sourceDir = path;\n            appInfo.publicSourceDir = path;\n            String packageName = appInfo.packageName;\n            String version = info.versionName;\n            Drawable icon = pm.getApplicationIcon(appInfo);\n            String appName = pm.getApplicationLabel(appInfo).toString();\n            if (TextUtils.isEmpty(appName)) {\n                appName = getApplicationName(packageName);\n            }\n            if (icon == null) {\n                icon = getIconFromPackageName(packageName, this);\n            }\n            fileModel.setName(appName);\n            fileModel.setPackageName(packageName);\n            fileModel.setPath(path);\n            fileModel.setSize(getFileSize(length));\n            fileModel.setVersion(version);\n            fileModel.setIcon(icon);\n            fileModel.setFileType(FileType.TYPE_APK);\n            fileModel.setInstalled(isAvailable(this, packageName));\n            mFileModelList.add(fileModel);\n        } else {\n            fileModel.setFileType(FileUtils.getFileType(path));\n            fileModel.setPath(path);\n            String[] pathItems = path.split(File.separator);\n            fileModel.setName(pathItems[pathItems.length - 1]);\n            fileModel.setSize(getFileSize(length));\n            Drawable icon = ContextCompat.getDrawable(this, FileUtils.getFileTypeIcon(path));\n            fileModel.setIcon(icon);\n            mFileModelList.add(fileModel);\n        }\n    }\n\n    private String getFileSize(long length) {\n        DecimalFormat df = new DecimalFormat(\"######0.0\");\n        if (length < 1024.f) {\n            return (int) length + \"B\";\n        } else if (length < 1024 * 1024.f) {\n            return df.format(length / 1024.f) + \"K\";\n        } else if (length < 1024 * 1024 * 1024.f) {\n            return df.format((length / 1024.f / 1024.f)) + \"M\";\n        }\n        return df.format(length / 1024.f / 1024.f / 1024.f) + \"G\";\n    }\n\n    @SuppressWarnings(\"unused\")\n    @Subscribe(thread = EventThread.IO, tags = {@Tag(Constants.RxBusEventType.LOAD_BOOK_LIST)})\n    public void loadFileList(Integer type) {\n        File dir = Constants.DIR;\n        if (dir.exists() && dir.isDirectory()) {\n            File[] files = dir.listFiles();\n            if (files == null) {\n                return;\n            }\n\n            FileUtils.sortWithLastModified(files);\n            mFileModelList.clear();\n            for (File file : files) {\n                handleFiles(file.getAbsolutePath(), file.length());\n            }\n        }\n        runOnUiThread(() -> {\n            mSwipeRefreshLayout.setRefreshing(false);\n            mAppshelfAdapter.notifyDataSetChanged();\n        });\n    }\n\n    public String getApplicationName(String packageName) {\n        PackageManager packageManager = null;\n        ApplicationInfo applicationInfo;\n        try {\n            packageManager = getApplicationContext().getPackageManager();\n            applicationInfo = packageManager.getApplicationInfo(packageName, 0);\n        } catch (PackageManager.NameNotFoundException e) {\n            applicationInfo = null;\n        }\n        if (applicationInfo != null) {\n            return (String) packageManager.getApplicationLabel(applicationInfo);\n        }\n        return packageName;\n    }\n\n    /**\n     * 判断相对应的APP是否存在\n     *\n     * @param context                                                                  context\n     * @param packageName(包名)(若想判断QQ，则改为com.tencent.mobileqq，若想判断微信，则改为com.tencent.mm)\n     * @return\n     */\n    public boolean isAvailable(Context context, String packageName) {\n        PackageManager packageManager = context.getPackageManager();\n\n        //获取手机系统的所有APP包名，然后进行一一比较\n        List<PackageInfo> pinfo = packageManager.getInstalledPackages(0);\n        for (int i = 0; i < pinfo.size(); i++) {\n            if ((pinfo.get(i)).packageName\n                    .equalsIgnoreCase(packageName)) {\n                return true;\n            }\n        }\n        return false;\n    }\n\n    //删除所有文件\n    private void deleteAll() {\n        File dir = Constants.DIR;\n        if (dir.exists() && dir.isDirectory()) {\n            File[] fileNames = dir.listFiles();\n            if (fileNames != null) {\n                for (File fileName : fileNames) {\n                    fileName.delete();\n                }\n            }\n        }\n        RxBus.get().post(Constants.RxBusEventType.LOAD_BOOK_LIST, 0);\n    }\n\n    @Override\n    protected void onActivityResult(final int requestCode, final int resultCode, final Intent\n            data) {\n        super.onActivityResult(requestCode, resultCode, data);\n        if (requestCode == FILE_FETCH_CODE && resultCode == Activity.RESULT_OK) {\n            Uri uri = data.getData();\n            if (uri != null) {\n                try {\n                    ContentResolver content = getContentResolver();\n                    FileUtils.copyFile(content.openInputStream(data.getData()), Constants.DIR\n                            + File.separator + FileUtils.getFileName(this, uri));\n                    Toast.makeText(this, R.string.please_refresh_web, Toast.LENGTH_LONG).show();\n                    RxBus.get().post(Constants.RxBusEventType.LOAD_BOOK_LIST, 0);\n                } catch (IOException e) {\n                    Toast.makeText(this, R.string.read_file_failed, Toast.LENGTH_SHORT).show();\n                }\n            } else {\n                Toast.makeText(this, R.string.read_file_failed, Toast.LENGTH_SHORT).show();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/me/pengtao/filetransfer/PopupMenuDialog.java",
    "content": "package me.pengtao.filetransfer;\n\nimport android.app.Dialog;\nimport android.content.ClipData;\nimport android.content.ClipboardManager;\nimport android.content.Context;\nimport android.content.DialogInterface;\nimport android.content.Intent;\nimport android.provider.Settings;\nimport android.view.Display;\nimport android.view.Gravity;\nimport android.view.LayoutInflater;\nimport android.view.View;\nimport android.view.Window;\nimport android.view.WindowManager;\nimport android.widget.Button;\nimport android.widget.ImageView;\nimport android.widget.TextView;\nimport android.widget.Toast;\n\nimport com.hwangjr.rxbus.RxBus;\n\nimport butterknife.BindView;\nimport butterknife.ButterKnife;\nimport butterknife.OnClick;\nimport butterknife.Unbinder;\nimport me.pengtao.filetransfer.util.WifiUtils;\n\n/**\n * @author chris\n */\npublic class PopupMenuDialog {\n    private Unbinder mUnbinder;\n    @BindView(R.id.popup_menu_title)\n    TextView mTxtTitle;\n    @BindView(R.id.popup_menu_subtitle)\n    TextView mTxtSubTitle;\n    @BindView(R.id.shared_wifi_state)\n    ImageView mImgLanState;\n    @BindView(R.id.shared_wifi_state_hint)\n    TextView mTxtStateHint;\n    @BindView(R.id.shared_wifi_address)\n    TextView mTxtAddress;\n    @BindView(R.id.shared_wifi_settings)\n    Button mBtnWifiSettings;\n    @BindView(R.id.shared_wifi_button_split_line)\n    View mButtonSplitLine;\n    private Context context;\n    private Dialog dialog;\n    private Display display;\n\n    public PopupMenuDialog(Context context) {\n        this.context = context;\n        WindowManager windowManager = (WindowManager) context\n                .getSystemService(Context.WINDOW_SERVICE);\n        display = windowManager.getDefaultDisplay();\n        RxBus.get().register(this);\n    }\n\n    public PopupMenuDialog builder() {\n        View view = LayoutInflater.from(context).inflate(\n                R.layout.layout_popup_menu_dialog, null);\n\n        view.setMinimumWidth(display.getWidth());\n\n        dialog = new Dialog(context, R.style.PopupMenuDialogStyle);\n        dialog.setContentView(view);\n        mUnbinder = ButterKnife.bind(this, dialog);\n        dialog.setOnDismissListener(this::onDialogDismiss);\n\n        Window dialogWindow = dialog.getWindow();\n        dialogWindow.setGravity(Gravity.LEFT | Gravity.BOTTOM);\n        WindowManager.LayoutParams lp = dialogWindow.getAttributes();\n        lp.x = 0;\n        lp.y = 0;\n        dialogWindow.setAttributes(lp);\n\n        return this;\n    }\n\n    public PopupMenuDialog setCancelable(boolean cancel) {\n        dialog.setCancelable(cancel);\n        return this;\n    }\n\n    public PopupMenuDialog setCanceledOnTouchOutside(boolean cancel) {\n        dialog.setCanceledOnTouchOutside(cancel);\n        return this;\n    }\n\n    public void show() {\n        dialog.show();\n        String ip = WifiUtils.getDeviceIpAddress();\n        onWifiConnected(ip);\n        WebService.start(context);\n    }\n\n    @OnClick({R.id.shared_wifi_cancel, R.id.shared_wifi_settings})\n    public void onClick(View view) {\n        switch (view.getId()) {\n            case R.id.shared_wifi_cancel:\n                dialog.dismiss();\n                break;\n            case R.id.shared_wifi_settings:\n                context.startActivity(new Intent(Settings.ACTION_WIFI_SETTINGS));\n                break;\n            default:\n                break;\n        }\n    }\n\n    void onWifiConnected(String ipAddr) {\n        mTxtTitle.setText(R.string.wlan_enabled);\n        mTxtTitle.setTextColor(context.getResources().getColor(R.color.colorWifiConnected));\n        mImgLanState.setImageResource(R.drawable.shared_wifi_enable);\n        mTxtStateHint.setText(R.string.pls_input_the_following_address_in_pc_browser);\n        String address = String.format(context.getString(R.string.http_address), ipAddr, Constants.HTTP_PORT);\n        mTxtAddress.setText(address);\n        mBtnWifiSettings.setOnClickListener(v -> {\n            ClipboardManager cm = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);\n            ClipData mClipData = ClipData.newPlainText(\"Label\", address);\n            cm.setPrimaryClip(mClipData);\n            Toast.makeText(context, context.getString(R.string.copy_toast), Toast.LENGTH_LONG).show();\n        });\n    }\n\n    void onDialogDismiss(DialogInterface dialog) {\n        if (mUnbinder != null) {\n            mUnbinder.unbind();\n            RxBus.get().post(Constants.RxBusEventType.POPUP_MENU_DIALOG_SHOW_DISMISS, Constants.MSG_DIALOG_DISMISS);\n            //unregisterWifiConnectChangedReceiver();\n            RxBus.get().unregister(PopupMenuDialog.this);\n        }\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/me/pengtao/filetransfer/TransferApp.java",
    "content": "/*\n * Copyright (c) 2018 CPPAlien\n *\n * Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3, 29 June 2007 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     https://github.com/CPPAlien/FileTransfer/blob/master/LICENSE\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage me.pengtao.filetransfer;\n\nimport android.app.Application;\n\n/**\n * @author CPPAlien\n */\npublic class TransferApp extends Application {\n    @Override\n    public void onCreate() {\n        super.onCreate();\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/me/pengtao/filetransfer/WebService.java",
    "content": "package me.pengtao.filetransfer;\n\nimport android.app.Service;\nimport android.content.Context;\nimport android.content.Intent;\nimport android.os.IBinder;\nimport android.text.TextUtils;\n\nimport com.hwangjr.rxbus.RxBus;\nimport com.koushikdutta.async.AsyncServer;\nimport com.koushikdutta.async.ByteBufferList;\nimport com.koushikdutta.async.DataEmitter;\nimport com.koushikdutta.async.http.body.MultipartFormDataBody;\nimport com.koushikdutta.async.http.body.Part;\nimport com.koushikdutta.async.http.body.UrlEncodedFormBody;\nimport com.koushikdutta.async.http.server.AsyncHttpServer;\nimport com.koushikdutta.async.http.server.AsyncHttpServerRequest;\nimport com.koushikdutta.async.http.server.AsyncHttpServerResponse;\n\nimport org.json.JSONArray;\nimport org.json.JSONException;\nimport org.json.JSONObject;\n\nimport java.io.BufferedInputStream;\nimport java.io.BufferedOutputStream;\nimport java.io.ByteArrayOutputStream;\nimport java.io.File;\nimport java.io.FileNotFoundException;\nimport java.io.FileOutputStream;\nimport java.io.IOException;\nimport java.io.UnsupportedEncodingException;\nimport java.net.URLDecoder;\nimport java.net.URLEncoder;\nimport java.text.DecimalFormat;\n\nimport timber.log.Timber;\n\npublic class WebService extends Service {\n    static final String ACTION_START_WEB_SERVICE = \"me.pengtao.filetransfer.action\" +\n            \".START_WEB_SERVICE\";\n    static final String ACTION_STOP_WEB_SERVICE = \"me.pengtao.filetransfer.action\" +\n            \".STOP_WEB_SERVICE\";\n    private static final String TEXT_CONTENT_TYPE = \"text/html;charset=utf-8\";\n    private static final String CSS_CONTENT_TYPE = \"text/css;charset=utf-8\";\n    private static final String BINARY_CONTENT_TYPE = \"application/octet-stream\";\n    private static final String JS_CONTENT_TYPE = \"application/javascript\";\n    private static final String PNG_CONTENT_TYPE = \"application/x-png\";\n    private static final String JPG_CONTENT_TYPE = \"application/jpeg\";\n    private static final String SWF_CONTENT_TYPE = \"application/x-shockwave-flash\";\n    private static final String WOFF_CONTENT_TYPE = \"application/x-font-woff\";\n    private static final String TTF_CONTENT_TYPE = \"application/x-font-truetype\";\n    private static final String SVG_CONTENT_TYPE = \"image/svg+xml\";\n    private static final String EOT_CONTENT_TYPE = \"image/vnd.ms-fontobject\";\n    private static final String MP3_CONTENT_TYPE = \"audio/mp3\";\n    private static final String MP4_CONTENT_TYPE = \"video/mpeg4\";\n    FileUploadHolder fileUploadHolder = new FileUploadHolder();\n    private AsyncHttpServer server = new AsyncHttpServer();\n    private AsyncServer mAsyncServer = new AsyncServer();\n\n    public static void start(Context context) {\n        Intent intent = new Intent(context, WebService.class);\n        intent.setAction(ACTION_START_WEB_SERVICE);\n        context.startService(intent);\n    }\n\n    public static void stop(Context context) {\n        Intent intent = new Intent(context, WebService.class);\n        intent.setAction(ACTION_STOP_WEB_SERVICE);\n        context.startService(intent);\n    }\n\n    @Override\n    public IBinder onBind(Intent intent) {\n        return null;\n    }\n\n    @Override\n    public int onStartCommand(Intent intent, int flags, int startId) {\n        if (intent != null) {\n            String action = intent.getAction();\n            if (ACTION_START_WEB_SERVICE.equals(action)) {\n                startServer();\n            } else if (ACTION_STOP_WEB_SERVICE.equals(action)) {\n                stopSelf();\n            }\n        }\n        return super.onStartCommand(intent, flags, startId);\n    }\n\n    @Override\n    public void onDestroy() {\n        super.onDestroy();\n        if (server != null) {\n            server.stop();\n        }\n        if (mAsyncServer != null) {\n            mAsyncServer.stop();\n        }\n    }\n\n    private void startServer() {\n        server.get(\"/images/.*\", this::sendResources);\n        server.get(\"/scripts/.*\", this::sendResources);\n        server.get(\"/css/.*\", this::sendResources);\n        //index page\n        server.get(\"/\", (AsyncHttpServerRequest request, AsyncHttpServerResponse response) -> {\n            try {\n                response.send(getIndexContent());\n            } catch (IOException e) {\n                e.printStackTrace();\n                response.code(500).end();\n            }\n        });\n        //query upload list\n        server.get(\"/files\", (AsyncHttpServerRequest request, AsyncHttpServerResponse response) -> {\n            JSONArray array = new JSONArray();\n            File dir = Constants.DIR;\n            if (dir.exists() && dir.isDirectory()) {\n                String[] fileNames = dir.list();\n                if (fileNames != null) {\n                    for (String fileName : fileNames) {\n                        File file = new File(dir, fileName);\n                        if (file.exists() && file.isFile()) {\n                            try {\n                                JSONObject jsonObject = new JSONObject();\n                                jsonObject.put(\"name\", fileName);\n                                long fileLen = file.length();\n                                DecimalFormat df = new DecimalFormat(\"0.00\");\n                                if (fileLen > 1024 * 1024) {\n                                    jsonObject.put(\"size\", df.format(fileLen * 1f / 1024 / 1024)\n                                            + \"MB\");\n                                } else if (fileLen > 1024) {\n                                    jsonObject.put(\"size\", df.format(fileLen * 1f / 1024) + \"KB\");\n                                } else {\n                                    jsonObject.put(\"size\", fileLen + \"B\");\n                                }\n                                array.put(jsonObject);\n                            } catch (JSONException e) {\n                                e.printStackTrace();\n                            }\n                        }\n                    }\n                }\n            }\n            response.send(array.toString());\n        });\n        //delete\n        server.post(\"/files/.*\", (AsyncHttpServerRequest request, AsyncHttpServerResponse\n                response) -> {\n            final UrlEncodedFormBody body = (UrlEncodedFormBody) request.getBody();\n            if (\"delete\".equalsIgnoreCase(body.get().getString(\"_method\"))) {\n                String path = request.getPath().replace(\"/files/\", \"\");\n                try {\n                    path = URLDecoder.decode(path, \"utf-8\");\n                } catch (UnsupportedEncodingException e) {\n                    e.printStackTrace();\n                }\n                File file = new File(Constants.DIR, path);\n                if (file.exists() && file.isFile() && file.delete()) {\n                    RxBus.get().post(Constants.RxBusEventType.LOAD_BOOK_LIST, 0);\n                }\n            }\n            response.end();\n        });\n        //download\n        server.get(\"/files/.*\", (AsyncHttpServerRequest request, AsyncHttpServerResponse\n                response) -> {\n            String path = request.getPath().replace(\"/files/\", \"\");\n            try {\n                path = URLDecoder.decode(path, \"utf-8\");\n            } catch (UnsupportedEncodingException e) {\n                e.printStackTrace();\n            }\n            File file = new File(Constants.DIR, path);\n            if (file.exists() && file.isFile()) {\n                try {\n                    response.getHeaders().add(\"Content-Disposition\", \"attachment;filename=\" +\n                            URLEncoder.encode(file.getName(), \"utf-8\"));\n                } catch (UnsupportedEncodingException e) {\n                    e.printStackTrace();\n                }\n                response.sendFile(file);\n                return;\n            }\n            response.code(404).send(\"Not found!\");\n        });\n        //upload\n        server.post(\"/files\", (AsyncHttpServerRequest request, AsyncHttpServerResponse response)\n                        -> {\n                    final MultipartFormDataBody body = (MultipartFormDataBody) request.getBody();\n                    body.setMultipartCallback((Part part) -> {\n                        if (part.isFile()) {\n                            body.setDataCallback((DataEmitter emitter, ByteBufferList bb) -> {\n                                fileUploadHolder.write(bb.getAllByteArray());\n                                bb.recycle();\n                            });\n                        } else {\n                            if (body.getDataCallback() == null) {\n                                body.setDataCallback((DataEmitter emitter, ByteBufferList bb) -> {\n                                    try {\n                                        String fileName = URLDecoder.decode(new String(bb\n                                                .getAllByteArray()), \"UTF-8\");\n                                        fileUploadHolder.setFileName(fileName);\n                                    } catch (UnsupportedEncodingException e) {\n                                        e.printStackTrace();\n                                    }\n                                    bb.recycle();\n                                });\n                            }\n                        }\n                    });\n                    request.setEndCallback((Exception e) -> {\n                        fileUploadHolder.reset();\n                        response.end();\n                        RxBus.get().post(Constants.RxBusEventType.LOAD_BOOK_LIST, 0);\n                    });\n                }\n        );\n        server.get(\"/progress/.*\", (final AsyncHttpServerRequest request,\n                                    final AsyncHttpServerResponse response) -> {\n                    JSONObject res = new JSONObject();\n\n                    String path = request.getPath().replace(\"/progress/\", \"\");\n\n                    if (path.equals(fileUploadHolder.fileName)) {\n                        try {\n                            res.put(\"fileName\", fileUploadHolder.fileName);\n                            res.put(\"size\", fileUploadHolder.totalSize);\n                            res.put(\"progress\", fileUploadHolder.fileOutPutStream == null ? 1 :\n                                    0.1);\n                        } catch (JSONException e) {\n                            e.printStackTrace();\n                        }\n                    }\n\n                    response.send(res);\n                }\n\n        );\n        server.listen(mAsyncServer, Constants.HTTP_PORT);\n    }\n\n    private String getIndexContent() throws IOException {\n        BufferedInputStream bInputStream = null;\n        try {\n            bInputStream = new BufferedInputStream(getAssets().open(\"wifi/index.html\"));\n            ByteArrayOutputStream baos = new ByteArrayOutputStream();\n            int len = 0;\n            byte[] tmp = new byte[10240];\n            while ((len = bInputStream.read(tmp)) > 0) {\n                baos.write(tmp, 0, len);\n            }\n            return new String(baos.toByteArray(), \"utf-8\");\n        } catch (IOException e) {\n            e.printStackTrace();\n            throw e;\n        } finally {\n            if (bInputStream != null) {\n                try {\n                    bInputStream.close();\n                } catch (IOException e) {\n                    e.printStackTrace();\n                }\n            }\n        }\n    }\n\n    private void sendResources(final AsyncHttpServerRequest request, final\n    AsyncHttpServerResponse response) {\n        try {\n            String fullPath = request.getPath();\n            fullPath = fullPath.replace(\"%20\", \" \");\n            String resourceName = fullPath;\n            if (resourceName.startsWith(\"/\")) {\n                resourceName = resourceName.substring(1);\n            }\n            if (resourceName.indexOf(\"?\") > 0) {\n                resourceName = resourceName.substring(0, resourceName.indexOf(\"?\"));\n            }\n            if (!TextUtils.isEmpty(getContentTypeByResourceName(resourceName))) {\n                response.setContentType(getContentTypeByResourceName(resourceName));\n            }\n            BufferedInputStream bInputStream = new BufferedInputStream(getAssets().open(\"wifi/\" +\n                    resourceName));\n            response.sendStream(bInputStream, bInputStream.available());\n        } catch (IOException e) {\n            e.printStackTrace();\n            response.code(404).end();\n            return;\n        }\n    }\n\n    private String getContentTypeByResourceName(String resourceName) {\n        if (resourceName.endsWith(\".css\")) {\n            return CSS_CONTENT_TYPE;\n        } else if (resourceName.endsWith(\".js\")) {\n            return JS_CONTENT_TYPE;\n        } else if (resourceName.endsWith(\".swf\")) {\n            return SWF_CONTENT_TYPE;\n        } else if (resourceName.endsWith(\".png\")) {\n            return PNG_CONTENT_TYPE;\n        } else if (resourceName.endsWith(\".jpg\") || resourceName.endsWith(\".jpeg\")) {\n            return JPG_CONTENT_TYPE;\n        } else if (resourceName.endsWith(\".woff\")) {\n            return WOFF_CONTENT_TYPE;\n        } else if (resourceName.endsWith(\".ttf\")) {\n            return TTF_CONTENT_TYPE;\n        } else if (resourceName.endsWith(\".svg\")) {\n            return SVG_CONTENT_TYPE;\n        } else if (resourceName.endsWith(\".eot\")) {\n            return EOT_CONTENT_TYPE;\n        } else if (resourceName.endsWith(\".mp3\")) {\n            return MP3_CONTENT_TYPE;\n        } else if (resourceName.endsWith(\".mp4\")) {\n            return MP4_CONTENT_TYPE;\n        }\n        return \"\";\n    }\n\n    public class FileUploadHolder {\n        private String fileName;\n        private File recievedFile;\n        private BufferedOutputStream fileOutPutStream;\n        private long totalSize;\n\n        public BufferedOutputStream getFileOutPutStream() {\n            return fileOutPutStream;\n        }\n\n        public void setFileName(String fileName) {\n            this.fileName = fileName;\n            totalSize = 0;\n            if (!Constants.DIR.exists()) {\n                Constants.DIR.mkdirs();\n            }\n            this.recievedFile = new File(Constants.DIR, this.fileName);\n            Timber.d(recievedFile.getAbsolutePath());\n            try {\n                fileOutPutStream = new BufferedOutputStream(new FileOutputStream(recievedFile));\n            } catch (FileNotFoundException e) {\n                e.printStackTrace();\n            }\n        }\n\n        public void reset() {\n            if (fileOutPutStream != null) {\n                try {\n                    fileOutPutStream.close();\n                } catch (IOException e) {\n                    e.printStackTrace();\n                }\n            }\n            fileOutPutStream = null;\n        }\n\n        public void write(byte[] data) {\n            if (fileOutPutStream != null) {\n                try {\n                    fileOutPutStream.write(data);\n                } catch (IOException e) {\n                    e.printStackTrace();\n                }\n            }\n            totalSize += data.length;\n        }\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/me/pengtao/filetransfer/receiver/PackageStateReceiver.java",
    "content": "/*\n * Copyright (c) 2018 CPPAlien\n *\n * Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3, 29 June 2007 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     https://github.com/CPPAlien/FileTransfer/blob/master/LICENSE\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage me.pengtao.filetransfer.receiver;\n\nimport android.content.BroadcastReceiver;\nimport android.content.Context;\nimport android.content.Intent;\n\nimport com.hwangjr.rxbus.RxBus;\n\nimport me.pengtao.filetransfer.Constants;\n\n/**\n * @author CPPAlien\n */\npublic class PackageStateReceiver extends BroadcastReceiver {\n    @Override\n    public void onReceive(Context context, Intent intent) {\n        RxBus.get().post(Constants.RxBusEventType.LOAD_BOOK_LIST, 0);\n    }\n}"
  },
  {
    "path": "app/src/main/java/me/pengtao/filetransfer/util/FileType.java",
    "content": "/*\n * Copyright (c) 2018 CPPAlien\n *\n * Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3, 29 June 2007 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     https://github.com/CPPAlien/FileTransfer/blob/master/LICENSE\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage me.pengtao.filetransfer.util;\n\n/**\n * @author CPPAlien\n */\npublic class FileType {\n    public static final String FileTypes[][] = {\n            // File Image\n            {\".png\", \".jpg\", \".jpeg\", \".gif\", \".bmp\"},\n            // File Audio\n            {\".mp3\", \".wav\", \".ogg\", \"midi\"},\n            // File Video\n            {\".mp4\", \".rmvb\", \".avi\", \".flv\", \".3gp\"},\n            // File Web Text\n            {\".jsp\", \".html\", \".htm\", \".js\", \".php\"},\n            // File Text\n            {\".txt\", \".c\", \".cpp\", \".xml\", \".py\", \".json\", \".log\"},\n            // File Excel\n            {\".xls\", \".xlsx\"},\n            // File Word\n            {\".doc\", \".docx\"},\n            // File PPT\n            {\".ppt\", \".pptx\"},\n            // File PDF\n            {\".pdf\"},\n            // File Package\n            {\".jar\", \".zip\", \".rar\", \".gz\"},\n            // APK\n            {\".apk\"}};\n    public static final int TYPE_IMAGE = 100;\n    public static final int TYPE_AUDIO = 200;\n    public static final int TYPE_VIDEO = 300;\n    public static final int TYPE_WEB = 400;\n    public static final int TYPE_TEXT = 500;\n    public static final int TYPE_EXCEL = 600;\n    public static final int TYPE_WORD = 700;\n    public static final int TYPE_PPT = 800;\n    public static final int TYPE_PDF = 900;\n    public static final int TYPE_PACKAGE = 1000;\n    public static final int TYPE_APK = 1100;\n    public static final int TYPE_UNKNOWN = -1;\n    public static final int TypeStart[] = {TYPE_IMAGE, TYPE_AUDIO, TYPE_VIDEO,\n            TYPE_WEB, TYPE_TEXT, TYPE_EXCEL, TYPE_WORD, TYPE_PPT, TYPE_PDF, TYPE_PACKAGE, TYPE_APK};\n}\n"
  },
  {
    "path": "app/src/main/java/me/pengtao/filetransfer/util/FileUtils.java",
    "content": "/*\n * Copyright (c) 2018 CPPAlien\n *\n * Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3, 29 June 2007 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     https://github.com/CPPAlien/FileTransfer/blob/master/LICENSE\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage me.pengtao.filetransfer.util;\n\nimport android.annotation.SuppressLint;\nimport android.app.AlertDialog;\nimport android.content.Context;\nimport android.content.Intent;\nimport android.database.Cursor;\nimport android.net.Uri;\nimport android.os.Build;\nimport android.provider.OpenableColumns;\n\nimport androidx.core.content.FileProvider;\n\nimport java.io.File;\nimport java.io.FileOutputStream;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.OutputStream;\nimport java.util.Arrays;\n\nimport me.pengtao.filetransfer.R;\n\n/**\n * @author CPPAlien\n */\npublic class FileUtils {\n    /**\n     * 获得文件的 uri\n     *\n     * @param context  context\n     * @param filePath 文件路径\n     * @return uri\n     */\n    public static Uri getFileUri(Context context, String filePath) {\n        File file = new File(filePath);\n        return FileProvider.getUriForFile(context, context.getPackageName() + \"\" +\n                \".fileprovider\", file);\n    }\n\n    public static boolean openFile(String filePath, Context context) {\n        int fileType = getFileType(filePath);\n        File file = new File(filePath);\n\n        if (file.isFile()) {\n            Intent intent = null;\n            Uri contentUri = getFileUri(context, filePath);\n            switch (fileType) {\n                case FileType.TYPE_IMAGE:\n                    intent = getImageFileIntent(contentUri);\n                    break;\n                case FileType.TYPE_AUDIO:\n                    intent = getAudioFileIntent(contentUri);\n                    break;\n                case FileType.TYPE_VIDEO:\n                    intent = getVideoFileIntent(contentUri);\n                    break;\n                case FileType.TYPE_WEB:\n                    intent = getHtmlFileIntent(contentUri);\n                    break;\n                case FileType.TYPE_TEXT:\n                    intent = getTextFileIntent(contentUri);\n                    break;\n                case FileType.TYPE_EXCEL:\n                    intent = getExcelFileIntent(contentUri);\n                    break;\n                case FileType.TYPE_WORD:\n                    intent = getWordFileIntent(contentUri);\n                    break;\n                case FileType.TYPE_PPT:\n                    intent = getPPTFileIntent(contentUri);\n                    break;\n                case FileType.TYPE_PDF:\n                    intent = getPdfFileIntent(contentUri);\n                    break;\n                case FileType.TYPE_PACKAGE:\n                case FileType.TYPE_APK:\n                    intent = getApkFileIntent(context, file);\n                    break;\n                default:\n                    new AlertDialog.Builder(context)\n                            .setMessage(R.string.no_program_open_it)\n                            .setPositiveButton(R.string.ok, null)\n                            .show();\n                    break;\n            }\n            if (intent != null) {\n                intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);\n                context.startActivity(intent);\n                return true;\n            }\n        }\n        return false;\n    }\n\n    public static int getFileType(String filePath) {\n        File file = new File(filePath);\n        String fileName = file.getName();\n\n        for (int i = 0; i < FileType.FileTypes.length; i++) {\n            int j = checkStringEnds(fileName, FileType.FileTypes[i]);\n            if (j == -1) {\n                continue;\n            }\n            return FileType.TypeStart[i];\n        }\n        return FileType.TYPE_UNKNOWN;\n    }\n\n    private static int checkStringEnds(String item, String[] array) {\n        for (int i = 0; i < array.length; i++) {\n            if (item.toLowerCase().endsWith(array[i])) {\n                return i;\n            }\n        }\n\n        return -1;\n    }\n\n    public static int getFileTypeIcon(String path) {\n        int fileType = getFileType(path);\n        switch (fileType) {\n            case FileType.TYPE_IMAGE:\n                return R.drawable.image;\n            case FileType.TYPE_AUDIO:\n                return R.drawable.audio;\n            case FileType.TYPE_VIDEO:\n                return R.drawable.vedio;\n            case FileType.TYPE_WEB:\n                return R.drawable.web;\n            case FileType.TYPE_TEXT:\n                return R.drawable.text;\n            case FileType.TYPE_EXCEL:\n                return R.drawable.excel;\n            case FileType.TYPE_WORD:\n                return R.drawable.doc;\n            case FileType.TYPE_PPT:\n                return R.drawable.ppt;\n            case FileType.TYPE_PDF:\n                return R.drawable.pdf;\n            case FileType.TYPE_PACKAGE:\n                return R.drawable.zip;\n            default:\n                return R.drawable.other_file;\n        }\n    }\n\n    public static String getShareType(String path) {\n        int fileType = getFileType(path);\n        switch (fileType) {\n            case FileType.TYPE_IMAGE:\n                return \"image/*\";\n            case FileType.TYPE_AUDIO:\n                return \"audio/*\";\n            case FileType.TYPE_VIDEO:\n                return \"video/*\";\n            case FileType.TYPE_WEB:\n            case FileType.TYPE_TEXT:\n                return \"text/*\";\n            case FileType.TYPE_EXCEL:\n            case FileType.TYPE_WORD:\n            case FileType.TYPE_PPT:\n            case FileType.TYPE_PDF:\n            case FileType.TYPE_PACKAGE:\n            case FileType.TYPE_APK:\n                return \"application/*\";\n            default:\n                return \"*/*\";\n        }\n    }\n\n    public static void copyFile(InputStream in, String targetLocation) throws IOException {\n        OutputStream out = new FileOutputStream(targetLocation);\n        byte[] buf = new byte[1024];\n        int len;\n        while ((len = in.read(buf)) > 0) {\n            out.write(buf, 0, len);\n        }\n        in.close();\n        out.close();\n    }\n\n    public static String getFileName(Context context, Uri uri) {\n        String result = null;\n        if (uri.getScheme().equals(\"content\")) {\n            try (Cursor cursor = context.getContentResolver().query(uri, null, null, null, null)) {\n                if (cursor != null && cursor.moveToFirst()) {\n                    result = cursor.getString(cursor.getColumnIndex(OpenableColumns.DISPLAY_NAME));\n                }\n            }\n        }\n        if (result == null) {\n            result = uri.getPath();\n            int cut = result.lastIndexOf('/');\n            if (cut != -1) {\n                result = result.substring(cut + 1);\n            }\n        }\n        return result;\n    }\n\n    private static Intent getHtmlFileIntent(Uri uri) {\n        Intent intent = new Intent(\"android.intent.action.VIEW\");\n        intent.setDataAndType(uri, \"text/html\");\n        return intent;\n    }\n\n    private static Intent getImageFileIntent(Uri uri) {\n        Intent intent = new Intent(\"android.intent.action.VIEW\");\n        intent.addCategory(\"android.intent.category.DEFAULT\");\n        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n        intent.setDataAndType(uri, \"image/*\");\n        return intent;\n    }\n\n    private static Intent getPdfFileIntent(Uri uri) {\n        Intent intent = new Intent(\"android.intent.action.VIEW\");\n        intent.addCategory(\"android.intent.category.DEFAULT\");\n        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n        intent.setDataAndType(uri, \"application/pdf\");\n        return intent;\n    }\n\n    private static Intent getTextFileIntent(Uri uri) {\n        Intent intent = new Intent(\"android.intent.action.VIEW\");\n        intent.addCategory(\"android.intent.category.DEFAULT\");\n        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n        intent.setDataAndType(uri, \"text/plain\");\n        return intent;\n    }\n\n    private static Intent getAudioFileIntent(Uri uri) {\n        Intent intent = new Intent(\"android.intent.action.VIEW\");\n        intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n        intent.putExtra(\"oneshot\", 0);\n        intent.putExtra(\"configchange\", 0);\n        intent.setDataAndType(uri, \"audio/*\");\n        return intent;\n    }\n\n    private static Intent getVideoFileIntent(Uri uri) {\n        Intent intent = new Intent(\"android.intent.action.VIEW\");\n        intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n        intent.putExtra(\"oneshot\", 0);\n        intent.putExtra(\"configchange\", 0);\n        intent.setDataAndType(uri, \"video/*\");\n        return intent;\n    }\n\n    private static Intent getWordFileIntent(Uri uri) {\n        Intent intent = new Intent(\"android.intent.action.VIEW\");\n        intent.addCategory(\"android.intent.category.DEFAULT\");\n        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n        intent.setDataAndType(uri, \"application/msword\");\n        return intent;\n    }\n\n    private static Intent getExcelFileIntent(Uri uri) {\n        Intent intent = new Intent(\"android.intent.action.VIEW\");\n        intent.addCategory(\"android.intent.category.DEFAULT\");\n        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n        intent.setDataAndType(uri, \"application/vnd.ms-excel\");\n        return intent;\n    }\n\n    private static Intent getPPTFileIntent(Uri uri) {\n        Intent intent = new Intent(\"android.intent.action.VIEW\");\n        intent.addCategory(\"android.intent.category.DEFAULT\");\n        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n        intent.setDataAndType(uri, \"application/vnd.ms-powerpoint\");\n        return intent;\n    }\n\n    private static Intent getApkFileIntent(Context context, File file) {\n        Intent intent = new Intent(Intent.ACTION_VIEW);\n        //兼容7.0\n        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {\n            intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);\n            Uri contentUri = FileProvider.getUriForFile(context, context.getPackageName() + \"\" +\n                    \".fileprovider\", file);\n            intent.setDataAndType(contentUri, \"application/vnd.android.package-archive\");\n        } else {\n            intent.setDataAndType(Uri.fromFile(file), \"application/vnd.android.package-archive\");\n            intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n        }\n        return intent;\n    }\n\n    public static void sortWithLastModified(File[] files) {\n        Arrays.sort(files, (f1, f2) -> {\n            long diff = f1.lastModified() - f2.lastModified();\n            if (diff > 0) {\n                return -1;\n            } else if (diff == 0) {\n                return 0;\n            } else {\n                return 1;\n            }\n        });\n    }\n\n    /**\n     * Writes a byte array to a file creating the file if it does not exist.\n     *\n     * @param file  the file to write to\n     * @param data  the content to write to the file\n     * @param append if {@code true}, then bytes will be added to the\n     * end of the file rather than overwriting\n     * @throws IOException in case of an I/O error\n     * @since IO 2.1\n     */\n    public static void writeByteArrayToFile(File file, byte[] data, boolean append) throws IOException {\n        OutputStream out = null;\n        try {\n            out = openOutputStream(file, append);\n            out.write(data);\n            out.close(); // don't swallow close Exception if copy completes normally\n        } finally {\n            if (out != null) {\n                out.close();\n            }\n        }\n    }\n\n    private static FileOutputStream openOutputStream(File file, boolean append) throws IOException {\n        if (file.exists()) {\n            if (file.isDirectory()) {\n                throw new IOException(\"File '\" + file + \"' exists but is a directory\");\n            }\n            if (!file.canWrite()) {\n                throw new IOException(\"File '\" + file + \"' cannot be written to\");\n            }\n        } else {\n            File parent = file.getParentFile();\n            if (parent != null) {\n                if (!parent.mkdirs() && !parent.isDirectory()) {\n                    throw new IOException(\"Directory '\" + parent + \"' could not be created\");\n                }\n            }\n        }\n        return new FileOutputStream(file, append);\n    }\n}\n"
  },
  {
    "path": "app/src/main/java/me/pengtao/filetransfer/util/WifiUtils.java",
    "content": "package me.pengtao.filetransfer.util;\n\nimport android.util.Log;\n\nimport java.net.InetAddress;\nimport java.net.NetworkInterface;\nimport java.net.SocketException;\nimport java.util.Enumeration;\n\n/**\n * @author chris\n */\npublic class WifiUtils {\n    private static final String TAG = \"WifiUtils\";\n\n    public static String getDeviceIpAddress() {\n        String deviceIpAddress = \"###.###.###.###\";\n\n        try {\n            for (Enumeration<NetworkInterface> enumeration =\n                 NetworkInterface.getNetworkInterfaces(); enumeration.hasMoreElements(); ) {\n                NetworkInterface networkInterface = enumeration.nextElement();\n\n                for (Enumeration<InetAddress> enumerationIpAddr =\n                     networkInterface.getInetAddresses(); enumerationIpAddr.hasMoreElements(); ) {\n                    InetAddress inetAddress = enumerationIpAddr.nextElement();\n\n                    if (!inetAddress.isLoopbackAddress() && inetAddress.getAddress().length == 4) {\n                        deviceIpAddress = inetAddress.getHostAddress();\n                    }\n                }\n            }\n        } catch (SocketException e) {\n            Log.e(TAG, \"SocketException:\" + e.getMessage());\n        }\n\n        return deviceIpAddress;\n    }\n}\n"
  },
  {
    "path": "app/src/main/res/anim/popup_menu_dialog_in.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<translate xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:duration=\"200\"\n    android:fromYDelta=\"100%\"\n    android:toYDelta=\"0\" />\n"
  },
  {
    "path": "app/src/main/res/anim/popup_menu_dialog_out.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<translate xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:duration=\"200\"\n    android:fromYDelta=\"0\"\n    android:toYDelta=\"100%\" />\n"
  },
  {
    "path": "app/src/main/res/drawable/ic_add.xml",
    "content": "<!--\n  ~ Copyright (c) 2018 CPPAlien\n  ~\n  ~ Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3, 29 June 2007 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~     https://github.com/CPPAlien/FileTransfer/blob/master/LICENSE\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<vector android:height=\"24dp\" android:viewportHeight=\"1024.0\"\n    android:viewportWidth=\"1024.0\" android:width=\"24dp\" xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <path android:fillColor=\"#ffffff\" android:pathData=\"M512,832a32,32 0,0 0,32 -32v-256h256a32,32 0,0 0,0 -64h-256V224a32,32 0,0 0,-64 0v256H224a32,32 0,0 0,0 64h256v256a32,32 0,0 0,32 32\"/>\n</vector>\n"
  },
  {
    "path": "app/src/main/res/drawable/ic_delete.xml",
    "content": "<!--\n  ~ Copyright (c) 2018 CPPAlien\n  ~\n  ~ Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3, 29 June 2007 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~     https://github.com/CPPAlien/FileTransfer/blob/master/LICENSE\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n        android:width=\"16dp\"\n        android:height=\"16dp\"\n        android:viewportWidth=\"1024.0\"\n        android:viewportHeight=\"1024.0\">\n    <path\n        android:pathData=\"M178,946q-1,0 -3,-1l1,0.5 2,0.5zM170,942q-3,-2 -5,-3 2,1 5,3zM950.5,203.5q-10.5,-10.5 -26.5,-10.5h-184L740,135q0,-29 -21,-49.5t-50,-20.5h-314q-30,0 -50.5,20.5t-20.5,49.5v58L99,193q-15,0 -25.5,10.5t-10.5,25 10.5,25 25.5,10.5h31v623q0,29 21,49.5t50,20.5h632q29,0 50,-20.5t21,-49.5L904,264h20q15,0 26,-10.5t11,-25 -10.5,-25zM354,136h315v57h-315L354,136zM833,887L201,887L201,264h632v623zM511.5,384q-14.5,0 -25,10.5t-10.5,25.5v334q0,15 10.5,25.5t25,10.5 25,-10.5 10.5,-25.5L547,420q0,-15 -10.5,-25.5T511.5,384zM317,384q-15,0 -25.5,10.5t-10.5,25.5v334q0,15 10.5,25.5t25.5,10.5 25.5,-10.5 10.5,-25.5L353,420q0,-15 -10.5,-25.5T317,384zM704,384q-15,0 -25.5,10.5t-10.5,25.5v334q0,15 10.5,25.5t25.5,10.5 25.5,-10.5 10.5,-25.5L740,420q0,-15 -10.5,-25.5T704,384z\"\n        android:fillColor=\"#ffffff\"/>\n</vector>\n"
  },
  {
    "path": "app/src/main/res/drawable/ic_launcher_background.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<vector\n    android:height=\"108dp\"\n    android:width=\"108dp\"\n    android:viewportHeight=\"108\"\n    android:viewportWidth=\"108\"\n    xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <path android:fillColor=\"#26A69A\"\n          android:pathData=\"M0,0h108v108h-108z\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M9,0L9,108\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M19,0L19,108\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M29,0L29,108\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M39,0L39,108\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M49,0L49,108\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M59,0L59,108\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M69,0L69,108\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M79,0L79,108\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M89,0L89,108\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M99,0L99,108\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M0,9L108,9\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M0,19L108,19\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M0,29L108,29\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M0,39L108,39\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M0,49L108,49\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M0,59L108,59\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M0,69L108,69\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M0,79L108,79\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M0,89L108,89\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M0,99L108,99\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M19,29L89,29\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M19,39L89,39\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M19,49L89,49\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M19,59L89,59\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M19,69L89,69\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M19,79L89,79\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M29,19L29,89\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M39,19L39,89\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M49,19L49,89\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M59,19L59,89\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M69,19L69,89\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n    <path android:fillColor=\"#00000000\" android:pathData=\"M79,19L79,89\"\n          android:strokeColor=\"#33FFFFFF\" android:strokeWidth=\"0.8\"/>\n</vector>\n"
  },
  {
    "path": "app/src/main/res/drawable/shape_common_bg_frame10.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <stroke\n        android:width=\"1dp\"\n        android:color=\"#3399ff\"/>\n    <padding\n        android:bottom=\"1dp\"\n        android:left=\"1dp\"\n        android:right=\"1dp\"\n        android:top=\"1dp\"/>\n    <corners android:radius=\"5dp\"/>\n    <solid android:color=\"#3399ff\"/>\n    //背景色\n</shape>"
  },
  {
    "path": "app/src/main/res/drawable/shape_red_bg_frame10.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <stroke\n        android:width=\"1dp\"\n        android:color=\"#FD5653\"/>\n    <padding\n        android:bottom=\"1dp\"\n        android:left=\"1dp\"\n        android:right=\"1dp\"\n        android:top=\"1dp\"/>\n    <corners android:radius=\"5dp\"/>\n    <solid android:color=\"#FD5653\"/>\n    //背景色\n</shape>"
  },
  {
    "path": "app/src/main/res/layout/activity_main.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:background=\"#EEEEEE\"\n    android:fitsSystemWindows=\"true\"\n    tools:context=\".MainActivity\">\n    <com.google.android.material.appbar.AppBarLayout\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:theme=\"@style/AppTheme.AppBarOverlay\">\n        <androidx.appcompat.widget.Toolbar\n            android:id=\"@+id/toolbar\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"?attr/actionBarSize\"\n            android:background=\"?attr/colorPrimary\"\n            app:popupTheme=\"@style/AppTheme.PopupOverlay\" />\n    </com.google.android.material.appbar.AppBarLayout>\n    <include layout=\"@layout/content_main\" />\n    <com.google.android.material.floatingactionbutton.FloatingActionButton\n        android:id=\"@+id/fab\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_gravity=\"bottom|end\"\n        android:layout_margin=\"@dimen/fab_margin\"\n        app:backgroundTint=\"@color/colorPrimary\"\n        app:srcCompat=\"@drawable/ic_wifi\" />\n</androidx.coordinatorlayout.widget.CoordinatorLayout>\n"
  },
  {
    "path": "app/src/main/res/layout/content_main.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<androidx.swiperefreshlayout.widget.SwipeRefreshLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:id=\"@+id/content_main\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    app:layout_behavior=\"@string/appbar_scrolling_view_behavior\"\n    tools:context=\"me.pengtao.filetransfer.MainActivity\"\n    tools:showIn=\"@layout/activity_main\">\n\n    <androidx.recyclerview.widget.RecyclerView\n        android:id=\"@+id/recyclerview\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\" />\n</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>\n"
  },
  {
    "path": "app/src/main/res/layout/empty_view.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:gravity=\"center\"\n    android:orientation=\"vertical\">\n    <ImageView\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:src=\"@mipmap/kulian\" />\n    <TextView\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_marginTop=\"5dp\"\n        android:gravity=\"center\"\n        android:lineSpacingExtra=\"4dp\"\n        android:paddingBottom=\"50dp\"\n        android:paddingTop=\"10dp\"\n        android:text=\"@string/empty_text\"\n        android:textColor=\"#B19873\"\n        android:textSize=\"15sp\"\n        android:textStyle=\"bold\" />\n</LinearLayout>"
  },
  {
    "path": "app/src/main/res/layout/layout_file_item.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<layout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    xmlns:tools=\"http://schemas.android.com/tools\">\n    <data>\n        <variable\n            name=\"file\"\n            type=\"me.pengtao.filetransfer.FileModel\" />\n        <import type=\"android.view.View\" />\n        <import type=\"me.pengtao.filetransfer.util.FileType\" />\n    </data>\n    <com.chauthai.swipereveallayout.SwipeRevealLayout\n        android:id=\"@+id/swipe_reveal_layout\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:layout_marginBottom=\"2dp\"\n        app:dragEdge=\"right\"\n        app:mode=\"same_level\">\n        <LinearLayout\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"match_parent\">\n            <Button\n                android:id=\"@+id/share\"\n                style=\"?android:attr/buttonBarButtonStyle\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"match_parent\"\n                android:background=\"@color/google_yellow\"\n                android:gravity=\"center\"\n                android:padding=\"20dp\"\n                android:text=\"@string/share\"\n                android:textColor=\"@color/white\"\n                android:textSize=\"16sp\" />\n            <Button\n                android:id=\"@+id/delete\"\n                style=\"?android:attr/buttonBarButtonStyle\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"match_parent\"\n                android:background=\"@color/google_red\"\n                android:gravity=\"center\"\n                android:padding=\"20dp\"\n                android:text=\"@string/delete\"\n                android:textColor=\"@color/white\"\n                android:textSize=\"16sp\" />\n        </LinearLayout>\n        <LinearLayout\n            android:id=\"@+id/main_layout\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:background=\"@color/white\"\n            android:gravity=\"center\"\n            android:orientation=\"horizontal\"\n            android:padding=\"10dp\">\n            <ImageView\n                android:id=\"@+id/iv_icon\"\n                android:layout_width=\"60dp\"\n                android:layout_height=\"60dp\"\n                android:layout_gravity=\"center\"\n                android:scaleType=\"centerCrop\"\n                tools:src=\"@mipmap/ic_launcher\" />\n            <LinearLayout\n                android:layout_width=\"0dp\"\n                android:layout_height=\"wrap_content\"\n                android:layout_marginLeft=\"10dp\"\n                android:layout_marginStart=\"10dp\"\n                android:layout_weight=\"0.8\"\n                android:orientation=\"vertical\">\n                <TextView\n                    android:id=\"@+id/tv_name\"\n                    android:layout_width=\"wrap_content\"\n                    android:layout_height=\"wrap_content\"\n                    android:layout_marginBottom=\"5dp\"\n                    android:ellipsize=\"end\"\n                    android:singleLine=\"true\"\n                    android:textColor=\"#4a4a4a\"\n                    android:textSize=\"17sp\"\n                    tools:text=\"段子乐(v1.1.0)\" />\n                <TextView\n                    android:id=\"@+id/tv_path\"\n                    android:layout_width=\"match_parent\"\n                    android:layout_height=\"wrap_content\"\n                    android:textColor=\"#8e8e93\"\n                    android:textSize=\"10sp\"\n                    tools:text=\"/storage/emulated/0/WifiTransfer/ff.apk\" />\n            </LinearLayout>\n            <LinearLayout\n                android:layout_width=\"0dp\"\n                android:layout_height=\"wrap_content\"\n                android:layout_marginLeft=\"10dp\"\n                android:layout_marginStart=\"10dp\"\n                android:layout_weight=\"0.2\"\n                android:gravity=\"center\"\n                android:orientation=\"vertical\">\n                <TextView\n                    android:id=\"@+id/tv_size\"\n                    android:layout_width=\"wrap_content\"\n                    android:layout_height=\"wrap_content\"\n                    android:ellipsize=\"end\"\n                    android:singleLine=\"true\"\n                    android:textColor=\"#8e8e93\"\n                    android:textSize=\"12sp\"\n                    tools:text=\"7.8M\" />\n                <ImageView\n                    android:id=\"@+id/tv_delete\"\n                    android:layout_width=\"wrap_content\"\n                    android:layout_height=\"wrap_content\"\n                    android:layout_marginTop=\"10dp\"\n                    android:src=\"@drawable/ic_delete\"\n                    android:background=\"@drawable/shape_red_bg_frame10\"\n                    android:ellipsize=\"end\"\n                    android:paddingLeft=\"15dp\"\n                    android:paddingRight=\"15dp\"\n                    android:paddingTop=\"5dp\"\n                    android:paddingBottom=\"5dp\"/>\n            </LinearLayout>\n        </LinearLayout>\n    </com.chauthai.swipereveallayout.SwipeRevealLayout>\n</layout>"
  },
  {
    "path": "app/src/main/res/layout/layout_popup_menu_dialog.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"wrap_content\"\n    android:background=\"@drawable/popup_menu_view_background\"\n    android:orientation=\"vertical\">\n    <TextView\n        android:id=\"@+id/popup_menu_title\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"30dp\"\n        android:gravity=\"center\"\n        android:text=\"@string/wlan_enabled\"\n        android:textSize=\"18sp\" />\n    <TextView\n        android:id=\"@+id/popup_menu_subtitle\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"40dp\"\n        android:layout_marginTop=\"5dp\"\n        android:gravity=\"center\"\n        android:text=\"@string/pls_check_network_state\"\n        android:textSize=\"12sp\" />\n    <ImageView\n        android:id=\"@+id/shared_wifi_state\"\n        android:layout_width=\"80dp\"\n        android:layout_height=\"80dp\"\n        android:layout_gravity=\"center_horizontal\"\n        android:layout_marginTop=\"5dp\"\n        android:scaleType=\"centerInside\"\n        android:src=\"@drawable/shared_wifi_enable\" />\n    <TextView\n        android:id=\"@+id/shared_wifi_state_hint\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"20dp\"\n        android:layout_gravity=\"center_horizontal\"\n        android:layout_marginTop=\"5dp\"\n        android:gravity=\"center\"\n        android:visibility=\"gone\"\n        android:text=\"@string/pls_input_the_following_address_in_pc_browser\"\n        android:textSize=\"15sp\" />\n    <TextView\n        android:id=\"@+id/shared_wifi_address\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"20dp\"\n        android:layout_gravity=\"center_horizontal\"\n        android:layout_marginTop=\"5dp\"\n        android:textIsSelectable=\"true\"\n        android:gravity=\"center\"\n        tools:text=\"http://10.100.9.195:8081\"\n        android:textColor=\"@color/colorWifiConnected\"\n        android:textSize=\"15sp\" />\n    <View\n        android:layout_width=\"match_parent\"\n        android:layout_height=\".5dp\"\n        android:layout_marginTop=\"5dp\"\n        android:background=\"@android:color/darker_gray\" />\n    <LinearLayout\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"50dp\"\n        android:orientation=\"horizontal\">\n        <Button\n            android:id=\"@+id/shared_wifi_cancel\"\n            style=\"?android:attr/borderlessButtonStyle\"\n            android:layout_width=\"0dp\"\n            android:layout_height=\"match_parent\"\n            android:layout_weight=\"1\"\n            android:gravity=\"center\"\n            android:text=\"@string/disappear\" />\n        <View\n            android:id=\"@+id/shared_wifi_button_split_line\"\n            android:layout_width=\"0.5dp\"\n            android:layout_height=\"match_parent\"\n            android:background=\"@android:color/darker_gray\" />\n        <Button\n            android:id=\"@+id/shared_wifi_settings\"\n            style=\"?android:attr/borderlessButtonStyle\"\n            android:layout_width=\"0dp\"\n            android:layout_height=\"match_parent\"\n            android:layout_weight=\"1\"\n            android:gravity=\"center\"\n            android:text=\"@string/set_network\"\n            android:textColor=\"@color/colorAccent\" />\n    </LinearLayout>\n</LinearLayout>"
  },
  {
    "path": "app/src/main/res/menu/item_menu.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<menu xmlns:android=\"http://schemas.android.com/apk/res/android\"\n      xmlns:app=\"http://schemas.android.com/apk/res-auto\">\n    <item\n        android:id=\"@+id/add_files\"\n        android:icon=\"@drawable/ic_add\"\n        android:title=\"@string/upload\"\n        app:showAsAction=\"always\"/>\n    <item\n        android:id=\"@+id/delete_all\"\n        android:icon=\"@mipmap/more\"\n        android:title=\"@string/delete_all\"/>\n</menu>"
  },
  {
    "path": "app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<adaptive-icon xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <background android:drawable=\"@drawable/ic_launcher_background\"/>\n    <foreground android:drawable=\"@mipmap/ic_launcher_foreground\"/>\n</adaptive-icon>"
  },
  {
    "path": "app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<adaptive-icon xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <background android:drawable=\"@drawable/ic_launcher_background\"/>\n    <foreground android:drawable=\"@mipmap/ic_launcher_foreground\"/>\n</adaptive-icon>"
  },
  {
    "path": "app/src/main/res/values/colors.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <color name=\"colorPrimary\">#32A14A</color>\n    <color name=\"colorPrimaryDark\">#303F9F</color>\n    <color name=\"colorAccent\">#FF4081</color>\n    <color name=\"colorWifiConnected\">#6495ED</color>\n    <color name=\"white\">#FFFFFF</color>\n    <color name=\"google_red\">#EB4537</color>\n    <color name=\"google_yellow\">#FAC230</color>\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values/dimens.xml",
    "content": "<resources>\n    <!-- Default screen margins, per the Android Design guidelines. -->\n    <dimen name=\"activity_horizontal_margin\">16dp</dimen>\n    <dimen name=\"activity_vertical_margin\">16dp</dimen>\n    <dimen name=\"fab_margin\">16dp</dimen>\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values/strings.xml",
    "content": "<resources>\n    <string name=\"app_name\">文件传输助手</string>\n    <string name=\"wlan_enabled\">服务已开启</string>\n    <string name=\"wlan_disabled\">服务未开启</string>\n    <string name=\"pls_check_network_state\">请确保连接设备在同一个 WI-FI 下，\\n或连到此设备的热点上</string>\n    <string name=\"copy_toast\">复制成功，请在连接设备的浏览器中打开</string>\n    <string name=\"fail_to_start_http_service\">启动HTTP服务失败</string>\n    <string name=\"retrofit_wlan_address\">正在获取地址&#8230;</string>\n    <string name=\"pls_input_the_following_address_in_pc_browser\">请在浏览器地址栏完整输入</string>\n    <string name=\"click_to_enable_server\">点击上面图标开启服务</string>\n    <string name=\"cancel\">取消</string>\n    <string name=\"disappear\">收起</string>\n    <string name=\"ok\">确定</string>\n    <string name=\"set_network\">复制地址</string>\n    <string name=\"http_address\">http://%1$s:%2$d</string>\n    <string name=\"permission_setting\">权限获取</string>\n    <string name=\"permission_need_des\">本APP需要获取您SD卡的读写权限用来保存电脑端传入的文件</string>\n    <string name=\"permission_go\">开启权限</string>\n    <string name=\"empty_text\">目前还没有传输任何文件\\n点击右下脚按钮，开始文件传输吧～</string>\n    <string name=\"install\">安装</string>\n    <string name=\"uninstall\">卸载</string>\n    <string name=\"app_name_format\">%1$s(v%2$s)</string>\n    <string name=\"no_program_open_it\">未安装可以打开此文件的应用</string>\n    <string name=\"delete_all\">全部删除</string>\n    <string name=\"sure_delete_all\">确定全部删除吗？</string>\n    <string name=\"share\">分享</string>\n    <string name=\"delete\">删除</string>\n    <string name=\"upload\">上传文件</string>\n    <string name=\"read_file_failed\">文件读取失败</string>\n    <string name=\"please_refresh_web\">上传成功，请刷新网页端</string>\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values/styles.xml",
    "content": "<resources>\n    <!-- Base application theme. -->\n    <style name=\"AppTheme\"\n        parent=\"Theme.AppCompat.Light.NoActionBar\">\n        <!-- Customize your theme here. -->\n        <item name=\"colorPrimary\">@color/colorPrimary</item>\n        <item name=\"colorPrimaryDark\">@color/colorPrimary</item>\n        <item name=\"colorAccent\">@color/colorAccent</item>\n    </style>\n\n    <style name=\"AppTheme.NoActionBar\">\n        <item name=\"windowActionBar\">false</item>\n        <item name=\"windowNoTitle\">true</item>\n    </style>\n\n    <style name=\"AppTheme.AppBarOverlay\"\n        parent=\"ThemeOverlay.AppCompat.Dark.ActionBar\" />\n\n    <style name=\"AppTheme.PopupOverlay\"\n        parent=\"ThemeOverlay.AppCompat.Light\">\n        <item name=\"overlapAnchor\">false</item>  <!--设置不覆盖锚点-->\n    </style>\n\n    <style name=\"PopupMenuDialogStyle\"\n        parent=\"@android:style/Theme.Dialog\">\n        <!-- 背景透明 -->\n        <item name=\"android:windowBackground\">@android:color/transparent</item>\n        <item name=\"android:windowContentOverlay\">@null</item>\n        <!-- 浮于Activity之上 -->\n        <item name=\"android:windowIsFloating\">true</item>\n        <!-- 边框 -->\n        <item name=\"android:windowFrame\">@null</item>\n        <!-- Dialog以外的区域模糊效果 -->\n        <item name=\"android:backgroundDimEnabled\">true</item>\n        <!-- 无标题 -->\n        <item name=\"android:windowNoTitle\">true</item>\n        <!-- 半透明 -->\n        <item name=\"android:windowIsTranslucent\">true</item>\n        <!-- Dialog进入及退出动画 -->\n        <item name=\"android:windowAnimationStyle\">@style/ActionSheetDialogAnimation</item>\n    </style>\n    <!-- ActionSheet进出动画 -->\n    <style name=\"ActionSheetDialogAnimation\"\n        parent=\"@android:style/Animation.Dialog\">\n        <item name=\"android:windowEnterAnimation\">@anim/popup_menu_dialog_in</item>\n        <item name=\"android:windowExitAnimation\">@anim/popup_menu_dialog_out</item>\n    </style>\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values-en/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <string name=\"app_name\">FileTransfer</string>\n    <string name=\"wlan_enabled\">Server is enabled</string>\n    <string name=\"wlan_disabled\">Server is disabled</string>\n    <string name=\"pls_check_network_state\">Connecting device should in same WIFI, \\n or connected the hotspot of this device</string>\n    <string name=\"fail_to_start_http_service\">Start HTTP server failed</string>\n    <string name=\"retrofit_wlan_address\">Retrieving wlan address&#8230;</string>\n    <string name=\"pls_input_the_following_address_in_pc_browser\">Please open the following address</string>\n    <string name=\"click_to_enable_server\">Click icon above to enable server</string>\n    <string name=\"cancel\">Cancel</string>\n    <string name=\"disappear\">Hide</string>\n    <string name=\"ok\">Sure</string>\n    <string name=\"copy_toast\">Copied, open in browser of connected device</string>\n    <string name=\"set_network\">Copy Address</string>\n    <string name=\"http_address\">http://%1$s:%2$d</string>\n    <string name=\"permission_setting\">permission request</string>\n    <string name=\"permission_need_des\">The App needs the permission to save files in sdcard</string>\n    <string name=\"permission_go\">enable permission</string>\n    <string name=\"empty_text\">Empty now\\nClick the button below, and start file transfer～</string>\n    <string name=\"install\">Install</string>\n    <string name=\"uninstall\">Uninstall</string>\n    <string name=\"app_name_format\">%1$s(v%2$s)</string>\n    <string name=\"no_program_open_it\">Cannot open it</string>\n    <string name=\"delete_all\">Delete All</string>\n    <string name=\"sure_delete_all\">Delete All？</string>\n    <string name=\"share\">Share</string>\n    <string name=\"delete\">Delete</string>\n    <string name=\"upload\">Upload Files</string>\n    <string name=\"read_file_failed\">File fetch failed</string>\n    <string name=\"please_refresh_web\">Upload success, please refresh web page</string>\n</resources>"
  },
  {
    "path": "app/src/main/res/values-v21/styles.xml",
    "content": "<resources>\n\n    <style name=\"AppTheme.NoActionBar\">\n        <item name=\"windowActionBar\">false</item>\n        <item name=\"windowNoTitle\">true</item>\n        <item name=\"android:windowDrawsSystemBarBackgrounds\">true</item>\n        <item name=\"android:statusBarColor\">@android:color/transparent</item>\n    </style>\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values-w820dp/dimens.xml",
    "content": "<resources>\n    <!-- Example customization of dimensions originally defined in res/values/dimens.xml\n         (such as screen margins) for screens with more than 820dp of available width. This\n         would include 7\" and 10\" devices in landscape (~960dp and ~1280dp respectively). -->\n    <dimen name=\"activity_horizontal_margin\">64dp</dimen>\n</resources>\n"
  },
  {
    "path": "app/src/main/res/xml/install_file.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<paths>\n    <external-path path=\"Android/data/$(applicationId)/\"  name=\"files_root\" />\n    <external-path path=\".\" name=\"cretin_install\" />\n</paths>"
  },
  {
    "path": "build.gradle",
    "content": "// Top-level build file where you can add configuration options common to all sub-projects/modules.\n\nbuildscript {\n    repositories {\n        mavenCentral()\n        google()\n    }\n    dependencies {\n        classpath 'com.android.tools.build:gradle:7.2.2'\n        classpath 'com.google.gms:google-services:4.3.13'\n        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.1'\n        // NOTE: Do not place your application dependencies here; they belong\n        // in the individual module build.gradle files\n    }\n}\n\nallprojects {\n    repositories {\n        mavenCentral()\n        google()\n        jcenter()\n    }\n}\n\ntask clean(type: Delete) {\n    delete rootProject.buildDir\n}\n\n"
  },
  {
    "path": "extra/terms_and_conditions.html",
    "content": "<!DOCTYPE html>\n<html>\n<head>\n    <meta charset=\"utf-8\">\n    <meta name=\"viewport\" content=\"width=device-width\">\n    <title>Privacy Policy</title>\n    <style>body{font-family: \"Helvetica Neue\", Helvetica, Arial, sans-serif; padding:1em;}</style>\n</head>\n<body><h2>Terms &amp; Conditions</h2>\n<p>By downloading or using the app, these terms will automatically apply to you – you should make\n    sure therefore that you read them carefully before using the app. You’re not allowed to copy, or\n    modify the app, any part of the app, or our trademarks in any way. You’re not allowed to attempt\n    to extract the source code of the app, and you also shouldn’t try to translate the app into\n    other languages, or make derivative versions. The app itself, and all the trade marks,\n    copyright, database rights and other intellectual property rights related to it, still belong to\n    Chris Peng.</p>\n<p>Chris Peng is committed to ensuring that the app is as useful and efficient as possible. For that\n    reason, we reserve the right to make changes to the app or to charge for its services, at any\n    time and for any reason. We will never charge you for the app or its services without making it\n    very clear to you exactly what you’re paying for.</p>\n<p>The FileTransfer app stores and processes personal data that you have provided to us, in order to\n    provide my Service. It’s your responsibility to keep your phone and access to the app secure. We\n    therefore recommend that you do not jailbreak or root your phone, which is the process of\n    removing software restrictions and limitations imposed by the official operating system of your\n    device. It could make your phone vulnerable to malware/viruses/malicious programs, compromise\n    your phone’s security features and it could mean that the FileTransfer app won’t work properly\n    or at all. </p>\n<p>You should be aware that there are certain things that Chris Peng will not take responsibility\n    for. Certain functions of the app will require the app to have an active internet connection.\n    The connection can be Wi-Fi, or provided by your mobile network provider, but Chris Peng cannot\n    take responsibility for the app not working at full functionality if you don’t have access to\n    Wi-Fi, and you don’t have any of your data allowance left.</p>\n<p></p>\n<p>If you’re using the app outside of an area with Wi-Fi, you should remember that your terms of the\n    agreement with your mobile network provider will still apply. As a result, you may be charged by\n    your mobile provider for the cost of data for the duration of the connection while accessing the\n    app, or other third party charges. In using the app, you’re accepting responsibility for any\n    such charges, including roaming data charges if you use the app outside of your home territory\n    (i.e. region or country) without turning off data roaming. If you are not the bill payer for the\n    device on which you’re using the app, please be aware that we assume that you have received\n    permission from the bill payer for using the app.</p>\n<p>Along the same lines, Chris Peng cannot always take responsibility for the way you use the app\n    i.e. You need to make sure that your device stays charged – if it runs out of battery and you\n    can’t turn it on to avail the Service, Chris Peng cannot accept responsibility</p>\n<p>With respect to Chris Peng’s responsibility for your use of the app, when you’re using the app,\n    it’s important to bear in mind that although we endeavour to ensure that it is updated and\n    correct at all times, we do rely on third parties to provide information to us so that we can\n    make it available to you. Chris Peng accepts no liability for any loss, direct or indirect, you\n    experience as a result of relying wholly on this functionality of the app.</p>\n<p>At some point, we may wish to update the app. The app is currently available on Android and iOS –\n    the requirements for both systems (and for any additional systems we decide to extend the\n    availability of the app to) may change, and you’ll need to download the updates if you want to\n    keep using the app. Chris Peng does not promise that it will always update the app so that it is\n    relevant to you and/or works with the iOS/Android version that you have installed on your\n    device. However, you promise to always accept updates to the application when offered to you, We\n    may also wish to stop providing the app, and may terminate use of it at any time without giving\n    notice of termination to you. Unless we tell you otherwise, upon any termination, (a) the rights\n    and licenses granted to you in these terms will end; (b) you must stop using the app, and (if\n    needed) delete it from your device.</p>\n<p><strong>Changes to This Terms and Conditions</strong></p>\n<p> I may update our Terms and Conditions from time to time. Thus, you are advised to review\n    this page periodically for any changes. I will notify you of any changes by posting\n    the new Terms and Conditions on this page. These changes are effective immediately after they\n    are posted on\n    this page.\n</p>\n<p><strong>Contact Us</strong></p>\n<p>If you have any questions or suggestions about my Terms and Conditions, do not hesitate to\n    contact\n    me.\n</p>\n<p>This Terms and Conditions page was generated by <a\n        href=\"https://app-privacy-policy-generator.firebaseapp.com/\" target=\"_blank\">App Privacy\n    Policy Generator</a></p></body>\n</html>"
  },
  {
    "path": "gradle/wrapper/gradle-wrapper.properties",
    "content": "#Sun Mar 08 17:16:33 CST 2020\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-7.3.3-bin.zip\n"
  },
  {
    "path": "gradle.properties",
    "content": "# Project-wide Gradle settings.\n\n# IDE (e.g. Android Studio) users:\n# Gradle settings configured through the IDE *will override*\n# any settings specified in this file.\n\n# For more details on how to configure your build environment visit\n# http://www.gradle.org/docs/current/userguide/build_environment.html\n\n# Specifies the JVM arguments used for the daemon process.\n# The setting is particularly useful for tweaking memory settings.\norg.gradle.jvmargs=-Xmx1536m\n\n# When configured, Gradle will run in incubating parallel mode.\n# This option should only be used with decoupled projects. More details, visit\n# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects\n# org.gradle.parallel=true\nandroid.useAndroidX=true\nandroid.enableJetifier=true"
  },
  {
    "path": "gradlew",
    "content": "#!/usr/bin/env bash\n\n##############################################################################\n##\n##  Gradle start up script for UN*X\n##\n##############################################################################\n\n# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nDEFAULT_JVM_OPTS=\"\"\n\nAPP_NAME=\"Gradle\"\nAPP_BASE_NAME=`basename \"$0\"`\n\n# Use the maximum available, or set MAX_FD != -1 to use that value.\nMAX_FD=\"maximum\"\n\nwarn ( ) {\n    echo \"$*\"\n}\n\ndie ( ) {\n    echo\n    echo \"$*\"\n    echo\n    exit 1\n}\n\n# OS specific support (must be 'true' or 'false').\ncygwin=false\nmsys=false\ndarwin=false\ncase \"`uname`\" in\n  CYGWIN* )\n    cygwin=true\n    ;;\n  Darwin* )\n    darwin=true\n    ;;\n  MINGW* )\n    msys=true\n    ;;\nesac\n\n# Attempt to set APP_HOME\n# Resolve links: $0 may be a link\nPRG=\"$0\"\n# Need this for relative symlinks.\nwhile [ -h \"$PRG\" ] ; do\n    ls=`ls -ld \"$PRG\"`\n    link=`expr \"$ls\" : '.*-> \\(.*\\)$'`\n    if expr \"$link\" : '/.*' > /dev/null; then\n        PRG=\"$link\"\n    else\n        PRG=`dirname \"$PRG\"`\"/$link\"\n    fi\ndone\nSAVED=\"`pwd`\"\ncd \"`dirname \\\"$PRG\\\"`/\" >/dev/null\nAPP_HOME=\"`pwd -P`\"\ncd \"$SAVED\" >/dev/null\n\nCLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar\n\n# Determine the Java command to use to start the JVM.\nif [ -n \"$JAVA_HOME\" ] ; then\n    if [ -x \"$JAVA_HOME/jre/sh/java\" ] ; then\n        # IBM's JDK on AIX uses strange locations for the executables\n        JAVACMD=\"$JAVA_HOME/jre/sh/java\"\n    else\n        JAVACMD=\"$JAVA_HOME/bin/java\"\n    fi\n    if [ ! -x \"$JAVACMD\" ] ; then\n        die \"ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n    fi\nelse\n    JAVACMD=\"java\"\n    which java >/dev/null 2>&1 || die \"ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\nfi\n\n# Increase the maximum file descriptors if we can.\nif [ \"$cygwin\" = \"false\" -a \"$darwin\" = \"false\" ] ; then\n    MAX_FD_LIMIT=`ulimit -H -n`\n    if [ $? -eq 0 ] ; then\n        if [ \"$MAX_FD\" = \"maximum\" -o \"$MAX_FD\" = \"max\" ] ; then\n            MAX_FD=\"$MAX_FD_LIMIT\"\n        fi\n        ulimit -n $MAX_FD\n        if [ $? -ne 0 ] ; then\n            warn \"Could not set maximum file descriptor limit: $MAX_FD\"\n        fi\n    else\n        warn \"Could not query maximum file descriptor limit: $MAX_FD_LIMIT\"\n    fi\nfi\n\n# For Darwin, add options to specify how the application appears in the dock\nif $darwin; then\n    GRADLE_OPTS=\"$GRADLE_OPTS \\\"-Xdock:name=$APP_NAME\\\" \\\"-Xdock:icon=$APP_HOME/media/gradle.icns\\\"\"\nfi\n\n# For Cygwin, switch paths to Windows format before running java\nif $cygwin ; then\n    APP_HOME=`cygpath --path --mixed \"$APP_HOME\"`\n    CLASSPATH=`cygpath --path --mixed \"$CLASSPATH\"`\n    JAVACMD=`cygpath --unix \"$JAVACMD\"`\n\n    # We build the pattern for arguments to be converted via cygpath\n    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`\n    SEP=\"\"\n    for dir in $ROOTDIRSRAW ; do\n        ROOTDIRS=\"$ROOTDIRS$SEP$dir\"\n        SEP=\"|\"\n    done\n    OURCYGPATTERN=\"(^($ROOTDIRS))\"\n    # Add a user-defined pattern to the cygpath arguments\n    if [ \"$GRADLE_CYGPATTERN\" != \"\" ] ; then\n        OURCYGPATTERN=\"$OURCYGPATTERN|($GRADLE_CYGPATTERN)\"\n    fi\n    # Now convert the arguments - kludge to limit ourselves to /bin/sh\n    i=0\n    for arg in \"$@\" ; do\n        CHECK=`echo \"$arg\"|egrep -c \"$OURCYGPATTERN\" -`\n        CHECK2=`echo \"$arg\"|egrep -c \"^-\"`                                 ### Determine if an option\n\n        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition\n            eval `echo args$i`=`cygpath --path --ignore --mixed \"$arg\"`\n        else\n            eval `echo args$i`=\"\\\"$arg\\\"\"\n        fi\n        i=$((i+1))\n    done\n    case $i in\n        (0) set -- ;;\n        (1) set -- \"$args0\" ;;\n        (2) set -- \"$args0\" \"$args1\" ;;\n        (3) set -- \"$args0\" \"$args1\" \"$args2\" ;;\n        (4) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" ;;\n        (5) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" ;;\n        (6) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" ;;\n        (7) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" ;;\n        (8) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" ;;\n        (9) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" \"$args8\" ;;\n    esac\nfi\n\n# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules\nfunction splitJvmOpts() {\n    JVM_OPTS=(\"$@\")\n}\neval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS\nJVM_OPTS[${#JVM_OPTS[*]}]=\"-Dorg.gradle.appname=$APP_BASE_NAME\"\n\nexec \"$JAVACMD\" \"${JVM_OPTS[@]}\" -classpath \"$CLASSPATH\" org.gradle.wrapper.GradleWrapperMain \"$@\"\n"
  },
  {
    "path": "gradlew.bat",
    "content": "@if \"%DEBUG%\" == \"\" @echo off\n@rem ##########################################################################\n@rem\n@rem  Gradle startup script for Windows\n@rem\n@rem ##########################################################################\n\n@rem Set local scope for the variables with windows NT shell\nif \"%OS%\"==\"Windows_NT\" setlocal\n\n@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nset DEFAULT_JVM_OPTS=\n\nset DIRNAME=%~dp0\nif \"%DIRNAME%\" == \"\" set DIRNAME=.\nset APP_BASE_NAME=%~n0\nset APP_HOME=%DIRNAME%\n\n@rem Find java.exe\nif defined JAVA_HOME goto findJavaFromJavaHome\n\nset JAVA_EXE=java.exe\n%JAVA_EXE% -version >NUL 2>&1\nif \"%ERRORLEVEL%\" == \"0\" goto init\n\necho.\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\necho.\necho Please set the JAVA_HOME variable in your environment to match the\necho location of your Java installation.\n\ngoto fail\n\n:findJavaFromJavaHome\nset JAVA_HOME=%JAVA_HOME:\"=%\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\n\nif exist \"%JAVA_EXE%\" goto init\n\necho.\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%\necho.\necho Please set the JAVA_HOME variable in your environment to match the\necho location of your Java installation.\n\ngoto fail\n\n:init\n@rem Get command-line arguments, handling Windowz variants\n\nif not \"%OS%\" == \"Windows_NT\" goto win9xME_args\nif \"%@eval[2+2]\" == \"4\" goto 4NT_args\n\n:win9xME_args\n@rem Slurp the command line arguments.\nset CMD_LINE_ARGS=\nset _SKIP=2\n\n:win9xME_args_slurp\nif \"x%~1\" == \"x\" goto execute\n\nset CMD_LINE_ARGS=%*\ngoto execute\n\n:4NT_args\n@rem Get arguments from the 4NT Shell from JP Software\nset CMD_LINE_ARGS=%$\n\n:execute\n@rem Setup the command line\n\nset CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\n\n@rem Execute Gradle\n\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% \"-Dorg.gradle.appname=%APP_BASE_NAME%\" -classpath \"%CLASSPATH%\" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%\n\n:end\n@rem End local scope for the variables with windows NT shell\nif \"%ERRORLEVEL%\"==\"0\" goto mainEnd\n\n:fail\nrem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\nrem the _cmd.exe /c_ return code!\nif  not \"\" == \"%GRADLE_EXIT_CONSOLE%\" exit 1\nexit /b 1\n\n:mainEnd\nif \"%OS%\"==\"Windows_NT\" endlocal\n\n:omega\n"
  },
  {
    "path": "settings.gradle",
    "content": "include ':app'\n"
  }
]