Full Code of CPPAlien/FileTransfer for AI

master 386401b2b96f cached
57 files
179.8 KB
44.5k tokens
125 symbols
1 requests
Download .txt
Repository: CPPAlien/FileTransfer
Branch: master
Commit: 386401b2b96f
Files: 57
Total size: 179.8 KB

Directory structure:
gitextract_dr2au37d/

├── .gitignore
├── LICENSE
├── README.md
├── app/
│   ├── .gitignore
│   ├── build.gradle
│   ├── google-services.json
│   ├── proguard-rules.pro
│   └── src/
│       └── main/
│           ├── AndroidManifest.xml
│           ├── assets/
│           │   └── wifi/
│           │       ├── css/
│           │       │   └── style.css
│           │       ├── index.html
│           │       └── scripts/
│           │           ├── ajaxfileupload.js
│           │           ├── bitcandies.upload5.js
│           │           ├── lang.en-US.js
│           │           ├── lang.zh-Hans.js
│           │           └── transfer.js
│           ├── java/
│           │   └── me/
│           │       └── pengtao/
│           │           └── filetransfer/
│           │               ├── Constants.java
│           │               ├── FileListAdapter.java
│           │               ├── FileModel.java
│           │               ├── MainActivity.java
│           │               ├── PopupMenuDialog.java
│           │               ├── TransferApp.java
│           │               ├── WebService.java
│           │               ├── receiver/
│           │               │   └── PackageStateReceiver.java
│           │               └── util/
│           │                   ├── FileType.java
│           │                   ├── FileUtils.java
│           │                   └── WifiUtils.java
│           └── res/
│               ├── anim/
│               │   ├── popup_menu_dialog_in.xml
│               │   └── popup_menu_dialog_out.xml
│               ├── drawable/
│               │   ├── ic_add.xml
│               │   ├── ic_delete.xml
│               │   ├── ic_launcher_background.xml
│               │   ├── shape_common_bg_frame10.xml
│               │   └── shape_red_bg_frame10.xml
│               ├── layout/
│               │   ├── activity_main.xml
│               │   ├── content_main.xml
│               │   ├── empty_view.xml
│               │   ├── layout_file_item.xml
│               │   └── layout_popup_menu_dialog.xml
│               ├── menu/
│               │   └── item_menu.xml
│               ├── mipmap-anydpi-v26/
│               │   ├── ic_launcher.xml
│               │   └── ic_launcher_round.xml
│               ├── values/
│               │   ├── colors.xml
│               │   ├── dimens.xml
│               │   ├── strings.xml
│               │   └── styles.xml
│               ├── values-en/
│               │   └── strings.xml
│               ├── values-v21/
│               │   └── styles.xml
│               ├── values-w820dp/
│               │   └── dimens.xml
│               └── xml/
│                   └── install_file.xml
├── build.gradle
├── extra/
│   └── terms_and_conditions.html
├── gradle/
│   └── wrapper/
│       ├── gradle-wrapper.jar
│       └── gradle-wrapper.properties
├── gradle.properties
├── gradlew
├── gradlew.bat
└── settings.gradle

================================================
FILE CONTENTS
================================================

================================================
FILE: .gitignore
================================================
*.iml
.gradle
/local.properties
/.idea
.DS_Store
/build
/captures
.externalNativeBuild
app/release


================================================
FILE: LICENSE
================================================
                    GNU GENERAL PUBLIC LICENSE
                       Version 3, 29 June 2007

 Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
 Everyone is permitted to copy and distribute verbatim copies
 of this license document, but changing it is not allowed.

                            Preamble

  The GNU General Public License is a free, copyleft license for
software and other kinds of works.

  The licenses for most software and other practical works are designed
to take away your freedom to share and change the works.  By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.  We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors.  You can apply it to
your programs, too.

  When we speak of free software, we are referring to freedom, not
price.  Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.

  To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights.  Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.

  For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received.  You must make sure that they, too, receive
or can get the source code.  And you must show them these terms so they
know their rights.

  Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.

  For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software.  For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.

  Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so.  This is fundamentally incompatible with the aim of
protecting users' freedom to change the software.  The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable.  Therefore, we
have designed this version of the GPL to prohibit the practice for those
products.  If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.

  Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary.  To prevent this, the GPL assures that
patents cannot be used to render the program non-free.

  The precise terms and conditions for copying, distribution and
modification follow.

                       TERMS AND CONDITIONS

  0. Definitions.

  "This License" refers to version 3 of the GNU General Public License.

  "Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.

  "The Program" refers to any copyrightable work licensed under this
License.  Each licensee is addressed as "you".  "Licensees" and
"recipients" may be individuals or organizations.

  To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy.  The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.

  A "covered work" means either the unmodified Program or a work based
on the Program.

  To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy.  Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.

  To "convey" a work means any kind of propagation that enables other
parties to make or receive copies.  Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.

  An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License.  If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.

  1. Source Code.

  The "source code" for a work means the preferred form of the work
for making modifications to it.  "Object code" means any non-source
form of a work.

  A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.

  The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form.  A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.

  The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities.  However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work.  For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.

  The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.

  The Corresponding Source for a work in source code form is that
same work.

  2. Basic Permissions.

  All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met.  This License explicitly affirms your unlimited
permission to run the unmodified Program.  The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work.  This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.

  You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force.  You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright.  Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.

  Conveying under any other circumstances is permitted solely under
the conditions stated below.  Sublicensing is not allowed; section 10
makes it unnecessary.

  3. Protecting Users' Legal Rights From Anti-Circumvention Law.

  No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.

  When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.

  4. Conveying Verbatim Copies.

  You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.

  You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.

  5. Conveying Modified Source Versions.

  You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:

    a) The work must carry prominent notices stating that you modified
    it, and giving a relevant date.

    b) The work must carry prominent notices stating that it is
    released under this License and any conditions added under section
    7.  This requirement modifies the requirement in section 4 to
    "keep intact all notices".

    c) You must license the entire work, as a whole, under this
    License to anyone who comes into possession of a copy.  This
    License will therefore apply, along with any applicable section 7
    additional terms, to the whole of the work, and all its parts,
    regardless of how they are packaged.  This License gives no
    permission to license the work in any other way, but it does not
    invalidate such permission if you have separately received it.

    d) If the work has interactive user interfaces, each must display
    Appropriate Legal Notices; however, if the Program has interactive
    interfaces that do not display Appropriate Legal Notices, your
    work need not make them do so.

  A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit.  Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.

  6. Conveying Non-Source Forms.

  You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:

    a) Convey the object code in, or embodied in, a physical product
    (including a physical distribution medium), accompanied by the
    Corresponding Source fixed on a durable physical medium
    customarily used for software interchange.

    b) Convey the object code in, or embodied in, a physical product
    (including a physical distribution medium), accompanied by a
    written offer, valid for at least three years and valid for as
    long as you offer spare parts or customer support for that product
    model, to give anyone who possesses the object code either (1) a
    copy of the Corresponding Source for all the software in the
    product that is covered by this License, on a durable physical
    medium customarily used for software interchange, for a price no
    more than your reasonable cost of physically performing this
    conveying of source, or (2) access to copy the
    Corresponding Source from a network server at no charge.

    c) Convey individual copies of the object code with a copy of the
    written offer to provide the Corresponding Source.  This
    alternative is allowed only occasionally and noncommercially, and
    only if you received the object code with such an offer, in accord
    with subsection 6b.

    d) Convey the object code by offering access from a designated
    place (gratis or for a charge), and offer equivalent access to the
    Corresponding Source in the same way through the same place at no
    further charge.  You need not require recipients to copy the
    Corresponding Source along with the object code.  If the place to
    copy the object code is a network server, the Corresponding Source
    may be on a different server (operated by you or a third party)
    that supports equivalent copying facilities, provided you maintain
    clear directions next to the object code saying where to find the
    Corresponding Source.  Regardless of what server hosts the
    Corresponding Source, you remain obligated to ensure that it is
    available for as long as needed to satisfy these requirements.

    e) Convey the object code using peer-to-peer transmission, provided
    you inform other peers where the object code and Corresponding
    Source of the work are being offered to the general public at no
    charge under subsection 6d.

  A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.

  A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling.  In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage.  For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product.  A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.

  "Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source.  The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.

  If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information.  But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).

  The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed.  Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.

  Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.

  7. Additional Terms.

  "Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law.  If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.

  When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it.  (Additional permissions may be written to require their own
removal in certain cases when you modify the work.)  You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.

  Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:

    a) Disclaiming warranty or limiting liability differently from the
    terms of sections 15 and 16 of this License; or

    b) Requiring preservation of specified reasonable legal notices or
    author attributions in that material or in the Appropriate Legal
    Notices displayed by works containing it; or

    c) Prohibiting misrepresentation of the origin of that material, or
    requiring that modified versions of such material be marked in
    reasonable ways as different from the original version; or

    d) Limiting the use for publicity purposes of names of licensors or
    authors of the material; or

    e) Declining to grant rights under trademark law for use of some
    trade names, trademarks, or service marks; or

    f) Requiring indemnification of licensors and authors of that
    material by anyone who conveys the material (or modified versions of
    it) with contractual assumptions of liability to the recipient, for
    any liability that these contractual assumptions directly impose on
    those licensors and authors.

  All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10.  If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term.  If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.

  If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.

  Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.

  8. Termination.

  You may not propagate or modify a covered work except as expressly
provided under this License.  Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).

  However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.

  Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.

  Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License.  If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.

  9. Acceptance Not Required for Having Copies.

  You are not required to accept this License in order to receive or
run a copy of the Program.  Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance.  However,
nothing other than this License grants you permission to propagate or
modify any covered work.  These actions infringe copyright if you do
not accept this License.  Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.

  10. Automatic Licensing of Downstream Recipients.

  Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License.  You are not responsible
for enforcing compliance by third parties with this License.

  An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations.  If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.

  You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License.  For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.

  11. Patents.

  A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based.  The
work thus licensed is called the contributor's "contributor version".

  A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version.  For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.

  Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.

  In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement).  To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.

  If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients.  "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.

  If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.

  A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License.  You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.

  Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.

  12. No Surrender of Others' Freedom.

  If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License.  If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all.  For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.

  13. Use with the GNU Affero General Public License.

  Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work.  The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.

  14. Revised Versions of this License.

  The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time.  Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.

  Each version is given a distinguishing version number.  If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation.  If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.

  If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.

  Later license versions may give you additional or different
permissions.  However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.

  15. Disclaimer of Warranty.

  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

  16. Limitation of Liability.

  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.

  17. Interpretation of Sections 15 and 16.

  If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.

                     END OF TERMS AND CONDITIONS

            How to Apply These Terms to Your New Programs

  If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.

  To do so, attach the following notices to the program.  It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.

    <one line to give the program's name and a brief idea of what it does.>
    Copyright (C) <year>  <name of author>

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.

