diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..cdb77c8
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,18 @@
+[submodule "android/common_python"]
+ path = android/common_python
+ url = https://github.com/canewsin/common_python.git
+[submodule "android/nativelibs_python"]
+ path = android/nativelibs_python
+ url = https://github.com/canewsin/nativelibs_python.git
+[submodule "android/arm_python"]
+ path = android/arm_python
+ url = https://github.com/canewsin/arm_python.git
+[submodule "android/arm64_python"]
+ path = android/arm64_python
+ url = https://github.com/canewsin/arm64_python.git
+[submodule "android/x86_64_python"]
+ path = android/x86_64_python
+ url = https://github.com/canewsin/x86_64_python.git
+[submodule "android/x86_python"]
+ path = android/x86_python
+ url = https://github.com/canewsin/x86_python.git
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..f288702
--- /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)
+
+ 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:
+
+ Copyright (C)
+ 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 be472a1..ae18d56 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
# ZeroNet Mobile
[![Codemagic build status](https://api.codemagic.io/apps/5f755f0647fecf7a4f25751a/5f75609747fecf958ea171b0/status_badge.svg)](https://codemagic.io/apps/5f755f0647fecf7a4f25751a/5f75609747fecf958ea171b0/latest_build)
-ZeroNet Mobile is an Android Client for [ZeroNet](https://zeronet.io), a platform for decentralized websites using Bitcoin crypto and the BitTorrent network. you can learn more about ZeroNet at https://zeronet.io/.
+ZeroNet Mobile is an Android Client for [ZeroNet](https://zeronet.dev), a platform for decentralized websites using Bitcoin crypto and the BitTorrent network. you can learn more about ZeroNet at https://zeronet.dev/.
[
versionProperties.load(reader)
@@ -39,7 +39,7 @@ apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
apply plugin: 'com.jeppeman.locallydynamic'
android {
- compileSdkVersion 29
+ compileSdkVersion 31
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
@@ -52,11 +52,16 @@ android {
defaultConfig {
applicationId "in.canews.zeronetmobile"
minSdkVersion 21
- targetSdkVersion 29
+ targetSdkVersion 31
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
+
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_11
+ targetCompatibility JavaVersion.VERSION_11
+ }
signingConfigs {
release {
@@ -71,19 +76,24 @@ android {
release {
signingConfig signingConfigs.release
+ minifyEnabled = false
+ shrinkResources = false
}
debug {
applicationIdSuffix '.debug'
signingConfig signingConfigs.release
locallyDynamic {
- enabled = true
+ enabled = false
throttleDownloadBy = 1000
}
defaultConfig.ndk.abiFilters 'armeabi-v7a','arm64-v8a','x86_64'
}
}
- dynamicFeatures = [":arm64", ":arm", ":common", ":x86", ":x86_64"]
+ dynamicFeatures = [":arm64", ":arm", ":common", ":x86", ":x86_64",
+ ":arm64_python", ":arm_python", ":common_python", ":x86_python", ":x86_64_python",
+ ":arm64_tor", ":arm_tor", ":x86_tor", ":x86_64_tor"
+ ]
}
@@ -93,11 +103,17 @@ flutter {
}
dependencies {
- def billing_version = "3.0.0"
- implementation "com.android.billingclient:billing:$billing_version"
+// def billing_version = '4.0.0'
+// implementation "com.android.billingclient:billing:$billing_version"
+
+ def work_version = "2.7.0"
+ // Force WorkManager 2.6.0 for transitive dependency
+ implementation("androidx.work:work-runtime-ktx:$work_version") {
+ force = true
+ }
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
- implementation 'com.google.android.gms:play-services-base:17.2.0'
+ implementation 'com.google.android.gms:play-services-base:17.6.0'
//Duplicate Classes Issue https://stackoverflow.com/a/60492942
implementation 'com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava'
@@ -105,7 +121,7 @@ dependencies {
debugImplementation 'com.jeppeman.locallydynamic:locallydynamic-debug:0.3'
releaseImplementation 'com.jeppeman.locallydynamic:locallydynamic:0.3'
- testImplementation 'junit:junit:4.12'
- androidTestImplementation 'androidx.test:runner:1.2.0'
- androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
+ // testImplementation 'junit:junit:4.12'
+ // androidTestImplementation 'androidx.test:runner:1.2.0'
+ // androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml
index b19f74b..4d8b0e2 100644
--- a/android/app/src/main/AndroidManifest.xml
+++ b/android/app/src/main/AndroidManifest.xml
@@ -12,8 +12,8 @@
+
-
+ android:windowSoftInputMode="adjustResize">
@@ -39,7 +39,9 @@
-
+
+ MethodChannel(flutterEngine.dartExecutor, CHANNEL).setMethodCallHandler { call, result ->
when (call.method) {
"addToHomeScreen" -> addShortcutToHomeScreen(context, result,
call.argument("title"),call.argument("url"),
@@ -237,7 +237,7 @@ class MainActivity : FlutterActivity() {
success(msg)
}.onFailure {
if (it is IllegalStateException) {
- Log.e("MainActivity>resultSuc>", it.message)
+ Log.e("MainActivity>resultSuc>", it.message!!)
}
}
}
@@ -305,6 +305,7 @@ class MainActivity : FlutterActivity() {
tempFile.createNewFile()
inputStream?.toFile(tempFilePath)
resultT?.success(File(tempFilePath).absoluteFile.absolutePath)
+ Log.e("copyFileToTempPath: ", filename + " copied to " + tempFilePath)
tempFile.deleteOnExit()
}
}
@@ -328,6 +329,9 @@ class MainActivity : FlutterActivity() {
.intent
shareIntent.data = contentUri
shareIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
+ shareIntent.putExtra(Intent.EXTRA_TEXT,"Save this file to a Safe place.")
+ shareIntent.action = Intent.ACTION_SEND
+ shareIntent.putExtra(Intent.EXTRA_STREAM, contentUri)
shareIntent.putExtra("finishActivityOnSaveCompleted", true)
context.startActivityForResult(Intent.createChooser(
shareIntent, "Backup Users.json File"), SAVE_USERJSON_FILE)
@@ -338,18 +342,22 @@ class MainActivity : FlutterActivity() {
getArchName()
try {
if (splitInstallManager?.installedModules!!.contains("common")) {
- val list = listOf("zeronet_py3.zip", "site_packages_common.zip")
- for (item in list) {
- getAssetFiles(item)
- }
+ getAssetFiles("zeronet_py3.zip")
+ }
+ if (archName != "arm64" && splitInstallManager?.installedModules!!.contains("common_python")) {
+ getAssetFiles("site_packages_common.zip")
}
if (splitInstallManager?.installedModules!!.contains(archName)) {
- val list = listOf("python38_$archName.zip", "site_packages_$archName.zip", "tor_$archName.zip")
- for (item in list) {
- getAssetFiles(item)
- }
+ getAssetFiles("site_packages_$archName.zip")
+ }
+ if (splitInstallManager?.installedModules!!.contains(archName + "_python")) {
+ getAssetFiles("python38_$archName.zip")
+ }
+ if (splitInstallManager?.installedModules!!.contains(archName + "_tor")) {
+ getAssetFiles("tor_$archName.zip")
}
} catch (e: IOException) {
+ Log.e("copyAssetsToCache", e.toString())
return false
}
return true
@@ -358,16 +366,16 @@ class MainActivity : FlutterActivity() {
private fun getAssetFiles(fileName: String) {
val assetManager = createPackageContext(packageName, 0).assets
val assistContent = assetManager.open(fileName)
+ Log.e("getAssetFiles: ", fileName)
copyFileToTempPath(inputStreamA = assistContent, filename = fileName, path = null)
}
private fun isModuleInstallSupported(): Boolean =
- Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP
- && isGooglePlayServicesAvailable(this)
+ Build.VERSION.SDK_INT <= 30 && isGooglePlayServicesAvailable(this)
private fun isGooglePlayServicesAvailable(activity: Activity?): Boolean {
val googleApiAvailability: GoogleApiAvailability = GoogleApiAvailability.getInstance()
- val status: Int = googleApiAvailability.isGooglePlayServicesAvailable(activity)
+ val status: Int = googleApiAvailability.isGooglePlayServicesAvailable(applicationContext)
if (status != ConnectionResult.SUCCESS) {
// if (googleApiAvailability.isUserResolvableError(status)) {
// googleApiAvailability.getErrorDialog(activity, status, 2404).show()
@@ -402,10 +410,15 @@ class MainActivity : FlutterActivity() {
private fun loadAndLaunchModule(name: String, eventSink: EventChannel.EventSink?) {
if (isModuleInstalled(name) == true)
return
- val request = SplitInstallRequest.newBuilder()
+ val builder = SplitInstallRequest.newBuilder()
.addModule("common")
.addModule(name)
- .build()
+ .addModule(name + "_python")
+ .addModule(name + "_tor")
+ if (name != "arm64") {
+ builder.addModule("common_python")
+ }
+ val request = builder.build();
splitInstallManager?.startInstall(request)?.addOnSuccessListener { sessionId ->
mSessionId = sessionId
}
@@ -442,7 +455,10 @@ class MainActivity : FlutterActivity() {
splitInstallManager?.installedModules?.contains(name)
private fun isRequiredModulesInstalled(): Boolean = isModuleInstalled("common") == true &&
- isModuleInstalled(archName) == true
+ ((archName == "arm64") || isModuleInstalled("common_python") == true)&&
+ isModuleInstalled(archName) == true &&
+ isModuleInstalled(archName + "_python") == true &&
+ isModuleInstalled(archName + "_tor") == true
private fun uninstallModules() {
val installedModules = splitInstallManager?.installedModules?.toList()
diff --git a/android/app/src/main/res/xml/file_provider_paths.xml b/android/app/src/main/res/xml/file_provider_paths.xml
index e3f1d7f..c0a358f 100644
--- a/android/app/src/main/res/xml/file_provider_paths.xml
+++ b/android/app/src/main/res/xml/file_provider_paths.xml
@@ -1,5 +1,5 @@
-
+
\ No newline at end of file
diff --git a/android/nativelibs/.gitignore b/android/arm/.gitignore
similarity index 100%
rename from android/nativelibs/.gitignore
rename to android/arm/.gitignore
diff --git a/android/arm/build.gradle b/android/arm/build.gradle
index 4673bfe..fcb50bb 100644
--- a/android/arm/build.gradle
+++ b/android/arm/build.gradle
@@ -1,20 +1,17 @@
apply plugin: 'com.android.dynamic-feature'
android {
- compileSdkVersion 29
+ compileSdkVersion 31
defaultConfig {
minSdkVersion 21
- targetSdkVersion 29
- versionCode 1
- versionName "1.0"
}
compileOptions {
- sourceCompatibility 1.8
- targetCompatibility 1.8
+ sourceCompatibility JavaVersion.VERSION_11
+ targetCompatibility JavaVersion.VERSION_11
}
}
diff --git a/android/arm/src/main/AndroidManifest.xml b/android/arm/src/main/AndroidManifest.xml
index 27b3358..66f0fde 100644
--- a/android/arm/src/main/AndroidManifest.xml
+++ b/android/arm/src/main/AndroidManifest.xml
@@ -2,6 +2,9 @@
xmlns:dist="http://schemas.android.com/apk/distribution"
package="in.canews.zeronetmobile.arm">
+
+
diff --git a/android/arm/src/main/assets/python38_arm.zip b/android/arm/src/main/assets/python38_arm.zip
deleted file mode 100644
index 8be7c8f..0000000
Binary files a/android/arm/src/main/assets/python38_arm.zip and /dev/null differ
diff --git a/android/arm64/build.gradle b/android/arm64/build.gradle
index 4673bfe..fcb50bb 100644
--- a/android/arm64/build.gradle
+++ b/android/arm64/build.gradle
@@ -1,20 +1,17 @@
apply plugin: 'com.android.dynamic-feature'
android {
- compileSdkVersion 29
+ compileSdkVersion 31
defaultConfig {
minSdkVersion 21
- targetSdkVersion 29
- versionCode 1
- versionName "1.0"
}
compileOptions {
- sourceCompatibility 1.8
- targetCompatibility 1.8
+ sourceCompatibility JavaVersion.VERSION_11
+ targetCompatibility JavaVersion.VERSION_11
}
}
diff --git a/android/arm64/src/main/AndroidManifest.xml b/android/arm64/src/main/AndroidManifest.xml
index 593f565..8867e5c 100644
--- a/android/arm64/src/main/AndroidManifest.xml
+++ b/android/arm64/src/main/AndroidManifest.xml
@@ -2,6 +2,9 @@
xmlns:dist="http://schemas.android.com/apk/distribution"
package="in.canews.zeronetmobile.arm64">
+
+
diff --git a/android/arm64/src/main/assets/python38_arm64.zip b/android/arm64/src/main/assets/python38_arm64.zip
deleted file mode 100644
index d0a6065..0000000
Binary files a/android/arm64/src/main/assets/python38_arm64.zip and /dev/null differ
diff --git a/android/arm64/src/main/assets/site_packages_arm64.zip b/android/arm64/src/main/assets/site_packages_arm64.zip
index 598a9d8..63cdc3b 100644
Binary files a/android/arm64/src/main/assets/site_packages_arm64.zip and b/android/arm64/src/main/assets/site_packages_arm64.zip differ
diff --git a/android/arm64_tor/.gitignore b/android/arm64_tor/.gitignore
new file mode 100644
index 0000000..796b96d
--- /dev/null
+++ b/android/arm64_tor/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/android/arm64_tor/build.gradle b/android/arm64_tor/build.gradle
new file mode 100644
index 0000000..fcb50bb
--- /dev/null
+++ b/android/arm64_tor/build.gradle
@@ -0,0 +1,22 @@
+apply plugin: 'com.android.dynamic-feature'
+
+android {
+ compileSdkVersion 31
+
+
+ defaultConfig {
+ minSdkVersion 21
+
+ }
+
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_11
+ targetCompatibility JavaVersion.VERSION_11
+ }
+
+}
+
+dependencies {
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
+ implementation project(':app')
+}
diff --git a/android/arm64_tor/src/main/AndroidManifest.xml b/android/arm64_tor/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..4176a82
--- /dev/null
+++ b/android/arm64_tor/src/main/AndroidManifest.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/android/arm64/src/main/assets/tor_arm64.zip b/android/arm64_tor/src/main/assets/tor_arm64.zip
similarity index 100%
rename from android/arm64/src/main/assets/tor_arm64.zip
rename to android/arm64_tor/src/main/assets/tor_arm64.zip
diff --git a/android/arm_tor/build.gradle b/android/arm_tor/build.gradle
new file mode 100644
index 0000000..fcb50bb
--- /dev/null
+++ b/android/arm_tor/build.gradle
@@ -0,0 +1,22 @@
+apply plugin: 'com.android.dynamic-feature'
+
+android {
+ compileSdkVersion 31
+
+
+ defaultConfig {
+ minSdkVersion 21
+
+ }
+
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_11
+ targetCompatibility JavaVersion.VERSION_11
+ }
+
+}
+
+dependencies {
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
+ implementation project(':app')
+}
diff --git a/android/arm_tor/src/main/AndroidManifest.xml b/android/arm_tor/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..6d5903f
--- /dev/null
+++ b/android/arm_tor/src/main/AndroidManifest.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/android/arm/src/main/assets/tor_arm.zip b/android/arm_tor/src/main/assets/tor_arm.zip
similarity index 100%
rename from android/arm/src/main/assets/tor_arm.zip
rename to android/arm_tor/src/main/assets/tor_arm.zip
diff --git a/android/build.gradle b/android/build.gradle
index e17521a..a750a49 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -1,16 +1,15 @@
buildscript {
- ext.kotlin_version = '1.3.61'
- ext.gradle_version = '3.6.1'
+ ext.kotlin_version = '1.5.21'
+ ext.gradle_version = '7.0.3'
repositories {
google()
- jcenter()
maven {
url "https://plugins.gradle.org/m2"
}
}
dependencies {
- classpath "com.android.tools.build:gradle:${gradle_version}"
+ classpath "com.android.tools.build:gradle:$gradle_version"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "com.jeppeman.locallydynamic.gradle:plugin:0.2"
}
@@ -19,7 +18,6 @@ buildscript {
allprojects {
repositories {
google()
- jcenter()
}
}
diff --git a/android/common/build.gradle b/android/common/build.gradle
index 4673bfe..fcb50bb 100644
--- a/android/common/build.gradle
+++ b/android/common/build.gradle
@@ -1,20 +1,17 @@
apply plugin: 'com.android.dynamic-feature'
android {
- compileSdkVersion 29
+ compileSdkVersion 31
defaultConfig {
minSdkVersion 21
- targetSdkVersion 29
- versionCode 1
- versionName "1.0"
}
compileOptions {
- sourceCompatibility 1.8
- targetCompatibility 1.8
+ sourceCompatibility JavaVersion.VERSION_11
+ targetCompatibility JavaVersion.VERSION_11
}
}
diff --git a/android/common/src/main/AndroidManifest.xml b/android/common/src/main/AndroidManifest.xml
index 30ec127..b446fc2 100644
--- a/android/common/src/main/AndroidManifest.xml
+++ b/android/common/src/main/AndroidManifest.xml
@@ -2,6 +2,9 @@
xmlns:dist="http://schemas.android.com/apk/distribution"
package="in.canews.zeronetmobile.common">
+
+
diff --git a/android/common/src/main/assets/site_packages_common.zip b/android/common/src/main/assets/site_packages_common.zip
deleted file mode 100644
index 335ea4f..0000000
Binary files a/android/common/src/main/assets/site_packages_common.zip and /dev/null differ
diff --git a/android/common/src/main/assets/zeronet_py3.zip b/android/common/src/main/assets/zeronet_py3.zip
index dd6a6e4..4b9100e 100644
Binary files a/android/common/src/main/assets/zeronet_py3.zip and b/android/common/src/main/assets/zeronet_py3.zip differ
diff --git a/android/gradle.properties b/android/gradle.properties
index f7818b4..7e0d4e4 100644
--- a/android/gradle.properties
+++ b/android/gradle.properties
@@ -3,6 +3,7 @@ org.gradle.jvmargs=-Xmx4096M
# we can remove below uncompressed property
# https://stackoverflow.com/a/55969995
android.bundle.enableUncompressedNativeLibs=false
+android.experimental.enableNewResourceShrinker=true
android.enableR8=true
android.useAndroidX=true
android.enableJetifier=true
diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties
index 5028f28..77a5e6f 100644
--- a/android/gradle/wrapper/gradle-wrapper.properties
+++ b/android/gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,7 @@
+#Thu Oct 21 07:26:34 IST 2021
distributionBase=GRADLE_USER_HOME
+distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-bin.zip
-zipStoreBase=GRADLE_USER_HOME
+distributionSha256Sum=0e46229820205440b48a5501122002842b82886e76af35f0f3a069243dca4b3c
zipStorePath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
diff --git a/android/gradlew b/android/gradlew
index 83f2acf..4f906e0 100644
--- a/android/gradlew
+++ b/android/gradlew
@@ -82,6 +82,7 @@ esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
@@ -129,6 +130,7 @@ fi
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
@@ -154,19 +156,19 @@ if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
else
eval `echo args$i`="\"$arg\""
fi
- i=$((i+1))
+ i=`expr $i + 1`
done
case $i in
- (0) set -- ;;
- (1) set -- "$args0" ;;
- (2) set -- "$args0" "$args1" ;;
- (3) set -- "$args0" "$args1" "$args2" ;;
- (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
- (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
- (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
- (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
- (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
- (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ 0) set -- ;;
+ 1) set -- "$args0" ;;
+ 2) set -- "$args0" "$args1" ;;
+ 3) set -- "$args0" "$args1" "$args2" ;;
+ 4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
@@ -175,14 +177,9 @@ save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
-APP_ARGS=$(save "$@")
+APP_ARGS=`save "$@"`
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
-# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
-if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
- cd "$(dirname "$0")"
-fi
-
exec "$JAVACMD" "$@"
diff --git a/android/gradlew.bat b/android/gradlew.bat
index 9618d8d..107acd3 100644
--- a/android/gradlew.bat
+++ b/android/gradlew.bat
@@ -29,6 +29,9 @@ if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
+@rem Resolve any "." and ".." in APP_HOME to make it shorter.
+for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
+
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@@ -37,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
-if "%ERRORLEVEL%" == "0" goto init
+if "%ERRORLEVEL%" == "0" goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
@@ -51,7 +54,7 @@ goto fail
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
-if exist "%JAVA_EXE%" goto init
+if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
@@ -61,28 +64,14 @@ echo location of your Java installation.
goto fail
-:init
-@rem Get command-line arguments, handling Windows variants
-
-if not "%OS%" == "Windows_NT" goto win9xME_args
-
-:win9xME_args
-@rem Slurp the command line arguments.
-set CMD_LINE_ARGS=
-set _SKIP=2
-
-:win9xME_args_slurp
-if "x%~1" == "x" goto execute
-
-set CMD_LINE_ARGS=%*
-
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
@rem Execute Gradle
-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
diff --git a/android/nativelibs/src/main/jniLibs/arm64-v8a/libopenssl.so b/android/nativelibs/src/main/jniLibs/arm64-v8a/libopenssl.so
deleted file mode 100644
index 69a749c..0000000
Binary files a/android/nativelibs/src/main/jniLibs/arm64-v8a/libopenssl.so and /dev/null differ
diff --git a/android/nativelibs/src/main/jniLibs/arm64-v8a/libpython3.8.so b/android/nativelibs/src/main/jniLibs/arm64-v8a/libpython3.8.so
deleted file mode 100644
index 1a83b1f..0000000
Binary files a/android/nativelibs/src/main/jniLibs/arm64-v8a/libpython3.8.so and /dev/null differ
diff --git a/android/nativelibs/src/main/jniLibs/armeabi-v7a/libopenssl.so b/android/nativelibs/src/main/jniLibs/armeabi-v7a/libopenssl.so
deleted file mode 100644
index beb75f2..0000000
Binary files a/android/nativelibs/src/main/jniLibs/armeabi-v7a/libopenssl.so and /dev/null differ
diff --git a/android/nativelibs/src/main/jniLibs/armeabi-v7a/libpython3.8.so b/android/nativelibs/src/main/jniLibs/armeabi-v7a/libpython3.8.so
deleted file mode 100644
index d2db263..0000000
Binary files a/android/nativelibs/src/main/jniLibs/armeabi-v7a/libpython3.8.so and /dev/null differ
diff --git a/android/nativelibs/src/main/jniLibs/x86_64/libopenssl.so b/android/nativelibs/src/main/jniLibs/x86_64/libopenssl.so
deleted file mode 100644
index 096f0e8..0000000
Binary files a/android/nativelibs/src/main/jniLibs/x86_64/libopenssl.so and /dev/null differ
diff --git a/android/nativelibs/src/main/jniLibs/x86_64/libpython3.8.so b/android/nativelibs/src/main/jniLibs/x86_64/libpython3.8.so
deleted file mode 100644
index 7370826..0000000
Binary files a/android/nativelibs/src/main/jniLibs/x86_64/libpython3.8.so and /dev/null differ
diff --git a/android/nativelibs_tor/.gitignore b/android/nativelibs_tor/.gitignore
new file mode 100644
index 0000000..796b96d
--- /dev/null
+++ b/android/nativelibs_tor/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/android/nativelibs/build.gradle b/android/nativelibs_tor/build.gradle
similarity index 60%
rename from android/nativelibs/build.gradle
rename to android/nativelibs_tor/build.gradle
index bbf8742..cc3f0f5 100644
--- a/android/nativelibs/build.gradle
+++ b/android/nativelibs_tor/build.gradle
@@ -5,19 +5,15 @@ android {
defaultConfig {
- minSdkVersion 16
- targetSdkVersion 29
- versionCode 1
- versionName "1.0"
+ minSdkVersion 21
}
compileOptions {
- sourceCompatibility 1.8
- targetCompatibility 1.8
+ sourceCompatibility JavaVersion.VERSION_11
+ targetCompatibility JavaVersion.VERSION_11
}
-
}
dependencies {
diff --git a/android/nativelibs/src/main/AndroidManifest.xml b/android/nativelibs_tor/src/main/AndroidManifest.xml
similarity index 90%
rename from android/nativelibs/src/main/AndroidManifest.xml
rename to android/nativelibs_tor/src/main/AndroidManifest.xml
index 7c21bee..5e0295a 100644
--- a/android/nativelibs/src/main/AndroidManifest.xml
+++ b/android/nativelibs_tor/src/main/AndroidManifest.xml
@@ -1,6 +1,6 @@
+ package="in.canews.nativelibs_tor">
+
+
diff --git a/android/x86/src/main/assets/python38_x86.zip b/android/x86/src/main/assets/python38_x86.zip
deleted file mode 100644
index 38f3b2e..0000000
Binary files a/android/x86/src/main/assets/python38_x86.zip and /dev/null differ
diff --git a/android/x86_64/build.gradle b/android/x86_64/build.gradle
index 4673bfe..fcb50bb 100644
--- a/android/x86_64/build.gradle
+++ b/android/x86_64/build.gradle
@@ -1,20 +1,17 @@
apply plugin: 'com.android.dynamic-feature'
android {
- compileSdkVersion 29
+ compileSdkVersion 31
defaultConfig {
minSdkVersion 21
- targetSdkVersion 29
- versionCode 1
- versionName "1.0"
}
compileOptions {
- sourceCompatibility 1.8
- targetCompatibility 1.8
+ sourceCompatibility JavaVersion.VERSION_11
+ targetCompatibility JavaVersion.VERSION_11
}
}
diff --git a/android/x86_64/src/main/AndroidManifest.xml b/android/x86_64/src/main/AndroidManifest.xml
index 34d918d..3f86609 100644
--- a/android/x86_64/src/main/AndroidManifest.xml
+++ b/android/x86_64/src/main/AndroidManifest.xml
@@ -2,6 +2,9 @@
xmlns:dist="http://schemas.android.com/apk/distribution"
package="in.canews.zeronetmobile.x86_64">
+
+
diff --git a/android/x86_64/src/main/assets/python38_x86_64.zip b/android/x86_64/src/main/assets/python38_x86_64.zip
deleted file mode 100644
index 3a2f5d6..0000000
Binary files a/android/x86_64/src/main/assets/python38_x86_64.zip and /dev/null differ
diff --git a/android/x86_64_tor/.gitignore b/android/x86_64_tor/.gitignore
new file mode 100644
index 0000000..796b96d
--- /dev/null
+++ b/android/x86_64_tor/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/android/x86_64_tor/build.gradle b/android/x86_64_tor/build.gradle
new file mode 100644
index 0000000..fcb50bb
--- /dev/null
+++ b/android/x86_64_tor/build.gradle
@@ -0,0 +1,22 @@
+apply plugin: 'com.android.dynamic-feature'
+
+android {
+ compileSdkVersion 31
+
+
+ defaultConfig {
+ minSdkVersion 21
+
+ }
+
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_11
+ targetCompatibility JavaVersion.VERSION_11
+ }
+
+}
+
+dependencies {
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
+ implementation project(':app')
+}
diff --git a/android/x86_64_tor/src/main/AndroidManifest.xml b/android/x86_64_tor/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..90de0d0
--- /dev/null
+++ b/android/x86_64_tor/src/main/AndroidManifest.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/android/x86_64/src/main/assets/tor_x86_64.zip b/android/x86_64_tor/src/main/assets/tor_x86_64.zip
similarity index 100%
rename from android/x86_64/src/main/assets/tor_x86_64.zip
rename to android/x86_64_tor/src/main/assets/tor_x86_64.zip
diff --git a/android/x86_tor/.gitignore b/android/x86_tor/.gitignore
new file mode 100644
index 0000000..796b96d
--- /dev/null
+++ b/android/x86_tor/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/android/x86_tor/build.gradle b/android/x86_tor/build.gradle
new file mode 100644
index 0000000..fcb50bb
--- /dev/null
+++ b/android/x86_tor/build.gradle
@@ -0,0 +1,22 @@
+apply plugin: 'com.android.dynamic-feature'
+
+android {
+ compileSdkVersion 31
+
+
+ defaultConfig {
+ minSdkVersion 21
+
+ }
+
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_11
+ targetCompatibility JavaVersion.VERSION_11
+ }
+
+}
+
+dependencies {
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
+ implementation project(':app')
+}
diff --git a/android/x86_tor/src/main/AndroidManifest.xml b/android/x86_tor/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..80b90a1
--- /dev/null
+++ b/android/x86_tor/src/main/AndroidManifest.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/android/x86/src/main/assets/tor_x86.zip b/android/x86_tor/src/main/assets/tor_x86.zip
similarity index 100%
rename from android/x86/src/main/assets/tor_x86.zip
rename to android/x86_tor/src/main/assets/tor_x86.zip
diff --git a/assets/filters/filters-tmp.json b/assets/filters/filters-tmp.json
new file mode 100644
index 0000000..40249ff
--- /dev/null
+++ b/assets/filters/filters-tmp.json
@@ -0,0 +1,30 @@
+{
+ "includes": {
+ "tmp/filters/sites-porn.json": {
+ "address": "tmp",
+ "date_added": 1604971003.9685245,
+ "description": "Porn Sites",
+ "inner_path": "filters/sites-porn.json"
+ },
+ "tmp/filters/sites-miners.json": {
+ "address": "tmp",
+ "date_added": 1604972074.2051556,
+ "description": "Crypto Miner Sites",
+ "inner_path": "filters/sites-miners.json"
+ },
+ "tmp/filters/users-porn.json": {
+ "address": "tmp",
+ "date_added": 1604970823.2421556,
+ "description": "Users Who Post Porn on Social Media",
+ "inner_path": "filters/users-porn.json"
+ },
+ "tmp/filters/users-spamlist.json": {
+ "address": "tmp",
+ "date_added": 1604971226.4319663,
+ "description": "Users Who Post Spam",
+ "inner_path": "filters/users-spamlist.json"
+ }
+ },
+ "mutes": {},
+ "siteblocks": {}
+}
\ No newline at end of file
diff --git a/assets/filters.json b/assets/filters/filters.json
similarity index 100%
rename from assets/filters.json
rename to assets/filters/filters.json
diff --git a/assets/filters/sites-miners.json b/assets/filters/sites-miners.json
new file mode 100644
index 0000000..d836544
--- /dev/null
+++ b/assets/filters/sites-miners.json
@@ -0,0 +1,59 @@
+{
+ "siteblocks": {
+ "13eFkhbXXQcJqd729zRLL9tMxxhz9d4UA6": {
+ "date_added": 1530012785,
+ "name": "EulerFinder",
+ "reason": "Includes calls to online coinhive script(with option to disable but sets to 50% on refresh)"
+ },
+ "1PXUne5szFdu4di5EV4gy9Qo7p8tP5p1VX": {
+ "date_added": 1530012785,
+ "name": "The Pedophile/Rapist Hitlist",
+ "reason": "Includes an offline script(/js/coinhive.min.js)"
+ },
+ "1JArw6Qb7cG6NuZBqvBSprURr2aaZdCFq9": {
+ "date_added": 1541928660,
+ "name": "C&P Zite Index",
+ "reason": "Includes an online coinhive script and anti adblock(BlockAdBlock)"
+ },
+ "1CS9y8BCXC7iXTqDMaYnwN9br8WaRbUeJV": {
+ "date_added": 1541928660,
+ "name": "C&P Video Share",
+ "reason": "Includes an online coinhive script and anti adblock(BlockAdBlock)"
+ },
+ "13WfLQv2nWXYBNUEL3PkWwGUe3H7qkTF5Y": {
+ "date_added": 1541928660,
+ "name": "C&P Forum",
+ "reason": "Includes an online coinhive script and anti adblock(BlockAdBlock)"
+ },
+ "14YK7V93HNLJb94PFrKj4aQMxPVkrbZ3oL": {
+ "date_added": 1541928660,
+ "name": "C&P File Share",
+ "reason": "Includes an online coinhive script and anti adblock(BlockAdBlock)"
+ },
+ "1RuLFAr8pJMdwMWaLfp5X5ousDZHXv8K4": {
+ "date_added": 1541928660,
+ "name": "The Chlorates and Perchlorates",
+ "reason": "Includes an online coinhive script and anti adblock(BlockAdBlock)"
+ },
+ "16AzWR6xfhVvrmvQCm4mt7rN17CWZTCJYS": {
+ "date_added": 1541928660,
+ "name": "Receptek Sufnipirotechnikusoknak",
+ "reason": "Includes an online coinhive script"
+ },
+ "1CpAXQVfedrNVKSLJMKEtrWNvU8KMXJzAt": {
+ "date_added": 1541928660,
+ "name": "PyroMaster minden ami érdekes",
+ "reason": "Includes anti adblock(BlockAdBlock) suspiciously no coinhive (note to self: check and remove latter)"
+ },
+ "16WRGSqD26sfYiVBsBQg6y1Sd3YJP6Q3SF": {
+ "date_added": 1542661064,
+ "name": "PyroData & PyroGuide",
+ "reason": "Includes an online coinhive script and anti adblock(BlockAdBlock)"
+ },
+ "1KjLxJ6TfeRvrPX1LkUtkFLfTp4en7j9uf": {
+ "date_added": 1541928660,
+ "name": "???",
+ "reason": "[sourced by tips of others](todo actually check it when it loads)Includes an online coinhive script"
+ }
+ }
+}
\ No newline at end of file
diff --git a/assets/filters/sites-porn.json b/assets/filters/sites-porn.json
new file mode 100644
index 0000000..1a94819
--- /dev/null
+++ b/assets/filters/sites-porn.json
@@ -0,0 +1,469 @@
+{
+ "siteblocks": {
+ "1BnagcoeRPswmR7vnFVNVEsXWRMmBXbGpn": {
+ "date_added": 1,
+ "name": "ZeroPorn Video",
+ "reason": "Pornography site"
+ },
+ "16pHK2sJQqmwXJTpwjf9af5E9RhNugQeh": {
+ "date_added": 1,
+ "name": "16pHK2sJQqmwXJTpwjf9af5E9RhNugQeh - Girl Collector",
+ "reason": "Pornography site"
+ },
+ "1PMGhAtfYFT65F4eECes68PK2fBcfYdQKV": {
+ "date_added": 1,
+ "name": "1PMGhAtfYFT65F4eECes68PK2fBcfYdQKV - NudeGirls Blog",
+ "reason": "Pornography site"
+ },
+ "1NZNtZQZHQRJXafvJpmY5jgqwRaCEZMsUc": {
+ "date_added": 1,
+ "name": "1NZNtZQZHQRJXafvJpmY5jgqwRaCEZMsUc - 0chan porn",
+ "reason": "Pornography site"
+ },
+ "122Ad6qhGRhFNcGgqSqkg9karrQf4fAPZe": {
+ "date_added": 1,
+ "name": "122Ad6qhGRhFNcGgqSqkg9karrQf4fAPZe - Deep Fakes",
+ "reason": "Pornography site"
+ },
+ "1HSgZAguU8P8LkJuinrSiAkXfpfnjfVPWa": {
+ "date_added": 1,
+ "name": "1HSgZAguU8P8LkJuinrSiAkXfpfnjfVPWa - Free to share porn movies",
+ "reason": "Pornography site"
+ },
+ "1MWkQT4a9AJBzcgmPVu9QczWVNaTgd72fR": {
+ "date_added": 1,
+ "name": "1MWkQT4a9AJBzcgmPVu9QczWVNaTgd72fR - Veronika Black",
+ "reason": "Pornography site"
+ },
+ "1HQDmuaknnfJNgVv13RVkCczUctq3KHHDk": {
+ "date_added": 1,
+ "name": "1HQDmuaknnfJNgVv13RVkCczUctq3KHHDk - Zerotica",
+ "reason": "Pornography site"
+ },
+ "1Nekos4fiBqfcazyG1bAxdBT5oBvA76Zmo": {
+ "date_added": 1,
+ "name": "1Nekos4fiBqfcazyG1bAxdBT5oBvA76Zmo - nekololi's GalleryHub",
+ "reason": "Pornography site"
+ },
+ "19EUPn2NVQZwzX2Z9TiqgD31iZdZNHYHpy": {
+ "date_added": 1,
+ "name": "19EUPn2NVQZwzX2Z9TiqgD31iZdZNHYHpy",
+ "reason": "Pornography site"
+ },
+ "15AKs78Z3mCSpg7PraJMbyQuHqgVGi1ZnU": {
+ "date_added": 1,
+ "name": "15AKs78Z3mCSpg7PraJMbyQuHqgVGi1ZnU - ZeroTorrenet Porn - adult torrent index",
+ "reason": "Pornography site"
+ },
+ "1JX5F4fdFEu34yGurmsr8jusTzeeeYeaeb": {
+ "date_added": 1,
+ "name": "1JX5F4fdFEu34yGurmsr8jusTzeeeYeaeb - TzeYea - MANGAO",
+ "reason": "Pornography site"
+ },
+ "136KU42w72E6Gd31oqfUxEhvAvRMvXMBsL": {
+ "date_added": 1,
+ "name": "136KU42w72E6Gd31oqfUxEhvAvRMvXMBsL - Porno and erotica video",
+ "reason": "Pornography site"
+ },
+ "14TPbCCnG4tzPYmJLJgXUbdxyPrR7ef8pU": {
+ "date_added": 1,
+ "name": "14TPbCCnG4tzPYmJLJgXUbdxyPrR7ef8pU - Chicas 123",
+ "reason": "Pornography site"
+ },
+ "149EPBN4hQRpwj5TcoPETepnoXHCUXzaCN": {
+ "date_added": 1,
+ "name": "149EPBN4hQRpwj5TcoPETepnoXHCUXzaCN - Youtube",
+ "reason": "Pornography site"
+ },
+ "1AZqKMVzsH1Q3soYdoRMJPzcV8Lah4Xyhu": {
+ "date_added": 1,
+ "name": "1AZqKMVzsH1Q3soYdoRMJPzcV8Lah4Xyhu - Pedo4Crypto",
+ "reason": "Pornography site"
+ },
+ "1P5AXm2CuAf2fx4FxD4iMu8sq8QB7fH8x2": {
+ "date_added": 1,
+ "name": "1P5AXm2CuAf2fx4FxD4iMu8sq8QB7fH8x2 - PedoChan",
+ "reason": "Pornography site"
+ },
+ "1NznrHyptJjHVkVMoxXRRTNVzeQFEgnsvV": {
+ "date_added": 1,
+ "name": "1NznrHyptJjHVkVMoxXRRTNVzeQFEgnsvV - NSFW PiCS",
+ "reason": "Pornography site"
+ },
+ "1CujoE8hTcp7PGFwiP35yAtPvDHkXHJzhJ": {
+ "date_added": 1,
+ "name": "1CujoE8hTcp7PGFwiP35yAtPvDHkXHJzhJ - Deep Throat",
+ "reason": "Pornography site"
+ },
+ "1Jm7uc3bmqPEBm6xdNoF8xi3y2uBBCn6pJ": {
+ "date_added": 1,
+ "name": "1Jm7uc3bmqPEBm6xdNoF8xi3y2uBBCn6pJ - Childchan",
+ "reason": "Pornography site"
+ },
+ "14rAzNFvLx2pCsSrXfxEm6TV28xgyf7M1e": {
+ "date_added": 1,
+ "name": "14rAzNFvLx2pCsSrXfxEm6TV28xgyf7M1e - 美人志-ROSI写真",
+ "reason": "Pornography site"
+ },
+ "1AFUBsm13NrN7228bBe1UcqvcrCmYgUFLa": {
+ "date_added": 1,
+ "name": "1AFUBsm13NrN7228bBe1UcqvcrCmYgUFLa - Porn2Peer",
+ "reason": "Pornography site"
+ },
+ "1Dy2bs4GygFrBPxvZAvysuYQG7P8g3qSYj": {
+ "date_added": 1,
+ "name": "1Dy2bs4GygFrBPxvZAvysuYQG7P8g3qSYj - Loligod's Gallery",
+ "reason": "Pornography site"
+ },
+ "1FygwtRQHaiZ4R6da1QMMS1W8rk23tZaUh": {
+ "date_added": 1,
+ "name": "1FygwtRQHaiZ4R6da1QMMS1W8rk23tZaUh - Jav",
+ "reason": "Pornography site"
+ },
+ "1U4MDxAVH1oSKb9PtRY9mGzvcKfEzRUsN": {
+ "date_added": 1,
+ "name": "1U4MDxAVH1oSKb9PtRY9mGzvcKfEzRUsN - comic.z1069.bit",
+ "reason": "Pornography site"
+ },
+ "1fu1iNKkkCZRwD37N6oB6mv1oHWiPVUCf": {
+ "date_added": 1,
+ "name": "1fu1iNKkkCZRwD37N6oB6mv1oHWiPVUCf - 女装子福利",
+ "reason": "Pornography site"
+ },
+ "1HrBGPB8Nippn5xNxua8ZuxE7hG7dWEnHW": {
+ "date_added": 1,
+ "name": "1HrBGPB8Nippn5xNxua8ZuxE7hG7dWEnHW - Schizzi",
+ "reason": "Pornography site"
+ },
+ "15xL5zA9TeDxdqwnikSA1SfhFEzMfBxD5D": {
+ "date_added": 1,
+ "name": "15xL5zA9TeDxdqwnikSA1SfhFEzMfBxD5D - Paradiso Hentai",
+ "reason": "Pornography site"
+ },
+ "191C1ggdcP31gFfTtwxH1CBSycXF7tR8uC": {
+ "date_added": 1,
+ "name": "191C1ggdcP31gFfTtwxH1CBSycXF7tR8uC - Fap GIFs",
+ "reason": "Pornography site"
+ },
+ "18sfb3Mx9hqmVZuY3bQiE91Uc13TFrxWgM": {
+ "date_added": 1,
+ "name": "18sfb3Mx9hqmVZuY3bQiE91Uc13TFrxWgM",
+ "reason": "Pornography site"
+ },
+ "16faLxtAU4uCBfnRmMUi4kf7NFMfduphd6": {
+ "date_added": 1,
+ "name": "16faLxtAU4uCBfnRmMUi4kf7NFMfduphd6 - 推女郎, 徐溧",
+ "reason": "Soft Pornography site"
+ },
+ "1J9CAuKdCxFAAgqmc1s72kpF8T1mW1SaG3": {
+ "date_added": 1,
+ "name": "1J9CAuKdCxFAAgqmc1s72kpF8T1mW1SaG3 - Let's Talk About Hentai",
+ "reason": "Pornography site"
+ },
+ "1PFyHkHJZCy9ohwZx9F3zsaNNvLZu1tU9f": {
+ "date_added": 1,
+ "name": "1PFyHkHJZCy9ohwZx9F3zsaNNvLZu1tU9f - 撸大师",
+ "reason": "Pornography site"
+ },
+ "15xit2EiY7mpnQAj482BB4TjFynAJYLuj5": {
+ "date_added": 1,
+ "name": "15xit2EiY7mpnQAj482BB4TjFynAJYLuj5 - 老司机福利社",
+ "reason": "Partial pornography site"
+ },
+ "1Aqc13SzDbdPd25zMJWb2oLPTMouFnbynw": {
+ "date_added": 1,
+ "name": "1Aqc13SzDbdPd25zMJWb2oLPTMouFnbynw - Gay Men Porn",
+ "reason": "Pornography site"
+ },
+ "1AEqp2aLHuyWRHpByNbSjKpTjmKQXA8iug": {
+ "date_added": 1,
+ "name": "1AEqp2aLHuyWRHpByNbSjKpTjmKQXA8iug - 绅士本子网",
+ "reason": "Pornography site"
+ },
+ "15NcUM27VhwysT8K3YeXBmLUwMezpGuJRN": {
+ "date_added": 1,
+ "name": "15NcUM27VhwysT8K3YeXBmLUwMezpGuJRN - 重口味本子网",
+ "reason": "Pornography site"
+ },
+ "15T15H8M6DRe7GoQManCsSW2wz57xheC56": {
+ "date_added": 1,
+ "name": "15T15H8M6DRe7GoQManCsSW2wz57xheC56 - Aengus",
+ "reason": "Pornography site"
+ },
+ "1NCDNC2jfw5xwxnV5B4VEpjS5n6qFsAG2Y": {
+ "date_added": 1,
+ "name": "1NCDNC2jfw5xwxnV5B4VEpjS5n6qFsAG2Y - NewBBBJBlog",
+ "reason": "Soft Pornography site"
+ },
+ "12wD9eHFshoJ5dVjjcKCTELd5zsfqAB6ms": {
+ "date_added": 1,
+ "name": "12wD9eHFshoJ5dVjjcKCTELd5zsfqAB6ms - LolirapeGallery",
+ "reason": "Pornography site"
+ },
+ "1CmDyfVXZvUGFfY6cUQagCpkqzazSsBdaP": {
+ "date_added": 1,
+ "name": "1CmDyfVXZvUGFfY6cUQagCpkqzazSsBdaP - LoliTube",
+ "reason": "Pornography site"
+ },
+ "1BuPsjT1AC5vjoAd4PmJMt4TaZvh3cgKNX": {
+ "date_added": 1,
+ "name": "1BuPsjT1AC5vjoAd4PmJMt4TaZvh3cgKNX - OniiChan",
+ "reason": "Pornography site"
+ },
+ "1PomfMoeTPxQ5gLJBeD1sBvaizxbHxf8Zv": {
+ "date_added": 1,
+ "name": "1PomfMoeTPxQ5gLJBeD1sBvaizxbHxf8Zv - PomfPomfMoeGallery",
+ "reason": "Pornography site"
+ },
+ "14gbc57vHpEnJvzetSecquyA9iL5m7JBxS": {
+ "date_added": 1,
+ "name": "14gbc57vHpEnJvzetSecquyA9iL5m7JBxS - Furry and yiff",
+ "reason": "Pornography site"
+ },
+ "19565hrPUAFkLgkgT2L1YUkbu1nmXvV8kH": {
+ "date_added": 1,
+ "name": "19565hrPUAFkLgkgT2L1YUkbu1nmXvV8kH - 工口转运站",
+ "reason": "Pornography site"
+ },
+ "1HDQEhYq2rKKdWhhad8YPnzPA9xayVTy9k": {
+ "date_added": 1,
+ "name": "1HDQEhYq2rKKdWhhad8YPnzPA9xayVTy9k - M3102",
+ "reason": "Pornography site"
+ },
+ "1QKcTLrnSodMZqHqWCBbx1izqtXRyeUDfq": {
+ "date_added": 1,
+ "name": "1QKcTLrnSodMZqHqWCBbx1izqtXRyeUDfq - モデルコレクション",
+ "reason": "Pornography site"
+ },
+ "1BCrj9RFTA6i5SzhKA8zVX8q8KRZqW3e29": {
+ "date_added": 1,
+ "name": "1BCrj9RFTA6i5SzhKA8zVX8q8KRZqW3e29 - 美眉开房玩水嫩粉木耳",
+ "reason": "Pornography site"
+ },
+ "1FemJowGjrKZgjfhFK9Eey9sUvD9STZsUu": {
+ "date_added": 1,
+ "name": "1FemJowGjrKZgjfhFK9Eey9sUvD9STZsUu - Femjoy",
+ "reason": "Pornography site"
+ },
+ "1UnionG7b1nsPAag4tRupCCdFxtE8sGKg": {
+ "date_added": 1,
+ "name": "1UnionG7b1nsPAag4tRupCCdFxtE8sGKg - 凡号",
+ "reason": "Pornography site"
+ },
+ "1TBAxe5M3Mf3RkPxSHuZGe1RqgqawbjkD": {
+ "date_added": 1,
+ "name": "1TBAxe5M3Mf3RkPxSHuZGe1RqgqawbjkD - TheBlackAlley",
+ "reason": "Pornography site"
+ },
+ "1iTCsdGj8skMpxRAZiAqzQWTsktZcGezT": {
+ "date_added": 1,
+ "name": "1iTCsdGj8skMpxRAZiAqzQWTsktZcGezT - InTheCrack",
+ "reason": "Pornography site"
+ },
+ "1MetARa9M59dbBcT93rhSwBxfYHzjzphB": {
+ "date_added": 1,
+ "name": "1MetARa9M59dbBcT93rhSwBxfYHzjzphB - MetArt",
+ "reason": "Pornography site"
+ },
+ "1PBPx1Qwgz6xAjvGcgru1xNmhk8zyJNgun": {
+ "date_added": 1,
+ "name": "1PBPx1Qwgz6xAjvGcgru1xNmhk8zyJNgun - PlayboyPlus",
+ "reason": "Pornography site"
+ },
+ "1RArt3kyMV3vSXA2MSxhQ8apEJx6mgifv": {
+ "date_added": 1,
+ "name": "1RArt3kyMV3vSXA2MSxhQ8apEJx6mgifv - RylskyArt",
+ "reason": "Pornography site"
+ },
+ "1TwisRPG4nVA1kmxcKRogPDKwE9ZTzWQg": {
+ "date_added": 1,
+ "name": "1TwisRPG4nVA1kmxcKRogPDKwE9ZTzWQg - Twistys",
+ "reason": "Pornography site"
+ },
+ "1BLxYeHot8MioHmNyeoQUA8PLo2DJKD8KS": {
+ "date_added": 1,
+ "name": "1BLxYeHot8MioHmNyeoQUA8PLo2DJKD8KS - Beautyleg",
+ "reason": "Pornography site"
+ },
+ "1DiSiLGX3wXUtFPnVd7uKnAuKTzo2thZAR": {
+ "date_added": 1,
+ "name": "1DiSiLGX3wXUtFPnVd7uKnAuKTzo2thZAR - DISI",
+ "reason": "Pornography site"
+ },
+ "1MYGxJXvxzDstaYESVUBEV6rcPB13m5FLR": {
+ "date_added": 1,
+ "name": "1MYGxJXvxzDstaYESVUBEV6rcPB13m5FLR - MyGirl",
+ "reason": "Pornography site"
+ },
+ "1RoSiCnN8d5YdKSD5nytLUDoBstXzevyC": {
+ "date_added": 1,
+ "name": "1RoSiCnN8d5YdKSD5nytLUDoBstXzevyC - ROSI",
+ "reason": "Pornography site"
+ },
+ "1TGxHc9wQaKJT7qa5w5WoGBkHxUjYGi5Q": {
+ "date_added": 1,
+ "name": "1TGxHc9wQaKJT7qa5w5WoGBkHxUjYGi5Q - TuiGirl",
+ "reason": "Pornography site"
+ },
+ "1XRxFHFfa2UiXe46rVSGjfemtZycUny9g": {
+ "date_added": 1,
+ "name": "1XRxFHFfa2UiXe46rVSGjfemtZycUny9g - XiuRen",
+ "reason": "Pornography site"
+ },
+ "1Carib5nfwA4b72i72UbiWtL8nx5krDEVM": {
+ "date_added": 1,
+ "name": "1Carib5nfwA4b72i72UbiWtL8nx5krDEVM - caribbeancom",
+ "reason": "Pornography site"
+ },
+ "1Heyzoyh7Lyb3js58GAS5v29rUPMeUZtyd": {
+ "date_added": 1,
+ "name": "1Heyzoyh7Lyb3js58GAS5v29rUPMeUZtyd - HEYZO",
+ "reason": "Pornography site"
+ },
+ "1PondoKxjzoVpGx4chqg3Nk5XDMSw3WqXj": {
+ "date_added": 1,
+ "name": "1PondoKxjzoVpGx4chqg3Nk5XDMSw3WqXj - 1Pondo",
+ "reason": "Pornography site"
+ },
+ "1BraZZoJcacPjcWRaY3aazWeNqgioX6ohM": {
+ "date_added": 1,
+ "name": "1BraZZoJcacPjcWRaY3aazWeNqgioX6ohM - Brazzers",
+ "reason": "Pornography site"
+ },
+ "1DPLAYx81sx5Qb6XXxHheKqAQ48gRD7vQP": {
+ "date_added": 1,
+ "name": "1DPLAYx81sx5Qb6XXxHheKqAQ48gRD7vQP - Digital Playground",
+ "reason": "Pornography site"
+ },
+ "1XARTsDohzz98n225FcKHA3J6WKuf8XxC": {
+ "date_added": 1,
+ "name": "1XARTsDohzz98n225FcKHA3J6WKuf8XxC - X-Art",
+ "reason": "Pornography site"
+ },
+ "1MxhTsxNSTu2nzevPHi7QRT8kP4B5BB5LW": {
+ "date_added": 1,
+ "name": "1MxhTsxNSTu2nzevPHi7QRT8kP4B5BB5LW - nekonekonyan",
+ "reason": "Pornography site"
+ },
+ "15p2dU4KtFrS8qjmupAi1HCGhmG5JEyLUP": {
+ "date_added": 1,
+ "name": "15p2dU4KtFrS8qjmupAi1HCGhmG5JEyLUP - 田中瞳Hitomi的神秘代码",
+ "reason": "Pornography site"
+ },
+ "1HTHV2tVMSn7wByUvmFQqaSMoPMy87Tdw4": {
+ "date_added": 1,
+ "name": "1HTHV2tVMSn7wByUvmFQqaSMoPMy87Tdw4 - picrandom.bit",
+ "reason": "Partial pornography site"
+ },
+ "16cYTZiW45hZ1tQCVVth5ZVqNe2ZZAWUFk": {
+ "date_added": 1,
+ "name": "16cYTZiW45hZ1tQCVVth5ZVqNe2ZZAWUFk - 3D porno Gallery Hub",
+ "reason": "Pornography site"
+ },
+ "1G8VWDQc5fXLkRiijJB4EZerDLmDVY75MZ": {
+ "date_added": 1,
+ "name": "1G8VWDQc5fXLkRiijJB4EZerDLmDVY75MZ - Alotofplot",
+ "reason": "Pornography site"
+ },
+ "1CudYVs5YrBY4JipPGxW6DTKMAL1N4N1MY": {
+ "date_added": 1,
+ "name": "1CudYVs5YrBY4JipPGxW6DTKMAL1N4N1MY - Rubbish",
+ "reason": "Pornography site"
+ },
+ "1Sweetyby4djYXnkVZGzTzyZ5gCWQ7ooN": {
+ "date_added": 1,
+ "name": "1Sweetyby4djYXnkVZGzTzyZ5gCWQ7ooN - /sweet/ Little Girls (Millchan hub)",
+ "reason": "Possible soft pornography site"
+ },
+ "1CheeseGbTxP5Hij7EDjipWZ7UDJZTaPey": {
+ "date_added": 1,
+ "name": "1CheeseGbTxP5Hij7EDjipWZ7UDJZTaPey - /CP/ Child Porn (Millchan hub)",
+ "reason": "Pornography site"
+ },
+ "1C6pzLZyt28GdcFZMcGcZKQWuRV79WPNaL": {
+ "date_added": 1,
+ "name": "1C6pzLZyt28GdcFZMcGcZKQWuRV79WPNaL - RedBox",
+ "reason": "Pornography site"
+ },
+ "16DoxCJ4mWtvttaPr3FamsShTsNVfuE6Cv": {
+ "date_added": 1,
+ "name": "16DoxCJ4mWtvttaPr3FamsShTsNVfuE6Cv - /SiS001/ sis001 (Millchan hub)",
+ "reason": "Pornography site"
+ },
+ "18ARQPUQwSKv8vDwG1G2qwVggHw69bupzu": {
+ "date_added": 1,
+ "name": "18ARQPUQwSKv8vDwG1G2qwVggHw69bupzu - Natural lust",
+ "reason": "Pornography site"
+ },
+ "1AeGXvMgsAV2t3fhv2AoXYJfwC5inAYfQW": {
+ "date_added": 1,
+ "name": "1AeGXvMgsAV2t3fhv2AoXYJfwC5inAYfQW - Cosplay Girls Blog R",
+ "reason": "Pornography site"
+ },
+ "19Mrim4ZCDDpVJaAhMdYckz5nW4j45FBjK": {
+ "date_added": 1,
+ "name": "19Mrim4ZCDDpVJaAhMdYckz5nW4j45FBjK - Big Bodacious Boobs!",
+ "reason": "Pornography site"
+ },
+ "1Gay3DR1K69PoqMukjShz9sPiWqUSLtVxt": {
+ "date_added": 1,
+ "name": "1Gay3DR1K69PoqMukjShz9sPiWqUSLtVxt - 3D gay porno hub",
+ "reason": "Pornography site"
+ },
+ "1NNGrbXrWjPVnV6pxkuKGngRP116VaAFtm": {
+ "date_added": 1,
+ "name": "1NNGrbXrWjPVnV6pxkuKGngRP116VaAFtm - Art of Sole",
+ "reason": "Pornography site"
+ },
+ "1E3atqf7Bh45rxE5Dhx2sxhAjKvdKHAPvs": {
+ "date_added": 1,
+ "name": "1E3atqf7Bh45rxE5Dhx2sxhAjKvdKHAPvs - DeepPussy blog",
+ "reason": "Pornography site"
+ },
+ "1NnG1qQ9jPjXWSxydhJW58EY3qiWEf5rac": {
+ "date_added": 1,
+ "name": "1NnG1qQ9jPjXWSxydhJW58EY3qiWEf5rac - xuan",
+ "reason": "Pornography site"
+ },
+ "12hdp8sYuigQ91e3Gh3KxUJLib5gichAcn": {
+ "date_added": 1,
+ "name": "12hdp8sYuigQ91e3Gh3KxUJLib5gichAcn - The Candy Shop",
+ "reason": "Pornography site"
+ },
+ "1ADULTVvRotzfvsGeTNq9F2uJD5sKnuNGk": {
+ "date_added": 1,
+ "name": "1ADULTVvRotzfvsGeTNq9F2uJD5sKnuNGk - ZNP",
+ "reason": "Pornography site"
+ },
+ "1Nfx6ZRnBGHHDdTkLSAUwcRrYviteqPMUT": {
+ "date_added": 1,
+ "name": "1Nfx6ZRnBGHHDdTkLSAUwcRrYviteqPMUT - Porno-Kings Domain",
+ "reason": "Pornography site"
+ },
+ "1Gif7PqWTzVWDQ42Mo7np3zXmGAo3DXc7h": {
+ "date_added": 1,
+ "name": "1Gif7PqWTzVWDQ42Mo7np3zXmGAo3DXc7h - r/NSFW_gifs",
+ "reason": "Parts of the site contains pornography"
+ },
+ "14oppwqGXGmuxs5dUbKYLPaYJ926wDJGKo": {
+ "date_added": 1,
+ "name": "14oppwqGXGmuxs5dUbKYLPaYJ926wDJGKo - C0096",
+ "reason": "Pornography site"
+ },
+ "14hfSk8zoBP3fNZnA6fe2HMfpVFMgvgBnc": {
+ "date_added": 1,
+ "name": "14hfSk8zoBP3fNZnA6fe2HMfpVFMgvgBnc - Little Girl Porn",
+ "reason": "Pornography site"
+ },
+ "144Az8bhWgNHGSepmFMiie9cbse3gxBmCD": {
+ "date_added": 1,
+ "name": "144Az8bhWgNHGSepmFMiie9cbse3gxBmCD - Gay Porn Index",
+ "reason": "Pornography site"
+ },
+ "1Mq1QK5EjeBVZkHMYhhnxb3EdnQjMr7SWY": {
+ "date_added": 1,
+ "name": "1Mq1QK5EjeBVZkHMYhhnxb3EdnQjMr7SWY - Top Vidz",
+ "reason": "Pornography site"
+ }
+ }
+}
\ No newline at end of file
diff --git a/assets/filters/users-porn.json b/assets/filters/users-porn.json
new file mode 100644
index 0000000..2789040
--- /dev/null
+++ b/assets/filters/users-porn.json
@@ -0,0 +1,82 @@
+{
+ "mutes": {
+ "17TFi7VtcyxehZB8JUN43trfr5hkjnoHsc": {
+ "cert_user_id": "foxtrot@zeroid.bit",
+ "date_added": 1,
+ "reason": "Pornography content poster on ZeroMe",
+ "source": "ZeroMe"
+ },
+ "1DCJkxufYgBd8pj8VnkVXaGUCBJiq8g9ai": {
+ "cert_user_id": "kheyflix@zeroid.bit",
+ "date_added": 1,
+ "reason": "Pornography content poster on ZeroMe",
+ "source": "ZeroMe"
+ },
+ "1HSJXS26WAFxab3etLidavpj5zki3bC1Pm": {
+ "cert_user_id": "tumbleweed@zeroid.bit",
+ "date_added": 1,
+ "source": "ZeroMe",
+ "reason": "Long term pornography content poster on ZeroMe site. Unsure about his activities on other sites."
+ },
+ "1AXWniok4qHQTGgP9szgQuQfXe9VxZXLwi": {
+ "cert_user_id": "colkurtz@zeroid.bit",
+ "date_added": 1,
+ "source": "ZeroMe",
+ "reason": "Long term pornography content poster on ZeroMe site. Unsure about his activities on other sites."
+ },
+ "1FzppM7Wv3LTgRLqApEBaSkr51QDJki8nJ": {
+ "cert_user_id": "bite@zeroid.bit",
+ "date_added": 1,
+ "source": "ZeroMe",
+ "reason": "Pornography content poster on ZeroMe site. Unsure about his activities on other sites, seen no other content from him."
+ },
+ "13qMquPdWJ59qDHa4e9oJK2kpnHDe1HYV1": {
+ "cert_user_id": "3dporno@zeroid.bit",
+ "date_added": 1,
+ "source": "ZeroMe",
+ "reason": "Long term pornography content poster on ZeroMe site. Unsure about his activities on other sites."
+ },
+ "17k3PvQS8X85js1PBuna6w8e6XjotCiT5L": {
+ "cert_user_id": "alfao@zeroid.bit",
+ "date_added": 1,
+ "source": "ZeroMe",
+ "reason": "Posting child pornography into general (non pornography targetted) site/s."
+ },
+ "13KYifCo93L2rptejRHcT7oM4qXpqL5u5G": {
+ "cert_user_id": "woow@zeroid.bit",
+ "date_added": 1,
+ "source": "ZeroMe",
+ "reason": "Posting child pornography into general (non pornography targetted) site/s."
+ },
+ "1JYfgs2tiLHFyWta6eRZnaUTNHiKDGYzNU": {
+ "cert_user_id": "asukah@zeroid.bit",
+ "date_added": 1,
+ "source": "ZeroMe",
+ "reason": "Posting child pornography into ZeroMe site. Marks himself as a pedo."
+ },
+ "1L4Ev3e99ZaMRqaTPUc5ZwHkWa62oGuFUU": {
+ "cert_user_id": "jimmyruly@zeroid.bit",
+ "date_added": 1,
+ "source": "ZeroMe",
+ "reason": "Long term pornography content poster on ZeroMe site. Unsure about his activities on other sites."
+ },
+ "1FHN4oukAG7zFUpiC9L2iz7QpQVTuT3xkz": {
+ "cert_user_id": "nekocross@zeroid.bit",
+ "date_added": 1,
+ "source": "KopyKate",
+ "reason": "Pornography content poster on KopyKate site. Unsure about his activities on other sites."
+ },
+ "17TFi7VtcyxehZB8JUN43trfr5hkjnoHsc": {
+ "cert_user_id": "foxtrot@zeroid.bit",
+ "date_added": 1,
+ "reason": "Pornography content poster",
+ "source": "ZeroMe"
+ },
+ "1DCJkxufYgBd8pj8VnkVXaGUCBJiq8g9ai": {
+ "cert_user_id": "kheyflix@zeroid.bit",
+ "date_added": 1,
+ "reason": "Pornography content poster",
+ "source": "ZeroMe"
+ }
+ }
+}
\ No newline at end of file
diff --git a/assets/filters/users-spamlist.json b/assets/filters/users-spamlist.json
new file mode 100644
index 0000000..627d7bd
--- /dev/null
+++ b/assets/filters/users-spamlist.json
@@ -0,0 +1,208 @@
+{
+"mutes" : {
+ "16LErDGxiEQgmerLmwT2sBrtBeg2PBH3jN": {
+ "cert_user_id": "zaranet@zeroid.bit",
+ "date_added": 1549505685.860143,
+ "reason": "Posting spam about crypto mining sites",
+ "source": "15UYrA7aXr2Nto1Gg4yWXpY3EAJwafMTNk"
+ },
+ "12fkBZP8Pt6WPujhx1Xc8Rqve8rDKmHoBk": {
+ "cert_user_id": "lkgskhg@zeroid.bit",
+ "date_added": 1549505685.860143,
+ "reason": "Chinese spammer",
+ "source": "1MeFqFfFFGQfa1J3gJyYYUvb5Lksczq7nH"
+ },
+ "14fdwxPt83nTw5vFaXTCR7KQkAxkXuGbAR": {
+ "cert_user_id": "doom1b@zeroid.bit",
+ "date_added": 1495182803.383208,
+ "reason": "Spammer",
+ "source": "1MeFqFfFFGQfa1J3gJyYYUvb5Lksczq7nH"
+ },
+ "18EuCdX79X4qbLEFBDLiaTSbkXU1ojM9A2": {
+ "cert_user_id": "miter@zeroid.bit",
+ "date_added": 1549506339.578346,
+ "reason": "Chinese spammer",
+ "source": "1MeFqFfFFGQfa1J3gJyYYUvb5Lksczq7nH"
+ },
+ "1Abwpgjt1RmxDhhMzCKDsePVUUDSruW4cT": {
+ "cert_user_id": "zeronetisashi@zeroid.bit",
+ "date_added": 1549500655.330371,
+ "reason": "Chinese spammer",
+ "source": "1MeFqFfFFGQfa1J3gJyYYUvb5Lksczq7nH"
+ },
+ "1BKYZXxnwD1Ci92XE4VNkQmWy5HjCC51Lh": {
+ "cert_user_id": "kasjslg@zeroid.bit",
+ "date_added": 1549505927.418664,
+ "reason": "Chinese spammer",
+ "source": "1MeFqFfFFGQfa1J3gJyYYUvb5Lksczq7nH"
+ },
+ "1D4B7XbRYY5p9kx79NtKr3qiShR5Tcpnvo": {
+ "cert_user_id": "doom1@zeroid.bit",
+ "date_added": 1495182789.474986,
+ "reason": "Spammer",
+ "source": "1MeFqFfFFGQfa1J3gJyYYUvb5Lksczq7nH"
+ },
+ "1FCtdTcT4Y1LimfEpRhaHsGKKYiAGjtMaZ": {
+ "cert_user_id": "goodone@zeroid.bit",
+ "date_added": 1549489420.202482,
+ "reason": "Chinese spammer",
+ "source": "1MeFqFfFFGQfa1J3gJyYYUvb5Lksczq7nH"
+ },
+ "1MRSDFESsBXDGvNoZ5ifztA89XfEahA5ka": {
+ "cert_user_id": "bbxxx@zeroid.bit",
+ "date_added": 1495183369.513695,
+ "reason": "Spammer",
+ "source": "1MeFqFfFFGQfa1J3gJyYYUvb5Lksczq7nH"
+ },
+ "1EFPRZRhijiQv6MvhJQLgV2SdPtHR6tJZ": {
+ "cert_user_id": "immortal0000@zeroid.bit",
+ "date_added": 1495183624.231652,
+ "reason": "Spammer",
+ "source": "1MeFqFfFFGQfa1J3gJyYYUvb5Lksczq7nH"
+ },
+ "1GXJzsEWCBdesJY5BtKgJXFQLuMoVPD6ed": {
+ "cert_user_id": "abnah@zeroid.bit",
+ "date_added": 1549528840.535473,
+ "reason": "Chinese spammer",
+ "source": "1MeFqFfFFGQfa1J3gJyYYUvb5Lksczq7nH"
+ },
+ "1QYERLpyBWwtprzJNTtyaNpjgq4aq2kfB": {
+ "cert_user_id": "afjzvmh@zeroid.bit",
+ "date_added": 1549536521.766814,
+ "reason": "Chinese spammer",
+ "source": "1MeFqFfFFGQfa1J3gJyYYUvb5Lksczq7nH"
+ },
+ "1HQsX5fubepwWtHnf4SqNcFVEMa4t8N1jP": {
+ "cert_user_id": "afnaui@zeroid.bit",
+ "date_added": 1549538136.695098,
+ "reason": "Chinese spammer",
+ "source": "1MeFqFfFFGQfa1J3gJyYYUvb5Lksczq7nH"
+ },
+ "1QYERLpyBWwtprzJNTtyaNpjgq4aq2kfB": {
+ "cert_user_id": "afjzvmh@zeroid.bit",
+ "date_added": 1549539112.699984,
+ "reason": "Chinese spammer",
+ "source": "1MeFqFfFFGQfa1J3gJyYYUvb5Lksczq7nH"
+ },
+ "18KRHZjWh7HjvoRLAbVygq94waeWU69SSH": {
+ "cert_user_id": "ajgaho@zeroid.bit",
+ "date_added": 1549539909.840917,
+ "reason": "Chinese spammer",
+ "source": "1MeFqFfFFGQfa1J3gJyYYUvb5Lksczq7nH"
+ },
+ "1Fi7HAnhZ1iu3kuG4oEZPhkiGCqp9WcMaG": {
+ "cert_user_id": "ajgalfj@zeroid.bit",
+ "date_added": 1549540102.139871,
+ "reason": "Chinese spammer",
+ "source": "1MeFqFfFFGQfa1J3gJyYYUvb5Lksczq7nH"
+ },
+ "17VS3A2eHFeMuoRsQX5YofXuCRetQsHVJX": {
+ "cert_user_id": "17VS3A2eHFeMuoR@millchan",
+ "date_added": 1550169460.500,
+ "reason": "Spammer on millchan /jessicanigri/",
+ "source": "1ADQAHsqsie5PBeQhQgjcKmUu3qdPFg6aA"
+ },
+ "16u5SZKMv9gnxLKQfFE8hYPB9UhFGn5FJw": {
+ "cert_user_id": "16u5SZKMv9gnxLK@millchan",
+ "date_added": 1550169460.500,
+ "reason": "Spammer on millchan /jessicanigri/",
+ "source": "1ADQAHsqsie5PBeQhQgjcKmUu3qdPFg6aA"
+ },
+ "1QJj8o4h2zgcuozSecB2WqmL6FBeQS1XSB": {
+ "cert_user_id": "1QJj8o4h2zgcuoz@millchan",
+ "date_added": 1550169460.500,
+ "reason": "Spammer on millchan /jessicanigri/",
+ "source": "1ADQAHsqsie5PBeQhQgjcKmUu3qdPFg6aA"
+ },
+ "15wTgdNkMoX4keYro96QiefAwXtf8FvxYY": {
+ "cert_user_id": "15wTgdNkMoX4keY@millchan",
+ "date_added": 1550169460.500,
+ "reason": "Spammer on millchan /jessicanigri/",
+ "source": "1ADQAHsqsie5PBeQhQgjcKmUu3qdPFg6aA"
+ },
+ "19eXGqVBwGmKWSfw7MjWknbX5kG5VEwML2": {
+ "cert_user_id": "19eXGqVBwGmKWSf@millchan",
+ "date_added": 1550169460.500,
+ "reason": "Spammer on millchan /jessicanigri/",
+ "source": "1ADQAHsqsie5PBeQhQgjcKmUu3qdPFg6aA"
+ },
+ "14JRUax64emMFVVxN2ikjz5J74CjqoJtFr": {
+ "cert_user_id": "yeahyi@zeroid.bit",
+ "date_added": 1550206131.422221,
+ "reason": "Spammer",
+ "source": "1iD5ZQJMNXu43w1qLB8sfdHVKppVMduGz"
+ },
+ "14Y1Vbo7Mz2efjpMnc4t5iSEYixVQhqQpL": {
+ "cert_user_id": "goody@zeroid.bit",
+ "date_added": 1550717228.894357,
+ "reason": "Spammed ZeroTalk threads",
+ "source": "1iD5ZQJMNXu43w1qLB8sfdHVKppVMduGz"
+ },
+ "13wJrWgzjwKU1zgXJMDCGhkSjsaUvYjZM2": {
+ "cert_user_id": "duende@zeroid.bit",
+ "date_added": 1555902803.067858,
+ "reason": "Pedo who's encouraging me to suicide and spamming his bullshit.",
+ "source": "1MeFqFfFFGQfa1J3gJyYYUvb5Lksczq7nH"
+ },
+ "17AMQVbBa12XB3xFWKDnP2dCEx92TaiY7X": {
+ "cert_user_id": "anonymouslogin@zeroid.bit",
+ "date_added": 1564403461.560763,
+ "reason": "Public cert, spamming kill yourself messages",
+ "source": "1MeFqFfFFGQfa1J3gJyYYUvb5Lksczq7nH"
+ },
+ "1A1JcKDgksT5pQJoSo7g1P1cC9kAKvG93m": {
+ "cert_user_id": "publicid@zeroid.bit",
+ "date_added": 1564403486.731043,
+ "reason": "Public cert, spamming kill yourself messages",
+ "source": "1MeFqFfFFGQfa1J3gJyYYUvb5Lksczq7nH"
+ },
+ "18oN5jkSiB1SLb4Jywb4ZnKiwXqtQN5Fau": {
+ "cert_user_id": "qqqqqqqqqqqqqqqq@zeroid.bit",
+ "date_added": 1568807655.9091918,
+ "reason": "spammer",
+ "source": "1TaLkFrMwvbNsooF4ioKAY9EuxTBTjipT"
+ },
+ "1JrUPjJmdTq5UsiKefuGTkNMd8MUNvP8Ss": {
+ "cert_user_id": "tedreamraffle@zeroid.bit",
+ "date_added": 1574046190.8304808,
+ "reason": "Spam raffles/lotto",
+ "source": "1TaLkFrMwvbNsooF4ioKAY9EuxTBTjipT"
+ },
+ "12ShAsoQVkbEgqfjS2JmXt7cXBSbf8ifuS": {
+ "cert_user_id": "caropc2@zeroid.bit",
+ "date_added": 1574420510.623536,
+ "reason": "Spamming kopykate clone",
+ "source": "1TaLkFrMwvbNsooF4ioKAY9EuxTBTjipT"
+ },
+ "1D5iCU5XE1D25ce2fV2XZqH95jGRtRaKZL": {
+ "cert_user_id": "caropc10@zeroid.bit",
+ "date_added": 1574420502.4061,
+ "reason": "spamming kopykate clone",
+ "source": "1TaLkFrMwvbNsooF4ioKAY9EuxTBTjipT"
+ },
+ "13EafRdDw5sZF42dTn68uDdcssTWKbdauJ": {
+ "cert_user_id": "deepnude@zeroid.bit",
+ "date_added": 1583066012.629051,
+ "reason": "harmful user",
+ "source": "1TaLkFrMwvbNsooF4ioKAY9EuxTBTjipT"
+ },
+ "1EZTWytasXcKdiUFnN4KHqAfvg1nwkTkKv": {
+ "cert_user_id": "kai0@zeroid.bit",
+ "date_added": 1530012685,
+ "source": "ZeroTalk",
+ "reason": "Spammer"
+ },
+ "14ytAKDfNjArMTqGecTi7ginG3aZTsRAum": {
+ "cert_user_id": "polar2@zeroid.bit",
+ "date_added": 1530012685,
+ "source": "ZeroTalk",
+ "reason": "Spammer"
+ },
+ "1JMXM9eSCpGAocrYxkfUmwiXeqcJw637vC": {
+ "cert_user_id": "mrc@zeroid.bit",
+ "date_added": 1530012685,
+ "source": "ZeroTalk",
+ "reason": "Spammer"
+ }
+ }
+}
\ No newline at end of file
diff --git a/fastlane/metadata/android/en-US/changelogs/70.txt b/fastlane/metadata/android/en-US/changelogs/70.txt
new file mode 100644
index 0000000..df9f83b
--- /dev/null
+++ b/fastlane/metadata/android/en-US/changelogs/70.txt
@@ -0,0 +1,9 @@
+v 0.7.0
+
+- Major UI Changes with Modern UI 😍😍.
+- Faster Startup of ZeroNet 😁😁.
+- Individual Site Details for Popular Sites with Stats and useful functions 😘😘.
+- Update Minimum Android Support Version to API 21 (Android 5.0 Lollipop).
+- Add Site Shortcut to HomeScreen.
+- Added In-App Review so that you can give your feedback quickly.
+- Several Bug Fixes and Improvements.
\ No newline at end of file
diff --git a/fastlane/metadata/android/en-US/full_description.txt b/fastlane/metadata/android/en-US/full_description.txt
new file mode 100644
index 0000000..462dd3f
--- /dev/null
+++ b/fastlane/metadata/android/en-US/full_description.txt
@@ -0,0 +1,59 @@
+ZeroNet - Open, free and uncensorable websites, using Bitcoin cryptography and BitTorrent network.
+
+TLDR(Short and Simple) Version
+Slides : http://bit.ly/howzeronetworks
+
+PEER-TO-PEER
+ - Your content distributed directly to other visitors without any central server.
+
+Unstopable
+ - It's nowhere because it's everywhere!
+ - No hosting costs
+ - Sites are served by visitors.
+ - Always accessible
+ - No single point of failure.
+
+SIMPLE
+ - No configuration needed:
+ - Download, unpack and start using it.
+
+.BIT DOMAINS
+ - Decentralized domains using Namecoin cryptocurrency.
+
+NO PASSWORDS
+ - Your account is protected by the same cryptography as your Bitcoin wallet.
+
+FAST
+ - Page response time is not limited by your connection speed.
+
+DYNAMIC CONTENT
+ - Real-time updated, multi-user websites.
+
+WORKS EVERYWHERE
+ - Supports any modern browser on
+ - Windows, Linux or Mac and Android platforms.
+
+ANONYMITY
+ - You can easily hide your IP address using the Tor network.
+
+OFFLINE
+ - Browse the sites you're seeding even if your internet connection is down.
+
+OPEN SOURCE
+ - Developed by the community for the community.
+
+We believe in
+open, free, and uncensored
+network and communication.
+
+About Mobile Client
+ZeroNet Mobile is an Android Client for ZeroNet, Project uses flutter framework for runner and is Open Sourced at https://github.com/canewsin/zeronet_mobile, you can contribute to the app by forking the project.
+
+Contribute
+ If you want to support project's further development, you can contribute your time or money, If you want to contribute money you can send bitcoin or other supported crypto currencies to above addresses or buy in-app purchases, if want to contribute translations or code, visit official GitHub repo.
+
+Links :
+Facebook https://www.facebook.com/HelloZeroNet
+Twitter https://twitter.com/HelloZeroNet
+Reddit https://www.reddit.com/r/zeronet/
+Github https://github.com/HelloZeroNet/ZeroNet
\ No newline at end of file
diff --git a/fastlane/metadata/android/en-US/images/featureGraphic.png b/fastlane/metadata/android/en-US/images/featureGraphic.png
new file mode 100644
index 0000000..bd0c58c
Binary files /dev/null and b/fastlane/metadata/android/en-US/images/featureGraphic.png differ
diff --git a/fastlane/metadata/android/en-US/images/icon.png b/fastlane/metadata/android/en-US/images/icon.png
new file mode 100644
index 0000000..7521e2f
Binary files /dev/null and b/fastlane/metadata/android/en-US/images/icon.png differ
diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/1.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/1.png
new file mode 100644
index 0000000..d9b335c
Binary files /dev/null and b/fastlane/metadata/android/en-US/images/phoneScreenshots/1.png differ
diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/2.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/2.png
new file mode 100644
index 0000000..4a772d1
Binary files /dev/null and b/fastlane/metadata/android/en-US/images/phoneScreenshots/2.png differ
diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/3.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/3.png
new file mode 100644
index 0000000..37c3bfb
Binary files /dev/null and b/fastlane/metadata/android/en-US/images/phoneScreenshots/3.png differ
diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/4.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/4.png
new file mode 100644
index 0000000..c7ccd67
Binary files /dev/null and b/fastlane/metadata/android/en-US/images/phoneScreenshots/4.png differ
diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/5.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/5.png
new file mode 100644
index 0000000..c0e3997
Binary files /dev/null and b/fastlane/metadata/android/en-US/images/phoneScreenshots/5.png differ
diff --git a/fastlane/metadata/android/en-US/images/phoneScreenshots/6.png b/fastlane/metadata/android/en-US/images/phoneScreenshots/6.png
new file mode 100644
index 0000000..74d7730
Binary files /dev/null and b/fastlane/metadata/android/en-US/images/phoneScreenshots/6.png differ
diff --git a/fastlane/metadata/android/en-US/short_description.txt b/fastlane/metadata/android/en-US/short_description.txt
new file mode 100644
index 0000000..bea4f19
--- /dev/null
+++ b/fastlane/metadata/android/en-US/short_description.txt
@@ -0,0 +1 @@
+ZeroNet - Open, Free Speech, Uncensored platform for modern & decentralized web.
\ No newline at end of file
diff --git a/fastlane/metadata/android/en-US/title.txt b/fastlane/metadata/android/en-US/title.txt
new file mode 100644
index 0000000..5ea828c
--- /dev/null
+++ b/fastlane/metadata/android/en-US/title.txt
@@ -0,0 +1 @@
+ZeroNet Mobile - Open, Free and Uncensorable Sites
\ No newline at end of file
diff --git a/fastlane/metadata/android/en-US/video.txt b/fastlane/metadata/android/en-US/video.txt
new file mode 100644
index 0000000..e69de29
diff --git a/lib/constants.dart b/lib/constants.dart
deleted file mode 100644
index 2ed4800..0000000
--- a/lib/constants.dart
+++ /dev/null
@@ -1,86 +0,0 @@
-import 'package:flutter/foundation.dart';
-import 'package:flutter/material.dart';
-
-const String pkgName = 'in.canews.zeronet${kDebugMode ? '.debug' : ''}';
-const String dataDir = "/data/data/$pkgName/files";
-const String zeroNetDir = dataDir + '/ZeroNet-py3';
-const String bin = '$dataDir/usr/bin';
-const String python = '$bin/python';
-const String libDir = '$dataDir/usr/lib';
-const String libDir64 = '$dataDir/usr/lib64';
-const String zeronetDir = '$dataDir/ZeroNet-py3';
-const String zeronet = '$zeronetDir/zeronet.py';
-const String defZeroNetUrl = 'http://127.0.0.1:43110/';
-const String downloading = 'Downloading Files';
-const String installing = 'Installing ZeroNet Files';
-const String githubLink = 'https://github.com';
-const String rawGithubLink = 'https://raw.githubusercontent.com';
-const String canewsInRepo = '/canewsin/ZeroNet';
-const String releases = '$githubLink$canewsInRepo/releases/download/';
-const String md5hashLink = '$rawGithubLink$canewsInRepo/py3-patches/md5.hashes';
-const String zeroNetNotiId = 'zeroNetNetiId';
-const String zeroNetChannelName = 'ZeroNet Mobile';
-const String zeroNetChannelDes =
- 'Shows ZeroNet Notification to Persist from closing.';
-const String notificationCategory = 'ZERONET_RUNNING';
-const String isolateUnZipPort = 'unzip_send_port';
-const String isolateDownloadPort = 'downloader_send_port';
-const String zeronetStartUpError = 'Startup error: ';
-const String zeronetAlreadyRunningError =
- zeronetStartUpError + 'Can\'t open lock file';
-const bool kEnableDynamicModules = !kDebugMode;
-
-const List colors = [
- Colors.cyan,
- Colors.indigoAccent,
- Color(0xFF9F63BF),
- Color(0xFFE2556F),
- Color(0xFF358AC7),
- Color(0xFFA176B6),
- Color(0xFFC04848),
- Color(0xFF4A569D),
- Color(0xFFF39963),
- Color(0xFFF1417D),
- Color(0xFF1BB2D4),
- Color(0xFF7ECA26),
-];
-const List binDirs = [
- 'usr',
- 'site-packages',
- 'ZeroNet-py3',
-];
-const List soDirs = [
- 'usr/bin',
- 'usr/lib',
- 'usr/lib/python3.8/lib-dynload',
- 'usr/lib/python3.8/site-packages',
-];
-
-const String profileSwitcher = 'Profile Switcher';
-const String profileSwitcherDes =
- 'Create and Use different Profiles on ZeroNet';
-const String debugZeroNet = 'Debug ZeroNet Code';
-const String debugZeroNetDes =
- 'Useful for Developers to find bugs and errors in the code.';
-const String enableZeroNetConsole = 'Enable ZeroNet Console';
-const String enableZeroNetConsoleDes =
- 'Useful for Developers to see the exec of ZeroNet Python code';
-const String pluginManager = 'Plugin Manager';
-const String pluginManagerDes = 'Enable/Disable ZeroNet Plugins';
-const String vibrateOnZeroNetStart = 'Vibrate on ZeroNet Start';
-const String vibrateOnZeroNetStartDes = 'Vibrates Phone When ZeroNet Starts';
-const String enableFullScreenOnWebView = 'FullScreen for ZeroNet Zites';
-const String enableFullScreenOnWebViewDes =
- 'This will Enable Full Screen for in app Webview of ZeroNet';
-const String batteryOptimisation = 'Disable Battery Optimisation';
-const String batteryOptimisationDes =
- 'This will Helps to Run App even App is in Background for long time.';
-const String publicDataFolder = 'Public DataFolder';
-const String publicDataFolderDes =
- 'This Will Make ZeroNet Data Folder Accessible via File Manager.';
-const String autoStartZeroNet = 'AutoStart ZeroNet';
-const String autoStartZeroNetDes =
- 'This Will Make ZeroNet Auto Start on App Start, So you don\'t have to click Start Button Every Time on App Start.';
-const String autoStartZeroNetonBoot = 'AutoStart ZeroNet on Boot';
-const String autoStartZeroNetonBootDes =
- 'This Will Make ZeroNet Auto Start on Device Boot.';
diff --git a/lib/mobx/purchasesstore.dart b/lib/controllers/purchasescontroller.dart
similarity index 50%
rename from lib/mobx/purchasesstore.dart
rename to lib/controllers/purchasescontroller.dart
index fd88626..52c9ba7 100644
--- a/lib/mobx/purchasesstore.dart
+++ b/lib/controllers/purchasescontroller.dart
@@ -1,60 +1,43 @@
-import 'package:mobx/mobx.dart';
import 'package:purchases_flutter/purchases_flutter.dart' as purchases_flutter;
+import '../imports.dart';
-// Include generated file
-part 'purchasesstore.g.dart';
+final purchasesStore = Get.put(PurchaseController());
-// This is the class used by rest of your codebase
-final purchasesStore = PurchasesStore();
+class PurchaseController extends GetxController {
+ var oneTimePurchases = [].obs;
-class PurchasesStore = _PurchasesStore with _$PurchasesStore;
+ var subscriptions = [].obs;
-// The store-class
-abstract class _PurchasesStore with Store {
- @observable
- ObservableList oneTimePurchases =
- ObservableList();
-
- @observable
- ObservableList subscriptions =
- ObservableList();
-
- @action
void addOneTimePuchases(List details) {
- for (var item in details) {
+ details.forEach((item) {
bool exists = oneTimePurchases
.any((element) => element.identifier == item.identifier);
if (!exists) {
oneTimePurchases.add(item);
}
- }
+ });
}
- @action
void addSubscriptions(List details) {
- for (var item in details) {
+ details.forEach((item) {
bool exists =
subscriptions.any((element) => element.identifier == item.identifier);
if (!exists) {
subscriptions.add(item);
}
- }
+ });
}
- @observable
- ObservableList purchases = ObservableList();
+ var purchases = [].obs;
- @action
void addPurchases(String purchaseIds) {
if (!purchases.contains(purchaseIds)) {
purchases.add(purchaseIds);
}
}
- @observable
- ObservableList consumedPurchases = ObservableList();
+ var consumedPurchases = [].obs;
- @action
void addConsumedPurchases(String purchaseIds) {
if (!consumedPurchases.contains(purchaseIds)) {
consumedPurchases.add(purchaseIds);
diff --git a/lib/controllers/stringcontroller.dart b/lib/controllers/stringcontroller.dart
new file mode 100644
index 0000000..b822973
--- /dev/null
+++ b/lib/controllers/stringcontroller.dart
@@ -0,0 +1,552 @@
+import '../imports.dart';
+
+final strController = Get.put(StrController());
+
+class StrController extends GetxController {
+ var statusStr = 'Status'.obs;
+ var userStatusStr = 'User Id'.obs;
+ var userNameNotCreatedStr = 'Not Created'.obs;
+ var statusNotRunningStr = 'Not Running'.obs;
+ var statusInitializingStr = 'Initializing..'.obs;
+ var statusStartingStr = 'Starting'.obs;
+ var statusRunningStr = 'Running'.obs;
+ var statusRunningWithTorStr = 'Running with Tor'.obs;
+ var statusErrorStr = 'Error'.obs;
+ var popularSitesStr = 'Popular Sites'.obs;
+ var startZeroNetFirstStr =
+ 'Please Start ZeroNet First to Browse this Zite'.obs;
+ var createStr = 'Create'.obs;
+ var openStr = 'OPEN'.obs;
+ var downloadStr = 'DOWNLOAD'.obs;
+ var addToHomeScreenStr = 'Add to HomeScreen'.obs;
+ var showLogStr = 'Show Log'.obs;
+ var pauseStr = 'Pause'.obs;
+ var resumeStr = 'Resume'.obs;
+ var deleteZiteStr = 'Delete Zite'.obs;
+ var shrtAddedToHomeScreenStr = 'shortcut added to HomeScreen'.obs;
+ var startStr = 'Start'.obs;
+ var restartStr = 'Restart'.obs;
+ var pleaseWaitStr = 'Please Wait..!'.obs;
+ var stopStr = 'Stop'.obs;
+ var closeStr = 'Close'.obs;
+ var viewLogStr = 'View Log'.obs;
+ var aboutStr = 'About'.obs;
+ var settingsStr = 'Settings'.obs;
+ var browserStr = 'Browser'.obs;
+ var logStr = 'Log'.obs;
+ var updateStr = 'Update'.obs;
+ var downloadingStr = 'Downloading'.obs;
+ var downloadedStr = 'Downloaded'.obs;
+ var installStr = 'Install'.obs;
+ var restoreStr = 'Restore'.obs;
+ var installingStr = 'Installing'.obs;
+ var installationCompletedStr = 'Installation Completed'.obs;
+ var notAvaliableStr = 'Not Available'.obs;
+ var aboutAppDesStr = 'ZeroNet Mobile is a full native client for ZeroNet, '
+ 'a platform for decentralized websites using Bitcoin '
+ .obs;
+ var aboutAppDes1Str =
+ 'crypto and the BitTorrent network. you can learn more about ZeroNet at '
+ .obs;
+ var developersStr = 'Developers'.obs;
+ var donationAddrsStr = 'Donation Addresses'.obs;
+ var clickAddrToCopyStr = '* Click on Address to copy'.obs;
+ var donAddrCopiedStr = 'Donation Address Copied to Clipboard'.obs;
+ var donationDes = "* Any Donation can activate all pro-features in app, "
+ "these are just an encouragement to me to work more on the app. "
+ "Pro-features will be made available to general public after certain time, "
+ "thus you don't need to worry about exclusiveness of a feature. "
+ "If you donate from any source other than Google Play Purchase, "
+ "just send your transaction id to canews.in@gmail.com / ZeroMail: zeromepro, "
+ "so than I can send activation code to activate pro-features."
+ .obs;
+ var contributeStr = 'Contribute'.obs;
+ var contributeDesStr = "If you want to support project's further development, "
+ "you can contribute your time or money, "
+ "If you want to contribute money you can send bitcoin or "
+ "other supported crypto currencies to above addresses or buy in-app purchases, "
+ "if want to contribute translations or code, visit official GitHub repo."
+ .obs;
+ var googlePurchasesStr = 'Google Play Purchases'.obs;
+ var googleFeeWarningStr = '(including 15% Google Tax) :'.obs;
+ var oneTimeSubStr = 'One Time'.obs;
+ var monthlySubStr = 'Monthly Subscriptions'.obs;
+ var tipStr = 'Tip'.obs;
+ var coffeeStr = 'Coffee'.obs;
+ var lunchStr = 'Lunch'.obs;
+ var usersFileCopied = 'Users.json content copied to Clipboard'.obs;
+ var chkBckUpStr = 'Please check yourself that file back up Successfully.'.obs;
+ var zeroNetNotInitTitleStr = 'ZeroNet data folder not Exists.'.obs;
+ var zeroNetNotInitDesStr =
+ "ZeroNet should be used atleast once (run it from home screen), "
+ "before using this option"
+ .obs;
+ var loadingStr = 'Loading'.obs;
+ var switchProfileToStr = 'Switch Profile to'.obs;
+ var switchProfileToDesStr = 'this will delete the existing profile, '
+ 'backup existing profile using backup button below'
+ .obs;
+ var backupStr = 'Backup'.obs;
+ var switchStr = 'Switch'.obs;
+ var loadingPageWarningStr = """
+ Please Wait! This may take a while, happens
+ only first time, Don't Press Back button.
+ If You Accidentally Pressed Back,
+ Clean App Storage in Settings or
+ Uninstall and Reinstall The App.
+ """
+ .obs;
+ var appUpdateAvailableStr = 'App Update Available : '.obs;
+ var knowMoreStr = 'Know More'.obs;
+ var ratingWgtStr = 'Give Your Rating/Feedback'.obs;
+ var siteInfoStr = 'SiteInfo'.obs;
+ var backupWarningStr =
+ 'Always remember to backup users.json before doing anything because, '
+ 'we are not able to tell when a software will fail. '
+ 'Click Backup below to backup your Existing users.json file.\n'
+ .obs;
+ var usernameStr = 'Username'.obs;
+ var usernamePhraseStr = 'Username Phrase :'.obs;
+ var usrnameWarning1Str = 'username can\'t be Empty'.obs;
+ var usrnameWarning2Str = 'username can\'t contain spaces'.obs;
+ var usrnameWarning3Str = 'username can\'t be less than 6 characters.'.obs;
+ var usrnameWarning4Str = 'username already exists, choose different one.'.obs;
+ var znNotiRunningTitleStr = 'ZeroNet Mobile is Running'.obs;
+ var znNotiRunningDesStr = 'Click Here on this Notification to open app'.obs;
+ var znNotiNotRunningTitleStr = 'ZeroNet Mobile is Not Running'.obs;
+ var znNotiNotRunningDesStr =
+ 'Open ZeroNet Mobile App and click start to run ZeroNet'.obs;
+ var znPluginInstallingTitleStr = 'Installing Plugin'.obs;
+ var znPluginInstallingDesStr =
+ 'This Dialog will be automatically closed after installation, '
+ 'After Installation Restart ZeroNet from Home page'
+ .obs;
+ var zninstallAPluginTitleStr = 'Install A Plugin'.obs;
+ var zninstallAPluginDesStr = 'This will load plugin to your ZeroNet repo, '
+ '\nWarning : Loading Unknown/Untrusted plugins may compromise ZeroNet Installation.'
+ .obs;
+ var restoreProfileTitleStr = 'Restore Profile ?'.obs;
+ var restoreProfileDesStr = 'this will delete the existing profile, '
+ 'backup existing profile using backup button below\n\n'
+ 'Selected Userfile : \n'
+ .obs;
+ var restoreProfileDes1Str =
+ 'You can only select users.json file, outside zeronet data folder'.obs;
+ var existingProfileTitleStr = 'Provide A Name for Existing Profile'.obs;
+ var createNewProfileStr = 'Create New Profile'.obs;
+ var importProfileStr = 'Import Profile'.obs;
+ var backupProfileStr = 'Backup Profile'.obs;
+ var openPluginManagerStr = 'Open Plugin Manager'.obs;
+ var loadPluginStr = 'Load Plugin'.obs;
+ var zerohelloSiteDesStr = 'Say Hello to ZeroNet, a Dashboard to manage '
+ 'all your ZeroNet Z(S)ites, You can view feed of other zites like '
+ 'posts, comments of other users from ZeroTalk as well for your posts '
+ 'and Stats like Total Requests sent and received from other peers on ZeroNet. '
+ 'You can also pause, clone or favourite, delete Zites from single page.'
+ .obs;
+ var zeronetMobileSiteDesStr = 'Forum to report ZeroNet Mobile app issues. '
+ 'Want a new feature in the app, Request a Feature. '
+ 'Facing any Bugs while using the app ? '
+ 'Just report problem here, we will take care of it. '
+ 'Want to Discuss any topic about app development ? '
+ 'Just dive into to this Zite.'
+ .obs;
+ var zeroTalkSiteDesStr = 'Need a forum to discuss something, '
+ 'we got covered you here. ZeroTalk fits your need, '
+ 'just post something to get opinion from others on Network. '
+ 'Have some queries ? don\'t hesitate to ask here.'
+ 'Tired of Spam ? Who don\'t! You can mute individual users also.'
+ .obs;
+ var zeroblogSiteDesStr = 'Want to Know Where ZeroNet is Going ? '
+ 'ZeroBlog gives you latest changes and improvements '
+ 'made to ZeroNet, including Bug Fixes, '
+ 'Speed Improvements of ZeroNet Core Software. '
+ 'Also Provides varies links to ZeroNet Protocol and '
+ 'how ZeroNet works underhood and much more things to know.'
+ .obs;
+ var zeromailSiteDesStr = 'So you need a mail service, use ZeroMail, '
+ 'fully end-to-end encrypted mail service on ZeroNet, '
+ 'don\'t let others scanning your mailbox for their profits '
+ 'all your data is encrypted and can only opened by you. '
+ 'Your all mails are backedup, so you can stay calm for your data.'
+ .obs;
+ var zeromeSiteDesStr = 'Social Network is everywhere, so we made one here too. '
+ 'Twitter like, Peer to Peer Social Networking in your hands without data-tracking, '
+ 'Follow others and post your thoughts, like, comment on others posts, it\'s that easy-peasy. '
+ 'Find Like minded people and increase your friend circle beyond the borders.'
+ .obs;
+ var zeroSitesSiteDesStr = 'Want to know more sites on ZeroNet, '
+ 'visit ZeroSites, listing of community contributed sites under various '
+ 'categories like Blogs, Services, Forums, Chat, Video, Image, Guides, News and much more. '
+ 'You can even filter those lists with your preferred language '
+ 'to get more comprehensive list. Has a New Site to Show, Just Submit here.'
+ .obs;
+ var themeSwitcherStr = 'Theme'.obs;
+ var themeSwitcherDesStr = 'Switch App Theme between Light, Dark, Black'.obs;
+ var languageSwitcherStr = 'Language'.obs;
+ var languageSwitcherDesStr = 'Change App Language to your Native Speaks'.obs;
+ var profileSwitcherStr = 'Profile Switcher'.obs;
+ var profileSwitcherDesStr = 'Create and Use different Profiles on ZeroNet, '
+ 'Import Existing Profiles from other devices, or Backup your Profile. '
+ '\nNote: If Backup Profile doesn\'t work. Long Press the "Backup Profile" Button, '
+ 'it will copy users.json file contents to clipboard, so that you can save the private keys from this option.'
+ .obs;
+ var debugZeroNetStr = 'Debug ZeroNet Code'.obs;
+ var debugZeroNetDesStr =
+ 'Useful for Developers to find bugs and errors in the code.'.obs;
+ var enableZeroNetConsoleStr = 'Enable ZeroNet Console'.obs;
+ var enableZeroNetConsoleDesStr =
+ 'Useful for Developers to see the exec of ZeroNet Python code'.obs;
+ var enableZeroNetFiltersStr = 'Enable ZeroNet Filters'.obs;
+ var enableZeroNetFiltersDesStr =
+ 'Enabling ZeroNet Filters blocks known ametuer content sites and spam users.'
+ .obs;
+ var enableAdditionalTrackersStr = 'Additional BitTorrent Trackers'.obs;
+ var enableAdditionalTrackersDesStr =
+ 'Enabling External/Additional BitTorrent Trackers will give more ZeroNet Site Seeders or Clients.'
+ .obs;
+ var pluginManagerStr = 'Plugin Manager'.obs;
+ var pluginManagerDesStr = 'Enable/Disable ZeroNet Plugins'.obs;
+ var vibrateOnZeroNetStartStr = 'Vibrate on ZeroNet Start'.obs;
+ var vibrateOnZeroNetStartDesStr = 'Vibrates Phone When ZeroNet Starts'.obs;
+ var enableFullScreenOnWebViewStr = 'FullScreen for ZeroNet Zites'.obs;
+ var enableFullScreenOnWebViewDesStr =
+ 'This will Enable Full Screen for in app Webview of ZeroNet'.obs;
+ var batteryOptimisationStr = 'Disable Battery Optimisation'.obs;
+ var batteryOptimisationDesStr =
+ 'This will Helps to Run App even App is in Background for long time.'.obs;
+ var publicDataFolderStr = 'Public DataFolder'.obs;
+ var publicDataFolderDesStr =
+ 'This Will Make ZeroNet Data Folder Accessible via File Manager.'.obs;
+ var autoStartZeroNetStr = 'AutoStart ZeroNet'.obs;
+ var autoStartZeroNetDesStr =
+ 'This Will Make ZeroNet Auto Start on App Start, So you don\'t have to click Start Button Every Time on App Start.'
+ .obs;
+ var autoStartZeroNetonBootStr = 'AutoStart ZeroNet on Boot'.obs;
+ var autoStartZeroNetonBootDesStr =
+ 'This Will Make ZeroNet Auto Start on Device Boot.'.obs;
+ var enableTorLogStr = 'Enable Tor Log'.obs;
+ var enableTorLogDesStr =
+ 'This will Enable Tor Log in ZeroNet Console helpful for debugging.'.obs;
+ var createUserIdFirstStr =
+ 'Please create User Id or Import your ZeroNet users.json File, to continue your donation. '
+ 'You can create your User ID at App Home Page. '
+ 'This will helps to restore your purchase in future.'
+ .obs;
+
+ void updatestatusStr(String str) => statusStr.value = str;
+ void updateUserStatusStr(String str) => userStatusStr.value = str;
+ void updateUserNameNotCreatedStr(String str) =>
+ userNameNotCreatedStr.value = str;
+ void updateCreateUserIdFirstStr(String str) =>
+ createUserIdFirstStr.value = str;
+ void updatestatusNotRunningStr(String str) => statusNotRunningStr.value = str;
+ void updatestatusInitializingStr(String str) =>
+ statusInitializingStr.value = str;
+ void updatestatusStartingStr(String str) => statusStartingStr.value = str;
+ void updatestatusRunningStr(String str) => statusRunningStr.value = str;
+ void updatestatusRunningWithTorStr(String str) =>
+ statusRunningStr.value = str;
+ void updatestatusErrorStr(String str) => statusErrorStr.value = str;
+ void updatepopularSitesStr(String str) => popularSitesStr.value = str;
+ void updatestartZeroNetFirstStr(String str) =>
+ startZeroNetFirstStr.value = str;
+ void updatecreateStr(String str) => createStr.value = str;
+ void updateopenStr(String str) => openStr.value = str;
+ void updatedownloadStr(String str) => downloadStr.value = str;
+ void updateaddToHomeScreenStr(String str) => addToHomeScreenStr.value = str;
+ void updateshowLogStr(String str) => showLogStr.value = str;
+ void updatepauseStr(String str) => pauseStr.value = str;
+ void updateresumeStr(String str) => resumeStr.value = str;
+ void updatedeleteZiteStr(String str) => deleteZiteStr.value = str;
+ void updateshrtAddedToHomeScreenStr(String str) =>
+ shrtAddedToHomeScreenStr.value = str;
+ void updatestartStr(String str) => startStr.value = str;
+ void updaterestartStr(String str) => restartStr.value = str;
+ void updatepleaseWaitStr(String str) => pleaseWaitStr.value = str;
+ void updatestopStr(String str) => stopStr.value = str;
+ void updatecloseStr(String str) => closeStr.value = str;
+ void updateviewLogStr(String str) => viewLogStr.value = str;
+ void updateaboutStr(String str) => aboutStr.value = str;
+ void updatesettingsStr(String str) => settingsStr.value = str;
+ void updatebrowserStr(String str) => browserStr.value = str;
+ void updatelogStr(String str) => logStr.value = str;
+ void updateupdateStr(String str) => updateStr.value = str;
+ void updatedownloadingStr(String str) => downloadingStr.value = str;
+ void updatedownloadedStr(String str) => downloadedStr.value = str;
+ void updateinstallStr(String str) => installStr.value = str;
+ void updaterestoreStr(String str) => restoreStr.value = str;
+ void updateinstallingStr(String str) => installingStr.value = str;
+ void updateinstallationCompletedStr(String str) =>
+ installationCompletedStr.value = str;
+ void updatenotAvaliableStr(String str) => notAvaliableStr.value = str;
+ void updateaboutAppDesStr(String str) => aboutAppDesStr.value = str;
+ void updateaboutAppDes1Str(String str) => aboutAppDes1Str.value = str;
+ void updatedevelopersStr(String str) => developersStr.value = str;
+ void updatedonationAddrsStr(String str) => donationAddrsStr.value = str;
+ void updateclickAddrToCopyStr(String str) => clickAddrToCopyStr.value = str;
+ void updatedonAddrCopiedStr(String str) => donAddrCopiedStr.value = str;
+ void updatedonationDes(String str) => donationDes.value = str;
+ void updatecontributeStr(String str) => contributeStr.value = str;
+ void updatecontributeDesStr(String str) => contributeDesStr.value = str;
+ void updategooglePurchasesStr(String str) => googlePurchasesStr.value = str;
+ void updategoogleFeeWarningStr(String str) => googleFeeWarningStr.value = str;
+ void updateoneTimeSubStr(String str) => oneTimeSubStr.value = str;
+ void updatemonthlySubStr(String str) => monthlySubStr.value = str;
+ void updatetipStr(String str) => tipStr.value = str;
+ void updatecoffeeStr(String str) => coffeeStr.value = str;
+ void updatelunchStr(String str) => lunchStr.value = str;
+ void updateusersFileCopied(String str) => usersFileCopied.value = str;
+ void updatechkBckUpStr(String str) => chkBckUpStr.value = str;
+ void updatezeroNetNotInitTitleStr(String str) =>
+ zeroNetNotInitTitleStr.value = str;
+ void updatezeroNetNotInitDesStr(String str) =>
+ zeroNetNotInitDesStr.value = str;
+ void updateloadingStr(String str) => loadingStr.value = str;
+ void updateswitchProfileToStr(String str) => switchProfileToStr.value = str;
+ void updateswitchProfileToDesStr(String str) =>
+ switchProfileToDesStr.value = str;
+ void updatebackupStr(String str) => backupStr.value = str;
+ void updateswitchStr(String str) => switchStr.value = str;
+ void updateloadingPageWarningStr(String str) =>
+ loadingPageWarningStr.value = str;
+ void updateappUpdateAvailableStr(String str) =>
+ appUpdateAvailableStr.value = str;
+ void updateknowMoreStr(String str) => knowMoreStr.value = str;
+ void updateratingWgtStr(String str) => ratingWgtStr.value = str;
+ void updatesiteInfoStr(String str) => siteInfoStr.value = str;
+ void updatebackupWarningStr(String str) => backupWarningStr.value = str;
+ void updateusernameStr(String str) => usernameStr.value = str;
+ void updateusernamePhraseStr(String str) => usernamePhraseStr.value = str;
+ void updateusrnameWarning1Str(String str) => usrnameWarning1Str.value = str;
+ void updateusrnameWarning2Str(String str) => usrnameWarning2Str.value = str;
+ void updateusrnameWarning3Str(String str) => usrnameWarning3Str.value = str;
+ void updateusrnameWarning4Str(String str) => usrnameWarning4Str.value = str;
+ void updateznNotiRunningTitleStr(String str) =>
+ znNotiRunningTitleStr.value = str;
+ void updateznNotiRunningDesStr(String str) => znNotiRunningDesStr.value = str;
+ void updateznNotiNotRunningTitleStr(String str) =>
+ znNotiNotRunningTitleStr.value = str;
+ void updateznNotiNotRunningDesStr(String str) =>
+ znNotiNotRunningDesStr.value = str;
+ void updateznPluginInstallingTitleStr(String str) =>
+ znPluginInstallingTitleStr.value = str;
+ void updateznPluginInstallingDesStr(String str) =>
+ znPluginInstallingDesStr.value = str;
+ void updatezninstallAPluginTitleStr(String str) =>
+ zninstallAPluginTitleStr.value = str;
+ void updatezninstallAPluginDesStr(String str) =>
+ zninstallAPluginDesStr.value = str;
+ void updaterestoreProfileTitleStr(String str) =>
+ restoreProfileTitleStr.value = str;
+ void updaterestoreProfileDesStr(String str) =>
+ restoreProfileDesStr.value = str;
+ void updaterestoreProfileDes1Str(String str) =>
+ restoreProfileDesStr.value = str;
+ void updateexistingProfileTitleStr(String str) =>
+ existingProfileTitleStr.value = str;
+ void updatecreateNewProfileStr(String str) => createNewProfileStr.value = str;
+ void updateimportProfileStr(String str) => importProfileStr.value = str;
+ void updatebackupProfileStr(String str) => backupProfileStr.value = str;
+ void updateopenPluginManagerStr(String str) =>
+ openPluginManagerStr.value = str;
+ void updateloadPluginStr(String str) => loadPluginStr.value = str;
+ void updatezerohelloSiteDesStr(String str) => zerohelloSiteDesStr.value = str;
+ void updatezeronetMobileSiteDesStr(String str) =>
+ zeronetMobileSiteDesStr.value = str;
+ void updatezeroTalkSiteDesStr(String str) => zeroTalkSiteDesStr.value = str;
+ void updatezeroblogSiteDesStr(String str) => zeroblogSiteDesStr.value = str;
+ void updatezeromailSiteDesStr(String str) => zeromailSiteDesStr.value = str;
+ void updatezeromeSiteDesStr(String str) => zeromeSiteDesStr.value = str;
+ void updatezeroSitesSiteDesStr(String str) => zeroSitesSiteDesStr.value = str;
+ void updatethemeSwitcherStr(String str) => themeSwitcherStr.value = str;
+ void updatethemeSwitcherDesStr(String str) => themeSwitcherDesStr.value = str;
+ void updatelanguageSwitcherStr(String str) => languageSwitcherStr.value = str;
+ void updatelanguageSwitcherDesStr(String str) =>
+ languageSwitcherDesStr.value = str;
+ void updateprofileSwitcherStr(String str) => profileSwitcherStr.value = str;
+ void updateprofileSwitcherDesStr(String str) =>
+ profileSwitcherDesStr.value = str;
+ void updatedebugZeroNetStr(String str) => debugZeroNetStr.value = str;
+ void updatedebugZeroNetDesStr(String str) => debugZeroNetDesStr.value = str;
+ void updateenableZeroNetConsoleStr(String str) =>
+ enableZeroNetConsoleStr.value = str;
+ void updateenableZeroNetConsoleDesStr(String str) =>
+ enableZeroNetConsoleDesStr.value = str;
+ void updateenableZeroNetFiltersStr(String str) =>
+ enableZeroNetFiltersStr.value = str;
+ void updateenableZeroNetFiltersDesStr(String str) =>
+ enableZeroNetFiltersDesStr.value = str;
+ void updateenableAdditionalTrackersStr(String str) =>
+ enableAdditionalTrackersStr.value = str;
+ void updateenableAdditionalTrackersDesStr(String str) =>
+ enableAdditionalTrackersDesStr.value = str;
+ void updatepluginManagerStr(String str) => pluginManagerStr.value = str;
+ void updatepluginManagerDesStr(String str) => pluginManagerDesStr.value = str;
+ void updatevibrateOnZeroNetStartStr(String str) =>
+ vibrateOnZeroNetStartStr.value = str;
+ void updatevibrateOnZeroNetStartDesStr(String str) =>
+ vibrateOnZeroNetStartDesStr.value = str;
+ void updateenableFullScreenOnWebViewStr(String str) =>
+ enableFullScreenOnWebViewStr.value = str;
+ void updateenableFullScreenOnWebViewDesStr(String str) =>
+ enableFullScreenOnWebViewDesStr.value = str;
+ void updatebatteryOptimisationStr(String str) =>
+ batteryOptimisationStr.value = str;
+ void updatebatteryOptimisationDesStr(String str) =>
+ batteryOptimisationDesStr.value = str;
+ void updatepublicDataFolderStr(String str) => publicDataFolderStr.value = str;
+ void updatepublicDataFolderDesStr(String str) =>
+ publicDataFolderDesStr.value = str;
+ void updateautoStartZeroNetStr(String str) => autoStartZeroNetStr.value = str;
+ void updateautoStartZeroNetDesStr(String str) =>
+ autoStartZeroNetDesStr.value = str;
+ void updateautoStartZeroNetonBootStr(String str) =>
+ autoStartZeroNetonBootStr.value = str;
+ void updateautoStartZeroNetonBootDesStr(String str) =>
+ autoStartZeroNetonBootDesStr.value = str;
+ void updateenableTorLogStr(String str) => enableTorLogStr.value = str;
+ void updateenableTorLogDesStr(String str) => enableTorLogDesStr.value = str;
+
+ void loadTranslationsFromFile(String path) {
+ File translationsFile = File(path);
+ String readAsStringSync = '';
+ try {
+ readAsStringSync = translationsFile.readAsStringSync();
+ } catch (e) {
+ if (e is FileSystemException) return;
+ }
+ Map map = json.decode(readAsStringSync);
+ updatestatusStr(map['statusStr']);
+ updateUserStatusStr(map['userStatusStr']);
+ updateUserNameNotCreatedStr(map['userNameNotCreatedStr']);
+ updateCreateUserIdFirstStr(map['createUserIdFirstStr']);
+ updatestatusNotRunningStr(map['statusNotRunningStr']);
+ updatestatusInitializingStr(map['statusInitializingStr']);
+ updatestatusStartingStr(map['statusStartingStr']);
+ updatestatusRunningStr(map['statusRunningStr']);
+ updatestatusRunningWithTorStr(map['statusRunningWithTorStr']);
+ updatestatusErrorStr(map['statusErrorStr']);
+ updatepopularSitesStr(map['popularSitesStr']);
+ updatestartZeroNetFirstStr(map['startZeroNetFirstStr']);
+ updatecreateStr(map['createStr']);
+ updateopenStr(map['openStr']);
+ updatedownloadStr(map['downloadStr']);
+ updateaddToHomeScreenStr(map['addToHomeScreenStr']);
+ updateshowLogStr(map['showLogStr']);
+ updatepauseStr(map['pauseStr']);
+ updateresumeStr(map['resumeStr']);
+ updatedeleteZiteStr(map['deleteZiteStr']);
+ updateshrtAddedToHomeScreenStr(map['shrtAddedToHomeScreenStr']);
+ updatestartStr(map['startStr']);
+ updaterestartStr(map['restartStr']);
+ updatepleaseWaitStr(map['pleaseWaitStr']);
+ updatestopStr(map['stopStr']);
+ updatecloseStr(map['closeStr']);
+ updateviewLogStr(map['viewLogStr']);
+ updateaboutStr(map['aboutStr']);
+ updatesettingsStr(map['settingsStr']);
+ updatebrowserStr(map['browserStr']);
+ updatelogStr(map['logStr']);
+ updateupdateStr(map['updateStr']);
+ updatedownloadingStr(map['downloadingStr']);
+ updatedownloadedStr(map['downloadedStr']);
+ updateinstallStr(map['installStr']);
+ updaterestoreStr(map['restoreStr']);
+ updateinstallingStr(map['installingStr']);
+ updateinstallationCompletedStr(map['installationCompletedStr']);
+ updatenotAvaliableStr(map['notAvaliableStr']);
+ updateaboutAppDesStr(map['aboutAppDesStr']);
+ updateaboutAppDes1Str(map['aboutAppDes1Str']);
+ updatedevelopersStr(map['developersStr']);
+ updatedonationAddrsStr(map['donationAddrsStr']);
+ updateclickAddrToCopyStr(map['clickAddrToCopyStr']);
+ updatedonAddrCopiedStr(map['donAddrCopiedStr']);
+ updatedonationDes(map['donationDes']);
+ updatecontributeStr(map['contributeStr']);
+ updatecontributeDesStr(map['contributeDesStr']);
+ updategooglePurchasesStr(map['googlePurchasesStr']);
+ updategoogleFeeWarningStr(map['googleFeeWarningStr']);
+ updateoneTimeSubStr(map['oneTimeSubStr']);
+ updatemonthlySubStr(map['monthlySubStr']);
+ updatetipStr(map['tipStr']);
+ updatecoffeeStr(map['coffeeStr']);
+ updatelunchStr(map['lunchStr']);
+ updateusersFileCopied(map['usersFileCopied']);
+ updatechkBckUpStr(map['chkBckUpStr']);
+ updatezeroNetNotInitTitleStr(map['zeroNetNotInitTitleStr']);
+ updatezeroNetNotInitDesStr(map['zeroNetNotInitDesStr']);
+ updateloadingStr(map['loadingStr']);
+ updateswitchProfileToStr(map['switchProfileToStr']);
+ updateswitchProfileToDesStr(map['switchProfileToDesStr']);
+ updatebackupStr(map['backupStr']);
+ updateswitchStr(map['switchStr']);
+ updateloadingPageWarningStr(map['loadingPageWarningStr']);
+ updateappUpdateAvailableStr(map['appUpdateAvailableStr']);
+ updateknowMoreStr(map['knowMoreStr']);
+ updateratingWgtStr(map['ratingWgtStr']);
+ updatesiteInfoStr(map['siteInfoStr']);
+ updatebackupWarningStr(map['backupWarningStr']);
+ updateusernameStr(map['usernameStr']);
+ updateusernamePhraseStr(map['usernamePhraseStr']);
+ updateusrnameWarning1Str(map['usrnameWarning1Str']);
+ updateusrnameWarning2Str(map['usrnameWarning2Str']);
+ updateusrnameWarning3Str(map['usrnameWarning3Str']);
+ updateusrnameWarning4Str(map['usrnameWarning4Str']);
+ updateznNotiRunningTitleStr(map['znNotiRunningTitleStr']);
+ updateznNotiRunningDesStr(map['znNotiRunningDesStr']);
+ updateznNotiNotRunningTitleStr(map['znNotiNotRunningTitleStr']);
+ updateznNotiNotRunningDesStr(map['znNotiNotRunningDesStr']);
+ updateznPluginInstallingTitleStr(map['znPluginInstallingTitleStr']);
+ updateznPluginInstallingDesStr(map['znPluginInstallingDesStr']);
+ updatezninstallAPluginTitleStr(map['zninstallAPluginTitleStr']);
+ updatezninstallAPluginDesStr(map['zninstallAPluginDesStr']);
+ updaterestoreProfileTitleStr(map['restoreProfileTitleStr']);
+ updaterestoreProfileDesStr(map['restoreProfileDesStr']);
+ updaterestoreProfileDes1Str(map['restoreProfileDes1Str']);
+ updateexistingProfileTitleStr(map['existingProfileTitleStr']);
+ updatecreateNewProfileStr(map['createNewProfileStr']);
+ updateimportProfileStr(map['importProfileStr']);
+ updatebackupProfileStr(map['backupProfileStr']);
+ updateopenPluginManagerStr(map['openPluginManagerStr']);
+ updateloadPluginStr(map['loadPluginStr']);
+ updatezerohelloSiteDesStr(map['zerohelloSiteDesStr']);
+ updatezeronetMobileSiteDesStr(map['zeronetMobileSiteDesStr']);
+ updatezeroTalkSiteDesStr(map['zeroTalkSiteDesStr']);
+ updatezeroblogSiteDesStr(map['zeroblogSiteDesStr']);
+ updatezeromailSiteDesStr(map['zeromailSiteDesStr']);
+ updatezeromeSiteDesStr(map['zeromeSiteDesStr']);
+ updatezeroSitesSiteDesStr(map['zeroSitesSiteDesStr']);
+ updatethemeSwitcherStr(map['themeSwitcherStr']);
+ updatethemeSwitcherDesStr(map['themeSwitcherDesStr']);
+ updatelanguageSwitcherStr(map['languageSwitcherStr']);
+ updatelanguageSwitcherDesStr(map['languageSwitcherDesStr']);
+ updateprofileSwitcherStr(map['profileSwitcherStr']);
+ updateprofileSwitcherDesStr(map['profileSwitcherDesStr']);
+ updatedebugZeroNetStr(map['debugZeroNetStr']);
+ updatedebugZeroNetDesStr(map['debugZeroNetDesStr']);
+ updateenableZeroNetConsoleStr(map['enableZeroNetConsoleStr']);
+ updateenableZeroNetConsoleDesStr(map['enableZeroNetConsoleDesStr']);
+ updateenableZeroNetFiltersStr(map['enableZeroNetFiltersStr']);
+ updateenableZeroNetFiltersDesStr(map['enableZeroNetFiltersDesStr']);
+ updateenableAdditionalTrackersStr(map['enableAdditionalTrackersStr']);
+ updateenableAdditionalTrackersDesStr(map['enableAdditionalTrackersDesStr']);
+ updatepluginManagerStr(map['pluginManagerStr']);
+ updatepluginManagerDesStr(map['pluginManagerDesStr']);
+ updatevibrateOnZeroNetStartStr(map['vibrateOnZeroNetStartStr']);
+ updatevibrateOnZeroNetStartDesStr(map['vibrateOnZeroNetStartDesStr']);
+ updateenableFullScreenOnWebViewStr(map['enableFullScreenOnWebViewStr']);
+ updateenableFullScreenOnWebViewDesStr(
+ map['enableFullScreenOnWebViewDesStr']);
+ updatebatteryOptimisationStr(map['batteryOptimisationStr']);
+ updatebatteryOptimisationDesStr(map['batteryOptimisationDesStr']);
+ updatepublicDataFolderStr(map['publicDataFolderStr']);
+ updatepublicDataFolderDesStr(map['publicDataFolderDesStr']);
+ updateautoStartZeroNetStr(map['autoStartZeroNetStr']);
+ updateautoStartZeroNetDesStr(map['autoStartZeroNetDesStr']);
+ updateautoStartZeroNetonBootStr(map['autoStartZeroNetonBootStr']);
+ updateautoStartZeroNetonBootDesStr(map['autoStartZeroNetonBootDesStr']);
+ updateenableTorLogStr(map['enableTorLogStr']);
+ updateenableTorLogDesStr(map['enableTorLogDesStr']);
+ }
+}
diff --git a/lib/controllers/uicontroller.dart b/lib/controllers/uicontroller.dart
new file mode 100644
index 0000000..6361238
--- /dev/null
+++ b/lib/controllers/uicontroller.dart
@@ -0,0 +1,68 @@
+import '../imports.dart';
+
+final uiStore = Get.put(UiController());
+
+class UiController extends GetxController {
+ PersistentBottomSheetController currentBottomSheetController;
+
+ var appUpdate = AppUpdate.NOT_AVAILABLE.obs;
+
+ void updateInAppUpdateAvailable(AppUpdate available) =>
+ appUpdate.value = available;
+
+ var showSnackReply = false.obs;
+
+ void updateShowSnackReply(bool show) {
+ showSnackReply.value = show;
+ }
+
+ var reload = 0.obs;
+
+ void updateReload(int i) {
+ reload.value = i;
+ }
+
+ var currentSiteInfo = SiteInfo().obs;
+
+ void updateCurrentSiteInfo(SiteInfo siteInfo) {
+ currentSiteInfo.update((val) {
+ val.address = siteInfo.address;
+ val.peers = siteInfo.peers;
+ val.size = siteInfo.size;
+ val.files = siteInfo.files;
+ val.serving = siteInfo.serving;
+ val.siteAdded = siteInfo.siteAdded;
+ val.siteModified = siteInfo.siteModified;
+ val.siteCodeUpdated = siteInfo.siteCodeUpdated;
+ });
+ }
+
+ var currentAppRoute = AppRoute.Home.obs;
+
+ void updateCurrentAppRoute(AppRoute appRoute) =>
+ currentAppRoute.value = appRoute;
+
+ var currentTheme = AppTheme.Light.obs;
+
+ void setTheme(AppTheme theme) {
+ currentTheme.value = theme;
+ }
+
+ var zeroNetStatus = ZeroNetStatus.NOT_RUNNING.obs;
+
+ void setZeroNetStatus(ZeroNetStatus status) {
+ zeroNetStatus.value = status;
+ }
+
+ var zeroNetUserStatus = ZeroNetUserStatus.NOT_REGISTERED.obs;
+
+ void setZeroNetUserStatus(ZeroNetUserStatus status) {
+ zeroNetUserStatus.value = status;
+ }
+
+ var zeroNetUserId = ''.obs;
+
+ void setZeroNetUserId(String id) {
+ zeroNetUserId.value = id;
+ }
+}
diff --git a/lib/controllers/varcontroller.dart b/lib/controllers/varcontroller.dart
new file mode 100644
index 0000000..040ad6a
--- /dev/null
+++ b/lib/controllers/varcontroller.dart
@@ -0,0 +1,49 @@
+import '../imports.dart';
+
+final varStore = Get.put(VarController());
+
+class VarController extends GetxController {
+ var zeroNetWrapperKey = '';
+ var settings = {}.obs;
+ var event = ObservableEvent.none.obs;
+ var zeroNetLog = 'ZeroNet Mobile'.obs;
+ RxString zeroNetStatus = strController.statusNotRunningStr;
+ var zeroNetInstalled = false.obs;
+ var zeroNetDownloaded = false.obs;
+ RxString loadingStatus = strController.loadingStr;
+ var loadingPercent = 0.obs;
+
+ void updateSetting(Setting setting) {
+ settings[setting.name] = setting;
+ }
+
+ void setObservableEvent(ObservableEvent eve) {
+ event.value = eve;
+ }
+
+ void setZeroNetLog(String status) {
+ zeroNetLog.value = status;
+ }
+
+ void setZeroNetStatus(String status) {
+ zeroNetStatus.value = status;
+ }
+
+ void isZeroNetInstalled(bool installed) {
+ zeroNetInstalled.value = installed;
+ }
+
+ void isZeroNetDownloaded(bool downloaded) {
+ zeroNetDownloaded.value = downloaded;
+ }
+
+ void setLoadingStatus(String status) {
+ loadingStatus.value = status;
+ }
+
+ void setLoadingPercent(int percent) {
+ loadingPercent.value = percent;
+ }
+}
+
+enum ObservableEvent { none, downloding, downloaded, installing, installed }
diff --git a/lib/core/content/content_db.dart b/lib/core/content/content_db.dart
new file mode 100644
index 0000000..af14519
--- /dev/null
+++ b/lib/core/content/content_db.dart
@@ -0,0 +1,32 @@
+class ContentDb {
+ bool foreignKeys = false;
+ Map schema = {};
+
+ ContentDb(String path) {
+ // Db({"db_name": "ContentDb", "tables": {}}, path);
+ foreignKeys = true;
+ }
+
+ getSchema() {
+ Map scehma = {};
+ scehma['db_name'] = 'ContentDb';
+ schema["version"] = 3;
+ schema["tables"] = {};
+ }
+}
+
+Map contentDb = {};
+
+getContentDb({String path}) {
+ if (path == null) {
+ path = "../content.db";
+ }
+
+ var result = contentDb.keys.where((element) => path == element).toList();
+
+ if (result.isEmpty) {
+ contentDb[path] = ContentDb(path);
+ contentDb[path].init();
+ return contentDb[path];
+ }
+}
diff --git a/lib/extensions.dart b/lib/extensions.dart
deleted file mode 100644
index 1c93650..0000000
--- a/lib/extensions.dart
+++ /dev/null
@@ -1,5 +0,0 @@
-import 'dart:io';
-
-extension FileSystemExtension on FileSystemEntity {
- String name() => this.path.replaceFirst(this.parent.path + '/', '');
-}
diff --git a/lib/imports.dart b/lib/imports.dart
index b9e90d2..0814a8e 100644
--- a/lib/imports.dart
+++ b/lib/imports.dart
@@ -12,16 +12,16 @@ export 'package:flutter/services.dart';
export 'package:clipboard/clipboard.dart';
export 'package:crypto/crypto.dart';
export 'package:device_info/device_info.dart';
+export 'package:diff_match_patch/diff_match_patch.dart';
export 'package:equatable/equatable.dart';
export 'package:file_picker/file_picker.dart';
export 'package:flutter_absolute_path/flutter_absolute_path.dart';
export 'package:flutter_background_service/flutter_background_service.dart';
export 'package:flutter_downloader/flutter_downloader.dart';
-export 'package:flutter_mobx/flutter_mobx.dart';
export 'package:flutter_webview_plugin/flutter_webview_plugin.dart';
+export 'package:get/get.dart' hide HeaderValue, MultipartFile, Response;
export 'package:google_fonts/google_fonts.dart';
export 'package:http/http.dart';
-export 'package:in_app_purchase/in_app_purchase.dart';
export 'package:in_app_review/in_app_review.dart';
export 'package:in_app_update/in_app_update.dart';
export 'package:outline_material_icons/outline_material_icons.dart';
@@ -32,15 +32,16 @@ export 'package:share/share.dart';
export 'package:url_launcher/url_launcher.dart';
export 'package:zeronet_ws/zeronet_ws.dart';
+export 'controllers/varcontroller.dart';
+export 'controllers/uicontroller.dart';
+export 'controllers/purchasescontroller.dart';
+export 'controllers/stringcontroller.dart';
export 'core/site/site.dart';
export 'core/site/site_manager.dart';
export 'core/user/user.dart';
export 'core/user/user_manager.dart';
export 'models/enums.dart';
export 'models/models.dart';
-export 'mobx/uistore.dart';
-export 'mobx/varstore.dart';
-export 'mobx/purchasesstore.dart';
export 'others/common.dart';
export 'others/constants.dart';
export 'others/donation_const.dart';
diff --git a/lib/main.dart b/lib/main.dart
index f6e95f7..f76751b 100644
--- a/lib/main.dart
+++ b/lib/main.dart
@@ -4,12 +4,6 @@ import 'imports.dart';
Future main() async {
WidgetsFlutterBinding.ensureInitialized();
await init();
- if (kEnableInAppPurchases) {
- InAppPurchaseConnection.enablePendingPurchases();
- final Stream purchaseUpdates =
- InAppPurchaseConnection.instance.purchaseUpdatedStream;
- purchaseUpdates.listen((purchases) => listenToPurchaseUpdated(purchases));
- }
launchUrl = await launchZiteUrl();
runApp(MyApp());
}
@@ -17,15 +11,7 @@ Future main() async {
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
- SystemChrome.setSystemUIOverlayStyle(
- SystemUiOverlayStyle(
- statusBarColor: Colors.transparent,
- systemNavigationBarColor: Colors.white,
- statusBarIconBrightness: Brightness.dark,
- systemNavigationBarIconBrightness: Brightness.dark,
- ),
- );
- return MaterialApp(
+ return GetMaterialApp(
title: 'ZeroNet Mobile',
theme: ThemeData(
primarySwatch: Colors.indigo,
@@ -33,22 +19,29 @@ class MyApp extends StatelessWidget {
),
debugShowCheckedModeBanner: false,
home: Scaffold(
- body: Observer(
- builder: (context) {
- if (varStore.zeroNetInstalled) {
- scaffoldState = Scaffold.of(context);
+ body: Obx(
+ () {
+ setSystemUiTheme();
+ if (varStore.zeroNetInstalled.value) {
if (firstTime) {
- SystemChrome.setEnabledSystemUIOverlays(SystemUiOverlay.values);
+ SystemChrome.setEnabledSystemUIMode(
+ SystemUiMode.manual,
+ overlays: [
+ SystemUiOverlay.top,
+ SystemUiOverlay.bottom,
+ ],
+ );
activateFilters();
uiStore.updateCurrentAppRoute(AppRoute.Settings);
if (!isExecPermitted)
makeExecHelper().then(
(value) => isExecPermitted = value,
);
+ if (zeroNetNativeDir.isNotEmpty) saveDataFile();
// createTorDataDir();
firstTime = false;
}
- if (uiStore.zeroNetStatus == ZeroNetStatus.NOT_RUNNING &&
+ if (uiStore.zeroNetStatus.value == ZeroNetStatus.NOT_RUNNING &&
!manuallyStoppedZeroNet) {
checkInitStatus();
}
@@ -57,18 +50,28 @@ class MyApp extends StatelessWidget {
? "http://127.0.0.1:43110/"
: zeroNetUrl) +
launchUrl;
- if (uiStore.zeroNetStatus == ZeroNetStatus.RUNNING) {
+ if (uiStore.zeroNetStatus.value == ZeroNetStatus.RUNNING) {
uiStore.updateCurrentAppRoute(AppRoute.ZeroBrowser);
} else
uiStore.updateCurrentAppRoute(AppRoute.ShortcutLoadingPage);
}
- return Observer(
- builder: (ctx) {
- switch (uiStore.currentAppRoute) {
+ return Obx(
+ () {
+ setSystemUiTheme();
+ switch (uiStore.currentAppRoute.value) {
case AppRoute.AboutPage:
return WillPopScope(
onWillPop: () {
- uiStore.updateCurrentAppRoute(AppRoute.Home);
+ if (fromBrowser) {
+ fromBrowser = false;
+ flutterWebViewPlugin.canGoBack().then(
+ (value) => value
+ ? flutterWebViewPlugin.goBack()
+ : null,
+ );
+ uiStore.updateCurrentAppRoute(AppRoute.ZeroBrowser);
+ } else
+ uiStore.updateCurrentAppRoute(AppRoute.Home);
return Future.value(false);
},
child: AboutPage(),
diff --git a/lib/mobx/purchasesstore.g.dart b/lib/mobx/purchasesstore.g.dart
deleted file mode 100644
index 2de7de3..0000000
--- a/lib/mobx/purchasesstore.g.dart
+++ /dev/null
@@ -1,123 +0,0 @@
-// GENERATED CODE - DO NOT MODIFY BY HAND
-
-part of 'purchasesstore.dart';
-
-// **************************************************************************
-// StoreGenerator
-// **************************************************************************
-
-// ignore_for_file: non_constant_identifier_names, unnecessary_lambdas, prefer_expression_function_bodies, lines_longer_than_80_chars, avoid_as, avoid_annotating_with_dynamic
-
-mixin _$PurchasesStore on _PurchasesStore, Store {
- final _$oneTimePurchasesAtom = Atom(name: '_PurchasesStore.oneTimePurchases');
-
- @override
- ObservableList get oneTimePurchases {
- _$oneTimePurchasesAtom.context.enforceReadPolicy(_$oneTimePurchasesAtom);
- _$oneTimePurchasesAtom.reportObserved();
- return super.oneTimePurchases;
- }
-
- @override
- set oneTimePurchases(ObservableList value) {
- _$oneTimePurchasesAtom.context.conditionallyRunInAction(() {
- super.oneTimePurchases = value;
- _$oneTimePurchasesAtom.reportChanged();
- }, _$oneTimePurchasesAtom, name: '${_$oneTimePurchasesAtom.name}_set');
- }
-
- final _$subscriptionsAtom = Atom(name: '_PurchasesStore.subscriptions');
-
- @override
- ObservableList get subscriptions {
- _$subscriptionsAtom.context.enforceReadPolicy(_$subscriptionsAtom);
- _$subscriptionsAtom.reportObserved();
- return super.subscriptions;
- }
-
- @override
- set subscriptions(ObservableList value) {
- _$subscriptionsAtom.context.conditionallyRunInAction(() {
- super.subscriptions = value;
- _$subscriptionsAtom.reportChanged();
- }, _$subscriptionsAtom, name: '${_$subscriptionsAtom.name}_set');
- }
-
- final _$purchasesAtom = Atom(name: '_PurchasesStore.purchases');
-
- @override
- ObservableList get purchases {
- _$purchasesAtom.context.enforceReadPolicy(_$purchasesAtom);
- _$purchasesAtom.reportObserved();
- return super.purchases;
- }
-
- @override
- set purchases(ObservableList value) {
- _$purchasesAtom.context.conditionallyRunInAction(() {
- super.purchases = value;
- _$purchasesAtom.reportChanged();
- }, _$purchasesAtom, name: '${_$purchasesAtom.name}_set');
- }
-
- final _$consumedPurchasesAtom =
- Atom(name: '_PurchasesStore.consumedPurchases');
-
- @override
- ObservableList get consumedPurchases {
- _$consumedPurchasesAtom.context.enforceReadPolicy(_$consumedPurchasesAtom);
- _$consumedPurchasesAtom.reportObserved();
- return super.consumedPurchases;
- }
-
- @override
- set consumedPurchases(ObservableList value) {
- _$consumedPurchasesAtom.context.conditionallyRunInAction(() {
- super.consumedPurchases = value;
- _$consumedPurchasesAtom.reportChanged();
- }, _$consumedPurchasesAtom, name: '${_$consumedPurchasesAtom.name}_set');
- }
-
- final _$_PurchasesStoreActionController =
- ActionController(name: '_PurchasesStore');
-
- @override
- void addOneTimePuchases(List details) {
- final _$actionInfo = _$_PurchasesStoreActionController.startAction();
- try {
- return super.addOneTimePuchases(details);
- } finally {
- _$_PurchasesStoreActionController.endAction(_$actionInfo);
- }
- }
-
- @override
- void addSubscriptions(List details) {
- final _$actionInfo = _$_PurchasesStoreActionController.startAction();
- try {
- return super.addSubscriptions(details);
- } finally {
- _$_PurchasesStoreActionController.endAction(_$actionInfo);
- }
- }
-
- @override
- void addPurchases(String purchaseIds) {
- final _$actionInfo = _$_PurchasesStoreActionController.startAction();
- try {
- return super.addPurchases(purchaseIds);
- } finally {
- _$_PurchasesStoreActionController.endAction(_$actionInfo);
- }
- }
-
- @override
- void addConsumedPurchases(String purchaseIds) {
- final _$actionInfo = _$_PurchasesStoreActionController.startAction();
- try {
- return super.addConsumedPurchases(purchaseIds);
- } finally {
- _$_PurchasesStoreActionController.endAction(_$actionInfo);
- }
- }
-}
diff --git a/lib/mobx/uistore.dart b/lib/mobx/uistore.dart
deleted file mode 100644
index 235a850..0000000
--- a/lib/mobx/uistore.dart
+++ /dev/null
@@ -1,68 +0,0 @@
-import 'package:mobx/mobx.dart';
-
-import '../imports.dart';
-
-// Include generated file
-part 'uistore.g.dart';
-
-// This is the class used by rest of your codebase
-final uiStore = UiStore();
-
-class UiStore = _UiStore with _$UiStore;
-
-// The store-class
-abstract class _UiStore with Store {
- PersistentBottomSheetController currentBottomSheetController;
-
- @observable
- AppUpdate appUpdate = AppUpdate.NOT_AVAILABLE;
-
- @action
- void updateInAppUpdateAvailable(AppUpdate available) => appUpdate = available;
-
- @observable
- bool showSnackReply = false;
-
- @action
- void updateShowSnackReply(bool show) {
- showSnackReply = show;
- }
-
- @observable
- int reload = 0;
-
- @action
- void updateReload(int i) {
- reload = i;
- }
-
- @observable
- SiteInfo currentSiteInfo = SiteInfo();
-
- @action
- void updateCurrentSiteInfo(SiteInfo siteInfo) {
- currentSiteInfo = siteInfo;
- }
-
- @observable
- AppRoute currentAppRoute = AppRoute.Home;
-
- @action
- void updateCurrentAppRoute(AppRoute appRoute) => currentAppRoute = appRoute;
-
- @observable
- AppTheme currentTheme = AppTheme.Light;
-
- @action
- void setTheme(AppTheme theme) {
- currentTheme = theme;
- }
-
- @observable
- ZeroNetStatus zeroNetStatus = ZeroNetStatus.NOT_RUNNING;
-
- @action
- void setZeroNetStatus(ZeroNetStatus status) {
- zeroNetStatus = status;
- }
-}
diff --git a/lib/mobx/uistore.g.dart b/lib/mobx/uistore.g.dart
deleted file mode 100644
index 0f00961..0000000
--- a/lib/mobx/uistore.g.dart
+++ /dev/null
@@ -1,202 +0,0 @@
-// GENERATED CODE - DO NOT MODIFY BY HAND
-
-part of 'uistore.dart';
-
-// **************************************************************************
-// StoreGenerator
-// **************************************************************************
-
-// ignore_for_file: non_constant_identifier_names, unnecessary_lambdas, prefer_expression_function_bodies, lines_longer_than_80_chars, avoid_as, avoid_annotating_with_dynamic
-
-mixin _$UiStore on _UiStore, Store {
- final _$appUpdateAtom = Atom(name: '_UiStore.appUpdate');
-
- @override
- AppUpdate get appUpdate {
- _$appUpdateAtom.context.enforceReadPolicy(_$appUpdateAtom);
- _$appUpdateAtom.reportObserved();
- return super.appUpdate;
- }
-
- @override
- set appUpdate(AppUpdate value) {
- _$appUpdateAtom.context.conditionallyRunInAction(() {
- super.appUpdate = value;
- _$appUpdateAtom.reportChanged();
- }, _$appUpdateAtom, name: '${_$appUpdateAtom.name}_set');
- }
-
- final _$showSnackReplyAtom = Atom(name: '_UiStore.showSnackReply');
-
- @override
- bool get showSnackReply {
- _$showSnackReplyAtom.context.enforceReadPolicy(_$showSnackReplyAtom);
- _$showSnackReplyAtom.reportObserved();
- return super.showSnackReply;
- }
-
- @override
- set showSnackReply(bool value) {
- _$showSnackReplyAtom.context.conditionallyRunInAction(() {
- super.showSnackReply = value;
- _$showSnackReplyAtom.reportChanged();
- }, _$showSnackReplyAtom, name: '${_$showSnackReplyAtom.name}_set');
- }
-
- final _$reloadAtom = Atom(name: '_UiStore.reload');
-
- @override
- int get reload {
- _$reloadAtom.context.enforceReadPolicy(_$reloadAtom);
- _$reloadAtom.reportObserved();
- return super.reload;
- }
-
- @override
- set reload(int value) {
- _$reloadAtom.context.conditionallyRunInAction(() {
- super.reload = value;
- _$reloadAtom.reportChanged();
- }, _$reloadAtom, name: '${_$reloadAtom.name}_set');
- }
-
- final _$currentSiteInfoAtom = Atom(name: '_UiStore.currentSiteInfo');
-
- @override
- SiteInfo get currentSiteInfo {
- _$currentSiteInfoAtom.context.enforceReadPolicy(_$currentSiteInfoAtom);
- _$currentSiteInfoAtom.reportObserved();
- return super.currentSiteInfo;
- }
-
- @override
- set currentSiteInfo(SiteInfo value) {
- _$currentSiteInfoAtom.context.conditionallyRunInAction(() {
- super.currentSiteInfo = value;
- _$currentSiteInfoAtom.reportChanged();
- }, _$currentSiteInfoAtom, name: '${_$currentSiteInfoAtom.name}_set');
- }
-
- final _$currentAppRouteAtom = Atom(name: '_UiStore.currentAppRoute');
-
- @override
- AppRoute get currentAppRoute {
- _$currentAppRouteAtom.context.enforceReadPolicy(_$currentAppRouteAtom);
- _$currentAppRouteAtom.reportObserved();
- return super.currentAppRoute;
- }
-
- @override
- set currentAppRoute(AppRoute value) {
- _$currentAppRouteAtom.context.conditionallyRunInAction(() {
- super.currentAppRoute = value;
- _$currentAppRouteAtom.reportChanged();
- }, _$currentAppRouteAtom, name: '${_$currentAppRouteAtom.name}_set');
- }
-
- final _$currentThemeAtom = Atom(name: '_UiStore.currentTheme');
-
- @override
- AppTheme get currentTheme {
- _$currentThemeAtom.context.enforceReadPolicy(_$currentThemeAtom);
- _$currentThemeAtom.reportObserved();
- return super.currentTheme;
- }
-
- @override
- set currentTheme(AppTheme value) {
- _$currentThemeAtom.context.conditionallyRunInAction(() {
- super.currentTheme = value;
- _$currentThemeAtom.reportChanged();
- }, _$currentThemeAtom, name: '${_$currentThemeAtom.name}_set');
- }
-
- final _$zeroNetStatusAtom = Atom(name: '_UiStore.zeroNetStatus');
-
- @override
- ZeroNetStatus get zeroNetStatus {
- _$zeroNetStatusAtom.context.enforceReadPolicy(_$zeroNetStatusAtom);
- _$zeroNetStatusAtom.reportObserved();
- return super.zeroNetStatus;
- }
-
- @override
- set zeroNetStatus(ZeroNetStatus value) {
- _$zeroNetStatusAtom.context.conditionallyRunInAction(() {
- super.zeroNetStatus = value;
- _$zeroNetStatusAtom.reportChanged();
- }, _$zeroNetStatusAtom, name: '${_$zeroNetStatusAtom.name}_set');
- }
-
- final _$_UiStoreActionController = ActionController(name: '_UiStore');
-
- @override
- void updateInAppUpdateAvailable(AppUpdate available) {
- final _$actionInfo = _$_UiStoreActionController.startAction();
- try {
- return super.updateInAppUpdateAvailable(available);
- } finally {
- _$_UiStoreActionController.endAction(_$actionInfo);
- }
- }
-
- @override
- void updateShowSnackReply(bool show) {
- final _$actionInfo = _$_UiStoreActionController.startAction();
- try {
- return super.updateShowSnackReply(show);
- } finally {
- _$_UiStoreActionController.endAction(_$actionInfo);
- }
- }
-
- @override
- void updateReload(int i) {
- final _$actionInfo = _$_UiStoreActionController.startAction();
- try {
- return super.updateReload(i);
- } finally {
- _$_UiStoreActionController.endAction(_$actionInfo);
- }
- }
-
- @override
- void updateCurrentSiteInfo(SiteInfo siteInfo) {
- final _$actionInfo = _$_UiStoreActionController.startAction();
- try {
- return super.updateCurrentSiteInfo(siteInfo);
- } finally {
- _$_UiStoreActionController.endAction(_$actionInfo);
- }
- }
-
- @override
- void updateCurrentAppRoute(AppRoute appRoute) {
- final _$actionInfo = _$_UiStoreActionController.startAction();
- try {
- return super.updateCurrentAppRoute(appRoute);
- } finally {
- _$_UiStoreActionController.endAction(_$actionInfo);
- }
- }
-
- @override
- void setTheme(AppTheme theme) {
- final _$actionInfo = _$_UiStoreActionController.startAction();
- try {
- return super.setTheme(theme);
- } finally {
- _$_UiStoreActionController.endAction(_$actionInfo);
- }
- }
-
- @override
- void setZeroNetStatus(ZeroNetStatus status) {
- final _$actionInfo = _$_UiStoreActionController.startAction();
- try {
- return super.setZeroNetStatus(status);
- } finally {
- _$_UiStoreActionController.endAction(_$actionInfo);
- }
- }
-}
diff --git a/lib/mobx/varstore.dart b/lib/mobx/varstore.dart
deleted file mode 100644
index 94a6625..0000000
--- a/lib/mobx/varstore.dart
+++ /dev/null
@@ -1,93 +0,0 @@
-import 'package:mobx/mobx.dart';
-import 'package:zeronet/models/models.dart';
-
-// Include generated file
-part 'varstore.g.dart';
-
-// This is the class used by rest of your codebase
-final varStore = VarStore();
-
-class VarStore = _VarStore with _$VarStore;
-
-// The store-class
-abstract class _VarStore with Store {
- String zeroNetWrapperKey = '';
-
- @observable
- ObservableMap settings = ObservableMap();
-
- @action
- void updateSetting(Setting setting) {
- settings.update(setting.name, (sett) {
- return sett;
- }, ifAbsent: () {
- return setting;
- });
- }
-
- @observable
- ObservableEvent event;
-
- @action
- void setObservableEvent(ObservableEvent eve) {
- event = eve;
- }
-
- @observable
- String zeroNetLog = 'ZeroNet Mobile';
-
- @action
- void setZeroNetLog(String status) {
- zeroNetLog = status;
- }
-
- @observable
- String zeroNetAppbarStatus = 'ZeroNet Mobile';
-
- @action
- void setZeroNetAppbarStatus(String status) {
- zeroNetAppbarStatus = status;
- }
-
- @observable
- String zeroNetStatus = 'Not Running';
-
- @action
- void setZeroNetStatus(String status) {
- zeroNetStatus = status;
- }
-
- @observable
- bool zeroNetInstalled = false;
-
- @action
- void isZeroNetInstalled(bool installed) {
- zeroNetInstalled = installed;
- }
-
- @observable
- bool zeroNetDownloaded = false;
-
- @action
- void isZeroNetDownloaded(bool downloaded) {
- zeroNetDownloaded = downloaded;
- }
-
- @observable
- String loadingStatus = 'Loading';
-
- @action
- void setLoadingStatus(String status) {
- loadingStatus = status;
- }
-
- @observable
- int loadingPercent = 0;
-
- @action
- void setLoadingPercent(int percent) {
- loadingPercent = percent;
- }
-}
-
-enum ObservableEvent { none, downloding, downloaded, installing, installed }
diff --git a/lib/mobx/varstore.g.dart b/lib/mobx/varstore.g.dart
deleted file mode 100644
index 218caf3..0000000
--- a/lib/mobx/varstore.g.dart
+++ /dev/null
@@ -1,231 +0,0 @@
-// GENERATED CODE - DO NOT MODIFY BY HAND
-
-part of 'varstore.dart';
-
-// **************************************************************************
-// StoreGenerator
-// **************************************************************************
-
-// ignore_for_file: non_constant_identifier_names, unnecessary_lambdas, prefer_expression_function_bodies, lines_longer_than_80_chars, avoid_as, avoid_annotating_with_dynamic
-
-mixin _$VarStore on _VarStore, Store {
- final _$settingsAtom = Atom(name: '_VarStore.settings');
-
- @override
- ObservableMap get settings {
- _$settingsAtom.context.enforceReadPolicy(_$settingsAtom);
- _$settingsAtom.reportObserved();
- return super.settings;
- }
-
- @override
- set settings(ObservableMap value) {
- _$settingsAtom.context.conditionallyRunInAction(() {
- super.settings = value;
- _$settingsAtom.reportChanged();
- }, _$settingsAtom, name: '${_$settingsAtom.name}_set');
- }
-
- final _$eventAtom = Atom(name: '_VarStore.event');
-
- @override
- ObservableEvent get event {
- _$eventAtom.context.enforceReadPolicy(_$eventAtom);
- _$eventAtom.reportObserved();
- return super.event;
- }
-
- @override
- set event(ObservableEvent value) {
- _$eventAtom.context.conditionallyRunInAction(() {
- super.event = value;
- _$eventAtom.reportChanged();
- }, _$eventAtom, name: '${_$eventAtom.name}_set');
- }
-
- final _$zeroNetLogAtom = Atom(name: '_VarStore.zeroNetLog');
-
- @override
- String get zeroNetLog {
- _$zeroNetLogAtom.context.enforceReadPolicy(_$zeroNetLogAtom);
- _$zeroNetLogAtom.reportObserved();
- return super.zeroNetLog;
- }
-
- @override
- set zeroNetLog(String value) {
- _$zeroNetLogAtom.context.conditionallyRunInAction(() {
- super.zeroNetLog = value;
- _$zeroNetLogAtom.reportChanged();
- }, _$zeroNetLogAtom, name: '${_$zeroNetLogAtom.name}_set');
- }
-
- final _$zeroNetAppbarStatusAtom = Atom(name: '_VarStore.zeroNetAppbarStatus');
-
- @override
- String get zeroNetAppbarStatus {
- _$zeroNetAppbarStatusAtom.context
- .enforceReadPolicy(_$zeroNetAppbarStatusAtom);
- _$zeroNetAppbarStatusAtom.reportObserved();
- return super.zeroNetAppbarStatus;
- }
-
- @override
- set zeroNetAppbarStatus(String value) {
- _$zeroNetAppbarStatusAtom.context.conditionallyRunInAction(() {
- super.zeroNetAppbarStatus = value;
- _$zeroNetAppbarStatusAtom.reportChanged();
- }, _$zeroNetAppbarStatusAtom,
- name: '${_$zeroNetAppbarStatusAtom.name}_set');
- }
-
- final _$zeroNetInstalledAtom = Atom(name: '_VarStore.zeroNetInstalled');
-
- @override
- bool get zeroNetInstalled {
- _$zeroNetInstalledAtom.context.enforceReadPolicy(_$zeroNetInstalledAtom);
- _$zeroNetInstalledAtom.reportObserved();
- return super.zeroNetInstalled;
- }
-
- @override
- set zeroNetInstalled(bool value) {
- _$zeroNetInstalledAtom.context.conditionallyRunInAction(() {
- super.zeroNetInstalled = value;
- _$zeroNetInstalledAtom.reportChanged();
- }, _$zeroNetInstalledAtom, name: '${_$zeroNetInstalledAtom.name}_set');
- }
-
- final _$zeroNetDownloadedAtom = Atom(name: '_VarStore.zeroNetDownloaded');
-
- @override
- bool get zeroNetDownloaded {
- _$zeroNetDownloadedAtom.context.enforceReadPolicy(_$zeroNetDownloadedAtom);
- _$zeroNetDownloadedAtom.reportObserved();
- return super.zeroNetDownloaded;
- }
-
- @override
- set zeroNetDownloaded(bool value) {
- _$zeroNetDownloadedAtom.context.conditionallyRunInAction(() {
- super.zeroNetDownloaded = value;
- _$zeroNetDownloadedAtom.reportChanged();
- }, _$zeroNetDownloadedAtom, name: '${_$zeroNetDownloadedAtom.name}_set');
- }
-
- final _$loadingStatusAtom = Atom(name: '_VarStore.loadingStatus');
-
- @override
- String get loadingStatus {
- _$loadingStatusAtom.context.enforceReadPolicy(_$loadingStatusAtom);
- _$loadingStatusAtom.reportObserved();
- return super.loadingStatus;
- }
-
- @override
- set loadingStatus(String value) {
- _$loadingStatusAtom.context.conditionallyRunInAction(() {
- super.loadingStatus = value;
- _$loadingStatusAtom.reportChanged();
- }, _$loadingStatusAtom, name: '${_$loadingStatusAtom.name}_set');
- }
-
- final _$loadingPercentAtom = Atom(name: '_VarStore.loadingPercent');
-
- @override
- int get loadingPercent {
- _$loadingPercentAtom.context.enforceReadPolicy(_$loadingPercentAtom);
- _$loadingPercentAtom.reportObserved();
- return super.loadingPercent;
- }
-
- @override
- set loadingPercent(int value) {
- _$loadingPercentAtom.context.conditionallyRunInAction(() {
- super.loadingPercent = value;
- _$loadingPercentAtom.reportChanged();
- }, _$loadingPercentAtom, name: '${_$loadingPercentAtom.name}_set');
- }
-
- final _$_VarStoreActionController = ActionController(name: '_VarStore');
-
- @override
- void updateSetting(Setting setting) {
- final _$actionInfo = _$_VarStoreActionController.startAction();
- try {
- return super.updateSetting(setting);
- } finally {
- _$_VarStoreActionController.endAction(_$actionInfo);
- }
- }
-
- @override
- void setObservableEvent(ObservableEvent eve) {
- final _$actionInfo = _$_VarStoreActionController.startAction();
- try {
- return super.setObservableEvent(eve);
- } finally {
- _$_VarStoreActionController.endAction(_$actionInfo);
- }
- }
-
- @override
- void setZeroNetLog(String status) {
- final _$actionInfo = _$_VarStoreActionController.startAction();
- try {
- return super.setZeroNetLog(status);
- } finally {
- _$_VarStoreActionController.endAction(_$actionInfo);
- }
- }
-
- @override
- void setZeroNetAppbarStatus(String status) {
- final _$actionInfo = _$_VarStoreActionController.startAction();
- try {
- return super.setZeroNetAppbarStatus(status);
- } finally {
- _$_VarStoreActionController.endAction(_$actionInfo);
- }
- }
-
- @override
- void isZeroNetInstalled(bool installed) {
- final _$actionInfo = _$_VarStoreActionController.startAction();
- try {
- return super.isZeroNetInstalled(installed);
- } finally {
- _$_VarStoreActionController.endAction(_$actionInfo);
- }
- }
-
- @override
- void isZeroNetDownloaded(bool downloaded) {
- final _$actionInfo = _$_VarStoreActionController.startAction();
- try {
- return super.isZeroNetDownloaded(downloaded);
- } finally {
- _$_VarStoreActionController.endAction(_$actionInfo);
- }
- }
-
- @override
- void setLoadingStatus(String status) {
- final _$actionInfo = _$_VarStoreActionController.startAction();
- try {
- return super.setLoadingStatus(status);
- } finally {
- _$_VarStoreActionController.endAction(_$actionInfo);
- }
- }
-
- @override
- void setLoadingPercent(int percent) {
- final _$actionInfo = _$_VarStoreActionController.startAction();
- try {
- return super.setLoadingPercent(percent);
- } finally {
- _$_VarStoreActionController.endAction(_$actionInfo);
- }
- }
-}
diff --git a/lib/models.dart b/lib/models.dart
deleted file mode 100644
index 7c239ac..0000000
--- a/lib/models.dart
+++ /dev/null
@@ -1,148 +0,0 @@
-import 'dart:convert';
-import 'dart:typed_data';
-
-abstract class Setting {
- String name;
- String description;
- Setting({
- this.name,
- this.description,
- });
-
- Map toMap();
-
- String toJson();
-
- Setting fromJson(Map map);
-}
-
-class ToggleSetting extends Setting {
- String name;
- String description;
- bool value;
-
- ToggleSetting({
- this.name,
- this.description,
- this.value,
- }) : super(
- name: name,
- description: description,
- );
-
- @override
- Map toMap() => {
- 'name': name,
- 'description': description,
- 'value': value,
- };
-
- @override
- String toJson() => json.encode(this.toMap());
-
- ToggleSetting fromJson(Map map) {
- return ToggleSetting(
- name: map['name'],
- description: map['description'],
- value: map['value'],
- );
- }
-}
-
-class MapSetting extends Setting {
- String name;
- String description;
- Map map;
-
- MapSetting({
- this.name,
- this.description,
- this.map,
- }) : super(
- name: name,
- description: description,
- );
-
- @override
- Map toMap() => {
- 'name': name,
- 'description': description,
- 'map': map,
- };
-
- @override
- String toJson() => json.encode(this.toMap());
-
- MapSetting fromJson(Map map) {
- return MapSetting(
- name: map['name'],
- description: map['description'],
- map: map['map'],
- );
- }
-}
-
-class Utils {
- static const String urlHello = '1HeLLo4uzjaLetFx6NH3PMwFP3qbRbTf3D';
- static const String urlTalk = 'Talk.ZeroNetwork.bit';
- static const String urlBlog = 'Blog.ZeroNetwork.bit';
- static const String urlMail = 'Mail.ZeroNetwork.bit';
- static const String urlMe = 'Me.ZeroNetwork.bit';
- static const String urlSites = 'Sites.ZeroNetwork.bit';
- static const String urlZeroNetMob = '15UYrA7aXr2Nto1Gg4yWXpY3EAJwafMTNk';
-
- static const initialSites = const {
- 'ZeroHello': {
- 'description': 'Hello Zeronet Site',
- 'url': urlHello,
- },
- 'ZeroMobile': {
- 'description': 'Report Android App Issues Here.',
- 'url': urlZeroNetMob,
- },
- 'ZeroTalk': {
- 'description': 'Reddit-like, decentralized forum',
- 'url': urlTalk,
- },
- 'ZeroBlog': {
- 'description': 'Microblogging Platform',
- 'url': urlBlog,
- },
- 'ZeroMail': {
- 'description': 'End-to-End Encrypted Mailing',
- 'url': urlMail,
- },
- 'ZeroMe': {
- 'description': 'P2P Social Network',
- 'url': urlMe,
- },
- 'ZeroSites': {
- 'description': 'Discover More Sites',
- 'url': urlSites,
- },
- };
-
- // 'ZeroName': '1Name2NXVi1RDPDgf5617UoW7xA6YrhM9F',
-}
-
-class UnzipParams {
- String item;
- Uint8List bytes;
- String dest;
- UnzipParams(
- this.item,
- this.bytes, {
- this.dest = '',
- });
-}
-
-enum state {
- NOT_DOWNLOADED,
- DOWNLOADING,
- NOT_INSTALLED,
- INSTALLING,
- MAKING_AS_EXEC,
- READY,
- RUNNING,
- NONE,
-}
diff --git a/lib/models/enums.dart b/lib/models/enums.dart
index 8e1e4ef..87db167 100644
--- a/lib/models/enums.dart
+++ b/lib/models/enums.dart
@@ -1,3 +1,4 @@
+import '../others/zeronet_isolate.dart';
import '../imports.dart';
enum ZeroNetStatus {
@@ -12,19 +13,19 @@ extension ZeroNetStatusExt on ZeroNetStatus {
get message {
switch (this) {
case ZeroNetStatus.NOT_RUNNING:
- return 'Not Running';
+ return strController.statusNotRunningStr.value;
break;
case ZeroNetStatus.INITIALISING:
- return 'Initialising...';
+ return strController.statusInitializingStr.value;
break;
case ZeroNetStatus.RUNNING:
- return 'Running';
+ return strController.statusRunningStr.value;
break;
case ZeroNetStatus.RUNNING_WITH_TOR:
- return 'Running with Tor';
+ return strController.statusRunningWithTorStr.value;
break;
case ZeroNetStatus.ERROR:
- return 'Error';
+ return strController.statusErrorStr.value;
break;
default:
}
@@ -33,17 +34,17 @@ extension ZeroNetStatusExt on ZeroNetStatus {
get actionText {
switch (this) {
case ZeroNetStatus.NOT_RUNNING:
- return 'Start';
+ return strController.startStr.value;
break;
case ZeroNetStatus.INITIALISING:
- return 'Please WAIT!';
+ return strController.pleaseWaitStr.value;
break;
case ZeroNetStatus.RUNNING:
case ZeroNetStatus.RUNNING_WITH_TOR:
- return 'Stop';
+ return strController.stopStr.value;
break;
case ZeroNetStatus.ERROR:
- return 'View Log';
+ return strController.viewLogStr.value;
break;
default:
}
@@ -52,11 +53,27 @@ extension ZeroNetStatusExt on ZeroNetStatus {
void onAction() {
switch (this) {
case ZeroNetStatus.NOT_RUNNING:
- runZeroNetService(autoStart: true);
+ printOut('onAction()');
+ printOut('ZeroNetStatus.NOT_RUNNING');
+ if (!patchChecked && checkPatchNeeded()) {
+ var zeroNetRevision = getZeroNetRevision(zeroNetDir);
+ downloadPatch('$zeroNetRevision').then((_) {
+ checkPatchAndApply(
+ tempDir.path + '/patches/$zeroNetRevision',
+ zeronetDir,
+ );
+ });
+ patchChecked = true;
+ }
+ var autoStart =
+ (varStore.settings[autoStartZeroNet] as ToggleSetting).value;
+ runZeroNetService(autoStart: autoStart);
break;
case ZeroNetStatus.RUNNING:
case ZeroNetStatus.RUNNING_WITH_TOR:
shutDownZeronet();
+ flutterWebViewPlugin.close();
+ // FlutterBackgroundService().stopBackgroundService();
manuallyStoppedZeroNet = true;
break;
case ZeroNetStatus.ERROR:
@@ -106,6 +123,72 @@ extension ZeroNetStatusExt on ZeroNetStatus {
}
}
+enum ZeroNetUserStatus {
+ NOT_REGISTERED,
+ REGISTERED,
+}
+
+extension ZeroNetUserStatusExt on ZeroNetUserStatus {
+ get message {
+ switch (this) {
+ case ZeroNetUserStatus.NOT_REGISTERED:
+ return strController.userNameNotCreatedStr.value;
+ break;
+ case ZeroNetUserStatus.REGISTERED:
+ return uiStore.zeroNetUserId.value;
+ break;
+ default:
+ }
+ }
+
+ get actionText {
+ switch (this) {
+ case ZeroNetUserStatus.NOT_REGISTERED:
+ return strController.createStr.value;
+ break;
+ case ZeroNetUserStatus.REGISTERED:
+ return strController.switchStr.value;
+ break;
+ default:
+ }
+ }
+
+ void onAction() {
+ switch (this) {
+ case ZeroNetUserStatus.NOT_REGISTERED:
+ var url = zeroNetUrl;
+ browserUrl = url + Utils.urlZeroId;
+ uiStore.updateCurrentAppRoute(AppRoute.ZeroBrowser);
+ break;
+ case ZeroNetUserStatus.REGISTERED:
+ MapOptions.CREATE_PROFILE.onClick(Get.context);
+ break;
+ default:
+ return null;
+ }
+ }
+
+ get actionBtnColor {
+ switch (this) {
+ case ZeroNetUserStatus.NOT_REGISTERED:
+ case ZeroNetUserStatus.REGISTERED:
+ return Color(0xFF52F7C5);
+ break;
+ default:
+ }
+ }
+
+ get statusChipColor {
+ switch (this) {
+ case ZeroNetUserStatus.NOT_REGISTERED:
+ case ZeroNetUserStatus.REGISTERED:
+ return Color(0xFF5A53FF);
+ break;
+ default:
+ }
+ }
+}
+
enum AppUpdate {
NOT_AVAILABLE,
AVAILABLE,
@@ -116,32 +199,30 @@ enum AppUpdate {
extension AppUpdateExt on AppUpdate {
get text {
- switch (uiStore.appUpdate) {
+ switch (uiStore.appUpdate.value) {
case AppUpdate.AVAILABLE:
- return 'Update';
+ return strController.updateStr.value;
break;
case AppUpdate.DOWNLOADING:
- return 'Downloading';
+ return strController.downloadingStr.value;
break;
case AppUpdate.DOWNLOADED:
- return 'Downloaded';
+ return strController.downloadedStr.value;
break;
case AppUpdate.INSTALLING:
- return 'Installing';
+ return strController.installingStr.value;
break;
default:
- return 'Not Available';
+ return strController.notAvaliableStr.value;
}
}
void action() {
- switch (uiStore.appUpdate) {
+ switch (uiStore.appUpdate.value) {
case AppUpdate.AVAILABLE:
{
// InAppUpdate.performImmediateUpdate().then((value) =>
// uiStore.updateInAppUpdateAvailable(AppUpdate.NOT_AVAILABLE));
- //TODO: Switch to startFlexibleUpdate() when below issue is Fixed.
- //https://github.com/feilfeilundfeil/flutter_in_app_update/issues/42
InAppUpdate.startFlexibleUpdate().then((value) =>
uiStore.updateInAppUpdateAvailable(AppUpdate.DOWNLOADED));
uiStore.updateInAppUpdateAvailable(AppUpdate.DOWNLOADING);
@@ -172,19 +253,19 @@ extension AppRouteExt on AppRoute {
get title {
switch (this) {
case AppRoute.AboutPage:
- return 'About';
+ return strController.aboutStr.value;
break;
case AppRoute.Home:
return 'ZeroNet Mobile';
break;
case AppRoute.Settings:
- return 'Settings';
+ return strController.settingsStr.value;
break;
case AppRoute.ZeroBrowser:
- return 'ZeroBrowser';
+ return 'Zero${strController.browserStr.value}';
break;
case AppRoute.LogPage:
- return 'ZeroNet Log';
+ return 'ZeroNet ${strController.logStr.value}';
break;
default:
}
@@ -207,7 +288,7 @@ extension AppRouteExt on AppRoute {
}
void onClick() {
- switch (uiStore.currentAppRoute) {
+ switch (uiStore.currentAppRoute.value) {
case AppRoute.Home:
uiStore.updateCurrentAppRoute(AppRoute.Settings);
break;
@@ -227,3 +308,91 @@ enum AppTheme {
Dark,
Black,
}
+
+extension AppThemeExt on AppTheme {
+ get primaryColor {
+ switch (this) {
+ case AppTheme.Light:
+ return Colors.white;
+ break;
+ case AppTheme.Dark:
+ return Colors.grey[900];
+ break;
+ case AppTheme.Black:
+ return Colors.black;
+ break;
+ default:
+ }
+ }
+
+ get primaryTextColor {
+ switch (this) {
+ case AppTheme.Light:
+ return Colors.black;
+ break;
+ case AppTheme.Dark:
+ case AppTheme.Black:
+ return Colors.white;
+ break;
+ default:
+ }
+ }
+
+ get btnTextColor {
+ switch (this) {
+ case AppTheme.Light:
+ return Colors.white;
+ break;
+ case AppTheme.Dark:
+ return Colors.white;
+ break;
+ case AppTheme.Black:
+ return Colors.white;
+ break;
+ default:
+ }
+ }
+
+ get cardBgColor {
+ switch (this) {
+ case AppTheme.Light:
+ return Colors.white;
+ break;
+ case AppTheme.Dark:
+ return Colors.grey[850];
+ break;
+ case AppTheme.Black:
+ return Colors.grey[900];
+ break;
+ default:
+ }
+ }
+
+ get iconBrightness {
+ switch (this) {
+ case AppTheme.Light:
+ return Brightness.dark;
+ case AppTheme.Dark:
+ case AppTheme.Black:
+ return Brightness.light;
+ break;
+ default:
+ }
+ }
+
+ get browserBgColor {
+ switch (this) {
+ case AppTheme.Light:
+ return Color(0xFFEDF2F5);
+ break;
+ case AppTheme.Dark:
+ case AppTheme.Black:
+ return Color(0xFF22272d);
+ break;
+ default:
+ }
+ }
+
+ get browserIconColor =>
+ zeroBrowserTheme == 'light' ? Color(0xFF22272d) : Color(0xFFEDF2F5);
+}
diff --git a/lib/models/models.dart b/lib/models/models.dart
index 659ac2e..2bc452b 100644
--- a/lib/models/models.dart
+++ b/lib/models/models.dart
@@ -141,15 +141,16 @@ enum state {
NONE,
}
+// ignore: must_be_immutable
class SiteInfo extends Equatable {
- final String address;
- final int peers;
- final int size;
- final int files;
- final DateTime siteAdded;
- final DateTime siteModified;
- final bool serving;
- final DateTime siteCodeUpdated;
+ String address;
+ int peers;
+ int size;
+ int files;
+ DateTime siteAdded;
+ DateTime siteModified;
+ bool serving;
+ DateTime siteCodeUpdated;
SiteInfo({
this.address = '',
this.peers = 0,
diff --git a/lib/native.dart b/lib/native.dart
deleted file mode 100644
index c6c040f..0000000
--- a/lib/native.dart
+++ /dev/null
@@ -1,101 +0,0 @@
-import 'imports.dart';
-
-const MethodChannel _channel = const MethodChannel('in.canews.zeronet');
-const EventChannel _events_channel =
- const EventChannel('in.canews.zeronet/installModules');
-
-Future askBatteryOptimisation() async =>
- await _channel.invokeMethod('batteryOptimisations');
-
-Future isPlayStoreInstall() async =>
- await _channel.invokeMethod('isPlayStoreInstall');
-
-Future isBatteryOptimised() async =>
- await _channel.invokeMethod('isBatteryOptimized');
-
-Future saveUserJsonFile(String path) async =>
- await _channel.invokeMethod('saveUserJsonFile', path);
-
-Future moveTaskToBack() async =>
- await _channel.invokeMethod('moveTaskToBack');
-
-Future isModuleInstallSupported() async =>
- await _channel.invokeMethod('isModuleInstallSupported');
-
-Future isRequiredModulesInstalled() async =>
- await _channel.invokeMethod('isRequiredModulesInstalled');
-
-Future copyAssetsToCache() async =>
- await _channel.invokeMethod('copyAssetsToCache');
-
-Future initSplitInstall() async =>
- await _channel.invokeMethod('initSplitInstall');
-
-void uninstallModules() async =>
- await _channel.invokeMethod('uninstallModules');
-
-void nativePrint(String log) => _channel.invokeMethod('nativePrint', log);
-
-getNativeDir() async => await _channel.invokeMethod('nativeDir');
-
-void handleModuleDownloadStatus() {
- _events_channel.receiveBroadcastStream().listen((onData) {
- Map data = json.decode(onData);
- final status = data['status'];
- if (status == 2) {
- final downloaded = data['downloaded'];
- final total = data['total'];
- double percentage = downloaded / total;
- varStore.setLoadingPercent(percentage.toInt());
- }
- printOut(onData, lineBreaks: 2, isNative: true);
- if (status == 5) check();
- });
-}
-
-String filePath = '';
-Future getUserJsonFile() async {
- String uri;
- if (deviceInfo.version.sdkInt > 28) {
- uri = await _channel.invokeMethod('openJsonFile');
- filePath = await FlutterAbsolutePath.getAbsolutePath(uri);
- } else {
- uri = (await pickUserJsonFile()).path;
- filePath = uri;
- }
- String path = await _channel.invokeMethod('readJsonFromUri', uri);
- return File(path);
-}
-
-Future getPluginZipFile() async {
- String uri;
- if (deviceInfo.version.sdkInt > 28) {
- try {
- uri = await _channel.invokeMethod('openZipFile');
- filePath = await FlutterAbsolutePath.getAbsolutePath(uri);
- } catch (e) {
- if (e is PlatformException) {
- if (e.code == '527') {
- return null;
- }
- }
- }
- } else {
- uri = (await pickPluginZipFile()).path;
- filePath = uri;
- }
- String path = await _channel.invokeMethod('readZipFromUri', uri);
- return File(path);
-}
-
-getArch() async {
- if (deviceInfo == null) deviceInfo = await DeviceInfoPlugin().androidInfo;
- String archL = deviceInfo.supportedAbis[0];
- if (archL.contains('arm64'))
- arch = 'arm64';
- else if (archL.contains('armeabi'))
- arch = 'arm';
- else if (archL.contains('x86_64'))
- arch = 'x86_64';
- else if (archL.contains('x86')) arch = 'x86';
-}
diff --git a/lib/others/common.dart b/lib/others/common.dart
index 867622e..0fe01af 100644
--- a/lib/others/common.dart
+++ b/lib/others/common.dart
@@ -1,6 +1,7 @@
import 'package:purchases_flutter/purchases_flutter.dart';
import '../imports.dart';
+import 'zeronet_isolate.dart';
Directory appPrivDir;
Directory tempDir;
@@ -12,6 +13,9 @@ bool isZeroNetDownloadedm = false;
bool isDownloadExec = false;
bool canLaunchUrl = false;
bool firstTime = false;
+bool kisProUser = false;
+bool patchChecked = false;
+bool fromBrowser = false;
bool kIsPlayStoreInstall = false;
bool kEnableInAppPurchases = !kDebugMode && kIsPlayStoreInstall;
bool manuallyStoppedZeroNet = false;
@@ -42,13 +46,12 @@ List usersAvailable = [];
String zeroBrowserTheme = 'light';
String snackMessage = '';
-ScaffoldState scaffoldState;
FlutterBackgroundService service;
String downloadLink(String item) =>
releases + 'Android_Module_Binaries/$item.zip';
-String trackerRepo = 'https://cdn.jsdelivr.net/gh/ngosang/trackerslist/';
+String trackerRepo = 'https://newtrackon.com/api/';
String downloadTrackerLink(String item) => trackerRepo + item;
bool isUsrBinExists() => Directory(dataDir + '/usr').existsSync();
@@ -64,25 +67,29 @@ String installedMetaDir(String dir, String name) =>
Duration secs(int sec) => Duration(seconds: sec);
List files(String arch) => [
'python38_$arch',
- 'site_packages_common',
+ if (arch != 'arm64') 'site_packages_common',
'site_packages_$arch',
'zeronet_py3',
'tor_$arch',
];
List trackerFileNames = [
- 'trackers_best.txt',
- 'trackers_all.txt',
- 'trackers_all_udp.txt',
- 'trackers_all_http.txt',
- 'trackers_all_https.txt',
- 'trackers_all_ws.txt',
- 'trackers_best_ip.txt',
- 'trackers_all_ip.txt',
+ 'stable',
];
+void setSystemUiTheme() => SystemChrome.setSystemUIOverlayStyle(
+ SystemUiOverlayStyle(
+ statusBarColor: Colors.transparent,
+ statusBarIconBrightness: uiStore.currentTheme.value.iconBrightness,
+ systemNavigationBarColor: uiStore.currentTheme.value.primaryColor,
+ systemNavigationBarIconBrightness:
+ uiStore.currentTheme.value.iconBrightness,
+ ),
+ );
+
init() async {
getArch();
+ await getPackageInfo();
kIsPlayStoreInstall = await isPlayStoreInstall();
zeroNetNativeDir = await getNativeDir();
tempDir = await getTemporaryDirectory();
@@ -92,13 +99,56 @@ init() async {
if (isZeroNetInstalledm) {
varStore.isZeroNetInstalled(isZeroNetInstalledm);
checkForAppUpdates();
- downloadTrackerFiles();
- runZeroNetService(
- autoStart: (varStore.settings[autoStartZeroNet] as ToggleSetting).value,
- );
+ if (enableZeroNetAddTrackers) await downloadTrackerFiles();
+ ZeroNetStatus.NOT_RUNNING.onAction();
}
if (!tempDir.existsSync()) tempDir.createSync(recursive: true);
Purchases.setup("ShCpAJsKdJrAAQawcMQSswqTyPWFMwXb");
+ var translations = loadTranslations();
+ if (varStore.settings.keys.contains(languageSwitcher)) {
+ var setting = varStore.settings[languageSwitcher] as MapSetting;
+ var language = setting.map['selected'];
+ var code = translations[language] ?? 'en';
+ if (code != 'en')
+ strController.loadTranslationsFromFile(
+ getZeroNetDataDir().path +
+ '/' +
+ Utils.urlZeroNetMob +
+ '/translations/' +
+ 'strings-$code.json',
+ );
+ }
+ loadUsersFromFileSystem();
+ if (varStore.settings.keys.contains(themeSwitcher)) {
+ var setting = varStore.settings[themeSwitcher] as MapSetting;
+ var theme = setting.map['selected'];
+ if (theme == 'Dark') {
+ uiStore.setTheme(AppTheme.Dark);
+ } else {
+ uiStore.setTheme(AppTheme.Light);
+ }
+ }
+ kisProUser = await isProUser();
+}
+
+List buildsRequirePatching = [60];
+
+bool requiresPatching() {
+ return buildsRequirePatching.contains(int.parse(buildNumber));
+}
+
+Future getPackageInfo() async {
+ packageInfo = await PackageInfo.fromPlatform();
+ appVersion = packageInfo.version;
+ buildNumber = packageInfo.buildNumber;
+}
+
+void listMetaFiles() {
+ Directory metaDirs = Directory(metaDir.path);
+ var files = metaDirs.listSync();
+ for (var item in files) {
+ print(item.path);
+ }
}
Future pickUserJsonFile() async {
@@ -124,26 +174,53 @@ Future pickFile({List fileExts}) async {
return result;
}
-Future backUpUserJsonFile(BuildContext context) async {
+Future backUpUserJsonFile(
+ BuildContext context, {
+ bool copyToClipboard = false,
+}) async {
if (getZeroNetUsersFilePath().isNotEmpty) {
- String result = await saveUserJsonFile(getZeroNetUsersFilePath());
- Scaffold.of(context).showSnackBar(SnackBar(
- content: Text(
- (result.contains('success'))
- ? result
- : "Please check yourself that file back up Successfully.",
- )));
+ if (copyToClipboard) {
+ FlutterClipboard.copy(File(getZeroNetUsersFilePath()).readAsStringSync())
+ .then(
+ (_) {
+ printToConsole(strController.usersFileCopied.value);
+ Get.showSnackbar(GetBar(
+ message: strController.usersFileCopied.value,
+ ));
+ },
+ );
+ } else {
+ String result = await saveUserJsonFile(getZeroNetUsersFilePath());
+ Get.showSnackbar(GetBar(
+ message: (result.contains('success'))
+ ? result
+ : strController.chkBckUpStr.value,
+ ));
+ }
} else
zeronetNotInit(context);
}
void zeronetNotInit(BuildContext context) => showDialogC(
context: context,
- title: 'ZeroNet data folder not Exists.',
- body: "ZeroNet should be used atleast once (run it from home screen), "
- "before using this option",
+ title: strController.zeroNetNotInitTitleStr.value,
+ body: strController.zeroNetNotInitDesStr.value,
);
+Map loadTranslations() {
+ Map langCodesMap = {};
+ var translationsDir = Directory(
+ getZeroNetDataDir().path + '/' + Utils.urlZeroNetMob + '/translations',
+ );
+ if (translationsDir.existsSync()) {
+ var langCodeFile = File(translationsDir.path + '/language-codes.json');
+ if (langCodeFile.existsSync()) {
+ langCodesMap = json.decode(langCodeFile.readAsStringSync());
+ }
+ }
+ return langCodesMap;
+}
+
saveDataFile() {
Map dataMap = {
'zeroNetNativeDir': zeroNetNativeDir,
@@ -155,7 +232,7 @@ saveDataFile() {
loadDataFile() {
File f = File(dataDir + '/data.json');
Map m = json.decode(f.readAsStringSync());
- print(m);
+ printOut(m);
zeroNetNativeDir = m['zeroNetNativeDir'];
}
@@ -217,9 +294,9 @@ String maptoStringList(Map map) {
}
String log = 'Click on Fab to Run ZeroNet\n';
-String logRunning = 'Running ZeroNet\n';
+String logRunning = '${strController.statusRunningStr.value} ZeroNet\n';
String uiServerLog = 'Ui.UiServer';
-String startZeroNetLog = 'Starting ZeroNet';
+String startZeroNetLog = '${strController.statusStartingStr.value} ZeroNet';
Process zero;
printToConsole(Object object) {
@@ -274,13 +351,18 @@ void showDialogC({
context: context,
builder: (context) {
return AlertDialog(
- title: Text(title),
+ title: Text(
+ title,
+ style: TextStyle(
+ color: uiStore.currentTheme.value.primaryTextColor,
+ ),
+ ),
content: SingleChildScrollView(
child: Text(body),
),
actions: [
- FlatButton(
- child: Text('Close'),
+ TextButton(
+ child: Text(strController.closeStr.value),
onPressed: () {
Navigator.of(context).pop();
},
@@ -301,14 +383,20 @@ void showDialogW({
context: context,
builder: (context) {
return AlertDialog(
- title: Text(title),
+ backgroundColor: uiStore.currentTheme.value.cardBgColor,
+ title: Text(
+ title,
+ style: TextStyle(
+ color: uiStore.currentTheme.value.primaryTextColor,
+ ),
+ ),
content: SingleChildScrollView(
child: body,
),
actions: [
actionOk,
- FlatButton(
- child: Text('Close'),
+ TextButton(
+ child: Text(strController.closeStr.value),
onPressed: () {
Navigator.of(context).pop();
},
@@ -409,12 +497,11 @@ void installPluginDialog(File file, BuildContext context) {
installPlugin(file);
showDialogW(
context: context,
- title: 'Installing Plugin',
+ title: strController.znPluginInstallingTitleStr.value,
body: Column(
children: [
Text(
- "This Dialog will be automatically closed after installation, "
- "After Installation Restart ZeroNet from Home page",
+ strController.znPluginInstallingDesStr.value,
),
Padding(padding: EdgeInsets.all(12.0)),
LinearProgressIndicator()
diff --git a/lib/others/constants.dart b/lib/others/constants.dart
index dbf14a3..baf9f47 100644
--- a/lib/others/constants.dart
+++ b/lib/others/constants.dart
@@ -17,8 +17,10 @@ const String twitterLink = 'https://twitter.com';
const String githubLink = 'https://github.com';
const String rawGithubLink = 'https://raw.githubusercontent.com';
const String canewsInRepo = '/canewsin/ZeroNet';
+const String zeromobileRepo = '/canewsin/zeronet_mobile';
const String releases = '$githubLink$canewsInRepo/releases/download/';
const String md5hashLink = '$rawGithubLink$canewsInRepo/py3-patches/md5.hashes';
+const String zpatches = '$githubLink$zeromobileRepo/releases/download/patches';
const String zeroNetNotiId = 'zeroNetNetiId';
const String zeroNetChannelName = 'ZeroNet Mobile';
const String zeroNetChannelDes =
@@ -34,8 +36,13 @@ const bool kEnableDynamicModules = !kDebugMode;
const List unImplementedFeatures = [
Feature.SITE_DELETE,
Feature.SITE_PAUSE_RESUME,
- // Feature.IN_APP_UPDATES,
];
+
+const List proFeatures = [
+ MapOptions.THEME_BLACK,
+ MapOptions.LOAD_PLUGIN,
+];
+
const List binDirs = [
'usr',
'site-packages',
@@ -47,6 +54,14 @@ const List soDirs = [
'usr/lib/python3.8/lib-dynload',
'usr/lib/python3.8/site-packages',
];
+
+const List filterFileNames = [
+ 'sites-miners.json',
+ 'sites-porn.json',
+ 'users-porn.json',
+ 'users-spamlist.json',
+];
+
const List appDevelopers = [
AppDeveloper(
name: 'PramUkesh',
@@ -66,46 +81,25 @@ const List appDevelopers = [
),
];
+const String languageSwitcher = 'Language';
+const String themeSwitcher = 'Theme';
const String profileSwitcher = 'Profile Switcher';
-const String profileSwitcherDes =
- 'Create and Use different Profiles on ZeroNet';
const String debugZeroNet = 'Debug ZeroNet Code';
-const String debugZeroNetDes =
- 'Useful for Developers to find bugs and errors in the code.';
const String enableZeroNetConsole = 'Enable ZeroNet Console';
-const String enableZeroNetConsoleDes =
- 'Useful for Developers to see the exec of ZeroNet Python code';
const String enableZeroNetFilters = 'Enable ZeroNet Filters';
-const String enableZeroNetFiltersDes =
- 'Enabling ZeroNet Filters blocks known ametuer content sites and spam users.';
const String enableAdditionalTrackers = 'Additional BitTorrent Trackers';
-const String enableAdditionalTrackersDes =
- 'Enabling External/Additional BitTorrent Trackers will give more ZeroNet Site Seeders or Clients.';
const String pluginManager = 'Plugin Manager';
-const String pluginManagerDes = 'Enable/Disable ZeroNet Plugins';
const String vibrateOnZeroNetStart = 'Vibrate on ZeroNet Start';
-const String vibrateOnZeroNetStartDes = 'Vibrates Phone When ZeroNet Starts';
const String enableFullScreenOnWebView = 'FullScreen for ZeroNet Zites';
-const String enableFullScreenOnWebViewDes =
- 'This will Enable Full Screen for in app Webview of ZeroNet';
const String batteryOptimisation = 'Disable Battery Optimisation';
-const String batteryOptimisationDes =
- 'This will Helps to Run App even App is in Background for long time.';
const String publicDataFolder = 'Public DataFolder';
-const String publicDataFolderDes =
- 'This Will Make ZeroNet Data Folder Accessible via File Manager.';
const String autoStartZeroNet = 'AutoStart ZeroNet';
-const String autoStartZeroNetDes =
- 'This Will Make ZeroNet Auto Start on App Start, So you don\'t have to click Start Button Every Time on App Start.';
const String autoStartZeroNetonBoot = 'AutoStart ZeroNet on Boot';
-const String autoStartZeroNetonBootDes =
- 'This Will Make ZeroNet Auto Start on Device Boot.';
const String enableTorLog = 'Enable Tor Log';
-const String enableTorLogDes =
- 'This will Enable Tor Log in ZeroNet Console helpful for debugging.';
class Utils {
- static const String urlHello = '1HeLLo4uzjaLetFx6NH3PMwFP3qbRbTf3D';
+ static const String urlHello = '1HELLoE3sFD9569CLCbHEAVqvqV7U2Ri9d';
+ static const String urlZeroId = '1iD5ZQJMNXu43w1qLB8sfdHVKppVMduGz';
static const String urlZeroNetMob = '15UYrA7aXr2Nto1Gg4yWXpY3EAJwafMTNk';
static const String urlTalk = 'Talk.ZeroNetwork.bit';
static const String btcUrlTalk = '1TaLkFrMwvbNsooF4ioKAY9EuxTBTjipT';
@@ -118,68 +112,39 @@ class Utils {
static const String urlSites = 'Sites.ZeroNetwork.bit';
static const String btcUrlSites = '1SiTEs2D3rCBxeMoLHXei2UYqFcxctdwB';
- static const initialSites = const {
+ static var initialSites = {
'ZeroHello': {
- 'description': 'Say Hello to ZeroNet, a Dashboard to manage ' +
- 'all your ZeroNet Z(S)ites, You can view feed of other zites like ' +
- 'posts, comments of other users from ZeroTalk as well for your posts ' +
- 'and Stats like Total Requests sent and received from other peers on ZeroNet. ' +
- 'You can also pause, clone or favourite, delete Zites from single page.',
+ 'description': strController.zerohelloSiteDesStr.value,
'url': urlHello,
'btcAddress': urlHello,
},
'ZeroNetMobile': {
- 'description': 'Forum to report ZeroNet Mobile app issues. ' +
- 'Want a new feature in the app, Request a Feature. ' +
- 'Facing any Bugs while using the app ? ' +
- 'Just report problem here, we will take care of it. ' +
- 'Want to Discuss any topic about app development ? ' +
- 'Just dive into to this Zite.',
+ 'description': strController.zeronetMobileSiteDesStr.value,
'url': urlZeroNetMob,
'btcAddress': urlZeroNetMob,
},
'ZeroTalk': {
- 'description': 'Need a forum to discuss something, ' +
- 'we got covered you here. ZeroTalk fits your need, ' +
- 'just post something to get opinion from others on Network. ' +
- 'Have some queries ? don\'t hesitate to ask here.' +
- 'Tired of Spam ? Who don\'t! You can mute individual users also.',
+ 'description': strController.zeroTalkSiteDesStr.value,
'url': urlTalk,
'btcAddress': btcUrlTalk,
},
'ZeroBlog': {
- 'description': 'Want to Know Where ZeroNet is Going ? ' +
- 'ZeroBlog gives you latest changes and improvements ' +
- 'made to ZeroNet, including Bug Fixes, ' +
- 'Speed Improvements of ZeroNet Core Software. ' +
- 'Also Provides varies links to ZeroNet Protocol and ' +
- 'how ZeroNet works underhood and much more things to know.',
+ 'description': strController.zeroblogSiteDesStr.value,
'url': urlBlog,
'btcAddress': btcUrlBlog,
},
'ZeroMail': {
- 'description': 'So you need a mail service, use ZeroMail, ' +
- 'fully end-to-end encrypted mail service on ZeroNet, ' +
- 'don\'t let others scanning your mailbox for their profits ' +
- 'all your data is encrypted and can only opened by you. ' +
- 'Your all mails are backedup, so you can stay calm for your data.',
+ 'description': strController.zeromailSiteDesStr.value,
'url': urlMail,
'btcAddress': btcUrlMail,
},
'ZeroMe': {
- 'description': 'Social Network is everywhere, so we made one here too. ' +
- 'Twitter like, Peer to Peer Social Networking in your hands without data-tracking, ' +
- 'Follow others and post your thoughts, like, comment on others posts, it\'s that easy-peasy. ' +
- 'Find Like minded people and increase your friend circle beyond the borders.',
+ 'description': strController.zeromeSiteDesStr.value,
'url': urlMe,
'btcAddress': btcUrlMe,
},
'ZeroSites': {
- 'description': 'Want to know more sites on ZeroNet, ' +
- 'visit ZeroSites, listing of community contributed sites under various ' +
- 'categories like Blogs, Services, Forums, Chat, Video, Image, Guides, News and much more. ' +
- 'You can even filter those lists with your preferred language ' +
- 'to get more comprehensive list. Has a New Site to Show, Just Submit here.',
+ 'description': strController.zeroSitesSiteDesStr.value,
'url': urlSites,
'btcAddress': btcUrlSites,
},
@@ -187,87 +152,107 @@ class Utils {
// 'ZeroName': '1Name2NXVi1RDPDgf5617UoW7xA6YrhM9F',
- static const String createProfile = 'Create'; // New Profile
- static const String importProfile = 'Import'; // Profile
- static const String backupProfile = 'Backup'; // Profile
+ // static const String createProfile = 'Create'; // New Profile
+ // static const String importProfile = 'Import'; // Profile
+ // static const String backupProfile = 'Backup'; // Profile
- static const String openPluginManager = 'Open Plugin Manager';
- static const String loadPlugin = 'Load Custom Plugin';
+ // static const String openPluginManager = 'Open Plugin Manager';
+ // static const String loadPlugin = 'Load Custom Plugin';
static Map defSettings = {
+ languageSwitcher: MapSetting(
+ name: strController.languageSwitcherStr.value,
+ description: strController.languageSwitcherDesStr.value,
+ map: {
+ "selected": '',
+ "all": [],
+ },
+ options: [],
+ ),
+ themeSwitcher: MapSetting(
+ name: strController.themeSwitcherStr.value,
+ description: strController.themeSwitcherDesStr.value,
+ map: {},
+ options: [
+ MapOptions.THEME_LIGHT,
+ MapOptions.THEME_DARK,
+ // MapOptions.THEME_BLACK,
+ ],
+ ),
profileSwitcher: MapSetting(
- name: profileSwitcher,
- description: profileSwitcherDes,
- map: {
- "selected": '',
- "all": [],
- },
- options: [
- MapOptions.CREATE_PROFILE,
- MapOptions.IMPORT_PROFILE,
- MapOptions.BACKUP_PROFILE,
- ]),
+ name: strController.profileSwitcherStr.value,
+ description: strController.profileSwitcherDesStr.value,
+ map: {
+ "selected": '',
+ "all": [],
+ },
+ options: [
+ MapOptions.CREATE_PROFILE,
+ MapOptions.IMPORT_PROFILE,
+ MapOptions.BACKUP_PROFILE,
+ ],
+ ),
pluginManager: MapSetting(
- name: pluginManager,
- description: pluginManagerDes,
+ name: strController.pluginManagerStr.value,
+ description: strController.pluginManagerDesStr.value,
map: {},
options: [
MapOptions.OPEN_PLUGIN_MANAGER,
MapOptions.LOAD_PLUGIN,
]),
batteryOptimisation: ToggleSetting(
- name: batteryOptimisation,
- description: batteryOptimisationDes,
+ name: strController.batteryOptimisationStr.value,
+ description: strController.batteryOptimisationDesStr.value,
value: false,
),
enableAdditionalTrackers: ToggleSetting(
- name: enableAdditionalTrackers,
- description: enableAdditionalTrackersDes,
+ name: strController.enableAdditionalTrackersStr.value,
+ description: strController.enableAdditionalTrackersDesStr.value,
value: true,
),
enableZeroNetFilters: ToggleSetting(
- name: enableZeroNetFilters,
- description: enableZeroNetFiltersDes,
+ name: strController.enableZeroNetFiltersStr.value,
+ description: strController.enableZeroNetFiltersDesStr.value,
value: true,
),
publicDataFolder: ToggleSetting(
- name: publicDataFolder,
- description: publicDataFolderDes,
+ name: strController.publicDataFolderStr.value,
+ description: strController.publicDataFolderDesStr.value,
value: false,
),
vibrateOnZeroNetStart: ToggleSetting(
- name: vibrateOnZeroNetStart,
- description: vibrateOnZeroNetStartDes,
+ name: strController.vibrateOnZeroNetStartStr.value,
+ description: strController.vibrateOnZeroNetStartDesStr.value,
value: false,
),
enableFullScreenOnWebView: ToggleSetting(
- name: enableFullScreenOnWebView,
- description: enableFullScreenOnWebViewDes,
+ name: strController.enableFullScreenOnWebViewStr.value,
+ description: strController.enableFullScreenOnWebViewDesStr.value,
value: false,
),
autoStartZeroNet: ToggleSetting(
- name: autoStartZeroNet,
- description: autoStartZeroNetDes,
+ name: strController.autoStartZeroNetStr.value,
+ description: strController.autoStartZeroNetDesStr.value,
value: true,
),
autoStartZeroNetonBoot: ToggleSetting(
- name: autoStartZeroNetonBoot,
- description: autoStartZeroNetonBootDes,
+ name: strController.autoStartZeroNetonBootStr.value,
+ description: strController.autoStartZeroNetonBootDesStr.value,
value: false,
),
debugZeroNet: ToggleSetting(
- name: debugZeroNet,
- description: debugZeroNetDes,
+ name: strController.debugZeroNetStr.value,
+ description: strController.debugZeroNetDesStr.value,
value: false,
),
enableZeroNetConsole: ToggleSetting(
- name: enableZeroNetConsole,
- description: enableZeroNetConsoleDes,
+ name: strController.enableZeroNetConsoleStr.value,
+ description: strController.enableZeroNetConsoleDesStr.value,
value: false,
),
enableTorLog: ToggleSetting(
- name: enableTorLog,
- description: enableTorLogDes,
+ name: strController.enableTorLogStr.value,
+ description: strController.enableTorLogDesStr.value,
value: false,
),
};
@@ -280,25 +265,38 @@ enum MapOptions {
OPEN_PLUGIN_MANAGER,
LOAD_PLUGIN,
+
+ THEME_LIGHT,
+ THEME_DARK,
+ THEME_BLACK,
}
extension MapOptionExt on MapOptions {
get description {
switch (this) {
case MapOptions.CREATE_PROFILE:
- return 'Create New Profile';
+ return strController.createNewProfileStr.value;
break;
case MapOptions.IMPORT_PROFILE:
- return 'Import Profile';
+ return strController.importProfileStr.value;
break;
case MapOptions.BACKUP_PROFILE:
- return 'Backup Profile';
+ return strController.backupProfileStr.value;
break;
case MapOptions.OPEN_PLUGIN_MANAGER:
- return 'Open Plugin Manager';
+ return strController.openPluginManagerStr.value;
break;
case MapOptions.LOAD_PLUGIN:
- return 'Load Plugin';
+ return strController.loadPluginStr.value;
+ break;
+ case MapOptions.THEME_LIGHT:
+ return 'Light';
+ break;
+ case MapOptions.THEME_DARK:
+ return 'Dark';
+ break;
+ case MapOptions.THEME_BLACK:
+ return 'Black';
break;
}
}
@@ -310,12 +308,12 @@ extension MapOptionExt on MapOptions {
if (isZeroNetUserDataExists()) {
showDialogW(
context: context,
- title: 'Provide A Name for Existing Profile',
+ title: strController.existingProfileTitleStr.value,
body: ProfileSwitcherUserNameEditText(),
actionOk: Row(
children: [
- FlatButton(
- child: Text('Create'),
+ TextButton(
+ child: Text(strController.createStr.value),
onPressed: () {
if (username.isNotEmpty) {
File file = File(getZeroNetUsersFilePath());
@@ -329,15 +327,17 @@ extension MapOptionExt on MapOptions {
}
username = '';
uiStore.updateCurrentAppRoute(AppRoute.Settings);
- uiStore.updateReload(uiStore.reload++);
+ var value2 = uiStore.reload.value;
+ uiStore.updateReload(value2 + 1);
+ loadUsersFromFileSystem();
} else {
validUsername = false;
// _reload();
}
},
),
- FlatButton(
- child: Text('Backup'),
+ TextButton(
+ child: Text(strController.backupStr.value),
onPressed: () => backUpUserJsonFile(context),
),
],
@@ -356,17 +356,15 @@ extension MapOptionExt on MapOptions {
: false;
showDialogW(
context: context,
- title: 'Restore Profile ?',
+ title: strController.restoreProfileTitleStr.value,
body: Text(
- 'this will delete the existing profile, '
- 'backup existing profile using backup button below\n\n'
- 'Selected Userfile : \n'
+ '${strController.restoreProfileDesStr.value}'
'$filePath'
- '\n\n${isSameUser ? 'You can only select users.json file, outside zeronet data folder' : ''}',
+ '\n\n${isSameUser ? '${strController.restoreProfileDes1Str.value}' : ''}',
),
actionOk: Row(
children: [
- FlatButton(
+ TextButton(
onPressed: isSameUser
? null
: () async {
@@ -387,11 +385,11 @@ extension MapOptionExt on MapOptions {
}
},
child: Text(
- 'Restore',
+ strController.restoreStr.value,
),
),
- FlatButton(
- child: Text('Backup'),
+ TextButton(
+ child: Text(strController.backupStr.value),
onPressed: () => backUpUserJsonFile(context),
),
],
@@ -405,22 +403,27 @@ extension MapOptionExt on MapOptions {
break;
case MapOptions.LOAD_PLUGIN:
{
- showDialogW(
- context: context,
- title: 'Install a Plugin',
- body: Text('This will load plugin to your ZeroNet repo, '
- '\nWarning : Loading Unknown/Untrusted plugins may compromise ZeroNet Installation.'),
- actionOk: FlatButton(
- onPressed: () async {
- var file = await getPluginZipFile();
- if (file != null) {
- Navigator.pop(context);
- installPluginDialog(file, context);
- }
- },
- child: Text('Install'),
- ),
- );
+ if (kisProUser)
+ showDialogW(
+ context: context,
+ title: strController.zninstallAPluginTitleStr.value,
+ body: Text(
+ strController.zninstallAPluginDesStr.value,
+ style: TextStyle(
+ color: uiStore.currentTheme.value.primaryTextColor,
+ ),
+ ),
+ actionOk: TextButton(
+ onPressed: () async {
+ var file = await getPluginZipFile();
+ if (file != null) {
+ Navigator.pop(context);
+ installPluginDialog(file, context);
+ }
+ },
+ child: Text(strController.installStr.value),
+ ),
+ );
}
break;
case MapOptions.OPEN_PLUGIN_MANAGER:
@@ -428,16 +431,33 @@ extension MapOptionExt on MapOptions {
context: context,
title: pluginManager,
body: PluginManager(),
- actionOk: FlatButton(
+ actionOk: TextButton(
onPressed: () {
ZeroNet.instance.shutDown();
service.sendData({'cmd': 'runZeroNet'});
Navigator.pop(context);
},
- child: Text('Restart'),
+ child: Text(strController.restartStr.value),
),
);
break;
+ case MapOptions.THEME_LIGHT:
+ uiStore.setTheme(AppTheme.Light);
+ var setting = (varStore.settings[themeSwitcher] as MapSetting)
+ ..map['selected'] = 'Light';
+ varStore.updateSetting(setting);
+ saveSettings(varStore.settings);
+ break;
+ case MapOptions.THEME_DARK:
+ uiStore.setTheme(AppTheme.Dark);
+ var setting = (varStore.settings[themeSwitcher] as MapSetting)
+ ..map['selected'] = 'Dark';
+ varStore.updateSetting(setting);
+ saveSettings(varStore.settings);
+ break;
+ case MapOptions.THEME_BLACK:
+ if (kisProUser) uiStore.setTheme(AppTheme.Black);
+ break;
default:
}
}
diff --git a/lib/others/donation_const.dart b/lib/others/donation_const.dart
index 7e7a349..638d3a0 100644
--- a/lib/others/donation_const.dart
+++ b/lib/others/donation_const.dart
@@ -2,11 +2,34 @@ import 'package:purchases_flutter/purchases_flutter.dart';
import '../imports.dart';
-const Map donationsAddressMap = {
- "BTC(Preferred)": "35NgjpB3pzkdHkAPrNh2EMERGxnXgwCb6G",
- "ETH": "0xa81a32dcce8e5bcb9792daa19ae7f964699ee536",
- "UPI(Indian Users)": "pramukesh@upi",
- "Liberapay": "https://liberapay.com/canews.in/donate",
+var enableExternalDonations = false;
+var btcAddress = '1ZeroNetyV5mKY9JF1gsm82TuBXHpfdLX';
+var ethAddress = '0xa7064577f79ece591143F5CccBA2afAE057903C6';
+var upiAddress = 'pramukesh@upi';
+var liberaPayAddress = 'https://liberapay.com/canews.in/donate';
+
+void getDonationSettings() {
+ var dir = Utils.urlZeroNetMob.zeroNetDataPath;
+ if (Directory(dir).existsSync()) {
+ var file = File(dir + '/native.decent');
+ if (file.existsSync()) {
+ var decode = json.decode(file.readAsStringSync());
+ var settingsMap = (decode as Map)['settings'];
+ var donations = settingsMap['donations'];
+ enableExternalDonations = donations['enableExternalDonations'];
+ btcAddress = donations['btcAddress'];
+ ethAddress = donations['ethAddress'];
+ upiAddress = donations['upiAddress'];
+ liberaPayAddress = donations['liberapayAddress'];
+ }
+ }
+}
+
+Map donationsAddressMap = {
+ "BTC(Preferred)": btcAddress,
+ "ETH": ethAddress,
+ "UPI(Indian Users)": upiAddress,
+ "Liberapay": liberaPayAddress,
};
const Set kGooglePlayPurchaseOneTimeIds = {
@@ -40,11 +63,16 @@ Future isProUser() async {
try {
final userName = getZeroIdUserName();
PurchaserInfo purchaserInfo;
- if (userName.isNotEmpty) purchaserInfo = await Purchases.identify(userName);
- purchaserInfo = await Purchases.getPurchaserInfo();
- if (purchaserInfo.entitlements.active.length > 0) return true;
+ if (userName.isNotEmpty) {
+ purchaserInfo = (await Purchases.logIn(userName)).purchaserInfo;
+ purchaserInfo = await Purchases.getPurchaserInfo();
+ if (purchaserInfo.entitlements.active.length > 0) return true;
+ } else
+ return false;
} on PlatformException catch (e) {
+ printOut(e);
// Error fetching purchaser info
+ return false;
}
return false;
}
@@ -53,14 +81,15 @@ void purchasePackage(Package package) async {
try {
PurchaserInfo purchaserInfo;
final userName = getZeroIdUserName();
- if (userName.isNotEmpty) purchaserInfo = await Purchases.identify(userName);
+ if (userName.isNotEmpty)
+ purchaserInfo = (await Purchases.logIn(userName)).purchaserInfo;
purchaserInfo = await Purchases.purchasePackage(package);
- var isPro = await isProUser();
- if (isPro) {
+ kisProUser = await isProUser();
+ if (kisProUser) {
// Unlock that great "pro" content
}
- print(purchaserInfo);
+ printOut(purchaserInfo);
} on PlatformException catch (e) {
var errorCode = PurchasesErrorHelper.getErrorCode(e);
if (errorCode != PurchasesErrorCode.purchaseCancelledError) {
@@ -68,52 +97,3 @@ void purchasePackage(Package package) async {
}
}
}
-
-void listenToPurchaseUpdated(List purchaseDetailsList) {
- purchaseDetailsList.forEach((PurchaseDetails purchaseDetails) async {
- if (purchaseDetails.status == PurchaseStatus.pending) {
- // showPendingUI();
- } else {
- if (purchaseDetails.status == PurchaseStatus.error) {
- scaffoldState.showSnackBar(
- SnackBar(
- content: Text(
- //!TODO Improve Error Messages sp that user can understand easily.
- 'PurchaseStatus.error :: ${purchaseDetails.error.message}',
- ),
- ),
- );
- } else if (purchaseDetails.status == PurchaseStatus.purchased) {
- bool valid = await _verifyPurchase(purchaseDetails);
- if (valid) {
- deliverProduct(purchaseDetails);
- } else {
- // _handleInvalidPurchase(purchaseDetails);
- return;
- }
- }
-
- if (purchaseDetails.productID != null &&
- purchaseDetails.productID.contains('zeronet_one')) {
- await InAppPurchaseConnection.instance.consumePurchase(purchaseDetails);
- purchasesStore.addConsumedPurchases(purchaseDetails.purchaseID);
- }
- if (purchaseDetails.pendingCompletePurchase) {
- await InAppPurchaseConnection.instance
- .completePurchase(purchaseDetails);
- }
- }
- });
-}
-
-_verifyPurchase(PurchaseDetails purchaseDetails) {
- print(purchaseDetails.verificationData.localVerificationData);
- return Future.value(true);
-}
-
-void deliverProduct(PurchaseDetails purchaseDetails) async {
- // IMPORTANT!! Always verify a purchase purchase details before delivering the product.
- if (purchaseDetails.productID.contains('zeronet_one')) {
- purchasesStore.addPurchases(purchaseDetails.purchaseID);
- } else {}
-}
diff --git a/lib/others/extensions.dart b/lib/others/extensions.dart
index 4999ad6..2374c5d 100644
--- a/lib/others/extensions.dart
+++ b/lib/others/extensions.dart
@@ -1,7 +1,8 @@
import 'dart:io';
+import 'package:zeronet/imports.dart';
extension FileSystemExtension on FileSystemEntity {
- String name() => this.path.replaceFirst(this.parent.path + '/', '');
+ String get name => this.path.replaceFirst(this.parent.path + '/', '');
}
extension CapExtension on String {
@@ -9,6 +10,7 @@ extension CapExtension on String {
String get allInCaps => this.toUpperCase();
String get capitalizeFirstofEach =>
this.split(" ").map((str) => str.inCaps).join(" ");
+ String get zeroNetDataPath => getZeroNetDataDir().path + '/' + this + '/';
}
extension DynamicExt on dynamic {
diff --git a/lib/others/utils.dart b/lib/others/utils.dart
index beff7cb..54598bd 100644
--- a/lib/others/utils.dart
+++ b/lib/others/utils.dart
@@ -7,7 +7,7 @@ import '../imports.dart';
debugTime(Function func) {
var start = DateTime.now();
func();
- print(DateTime.now().difference(start).inMilliseconds);
+ printOut(DateTime.now().difference(start).inMilliseconds);
}
printOut(Object object, {int lineBreaks = 0, bool isNative = false}) {
@@ -19,7 +19,7 @@ printOut(Object object, {int lineBreaks = 0, bool isNative = false}) {
if (isNative)
nativePrint(breaks + "$object" + breaks);
else
- print(breaks + object + breaks);
+ print(breaks + '$object' + breaks);
}
}
@@ -59,9 +59,6 @@ initDownloadParams() async {
bindDownloadIsolate();
bindUnZipIsolate();
FlutterDownloader.registerCallback(handleDownloads);
- packageInfo = await PackageInfo.fromPlatform();
- appVersion = packageInfo.version;
- buildNumber = packageInfo.buildNumber;
}
handleDownloads(String id, DownloadTaskStatus status, int progress) {
@@ -128,7 +125,7 @@ bindUnZipIsolate() {
int totalFiles = data[2];
var percent = (currentFile / totalFiles) * 100;
if (percent.toInt() % 5 == 0) {
- varStore.setLoadingStatus('Installing $name');
+ varStore.setLoadingStatus('${strController.installingStr.value} $name');
varStore.setLoadingPercent(percent.toInt());
}
if (percent == 100) {
@@ -136,6 +133,12 @@ bindUnZipIsolate() {
}
var nooffiles = files(arch).length;
if (percentUnZip == nooffiles * 100) {
+ if (requiresPatching()) {
+ var patchFile = File(dataDir + '/$buildNumber.patched');
+ if (!patchFile.existsSync()) {
+ patchFile.createSync(recursive: true);
+ }
+ }
printOut('Installation Completed', isNative: true);
makeExecHelper().then((value) => isExecPermitted = value);
uninstallModules();
@@ -179,7 +182,7 @@ downloadBins() async {
} else {
var bytes = file.readAsBytesSync();
var digest = md5.convert(bytes).toString();
- var res = await client.get(md5hashLink);
+ var res = await client.get(Uri.parse(md5hashLink));
var list = json.decode(res.body) as List;
list.forEach((f) => md5List.add(f as String));
for (var hash in md5List) {
@@ -208,11 +211,19 @@ unzip() async {
zeroNetState = state.INSTALLING;
if (!(f2.existsSync() && f3.existsSync())) {
if (f.path.contains('usr'))
- _unzipBytes(item, f.readAsBytesSync(), dest: 'usr/');
+ unzipBytes(
+ item,
+ f.readAsBytesSync(),
+ dest: dataDir + '/' + 'usr/',
+ );
else if (f.path.contains('site-packages'))
- _unzipBytes(item, f.readAsBytesSync(), dest: 'usr/lib/python3.8/');
+ unzipBytes(
+ item,
+ f.readAsBytesSync(),
+ dest: dataDir + '/' + 'usr/lib/python3.8/',
+ );
else
- _unzipBytes(item, f.readAsBytesSync());
+ unzipBytes(item, f.readAsBytesSync(), dest: dataDir + '/');
f2.createSync(recursive: true);
}
}
@@ -303,9 +314,9 @@ void _unzipBytesAsync(UnzipParams params) async {
int percentUnZip = 0;
-_unzipBytes(String name, List bytes, {String dest = ''}) async {
+unzipBytes(String name, List bytes, {String dest = ''}) async {
printOut("UnZippingFiles.......");
- var out = dataDir + '/' + dest;
+ var out = dest;
Archive archive = ZipDecoder().decodeBytes(bytes);
for (ArchiveFile file in archive) {
String filename = file.name;
@@ -425,7 +436,7 @@ installPlugin(File file) async {
);
}
-void downloadTrackerFiles() async {
+Future downloadTrackerFiles() async {
DateTime pastTime;
int hrs = -1;
File timestamp = File(trackersDir.path + '/timestamp');
@@ -439,6 +450,7 @@ void downloadTrackerFiles() async {
}
if (hrs == -1 || hrs > 24) {
await FlutterDownloader.initialize();
+ FlutterDownloader.registerCallback(handleDownloads);
for (var item in trackerFileNames) {
await FlutterDownloader.enqueue(
url: downloadTrackerLink(item),
diff --git a/lib/others/zeronet_isolate.dart b/lib/others/zeronet_isolate.dart
new file mode 100644
index 0000000..f4ce4cf
--- /dev/null
+++ b/lib/others/zeronet_isolate.dart
@@ -0,0 +1,311 @@
+import '../imports.dart';
+
+void runTorEngine() {
+ service = FlutterBackgroundService();
+ final tor = zeroNetNativeDir + '/libtor.so';
+ if (File(tor).existsSync()) {
+ service.sendData({'console': 'Running Tor Engine..'});
+ Process.start('$tor', [], environment: {
+ "LD_LIBRARY_PATH": "$libDir:$libDir64:/system/lib64",
+ }).then((proc) {
+ zero = proc;
+ if (enableTorLogConsole) {
+ zero.stderr.listen((onData) {
+ service.sendData({'console': utf8.decode(onData)});
+ });
+ zero.stdout.listen((onData) {
+ service.sendData({'console': utf8.decode(onData)});
+ });
+ }
+ }).catchError((e) {
+ if (e is ProcessException) {
+ printOut(e.toString());
+ }
+ });
+ } else {
+ //TODO: Improve Error Trace here
+ service.sendData({'console': 'Tor Binary Not Found'});
+ uiStore.setZeroNetStatus(ZeroNetStatus.RUNNING);
+ }
+}
+
+void runZeroNet() {
+ printOut('runZeroNet()');
+ printOut('zeroNetStatus : ${uiStore.zeroNetStatus.value}');
+ // if (zeroNetNativeDir.isEmpty) {
+ // printOut('zeroNetNativeDir.isEmpty : ${zeroNetNativeDir.isEmpty}');
+ // getNativeDir().then((nativeDir) {
+ // zeroNetNativeDir = nativeDir;
+ // runZeroNet();
+ // });
+ // } else {
+ if (uiStore.zeroNetStatus.value == ZeroNetStatus.NOT_RUNNING ||
+ uiStore.zeroNetStatus.value == ZeroNetStatus.ERROR) {
+ uiStore.setZeroNetStatus(ZeroNetStatus.INITIALISING);
+ service.sendData({'ZeroNetStatus': 'INITIALISING'});
+ runTorEngine();
+ log = '';
+ service.sendData({'console': logRunning});
+ service.sendData({'console': startZeroNetLog + '\n'});
+ var python = zeroNetNativeDir + '/libpython3.8.so';
+ var openssl = zeroNetNativeDir + '/libopenssl.so';
+ var trackerFile = trackersDir.path + '/${trackerFileNames[0]}';
+ printOut('python file : $python');
+ printOut('openssl file : $openssl');
+ if (File(python).existsSync()) {
+ Process.start('$python', [
+ zeronet,
+ if (debugZeroNetCode) '--debug',
+ "--start_dir",
+ zeroNetDir,
+ "--openssl_bin_file",
+ openssl,
+ if (enableZeroNetAddTrackers) '--trackers_file',
+ if (enableZeroNetAddTrackers) trackerFile,
+ "--updatesite",
+ "1Update8crprmciJHwp2WXqkx2c4iYp18"
+ ], environment: {
+ "LD_LIBRARY_PATH": "$libDir:$libDir64:/system/lib64",
+ 'PYTHONHOME': '$dataDir/usr',
+ 'PYTHONPATH': '$python',
+ }).then((proc) {
+ zero = proc;
+ zero.stderr.listen((onData) {
+ service.sendData({'console': utf8.decode(onData)});
+ });
+ zero.stdout.listen((onData) {
+ service.sendData({'console': utf8.decode(onData)});
+ });
+ }).catchError((e) {
+ if (e is ProcessException) {
+ printOut(e.toString());
+ }
+ uiStore.setZeroNetStatus(ZeroNetStatus.ERROR);
+ service.sendData({'ZeroNetStatus': 'ERROR'});
+ service.sendData({'console': e.toString()});
+ });
+ // service.sendData({'ZeroNetStatus': 'RUNNING'});
+ } else {
+ //TODO: Improve Error Trace here
+ service.sendData({'console': 'Python Binary Not Found'});
+ uiStore.setZeroNetStatus(ZeroNetStatus.ERROR);
+ service.sendData({'ZeroNetStatus': 'ERROR'});
+ service.sendData({'console': 'zeroNetNativeDir : $zeroNetNativeDir'});
+ if (zeroNetNativeDir.isNotEmpty) {
+ var contents = Directory(zeroNetNativeDir).listSync(recursive: true);
+ for (var item in contents) {
+ service.sendData({'console': item.name});
+ service.sendData({'console': item.path});
+ }
+ } else {
+ service.sendData({'console': 'Initialising ZeroNet'});
+ }
+ }
+ } else {
+ shutDownZeronet();
+ }
+}
+
+void runZeroNetService({bool autoStart = false}) async {
+ printOut('runZeroNetService()');
+ bool autoStartService = autoStart
+ ? true
+ : (varStore.settings[autoStartZeroNetonBoot] as ToggleSetting).value;
+ bool filtersEnabled =
+ (varStore.settings[enableZeroNetFilters] as ToggleSetting).value ?? true;
+ if (filtersEnabled) await activateFilters();
+ printToConsole(startZeroNetLog);
+ //TODO?: Check for Bugs Here.
+ var serviceRunning = await FlutterBackgroundService().isServiceRunning();
+ printOut('serviceRunning : $serviceRunning');
+ if (!serviceRunning) {
+ uiStore.setZeroNetStatus(ZeroNetStatus.NOT_RUNNING);
+ service = FlutterBackgroundService();
+ }
+
+ FlutterBackgroundService.initialize(
+ runBgIsolate,
+ autoStart: autoStartService,
+ ).then((value) {
+ printOut('FlutterBackgroundService.initialize() : $value');
+ if (value) {
+ service = FlutterBackgroundService();
+ service.onDataReceived.listen(onBgServiceDataReceived);
+ if (zeroNetNativeDir.isNotEmpty) saveDataFile();
+ uiStore.setZeroNetStatus(ZeroNetStatus.INITIALISING);
+ // if (autoStart)
+ service.sendData({'cmd': 'runZeroNet'});
+ }
+ });
+}
+
+void runBgIsolate() {
+ WidgetsFlutterBinding.ensureInitialized();
+ service = FlutterBackgroundService();
+ service.onDataReceived.listen(onBgServiceDataReceivedForIsolate);
+ service.sendData({'status': 'Started Background Service Successfully'});
+ Timer(Duration(milliseconds: 0), () {
+ if (zeroNetStartedFromBoot || zeroNetNativeDir.isEmpty) {
+ setBgServiceRunningNotification();
+ if (zeroNetNativeDir.isEmpty || zeroNetNativeDir == null) {
+ loadSettings();
+ loadDataFile();
+ debugZeroNetCode =
+ (varStore.settings[debugZeroNet] as ToggleSetting).value;
+ enableTorLogConsole =
+ (varStore.settings[enableTorLog] as ToggleSetting).value;
+ enableZeroNetAddTrackers =
+ (varStore.settings[enableAdditionalTrackers] as ToggleSetting)
+ .value;
+ vibrateonZeroNetStart =
+ (varStore.settings[vibrateOnZeroNetStart] as ToggleSetting).value;
+ printOut('runBgIsolate() > runZeroNet()');
+ runZeroNet();
+ setZeroNetRunningNotification();
+ }
+ }
+ });
+}
+
+void onBgServiceDataReceivedForIsolate(Map data) {
+ if (data.keys.first == 'cmd') {
+ switch (data.values.first) {
+ case 'runZeroNet':
+ printOut('onBgServiceDataReceivedForIsolate() > runZeroNet()');
+ runZeroNet();
+ break;
+ case 'shutDownZeronet':
+ service.stopBackgroundService();
+ uiStore.setZeroNetStatus(ZeroNetStatus.NOT_RUNNING);
+ break;
+ default:
+ }
+ } else if (data.keys.first == 'init') {
+ Map initMap = data['init'];
+ zeroNetNativeDir = initMap['zeroNetNativeDir'];
+ debugZeroNetCode = initMap['debugZeroNetCode'];
+ enableTorLogConsole = initMap['enableTorLog'];
+ zeroNetStartedFromBoot = initMap['zeroNetStartedFromBoot'];
+ vibrateonZeroNetStart = initMap['vibrateOnZeroNetStart'];
+ enableZeroNetAddTrackers = initMap['enableAdditionalTrackers'];
+ setBgServiceRunningNotification();
+ } else if (data.keys.first == 'notification') {
+ if (data.values.first == 'ZeroNetStatus.RUNNING') {
+ setZeroNetRunningNotification();
+ } else if (data.values.first == 'BgService.RUNNING') {
+ setBgServiceRunningNotification();
+ }
+ }
+}
+
+void setZeroNetRunningNotification() {
+ service.setNotificationInfo(
+ title: strController.znNotiRunningTitleStr.value,
+ content: strController.znNotiRunningDesStr.value,
+ );
+}
+
+void setBgServiceRunningNotification() {
+ service.setNotificationInfo(
+ title: strController.znNotiNotRunningTitleStr.value,
+ content: strController.znNotiNotRunningDesStr.value,
+ );
+}
+
+void onBgServiceDataReceived(Map data) {
+ if (data.keys.first == 'status') {
+ service.sendData({'notification': 'BgService.RUNNING'});
+ service.sendData({
+ 'init': {
+ 'zeroNetNativeDir': zeroNetNativeDir,
+ 'zeroNetStartedFromBoot': false,
+ 'debugZeroNetCode':
+ (varStore.settings[debugZeroNet] as ToggleSetting).value,
+ 'enableTorLog':
+ (varStore.settings[enableTorLog] as ToggleSetting).value,
+ 'vibrateOnZeroNetStart':
+ (varStore.settings[vibrateOnZeroNetStart] as ToggleSetting).value,
+ 'enableAdditionalTrackers':
+ (varStore.settings[enableAdditionalTrackers] as ToggleSetting)
+ .value,
+ }
+ });
+ if (zeroNetNativeDir.isEmpty || zeroNetNativeDir == null) {
+ printToConsole('zeroNetNativeDir is Empty');
+ } else if ((varStore.settings[autoStartZeroNet] as ToggleSetting).value ==
+ true) {
+ service.sendData({'cmd': 'runZeroNet'});
+ }
+ } else if (data.keys.first == 'ZeroNetStatus') {
+ switch (data.values.first) {
+ case 'INITIALISING':
+ uiStore.setZeroNetStatus(ZeroNetStatus.INITIALISING);
+ break;
+ case 'RUNNING':
+ uiStore.setZeroNetStatus(ZeroNetStatus.RUNNING);
+ runZeroNetWs();
+ break;
+ case 'ERROR':
+ uiStore.setZeroNetStatus(ZeroNetStatus.ERROR);
+ break;
+ default:
+ }
+ } else if (data.keys.first == 'console') {
+ printToConsole(data.values.first);
+ }
+}
+
+void runZeroNetWs({String address}) {
+ var zeroNetUrlL = zeroNetUrl.isNotEmpty ? zeroNetUrl : defZeroNetUrl;
+ zeroNetUrl = zeroNetUrlL;
+ if (varStore.zeroNetWrapperKey.isEmpty) {
+ try {
+ ZeroNet.instance
+ .getWrapperKey(
+ zeroNetUrl + Utils.urlHello,
+ override: true,
+ )
+ .then((value) {
+ if (value != null) {
+ // ZeroNet.wrapperKey = value;
+ varStore.zeroNetWrapperKey = value;
+ browserUrl = zeroNetUrl;
+ ZeroNet.instance.connect(
+ // zeroNetIPwithPort(defZeroNetUrl),
+ address ?? Utils.urlHello,
+ override: true,
+ );
+ }
+ });
+ } catch (e) {
+ // printToConsole(e);
+ }
+ } else {
+ // ZeroNet.wrapperKey = varStore.zeroNetWrapperKey;
+ browserUrl = zeroNetUrl;
+ }
+}
+
+void restartZeroNet() {
+ ZeroNet.instance.shutDown();
+ service.sendData({'cmd': 'runZeroNet'});
+}
+
+void shutDownZeronet() {
+ if (uiStore.zeroNetStatus.value == ZeroNetStatus.RUNNING) {
+ service.sendData({'cmd': 'shutDownZeronet'});
+ runZeroNetWs();
+ if (ZeroNet.isInitialised)
+ ZeroNet.instance.shutDown();
+ else {
+ runZeroNetWs(address: Utils.urlHello);
+ try {
+ ZeroNet.instance.shutDown();
+ } catch (e) {
+ printOut(e);
+ }
+ }
+ zeroNetUrl = '';
+ uiStore.setZeroNetStatus(ZeroNetStatus.NOT_RUNNING);
+ }
+}
diff --git a/lib/others/zeronet_utils.dart b/lib/others/zeronet_utils.dart
index f941969..ad0d4f6 100644
--- a/lib/others/zeronet_utils.dart
+++ b/lib/others/zeronet_utils.dart
@@ -5,17 +5,25 @@ Future checkInitStatus() async {
loadUsersFromFileSystem();
setZeroBrowserThemeValues();
try {
- String url = defZeroNetUrl + Utils.initialSites['ZeroNetMobile']['url'];
+ var url = '';
+ var address = '';
+ if (Directory(getZeroNetDataDir().path + '/' + Utils.urlZeroNetMob)
+ .existsSync()) {
+ address = Utils.urlHello;
+ } else {
+ address = Utils.urlZeroNetMob;
+ }
+ url = defZeroNetUrl + address;
String key = await ZeroNet.instance.getWrapperKey(url);
zeroNetUrl = defZeroNetUrl;
varStore.zeroNetWrapperKey = key;
+ // zeroNetIPwithPort(defZeroNetUrl),
+ ZeroNet.instance.connect(address).catchError(
+ (onError) {
+ printToConsole(onError);
+ },
+ );
uiStore.setZeroNetStatus(ZeroNetStatus.RUNNING);
- ZeroNet.instance
- .connect(
- zeroNetIPwithPort(defZeroNetUrl),
- Utils.urlZeroNetMob,
- )
- .catchError((onError) => printToConsole(onError));
service.sendData({'notification': 'ZeroNetStatus.RUNNING'});
testUrl();
} catch (e) {
@@ -48,7 +56,8 @@ checkForAppUpdates() async {
if (updateDays > 3 && !kDebugMode) {
if (kIsPlayStoreInstall) {
AppUpdateInfo info = await InAppUpdate.checkForUpdate();
- if (info.updateAvailable && info.flexibleUpdateAllowed)
+ if (info.updateAvailability == UpdateAvailability.updateAvailable &&
+ info.flexibleUpdateAllowed)
uiStore.updateInAppUpdateAvailable(AppUpdate.AVAILABLE);
}
}
@@ -62,8 +71,14 @@ loadSitesFromFileSystem() {
loadUsersFromFileSystem() {
File usersFile = File(getZeroNetDataDir().path + '/users.json');
- if (usersFile.existsSync())
+ if (usersFile.existsSync()) {
usersAvailable = UserManager().loadUsersFromFile(usersFile);
+ var zeronetUser = getZeroIdUserName();
+ if (zeronetUser.isNotEmpty) {
+ uiStore.setZeroNetUserStatus(ZeroNetUserStatus.REGISTERED);
+ uiStore.setZeroNetUserId(zeronetUser);
+ }
+ }
}
setZeroBrowserThemeValues() {
@@ -71,274 +86,6 @@ setZeroBrowserThemeValues() {
zeroBrowserTheme = usersAvailable.first.settings.theme ?? 'light';
}
-runTorEngine() {
- service = FlutterBackgroundService();
- final tor = zeroNetNativeDir + '/libtor.so';
- if (File(tor).existsSync()) {
- service.sendData({'console': 'Running Tor Engine..'});
- Process.start('$tor', [], environment: {
- "LD_LIBRARY_PATH": "$libDir:$libDir64:/system/lib64",
- }).then((proc) {
- zero = proc;
- if (enableTorLogConsole) {
- zero.stderr.listen((onData) {
- service.sendData({'console': utf8.decode(onData)});
- });
- zero.stdout.listen((onData) {
- service.sendData({'console': utf8.decode(onData)});
- });
- }
- }).catchError((e) {
- if (e is ProcessException) {
- printOut(e.toString());
- }
- });
- } else {
- //TODO: Improve Error Trace here
- service.sendData({'console': 'Tor Binary Not Found'});
- uiStore.setZeroNetStatus(ZeroNetStatus.RUNNING);
- }
-}
-
-runZeroNet() {
- if (uiStore.zeroNetStatus == ZeroNetStatus.NOT_RUNNING ||
- uiStore.zeroNetStatus == ZeroNetStatus.ERROR) {
- uiStore.setZeroNetStatus(ZeroNetStatus.INITIALISING);
- service.sendData({'ZeroNetStatus': 'INITIALISING'});
- runTorEngine();
- log = '';
- service.sendData({'console': logRunning});
- service.sendData({'console': startZeroNetLog + '\n'});
- var python = zeroNetNativeDir + '/libpython3.8.so';
- var openssl = zeroNetNativeDir + '/libopenssl.so';
- var trackerFile = trackersDir.path + '/${trackerFileNames[7]}';
-
- if (File(python).existsSync()) {
- Process.start('$python', [
- zeronet,
- if (debugZeroNetCode) '--debug',
- "--start_dir",
- zeroNetDir,
- "--openssl_bin_file",
- openssl,
- if (enableZeroNetAddTrackers) '--trackers_file',
- if (enableZeroNetAddTrackers) trackerFile,
- ], environment: {
- "LD_LIBRARY_PATH": "$libDir:$libDir64:/system/lib64",
- 'PYTHONHOME': '$dataDir/usr',
- 'PYTHONPATH': '$python',
- }).then((proc) {
- zero = proc;
- zero.stderr.listen((onData) {
- service.sendData({'console': utf8.decode(onData)});
- });
- zero.stdout.listen((onData) {
- service.sendData({'console': utf8.decode(onData)});
- });
- }).catchError((e) {
- if (e is ProcessException) {
- printOut(e.toString());
- }
- uiStore.setZeroNetStatus(ZeroNetStatus.ERROR);
- service.sendData({'ZeroNetStatus': 'ERROR'});
- service.sendData({'console': e.toString()});
- });
- } else {
- //TODO: Improve Error Trace here
- service.sendData({'console': 'Python Binary Not Found'});
- uiStore.setZeroNetStatus(ZeroNetStatus.ERROR);
- service.sendData({'ZeroNetStatus': 'ERROR'});
- service.sendData({'console': 'zeroNetNativeDir : $zeroNetNativeDir'});
- var contents = Directory(zeroNetNativeDir).listSync(recursive: true);
- for (var item in contents) {
- service.sendData({'console': item.name()});
- service.sendData({'console': item.path});
- }
- }
- } else {
- shutDownZeronet();
- }
-}
-
-void runZeroNetService({bool autoStart = false}) async {
- bool autoStartService = autoStart
- ? true
- : (varStore.settings[autoStartZeroNetonBoot] as ToggleSetting).value;
- bool filtersEnabled =
- (varStore.settings[enableZeroNetFilters] as ToggleSetting).value ?? true;
- if (filtersEnabled) await activateFilters();
- printToConsole(startZeroNetLog);
- //TODO?: Check for Bugs Here.
- if (await FlutterBackgroundService().isServiceRunning())
- FlutterBackgroundService.initialize(
- runBgIsolate,
- autoStart: autoStartService,
- ).then((value) {
- if (value) {
- service = FlutterBackgroundService();
- service.onDataReceived.listen(onBgServiceDataReceived);
- if (zeroNetNativeDir.isNotEmpty) saveDataFile();
- uiStore.setZeroNetStatus(ZeroNetStatus.RUNNING);
- if (autoStart) service.sendData({'cmd': 'runZeroNet'});
- }
- });
-}
-
-void runBgIsolate() {
- WidgetsFlutterBinding.ensureInitialized();
- service = FlutterBackgroundService();
- service.onDataReceived.listen(onBgServiceDataReceivedForIsolate);
- service.sendData({'status': 'Started Background Service Successfully'});
- Timer(Duration(milliseconds: 500), () {
- if (zeroNetStartedFromBoot) {
- setBgServiceRunningNotification();
- if (zeroNetNativeDir.isEmpty || zeroNetNativeDir == null) {
- loadSettings();
- loadDataFile();
- debugZeroNetCode =
- (varStore.settings[debugZeroNet] as ToggleSetting).value;
- enableTorLogConsole =
- (varStore.settings[enableTorLog] as ToggleSetting).value;
- enableZeroNetAddTrackers =
- (varStore.settings[enableAdditionalTrackers] as ToggleSetting)
- .value;
- vibrateonZeroNetStart =
- (varStore.settings[vibrateOnZeroNetStart] as ToggleSetting).value;
- runZeroNet();
- setZeroNetRunningNotification();
- }
- }
- });
-}
-
-void onBgServiceDataReceivedForIsolate(Map data) {
- if (data.keys.first == 'cmd') {
- switch (data.values.first) {
- case 'runZeroNet':
- runZeroNet();
- break;
- case 'shutDownZeronet':
- service.stopBackgroundService();
- break;
- default:
- }
- } else if (data.keys.first == 'init') {
- Map initMap = data['init'];
- zeroNetNativeDir = initMap['zeroNetNativeDir'];
- debugZeroNetCode = initMap['debugZeroNetCode'];
- enableTorLogConsole = initMap['enableTorLog'];
- zeroNetStartedFromBoot = initMap['zeroNetStartedFromBoot'];
- vibrateonZeroNetStart = initMap['vibrateOnZeroNetStart'];
- enableZeroNetAddTrackers = initMap['enableAdditionalTrackers'];
- setBgServiceRunningNotification();
- } else if (data.keys.first == 'notification') {
- if (data.values.first == 'ZeroNetStatus.RUNNING') {
- setZeroNetRunningNotification();
- } else if (data.values.first == 'BgService.RUNNING') {
- setBgServiceRunningNotification();
- }
- }
-}
-
-setZeroNetRunningNotification() {
- service.setNotificationInfo(
- title: "ZeroNet Mobile is Running",
- content: "Click Here on this Notification to open app",
- );
-}
-
-setBgServiceRunningNotification() {
- service.setNotificationInfo(
- title: "ZeroNet Mobile is Not Running",
- content: "Open ZeroNet Mobile App and click start to run ZeroNet",
- );
-}
-
-void onBgServiceDataReceived(Map data) {
- if (data.keys.first == 'status') {
- service.sendData({'notification': 'BgService.RUNNING'});
- service.sendData({
- 'init': {
- 'zeroNetNativeDir': zeroNetNativeDir,
- 'zeroNetStartedFromBoot': false,
- 'debugZeroNetCode':
- (varStore.settings[debugZeroNet] as ToggleSetting).value,
- 'enableTorLog':
- (varStore.settings[enableTorLog] as ToggleSetting).value,
- 'vibrateOnZeroNetStart':
- (varStore.settings[vibrateOnZeroNetStart] as ToggleSetting).value,
- 'enableAdditionalTrackers':
- (varStore.settings[enableAdditionalTrackers] as ToggleSetting)
- .value,
- }
- });
- if (zeroNetNativeDir.isEmpty || zeroNetNativeDir == null) {
- printToConsole('zeroNetNativeDir is Empty');
- } else if ((varStore.settings[autoStartZeroNet] as ToggleSetting).value ==
- true) {
- service.sendData({'cmd': 'runZeroNet'});
- }
- } else if (data.keys.first == 'ZeroNetStatus') {
- switch (data.values.first) {
- case 'INITIALISING':
- uiStore.setZeroNetStatus(ZeroNetStatus.INITIALISING);
- break;
- case 'ERROR':
- uiStore.setZeroNetStatus(ZeroNetStatus.ERROR);
- break;
- default:
- }
- } else if (data.keys.first == 'console') {
- printToConsole(data.values.first);
- }
-}
-
-shutDownZeronet() {
- if (uiStore.zeroNetStatus == ZeroNetStatus.RUNNING) {
- service.sendData({'cmd': 'shutDownZeronet'});
- if (ZeroNet.isInitialised)
- ZeroNet.instance.shutDown();
- else {
- runZeroNetWs(address: Utils.urlHello);
- try {
- ZeroNet.instance.shutDown();
- } catch (e) {
- printOut(e);
- }
- }
- zeroNetUrl = '';
- uiStore.setZeroNetStatus(ZeroNetStatus.NOT_RUNNING);
- }
-}
-
-runZeroNetWs({String address}) {
- var zeroNetUrlL = zeroNetUrl.isNotEmpty ? zeroNetUrl : defZeroNetUrl;
- zeroNetUrl = zeroNetUrlL;
- if (varStore.zeroNetWrapperKey.isEmpty) {
- ZeroNet.instance
- .getWrapperKey(zeroNetUrl + Utils.initialSites['ZeroHello']['url'])
- .then((value) {
- if (value != null) {
- // ZeroNet.wrapperKey = value;
- varStore.zeroNetWrapperKey = value;
- browserUrl = zeroNetUrl;
- ZeroNet.instance.connect(
- zeroNetIPwithPort(defZeroNetUrl),
- address ?? Utils.urlZeroNetMob,
- );
- }
- });
- } else {
- // ZeroNet.wrapperKey = varStore.zeroNetWrapperKey;
- browserUrl = zeroNetUrl;
- }
-}
-
-restartZeroNet() {
- ZeroNet.instance.shutDown();
- service.sendData({'cmd': 'runZeroNet'});
-}
-
writeZeroNetConf(String str) {
File f = File(zeroNetDir + '/zeronet.conf');
if (f.existsSync()) {
@@ -396,7 +143,9 @@ List getZeroNameProfiles() {
}
String getZeroIdUserName() {
- File file = File(getZeroNetUsersFilePath());
+ var zeroNetUsersFilePath = getZeroNetUsersFilePath();
+ if (zeroNetUsersFilePath.isEmpty) return '';
+ File file = File(zeroNetUsersFilePath);
if (!file.existsSync()) return '';
Map map = json.decode(file.readAsStringSync());
var key = map.keys.first;
@@ -438,13 +187,29 @@ bool isLocalZitesExists() {
Future activateFilters() async {
File file = File(getZeroNetDataDir().path + '/filters.json');
- if (!file.existsSync()) {
+ File fileTemp = File(getZeroNetDataDir().path + '/filters-tmp.json');
+ if (!file.existsSync() || fileTemp.existsSync()) {
File deFile = File(getZeroNetDataDir().path + '/filters.json-deactive');
if (deFile.existsSync()) {
deFile.renameSync(getZeroNetDataDir().path + '/filters.json');
return true;
- } else
- return await saveFilterstoDevice(file);
+ } else {
+ await saveInAppFilterstoDevice();
+ var filtersFileName = '';
+ var filtersPath =
+ getZeroNetDataDir().path + '/${Utils.urlZeroNetMob}/filters/';
+ int len = 0;
+ var directory = Directory(filtersPath);
+ if (directory.existsSync()) len = directory.listSync().length;
+ if (len >= 4) {
+ filtersFileName = 'assets/filters/filters.json';
+ fileTemp.deleteSync(recursive: true);
+ } else {
+ filtersFileName = 'assets/filters/filters-tmp.json';
+ await saveFilterstoDevice(fileTemp, filtersFileName);
+ }
+ return await saveFilterstoDevice(file, filtersFileName);
+ }
}
return true;
}
@@ -457,9 +222,21 @@ Future deactivateFilters() async {
return true;
}
-Future saveFilterstoDevice(File file) async {
+Future saveInAppFilterstoDevice() async {
+ for (var filterName in filterFileNames) {
+ File file = File(
+ getZeroNetDataDir().path + '/tmp/filters/$filterName',
+ );
+ if (!file.existsSync()) {
+ await saveFilterstoDevice(file, 'assets/filters/$filterName');
+ }
+ }
+ return true;
+}
+
+Future saveFilterstoDevice(File file, String assetPath) async {
file.createSync(recursive: true);
- var data = (await rootBundle.load('assets/filters.json'));
+ var data = (await rootBundle.load(assetPath));
var buffer = data.buffer;
file.writeAsBytesSync(buffer.asUint8List(
data.offsetInBytes,
@@ -473,3 +250,143 @@ Future createTorDataDir() {
if (!torDir.existsSync()) torDir.createSync();
return Future.value(true);
}
+
+int getZeroNetRevision(String zeroNetDir) {
+ var file = File(zeroNetDir + '/src/Config.py');
+ var content = file.readAsStringSync();
+ var versionIndex = content.indexOf('self.rev = ');
+ var version = content.substring(versionIndex + 11, versionIndex + 15);
+ return int.parse(version);
+}
+
+String getZeroNetVersion(String zeroNetDir) {
+ var file = File(zeroNetDir + '/src/Config.py');
+ var content = file.readAsStringSync();
+ var versionIndex = content.indexOf('self.version = "');
+ content = content.substring(versionIndex + 16);
+ var endindex = content.indexOf('"');
+ var version = content.substring(0, endindex);
+ return version;
+}
+
+bool checkPatchNeeded() {
+ var zeroNetVersion = getZeroNetVersion(zeronetDir);
+ var zeroNetRevision = getZeroNetRevision(zeronetDir);
+ if (zeroNetRevision == 4555 && zeroNetVersion == '0.7.2') {
+ return true;
+ } else if (zeroNetRevision == 4556 && zeroNetVersion == '0.7.2-v3patched') {
+ return false;
+ }
+ return false;
+}
+
+Future downloadPatch(String version) async {
+ File patchFile = File(tempDir.path + '/$version.zip');
+ if (!patchFile.existsSync()) {
+ await downloadFile(zpatches, '$version.zip', tempDir.path);
+ }
+ Directory dir = Directory(tempDir.path + '/patches/$version');
+ if (!dir.existsSync()) {
+ unzipBytes(version, patchFile.readAsBytesSync(),
+ dest: '${tempDir.path}/patches/$version/');
+ }
+}
+
+Future downloadFile(String url, String fileName, String dir) async {
+ HttpClient httpClient = HttpClient();
+ File file;
+ String filePath = '';
+ String myUrl = '';
+
+ try {
+ myUrl = url + '/' + fileName;
+ var request = await httpClient.getUrl(Uri.parse(myUrl));
+ var response = await request.close();
+ if (response.statusCode == 200) {
+ var bytes = await consolidateHttpClientResponseBytes(response);
+ filePath = '$dir/$fileName';
+ file = File(filePath);
+ await file.writeAsBytes(bytes);
+ } else
+ filePath = 'Error code: ' + response.statusCode.toString();
+ } catch (ex) {
+ filePath = 'Can not fetch url';
+ }
+
+ return filePath;
+}
+
+void checkPatchAndApply(String patchPath, String zeroNetPath) {
+ var zeroNetVersion = getZeroNetVersion(zeroNetPath);
+ var zeroNetRevision = getZeroNetRevision(zeroNetPath);
+
+ if (zeroNetRevision == 4555 && zeroNetVersion == '0.7.2') {
+ printOut('Applying patch for 0.7.2');
+ applyPatch(patchPath, zeroNetPath);
+ } else if (zeroNetRevision == 4555 && zeroNetVersion == '0.7.2-torv3') {
+ printOut('Patch Already Applied for 0.7.2');
+ }
+}
+
+void applyPatch(String patchPath, String destination) {
+ var patchManifestFile = File(
+ patchPath + '/patch.manifest',
+ ).readAsStringSync();
+ var contents = patchManifestFile.split('\n');
+ for (var line in contents) {
+ if (line.startsWith('[{D_}]')) {
+ var filePath = line.replaceAll('[{D_}]', '');
+ var file = File(destination + '/' + filePath);
+ try {
+ file.deleteSync();
+ } catch (e) {
+ print(e);
+ }
+ } else if (line.startsWith('[{A_}]')) {
+ var name = line.replaceAll('[{A_}]', '');
+ var file = File(patchPath + '/' + name);
+ if (!file.existsSync()) {
+ // throw Exception('File does not exist');
+ }
+ var p = File(destination + '/' + name).parent;
+ if (!p.existsSync()) {
+ p.createSync();
+ }
+ File(file.path).copySync(destination + '/' + name);
+ } else if (line.startsWith('[{R_}]')) {
+ var params = line.replaceAll('[{R_}]', '').split('][');
+ var oldname = params[0].replaceAll('[', '');
+ var newname = params[1].replaceAll(']', '');
+ if (oldname.endsWith('/') && newname.endsWith('/')) {
+ try {
+ Directory(destination + '/' + oldname).renameSync(
+ destination + '/' + newname,
+ );
+ } catch (e) {
+ print(e);
+ }
+ } else {
+ try {
+ File(destination + '/' + oldname).renameSync(
+ destination + '/' + newname,
+ );
+ } catch (e) {
+ print(e);
+ }
+ }
+ } else if (line.startsWith('[{M_}]')) {
+ var path = line.replaceAll('[{M_}]', '');
+ var patchFile = File(patchPath + '/' + path + '.patch');
+ var destinationFile = File(destination + '/' + path);
+ var p = patchFromText(patchFile.readAsStringSync());
+
+ var dmp = DiffMatchPatch();
+ // var diff = dmp.diff(orgContent, patchedContent);
+ var result = dmp.patch_apply(p, destinationFile.readAsStringSync());
+ print('\n' + result[1].toString() + '\n');
+ if (!(result[1] as List).contains(false)) {
+ destinationFile.writeAsString(result[0]);
+ }
+ }
+ }
+}
diff --git a/lib/utils.dart b/lib/utils.dart
deleted file mode 100644
index 11e052e..0000000
--- a/lib/utils.dart
+++ /dev/null
@@ -1,590 +0,0 @@
-import 'dart:ui';
-
-import 'package:archive/archive.dart';
-import 'imports.dart';
-
-debugTime(Function func) {
- var start = DateTime.now();
- func();
- print(DateTime.now().difference(start).inMilliseconds);
-}
-
-printOut(Object object, {int lineBreaks = 0, bool isNative = false}) {
- if (kDebugMode || appVersion.contains('beta')) {
- var breaks = '';
- for (var i = 0; i < lineBreaks; i++) breaks = breaks + '\n';
- if (isNative)
- nativePrint(breaks + "$object" + breaks);
- else
- print(breaks + object + breaks);
- }
-}
-
-List md5List = [];
-bool isHashMatched(File file) {
- var bytes = file.readAsBytesSync();
- var digest = md5.convert(bytes).toString();
- for (var hash in md5List) {
- if (digest == hash) {
- return true;
- }
- }
- return false;
-}
-
-bool allFilesDownloaded() {
- bool isDownloaded = false;
- for (var item in files(arch)) {
- bool isLast = files(arch).length - 1 == files(arch).indexOf(item);
- File file = File(downloadedMetaDir(tempDir.path, item));
- if (file.existsSync()) {
- if (isLast) isDownloaded = true;
- } else {
- File f = File(tempDir.path + '/$item.zip');
- if (f.existsSync()) {
- if (!isHashMatched(f)) return false;
- file.createSync(recursive: true);
- if (isLast) isDownloaded = isHashMatched(f);
- }
- }
- }
- return isDownloaded;
-}
-
-initDownloadParams() async {
- await FlutterDownloader.initialize();
- bindDownloadIsolate();
- bindUnZipIsolate();
- FlutterDownloader.registerCallback(handleDownloads);
- packageInfo = await PackageInfo.fromPlatform();
- appVersion = packageInfo.version;
- buildNumber = packageInfo.buildNumber;
-}
-
-handleDownloads(String id, DownloadTaskStatus status, int progress) {
- final SendPort send = IsolateNameServer.lookupPortByName(isolateDownloadPort);
- send.send([id, status, progress]);
-}
-
-ReceivePort _downloadPort = ReceivePort();
-
-bindDownloadIsolate() {
- bool isSuccess = IsolateNameServer.registerPortWithName(
- _downloadPort.sendPort, isolateDownloadPort);
- if (!isSuccess) {
- _unbindDownloadIsolate();
- bindDownloadIsolate();
- return;
- }
- _downloadPort.listen((data) {
- String id = data[0];
- DownloadTaskStatus status = data[1];
- int progress = data[2];
- for (var item in downloadsMap.keys) {
- if (downloadsMap[item] == id) {
- downloadStatusMap[id] = progress;
- if (status == DownloadTaskStatus.complete)
- File(downloadedMetaDir(tempDir.path, item))
- .createSync(recursive: true);
- }
- }
- var progressA = 0;
- for (var key in downloadStatusMap.keys) {
- progressA = (progressA + downloadStatusMap[key]);
- }
- var nooffiles = files(arch).length;
- varStore.setLoadingPercent(progressA ~/ nooffiles);
- if ((progressA ~/ nooffiles) == 100) {
- isZeroNetDownloadedm = true;
- varStore.setLoadingStatus(installing);
- varStore.setLoadingPercent(0);
- check();
- }
- });
-}
-
-void _unbindDownloadIsolate() {
- IsolateNameServer.removePortNameMapping(isolateDownloadPort);
-}
-
-ReceivePort _unZipPort = ReceivePort();
-bool unZipIsolateBound = false;
-
-bindUnZipIsolate() {
- bool isSuccess = IsolateNameServer.registerPortWithName(
- _unZipPort.sendPort, isolateUnZipPort);
- if (!isSuccess) {
- _unbindUnZipIsolate();
- bindUnZipIsolate();
- return;
- }
- unZipIsolateBound = true;
- _unZipPort.listen((data) {
- String name = data[0];
- int currentFile = data[1];
- int totalFiles = data[2];
- var percent = (currentFile / totalFiles) * 100;
- if (percent.toInt() % 5 == 0) {
- varStore.setLoadingStatus('Installing $name');
- varStore.setLoadingPercent(percent.toInt());
- }
- if (percent == 100) {
- percentUnZip = percentUnZip + 100;
- }
- var nooffiles = files(arch).length;
- if (percentUnZip == nooffiles * 100) {
- printOut('Installation Completed', isNative: true);
- makeExecHelper();
- uninstallModules();
- check();
- }
- });
-}
-
-void _unbindUnZipIsolate() {
- IsolateNameServer.removePortNameMapping(isolateUnZipPort);
-}
-
-downloadBins() async {
- isDownloadExec = true;
-
- if (tempDir != null && arch != null) {
- int t = 0;
- for (var item in files(arch)) {
- t = t + 2;
- var file = File(tempDir.path + '/$item.zip');
- if (!file.existsSync()) {
- sesionKey = randomAlpha(10);
- var tempFilePath = downloadingMetaDir(
- tempDir.path,
- item,
- sesionKey,
- );
- if (!File(tempFilePath).existsSync()) {
- Timer(Duration(seconds: t), () {
- FlutterDownloader.enqueue(
- url: downloadLink(item),
- savedDir: tempDir.path,
- showNotification: false,
- openFileFromNotification: false,
- ).then((taskId) {
- File(tempFilePath).createSync(recursive: true);
- downloadsMap[item] = taskId;
- });
- });
- }
- } else {
- var bytes = file.readAsBytesSync();
- var digest = md5.convert(bytes).toString();
- var res = await client.get(md5hashLink);
- var list = json.decode(res.body) as List;
- list.forEach((f) => md5List.add(f as String));
- for (var hash in md5List) {
- if (digest == hash) {
- File f = File(downloadedMetaDir(tempDir.path, item));
- if (!f.existsSync()) f.createSync(recursive: true);
- printOut(item + ' downloaded');
- if (files(arch).length - 1 == files(arch).indexOf(item)) {
- isZeroNetDownloadedm = true;
- }
- }
- }
- }
- }
- check();
- }
-}
-
-unzip() async {
- downloadStatus = 0;
- for (var item in files(arch)) {
- downloadStatus = downloadStatus + 100;
- File f = File(tempDir.path + '/$item.zip');
- File f2 = File(tempDir.path + '/$item.installing');
- File f3 = File(tempDir.path + '/$item.installed');
- zeroNetState = state.INSTALLING;
- if (!(f2.existsSync() && f3.existsSync())) {
- if (f.path.contains('usr'))
- _unzipBytes(item, f.readAsBytesSync(), dest: 'usr/');
- else if (f.path.contains('site-packages'))
- _unzipBytes(item, f.readAsBytesSync(), dest: 'usr/lib/python3.8/');
- else
- _unzipBytes(item, f.readAsBytesSync());
- f2.createSync(recursive: true);
- }
- }
- isZeroNetInstalledm = await isZeroNetInstalled();
-}
-
-unZipinBg() async {
- if (arch != null)
- for (var item in files(arch)) {
- File f = File(tempDir.path + '/$item.zip');
- File f2 = File(installingMetaDir(tempDir.path, item, sesionKey));
- zeroNetState = state.INSTALLING;
- if (!(f2.existsSync())) {
- f2.createSync(recursive: true);
- if (f.path.contains('usr') || f.path.contains('tor')) {
- await compute(
- _unzipBytesAsync,
- UnzipParams(
- item,
- f.readAsBytesSync(),
- dest: 'usr/',
- ),
- );
- } else if (f.path.contains('site_packages') ||
- f.path.contains('lib-dynload')) {
- await compute(
- _unzipBytesAsync,
- UnzipParams(
- item,
- f.readAsBytesSync(),
- dest: 'usr/lib/python3.8/',
- ),
- );
- } else if (f.path.contains('python38')) {
- await compute(
- _unzipBytesAsync,
- UnzipParams(
- item,
- f.readAsBytesSync(),
- dest: 'usr/lib/',
- ),
- );
- } else {
- await compute(
- _unzipBytesAsync,
- UnzipParams(
- item,
- f.readAsBytesSync(),
- ),
- );
- }
- }
- }
- // printOut('Dont Call this Function Twice');
- // check();
-}
-
-void _unzipBytesAsync(UnzipParams params) async {
- printOut("UnZippingFiles.......");
- var out = dataDir + '/' + params.dest;
- Archive archive = ZipDecoder().decodeBytes(params.bytes);
- int totalfiles = archive.length;
- int i = 0;
- for (ArchiveFile file in archive) {
- String filename = file.name;
- printOut('$out$filename');
- i++;
- final SendPort send = IsolateNameServer.lookupPortByName(isolateUnZipPort);
- send.send([params.item, i, totalfiles]);
- String outName = '$out' + filename;
- if (file.isFile) {
- List data = file.content;
- // if (!File(outName).existsSync()) {
- File f = File(outName);
- if (!f.existsSync())
- f
- ..createSync(recursive: true)
- ..writeAsBytesSync(data);
- // }
- } else {
- Directory(outName).exists().then((exists) {
- if (!exists) Directory(outName)..create(recursive: true);
- });
- }
- }
- File(installedMetaDir(metaDir.path, params.item)).createSync(recursive: true);
-}
-
-int percentUnZip = 0;
-
-_unzipBytes(String name, List bytes, {String dest = ''}) async {
- printOut("UnZippingFiles.......");
- var out = dataDir + '/' + dest;
- Archive archive = ZipDecoder().decodeBytes(bytes);
- for (ArchiveFile file in archive) {
- String filename = file.name;
- printOut('$out$filename');
- String outName = '$out' + filename;
- if (file.isFile) {
- List data = file.content;
- // if (!File(outName).existsSync()) {
- File(outName).exists().then((onValue) {
- if (!onValue) {
- File(outName)
- ..createSync(recursive: true)
- ..writeAsBytes(data).then((f) {
- bool isBin = f.path.contains('bin');
- if (isBin)
- makeExec(f.path);
- else if (f.path.contains('.so')) makeExec(f.path);
- });
- }
- });
- // }
- } else {
- Directory(outName).exists().then((exists) {
- if (!exists) Directory(outName)..create(recursive: true);
- });
- }
- }
- File(installedMetaDir(tempDir.path, name)).createSync(recursive: true);
-}
-
-Future makeExecHelper() async {
- for (var item in soDirs) {
- var dir = Directory(dataDir + '/$item');
- if (dir.existsSync()) {
- var list = dir.listSync();
- for (var item in list) {
- if (item is File) {
- printOut(item.path);
- makeExec(item.path);
- }
- }
- }
- }
- return true;
-}
-
-makeExec(String path) => Process.runSync('chmod', ['744', path]);
-
-load() async {
- if (arch == null) await init();
- isZeroNetInstalled().then((onValue) {
- isZeroNetInstalledm = onValue;
- if (!isZeroNetInstalledm)
- isZeroNetDownloaded().then((onValue) {
- isZeroNetDownloadedm = onValue;
- });
- });
-}
-
-Future isZeroNetInstalled() async {
- bool isExists = false;
- for (var item in files(arch)) {
- File f = File(installedMetaDir(metaDir.path, item));
- var exists = f.existsSync();
- if (!exists) return Future.value(exists);
- isExists = exists;
- }
- return isExists;
-}
-
-Future isZeroNetDownloaded() async {
- bool isExists = false;
- if (await isModuleInstallSupported()) {
- if (await isRequiredModulesInstalled()) {
- for (var item in files(arch)) {
- var i = files(arch).indexOf(item);
- bool f2 = File(tempDir.path + '/$item.zip').existsSync();
- if (i == files(arch).length - 1) {
- isExists = f2;
- } else if (!f2) {
- return false;
- }
- }
- }
- } else {
- for (var item in files(arch)) {
- var i = binDirs.indexOf(item);
- bool f = File(downloadedMetaDir(tempDir.path, item)).existsSync();
- // bool f1 = File(tempDir.path + '/$item.downloading').existsSync();
- bool f2 = File(tempDir.path + '/$item.zip').existsSync();
- bool isAllDownloaded = allFilesDownloaded();
- var exists = ((f && f2) || isAllDownloaded);
- if (!exists) return Future.value(exists);
- if (i == binDirs.length - 1) {
- isExists = exists;
- }
- }
- varStore.isZeroNetDownloaded(isExists);
- }
- return isExists;
-}
-
-installPlugin(File file) async {
- await compute(
- _unzipBytesAsync,
- UnzipParams(
- 'plugin',
- file.readAsBytesSync(),
- dest: 'ZeroNet-py3/plugins/',
- ),
- );
-}
-
-runTorEngine() {
- final tor = zeroNetNativeDir + '/libtor.so';
- if (File(tor).existsSync()) {
- printToConsole('Running Tor Engine..');
- Process.start('$tor', [], environment: {
- "LD_LIBRARY_PATH": "$libDir:$libDir64:/system/lib64",
- }).then((proc) {
- zero = proc;
- zero.stderr.listen((onData) {
- // printToConsole(utf8.decode(onData));
- });
- zero.stdout.listen((onData) {
- // printToConsole(utf8.decode(onData));
- });
- }).catchError((e) {
- if (e is ProcessException) {
- printOut(e.toString());
- }
- });
- } else
- //TODO: Improve Error Trace here
- printToConsole('Tor Binary Not Found');
-}
-
-runZeroNet() {
- if (varStore.zeroNetStatus == 'Not Running') {
- varStore.setZeroNetStatus('Initialising...');
- runTorEngine();
- log = '';
- printToConsole(logRunning);
- printToConsole(startZeroNetLog + '\n');
- var python = zeroNetNativeDir + '/libpython3.8.so';
- var openssl = zeroNetNativeDir + '/libopenssl.so';
-
- if (File(python).existsSync()) {
- var debug = (varStore.settings[debugZeroNet] as ToggleSetting).value;
- Process.start('$python', [
- zeronet,
- if (debug) '--debug',
- "--start_dir",
- zeroNetDir,
- "--openssl_bin_file",
- openssl
- ], environment: {
- "LD_LIBRARY_PATH": "$libDir:$libDir64:/system/lib64",
- 'PYTHONHOME': '$dataDir/usr',
- 'PYTHONPATH': '$python',
- }).then((proc) {
- zero = proc;
- zero.stderr.listen((onData) {
- printToConsole(utf8.decode(onData));
- });
- zero.stdout.listen((onData) {
- printToConsole(utf8.decode(onData));
- });
- }).catchError((e) {
- if (e is ProcessException) {
- printOut(e.toString());
- }
- varStore.setZeroNetStatus('Not Running');
- });
- } else {
- //TODO: Improve Error Trace here
- printToConsole('Python Binary Not Found');
- var contents = Directory(zeroNetNativeDir).listSync(recursive: true);
- for (var item in contents) {
- printToConsole(item.name());
- printToConsole(item.path);
- }
- }
- } else {
- shutDownZeronet();
- }
-}
-
-shutDownZeronet() {
- if (varStore.zeroNetStatus == 'Running') {
- if (ZeroNet.isInitialised)
- ZeroNet.instance.shutDown();
- else {
- runZeroNetWs();
- try {
- ZeroNet.instance.shutDown();
- } catch (e) {
- printOut(e);
- }
- }
- zeroNetUrl = '';
- varStore.setZeroNetStatus('Not Running');
- }
-}
-
-runZeroNetWs() {
- var zeroNetUrlL = zeroNetUrl.isNotEmpty ? zeroNetUrl : defZeroNetUrl;
- zeroNetUrl = zeroNetUrlL;
- if (varStore.zeroNetWrapperKey.isEmpty) {
- ZeroNet.instance
- .getWrapperKey(zeroNetUrl + Utils.initialSites['ZeroHello']['url'])
- .then((value) {
- if (value != null) {
- ZeroNet.wrapperKey = value;
- varStore.zeroNetWrapperKey = value;
- browserUrl = zeroNetUrl;
- }
- });
- } else {
- ZeroNet.wrapperKey = varStore.zeroNetWrapperKey;
- browserUrl = zeroNetUrl;
- }
-}
-
-restartZeroNet() {
- ZeroNet.instance.shutDown();
- runZeroNet();
-}
-
-writeZeroNetConf(String str) {
- File f = File(zeroNetDir + '/zeronet.conf');
- if (f.existsSync()) {
- f.writeAsStringSync('\n' + str, mode: FileMode.append);
- } else {
- f.writeAsStringSync('[global]\n$str');
- }
-}
-
-//TODO : Move These ZeroNet Func to Seperate dart file.
-bool isZeroNetUserDataExists() {
- return getZeroNetUsersFilePath().isNotEmpty;
-}
-
-String getZeroNetUsersFilePath() {
- var dataDir = getZeroNetDataDir();
- if (dataDir.existsSync()) {
- File f = File(dataDir.path + '/users.json');
- bool exists = f.existsSync();
- if (exists) {
- return f.path;
- }
- return zeroNetDir + '/data/users.json';
- } else {
- dataDir.createSync(recursive: true);
- File f = File(dataDir.path + '/users.json');
- f.createSync(recursive: true);
- return f.path;
- }
-}
-
-Directory getZeroNetDataDir() => Directory(
- ((varStore.settings[publicDataFolder] as ToggleSetting).value
- ? appPrivDir.path
- : zeroNetDir) +
- '/data',
- );
-
-List getZeroNameProfiles() {
- List list = [];
- if (getZeroNetDataDir().existsSync())
- for (var item in getZeroNetDataDir().listSync()) {
- if (item is File) {
- if (item.path.endsWith('.json')) {
- var name = item.path.replaceAll(getZeroNetDataDir().path + '/', '');
- if (name.startsWith('users-')) {
- var username =
- name.replaceAll('users-', '').replaceAll('.json', '');
- list.add(username);
- printOut(username);
- }
- }
- }
- }
- return list;
-}
diff --git a/lib/widgets/about_page.dart b/lib/widgets/about_page.dart
index 0b24db0..8688cc0 100644
--- a/lib/widgets/about_page.dart
+++ b/lib/widgets/about_page.dart
@@ -1,5 +1,3 @@
-import 'dart:ui';
-
import 'package:purchases_flutter/purchases_flutter.dart';
import '../imports.dart';
@@ -13,6 +11,7 @@ class AboutPage extends StatelessWidget {
return Future.value(false);
},
child: Container(
+ color: uiStore.currentTheme.value.primaryColor,
child: SingleChildScrollView(
child: Column(
children: [
@@ -37,11 +36,13 @@ class AboutPage extends StatelessWidget {
Flexible(
child: Container(
child: Text(
- 'ZeroNet Mobile is a full native client for ZeroNet, a platform for decentralized websites using Bitcoin ',
+ strController.aboutAppDesStr.value,
style: GoogleFonts.roboto(
fontSize: 20.0,
fontWeight: FontWeight.w500,
height: 1.5,
+ color:
+ uiStore.currentTheme.value.primaryTextColor,
),
),
),
@@ -51,16 +52,16 @@ class AboutPage extends StatelessWidget {
Container(
child: Text.rich(
TextSpan(
- text:
- 'crypto and the BitTorrent network. you can learn more about ZeroNet at ',
+ text: strController.aboutAppDes1Str.value,
style: GoogleFonts.roboto(
fontSize: 20.0,
fontWeight: FontWeight.w500,
height: 1.5,
+ color: uiStore.currentTheme.value.primaryTextColor,
),
children: [
TextSpan(
- text: 'https://zeronet.io/',
+ text: 'https://zeronet.dev/',
style: GoogleFonts.roboto(
fontSize: 20.0,
fontWeight: FontWeight.w500,
@@ -70,7 +71,7 @@ class AboutPage extends StatelessWidget {
),
recognizer: TapGestureRecognizer()
..onTap = () {
- launch('https://zeronet.io/');
+ launch('https://zeronet.dev/');
},
),
],
@@ -89,19 +90,21 @@ class AboutPage extends StatelessWidget {
padding: const EdgeInsets.all(8.0),
),
Text(
- 'Contribute',
+ strController.contributeStr.value,
style: GoogleFonts.roboto(
fontSize: 20.0,
fontWeight: FontWeight.bold,
+ color: uiStore.currentTheme.value.primaryTextColor,
),
),
Padding(
padding: const EdgeInsets.all(4.0),
),
Text(
- "If you want to support project's further development, you can contribute your time or money, If you want to contribute money you can send bitcoin or other supported crypto currencies to above addresses or buy in-app purchases, if want to contribute translations or code, visit official GitHub repo.",
+ strController.contributeDesStr.value,
style: GoogleFonts.roboto(
fontSize: 18.0,
+ color: uiStore.currentTheme.value.primaryTextColor,
),
),
Padding(
@@ -126,10 +129,11 @@ class DonationWidget extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
- 'Donation Addresses',
+ strController.donationAddrsStr.value,
style: GoogleFonts.roboto(
fontSize: 18.0,
fontWeight: FontWeight.bold,
+ color: uiStore.currentTheme.value.primaryTextColor,
),
),
Padding(
@@ -139,42 +143,45 @@ class DonationWidget extends StatelessWidget {
builder: (ctx, cons) {
List children = [];
for (var crypto in donationsAddressMap.keys) {
- children.add(
- Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Text(
- crypto,
- style: GoogleFonts.roboto(
- fontSize: 16.0,
+ var enabled = true;
+ if (crypto == 'Liberapay') {
+ if (!enableExternalDonations) enabled = false;
+ }
+ if (enabled)
+ children.add(
+ Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text(
+ crypto,
+ style: GoogleFonts.roboto(
+ fontSize: 16.0,
+ color: uiStore.currentTheme.value.primaryTextColor,
+ ),
),
- ),
- ClickableTextWidget(
- text: donationsAddressMap[crypto],
- textStyle: GoogleFonts.roboto(
- fontSize: 15.0,
- fontWeight: FontWeight.w500,
- height: 1.5,
- color: Color(0xFF8663FF),
- decoration: TextDecoration.underline,
+ ClickableTextWidget(
+ text: donationsAddressMap[crypto],
+ textStyle: GoogleFonts.roboto(
+ fontSize: 15.0,
+ fontWeight: FontWeight.w500,
+ height: 1.5,
+ color: Color(0xFF8663FF),
+ decoration: TextDecoration.underline,
+ ),
+ onClick: () {
+ FlutterClipboard.copy(donationsAddressMap[crypto]);
+ Get.showSnackbar(GetBar(
+ message: '$crypto '
+ '${strController.donAddrCopiedStr.value}',
+ ));
+ },
),
- onClick: () {
- FlutterClipboard.copy(donationsAddressMap[crypto]);
- Scaffold.of(context).showSnackBar(
- SnackBar(
- content: Text(
- '$crypto Donation Address Copied to Clipboard',
- ),
- ),
- );
- },
- ),
- Padding(
- padding: const EdgeInsets.all(6.0),
- )
- ],
- ),
- );
+ Padding(
+ padding: const EdgeInsets.all(6.0),
+ )
+ ],
+ ),
+ );
}
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
@@ -184,9 +191,10 @@ class DonationWidget extends StatelessWidget {
),
Flexible(
child: Text(
- "* Click on Address to copy",
+ strController.clickAddrToCopyStr.value,
style: GoogleFonts.roboto(
fontSize: 16.0,
+ color: uiStore.currentTheme.value.primaryTextColor,
),
),
),
@@ -199,15 +207,10 @@ class DonationWidget extends StatelessWidget {
),
Flexible(
child: Text(
- "* Any Donation can activate all pro-features in app, "
- "these are just an encouragement to me to work more on the app. "
- "Pro-features will be made available to general public after certain time, "
- "thus you don't need to worry about exclusiveness of a feature. "
- "If you donate from any source other than Google Play Purchase, "
- "just send your transaction id to canews.in@gmail.com / ZeroMail: zeromepro, "
- "so than I can send activation code to activate pro-features.",
+ strController.donationDes.value,
style: GoogleFonts.roboto(
fontSize: 16.0,
+ color: uiStore.currentTheme.value.primaryTextColor,
),
),
)
@@ -223,10 +226,11 @@ class DeveloperWidget extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
- 'Developers',
+ strController.developersStr.value,
style: GoogleFonts.roboto(
fontSize: 20.0,
fontWeight: FontWeight.bold,
+ color: uiStore.currentTheme.value.primaryTextColor,
),
),
Padding(padding: const EdgeInsets.all(4.0)),
@@ -240,6 +244,7 @@ class DeveloperWidget extends StatelessWidget {
borderRadius: BorderRadius.circular(12.0),
),
elevation: 4.0,
+ color: uiStore.currentTheme.value.cardBgColor,
child: Container(
padding: const EdgeInsets.only(left: 8.0, right: 8.0),
decoration: BoxDecoration(
@@ -264,15 +269,17 @@ class DeveloperWidget extends StatelessWidget {
style: GoogleFonts.roboto(
fontSize: 20.0,
fontWeight: FontWeight.w500,
+ color: uiStore
+ .currentTheme.value.primaryTextColor,
),
),
LayoutBuilder(builder: (context, cons) {
List children = [];
final iconsPath = 'assets/icons';
List assets = [
- '$iconsPath/github_dark.png',
- '$iconsPath/twitter_dark.png',
- '$iconsPath/facebook_dark.png',
+ '$iconsPath/github${uiStore.currentTheme.value == AppTheme.Light ? '_dark' : ''}.png',
+ '$iconsPath/twitter${uiStore.currentTheme.value == AppTheme.Light ? '_dark' : ''}.png',
+ '$iconsPath/facebook${uiStore.currentTheme.value == AppTheme.Light ? '_dark' : ''}.png',
];
List links = [
developer.githubLink,
@@ -327,26 +334,29 @@ class GooglePlayInAppPurchases extends StatelessWidget {
children: [
Text.rich(
TextSpan(
- text: 'Google Play Purchases ',
+ text: strController.googlePurchasesStr.value,
children: [
TextSpan(
- text: '(30% taken by Google) :',
+ text: strController.googleFeeWarningStr.value,
style: GoogleFonts.roboto(
fontSize: 14.0,
+ color: uiStore.currentTheme.value.primaryTextColor,
),
),
],
style: GoogleFonts.roboto(
fontSize: 18.0,
fontWeight: FontWeight.bold,
+ color: uiStore.currentTheme.value.primaryTextColor,
),
),
),
- Observer(builder: (ctx) {
+ Obx(() {
List mChildren = [];
Map> googlePurchasesTypes = {
- 'One Time': purchasesStore.oneTimePurchases,
- 'Monthly Subscriptions': purchasesStore.subscriptions,
+ strController.oneTimeSubStr.value:
+ purchasesStore.oneTimePurchases,
+ strController.monthlySubStr.value: purchasesStore.subscriptions,
};
for (var item in googlePurchasesTypes.keys) {
List purchases = googlePurchasesTypes[item];
@@ -372,23 +382,27 @@ class GooglePlayInAppPurchases extends StatelessWidget {
String label = '';
switch (i) {
case 0:
- label = 'Tip';
+ label = strController.tipStr.value;
c = Color(0xFF06CAB6);
break;
case 1:
- label = 'Coffee';
+ label = strController.coffeeStr.value;
c = Color(0xFF0696CA);
break;
case 2:
- label = 'Lunch';
+ label = strController.lunchStr.value;
c = Color(0xFFCA067B);
break;
default:
}
children.add(
- RaisedButton(
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(8.0),
+ ElevatedButton(
+ style: ButtonStyle(
+ backgroundColor: MaterialStateProperty.all(c),
+ shape: MaterialStateProperty.all(
+ RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(8.0)),
+ ),
),
child: Padding(
padding: const EdgeInsets.only(
@@ -406,8 +420,15 @@ class GooglePlayInAppPurchases extends StatelessWidget {
),
),
),
- color: c,
- onPressed: () => purchasePackage(package),
+ onPressed: () => uiStore.zeroNetUserStatus.value ==
+ ZeroNetUserStatus.NOT_REGISTERED
+ ? () {
+ Get.snackbar(
+ strController.tipStr.value + ':',
+ strController.createUserIdFirstStr.value,
+ );
+ }
+ : purchasePackage(package),
),
);
}
@@ -420,6 +441,7 @@ class GooglePlayInAppPurchases extends StatelessWidget {
style: GoogleFonts.roboto(
fontSize: 16.0,
fontWeight: FontWeight.w500,
+ color: uiStore.currentTheme.value.primaryTextColor,
),
),
Padding(padding: const EdgeInsets.all(8.0)),
diff --git a/lib/widgets/common.dart b/lib/widgets/common.dart
index e38e768..0b8ca70 100644
--- a/lib/widgets/common.dart
+++ b/lib/widgets/common.dart
@@ -7,39 +7,40 @@ class ZeroNetAppBar extends StatelessWidget {
@override
Widget build(BuildContext context) {
- return Observer(builder: (context) {
+ return Obx(() {
return Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
- uiStore.currentAppRoute.title,
+ uiStore.currentAppRoute.value.title,
style: GoogleFonts.roboto(
fontSize: 32.0,
fontWeight: FontWeight.bold,
+ color: uiStore.currentTheme.value.primaryTextColor,
),
),
Row(
children: [
- if (uiStore.currentAppRoute == AppRoute.Settings)
+ if (uiStore.currentAppRoute.value == AppRoute.Settings)
InkWell(
child: Icon(
OMIcons.info,
size: 32.0,
- color: Colors.black,
+ color: uiStore.currentTheme.value.primaryTextColor,
),
onTap: () =>
uiStore.updateCurrentAppRoute(AppRoute.AboutPage),
),
- if (uiStore.currentAppRoute == AppRoute.Settings)
+ if (uiStore.currentAppRoute.value == AppRoute.Settings)
Padding(padding: const EdgeInsets.only(right: 20.0)),
InkWell(
child: Icon(
- uiStore.currentAppRoute.icon,
+ uiStore.currentAppRoute.value.icon,
size: 32.0,
- color: Colors.black,
+ color: uiStore.currentTheme.value.primaryTextColor,
),
- onTap: uiStore.currentAppRoute.onClick,
+ onTap: uiStore.currentAppRoute.value.onClick,
)
],
)
@@ -90,11 +91,19 @@ class _PluginManagerState extends State {
itemBuilder: (ctx, i) {
final isDisabled = disabledPlugins.contains(plugins[i]);
final pluginName = plugins[i];
+ if (pluginName == 'MyDonationMessage') {
+ if (!kisProUser) return Container();
+ }
return Row(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
- Text(pluginName),
+ Text(
+ pluginName,
+ style: TextStyle(
+ color: uiStore.currentTheme.value.primaryTextColor,
+ ),
+ ),
Switch(
onChanged: (value) {
if (isDisabled)
@@ -145,14 +154,17 @@ class _ProfileSwitcherUserNameEditTextState
return ListBody(
children: [
Text(
- 'Always remember to backup users.json before doing anything because, '
- 'we are not able to tell when a software will fail. '
- 'Click Backup below to backup your Existing users.json file.\n',
+ strController.backupWarningStr.value,
style: TextStyle(
color: Colors.red,
),
),
- Text('Username Phrase :'),
+ Text(
+ strController.usernamePhraseStr.value,
+ style: TextStyle(
+ color: uiStore.currentTheme.value.primaryTextColor,
+ ),
+ ),
Padding(
padding: const EdgeInsets.only(
left: 8.0,
@@ -164,18 +176,18 @@ class _ProfileSwitcherUserNameEditTextState
var valid = text.isNotEmpty;
if (valid) {
if (text.contains(' ')) {
- errorText = 'username can\'t contain spaces';
+ errorText = strController.usrnameWarning2Str.value;
valid = false;
} else if (text.length < 6) {
- errorText = 'username can\'t be less than 6 characters.';
+ errorText = strController.usrnameWarning3Str.value;
valid = false;
} else if (File(getZeroNetDataDir().path + '/users-$text.json')
.existsSync()) {
- errorText = 'username already exists, choose different one.';
+ errorText = strController.usrnameWarning4Str.value;
valid = false;
}
} else {
- errorText = 'username can\'t be Empty';
+ errorText = strController.usrnameWarning1Str.value;
}
setState(() {
validUsername = valid;
@@ -183,10 +195,14 @@ class _ProfileSwitcherUserNameEditTextState
},
style: TextStyle(
fontSize: 18.0,
+ color: uiStore.currentTheme.value.primaryTextColor,
),
decoration: InputDecoration(
- hintText: 'username',
+ hintText: strController.usernameStr.value.toLowerCase(),
errorText: validUsername ? null : errorText,
+ hintStyle: TextStyle(
+ color: uiStore.currentTheme.value.primaryTextColor,
+ ),
),
),
),
diff --git a/lib/widgets/home_page.dart b/lib/widgets/home_page.dart
index 5e96d96..5302881 100644
--- a/lib/widgets/home_page.dart
+++ b/lib/widgets/home_page.dart
@@ -6,6 +6,7 @@ class HomePage extends StatelessWidget {
Widget build(BuildContext context) {
return Container(
height: MediaQuery.of(context).size.height,
+ color: uiStore.currentTheme.value.primaryColor,
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
@@ -21,6 +22,7 @@ class HomePage extends StatelessWidget {
padding: EdgeInsets.only(bottom: 30),
),
ZeroNetStatusWidget(),
+ ZeroNetUserStatusWidget(),
Padding(
padding: EdgeInsets.only(bottom: 15),
),
@@ -54,33 +56,38 @@ class HomePage extends StatelessWidget {
class InAppUpdateWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
- return Observer(builder: (context) {
- if (uiStore.appUpdate != AppUpdate.NOT_AVAILABLE)
+ return Obx(() {
+ if (uiStore.appUpdate.value != AppUpdate.NOT_AVAILABLE)
return Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Text(
- 'App Update Available : ',
+ strController.appUpdateAvailableStr.value,
style: GoogleFonts.roboto(
fontSize: 20.0,
fontWeight: FontWeight.w500,
),
),
- RaisedButton(
- onPressed: uiStore.appUpdate.action,
- color: Color(0xFF008297),
- padding: EdgeInsets.only(left: 10, right: 10),
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(30.0),
+ ElevatedButton(
+ onPressed: uiStore.appUpdate.value.action,
+ style: ButtonStyle(
+ backgroundColor: MaterialStateProperty.all(Color(0xFF008297)),
+ shape: MaterialStateProperty.all(
+ RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(30.0),
+ ),
+ ),
+ padding: MaterialStateProperty.all(
+ EdgeInsets.only(left: 10, right: 10)),
),
- child: Observer(builder: (context) {
+ child: Obx(() {
return Text(
- uiStore.appUpdate.text,
+ uiStore.appUpdate.value.text,
style: GoogleFonts.roboto(
fontSize: 20.0,
fontWeight: FontWeight.w500,
- color: Colors.white,
+ color: uiStore.currentTheme.value.btnTextColor,
),
);
}),
@@ -95,19 +102,24 @@ class InAppUpdateWidget extends StatelessWidget {
class AboutButtonWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
- return RaisedButton(
+ return ElevatedButton(
onPressed: () => uiStore.updateCurrentAppRoute(AppRoute.AboutPage),
- color: Color(0xFFAA5297),
- padding: EdgeInsets.only(top: 10, bottom: 10, left: 30, right: 30),
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(30.0),
+ style: ButtonStyle(
+ backgroundColor: MaterialStateProperty.all(Color(0xFFAA5297)),
+ shape: MaterialStateProperty.all(
+ RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(30.0),
+ ),
+ ),
+ padding: MaterialStateProperty.all(
+ EdgeInsets.only(top: 10, bottom: 10, left: 30, right: 30)),
),
child: Text(
- 'Know More',
+ strController.knowMoreStr.value,
style: GoogleFonts.roboto(
fontSize: 16.0,
fontWeight: FontWeight.normal,
- color: Colors.white,
+ color: uiStore.currentTheme.value.btnTextColor,
),
),
);
@@ -117,7 +129,7 @@ class AboutButtonWidget extends StatelessWidget {
class RatingButtonWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
- return RaisedButton(
+ return ElevatedButton(
onPressed: () async {
final InAppReview inAppReview = InAppReview.instance;
//TODO: remove this once we support non playstore reviews.
@@ -127,17 +139,22 @@ class RatingButtonWidget extends StatelessWidget {
//TODO: Handle this case. eg: Non-PlayStore Install, Already Reviewed Users etc.
}
},
- color: Color(0xFF008297),
- padding: EdgeInsets.only(top: 10, bottom: 10, left: 30, right: 30),
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(30.0),
+ style: ButtonStyle(
+ backgroundColor: MaterialStateProperty.all(Color(0xFF008297)),
+ shape: MaterialStateProperty.all(
+ RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(30.0),
+ ),
+ ),
+ padding: MaterialStateProperty.all(
+ EdgeInsets.only(top: 10, bottom: 10, left: 30, right: 30)),
),
child: Text(
- 'Give Your Rating/Feedback',
+ strController.ratingWgtStr.value,
style: GoogleFonts.roboto(
fontSize: 16.0,
fontWeight: FontWeight.normal,
- color: Colors.white,
+ color: uiStore.currentTheme.value.btnTextColor,
),
),
);
@@ -152,59 +169,60 @@ class ZeroNetStatusWidget extends StatelessWidget {
Row(
children: [
Text(
- 'Status',
+ strController.statusStr.value,
style: GoogleFonts.roboto(
fontSize: 20,
fontWeight: FontWeight.bold,
+ color: uiStore.currentTheme.value.primaryTextColor,
),
),
Spacer(
flex: 1,
),
- Observer(
- builder: (context) {
+ Obx(
+ () {
return Chip(
label: Padding(
padding: const EdgeInsets.all(2.0),
child: Text(
- uiStore.zeroNetStatus.message,
+ uiStore.zeroNetStatus.value.message,
style: GoogleFonts.roboto(
- fontSize: 20,
- color: Colors.white,
+ fontSize: 18,
+ color: uiStore.currentTheme.value.btnTextColor,
),
),
),
- backgroundColor: uiStore.zeroNetStatus.statusChipColor,
+ backgroundColor: uiStore.zeroNetStatus.value.statusChipColor,
);
},
),
Spacer(
flex: 1,
),
- Observer(builder: (context) {
+ Obx(() {
return InkWell(
- onTap: uiStore.zeroNetStatus.onAction,
+ onTap: uiStore.zeroNetStatus.value.onAction,
child: Chip(
elevation: 8.0,
label: Padding(
padding: const EdgeInsets.all(2.0),
child: Text(
- uiStore.zeroNetStatus.actionText,
+ uiStore.zeroNetStatus.value.actionText,
style: GoogleFonts.roboto(
- fontSize: 20,
- color: Colors.white,
+ fontSize: 18,
+ color: uiStore.currentTheme.value.btnTextColor,
),
),
),
- backgroundColor: uiStore.zeroNetStatus.actionBtnColor,
+ backgroundColor: uiStore.zeroNetStatus.value.actionBtnColor,
),
);
}),
- if (uiStore.zeroNetStatus == ZeroNetStatus.ERROR)
+ if (uiStore.zeroNetStatus.value == ZeroNetStatus.ERROR)
Spacer(
flex: 1,
),
- if (uiStore.zeroNetStatus == ZeroNetStatus.ERROR)
+ if (uiStore.zeroNetStatus.value == ZeroNetStatus.ERROR)
InkWell(
onTap: ZeroNetStatus.NOT_RUNNING.onAction,
child: Chip(
@@ -213,7 +231,7 @@ class ZeroNetStatusWidget extends StatelessWidget {
child: Text(
ZeroNetStatus.NOT_RUNNING.actionText,
style: GoogleFonts.roboto(
- fontSize: 20,
+ fontSize: 18,
color: Colors.white,
),
),
@@ -231,6 +249,77 @@ class ZeroNetStatusWidget extends StatelessWidget {
}
}
+class ZeroNetUserStatusWidget extends StatelessWidget {
+ @override
+ Widget build(BuildContext context) {
+ return Column(
+ children: [
+ Row(
+ children: [
+ Text(
+ strController.userStatusStr.value,
+ style: GoogleFonts.roboto(
+ fontSize: 20,
+ fontWeight: FontWeight.bold,
+ color: uiStore.currentTheme.value.primaryTextColor,
+ ),
+ ),
+ Spacer(
+ flex: 1,
+ ),
+ Obx(
+ () {
+ return Chip(
+ label: Padding(
+ padding: const EdgeInsets.all(2.0),
+ child: Text(
+ uiStore.zeroNetUserStatus.value.message,
+ style: GoogleFonts.roboto(
+ fontSize: 16,
+ color: uiStore.currentTheme.value.btnTextColor,
+ ),
+ ),
+ ),
+ backgroundColor:
+ uiStore.zeroNetUserStatus.value.statusChipColor,
+ );
+ },
+ ),
+ if (uiStore.zeroNetStatus.value == ZeroNetStatus.RUNNING)
+ Spacer(
+ flex: 1,
+ ),
+ if (uiStore.zeroNetStatus.value == ZeroNetStatus.RUNNING)
+ Obx(() {
+ return InkWell(
+ onTap: uiStore.zeroNetUserStatus.value.onAction,
+ child: Chip(
+ elevation: 8.0,
+ label: Padding(
+ padding: const EdgeInsets.all(2.0),
+ child: Text(
+ uiStore.zeroNetUserStatus.value.actionText,
+ style: GoogleFonts.roboto(
+ fontSize: 18,
+ color: uiStore.currentTheme.value.btnTextColor,
+ ),
+ ),
+ ),
+ backgroundColor:
+ uiStore.zeroNetUserStatus.value.actionBtnColor,
+ ),
+ );
+ }),
+ Spacer(
+ flex: 6,
+ ),
+ ],
+ ),
+ ],
+ );
+ }
+}
+
class PopularZeroNetSites extends StatelessWidget {
const PopularZeroNetSites({
Key key,
@@ -265,10 +354,11 @@ class PopularZeroNetSites extends StatelessWidget {
Padding(
padding: EdgeInsets.all(4.0),
child: Text(
- 'Popular Sites',
+ strController.popularSitesStr.value,
style: GoogleFonts.roboto(
fontSize: 20.0,
fontWeight: FontWeight.w500,
+ color: uiStore.currentTheme.value.primaryTextColor,
),
),
),
@@ -311,6 +401,7 @@ class SiteDetailCard extends StatelessWidget {
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(9),
),
+ color: uiStore.currentTheme.value.cardBgColor,
margin: EdgeInsets.only(bottom: 14.0),
child: Container(
height: 60.0,
@@ -331,6 +422,7 @@ class SiteDetailCard extends StatelessWidget {
style: GoogleFonts.roboto(
fontSize: 18.0,
fontWeight: FontWeight.w500,
+ color: uiStore.currentTheme.value.primaryTextColor,
),
),
],
@@ -346,11 +438,14 @@ class SiteDetailCard extends StatelessWidget {
onPressed: () {
uiStore.currentBottomSheetController = showBottomSheet(
context: context,
+ backgroundColor:
+ uiStore.currentTheme.value.primaryColor,
elevation: 16.0,
builder: (ctx) {
return Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16.0),
+ color: uiStore.currentTheme.value.cardBgColor,
),
constraints: BoxConstraints(
minHeight: 300.0,
@@ -388,19 +483,27 @@ class SiteDetailCard extends StatelessWidget {
size: 36,
color: Color(isZiteExists ? 0xFF6EB69E : 0xDF6EB69E),
),
- onTap: uiStore.zeroNetStatus == ZeroNetStatus.NOT_RUNNING
+ onTap: uiStore.zeroNetStatus.value ==
+ ZeroNetStatus.NOT_RUNNING
? () {
- Scaffold.of(context).showSnackBar(
- SnackBar(
- content: Text(
- 'Please Start ZeroNet First to Browse this Zite',
- ),
+ Get.showSnackbar(
+ GetBar(
+ message:
+ strController.startZeroNetFirstStr.value,
),
);
}
- : () {
- browserUrl =
- zeroNetUrl + Utils.initialSites[name]['url'];
+ : () async {
+ var url = zeroNetUrl;
+ if (url.isEmpty) {
+ var isServiceRunning =
+ await FlutterBackgroundService()
+ .isServiceRunning();
+ if (isServiceRunning) {
+ url = defZeroNetUrl;
+ }
+ }
+ browserUrl = url + Utils.initialSites[name]['url'];
uiStore.updateCurrentAppRoute(AppRoute.ZeroBrowser);
},
),
@@ -450,6 +553,7 @@ class SiteDetailsSheet extends StatelessWidget {
style: GoogleFonts.roboto(
fontSize: 31.0,
fontWeight: FontWeight.w500,
+ color: uiStore.currentTheme.value.primaryTextColor,
),
),
),
@@ -464,16 +568,22 @@ class SiteDetailsSheet extends StatelessWidget {
Utils.initialSites[name]['url'],
),
),
- Observer(builder: (context) {
- return RaisedButton(
- color: Color(0xFF009764),
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(10.0)),
- onPressed: uiStore.zeroNetStatus ==
+ Obx(() {
+ return ElevatedButton(
+ style: ButtonStyle(
+ backgroundColor: MaterialStateProperty.all(
+ Color(0xFF009764),
+ ),
+ shape: MaterialStateProperty.all(
+ RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(10.0)),
+ ),
+ ),
+ onPressed: uiStore.zeroNetStatus.value ==
ZeroNetStatus.NOT_RUNNING
? () {
snackMessage =
- 'Please Start ZeroNet First to Browse this Zite';
+ strController.startZeroNetFirstStr.value;
uiStore.updateShowSnackReply(true);
}
: () {
@@ -485,12 +595,14 @@ class SiteDetailsSheet extends StatelessWidget {
);
},
child: Text(
- isZiteExists ? 'OPEN' : 'DOWNLOAD',
+ isZiteExists
+ ? strController.openStr.value
+ : strController.downloadStr.value,
maxLines: 1,
style: GoogleFonts.roboto(
fontSize: 18.0,
fontWeight: FontWeight.w500,
- color: Colors.white,
+ color: uiStore.currentTheme.value.btnTextColor,
),
),
);
@@ -505,6 +617,7 @@ class SiteDetailsSheet extends StatelessWidget {
style: GoogleFonts.roboto(
fontSize: 16.0,
fontWeight: FontWeight.normal,
+ color: uiStore.currentTheme.value.primaryTextColor,
),
),
Padding(padding: EdgeInsets.all(6.0)),
@@ -513,10 +626,15 @@ class SiteDetailsSheet extends StatelessWidget {
alignment: WrapAlignment.start,
crossAxisAlignment: WrapCrossAlignment.start,
children: [
- RaisedButton(
- color: Color(0xFF008297),
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(10.0),
+ ElevatedButton(
+ style: ButtonStyle(
+ backgroundColor:
+ MaterialStateProperty.all(Color(0xFF008297)),
+ shape: MaterialStateProperty.all(
+ RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(10.0),
+ ),
+ ),
),
onPressed: () async {
File logoFile = File(getZeroNetDataDir().path +
@@ -533,45 +651,58 @@ class SiteDetailsSheet extends StatelessWidget {
logoPath,
);
if (added) {
- snackMessage = '$name shortcut added to HomeScreen';
+ snackMessage =
+ '$name ${strController.shrtAddedToHomeScreenStr.value}';
uiStore.updateShowSnackReply(true);
}
},
child: Text(
- 'Add to HomeScreen',
+ strController.addToHomeScreenStr.value,
maxLines: 1,
style: GoogleFonts.roboto(
fontSize: 18.0,
fontWeight: FontWeight.w300,
- color: Colors.white,
+ color: uiStore.currentTheme.value.btnTextColor,
),
),
),
if (isZiteExists)
- RaisedButton(
- color: Color(0xFF517184),
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(10.0)),
+ ElevatedButton(
+ style: ButtonStyle(
+ backgroundColor:
+ MaterialStateProperty.all(Color(0xFF517184)),
+ shape: MaterialStateProperty.all(
+ RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(10.0),
+ ),
+ ),
+ ),
onPressed: () {
uiStore.currentBottomSheetController?.close();
uiStore.updateCurrentAppRoute(AppRoute.LogPage);
},
child: Text(
- 'Show Log',
+ strController.showLogStr.value,
maxLines: 1,
style: GoogleFonts.roboto(
fontSize: 18.0,
fontWeight: FontWeight.w300,
- color: Colors.white,
+ color: uiStore.currentTheme.value.btnTextColor,
),
),
),
if (!unImplementedFeatures.contains(Feature.SITE_PAUSE_RESUME))
if (isZiteExists && currentSite != null)
- RaisedButton(
- color: Color(0xFF009793),
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(10.0)),
+ ElevatedButton(
+ style: ButtonStyle(
+ backgroundColor:
+ MaterialStateProperty.all(Color(0xFF009793)),
+ shape: MaterialStateProperty.all(
+ RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(10.0),
+ ),
+ ),
+ ),
onPressed: () {
//TODO: Implement this function;
currentSite = (currentSite.serving)
@@ -583,31 +714,39 @@ class SiteDetailsSheet extends StatelessWidget {
sitesAvailable);
},
child: Text(
- currentSite.serving ? 'Pause' : 'Resume',
+ currentSite.serving
+ ? strController.pauseStr.value
+ : strController.resumeStr.value,
maxLines: 1,
style: GoogleFonts.roboto(
fontSize: 18.0,
fontWeight: FontWeight.w300,
- color: Colors.white,
+ color: uiStore.currentTheme.value.btnTextColor,
),
),
),
if (!unImplementedFeatures.contains(Feature.SITE_DELETE))
if (isZiteExists && currentSite != null)
- RaisedButton(
- color: Color(0xFFBB4848),
- shape: RoundedRectangleBorder(
- borderRadius: BorderRadius.circular(10.0)),
+ ElevatedButton(
+ style: ButtonStyle(
+ backgroundColor: MaterialStateProperty.all(
+ Color(0xFFBB4848),
+ ),
+ shape: MaterialStateProperty.all(
+ RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(10.0)),
+ ),
+ ),
onPressed: () {
//TODO: Implement this function;
},
child: Text(
- 'Delete Zite',
+ strController.deleteZiteStr.value,
maxLines: 1,
style: GoogleFonts.roboto(
fontSize: 18.0,
fontWeight: FontWeight.w300,
- color: Colors.white,
+ color: uiStore.currentTheme.value.btnTextColor,
),
),
),
@@ -615,20 +754,20 @@ class SiteDetailsSheet extends StatelessWidget {
),
Padding(padding: EdgeInsets.all(6.0)),
if (isZiteExists)
- Observer(builder: (context) {
+ Obx(() {
return SiteInfoWidget(
- uiStore.currentSiteInfo,
+ uiStore.currentSiteInfo.value,
);
}),
],
),
Align(
alignment: Alignment.bottomCenter,
- child: Observer(builder: (context) {
+ child: Obx(() {
Timer(Duration(seconds: 3), () {
uiStore.updateShowSnackReply(false);
});
- return uiStore.showSnackReply
+ return uiStore.showSnackReply.value
? Container(
height: 50.0,
color: Colors.grey[900],
@@ -665,6 +804,7 @@ class SiteInfoWidget extends StatelessWidget {
style: GoogleFonts.roboto(
fontSize: 12,
fontWeight: FontWeight.bold,
+ color: uiStore.currentTheme.value.primaryTextColor,
),
),
);
@@ -690,6 +830,7 @@ class SiteInfoWidget extends StatelessWidget {
style: GoogleFonts.roboto(
fontSize: 12.0,
fontWeight: FontWeight.normal,
+ color: uiStore.currentTheme.value.primaryTextColor,
),
),
);
@@ -699,10 +840,11 @@ class SiteInfoWidget extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
- 'SiteInfo',
+ strController.siteInfoStr.value,
style: GoogleFonts.roboto(
fontSize: 21.0,
fontWeight: FontWeight.w500,
+ color: uiStore.currentTheme.value.primaryTextColor,
),
),
Padding(padding: EdgeInsets.all(2.0)),
diff --git a/lib/widgets/loading_page.dart b/lib/widgets/loading_page.dart
index 14f9d18..ecad52f 100644
--- a/lib/widgets/loading_page.dart
+++ b/lib/widgets/loading_page.dart
@@ -2,17 +2,11 @@ import '../imports.dart';
class Loading extends StatelessWidget {
// String data = 'Loading';
- final String warning = """
- Please Wait! This may take a while, happens
- only first time, Don't Press Back button.
- If You Accidentally Pressed Back,
- Clean App Storage in Settings or
- Uninstall and Reinstall The App.
- """;
+ final String warning = strController.loadingPageWarningStr.value;
@override
Widget build(BuildContext context) {
- SystemChrome.setEnabledSystemUIOverlays([]);
+ SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersive);
check();
return Scaffold(
body: Center(
@@ -23,11 +17,11 @@ class Loading extends StatelessWidget {
Padding(
padding: EdgeInsets.all(24.0),
),
- Observer(
- builder: (context) {
+ Obx(
+ () {
var status = varStore.loadingStatus;
return Text(
- status,
+ status.value,
style: TextStyle(
fontSize: 24.0,
fontStyle: FontStyle.italic,
@@ -35,7 +29,7 @@ class Loading extends StatelessWidget {
);
},
),
- Observer(builder: (context) {
+ Obx(() {
var percent = varStore.loadingPercent;
return (percent < 1)
? CircularProgressIndicator()
diff --git a/lib/widgets/log_page.dart b/lib/widgets/log_page.dart
index 5327764..7fe590e 100644
--- a/lib/widgets/log_page.dart
+++ b/lib/widgets/log_page.dart
@@ -3,29 +3,37 @@ import '../imports.dart';
class ZeroNetLogPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
- return Column(
- children: [
- Padding(padding: EdgeInsets.all(24)),
- Padding(
- padding: const EdgeInsets.only(left: 18.0, right: 18.0),
- child: Column(
- children: [
- ZeroNetAppBar(),
- Padding(
- padding: EdgeInsets.only(bottom: 30),
- ),
- Container(
- height: MediaQuery.of(context).size.height * 0.83,
- child: SingleChildScrollView(
- child: Observer(
- builder: (_) => Text(varStore.zeroNetLog),
+ return Container(
+ color: uiStore.currentTheme.value.primaryColor,
+ child: Column(
+ children: [
+ Padding(padding: EdgeInsets.all(24)),
+ Padding(
+ padding: const EdgeInsets.only(left: 18.0, right: 18.0),
+ child: Column(
+ children: [
+ ZeroNetAppBar(),
+ Padding(
+ padding: EdgeInsets.only(bottom: 30),
+ ),
+ Container(
+ height: MediaQuery.of(context).size.height * 0.83,
+ child: SingleChildScrollView(
+ child: Obx(
+ () => Text(
+ varStore.zeroNetLog.value,
+ style: TextStyle(
+ color: uiStore.currentTheme.value.primaryTextColor,
+ ),
+ ),
+ ),
),
),
- ),
- ],
+ ],
+ ),
),
- ),
- ],
+ ],
+ ),
);
}
}
diff --git a/lib/widgets/settings_page.dart b/lib/widgets/settings_page.dart
index 9c19390..6cf5014 100644
--- a/lib/widgets/settings_page.dart
+++ b/lib/widgets/settings_page.dart
@@ -5,6 +5,7 @@ class SettingsPage extends StatelessWidget {
Widget build(BuildContext context) {
return Container(
height: MediaQuery.of(context).size.height,
+ color: uiStore.currentTheme.value.primaryColor,
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
@@ -16,9 +17,6 @@ class SettingsPage extends StatelessWidget {
child: Column(
children: [
ZeroNetAppBar(),
- // Padding(
- // padding: EdgeInsets.only(bottom: 30),
- // ),
ListView.builder(
physics: BouncingScrollPhysics(),
shrinkWrap: true,
@@ -65,6 +63,7 @@ class SettingsCard extends StatelessWidget {
borderRadius: BorderRadius.circular(9),
),
margin: EdgeInsets.only(bottom: 14.0),
+ color: uiStore.currentTheme.value.cardBgColor,
child: Container(
// height: 60.0,
constraints: BoxConstraints(
@@ -93,6 +92,7 @@ class SettingsCard extends StatelessWidget {
style: GoogleFonts.roboto(
fontSize: 16.0,
fontWeight: FontWeight.w500,
+ color: uiStore.currentTheme.value.primaryTextColor,
),
),
],
@@ -109,14 +109,10 @@ class SettingsCard extends StatelessWidget {
showBottomSheet(
context: context,
elevation: 16.0,
+ backgroundColor:
+ uiStore.currentTheme.value.cardBgColor,
builder: (ctx) {
- return
- // Card(
- // color: Color(0xFFFCFCFC),
- // borderOnForeground: false,
- // elevation: 16.0,
- // child:
- Container(
+ return Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16.0),
),
@@ -146,16 +142,14 @@ class SettingsCard extends StatelessWidget {
),
],
),
- // ),
- // shadowColor: Colors.grey,
);
},
);
},
),
if (setting is ToggleSetting)
- Observer(
- builder: (context) {
+ Obx(
+ () {
bool enabled = (varStore.settings[setting.name]
as ToggleSetting)
.value;
@@ -171,8 +165,9 @@ class SettingsCard extends StatelessWidget {
],
),
if (setting is MapSetting)
- Observer(builder: (ctx) {
- var i = uiStore.reload;
+ Obx(() {
+ var i = uiStore.reload.value;
+ var str = i.toString();
List children = [];
var settingL = setting as MapSetting;
settingL.options.forEach((element) {
@@ -182,12 +177,22 @@ class SettingsCard extends StatelessWidget {
splashColor: Color(0xFF5380FF),
onTap: () {
settingL.options[settingL.options.indexOf(element)]
- .onClick(ctx);
+ .onClick(Get.context);
},
+ onLongPress: element == MapOptions.BACKUP_PROFILE
+ ? () {
+ backUpUserJsonFile(
+ context,
+ copyToClipboard: true,
+ );
+ }
+ : null,
child: Padding(
padding: const EdgeInsets.only(left: 3.0, right: 3.0),
child: Chip(
elevation: 2.0,
+ backgroundColor:
+ uiStore.currentTheme.value.cardBgColor,
label: Text(
settingL
.options[settingL.options.indexOf(element)]
@@ -196,6 +201,8 @@ class SettingsCard extends StatelessWidget {
style: GoogleFonts.roboto(
fontSize: 14.0,
fontWeight: FontWeight.w500,
+ color:
+ uiStore.currentTheme.value.primaryTextColor,
),
),
),
@@ -213,10 +220,10 @@ class SettingsCard extends StatelessWidget {
onTap: () {
showDialogW(
context: context,
- title: 'Switch Profile to $profile ?',
+ title:
+ '${strController.switchProfileToStr.value} $profile ?',
body: Text(
- 'this will delete the existing profile, '
- 'backup existing profile using backup button below',
+ strController.switchProfileToDesStr.value,
),
actionOk:
profileSwitcherActionOk(profile, context),
@@ -240,6 +247,48 @@ class SettingsCard extends StatelessWidget {
),
);
});
+ else if ((setting as MapSetting).name == languageSwitcher)
+ loadTranslations().keys.forEach((language) {
+ children.insert(
+ 0,
+ InkWell(
+ borderRadius: BorderRadius.circular(24.0),
+ splashColor: Color(0xFF5380FF),
+ onTap: () {
+ String code = loadTranslations()[language];
+ strController.loadTranslationsFromFile(
+ getZeroNetDataDir().path +
+ '/' +
+ Utils.urlZeroNetMob +
+ '/translations/' +
+ 'strings-$code.json',
+ );
+ varStore.updateSetting((setting as MapSetting)
+ ..map = {'selected': language});
+ saveSettings(varStore.settings);
+ },
+ child: Padding(
+ padding:
+ const EdgeInsets.only(left: 3.0, right: 3.0),
+ child: Chip(
+ elevation: 2.0,
+ backgroundColor:
+ uiStore.currentTheme.value.cardBgColor,
+ label: Text(
+ language,
+ maxLines: 1,
+ style: GoogleFonts.roboto(
+ fontSize: 14.0,
+ fontWeight: FontWeight.w500,
+ color: uiStore
+ .currentTheme.value.primaryTextColor,
+ ),
+ ),
+ ),
+ ),
+ ),
+ );
+ });
return Wrap(
children: children,
);
@@ -254,7 +303,7 @@ class SettingsCard extends StatelessWidget {
Row profileSwitcherActionOk(String profile, BuildContext context) {
return Row(
children: [
- FlatButton(
+ TextButton(
onPressed: () {
File f = File(getZeroNetUsersFilePath());
if (f.existsSync()) {
@@ -264,18 +313,18 @@ class SettingsCard extends StatelessWidget {
if (file.existsSync()) {
file.renameSync(getZeroNetDataDir().path + '/users.json');
// _reload();
- if (uiStore.zeroNetStatus == ZeroNetStatus.RUNNING)
+ if (uiStore.zeroNetStatus.value == ZeroNetStatus.RUNNING)
ZeroNet.instance.shutDown();
service.sendData({'cmd': 'runZeroNet'});
Navigator.pop(context);
}
},
child: Text(
- 'Switch',
+ strController.switchStr.value,
),
),
- FlatButton(
- child: Text('Backup'),
+ TextButton(
+ child: Text(strController.backupStr.value),
onPressed: () => backUpUserJsonFile(context),
),
],
@@ -300,6 +349,7 @@ class SettingDetailsSheet extends StatelessWidget {
style: GoogleFonts.roboto(
fontSize: 24.0,
fontWeight: FontWeight.w500,
+ color: uiStore.currentTheme.value.primaryTextColor,
),
),
],
@@ -310,6 +360,7 @@ class SettingDetailsSheet extends StatelessWidget {
style: GoogleFonts.roboto(
fontSize: 16.0,
fontWeight: FontWeight.normal,
+ color: uiStore.currentTheme.value.primaryTextColor,
),
),
],
diff --git a/lib/widgets/zerobrowser_page.dart b/lib/widgets/zerobrowser_page.dart
index c726be0..f48ac04 100644
--- a/lib/widgets/zerobrowser_page.dart
+++ b/lib/widgets/zerobrowser_page.dart
@@ -1,32 +1,35 @@
import '../imports.dart';
+final flutterWebViewPlugin = FlutterWebviewPlugin();
+
+// ignore: must_be_immutable
class ZeroBrowser extends StatelessWidget {
+ Color browserBgColor = uiStore.currentTheme.value.browserBgColor;
setTheme() {
+ Brightness brightness;
switch (zeroBrowserTheme) {
case 'dark':
- SystemChrome.setSystemUIOverlayStyle(
- SystemUiOverlayStyle(
- statusBarIconBrightness: Brightness.light,
- systemNavigationBarIconBrightness: Brightness.light,
- statusBarBrightness: Brightness.light,
- statusBarColor: Colors.blueGrey[900],
- systemNavigationBarColor: Colors.blueGrey[900],
- ),
- );
+ brightness = Brightness.light;
+ if (uiStore.currentTheme.value == AppTheme.Light)
+ browserBgColor = Color(0xFF22272d);
break;
case 'light':
- SystemChrome.setSystemUIOverlayStyle(
- SystemUiOverlayStyle(
- statusBarIconBrightness: Brightness.dark,
- systemNavigationBarIconBrightness: Brightness.dark,
- statusBarBrightness: Brightness.dark,
- statusBarColor: Colors.transparent,
- systemNavigationBarColor: Colors.white,
- ),
- );
+ brightness = Brightness.dark;
+ if (uiStore.currentTheme.value == AppTheme.Dark ||
+ uiStore.currentTheme.value == AppTheme.Black)
+ browserBgColor = Color(0xFFEDF2F5);
break;
default:
}
+ SystemChrome.setSystemUIOverlayStyle(
+ SystemUiOverlayStyle(
+ statusBarIconBrightness: brightness,
+ systemNavigationBarIconBrightness: brightness,
+ statusBarBrightness: brightness,
+ statusBarColor: browserBgColor,
+ systemNavigationBarColor: browserBgColor,
+ ),
+ );
}
@override
@@ -34,7 +37,8 @@ class ZeroBrowser extends StatelessWidget {
setTheme();
bool fullScreenWebView =
(varStore.settings[enableFullScreenOnWebView] as ToggleSetting)?.value;
- if (fullScreenWebView) SystemChrome.setEnabledSystemUIOverlays([]);
+ if (fullScreenWebView)
+ SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersive);
// ignore: prefer_collection_literals
final Set jsChannels = [
JavascriptChannel(
@@ -44,22 +48,29 @@ class ZeroBrowser extends StatelessWidget {
},
),
].toSet();
- final flutterWebViewPlugin = FlutterWebviewPlugin();
- flutterWebViewPlugin.onUrlChanged.listen((newUrl) => browserUrl = newUrl);
+ flutterWebViewPlugin.onUrlChanged.listen((newUrl) {
+ browserUrl = newUrl;
+ if (browserUrl.startsWith('https://blockchain.info/address/') ||
+ browserUrl.startsWith('https://www.blockchain.com/btc/address/')) {
+ uiStore.updateCurrentAppRoute(AppRoute.AboutPage);
+ fromBrowser = true;
+ }
+ });
return WillPopScope(
onWillPop: () {
if (launchUrl.isNotEmpty) {
return Future.value(true);
} else {
- SystemChrome.setEnabledSystemUIOverlays(SystemUiOverlay.values);
- SystemChrome.setSystemUIOverlayStyle(
- SystemUiOverlayStyle(
- statusBarColor: Colors.transparent,
- systemNavigationBarColor: Colors.white,
- statusBarIconBrightness: Brightness.dark,
- systemNavigationBarIconBrightness: Brightness.dark,
- ),
+ SystemChrome.setEnabledSystemUIMode(
+ SystemUiMode.manual,
+ overlays: [
+ SystemUiOverlay.top,
+ SystemUiOverlay.bottom,
+ ],
);
+ loadUsersFromFileSystem();
+ setZeroBrowserThemeValues();
+ setSystemUiTheme();
uiStore.updateCurrentAppRoute(AppRoute.Home);
return Future.value(false);
}
@@ -67,103 +78,102 @@ class ZeroBrowser extends StatelessWidget {
child: SafeArea(
child: Stack(
children: [
- WebviewScaffold(
- url: browserUrl,
- javascriptChannels: jsChannels,
- mediaPlaybackRequiresUserGesture: false,
- appCacheEnabled: true,
- withZoom: true,
- useWideViewPort: true,
- withLocalStorage: true,
- hidden: true,
- initialChild: Container(
- color: zeroBrowserTheme == 'dark'
- ? Colors.blueGrey[900]
- : Colors.white,
- child: Center(
- child: Column(
- mainAxisAlignment: MainAxisAlignment.center,
+ Theme(
+ data: zeroBrowserTheme == 'dark'
+ ? ThemeData.dark()
+ : ThemeData.light(),
+ child: WebviewScaffold(
+ url: browserUrl,
+ javascriptChannels: jsChannels,
+ mediaPlaybackRequiresUserGesture: false,
+ appCacheEnabled: true,
+ withZoom: true,
+ useWideViewPort: true,
+ withLocalStorage: true,
+ hidden: true,
+ initialChild: Container(
+ color: zeroBrowserTheme == 'dark'
+ ? Colors.blueGrey[900]
+ : Colors.white,
+ child: Center(
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ Padding(
+ padding: const EdgeInsets.all(8.0),
+ child: CircularProgressIndicator(),
+ ),
+ Text(
+ '${strController.loadingStr.value}.....',
+ style: TextStyle(
+ color: zeroBrowserTheme == 'light'
+ ? Colors.blueGrey[900]
+ : Colors.white,
+ ),
+ ),
+ ],
+ ),
+ ),
+ ),
+ bottomNavigationBar: BottomAppBar(
+ color: browserBgColor,
+ child: Row(
+ mainAxisAlignment: MainAxisAlignment.end,
children: [
- Padding(
- padding: const EdgeInsets.all(8.0),
- child: CircularProgressIndicator(),
+ IconButton(
+ icon: const Icon(Icons.home),
+ color: uiStore.currentTheme.value.browserIconColor,
+ onPressed: () {
+ SystemChrome.setEnabledSystemUIMode(
+ SystemUiMode.manual,
+ overlays: [
+ SystemUiOverlay.top,
+ SystemUiOverlay.bottom,
+ ],
+ );
+ SystemChrome.setSystemUIOverlayStyle(
+ SystemUiOverlayStyle(
+ statusBarColor: Colors.transparent,
+ systemNavigationBarColor: Colors.white,
+ statusBarIconBrightness: Brightness.dark,
+ systemNavigationBarIconBrightness:
+ Brightness.dark,
+ ),
+ );
+ uiStore.updateCurrentAppRoute(AppRoute.Home);
+ },
),
- Text(
- 'Loading.....',
- style: TextStyle(
- color: zeroBrowserTheme == 'light'
- ? Colors.blueGrey[900]
- : Colors.white,
- ),
+ Spacer(),
+ IconButton(
+ icon: const Icon(Icons.share),
+ color: uiStore.currentTheme.value.browserIconColor,
+ onPressed: () => Share.share(browserUrl),
+ ),
+ IconButton(
+ icon: const Icon(Icons.arrow_back_ios),
+ color: uiStore.currentTheme.value.browserIconColor,
+ onPressed: () {
+ flutterWebViewPlugin.goBack();
+ },
+ ),
+ IconButton(
+ icon: const Icon(Icons.arrow_forward_ios),
+ color: uiStore.currentTheme.value.browserIconColor,
+ onPressed: () {
+ flutterWebViewPlugin.goForward();
+ },
+ ),
+ IconButton(
+ icon: const Icon(Icons.autorenew),
+ color: uiStore.currentTheme.value.browserIconColor,
+ onPressed: () {
+ flutterWebViewPlugin.reload();
+ },
),
],
),
),
),
- bottomNavigationBar: BottomAppBar(
- color: zeroBrowserTheme == 'dark'
- ? Colors.blueGrey[900]
- : Colors.white,
- child: Row(
- mainAxisAlignment: MainAxisAlignment.end,
- children: [
- IconButton(
- icon: const Icon(Icons.home),
- color: zeroBrowserTheme == 'light'
- ? Colors.blueGrey[900]
- : Colors.white,
- onPressed: () {
- SystemChrome.setEnabledSystemUIOverlays(
- SystemUiOverlay.values);
- SystemChrome.setSystemUIOverlayStyle(
- SystemUiOverlayStyle(
- statusBarColor: Colors.transparent,
- systemNavigationBarColor: Colors.white,
- statusBarIconBrightness: Brightness.dark,
- systemNavigationBarIconBrightness: Brightness.dark,
- ),
- );
- uiStore.updateCurrentAppRoute(AppRoute.Home);
- },
- ),
- Spacer(),
- IconButton(
- icon: const Icon(Icons.share),
- color: zeroBrowserTheme == 'light'
- ? Colors.blueGrey[900]
- : Colors.white,
- onPressed: () => Share.share(browserUrl),
- ),
- IconButton(
- icon: const Icon(Icons.arrow_back_ios),
- color: zeroBrowserTheme == 'light'
- ? Colors.blueGrey[900]
- : Colors.white,
- onPressed: () {
- flutterWebViewPlugin.goBack();
- },
- ),
- IconButton(
- icon: const Icon(Icons.arrow_forward_ios),
- color: zeroBrowserTheme == 'light'
- ? Colors.blueGrey[900]
- : Colors.white,
- onPressed: () {
- flutterWebViewPlugin.goForward();
- },
- ),
- IconButton(
- icon: const Icon(Icons.autorenew),
- color: zeroBrowserTheme == 'light'
- ? Colors.blueGrey[900]
- : Colors.white,
- onPressed: () {
- flutterWebViewPlugin.reload();
- },
- ),
- ],
- ),
- ),
),
],
),
diff --git a/pubspec.yaml b/pubspec.yaml
index c18b25c..71ec968 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -8,60 +8,63 @@ environment:
dependencies:
flutter:
sdk: flutter
- auto_size_text: 2.1.0
- archive: 2.0.13
- crypto: 2.1.5
- clipboard: 0.1.2+8
- device_info: 0.4.2+9
- file_picker: 2.0.9+1
+ auto_size_text: ^3.0.0
+ archive: ^3.1.6
+ crypto: ^3.0.1
+ clipboard: ^0.1.3
+ device_info: ^2.0.2
+ diff_match_patch: ^0.4.1
+ file_picker: ^4.2.0
flutter_absolute_path:
# path: ../flutter_absolute_path
git:
url: https://github.com/canewsin/flutter_absolute_path.git
- ref: android-v2
- flutter_downloader: 1.5.1
- flutter_mobx: 0.3.3+3
- http: 0.12.2
- mobx: 0.3.3+1
- google_fonts: 1.1.1
- in_app_purchase: 0.3.4+15
- in_app_review: 0.2.1+1
- in_app_update: 1.1.13
+ # ref: android-v2
+ flutter_downloader: ^1.6.1
+ # flutter_mobx: ^1.1.0+2
+ http: ^0.13.4
+ # mobx: ^1.2.1+4
+ get: ^4.3.0
+ google_fonts: ^2.1.0
+ in_app_review: ^2.0.2
+ in_app_update: ^2.0.0
# git:
# url: https://github.com/canewsin/flutter_in_app_update.git
- outline_material_icons: 0.1.1
- equatable: 1.2.5
- time_ago_provider: 2.3.1
- package_info: 0.4.3
- path_provider: 1.6.21
- purchases_flutter: 1.4.0
- random_string: 2.1.0
- share: 0.6.5+3
- url_launcher: 5.7.6
- flutter_background_service: 0.0.1+21
+ outline_material_icons: ^0.1.1
+ equatable: ^2.0.2
+ time_ago_provider: ^4.1.0
+ package_info: ^2.0.2
+ path_provider: ^2.0.2
+ purchases_flutter: ^3.5.0
+ random_string: 2.3.1
+ share: ^2.0.4
+ url_launcher: ^6.0.9
+ flutter_background_service: #^0.1.5
# path: ../flutter_background_service
- # git:
- # url: https://github.com/canewsin/flutter_background_service
- # ref: zeronet
- flutter_webview_plugin: #0.3.11
git:
- url: https://github.com/canewsin/flutter_webview_plugin
- ref: fullscreen-support
- web_socket_channel: 1.1.0
- zeronet_ws:
+ url: https://github.com/ekasetiawans/flutter_background_service
+ # ref: zeronet
+ flutter_webview_plugin: ^0.4.0
+ # git: https://github.com/nuc134r/flutter_webview_plugin.git
+ # git:
+ # url: https://github.com/canewsin/flutter_webview_plugin
+ # ref: fullscreen-support
+ # web_socket_channel: 1.1.0
+ zeronet_ws: ^0.0.3
# path: ../zeronet_ws
- git:
- url : https://github.com/canewsin/zeronet_ws.git
+ # git:
+ # url : https://github.com/canewsin/zeronet_ws.git
dev_dependencies:
flutter_test:
sdk: flutter
- build_runner: 1.9.0
- mobx_codegen: 0.3.4
+ # build_runner: ^1.11.5
+ # mobx_codegen: ^1.1.2
flutter:
uses-material-design: true
assets:
- assets/
- assets/developers/
- - assets/icons/
\ No newline at end of file
+ - assets/icons/
+ - assets/filters/
\ No newline at end of file
diff --git a/version.properties b/version.properties
new file mode 100644
index 0000000..e7f0946
--- /dev/null
+++ b/version.properties
@@ -0,0 +1,2 @@
+flutter.versionName=v 0.8.2
+flutter.versionCode=90