Merge "recovery: czech translation" into android-6.0
diff --git a/NOTICE b/NOTICE
index c5b1efa..346e71a 100644
--- a/NOTICE
+++ b/NOTICE
@@ -1,190 +1,634 @@
 
-   Copyright (c) 2005-2008, The Android Open Source Project
+    Copyright (c) 2011-2016, Dees_Troy, bigbiff, Team Win
 
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
+    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.
 
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
+    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.
 
+                    GNU GENERAL PUBLIC LICENSE
+                       Version 3, 29 June 2007
 
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
 
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+                            Preamble
 
-   1. Definitions.
+  The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
 
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
+  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.
 
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
+  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.
 
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
+  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.
 
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
+  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.
 
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
+  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.
 
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
+  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.
 
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
+  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.
 
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
+  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.
 
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
+  The precise terms and conditions for copying, distribution and
+modification follow.
 
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
+                       TERMS AND CONDITIONS
 
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
+  0. Definitions.
 
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
+  "This License" refers to version 3 of the GNU General Public License.
 
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
+  "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
 
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
+  "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.
 
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
+  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.
 
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
+  A "covered work" means either the unmodified Program or a work based
+on the Program.
 
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
+  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.
 
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
+  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.
 
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
+  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.
 
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
+  1. Source Code.
 
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
+  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.
 
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
+  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.
 
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
+  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.
 
-   END OF TERMS AND CONDITIONS
+  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
diff --git a/flashutils/flashutils.c b/flashutils/flashutils.c
index fe1181f..5a5e009 100644
--- a/flashutils/flashutils.c
+++ b/flashutils/flashutils.c
@@ -54,7 +54,7 @@
     int type = device_flash_type();
     if (strstr(partition, "/dev/block/mtd") != NULL)
         type = MTD;
-    else if (strstr(partition, "/dev/block/mmc") != NULL)
+    else if (strstr(partition, "/dev/block/mmc") != NULL || strstr(partition, "/dev/block/sd") != NULL)
         type = MMC;
     else if (strstr(partition, "/dev/block/bml") != NULL)
         type = BML;
diff --git a/gui/gui.cpp b/gui/gui.cpp
index c2a439a..4cf80a4 100644
--- a/gui/gui.cpp
+++ b/gui/gui.cpp
@@ -765,7 +765,7 @@
 			check = 1;
 	}
 
