diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml
new file mode 100644
index 0000000..dca9e76
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/config.yml
@@ -0,0 +1,8 @@
+blank_issues_enabled: false
+contact_links:
+ - name: Official website
+ url: https://www.zzhow.com/MagicShare
+ about: Please read the official documentation before submitting an issue, and if that doesn't solve your problem, then ask an issue.
+ - name: 官方网站
+ url: https://www.zzhow.com/MagicShare
+ about: 请在提交问题之前先阅读官方文档,如果还不能解决问题,则再提问题。
diff --git a/.github/ISSUE_TEMPLATE/issue-template-bug.md b/.github/ISSUE_TEMPLATE/issue-template-bug.md
new file mode 100644
index 0000000..5138e9b
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/issue-template-bug.md
@@ -0,0 +1,19 @@
+---
+name: Bug Report | Bug反馈
+about: Create a "Bug Report" | 创建一个"Bug反馈"
+title: ''
+labels: ["bug"]
+assignees: ''
+---
+
+
+
+### Bug description | bug 描述
+
+### Desired outcome | 期望的结果
+
+### MagicEncoding version | MagicEncoding 版本
+
+### Operating system version | 操作系统版本
+
+### Screenshot | 截图
diff --git a/.github/ISSUE_TEMPLATE/template-feature.md b/.github/ISSUE_TEMPLATE/template-feature.md
new file mode 100644
index 0000000..a7bb8b4
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/template-feature.md
@@ -0,0 +1,13 @@
+---
+name: Desired functionality | 期望的功能
+about: Tell us what features you would like | 告诉我们您期望的功能
+title: ''
+labels: ["enhancement"]
+assignees: ''
+---
+
+
+
+### Scenes to be used | 使用场景
+
+### Functional Description | 功能描述
diff --git a/.github/ISSUE_TEMPLATE/template-question.md b/.github/ISSUE_TEMPLATE/template-question.md
new file mode 100644
index 0000000..3a62d35
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/template-question.md
@@ -0,0 +1,19 @@
+---
+name: Question Exchange | 问题交流
+about: Create a "Question Exchange" | 创建一个“问题交流”
+title: ''
+labels: ["question"]
+assignees: ''
+---
+
+
+
+### Question description | 问题描述
+
+### Desired outcome | 期望的结果
+
+### MagicEncoding version | MagicEncoding 版本
+
+### Operating system version | 操作系统版本
+
+### Screenshot | 截图
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..192e7d5
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+
+/.idea
+/backend/out
+/backend/src/main/resources/META-INF
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..21a3c54
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,674 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc.
+ 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.
+
+
+ Copyright (C) 2025 ZZHow(ZZHow1024)
+
+ 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 .
+
+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:
+
+ MagicShare Copyright (C) 2025 ZZHow(ZZHow1024)
+ 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
+.
+
+ 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
+.
diff --git a/README.md b/README.md
index e7e2f55..3ec4faf 100644
--- a/README.md
+++ b/README.md
@@ -1,2 +1,124 @@
-# MagicShare
-MagicShare
+# [C/S项目]神奇分享_**MagicShare**(中文说明)
+
+---
+
+Website:
+
+[[C/S项目]神奇分享_MagicShare | ZZHow](https://www.zzhow.com/MagicShare)
+
+Source Code:
+
+https://github.com/ZZHow1024/MagicShare
+
+Releases:
+
+https://github.com/ZZHow1024/MagicShare/releases
+
+---
+
+## 它是什么?
+
+MagicShare 是一款跨平台的内网文件分享工具,发送方使用桌面客户端选择需要分享的文件,接收方使用 Web 页面下载分享的文件。
+
+---
+
+## 技术路线
+
+
+
+- 编程语言:Java 和 JavaScript
+
+---
+
+## 许可证
+
+该项目根据 GNU 通用公共许可证 v3.0 获得许可 - 有关详细信息,请参阅 [LICENSE](./LICENSE) 文件。
+
+---
+
+## 用户许可协议
+
+**使用本软件前,请仔细阅读:**
+
+- 合法使用:本软件仅限于合法文件分享,严禁分享任何侵犯版权、涉及色情、暴力、欺诈、违法或其他有害内容的文件。
+- 个人责任:您对分享内容的合法性负全部责任,请确保您拥有分享文件的合法授权。
+- 风险提示:本软件无法保证所分享文件的安全性,请您自行检查文件的安全性。
+- 免责声明:软件作者不对因使用本软件造成的任何直接或间接损失承担责任。
+
+使用 MagicShare 须同意并遵守以上内容。
+
+---
+
+## 使用说明
+
+下载地址:
+
+https://github.com/ZZHow1024/MagicShare/releases
+
+### 桌面客户端
+
+- 确定您使用的操作系统。
+ - Linux:
+ - 选择 .deb安装包(Debian, Ubuntu) / .rpm(Red Hat, Fedora, SUSE)安装包。
+ - macOS:
+ - 确定您使用的 Mac 的芯片(Apple Silicon / Intel)。
+ - 选择 .dmg磁盘镜像 / .pkg安装包。
+ - Windows:
+ - 选择 .zip压缩包 / .exe安装包 / .msi安装包。
+ - 通用:
+ - 选择 .jar包(计算机需要配置好 JRE)
+- 下载对应的文件。
+- Linux 和 macOS 需要执行安装操作后再运行,Windows 可直接运行 .zip 压缩包中的 .exe 可执行程序或选择 .exe 安装包与 .msi 安装包执行安装操作,.jar 包可直接通过 `java -jar` 命令运行。
+- 启动 MagicShare 并认真阅读启动页说明,同意 “用户许可协议” 可继续使用。
+- 自定义端口后单击 “启动服务” 按钮
+ - 若提示 “启动成功”,则表示服务正常启动,可将 ”分享URL“ 提供给接收方。
+ - 若提示 ”端口被占用“,请尝试更换端口号。
+ - 若提示 “端口号错误”,请检查自定义的端口号是否为 1~65535 的整数。
+- 将待分享的文件添加进分享列表中
+ - 方式一:拖拽待分享的文件/文件夹至软件主界面上半部分。
+ - 方式二:单击 “选择文件夹” 按钮选择待分享的文件夹。
+ - 方式三:在 “分享的文件/文件夹” 文本输入框中输入待分享的文件/文件夹路径,按下 “Enter” 键。
+- 按下 “停止服务” 按钮可立即终止分享。
+- 按下 “清空分享列表” 按钮可立即清空分享列表。
+
+### Web端
+
+- 打开浏览器,访问 ”分享URL“。
+- 启动 MagicShare 并认真阅读启动页说明,同意 “用户许可协议” 可继续使用。
+- 下载文件
+ - 单击 ”快速下载“ 使用浏览器下载器通过 HTTP 协议快速下载文件。
+ - 单击 ”加密下载“ 使用 MagicShare 加密下载器通过 WebSocket 协议并使用 RSA+AES 混合加密下载文件,不支持同时加密下载多个文件。
+- 单击 “查看加密下载进度” 按钮,页面下方将弹出加密下载进度抽屉。
+
+---
+
+## 依赖项
+
+该项目需要以下库:
+
+- [**Vue.js**](https://github.com/vuejs) 及配套组件:用于构建 Web 前端程序。
+- [**Spring Boot**](https://github.com/spring-projects/spring-boot) 及配套组件:用于构建 Web 后端程序。
+- [**OpenJFX**](https://openjfx.io/):用于构建图形用户界面的 JavaFX 库。
+
+---
+
+## 各版本功能介绍
+
+- MagicShare1.0.0
+ - 自定义端口启动服务。
+ - 按文件夹/文件路径查找文件并生成列表。
+ - Web 网页下载文件。
+ - 支持通过 HTTP 协议快速下载文件
+ - 支持通过 WebSocket 协议并使用 RSA+AES 混合加密下载文件
+
+---
+
+## 各版本主界面
+
+
+
+MagicShare1.0.0-Desktop
+
+
+
+MagicShare1.0.0-Web
diff --git a/TechnicalRoute.png b/TechnicalRoute.png
new file mode 100644
index 0000000..6a59f62
Binary files /dev/null and b/TechnicalRoute.png differ
diff --git a/backend/.gitattributes b/backend/.gitattributes
new file mode 100755
index 0000000..3b41682
--- /dev/null
+++ b/backend/.gitattributes
@@ -0,0 +1,2 @@
+/mvnw text eol=lf
+*.cmd text eol=crlf
diff --git a/backend/.gitignore b/backend/.gitignore
new file mode 100755
index 0000000..549e00a
--- /dev/null
+++ b/backend/.gitignore
@@ -0,0 +1,33 @@
+HELP.md
+target/
+!.mvn/wrapper/maven-wrapper.jar
+!**/src/main/**/target/
+!**/src/test/**/target/
+
+### STS ###
+.apt_generated
+.classpath
+.factorypath
+.project
+.settings
+.springBeans
+.sts4-cache
+
+### IntelliJ IDEA ###
+.idea
+*.iws
+*.iml
+*.ipr
+
+### NetBeans ###
+/nbproject/private/
+/nbbuild/
+/dist/
+/nbdist/
+/.nb-gradle/
+build/
+!**/src/main/**/build/
+!**/src/test/**/build/
+
+### VS Code ###
+.vscode/
diff --git a/backend/.mvn/wrapper/maven-wrapper.properties b/backend/.mvn/wrapper/maven-wrapper.properties
new file mode 100755
index 0000000..d58dfb7
--- /dev/null
+++ b/backend/.mvn/wrapper/maven-wrapper.properties
@@ -0,0 +1,19 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# 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.
+wrapperVersion=3.3.2
+distributionType=only-script
+distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip
diff --git a/backend/mvnw b/backend/mvnw
new file mode 100755
index 0000000..19529dd
--- /dev/null
+++ b/backend/mvnw
@@ -0,0 +1,259 @@
+#!/bin/sh
+# ----------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# 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.
+# ----------------------------------------------------------------------------
+
+# ----------------------------------------------------------------------------
+# Apache Maven Wrapper startup batch script, version 3.3.2
+#
+# Optional ENV vars
+# -----------------
+# JAVA_HOME - location of a JDK home dir, required when download maven via java source
+# MVNW_REPOURL - repo url base for downloading maven distribution
+# MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven
+# MVNW_VERBOSE - true: enable verbose log; debug: trace the mvnw script; others: silence the output
+# ----------------------------------------------------------------------------
+
+set -euf
+[ "${MVNW_VERBOSE-}" != debug ] || set -x
+
+# OS specific support.
+native_path() { printf %s\\n "$1"; }
+case "$(uname)" in
+CYGWIN* | MINGW*)
+ [ -z "${JAVA_HOME-}" ] || JAVA_HOME="$(cygpath --unix "$JAVA_HOME")"
+ native_path() { cygpath --path --windows "$1"; }
+ ;;
+esac
+
+# set JAVACMD and JAVACCMD
+set_java_home() {
+ # For Cygwin and MinGW, ensure paths are in Unix format before anything is touched
+ 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"
+ JAVACCMD="$JAVA_HOME/jre/sh/javac"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ JAVACCMD="$JAVA_HOME/bin/javac"
+
+ if [ ! -x "$JAVACMD" ] || [ ! -x "$JAVACCMD" ]; then
+ echo "The JAVA_HOME environment variable is not defined correctly, so mvnw cannot run." >&2
+ echo "JAVA_HOME is set to \"$JAVA_HOME\", but \"\$JAVA_HOME/bin/java\" or \"\$JAVA_HOME/bin/javac\" does not exist." >&2
+ return 1
+ fi
+ fi
+ else
+ JAVACMD="$(
+ 'set' +e
+ 'unset' -f command 2>/dev/null
+ 'command' -v java
+ )" || :
+ JAVACCMD="$(
+ 'set' +e
+ 'unset' -f command 2>/dev/null
+ 'command' -v javac
+ )" || :
+
+ if [ ! -x "${JAVACMD-}" ] || [ ! -x "${JAVACCMD-}" ]; then
+ echo "The java/javac command does not exist in PATH nor is JAVA_HOME set, so mvnw cannot run." >&2
+ return 1
+ fi
+ fi
+}
+
+# hash string like Java String::hashCode
+hash_string() {
+ str="${1:-}" h=0
+ while [ -n "$str" ]; do
+ char="${str%"${str#?}"}"
+ h=$(((h * 31 + $(LC_CTYPE=C printf %d "'$char")) % 4294967296))
+ str="${str#?}"
+ done
+ printf %x\\n $h
+}
+
+verbose() { :; }
+[ "${MVNW_VERBOSE-}" != true ] || verbose() { printf %s\\n "${1-}"; }
+
+die() {
+ printf %s\\n "$1" >&2
+ exit 1
+}
+
+trim() {
+ # MWRAPPER-139:
+ # Trims trailing and leading whitespace, carriage returns, tabs, and linefeeds.
+ # Needed for removing poorly interpreted newline sequences when running in more
+ # exotic environments such as mingw bash on Windows.
+ printf "%s" "${1}" | tr -d '[:space:]'
+}
+
+# parse distributionUrl and optional distributionSha256Sum, requires .mvn/wrapper/maven-wrapper.properties
+while IFS="=" read -r key value; do
+ case "${key-}" in
+ distributionUrl) distributionUrl=$(trim "${value-}") ;;
+ distributionSha256Sum) distributionSha256Sum=$(trim "${value-}") ;;
+ esac
+done <"${0%/*}/.mvn/wrapper/maven-wrapper.properties"
+[ -n "${distributionUrl-}" ] || die "cannot read distributionUrl property in ${0%/*}/.mvn/wrapper/maven-wrapper.properties"
+
+case "${distributionUrl##*/}" in
+maven-mvnd-*bin.*)
+ MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/
+ case "${PROCESSOR_ARCHITECTURE-}${PROCESSOR_ARCHITEW6432-}:$(uname -a)" in
+ *AMD64:CYGWIN* | *AMD64:MINGW*) distributionPlatform=windows-amd64 ;;
+ :Darwin*x86_64) distributionPlatform=darwin-amd64 ;;
+ :Darwin*arm64) distributionPlatform=darwin-aarch64 ;;
+ :Linux*x86_64*) distributionPlatform=linux-amd64 ;;
+ *)
+ echo "Cannot detect native platform for mvnd on $(uname)-$(uname -m), use pure java version" >&2
+ distributionPlatform=linux-amd64
+ ;;
+ esac
+ distributionUrl="${distributionUrl%-bin.*}-$distributionPlatform.zip"
+ ;;
+maven-mvnd-*) MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ ;;
+*) MVN_CMD="mvn${0##*/mvnw}" _MVNW_REPO_PATTERN=/org/apache/maven/ ;;
+esac
+
+# apply MVNW_REPOURL and calculate MAVEN_HOME
+# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-,maven-mvnd--}/
+[ -z "${MVNW_REPOURL-}" ] || distributionUrl="$MVNW_REPOURL$_MVNW_REPO_PATTERN${distributionUrl#*"$_MVNW_REPO_PATTERN"}"
+distributionUrlName="${distributionUrl##*/}"
+distributionUrlNameMain="${distributionUrlName%.*}"
+distributionUrlNameMain="${distributionUrlNameMain%-bin}"
+MAVEN_USER_HOME="${MAVEN_USER_HOME:-${HOME}/.m2}"
+MAVEN_HOME="${MAVEN_USER_HOME}/wrapper/dists/${distributionUrlNameMain-}/$(hash_string "$distributionUrl")"
+
+exec_maven() {
+ unset MVNW_VERBOSE MVNW_USERNAME MVNW_PASSWORD MVNW_REPOURL || :
+ exec "$MAVEN_HOME/bin/$MVN_CMD" "$@" || die "cannot exec $MAVEN_HOME/bin/$MVN_CMD"
+}
+
+if [ -d "$MAVEN_HOME" ]; then
+ verbose "found existing MAVEN_HOME at $MAVEN_HOME"
+ exec_maven "$@"
+fi
+
+case "${distributionUrl-}" in
+*?-bin.zip | *?maven-mvnd-?*-?*.zip) ;;
+*) die "distributionUrl is not valid, must match *-bin.zip or maven-mvnd-*.zip, but found '${distributionUrl-}'" ;;
+esac
+
+# prepare tmp dir
+if TMP_DOWNLOAD_DIR="$(mktemp -d)" && [ -d "$TMP_DOWNLOAD_DIR" ]; then
+ clean() { rm -rf -- "$TMP_DOWNLOAD_DIR"; }
+ trap clean HUP INT TERM EXIT
+else
+ die "cannot create temp dir"
+fi
+
+mkdir -p -- "${MAVEN_HOME%/*}"
+
+# Download and Install Apache Maven
+verbose "Couldn't find MAVEN_HOME, downloading and installing it ..."
+verbose "Downloading from: $distributionUrl"
+verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName"
+
+# select .zip or .tar.gz
+if ! command -v unzip >/dev/null; then
+ distributionUrl="${distributionUrl%.zip}.tar.gz"
+ distributionUrlName="${distributionUrl##*/}"
+fi
+
+# verbose opt
+__MVNW_QUIET_WGET=--quiet __MVNW_QUIET_CURL=--silent __MVNW_QUIET_UNZIP=-q __MVNW_QUIET_TAR=''
+[ "${MVNW_VERBOSE-}" != true ] || __MVNW_QUIET_WGET='' __MVNW_QUIET_CURL='' __MVNW_QUIET_UNZIP='' __MVNW_QUIET_TAR=v
+
+# normalize http auth
+case "${MVNW_PASSWORD:+has-password}" in
+'') MVNW_USERNAME='' MVNW_PASSWORD='' ;;
+has-password) [ -n "${MVNW_USERNAME-}" ] || MVNW_USERNAME='' MVNW_PASSWORD='' ;;
+esac
+
+if [ -z "${MVNW_USERNAME-}" ] && command -v wget >/dev/null; then
+ verbose "Found wget ... using wget"
+ wget ${__MVNW_QUIET_WGET:+"$__MVNW_QUIET_WGET"} "$distributionUrl" -O "$TMP_DOWNLOAD_DIR/$distributionUrlName" || die "wget: Failed to fetch $distributionUrl"
+elif [ -z "${MVNW_USERNAME-}" ] && command -v curl >/dev/null; then
+ verbose "Found curl ... using curl"
+ curl ${__MVNW_QUIET_CURL:+"$__MVNW_QUIET_CURL"} -f -L -o "$TMP_DOWNLOAD_DIR/$distributionUrlName" "$distributionUrl" || die "curl: Failed to fetch $distributionUrl"
+elif set_java_home; then
+ verbose "Falling back to use Java to download"
+ javaSource="$TMP_DOWNLOAD_DIR/Downloader.java"
+ targetZip="$TMP_DOWNLOAD_DIR/$distributionUrlName"
+ cat >"$javaSource" <<-END
+ public class Downloader extends java.net.Authenticator
+ {
+ protected java.net.PasswordAuthentication getPasswordAuthentication()
+ {
+ return new java.net.PasswordAuthentication( System.getenv( "MVNW_USERNAME" ), System.getenv( "MVNW_PASSWORD" ).toCharArray() );
+ }
+ public static void main( String[] args ) throws Exception
+ {
+ setDefault( new Downloader() );
+ java.nio.file.Files.copy( java.net.URI.create( args[0] ).toURL().openStream(), java.nio.file.Paths.get( args[1] ).toAbsolutePath().normalize() );
+ }
+ }
+ END
+ # For Cygwin/MinGW, switch paths to Windows format before running javac and java
+ verbose " - Compiling Downloader.java ..."
+ "$(native_path "$JAVACCMD")" "$(native_path "$javaSource")" || die "Failed to compile Downloader.java"
+ verbose " - Running Downloader.java ..."
+ "$(native_path "$JAVACMD")" -cp "$(native_path "$TMP_DOWNLOAD_DIR")" Downloader "$distributionUrl" "$(native_path "$targetZip")"
+fi
+
+# If specified, validate the SHA-256 sum of the Maven distribution zip file
+if [ -n "${distributionSha256Sum-}" ]; then
+ distributionSha256Result=false
+ if [ "$MVN_CMD" = mvnd.sh ]; then
+ echo "Checksum validation is not supported for maven-mvnd." >&2
+ echo "Please disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2
+ exit 1
+ elif command -v sha256sum >/dev/null; then
+ if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | sha256sum -c >/dev/null 2>&1; then
+ distributionSha256Result=true
+ fi
+ elif command -v shasum >/dev/null; then
+ if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | shasum -a 256 -c >/dev/null 2>&1; then
+ distributionSha256Result=true
+ fi
+ else
+ echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available." >&2
+ echo "Please install either command, or disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2
+ exit 1
+ fi
+ if [ $distributionSha256Result = false ]; then
+ echo "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised." >&2
+ echo "If you updated your Maven version, you need to update the specified distributionSha256Sum property." >&2
+ exit 1
+ fi
+fi
+
+# unzip and move
+if command -v unzip >/dev/null; then
+ unzip ${__MVNW_QUIET_UNZIP:+"$__MVNW_QUIET_UNZIP"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -d "$TMP_DOWNLOAD_DIR" || die "failed to unzip"
+else
+ tar xzf${__MVNW_QUIET_TAR:+"$__MVNW_QUIET_TAR"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -C "$TMP_DOWNLOAD_DIR" || die "failed to untar"
+fi
+printf %s\\n "$distributionUrl" >"$TMP_DOWNLOAD_DIR/$distributionUrlNameMain/mvnw.url"
+mv -- "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" "$MAVEN_HOME" || [ -d "$MAVEN_HOME" ] || die "fail to move MAVEN_HOME"
+
+clean || :
+exec_maven "$@"
diff --git a/backend/mvnw.cmd b/backend/mvnw.cmd
new file mode 100755
index 0000000..249bdf3
--- /dev/null
+++ b/backend/mvnw.cmd
@@ -0,0 +1,149 @@
+<# : batch portion
+@REM ----------------------------------------------------------------------------
+@REM Licensed to the Apache Software Foundation (ASF) under one
+@REM or more contributor license agreements. See the NOTICE file
+@REM distributed with this work for additional information
+@REM regarding copyright ownership. The ASF licenses this file
+@REM to you under the Apache License, Version 2.0 (the
+@REM "License"); you may not use this file except in compliance
+@REM with the License. You may obtain a copy of the License at
+@REM
+@REM http://www.apache.org/licenses/LICENSE-2.0
+@REM
+@REM Unless required by applicable law or agreed to in writing,
+@REM software distributed under the License is distributed on an
+@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+@REM KIND, either express or implied. See the License for the
+@REM specific language governing permissions and limitations
+@REM under the License.
+@REM ----------------------------------------------------------------------------
+
+@REM ----------------------------------------------------------------------------
+@REM Apache Maven Wrapper startup batch script, version 3.3.2
+@REM
+@REM Optional ENV vars
+@REM MVNW_REPOURL - repo url base for downloading maven distribution
+@REM MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven
+@REM MVNW_VERBOSE - true: enable verbose log; others: silence the output
+@REM ----------------------------------------------------------------------------
+
+@IF "%__MVNW_ARG0_NAME__%"=="" (SET __MVNW_ARG0_NAME__=%~nx0)
+@SET __MVNW_CMD__=
+@SET __MVNW_ERROR__=
+@SET __MVNW_PSMODULEP_SAVE=%PSModulePath%
+@SET PSModulePath=
+@FOR /F "usebackq tokens=1* delims==" %%A IN (`powershell -noprofile "& {$scriptDir='%~dp0'; $script='%__MVNW_ARG0_NAME__%'; icm -ScriptBlock ([Scriptblock]::Create((Get-Content -Raw '%~f0'))) -NoNewScope}"`) DO @(
+ IF "%%A"=="MVN_CMD" (set __MVNW_CMD__=%%B) ELSE IF "%%B"=="" (echo %%A) ELSE (echo %%A=%%B)
+)
+@SET PSModulePath=%__MVNW_PSMODULEP_SAVE%
+@SET __MVNW_PSMODULEP_SAVE=
+@SET __MVNW_ARG0_NAME__=
+@SET MVNW_USERNAME=
+@SET MVNW_PASSWORD=
+@IF NOT "%__MVNW_CMD__%"=="" (%__MVNW_CMD__% %*)
+@echo Cannot start maven from wrapper >&2 && exit /b 1
+@GOTO :EOF
+: end batch / begin powershell #>
+
+$ErrorActionPreference = "Stop"
+if ($env:MVNW_VERBOSE -eq "true") {
+ $VerbosePreference = "Continue"
+}
+
+# calculate distributionUrl, requires .mvn/wrapper/maven-wrapper.properties
+$distributionUrl = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionUrl
+if (!$distributionUrl) {
+ Write-Error "cannot read distributionUrl property in $scriptDir/.mvn/wrapper/maven-wrapper.properties"
+}
+
+switch -wildcard -casesensitive ( $($distributionUrl -replace '^.*/','') ) {
+ "maven-mvnd-*" {
+ $USE_MVND = $true
+ $distributionUrl = $distributionUrl -replace '-bin\.[^.]*$',"-windows-amd64.zip"
+ $MVN_CMD = "mvnd.cmd"
+ break
+ }
+ default {
+ $USE_MVND = $false
+ $MVN_CMD = $script -replace '^mvnw','mvn'
+ break
+ }
+}
+
+# apply MVNW_REPOURL and calculate MAVEN_HOME
+# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-,maven-mvnd--}/
+if ($env:MVNW_REPOURL) {
+ $MVNW_REPO_PATTERN = if ($USE_MVND) { "/org/apache/maven/" } else { "/maven/mvnd/" }
+ $distributionUrl = "$env:MVNW_REPOURL$MVNW_REPO_PATTERN$($distributionUrl -replace '^.*'+$MVNW_REPO_PATTERN,'')"
+}
+$distributionUrlName = $distributionUrl -replace '^.*/',''
+$distributionUrlNameMain = $distributionUrlName -replace '\.[^.]*$','' -replace '-bin$',''
+$MAVEN_HOME_PARENT = "$HOME/.m2/wrapper/dists/$distributionUrlNameMain"
+if ($env:MAVEN_USER_HOME) {
+ $MAVEN_HOME_PARENT = "$env:MAVEN_USER_HOME/wrapper/dists/$distributionUrlNameMain"
+}
+$MAVEN_HOME_NAME = ([System.Security.Cryptography.MD5]::Create().ComputeHash([byte[]][char[]]$distributionUrl) | ForEach-Object {$_.ToString("x2")}) -join ''
+$MAVEN_HOME = "$MAVEN_HOME_PARENT/$MAVEN_HOME_NAME"
+
+if (Test-Path -Path "$MAVEN_HOME" -PathType Container) {
+ Write-Verbose "found existing MAVEN_HOME at $MAVEN_HOME"
+ Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD"
+ exit $?
+}
+
+if (! $distributionUrlNameMain -or ($distributionUrlName -eq $distributionUrlNameMain)) {
+ Write-Error "distributionUrl is not valid, must end with *-bin.zip, but found $distributionUrl"
+}
+
+# prepare tmp dir
+$TMP_DOWNLOAD_DIR_HOLDER = New-TemporaryFile
+$TMP_DOWNLOAD_DIR = New-Item -Itemtype Directory -Path "$TMP_DOWNLOAD_DIR_HOLDER.dir"
+$TMP_DOWNLOAD_DIR_HOLDER.Delete() | Out-Null
+trap {
+ if ($TMP_DOWNLOAD_DIR.Exists) {
+ try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null }
+ catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" }
+ }
+}
+
+New-Item -Itemtype Directory -Path "$MAVEN_HOME_PARENT" -Force | Out-Null
+
+# Download and Install Apache Maven
+Write-Verbose "Couldn't find MAVEN_HOME, downloading and installing it ..."
+Write-Verbose "Downloading from: $distributionUrl"
+Write-Verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName"
+
+$webclient = New-Object System.Net.WebClient
+if ($env:MVNW_USERNAME -and $env:MVNW_PASSWORD) {
+ $webclient.Credentials = New-Object System.Net.NetworkCredential($env:MVNW_USERNAME, $env:MVNW_PASSWORD)
+}
+[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
+$webclient.DownloadFile($distributionUrl, "$TMP_DOWNLOAD_DIR/$distributionUrlName") | Out-Null
+
+# If specified, validate the SHA-256 sum of the Maven distribution zip file
+$distributionSha256Sum = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionSha256Sum
+if ($distributionSha256Sum) {
+ if ($USE_MVND) {
+ Write-Error "Checksum validation is not supported for maven-mvnd. `nPlease disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties."
+ }
+ Import-Module $PSHOME\Modules\Microsoft.PowerShell.Utility -Function Get-FileHash
+ if ((Get-FileHash "$TMP_DOWNLOAD_DIR/$distributionUrlName" -Algorithm SHA256).Hash.ToLower() -ne $distributionSha256Sum) {
+ Write-Error "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised. If you updated your Maven version, you need to update the specified distributionSha256Sum property."
+ }
+}
+
+# unzip and move
+Expand-Archive "$TMP_DOWNLOAD_DIR/$distributionUrlName" -DestinationPath "$TMP_DOWNLOAD_DIR" | Out-Null
+Rename-Item -Path "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" -NewName $MAVEN_HOME_NAME | Out-Null
+try {
+ Move-Item -Path "$TMP_DOWNLOAD_DIR/$MAVEN_HOME_NAME" -Destination $MAVEN_HOME_PARENT | Out-Null
+} catch {
+ if (! (Test-Path -Path "$MAVEN_HOME" -PathType Container)) {
+ Write-Error "fail to move MAVEN_HOME"
+ }
+} finally {
+ try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null }
+ catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" }
+}
+
+Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD"
diff --git a/backend/pom.xml b/backend/pom.xml
new file mode 100755
index 0000000..46882e4
--- /dev/null
+++ b/backend/pom.xml
@@ -0,0 +1,100 @@
+
+
+ 4.0.0
+
+ org.springframework.boot
+ spring-boot-starter-parent
+ 3.4.1
+
+
+ com.zzhow
+ MagicShare
+ 1.0.0
+ MagicShare
+ MagicShare
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 21
+ 21
+ 21
+
+
+
+ org.springframework.boot
+ spring-boot-starter
+
+
+
+ org.springframework.boot
+ spring-boot-starter-websocket
+
+
+
+ org.springframework.boot
+ spring-boot-starter-test
+ test
+
+
+
+ org.openjfx
+ javafx-controls
+ 21
+
+
+ org.openjfx
+ javafx-fxml
+ 21
+
+
+ org.springframework.boot
+ spring-boot-starter-web
+
+
+
+
+ com.fasterxml.jackson.core
+ jackson-core
+ 2.18.2
+
+
+
+
+
+
+
+ org.openjfx
+ javafx-maven-plugin
+ 0.0.8
+
+
+
+ default-cli
+
+ com.zzhow.magicshare/com.zzhow.magicshare.ui.MainView
+ app
+ app
+ app
+ true
+ true
+ true
+
+
+
+
+
+
+
+
diff --git a/backend/src/main/java/com/zzhow/magicshare/MagicShareApplication.java b/backend/src/main/java/com/zzhow/magicshare/MagicShareApplication.java
new file mode 100755
index 0000000..1f972ea
--- /dev/null
+++ b/backend/src/main/java/com/zzhow/magicshare/MagicShareApplication.java
@@ -0,0 +1,13 @@
+package com.zzhow.magicshare;
+
+import com.zzhow.magicshare.ui.window.PromptWindow;
+
+/**
+ * @author ZZHow
+ * @date 2025/1/12
+ */
+public class MagicShareApplication {
+ public static void main(String[] args) {
+ PromptWindow.show();
+ }
+}
diff --git a/backend/src/main/java/com/zzhow/magicshare/config/WebSocketConfig.java b/backend/src/main/java/com/zzhow/magicshare/config/WebSocketConfig.java
new file mode 100644
index 0000000..4e9ac33
--- /dev/null
+++ b/backend/src/main/java/com/zzhow/magicshare/config/WebSocketConfig.java
@@ -0,0 +1,21 @@
+package com.zzhow.magicshare.config;
+
+import com.zzhow.magicshare.websocket.FileWebSocketHandler;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.socket.config.annotation.EnableWebSocket;
+import org.springframework.web.socket.config.annotation.WebSocketConfigurer;
+import org.springframework.web.socket.config.annotation.WebSocketHandlerRegistry;
+
+/**
+ * @author ZZHow
+ * @date 2025/01/16
+ */
+@Configuration
+@EnableWebSocket
+public class WebSocketConfig implements WebSocketConfigurer {
+ @Override
+ public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
+ // 注册 WebSocket 端点并指定处理器
+ registry.addHandler(new FileWebSocketHandler(), "/ws/download").setAllowedOrigins("*");
+ }
+}
\ No newline at end of file
diff --git a/backend/src/main/java/com/zzhow/magicshare/controller/DownloadController.java b/backend/src/main/java/com/zzhow/magicshare/controller/DownloadController.java
new file mode 100644
index 0000000..34ea671
--- /dev/null
+++ b/backend/src/main/java/com/zzhow/magicshare/controller/DownloadController.java
@@ -0,0 +1,60 @@
+package com.zzhow.magicshare.controller;
+
+import com.zzhow.magicshare.pojo.entity.FileDetail;
+import com.zzhow.magicshare.repository.FileRepository;
+import org.springframework.core.io.Resource;
+import org.springframework.core.io.UrlResource;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.*;
+
+import java.io.*;
+import java.net.URLEncoder;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Path;
+import java.util.List;
+
+/**
+ * @author ZZHow
+ * @date 2025/01/14
+ */
+@RestController()
+@RequestMapping("/api/download")
+public class DownloadController {
+ @GetMapping("/{fileId}")
+ public ResponseEntity downloadFile(String shareId, @PathVariable String fileId) {
+ if (shareId == null || fileId == null) {
+ return ResponseEntity.badRequest().build();
+ }
+
+ if (!shareId.equals(FileRepository.getUuid())) {
+ return ResponseEntity.notFound().build();
+ }
+
+ try {
+ // 构建文件路径
+ List files = FileRepository.getFiles();
+ int index = files.indexOf(new FileDetail(fileId));
+ if (index == -1)
+ return ResponseEntity.notFound().build();
+
+ String path = FileRepository.getBasePath() + files.get(index).getPath();
+ Path filePath = new File(path).toPath();
+
+ Resource resource = new UrlResource(filePath.toUri());
+
+ // 检查文件是否存在和可读
+ if (!resource.exists() || !resource.isReadable()) {
+ return ResponseEntity.notFound().build();
+ }
+
+ // 返回文件作为响应
+ return ResponseEntity.ok()
+ .header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + URLEncoder.encode(resource.getFilename(), StandardCharsets.UTF_8) + "\"")
+ .body(resource);
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ return ResponseEntity.internalServerError().build();
+ }
+ }
+}
diff --git a/backend/src/main/java/com/zzhow/magicshare/controller/FileController.java b/backend/src/main/java/com/zzhow/magicshare/controller/FileController.java
new file mode 100644
index 0000000..5a848ef
--- /dev/null
+++ b/backend/src/main/java/com/zzhow/magicshare/controller/FileController.java
@@ -0,0 +1,29 @@
+package com.zzhow.magicshare.controller;
+
+import com.zzhow.magicshare.pojo.dto.CryptoDTO;
+import com.zzhow.magicshare.pojo.vo.CryptoVO;
+import com.zzhow.magicshare.result.Result;
+import com.zzhow.magicshare.service.FileService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * @author ZZHow
+ * @date 2025/01/14
+ */
+@RestController()
+@RequestMapping("/api/file")
+public class FileController {
+ @Autowired
+ private FileService fileService;
+
+ @PostMapping(path = "/list")
+ public Result fileList(@RequestBody CryptoDTO cryptoDTO) {
+ return Result.success(fileService.getFileList(cryptoDTO.getKey()));
+ }
+
+ @GetMapping(path = "/check")
+ public Result checkCurrentShare(@RequestParam String shareId) {
+ return Result.success(fileService.checkCurrentShare(shareId));
+ }
+}
diff --git a/backend/src/main/java/com/zzhow/magicshare/controller/VueController.java b/backend/src/main/java/com/zzhow/magicshare/controller/VueController.java
new file mode 100644
index 0000000..97019d2
--- /dev/null
+++ b/backend/src/main/java/com/zzhow/magicshare/controller/VueController.java
@@ -0,0 +1,16 @@
+package com.zzhow.magicshare.controller;
+
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+/**
+ * @author ZZHow
+ * @date 2025/01/14
+ */
+@Controller
+public class VueController {
+ @RequestMapping("/{path:[^\\.]*}")
+ public String redirect() {
+ return "forward:/index.html";
+ }
+}
diff --git a/backend/src/main/java/com/zzhow/magicshare/filter/CorsFilter.java b/backend/src/main/java/com/zzhow/magicshare/filter/CorsFilter.java
new file mode 100644
index 0000000..1fbf82b
--- /dev/null
+++ b/backend/src/main/java/com/zzhow/magicshare/filter/CorsFilter.java
@@ -0,0 +1,31 @@
+package com.zzhow.magicshare.filter;
+
+import jakarta.servlet.*;
+import org.springframework.stereotype.Component;
+import jakarta.servlet.http.HttpServletResponse;
+
+import java.io.IOException;
+
+/**
+ * 添加响应头,允许跨域
+ *
+ * @author ZZHow
+ * @date 2025/01/14
+ */
+@Component
+public class CorsFilter implements Filter {
+
+ @Override
+ public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
+ throws IOException, ServletException {
+ HttpServletResponse httpResponse = (HttpServletResponse) response;
+
+ httpResponse.setHeader("Access-Control-Allow-Origin", "*");
+ httpResponse.setHeader("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS");
+ httpResponse.setHeader("Access-Control-Allow-Headers", "Content-Type, Authorization, token");
+ httpResponse.setHeader("Access-Control-Allow-Credentials", "true");
+
+ chain.doFilter(request, response);
+ }
+
+}
\ No newline at end of file
diff --git a/backend/src/main/java/com/zzhow/magicshare/pojo/dto/CryptoDTO.java b/backend/src/main/java/com/zzhow/magicshare/pojo/dto/CryptoDTO.java
new file mode 100644
index 0000000..c8eedbf
--- /dev/null
+++ b/backend/src/main/java/com/zzhow/magicshare/pojo/dto/CryptoDTO.java
@@ -0,0 +1,24 @@
+package com.zzhow.magicshare.pojo.dto;
+
+/**
+ * @author ZZHow
+ * @date 2025/01/15
+ */
+public class CryptoDTO {
+ private String key;
+
+ public CryptoDTO() {
+ }
+
+ public CryptoDTO(String key) {
+ this.key = key;
+ }
+
+ public String getKey() {
+ return key;
+ }
+
+ public void setKey(String key) {
+ this.key = key;
+ }
+}
diff --git a/backend/src/main/java/com/zzhow/magicshare/pojo/entity/AesCrypto.java b/backend/src/main/java/com/zzhow/magicshare/pojo/entity/AesCrypto.java
new file mode 100644
index 0000000..d788a62
--- /dev/null
+++ b/backend/src/main/java/com/zzhow/magicshare/pojo/entity/AesCrypto.java
@@ -0,0 +1,36 @@
+package com.zzhow.magicshare.pojo.entity;
+
+import javax.crypto.SecretKey;
+
+/**
+ * @author ZZHow
+ * @date 2025/01/16
+ */
+public class AesCrypto {
+ private SecretKey key;
+ private byte[] iv;
+
+ public AesCrypto() {
+ }
+
+ public AesCrypto(SecretKey key, byte[] iv) {
+ this.key = key;
+ this.iv = iv;
+ }
+
+ public SecretKey getKey() {
+ return key;
+ }
+
+ public void setKey(SecretKey key) {
+ this.key = key;
+ }
+
+ public byte[] getIv() {
+ return iv;
+ }
+
+ public void setIv(byte[] iv) {
+ this.iv = iv;
+ }
+}
diff --git a/backend/src/main/java/com/zzhow/magicshare/pojo/entity/FileDetail.java b/backend/src/main/java/com/zzhow/magicshare/pojo/entity/FileDetail.java
new file mode 100644
index 0000000..5f20bd5
--- /dev/null
+++ b/backend/src/main/java/com/zzhow/magicshare/pojo/entity/FileDetail.java
@@ -0,0 +1,98 @@
+package com.zzhow.magicshare.pojo.entity;
+
+import java.util.Objects;
+
+/**
+ * 文件实体类
+ *
+ * @author ZZHow
+ * @date 2025/01/14
+ */
+public class FileDetail {
+ // 文件 ID
+ private String fileId;
+ // 文件名
+ private String name;
+ // 文件类型
+ private String type;
+ // 文件大小(KB)
+ private double size;
+ // 文件路径
+ private String path;
+
+ public FileDetail() {
+ }
+
+ public FileDetail(String fileId) {
+ this.fileId = fileId;
+ }
+
+ public FileDetail(String fileId, String name, String type, double size, String path) {
+ this.fileId = fileId;
+ this.name = name;
+ this.type = type;
+ this.size = size;
+ this.path = path;
+ }
+
+ public String getFileId() {
+ return fileId;
+ }
+
+ public void setFileId(String fileId) {
+ this.fileId = fileId;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public double getSize() {
+ return size;
+ }
+
+ public void setSize(double size) {
+ this.size = size;
+ }
+
+ public String getPath() {
+ return path;
+ }
+
+ public void setPath(String path) {
+ this.path = path;
+ }
+
+ @Override
+ public String toString() {
+ return "FileDetail{" +
+ "name='" + name + '\'' +
+ ", type='" + type + '\'' +
+ ", path='" + path + '\'' +
+ "}\n";
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (o == null || getClass() != o.getClass()) return false;
+ FileDetail that = (FileDetail) o;
+ return this.fileId.equals(that.fileId);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(fileId);
+ }
+}
diff --git a/backend/src/main/java/com/zzhow/magicshare/pojo/vo/CryptoVO.java b/backend/src/main/java/com/zzhow/magicshare/pojo/vo/CryptoVO.java
new file mode 100644
index 0000000..35b8e5d
--- /dev/null
+++ b/backend/src/main/java/com/zzhow/magicshare/pojo/vo/CryptoVO.java
@@ -0,0 +1,44 @@
+package com.zzhow.magicshare.pojo.vo;
+
+/**
+ * @author ZZHow
+ * @date 2025/01/15
+ */
+public class CryptoVO {
+ private String key;
+ private String iv;
+ private String data;
+
+ public CryptoVO() {
+ }
+
+ public CryptoVO(String key, String iv, String data) {
+ this.key = key;
+ this.iv = iv;
+ this.data = data;
+ }
+
+ public String getKey() {
+ return key;
+ }
+
+ public void setKey(String key) {
+ this.key = key;
+ }
+
+ public String getIv() {
+ return iv;
+ }
+
+ public void setIv(String iv) {
+ this.iv = iv;
+ }
+
+ public String getData() {
+ return data;
+ }
+
+ public void setData(String data) {
+ this.data = data;
+ }
+}
diff --git a/backend/src/main/java/com/zzhow/magicshare/pojo/vo/FileListVO.java b/backend/src/main/java/com/zzhow/magicshare/pojo/vo/FileListVO.java
new file mode 100644
index 0000000..f84adbb
--- /dev/null
+++ b/backend/src/main/java/com/zzhow/magicshare/pojo/vo/FileListVO.java
@@ -0,0 +1,51 @@
+package com.zzhow.magicshare.pojo.vo;
+
+import com.zzhow.magicshare.pojo.entity.FileDetail;
+
+import java.util.List;
+
+/**
+ * @author ZZHow
+ * @date 2025/01/14
+ */
+public class FileListVO {
+ // 分享 ID
+ private String shareId;
+ // 总文件数
+ private Integer count;
+ // 文件列表
+ private List files;
+
+ public FileListVO() {
+ }
+
+ public FileListVO(String shareId, Integer count, List files) {
+ this.shareId = shareId;
+ this.count = count;
+ this.files = files;
+ }
+
+ public String getShareId() {
+ return shareId;
+ }
+
+ public void setShareId(String shareId) {
+ this.shareId = shareId;
+ }
+
+ public List getFiles() {
+ return files;
+ }
+
+ public void setFiles(List files) {
+ this.files = files;
+ }
+
+ public Integer getCount() {
+ return count;
+ }
+
+ public void setCount(Integer count) {
+ this.count = count;
+ }
+}
diff --git a/backend/src/main/java/com/zzhow/magicshare/repository/AesKeyRepository.java b/backend/src/main/java/com/zzhow/magicshare/repository/AesKeyRepository.java
new file mode 100644
index 0000000..dcb9ae4
--- /dev/null
+++ b/backend/src/main/java/com/zzhow/magicshare/repository/AesKeyRepository.java
@@ -0,0 +1,38 @@
+package com.zzhow.magicshare.repository;
+
+import com.zzhow.magicshare.pojo.entity.AesCrypto;
+
+import javax.crypto.SecretKey;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author ZZHow
+ * @date 2025/01/16
+ */
+public class AesKeyRepository {
+ private static final Map keys = new HashMap<>();
+
+ private AesKeyRepository() {
+ }
+
+ public static void clear() {
+ keys.clear();
+ }
+
+ public static void set(String session, AesCrypto aesCrypto) {
+ keys.put(session, aesCrypto);
+ }
+
+ public static void set(String session, SecretKey key, byte[] iv) {
+ keys.put(session, new AesCrypto(key, iv));
+ }
+
+ public static void delete(String session) {
+ keys.remove(session);
+ }
+
+ public static AesCrypto get(String session) {
+ return keys.get(session);
+ }
+}
diff --git a/backend/src/main/java/com/zzhow/magicshare/repository/FileRepository.java b/backend/src/main/java/com/zzhow/magicshare/repository/FileRepository.java
new file mode 100644
index 0000000..836127b
--- /dev/null
+++ b/backend/src/main/java/com/zzhow/magicshare/repository/FileRepository.java
@@ -0,0 +1,58 @@
+package com.zzhow.magicshare.repository;
+
+import com.zzhow.magicshare.pojo.entity.FileDetail;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.UUID;
+
+/**
+ * @author ZZHow
+ * @date 2025/01/14
+ */
+public class FileRepository {
+ // 分享 ID
+ private static String uuid = UUID.randomUUID().toString();
+ // 文件基路径
+ private static String basePath = "";
+ // 文件列表
+ private static List files = new ArrayList<>();
+
+ private FileRepository() {
+ }
+
+ public static List getFiles() {
+ return files;
+ }
+
+ public static void clearFiles() {
+ uuid = UUID.randomUUID().toString();
+ basePath = "";
+ files.clear();
+ }
+
+ public static void addFile(FileDetail fileDetail) {
+ files.add(fileDetail);
+ }
+
+ public static int size() {
+ return files.size();
+ }
+
+ public static String getUuid() {
+ return uuid;
+ }
+
+ public static void setFiles(String bashPath, List files) {
+ FileRepository.basePath = bashPath;
+ FileRepository.files = files;
+ }
+
+ public static void setBasePath(String basePath) {
+ FileRepository.basePath = basePath;
+ }
+
+ public static String getBasePath() {
+ return basePath;
+ }
+}
diff --git a/backend/src/main/java/com/zzhow/magicshare/result/Result.java b/backend/src/main/java/com/zzhow/magicshare/result/Result.java
new file mode 100644
index 0000000..386eb98
--- /dev/null
+++ b/backend/src/main/java/com/zzhow/magicshare/result/Result.java
@@ -0,0 +1,82 @@
+package com.zzhow.magicshare.result;
+
+/**
+ * 统一的结果
+ *
+ * @author ZZHow
+ * @date 2025/01/14
+ */
+public class Result {
+ private Integer code; // 代码:1 成功,0 和其它数字为失败
+ private String message; // 信息
+ private T data; // 数据
+
+ public Result() {
+ }
+
+ public Result(Integer code, String message, T data) {
+ this.code = code;
+ this.message = message;
+ this.data = data;
+ }
+
+ public static Result success() {
+ return new Result<>(0, "success", null);
+ }
+
+ public static Result success(String message, T object) {
+ return new Result<>(0, message, object);
+ }
+
+ public static Result success(T object) {
+ return new Result<>(0, "success", object);
+ }
+
+ public static Result error(String message) {
+ return new Result<>(1, message, null);
+ }
+
+ public static Result error(Integer code, String message) {
+ return new Result<>(code, message, null);
+ }
+
+ public static Result loginSuccessful(T object) {
+ return new Result<>(0, "Login successful", object);
+ }
+
+ public static Result loginFailed(Integer code, String message) {
+ return new Result<>(code, message, null);
+ }
+
+ public static Result unauthorized() {
+ return new Result<>(1, "Unauthorized", null);
+ }
+
+ public static Result resourceNotFound() {
+ return new Result<>(1, "Resource Not Found", null);
+ }
+
+ public Integer getCode() {
+ return code;
+ }
+
+ public void setCode(Integer code) {
+ this.code = code;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public T getData() {
+ return data;
+ }
+
+ public void setData(T data) {
+ this.data = data;
+ }
+}
diff --git a/backend/src/main/java/com/zzhow/magicshare/service/FileService.java b/backend/src/main/java/com/zzhow/magicshare/service/FileService.java
new file mode 100644
index 0000000..dc53121
--- /dev/null
+++ b/backend/src/main/java/com/zzhow/magicshare/service/FileService.java
@@ -0,0 +1,26 @@
+package com.zzhow.magicshare.service;
+
+import com.zzhow.magicshare.pojo.vo.CryptoVO;
+import com.zzhow.magicshare.pojo.vo.FileListVO;
+
+/**
+ * @author ZZHow
+ * @date 2025/01/14
+ */
+public interface FileService {
+ /**
+ * 获得分享的文件列表
+ *
+ * @param publicKey 公钥
+ * @return 分享的文件列表(经过 AES 加密)
+ */
+ CryptoVO getFileList(String publicKey);
+
+ /**
+ * 检查是否为当前分享
+ *
+ * @param shareId 分享 ID
+ * @return 是否为当前分享
+ */
+ boolean checkCurrentShare(String shareId);
+}
diff --git a/backend/src/main/java/com/zzhow/magicshare/service/impl/FileServiceImpl.java b/backend/src/main/java/com/zzhow/magicshare/service/impl/FileServiceImpl.java
new file mode 100644
index 0000000..2e61c2e
--- /dev/null
+++ b/backend/src/main/java/com/zzhow/magicshare/service/impl/FileServiceImpl.java
@@ -0,0 +1,95 @@
+package com.zzhow.magicshare.service.impl;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.zzhow.magicshare.pojo.vo.CryptoVO;
+import com.zzhow.magicshare.pojo.vo.FileListVO;
+import com.zzhow.magicshare.repository.FileRepository;
+import com.zzhow.magicshare.service.FileService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+
+import javax.crypto.*;
+import javax.crypto.spec.IvParameterSpec;
+import java.security.*;
+import java.security.spec.InvalidKeySpecException;
+import java.security.spec.X509EncodedKeySpec;
+import java.util.Base64;
+
+/**
+ * @author ZZHow
+ * @date 2025/01/14
+ */
+@Service
+public class FileServiceImpl implements FileService {
+ private static final Logger log = LoggerFactory.getLogger(FileServiceImpl.class);
+
+ /**
+ * 获得分享的文件列表
+ *
+ * @param publicKey 公钥
+ * @return 分享的文件列表
+ */
+ @Override
+ public CryptoVO getFileList(String publicKey) {
+ FileListVO fileListVO = new FileListVO(FileRepository.getUuid(), FileRepository.size(), FileRepository.getFiles());
+
+ try {
+ // Base64 解码
+ publicKey = new String(Base64.getDecoder().decode(publicKey));
+ // 去除 PEM 格式的头尾
+ String publicKeyContent = publicKey.replaceAll("-----\\w+ PUBLIC KEY-----", "").replaceAll("\\s+", "");
+ byte[] keyBytes = Base64.getDecoder().decode(publicKeyContent);
+
+ // 加载公钥
+ X509EncodedKeySpec spec = new X509EncodedKeySpec(keyBytes);
+ KeyFactory keyFactory = KeyFactory.getInstance("RSA");
+ PublicKey clientPublicKey = keyFactory.generatePublic(spec);
+
+ // 生成随机 AES 密钥
+ KeyGenerator keyGenerator = KeyGenerator.getInstance("AES");
+ keyGenerator.init(256); // 选择 AES 256 位密钥
+ SecretKey aesKey = keyGenerator.generateKey();
+
+ // 生成随机 IV(初始化向量)
+ byte[] iv = new byte[16]; // AES 块大小 128 位
+ SecureRandom secureRandom = new SecureRandom();
+ secureRandom.nextBytes(iv); // 填充随机数据到 iv 数组
+
+ // 使用 RSA 加密 AES 密钥
+ Cipher rsaCipher = Cipher.getInstance("RSA/ECB/OAEPWithSHA-256AndMGF1Padding");
+ rsaCipher.init(Cipher.ENCRYPT_MODE, clientPublicKey);
+ byte[] encryptedAesKey = rsaCipher.doFinal(aesKey.getEncoded());
+
+ // 初始化 AES 加密器
+ Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
+ IvParameterSpec ivSpec = new IvParameterSpec(iv);
+ cipher.init(Cipher.ENCRYPT_MODE, aesKey, ivSpec);
+
+ // 加密数据
+ ObjectMapper objectMapper = new ObjectMapper();
+ String jsonString = objectMapper.writeValueAsString(fileListVO); // 将对象序列化为 JSON 字符串
+ byte[] encryptedData = cipher.doFinal(jsonString.getBytes());
+
+ // 返回加密的 AES 密钥、IV 和加密数据
+ return new CryptoVO(Base64.getEncoder().encodeToString(encryptedAesKey), Base64.getEncoder().encodeToString(iv), Base64.getEncoder().encodeToString(encryptedData));
+ } catch (NoSuchAlgorithmException | NoSuchPaddingException | IllegalBlockSizeException |
+ InvalidKeySpecException | BadPaddingException | InvalidKeyException | JsonProcessingException |
+ InvalidAlgorithmParameterException e) {
+ throw new RuntimeException(e);
+ }
+
+ }
+
+ /**
+ * 检查是否为当前分享
+ *
+ * @param shareId 分享 ID
+ * @return 是否为当前分享
+ */
+ @Override
+ public boolean checkCurrentShare(String shareId) {
+ return FileRepository.getUuid().equals(shareId);
+ }
+}
diff --git a/backend/src/main/java/com/zzhow/magicshare/ui/controller/MainController.java b/backend/src/main/java/com/zzhow/magicshare/ui/controller/MainController.java
new file mode 100644
index 0000000..f1a164b
--- /dev/null
+++ b/backend/src/main/java/com/zzhow/magicshare/ui/controller/MainController.java
@@ -0,0 +1,181 @@
+package com.zzhow.magicshare.ui.controller;
+
+import com.zzhow.magicshare.repository.FileRepository;
+import com.zzhow.magicshare.pojo.entity.FileDetail;
+import com.zzhow.magicshare.ui.service.ShareService;
+import com.zzhow.magicshare.ui.service.impl.ShareServiceImpl;
+import com.zzhow.magicshare.ui.window.AboutWindow;
+import com.zzhow.magicshare.ui.window.MainWindow;
+import com.zzhow.magicshare.util.InternetUtil;
+import com.zzhow.magicshare.util.MessageBox;
+import javafx.beans.property.SimpleStringProperty;
+import javafx.fxml.FXML;
+import javafx.scene.control.*;
+import javafx.scene.input.DragEvent;
+import javafx.scene.input.KeyCode;
+import javafx.scene.input.KeyEvent;
+import javafx.scene.input.TransferMode;
+import javafx.stage.DirectoryChooser;
+import javafx.stage.FileChooser;
+
+import java.io.File;
+import java.util.List;
+
+/**
+ * @author ZZHow
+ * @date 2025/1/13
+ */
+public class MainController {
+ @FXML
+ private Label label1;
+ @FXML
+ private Label label2;
+ @FXML
+ private Label label3;
+ @FXML
+ private Label label4;
+ @FXML
+ private Label label5;
+ @FXML
+ private Label label6;
+ @FXML
+ private TextField textField1;
+ @FXML
+ private TextField textField2;
+ @FXML
+ private Button button1;
+ @FXML
+ private Button button2;
+ @FXML
+ private TableView tableView1;
+
+ private final ShareService shareService = new ShareServiceImpl();
+
+ private boolean serviceIsStarted = false;
+
+ @FXML
+ private void initialize() {
+ label2.setText(InternetUtil.getLocalIpAddress());
+
+ // 创建列
+ TableColumn fileNameCol = new TableColumn<>("文件名");
+ fileNameCol.setCellValueFactory(cellData -> new SimpleStringProperty(cellData.getValue().getName()));
+ TableColumn fileTypeCol = new TableColumn<>("类型");
+ fileTypeCol.setCellValueFactory(cellData -> new SimpleStringProperty(cellData.getValue().getType()));
+ TableColumn fileSizeCol = new TableColumn<>("大小(KB)");
+ fileSizeCol.setCellValueFactory(cellData -> new SimpleStringProperty(cellData.getValue().getSize() + ""));
+ TableColumn filePathCol = new TableColumn<>("相对路径");
+ filePathCol.setCellValueFactory(cellData -> new SimpleStringProperty(cellData.getValue().getPath()));
+ tableView1.getColumns().addAll(fileNameCol, fileTypeCol, fileSizeCol, filePathCol);
+ tableView1.setPlaceholder(new Label("分享列表为空"));
+
+ // 设置列的宽度比例
+ tableView1.widthProperty().addListener((obs, oldWidth, newWidth) -> {
+ double totalWidth = newWidth.doubleValue();
+ fileNameCol.setPrefWidth(totalWidth * 0.25);
+ fileTypeCol.setPrefWidth(totalWidth * 0.12);
+ fileSizeCol.setPrefWidth(totalWidth * 0.13);
+ filePathCol.setPrefWidth(totalWidth * 0.50);
+ });
+ }
+
+ @FXML
+ private void onStartOrStopServiceKeyDown(KeyEvent keyEvent) {
+ if (keyEvent.getCode().equals(KeyCode.ENTER))
+ onStartOrStopServiceClicked();
+ }
+
+ @FXML
+ private void onStartOrStopServiceClicked() {
+ if (serviceIsStarted) {
+ textField1.setDisable(false);
+ label1.setText("内网IPv4地址:");
+ label2.setText(InternetUtil.getLocalIpAddress());
+ button1.setText("启动服务");
+ shareService.stopService();
+ MessageBox.success("停止成功", "MagicShare 服务停止成功");
+ serviceIsStarted = false;
+
+ return;
+ }
+
+
+ byte i = shareService.startService(textField1.getText());
+ switch (i) {
+ case 0 -> {
+ textField1.setDisable(true);
+ label1.setText("分享URL:");
+ label2.setText("http://" + InternetUtil.getLocalIpAddress() + ":" + textField1.getText());
+ MessageBox.success("启动成功", "MagicShare 服务启动成功");
+ button1.setText("停止服务");
+ serviceIsStarted = true;
+ }
+ case 1 -> {
+ MessageBox.error("端口号错误", "端口号应为 1~65535 的整数");
+ }
+ case 2 -> {
+ MessageBox.error("端口被占用", "请尝试更换端口号");
+ }
+ }
+ }
+
+ @FXML
+ private void onSelectFileClicked() {
+ DirectoryChooser directoryChooser = new DirectoryChooser();
+ directoryChooser.setTitle("选择文件夹");
+ try {
+ textField2.setText(directoryChooser.showDialog(MainWindow.getStage()).getAbsolutePath());
+ onSearchFileClicked();
+ } catch (NullPointerException e) {
+ // 未选择文件夹
+ }
+ }
+
+ @FXML
+ private void onClearFileClicked() {
+ textField2.setText("");
+ onSearchFileClicked();
+ }
+
+ @FXML
+ private void onSearchFileKeyDown(KeyEvent keyEvent) {
+ if (keyEvent.getCode() == KeyCode.ENTER)
+ onSearchFileClicked();
+ }
+
+ @FXML
+ private void onSearchFileClicked() {
+ label6.setText("0");
+ tableView1.getItems().clear();
+
+ shareService.searchFile(textField2.getText());
+
+ for (FileDetail fileDetail : FileRepository.getFiles())
+ tableView1.getItems().add(fileDetail);
+ label6.setText(FileRepository.size() + "");
+ }
+
+ @FXML
+ private void handleDragOver(DragEvent event) {
+ if (event.getGestureSource() != event.getTarget() // 是否从外部拖拽
+ && event.getDragboard().hasFiles()) { // 是否拖拽了文件
+ event.acceptTransferModes(TransferMode.COPY_OR_MOVE); // 接受拖拽的文件
+ }
+ event.consume();
+ }
+
+ @FXML
+ private void onDragFile(DragEvent event) {
+ List files = event.getDragboard().getFiles();
+ if (!files.isEmpty()) {
+ textField2.setText(files.get(0).getAbsolutePath());
+ }
+
+ onSearchFileClicked();
+ }
+
+ @FXML
+ private void onAboutClicked() {
+ AboutWindow.open();
+ }
+}
diff --git a/backend/src/main/java/com/zzhow/magicshare/ui/controller/PromptController.java b/backend/src/main/java/com/zzhow/magicshare/ui/controller/PromptController.java
new file mode 100644
index 0000000..9c8b35e
--- /dev/null
+++ b/backend/src/main/java/com/zzhow/magicshare/ui/controller/PromptController.java
@@ -0,0 +1,20 @@
+package com.zzhow.magicshare.ui.controller;
+
+import com.zzhow.magicshare.ui.window.PromptWindow;
+import javafx.fxml.FXML;
+
+/**
+ * @author ZZHow
+ * @date 2025/01/17
+ */
+public class PromptController {
+ @FXML
+ private void onAgreeClicked() {
+ PromptWindow.close();
+ }
+
+ @FXML
+ private void onExitClicked() {
+ System.exit(0);
+ }
+}
diff --git a/backend/src/main/java/com/zzhow/magicshare/ui/service/ShareService.java b/backend/src/main/java/com/zzhow/magicshare/ui/service/ShareService.java
new file mode 100644
index 0000000..17e0aa8
--- /dev/null
+++ b/backend/src/main/java/com/zzhow/magicshare/ui/service/ShareService.java
@@ -0,0 +1,27 @@
+package com.zzhow.magicshare.ui.service;
+
+/**
+ * @author ZZHow
+ * @date 2025/01/14
+ */
+public interface ShareService {
+ /**
+ * 启动 MagicShare 服务
+ *
+ * @param port 端口号
+ * @return 0-启动成功;1-端口号错误;2-端口被占用
+ */
+ byte startService(String port);
+
+ /**
+ * 停止 MagicShare 服务
+ */
+ void stopService();
+
+ /**
+ * 查找文件
+ *
+ * @param path 路径
+ */
+ void searchFile(String path);
+}
diff --git a/backend/src/main/java/com/zzhow/magicshare/ui/service/impl/ShareServiceImpl.java b/backend/src/main/java/com/zzhow/magicshare/ui/service/impl/ShareServiceImpl.java
new file mode 100644
index 0000000..f64fff7
--- /dev/null
+++ b/backend/src/main/java/com/zzhow/magicshare/ui/service/impl/ShareServiceImpl.java
@@ -0,0 +1,61 @@
+package com.zzhow.magicshare.ui.service.impl;
+
+import com.zzhow.magicshare.repository.FileRepository;
+import com.zzhow.magicshare.util.Application;
+import com.zzhow.magicshare.ui.service.ShareService;
+import com.zzhow.magicshare.util.FileUtil;
+import com.zzhow.magicshare.util.InternetUtil;
+import org.springframework.boot.SpringApplication;
+import org.springframework.context.ConfigurableApplicationContext;
+
+/**
+ * @author ZZHow
+ * @date 2025/01/14
+ */
+public class ShareServiceImpl implements ShareService {
+ private ConfigurableApplicationContext applicationContext;
+
+ /**
+ * 启动 MagicShare 服务
+ *
+ * @param portStr 端口号
+ * @return 0-启动成功;1-端口号错误;2-端口被占用
+ */
+ @Override
+ public byte startService(String portStr) {
+ try {
+ int port = Integer.parseInt(portStr);
+ if (port < 1 || port > 65535)
+ return 1;
+ if (InternetUtil.isPortInUse(port))
+ return 2;
+ else {
+ applicationContext = Application.startSpringBoot("--server.port=" + port);
+
+ return 0;
+ }
+ } catch (NumberFormatException e) {
+ return 1;
+ }
+ }
+
+ /**
+ * 停止 MagicShare 服务
+ */
+ @Override
+ public void stopService() {
+ SpringApplication.exit(applicationContext, () -> 0);
+ }
+
+ /**
+ * 查找文件
+ *
+ * @param path 路径
+ */
+ @Override
+ public void searchFile(String path) {
+ FileRepository.clearFiles();
+ FileRepository.setBasePath(path);
+ FileUtil.find(path, FileRepository.getFiles());
+ }
+}
diff --git a/backend/src/main/java/com/zzhow/magicshare/ui/window/AboutWindow.java b/backend/src/main/java/com/zzhow/magicshare/ui/window/AboutWindow.java
new file mode 100644
index 0000000..63acf31
--- /dev/null
+++ b/backend/src/main/java/com/zzhow/magicshare/ui/window/AboutWindow.java
@@ -0,0 +1,57 @@
+package com.zzhow.magicshare.ui.window;
+
+import com.zzhow.magicshare.MagicShareApplication;
+import javafx.fxml.FXMLLoader;
+import javafx.scene.Scene;
+import javafx.scene.image.Image;
+import javafx.scene.layout.Pane;
+import javafx.stage.Stage;
+
+import java.io.IOException;
+import java.util.Objects;
+
+/**
+ * @author ZZHow
+ * @date 2025/01/17
+ */
+public class AboutWindow extends javafx.application.Application {
+ private static Stage stage = null;
+
+ @Override
+ public void start(Stage stage) throws IOException {
+ AboutWindow.stage = stage;
+ FXMLLoader fxmlLoader = new FXMLLoader(MainWindow.class.getResource("about-window.fxml"));
+ Scene scene = new Scene(fxmlLoader.load(), 600, 400);
+ stage.setTitle("MagicShare-About");
+ stage.setScene(scene);
+ Image icon = new Image(Objects.requireNonNull(MagicShareApplication.class.getResourceAsStream("/image/icon.png")));
+ stage.getIcons().add(icon);
+ stage.setResizable(false);
+ stage.show();
+ }
+
+ public static void open() {
+ Stage stage = new Stage();
+ stage.setTitle("MagicShare-About");
+ Image icon = new Image(Objects.requireNonNull(MagicShareApplication.class.getResourceAsStream("/image/icon.png")));
+ stage.getIcons().add(icon);
+ stage.setResizable(false);
+ try {
+ Pane load = FXMLLoader.load(Objects.requireNonNull(MainWindow.class.getResource("about-window.fxml")));
+ Scene scene = new Scene(load);
+ stage.setScene(scene);
+ stage.show();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public static void close() {
+ stage.close();
+ MainWindow.open();
+ }
+
+ public static void show() {
+ launch();
+ }
+}
diff --git a/backend/src/main/java/com/zzhow/magicshare/ui/window/MainWindow.java b/backend/src/main/java/com/zzhow/magicshare/ui/window/MainWindow.java
new file mode 100755
index 0000000..ddc0579
--- /dev/null
+++ b/backend/src/main/java/com/zzhow/magicshare/ui/window/MainWindow.java
@@ -0,0 +1,61 @@
+package com.zzhow.magicshare.ui.window;
+
+import com.zzhow.magicshare.MagicShareApplication;
+import javafx.fxml.FXMLLoader;
+import javafx.scene.Scene;
+import javafx.scene.image.Image;
+import javafx.scene.layout.Pane;
+import javafx.stage.Stage;
+
+import java.io.IOException;
+import java.util.Objects;
+
+/**
+ * @author ZZHow
+ * @date 2025/1/12
+ */
+public class MainWindow extends javafx.application.Application {
+ private static Stage stage = null;
+
+ @Override
+ public void start(Stage stage) throws IOException {
+ FXMLLoader fxmlLoader = new FXMLLoader(MainWindow.class.getResource("main-window.fxml"));
+ Scene scene = new Scene(fxmlLoader.load(), 600, 400);
+ stage.setTitle("MagicShare");
+ stage.setScene(scene);
+ Image icon = new Image(Objects.requireNonNull(MagicShareApplication.class.getResourceAsStream("/image/icon.png")));
+ stage.getIcons().add(icon);
+ stage.setResizable(false);
+ stage.setOnHiding(windowEvent -> {
+ System.exit(0);
+ });
+ stage.show();
+ }
+
+ public static void open() {
+ Stage stage = new Stage();
+ stage.setTitle("MagicShare");
+ Image icon = new Image(Objects.requireNonNull(MagicShareApplication.class.getResourceAsStream("/image/icon.png")));
+ stage.getIcons().add(icon);
+ stage.setResizable(false);
+ try {
+ Pane load = FXMLLoader.load(Objects.requireNonNull(MainWindow.class.getResource("main-window.fxml")));
+ Scene scene = new Scene(load);
+ stage.setScene(scene);
+ stage.setOnHiding(windowEvent -> {
+ System.exit(0);
+ });
+ stage.show();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public static Stage getStage() {
+ return stage;
+ }
+
+ public static void show() {
+ launch();
+ }
+}
\ No newline at end of file
diff --git a/backend/src/main/java/com/zzhow/magicshare/ui/window/PromptWindow.java b/backend/src/main/java/com/zzhow/magicshare/ui/window/PromptWindow.java
new file mode 100644
index 0000000..4f9dd54
--- /dev/null
+++ b/backend/src/main/java/com/zzhow/magicshare/ui/window/PromptWindow.java
@@ -0,0 +1,40 @@
+package com.zzhow.magicshare.ui.window;
+
+import com.zzhow.magicshare.MagicShareApplication;
+import javafx.fxml.FXMLLoader;
+import javafx.scene.Scene;
+import javafx.scene.image.Image;
+import javafx.stage.Stage;
+
+import java.io.IOException;
+import java.util.Objects;
+
+/**
+ * @author ZZHow
+ * @date 2025/01/17
+ */
+public class PromptWindow extends javafx.application.Application {
+ private static Stage stage = null;
+
+ @Override
+ public void start(Stage stage) throws IOException {
+ PromptWindow.stage = stage;
+ FXMLLoader fxmlLoader = new FXMLLoader(MainWindow.class.getResource("prompt-window.fxml"));
+ Scene scene = new Scene(fxmlLoader.load(), 780, 450);
+ stage.setTitle("MagicShare");
+ stage.setScene(scene);
+ Image icon = new Image(Objects.requireNonNull(MagicShareApplication.class.getResourceAsStream("/image/icon.png")));
+ stage.getIcons().add(icon);
+ stage.setResizable(false);
+ stage.show();
+ }
+
+ public static void close() {
+ stage.close();
+ MainWindow.open();
+ }
+
+ public static void show() {
+ launch();
+ }
+}
diff --git a/backend/src/main/java/com/zzhow/magicshare/util/Application.java b/backend/src/main/java/com/zzhow/magicshare/util/Application.java
new file mode 100644
index 0000000..0bed754
--- /dev/null
+++ b/backend/src/main/java/com/zzhow/magicshare/util/Application.java
@@ -0,0 +1,16 @@
+package com.zzhow.magicshare.util;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.context.ConfigurableApplicationContext;
+
+/**
+ * @author ZZHow
+ * @date 2025/01/14
+ */
+@SpringBootApplication(proxyBeanMethods = false, scanBasePackages = "com.zzhow.magicshare")
+public class Application {
+ public static ConfigurableApplicationContext startSpringBoot(String args) {
+ return SpringApplication.run(Application.class, args);
+ }
+}
diff --git a/backend/src/main/java/com/zzhow/magicshare/util/FileUtil.java b/backend/src/main/java/com/zzhow/magicshare/util/FileUtil.java
new file mode 100644
index 0000000..9559882
--- /dev/null
+++ b/backend/src/main/java/com/zzhow/magicshare/util/FileUtil.java
@@ -0,0 +1,56 @@
+package com.zzhow.magicshare.util;
+
+import com.zzhow.magicshare.pojo.entity.FileDetail;
+import com.zzhow.magicshare.repository.FileRepository;
+
+import java.io.File;
+import java.util.List;
+
+/**
+ * @author ZZHow
+ * @date 2025/01/14
+ */
+public class FileUtil {
+ public static final SnowflakeIdGenerator generator = new SnowflakeIdGenerator(1);
+
+ /**
+ * 查找指定路径下的所有文件
+ *
+ * @param path 路径
+ * @param res 所有文件的路径
+ */
+ public static void find(String path, List res) {
+ File currentPath = new File(path);
+
+ if (!currentPath.exists())
+ return;
+
+ if (!currentPath.isDirectory()) {
+ String fileName = currentPath.getName();
+ String fileType = "unknown";
+ if (fileName.lastIndexOf(".") != -1)
+ fileType = fileName.substring(fileName.lastIndexOf(".") + 1);
+ FileDetail fileDetail = new FileDetail(generator.generateId() + "", fileName, fileType, Math.round(currentPath.length() / 1024.0 * 10.0) / 10.0, "");
+ res.add(fileDetail);
+ return;
+ }
+
+ File[] files = currentPath.listFiles();
+
+ if (files == null) return;
+
+ for (File file : files) {
+ if (file.isDirectory()) {
+ find(file.getAbsolutePath(), res);
+ } else {
+ String fileName = file.getName();
+ String fileType = "unknown";
+ if (fileName.lastIndexOf(".") != -1)
+ fileType = fileName.substring(fileName.lastIndexOf(".") + 1);
+
+ FileDetail fileDetail = new FileDetail(generator.generateId() + "", fileName, fileType, Math.round(file.length() / 1024.0 * 10.0) / 10.0, file.getAbsolutePath().replace(FileRepository.getBasePath(), ""));
+ res.add(fileDetail);
+ }
+ }
+ }
+}
diff --git a/backend/src/main/java/com/zzhow/magicshare/util/InternetUtil.java b/backend/src/main/java/com/zzhow/magicshare/util/InternetUtil.java
new file mode 100644
index 0000000..4bda041
--- /dev/null
+++ b/backend/src/main/java/com/zzhow/magicshare/util/InternetUtil.java
@@ -0,0 +1,62 @@
+package com.zzhow.magicshare.util;
+
+import java.io.IOException;
+import java.net.*;
+import java.util.Enumeration;
+import java.util.regex.Pattern;
+
+/**
+ * @author ZZHow
+ * @date 2025/1/13
+ */
+public class InternetUtil {
+ /**
+ * 获取内网 IPv4 地址
+ *
+ * @return 内网 IPv4 地址
+ */
+ public static String getLocalIpAddress() {
+ try {
+ /*内网 IP 正则表达式
+ A: 10.0.0.0 - 10.255.255.255
+ B: 172.16.0.0 - 172.31.255.255
+ C: 192.168.0.0 - 192.168.255.255
+ */
+ String privateIpRegex = "^(10\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}|172\\.(1[6-9]|2[0-9]|3[0-1])\\.\\d{1,3}\\.\\d{1,3}|192\\.168\\.\\d{1,3}\\.\\d{1,3})$";
+ Pattern pattern = Pattern.compile(privateIpRegex);
+
+ // 获取所有网络接口
+ Enumeration networkInterfaces = NetworkInterface.getNetworkInterfaces();
+
+ while (networkInterfaces.hasMoreElements()) {
+ NetworkInterface networkInterface = networkInterfaces.nextElement();
+
+ // 跳过未启用或回环接口
+ if (!networkInterface.isUp() || networkInterface.isLoopback()) {
+ continue;
+ }
+
+ // 获取当前网络接口的 IP 地址
+ Enumeration inetAddresses = networkInterface.getInetAddresses();
+ while (inetAddresses.hasMoreElements()) {
+ InetAddress inetAddress = inetAddresses.nextElement();
+ if (inetAddress instanceof Inet4Address && pattern.matcher(inetAddress.getHostAddress()).matches()) {
+ return inetAddress.getHostAddress();
+ }
+ }
+ }
+ } catch (SocketException e) {
+ e.printStackTrace();
+ }
+
+ return null;
+ }
+
+ public static boolean isPortInUse(int port) {
+ try (ServerSocket socket = new ServerSocket(port)) {
+ return false;
+ } catch (IOException e) {
+ return true;
+ }
+ }
+}
diff --git a/backend/src/main/java/com/zzhow/magicshare/util/MessageBox.java b/backend/src/main/java/com/zzhow/magicshare/util/MessageBox.java
new file mode 100644
index 0000000..935bc6b
--- /dev/null
+++ b/backend/src/main/java/com/zzhow/magicshare/util/MessageBox.java
@@ -0,0 +1,43 @@
+package com.zzhow.magicshare.util;
+
+import com.zzhow.magicshare.MagicShareApplication;
+import javafx.scene.control.Alert;
+import javafx.scene.image.Image;
+import javafx.stage.Stage;
+
+import java.util.Objects;
+
+/**
+ * @author ZZHow
+ * @date 2025/01/14
+ */
+public class MessageBox {
+
+ public static void alert(Alert.AlertType type, String title, String headerText, String contentText) {
+ Alert alert = new Alert(type);
+ alert.setTitle(title);
+ alert.setHeaderText(headerText);
+ alert.setContentText(contentText);
+
+ Stage stage = (Stage) alert.getDialogPane().getScene().getWindow();
+ Image icon = new Image(Objects.requireNonNull(MagicShareApplication.class.getResourceAsStream("/image/icon.png")));
+ stage.getIcons().add(icon);
+
+ alert.showAndWait();
+ }
+
+ public static void error(String headerText, String contentText) {
+ alert(Alert.AlertType.ERROR,
+ "错误",
+ headerText,
+ contentText);
+ }
+
+ public static void success(String headerText, String contentText) {
+ alert(Alert.AlertType.INFORMATION,
+ "成功",
+ headerText,
+ contentText);
+ }
+
+}
diff --git a/backend/src/main/java/com/zzhow/magicshare/util/SnowflakeIdGenerator.java b/backend/src/main/java/com/zzhow/magicshare/util/SnowflakeIdGenerator.java
new file mode 100644
index 0000000..9335102
--- /dev/null
+++ b/backend/src/main/java/com/zzhow/magicshare/util/SnowflakeIdGenerator.java
@@ -0,0 +1,69 @@
+package com.zzhow.magicshare.util;
+
+/**
+ * 雪花算法(Snowflake)ID 生成器
+ */
+public class SnowflakeIdGenerator {
+
+ // 配置参数
+ private final long epoch = 1640995200000L; // 自定义起始时间戳(2022-01-01 00:00:00)
+ private final long machineIdBits = 10L; // 机器 ID 部分的位数
+ private final long sequenceBits = 12L; // 序列号部分的位数
+ private final long machineIdMax = -1L ^ (-1L << machineIdBits); // 机器 ID 最大值
+ private final long sequenceMask = -1L ^ (-1L << sequenceBits); // 序列号掩码
+
+ // 位移量
+ private final long machineIdShift = sequenceBits; // 机器 ID 左移的位数
+ private final long timestampShift = sequenceBits + machineIdBits; // 时间戳左移的位数
+ private final long epochShift = 22; // 基准时间(自定义起始时间戳)
+
+ private long lastTimestamp = -1L; // 上一次生成 ID 的时间戳
+ private long sequence = 0L; // 序列号
+ private final long machineId; // 机器 ID
+
+ public SnowflakeIdGenerator(long machineId) {
+ if (machineId > machineIdMax || machineId < 0) {
+ throw new IllegalArgumentException("机器 ID 必须在 0 到 " + machineIdMax);
+ }
+ this.machineId = machineId;
+ }
+
+ // 生成唯一的 ID
+ public synchronized long generateId() {
+ long timestamp = timeGen(); // 当前时间戳
+ if (timestamp < lastTimestamp) {
+ throw new RuntimeException("系统时钟出现回退,无法生成 ID");
+ }
+
+ if (timestamp == lastTimestamp) {
+ // 同一毫秒内,序列号递增
+ sequence = (sequence + 1) & sequenceMask;
+ if (sequence == 0) {
+ // 序列号溢出,等待下一毫秒
+ timestamp = tilNextMillis(lastTimestamp);
+ }
+ } else {
+ // 不同毫秒,序列号重置
+ sequence = 0;
+ }
+
+ lastTimestamp = timestamp;
+
+ // 组装雪花算法生成的唯一 ID
+ return ((timestamp - epoch) << timestampShift) | (machineId << machineIdShift) | sequence;
+ }
+
+ // 获取当前时间戳(毫秒)
+ private long timeGen() {
+ return System.currentTimeMillis();
+ }
+
+ // 等待下一毫秒
+ private long tilNextMillis(long lastTimestamp) {
+ long timestamp = timeGen();
+ while (timestamp <= lastTimestamp) {
+ timestamp = timeGen();
+ }
+ return timestamp;
+ }
+}
diff --git a/backend/src/main/java/com/zzhow/magicshare/websocket/FileWebSocketHandler.java b/backend/src/main/java/com/zzhow/magicshare/websocket/FileWebSocketHandler.java
new file mode 100644
index 0000000..7b9e585
--- /dev/null
+++ b/backend/src/main/java/com/zzhow/magicshare/websocket/FileWebSocketHandler.java
@@ -0,0 +1,132 @@
+package com.zzhow.magicshare.websocket;
+
+import com.zzhow.magicshare.pojo.entity.AesCrypto;
+import com.zzhow.magicshare.pojo.entity.FileDetail;
+import com.zzhow.magicshare.repository.AesKeyRepository;
+import com.zzhow.magicshare.repository.FileRepository;
+import org.springframework.web.socket.CloseStatus;
+import org.springframework.web.socket.TextMessage;
+import org.springframework.web.socket.WebSocketSession;
+import org.springframework.web.socket.handler.TextWebSocketHandler;
+
+import javax.crypto.Cipher;
+import javax.crypto.KeyGenerator;
+import javax.crypto.SecretKey;
+import javax.crypto.spec.IvParameterSpec;
+import java.io.BufferedInputStream;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.security.KeyFactory;
+import java.security.PublicKey;
+import java.security.SecureRandom;
+import java.security.spec.X509EncodedKeySpec;
+import java.util.Arrays;
+import java.util.Base64;
+import java.util.List;
+
+/**
+ * @author ZZHow
+ * @date 2025/01/16
+ */
+public class FileWebSocketHandler extends TextWebSocketHandler {
+ private static final int CHUNK_SIZE = 8192;
+
+ @Override
+ public void afterConnectionClosed(WebSocketSession session, CloseStatus status) {
+ AesKeyRepository.delete(session.getId());
+ }
+
+ @Override
+ public void handleTextMessage(WebSocketSession session, TextMessage message) throws Exception {
+ // 消息格式:a,publicKey,fileId
+ if (message.getPayload().charAt(0) == 'a') {
+ String[] split = message.getPayload().split(",");
+
+ // 计算分块数量
+ List files = FileRepository.getFiles();
+ int index = files.indexOf(new FileDetail(split[2]));
+ if (index == -1) {
+ session.sendMessage(new TextMessage("Not found"));
+ session.close(CloseStatus.NOT_ACCEPTABLE);
+ return;
+ }
+ int block = (int) Math.ceil(files.get(index).getSize() / (CHUNK_SIZE / 1024.0));
+
+ // Base64 解码
+ String key = new String(Base64.getDecoder().decode(split[1]));
+
+ // 去除 PEM 格式的头尾
+ key = key.replaceAll("-----\\w+ PUBLIC KEY-----", "").replaceAll("\\s+", "");
+ byte[] keyBytes = Base64.getDecoder().decode(key);
+
+ // 加载公钥
+ X509EncodedKeySpec spec = new X509EncodedKeySpec(keyBytes);
+ KeyFactory keyFactory = KeyFactory.getInstance("RSA");
+ PublicKey publicKey = keyFactory.generatePublic(spec);
+
+ // 生成随机 AES 密钥
+ KeyGenerator keyGenerator = KeyGenerator.getInstance("AES");
+ keyGenerator.init(256); // 选择 AES 256 位密钥
+ SecretKey aesKey = keyGenerator.generateKey();
+
+ // 生成随机 IV(初始化向量)
+ byte[] iv = new byte[16]; // AES 块大小 128 位
+ SecureRandom secureRandom = new SecureRandom();
+ secureRandom.nextBytes(iv); // 填充随机数据到 iv 数组
+
+ // 使用 RSA 加密 AES 密钥
+ Cipher rsaCipher = Cipher.getInstance("RSA/ECB/OAEPWithSHA-256AndMGF1Padding");
+ rsaCipher.init(Cipher.ENCRYPT_MODE, publicKey);
+ byte[] encryptedAesKey = rsaCipher.doFinal(aesKey.getEncoded());
+
+ AesKeyRepository.set(session.getId(), aesKey, iv);
+ session.sendMessage(new TextMessage("key#" + Base64.getEncoder().encodeToString(encryptedAesKey) + ",iv#" + Base64.getEncoder().encodeToString(iv) + ",block#" + block));
+
+ // 消息格式:b,fileId
+ } else if ((message.getPayload().charAt(0) == 'b')) {
+ String[] split = message.getPayload().split(",");
+
+ // 构建文件路径
+ List files = FileRepository.getFiles();
+ int index = files.indexOf(new FileDetail(split[1]));
+ if (index == -1) {
+ session.sendMessage(new TextMessage("Not found"));
+ session.close(CloseStatus.NOT_ACCEPTABLE);
+ return;
+ }
+
+ String filePath = FileRepository.getBasePath() + files.get(index).getPath();
+
+ // 初始化 AES 加密器
+ Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
+ AesCrypto aesCrypto = AesKeyRepository.get(session.getId());
+ IvParameterSpec ivSpec = new IvParameterSpec(aesCrypto.getIv());
+ cipher.init(Cipher.ENCRYPT_MODE, aesCrypto.getKey(), ivSpec);
+
+ try (BufferedInputStream bis = new BufferedInputStream(new FileInputStream(filePath))) {
+ byte[] buffer = new byte[CHUNK_SIZE];
+ int bytesRead;
+ while ((bytesRead = bis.read(buffer)) != -1) {
+ // 通过 WebSocket 传输文件数据
+ byte[] encryptedData;
+ if (bytesRead == CHUNK_SIZE)
+ encryptedData = cipher.doFinal(buffer);
+ else {
+ byte[] newBuffer = Arrays.copyOf(buffer, bytesRead);
+ encryptedData = cipher.doFinal(newBuffer);
+ }
+ session.sendMessage(new TextMessage(new String(Base64.getEncoder().encode(encryptedData))));
+ }
+
+ // 发送结束
+ session.sendMessage(new TextMessage("fin"));
+ } catch (IOException e) {
+ session.sendMessage(new TextMessage("Error: " + e.getMessage()));
+ session.close();
+ }
+ } else {
+ session.sendMessage(new TextMessage("Bad Request"));
+ session.close();
+ }
+ }
+}
\ No newline at end of file
diff --git a/backend/src/main/resources/application.yml b/backend/src/main/resources/application.yml
new file mode 100644
index 0000000..0d3a046
--- /dev/null
+++ b/backend/src/main/resources/application.yml
@@ -0,0 +1,7 @@
+spring:
+ application:
+ name: MagicShare
+
+ web:
+ resources:
+ static-locations: classpath:/static/
diff --git a/backend/src/main/resources/banner.txt b/backend/src/main/resources/banner.txt
new file mode 100644
index 0000000..2a2ce69
--- /dev/null
+++ b/backend/src/main/resources/banner.txt
@@ -0,0 +1,9 @@
+
+ __ __ _ _____ _
+ | \/ | (_) / ____| |
+ | \ / | __ _ __ _ _ ___| (___ | |__ __ _ _ __ ___
+ | |\/| |/ _` |/ _` | |/ __|\___ \| '_ \ / _` | '__/ _ \
+ | | | | (_| | (_| | | (__ ____) | | | | (_| | | | __/
+ |_| |_|\__,_|\__, |_|\___|_____/|_| |_|\__,_|_| \___|
+ __/ |
+ |___/
diff --git a/backend/src/main/resources/com/zzhow/magicshare/ui/window/about-window.fxml b/backend/src/main/resources/com/zzhow/magicshare/ui/window/about-window.fxml
new file mode 100644
index 0000000..f7cb21f
--- /dev/null
+++ b/backend/src/main/resources/com/zzhow/magicshare/ui/window/about-window.fxml
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/backend/src/main/resources/com/zzhow/magicshare/ui/window/main-window.fxml b/backend/src/main/resources/com/zzhow/magicshare/ui/window/main-window.fxml
new file mode 100755
index 0000000..4b3da2f
--- /dev/null
+++ b/backend/src/main/resources/com/zzhow/magicshare/ui/window/main-window.fxml
@@ -0,0 +1,37 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/backend/src/main/resources/com/zzhow/magicshare/ui/window/prompt-window.fxml b/backend/src/main/resources/com/zzhow/magicshare/ui/window/prompt-window.fxml
new file mode 100644
index 0000000..eab26c2
--- /dev/null
+++ b/backend/src/main/resources/com/zzhow/magicshare/ui/window/prompt-window.fxml
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/backend/src/main/resources/image/icon.png b/backend/src/main/resources/image/icon.png
new file mode 100644
index 0000000..3b76931
Binary files /dev/null and b/backend/src/main/resources/image/icon.png differ
diff --git a/backend/src/main/resources/static/assets/AboutPage-B8ON9FDS.js b/backend/src/main/resources/static/assets/AboutPage-B8ON9FDS.js
new file mode 100644
index 0000000..784b9d2
--- /dev/null
+++ b/backend/src/main/resources/static/assets/AboutPage-B8ON9FDS.js
@@ -0,0 +1 @@
+import{_ as t}from"./MagicShare-DLx5ZzAx.js";import{_ as d,e as c,$ as e,g as s}from"./index-moUN8hPO.js";const o={},i={class:"about-page"};function r(v,a){return s(),c("div",i,a[0]||(a[0]=[e('