Also add information on how to contact you by electronic and paper mail.

  If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:

    <program>  Copyright (C) <year>  <name of author>
    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
    This is free software, and you are welcome to redistribute it
    under certain conditions; type `show c' for details.

The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License.  Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".

  You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.

  The GNU General Public License does not permit incorporating your program
into proprietary programs.  If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library.  If this is what you want to do, use the GNU Lesser General
Public License instead of this License.  But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.


================================================
FILE: README.md
================================================
# FileTransfer
![](https://github.com/CPPAlien/FileTransfer/raw/master/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png)

Transfer any files from PC to your phone easily.

https://www.youtube.com/watch?v=NUNaORa1YzM

[![](http://7xq276.com2.z0.glb.qiniucdn.com/google_play.png)](https://play.google.com/store/apps/details?id=me.pengtao.filetransfer)

**If you are banned by GFW. You can watch the video or download apk by ways below:**

Video: https://v.qq.com/x/page/x0618rp8w9x.html

APK: http://d.6short.com/transfer

### What Next
1, Two-way transfer between PC and Phone. 

2, Support plain text send.

### We Need you
If you have any ideas for this app, welcome to submit an issue. 

If you want to add some features, welcome to pull request. 

## Thanks
The idea and some code of this app are from [WifiTransfer](https://github.com/baidusoso/WifiTransfer).
Thanks for [baidusoso](https://github.com/baidusoso).

## LICENSE
```
Copyright (c) 2018 CPPAlien

Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3, 29 June 2007 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    https://github.com/CPPAlien/FileTransfer/blob/master/LICENSE

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```



================================================
FILE: app/.gitignore
================================================
/build


================================================
FILE: app/build.gradle
================================================
plugins {
    id 'com.android.application'
    id 'com.google.gms.google-services'
    id 'com.google.firebase.crashlytics'
}
def cmd = 'git rev-list --no-merges --count HEAD master'
def gitVersion = Integer.parseInt(cmd.execute().text.trim())

android {
    compileSdkVersion 33

    defaultConfig {
        minSdkVersion 19
        targetSdkVersion 33
        versionCode gitVersion
        versionName "1.4.0"
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    dataBinding {
        enabled = true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: "*.jar")
    implementation platform('com.google.firebase:firebase-bom:30.2.0')
    implementation 'com.google.firebase:firebase-analytics'
    implementation 'com.google.firebase:firebase-crashlytics'
    implementation 'com.google.android.material:material:1.6.1'
    implementation 'com.chauthai.swipereveallayout:swipe-reveal-layout:1.4.1'
    implementation 'com.jakewharton:butterknife:10.2.3'
    annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.3'
    implementation 'com.github.bumptech.glide:glide:4.13.0'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.13.0'
    implementation("com.hwangjr.rxbus:rxbus:1.0.5") {
        exclude group: 'com.jakewharton.timber', module: 'timber'
    }
    implementation "com.koushikdutta.async:androidasync:3.1.0"
    implementation 'com.jakewharton.timber:timber:4.1.2'
}


================================================
FILE: app/google-services.json
================================================
{
  "project_info": {
    "project_number": "316341165060",
    "project_id": "filetransfer-94133",
    "storage_bucket": "filetransfer-94133.appspot.com"
  },
  "client": [
    {
      "client_info": {
        "mobilesdk_app_id": "1:316341165060:android:2e482b94aa90d4cb39e951",
        "android_client_info": {
          "package_name": "me.pengtao.filetransfer"
        }
      },
      "oauth_client": [
        {
          "client_id": "316341165060-a1m5kcjqdj9tsmttcjkvelb5dqnq2kaf.apps.googleusercontent.com",
          "client_type": 3
        }
      ],
      "api_key": [
        {
          "current_key": "AIzaSyAROoKJ20QLdInkc9fq0-uCSESAfGIVxRA"
        }
      ],
      "services": {
        "appinvite_service": {
          "other_platform_oauth_client": [
            {
              "client_id": "316341165060-a1m5kcjqdj9tsmttcjkvelb5dqnq2kaf.apps.googleusercontent.com",
              "client_type": 3
            }
          ]
        }
      }
    }
  ],
  "configuration_version": "1"
}

================================================
FILE: app/proguard-rules.pro
================================================
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in D:\program\AndroidSdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
#   http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
#   public *;
#}
-keep public class * implements com.bumptech.glide.module.GlideModule
-keep public class * extends com.bumptech.glide.module.AppGlideModule
-keep public enum com.bumptech.glide.load.ImageHeaderParser$** {
  **[] $VALUES;
  public *;
}

-keep class com.growingio.android.sdk.** {
    *;
}
-dontwarn com.growingio.android.sdk.**
-keepnames class * extends android.view.View
-keep class * extends android.app.Fragment {
    public void setUserVisibleHint(boolean);
    public void onHiddenChanged(boolean);
    public void onResume();
    public void onPause();
}
-keep class android.support.v4.app.Fragment {
    public void setUserVisibleHint(boolean);
    public void onHiddenChanged(boolean);
    public void onResume();
    public void onPause();
}
-keep class * extends android.support.v4.app.Fragment {
    public void setUserVisibleHint(boolean);
    public void onHiddenChanged(boolean);
    public void onResume();
    public void onPause();
}

================================================
FILE: app/src/main/AndroidManifest.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<manifest package="me.pengtao.filetransfer"
    xmlns:android="http://schemas.android.com/apk/res/android">

    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />

    <application
        android:name=".TransferApp"
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:requestLegacyExternalStorage="true"
        android:theme="@style/AppTheme">
        <activity
            android:name=".MainActivity"
            android:exported="true"
            android:label="@string/app_name">
            <intent-filter>
                <data android:scheme="growing.1f3e3791e1d6aee5" />
                <action android:name="android.intent.action.VIEW" />

                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <service
            android:name=".WebService"
            android:enabled="true" />
        <receiver android:exported="true" android:name=".receiver.PackageStateReceiver">
            <intent-filter>
                <category android:name="android.intent.category.DEFAULT" />

                <action android:name="android.intent.action.PACKAGE_ADDED" />
                <action android:name="android.intent.action.PACKAGE_CHANGED" />
                <action android:name="android.intent.action.PACKAGE_INSTALL" />
                <action android:name="android.intent.action.PACKAGE_REMOVED" />
                <action android:name="android.intent.action.PACKAGE_REPLACED" />

                <data android:scheme="package" />
            </intent-filter>
        </receiver>
        <provider
            android:name="androidx.core.content.FileProvider"
            android:authorities="${applicationId}.fileprovider"
            android:exported="false"
            android:grantUriPermissions="true">
            <meta-data
                android:name="android.support.FILE_PROVIDER_PATHS"
                android:resource="@xml/install_file" />
        </provider>
    </application>
</manifest>

================================================
FILE: app/src/main/assets/wifi/css/style.css
================================================
html { margin: 0px; padding: 0px; overflow: visible; }
body {  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;*/
#wrapper {  height: 768px; }
#content { margin: 0px auto 0px auto; width:950px; height:768px; position: relative; }
#left { margin: 0px 0px 0px 50px; }
#logo { position: relative; height:417; }
#logo .wifi { position:absolute;font-size:48px; line-height:48px; color:#ffffff; text-align:center; top:10px; }
.hint { font-size: 12px; color: #FFF; width:243px; height:30px; text-align: center; line-height:15px; }
#upload_form { position:absolute;left:50px;top:400px;  }
.file_upload_warper { position: absolute; top:0px; left:0px; width:212px; height:92px; overflow: hidden; }
.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); }
#copyright { margin-top: 170px; font-size: 14px; color: #FFF; width:243px; text-align: center; }
#right_wrapper { background-image: url('../images/bg_files2.jpg'); background-repeat: repeat-y; width:559px; height:5000px;position: absolute;top: 0px; left:350px }
#right { background-image: url('../images/bg_files.jpg'); background-repeat: no-repeat; height:100%; width:100%; }
#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; }
#right .content_title .drag_hint { padding-left:10px; font-size:12px; color:#FFCC00 }
#right .table_header { margin-left:37px;width:483px; height:34px; background-image: url('../images/table_header_bg2.jpg'); border-bottom: 1px solid #bac8d2; }
#right .table_header .separator { background-image: url('../images/table_header_bg.jpg'); background-repeat: no-repeat; }
#right .table_header .column { text-indent: 10px; float: left; height:34px; line-height:34px; color:#607589; font-size:12px }
#right .table_header .filename { width:313px; }
#right .table_header .size { width:80px; }
#right .table_header .operate { width:80px; text-align:center; }
#right .files { background-image: url('../images/bg_file_list.jpg'); margin-left:37px; width:483px; overflow: auto;}
#right .file { line-height:40px; height:40px; line-height:40px; color:#000; font-size:12px; position: relative; }
#right .progress_wrapper { color:#FFF; background-image: url('../images/progress_bg.jpg'); background-repeat: repeat-x;}
#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; }
#right .files .even { background-color: #dadfe4; }
#right .files .column { position:relative; text-indent: 10px; float: left; height:40px; overflow: hidden; z-index:2; }
#right .files .filename { width:313px; }
#right .files .size { width:80px; }
#right .files .precent { width:44px; text-align:right;}
#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; }
#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; }
#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; }

#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; }
#drag_area.normal { background-position: 0px 0px; }
#drag_area.active { background-position: 0px -181px; }

#upload_button { width:210px; height:90px; margin-left: 17px; background-image: url("../images/button_status.png");background-repeat:no-repeat;  }
#upload_button.normal   { background-position: 0px 0px; }
#upload_button.pressed  { background-position: 0px -91px; }
#upload_button.rollover { background-position: 0px -182px; }

#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; }
.button_lables { position: absolute; top:26px; left:0px; width:212px; height:92px; }
.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;}
.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;}
.button_lable { position: absolute; width:210px; height:90px; font-size:20px; line-height:80px; color:#ffffff; text-align:center;}

================================================
FILE: app/src/main/assets/wifi/index.html
================================================
<!DOCTYPE html>
<head>
    <meta http-equiv="Content-type" content="text/html; charset=utf-8">
    <link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8">
    <script src="scripts/jquery-3.5.1.min.js" type="text/javascript"></script>
    <script>
        var htmlObject =document.getElementsByTagName("html")[0];
        var script = document.createElement("script");
        script.async="async"
        if (navigator.language && navigator.language.startsWith('zh')) {
            script.src="scripts/lang.zh-Hans.js"
        } else {
            script.src="scripts/lang.en-US.js"
        }

        htmlObject.appendChild(script);

        var script1 = document.createElement("script");
        script1.async="async"
        script1.src="scripts/transfer.js"

        htmlObject.appendChild(script1);
    </script>
    <script src="scripts/ajaxfileupload.js" type="text/javascript"></script>
    <script src="scripts/bitcandies.upload5.js" type="text/javascript"></script>
</head>
<body>
<div id="wrapper">
    <div id="content">
        <div id="left">
            <div id="logo">
                <div class="wifi">文件传输助手</div>
            </div>
            <div id="upload_hint" class="hint"></div>
            <div id="upload_form">
                <div id="upload_button" />
                <div class="file_upload_warper">
                    <input type="file" name="newfile" value="" id="newfile_0" class="file_upload" multiple="multiple" />
                </div>
            </div>
        </div>
        <div id="right_wrapper">
            <div id="right">
                <div class="content_title">您设备上的文件列表</div>
                <div class="table_header">
                    <div class="filename column">文件名</div>
                    <div class="size column separator">大小</div>
                    <div class="operate column separator">操作</div>
                </div>
                <div class="files">
                </div>
            </div>
        </div>
    </div>
</div>
</body>
</html>

================================================
FILE: app/src/main/assets/wifi/scripts/ajaxfileupload.js
================================================

jQuery.extend({
	

    createUploadIframe: function(id, uri)
	{
			//create frame
            var frameId = 'jUploadFrame' + id;
            var iframeHtml = '<iframe id="' + frameId + '" name="' + frameId + '" style="position:absolute; top:-9999px; left:-9999px"';
			if(window.ActiveXObject)
			{
                if(typeof uri== 'boolean'){
					iframeHtml += ' src="' + 'javascript:false' + '"';

                }
                else if(typeof uri== 'string'){
					iframeHtml += ' src="' + uri + '"';

                }	
			}
			iframeHtml += ' />';
			jQuery(iframeHtml).appendTo(document.body);

            return jQuery('#' + frameId).get(0);			
    },
    createUploadForm: function(id, fileElementId, data)
	{
		//create form	
		var formId = 'jUploadForm' + id;
		var fileId = 'jUploadFile' + id;
		var form = jQuery('<form  action="" method="POST" name="' + formId + '" id="' + formId + '" enctype="multipart/form-data"></form>');	
		if(data)
		{
			for(var i in data)
			{
				jQuery('<input type="hidden" name="' + i + '" value="' + data[i] + '" />').appendTo(form);
			}			
		}		
		var oldElement = jQuery('#' + fileElementId);
		var newElement = jQuery(oldElement).clone();
		jQuery(oldElement).attr('id', fileId);
		jQuery(oldElement).before(newElement);
		jQuery(oldElement).appendTo(form);


		
		//set attributes
		jQuery(form).css('position', 'absolute');
		jQuery(form).css('top', '-1200px');
		jQuery(form).css('left', '-1200px');
		jQuery(form).appendTo('body');		
		return form;
    },

    ajaxFileUpload: function(s) {
        // TODO introduce global settings, allowing the client to modify them for all requests, not only timeout		
        s = jQuery.extend({}, jQuery.ajaxSettings, s);
        var id = new Date().getTime()        
		var form = jQuery.createUploadForm(id, s.fileElementId, (typeof(s.data)=='undefined'?false:s.data));
		var io = jQuery.createUploadIframe(id, s.secureuri);
		var frameId = 'jUploadFrame' + id;
		var formId = 'jUploadForm' + id;		
        // Watch for a new set of requests
        if ( s.global && ! jQuery.active++ )
		{
			jQuery.event.trigger( "ajaxStart" );
		}            
        var requestDone = false;
        // Create the request object
        var xml = {}   
        if ( s.global )
            jQuery.event.trigger("ajaxSend", [xml, s]);
        // Wait for a response to come back
        var uploadCallback = function(isTimeout)
		{			
			var io = document.getElementById(frameId);
            try 
			{				
				if(io.contentWindow)
				{
					 xml.responseText = io.contentWindow.document.body?io.contentWindow.document.body.innerHTML:null;
                	 xml.responseXML = io.contentWindow.document.XMLDocument?io.contentWindow.document.XMLDocument:io.contentWindow.document;
					 
				}else if(io.contentDocument)
				{
					 xml.responseText = io.contentDocument.document.body?io.contentDocument.document.body.innerHTML:null;
                	xml.responseXML = io.contentDocument.document.XMLDocument?io.contentDocument.document.XMLDocument:io.contentDocument.document;
				}						
            }catch(e)
			{
				jQuery.handleError(s, xml, null, e);
			}
            if ( xml || isTimeout == "timeout") 
			{				
                requestDone = true;
                var status;
                try {
                    status = isTimeout != "timeout" ? "success" : "error";
                    // Make sure that the request was successful or notmodified
                    if ( status != "error" )
					{
                        // process the data (runs the xml through httpData regardless of callback)
                        var data = jQuery.uploadHttpData( xml, s.dataType );    
                        // If a local callback was specified, fire it and pass it the data
                        if ( s.success )
                            s.success( data, status );
    
                        // Fire the global callback
                        if( s.global )
                            jQuery.event.trigger( "ajaxSuccess", [xml, s] );
                    } else
                        jQuery.handleError(s, xml, status);
                } catch(e) 
				{
                    status = "error";
                    jQuery.handleError(s, xml, status, e);
                }

                // The request was completed
                if( s.global )
                    jQuery.event.trigger( "ajaxComplete", [xml, s] );

                // Handle the global AJAX counter
                if ( s.global && ! --jQuery.active )
                    jQuery.event.trigger( "ajaxStop" );

                // Process result
                if ( s.complete )
                    s.complete(xml, status);

                jQuery(io).unbind()

                setTimeout(function()
									{	try 
										{
											jQuery(io).remove();
											jQuery(form).remove();	
											
										} catch(e) 
										{
											jQuery.handleError(s, xml, null, e);
										}									

									}, 100)

                xml = null

            }
        }
        // Timeout checker
        if ( s.timeout > 0 ) 
		{
            setTimeout(function(){
                // Check to see if the request is still happening
                if( !requestDone ) uploadCallback( "timeout" );
            }, s.timeout);
        }
        try 
		{

			var form = jQuery('#' + formId);
			jQuery(form).attr('action', s.url);
			jQuery(form).attr('method', 'POST');
			jQuery(form).attr('target', frameId);
            if(form.encoding)
			{
				jQuery(form).attr('encoding', 'multipart/form-data');      			
            }
            else
			{	
				jQuery(form).attr('enctype', 'multipart/form-data');			
            }			
            jQuery(form).submit();

        } catch(e) 
		{			
            jQuery.handleError(s, xml, null, e);
        }
		
		jQuery('#' + frameId).load(uploadCallback	);
        return {abort: function () {}};	

    },

    uploadHttpData: function( r, type ) {
        var data = !type;
        data = type == "xml" || data ? r.responseXML : r.responseText;
        // If the type is "script", eval it in global context
        if ( type == "script" )
            jQuery.globalEval( data );
        // Get the JavaScript object, if JSON is used.
        if ( type == "json" )
            eval( "data = " + data );
        // evaluate scripts within html
        if ( type == "html" )
            jQuery("<div>").html(data).evalScripts();

        return data;
    }
})



================================================
FILE: app/src/main/assets/wifi/scripts/bitcandies.upload5.js
================================================
/**
* Upload5 0.1.0
* (c) 2011 BitCandies
* http://github.com/bitcandies/upload5
*
* Upload5 is a flexible HTML5/JavaScript library that handles multiple file uploads.
*
* Upload5 is freely distributable under the MIT license,
* see LICENSE.
*
* http://www.bitcandies.com/
*/

var bitcandies = bitcandies || {};

bitcandies.defaults = function (dest, source) {
    for (var i in source) {
        if (typeof dest[i] == 'undefined') {
            dest[i] = source[i];
        }
    }
};

bitcandies.FileUploader = function (options) {
    var default_options = {
        fieldname: 'file',
        maxconnections: 2,
        //maxfilesize: 1024,
        method: 'POST',
        default_params: {},
        url: '',

        enqueued: function (item) { },
        aborted: function (item) { },
        start: function (item, xhr) { },
        progress: function (item, loaded, total, xhr) { },
        success: function (item, xhr) { },
        error: function (item, xhr) { },
        complete: function (item, xhr) { }
    };
    this.options = options || {};
    bitcandies.defaults(this.options, default_options);

    this.queue = [];
    this.running = [];
    this.completed = [];

    this._curid = 1;
};

bitcandies.FileUploader.Statuses = {
    QUEUED: 'queued',
    ABORTED: 'aborted',
    UPLOADING: 'uploading',
    COMPLETED: 'completed'
};

bitcandies.FileUploader.QueuedFile = function (uploader, file, params, id) {
    if (!(file instanceof File)) {
        throw new Error('Cannot add a non-File object to upload queue.');
    }
    this.uploader = uploader;
    this.file = file;
    this.params = params || {};
    this.id = id;
    this.status = bitcandies.FileUploader.Statuses.QUEUED;
}

bitcandies.FileUploader.QueuedFile.prototype = {
    getFilename: function () {
        return this.file.fileName ? this.file.fileName : this.file.name;
    },

    getSize: function () {
        return this.file.fileSize ? this.file.fileSize : this.file.size;
    },

    getFile: function () {
        return this.file;
    },

    getParams: function () {
        return this.params;
    },

    getStatus: function () {
        return this.status;
    }
};

bitcandies.FileUploader.prototype = {
    add: function (file, params) {
        params = params || {};
        bitcandies.defaults(params, this.options.default_params);
        var item = new bitcandies.FileUploader.QueuedFile(this, file, params, this._curid);
        this._curid++;
        this.queue.push(item);
        this.options.enqueued.call(this, item);
        this.run();
        return item;
    },

    abort: function (item) {
        if (item.status !== bitcandies.FileUploader.Statuses.COMPLETED && item.status !== bitcandies.FileUploader.Statuses.ABORTED) {
            for (var i = 0; i < this.queue.length; ++i) {
                if (item.id === this.queue[i].id) {
                    this.queue.splice(i, 1);
                    item.status = bitcandies.FileUploader.Statuses.ABORTED;
                    this.options.aborted.call(this, item);
                    return;
                }
            }
            for (var i = 0; i < this.running.length; ++i) {
                if (item.id === this.running[i].id) {
                    item.status = bitcandies.FileUploader.Statuses.ABORTED;
                    item.xhr.abort();
                    this.options.aborted.call(this, item);
                    return;
                }
            }
        }
    },

    doUpload: function (item) {
        var self = this,
            xhr = new XMLHttpRequest(),
            formData = new FormData();

        item.status = bitcandies.FileUploader.Statuses.UPLOADING;
        item.xhr = xhr;

        this.options.start.call(this, item, xhr);

        xhr.onreadystatechange = function () {
            if (xhr.readyState == 4) {
                self.onComplete(item, xhr);
            }
        };

        xhr.upload.onprogress = function (e) {
            if (e.lengthComputable) {
                self.options.progress.call(self, item, e.loaded, e.total, xhr);
            }
        };

        xhr.open(this.options.method, this.options.url, true);

        for (var key in item.params) {
            formData.append(key, item.params[key]);
        }
        formData.append("fileName",encodeURI(item.file.name));
        formData.append(this.options.fieldname, item.file);

        xhr.send(formData);
    },

    isRunning: function () {
        return this.queue.length || this.running.length;
    },

    onComplete: function (item, xhr) {
        if (item.status !== bitcandies.FileUploader.Statuses.ABORTED) {
            item.status = bitcandies.FileUploader.Statuses.COMPLETED;
            this.options.progress.call(this, item, item.getSize(), item.getSize(), xhr);
            if (xhr.status == 200) {
                this.options.success.call(this, item, xhr);
            }
            else {
                this.options.error.call(this, item, xhr);
            }
            this.options.complete.call(this, item, xhr);
        }
        if (item.xhr) {
            delete item.xhr;
        }

        for (var i in this.running) {
            if (this.running[i].id === item.id) {
                this.running.splice(i, 1);
                break;
            }
        }
        this.run();
    },

    run: function () {
        if (this.queue.length > 0 && this.running.length < this.options.maxconnections) {
            for (var i = 0; i < this.options.maxconnections - this.running.length; ++i) {
                var item = this.queue.shift();
                this.running.push(item);
                this.doUpload(item);
            }
        }
    }
};


================================================
FILE: app/src/main/assets/wifi/scripts/lang.en-US.js
================================================
var STRINGS = {};

STRINGS.WIFI_TRANS_TITLE = 'File Transfer';
STRINGS.FILES_ON_DEVICE = 'File list';
STRINGS.FILENAME = 'Name';
STRINGS.FILE_SIZE = 'Size';
STRINGS.FILE_OPER = 'Action';
STRINGS.CONFIRM_DELETE_BOOK = 'Delete?';
STRINGS.DOWNLOAD_FILE = 'Download file';
STRINGS.DELETE_FILE = 'Delete file';
STRINGS.USE_ONE_BROWSER = 'Upload failed. Please do not upload on multiple browser same time.';
STRINGS.UPLOAD_FAILED = 'Upload failed. Reopen this page and try again';
STRINGS.UNSUPPORTED_FILE_TYPE = 'The file type is unsupported';
STRINGS.FILE_IN_QUEUE = 'File is uploading';
STRINGS.FILE_EXISTS = 'File is exist, please delete and try again';
STRINGS.YOU_CHOOSE = 'You chose';
STRINGS.CHOSEN_FILE_COUNT = 'file(s),but limit';
STRINGS.VALID_CHOSEN_FILE_COUNT = 'file(s)。\nPlease choose file,file name cannot be same';
STRINGS.CANCEL = 'Cancel';
STRINGS.SELECT_YOUR_FILES = 'Choose the files you want to upload';
STRINGS.SUPPORTED_FILE_TYPES = 'Support the type';
STRINGS.CANNOT_CONNECT_SERVER = 'Connect failed, refresh the page and try again.';
STRINGS.DRAG_TO_HERE = "drag files here";
STRINGS.SELECT_BUTTON_LABLE1 = "Choose files";
STRINGS.SELECT_BUTTON_LABLE2 = "multiple files supported";
STRINGS.SELECT_BUTTON_LABLE = "Choose files";
STRINGS.WIFI_AVAILABLE = "WiFi is connected";


================================================
FILE: app/src/main/assets/wifi/scripts/lang.zh-Hans.js
================================================
var STRINGS = {};

STRINGS.WIFI_TRANS_TITLE = '文件传输助手';
STRINGS.FILES_ON_DEVICE = '您设备上的文件列表';
STRINGS.FILENAME = '文件名';
STRINGS.FILE_SIZE = '大小';
STRINGS.FILE_OPER = '操作';
STRINGS.CONFIRM_DELETE_BOOK = '是否删除文件?';
STRINGS.DOWNLOAD_FILE = '下载文件';
STRINGS.DELETE_FILE = '删除文件';
STRINGS.USE_ONE_BROWSER = '无法上传文件,请勿使用多个浏览器窗口同时上传。';
STRINGS.UPLOAD_FAILED = '上传失败,请重新打开文件传输助手并刷新此页重新上传。';
STRINGS.UNSUPPORTED_FILE_TYPE = '请选择APK文件。';
STRINGS.FILE_IN_QUEUE = '文件已经在上传列队中。';
STRINGS.FILE_EXISTS = '文件已存在,请先删除再重新上传。';
STRINGS.YOU_CHOOSE = '您选择了';
STRINGS.CHOSEN_FILE_COUNT = '个文件,只能上传';
STRINGS.VALID_CHOSEN_FILE_COUNT = '个文件。\n请选择文件,文件名不能重复。';
STRINGS.CANCEL = '取消';
STRINGS.SELECT_YOUR_FILES = '请选择您要上传到文件传输助手的文件';
STRINGS.SUPPORTED_FILE_TYPES = '支持APK';
STRINGS.CANNOT_CONNECT_SERVER = '无法连接到文件传输助手,请重新文件传输服务并刷新此页后重新上传。';
STRINGS.DRAG_TO_HERE = "拖拽到此处上传";
STRINGS.SELECT_BUTTON_LABLE1 = "选择文件";
STRINGS.SELECT_BUTTON_LABLE2 = "可同时上传多个文件";
STRINGS.SELECT_BUTTON_LABLE = "选择文件";
STRINGS.WIFI_AVAILABLE = "WiFi连接已启用";

================================================
FILE: app/src/main/assets/wifi/scripts/transfer.js
================================================
$(function() {
	var isDragOver = false;
	
	var files = [];
	var currentFileName;

	var uploadQueue = [];
	var currentQueueIndex = 0;
	var isUploading = false;
	var getProgressReties = 0;
	
	var html5Uploader = null;
	var items = {};
	
	function initPageStrings() {
		document.title = STRINGS.WIFI_TRANS_TITLE;
		$('#logo .wifi').text(STRINGS.WIFI_TRANS_TITLE);
		$('.content_title').text(STRINGS.FILES_ON_DEVICE);
		$('.table_header .filename').text(STRINGS.FILENAME);
		$('.table_header .size').text(STRINGS.FILE_SIZE);
		$('.table_header .operate').text(STRINGS.FILE_OPER);
	}
    
	function deleteBook(_event) {
		if (!confirm(STRINGS.CONFIRM_DELETE_BOOK)) {
			return;
		}
		var $node =  $(_event.currentTarget);
		var fileName = $node.siblings(':first').text();
		var deleteUrl = "files/" + encodeURI(fileName);
		var fileInfoContainer = $node.parent();
		fileInfoContainer.css({ 'color':'#fff', 'background-color': '#cb4638' });
		fileInfoContainer.find('.trash').removeClass('trash').unbind();
		fileInfoContainer.find('.download').removeClass('download').unbind();
		$.post(deleteUrl, { '_method' : 'delete' }, function() {
			setTimeout(function() { 
				fileInfoContainer.slideUp('fast', function() {
					fileInfoContainer.remove();
				});
			}, 300);
		});
	}
	
	function downloadBook(_event) {
		var $node =  $(_event.currentTarget);
		var fileName = $node.siblings(':first').text();
		var url = "files/" + fileName;
		window.location = url;
	}

	function loadFileList() {
		var now = new Date();
		var url = "files?";
		$.getJSON(url + now.getTime(), function(data) {
			files = data;
			fillFilesContainer();
			//$(".download").click(downloadBook);
			//$(".trash").click(deleteBook);
		});
	}

	function fillFilesContainer() {
		var height = $(window).height() - $("#right .content_title").height() - $("#right .table_header").height();
		var filesContainer = $("#right .files");
		filesContainer.empty();
		filesContainer.height(height);
		var rowsCount = Math.floor(height / 40);
	
		for (var i = 0; i < files.length;i ++) {
			var row = $('<div class="file"></div>');
			var fileInfo = files[i];
			row.append('<div class="column filename" filename="' + escape(fileInfo.name) + '">' + fileInfo.name +'</div>');
			row.append('<div class="column size">' + fileInfo.size + '</div>');
			row.append('<div class="column download" title="'+STRINGS.DOWNLOAD_FILE+'"></div>');
			row.append('<div class="column trash" title="'+STRINGS.DELETE_FILE+'"></div>');
			filesContainer.append(row);
		}
	
		return height;
	}

	function getUploadProgress() {
		var time = new Date().getTime();
		var url = 'progress/' + encodeURI(currentFileName) + '?' + time;
		$.getJSON(url, function(data) {
			if (!data) {
				getProgressReties ++
				if (getProgressReties < 5) {
					setTimeout(getUploadProgress, 500);
					return;
				} else {
					alert(STRINGS.USE_ONE_BROWSER);
				}
			}
			
			getProgressReties = 0;
			var ele = $("#right .file [filename='" + escape(data.fileName) + "']")
			var eleSize = ele.next()
			eleSize.text(data.size);
			var elePrecent = eleSize.next()
			elePrecent.text(Math.round(data.progress * 100) + "%");
			var eleProgress = ele.prev();
			eleProgress.animate({ width:Math.round(483 * data.progress) }, 280);
		
			if (data.progress < 1) {
				setTimeout(getUploadProgress, 300);
			} else {
				elePrecent.text('');
			}
		});
	}

	function startAjaxUpload() {
		if (isUploading || currentQueueIndex >= uploadQueue.length) {
			return;
		}
		
		isUploading = true;
		var eleFile = $(uploadQueue[currentQueueIndex]);
		var eleFileId = eleFile.attr('id');
		var fileName = eleFile.val();
		var arr = fileName.split("\\");
		fileName = arr[arr.length - 1];
		
		currentQueueIndex ++;
		
		var row = $("#right .file [filename='" + escape(fileName) + "']").parent();
		$.ajaxFileUpload({
			url:'files',
			data:{"fileName":encodeURI(fileName)},
			secureuri:false,
			fileElementId:eleFileId,
			dataType: 'text',
			success: function (data, status) {
				row.removeClass('progress_wrapper');
				row.find('.progress').remove();
				row.find('.precent').text('').remove();
				$('<div class="column download" title="'+STRINGS.DOWNLOAD_FILE+'"></div>')
					//.click(downloadBook)
					.appendTo(row);
				$('<div class="column trash" title="'+STRINGS.DELETE_FILE+'"></div>')
					//.click(deleteBook)
					.appendTo(row);
				isUploading = false;
				
				//IE的诡异情况
				row.find('.download').text('');
				startAjaxUpload();
			},
			error: function (data, status, e) {
				isUploading = false;
				alert(STRINGS.UPLOAD_FAILED);
				row.remove();
				startAjaxUpload();
			}
		});
	
		currentFileName = fileName;
		setTimeout(getUploadProgress, 300);
	}
	
	function checkFileName(fileName) {
		if (!fileName || !fileName.toLowerCase().match('(apk)$')) {
			//return STRINGS.UNSUPPORTED_FILE_TYPE;
		}
		
		var arr = fileName.split("\\");
		fileName = arr[arr.length - 1];
		
		var hasFile = false;
		var existFile = $("#right .file [filename='" + escape(fileName) + "']");
		if (existFile.length > 0) {
            $(this).val("");
			if (existFile.parent().hasClass('progress_wrapper')) {
				return STRINGS.FILE_IN_QUEUE;
			} else {
				return STRINGS.FILE_EXISTS;
			}
		}
		return null;
	}
	
	function uploadFiles(files) {
		var uploader = getHtml5Uploader();
		if (files.length == 1) {
			var msg = checkFileName(files[0].name || files[0].fileName);
			if (msg) {
				alert(msg);
				return;
			}
			uploader.add(files[0]);
			return;
		}
		
		var totalFiles = files.length;
		var actualFiles = 0;
        for (var i = 0; i < files.length; ++i) {
			if (!checkFileName(files[i].name || files[i].fileName)) {
				uploader.add(files[i]);
				actualFiles ++;
			}
        }
		if (totalFiles != actualFiles) {
			var msg = STRINGS.YOU_CHOOSE + totalFiles + STRINGS.CHOSEN_FILE_COUNT + actualFiles + STRINGS.VALID_CHOSEN_FILE_COUNT;
			alert(msg);
		}
	}

	function bindAjaxUpload(fileSelector) {
		$(fileSelector).unbind();
		$(fileSelector).change(function() {
			if (this.files) {
				uploadFiles(this.files);
				//优先使用HTML5上传方式
				return;
			}
			var fileName = $(this).val();
			//alert(fileName);
            
			var msg = checkFileName(fileName);
			if (msg) {
				alert(msg);
				return;
			}
                               
            var arr = fileName.split("\\");
            fileName = arr[arr.length - 1];
		
			var row = $('<div class="file progress_wrapper"></div>');
			row.append('<div class="progress"></div>');
			row.append('<div class="column filename" filename="' + escape(fileName) + '">' + fileName +'</div>');
			row.append('<div class="column size"> - </div>');
			row.append('<div class="column precent">0%</div>');
			$("#right .files").prepend(row);
			
			uploadQueue.push(fileSelector);
			$(fileSelector).css({ top: '-9999px', left: '-9999px' });
			$('.file_upload_warper').append('<input type="file" name="newfile" value="" id="newfile_' + uploadQueue.length + '" class="file_upload" />');
			bindAjaxUpload('#newfile_' + uploadQueue.length);
			startAjaxUpload();
		});
		
		if (typeof(Worker) !== "undefined") {
			$(fileSelector)
				.mouseover(function() { $('#upload_button').removeClass('normal').addClass('pressed'); })
				.mouseout(function() { $('#upload_button').removeClass('pressed').addClass('normal'); })
				.mousedown(function() { $('#upload_button').removeClass('normal').addClass('pressed'); })
				.mouseup(function() { $('#upload_button').removeClass('pressed').addClass('normal'); });
		} else {
			$(fileSelector)
				.mouseover(function() { $('#upload_button').css('background-image', 'url("images/select_file1_rollover.jpg")'); })
				.mouseout(function() { $('#upload_button').css('background-image', 'url("images/select_file1.jpg")'); })
				.mousedown(function() { $('#upload_button').css('background-image', 'url("images/select_file1_pressed.jpg")'); })
				.mouseup(function() { $('#upload_button').css('background-image', 'url("images/select_file1.jpg")'); });
		}
	}
	
	function formatFileSize(value) {
	    var multiplyFactor = 0;
	    var tokens = ["bytes","KB","MB","GB","TB"];
    
	    while (value > 1024) {
	        value /= 1024;
	        multiplyFactor++;
	    }
    
	    return value.toFixed(1) + " " + tokens[multiplyFactor];
	}
    
    function cancelUpload() {
        var uploader = getHtml5Uploader();
        var fileName = $(this).parent().find('.filename').attr('filename');
        if (fileName) {
            item = items[fileName];
            if (item) {
                uploader.abort(item);
            }
        }
    }
	
	function getHtml5Uploader() {
		if (!html5Uploader) {
			html5Uploader = new bitcandies.FileUploader({
				url: 'files',
				maxconnections: 1,
				fieldname: 'newfile',
                enqueued: function (item) {
					var fileName = item.getFilename();
                    items[escape(fileName)] = item;
					var size = item.getSize();
					var row = $('<div class="file progress_wrapper"></div>');
					row.append('<div class="progress"></div>');
					row.append('<div class="column filename" filename="' + escape(fileName) + '">' + fileName +'</div>');
					row.append('<div class="column size">' + formatFileSize(size) +'</div>');
					row.append('<div class="column precent">0%</div>');
                    $('<div class="column trash_white" title="'+STRINGS.CANCEL+'"></div>')
                        .click(cancelUpload)
                        .appendTo(row);
					$("#right .files").prepend(row);
                },
                progress: function (item, loaded, total) {
					var fileName = item.getFilename();
					var progress = loaded / total;
					
					var ele = $("#right .file [filename='" + escape(fileName) + "']")
					var elePrecent = ele.next().next();
					elePrecent.text(Math.round(progress * 100) + "%");
					var eleProgress = ele.prev();
					eleProgress.width(483 * progress);
                },
                success: function (item) {
					var fileName = item.getFilename();
					var row = $("#right .file [filename='" + escape(fileName) + "']").parent();
					
					row.removeClass('progress_wrapper');
					row.find('.progress').remove();
					row.find('.precent').text('').remove();
                    row.find('.trash_white').remove();
					$('<div class="column download" title="'+STRINGS.DOWNLOAD_FILE+'"></div>')
						//.click(downloadBook)
						.appendTo(row);
					$('<div class="column trash" title="'+STRINGS.DELETE_FILE+'"></div>')
						//.click(deleteBook)
						.appendTo(row);
                },
                error: function (item) {
					var fileName = item.getFilename();
					var row = $("#right .file [filename='" + escape(fileName) + "']").parent();
					row.remove();
                },
                aborted: function (item) {
                    var fileName = item.getFilename();
					var row = $("#right .file [filename='" + escape(fileName) + "']").parent();
					row.remove();
                }
			});
		}
		return html5Uploader;
	}
	
    function handleDragOver(evt) {
        evt.stopPropagation();
        evt.preventDefault();
		if (!isDragOver) {
            $(this).removeClass('normal').addClass('active');
			isDragOver = true;
		}
    }
	
    function handleDragLeave(evt) {
        evt.stopPropagation();
        evt.preventDefault();
		
		$(this).removeClass('active').addClass('normal');
		isDragOver = false;
    }
	
    function handleDrop(evt) {
        evt.stopPropagation();
        evt.preventDefault();
		var uploader = getHtml5Uploader();
		
		$(this).removeClass('active').addClass('normal');
		isDragOver = false;
		
		if (evt.dataTransfer && evt.dataTransfer.files) {
			uploadFiles(evt.dataTransfer.files);
		}
    }
	
	function dragUpload() {
        var dropArea = document.getElementById('drag_area');
		if (dropArea && dropArea.addEventListener) {
	        dropArea.addEventListener('dragover', handleDragOver, false);
			dropArea.addEventListener('dragleave', handleDragLeave, false);
	        dropArea.addEventListener('drop', handleDrop, false);
		}
	}
	
	function showHtml5View() {
		var dragAree = $('<div id="drag_area"><div class="drag_hint">' + STRINGS.DRAG_TO_HERE + '</div></div)').addClass('normal').appendTo('#logo');
        $('#upload_hint').empty();
		$('<div>'+STRINGS.SELECT_YOUR_FILES+'</div>')
			.addClass('hint')
			.insertAfter('#upload_button');
            
        var buttonLabels = $('<div class="button_lables"></div>').prependTo("#upload_button")
        $('<div class="button_lable1"></div>').text(STRINGS.SELECT_BUTTON_LABLE1).appendTo(buttonLabels);
        $('<div class="button_lable2"></div>').text(STRINGS.SELECT_BUTTON_LABLE2).appendTo(buttonLabels);
        
		dragUpload();
	}
	
	function showHtml4View() {
        $('#upload_button').css('background-image', 'url("images/select_file1_rollover.jpg")');
		$('#upload_hint').html(STRINGS.SELECT_YOUR_FILES);
        $('<div class="button_lable">' + STRINGS.SELECT_BUTTON_LABLE + '</div>').prependTo("#upload_button")
	}

	$(document).ready(function() {
		// events delegate
		$('.files').on('click', '.trash', deleteBook);
		$('.files').on('click', '.download', downloadBook);
		
		initPageStrings();
		fillFilesContainer();
		loadFileList();
		$(window).resize(function() {
			fillFilesContainer();
		});
		bindAjaxUpload('#newfile_0');
		
		if (typeof(Worker) !== "undefined") {
			showHtml5View();
		} else {
			showHtml4View();
		}
		
		$(document).ajaxError(function(event, request, settings){
			alert(STRINGS.CANNOT_CONNECT_SERVER);
			$('.progress_wrapper, .progress').css( { 'background':'#f00' });
		});
	});
});

================================================
FILE: app/src/main/java/me/pengtao/filetransfer/Constants.java
================================================
package me.pengtao.filetransfer;

import android.os.Environment;

import java.io.File;

public class Constants {
    public static final int HTTP_PORT = 12345;
    public static final String DIR_IN_SDCARD = "FileTransfer";
    public static final int MSG_DIALOG_DISMISS = 0;
    public static final File DIR = new File(Environment.getExternalStorageDirectory() + File
            .separator + Constants.DIR_IN_SDCARD);

    public static final class RxBusEventType {
        public static final String POPUP_MENU_DIALOG_SHOW_DISMISS = "POPUP MENU DIALOG SHOW " +
                "DISMISS";
        public static final String WIFI_CONNECT_CHANGE_EVENT = "WIFI CONNECT CHANGE EVENT";
        public static final String LOAD_BOOK_LIST = "LOAD BOOK LIST";
    }
}


================================================
FILE: app/src/main/java/me/pengtao/filetransfer/FileListAdapter.java
================================================
/*
 * Copyright (c) 2018 CPPAlien
 *
 * Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3, 29 June 2007 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://github.com/CPPAlien/FileTransfer/blob/master/LICENSE
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package me.pengtao.filetransfer;

import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.databinding.DataBindingUtil;
import androidx.recyclerview.widget.RecyclerView;

import com.bumptech.glide.Glide;
import com.chauthai.swipereveallayout.ViewBinderHelper;
import com.hwangjr.rxbus.RxBus;

import java.io.File;
import java.util.List;

import me.pengtao.filetransfer.databinding.LayoutFileItemBinding;
import me.pengtao.filetransfer.util.FileType;
import me.pengtao.filetransfer.util.FileUtils;

/**
 * @author CPPAlien
 */
class FileListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
    private Context mContext;
    private List<FileModel> mFileModelList;
    private final ViewBinderHelper viewBinderHelper = new ViewBinderHelper();

    public FileListAdapter(Context context, List<FileModel> fileModelList) {
        mContext = context;
        mFileModelList = fileModelList;
        viewBinderHelper.setOpenOnlyOne(true);
    }

    @Override
    public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        LayoutInflater inflater = LayoutInflater.from(parent.getContext());
        if (viewType == 1) {
            View view = inflater.inflate(R.layout.empty_view, parent, false);
            return new EmptyViewHolder(view);
        } else {
            return new MyViewHolder(LayoutInflater.from(
                    mContext).inflate(R.layout.layout_file_item, parent,
                    false));
        }
    }

    @Override
    public void onBindViewHolder(@NonNull final RecyclerView.ViewHolder holder, int position) {
        if (holder instanceof MyViewHolder) {
            ((MyViewHolder) holder).onBindViewHolder(position);
        }
    }

    class EmptyViewHolder extends RecyclerView.ViewHolder {
        public EmptyViewHolder(View itemView) {
            super(itemView);
        }
    }

    @Override
    public int getItemCount() {
        return mFileModelList.size() > 0 ? mFileModelList.size() : 1;
    }

    class MyViewHolder extends RecyclerView.ViewHolder {
        LayoutFileItemBinding mBinding;

        public MyViewHolder(View view) {
            super(view);
            mBinding = DataBindingUtil.bind(view);
        }

        public void onBindViewHolder(int position) {
            FileModel infoModel = mFileModelList.get(position);
            if (infoModel.getFileType() == FileType.TYPE_APK) {
                mBinding.tvName.setText(mContext.getString(R.string.app_name_format,
                        infoModel.getName(), infoModel.getVersion()));
                mBinding.tvDelete.setVisibility(infoModel.isInstalled() ? View.VISIBLE : View.GONE);
                mBinding.tvDelete.setOnClickListener(v ->
                        delete(mContext, infoModel.getPackageName()));
            } else {
                mBinding.tvDelete.setVisibility(View.GONE);
                mBinding.tvName.setText(infoModel.getName());
            }
            viewBinderHelper.bind(mBinding.swipeRevealLayout, infoModel.getPath());

            mBinding.tvSize.setText(infoModel.getSize());
            mBinding.tvPath.setText(infoModel.getPath());
            if (infoModel.getFileType() == FileType.TYPE_IMAGE) {
                Glide.with(mContext).load(new File(infoModel.getPath())).into(mBinding.ivIcon);
            } else {
                mBinding.ivIcon.setImageDrawable(infoModel.getIcon());
            }

            mBinding.mainLayout.setOnClickListener(v ->
                    FileUtils.openFile(infoModel.getPath(), mContext));

            mBinding.delete.setOnClickListener(view -> {
                File file = new File(infoModel.getPath());
                if (file.exists() && file.isFile() && file.delete()) {
                    RxBus.get().post(Constants.RxBusEventType.LOAD_BOOK_LIST, 0);
                }
            });
            mBinding.share.setOnClickListener(view -> share(mContext, infoModel.getPath()));
            mBinding.executePendingBindings();
        }
    }

    @Override
    public int getItemViewType(int position) {
        if (mFileModelList.size() == 0) {
            return 1;
        }
        return super.getItemViewType(position);
    }

    private void delete(Context context, String packageName) {
        Uri uri = Uri.fromParts("package", packageName, null);
        Intent intent = new Intent(Intent.ACTION_DELETE, uri);
        context.startActivity(intent);
    }

    private void share(Context context, String filePath) {
        Intent shareIntent = new Intent();
        shareIntent.setAction(Intent.ACTION_SEND);
        shareIntent.putExtra(Intent.EXTRA_STREAM, FileUtils.getFileUri(context, filePath));
        shareIntent.setType(FileUtils.getShareType(filePath));
        context.startActivity(Intent.createChooser(shareIntent, ""));
    }
}

================================================
FILE: app/src/main/java/me/pengtao/filetransfer/FileModel.java
================================================
/*
 * Copyright (c) 2018 CPPAlien
 *
 * Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3, 29 June 2007 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://github.com/CPPAlien/FileTransfer/blob/master/LICENSE
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package me.pengtao.filetransfer;

import android.graphics.drawable.Drawable;

/**
 * @author CPPAlien
 */
public class FileModel {
    private String path;
    private String version;
    private String size;
    private String name;
    private String packageName;
    private int fileType;
    private boolean installed;
    private Drawable icon;

    public Drawable getIcon() {
        return icon;
    }

    public void setIcon(Drawable icon) {
        this.icon = icon;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public String getSize() {
        return size;
    }

    public void setSize(String size) {
        this.size = size;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPackageName() {
        return packageName;
    }

    public void setPackageName(String packageName) {
        this.packageName = packageName;
    }

    public boolean isInstalled() {
        return installed;
    }

    public void setInstalled(boolean installed) {
        this.installed = installed;
    }

    public int getFileType() {
        return fileType;
    }

    public FileModel setFileType(final int fileType) {
        this.fileType = fileType;
        return this;
    }
}


================================================
FILE: app/src/main/java/me/pengtao/filetransfer/MainActivity.java
================================================
package me.pengtao.filetransfer;

import android.Manifest;
import android.animation.Animator;
import android.animation.ObjectAnimator;
import android.app.Activity;
import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.res.Resources;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.provider.Settings;
import android.text.TextUtils;
import android.util.DisplayMetrics;
import android.view.Menu;
import android.view.View;
import android.view.animation.AccelerateInterpolator;
import android.widget.Toast;

import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;

import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.hwangjr.rxbus.RxBus;
import com.hwangjr.rxbus.annotation.Subscribe;
import com.hwangjr.rxbus.annotation.Tag;
import com.hwangjr.rxbus.thread.EventThread;

import java.io.File;
import java.io.IOException;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;
import me.pengtao.filetransfer.util.FileType;
import me.pengtao.filetransfer.util.FileUtils;
import timber.log.Timber;

/**
 * @author chris
 */
public class MainActivity extends AppCompatActivity implements Animator.AnimatorListener {
    private static final int WRITE_PERMISSION_CODE = 1;
    private static final int FILE_FETCH_CODE = 2;
    private String mAlreadyWrited = "";
    Unbinder mUnbinder;
    @BindView(R.id.toolbar)
    Toolbar mToolbar;
    @BindView(R.id.fab)
    FloatingActionButton mFab;
    @BindView(R.id.recyclerview)
    RecyclerView mAppList;
    @BindView(R.id.content_main)
    SwipeRefreshLayout mSwipeRefreshLayout;
    List<FileModel> mFileModelList = new ArrayList<>();
    FileListAdapter mAppshelfAdapter;

    public synchronized static Drawable getIconFromPackageName(String packageName, Context
            context) {
        PackageManager pm = context.getPackageManager();
        try {
            PackageInfo pi = pm.getPackageInfo(packageName, 0);
            Context otherAppCtx = context.createPackageContext(packageName, Context
                    .CONTEXT_IGNORE_SECURITY);
            List<Integer> displayMetrics = new ArrayList<>();
            displayMetrics.add(DisplayMetrics.DENSITY_XXXHIGH);
            displayMetrics.add(DisplayMetrics.DENSITY_XXHIGH);
            displayMetrics.add(DisplayMetrics.DENSITY_XHIGH);
            displayMetrics.add(DisplayMetrics.DENSITY_HIGH);
            displayMetrics.add(DisplayMetrics.DENSITY_TV);
            for (int displayMetric : displayMetrics) {
                try {
                    Drawable d = otherAppCtx.getResources().getDrawableForDensity(pi
                            .applicationInfo.icon, displayMetric);
                    if (d != null) {
                        return d;
                    }
                } catch (Resources.NotFoundException e) {
                    // ignore
                }
            }
        } catch (Exception e) {
            // Handle Error here
        }
        ApplicationInfo appInfo;
        try {
            appInfo = pm.getApplicationInfo(packageName, 0);
        } catch (PackageManager.NameNotFoundException e) {
            return null;
        }
        return appInfo.loadIcon(pm);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        mUnbinder = ButterKnife.bind(this);
        setSupportActionBar(mToolbar);

        mToolbar.setOnMenuItemClickListener(item -> {
            switch (item.getItemId()) {
                case R.id.delete_all:
                    if (!mFileModelList.isEmpty()) {
                        showDialog();
                    }
                    break;
                case R.id.add_files:
                    Intent intent = new Intent();
                    intent.setAction(Intent.ACTION_GET_CONTENT);
                    intent.setType("*/*");
                    intent.addCategory(Intent.CATEGORY_OPENABLE);
                    startActivityForResult(intent, FILE_FETCH_CODE);
                    break;
                default:
                    break;
            }
            return false;
        });
        Timber.plant(new Timber.DebugTree());
        RxBus.get().register(this);
        initRecyclerView();
        ActivityCompat.requestPermissions(this,
                new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, WRITE_PERMISSION_CODE);
    }

    @Override
    protected void onResume() {
        super.onResume();
        /*ClipboardManager clipboard = (ClipboardManager)getSystemService(Context.CLIPBOARD_SERVICE);
        if (clipboard != null && clipboard.hasPrimaryClip() && clipboard.getPrimaryClip() != null) {
            ClipData.Item item = clipboard.getPrimaryClip().getItemAt(0);
            if (item != null && item.getText() != null && item.getText().length() > 0 && !item.getText().equals(mAlreadyWrited)) {
                File file = new File(Constants.DIR, "clipboard_" + String.valueOf(System.currentTimeMillis()) + ".txt");
                try {
                    FileUtils.writeByteArrayToFile(file, item.getText().toString().getBytes(), false);
                    Toast.makeText(this, "已把剪切板中内容写入到该文件中", Toast.LENGTH_SHORT).show();
                    RxBus.get().post(Constants.RxBusEventType.LOAD_BOOK_LIST, 0);
                    mAlreadyWrited = item.getText().toString();
                } catch (IOException e) {
                    e.printStackTrace();
                    Toast.makeText(this, "文件写入失败", Toast.LENGTH_SHORT).show();
                }
            }
        }*/
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.item_menu, menu);
        return true;
    }

    @OnClick(R.id.fab)
    public void onClick(View view) {
        if (ActivityCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE)
                == PackageManager.PERMISSION_GRANTED) {
            ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(mFab, "translationY", 0, mFab
                    .getHeight() * 2).setDuration(200L);
            objectAnimator.setInterpolator(new AccelerateInterpolator());
            objectAnimator.addListener(this);
            objectAnimator.start();
        } else {
            AlertDialog.Builder builder = new AlertDialog.Builder(this);
            builder.setTitle(R.string.permission_setting);
            builder.setMessage(R.string.permission_need_des);
            builder.setPositiveButton(R.string.permission_go, (dialog, which) -> {
                Intent intent = new Intent();
                intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
                Uri uri = Uri.fromParts("package", getPackageName(), null);
                intent.setData(uri);
                startActivity(intent);
            });
            builder.setNegativeButton(R.string.cancel, null);
            builder.show();
        }
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        if (mUnbinder != null) {
            mUnbinder.unbind();
        }
        RxBus.get().unregister(this);
    }

    @SuppressWarnings("unused")
    @Subscribe(tags = {@Tag(Constants.RxBusEventType.POPUP_MENU_DIALOG_SHOW_DISMISS)})
    public void onPopupMenuDialogDismiss(Integer type) {
        if (type == Constants.MSG_DIALOG_DISMISS) {
            ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(mFab, "translationY", mFab
                    .getHeight() * 2, 0).setDuration(200L);
            objectAnimator.setInterpolator(new AccelerateInterpolator());
            objectAnimator.start();
        }
    }

    private void showDialog() {
        AlertDialog.Builder builder = new AlertDialog.Builder(this);
        builder.setTitle(R.string.sure_delete_all);
        builder.setPositiveButton(R.string.ok, (dialog, which) -> deleteAll());
        builder.setNegativeButton(R.string.cancel, null);
        builder.show();
    }

    @Override
    public void onAnimationStart(Animator animation) {
        new PopupMenuDialog(this).builder().setCancelable(false)
                .setCanceledOnTouchOutside(true).show();
    }

    @Override
    public void onAnimationEnd(Animator animation) {
    }

    @Override
    public void onAnimationCancel(Animator animation) {
    }

    @Override
    public void onAnimationRepeat(Animator animation) {
    }

    void initRecyclerView() {
        mAppshelfAdapter = new FileListAdapter(this, mFileModelList);
        mAppList.setHasFixedSize(true);
        mAppList.setLayoutManager(new LinearLayoutManager(this));
        mAppList.setAdapter(mAppshelfAdapter);
        RxBus.get().post(Constants.RxBusEventType.LOAD_BOOK_LIST, 0);

        mSwipeRefreshLayout.setColorSchemeResources(
                android.R.color.holo_blue_bright,
                android.R.color.holo_green_light,
                android.R.color.holo_orange_light,
                android.R.color.holo_red_light);
        mSwipeRefreshLayout.setOnRefreshListener(() ->
                RxBus.get().post(Constants.RxBusEventType.LOAD_BOOK_LIST, 0));
    }

    private void handleFiles(String path, long length) {
        FileModel fileModel = new FileModel();
        PackageManager pm = getPackageManager();
        PackageInfo info = pm.getPackageArchiveInfo(path, 0);

        if (info != null) {
            ApplicationInfo appInfo = info.applicationInfo;
            appInfo.sourceDir = path;
            appInfo.publicSourceDir = path;
            String packageName = appInfo.packageName;
            String version = info.versionName;
            Drawable icon = pm.getApplicationIcon(appInfo);
            String appName = pm.getApplicationLabel(appInfo).toString();
            if (TextUtils.isEmpty(appName)) {
                appName = getApplicationName(packageName);
            }
            if (icon == null) {
                icon = getIconFromPackageName(packageName, this);
            }
            fileModel.setName(appName);
            fileModel.setPackageName(packageName);
            fileModel.setPath(path);
            fileModel.setSize(getFileSize(length));
            fileModel.setVersion(version);
            fileModel.setIcon(icon);
            fileModel.setFileType(FileType.TYPE_APK);
            fileModel.setInstalled(isAvailable(this, packageName));
            mFileModelList.add(fileModel);
        } else {
            fileModel.setFileType(FileUtils.getFileType(path));
            fileModel.setPath(path);
            String[] pathItems = path.split(File.separator);
            fileModel.setName(pathItems[pathItems.length - 1]);
            fileModel.setSize(getFileSize(length));
            Drawable icon = ContextCompat.getDrawable(this, FileUtils.getFileTypeIcon(path));
            fileModel.setIcon(icon);
            mFileModelList.add(fileModel);
        }
    }

    private String getFileSize(long length) {
        DecimalFormat df = new DecimalFormat("######0.0");
        if (length < 1024.f) {
            return (int) length + "B";
        } else if (length < 1024 * 1024.f) {
            return df.format(length / 1024.f) + "K";
        } else if (length < 1024 * 1024 * 1024.f) {
            return df.format((length / 1024.f / 1024.f)) + "M";
        }
        return df.format(length / 1024.f / 1024.f / 1024.f) + "G";
    }

    @SuppressWarnings("unused")
    @Subscribe(thread = EventThread.IO, tags = {@Tag(Constants.RxBusEventType.LOAD_BOOK_LIST)})
    public void loadFileList(Integer type) {
        File dir = Constants.DIR;
        if (dir.exists() && dir.isDirectory()) {
            File[] files = dir.listFiles();
            if (files == null) {
                return;
            }

            FileUtils.sortWithLastModified(files);
            mFileModelList.clear();
            for (File file : files) {
                handleFiles(file.getAbsolutePath(), file.length());
            }
        }
        runOnUiThread(() -> {
            mSwipeRefreshLayout.setRefreshing(false);
            mAppshelfAdapter.notifyDataSetChanged();
        });
    }

    public String getApplicationName(String packageName) {
        PackageManager packageManager = null;
        ApplicationInfo applicationInfo;
        try {
            packageManager = getApplicationContext().getPackageManager();
            applicationInfo = packageManager.getApplicationInfo(packageName, 0);
        } catch (PackageManager.NameNotFoundException e) {
            applicationInfo = null;
        }
        if (applicationInfo != null) {
            return (String) packageManager.getApplicationLabel(applicationInfo);
        }
        return packageName;
    }

    /**
     * 判断相对应的APP是否存在
     *
     * @param context                                                                  context
     * @param packageName(包名)(若想判断QQ,则改为com.tencent.mobileqq,若想判断微信,则改为com.tencent.mm)
     * @return
     */
    public boolean isAvailable(Context context, String packageName) {
        PackageManager packageManager = context.getPackageManager();

        //获取手机系统的所有APP包名,然后进行一一比较
        List<PackageInfo> pinfo = packageManager.getInstalledPackages(0);
        for (int i = 0; i < pinfo.size(); i++) {
            if ((pinfo.get(i)).packageName
                    .equalsIgnoreCase(packageName)) {
                return true;
            }
        }
        return false;
    }

    //删除所有文件
    private void deleteAll() {
        File dir = Constants.DIR;
        if (dir.exists() && dir.isDirectory()) {
            File[] fileNames = dir.listFiles();
            if (fileNames != null) {
                for (File fileName : fileNames) {
                    fileName.delete();
                }
            }
        }
        RxBus.get().post(Constants.RxBusEventType.LOAD_BOOK_LIST, 0);
    }

    @Override
    protected void onActivityResult(final int requestCode, final int resultCode, final Intent
            data) {
        super.onActivityResult(requestCode, resultCode, data);
        if (requestCode == FILE_FETCH_CODE && resultCode == Activity.RESULT_OK) {
            Uri uri = data.getData();
            if (uri != null) {
                try {
                    ContentResolver content = getContentResolver();
                    FileUtils.copyFile(content.openInputStream(data.getData()), Constants.DIR
                            + File.separator + FileUtils.getFileName(this, uri));
                    Toast.makeText(this, R.string.please_refresh_web, Toast.LENGTH_LONG).show();
                    RxBus.get().post(Constants.RxBusEventType.LOAD_BOOK_LIST, 0);
                } catch (IOException e) {
                    Toast.makeText(this, R.string.read_file_failed, Toast.LENGTH_SHORT).show();
                }
            } else {
                Toast.makeText(this, R.string.read_file_failed, Toast.LENGTH_SHORT).show();
            }
        }
    }
}


================================================
FILE: app/src/main/java/me/pengtao/filetransfer/PopupMenuDialog.java
================================================
package me.pengtao.filetransfer;

import android.app.Dialog;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.provider.Settings;
import android.view.Display;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

import com.hwangjr.rxbus.RxBus;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;
import me.pengtao.filetransfer.util.WifiUtils;

/**
 * @author chris
 */
public class PopupMenuDialog {
    private Unbinder mUnbinder;
    @BindView(R.id.popup_menu_title)
    TextView mTxtTitle;
    @BindView(R.id.popup_menu_subtitle)
    TextView mTxtSubTitle;
    @BindView(R.id.shared_wifi_state)
    ImageView mImgLanState;
    @BindView(R.id.shared_wifi_state_hint)
    TextView mTxtStateHint;
    @BindView(R.id.shared_wifi_address)
    TextView mTxtAddress;
    @BindView(R.id.shared_wifi_settings)
    Button mBtnWifiSettings;
    @BindView(R.id.shared_wifi_button_split_line)
    View mButtonSplitLine;
    private Context context;
    private Dialog dialog;
    private Display display;

    public PopupMenuDialog(Context context) {
        this.context = context;
        WindowManager windowManager = (WindowManager) context
                .getSystemService(Context.WINDOW_SERVICE);
        display = windowManager.getDefaultDisplay();
        RxBus.get().register(this);
    }

    public PopupMenuDialog builder() {
        View view = LayoutInflater.from(context).inflate(
                R.layout.layout_popup_menu_dialog, null);

        view.setMinimumWidth(display.getWidth());

        dialog = new Dialog(context, R.style.PopupMenuDialogStyle);
        dialog.setContentView(view);
        mUnbinder = ButterKnife.bind(this, dialog);
        dialog.setOnDismissListener(this::onDialogDismiss);

        Window dialogWindow = dialog.getWindow();
        dialogWindow.setGravity(Gravity.LEFT | Gravity.BOTTOM);
        WindowManager.LayoutParams lp = dialogWindow.getAttributes();
        lp.x = 0;
        lp.y = 0;
        dialogWindow.setAttributes(lp);

        return this;
    }

    public PopupMenuDialog setCancelable(boolean cancel) {
        dialog.setCancelable(cancel);
        return this;
    }

    public PopupMenuDialog setCanceledOnTouchOutside(boolean cancel) {
        dialog.setCanceledOnTouchOutside(cancel);
        return this;
    }

    public void show() {
        dialog.show();
        String ip = WifiUtils.getDeviceIpAddress();
        onWifiConnected(ip);
        WebService.start(context);
    }

    @OnClick({R.id.shared_wifi_cancel, R.id.shared_wifi_settings})
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.shared_wifi_cancel:
                dialog.dismiss();
                break;
            case R.id.shared_wifi_settings:
                context.startActivity(new Intent(Settings.ACTION_WIFI_SETTINGS));
                break;
            default:
                break;
        }
    }

    void onWifiConnected(String ipAddr) {
        mTxtTitle.setText(R.string.wlan_enabled);
        mTxtTitle.setTextColor(context.getResources().getColor(R.color.colorWifiConnected));
        mImgLanState.setImageResource(R.drawable.shared_wifi_enable);
        mTxtStateHint.setText(R.string.pls_input_the_following_address_in_pc_browser);
        String address = String.format(context.getString(R.string.http_address), ipAddr, Constants.HTTP_PORT);
        mTxtAddress.setText(address);
        mBtnWifiSettings.setOnClickListener(v -> {
            ClipboardManager cm = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
            ClipData mClipData = ClipData.newPlainText("Label", address);
            cm.setPrimaryClip(mClipData);
            Toast.makeText(context, context.getString(R.string.copy_toast), Toast.LENGTH_LONG).show();
        });
    }

    void onDialogDismiss(DialogInterface dialog) {
        if (mUnbinder != null) {
            mUnbinder.unbind();
            RxBus.get().post(Constants.RxBusEventType.POPUP_MENU_DIALOG_SHOW_DISMISS, Constants.MSG_DIALOG_DISMISS);
            //unregisterWifiConnectChangedReceiver();
            RxBus.get().unregister(PopupMenuDialog.this);
        }
    }
}


================================================
FILE: app/src/main/java/me/pengtao/filetransfer/TransferApp.java
================================================
/*
 * Copyright (c) 2018 CPPAlien
 *
 * Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3, 29 June 2007 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://github.com/CPPAlien/FileTransfer/blob/master/LICENSE
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package me.pengtao.filetransfer;

import android.app.Application;

/**
 * @author CPPAlien
 */
public class TransferApp extends Application {
    @Override
    public void onCreate() {
        super.onCreate();
    }
}


================================================
FILE: app/src/main/java/me/pengtao/filetransfer/WebService.java
================================================
package me.pengtao.filetransfer;

import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.os.IBinder;
import android.text.TextUtils;

import com.hwangjr.rxbus.RxBus;
import com.koushikdutta.async.AsyncServer;
import com.koushikdutta.async.ByteBufferList;
import com.koushikdutta.async.DataEmitter;
import com.koushikdutta.async.http.body.MultipartFormDataBody;
import com.koushikdutta.async.http.body.Part;
import com.koushikdutta.async.http.body.UrlEncodedFormBody;
import com.koushikdutta.async.http.server.AsyncHttpServer;
import com.koushikdutta.async.http.server.AsyncHttpServerRequest;
import com.koushikdutta.async.http.server.AsyncHttpServerResponse;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.net.URLEncoder;
import java.text.DecimalFormat;

import timber.log.Timber;

public class WebService extends Service {
    static final String ACTION_START_WEB_SERVICE = "me.pengtao.filetransfer.action" +
            ".START_WEB_SERVICE";
    static final String ACTION_STOP_WEB_SERVICE = "me.pengtao.filetransfer.action" +
            ".STOP_WEB_SERVICE";
    private static final String TEXT_CONTENT_TYPE = "text/html;charset=utf-8";
    private static final String CSS_CONTENT_TYPE = "text/css;charset=utf-8";
    private static final String BINARY_CONTENT_TYPE = "application/octet-stream";
    private static final String JS_CONTENT_TYPE = "application/javascript";
    private static final String PNG_CONTENT_TYPE = "application/x-png";
    private static final String JPG_CONTENT_TYPE = "application/jpeg";
    private static final String SWF_CONTENT_TYPE = "application/x-shockwave-flash";
    private static final String WOFF_CONTENT_TYPE = "application/x-font-woff";
    private static final String TTF_CONTENT_TYPE = "application/x-font-truetype";
    private static final String SVG_CONTENT_TYPE = "image/svg+xml";
    private static final String EOT_CONTENT_TYPE = "image/vnd.ms-fontobject";
    private static final String MP3_CONTENT_TYPE = "audio/mp3";
    private static final String MP4_CONTENT_TYPE = "video/mpeg4";
    FileUploadHolder fileUploadHolder = new FileUploadHolder();
    private AsyncHttpServer server = new AsyncHttpServer();
    private AsyncServer mAsyncServer = new AsyncServer();

    public static void start(Context context) {
        Intent intent = new Intent(context, WebService.class);
        intent.setAction(ACTION_START_WEB_SERVICE);
        context.startService(intent);
    }

    public static void stop(Context context) {
        Intent intent = new Intent(context, WebService.class);
        intent.setAction(ACTION_STOP_WEB_SERVICE);
        context.startService(intent);
    }

    @Override
    public IBinder onBind(Intent intent) {
        return null;
    }

    @Override
    public int onStartCommand(Intent intent, int flags, int startId) {
        if (intent != null) {
            String action = intent.getAction();
            if (ACTION_START_WEB_SERVICE.equals(action)) {
                startServer();
            } else if (ACTION_STOP_WEB_SERVICE.equals(action)) {
                stopSelf();
            }
        }
        return super.onStartCommand(intent, flags, startId);
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        if (server != null) {
            server.stop();
        }
        if (mAsyncServer != null) {
            mAsyncServer.stop();
        }
    }

    private void startServer() {
        server.get("/images/.*", this::sendResources);
        server.get("/scripts/.*", this::sendResources);
        server.get("/css/.*", this::sendResources);
        //index page
        server.get("/", (AsyncHttpServerRequest request, AsyncHttpServerResponse response) -> {
            try {
                response.send(getIndexContent());
            } catch (IOException e) {
                e.printStackTrace();
                response.code(500).end();
            }
        });
        //query upload list
        server.get("/files", (AsyncHttpServerRequest request, AsyncHttpServerResponse response) -> {
            JSONArray array = new JSONArray();
            File dir = Constants.DIR;
            if (dir.exists() && dir.isDirectory()) {
                String[] fileNames = dir.list();
                if (fileNames != null) {
                    for (String fileName : fileNames) {
                        File file = new File(dir, fileName);
                        if (file.exists() && file.isFile()) {
                            try {
                                JSONObject jsonObject = new JSONObject();
                                jsonObject.put("name", fileName);
                                long fileLen = file.length();
                                DecimalFormat df = new DecimalFormat("0.00");
                                if (fileLen > 1024 * 1024) {
                                    jsonObject.put("size", df.format(fileLen * 1f / 1024 / 1024)
                                            + "MB");
                                } else if (fileLen > 1024) {
                                    jsonObject.put("size", df.format(fileLen * 1f / 1024) + "KB");
                                } else {
                                    jsonObject.put("size", fileLen + "B");
                                }
                                array.put(jsonObject);
                            } catch (JSONException e) {
                                e.printStackTrace();
                            }
                        }
                    }
                }
            }
            response.send(array.toString());
        });
        //delete
        server.post("/files/.*", (AsyncHttpServerRequest request, AsyncHttpServerResponse
                response) -> {
            final UrlEncodedFormBody body = (UrlEncodedFormBody) request.getBody();
            if ("delete".equalsIgnoreCase(body.get().getString("_method"))) {
                String path = request.getPath().replace("/files/", "");
                try {
                    path = URLDecoder.decode(path, "utf-8");
                } catch (UnsupportedEncodingException e) {
                    e.printStackTrace();
                }
                File file = new File(Constants.DIR, path);
                if (file.exists() && file.isFile() && file.delete()) {
                    RxBus.get().post(Constants.RxBusEventType.LOAD_BOOK_LIST, 0);
                }
            }
            response.end();
        });
        //download
        server.get("/files/.*", (AsyncHttpServerRequest request, AsyncHttpServerResponse
                response) -> {
            String path = request.getPath().replace("/files/", "");
            try {
                path = URLDecoder.decode(path, "utf-8");
            } catch (UnsupportedEncodingException e) {
                e.printStackTrace();
            }
            File file = new File(Constants.DIR, path);
            if (file.exists() && file.isFile()) {
                try {
                    response.getHeaders().add("Content-Disposition", "attachment;filename=" +
                            URLEncoder.encode(file.getName(), "utf-8"));
                } catch (UnsupportedEncodingException e) {
                    e.printStackTrace();
                }
                response.sendFile(file);
                return;
            }
            response.code(404).send("Not found!");
        });
        //upload
        server.post("/files", (AsyncHttpServerRequest request, AsyncHttpServerResponse response)
                        -> {
                    final MultipartFormDataBody body = (MultipartFormDataBody) request.getBody();
                    body.setMultipartCallback((Part part) -> {
                        if (part.isFile()) {
                            body.setDataCallback((DataEmitter emitter, ByteBufferList bb) -> {
                                fileUploadHolder.write(bb.getAllByteArray());
                                bb.recycle();
                            });
                        } else {
                            if (body.getDataCallback() == null) {
                                body.setDataCallback((DataEmitter emitter, ByteBufferList bb) -> {
                                    try {
                                        String fileName = URLDecoder.decode(new String(bb
                                                .getAllByteArray()), "UTF-8");
                                        fileUploadHolder.setFileName(fileName);
                                    } catch (UnsupportedEncodingException e) {
                                        e.printStackTrace();
                                    }
                                    bb.recycle();
                                });
                            }
                        }
                    });
                    request.setEndCallback((Exception e) -> {
                        fileUploadHolder.reset();
                        response.end();
                        RxBus.get().post(Constants.RxBusEventType.LOAD_BOOK_LIST, 0);
                    });
                }
        );
        server.get("/progress/.*", (final AsyncHttpServerRequest request,
                                    final AsyncHttpServerResponse response) -> {
                    JSONObject res = new JSONObject();

                    String path = request.getPath().replace("/progress/", "");

                    if (path.equals(fileUploadHolder.fileName)) {
                        try {
                            res.put("fileName", fileUploadHolder.fileName);
                            res.put("size", fileUploadHolder.totalSize);
                            res.put("progress", fileUploadHolder.fileOutPutStream == null ? 1 :
                                    0.1);
                        } catch (JSONException e) {
                            e.printStackTrace();
                        }
                    }

                    response.send(res);
                }

        );
        server.listen(mAsyncServer, Constants.HTTP_PORT);
    }

    private String getIndexContent() throws IOException {
        BufferedInputStream bInputStream = null;
        try {
            bInputStream = new BufferedInputStream(getAssets().open("wifi/index.html"));
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            int len = 0;
            byte[] tmp = new byte[10240];
            while ((len = bInputStream.read(tmp)) > 0) {
                baos.write(tmp, 0, len);
            }
            return new String(baos.toByteArray(), "utf-8");
        } catch (IOException e) {
            e.printStackTrace();
            throw e;
        } finally {
            if (bInputStream != null) {
                try {
                    bInputStream.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }

    private void sendResources(final AsyncHttpServerRequest request, final
    AsyncHttpServerResponse response) {
        try {
            String fullPath = request.getPath();
            fullPath = fullPath.replace("%20", " ");
            String resourceName = fullPath;
            if (resourceName.startsWith("/")) {
                resourceName = resourceName.substring(1);
            }
            if (resourceName.indexOf("?") > 0) {
                resourceName = resourceName.substring(0, resourceName.indexOf("?"));
            }
            if (!TextUtils.isEmpty(getContentTypeByResourceName(resourceName))) {
                response.setContentType(getContentTypeByResourceName(resourceName));
            }
            BufferedInputStream bInputStream = new BufferedInputStream(getAssets().open("wifi/" +
                    resourceName));
            response.sendStream(bInputStream, bInputStream.available());
        } catch (IOException e) {
            e.printStackTrace();
            response.code(404).end();
            return;
        }
    }

    private String getContentTypeByResourceName(String resourceName) {
        if (resourceName.endsWith(".css")) {
            return CSS_CONTENT_TYPE;
        } else if (resourceName.endsWith(".js")) {
            return JS_CONTENT_TYPE;
        } else if (resourceName.endsWith(".swf")) {
            return SWF_CONTENT_TYPE;
        } else if (resourceName.endsWith(".png")) {
            return PNG_CONTENT_TYPE;
        } else if (resourceName.endsWith(".jpg") || resourceName.endsWith(".jpeg")) {
            return JPG_CONTENT_TYPE;
        } else if (resourceName.endsWith(".woff")) {
            return WOFF_CONTENT_TYPE;
        } else if (resourceName.endsWith(".ttf")) {
            return TTF_CONTENT_TYPE;
        } else if (resourceName.endsWith(".svg")) {
            return SVG_CONTENT_TYPE;
        } else if (resourceName.endsWith(".eot")) {
            return EOT_CONTENT_TYPE;
        } else if (resourceName.endsWith(".mp3")) {
            return MP3_CONTENT_TYPE;
        } else if (resourceName.endsWith(".mp4")) {
            return MP4_CONTENT_TYPE;
        }
        return "";
    }

    public class FileUploadHolder {
        private String fileName;
        private File recievedFile;
        private BufferedOutputStream fileOutPutStream;
        private long totalSize;

        public BufferedOutputStream getFileOutPutStream() {
            return fileOutPutStream;
        }

        public void setFileName(String fileName) {
            this.fileName = fileName;
            totalSize = 0;
            if (!Constants.DIR.exists()) {
                Constants.DIR.mkdirs();
            }
            this.recievedFile = new File(Constants.DIR, this.fileName);
            Timber.d(recievedFile.getAbsolutePath());
            try {
                fileOutPutStream = new BufferedOutputStream(new FileOutputStream(recievedFile));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        }

        public void reset() {
            if (fileOutPutStream != null) {
                try {
                    fileOutPutStream.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            fileOutPutStream = null;
        }

        public void write(byte[] data) {
            if (fileOutPutStream != null) {
                try {
                    fileOutPutStream.write(data);
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            totalSize += data.length;
        }
    }
}


================================================
FILE: app/src/main/java/me/pengtao/filetransfer/receiver/PackageStateReceiver.java
================================================
/*
 * Copyright (c) 2018 CPPAlien
 *
 * Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3, 29 June 2007 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://github.com/CPPAlien/FileTransfer/blob/master/LICENSE
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package me.pengtao.filetransfer.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

import com.hwangjr.rxbus.RxBus;

import me.pengtao.filetransfer.Constants;

/**
 * @author CPPAlien
 */
public class PackageStateReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        RxBus.get().post(Constants.RxBusEventType.LOAD_BOOK_LIST, 0);
    }
}

================================================
FILE: app/src/main/java/me/pengtao/filetransfer/util/FileType.java
================================================
/*
 * Copyright (c) 2018 CPPAlien
 *
 * Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3, 29 June 2007 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://github.com/CPPAlien/FileTransfer/blob/master/LICENSE
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package me.pengtao.filetransfer.util;

/**
 * @author CPPAlien
 */
public class FileType {
    public static final String FileTypes[][] = {
            // File Image
            {".png", ".jpg", ".jpeg", ".gif", ".bmp"},
            // File Audio
            {".mp3", ".wav", ".ogg", "midi"},
            // File Video
            {".mp4", ".rmvb", ".avi", ".flv", ".3gp"},
            // File Web Text
            {".jsp", ".html", ".htm", ".js", ".php"},
            // File Text
            {".txt", ".c", ".cpp", ".xml", ".py", ".json", ".log"},
            // File Excel
            {".xls", ".xlsx"},
            // File Word
            {".doc", ".docx"},
            // File PPT
            {".ppt", ".pptx"},
            // File PDF
            {".pdf"},
            // File Package
            {".jar", ".zip", ".rar", ".gz"},
            // APK
            {".apk"}};
    public static final int TYPE_IMAGE = 100;
    public static final int TYPE_AUDIO = 200;
    public static final int TYPE_VIDEO = 300;
    public static final int TYPE_WEB = 400;
    public static final int TYPE_TEXT = 500;
    public static final int TYPE_EXCEL = 600;
    public static final int TYPE_WORD = 700;
    public static final int TYPE_PPT = 800;
    public static final int TYPE_PDF = 900;
    public static final int TYPE_PACKAGE = 1000;
    public static final int TYPE_APK = 1100;
    public static final int TYPE_UNKNOWN = -1;
    public static final int TypeStart[] = {TYPE_IMAGE, TYPE_AUDIO, TYPE_VIDEO,
            TYPE_WEB, TYPE_TEXT, TYPE_EXCEL, TYPE_WORD, TYPE_PPT, TYPE_PDF, TYPE_PACKAGE, TYPE_APK};
}


================================================
FILE: app/src/main/java/me/pengtao/filetransfer/util/FileUtils.java
================================================
/*
 * Copyright (c) 2018 CPPAlien
 *
 * Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3, 29 June 2007 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://github.com/CPPAlien/FileTransfer/blob/master/LICENSE
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package me.pengtao.filetransfer.util;

import android.annotation.SuppressLint;
import android.app.AlertDialog;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.net.Uri;
import android.os.Build;
import android.provider.OpenableColumns;

import androidx.core.content.FileProvider;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Arrays;

import me.pengtao.filetransfer.R;

/**
 * @author CPPAlien
 */
public class FileUtils {
    /**
     * 获得文件的 uri
     *
     * @param context  context
     * @param filePath 文件路径
     * @return uri
     */
    public static Uri getFileUri(Context context, String filePath) {
        File file = new File(filePath);
        return FileProvider.getUriForFile(context, context.getPackageName() + "" +
                ".fileprovider", file);
    }

    public static boolean openFile(String filePath, Context context) {
        int fileType = getFileType(filePath);
        File file = new File(filePath);

        if (file.isFile()) {
            Intent intent = null;
            Uri contentUri = getFileUri(context, filePath);
            switch (fileType) {
                case FileType.TYPE_IMAGE:
                    intent = getImageFileIntent(contentUri);
                    break;
                case FileType.TYPE_AUDIO:
                    intent = getAudioFileIntent(contentUri);
                    break;
                case FileType.TYPE_VIDEO:
                    intent = getVideoFileIntent(contentUri);
                    break;
                case FileType.TYPE_WEB:
                    intent = getHtmlFileIntent(contentUri);
                    break;
                case FileType.TYPE_TEXT:
                    intent = getTextFileIntent(contentUri);
                    break;
                case FileType.TYPE_EXCEL:
                    intent = getExcelFileIntent(contentUri);
                    break;
                case FileType.TYPE_WORD:
                    intent = getWordFileIntent(contentUri);
                    break;
                case FileType.TYPE_PPT:
                    intent = getPPTFileIntent(contentUri);
                    break;
                case FileType.TYPE_PDF:
                    intent = getPdfFileIntent(contentUri);
                    break;
                case FileType.TYPE_PACKAGE:
                case FileType.TYPE_APK:
                    intent = getApkFileIntent(context, file);
                    break;
                default:
                    new AlertDialog.Builder(context)
                            .setMessage(R.string.no_program_open_it)
                            .setPositiveButton(R.string.ok, null)
                            .show();
                    break;
            }
            if (intent != null) {
                intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
                context.startActivity(intent);
                return true;
            }
        }
        return false;
    }

    public static int getFileType(String filePath) {
        File file = new File(filePath);
        String fileName = file.getName();

        for (int i = 0; i < FileType.FileTypes.length; i++) {
            int j = checkStringEnds(fileName, FileType.FileTypes[i]);
            if (j == -1) {
                continue;
            }
            return FileType.TypeStart[i];
        }
        return FileType.TYPE_UNKNOWN;
    }

    private static int checkStringEnds(String item, String[] array) {
        for (int i = 0; i < array.length; i++) {
            if (item.toLowerCase().endsWith(array[i])) {
                return i;
            }
        }

        return -1;
    }

    public static int getFileTypeIcon(String path) {
        int fileType = getFileType(path);
        switch (fileType) {
            case FileType.TYPE_IMAGE:
                return R.drawable.image;
            case FileType.TYPE_AUDIO:
                return R.drawable.audio;
            case FileType.TYPE_VIDEO:
                return R.drawable.vedio;
            case FileType.TYPE_WEB:
                return R.drawable.web;
            case FileType.TYPE_TEXT:
                return R.drawable.text;
            case FileType.TYPE_EXCEL:
                return R.drawable.excel;
            case FileType.TYPE_WORD:
                return R.drawable.doc;
            case FileType.TYPE_PPT:
                return R.drawable.ppt;
            case FileType.TYPE_PDF:
                return R.drawable.pdf;
            case FileType.TYPE_PACKAGE:
                return R.drawable.zip;
            default:
                return R.drawable.other_file;
        }
    }

    public static String getShareType(String path) {
        int fileType = getFileType(path);
        switch (fileType) {
            case FileType.TYPE_IMAGE:
                return "image/*";
            case FileType.TYPE_AUDIO:
                return "audio/*";
            case FileType.TYPE_VIDEO:
                return "video/*";
            case FileType.TYPE_WEB:
            case FileType.TYPE_TEXT:
                return "text/*";
            case FileType.TYPE_EXCEL:
            case FileType.TYPE_WORD:
            case FileType.TYPE_PPT:
            case FileType.TYPE_PDF:
            case FileType.TYPE_PACKAGE:
            case FileType.TYPE_APK:
                return "application/*";
            default:
                return "*/*";
        }
    }

    public static void copyFile(InputStream in, String targetLocation) throws IOException {
        OutputStream out = new FileOutputStream(targetLocation);
        byte[] buf = new byte[1024];
        int len;
        while ((len = in.read(buf)) > 0) {
            out.write(buf, 0, len);
        }
        in.close();
        out.close();
    }

    public static String getFileName(Context context, Uri uri) {
        String result = null;
        if (uri.getScheme().equals("content")) {
            try (Cursor cursor = context.getContentResolver().query(uri, null, null, null, null)) {
                if (cursor != null && cursor.moveToFirst()) {
                    result = cursor.getString(cursor.getColumnIndex(OpenableColumns.DISPLAY_NAME));
                }
            }
        }
        if (result == null) {
            result = uri.getPath();
            int cut = result.lastIndexOf('/');
            if (cut != -1) {
                result = result.substring(cut + 1);
            }
        }
        return result;
    }

    private static Intent getHtmlFileIntent(Uri uri) {
        Intent intent = new Intent("android.intent.action.VIEW");
        intent.setDataAndType(uri, "text/html");
        return intent;
    }

    private static Intent getImageFileIntent(Uri uri) {
        Intent intent = new Intent("android.intent.action.VIEW");
        intent.addCategory("android.intent.category.DEFAULT");
        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        intent.setDataAndType(uri, "image/*");
        return intent;
    }

    private static Intent getPdfFileIntent(Uri uri) {
        Intent intent = new Intent("android.intent.action.VIEW");
        intent.addCategory("android.intent.category.DEFAULT");
        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        intent.setDataAndType(uri, "application/pdf");
        return intent;
    }

    private static Intent getTextFileIntent(Uri uri) {
        Intent intent = new Intent("android.intent.action.VIEW");
        intent.addCategory("android.intent.category.DEFAULT");
        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        intent.setDataAndType(uri, "text/plain");
        return intent;
    }

    private static Intent getAudioFileIntent(Uri uri) {
        Intent intent = new Intent("android.intent.action.VIEW");
        intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
        intent.putExtra("oneshot", 0);
        intent.putExtra("configchange", 0);
        intent.setDataAndType(uri, "audio/*");
        return intent;
    }

    private static Intent getVideoFileIntent(Uri uri) {
        Intent intent = new Intent("android.intent.action.VIEW");
        intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
        intent.putExtra("oneshot", 0);
        intent.putExtra("configchange", 0);
        intent.setDataAndType(uri, "video/*");
        return intent;
    }

    private static Intent getWordFileIntent(Uri uri) {
        Intent intent = new Intent("android.intent.action.VIEW");
        intent.addCategory("android.intent.category.DEFAULT");
        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        intent.setDataAndType(uri, "application/msword");
        return intent;
    }

    private static Intent getExcelFileIntent(Uri uri) {
        Intent intent = new Intent("android.intent.action.VIEW");
        intent.addCategory("android.intent.category.DEFAULT");
        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        intent.setDataAndType(uri, "application/vnd.ms-excel");
        return intent;
    }

    private static Intent getPPTFileIntent(Uri uri) {
        Intent intent = new Intent("android.intent.action.VIEW");
        intent.addCategory("android.intent.category.DEFAULT");
        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        intent.setDataAndType(uri, "application/vnd.ms-powerpoint");
        return intent;
    }

    private static Intent getApkFileIntent(Context context, File file) {
        Intent intent = new Intent(Intent.ACTION_VIEW);
        //兼容7.0
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
            intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
            Uri contentUri = FileProvider.getUriForFile(context, context.getPackageName() + "" +
                    ".fileprovider", file);
            intent.setDataAndType(contentUri, "application/vnd.android.package-archive");
        } else {
            intent.setDataAndType(Uri.fromFile(file), "application/vnd.android.package-archive");
            intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        }
        return intent;
    }

    public static void sortWithLastModified(File[] files) {
        Arrays.sort(files, (f1, f2) -> {
            long diff = f1.lastModified() - f2.lastModified();
            if (diff > 0) {
                return -1;
            } else if (diff == 0) {
                return 0;
            } else {
                return 1;
            }
        });
    }

    /**
     * Writes a byte array to a file creating the file if it does not exist.
     *
     * @param file  the file to write to
     * @param data  the content to write to the file
     * @param append if {@code true}, then bytes will be added to the
     * end of the file rather than overwriting
     * @throws IOException in case of an I/O error
     * @since IO 2.1
     */
    public static void writeByteArrayToFile(File file, byte[] data, boolean append) throws IOException {
        OutputStream out = null;
        try {
            out = openOutputStream(file, append);
            out.write(data);
            out.close(); // don't swallow close Exception if copy completes normally
        } finally {
            if (out != null) {
                out.close();
            }
        }
    }

    private static FileOutputStream openOutputStream(File file, boolean append) throws IOException {
        if (file.exists()) {
            if (file.isDirectory()) {
                throw new IOException("File '" + file + "' exists but is a directory");
            }
            if (!file.canWrite()) {
                throw new IOException("File '" + file + "' cannot be written to");
            }
        } else {
            File parent = file.getParentFile();
            if (parent != null) {
                if (!parent.mkdirs() && !parent.isDirectory()) {
                    throw new IOException("Directory '" + parent + "' could not be created");
                }
            }
        }
        return new FileOutputStream(file, append);
    }
}


================================================
FILE: app/src/main/java/me/pengtao/filetransfer/util/WifiUtils.java
================================================
package me.pengtao.filetransfer.util;

import android.util.Log;

import java.net.InetAddress;
import java.net.NetworkInterface;
import java.net.SocketException;
import java.util.Enumeration;

/**
 * @author chris
 */
public class WifiUtils {
    private static final String TAG = "WifiUtils";

    public static String getDeviceIpAddress() {
        String deviceIpAddress = "###.###.###.###";

        try {
            for (Enumeration<NetworkInterface> enumeration =
                 NetworkInterface.getNetworkInterfaces(); enumeration.hasMoreElements(); ) {
                NetworkInterface networkInterface = enumeration.nextElement();

                for (Enumeration<InetAddress> enumerationIpAddr =
                     networkInterface.getInetAddresses(); enumerationIpAddr.hasMoreElements(); ) {
                    InetAddress inetAddress = enumerationIpAddr.nextElement();

                    if (!inetAddress.isLoopbackAddress() && inetAddress.getAddress().length == 4) {
                        deviceIpAddress = inetAddress.getHostAddress();
                    }
                }
            }
        } catch (SocketException e) {
            Log.e(TAG, "SocketException:" + e.getMessage());
        }

        return deviceIpAddress;
    }
}


================================================
FILE: app/src/main/res/anim/popup_menu_dialog_in.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<translate xmlns:android="http://schemas.android.com/apk/res/android"
    android:duration="200"
    android:fromYDelta="100%"
    android:toYDelta="0" />


================================================
FILE: app/src/main/res/anim/popup_menu_dialog_out.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<translate xmlns:android="http://schemas.android.com/apk/res/android"
    android:duration="200"
    android:fromYDelta="0"
    android:toYDelta="100%" />


================================================
FILE: app/src/main/res/drawable/ic_add.xml
================================================
<!--
  ~ Copyright (c) 2018 CPPAlien
  ~
  ~ Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3, 29 June 2007 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~     https://github.com/CPPAlien/FileTransfer/blob/master/LICENSE
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<vector android:height="24dp" android:viewportHeight="1024.0"
    android:viewportWidth="1024.0" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
    <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"/>
</vector>


================================================
FILE: app/src/main/res/drawable/ic_delete.xml
================================================
<!--
  ~ Copyright (c) 2018 CPPAlien
  ~
  ~ Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3, 29 June 2007 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~     https://github.com/CPPAlien/FileTransfer/blob/master/LICENSE
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<vector xmlns:android="http://schemas.android.com/apk/res/android"
        android:width="16dp"
        android:height="16dp"
        android:viewportWidth="1024.0"
        android:viewportHeight="1024.0">
    <path
        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"
        android:fillColor="#ffffff"/>
</vector>


================================================
FILE: app/src/main/res/drawable/ic_launcher_background.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<vector
    android:height="108dp"
    android:width="108dp"
    android:viewportHeight="108"
    android:viewportWidth="108"
    xmlns:android="http://schemas.android.com/apk/res/android">
    <path android:fillColor="#26A69A"
          android:pathData="M0,0h108v108h-108z"/>
    <path android:fillColor="#00000000" android:pathData="M9,0L9,108"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M19,0L19,108"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M29,0L29,108"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M39,0L39,108"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M49,0L49,108"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M59,0L59,108"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M69,0L69,108"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M79,0L79,108"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M89,0L89,108"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M99,0L99,108"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M0,9L108,9"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M0,19L108,19"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M0,29L108,29"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M0,39L108,39"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M0,49L108,49"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M0,59L108,59"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M0,69L108,69"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M0,79L108,79"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M0,89L108,89"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M0,99L108,99"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M19,29L89,29"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M19,39L89,39"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M19,49L89,49"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M19,59L89,59"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M19,69L89,69"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M19,79L89,79"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M29,19L29,89"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M39,19L39,89"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M49,19L49,89"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M59,19L59,89"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M69,19L69,89"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
    <path android:fillColor="#00000000" android:pathData="M79,19L79,89"
          android:strokeColor="#33FFFFFF" android:strokeWidth="0.8"/>
</vector>


================================================
FILE: app/src/main/res/drawable/shape_common_bg_frame10.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
    <stroke
        android:width="1dp"
        android:color="#3399ff"/>
    <padding
        android:bottom="1dp"
        android:left="1dp"
        android:right="1dp"
        android:top="1dp"/>
    <corners android:radius="5dp"/>
    <solid android:color="#3399ff"/>
    //背景色
</shape>

================================================
FILE: app/src/main/res/drawable/shape_red_bg_frame10.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
    <stroke
        android:width="1dp"
        android:color="#FD5653"/>
    <padding
        android:bottom="1dp"
        android:left="1dp"
        android:right="1dp"
        android:top="1dp"/>
    <corners android:radius="5dp"/>
    <solid android:color="#FD5653"/>
    //背景色
</shape>

================================================
FILE: app/src/main/res/layout/activity_main.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#EEEEEE"
    android:fitsSystemWindows="true"
    tools:context=".MainActivity">
    <com.google.android.material.appbar.AppBarLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:theme="@style/AppTheme.AppBarOverlay">
        <androidx.appcompat.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            android:background="?attr/colorPrimary"
            app:popupTheme="@style/AppTheme.PopupOverlay" />
    </com.google.android.material.appbar.AppBarLayout>
    <include layout="@layout/content_main" />
    <com.google.android.material.floatingactionbutton.FloatingActionButton
        android:id="@+id/fab"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom|end"
        android:layout_margin="@dimen/fab_margin"
        app:backgroundTint="@color/colorPrimary"
        app:srcCompat="@drawable/ic_wifi" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>


================================================
FILE: app/src/main/res/layout/content_main.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/content_main"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    tools:context="me.pengtao.filetransfer.MainActivity"
    tools:showIn="@layout/activity_main">

    <androidx.recyclerview.widget.RecyclerView
        android:id="@+id/recyclerview"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>


================================================
FILE: app/src/main/res/layout/empty_view.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:gravity="center"
    android:orientation="vertical">
    <ImageView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:src="@mipmap/kulian" />
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="5dp"
        android:gravity="center"
        android:lineSpacingExtra="4dp"
        android:paddingBottom="50dp"
        android:paddingTop="10dp"
        android:text="@string/empty_text"
        android:textColor="#B19873"
        android:textSize="15sp"
        android:textStyle="bold" />
</LinearLayout>

================================================
FILE: app/src/main/res/layout/layout_file_item.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools">
    <data>
        <variable
            name="file"
            type="me.pengtao.filetransfer.FileModel" />
        <import type="android.view.View" />
        <import type="me.pengtao.filetransfer.util.FileType" />
    </data>
    <com.chauthai.swipereveallayout.SwipeRevealLayout
        android:id="@+id/swipe_reveal_layout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginBottom="2dp"
        app:dragEdge="right"
        app:mode="same_level">
        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="match_parent">
            <Button
                android:id="@+id/share"
                style="?android:attr/buttonBarButtonStyle"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:background="@color/google_yellow"
                android:gravity="center"
                android:padding="20dp"
                android:text="@string/share"
                android:textColor="@color/white"
                android:textSize="16sp" />
            <Button
                android:id="@+id/delete"
                style="?android:attr/buttonBarButtonStyle"
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:background="@color/google_red"
                android:gravity="center"
                android:padding="20dp"
                android:text="@string/delete"
                android:textColor="@color/white"
                android:textSize="16sp" />
        </LinearLayout>
        <LinearLayout
            android:id="@+id/main_layout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="@color/white"
            android:gravity="center"
            android:orientation="horizontal"
            android:padding="10dp">
            <ImageView
                android:id="@+id/iv_icon"
                android:layout_width="60dp"
                android:layout_height="60dp"
                android:layout_gravity="center"
                android:scaleType="centerCrop"
                tools:src="@mipmap/ic_launcher" />
            <LinearLayout
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_marginLeft="10dp"
                android:layout_marginStart="10dp"
                android:layout_weight="0.8"
                android:orientation="vertical">
                <TextView
                    android:id="@+id/tv_name"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginBottom="5dp"
                    android:ellipsize="end"
                    android:singleLine="true"
                    android:textColor="#4a4a4a"
                    android:textSize="17sp"
                    tools:text="段子乐(v1.1.0)" />
                <TextView
                    android:id="@+id/tv_path"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:textColor="#8e8e93"
                    android:textSize="10sp"
                    tools:text="/storage/emulated/0/WifiTransfer/ff.apk" />
            </LinearLayout>
            <LinearLayout
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_marginLeft="10dp"
                android:layout_marginStart="10dp"
                android:layout_weight="0.2"
                android:gravity="center"
                android:orientation="vertical">
                <TextView
                    android:id="@+id/tv_size"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:ellipsize="end"
                    android:singleLine="true"
                    android:textColor="#8e8e93"
                    android:textSize="12sp"
                    tools:text="7.8M" />
                <ImageView
                    android:id="@+id/tv_delete"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="10dp"
                    android:src="@drawable/ic_delete"
                    android:background="@drawable/shape_red_bg_frame10"
                    android:ellipsize="end"
                    android:paddingLeft="15dp"
                    android:paddingRight="15dp"
                    android:paddingTop="5dp"
                    android:paddingBottom="5dp"/>
            </LinearLayout>
        </LinearLayout>
    </com.chauthai.swipereveallayout.SwipeRevealLayout>
</layout>

================================================
FILE: app/src/main/res/layout/layout_popup_menu_dialog.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@drawable/popup_menu_view_background"
    android:orientation="vertical">
    <TextView
        android:id="@+id/popup_menu_title"
        android:layout_width="match_parent"
        android:layout_height="30dp"
        android:gravity="center"
        android:text="@string/wlan_enabled"
        android:textSize="18sp" />
    <TextView
        android:id="@+id/popup_menu_subtitle"
        android:layout_width="match_parent"
        android:layout_height="40dp"
        android:layout_marginTop="5dp"
        android:gravity="center"
        android:text="@string/pls_check_network_state"
        android:textSize="12sp" />
    <ImageView
        android:id="@+id/shared_wifi_state"
        android:layout_width="80dp"
        android:layout_height="80dp"
        android:layout_gravity="center_horizontal"
        android:layout_marginTop="5dp"
        android:scaleType="centerInside"
        android:src="@drawable/shared_wifi_enable" />
    <TextView
        android:id="@+id/shared_wifi_state_hint"
        android:layout_width="match_parent"
        android:layout_height="20dp"
        android:layout_gravity="center_horizontal"
        android:layout_marginTop="5dp"
        android:gravity="center"
        android:visibility="gone"
        android:text="@string/pls_input_the_following_address_in_pc_browser"
        android:textSize="15sp" />
    <TextView
        android:id="@+id/shared_wifi_address"
        android:layout_width="match_parent"
        android:layout_height="20dp"
        android:layout_gravity="center_horizontal"
        android:layout_marginTop="5dp"
        android:textIsSelectable="true"
        android:gravity="center"
        tools:text="http://10.100.9.195:8081"
        android:textColor="@color/colorWifiConnected"
        android:textSize="15sp" />
    <View
        android:layout_width="match_parent"
        android:layout_height=".5dp"
        android:layout_marginTop="5dp"
        android:background="@android:color/darker_gray" />
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="50dp"
        android:orientation="horizontal">
        <Button
            android:id="@+id/shared_wifi_cancel"
            style="?android:attr/borderlessButtonStyle"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:gravity="center"
            android:text="@string/disappear" />
        <View
            android:id="@+id/shared_wifi_button_split_line"
            android:layout_width="0.5dp"
            android:layout_height="match_parent"
            android:background="@android:color/darker_gray" />
        <Button
            android:id="@+id/shared_wifi_settings"
            style="?android:attr/borderlessButtonStyle"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:gravity="center"
            android:text="@string/set_network"
            android:textColor="@color/colorAccent" />
    </LinearLayout>
</LinearLayout>

================================================
FILE: app/src/main/res/menu/item_menu.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto">
    <item
        android:id="@+id/add_files"
        android:icon="@drawable/ic_add"
        android:title="@string/upload"
        app:showAsAction="always"/>
    <item
        android:id="@+id/delete_all"
        android:icon="@mipmap/more"
        android:title="@string/delete_all"/>
</menu>

================================================
FILE: app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
    <background android:drawable="@drawable/ic_launcher_background"/>
    <foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>

================================================
FILE: app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
    <background android:drawable="@drawable/ic_launcher_background"/>
    <foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>

================================================
FILE: app/src/main/res/values/colors.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="colorPrimary">#32A14A</color>
    <color name="colorPrimaryDark">#303F9F</color>
    <color name="colorAccent">#FF4081</color>
    <color name="colorWifiConnected">#6495ED</color>
    <color name="white">#FFFFFF</color>
    <color name="google_red">#EB4537</color>
    <color name="google_yellow">#FAC230</color>
</resources>


================================================
FILE: app/src/main/res/values/dimens.xml
================================================
<resources>
    <!-- Default screen margins, per the Android Design guidelines. -->
    <dimen name="activity_horizontal_margin">16dp</dimen>
    <dimen name="activity_vertical_margin">16dp</dimen>
    <dimen name="fab_margin">16dp</dimen>
</resources>


================================================
FILE: app/src/main/res/values/strings.xml
================================================
<resources>
    <string name="app_name">文件传输助手</string>
    <string name="wlan_enabled">服务已开启</string>
    <string name="wlan_disabled">服务未开启</string>
    <string name="pls_check_network_state">请确保连接设备在同一个 WI-FI 下,\n或连到此设备的热点上</string>
    <string name="copy_toast">复制成功,请在连接设备的浏览器中打开</string>
    <string name="fail_to_start_http_service">启动HTTP服务失败</string>
    <string name="retrofit_wlan_address">正在获取地址&#8230;</string>
    <string name="pls_input_the_following_address_in_pc_browser">请在浏览器地址栏完整输入</string>
    <string name="click_to_enable_server">点击上面图标开启服务</string>
    <string name="cancel">取消</string>
    <string name="disappear">收起</string>
    <string name="ok">确定</string>
    <string name="set_network">复制地址</string>
    <string name="http_address">http://%1$s:%2$d</string>
    <string name="permission_setting">权限获取</string>
    <string name="permission_need_des">本APP需要获取您SD卡的读写权限用来保存电脑端传入的文件</string>
    <string name="permission_go">开启权限</string>
    <string name="empty_text">目前还没有传输任何文件\n点击右下脚按钮,开始文件传输吧~</string>
    <string name="install">安装</string>
    <string name="uninstall">卸载</string>
    <string name="app_name_format">%1$s(v%2$s)</string>
    <string name="no_program_open_it">未安装可以打开此文件的应用</string>
    <string name="delete_all">全部删除</string>
    <string name="sure_delete_all">确定全部删除吗?</string>
    <string name="share">分享</string>
    <string name="delete">删除</string>
    <string name="upload">上传文件</string>
    <string name="read_file_failed">文件读取失败</string>
    <string name="please_refresh_web">上传成功,请刷新网页端</string>
</resources>


================================================
FILE: app/src/main/res/values/styles.xml
================================================
<resources>
    <!-- Base application theme. -->
    <style name="AppTheme"
        parent="Theme.AppCompat.Light.NoActionBar">
        <!-- Customize your theme here. -->
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimary</item>
        <item name="colorAccent">@color/colorAccent</item>
    </style>

    <style name="AppTheme.NoActionBar">
        <item name="windowActionBar">false</item>
        <item name="windowNoTitle">true</item>
    </style>

    <style name="AppTheme.AppBarOverlay"
        parent="ThemeOverlay.AppCompat.Dark.ActionBar" />

    <style name="AppTheme.PopupOverlay"
        parent="ThemeOverlay.AppCompat.Light">
        <item name="overlapAnchor">false</item>  <!--设置不覆盖锚点-->
    </style>

    <style name="PopupMenuDialogStyle"
        parent="@android:style/Theme.Dialog">
        <!-- 背景透明 -->
        <item name="android:windowBackground">@android:color/transparent</item>
        <item name="android:windowContentOverlay">@null</item>
        <!-- 浮于Activity之上 -->
        <item name="android:windowIsFloating">true</item>
        <!-- 边框 -->
        <item name="android:windowFrame">@null</item>
        <!-- Dialog以外的区域模糊效果 -->
        <item name="android:backgroundDimEnabled">true</item>
        <!-- 无标题 -->
        <item name="android:windowNoTitle">true</item>
        <!-- 半透明 -->
        <item name="android:windowIsTranslucent">true</item>
        <!-- Dialog进入及退出动画 -->
        <item name="android:windowAnimationStyle">@style/ActionSheetDialogAnimation</item>
    </style>
    <!-- ActionSheet进出动画 -->
    <style name="ActionSheetDialogAnimation"
        parent="@android:style/Animation.Dialog">
        <item name="android:windowEnterAnimation">@anim/popup_menu_dialog_in</item>
        <item name="android:windowExitAnimation">@anim/popup_menu_dialog_out</item>
    </style>
</resources>


================================================
FILE: app/src/main/res/values-en/strings.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="app_name">FileTransfer</string>
    <string name="wlan_enabled">Server is enabled</string>
    <string name="wlan_disabled">Server is disabled</string>
    <string name="pls_check_network_state">Connecting device should in same WIFI, \n or connected the hotspot of this device</string>
    <string name="fail_to_start_http_service">Start HTTP server failed</string>
    <string name="retrofit_wlan_address">Retrieving wlan address&#8230;</string>
    <string name="pls_input_the_following_address_in_pc_browser">Please open the following address</string>
    <string name="click_to_enable_server">Click icon above to enable server</string>
    <string name="cancel">Cancel</string>
    <string name="disappear">Hide</string>
    <string name="ok">Sure</string>
    <string name="copy_toast">Copied, open in browser of connected device</string>
    <string name="set_network">Copy Address</string>
    <string name="http_address">http://%1$s:%2$d</string>
    <string name="permission_setting">permission request</string>
    <string name="permission_need_des">The App needs the permission to save files in sdcard</string>
    <string name="permission_go">enable permission</string>
    <string name="empty_text">Empty now\nClick the button below, and start file transfer~</string>
    <string name="install">Install</string>
    <string name="uninstall">Uninstall</string>
    <string name="app_name_format">%1$s(v%2$s)</string>
    <string name="no_program_open_it">Cannot open it</string>
    <string name="delete_all">Delete All</string>
    <string name="sure_delete_all">Delete All?</string>
    <string name="share">Share</string>
    <string name="delete">Delete</string>
    <string name="upload">Upload Files</string>
    <string name="read_file_failed">File fetch failed</string>
    <string name="please_refresh_web">Upload success, please refresh web page</string>
</resources>

================================================
FILE: app/src/main/res/values-v21/styles.xml
================================================
<resources>

    <style name="AppTheme.NoActionBar">
        <item name="windowActionBar">false</item>
        <item name="windowNoTitle">true</item>
        <item name="android:windowDrawsSystemBarBackgrounds">true</item>
        <item name="android:statusBarColor">@android:color/transparent</item>
    </style>
</resources>


================================================
FILE: app/src/main/res/values-w820dp/dimens.xml
================================================
<resources>
    <!-- Example customization of dimensions originally defined in res/values/dimens.xml
         (such as screen margins) for screens with more than 820dp of available width. This
         would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). -->
    <dimen name="activity_horizontal_margin">64dp</dimen>
</resources>


================================================
FILE: app/src/main/res/xml/install_file.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<paths>
    <external-path path="Android/data/$(applicationId)/"  name="files_root" />
    <external-path path="." name="cretin_install" />
</paths>

================================================
FILE: build.gradle
================================================
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        mavenCentral()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:7.2.2'
        classpath 'com.google.gms:google-services:4.3.13'
        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.1'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        mavenCentral()
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}



================================================
FILE: extra/terms_and_conditions.html
================================================
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width">
    <title>Privacy Policy</title>
    <style>body{font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; padding:1em;}</style>
</head>
<body><h2>Terms &amp; Conditions</h2>
<p>By downloading or using the app, these terms will automatically apply to you – you should make
    sure therefore that you read them carefully before using the app. You’re not allowed to copy, or
    modify the app, any part of the app, or our trademarks in any way. You’re not allowed to attempt
    to extract the source code of the app, and you also shouldn’t try to translate the app into
    other languages, or make derivative versions. The app itself, and all the trade marks,
    copyright, database rights and other intellectual property rights related to it, still belong to
    Chris Peng.</p>
<p>Chris Peng is committed to ensuring that the app is as useful and efficient as possible. For that
    reason, we reserve the right to make changes to the app or to charge for its services, at any
    time and for any reason. We will never charge you for the app or its services without making it
    very clear to you exactly what you’re paying for.</p>
<p>The FileTransfer app stores and processes personal data that you have provided to us, in order to
    provide my Service. It’s your responsibility to keep your phone and access to the app secure. We
    therefore recommend that you do not jailbreak or root your phone, which is the process of
    removing software restrictions and limitations imposed by the official operating system of your
    device. It could make your phone vulnerable to malware/viruses/malicious programs, compromise
    your phone’s security features and it could mean that the FileTransfer app won’t work properly
    or at all. </p>
<p>You should be aware that there are certain things that Chris Peng will not take responsibility
    for. Certain functions of the app will require the app to have an active internet connection.
    The connection can be Wi-Fi, or provided by your mobile network provider, but Chris Peng cannot
    take responsibility for the app not working at full functionality if you don’t have access to
    Wi-Fi, and you don’t have any of your data allowance left.</p>
<p></p>
<p>If you’re using the app outside of an area with Wi-Fi, you should remember that your terms of the
    agreement with your mobile network provider will still apply. As a result, you may be charged by
    your mobile provider for the cost of data for the duration of the connection while accessing the
    app, or other third party charges. In using the app, you’re accepting responsibility for any
    such charges, including roaming data charges if you use the app outside of your home territory
    (i.e. region or country) without turning off data roaming. If you are not the bill payer for the
    device on which you’re using the app, please be aware that we assume that you have received
    permission from the bill payer for using the app.</p>
<p>Along the same lines, Chris Peng cannot always take responsibility for the way you use the app
    i.e. You need to make sure that your device stays charged – if it runs out of battery and you
    can’t turn it on to avail the Service, Chris Peng cannot accept responsibility</p>
<p>With respect to Chris Peng’s responsibility for your use of the app, when you’re using the app,
    it’s important to bear in mind that although we endeavour to ensure that it is updated and
    correct at all times, we do rely on third parties to provide information to us so that we can
    make it available to you. Chris Peng accepts no liability for any loss, direct or indirect, you
    experience as a result of relying wholly on this functionality of the app.</p>
<p>At some point, we may wish to update the app. The app is currently available on Android and iOS –
    the requirements for both systems (and for any additional systems we decide to extend the
    availability of the app to) may change, and you’ll need to download the updates if you want to
    keep using the app. Chris Peng does not promise that it will always update the app so that it is
    relevant to you and/or works with the iOS/Android version that you have installed on your
    device. However, you promise to always accept updates to the application when offered to you, We
    may also wish to stop providing the app, and may terminate use of it at any time without giving
    notice of termination to you. Unless we tell you otherwise, upon any termination, (a) the rights
    and licenses granted to you in these terms will end; (b) you must stop using the app, and (if
    needed) delete it from your device.</p>
<p><strong>Changes to This Terms and Conditions</strong></p>
<p> I may update our Terms and Conditions from time to time. Thus, you are advised to review
    this page periodically for any changes. I will notify you of any changes by posting
    the new Terms and Conditions on this page. These changes are effective immediately after they
    are posted on
    this page.
</p>
<p><strong>Contact Us</strong></p>
<p>If you have any questions or suggestions about my Terms and Conditions, do not hesitate to
    contact
    me.
</p>
<p>This Terms and Conditions page was generated by <a
        href="https://app-privacy-policy-generator.firebaseapp.com/" target="_blank">App Privacy
    Policy Generator</a></p></body>
</html>

================================================
FILE: gradle/wrapper/gradle-wrapper.properties
================================================
#Sun Mar 08 17:16:33 CST 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip


================================================
FILE: gradle.properties
================================================
# Project-wide Gradle settings.

# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.

# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html

# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1536m

# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
android.useAndroidX=true
android.enableJetifier=true

================================================
FILE: gradlew
================================================
#!/usr/bin/env bash

##############################################################################
##
##  Gradle start up script for UN*X
##
##############################################################################

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""

APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"

warn ( ) {
    echo "$*"
}

die ( ) {
    echo
    echo "$*"
    echo
    exit 1
}

# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
case "`uname`" in
  CYGWIN* )
    cygwin=true
    ;;
  Darwin* )
    darwin=true
    ;;
  MINGW* )
    msys=true
    ;;
esac

# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
    ls=`ls -ld "$PRG"`
    link=`expr "$ls" : '.*-> \(.*\)$'`
    if expr "$link" : '/.*' > /dev/null; then
        PRG="$link"
    else
        PRG=`dirname "$PRG"`"/$link"
    fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null

CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar

# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
        # IBM's JDK on AIX uses strange locations for the executables
        JAVACMD="$JAVA_HOME/jre/sh/java"
    else
        JAVACMD="$JAVA_HOME/bin/java"
    fi
    if [ ! -x "$JAVACMD" ] ; then
        die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
    fi
else
    JAVACMD="java"
    which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi

# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
    MAX_FD_LIMIT=`ulimit -H -n`
    if [ $? -eq 0 ] ; then
        if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
            MAX_FD="$MAX_FD_LIMIT"
        fi
        ulimit -n $MAX_FD
        if [ $? -ne 0 ] ; then
            warn "Could not set maximum file descriptor limit: $MAX_FD"
        fi
    else
        warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
    fi
fi

# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
    GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi

# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
    APP_HOME=`cygpath --path --mixed "$APP_HOME"`
    CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
    JAVACMD=`cygpath --unix "$JAVACMD"`

    # We build the pattern for arguments to be converted via cygpath
    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
    SEP=""
    for dir in $ROOTDIRSRAW ; do
        ROOTDIRS="$ROOTDIRS$SEP$dir"
        SEP="|"
    done
    OURCYGPATTERN="(^($ROOTDIRS))"
    # Add a user-defined pattern to the cygpath arguments
    if [ "$GRADLE_CYGPATTERN" != "" ] ; then
        OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
    fi
    # Now convert the arguments - kludge to limit ourselves to /bin/sh
    i=0
    for arg in "$@" ; do
        CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
        CHECK2=`echo "$arg"|egrep -c "^-"`                                 ### Determine if an option

        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition
            eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
        else
            eval `echo args$i`="\"$arg\""
        fi
        i=$((i+1))
    done
    case $i in
        (0) set -- ;;
        (1) set -- "$args0" ;;
        (2) set -- "$args0" "$args1" ;;
        (3) set -- "$args0" "$args1" "$args2" ;;
        (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
        (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
        (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
        (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
        (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
        (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
    esac
fi

# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
    JVM_OPTS=("$@")
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"

exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"


================================================
FILE: gradlew.bat
================================================
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem  Gradle startup script for Windows
@rem
@rem ##########################################################################

@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:init
@rem Get command-line arguments, handling Windowz variants

if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

:win9xME_args_slurp
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*
goto execute

:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if  not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1

:mainEnd
if "%OS%"=="Windows_NT" endlocal

:omega


================================================
FILE: settings.gradle
================================================
include ':app'
Download .txt
gitextract_dr2au37d/

├── .gitignore
├── LICENSE
├── README.md
├── app/
│   ├── .gitignore
│   ├── build.gradle
│   ├── google-services.json
│   ├── proguard-rules.pro
│   └── src/
│       └── main/
│           ├── AndroidManifest.xml
│           ├── assets/
│           │   └── wifi/
│           │       ├── css/
│           │       │   └── style.css
│           │       ├── index.html
│           │       └── scripts/
│           │           ├── ajaxfileupload.js
│           │           ├── bitcandies.upload5.js
│           │           ├── lang.en-US.js
│           │           ├── lang.zh-Hans.js
│           │           └── transfer.js
│           ├── java/
│           │   └── me/
│           │       └── pengtao/
│           │           └── filetransfer/
│           │               ├── Constants.java
│           │               ├── FileListAdapter.java
│           │               ├── FileModel.java
│           │               ├── MainActivity.java
│           │               ├── PopupMenuDialog.java
│           │               ├── TransferApp.java
│           │               ├── WebService.java
│           │               ├── receiver/
│           │               │   └── PackageStateReceiver.java
│           │               └── util/
│           │                   ├── FileType.java
│           │                   ├── FileUtils.java
│           │                   └── WifiUtils.java
│           └── res/
│               ├── anim/
│               │   ├── popup_menu_dialog_in.xml
│               │   └── popup_menu_dialog_out.xml
│               ├── drawable/
│               │   ├── ic_add.xml
│               │   ├── ic_delete.xml
│               │   ├── ic_launcher_background.xml
│               │   ├── shape_common_bg_frame10.xml
│               │   └── shape_red_bg_frame10.xml
│               ├── layout/
│               │   ├── activity_main.xml
│               │   ├── content_main.xml
│               │   ├── empty_view.xml
│               │   ├── layout_file_item.xml
│               │   └── layout_popup_menu_dialog.xml
│               ├── menu/
│               │   └── item_menu.xml
│               ├── mipmap-anydpi-v26/
│               │   ├── ic_launcher.xml
│               │   └── ic_launcher_round.xml
│               ├── values/
│               │   ├── colors.xml
│               │   ├── dimens.xml
│               │   ├── strings.xml
│               │   └── styles.xml
│               ├── values-en/
│               │   └── strings.xml
│               ├── values-v21/
│               │   └── styles.xml
│               ├── values-w820dp/
│               │   └── dimens.xml
│               └── xml/
│                   └── install_file.xml
├── build.gradle
├── extra/
│   └── terms_and_conditions.html
├── gradle/
│   └── wrapper/
│       ├── gradle-wrapper.jar
│       └── gradle-wrapper.properties
├── gradle.properties
├── gradlew
├── gradlew.bat
└── settings.gradle
Download .txt
SYMBOL INDEX (125 symbols across 12 files)

FILE: app/src/main/assets/wifi/scripts/transfer.js
  function initPageStrings (line 15) | function initPageStrings() {
  function deleteBook (line 24) | function deleteBook(_event) {
  function downloadBook (line 44) | function downloadBook(_event) {
  function loadFileList (line 51) | function loadFileList() {
  function fillFilesContainer (line 62) | function fillFilesContainer() {
  function getUploadProgress (line 82) | function getUploadProgress() {
  function startAjaxUpload (line 113) | function startAjaxUpload() {
  function checkFileName (line 162) | function checkFileName(fileName) {
  function uploadFiles (line 183) | function uploadFiles(files) {
  function bindAjaxUpload (line 209) | function bindAjaxUpload(fileSelector) {
  function formatFileSize (line 258) | function formatFileSize(value) {
  function cancelUpload (line 270) | function cancelUpload() {
  function getHtml5Uploader (line 281) | function getHtml5Uploader() {
  function handleDragOver (line 341) | function handleDragOver(evt) {
  function handleDragLeave (line 350) | function handleDragLeave(evt) {
  function handleDrop (line 358) | function handleDrop(evt) {
  function dragUpload (line 371) | function dragUpload() {
  function showHtml5View (line 380) | function showHtml5View() {
  function showHtml4View (line 394) | function showHtml4View() {

FILE: app/src/main/java/me/pengtao/filetransfer/Constants.java
  class Constants (line 7) | public class Constants {
    class RxBusEventType (line 14) | public static final class RxBusEventType {

FILE: app/src/main/java/me/pengtao/filetransfer/FileListAdapter.java
  class FileListAdapter (line 43) | class FileListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHold...
    method FileListAdapter (line 48) | public FileListAdapter(Context context, List<FileModel> fileModelList) {
    method onCreateViewHolder (line 54) | @Override
    method onBindViewHolder (line 67) | @Override
    class EmptyViewHolder (line 74) | class EmptyViewHolder extends RecyclerView.ViewHolder {
      method EmptyViewHolder (line 75) | public EmptyViewHolder(View itemView) {
    method getItemCount (line 80) | @Override
    class MyViewHolder (line 85) | class MyViewHolder extends RecyclerView.ViewHolder {
      method MyViewHolder (line 88) | public MyViewHolder(View view) {
      method onBindViewHolder (line 93) | public void onBindViewHolder(int position) {
    method getItemViewType (line 129) | @Override
    method delete (line 137) | private void delete(Context context, String packageName) {
    method share (line 143) | private void share(Context context, String filePath) {

FILE: app/src/main/java/me/pengtao/filetransfer/FileModel.java
  class FileModel (line 23) | public class FileModel {
    method getIcon (line 33) | public Drawable getIcon() {
    method setIcon (line 37) | public void setIcon(Drawable icon) {
    method getPath (line 41) | public String getPath() {
    method setPath (line 45) | public void setPath(String path) {
    method getVersion (line 49) | public String getVersion() {
    method setVersion (line 53) | public void setVersion(String version) {
    method getSize (line 57) | public String getSize() {
    method setSize (line 61) | public void setSize(String size) {
    method getName (line 65) | public String getName() {
    method setName (line 69) | public void setName(String name) {
    method getPackageName (line 73) | public String getPackageName() {
    method setPackageName (line 77) | public void setPackageName(String packageName) {
    method isInstalled (line 81) | public boolean isInstalled() {
    method setInstalled (line 85) | public void setInstalled(boolean installed) {
    method getFileType (line 89) | public int getFileType() {
    method setFileType (line 93) | public FileModel setFileType(final int fileType) {

FILE: app/src/main/java/me/pengtao/filetransfer/MainActivity.java
  class MainActivity (line 58) | public class MainActivity extends AppCompatActivity implements Animator....
    method getIconFromPackageName (line 74) | public synchronized static Drawable getIconFromPackageName(String pack...
    method onCreate (line 110) | @Override
    method onResume (line 143) | @Override
    method onCreateOptionsMenu (line 164) | @Override
    method onClick (line 170) | @OnClick(R.id.fab)
    method onDestroy (line 195) | @Override
    method onPopupMenuDialogDismiss (line 204) | @SuppressWarnings("unused")
    method showDialog (line 215) | private void showDialog() {
    method onAnimationStart (line 223) | @Override
    method onAnimationEnd (line 229) | @Override
    method onAnimationCancel (line 233) | @Override
    method onAnimationRepeat (line 237) | @Override
    method initRecyclerView (line 241) | void initRecyclerView() {
    method handleFiles (line 257) | private void handleFiles(String path, long length) {
    method getFileSize (line 297) | private String getFileSize(long length) {
    method loadFileList (line 309) | @SuppressWarnings("unused")
    method getApplicationName (line 331) | public String getApplicationName(String packageName) {
    method isAvailable (line 353) | public boolean isAvailable(Context context, String packageName) {
    method deleteAll (line 368) | private void deleteAll() {
    method onActivityResult (line 381) | @Override

FILE: app/src/main/java/me/pengtao/filetransfer/PopupMenuDialog.java
  class PopupMenuDialog (line 32) | public class PopupMenuDialog {
    method PopupMenuDialog (line 52) | public PopupMenuDialog(Context context) {
    method builder (line 60) | public PopupMenuDialog builder() {
    method setCancelable (line 81) | public PopupMenuDialog setCancelable(boolean cancel) {
    method setCanceledOnTouchOutside (line 86) | public PopupMenuDialog setCanceledOnTouchOutside(boolean cancel) {
    method show (line 91) | public void show() {
    method onClick (line 98) | @OnClick({R.id.shared_wifi_cancel, R.id.shared_wifi_settings})
    method onWifiConnected (line 112) | void onWifiConnected(String ipAddr) {
    method onDialogDismiss (line 127) | void onDialogDismiss(DialogInterface dialog) {

FILE: app/src/main/java/me/pengtao/filetransfer/TransferApp.java
  class TransferApp (line 23) | public class TransferApp extends Application {
    method onCreate (line 24) | @Override

FILE: app/src/main/java/me/pengtao/filetransfer/WebService.java
  class WebService (line 38) | public class WebService extends Service {
    method start (line 60) | public static void start(Context context) {
    method stop (line 66) | public static void stop(Context context) {
    method onBind (line 72) | @Override
    method onStartCommand (line 77) | @Override
    method onDestroy (line 90) | @Override
    method startServer (line 101) | private void startServer() {
    method getIndexContent (line 243) | private String getIndexContent() throws IOException {
    method sendResources (line 268) | private void sendResources(final AsyncHttpServerRequest request, final
    method getContentTypeByResourceName (line 293) | private String getContentTypeByResourceName(String resourceName) {
    class FileUploadHolder (line 320) | public class FileUploadHolder {
      method getFileOutPutStream (line 326) | public BufferedOutputStream getFileOutPutStream() {
      method setFileName (line 330) | public void setFileName(String fileName) {
      method reset (line 345) | public void reset() {
      method write (line 356) | public void write(byte[] data) {

FILE: app/src/main/java/me/pengtao/filetransfer/receiver/PackageStateReceiver.java
  class PackageStateReceiver (line 29) | public class PackageStateReceiver extends BroadcastReceiver {
    method onReceive (line 30) | @Override

FILE: app/src/main/java/me/pengtao/filetransfer/util/FileType.java
  class FileType (line 22) | public class FileType {

FILE: app/src/main/java/me/pengtao/filetransfer/util/FileUtils.java
  class FileUtils (line 42) | public class FileUtils {
    method getFileUri (line 50) | public static Uri getFileUri(Context context, String filePath) {
    method openFile (line 56) | public static boolean openFile(String filePath, Context context) {
    method getFileType (line 111) | public static int getFileType(String filePath) {
    method checkStringEnds (line 125) | private static int checkStringEnds(String item, String[] array) {
    method getFileTypeIcon (line 135) | public static int getFileTypeIcon(String path) {
    method getShareType (line 163) | public static String getShareType(String path) {
    method copyFile (line 187) | public static void copyFile(InputStream in, String targetLocation) thr...
    method getFileName (line 198) | public static String getFileName(Context context, Uri uri) {
    method getHtmlFileIntent (line 217) | private static Intent getHtmlFileIntent(Uri uri) {
    method getImageFileIntent (line 223) | private static Intent getImageFileIntent(Uri uri) {
    method getPdfFileIntent (line 231) | private static Intent getPdfFileIntent(Uri uri) {
    method getTextFileIntent (line 239) | private static Intent getTextFileIntent(Uri uri) {
    method getAudioFileIntent (line 247) | private static Intent getAudioFileIntent(Uri uri) {
    method getVideoFileIntent (line 256) | private static Intent getVideoFileIntent(Uri uri) {
    method getWordFileIntent (line 265) | private static Intent getWordFileIntent(Uri uri) {
    method getExcelFileIntent (line 273) | private static Intent getExcelFileIntent(Uri uri) {
    method getPPTFileIntent (line 281) | private static Intent getPPTFileIntent(Uri uri) {
    method getApkFileIntent (line 289) | private static Intent getApkFileIntent(Context context, File file) {
    method sortWithLastModified (line 304) | public static void sortWithLastModified(File[] files) {
    method writeByteArrayToFile (line 327) | public static void writeByteArrayToFile(File file, byte[] data, boolea...
    method openOutputStream (line 340) | private static FileOutputStream openOutputStream(File file, boolean ap...

FILE: app/src/main/java/me/pengtao/filetransfer/util/WifiUtils.java
  class WifiUtils (line 13) | public class WifiUtils {
    method getDeviceIpAddress (line 16) | public static String getDeviceIpAddress() {
Condensed preview — 57 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (198K chars).
[
  {
    "path": ".gitignore",
    "chars": 99,
    "preview": "*.iml\n.gradle\n/local.properties\n/.idea\n.DS_Store\n/build\n/captures\n.externalNativeBuild\napp/release\n"
  },
  {
    "path": "LICENSE",
    "chars": 35147,
    "preview": "                    GNU GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free "
  },
  {
    "path": "README.md",
    "chars": 1533,
    "preview": "# FileTransfer\n![](https://github.com/CPPAlien/FileTransfer/raw/master/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png)\n"
  },
  {
    "path": "app/.gitignore",
    "chars": 7,
    "preview": "/build\n"
  },
  {
    "path": "app/build.gradle",
    "chars": 1689,
    "preview": "plugins {\n    id 'com.android.application'\n    id 'com.google.gms.google-services'\n    id 'com.google.firebase.crashlyti"
  },
  {
    "path": "app/google-services.json",
    "chars": 1007,
    "preview": "{\n  \"project_info\": {\n    \"project_number\": \"316341165060\",\n    \"project_id\": \"filetransfer-94133\",\n    \"storage_bucket\""
  },
  {
    "path": "app/proguard-rules.pro",
    "chars": 1602,
    "preview": "# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in D:"
  },
  {
    "path": "app/src/main/AndroidManifest.xml",
    "chars": 2917,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest package=\"me.pengtao.filetransfer\"\n    xmlns:android=\"http://schemas.and"
  },
  {
    "path": "app/src/main/assets/wifi/css/style.css",
    "chars": 5110,
    "preview": "html { margin: 0px; padding: 0px; overflow: visible; }\nbody {  background-image: url('../images/bg1_01.jpg'); padding: 0"
  },
  {
    "path": "app/src/main/assets/wifi/index.html",
    "chars": 2035,
    "preview": "<!DOCTYPE html>\n<head>\n    <meta http-equiv=\"Content-type\" content=\"text/html; charset=utf-8\">\n    <link rel=\"stylesheet"
  },
  {
    "path": "app/src/main/assets/wifi/scripts/ajaxfileupload.js",
    "chars": 6476,
    "preview": "\njQuery.extend({\n\t\n\n    createUploadIframe: function(id, uri)\n\t{\n\t\t\t//create frame\n            var frameId = 'jUploadFra"
  },
  {
    "path": "app/src/main/assets/wifi/scripts/bitcandies.upload5.js",
    "chars": 5678,
    "preview": "/**\n* Upload5 0.1.0\n* (c) 2011 BitCandies\n* http://github.com/bitcandies/upload5\n*\n* Upload5 is a flexible HTML5/JavaScr"
  },
  {
    "path": "app/src/main/assets/wifi/scripts/lang.en-US.js",
    "chars": 1294,
    "preview": "var STRINGS = {};\n\nSTRINGS.WIFI_TRANS_TITLE = 'File Transfer';\nSTRINGS.FILES_ON_DEVICE = 'File list';\nSTRINGS.FILENAME ="
  },
  {
    "path": "app/src/main/assets/wifi/scripts/lang.zh-Hans.js",
    "chars": 1008,
    "preview": "var STRINGS = {};\n\nSTRINGS.WIFI_TRANS_TITLE = '文件传输助手';\nSTRINGS.FILES_ON_DEVICE = '您设备上的文件列表';\nSTRINGS.FILENAME = '文件名';"
  },
  {
    "path": "app/src/main/assets/wifi/scripts/transfer.js",
    "chars": 13567,
    "preview": "$(function() {\n\tvar isDragOver = false;\n\t\n\tvar files = [];\n\tvar currentFileName;\n\n\tvar uploadQueue = [];\n\tvar currentQue"
  },
  {
    "path": "app/src/main/java/me/pengtao/filetransfer/Constants.java",
    "chars": 760,
    "preview": "package me.pengtao.filetransfer;\n\nimport android.os.Environment;\n\nimport java.io.File;\n\npublic class Constants {\n    pub"
  },
  {
    "path": "app/src/main/java/me/pengtao/filetransfer/FileListAdapter.java",
    "chars": 5627,
    "preview": "/*\n * Copyright (c) 2018 CPPAlien\n *\n * Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3, 29 June 2007 (the \"Lic"
  },
  {
    "path": "app/src/main/java/me/pengtao/filetransfer/FileModel.java",
    "chars": 2175,
    "preview": "/*\n * Copyright (c) 2018 CPPAlien\n *\n * Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3, 29 June 2007 (the \"Lic"
  },
  {
    "path": "app/src/main/java/me/pengtao/filetransfer/MainActivity.java",
    "chars": 15671,
    "preview": "package me.pengtao.filetransfer;\n\nimport android.Manifest;\nimport android.animation.Animator;\nimport android.animation.O"
  },
  {
    "path": "app/src/main/java/me/pengtao/filetransfer/PopupMenuDialog.java",
    "chars": 4579,
    "preview": "package me.pengtao.filetransfer;\n\nimport android.app.Dialog;\nimport android.content.ClipData;\nimport android.content.Cli"
  },
  {
    "path": "app/src/main/java/me/pengtao/filetransfer/TransferApp.java",
    "chars": 857,
    "preview": "/*\n * Copyright (c) 2018 CPPAlien\n *\n * Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3, 29 June 2007 (the \"Lic"
  },
  {
    "path": "app/src/main/java/me/pengtao/filetransfer/WebService.java",
    "chars": 15045,
    "preview": "package me.pengtao.filetransfer;\n\nimport android.app.Service;\nimport android.content.Context;\nimport android.content.Int"
  },
  {
    "path": "app/src/main/java/me/pengtao/filetransfer/receiver/PackageStateReceiver.java",
    "chars": 1104,
    "preview": "/*\n * Copyright (c) 2018 CPPAlien\n *\n * Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3, 29 June 2007 (the \"Lic"
  },
  {
    "path": "app/src/main/java/me/pengtao/filetransfer/util/FileType.java",
    "chars": 2247,
    "preview": "/*\n * Copyright (c) 2018 CPPAlien\n *\n * Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3, 29 June 2007 (the \"Lic"
  },
  {
    "path": "app/src/main/java/me/pengtao/filetransfer/util/FileUtils.java",
    "chars": 12737,
    "preview": "/*\n * Copyright (c) 2018 CPPAlien\n *\n * Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3, 29 June 2007 (the \"Lic"
  },
  {
    "path": "app/src/main/java/me/pengtao/filetransfer/util/WifiUtils.java",
    "chars": 1264,
    "preview": "package me.pengtao.filetransfer.util;\n\nimport android.util.Log;\n\nimport java.net.InetAddress;\nimport java.net.NetworkInt"
  },
  {
    "path": "app/src/main/res/anim/popup_menu_dialog_in.xml",
    "chars": 194,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<translate xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android"
  },
  {
    "path": "app/src/main/res/anim/popup_menu_dialog_out.xml",
    "chars": 194,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<translate xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android"
  },
  {
    "path": "app/src/main/res/drawable/ic_add.xml",
    "chars": 1036,
    "preview": "<!--\n  ~ Copyright (c) 2018 CPPAlien\n  ~\n  ~ Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3, 29 June 2007 (the"
  },
  {
    "path": "app/src/main/res/drawable/ic_delete.xml",
    "chars": 1697,
    "preview": "<!--\n  ~ Copyright (c) 2018 CPPAlien\n  ~\n  ~ Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3, 29 June 2007 (the"
  },
  {
    "path": "app/src/main/res/drawable/ic_launcher_background.xml",
    "chars": 4867,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<vector\n    android:height=\"108dp\"\n    android:width=\"108dp\"\n    android:viewport"
  },
  {
    "path": "app/src/main/res/drawable/shape_common_bg_frame10.xml",
    "chars": 396,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <stroke\n  "
  },
  {
    "path": "app/src/main/res/drawable/shape_red_bg_frame10.xml",
    "chars": 396,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<shape xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <stroke\n  "
  },
  {
    "path": "app/src/main/res/layout/activity_main.xml",
    "chars": 1477,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android=\"http://schema"
  },
  {
    "path": "app/src/main/res/layout/content_main.xml",
    "chars": 776,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<androidx.swiperefreshlayout.widget.SwipeRefreshLayout xmlns:android=\"http://sche"
  },
  {
    "path": "app/src/main/res/layout/empty_view.xml",
    "chars": 848,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    andr"
  },
  {
    "path": "app/src/main/res/layout/layout_file_item.xml",
    "chars": 5142,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<layout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app="
  },
  {
    "path": "app/src/main/res/layout/layout_popup_menu_dialog.xml",
    "chars": 3375,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmln"
  },
  {
    "path": "app/src/main/res/menu/item_menu.xml",
    "chars": 459,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<menu xmlns:android=\"http://schemas.android.com/apk/res/android\"\n      xmlns:app="
  },
  {
    "path": "app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml",
    "chars": 268,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<adaptive-icon xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <b"
  },
  {
    "path": "app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml",
    "chars": 268,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<adaptive-icon xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <b"
  },
  {
    "path": "app/src/main/res/values/colors.xml",
    "chars": 394,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <color name=\"colorPrimary\">#32A14A</color>\n    <color name=\"color"
  },
  {
    "path": "app/src/main/res/values/dimens.xml",
    "chars": 253,
    "preview": "<resources>\n    <!-- Default screen margins, per the Android Design guidelines. -->\n    <dimen name=\"activity_horizontal"
  },
  {
    "path": "app/src/main/res/values/strings.xml",
    "chars": 1568,
    "preview": "<resources>\n    <string name=\"app_name\">文件传输助手</string>\n    <string name=\"wlan_enabled\">服务已开启</string>\n    <string name="
  },
  {
    "path": "app/src/main/res/values/styles.xml",
    "chars": 1905,
    "preview": "<resources>\n    <!-- Base application theme. -->\n    <style name=\"AppTheme\"\n        parent=\"Theme.AppCompat.Light.NoActi"
  },
  {
    "path": "app/src/main/res/values-en/strings.xml",
    "chars": 1958,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <string name=\"app_name\">FileTransfer</string>\n    <string name=\"w"
  },
  {
    "path": "app/src/main/res/values-v21/styles.xml",
    "chars": 327,
    "preview": "<resources>\n\n    <style name=\"AppTheme.NoActionBar\">\n        <item name=\"windowActionBar\">false</item>\n        <item nam"
  },
  {
    "path": "app/src/main/res/values-w820dp/dimens.xml",
    "chars": 358,
    "preview": "<resources>\n    <!-- Example customization of dimensions originally defined in res/values/dimens.xml\n         (such as s"
  },
  {
    "path": "app/src/main/res/xml/install_file.xml",
    "chars": 187,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<paths>\n    <external-path path=\"Android/data/$(applicationId)/\"  name=\"files_roo"
  },
  {
    "path": "build.gradle",
    "chars": 692,
    "preview": "// Top-level build file where you can add configuration options common to all sub-projects/modules.\n\nbuildscript {\n    r"
  },
  {
    "path": "extra/terms_and_conditions.html",
    "chars": 5510,
    "preview": "<!DOCTYPE html>\n<html>\n<head>\n    <meta charset=\"utf-8\">\n    <meta name=\"viewport\" content=\"width=device-width\">\n    <ti"
  },
  {
    "path": "gradle/wrapper/gradle-wrapper.properties",
    "chars": 232,
    "preview": "#Sun Mar 08 17:16:33 CST 2020\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_"
  },
  {
    "path": "gradle.properties",
    "chars": 782,
    "preview": "# Project-wide Gradle settings.\n\n# IDE (e.g. Android Studio) users:\n# Gradle settings configured through the IDE *will o"
  },
  {
    "path": "gradlew",
    "chars": 4971,
    "preview": "#!/usr/bin/env bash\n\n##############################################################################\n##\n##  Gradle start "
  },
  {
    "path": "gradlew.bat",
    "chars": 2314,
    "preview": "@if \"%DEBUG%\" == \"\" @echo off\n@rem ##########################################################################\n@rem\n@rem "
  },
  {
    "path": "settings.gradle",
    "chars": 15,
    "preview": "include ':app'\n"
  }
]

// ... and 1 more files (download for full content)

About this extraction

This page contains the full source code of the CPPAlien/FileTransfer GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 57 files (179.8 KB), approximately 44.5k tokens, and a symbol index with 125 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!