-	if (check == 0 && PageManager::LoadPackage("TWRP", "/script/ui.xml", "main"))
+	if (check == 0)
 	{
 		std::string theme_path;
 
diff --git a/gui/input.cpp b/gui/input.cpp
index c12ecc2..4bf01ad 100644
--- a/gui/input.cpp
+++ b/gui/input.cpp
@@ -1,5 +1,5 @@
 /*
-        Copyright 2012 bigbiff/Dees_Troy TeamWin
+        Copyright 2012 to 2016 bigbiff/Dees_Troy TeamWin
         This file is part of TWRP/TeamWin Recovery Project.
 
         TWRP is free software: you can redistribute it and/or modify
@@ -46,6 +46,8 @@
 #include "objects.hpp"
 #include "../data.hpp"
 
+#define TW_INPUT_NO_UPDATE -1000 // Magic value for HandleTextLocation when no change in scrolling has occurred
+
 GUIInput::GUIInput(xml_node<>* node)
 	: GUIObject(node)
 {
@@ -63,12 +65,13 @@
 	isLocalChange = true;
 	HasAllowed = false;
 	HasDisabled = false;
-	skipChars = scrollingX = mFontHeight = mFontY = lastX = 0;
+	cursorX = textWidth = scrollingX = mFontHeight = mFontY = lastX = 0;
 	mBackgroundX = mBackgroundY = mBackgroundW = mBackgroundH = MinLen = MaxLen = 0;
 	mCursorLocation = -1; // -1 is always the end of the string
 	CursorWidth = 3;
 	ConvertStrToColor("black", &mBackgroundColor);
 	ConvertStrToColor("white", &mCursorColor);
+	displayValue = "";
 
 	if (!node)
 		return;
@@ -136,11 +139,6 @@
 			DataManager::SetValue(mVariable, attr->value());
 		mMask = LoadAttrString(child, "mask");
 		HasMask = !mMask.empty();
-		attr = child->first_attribute("maskvariable");
-		if (attr)
-			mMaskVariable = attr->value();
-		else
-			mMaskVariable = mVariable;
 	}
 
 	// Load input restrictions
@@ -166,10 +164,7 @@
 		mFontY = mRenderY;
 
 	if (mInputText)
-		mInputText->SetMaxWidth(mRenderW);
-
-	isLocalChange = false;
-	HandleTextLocation(-3);
+		mInputText->SetMaxWidth(0);
 }
 
 GUIInput::~GUIInput()
@@ -178,17 +173,40 @@
 	delete mAction;
 }
 
-int GUIInput::HandleTextLocation(int x)
-{
-	int textWidth;
-	string displayValue, originalValue, insertChar;
+void GUIInput::HandleTextLocation(int x) {
+	mRendered = false;
+	if (textWidth <= mRenderW) {
+		if (x != TW_INPUT_NO_UPDATE)
+			lastX = x;
+		scrollingX = 0;
+		return;
+	}
+	if (scrollingX + textWidth < mRenderW) {
+		scrollingX = mRenderW - textWidth;
+	}
+
+	if (x == TW_INPUT_NO_UPDATE)
+		return;
+
+	scrollingX += x - lastX;
+	if (scrollingX > 0)
+		scrollingX = 0;
+	else if (scrollingX + textWidth < mRenderW)
+		scrollingX = mRenderW - textWidth;
+	lastX = x;
+}
+
+void GUIInput::UpdateTextWidth() {
 	void* fontResource = NULL;
 
-	if (mFont)
+	if (mFont) {
 		fontResource = mFont->GetResource();
+	} else {
+		textWidth = 0;
+		return;
+	}
 
-	DataManager::GetValue(mVariable, originalValue);
-	displayValue = originalValue;
+	DataManager::GetValue(mVariable, displayValue);
 	if (HasMask) {
 		int index, string_size = displayValue.size();
 		string maskedValue;
@@ -197,153 +215,80 @@
 		displayValue = maskedValue;
 	}
 	textWidth = gr_ttf_measureEx(displayValue.c_str(), fontResource);
-	if (textWidth <= mRenderW) {
-		lastX = x;
-		scrollingX = 0;
-		skipChars = 0;
-		mInputText->SkipCharCount(skipChars);
-		mRendered = false;
-		return 0;
+}
+
+void GUIInput::HandleCursorByTouch(int x) {
+// Uses x to find mCursorLocation and cursorX
+	if (displayValue.size() == 0) {
+		mCursorLocation = -1;
+		cursorX = mRenderX;
+		return;
 	}
 
-	if (skipChars && skipChars < displayValue.size())
-		displayValue.erase(0, skipChars);
+	void* fontResource = NULL;
+	if (mFont) {
+		fontResource = mFont->GetResource();
+	} else {
+		return;
+	}
 
-	textWidth = gr_ttf_measureEx(displayValue.c_str(), fontResource);
-	mRendered = false;
+	string cursorString;
+	unsigned index = 0, displaySize = displayValue.size();
+	int prevX = mRenderX + scrollingX;
 
-	int deltaX, deltaText, newWidth;
-
-	if (x < -1000) {
-		// No change in scrolling
-		if (x == -1003)
-			mCursorLocation = -1;
-
-		if (mCursorLocation == -1) {
-			displayValue = originalValue;
-			skipChars = 0;
-			textWidth = gr_ttf_measureEx(displayValue.c_str(), fontResource);
-			while (textWidth > mRenderW) {
-				displayValue.erase(0, 1);
-				skipChars++;
-				textWidth = gr_ttf_measureEx(displayValue.c_str(), fontResource);
+	for(index = 0; index <= displaySize; index++) {
+		cursorString = displayValue.substr(0, index);
+		cursorX = gr_ttf_measureEx(cursorString.c_str(), fontResource) + mRenderX + scrollingX;
+		if (cursorX > x) {
+			if (index > 0 && x <= cursorX - ((x - prevX) / 2) && prevX >= mRenderX) {
+				// This helps make sure that we can place the cursor before the very first char if the first char is
+				// is fully visible while also still letting us place the cursor after the last char if fully visible
+				mCursorLocation = index - 1;
+				cursorX = prevX;
+				return;
 			}
-			scrollingX = mRenderW - textWidth;
-			mInputText->SkipCharCount(skipChars);
-		} else if (x == -1001) {
-			// Added a new character
-			int adjust_scrollingX = 0;
-			string cursorLocate;
-
-			cursorLocate = displayValue;
-			cursorLocate.resize(mCursorLocation);
-			textWidth = gr_ttf_measureEx(cursorLocate.c_str(), fontResource);
-			while (textWidth > mRenderW) {
-				skipChars++;
+			mCursorLocation = index;
+			if (cursorX > mRenderX + mRenderW) {
+				cursorX = prevX; // This makes sure that the cursor doesn't get placed after the end of the input box
 				mCursorLocation--;
-				cursorLocate.erase(0, 1);
-				textWidth = gr_ttf_measureEx(cursorLocate.c_str(), fontResource);
-				adjust_scrollingX = -1;
+				return;
 			}
-			if (adjust_scrollingX) {
-				scrollingX = mRenderW - textWidth;
-				if (scrollingX < 0)
-					scrollingX = 0;
-			}
-			mInputText->SkipCharCount(skipChars);
-		} else if (x == -1002) {
-			// Deleted a character
-			while (-1) {
-				if (skipChars == 0) {
-					scrollingX = 0;
-					mInputText->SkipCharCount(skipChars);
-					return 0;
-				}
-				insertChar = originalValue.substr(skipChars - 1, 1);
-				displayValue.insert(0, insertChar);
-				newWidth = gr_ttf_measureEx(displayValue.c_str(), fontResource);
-				deltaText = newWidth - textWidth;
-				if (newWidth > mRenderW) {
-					scrollingX = mRenderW - textWidth;
-					if (scrollingX < 0)
-						scrollingX = 0;
-					mInputText->SkipCharCount(skipChars);
-					return 0;
-				} else {
-					textWidth = newWidth;
-					skipChars--;
-					mCursorLocation++;
-				}
-			}
-		} else
-			LOGINFO("GUIInput::HandleTextLocation -> We really shouldn't ever get here...\n");
-	} else if (x > lastX) {
-		// Dragging to right, scrolling left
-		while (-1) {
-			deltaX = x - lastX + scrollingX;
-			if (skipChars == 0 || deltaX == 0) {
-				scrollingX = 0;
-				lastX = x;
-				mInputText->SkipCharCount(skipChars);
-				return 0;
-			}
-			insertChar = originalValue.substr(skipChars - 1, 1);
-			displayValue.insert(0, insertChar);
-			newWidth = gr_ttf_measureEx(displayValue.c_str(), fontResource);
-			deltaText = newWidth - textWidth;
-			if (deltaText < deltaX) {
-				lastX += deltaText;
-				textWidth = newWidth;
-				skipChars--;
-			} else {
-				scrollingX = deltaX;
-				lastX = x;
-				mInputText->SkipCharCount(skipChars);
-				return 0;
+			if (cursorX >= mRenderX) {
+				return; // This makes sure that the cursor doesn't get placed before the beginning of the input box
 			}
 		}
-	} else if (x < lastX) {
-		// Dragging to left, scrolling right
-		if (textWidth <= mRenderW) {
-			lastX = x;
-			scrollingX = mRenderW - textWidth;
-			return 0;
-		}
-		if (scrollingX) {
-			deltaX = lastX - x;
-			if (scrollingX > deltaX) {
-				scrollingX -= deltaX;
-				lastX = x;
-				return 0;
-			} else {
-				lastX -= deltaX;
-				scrollingX = 0;
-			}
-		}
-		while (-1) {
-			deltaX = lastX - x;
-			displayValue.erase(0, 1);
-			skipChars++;
-			newWidth = gr_ttf_measureEx(displayValue.c_str(), fontResource);
-			deltaText = textWidth - newWidth;
-			if (newWidth <= mRenderW) {
-				scrollingX = mRenderW - newWidth;
-				lastX = x;
-				mInputText->SkipCharCount(skipChars);
-				return 0;
-			}
-			if (deltaText < deltaX) {
-				lastX -= deltaText;
-				textWidth = newWidth;
-			} else {
-				scrollingX = deltaText - deltaX;
-				lastX = x;
-				mInputText->SkipCharCount(skipChars);
-				return 0;
-			}
-		}
+		prevX = cursorX;
 	}
-	return 0;
+	mCursorLocation = -1; // x is at or past the end of the string
+}
+
+void GUIInput::HandleCursorByText() {
+// Uses mCursorLocation to find cursorX 
+	if (!DrawCursor)
+		return;
+
+	void* fontResource = NULL;
+	if (mFont) {
+		fontResource = mFont->GetResource();
+	} else {
+		return;
+	}
+
+	int cursorWidth = textWidth;
+
+	if (mCursorLocation != -1) {
+		string cursorDisplay = displayValue;
+		cursorDisplay.resize(mCursorLocation);
+		cursorWidth = gr_ttf_measureEx(cursorDisplay.c_str(), fontResource);
+	}
+	cursorX = mRenderX + cursorWidth + scrollingX;
+	if (cursorX >= mRenderX + mRenderW) {
+		scrollingX = mRenderW - cursorWidth;
+		cursorX = mRenderX + mRenderW - CursorWidth;
+	} else if (cursorX < mRenderX) {
+		scrollingX = cursorWidth * -1;
+		cursorX = mRenderX;
+	}
 }
 
 int GUIInput::Render(void)
@@ -372,58 +317,18 @@
 	int ret = 0;
 
 	// Render the text
-	mInputText->SetRenderPos(mRenderX + scrollingX, mFontY);
-	mInputText->SetMaxWidth(mRenderW - scrollingX);
-	if (mInputText)	 ret = mInputText->Render();
-	if (ret < 0)		return ret;
+	if (mInputText) {
+		mInputText->SetRenderPos(mRenderX + scrollingX, mFontY);
+		mInputText->SetText(displayValue);
+		gr_clip(mRenderX, mRenderY, mRenderW, mRenderH);
+		ret = mInputText->Render();
+		gr_noclip();
+	}
+	if (ret < 0)
+		return ret;
 
 	if (HasInputFocus && DrawCursor) {
 		// Render the cursor
-		string displayValue;
-		int cursorX;
-		DataManager::GetValue(mVariable, displayValue);
-		if (HasMask) {
-			int index, string_size = displayValue.size();
-			string maskedValue;
-			for (index=0; index<string_size; index++)
-				maskedValue += mMask;
-			displayValue = maskedValue;
-		}
-		if (displayValue.size() == 0) {
-			skipChars = 0;
-			mCursorLocation = -1;
-			cursorX = mRenderX;
-		} else {
-			if (skipChars && skipChars < displayValue.size()) {
-				displayValue.erase(0, skipChars);
-			}
-			if (mCursorLocation == 0) {
-				// Cursor is at the beginning
-				cursorX = mRenderX;
-			} else if (mCursorLocation > 0) {
-				// Cursor is in the middle
-				if (displayValue.size() > (unsigned)mCursorLocation) {
-					string cursorDisplay;
-
-					cursorDisplay = displayValue;
-					cursorDisplay.resize(mCursorLocation);
-					cursorX = gr_ttf_measureEx(cursorDisplay.c_str(), fontResource) + mRenderX;
-				} else {
-					// Cursor location is after the end of the text  - reset to -1
-					mCursorLocation = -1;
-					cursorX = gr_ttf_measureEx(displayValue.c_str(), fontResource) + mRenderX;
-				}
-			} else {
-				// Cursor is at the end (-1)
-				cursorX = gr_ttf_measureEx(displayValue.c_str(), fontResource) + mRenderX;
-			}
-		}
-		cursorX += scrollingX;
-		// Make sure that the cursor doesn't go past the boundaries of the box
-		if (cursorX + (int)CursorWidth > mRenderX + mRenderW)
-			cursorX = mRenderX + mRenderW - CursorWidth;
-
-		// Set the color for the cursor
 		gr_color(mCursorColor.red, mCursorColor.green, mCursorColor.blue, 255);
 		gr_fill(cursorX, mFontY, CursorWidth, mFontHeight);
 	}
@@ -454,8 +359,6 @@
 int GUIInput::NotifyTouch(TOUCH_STATE state, int x, int y)
 {
 	static int startSelection = -1;
-	int textWidth;
-	string displayValue, originalValue;
 	void* fontResource = NULL;
 
 	if (mFont)  fontResource = mFont->GetResource();
@@ -507,43 +410,9 @@
 
 		case TOUCH_RELEASE:
 			// We've moved the cursor location
-			int relativeX = x - mRenderX;
-
 			mRendered = false;
 			DrawCursor = true;
-			DataManager::GetValue(mVariable, displayValue);
-			if (HasMask) {
-				int index, string_size = displayValue.size();
-				string maskedValue;
-				for (index=0; index<string_size; index++)
-					maskedValue += mMask;
-				displayValue = maskedValue;
-			}
-			if (displayValue.size() == 0) {
-				skipChars = 0;
-				mCursorLocation = -1;
-				return 0;
-			} else if (skipChars && skipChars < displayValue.size()) {
-				displayValue.erase(0, skipChars);
-			}
-
-			string cursorString;
-			int cursorX = 0;
-			unsigned index = 0;
-
-			for(index=0; index<displayValue.size(); index++)
-			{
-				cursorString = displayValue.substr(0, index);
-				cursorX = gr_ttf_measureEx(cursorString.c_str(), fontResource) + mRenderX;
-				if (cursorX > x) {
-					if (index > 0)
-						mCursorLocation = index - 1;
-					else
-						mCursorLocation = index;
-					return 0;
-				}
-			}
-			mCursorLocation = -1;
+			HandleCursorByTouch(x);
 			break;
 		}
 	}
@@ -554,10 +423,19 @@
 {
 	GUIObject::NotifyVarChange(varName, value);
 
-	if (varName == mVariable && !isLocalChange) {
-		HandleTextLocation(-1003);
+	if (varName == mVariable) {
+		if (!isLocalChange) {
+			UpdateTextWidth();
+			HandleTextLocation(TW_INPUT_NO_UPDATE);
+		} else
+			isLocalChange = false;
 		return 0;
 	}
+	if (varName.empty()) {
+		UpdateTextWidth();
+		HandleTextLocation(TW_INPUT_NO_UPDATE);
+		HandleCursorByText();
+	}
 	return 0;
 }
 
@@ -566,54 +444,48 @@
 	if (!HasInputFocus || !down)
 		return 1;
 
-	string variableValue;
 	switch (key)
 	{
 		case KEY_LEFT:
-			if (mCursorLocation == 0 && skipChars == 0)
+			if (mCursorLocation == 0)
 				return 0; // we're already at the beginning
 			if (mCursorLocation == -1) {
-				DataManager::GetValue(mVariable, variableValue);
-				if (variableValue.size() == 0)
+				if (displayValue.size() == 0) {
+					cursorX = mRenderX;
 					return 0;
-				mCursorLocation = variableValue.size() - skipChars - 1;
-			} else if (mCursorLocation == 0) {
-				skipChars--;
-				HandleTextLocation(-1002);
+				}
+				mCursorLocation = displayValue.size() - 1;
 			} else {
 				mCursorLocation--;
-				HandleTextLocation(-1002);
 			}
 			mRendered = false;
+			HandleCursorByText();
 			return 0;
 
 		case KEY_RIGHT:
 			if (mCursorLocation == -1)
 				return 0; // we're already at the end
 			mCursorLocation++;
-			DataManager::GetValue(mVariable, variableValue);
-			if (variableValue.size() <= mCursorLocation + skipChars)
+			if ((int)displayValue.size() <= mCursorLocation)
 				mCursorLocation = -1;
-			HandleTextLocation(-1001);
+			HandleCursorByText();
 			mRendered = false;
 			return 0;
 
 		case KEY_HOME:
 		case KEY_UP:
-			DataManager::GetValue(mVariable, variableValue);
-			if (variableValue.size() == 0)
+			if (displayValue.size() == 0)
 				return 0;
 			mCursorLocation = 0;
-			skipChars = 0;
 			mRendered = false;
-			HandleTextLocation(-1002);
+			cursorX = mRenderX;
 			return 0;
 
 		case KEY_END:
 		case KEY_DOWN:
 			mCursorLocation = -1;
 			mRendered = false;
-			HandleTextLocation(-1003);
+			HandleCursorByText();
 			return 0;
 	}
 
@@ -622,58 +494,38 @@
 
 int GUIInput::NotifyCharInput(int key)
 {
-	string variableValue;
-
 	if (HasInputFocus) {
 		if (key == KEYBOARD_BACKSPACE) {
 			//Backspace
-			DataManager::GetValue(mVariable, variableValue);
-			if (variableValue.size() > 0 && (mCursorLocation + skipChars != 0 || mCursorLocation == -1)) {
+			if (displayValue.size() > 0 && mCursorLocation != 0) {
 				if (mCursorLocation == -1) {
-					variableValue.resize(variableValue.size() - 1);
+					displayValue.resize(displayValue.size() - 1);
 				} else {
-					variableValue.erase(mCursorLocation + skipChars - 1, 1);
-					if (mCursorLocation > 0)
-						mCursorLocation--;
-					else if (skipChars > 0)
-						skipChars--;
+					displayValue.erase(mCursorLocation - 1, 1);
+					mCursorLocation--;
 				}
 				isLocalChange = true;
-				DataManager::SetValue(mVariable, variableValue);
-				isLocalChange = false;
-
-				if (HasMask) {
-					int index, string_size = variableValue.size();
-					string maskedValue;
-					for (index=0; index<string_size; index++)
-						maskedValue += mMask;
-					DataManager::SetValue(mMaskVariable, maskedValue);
-				}
-				HandleTextLocation(-1002);
+				DataManager::SetValue(mVariable, displayValue);
+				UpdateTextWidth();
+				HandleTextLocation(TW_INPUT_NO_UPDATE);
+				HandleCursorByText();
 			}
 		} else if (key == KEYBOARD_SWIPE_LEFT) {
 			// Delete all
 			isLocalChange = true;
 			if (mCursorLocation == -1) {
 				DataManager::SetValue (mVariable, "");
-				if (HasMask)
-					DataManager::SetValue(mMaskVariable, "");
+				displayValue = "";
+				textWidth = 0;
 				mCursorLocation = -1;
 			} else {
-				DataManager::GetValue(mVariable, variableValue);
-				variableValue.erase(0, mCursorLocation + skipChars);
-				DataManager::SetValue(mVariable, variableValue);
-				if (HasMask) {
-					DataManager::GetValue(mMaskVariable, variableValue);
-					variableValue.erase(0, mCursorLocation + skipChars);
-					DataManager::SetValue(mMaskVariable, variableValue);
-				}
+				displayValue.erase(0, mCursorLocation);
+				DataManager::SetValue(mVariable, displayValue);
+				UpdateTextWidth();
 				mCursorLocation = 0;
 			}
-			skipChars = 0;
+			cursorX = mRenderX;
 			scrollingX = 0;
-			mInputText->SkipCharCount(skipChars);
-			isLocalChange = false;
 			mRendered = false;
 			return 0;
 		} else if (key >= 32) {
@@ -684,33 +536,24 @@
 			if (HasDisabled && DisabledList.find((char)key) != string::npos) {
 				return 0;
 			}
-			DataManager::GetValue(mVariable, variableValue);
-			if (MaxLen != 0 && variableValue.size() >= MaxLen) {
+			if (MaxLen != 0 && displayValue.size() >= MaxLen) {
 				return 0;
 			}
 			if (mCursorLocation == -1) {
-				variableValue += key;
+				displayValue += key;
 			} else {
-				variableValue.insert(mCursorLocation + skipChars, 1, key);
+				displayValue.insert(mCursorLocation, 1, key);
 				mCursorLocation++;
 			}
 			isLocalChange = true;
-			DataManager::SetValue(mVariable, variableValue);
-			HandleTextLocation(-1001);
-			isLocalChange = false;
-
-			if (HasMask) {
-				int index, string_size = variableValue.size();
-				string maskedValue;
-				for (index=0; index<string_size; index++)
-					maskedValue += mMask;
-				DataManager::SetValue(mMaskVariable, maskedValue);
-			}
+			DataManager::SetValue(mVariable, displayValue);
+			UpdateTextWidth();
+			HandleTextLocation(TW_INPUT_NO_UPDATE);
+			HandleCursorByText();
 		} else if (key == KEYBOARD_ACTION) {
 			// Action
-			DataManager::GetValue(mVariable, variableValue);
 			if (mAction) {
-				unsigned inputLen = variableValue.length();
+				unsigned inputLen = displayValue.length();
 				if (inputLen < MinLen)
 					return 0;
 				else if (MaxLen != 0 && inputLen > MaxLen)
diff --git a/gui/objects.hpp b/gui/objects.hpp
index 6c6fa5e..7913b36 100644
--- a/gui/objects.hpp
+++ b/gui/objects.hpp
@@ -192,8 +192,7 @@
 	// Set maximum width in pixels
 	virtual int SetMaxWidth(unsigned width);
 
-	// Set number of characters to skip (for scrolling)
-	virtual int SkipCharCount(unsigned skip);
+	void SetText(string newtext);
 
 public:
 	bool isHighlighted;
@@ -209,7 +208,6 @@
 	int mIsStatic;
 	int mVarChanged;
 	int mFontHeight;
-	unsigned charSkip;
 };
 
 // GUIImage - Used for static image
@@ -1001,7 +999,10 @@
 	virtual int GetSelection(int x, int y);
 
 	// Handles displaying the text properly when chars are added, deleted, or for scrolling
-	virtual int HandleTextLocation(int x);
+	void HandleTextLocation(int x);
+	void UpdateTextWidth();
+	void HandleCursorByTouch(int x);
+	void HandleCursorByText();
 
 protected:
 	GUIText* mInputText;
@@ -1013,15 +1014,16 @@
 	std::string mLastValue;
 	std::string mVariable;
 	std::string mMask;
-	std::string mMaskVariable;
+	std::string displayValue;
 	COLOR mBackgroundColor;
 	COLOR mCursorColor;
 	int scrollingX;
+	int cursorX;
 	int lastX;
 	int mCursorLocation;
 	int mBackgroundX, mBackgroundY, mBackgroundW, mBackgroundH;
 	int mFontY;
-	unsigned skipChars;
+	int textWidth;
 	unsigned mFontHeight;
 	unsigned CursorWidth;
 	bool mRendered;
diff --git a/gui/pages.cpp b/gui/pages.cpp
index cfe3067..115d6b3 100644
--- a/gui/pages.cpp
+++ b/gui/pages.cpp
@@ -55,9 +55,6 @@
 
 extern int gGuiRunning;
 
-// From ../twrp.cpp
-extern bool datamedia;
-
 // From console.cpp
 extern size_t last_message_count;
 extern std::vector<std::string> gConsole;
@@ -621,7 +618,7 @@
 		if (ret == 0)
 			return 0;
 		else if (ret < 0)
-			LOGERR("A char input handler has returned an error");
+			LOGERR("A char input handler has returned an error\n");
 	}
 	return 1;
 }
@@ -637,7 +634,7 @@
 		if (ret == 0)
 			return 0;
 		else if (ret < 0)
-			LOGERR("An input focus handler has returned an error");
+			LOGERR("An input focus handler has returned an error\n");
 	}
 	return 1;
 }
@@ -663,13 +660,42 @@
 	return 0;
 }
 
-PageSet::PageSet(const char* xmlFile)
+
+// transient data for loading themes
+struct LoadingContext
+{
+	ZipArchive* zip; // zip to load theme from, or NULL for the stock theme
+	std::set<std::string> filenames; // to detect cyclic includes
+	std::string basepath; // if zip is NULL, base path to load includes from with trailing slash, otherwise empty
+	std::vector<xml_document<>*> xmldocs; // all loaded xml docs
+	std::vector<char*> xmlbuffers; // text buffers with xml content
+	std::vector<xml_node<>*> styles; // refer to <styles> nodes inside xmldocs
+	std::vector<xml_node<>*> templates; // refer to <templates> nodes inside xmldocs
+
+	LoadingContext()
+	{
+		zip = NULL;
+	}
+
+	~LoadingContext()
+	{
+		// free all xml buffers
+		for (std::vector<char*>::iterator it = xmlbuffers.begin(); it != xmlbuffers.end(); ++it)
+			free(*it);
+	}
+
+};
+
+// for FindStyle
+LoadingContext* PageManager::currentLoadingContext = NULL;
+
+
+PageSet::PageSet()
 {
 	mResources = new ResourceManager;
 	mCurrentPage = NULL;
 
-	if (!xmlFile)
-		mCurrentPage = new Page(NULL, NULL);
+	set_scale_values(1, 1); // Reset any previous scaling values
 }
 
 PageSet::~PageSet()
@@ -681,6 +707,105 @@
 	delete mResources;
 }
 
+int PageSet::Load(LoadingContext& ctx, const std::string& filename)
+{
+	bool isMain = ctx.xmlbuffers.empty(); // if we have no files yet, remember that this is the main XML file
+
+	if (!ctx.filenames.insert(filename).second)
+		// ignore already loaded files to prevent crash with cyclic includes
+		return 0;
+
+	// load XML into buffer
+	char* xmlbuffer = PageManager::LoadFileToBuffer(filename, ctx.zip);
+	if (!xmlbuffer)
+		return -1; // error already displayed by LoadFileToBuffer
+	ctx.xmlbuffers.push_back(xmlbuffer);
+
+	// parse XML
+	xml_document<>* doc = new xml_document<>();
+	doc->parse<0>(xmlbuffer);
+	ctx.xmldocs.push_back(doc);
+
+	xml_node<>* root = doc->first_node("recovery");
+	if (!root)
+		root = doc->first_node("install");
+	if (!root) {
+		LOGERR("Unknown root element in %s\n", filename.c_str());
+		return -1;
+	}
+
+	if (isMain) {
+		int rc = LoadDetails(ctx, root);
+		if (rc != 0)
+			return rc;
+	}
+
+	LOGINFO("Loading resources...\n");
+	xml_node<>* child = root->first_node("resources");
+	if (child)
+		mResources->LoadResources(child, ctx.zip, "theme");
+
+	LOGINFO("Loading variables...\n");
+	child = root->first_node("variables");
+	if (child)
+		LoadVariables(child);
+
+	LOGINFO("Loading mouse cursor...\n");
+	child = root->first_node("mousecursor");
+	if (child)
+		PageManager::LoadCursorData(child);
+
+	LOGINFO("Loading pages...\n");
+	child = root->first_node("templates");
+	if (child)
+		ctx.templates.push_back(child);
+
+	child = root->first_node("styles");
+	if (child)
+		ctx.styles.push_back(child);
+
+	// Load pages
+	child = root->first_node("pages");
+	if (child) {
+		if (LoadPages(ctx, child)) {
+			LOGERR("PageSet::Load returning -1\n");
+			return -1;
+		}
+	}
+
+	// process includes recursively
+	child = root->first_node("include");
+	if (child) {
+		xml_node<>* include = child->first_node("xmlfile");
+		while (include != NULL) {
+			xml_attribute<>* attr = include->first_attribute("name");
+			if (!attr) {
+				LOGERR("Skipping include/xmlfile with no name\n");
+				continue;
+			}
+
+			string filename = ctx.basepath + attr->value();
+			LOGINFO("Including file: %s...\n", filename.c_str());
+			int rc = Load(ctx, filename);
+			if (rc != 0)
+				return rc;
+
+			include = include->next_sibling("xmlfile");
+		}
+	}
+
+	return 0;
+}
+
+void PageSet::MakeEmergencyConsoleIfNeeded()
+{
+	if (mPages.empty()) {
+		mCurrentPage = new Page(NULL, NULL); // fallback console page
+		// TODO: since removal of non-TTF fonts, the emergency console doesn't work without a font, which might be missing too
+		mPages.push_back(mCurrentPage);
+	}
+}
+
 int PageSet::LoadLanguage(char* languageFile, ZipArchive* package)
 {
 	xml_document<> lang;
@@ -724,26 +849,9 @@
 	return ret;
 }
 
-int PageSet::Load(ZipArchive* package, char* xmlFile, char* languageFile, char* baseLanguageFile)
+int PageSet::LoadDetails(LoadingContext& ctx, xml_node<>* root)
 {
-	xml_document<> mDoc;
-	xml_node<>* parent;
-	xml_node<>* child;
-	xml_node<>* xmltemplate;
-	xml_node<>* xmlstyle;
-
-	mDoc.parse<0>(xmlFile);
-	parent = mDoc.first_node("recovery");
-	if (!parent)
-		parent = mDoc.first_node("install");
-
-	set_scale_values(1, 1); // Reset any previous scaling values
-
-	if (baseLanguageFile)
-		LoadLanguage(baseLanguageFile, NULL);
-
-	// Now, let's parse the XML
-	child = parent->first_node("details");
+	xml_node<>* child = root->first_node("details");
 	if (child) {
 		int theme_ver = 0;
 		xml_node<>* themeversion = child->first_node("themeversion");
@@ -754,9 +862,8 @@
 		}
 		if (theme_ver != TW_THEME_VERSION) {
 			LOGINFO("theme version from xml: %i, expected %i\n", theme_ver, TW_THEME_VERSION);
-			if (package) {
+			if (ctx.zip) {
 				gui_err("theme_ver_err=Custom theme version does not match TWRP version. Using stock theme.");
-				mDoc.clear();
 				return TW_THEME_VER_ERR;
 			} else {
 				gui_print_color("warning", "Stock theme version does not match TWRP version.\n");
@@ -810,151 +917,6 @@
 		LOGINFO("XML contains no details tag, no scaling will be applied.\n");
 	}
 
-	if (languageFile)
-		LoadLanguage(languageFile, package);
-
-	LOGINFO("Loading resources...\n");
-	child = parent->first_node("resources");
-	if (child)
-		mResources->LoadResources(child, package, "theme");
-
-	LOGINFO("Loading variables...\n");
-	child = parent->first_node("variables");
-	if (child)
-		LoadVariables(child);
-
-	LOGINFO("Loading mouse cursor...\n");
-	child = parent->first_node("mousecursor");
-	if(child)
-		PageManager::LoadCursorData(child);
-
-	LOGINFO("Loading pages...\n");
-	// This may be NULL if no templates are present
-	xmltemplate = parent->first_node("templates");
-	if (xmltemplate)
-		templates.push_back(xmltemplate);
-
-	// Load styles if present
-	xmlstyle = parent->first_node("styles");
-	if (xmlstyle)
-		styles.push_back(xmlstyle);
-
-	child = parent->first_node("pages");
-	if (child) {
-		if (LoadPages(child)) {
-			LOGERR("PageSet::Load returning -1\n");
-			mDoc.clear();
-			return -1;
-		}
-	}
-
-	int ret = CheckInclude(package, &mDoc);
-	mDoc.clear();
-	templates.clear();
-	return ret;
-}
-
-int PageSet::CheckInclude(ZipArchive* package, xml_document<> *parentDoc)
-{
-	xml_node<>* par;
-	xml_node<>* par2;
-	xml_node<>* chld;
-	xml_node<>* parent;
-	xml_node<>* child;
-	xml_node<>* xmltemplate;
-	xml_node<>* xmlstyle;
-	long len;
-	char* xmlFile = NULL;
-	string filename;
-	xml_document<> *doc = NULL;
-
-	par = parentDoc->first_node("recovery");
-	if (!par) {
-		par = parentDoc->first_node("install");
-	}
-	if (!par) {
-		return 0;
-	}
-
-	par2 = par->first_node("include");
-	if (!par2)
-		return 0;
-	chld = par2->first_node("xmlfile");
-	while (chld != NULL) {
-		xml_attribute<>* attr = chld->first_attribute("name");
-		if (!attr)
-			break;
-
-		if (!package) {
-			// We can try to load the XML directly...
-			filename = TWRES;
-			filename += attr->value();
-		} else {
-			filename += attr->value();
-		}
-		xmlFile = PageManager::LoadFileToBuffer(filename, package);
-		if (xmlFile == NULL) {
-			LOGERR("PageSet::CheckInclude unable to load '%s'\n", filename.c_str());
-			return -1;
-		}
-
-		doc = new xml_document<>();
-		doc->parse<0>(xmlFile);
-
-		parent = doc->first_node("recovery");
-		if (!parent)
-			parent = doc->first_node("install");
-
-		// Now, let's parse the XML
-		LOGINFO("Loading included resources...\n");
-		child = parent->first_node("resources");
-		if (child)
-			mResources->LoadResources(child, package, "theme");
-
-		LOGINFO("Loading included variables...\n");
-		child = parent->first_node("variables");
-		if (child)
-			LoadVariables(child);
-
-		LOGINFO("Loading mouse cursor...\n");
-		child = parent->first_node("mousecursor");
-		if(child)
-			PageManager::LoadCursorData(child);
-
-		LOGINFO("Loading included pages...\n");
-		// This may be NULL if no templates are present
-		xmltemplate = parent->first_node("templates");
-		if (xmltemplate)
-			templates.push_back(xmltemplate);
-
-		// Load styles if present
-		xmlstyle = parent->first_node("styles");
-		if (xmlstyle)
-			styles.push_back(xmlstyle);
-
-		child = parent->first_node("pages");
-		if (child && LoadPages(child))
-		{
-			templates.pop_back();
-			doc->clear();
-			delete doc;
-			free(xmlFile);
-			return -1;
-		}
-
-		if (CheckInclude(package, doc)) {
-			doc->clear();
-			delete doc;
-			free(xmlFile);
-			return -1;
-		}
-		doc->clear();
-		delete doc;
-		free(xmlFile);
-
-		chld = chld->next_sibling("xmlfile");
-	}
-
 	return 0;
 }
 
@@ -1089,7 +1051,7 @@
 	return 0;
 }
 
-int PageSet::LoadPages(xml_node<>* pages)
+int PageSet::LoadPages(LoadingContext& ctx, xml_node<>* pages)
 {
 	xml_node<>* child;
 
@@ -1099,7 +1061,7 @@
 	child = pages->first_node("page");
 	while (child != NULL)
 	{
-		Page* page = new Page(child, &templates);
+		Page* page = new Page(child, &ctx.templates);
 		if (page->GetName().empty())
 		{
 			LOGERR("Unable to process load page\n");
@@ -1356,10 +1318,8 @@
 
 int PageManager::LoadPackage(std::string name, std::string package, std::string startpage)
 {
-	int fd;
-	ZipArchive zip, *pZip = NULL;
-	long len;
-	char* xmlFile = NULL;
+	std::string mainxmlfilename = package;
+	ZipArchive zip;
 	char* languageFile = NULL;
 	char* baseLanguageFile = NULL;
 	PageSet* pageSet = NULL;
@@ -1369,6 +1329,9 @@
 	mReloadTheme = false;
 	mStartPage = startpage;
 
+	// init the loading context
+	LoadingContext ctx;
+
 	// Open the XML file
 	LOGINFO("Loading package: %s (%s)\n", name.c_str(), package.c_str());
 	if (package.size() > 4 && package.substr(package.size() - 4) != ".zip")
@@ -1376,8 +1339,11 @@
 		LOGINFO("Load XML directly\n");
 		tw_x_offset = TW_X_OFFSET;
 		tw_y_offset = TW_Y_OFFSET;
-		LoadLanguageList(NULL);
-		languageFile = LoadFileToBuffer(TWRES "languages/en.xml", NULL);
+		if (name != "splash") {
+			LoadLanguageList(NULL);
+			languageFile = LoadFileToBuffer(TWRES "languages/en.xml", NULL);
+		}
+		ctx.basepath = TWRES;
 	}
 	else
 	{
@@ -1395,26 +1361,32 @@
 			sysReleaseMap(&map);
 			goto error;
 		}
-		pZip = &zip;
-		package = "ui.xml";
-		LoadLanguageList(pZip);
-		languageFile = LoadFileToBuffer("languages/en.xml", pZip);
+		ctx.zip = &zip;
+		mainxmlfilename = "ui.xml";
+		LoadLanguageList(ctx.zip);
+		languageFile = LoadFileToBuffer("languages/en.xml", ctx.zip);
 		baseLanguageFile = LoadFileToBuffer(TWRES "languages/en.xml", NULL);
 	}
 
-	xmlFile = LoadFileToBuffer(package, pZip);
-	if (xmlFile == NULL) {
-		goto error;
-	}
-
 	// Before loading, mCurrentSet must be the loading package so we can find resources
 	pageSet = mCurrentSet;
-	mCurrentSet = new PageSet(xmlFile);
-	ret = mCurrentSet->Load(pZip, xmlFile, languageFile, baseLanguageFile);
-	if (languageFile) {
-		free(languageFile);
-		languageFile = NULL;
+	mCurrentSet = new PageSet();
+
+	if (baseLanguageFile) {
+		mCurrentSet->LoadLanguage(baseLanguageFile, NULL);
+		free(baseLanguageFile);
 	}
+
+	if (languageFile) {
+		mCurrentSet->LoadLanguage(languageFile, ctx.zip);
+		free(languageFile);
+	}
+
+	// Load and parse the XML and all includes
+	currentLoadingContext = &ctx; // required to find styles
+	ret = mCurrentSet->Load(ctx, mainxmlfilename);
+	currentLoadingContext = NULL;
+
 	if (ret == 0) {
 		mCurrentSet->SetPage(startpage);
 		mPageSets.insert(std::pair<std::string, PageSet*>(name, mCurrentSet));
@@ -1423,25 +1395,21 @@
 			LOGERR("Package %s failed to load.\n", name.c_str());
 	}
 
+	// reset to previous pageset
 	mCurrentSet = pageSet;
 
-	if (pZip) {
-		mzCloseZipArchive(pZip);
+	if (ctx.zip) {
+		mzCloseZipArchive(ctx.zip);
 		sysReleaseMap(&map);
 	}
-	free(xmlFile);
-	if (languageFile)
-		free(languageFile);
 	return ret;
 
 error:
 	// Sometimes we get here without a real error
-	if (pZip) {
-		mzCloseZipArchive(pZip);
+	if (ctx.zip) {
+		mzCloseZipArchive(ctx.zip);
 		sysReleaseMap(&map);
 	}
-	if (xmlFile)
-		free(xmlFile);
 	return -1;
 }
 
@@ -1466,6 +1434,7 @@
 	if (tmp)
 	{
 		mCurrentSet = tmp;
+		mCurrentSet->MakeEmergencyConsoleIfNeeded();
 		mCurrentSet->NotifyVarChange("", "");
 	}
 	else
@@ -1620,7 +1589,13 @@
 
 xml_node<>* PageManager::FindStyle(std::string name)
 {
-	for (std::vector<xml_node<>*>::iterator itr = mCurrentSet->styles.begin(); itr != mCurrentSet->styles.end(); itr++) {
+	if (!currentLoadingContext)
+	{
+		LOGERR("FindStyle works only while loading a theme.\n");
+		return NULL;
+	}
+
+	for (std::vector<xml_node<>*>::iterator itr = currentLoadingContext->styles.begin(); itr != currentLoadingContext->styles.end(); itr++) {
 		xml_node<>* node = (*itr)->first_node("style");
 
 		while (node) {
diff --git a/gui/pages.hpp b/gui/pages.hpp
index 927f3fc..4bfd5b0 100644
--- a/gui/pages.hpp
+++ b/gui/pages.hpp
@@ -88,16 +88,18 @@
 	bool ProcessNode(xml_node<>* page, std::vector<xml_node<>*> *templates, int depth);
 };
 
+struct LoadingContext;
+
 class PageSet
 {
 public:
-	PageSet(const char* xmlFile);
+	PageSet();
 	virtual ~PageSet();
 
 public:
+	int Load(LoadingContext& ctx, const std::string& filename);
 	int LoadLanguage(char* languageFile, ZipArchive* package);
-	int Load(ZipArchive* package, char* xmlFile, char* languageFile, char* baseLanguageFile);
-	int CheckInclude(ZipArchive* package, xml_document<> *parentDoc);
+	void MakeEmergencyConsoleIfNeeded();
 
 	Page* FindPage(std::string name);
 	int SetPage(std::string page);
@@ -117,17 +119,16 @@
 	int SetKeyBoardFocus(int inFocus);
 	int NotifyVarChange(std::string varName, std::string value);
 
-	std::vector<xml_node<>*> styles;
 	void AddStringResource(std::string resource_source, std::string resource_name, std::string value);
 
 protected:
-	int LoadPages(xml_node<>* pages);
+	int LoadDetails(LoadingContext& ctx, xml_node<>* root);
+	int LoadPages(LoadingContext& ctx, xml_node<>* pages);
 	int LoadVariables(xml_node<>* vars);
 
 protected:
 	ResourceManager* mResources;
 	std::vector<Page*> mPages;
-	std::vector<xml_node<>*> templates;
 	Page* mCurrentPage;
 	std::vector<Page*> mOverlays; // Special case for popup dialogs and the lock screen
 };
@@ -187,6 +188,7 @@
 	static HardwareKeyboard *mHardwareKeyboard;
 	static bool mReloadTheme;
 	static std::string mStartPage;
+	static LoadingContext* currentLoadingContext;
 };
 
 #endif  // _PAGES_HEADER_HPP
diff --git a/gui/resources.cpp b/gui/resources.cpp
index e7611dd..9c97dad 100644
--- a/gui/resources.cpp
+++ b/gui/resources.cpp
@@ -54,24 +54,27 @@
 	return ret;
 }
 
-void Resource::LoadImage(ZipArchive* pZip, std::string file, gr_surface* source)
+void Resource::LoadImage(ZipArchive* pZip, std::string file, gr_surface* surface)
 {
+	int rc = 0;
 	if (ExtractResource(pZip, "images", file, ".png", TMP_RESOURCE_NAME) == 0)
 	{
-		res_create_surface(TMP_RESOURCE_NAME, source);
+		rc = res_create_surface(TMP_RESOURCE_NAME, surface);
 		unlink(TMP_RESOURCE_NAME);
 	}
 	else if (ExtractResource(pZip, "images", file, "", TMP_RESOURCE_NAME) == 0)
 	{
 		// JPG includes the .jpg extension in the filename so extension should be blank
-		res_create_surface(TMP_RESOURCE_NAME, source);
+		rc = res_create_surface(TMP_RESOURCE_NAME, surface);
 		unlink(TMP_RESOURCE_NAME);
 	}
 	else if (!pZip)
 	{
 		// File name in xml may have included .png so try without adding .png
-		res_create_surface(file.c_str(), source);
+		rc = res_create_surface(file.c_str(), surface);
 	}
+	if (rc != 0)
+		LOGINFO("Failed to load image from %s%s, error %d\n", file.c_str(), pZip ? " (zip)" : "", rc);
 }
 
 void Resource::CheckAndScaleImage(gr_surface source, gr_surface* destination, int retain_aspect)
@@ -122,7 +125,6 @@
 
 	if(file.size() >= 4 && file.compare(file.size()-4, 4, ".ttf") == 0)
 	{
-		m_type = TYPE_TTF;
 		int font_size = 0;
 
 		if (origFontSize != 0) {
@@ -144,10 +146,11 @@
 		if(attr)
 			dpi = atoi(attr->value());
 
-		if (ExtractResource(pZip, "fonts", file, "", TMP_RESOURCE_NAME) == 0)
+		// we can't use TMP_RESOURCE_NAME here because the ttf subsystem is caching the name and scaling needs to reload the font
+		std::string tmpname = "/tmp/" + file;
+		if (ExtractResource(pZip, "fonts", file, "", tmpname) == 0)
 		{
-			mFont = gr_ttf_loadFont(TMP_RESOURCE_NAME, font_size, dpi);
-			unlink(TMP_RESOURCE_NAME);
+			mFont = gr_ttf_loadFont(tmpname.c_str(), font_size, dpi);
 		}
 		else
 		{
diff --git a/gui/resources.hpp b/gui/resources.hpp
index 4548c10..528fecc 100644
--- a/gui/resources.hpp
+++ b/gui/resources.hpp
@@ -29,21 +29,13 @@
 
 protected:
 	static int ExtractResource(ZipArchive* pZip, std::string folderName, std::string fileName, std::string fileExtn, std::string destFile);
-	static void LoadImage(ZipArchive* pZip, std::string file, gr_surface* source);
+	static void LoadImage(ZipArchive* pZip, std::string file, gr_surface* surface);
 	static void CheckAndScaleImage(gr_surface source, gr_surface* destination, int retain_aspect);
 };
 
 class FontResource : public Resource
 {
 public:
-	enum Type
-	{
-		TYPE_TWRP,
-#ifndef TW_DISABLE_TTF
-		TYPE_TTF,
-#endif
-	};
-
 	FontResource(xml_node<>* node, ZipArchive* pZip);
 	virtual ~FontResource();
 
@@ -54,7 +46,6 @@
 
 protected:
 	void* mFont;
-	Type m_type;
 
 private:
 	void LoadFont(xml_node<>* node, ZipArchive* pZip);
diff --git a/gui/text.cpp b/gui/text.cpp
index 6498af6..49e27a1 100644
--- a/gui/text.cpp
+++ b/gui/text.cpp
@@ -1,3 +1,21 @@
+/*
+        Copyright 2012 to 2016 bigbiff/Dees_Troy TeamWin
+        This file is part of TWRP/TeamWin Recovery Project.
+
+        TWRP 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.
+
+        TWRP 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 TWRP.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
 // text.cpp - GUIText object
 
 #include <stdarg.h>
@@ -33,7 +51,6 @@
 	mVarChanged = 0;
 	mFontHeight = 0;
 	maxWidth = 0;
-	charSkip = 0;
 	scaleWidth = true;
 	isHighlighted = false;
 	mText = "";
@@ -94,22 +111,18 @@
 		return -1;
 
 	mLastValue = gui_parse_text(mText);
-	string displayValue = mLastValue;
-
-	if (charSkip)
-		displayValue.erase(0, charSkip);
 
 	mVarChanged = 0;
 
 	int x = mRenderX, y = mRenderY;
-	int width = gr_ttf_measureEx(displayValue.c_str(), fontResource);
+	int width = gr_ttf_measureEx(mLastValue.c_str(), fontResource);
 
 	if (isHighlighted)
 		gr_color(mHighlightColor.red, mHighlightColor.green, mHighlightColor.blue, mHighlightColor.alpha);
 	else
 		gr_color(mColor.red, mColor.green, mColor.blue, mColor.alpha);
 
-	gr_textEx_scaleW(mRenderX, mRenderY, displayValue.c_str(), fontResource, maxWidth, mPlacement, scaleWidth);
+	gr_textEx_scaleW(mRenderX, mRenderY, mLastValue.c_str(), fontResource, maxWidth, mPlacement, scaleWidth);
 
 	return 0;
 }
@@ -164,13 +177,13 @@
 int GUIText::SetMaxWidth(unsigned width)
 {
 	maxWidth = width;
+	if (!maxWidth)
+		scaleWidth = false;
 	mVarChanged = 1;
 	return 0;
 }
 
-int GUIText::SkipCharCount(unsigned skip)
+void GUIText::SetText(string newtext)
 {
-	charSkip = skip;
-	mVarChanged = 1;
-	return 0;
+	mText = newtext;
 }
diff --git a/gui/theme/common/languages/hu.xml b/gui/theme/common/languages/hu.xml
index 718dd17..8f88751 100644
--- a/gui/theme/common/languages/hu.xml
+++ b/gui/theme/common/languages/hu.xml
@@ -2,6 +2,7 @@
 <!--Generated by crowdin.com-->
 <language>
 	<display>Hungarian</display>
+
 	<resources>
 		<!-- Font overrides - only change these if your language requires special characters -->
 		<resource name="font_l" type="fontoverride" filename="RobotoCondensed-Regular.ttf" scale="100" />
@@ -9,6 +10,7 @@
 		<resource name="font_s" type="fontoverride" filename="RobotoCondensed-Regular.ttf" scale="100" />
 		<resource name="fixed" type="fontoverride" filename="DroidSansMono.ttf" scale="100" />
 
+		<!-- Partition display names -->
 		<string name="system">Rendszer</string>
 		<string name="system_image">Rendszerkép</string>
 		<string name="vendor">Gyártó</string>
@@ -23,9 +25,12 @@
 		<string name="usbotg">USB OTG</string>
 		<string name="android_secure">Android Secure</string>
 		<string name="dalvik">Dalvik / ART-gyorsítótár</string>
+		<!-- This is a rarely used partition on a Micro SD card for a very old app2sd system -->
 		<string name="sdext">SD-EXT</string>
 		<string name="adopted_data">Adoptált adatok</string>
 		<string name="adopted_storage">Adoptált tároló</string>
+
+		<!-- GUI XML strings -->
 		<string name="twrp_header">Team Win Recovery Project</string>
 		<string name="twrp_watch_header">TWRP %tw_version%</string>
 		<string name="cpu_temp">CPU: %tw_cpu_temp% °C</string>
@@ -43,6 +48,7 @@
 		<string name="tab_screen">KÉPERNYŐ</string>
 		<string name="tab_vibration">REZGÉS</string>
 		<string name="tab_language">NYELV</string>
+
 		<string name="install_btn">Telepítés</string>
 		<string name="wipe_btn">Törlés</string>
 		<string name="backup_btn">Biztonsági mentés</string>
@@ -144,7 +150,8 @@
 		<string name="format_data_wtc2">mentését és médiáját. Nem lehet visszavonni.</string>
 		<string name="format_data_undo">Ezt nem lehet visszavonni.</string>
 		<string name="format_data_complete">Adatok formázása kész</string>
-		<string name="yes_continue">Folytatáshoz gépelje be: igen. Nyomja meg a vissza gombot a megszakításhoz.</string>
+		<!-- Translator note: the word "yes" must remain English! -->
+		<string name="yes_continue">Folytatáshoz gépelje be: yes. Nyomja meg a vissza gombot a megszakításhoz.</string>
 		<string name="part_opt_hdr">Partíció lehetőségei: %tw_partition_name%</string>
 		<string name="sel_act_hdr">Válasszon műveletet</string>
 		<string name="file_sys_opt">Fájlrendszer beállítások</string>
@@ -234,7 +241,7 @@
 		<string name="restore_sel_part">Válassza ki a visszaállítandó partíciókat:</string>
 		<string name="restore_enable_md5_chk">A biztonsági mentési fájlok MD5 ellenőrzésének engedélyezése</string>
 		<string name="restore_complete">Mentés helyreállítása kész</string>
-		<string name="swipe_restore">Csúsztasson a visszaállítshoz</string>
+		<string name="swipe_restore">Csúsztasson a visszaállításhoz</string>
 		<string name="swipe_restore_s">   Visszaállítás</string>
 		<string name="rename_backup_hdr">Biztonsági mentés átnevezése</string>
 		<string name="rename_backup_confirm">Biztonsági mentés átnevezése?</string>
@@ -300,6 +307,8 @@
 		<string name="settings_language_btn">Nyelv</string>
 		<string name="time_zone_hdr">Időzóna</string>
 		<string name="sel_tz_list">Időzóna választása:</string>
+		<!-- Translator note: if it does not make sense to translate the locations or if it makes more sense,
+				feel free to change the location listed or drop the location entirely and just call it UTC -6 -->
 		<string name="utcm11">(UTC-11) Szamoa, Midway-szigetek</string>
 		<string name="utcm10">(UTC-10) Hawaii</string>
 		<string name="utcm9">(UTC-9) Alaszka</string>
@@ -356,6 +365,7 @@
 		<string name="copy_log_confirm">Napló másolása SD-kártyára?</string>
 		<string name="copying_log">Napló másolása az SD-kártyára...</string>
 		<string name="copy_log_complete">Napló másolása kész</string>
+		<string name="fix_context_btn">Kontextus javítása</string>
 		<string name="part_sd_btn">SD-kártya particionálása</string>
 		<string name="part_sd_s_btn">SD-kártya</string>
 		<string name="file_manager_btn">Fájlkezelő</string>
@@ -427,6 +437,8 @@
 		<string name="decrypt_data_hdr">Adat dekódolása</string>
 		<string name="decrypt_data_enter_pass">Adja meg a jelszót.</string>
 		<string name="decrypt_data_enter_pattern">Adja meg a mintát.</string>
+		<string name="decrypt_data_failed">Helytelen jelszó, próbálja újra!</string>
+		<string name="decrypt_data_failed_pattern">Helytelen minta, próbálja újra!</string>
 		<string name="decrypt_data_trying">Dekódolás megpróbálása</string>
 		<string name="term_hdr">Terminál parancs</string>
 		<string name="term_s_hdr">Terminál</string>
@@ -440,6 +452,14 @@
 		<string name="sideload_confirm">ADB Sideload</string>
 		<string name="sideload_usage">Használat: adb sideload fájlnév.zip</string>
 		<string name="sideload_complete">ADB Sideload kész</string>
+		<string name="fix_contexts_hdr">Kontextus javítása</string>
+		<string name="fix_contexts_note1">Megjegyzés: kontextus javítására ritkán van szükség.</string>
+		<string name="fix_contexts_note2">SELinux kontextus javítása a készülék</string>
+		<string name="fix_contexts_note3">nem megfelelő elindulását okozhatja.</string>
+		<string name="swipe_to_fix_contexts">Csúsztasson a kontextus javításához</string>
+		<string name="swipe_fix_contexts">   Kontextus javítása</string>
+		<string name="fixing_contexts">Kontextus javítása...</string>
+		<string name="fix_contexts_complete">Kontextus javítása kész</string>
 		<string name="reboot_hdr">Újraindítás</string>
 		<string name="su_hdr">SuperSU ellenőrzés</string>
 		<string name="su_note1">A készüléke nem tűnik rootoltnak.</string>
@@ -451,6 +471,8 @@
 		<string name="su_installing">SuperSU telepítése</string>
 		<string name="sel_storage_list">Válasszon tárolót</string>
 		<string name="ok_btn">OK</string>
+
+		<!-- Various console messages - these consist of user displayed messages, oftentimes errors -->
 		<string name="no_kernel_selinux">Kernel nem támogatja a SELinux összefüggések olvasását.</string>
 		<string name="full_selinux">Teljes SELinux támogatás jelen van.</string>
 		<string name="no_selinux">Nincs SELinux támogatás (nincs libselinux).</string>
@@ -459,6 +481,7 @@
 		<string name="decrypt_success">Sikeresen visszafejtve az alapértelmezett jelszóval.</string>
 		<string name="unable_to_decrypt">Visszafejtés sikertelen az alapértelmezett jelszóval. Szükség lehet az adatok formázására.</string>
 		<string name="generating_md51">MD5 generálása</string>
+		<!-- Message displayed during a backup if we are generating an MD5, ideally, leave the leading " * " to help align and separate this text from other console text -->
 		<string name="generating_md52"> * MD5 generálása...</string>
 		<string name="md5_created"> * MD5 létrehozva.</string>
 		<string name="md5_error"> * MD5 hiba!</string>
@@ -481,6 +504,8 @@
 		<string name="backup_completed">[BIZTONSÁGI MENTÉS KÉSZ {1} MÁSODPERC ALATT]</string>
 		<string name="restore_started">[VISSZAÁLLÍTÁS ELINDÍTVA]</string>
 		<string name="restore_folder">Mappa visszaállítása: \'{1}\'</string>
+		<!-- {1} is the partition display name and {2} is the number of seconds -->
+		<string name="restore_part_done">[{1} kész ({2} másodperc)]</string>
 		<string name="verifying_md5">MD5 ellenőrzése</string>
 		<string name="skip_md5">MD5 ellenőrzés átugrása felhasználói beállítás alapján.</string>
 		<string name="calc_restore">Visszaállítási részletek számítása...</string>
@@ -491,6 +516,7 @@
 		<string name="total_restore_size">Teljes visszaállítás mérete: {1}MB</string>
 		<string name="updating_system_details">Rendszer részleteinek frissítése</string>
 		<string name="restore_completed">[VISSZAÁLLÍTÁS BEFEJEZŐDÖTT {1} MÁSODPERC ALATT]</string>
+		<!-- {1} is the path we could not open, {2} is strerror output -->
 		<string name="error_opening_strerr">Megnyitási hiba: \'{1}\' ({2})</string>
 		<string name="unable_locate_part_backup_name">Nem található partíció a biztonsági mentés neve alapján: \'{1}\'</string>
 		<string name="unable_find_part_path">Nem található partíció a(z) \'{1}\' elérési útnak</string>
@@ -534,8 +560,11 @@
 		<string name="repairing_using">{1} javítása {2} segítségével...</string>
 		<string name="unable_repair">{1} nem javítható.</string>
 		<string name="mount_data_footer">Nem sikerült csatolni az /adat partíciót és a titkosítási lábléc sem található.</string>
+		<!-- {1} is the folder name that we could not create, {2} is strerror output -->
 		<string name="create_folder_strerr">\'{1}\' mappa létrehozása sikertelen ({2}).</string>
+		<!-- {1} is the folder name that we could not mount, {2} is strerror output -->
 		<string name="fail_mount">\'{1}\' csatolása sikertlelen ({2})</string>
+		<!-- {1} is the folder name that we could not unmount, {2} is strerror output -->
 		<string name="fail_unmount">\'{1}\' leválasztása sikertlelen ({2})</string>
 		<string name="cannot_resize">{1} átméretezése sikertelen.</string>
 		<string name="repair_resize">{1} javítása az átméretezés előtt.</string>
@@ -611,6 +640,7 @@
 		<string name="backup_error">Hiba a biztonsági mentés létrehozásakor.</string>
 		<string name="restore_error">Hiba a visszaállítási folyamat közben.</string>
 		<string name="split_thread">{1} szálazonosító tördelése {2} archívumba</string>
+		<!-- These 2 items are saved in the data manager instead of resource manager, so %llu, etc is correct instead of {1} -->
 		<string name="file_progress">%llu / %llu fájl, %i%%</string>
 		<string name="size_progress">%lluMB / %lluMB, %i%%</string>
 		<string name="decrypt_cmd">Adatpartíció visszafejtésének megpróbálása parancssor segítségével.</string>
@@ -635,5 +665,6 @@
 		<string name="cancel_sideload">ADB sideload megszakítva...</string>
 		<string name="change_fs_err">Fájlrendszer módosítási hiba.</string>
 		<string name="theme_ver_err">Egyéni téma verziója nem egyezik a TWRP verziójával. Gyári téma használata.</string>
+		<string name="up_a_level">(Egy szinttel feljebb)</string>
 	</resources>
 </language>
diff --git a/gui/theme/common/languages/it.xml b/gui/theme/common/languages/it.xml
new file mode 100644
index 0000000..04187ef
--- /dev/null
+++ b/gui/theme/common/languages/it.xml
@@ -0,0 +1,670 @@
+<?xml version="1.0"?>
+
+<language>
+	<display>Italiano</display>
+
+	<resources>
+		<!-- Font overrides - only change these if your language requires special characters -->
+		<resource name="font_l" type="fontoverride" filename="RobotoCondensed-Regular.ttf" scale="100" />
+		<resource name="font_m" type="fontoverride" filename="RobotoCondensed-Regular.ttf" scale="100" />
+		<resource name="font_s" type="fontoverride" filename="RobotoCondensed-Regular.ttf" scale="100" />
+		<resource name="fixed" type="fontoverride" filename="DroidSansMono.ttf" scale="100" />
+
+		<!-- Partition display names -->
+		<string name="system">System</string>
+		<string name="system_image">Immagine System</string>
+		<string name="vendor">Vendor</string>
+		<string name="vendor_image">Immagine Vendor</string>
+		<string name="boot">Boot</string>
+		<string name="recovery">Recovery</string>
+		<string name="cache">Cache</string>
+		<string name="data">Data</string>
+		<string name="sdcard">SDCard</string>
+		<string name="internal">Archivio interno</string>
+		<string name="microsd">Micro SD</string>
+		<string name="usbotg">USB OTG</string>
+		<string name="android_secure">Android Secure</string>
+		<string name="dalvik">Dalvik / ART Cache</string>
+		<!-- This is a rarely used partition on a Micro SD card for a very old app2sd system -->
+		<string name="sdext">SD-EXT</string>
+		<string name="adopted_data">Data annessa</string>
+		<string name="adopted_storage">Archivio annesso</string>
+
+		<!-- GUI XML strings -->
+		<string name="twrp_header">Team Win Recovery Project</string>
+		<string name="twrp_watch_header">TWRP %tw_version%</string>
+		<string name="cpu_temp">CPU: %tw_cpu_temp% &#xB0;C</string>
+		<string name="battery_pct">Batteria: %tw_battery%</string>
+		<string name="sort_by_name">Ordina per Nome</string>
+		<string name="sort_by_date">Ordina per Data</string>
+		<string name="sort_by_size">Ordina per Dimensione</string>
+		<string name="sort_by_name_only">Nome</string>
+		<string name="sort_by_date_only">Data</string>
+		<string name="sort_by_size_only">Dimensione</string>
+		<string name="tab_general">GENERALE</string>
+		<string name="tab_options">OPZIONI</string>
+		<string name="tab_backup">BACKUP</string>
+		<string name="tab_time_zone">FUSO ORARIO</string>
+		<string name="tab_screen">SCHERMO</string>
+		<string name="tab_vibration">VIBRAZIONE</string>
+		<string name="tab_language">LINGUA</string>
+
+		<string name="install_btn">Installa</string>
+		<string name="wipe_btn">Pulisci</string>
+		<string name="backup_btn">Backup</string>
+		<string name="restore_btn">Ripristina</string>
+		<string name="mount_btn">Monta</string>
+		<string name="settings_btn">Impostazioni</string>
+		<string name="advanced_btn">Avanzate</string>
+		<string name="reboot_btn">Riavvia</string>
+		<string name="files_btn">File</string>
+		<string name="copy_log_btn">Copia Log</string>
+		<string name="select_type_hdr">Scegli tipologia</string>
+		<string name="install_zip_hdr">Installa Zip</string>
+		<string name="install_zip_btn">Installa Zip</string>
+		<string name="install_image_hdr">Installa Immagine</string>
+		<string name="install_image_btn">Installa Immagine</string>
+		<string name="install_select_file_hdr">Seleziona il file</string>
+		<string name="file_selector_folders_hdr">Cartelle</string>
+		<string name="select_file_from_storage">Seleziona il file da %tw_storage_display_name% (%tw_storage_free_size% MB)</string>
+		<string name="adb_sideload_btn">ADB Sideload</string>
+		<string name="install_hdr">Installa</string>
+		<string name="select_storage_hdr">Scegli archivio</string>
+		<string name="select_storage_btn">Scegli archivio</string>
+		<string name="queue_hdr">Coda</string>
+		<string name="zip_queue_count">%tw_zip_queue_count% file accodati su un max di 10</string>
+		<string name="zip_queue_count_s">File %tw_zip_queue_count% di 10:</string>
+		<string name="zip_warn1">Questa operazione potrebbe installare software</string>
+		<string name="zip_warn2">incompatibile e rendere il tuo dispositivo inutilizzabile.</string>
+		<string name="zip_back_cancel">Premi indietro per annullare la selezione di questo file.</string>
+		<string name="zip_back_clear">Premi indietro per eliminare la coda di Zip.</string>
+		<string name="folder">Cartella:</string>
+		<string name="file">File:</string>
+		<string name="zip_sig_chk">Verifica della firma del file Zip</string>
+		<string name="inject_twrp_chk">Esegui TWRP Inject dopo l'installazione</string>
+		<string name="options_hdr">Opzioni</string>
+		<string name="confirm_flash_hdr">Conferma installazione</string>
+		<string name="zip_queue">Coda:</string>
+		<string name="options">Opzioni:</string>
+		<string name="swipe_confirm">   Conferma</string>
+		<string name="zip_add_btn">Aggiungi altri Zip</string>
+		<string name="zip_clear_btn">Elimina la coda di Zip</string>
+		<string name="install_zip_count_hdr">Installazione Zip %tw_zip_index% di %tw_zip_queue_count%</string>
+		<string name="installing_zip_xml">Installazione Zip %tw_file% in corso...</string>
+		<string name="failed">Operazione fallita</string>
+		<string name="successful">Operazione riuscita</string>
+		<string name="install_failed">Installazione fallita</string>
+		<string name="install_successful">Installazione riuscita</string>
+		<string name="wipe_cache_dalvik_btn">Pulisci Cache/Dalvik</string>
+		<string name="reboot_system_btn">Riavvia sistema</string>
+		<string name="install_sel_target">Scegli partizione</string>
+		<string name="flash_image_select">Scegli la partizione su cui installare:</string>
+		<string name="target_partition">Partizione scelta:</string>
+		<string name="flashing_image">Installazione Immagine...</string>
+		<string name="image_flashed">Immagine installata</string>
+		<string name="wipe_cache_dalvik_confirm">Pulire Cache &amp; Dalvik?</string>
+		<string name="wiping_cache_dalvik">Pulizia Cache &amp; Dalvik...</string>
+		<string name="wipe_cache_dalvik_complete">Pulizia Cache &amp; Dalvik completata</string>
+		<string name="swipe_wipe">Scorri per pulire</string>
+		<string name="swipe_wipe_s">   Pulisci</string>
+		<string name="no_os1">Nessun SO installato. Sei</string>
+		<string name="no_osrb">certo di voler riavviare?</string>
+		<string name="no_ospo">certo di voler spegnere?</string>
+		<string name="rebooting">Riavvio...</string>
+		<string name="swipe_reboot">Scorri per riavviare</string>
+		<string name="swipe_reboot_s">   Riavvia</string>
+		<string name="swipe_flash">Scorri per installare</string>
+		<string name="confirm_action">Conferma l'azione</string>
+		<string name="back_cancel">Premi indietro per annullare.</string>
+		<string name="cancel_btn">Annulla</string>
+		<string name="wipe_hdr">Pulizia</string>
+		<string name="factory_reset_hdr">Reset di fabbrica</string>
+		<string name="factory_reset_btn">Reset di fabbrica</string>
+		<string name="factory_reset1">Data, Cache e Dalvik saranno puliti</string>
+		<string name="factory_reset2">(l'archivio interno sarà escluso)</string>
+		<string name="factory_reset3">La maggior parte delle volte, questo</string>
+		<string name="factory_reset4">sarà l'unico tipo di pulizia necessario.</string>
+		<string name="factory_resetting">Reset in corso...</string>
+		<string name="advanced_wipe_hdr">Pulizia avanzata</string>
+		<string name="advanced_wipe_btn">Pulizia avanzata</string>
+		<string name="wipe_enc_confirm">Eliminare la crittografia da Data?</string>
+		<string name="formatting_data">Formattazione di Data in corso...</string>
+		<string name="swipe_format_data">Scorri per formattare Data...</string>
+		<string name="swipe_format_data_s">   Formattazione Data</string>
+		<string name="factory_reset_complete">Reset di fabbrica completato</string>
+		<string name="sel_part_hdr">Selezione partizioni</string>
+		<string name="wipe_sel_confirm">Pulire questa(e) partizione(i)?</string>
+		<string name="wiping_part">Pulizia partizione(i) in corso...</string>
+		<string name="wipe_complete">Pulizia completata</string>
+		<string name="sel_part_wipe">Scegli le partizioni da pulire:</string>
+		<string name="invalid_part_sel">Scelta non valida</string>
+		<string name="format_data_hdr">Formattazione Data</string>
+		<string name="format_data_btn">Formatta Data</string>
+		<string name="format_data_ptr1">Formattare Data eliminerà tutte le tue app,</string>
+		<string name="format_data_ptr2">backup, immagini, video e file. Inoltre, la</string>
+		<string name="format_data_ptr3">crittografia dell'archivio interno sarà rimossa.</string>
+		<string name="format_data_adopted">Includi Archivio annesso</string>
+		<string name="format_data_lcp1">Formattare Data eliminerà tutte le app, backup, immagini, video e file.</string>
+		<string name="format_data_lcp2">Inoltre, la crittografia dell'archivio interno sarà rimossa.</string>
+		<string name="format_data_wtc1">Formattare Data eliminerà tutte le tue app,</string>
+		<string name="format_data_wtc2">backup e file. L'operazione è irreversibile.</string>
+		<string name="format_data_undo">L'operazione è irreversibile.</string>
+		<string name="format_data_complete">Formattazione di Data completata</string>
+		<!-- Translator note: the word "yes" must remain English! -->
+		<string name="yes_continue">Scrivi yes per continuare.  Premi indietro per annullare.</string>
+		<string name="part_opt_hdr">Opzioni partizione per: %tw_partition_name%</string>
+		<string name="sel_act_hdr">Scegli azione</string>
+		<string name="file_sys_opt">Opzioni filesystem</string>
+		<string name="partition">Partizione: %tw_partition_name%</string>
+		<string name="part_mount_point">Punto di montaggio: %tw_partition_mount_point%</string>
+		<string name="part_curr_fs">Filesystem: %tw_partition_file_system%</string>
+		<string name="part_present_yes">Presente: Sì</string>
+		<string name="part_present_no">Presente: No</string>
+		<string name="part_removable_yes">Rimovibile: Sì</string>
+		<string name="part_removable_no">Rimovibile: No</string>
+		<string name="part_size">Dimensione: %tw_partition_size%MB</string>
+		<string name="part_used">Utilizzati: %tw_partition_used%MB</string>
+		<string name="part_free">Liberi: %tw_partition_free%MB</string>
+		<string name="part_backup_size">Dimensione backup: %tw_partition_backup_size%MB</string>
+		<string name="resize_btn">Ridimensiona filesystem</string>
+		<string name="resize_btn_s">Ridimensiona</string>
+		<string name="resize_confirm">Ridimensionare %tw_partition_name%?</string>
+		<string name="resizing">Ridimensionamento in corso...</string>
+		<string name="resize_complete">Ridimensionamento completato</string>
+		<string name="swipe_resize">Scorri per ridimensionare</string>
+		<string name="swipe_resize_s">   Ridimensiona</string>
+		<string name="repair_btn">Ripara filesystem</string>
+		<string name="repair_btn_s">Ripara</string>
+		<string name="repair_confirm">Riparare %tw_partition_name%?</string>
+		<string name="repairing">Riparazione in corso...</string>
+		<string name="repair_complete">Riparazione completata</string>
+		<string name="swipe_repair">Scorri per riparare</string>
+		<string name="swipe_repair_s">   Ripara</string>
+		<string name="change_fs_btn">Cambia filesystem</string>
+		<string name="change_fs_btn_s">Cambia</string>
+		<string name="change_fs_for_hdr">Cambia il filesystem di: %tw_partition_name%</string>
+		<string name="change_fs_for_hdr_s">Partizione: %tw_partition_name% &gt; Scegli filesystem</string>
+		<string name="change_fs_warn1">Alcune ROM o kernel non supportano determinati</string>
+		<string name="change_fs_warn2">filesystem. Procedi con cautela!</string>
+		<string name="change_fs_confirm">Modificare %tw_partition_name%?</string>
+		<string name="formatting">Formattazione in corso...</string>
+		<string name="format_complete">Formattazione completata</string>
+		<string name="swipe_change_fs">Scorri per modificare</string>
+		<string name="swipe_change_s">   Modifica</string>
+		<string name="back_btn">Indietro</string>
+		<string name="wipe_enc_btn">Elimina crittografia</string>
+		<string name="swipe_factory_reset">Scorri per eseguire reset di fabbrica</string>
+		<string name="repair_change_btn">Ripara o Modifica filesystem</string>
+		<string name="storage_hdr">Archivio: %tw_storage_display_name% (%tw_storage_free_size% MB)</string>
+		<string name="backup_hdr">Backup</string>
+		<string name="backup_confirm_hdr">Conferma Backup</string>
+		<string name="encryption_tab">CRITTOGRAFIA</string>
+		<string name="encryption">Crittografia:</string>
+		<string name="name">Nome:</string>
+		<string name="sel_part_backup">Seleziona le partizioni di cui eseguire un Backup:</string>
+		<string name="storage">Archivio:</string>
+		<string name="enc_disabled">disabilitata - imposta una password per abilitarla</string>
+		<string name="enc_enabled">abilitata</string>
+		<string name="enable_backup_comp_chk">Abilita compressione</string>
+		<string name="skip_md5_backup_chk">Salta la generazione di MD5 durante il backup</string>
+		<string name="disable_backup_space_chk">Disabilita controllo dello spazio libero</string>
+		<string name="refresh_sizes_btn">Aggiorna dimensioni</string>
+		<string name="swipe_backup">Scorri per eseguire il backup</string>
+		<string name="append_date_btn">Includi la data</string>
+		<string name="backup_name_exists">Esiste già un backup con lo stesso nome!</string>
+		<string name="encrypt_backup">Crittografare il backup?</string>
+		<string name="enter_pass">Inserisci una password:</string>
+		<string name="enter_pass2">Inserisci nuovamente la password:</string>
+		<string name="pass_not_match">Le password non corrispondono!</string>
+		<string name="partitions">Partizioni:</string>
+		<string name="disabled">Disabilitato</string>
+		<string name="enabled">Abilitato</string>
+		<string name="backup_name_hdr">Imposta nome backup</string>
+		<string name="progress">Avanzamento:</string>
+		<string name="backup_complete">Backup completato</string>
+		<string name="restore_hdr">Ripristina backup</string>
+		<string name="sel_backup_hdr">Scegli backup</string>
+		<string name="restore_sel_store_hdr">Seleziona un backup da %tw_storage_display_name% (%tw_storage_free_size% MB)</string>
+		<string name="restore_sel_pack_fs">Scegli i contenuti da ripristinare:</string>
+		<string name="restore_enc_backup_hdr">Backup crittografato</string>
+		<string name="restore_dec_fail">Password errata! Riprova.</string>
+		<string name="del_backup_btn">Elimina backup</string>
+		<string name="del_backup_confirm">Eliminare il backup?</string>
+		<string name="del_backup_confirm2">L'operazione è irreversibile!</string>
+		<string name="deleting_backup">Eliminazione backup in corso...</string>
+		<string name="backup_deleted">Eliminazione backup completata</string>
+		<string name="swipe_delete">Scorri per eliminare</string>
+		<string name="swipe_delete_s">   Elimina</string>
+		<string name="restore_try_decrypt">Backup crittografato - tentativo di decriptazione</string>
+		<string name="restore_try_decrypt_s">Tentativo di decriptazione</string>
+		<string name="restore_backup_date">Backup creato il %tw_restore_file_date%</string>
+		<string name="restore_sel_part">Seleziona le partizioni da ripristinare:</string>
+		<string name="restore_enable_md5_chk">Abilita verifica MD5</string>
+		<string name="restore_complete">Ripristino completato</string>
+		<string name="swipe_restore">Scorri per ripristinare</string>
+		<string name="swipe_restore_s">   Ripristina</string>
+		<string name="rename_backup_hdr">Rinomina backup</string>
+		<string name="rename_backup_confirm">Rinominare il backup?</string>
+		<string name="rename_backup_confirm2">L'operazione è irreversibile!</string>
+		<string name="renaming_backup">Rinominazione del backup in corso...</string>
+		<string name="rename_backup_complete">Rinominazione del backup completata</string>
+		<string name="swipe_to_rename">Scorri per rinominare</string>
+		<string name="swipe_rename">   Rinomina</string>
+		<string name="confirm_hdr">Conferma</string>
+		<string name="mount_hdr">Monta</string>
+		<string name="mount_sel_part">Seleziona le partizioni da montare:</string>
+		<string name="mount_sys_ro_chk">Monta la partizione System in sola lettura</string>
+		<string name="mount_sys_ro_s_chk">Monta System in sola lettura</string>
+		<string name="decrypt_data_btn">Decripta Data</string>
+		<string name="disable_mtp_btn">Disabilita MTP</string>
+		<string name="enable_mtp_btn">Abilita MTP</string>
+		<string name="mount_usb_storage_btn">Monta archivio USB</string>
+		<string name="usb_storage_hdr">Archivio USB</string>
+		<string name="usb_stor_mnt1">Archivio USB montato</string>
+		<string name="usb_stor_mnt2">Accertati di aver eseguito la rimozione sicura</string>
+		<string name="usb_stor_mnt3">dal tuo computer prima di smontare l'archivio!</string>
+		<string name="unmount_btn">Smonta</string>
+		<string name="rb_system_btn">Sistema</string>
+		<string name="rb_poweroff_btn">Spegni</string>
+		<string name="rb_recovery_btn">Recovery</string>
+		<string name="rb_bootloader_btn">Bootloader</string>
+		<string name="rb_download_btn">Download</string>
+		<string name="turning_off">Spegnimento in corso...</string>
+		<string name="swipe_power_off">Scorri per spegnere</string>
+		<string name="swipe_power_off_s">Spegni</string>
+		<string name="sys_ro_hdr">Partizione System non modificata</string>
+		<string name="sys_ro_keep">Mantenere System in sola lettura?</string>
+		<string name="sys_rop1">TWRP può preservare la partizione System dalle modifiche</string>
+		<string name="sys_rop2">per facilitarti l'installazione di aggiornamenti ufficiali.</string>
+		<string name="sys_rop3">TWRP non potrà prevenire la sostituzione della Recovery da parte</string>
+		<string name="sys_rop4">della ROM, e non ti chiederà se desideri ottenere accesso root.</string>
+		<string name="sys_rop5">Installare Zip o eseguire operazioni mediante adb</string>
+		<string name="sys_rop6">potrà ugualmente operare modifiche su System.</string>
+		<string name="sys_rol1">TWRP può preservare la partizione System dalle modifiche per facilitarti l'installazione di aggiornamenti ufficiali.</string>
+		<string name="sys_rol2">TWRP non potrà prevenire la sostituzione della Recovery da parte della ROM, e non ti chiederà se desideri ottenere accesso root.</string>
+		<string name="sys_rol3">Installare Zip o eseguire operazioni mediante adb potrà ugualmente operare modifiche su System.</string>
+		<string name="sys_ro_never_show_chk">Non mostrare più questa schermata all'avvio</string>
+		<string name="sys_ro_keep_ro_btn">Mantieni sola lettura</string>
+		<string name="swipe_allow_mod">Scorri per permettere le modifiche</string>
+		<string name="swipe_allow_mod_s">Permetti modifiche</string>
+		<string name="settings_hdr">Impostazioni</string>
+		<string name="settings_gen_hdr">Generale</string>
+		<string name="settings_gen_s_hdr">Generale</string>
+		<string name="settings_gen_btn">Generale</string>
+		<string name="use_rmrf_chk">Usa rm -rf invece di formattare</string>
+		<string name="use24clock_chk">Usa orologio a 24 ore</string>
+		<string name="rev_navbar_chk">Rovescia la navbar</string>
+		<string name="simact_chk">Simula le azioni per il testing dei temi</string>
+		<string name="simfail_chk">Simula fallimenti per le azioni</string>
+		<string name="ctr_navbar_rdo">Centra pulsanti della navbar</string>
+		<string name="lft_navbar_rdo">Allinea pulsanti della navbar a SX</string>
+		<string name="rht_navbar_rdo">Allinea pulsanti della navbar a DX</string>
+		<string name="restore_defaults_btn">Ripristina predefinite</string>
+		<string name="settings_tz_btn">Fuso orario</string>
+		<string name="settings_screen_btn">Schermo</string>
+		<string name="settings_screen_bright_btn">Luminosità</string>
+		<string name="settings_vibration_btn">Vibrazione</string>
+		<string name="settings_language_btn">Lingua</string>
+		<string name="time_zone_hdr">Fuso orario</string>
+		<string name="sel_tz_list">Scegli fuso orario:</string>
+		<!-- Translator note: if it does not make sense to translate the locations or if it makes more sense,
+				feel free to change the location listed or drop the location entirely and just call it UTC -6 -->
+		<string name="utcm11">(UTC -11) Samoa, Midway Island</string>
+		<string name="utcm10">(UTC -10) Hawaii</string>
+		<string name="utcm9">(UTC -9) Alaska</string>
+		<string name="utcm8">(UTC -8) Pacific Time</string>
+		<string name="utcm7">(UTC -7) Mountain Time</string>
+		<string name="utcm6">(UTC -6) Central Time</string>
+		<string name="utcm5">(UTC -5) Eastern Time</string>
+		<string name="utcm4">(UTC -4) Atlantic Time</string>
+		<string name="utcm3">(UTC -3) Brazil, Buenos Aires</string>
+		<string name="utcm2">(UTC -2) Mid-Atlantic</string>
+		<string name="utcm1">(UTC -1) Azores, Cape Verde</string>
+		<string name="utc0">(UTC  0) London, Dublin, Lisbon</string>
+		<string name="utcp1">(UTC +1) Berlin, Brussels, Paris</string>
+		<string name="utcp2">(UTC +2) Athens, Istanbul, South Africa</string>
+		<string name="utcp3">(UTC +3) Moscow, Baghdad</string>
+		<string name="utcp4">(UTC +4) Abu Dhabi, Tbilisi, Muscat</string>
+		<string name="utcp5">(UTC +5) Yekaterinburg, Islamabad</string>
+		<string name="utcp6">(UTC +6) Almaty, Dhaka, Colombo</string>
+		<string name="utcp7">(UTC +7) Bangkok, Hanoi, Jakarta</string>
+		<string name="utcp8">(UTC +8) Beijing, Singapore, Hong Kong</string>
+		<string name="utcp9">(UTC +9) Tokyo, Seoul, Yakutsk</string>
+		<string name="utcp10">(UTC +10) Eastern Australia, Guam</string>
+		<string name="utcp11">(UTC +11) Vladivostok, Solomon Islands</string>
+		<string name="utcp12">(UTC +12) Auckland, Wellington, Fiji</string>
+		<string name="sel_tz_offset">Scegli offset (solitamente 0): %tw_time_zone_guioffset%</string>
+		<string name="tz_offset_none">Nessuno</string>
+		<string name="tz_offset_0">0</string>
+		<string name="tz_offset_15">15</string>
+		<string name="tz_offset_30">30</string>
+		<string name="tz_offset_45">45</string>
+		<string name="use_dst_chk">Usa ora legale</string>
+		<string name="curr_tz">Fuso orario attuale: %tw_time_zone%</string>
+		<string name="curr_tz_s">Fuso orario attuale:</string>
+		<string name="set_tz_btn">Imposta fuso orario</string>
+		<string name="settings_screen_hdr">Schermo</string>
+		<string name="settings_screen_timeout_hdr">Timeout schermo</string>
+		<string name="enable_timeout_chk">Abilita timeout schermo</string>
+		<string name="screen_to_slider">Timeout in secondi:</string>
+		<string name="screen_to_slider_s">Timeout in secondi (0=disabilitato): %tw_screen_timeout_secs%</string>
+		<string name="screen_to_na">Impostazione del timeout non disponibile</string>
+		<string name="screen_bright_slider">Luminosità: %tw_brightness_pct%%</string>
+		<string name="screen_bright_na">Impostazione luminosità non disponibile</string>
+		<string name="vibration_hdr">Vibrazione</string>
+		<string name="button_vibration_hdr">Vibrazione pulsanti</string>
+		<string name="kb_vibration_hdr">Vibrazione tastiera</string>
+		<string name="act_vibration_hdr">Vibrazione azioni</string>
+		<string name="button_vibration">Vibrazione pulsanti:</string>
+		<string name="kb_vibration">Vibrazione tastiera:</string>
+		<string name="act_vibration">Vibrazione azioni:</string>
+		<string name="select_language">Scegli lingua:</string>
+		<string name="sel_lang_btn">Scegli lingua</string>
+		<string name="set_language_btn">Imposta lingua</string>
+		<string name="advanced_hdr">Avanzate</string>
+		<string name="copy_log_confirm">Copiare il log su scheda SD?</string>
+		<string name="copying_log">Copia del log in corso...</string>
+		<string name="copy_log_complete">Copia del log completata</string>
+		<string name="fix_context_btn">Ripara contesti</string>
+		<string name="part_sd_btn">Partiziona SD</string>
+		<string name="part_sd_s_btn">Scheda SD</string>
+		<string name="file_manager_btn">File manager</string>
+		<string name="language_hdr">Lingua</string>
+		<string name="terminal_btn">Terminale</string>
+		<string name="reload_theme_btn">Ricarica tema</string>
+		<string name="dumlock_btn">HTC Dumlock</string>
+		<string name="inject_twrp_btn">TWRP Inject</string>
+		<string name="inject_twrp_confirm">Eseguire nuovamente TWRP Inject?</string>
+		<string name="injecting_twrp">Esecuzione di TWRP Inject in corso...</string>
+		<string name="inject_twrp_complete">TWRP Inject completato</string>
+		<string name="swipe_to_confirm">Scorri per confermare</string>
+		<string name="part_sd_hdr">Partiziona scheda SD</string>
+		<string name="invalid_partsd_sel">Devi selezionare un dispositivo rimovibile</string>
+		<string name="part_sd_lose">Tutti i file sulla scheda SD andranno perduti!</string>
+		<string name="part_sd_undo">L'operazione è irreversibile!</string>
+		<string name="part_sd_ext_sz">Dimensione EXT:</string>
+		<string name="part_sd_swap_sz">Dimensione Swap:</string>
+		<string name="part_sd_m">-</string>
+		<string name="part_sd_p">+</string>
+		<string name="file_system">Filesystem:</string>
+		<string name="swipe_part_sd">Scorri per partizionare</string>
+		<string name="swipe_part_sd_s">Partiziona</string>
+		<string name="partitioning_sd">Partizionamento scheda SD in corso...</string>
+		<string name="partitioning_sd2">Ci vorranno un paio di minuti.</string>
+		<string name="part_sd_complete">Partizionamento completato</string>
+		<string name="dumlock_hdr">HTC Dumlock</string>
+		<string name="dumlock_restore_btn">Ripristina Boot originale</string>
+		<string name="dumlock_restore_confirm">Ripristinare l'immagine di Boot originale?</string>
+		<string name="dumlock_restoring">Ripristino del Boot originale in corso...</string>
+		<string name="dumlock_restore_complete">Ripristino del Boot originale completato</string>
+		<string name="dumlock_reflash_btn">Reinstalla Recovery</string>
+		<string name="dumlock_reflash_confirm">Reinstallare la Recovery in Boot?</string>
+		<string name="dumlock_reflashing">Installazione Recovery in Boot in corso...</string>
+		<string name="dumlock_reflash_complete">Installazione della Recovery in Boot completata</string>
+		<string name="dumlock_install_btn">Installa HTC Dumlock</string>
+		<string name="dumlock_install_confirm">Installare i file di HTC Dumlock nella ROM?</string>
+		<string name="dumlock_installing">Installazione di HTC Dumlock in corso...</string>
+		<string name="dumlock_install_complete">Installazione di HTC Dumlock Install completata</string>
+		<string name="swipe_to_unlock">Scorri per sbloccare</string>
+		<string name="swipe_unlock">   Sblocca</string>
+		<string name="fm_hdr">File manager</string>
+		<string name="fm_sel_file">Seleziona un file o una cartella</string>
+		<string name="fm_type_folder">Cartella</string>
+		<string name="fm_type_file">File</string>
+		<string name="fm_choose_act">Scegli azione</string>
+		<string name="fm_selected">%tw_fm_type% selezionato(a):</string>
+		<string name="fm_copy_btn">Copia</string>
+		<string name="fm_copy_file_btn">Copia</string>
+		<string name="fm_copy_folder_btn">Copia</string>
+		<string name="fm_copying">Copia di</string>
+		<string name="fm_move_btn">Sposta</string>
+		<string name="fm_moving">Spostamento di</string>
+		<string name="fm_chmod755_btn">chmod 755</string>
+		<string name="fm_chmod755ing">chmod 755 di</string>
+		<string name="fm_chmod_btn">chmod</string>
+		<string name="fm_delete_btn">Elimina</string>
+		<string name="fm_deleting">Eliminazione di</string>
+		<string name="fm_rename_btn">Rinomina</string>
+		<string name="fm_rename_file_btn">Rinomina</string>
+		<string name="fm_rename_folder_btn">Rinomina</string>
+		<string name="fm_renaming">Rinominazione di</string>
+		<string name="fm_sel_dest">Scegli cartella di destinazione</string>
+		<string name="fm_sel_curr_folder">Scegli cartella attuale</string>
+		<string name="fm_rename_hdr">Rinomina</string>
+		<string name="fm_set_perms_hdr">Imposta permessi</string>
+		<string name="fm_perms">Permessi:</string>
+		<string name="fm_complete">Operazione completata</string>
+		<string name="decrypt_data_hdr">Decripta Data</string>
+		<string name="decrypt_data_enter_pass">Inserisci la password.</string>
+		<string name="decrypt_data_failed">Password errata! Riprova.</string>
+		<string name="decrypt_data_failed_pattern">Sequenza errata! Riprova.</string>
+		<string name="decrypt_data_enter_pattern">Inserisci sequenza di sblocco.</string>
+		<string name="decrypt_data_trying">Tentativo di decriptazione in corso...</string>
+		<string name="term_hdr">Terminale</string>
+		<string name="term_s_hdr">Terminale</string>
+		<string name="term_kill_btn">TERMINA</string>
+		<string name="term_sel_folder_hdr">Scegli la cartella d'inizio</string>
+		<string name="adb_sideload_hdr">ADB Sideload</string>
+		<string name="sideload_wipe_dalvik_chk">Pulisci la cache Dalvik</string>
+		<string name="sideload_wipe_cache_chk">Pulisci Cache</string>
+		<string name="swipe_to_sideload">Scorri per avviare Sideload</string>
+		<string name="swipe_sideload">   Avvia</string>
+		<string name="sideload_confirm">ADB Sideload</string>
+		<string name="sideload_usage">Utilizzo: adb sideload nomefile.zip</string>
+		<string name="sideload_complete">ADB Sideload completato</string>
+		<string name="fix_contexts_hdr">Ripristina contesti</string>
+		<string name="fix_contexts_note1">Nota: il ripristino dei contesti è raramente necessario.</string>
+		<string name="fix_contexts_note2">Il ripristino dei contesti SELinux può impedire</string>
+		<string name="fix_contexts_note3">il corretto avvio del tuo dispositivo.</string>
+		<string name="swipe_to_fix_contexts">Scorri per ripristinare i contesti</string>
+		<string name="swipe_fix_contexts">   Ripristina contesti</string>
+		<string name="fixing_contexts">Ripristino dei contesti in corso...</string>
+		<string name="fix_contexts_complete">Ripristino dei contesti completato</string>
+		<string name="reboot_hdr">Riavvio</string>
+		<string name="su_hdr">Verifica SuperSU</string>
+		<string name="su_note1">Il tuo dispositivo non sembra disporre di accesso root.</string>
+		<string name="su_note2">Installare SuperSU ora?</string>
+		<string name="su_note3">Ciò ti garantirà privilegi di root.</string>
+		<string name="su_cancel">Non installare</string>
+		<string name="swipe_su_to_install">Scorri per installare</string>
+		<string name="swipe_su_install">   Installa</string>
+		<string name="su_installing">Installazione di SuperSU in corso...</string>
+		<string name="sel_storage_list">Scegli archivio</string>
+		<string name="ok_btn">OK</string>
+
+		<!-- Various console messages - these consist of user displayed messages, oftentimes errors -->
+		<string name="no_kernel_selinux">Il kernel non supporta la lettura dei contesti SELinux.</string>
+		<string name="full_selinux">Supporto per SELinux completo non presente.</string>
+		<string name="no_selinux">Nessun supporto per SELinux (libselinux assente).</string>
+		<string name="mtp_enabled">MTP abilitato</string>
+		<string name="mtp_crash">MTP si è arrestato. Non sarà più inizializzato all'avvio.</string>
+		<string name="decrypt_success">Decriptazione con password predefinita avvenuta con successo.</string>
+		<string name="unable_to_decrypt">Impossibile decriptare con password predefinita. Potresti dover formattare Data.</string>
+		<string name="generating_md51">Generazione MD5 in corso...</string>
+		<!-- Message displayed during a backup if we are generating an MD5, ideally, leave the leading " * " to help align and separate this text from other console text -->
+		<string name="generating_md52"> * Generazione MD5 in corso...</string>
+		<string name="md5_created"> * MD5 creato.</string>
+		<string name="md5_error"> * Errore nell'MD5!</string>
+		<string name="md5_compute_error"> * Errore nel calcolo dell'MD5.</string>
+		<string name="current_date">(Data attuale)</string>
+		<string name="auto_generate">(Genera automaticamente)</string>
+		<string name="unable_to_locate_partition">Impossibile localizzare la partizione '{1}' per il calcolo delle dimensioni del backup.</string>
+		<string name="no_partition_selected">Nessuna partizione selezionata.</string>
+		<string name="total_partitions_backup"> * Numero di partizioni di cui eseguire il backup: {1}</string>
+		<string name="total_backup_size"> * Dimensione complessiva: {1}MB</string>
+		<string name="available_space"> * Spazio disponibile: {1}MB</string>
+		<string name="unable_locate_storage">Impossibile localizzare l'archivio.</string>
+		<string name="no_space">Lo spazio libero dell'archivio scelto è insufficiente.</string>
+		<string name="backup_started">[INIZIO DEL BACKUP]</string>
+		<string name="backup_folder"> * Cartella dei backup: {1}</string>
+		<string name="fail_backup_folder">Creazione della cartella dei backup fallita.</string>
+		<string name="avg_backup_fs">Velocità media di backup del filesystem: {1} MB/sec</string>
+		<string name="avg_backup_img">Velocità media di backup del drive: {1} MB/sec</string>
+		<string name="total_backed_size">[DIMENSIONE TOTALE SALVATA: {1} MB]</string>
+		<string name="backup_completed">[BACKUP COMPLETATO IN {1} SECONDI]</string>
+		<string name="restore_started">[INIZIO DEL RIPRISTINO]</string>
+		<string name="restore_folder">Cartella da cui ripristinare: '{1}'</string>
+		<!-- {1} is the partition display name and {2} is the number of seconds -->
+		<string name="restore_part_done">[Partizione {1} ripristinata ({2} secondi)]</string>
+		<string name="verifying_md5">Verifica MD5 in corso...</string>
+		<string name="skip_md5">Saltando la verifica del MD5 in base alle impostazioni stabilite.</string>
+		<string name="calc_restore">Calcolo dei dettagli del ripristino in corso...</string>
+		<string name="restore_read_only">Impossibile ripristinare {1} -- partizione montata in sola lettura.</string>
+		<string name="restore_unable_locate">Impossibile localizzare la partizione '{1}' per il ripristino.</string>
+		<string name="no_part_restore">Nessuna partizione selezionata per il ripristino.</string>
+		<string name="restore_part_count">Ripristino di {1} partizioni in corso...</string>
+		<string name="total_restore_size">Dimensione complessiva da ripristinare: {1}MB</string>
+		<string name="updating_system_details">Aggiornamento dei dettagli di System...</string>
+		<string name="restore_completed">[RIPRISTINO COMPLETATO IN {1} SECONDI]</string>
+		<!-- {1} is the path we could not open, {2} is strerror output -->
+		<string name="error_opening_strerr">Errore durante l'apertura di: '{1}' ({2})</string>
+		<string name="unable_locate_part_backup_name">Impossibile localizzare la partizione dal nome di backup: '{1}'</string>
+		<string name="unable_find_part_path">Impossibile localizzare la partizione associata al percorso '{1}'</string>
+		<string name="update_part_details">Aggiornamento dei dettagli della partizione...</string>
+		<string name="update_part_details_done">...fatto</string>
+		<string name="wiping_dalvik">Pulizia delle cartelle della cache Dalvik...</string>
+		<string name="cleaned">Cartella pulita: {1}...</string>
+		<string name="dalvik_done">-- pulizia delle cartelle della cache Dalvik completata!</string>
+		<string name="no_andsec">Nessuna partizione Android protetta trovata.</string>
+		<string name="unable_to_locate">Impossibile localizzare {1}.</string>
+		<string name="wiping_datamedia">Pulizia dell'archivio interno -- /data/media...</string>
+		<string name="unable_to_mount">Impossibile montare {1}</string>
+		<string name="unable_to_mount_internal">Impossibile montare l'archivio interno</string>
+		<string name="unable_to_mount_storage">Impossibile montare l'archivio</string>
+		<string name="fail_decrypt">Decriptazione dei dati fallita.</string>
+		<string name="no_crypto_support">In questa build non è stato integrato alcun supporto per la crittografia.</string>
+		<string name="decrypt_success_dev">Dati decriptati con successo. Nuovo dispositivo di memoria: '{1}'</string>
+		<string name="done">Fatto.</string>
+		<string name="start_partition_sd">Partizionamento scheda SD in corso...</string>
+		<string name="partition_sd_locate">Impossibile localizzare il dispositivo da partizionare.</string>
+		<string name="ext_swap_size">La dimensione complessiva di EXT e Swap eccede la capacità della scheda SD.</string>
+		<string name="remove_part_table">Rimozione della tabella delle partizioni in corso...</string>
+		<string name="unable_rm_part">Impossibile rimuovere la tabella delle partizioni.</string>
+		<string name="create_part">Creazione della partizione {1} in corso...</string>
+		<string name="unable_to_create_part">Impossibile creare la partizione {1}.</string>
+		<string name="format_sdext_as">Formattazione di sd-ext come {1}...</string>
+		<string name="part_complete">Partizionamento completato.</string>
+		<string name="unable_to_open">Impossibile aprire '{1}'.</string>
+		<string name="mtp_already_enabled">MTP è stato già abilitato</string>
+		<string name="mtp_fail">Impossibile abilitare MTP</string>
+		<string name="no_mtp">Supporto per MTP non incluso</string>
+		<string name="image_flash_start">[INIZIO INSTALLAZIONE DELL'IMMAGINE]</string>
+		<string name="img_to_flash">Immagine da installare: '{1}'</string>
+		<string name="flash_unable_locate">Impossibile localizzare la partizione '{1}' per l'installazione.</string>
+		<string name="no_part_flash">Nessuna partizione scelta per l'installazione.</string>
+		<string name="too_many_flash">Troppe partizioni scelte per l'installazione.</string>
+		<string name="invalid_flash">La partizione specificata non è valida.</string>
+		<string name="flash_done">[INSTALLAZIONE COMPLETATA]</string>
+		<string name="wiping">Pulizia di {1} in corso...</string>
+		<string name="repair_not_exist">{1} non esiste! Impossibile riparare!</string>
+		<string name="repairing_using">Riparazione di {1} utilizzando {2}...</string>
+		<string name="unable_repair">Impossibile riparare {1}.</string>
+		<string name="mount_data_footer">Impossibile montare la partizione Data. Footer criptato non trovato.</string>
+		<!-- {1} is the folder name that we could not create, {2} is strerror output -->
+		<string name="create_folder_strerr">Impossibile creare la cartella '{1}' ({2}).</string>
+		<!-- {1} is the folder name that we could not mount, {2} is strerror output -->
+		<string name="fail_mount">Impossibile montare '{1}' ({2}).</string>
+		<!-- {1} is the folder name that we could not unmount, {2} is strerror output -->
+		<string name="fail_unmount">Impossibile smontare '{1}' ({2}).</string>
+		<string name="cannot_resize">Impossibile ridimensionare {1}.</string>
+		<string name="repair_resize">Riparazione di {1} prima del ridimensionamento.</string>
+		<string name="unable_resize">Impossibile ridimensionare {1}.</string>
+		<string name="no_md5_found">Nessun MD5 trovato per '{1}'. Deseleziona "Abilita verifica MD5" per procedere con il ripristino.</string>
+		<string name="md5_fail_match">Il valore MD5 non corrisponde per '{1}'.</string>
+		<string name="fail_decrypt_tar">Decriptazione fallita per il file Tar '{1}'</string>
+		<string name="format_data_msg">Potresti dover riavviare la Recovery per accedere nuovamente a Data.</string>
+		<string name="format_data_err">Impossibile formattare al fine di rimuovere la crittografia.</string>
+		<string name="formatting_using">Formattazione di {1} tramite {2}...</string>
+		<string name="unable_to_wipe">Impossibile pulire {1}.</string>
+		<string name="cannot_wipe">La partizione {1} non può essere pulita.</string>
+		<string name="remove_all">Eliminazione di tutti i file in '{1}'...</string>
+		<string name="wiping_data">Pulizia di Data tralasciando /data/media...</string>
+		<string name="backing_up">Backup di {1} in corso...</string>
+		<string name="backing">Backup in corso...</string>
+		<string name="backup_size">La dimensione del backup di '{1}' è 0 byte.</string>
+		<string name="datamedia_fs_restore">ATTENZIONE: Il backup di Data è stato fatto mentre il filesystem era {1}! Il dispositivo potrebbe non avviarsi finché non reimposti il filesystem {1}.</string>
+		<string name="restoring">Ripristino di {1} in corso...</string>
+		<string name="restoring_hdr">Ripristino in corso...</string>
+		<string name="recreate_folder_err">Impossibile ripristinare la cartella {1}.</string>
+		<string name="img_size_err">La dimensione dell'immagine eccede la capacità del dispositivo</string>
+		<string name="flashing">Installazione di {1}...</string>
+		<string name="backup_folder_set">Cartella dei backup impostata in '{1}'</string>
+		<string name="locate_backup_err">Impossibile localizzare il backup '{1}'</string>
+		<string name="set_restore_opt">Impostazione opzioni di ripristino: '{1}':</string>
+		<string name="md5_check_skip">Tralascia controllo MD5: attivo</string>
+		<string name="ors_encrypt_restore_err">Impossibile utilizzare OpenRecoveryScript per ripristinare un backup criptato.</string>
+		<string name="mounting">Montaggio</string>
+		<string name="unmounting">Smontaggio</string>
+		<string name="mounted">'{1}' montata</string>
+		<string name="unmounted">'{1}' smontata</string>
+		<string name="setting">Impostazione di '{1}' a '{2}'</string>
+		<string name="setting_empty">Impostazione di '{1}' a vuoto</string>
+		<string name="making_dir1">Creazione cartella</string>
+		<string name="making_dir2">Creazione cartella: '{1}'</string>
+		<string name="running_command">Esecuzione comando</string>
+		<string name="sideload">ADB Sideload</string>
+		<string name="start_sideload">Avvio di ADB Sideload...</string>
+		<string name="need_new_adb">Necessiti di adb 1.0.32 o più recente, per inviare dati tramite Sideload.</string>
+		<string name="no_pwd">Nessuna password fornita.</string>
+		<string name="done_ors">Elaborazione script terminata</string>
+		<string name="injecttwrp">Installazione di TWRP in Boot tramite TWRP Inject...</string>
+		<string name="zip_err">Errore durante l'installazione dello Zip '{1}'</string>
+		<string name="installing_zip">Installazione dello Zip '{1}' in corso...</string>
+		<string name="select_backup_opt">Impostazione opzioni di backup:</string>
+		<string name="compression_on">La compressione è attiva</string>
+		<string name="md5_off">La generazione di MD5 è disattiva</string>
+		<string name="backup_fail">Backup non riuscito</string>
+		<string name="backup_clean">Backup non riuscito. Pulizia della cartella dei backup in corso...</string>
+		<string name="running_recovery_commands">Esecuzione dei comandi di ripristino...</string>
+		<string name="recovery_commands_complete">Esecuzione dei comandi completata</string>
+		<string name="running_ors">Esecuzione di OpenRecoveryScript...</string>
+		<string name="ors_complete">Esecuzione di OpenRecoveryScript completata</string>
+		<string name="no_updater_binary">Impossibile trovare '{1}' nel file Zip.</string>
+		<string name="check_for_md5">Controllo sull'MD5 in corso...</string>
+		<string name="fail_sysmap">Impossibile mappare '{1}'</string>
+		<string name="verify_zip_sig">Verifica della firma dello Zip in corso...</string>
+		<string name="verify_zip_fail">Verifica della firma non riuscita!</string>
+		<string name="verify_zip_done">Verifica della firma completata con successo.</string>
+		<string name="zip_corrupt">Il file Zip è corrotto!</string>
+		<string name="no_md5">Nessun MD5 trovato: la verifica non sarà eseguita</string>
+		<string name="md5_fail">L'MD5 non corrisponde</string>
+		<string name="md5_match">L'MD5 corrisponde</string>
+		<string name="pid_signal">Il processo {1} è terminato con segnale: {2}</string>
+		<string name="pid_error">Il processo {1} è terminato con ERRORE: {2}</string>
+		<string name="install_dumlock">Installazione di HTC Dumlock in System...</string>
+		<string name="dumlock_restore">Ripristino del Boot originale...</string>
+		<string name="dumlock_reflash">Reinstallazione della Recovery in Boot...</string>
+		<string name="run_script">Esecuzione dello script {1}...</string>
+		<string name="rename_stock">Il file della Recovery stock, in System, è stato rinominato per prevenire la sostituzione di TWRP da paete della ROM.</string>
+		<string name="split_backup">Divisione del backup in archivi multipli...</string>
+		<string name="backup_error">Errore nella creazione del backup.</string>
+		<string name="restore_error">Errore durante il ripristino.</string>
+		<string name="split_thread">Divisione del thread {1} nell'archivio {2}</string>
+		<!-- These 2 items are saved in the data manager instead of resource manager, so %llu, etc is correct instead of {1} -->
+		<string name="file_progress">File %llu di %llu, %i%%</string>
+		<string name="size_progress">%lluMB di %lluMB, %i%%</string>
+		<string name="decrypt_cmd">Tentativo di decriptare Data da riga di comando.</string>
+		<string name="base_pkg_err">Errore nel caricamento dei pacchetti base.</string>
+		<string name="simulating">Simulazione azioni in corso...</string>
+		<string name="backup_cancel">Backup annullato</string>
+		<string name="config_twrp">Configurazione di TWRP in corso...</string>
+		<string name="config_twrp_err">Impossibile configurare TWRP con questo kernel.</string>
+		<string name="copy_log">Log della Recovery copiato in {1}.</string>
+		<string name="max_queue">È stata raggiunta la dimensione massima della coda di Zip!</string>
+		<string name="min_queue">È stata raggiunta la dimensione minima della coda di Zip!</string>
+		<string name="screenshot_saved">Lo screenshot è stato salvato in {1}</string>
+		<string name="screenshot_err">Cattura dello screenshot non riuscita!</string>
+		<string name="zip_wipe_cache">Uno o più Zip ha richiesto la pulizia della Cache -- La Cache sarà pulita immediatamente.</string>
+		<string name="and_sec_wipe_err">Impossibile pulire android_secure</string>
+		<string name="dalvik_wipe_err">Pulizia della cache Dalvik fallita</string>
+		<string name="auto_gen">(Genera automaticamente)</string>
+		<string name="curr_date">(Data attuale)</string>
+		<string name="backup_name_len">Il nome del backup eccede la lunghezza massima.</string>
+		<string name="backup_name_invalid">Il nome del backup '{1}' contiene uno o più caratteri non validi: '{1}'</string>
+		<string name="no_real_sdcard">Questo dispositivo non possiede una scheda SD reale! Interruzione immediata!</string>
+		<string name="cancel_sideload">Annullamento di ADB sideload...</string>
+		<string name="change_fs_err">Errore nella modifica del filesystem.</string>
+		<string name="theme_ver_err">La versione del tema personalizzato non corrisponde alla versione di TWRP. Sarà utilizzato il tema predefinito.</string>
+		<string name="up_a_level">(Livello superiore)</string>
+	</resources>
+</language>
diff --git a/gui/theme/common/languages/ru.xml b/gui/theme/common/languages/ru.xml
index 57a9965..ee3b069 100644
--- a/gui/theme/common/languages/ru.xml
+++ b/gui/theme/common/languages/ru.xml
@@ -2,7 +2,7 @@
 
 <language>
 	<display>Русский</display>
-	<!-- Translated by Jemmini, 2016 -->
+	<!-- Translated by Jemmini; modified by agur4ik, SevenMaxs, S-trace 2016 -->
 
 	<resources>
 		<!-- Font overrides - only change these if your language requires special characters -->
@@ -21,11 +21,11 @@
 		<string name="cache">Cache</string>
 		<string name="data">Data</string>
 		<string name="sdcard">SDcard</string>
-		<string name="internal">Внутр.память</string>
+		<string name="internal">Память устройства</string>
 		<string name="microsd">Micro SDCard</string>
 		<string name="usbotg">USB OTG</string>
 		<string name="android_secure">Android Secure</string>
-		<string name="dalvik">Dalvik / ART Cache</string>
+		<string name="dalvik">Dalvik/ART Cache</string>
 		<!-- This is a rarely used partition on a Micro SD card for a very old app2sd system -->
 		<string name="sdext">SD-EXT</string>
 		<string name="adopted_data">Adopted Data</string>
@@ -50,7 +50,7 @@
 		<string name="tab_vibration">ВИБРАЦИЯ</string>
 		<string name="tab_language">ЯЗЫК</string>
 
-		<string name="install_btn">Установить</string>
+		<string name="install_btn">Установка</string>
 		<string name="wipe_btn">Очистка</string>
 		<string name="backup_btn">Резервное коп-ние</string>
 		<string name="restore_btn">Восстановление</string>
@@ -63,14 +63,14 @@
 		<string name="select_type_hdr">Выбор типа</string>
 		<string name="install_zip_hdr">Установка Zip</string>
 		<string name="install_zip_btn">Установка Zip</string>
-		<string name="install_image_hdr">Установка образа</string>
-		<string name="install_image_btn">Установка образа</string>
+		<string name="install_image_hdr">Установка Img-образа</string>
+		<string name="install_image_btn">Установка Img</string>
 		<string name="install_select_file_hdr">Выбор файла</string>
 		<string name="file_selector_folders_hdr">Папки</string>
-		<string name="select_file_from_storage">Выбор файла из %tw_storage_display_name% (%tw_storage_free_size% MB)</string>
+		<string name="select_file_from_storage">Текущий накопитель: %tw_storage_display_name% (%tw_storage_free_size% МБ)</string>
 		<string name="adb_sideload_btn">ADB sideload</string>
 		<string name="install_hdr">Установка</string>
-		<string name="select_storage_hdr">Выбор накопителя</string>
+		<string name="select_storage_hdr">Выберите накопитель</string>
 		<string name="select_storage_btn">Выбор накопителя</string>
 		<string name="queue_hdr">Очередь</string>
 		<string name="zip_queue_count">Файлов в очереди: %tw_zip_queue_count% из 10 возможных</string>
@@ -81,10 +81,10 @@
 		<string name="zip_back_clear">Нажмите назад для очистки очереди.</string>
 		<string name="folder">Папка:</string>
 		<string name="file">Файл:</string>
-		<string name="zip_sig_chk">Проверка Zip сигнатуры</string>
+		<string name="zip_sig_chk">Проверка подписи Zip</string>
 		<string name="inject_twrp_chk">Интегрировать TWRP после установки</string>
 		<string name="options_hdr">Опции</string>
-		<string name="confirm_flash_hdr">Confirm Flash</string>
+		<string name="confirm_flash_hdr">Подтвердите установку</string>
 		<string name="zip_queue">Очередь:</string>
 		<string name="options">Опции:</string>
 		<string name="swipe_confirm">   Подтвердить</string>
@@ -97,7 +97,7 @@
 		<string name="install_failed">Установка не удалась</string>
 		<string name="install_successful">Установка выполнена успешно</string>
 		<string name="wipe_cache_dalvik_btn">Очистка cache/dalvik</string>
-		<string name="reboot_system_btn">Перезагрузка в сист.</string>
+		<string name="reboot_system_btn">Перезагрузка в ОС</string>
 		<string name="install_sel_target">Выбор раздела</string>
 		<string name="flash_image_select">Выберите раздел для прошивки образа:</string>
 		<string name="target_partition">Целевой раздел:</string>
@@ -163,17 +163,17 @@
 		<string name="part_present_no">Присутствует: нет</string>
 		<string name="part_removable_yes">Съемное: да</string>
 		<string name="part_removable_no">Съемное: нет</string>
-		<string name="part_size">Размер: %tw_partition_size%MB</string>
-		<string name="part_used">Использовано: %tw_partition_used%MB</string>
-		<string name="part_free">Свободно: %tw_partition_free%MB</string>
-		<string name="part_backup_size">Размер резервных копий: %tw_partition_backup_size%MB</string>
-		<string name="resize_btn">Исправ. размер</string>
-		<string name="resize_btn_s">Испр. размер</string>
-		<string name="resize_confirm">Исправить размер %tw_partition_name%?</string>
-		<string name="resizing">Исправление размера...</string>
-		<string name="resize_complete">Размер партиции исправлен</string>
-		<string name="swipe_resize">Свайп для испр-ния размера</string>
-		<string name="swipe_resize_s">   Испр. размер</string>
+		<string name="part_size">Размер: %tw_partition_size% МБ</string>
+		<string name="part_used">Использовано: %tw_partition_used% МБ</string>
+		<string name="part_free">Свободно: %tw_partition_free% МБ</string>
+		<string name="part_backup_size">Размер резервных копий: %tw_partition_backup_size% МБ</string>
+		<string name="resize_btn">Измен. размер</string>
+		<string name="resize_btn_s">Изм. размер</string>
+		<string name="resize_confirm">Изменить размер %tw_partition_name%?</string>
+		<string name="resizing">Изменение размера...</string>
+		<string name="resize_complete">Размер раздела изменён</string>
+		<string name="swipe_resize">Свайп для изменения размера</string>
+		<string name="swipe_resize_s">   Измен. размер</string>
 		<string name="repair_btn">Восст-ть файл. систему</string>
 		<string name="repair_btn_s">Восстановление</string>
 		<string name="repair_confirm">Восстановить %tw_partition_name%?</string>
@@ -196,7 +196,7 @@
 		<string name="wipe_enc_btn">Стереть шифрование</string>
 		<string name="swipe_factory_reset">Свайп для подтверждения</string>
 		<string name="repair_change_btn">Восстановить или изменить файловую систему</string>
-		<string name="storage_hdr">Хранилище: %tw_storage_display_name% (%tw_storage_free_size% MB)</string>
+		<string name="storage_hdr">Текущий накопитель: %tw_storage_display_name% (%tw_storage_free_size% МБ)</string>
 		<string name="backup_hdr">Резервное копирование</string>
 		<string name="backup_confirm_hdr">Подтверждение резервного копирования</string>
 		<string name="encryption_tab">ШИФРОВАНИЕ</string>
@@ -225,7 +225,7 @@
 		<string name="backup_complete">Резервное копирование завершено</string>
 		<string name="restore_hdr">Восстановление</string>
 		<string name="sel_backup_hdr">Выбор резервной копии</string>
-		<string name="restore_sel_store_hdr">Выбор резервной копии из %tw_storage_display_name% (%tw_storage_free_size% MB)</string>
+		<string name="restore_sel_store_hdr">Текущий накопитель: %tw_storage_display_name% (%tw_storage_free_size% МБ)</string>
 		<string name="restore_sel_pack_fs">Выбор резервной копии для восстановления:</string>
 		<string name="restore_enc_backup_hdr">Зашифрованная резервная копия</string>
 		<string name="restore_dec_fail">Пароль неверный, попробуйте снова!</string>
@@ -238,7 +238,7 @@
 		<string name="swipe_delete_s">   Удаление</string>
 		<string name="restore_try_decrypt">Зашифрованная резервная копия - попытка расшифровки</string>
 		<string name="restore_try_decrypt_s">Попытка расшифровки</string>
-		<string name="restore_backup_date">Резервная копия создана %tw_restore_file_date%</string>
+		<string name="restore_backup_date">Резервная копия создана: %tw_restore_file_date%</string>
 		<string name="restore_sel_part">Выбор раздела для восстановления:</string>
 		<string name="restore_enable_md5_chk">Включить проверку MD5 файлов резервной копии</string>
 		<string name="restore_complete">Восстановление завершено</string>
@@ -259,12 +259,12 @@
 		<string name="decrypt_data_btn">Расшифровать данные</string>
 		<string name="disable_mtp_btn">Выключить MTP</string>
 		<string name="enable_mtp_btn">Включить MTP</string>
-		<string name="mount_usb_storage_btn">Смонтировать как USB-накопит.</string>
+		<string name="mount_usb_storage_btn">Включить UMS</string>
 		<string name="usb_storage_hdr">USB накопитель</string>
-		<string name="usb_stor_mnt1">USB накопитель смонтирован</string>
-		<string name="usb_stor_mnt2">Для безопасного отключения вашего устройства</string>
-		<string name="usb_stor_mnt3">от компьютера, выполните размонтирование!</string>
-		<string name="unmount_btn">Размонтировать</string>
+		<string name="usb_stor_mnt1">Режим USB накопителя включен</string>
+		<string name="usb_stor_mnt2">Перед отключением вашего устройства от компьютера,</string>
+		<string name="usb_stor_mnt3">выполните размонтирование (выключите UMS)!</string>
+		<string name="unmount_btn">Выключить UMS</string>
 		<string name="rb_system_btn">Система</string>
 		<string name="rb_poweroff_btn">Выключение</string>
 		<string name="rb_recovery_btn">Рекавери</string>
@@ -300,7 +300,7 @@
 		<string name="ctr_navbar_rdo">Кнопки нав.панели по центру</string>
 		<string name="lft_navbar_rdo">Выровнять кнопки нав.панели слева</string>
 		<string name="rht_navbar_rdo">Выровнять кнопки нав.панели справа</string>
-		<string name="restore_defaults_btn">Восстановить настр-ки</string>
+		<string name="restore_defaults_btn">Сброс настроек</string>
 		<string name="settings_tz_btn">Часовой пояс</string>
 		<string name="settings_screen_btn">Экран</string>
 		<string name="settings_screen_bright_btn">Яркость</string>
@@ -329,9 +329,9 @@
 		<string name="utcp5">(UTC +5) Ташкент, Исламабад, Карачи</string>
 		<string name="utcp6">(UTC +6) Алматы, Астана, Дхака, Екатеринбург</string>
 		<string name="utcp7">(UTC +7) Омск, Новосибирск, Бангкок, Джакарта, Ханой</string>
-		<string name="utcp8">(UTC +8) Красноярск, Гонконг, Пекин, Улан-Батор</string>
-		<string name="utcp9">(UTC +9) Иркутск, Осака, Саппоро, Токио, Сеул</string>
-		<string name="utcp10">(UTC +10) Якутск, Гуам, Канберра, Мельбурн, Сидней</string>
+		<string name="utcp8">(UTC +8) Красноярск, Пекин, Улан-Батор, Иркутск</string>
+		<string name="utcp9">(UTC +9) Осака, Саппоро, Токио, Сеул, Якутск</string>
+		<string name="utcp10">(UTC +10) Гуам, Канберра, Мельбурн, Сидней</string>
 		<string name="utcp11">(UTC +11) Владивосток, Сахалин, Соломоновы о-ва</string>
 		<string name="utcp12">(UTC +12) Магадан, Камчатка, Фиджи, Маршаловы о-ва</string>
 		<string name="sel_tz_offset">Выбор смещения (как правило 0): %tw_time_zone_guioffset%</string>
@@ -437,8 +437,8 @@
 		<string name="fm_complete">Операция завершена</string>
 		<string name="decrypt_data_hdr">Расшифровать данные</string>
 		<string name="decrypt_data_enter_pass">Введите пароль.</string>
-		<string name="decryt_data_failed">Пароль неверный, попробуйте снова!</string>
-		<string name="decryt_data_failed_pattern">Шаблон неверный, попробуйте снова!</string>
+		<string name="decrypt_data_failed">Пароль неверный, попробуйте снова!</string>
+		<string name="decrypt_data_failed_pattern">Шаблон неверный, попробуйте снова!</string>
 		<string name="decrypt_data_enter_pattern">Введите шаблон.</string>
 		<string name="decrypt_data_trying">Попытка расшифровки</string>
 		<string name="term_hdr">Команда терминала</string>
@@ -470,7 +470,7 @@
 		<string name="swipe_su_to_install">Свайп для установки</string>
 		<string name="swipe_su_install">   Установка</string>
 		<string name="su_installing">Установка SuperSU</string>
-		<string name="sel_storage_list">Выбор хранилища</string>
+		<string name="sel_storage_list">Выберите накопитель</string>
 		<string name="ok_btn">OK</string>
 
 		<!-- Various console messages - these consist of user displayed messages, oftentimes errors -->
@@ -492,17 +492,17 @@
 		<string name="unable_to_locate_partition">Не удается найти '{1}' раздел для расчета копирования.</string>
 		<string name="no_partition_selected">Не выбраны разделы для резервного копирования.</string>
 		<string name="total_partitions_backup"> * Общее количество разделов для резервного копирования: {1}</string>
-		<string name="total_backup_size"> * Общий объем данных: {1}MB</string>
-		<string name="available_space"> * Доступный объем: {1}MB</string>
+		<string name="total_backup_size"> * Общий объем данных: {1} МБ</string>
+		<string name="available_space"> * Доступный объем: {1} МБ</string>
 		<string name="unable_locate_storage">Не удается найти накопитель для хранения.</string>
 		<string name="no_space">В накопителе для хранения недостаточно свободного места.</string>
 		<string name="backup_started">[РЕЗЕРВНОЕ КОПИРОВАНИЕ НАЧАТО]</string>
 		<string name="backup_folder"> * Папка для резервной копии: {1}</string>
 		<string name="fail_backup_folder">Не удается создать папку для резервной копии.</string>
-		<string name="avg_backup_fs">Средняя скорость копирования для файлов: {1} MB/sec</string>
-		<string name="avg_backup_img">Средняя скорость копирования для образов: {1} MB/sec</string>
-		<string name="total_backed_size">[{1} MB ВСЕГО СКОПИРОВАНО]</string>
-		<string name="backup_completed">[КОПИРОВАНИЕ ЗАВЕРШЕНО ЗА {1} СЕКУНД]</string>
+		<string name="avg_backup_fs">Средняя скорость копирования для файлов: {1} МБ/сек</string>
+		<string name="avg_backup_img">Средняя скорость копирования для образов: {1} МБ/сек</string>
+		<string name="total_backed_size">[ВСЕГО СКОПИРОВАНО {1} МБ]</string>
+		<string name="backup_completed">[КОПИРОВАНИЕ ЗАВЕРШЕНО ЗА {1} СЕКУНД(Ы)]</string>
 		<string name="restore_started">[ВОССТАНОВЛЕНИЕ НАЧАТО]</string>
 		<string name="restore_folder">Папка для восстановления: '{1}'</string>
 		<!-- {1} is the partition display name and {2} is the number of seconds -->
@@ -514,9 +514,9 @@
 		<string name="restore_unable_locate">Не удается найти '{1}' раздел для восстановления.</string>
 		<string name="no_part_restore">Не выбраны разделы для восстановления.</string>
 		<string name="restore_part_count">Восстановление {1} разделов...</string>
-		<string name="total_restore_size">Общий размер для восстановления: {1}MB</string>
+		<string name="total_restore_size">Общий размер для восстановления: {1} МБ</string>
 		<string name="updating_system_details">Обновление информации о системе</string>
-		<string name="restore_completed">[ВОССТАНОВЛЕНИЕ ЗАВЕРШЕНО ЗА {1} СЕКУНД]</string>
+		<string name="restore_completed">[ВОССТАНОВЛЕНИЕ ЗАВЕРШЕНО ЗА {1} СЕКУНД(Ы)]</string>
 		<!-- {1} is the path we could not open, {2} is strerror output -->
 		<string name="error_opening_strerr">Ошибка открытия: '{1}' ({2})</string>
 		<string name="unable_locate_part_backup_name">Не удается найти раздел для копирования: '{1}'</string>
@@ -533,9 +533,9 @@
 		<string name="unable_to_mount_internal">Не удается смонтировать internal_storage</string>
 		<string name="unable_to_mount_storage">Не удается смонтировать накопитель</string>
 		<string name="fail_decrypt">Не удается расшифровать data.</string>
-		<string name="no_crypto_support">Шифрование не добавлено в эту сборки, пинайте разработчика.</string>
+		<string name="no_crypto_support">Шифрование не добавлено в эту сборку, пинайте разработчика.</string>
 		<string name="decrypt_success_dev">Data успешно расшифрован, новое блочное устройство: '{1}'</string>
-		<string name="done">Done.</string>
+		<string name="done">Готово.</string>
 		<string name="start_partition_sd">Разметка SD-карты...</string>
 		<string name="partition_sd_locate">Не удалось найти устройство для разметки.</string>
 		<string name="ext_swap_size">Размер EXT + Swap превышает размер sdcard.</string>
@@ -622,10 +622,10 @@
 		<string name="ors_complete">OpenRecoveryScript выполнен</string>
 		<string name="no_updater_binary">'{1}' не найден в zip файле.</string>
 		<string name="check_for_md5">Проверка MD5-файлов...</string>
-		<string name="fail_sysmap">Failed to map file '{1}'</string>
-		<string name="verify_zip_sig">Проверка zip сигнатуры...</string>
-		<string name="verify_zip_fail">Zip сигнатура не прошла проверку!</string>
-		<string name="verify_zip_done">Zip сигнатура проверена успешно.</string>
+		<string name="fail_sysmap">Не удалось отобразить в память файл '{1}'</string>
+		<string name="verify_zip_sig">Проверка подписи zip...</string>
+		<string name="verify_zip_fail">Подпись Zip не прошла проверку!</string>
+		<string name="verify_zip_done">Подпись Zip проверена успешно.</string>
 		<string name="zip_corrupt">Zip-файл поврежден!</string>
 		<string name="no_md5">Пропуск проверки MD5: не найден MD5-файл</string>
 		<string name="md5_fail">MD5 не соответствует</string>
@@ -643,7 +643,7 @@
 		<string name="split_thread">Разделение идентификатора потока {1} в архив {2}</string>
 		<!-- These 2 items are saved in the data manager instead of resource manager, so %llu, etc is correct instead of {1} -->
 		<string name="file_progress">%llu из %llu файлов, %i%%</string>
-		<string name="size_progress">%lluMB из %lluMB, %i%%</string>
+		<string name="size_progress">%llu МБ из %llu МБ, %i%%</string>
 		<string name="decrypt_cmd">Попытка расшифровать раздел данных с помощью командной строки.</string>
 		<string name="base_pkg_err">Неудача при загрузке базовых пакетов.</string>
 		<string name="simulating">Имитация действий...</string>
diff --git a/partition.cpp b/partition.cpp
index 3545634..fe2843c 100644
--- a/partition.cpp
+++ b/partition.cpp
@@ -984,6 +984,14 @@
 	return ret;
 }
 
+bool TWPartition::Is_File_System_Writable(void) {
+	if (!Is_File_System(Current_File_System) || !Is_Mounted())
+		return false;
+
+	string test_path = Mount_Point + "/.";
+	return (access(test_path.c_str(), W_OK) == 0);
+}
+
 bool TWPartition::Mount(bool Display_Error) {
 	int exfat_mounted = 0;
 	unsigned long flags = Mount_Flags;
@@ -1152,6 +1160,31 @@
 	}
 }
 
+bool TWPartition::ReMount(bool Display_Error) {
+	if (UnMount(Display_Error))
+		return Mount(Display_Error);
+	return false;
+}
+
+bool TWPartition::ReMount_RW(bool Display_Error) {
+	// No need to remount if already mounted rw
+	if (Is_File_System_Writable())
+		return true;
+
+	bool ro = Mount_Read_Only;
+	int flags = Mount_Flags;
+
+	Mount_Read_Only = false;
+	Mount_Flags &= ~MS_RDONLY;
+
+	bool ret = ReMount(Display_Error);
+
+	Mount_Read_Only = ro;
+	Mount_Flags = flags;
+
+	return ret;
+}
+
 bool TWPartition::Wipe(string New_File_System) {
 	bool wiped = false, update_crypt = false, recreate_media = true;
 	int check;
@@ -1611,8 +1644,12 @@
 			close(fd);
 		}
 	} else {
-		string Command = "flash_image " + Crypto_Key_Location + " /dev/zero";
-		TWFunc::Exec_Cmd(Command);
+		if (TWFunc::IOCTL_Get_Block_Size(Crypto_Key_Location.c_str()) >= 16384LLU) {
+			string Command = "dd of='" + Crypto_Key_Location + "' if=/dev/zero bs=16384 count=1";
+			TWFunc::Exec_Cmd(Command);
+		} else {
+			LOGINFO("Crypto key location reports size < 16K so not wiping crypto footer.\n");
+		}
 	}
 	if (Wipe(Fstab_File_System)) {
 		Has_Data_Media = Save_Data_Media;
@@ -2137,7 +2174,8 @@
 	TWFunc::GUI_Operation_Text(TW_RESTORE_TEXT, Backup_Display_Name, gui_parse_text("{@restoring_hdr}"));
 	gui_msg(Msg("restoring=Restoring {1}...")(Backup_Display_Name));
 
-	if (!Mount(true))
+	// Remount as read/write as needed so we can restore the backup
+	if (!ReMount_RW(true))
 		return false;
 
 	Full_FileName = restore_folder + "/" + Backup_FileName;
@@ -2174,6 +2212,10 @@
 		}
 	}
 #endif
+	if (Mount_Read_Only || Mount_Flags & MS_RDONLY)
+		// Remount as read only when restoration is complete
+		ReMount(true);
+
 	return ret;
 }
 
diff --git a/partitions.hpp b/partitions.hpp
index 90f772c..1d43e04 100644
--- a/partitions.hpp
+++ b/partitions.hpp
@@ -51,8 +51,11 @@
 
 public:
 	bool Is_Mounted();                                                        // Checks mount to see if the partition is currently mounted
+	bool Is_File_System_Writable();                                           // Checks if the root directory of the file system can be written to
 	bool Mount(bool Display_Error);                                           // Mounts the partition if it is not mounted
 	bool UnMount(bool Display_Error);                                         // Unmounts the partition if it is mounted
+	bool ReMount(bool Display_Error);                                         // Remounts the partition
+	bool ReMount_RW(bool Display_Error);                                      // Remounts the partition with read/write access
 	bool Wipe(string New_File_System);                                        // Wipes the partition
 	bool Wipe();                                                              // Wipes the partition
 	bool Wipe_AndSec();                                                       // Wipes android secure
diff --git a/prebuilt/Android.mk b/prebuilt/Android.mk
index 4476701..cba396a 100644
--- a/prebuilt/Android.mk
+++ b/prebuilt/Android.mk
@@ -19,7 +19,7 @@
 	RELINK_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/sh
 	RELINK_SOURCE_FILES += $(TARGET_OUT_SHARED_LIBRARIES)/libcrypto.so
 	ifneq (,$(filter $(PLATFORM_SDK_VERSION), 23))
-	    RELINK_SOURCE_FILES += $(TARGET_OUT_EXECUTABLES)/toybox
+	    RELINK_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/sbin/toybox
 	    ifneq ($(wildcard external/zip/Android.mk),)
                 RELINK_SOURCE_FILES += $(TARGET_OUT_OPTIONAL_EXECUTABLES)/zip
 	    endif
diff --git a/scripts/README b/scripts/README
index ff8b366..0191d8f 100644
--- a/scripts/README
+++ b/scripts/README
@@ -25,3 +25,17 @@
 
 python compare_xml.py -o target.xml
 
+
+
+language_helper.py
+
+This script reads the English and supplied other language files and
+compares the 2 and reorders and rewrites the other language to a new
+XML file such that all the strings are placed in the same order as
+the English file. It will place commented out string lines for items
+that are not present in the new file and will not include any strings
+in the new file that are no longer present in the English source.
+There is also a version tag that may be compared if present between
+the English and other language in case a translation string changes.
+
+python language_helper.py -o ../gui/theme/common/languages/es.xml
diff --git a/scripts/language_helper.py b/scripts/language_helper.py
new file mode 100644
index 0000000..2e3df71
--- /dev/null
+++ b/scripts/language_helper.py
@@ -0,0 +1,142 @@
+from xml.dom import minidom
+import sys
+import getopt
+
+# language helper
+#
+# by Ethan Yonker (Dees_Troy)
+#
+# This script reads the English and supplied other language files and
+# compares the 2 and reorders and rewrites the other language to a new
+# XML file such that all the strings are placed in the same order as
+# the English file. It will place commented out string lines for items
+# that are not present in the new file and will not include any strings
+# in the new file that are no longer present in the English source.
+# There is also a version tag that may be compared if present between
+# the English and other language in case a translation string changes.
+
+
+
+# this helps us avoid ascii unicode errors when writing the final XML
+def toprettyxml(xdoc, encoding):
+    #"""Return a pretty-printed XML document in a given encoding."""
+    unistr = xdoc.toprettyxml().replace(u'<?xml version="1.0" ?>',
+                          u'<?xml version="1.0" encoding="%s"?>' % encoding)
+    return unistr.encode(encoding, 'xmlcharrefreplace')
+
+HELP = """
+  language_helper.py   -o file.xml    other language to compre to English
+                     [ -f file.xml ]  output file (defaults to new.xml)
+                       -h             help info
+"""
+
+enfile = "../gui/theme/common/languages/en.xml"
+otherfile = ""
+outfile = "new.xml"
+
+try:
+	opts, args = getopt.getopt(sys.argv[1:], "hfo:koz", ["device="])
+except getopt.GetoptEror:
+	print HELP
+	sys.stdout.flush()
+	sys.exit(2)
+
+for opt, arg in opts:
+	if opt == "-h":
+		print HELP
+		sys.stdout.flush()
+		sys.exit()
+	elif opt == "-o":
+		otherfile = arg
+	elif opt == "-f":
+		outfile = arg
+
+if otherfile == "":
+	print HELP
+	exit()
+
+print "Comparing %s and %s" % (enfile, otherfile)
+print ""
+
+# Open English
+endoc = minidom.parse(enfile)
+
+# Open other language
+otherdoc = minidom.parse(otherfile)
+otherstrings = otherdoc.getElementsByTagName('string')
+
+# create minidom-document
+doc = minidom.Document()
+
+# language tag
+language = doc.createElement('language')
+doc.appendChild(language)
+
+# display tag (name of the language that shows in the GUI)
+otherlang = ""
+otherdisplay = otherdoc.getElementsByTagName('display')
+for disnode in otherdisplay:
+	if disnode.nodeType == disnode.ELEMENT_NODE:
+		language.appendChild(disnode)
+		otherlang = disnode.firstChild.data
+		print otherlang
+
+# resources
+resources = doc.createElement('resources')
+language.appendChild(resources)
+
+enres = endoc.getElementsByTagName('resources')
+for resnode in enres:
+	resc = resnode.childNodes
+	for child in resc:
+		if child.nodeType == child.ELEMENT_NODE:
+			if child.tagName != "string":
+				otherres = otherdoc.getElementsByTagName('resources')
+				found = False
+				for othernode in otherres:
+					otherresc = othernode.childNodes
+					for otherchild in otherresc:
+						if otherchild.nodeType == otherchild.ELEMENT_NODE:
+							if otherchild.tagName == child.tagName:
+								if otherchild.attributes['name'].value == child.attributes['name'].value:
+									found = True
+									resources.appendChild(otherchild)
+									break
+					if found == True:
+						break
+				if found == False:
+					print "Failed to find %s in %s, using what we got from English" % (child.toxml(), otherlang)
+					resources.appendChild(child)
+			else:
+				found = False
+				for others in otherstrings:
+					if child.attributes['name'].value == others.attributes['name'].value:
+						found = True
+						enver = "1"
+						if child.hasAttribute('version'):
+							enver = child.attributes['version'].value
+						otherver = "1"
+						if others.hasAttribute('version'):
+							otherver = others.attributes['version'].value
+						if enver != otherver:
+							ver_err = "English has version " + enver + " but " + otherlang + " has version " + otherver + " for '" + child.attributes['name'].value + "'"
+							print ver_err
+							version_comment = doc.createComment(ver_err)
+							resources.appendChild(version_comment)
+							resources.appendChild(others)
+						else:
+							resources.appendChild(others)
+						break
+				if found == False:
+					print "'%s' present in English and not in %s" % (child.attributes['name'].value, otherlang)
+					notfound_err = "NOT FOUND " + child.toxml()
+					notfound_comment = doc.createComment(notfound_err)
+					resources.appendChild(notfound_comment)
+		elif child.nodeType == child.COMMENT_NODE:
+			resources.appendChild(child)
+
+# Done, output the xml to a file
+file_handle = open(outfile,"wb")
+itspretty = toprettyxml(doc, "utf-8")
+file_handle.write(itspretty)
+file_handle.close()
diff --git a/twinstall.cpp b/twinstall.cpp
index a2eb725..f512e27 100644
--- a/twinstall.cpp
+++ b/twinstall.cpp
@@ -1,5 +1,5 @@
 /*
-	Copyright 2012 bigbiff/Dees_Troy TeamWin
+	Copyright 2012 to 2016 bigbiff/Dees_Troy TeamWin
 	This file is part of TWRP/TeamWin Recovery Project.
 
 	TWRP is free software: you can redistribute it and/or modify
@@ -41,6 +41,7 @@
 #include "twrpDigest.hpp"
 #include "twrp-functions.hpp"
 #include "gui/gui.hpp"
+#include "gui/pages.hpp"
 extern "C" {
 	#include "gui/gui.h"
 	#include "legacy_property_service.h"
@@ -93,6 +94,36 @@
 	return 0;
 }
 
+static int Install_Theme(const char* path, ZipArchive *Zip) {
+#ifdef TW_OEM_BUILD // We don't do custom themes in OEM builds
+	mzCloseZipArchive(Zip);
+	return INSTALL_CORRUPT;
+#else
+	const ZipEntry* xml_location = mzFindZipEntry(Zip, "ui.xml");
+
+	mzCloseZipArchive(Zip);
+	if (xml_location == NULL) {
+		return INSTALL_CORRUPT;
+	}
+	if (!PartitionManager.Mount_Settings_Storage(true))
+		return INSTALL_ERROR;
+	string theme_path = DataManager::GetSettingsStoragePath();
+	theme_path += "/TWRP/theme";
+	if (!TWFunc::Path_Exists(theme_path)) {
+		if (!TWFunc::Recursive_Mkdir(theme_path)) {
+			return INSTALL_ERROR;
+		}
+	}
+	theme_path += "/ui.zip";
+	if (TWFunc::copy_file(path, theme_path, 0644) != 0) {
+		return INSTALL_ERROR;
+	}
+	LOGINFO("Installing custom theme '%s' to '%s'\n", path, theme_path.c_str());
+	PageManager::RequestReload();
+	return INSTALL_SUCCESS;
+#endif
+}
+
 static int Run_Update_Binary(const char *path, ZipArchive *Zip, int* wipe_cache) {
 	const ZipEntry* binary_location = mzFindZipEntry(Zip, ASSUMED_UPDATE_BINARY_NAME);
 	string Temp_Binary = "/tmp/updater"; // Note: AOSP names it /tmp/update_binary (yes, with "_")
@@ -102,8 +133,6 @@
 	FILE* child_data;
 
 	if (binary_location == NULL) {
-		mzCloseZipArchive(Zip);
-		gui_msg(Msg(msg::kError, "no_updater_binary=Could not find '{1}' in the zip file.")(ASSUMED_UPDATE_BINARY_NAME));
 		return INSTALL_CORRUPT;
 	}
 
@@ -300,6 +329,12 @@
 		return INSTALL_CORRUPT;
 	}
 	ret_val = Run_Update_Binary(path, &Zip, wipe_cache);
+	if (ret_val == INSTALL_CORRUPT) {
+		// If no updater binary is found, check for ui.xml
+		ret_val = Install_Theme(path, &Zip);
+		if (ret_val == INSTALL_CORRUPT)
+			gui_msg(Msg(msg::kError, "no_updater_binary=Could not find '{1}' in the zip file.")(ASSUMED_UPDATE_BINARY_NAME));
+	}
 	sysReleaseMap(&map);
 	return ret_val;
 }