From c3608b39381732fcb6ace138e29945e2561eea39 Mon Sep 17 00:00:00 2001 From: Aleop Date: Fri, 9 Oct 2026 22:14:30 +0200 Subject: [PATCH] Loksi 2026.10.0 (Android 3) : source correspondante MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Export du dépôt interne d'Aleop, révision 5fbb921. --- .gitignore | 3 + LICENSE | 674 +++++++ README.md | 104 ++ brand/icones.mjs | 92 + brand/illustrations-mobiles/.gitignore | 1 + brand/illustrations-mobiles/controle.mjs | 50 + .../illustrations-mobiles/correspondance.mjs | 28 + brand/illustrations-mobiles/generate.mjs | 484 +++++ brand/illustrations-mobiles/onglets.mjs | 90 + .../onglets/generator-active-dark.svg | 4 + .../onglets/generator-active-light.svg | 4 + .../onglets/generator-idle-dark.svg | 5 + .../onglets/generator-idle-light.svg | 5 + .../onglets/send-active-dark.svg | 3 + .../onglets/send-active-light.svg | 3 + .../onglets/send-idle-dark.svg | 4 + .../onglets/send-idle-light.svg | 4 + .../onglets/settings-active-dark.svg | 3 + .../onglets/settings-active-light.svg | 3 + .../onglets/settings-idle-dark.svg | 4 + .../onglets/settings-idle-light.svg | 4 + .../onglets/vault-active-dark.svg | 3 + .../onglets/vault-active-light.svg | 3 + .../onglets/vault-idle-dark.svg | 3 + .../onglets/vault-idle-light.svg | 3 + brand/illustrations-mobiles/render.mjs | 73 + .../sources/appareils-clair.svg | 28 + .../sources/appareils-sombre.svg | 28 + .../sources/authentificateur-clair.svg | 19 + .../sources/authentificateur-sombre.svg | 19 + .../sources/autofill-clair.svg | 22 + .../sources/autofill-sombre.svg | 22 + .../sources/biometrie-clair.svg | 18 + .../sources/biometrie-sombre.svg | 18 + .../sources/cle-securite-clair.svg | 14 + .../sources/cle-securite-sombre.svg | 14 + .../sources/coffre-clair.svg | 25 + .../sources/coffre-sombre.svg | 25 + .../sources/corbeille-clair.svg | 14 + .../sources/corbeille-sombre.svg | 14 + .../sources/delai-expire-clair.svg | 14 + .../sources/delai-expire-sombre.svg | 14 + .../sources/dossier-vide-clair.svg | 10 + .../sources/dossier-vide-sombre.svg | 10 + .../sources/email-clair.svg | 16 + .../sources/email-code-clair.svg | 18 + .../sources/email-code-sombre.svg | 18 + .../sources/email-sombre.svg | 16 + .../sources/fichier-erreur-clair.svg | 15 + .../sources/fichier-erreur-sombre.svg | 15 + .../sources/generateur-clair.svg | 28 + .../sources/generateur-sombre.svg | 28 + .../sources/import-clair.svg | 25 + .../sources/import-sombre.svg | 25 + .../sources/organisation-clair.svg | 23 + .../sources/organisation-sombre.svg | 23 + .../sources/recherche-vide-clair.svg | 18 + .../sources/recherche-vide-sombre.svg | 18 + .../sources/securite-clair.svg | 10 + .../sources/securite-sombre.svg | 10 + .../sources/send-clair.svg | 11 + .../sources/send-sombre.svg | 11 + .../sources/succes-clair.svg | 16 + .../sources/succes-sombre.svg | 16 + .../sources/synchro-navigateur-clair.svg | 18 + .../sources/synchro-navigateur-sombre.svg | 18 + .../sources/uri-bloquee-clair.svg | 13 + .../sources/uri-bloquee-sombre.svg | 13 + .../sources/verrou-clair.svg | 21 + .../sources/verrou-sombre.svg | 21 + brand/loksi-icon-16.svg | 1 + brand/loksi-icon.svg | 14 + brand/package-lock.json | 621 +++++++ brand/package.json | 7 + brand/sources/loksi-icon-16.svg | 1 + brand/sources/loksi-icon-mono-blanc.svg | 1 + brand/sources/loksi-icon-mono.svg | 1 + brand/sources/loksi-icon.svg | 14 + brand/sources/loksi-logo-clair.svg | 14 + brand/sources/loksi-logo-sombre.svg | 14 + brand/sources/loksi-mot-inverse.svg | 1 + brand/sources/loksi-mot.svg | 1 + mobile/.gitignore | 6 + mobile/android/graphics.py | 385 ++++ mobile/android/kotlin/LoksiVault.kt | 86 + mobile/android/kotlin/LoksiVaultTest.kt | 93 + mobile/android/loksi.py | 1645 ++++++++++++++++ mobile/android/render.mjs | 73 + mobile/ios/fonts.py | 112 ++ mobile/ios/loksi.py | 1648 +++++++++++++++++ mobile/upstream.json | 110 ++ 91 files changed, 7297 insertions(+) create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 README.md create mode 100644 brand/icones.mjs create mode 100644 brand/illustrations-mobiles/.gitignore create mode 100644 brand/illustrations-mobiles/controle.mjs create mode 100644 brand/illustrations-mobiles/correspondance.mjs create mode 100644 brand/illustrations-mobiles/generate.mjs create mode 100644 brand/illustrations-mobiles/onglets.mjs create mode 100644 brand/illustrations-mobiles/onglets/generator-active-dark.svg create mode 100644 brand/illustrations-mobiles/onglets/generator-active-light.svg create mode 100644 brand/illustrations-mobiles/onglets/generator-idle-dark.svg create mode 100644 brand/illustrations-mobiles/onglets/generator-idle-light.svg create mode 100644 brand/illustrations-mobiles/onglets/send-active-dark.svg create mode 100644 brand/illustrations-mobiles/onglets/send-active-light.svg create mode 100644 brand/illustrations-mobiles/onglets/send-idle-dark.svg create mode 100644 brand/illustrations-mobiles/onglets/send-idle-light.svg create mode 100644 brand/illustrations-mobiles/onglets/settings-active-dark.svg create mode 100644 brand/illustrations-mobiles/onglets/settings-active-light.svg create mode 100644 brand/illustrations-mobiles/onglets/settings-idle-dark.svg create mode 100644 brand/illustrations-mobiles/onglets/settings-idle-light.svg create mode 100644 brand/illustrations-mobiles/onglets/vault-active-dark.svg create mode 100644 brand/illustrations-mobiles/onglets/vault-active-light.svg create mode 100644 brand/illustrations-mobiles/onglets/vault-idle-dark.svg create mode 100644 brand/illustrations-mobiles/onglets/vault-idle-light.svg create mode 100644 brand/illustrations-mobiles/render.mjs create mode 100644 brand/illustrations-mobiles/sources/appareils-clair.svg create mode 100644 brand/illustrations-mobiles/sources/appareils-sombre.svg create mode 100644 brand/illustrations-mobiles/sources/authentificateur-clair.svg create mode 100644 brand/illustrations-mobiles/sources/authentificateur-sombre.svg create mode 100644 brand/illustrations-mobiles/sources/autofill-clair.svg create mode 100644 brand/illustrations-mobiles/sources/autofill-sombre.svg create mode 100644 brand/illustrations-mobiles/sources/biometrie-clair.svg create mode 100644 brand/illustrations-mobiles/sources/biometrie-sombre.svg create mode 100644 brand/illustrations-mobiles/sources/cle-securite-clair.svg create mode 100644 brand/illustrations-mobiles/sources/cle-securite-sombre.svg create mode 100644 brand/illustrations-mobiles/sources/coffre-clair.svg create mode 100644 brand/illustrations-mobiles/sources/coffre-sombre.svg create mode 100644 brand/illustrations-mobiles/sources/corbeille-clair.svg create mode 100644 brand/illustrations-mobiles/sources/corbeille-sombre.svg create mode 100644 brand/illustrations-mobiles/sources/delai-expire-clair.svg create mode 100644 brand/illustrations-mobiles/sources/delai-expire-sombre.svg create mode 100644 brand/illustrations-mobiles/sources/dossier-vide-clair.svg create mode 100644 brand/illustrations-mobiles/sources/dossier-vide-sombre.svg create mode 100644 brand/illustrations-mobiles/sources/email-clair.svg create mode 100644 brand/illustrations-mobiles/sources/email-code-clair.svg create mode 100644 brand/illustrations-mobiles/sources/email-code-sombre.svg create mode 100644 brand/illustrations-mobiles/sources/email-sombre.svg create mode 100644 brand/illustrations-mobiles/sources/fichier-erreur-clair.svg create mode 100644 brand/illustrations-mobiles/sources/fichier-erreur-sombre.svg create mode 100644 brand/illustrations-mobiles/sources/generateur-clair.svg create mode 100644 brand/illustrations-mobiles/sources/generateur-sombre.svg create mode 100644 brand/illustrations-mobiles/sources/import-clair.svg create mode 100644 brand/illustrations-mobiles/sources/import-sombre.svg create mode 100644 brand/illustrations-mobiles/sources/organisation-clair.svg create mode 100644 brand/illustrations-mobiles/sources/organisation-sombre.svg create mode 100644 brand/illustrations-mobiles/sources/recherche-vide-clair.svg create mode 100644 brand/illustrations-mobiles/sources/recherche-vide-sombre.svg create mode 100644 brand/illustrations-mobiles/sources/securite-clair.svg create mode 100644 brand/illustrations-mobiles/sources/securite-sombre.svg create mode 100644 brand/illustrations-mobiles/sources/send-clair.svg create mode 100644 brand/illustrations-mobiles/sources/send-sombre.svg create mode 100644 brand/illustrations-mobiles/sources/succes-clair.svg create mode 100644 brand/illustrations-mobiles/sources/succes-sombre.svg create mode 100644 brand/illustrations-mobiles/sources/synchro-navigateur-clair.svg create mode 100644 brand/illustrations-mobiles/sources/synchro-navigateur-sombre.svg create mode 100644 brand/illustrations-mobiles/sources/uri-bloquee-clair.svg create mode 100644 brand/illustrations-mobiles/sources/uri-bloquee-sombre.svg create mode 100644 brand/illustrations-mobiles/sources/verrou-clair.svg create mode 100644 brand/illustrations-mobiles/sources/verrou-sombre.svg create mode 100644 brand/loksi-icon-16.svg create mode 100644 brand/loksi-icon.svg create mode 100644 brand/package-lock.json create mode 100644 brand/package.json create mode 100644 brand/sources/loksi-icon-16.svg create mode 100644 brand/sources/loksi-icon-mono-blanc.svg create mode 100644 brand/sources/loksi-icon-mono.svg create mode 100644 brand/sources/loksi-icon.svg create mode 100644 brand/sources/loksi-logo-clair.svg create mode 100644 brand/sources/loksi-logo-sombre.svg create mode 100644 brand/sources/loksi-mot-inverse.svg create mode 100644 brand/sources/loksi-mot.svg create mode 100644 mobile/.gitignore create mode 100644 mobile/android/graphics.py create mode 100644 mobile/android/kotlin/LoksiVault.kt create mode 100644 mobile/android/kotlin/LoksiVaultTest.kt create mode 100644 mobile/android/loksi.py create mode 100644 mobile/android/render.mjs create mode 100644 mobile/ios/fonts.py create mode 100644 mobile/ios/loksi.py create mode 100644 mobile/upstream.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e106046 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +node_modules/ +.DS_Store +__pycache__/ diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..30ace6a --- /dev/null +++ b/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + {one line to give the program's name and a brief idea of what it does.} + Copyright (C) {year} {name of author} + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + {project} Copyright (C) {year} {fullname} + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..b182fb2 --- /dev/null +++ b/README.md @@ -0,0 +1,104 @@ +# Loksi pour Android : code source + +Loksi, par Aleop. Application Bitwarden® modifiée par Aleop, sous licence GPL v3. Aleop +n'est pas affilié à Bitwarden Inc. + +Ce dépôt est la source correspondante de l'application Android Loksi, au sens de la GPL v3. +Il ne contient pas une copie de l'arbre Bitwarden. Il contient les scripts qui partent des +archives officielles de Bitwarden, épinglées par SHA-256, et y appliquent les adaptations +Loksi. Toute modification de l'amont est faite par ces scripts, et rien d'autre. + +English summary at the end of this file. + +## Ce qui est dans ce dépôt + +| Chemin | Rôle | +|---|---| +| `mobile/upstream.json` | versions amont épinglées : tag `bitwarden/android`, commit, SHA-256 des archives, commit du SDK `sdk-internal`, police Raleway, outils | +| `mobile/android/loksi.py` | adaptation et construction Android : `fetch`, `sdk`, `prepare`, `changes`, `build`, `tests`, `release`, `verify-release` | +| `mobile/android/graphics.py`, `render.mjs` | icône, logos et illustrations convertis en ressources Android | +| `mobile/android/kotlin/` | code Kotlin ajouté par Loksi (nom ou adresse du coffre) et ses tests | +| `mobile/ios/loksi.py`, `fonts.py` | textes d'accueil et police Loksi tirée de Raleway, lus par la construction Android | +| `brand/` | ressources de la charte Loksi lues par la construction : icône, logos, illustrations et leurs générateurs | +| `LICENSE` | texte de la GPL v3, celui des dépôts Bitwarden | + +Chaque script refuse une archive amont dont le SHA-256 a changé. `loksi.py changes` refuse +toute différence avec l'archive en dehors des fichiers prévus, et les écrit dans +`mobile/reports/`. L'arbre adapté porte un fichier `LOKSI-NOTICE.txt` qui dit ce qu'Aleop +a modifié et depuis quelle date. + +## Reconstruire l'application Android + +Poste utilisé par Aleop : Mac Apple Silicon. Outils, versions dans `mobile/upstream.json`, +section `android.toolchain` : + +- JDK 21 ; +- SDK Android : platform 37, build-tools 36.0.0, NDK 28.2.13676358 ; +- Rust 1.97.1 (rustup) et cargo-ndk 4.1.2 ; +- Node.js et npm, pour Playwright et Chromium (rendu de l'icône) ; +- Python 3, avec fontTools 4.60.1 dans un environnement virtuel. + +```bash +cd mobile +python3 -m venv .cache/venv && .cache/venv/bin/pip install fonttools==4.60.1 +.cache/venv/bin/python android/loksi.py sdk # SDK Rust recompilé depuis sdk-internal +.cache/venv/bin/python android/loksi.py keys # clé debug, créée sur votre poste +.cache/venv/bin/python android/loksi.py prepare # archive amont + adaptations Loksi +.cache/venv/bin/python android/loksi.py build # APK debug et contrôles +.cache/venv/bin/python android/loksi.py upload-key # clé de signature release, sur votre poste +.cache/venv/bin/python android/loksi.py release # AAB et APK release signés, puis contrôles +``` + +Le SDK de Bitwarden n'est pas téléchargé en binaire : `sdk` le recompile depuis +`bitwarden/sdk-internal` au commit utilisé par le tag, contrôle qu'aucune crate sous +licence commerciale Bitwarden n'entre dans le graphe, puis le publie dans le dépôt Maven +local. Seule l'architecture `arm64-v8a` est compilée. + +La variante compilée est `fdroid` : sans Firebase, Crashlytics, Play Billing, ML Kit ni +Play Review. + +Les clés sont créées sur votre poste, dans `~/.config/loksi/android/` ou dans le dossier +donné par `LOKSI_ANDROID_KEYS`. Elles ne sont pas dans ce dépôt. Votre APK aura donc la +même source et le même code qu'une version Loksi, mais pas sa signature. Sur Google Play, +la signature finale est posée par Google. `verify-release` contrôle l'identifiant, le nom, +l'absence des bibliothèques exclues, les textes, la signature par votre clé, et que l'AAB +embarque le SDK recompilé et les mêmes dex que l'APK release. + +## Application iOS + +L'application iOS n'est pas encore distribuée. Sa source sera publiée ici avec sa première +version. + +## Licences et marques + +- Code : GPL v3, comme les applications Bitwarden dont il dérive (`LICENSE`). +- SDK : `bitwarden-uniffi`, branche GPL v3 de sa double licence, sans les crates + `bitwarden_license`, contrôlé à chaque compilation par `loksi.py sdk`. +- Police : Raleway, SIL Open Font License 1.1. La version modifiée s'appelle « Loksi », + le nom « Raleway » étant réservé. +- Marques : Bitwarden est une marque de Bitwarden Inc. Loksi et son logo sont des marques + d'Aleop. Les fichiers de `brand/` sont fournis pour reconstruire l'application. Comme le + permet l'article 7 e) de la GPL v3, aucun droit sur ces marques n'est accordé : une + version modifiée que vous distribuez doit porter un autre nom et un autre logo. + +Contact : loksi@aleop.eu. + +## English summary + +Loksi, by Aleop. Bitwarden® app modified by Aleop, under the GPL v3. Aleop is not +affiliated with Bitwarden Inc. + +This repository is the corresponding source of the Loksi Android app under the GPL v3. It +does not copy the Bitwarden tree. The scripts download the official Bitwarden archives, +pinned by SHA-256 in `mobile/upstream.json`, and apply the Loksi changes. The Bitwarden SDK +is rebuilt from `bitwarden/sdk-internal` at the commit used by the tag. + +To rebuild the Android app, install the tools listed above and run the commands of the +French section, from `sdk` to `release`. Signing keys are created on your machine and are +not part of this repository, so your build has the same code but not the same signature. + +Code is under the GPL v3. Bitwarden is a trademark of Bitwarden Inc. Loksi and its logo are +trademarks of Aleop. Under section 7 e) of the GPL v3, no trademark rights are granted: a +modified version you distribute must use another name and logo. + +Contact: loksi@aleop.eu. diff --git a/brand/icones.mjs b/brand/icones.mjs new file mode 100644 index 0000000..3ed8898 --- /dev/null +++ b/brand/icones.mjs @@ -0,0 +1,92 @@ +/** + * Icônes Loksi, depuis les deux maîtres de brand/ (charte adoptée le 28/09/2026) : + * - loksi-icon.svg, l'icône sculptée, pour 32 px et plus ; + * - loksi-icon-16.svg, le maître optique plat, pour 16 px seulement. En relief, le + * carré devient flou à cette taille (comparatif montré à Romain le 28/09/2026). + * + * Rendu par Chromium et non par Sharp : les ombres du maître sculpté sont des + * feDropShadow, rendus tels que la planche les montre. + * + * L'icône Apple 180 est pleine page. iOS remplit en noir tout pixel transparent d'un + * apple-touch-icon, et le maître sculpté a un cadre transparent pour ses ombres. On + * recadre donc sur le carré, sans l'ombre portée, avec la face étendue jusqu'aux + * bords : iOS pose son propre arrondi. + * + * Pas d'effet de bord : ce module n'écrit que dans le dossier qu'on lui donne. + */ +import { readFileSync, writeFileSync, mkdirSync } from 'fs'; +import { join, dirname } from 'path'; +import { fileURLToPath } from 'url'; + +const brand = dirname(fileURLToPath(import.meta.url)); +export const sculpte = readFileSync(join(brand, 'loksi-icon.svg'), 'utf8'); +export const plat16 = readFileSync(join(brand, 'loksi-icon-16.svg'), 'utf8'); + +// Les trois tracés du symbole, pris sur le maître plat. Le maître sculpté doit les +// porter à l'identique (face et ombre), sinon les deux maîtres ont divergé. +export const traces = [...plat16.matchAll(/ d="([^"]+)"/g)].map(m => m[1]); +if (traces.length !== 3) throw new Error(`loksi-icon-16.svg : 3 tracés attendus, ${traces.length} trouvés`); +const manquants = traces.filter(d => !sculpte.includes(`d="${d}"`)); +if (manquants.length) throw new Error(`loksi-icon.svg ne porte pas ${manquants.length} tracé(s) du maître 16 px`); + +// Remplacement qui doit tomber exactement une fois, sinon le maître a changé de forme. +const une = (s, avant, apres, quoi) => { + const n = s.split(avant).length - 1; + if (n !== 1) throw new Error(`icône Apple : « ${quoi} » trouvé ${n} fois, 1 attendu`); + return s.replace(avant, apres); +}; +export function apple(svg = sculpte) { + let s = une(svg, /viewBox="[^"]+"/.exec(svg)?.[0] ?? 'viewBox', 'viewBox="0 0 100 100"', 'viewBox'); + s = une(s, 'transform="translate(7 2) scale(.86)"', '', 'cadre de l’export'); + s = une(s, /]*\/>/.exec(s)?.[0] ?? '' + face, 'face'); +} + +// Icône système pleine page, opaque et à angles droits : macOS (Dock, Finder) pose son +// propre masque arrondi. Avec le maître sculpté, son cadre transparent et ses coins +// arrondis, macOS 27 réduisait le carré à 710 px sur 1024 dans le Dock (mesuré le +// 03/10/2026), quand Klepsi, pleine page, remplit toute la case. Même gabarit que +// klepsi-icone-ios.svg : face, reflet et liseré à angles droits, socle retiré. +export function systeme(svg = sculpte) { + let s = une(svg, /viewBox="[^"]+"/.exec(svg)?.[0] ?? 'viewBox', 'viewBox="0 0 100 100"', 'viewBox'); + s = une(s, 'transform="translate(7 2) scale(.86)"', '', 'cadre de l’export'); + s = une(s, /]*\/>/.exec(s)?.[0] ?? '', + '', 'face'); + s = une(s, '', + '', 'reflet'); + return une(s, 'rx="23.2"', '', 'liseré'); +} +// Icône Windows recadrée : Windows ne pose aucun masque, on garde donc les coins arrondis +// et le socle, mais sans le cadre transparent de l'export ni l'ombre floue, qu'un cadre +// serré couperait net. Le carré passe de 69 % à 89 % de la case (100 sur 112). +export function windows(svg = sculpte) { + let s = une(svg, /viewBox="[^"]+"/.exec(svg)?.[0] ?? 'viewBox', 'viewBox="-6 -4 112 112"', 'viewBox'); + s = une(s, 'transform="translate(7 2) scale(.86)"', '', 'cadre de l’export'); + return une(s, ' filter="url(#baseShadowstandalone)"', '', 'ombre du socle'); +} +// Le maître plat 16 px au même gabarit système : fond navy à angles droits. +export const systeme16 = () => une(plat16, ' rx="15.36"', '', 'arrondi du plat 16'); + +export const TAILLES = [16, 32, 180, 192, 512]; +export const sourcePour = (t) => (t === 16 ? plat16 : t === 180 ? apple() : sculpte); + +// Masque Safari : une silhouette d'une seule encre, depuis les tracés du plat. +export const masque = () => plat16.replace(/]*\/>/, '').replace(/#(fff|FFF|1FBFF5|009CDE)\b/g, '#000'); + +/** Rend chaque taille dans outDir sous nom(t). page : une page Playwright. */ +export async function rendreIcones(page, outDir, nom = (t) => `loksi-icon-${t}.png`) { + mkdirSync(outDir, { recursive: true }); + const faites = []; + for (const t of TAILLES) { + await page.setViewportSize({ width: t, height: t }); + await page.setContent(`${sourcePour(t)}`); + const sortie = join(outDir, nom(t)); + await page.screenshot({ path: sortie, omitBackground: true }); + faites.push(sortie); + } + return faites; +} + +export function ecrireMasque(chemin) { writeFileSync(chemin, masque()); } diff --git a/brand/illustrations-mobiles/.gitignore b/brand/illustrations-mobiles/.gitignore new file mode 100644 index 0000000..0467580 --- /dev/null +++ b/brand/illustrations-mobiles/.gitignore @@ -0,0 +1 @@ +amont/ diff --git a/brand/illustrations-mobiles/controle.mjs b/brand/illustrations-mobiles/controle.mjs new file mode 100644 index 0000000..3409807 --- /dev/null +++ b/brand/illustrations-mobiles/controle.mjs @@ -0,0 +1,50 @@ +// Contrôle de format des maîtres : chaque SVG doit rester dans le sous-ensemble qui passe +// tel quel en PDF iOS et en VectorDrawable Android. Refuse filtre, masque, texte, image, +// clipPath, dégradé radial ou en objectBoundingBox, transformation autre que translate, +// rotate ou scale, et toute taille autre que 200 x 200. +// node illustrations-mobiles/controle.mjs (sortie 1 au moindre refus) +// Canari : un SVG fabriqué avec un filtre doit être refusé, sinon le contrôle lui-même est cassé. +import { readdirSync, readFileSync } from 'node:fs'; +import { dirname, join } from 'node:path'; +import { fileURLToPath } from 'node:url'; + +const ici = dirname(fileURLToPath(import.meta.url)); +// Illustrations en 200, pictogrammes de la barre d'onglets en 24. +const DOSSIERS = [['sources', 200], ['onglets', 24]]; +const ELEMENTS = new Set(['svg', 'defs', 'g', 'path', 'linearGradient', 'stop']); +const ATTRS = new Set(['xmlns', 'width', 'height', 'viewBox', 'd', 'fill', 'fill-opacity', 'stroke', + 'stroke-width', 'stroke-linecap', 'stroke-linejoin', 'transform', 'id', 'gradientUnits', + 'x1', 'y1', 'x2', 'y2', 'offset', 'stop-color', 'fill-rule']); + +export function defauts(svg, taille = 200) { + const out = []; + for (const [, nom, attrs] of svg.matchAll(/<([A-Za-z][\w:-]*)([^>]*)>/g)) { + if (!ELEMENTS.has(nom)) { out.push(`élément <${nom}>`); continue; } + for (const [, a, v] of attrs.matchAll(/([\w:-]+)="([^"]*)"/g)) { + if (!ATTRS.has(a)) out.push(`attribut ${a} sur <${nom}>`); + if (a === 'transform' && !/^((translate|rotate|scale)\([^)]*\)\s*)+$/.test(v)) out.push(`transform ${v}`); + if (a === 'gradientUnits' && v !== 'userSpaceOnUse') out.push(`gradientUnits ${v}`); + if (a === 'fill' && v.startsWith('url(') && !/^url\(#g\d+\)$/.test(v)) out.push(`fill ${v}`); + } + if (nom === 'linearGradient' && !/gradientUnits="userSpaceOnUse"/.test(attrs)) out.push('dégradé sans userSpaceOnUse'); + } + if (!new RegExp(`]*width="${taille}" height="${taille}" viewBox="0 0 ${taille} ${taille}"`).test(svg)) out.push(`gabarit autre que ${taille} x ${taille}`); + for (const [, r] of svg.matchAll(/fill-rule="([^"]*)"/g)) if (r !== 'evenodd') out.push(`fill-rule ${r}`); + if (/ x.endsWith('.svg')).sort()) { + total++; + const d = defauts(readFileSync(join(dir, f), 'utf8'), taille); + if (d.length) { ko++; console.error(`${sous}/${f} : ${[...new Set(d)].join(', ')}`); } + } +} +console.log(`canari refusé (${defauts(canari)[0]}), ${total} maîtres contrôlés, ${ko} refusés`); +process.exit(ko ? 1 : 0); diff --git a/brand/illustrations-mobiles/correspondance.mjs b/brand/illustrations-mobiles/correspondance.mjs new file mode 100644 index 0000000..0243be9 --- /dev/null +++ b/brand/illustrations-mobiles/correspondance.mjs @@ -0,0 +1,28 @@ +// Correspondance entre chaque illustration Loksi et les fichiers amont qu'elle remplace. +// Source unique : render.mjs en tire la planche du jeu et la table du README. +// Tailles : points iOS, dp Android, px CSS dans la popup de l'extension (relevé du 29/09/2026 +// sur browser-v2026.9.2 : 80 pour les pages d'accueil et les états vides, 128 au carrousel). +export const JEU = [ + ['coffre', 'Carrousel 1, coffre vide', 'items (200)', 'ill_vault_items (200)', 'ItemTypes (128), VaultOpen (80)'], + ['biometrie', 'Carrousel 2, déverrouillage', 'biometrics-phone (200)', 'ill_welcome_2, ill_account_setup (200)', 'UserVerificationBiometricsIcon (64)'], + ['generateur', 'Carrousel 3', 'generate (200)', 'ill_welcome_3 (188)', 'NoCredentialsIcon (128)'], + ['appareils', 'Carrousel 4, appareils', 'secure-devices, devices (200)', 'ill_welcome_4, ill_pending_requests, ill_2fa (200), ill_secure_devices (96)', 'DevicesIcon (80 et 128)'], + ['autofill', 'Remplissage automatique', 'autofill (200)', 'ill_autofill (200)', 'LoginCards (128)'], + ['verrou', 'Coffre verrouillé, mot de passe', 'lock (200)', 'ill_lock (200)', 'LockIcon, UserLockIcon (80)'], + ['succes', 'Fin de configuration', '', 'ill_setup_complete (200)', ''], + ['dossier-vide', 'Groupe ou dossier vide', 'no-items (100 clair, 200 sombre)', 'ill_folder_question, ill_pin (200), ill_open_source (100)', 'NoFolders, SearchFolder (80)'], + ['recherche-vide', 'Aucun résultat', '', '', 'NoResults (80)'], + ['corbeille', 'Corbeille vide', '', '', 'EmptyTrash (80)'], + ['send', 'Send vide ou créé', 'send (200)', 'ill_send (200)', 'NoSendsIcon (80), ActiveSendIcon (95)'], + ['import', 'Import des identifiants', 'import (200)', 'ill_import_logins (200)', ''], + ['synchro-navigateur', 'Synchro avec le navigateur', 'keyhole (200)', 'ill_sso_cookie_sync (100)', ''], + ['email', 'Vérifier l\'e-mail', 'email (200)', 'ill_open_email (192)', 'RegistrationCheckEmailIcon (80)'], + ['email-code', '2FA par e-mail', 'email-otp (96)', 'ill_new_device_verification (97)', 'TwoFactorAuthEmailIcon (80)'], + ['authentificateur', '2FA par application', 'authenticator-app (200 sombre, 124 clair)', 'ill_authenticator (200)', ''], + ['cle-securite', '2FA par clé', 'yubikey (200)', 'ill_yubi_key (124)', ''], + ['delai-expire', 'Délai ou lien expiré', '', '', 'TwoFactorTimeoutIcon (80)'], + ['securite', 'Connexion SSO', '', '', 'VaultIcon (80)'], + ['organisation', 'Organisation, transfert', 'item-transfer, item-transfer-warning (100, clair seul)', 'ill_leave_organization, ill_migrate_to_my_items (100)', 'DeactivatedOrg, AccountWarning (80)'], + ['uri-bloquee', 'Adresse bloquée, domaine', '', 'ill_blocked_uri (200)', 'DomainIcon (80)'], + ['fichier-erreur', 'Pièce jointe en erreur', '', 'ill_file_error, ill_file_not_found (200)', ''], +].map(([nom, ecran, ios, android, extension]) => ({ nom, ecran, ios, android, extension })); diff --git a/brand/illustrations-mobiles/generate.mjs b/brand/illustrations-mobiles/generate.mjs new file mode 100644 index 0000000..ec9443b --- /dev/null +++ b/brand/illustrations-mobiles/generate.mjs @@ -0,0 +1,484 @@ +// Illustrations mobiles Loksi : une scène par illustration, rendue en clair et en sombre. +// node illustrations-mobiles/generate.mjs (depuis brand/) +// +// Sous-ensemble SVG volontairement étroit, pour que chaque maître passe tel quel en PDF +// vectoriel (iOS) et en VectorDrawable (Android) : path, g avec translate/rotate, dégradés +// linéaires en userSpaceOnUse, fill-opacity, trait à bouts ronds. Aucun filtre, aucun masque, +// aucun texte : les ombres de l'icône (feDropShadow) sont remplacées par des volumes pleins. +import { mkdirSync, writeFileSync } from 'node:fs'; +import { dirname, join } from 'node:path'; +import { fileURLToPath } from 'node:url'; + +const HERE = dirname(fileURLToPath(import.meta.url)); +const SIZE = 200; + +// Palettes. Le clair reprend l'icône (face navy, porcelaine, cyan et leurs flancs). +// Le sombre éclaircit la face navy et assourdit la porcelaine pour tenir sur #121A27. +export const THEMES = { + clair: { + fond: '#E6F6FD', ombre: ['#003087', 0.10], + porc: ['#FFFFFF', '#F3F8FD', '#D9E6F4'], porcFlanc: '#A9C0DD', porcTrait: '#C8D8EA', + navy: ['#246CD0', '#06439E', '#001D59'], navyFlanc: '#001540', navyReflet: '#8EC2FF', + cyan: '#1FBFF5', cyanFlanc: '#1385B6', cyan2: '#009CDE', cyan2Flanc: '#006DAD', + encre: '#003087', ecran: ['#EAF7FE', '#BFE5F8'], + }, + sombre: { + fond: '#172A45', ombre: ['#000000', 0.30], + porc: ['#EEF4FA', '#DCE6F2', '#B4C6DC'], porcFlanc: '#6F87A8', porcTrait: '#A3B7CF', + navy: ['#3B88EA', '#1458C2', '#0A3585'], navyFlanc: '#051A45', navyReflet: '#A9D2FF', + cyan: '#33C3FF', cyanFlanc: '#1385B6', cyan2: '#009CDE', cyan2Flanc: '#006DAD', + encre: '#0A3585', ecran: ['#DDF1FC', '#9FD3F0'], + }, +}; + +// Géométrie +const f = (n) => +n.toFixed(2); +function rr(x, y, w, h, r) { + const [a, b, c, d] = Array.isArray(r) ? r : [r, r, r, r]; + return `M${f(x + a)} ${f(y)}H${f(x + w - b)}A${b} ${b} 0 0 1 ${f(x + w)} ${f(y + b)}V${f(y + h - c)}` + + `A${c} ${c} 0 0 1 ${f(x + w - c)} ${f(y + h)}H${f(x + d)}A${d} ${d} 0 0 1 ${f(x)} ${f(y + h - d)}` + + `V${f(y + a)}A${a} ${a} 0 0 1 ${f(x + a)} ${f(y)}Z`; +} +const circle = (cx, cy, r) => `M${f(cx - r)} ${f(cy)}A${r} ${r} 0 1 0 ${f(cx + r)} ${f(cy)}A${r} ${r} 0 1 0 ${f(cx - r)} ${f(cy)}Z`; +const ellipse = (cx, cy, rx, ry) => `M${f(cx - rx)} ${f(cy)}A${rx} ${ry} 0 1 0 ${f(cx + rx)} ${f(cy)}A${rx} ${ry} 0 1 0 ${f(cx - rx)} ${f(cy)}Z`; + +// Scène : liste d'éléments. Une forme = { d, fill } ou { d, stroke, width }. Un groupe = { g, items }. +class Scene { + constructor(t) { this.t = t; this.defs = []; this.items = []; this.n = 0; } + grad(stops, x1, y1, x2, y2) { + const id = `g${++this.n}`; + const s = stops.map((c, i) => ``).join(''); + this.defs.push(`${s}`); + return `url(#${id})`; + } + add(to, el) { (to || this.items).push(el); return el; } + // Volume : flanc plein décalé vers le bas, puis la face. C'est le relief de l'icône sans filtre. + bloc(to, d, dFlanc, face, flanc) { this.add(to, { d: dFlanc, fill: flanc }); this.add(to, { d, fill: face }); } + svg() { + const out = (els) => els.map((e) => { + if (e.g) return `${out(e.items)}`; + if (e.stroke) return ``; + return ``; + }).join('\n'); + return `\n` + + `${this.defs.join('')}\n${out(this.items)}\n\n`; + } +} + +// Éléments partagés +function fond(s) { + s.add(null, { d: circle(100, 100, 86), fill: s.t.fond }); +} +function ombreSol(s, cx, cy, rx, ry = 6) { + s.add(null, { d: ellipse(cx, cy, rx, ry), fill: s.t.ombre[0], opacity: s.t.ombre[1] }); +} +function porcelaine(s, to, x, y, w, h, r, prof = 4) { + s.bloc(to, rr(x, y, w, h, r), rr(x, y + prof, w, h, r), s.grad(s.t.porc, x, y, x + w * 0.65, y + h), s.t.porcFlanc); +} +function navy(s, to, x, y, w, h, r, prof = 4) { + s.bloc(to, rr(x, y, w, h, r), rr(x, y + prof, w, h, r), s.grad(s.t.navy, x, y, x + w * 0.8, y + h), s.t.navyFlanc); +} +// Le glyphe de l'icône (anse porcelaine, L et petit bloc cyan), repris à l'identique, mis à l'échelle. +// Coordonnées d'origine : repère 64 de loksi-icon.svg, boîte x 12.3 à 49.9, y 9.95 à 55. +function glyphe(s, to, x, y, h) { + const k = h / 45.05, ox = x - 12.3 * k, oy = y - 9.95 * k; + const g = { g: `translate(${f(ox)} ${f(oy)}) scale(${f(k)})`, items: [] }; + const anse = 'M19.6 27.3V24.2a10.95 10.95 0 0 1 21.9 0v3.1'; + const L = 'M13.8 28.9H28.5a1.5 1.5 0 0 1 1.5 1.5V52.5a1.5 1.5 0 0 1-1.5 1.5H18.3a6 6 0 0 1-6-6V30.4a1.5 1.5 0 0 1 1.5-1.5Z'; + const bloc = 'M34 41.1H44.9a5 5 0 0 1 5 5V48a7 7 0 0 1-7 7H34.5a1.5 1.5 0 0 1-1.5-1.5V42.1a1 1 0 0 1 1-1Z'; + const flanc = { g: 'translate(0 1.6)', items: [ + { d: anse, stroke: s.t.porcFlanc, width: 6.6 }, { d: L, fill: s.t.cyanFlanc }, { d: bloc, fill: s.t.cyan2Flanc }] }; + g.items.push(flanc, + { d: anse, stroke: s.grad(s.t.porc, 19.6, 13, 41.5, 27.3), width: 6.6 }, + { d: L, fill: s.t.cyan }, { d: bloc, fill: s.t.cyan2 }); + s.add(to, g); +} +// Tuile navy portant le glyphe : l'icône en miniature, pour les surfaces claires où l'anse disparaît. +function tuile(s, to, x, y, c) { + navy(s, to, x, y, c, c, c * 0.24, Math.max(2, c * 0.07)); + const h = c * 0.6; + glyphe(s, to, x + (c - h * 37.6 / 45.05) / 2, y + (c - h) / 2, h); +} +const points = (s, to, x, y, n, r, pas, fill) => { for (let i = 0; i < n; i++) s.add(to, { d: circle(x + i * pas, y, r), fill }); }; +const trait = (s, to, x, y, w, h, fill) => s.add(to, { d: rr(x, y, w, h, h / 2), fill }); + +function arc(cx, cy, r, a0, a1) { + const p = (a) => [cx + r * Math.cos(a * Math.PI / 180), cy + r * Math.sin(a * Math.PI / 180)]; + const [x0, y0] = p(a0), [x1, y1] = p(a1); + return `M${f(x0)} ${f(y0)}A${r} ${r} 0 ${a1 - a0 > 180 ? 1 : 0} 1 ${f(x1)} ${f(y1)}`; +} + +// Pastille d'état : disque cyan (ou navy pour une alerte) et un signe porcelaine. +// check, moins, excl, sortie, plus. Même relief que le reste : flanc plein 2,5 plus bas. +function pastille(s, cx, cy, r, signe, alerte = false) { + const t = s.t, w = f(r * 0.28), c = t.porc[0]; + if (alerte) s.bloc(null, circle(cx, cy, r), circle(cx, cy + 2.5, r), s.grad(t.navy, cx - r, cy - r, cx + r, cy + r), t.navyFlanc); + else s.bloc(null, circle(cx, cy, r), circle(cx, cy + 2.5, r), t.cyan2, t.cyan2Flanc); + const P = (u, v) => `${f(cx + u * r)} ${f(cy + v * r)}`; + const d = { + check: `M${P(-0.4, 0.02)}L${P(-0.1, 0.32)}L${P(0.42, -0.28)}`, + moins: `M${P(-0.4, 0)}L${P(0.4, 0)}`, + plus: `M${P(-0.4, 0)}L${P(0.4, 0)}M${P(0, -0.4)}L${P(0, 0.4)}`, + excl: `M${P(0, -0.44)}L${P(0, 0.08)}`, + sortie: `M${P(-0.4, 0)}L${P(0.36, 0)}M${P(0.06, -0.3)}L${P(0.38, 0)}L${P(0.06, 0.3)}`, + }[signe]; + s.add(null, { d, stroke: c, width: w }); + if (signe === 'excl') s.add(null, { d: circle(cx, cy + r * 0.4, r * 0.15), fill: c }); +} +// Cadenas simple, fermé : anse navy, corps cyan, serrure navy. Pour les scènes sans le glyphe. +function cadenas(s, x, y, w, ouvert = false) { + const t = s.t, r = w * 0.27, e = w * 0.15, cx = x + w / 2, haut = y + w * 0.62; + const dx = ouvert ? w * 0.2 : 0; + const anse = `M${f(cx - r + dx)} ${f(haut)}V${f(y + r + e / 2)}A${r} ${r} 0 0 1 ${f(cx + r + dx)} ${f(y + r + e / 2)}V${f(ouvert ? y + r + e : haut)}`; + s.add(null, { g: 'translate(0 2.5)', items: [{ d: anse, stroke: t.navyFlanc, width: e }] }); + s.add(null, { d: anse, stroke: s.grad(t.navy, x, y, x + w, haut), width: e }); + const h = w * 0.72; + s.bloc(null, rr(x, haut, w, h, w * 0.16), rr(x, haut + 4, w, h, w * 0.16), s.grad([t.cyan, t.cyan2], x, haut, x + w, haut + h), t.cyan2Flanc); + const kx = cx, ky = haut + h * 0.44; + s.add(null, { d: circle(kx, ky, w * 0.09), fill: t.encre }); + s.add(null, { d: rr(kx - w * 0.04, ky, w * 0.08, h * 0.28, w * 0.04), fill: t.encre }); +} +// Coffre-fort : caisse navy, porte porcelaine à molette cyan. +function coffreFort(s, x, y, w, h) { + const t = s.t; + navy(s, null, x, y, w, h, w * 0.14, 6); + const cx = x + w / 2, cy = y + h / 2, r = Math.min(w, h) * 0.26; + s.bloc(null, circle(cx, cy, r), circle(cx, cy + 3, r), s.grad(t.porc, cx - r, cy - r, cx + r, cy + r), t.porcFlanc); + s.add(null, { d: circle(cx, cy, r * 0.46), fill: t.cyan2 }); + for (const a of [0, 90, 180, 270]) { + const u = Math.cos(a * Math.PI / 180), v = Math.sin(a * Math.PI / 180); + s.add(null, { d: `M${f(cx + u * r * 0.62)} ${f(cy + v * r * 0.62)}L${f(cx + u * r * 0.82)} ${f(cy + v * r * 0.82)}`, stroke: t.porcTrait, width: 3 }); + } + trait(s, null, x + w * 0.82, y + h * 0.36, 5, h * 0.28, t.navyReflet); s.items.at(-1).opacity = 0.5; +} +// Téléphone porcelaine, écran navy par défaut (clair si ecran = true). Rend le rectangle d'écran. +function telephone(s, x, y, w, h, clair = false) { + const t = s.t; + porcelaine(s, null, x, y, w, h, w * 0.2, 5); + const e = { x: x + w * 0.1, y: y + w * 0.2, w: w * 0.8, h: h - w * 0.36 }; + s.add(null, { d: rr(e.x, e.y, e.w, e.h, w * 0.1), fill: clair ? s.grad(t.ecran, e.x, e.y, e.x + e.w, e.y + e.h) : s.grad(t.navy, e.x, e.y, e.x + e.w, e.y + e.h) }); + trait(s, null, x + w / 2 - w * 0.14, y + w * 0.08, w * 0.28, w * 0.05, t.porcTrait); + return e; +} +// Enveloppe : dos navy, lettre porcelaine qui dépasse, poche porcelaine devant. +function enveloppe(s, x, y, w, h, lettre = true) { + const t = s.t; + navy(s, null, x, y, w, h, 12, 5); + if (lettre) porcelaine(s, null, x + w * 0.12, y - h * 0.34, w * 0.76, h * 0.9, 8, 3); + const poche = `M${f(x)} ${f(y + h * 0.3)}L${f(x + w / 2)} ${f(y + h * 0.64)}L${f(x + w)} ${f(y + h * 0.3)}V${f(y + h - 12)}A12 12 0 0 1 ${f(x + w - 12)} ${f(y + h)}H${f(x + 12)}A12 12 0 0 1 ${f(x)} ${f(y + h - 12)}Z`; + s.add(null, { g: 'translate(0 5)', items: [{ d: poche, fill: t.porcFlanc }] }); + s.add(null, { d: poche, fill: s.grad(t.porc, x, y + h * 0.3, x + w * 0.6, y + h) }); + return { lx: x + w * 0.12, ly: y - h * 0.34, lw: w * 0.76 }; +} + +// 1. Coffre : trois éléments distincts par la silhouette. Une note cyan et une carte navy derrière, +// l'identifiant porcelaine devant avec un cadenas simple et le mot de passe masqué. +// Deuxième version (29/09) : la première empilait trop de détails, illisible à 100 pt. +function coffre(t) { + const s = new Scene(t); fond(s); ombreSol(s, 100, 168, 60); + const note = s.add(null, { g: 'rotate(-12 70 78)', items: [] }); + s.bloc(note.items, rr(28, 46, 84, 64, 12), rr(28, 51, 84, 64, 12), s.grad([t.cyan, t.cyan2], 28, 46, 100, 110), t.cyan2Flanc); + trait(s, note.items, 40, 60, 40, 6, '#FFFFFF'); note.items.at(-1).opacity = 0.7; + trait(s, note.items, 40, 73, 28, 6, '#FFFFFF'); note.items.at(-1).opacity = 0.7; + const carte = s.add(null, { g: 'rotate(10 132 76)', items: [] }); + navy(s, carte.items, 88, 44, 88, 60, 12, 5); + s.bloc(carte.items, rr(102, 58, 20, 15, 4), rr(102, 60, 20, 15, 4), t.cyan, t.cyanFlanc); + porcelaine(s, null, 30, 98, 140, 58, 14, 6); + s.bloc(null, rr(42, 110, 34, 34, 10), rr(42, 113, 34, 34, 10), s.grad(t.navy, 42, 110, 76, 144), t.navyFlanc); + s.add(null, { d: 'M52.5 124V121.5a6.5 6.5 0 0 1 13 0V124', stroke: s.grad(t.porc, 52, 115, 66, 124), width: 3.6 }); + s.add(null, { d: rr(49, 124, 20, 13, 3.5), fill: t.cyan }); + points(s, null, 92, 127, 6, 4.6, 12.5, t.encre); + return s.svg(); +} + +// 2. Générateur : l'icône Loksi en arrière-plan, le champ du mot de passe neuf par-dessus, +// et une jauge de robustesse pleine pour dire « fort ». Les deux flèches de rotation de la +// première planche sont retirées à la demande de Romain (29/09). +function generateur(t) { + const s = new Scene(t); fond(s); ombreSol(s, 100, 170, 64); + tuile(s, null, 50, 18, 100); + porcelaine(s, null, 22, 104, 156, 54, 14, 6); + points(s, null, 42, 122, 7, 5, 15.5, t.encre); + s.bloc(null, rr(151, 111, 6, 22, 3), rr(151, 113, 6, 22, 3), t.cyan2, t.cyan2Flanc); + for (let i = 0; i < 4; i++) s.add(null, { d: rr(36 + i * 32.5, 140, 29, 6, 3), fill: i < 2 ? t.cyan : t.cyan2 }); + return s.svg(); +} + +// 3. Appareils : le même glyphe sur l'ordinateur et sur le téléphone, c'est le message +// « vos données partout ». Deuxième version (29/09) : écran du téléphone réduit au glyphe. +function appareils(t) { + const s = new Scene(t); fond(s); ombreSol(s, 104, 168, 74); + porcelaine(s, null, 36, 40, 138, 92, 12, 5); + s.add(null, { d: rr(44, 48, 122, 76, 6), fill: s.grad(t.navy, 44, 48, 140, 124) }); + glyphe(s, null, 89, 61, 50); + s.bloc(null, rr(92, 136, 26, 16, 2), rr(92, 138, 26, 16, 2), s.grad(t.porc, 92, 136, 118, 152), t.porcFlanc); + porcelaine(s, null, 72, 150, 66, 10, 5, 4); + // Téléphone au premier plan, même écran navy et même glyphe. + porcelaine(s, null, 16, 84, 54, 88, 12, 5); + s.add(null, { d: rr(22, 94, 42, 70, 7), fill: s.grad(t.navy, 22, 94, 64, 164) }); + trait(s, null, 36, 88.5, 14, 3, t.porcTrait); + glyphe(s, null, 29.7, 113, 32); + return s.svg(); +} + +// 4. Biométrie : téléphone, empreinte cyan sur l'écran navy, pastille validée. +// Remplace biometrics-phone, ill_welcome_2, ill_account_setup. +function biometrie(t) { + const s = new Scene(t); fond(s); ombreSol(s, 100, 170, 46); + const e = telephone(s, 60, 24, 80, 142); + const cx = e.x + e.w / 2, cy = e.y + e.h / 2 - 2; + s.add(null, { d: arc(cx, cy, 24, 200, 340), stroke: t.cyan, width: 4.5 }); + s.add(null, { d: arc(cx, cy + 2, 16, 180, 360) + `V${f(cy + 14)}`, stroke: t.cyan, width: 4.5 }); + s.add(null, { d: `M${f(cx - 16)} ${f(cy + 2)}V${f(cy + 22)}`, stroke: t.cyan, width: 4.5 }); + s.add(null, { d: arc(cx, cy + 4, 8, 180, 360) + `V${f(cy + 26)}`, stroke: t.cyan2, width: 4.5 }); + s.add(null, { d: `M${f(cx - 8)} ${f(cy + 4)}V${f(cy + 16)}`, stroke: t.cyan2, width: 4.5 }); + s.add(null, { d: `M${f(cx)} ${f(cy + 2)}V${f(cy + 28)}`, stroke: t.cyan, width: 4.5 }); + pastille(s, 138, 138, 17, 'check'); + return s.svg(); +} + +// 5. Dossier vide : un dossier ouvert sans rien dedans. Remplace no-items, ill_folder_question, +// ill_pin (contenu vide), NoFolders et SearchFolder. +function dossierVide(t) { + const s = new Scene(t); fond(s); ombreSol(s, 100, 166, 64); + const dos = `M36 58a10 10 0 0 1 10-10H80l12 12H154a10 10 0 0 1 10 10V144a10 10 0 0 1-10 10H46a10 10 0 0 1-10-10Z`; + s.add(null, { g: 'translate(0 5)', items: [{ d: dos, fill: t.navyFlanc }] }); + s.add(null, { d: dos, fill: s.grad(t.navy, 36, 48, 150, 154) }); + const devant = `M30 88a8 8 0 0 1 8-8H162a8 8 0 0 1 8 8L164 146a10 10 0 0 1-10 9H46a10 10 0 0 1-10-9Z`; + s.add(null, { g: 'translate(0 5)', items: [{ d: devant, fill: t.porcFlanc }] }); + s.add(null, { d: devant, fill: s.grad(t.porc, 30, 80, 120, 155) }); + trait(s, null, 78, 112, 44, 6, t.porcTrait); + return s.svg(); +} + +// 6. Recherche vide : loupe cyan sur une liste porcelaine sans résultat. Remplace NoResults. +function rechercheVide(t) { + const s = new Scene(t); fond(s); ombreSol(s, 100, 168, 60); + porcelaine(s, null, 34, 40, 104, 118, 14, 5); + for (let i = 0; i < 3; i++) { trait(s, null, 50, 62 + i * 26, 16, 16, t.porcTrait); trait(s, null, 74, 66 + i * 26, 44, 7, t.porcTrait); } + s.add(null, { d: `M146 136L164 154`, stroke: t.navyFlanc, width: 16 }); + s.add(null, { d: `M146 133L164 151`, stroke: s.grad(t.navy, 140, 128, 170, 156), width: 16 }); + s.add(null, { g: 'translate(0 4)', items: [{ d: circle(126, 110, 30), stroke: t.cyanFlanc, width: 11 }] }); + s.add(null, { d: circle(126, 110, 24), fill: t.ecran[0], opacity: 0.55 }); + s.add(null, { d: circle(126, 110, 30), stroke: t.cyan, width: 11 }); + return s.svg(); +} + +// 7. Verrou : un cadenas fermé en héros sur un champ de mot de passe. Remplace lock, ill_lock, +// LockIcon (écran « Votre coffre est verrouillé ») et UserLockIcon. +function verrou(t) { + const s = new Scene(t); fond(s); ombreSol(s, 100, 170, 56); + cadenas(s, 60, 16, 80); + porcelaine(s, null, 30, 128, 140, 32, 12, 5); + points(s, null, 50, 144, 6, 4.4, 13, t.encre); + s.bloc(null, rr(134, 134, 5, 20, 2.5), rr(134, 136, 5, 20, 2.5), t.cyan2, t.cyan2Flanc); + return s.svg(); +} + +// 8. Succès : l'icône Loksi et une pastille validée. Fin d'inscription et de configuration. +// Remplace ill_setup_complete et la fin de l'inscription iOS. +function succes(t) { + const s = new Scene(t); fond(s); ombreSol(s, 100, 164, 50); + tuile(s, null, 46, 40, 108); + pastille(s, 148, 136, 22, 'check'); + return s.svg(); +} + +// 9. Synchro navigateur : une fenêtre de navigateur et le cadenas de la serrure. Remplace keyhole +// et ill_sso_cookie_sync. +function synchroNavigateur(t) { + const s = new Scene(t); fond(s); ombreSol(s, 100, 168, 70); + porcelaine(s, null, 22, 42, 156, 116, 14, 5); + s.add(null, { d: rr(22, 42, 156, 24, [14, 14, 0, 0]), fill: s.grad(t.navy, 22, 42, 178, 66) }); + points(s, null, 36, 54, 3, 3.4, 11, t.porcTrait); + trait(s, null, 76, 50, 88, 8, t.navyReflet); s.items.at(-1).opacity = 0.35; + s.bloc(null, circle(100, 102, 18), circle(100, 105, 18), s.grad([t.cyan, t.cyan2], 82, 84, 118, 120), t.cyan2Flanc); + s.bloc(null, `M92 110L100 96L108 110L112 140H88Z`, `M92 113L100 99L108 113L112 143H88Z`, s.grad([t.cyan, t.cyan2], 88, 96, 112, 140), t.cyan2Flanc); + s.add(null, { d: circle(100, 100, 6), fill: t.encre }); + s.add(null, { d: rr(97, 100, 6, 20, 3), fill: t.encre }); + return s.svg(); +} + +// 10. Import : des feuilles d'identifiants qui descendent dans le coffre-fort. Remplace import, +// ill_import_logins. +function importer(t) { + const s = new Scene(t); fond(s); ombreSol(s, 100, 170, 60); + coffreFort(s, 48, 90, 104, 76); + const feuille = s.add(null, { g: 'rotate(-8 80 50)', items: [] }); + porcelaine(s, feuille.items, 50, 22, 56, 64, 8, 3); + trait(s, feuille.items, 60, 36, 32, 5, t.porcTrait); trait(s, feuille.items, 60, 48, 24, 5, t.porcTrait); + points(s, feuille.items, 63, 64, 4, 3, 8, t.encre); + s.add(null, { d: 'M134 26V66M122 56L134 70L146 56', stroke: t.cyanFlanc, width: 9 }); + s.add(null, { d: 'M134 23V63M122 53L134 67L146 53', stroke: t.cyan, width: 9 }); + return s.svg(); +} + +// 11. Send : un avion de papier porcelaine et sa traîne cyan. Remplace send, ill_send, +// NoSendsIcon et ActiveSendIcon. +function send(t) { + const s = new Scene(t); fond(s); ombreSol(s, 104, 166, 52); + const aile = 'M34 102L164 44L118 150L96 118Z'; + const pli = 'M96 118L164 44L86 132Z'; + s.add(null, { g: 'translate(0 5)', items: [{ d: aile, fill: t.porcFlanc }] }); + s.add(null, { d: aile, fill: s.grad(t.porc, 40, 50, 150, 150) }); + s.add(null, { d: pli, fill: s.grad(t.navy, 90, 60, 150, 130) }); + s.add(null, { d: 'M96 118L164 44', stroke: t.porcTrait, width: 2 }); + s.add(null, { d: 'M40 148Q58 136 74 142', stroke: t.cyan, width: 6 }); + s.add(null, { d: 'M24 128Q34 122 44 124', stroke: t.cyan2, width: 6 }); + return s.svg(); +} + +// 12. E-mail : enveloppe ouverte, lettre avec la pastille validée. Remplace email, ill_open_email, +// RegistrationCheckEmailIcon. +function email(t) { + const s = new Scene(t); fond(s); ombreSol(s, 100, 168, 64); + const { lx, ly, lw } = enveloppe(s, 36, 82, 128, 80); + trait(s, null, lx + 14, ly + 16, lw - 44, 6, t.porcTrait); + trait(s, null, lx + 14, ly + 30, lw - 60, 6, t.porcTrait); + pastille(s, 148, 84, 18, 'check'); + return s.svg(); +} + +// 13. Code par e-mail : même enveloppe, la lettre porte un code masqué. Remplace email-otp, +// ill_new_device_verification, TwoFactorAuthEmailIcon. +function emailCode(t) { + const s = new Scene(t); fond(s); ombreSol(s, 100, 168, 64); + const { lx, ly, lw } = enveloppe(s, 36, 82, 128, 80); + s.add(null, { d: rr(lx + 10, ly + 12, lw - 20, 22, 7), fill: t.ecran[1], opacity: 0.6 }); + points(s, null, lx + 22, ly + 23, 6, 3.6, (lw - 44) / 5, t.encre); + return s.svg(); +} + +// 14. Application d'authentification : téléphone, minuteur cyan et code. Remplace +// authenticator-app, ill_authenticator. +function authentificateur(t) { + const s = new Scene(t); fond(s); ombreSol(s, 100, 170, 46); + const e = telephone(s, 60, 24, 80, 142); + const cx = e.x + e.w / 2; + s.add(null, { d: circle(cx, 72, 20), stroke: t.navyReflet, width: 6 }); s.items.at(-1).stroke = t.navyFlanc; + s.add(null, { d: arc(cx, 72, 20, -90, 160), stroke: t.cyan, width: 6 }); + porcelaine(s, null, e.x + 4, 106, e.w - 8, 22, 7, 3); + points(s, null, e.x + 13, 117, 6, 3, (e.w - 26) / 5, t.encre); + return s.svg(); +} + +// 15. Clé de sécurité : une clé USB navy à bouton cyan. Remplace yubikey, ill_yubi_key. +function cleSecurite(t) { + const s = new Scene(t); fond(s); ombreSol(s, 100, 168, 44); + const g = s.add(null, { g: 'rotate(-30 100 100)', items: [] }); + s.bloc(g.items, rr(86, 20, 28, 30, 4), rr(86, 23, 28, 30, 4), s.grad(t.porc, 86, 20, 114, 50), t.porcFlanc); + trait(s, g.items, 92, 28, 6, 8, t.porcTrait); trait(s, g.items, 102, 28, 6, 8, t.porcTrait); + navy(s, g.items, 72, 46, 56, 118, 16, 6); + s.bloc(g.items, circle(100, 104, 15), circle(100, 107, 15), s.grad([t.cyan, t.cyan2], 85, 89, 115, 119), t.cyan2Flanc); + s.add(g.items, { d: circle(100, 146, 6), fill: t.fond }); + return s.svg(); +} + +// 16. Remplissage automatique : un formulaire porcelaine rempli, pastille validée. +// Remplace autofill, ill_autofill. +function autofill(t) { + const s = new Scene(t); fond(s); ombreSol(s, 100, 170, 64); + porcelaine(s, null, 36, 30, 128, 134, 16, 5); + trait(s, null, 52, 46, 40, 6, t.porcTrait); + s.add(null, { d: rr(52, 60, 96, 24, 7), fill: t.ecran[1], opacity: 0.6 }); + trait(s, null, 62, 69, 52, 6, t.encre); + s.add(null, { d: rr(52, 94, 96, 24, 7), fill: t.ecran[1], opacity: 0.6 }); + points(s, null, 64, 106, 6, 3.6, 10, t.encre); + s.bloc(null, rr(52, 130, 96, 20, 10), rr(52, 133, 96, 20, 10), s.grad([t.cyan, t.cyan2], 52, 130, 148, 150), t.cyan2Flanc); + pastille(s, 152, 58, 18, 'check'); + return s.svg(); +} + +// 17. Adresse bloquée : un globe navy et une pastille d'interdiction. Remplace ill_blocked_uri +// et DomainIcon. +function uriBloquee(t) { + const s = new Scene(t); fond(s); ombreSol(s, 100, 166, 54); + s.bloc(null, circle(96, 96, 56), circle(96, 102, 56), s.grad(t.navy, 40, 40, 150, 152), t.navyFlanc); + const l = t.navyReflet; + s.add(null, { d: ellipse(96, 96, 24, 56), stroke: l, width: 4 }); s.items.at(-1).opacity = 0.7; + s.add(null, { d: 'M40 96H152M48 68H144M48 124H144', stroke: l, width: 4 }); + s.add(null, { d: 'M96 40V152', stroke: l, width: 4 }); + pastille(s, 146, 138, 24, 'moins', true); + return s.svg(); +} + +// 18. Corbeille vide. Remplace EmptyTrash. +function corbeille(t) { + const s = new Scene(t); fond(s); ombreSol(s, 100, 168, 50); + const cuve = 'M52 64H148L138 156A10 10 0 0 1 128 165H72A10 10 0 0 1 62 156Z'; + s.add(null, { g: 'translate(0 5)', items: [{ d: cuve, fill: t.porcFlanc }] }); + s.add(null, { d: cuve, fill: s.grad(t.porc, 52, 64, 130, 165) }); + for (const x of [80, 100, 120]) s.add(null, { d: `M${x} 84V${x === 100 ? 146 : 144}`, stroke: t.porcTrait, width: 6 }); + s.bloc(null, rr(84, 32, 32, 16, 6), rr(84, 34, 32, 16, 6), s.grad(t.navy, 84, 32, 116, 48), t.navyFlanc); + navy(s, null, 42, 42, 116, 18, 9, 4); + return s.svg(); +} + +// 19. Fichier en erreur : un document porcelaine et une pastille d'alerte. Remplace +// ill_file_error, ill_file_not_found. +function fichierErreur(t) { + const s = new Scene(t); fond(s); ombreSol(s, 100, 168, 50); + const doc = 'M56 38A10 10 0 0 1 66 28H116L146 58V154A10 10 0 0 1 136 164H66A10 10 0 0 1 56 154Z'; + s.add(null, { g: 'translate(0 5)', items: [{ d: doc, fill: t.porcFlanc }] }); + s.add(null, { d: doc, fill: s.grad(t.porc, 56, 28, 130, 164) }); + s.add(null, { d: 'M116 28V50A8 8 0 0 0 124 58H146Z', fill: s.grad([t.cyan, t.cyan2], 116, 28, 146, 58) }); + for (let i = 0; i < 3; i++) trait(s, null, 72, 78 + i * 16, i === 2 ? 36 : 56, 6, t.porcTrait); + pastille(s, 140, 140, 22, 'excl', true); + return s.svg(); +} + +// 20. Organisation : un immeuble navy aux fenêtres porcelaine, pastille de sortie. Remplace +// item-transfer, ill_leave_organization, ill_migrate_to_my_items, DeactivatedOrg. +function organisation(t) { + const s = new Scene(t); fond(s); ombreSol(s, 100, 168, 60); + navy(s, null, 56, 36, 88, 126, 12, 6); + for (let r = 0; r < 4; r++) for (let c = 0; c < 3; c++) s.add(null, { d: rr(68 + c * 24, 50 + r * 22, 16, 13, 3), fill: t.porc[r === 1 && c === 1 ? 2 : 0], opacity: 0.9 }); + s.add(null, { d: rr(88, 138, 24, 24, [6, 6, 0, 0]), fill: t.cyan2 }); + pastille(s, 146, 138, 22, 'sortie'); + return s.svg(); +} + +// 21. Délai expiré : un réveil porcelaine, aiguilles navy, arc cyan du temps écoulé. Remplace +// TwoFactorTimeoutIcon (lien expiré, délai d'authentification). +function delaiExpire(t) { + const s = new Scene(t); fond(s); ombreSol(s, 100, 168, 52); + s.bloc(null, circle(100, 100, 58), circle(100, 106, 58), s.grad(t.porc, 50, 44, 150, 158), t.porcFlanc); + s.add(null, { d: arc(100, 100, 46, -90, 200), stroke: t.cyan, width: 8 }); + s.add(null, { d: 'M100 100V70M100 100L120 112', stroke: t.encre, width: 7 }); + s.add(null, { d: circle(100, 100, 6), fill: t.cyan2 }); + pastille(s, 148, 146, 20, 'excl', true); + return s.svg(); +} + +// 22. Sécurité : un bouclier navy et une coche cyan. Remplace Security (ressaisie du mot de +// passe, sécurité du compte). +function securite(t) { + const s = new Scene(t); fond(s); ombreSol(s, 100, 170, 48); + const b = 'M100 24L154 44V92C154 126 130 150 100 162C70 150 46 126 46 92V44Z'; + s.add(null, { g: 'translate(0 6)', items: [{ d: b, fill: t.navyFlanc }] }); + s.add(null, { d: b, fill: s.grad(t.navy, 46, 24, 150, 160) }); + const b2 = 'M100 38L142 54V92C142 118 124 138 100 148Z'; + s.add(null, { d: b2, fill: t.navyReflet, opacity: 0.18 }); + s.add(null, { d: 'M78 94L94 110L124 78', stroke: t.cyanFlanc, width: 12 }); + s.add(null, { d: 'M78 90L94 106L124 74', stroke: t.cyan, width: 12 }); + return s.svg(); +} + +export const ILLUSTRATIONS = { + coffre, biometrie, generateur, appareils, 'dossier-vide': dossierVide, 'recherche-vide': rechercheVide, + verrou, succes, 'synchro-navigateur': synchroNavigateur, import: importer, send, email, + 'email-code': emailCode, authentificateur, 'cle-securite': cleSecurite, autofill, + 'uri-bloquee': uriBloquee, corbeille, 'fichier-erreur': fichierErreur, organisation, + 'delai-expire': delaiExpire, securite, +}; + +if (process.argv[1] === fileURLToPath(import.meta.url)) { + const dir = join(HERE, 'sources'); + mkdirSync(dir, { recursive: true }); + for (const [nom, scene] of Object.entries(ILLUSTRATIONS)) { + for (const [theme, t] of Object.entries(THEMES)) { + writeFileSync(join(dir, `${nom}-${theme}.svg`), scene(t)); + } + } + console.log(`${Object.keys(ILLUSTRATIONS).length * 2} maîtres SVG écrits dans ${dir}`); +} diff --git a/brand/illustrations-mobiles/onglets.mjs b/brand/illustrations-mobiles/onglets.mjs new file mode 100644 index 0000000..b10348a --- /dev/null +++ b/brand/illustrations-mobiles/onglets.mjs @@ -0,0 +1,90 @@ +// Pictogrammes de la barre d'onglets de l'app iOS : coffre, générateur, Send, paramètres. +// node illustrations-mobiles/onglets.mjs (depuis brand/) écrit onglets/-<état>-.svg +// +// Remplacent BitwardenResources/Icons.xcassets/TabBar/{vault,generator,send,settings}-{active,idle} +// (24 x 24 pt, clair et sombre, template-rendering-intent original : couleurs figées dans le PDF). +// Convention iOS : actif en forme pleine, inactif au trait. Les détails de la forme pleine sont +// évidés par fill-rule evenodd, pas peints à la couleur du fond : la barre d'onglets est translucide. +// Même sous-ensemble SVG que les illustrations, contrôlé par controle.mjs. +import { mkdirSync, writeFileSync } from 'node:fs'; +import { dirname, join } from 'node:path'; +import { fileURLToPath } from 'node:url'; + +const HERE = dirname(fileURLToPath(import.meta.url)); +const f = (n) => +n.toFixed(2); + +// Actif navy en clair et cyan en sombre, comme les boutons de l'app. Second ton pour le petit +// bloc du glyphe. Inactif gris bleu, lisible sur les deux fonds sans concurrencer l'actif. +export const THEMES = { + light: { actif: '#003087', second: '#009CDE', repos: '#6B7A90' }, + dark: { actif: '#009CDE', second: '#1FBFF5', repos: '#8D9AAE' }, +}; +const TRAIT = 1.8; + +const circle = (cx, cy, r) => `M${f(cx - r)} ${f(cy)}A${r} ${r} 0 1 0 ${f(cx + r)} ${f(cy)}A${r} ${r} 0 1 0 ${f(cx - r)} ${f(cy)}Z`; +function rr(x, y, w, h, r) { + return `M${f(x + r)} ${f(y)}H${f(x + w - r)}A${r} ${r} 0 0 1 ${f(x + w)} ${f(y + r)}V${f(y + h - r)}` + + `A${r} ${r} 0 0 1 ${f(x + w - r)} ${f(y + h)}H${f(x + r)}A${r} ${r} 0 0 1 ${f(x)} ${f(y + h - r)}V${f(y + r)}A${r} ${r} 0 0 1 ${f(x + r)} ${f(y)}Z`; +} +const plein = (d, c, evidement = false) => ``; +const trait = (d, c, w = TRAIT) => ``; +const svg = (corps) => `\n${corps.join('\n')}\n\n`; + +// Coffre : le glyphe de l'icône Loksi (anse, L, petit bloc), repère 64 de loksi-icon.svg ramené +// à 20 de haut. Actif : L et anse à la couleur active, bloc au second ton. Inactif : au trait. +const G = { anse: 'M19.6 27.3V24.2a10.95 10.95 0 0 1 21.9 0v3.1', + L: 'M13.8 28.9H28.5a1.5 1.5 0 0 1 1.5 1.5V52.5a1.5 1.5 0 0 1-1.5 1.5H18.3a6 6 0 0 1-6-6V30.4a1.5 1.5 0 0 1 1.5-1.5Z', + bloc: 'M34 41.1H44.9a5 5 0 0 1 5 5V48a7 7 0 0 1-7 7H34.5a1.5 1.5 0 0 1-1.5-1.5V42.1a1 1 0 0 1 1-1Z' }; +function vault(t, actif) { + const k = 20 / 45.05, ox = (24 - 37.6 * k) / 2 - 12.3 * k, oy = 2 - 9.95 * k; + const g = (items) => `${items.join('')}`; + if (actif) return svg([g([trait(G.anse, t.actif, 6.6), plein(G.L, t.actif), plein(G.bloc, t.second)])]); + const w = f(TRAIT / k); + return svg([g([trait(G.anse, t.repos, w), trait(G.L, t.repos, w), trait(G.bloc, t.repos, w)])]); +} + +// Générateur : le champ du mot de passe, trois points et le curseur, une étincelle au-dessus. +const etincelle = (cx, cy, r) => `M${f(cx)} ${f(cy - r)}Q${f(cx + r * 0.18)} ${f(cy - r * 0.18)} ${f(cx + r)} ${f(cy)}` + + `Q${f(cx + r * 0.18)} ${f(cy + r * 0.18)} ${f(cx)} ${f(cy + r)}Q${f(cx - r * 0.18)} ${f(cy + r * 0.18)} ${f(cx - r)} ${f(cy)}` + + `Q${f(cx - r * 0.18)} ${f(cy - r * 0.18)} ${f(cx)} ${f(cy - r)}Z`; +function generator(t, actif) { + const champ = rr(1.9, 10, 20.2, 10, 5), pts = [6.6, 10.4, 14.2].map((x) => circle(x, 15, 1.35)).join(''); + const curseur = rr(17.5, 12.4, 1.6, 5.2, 0.8); + const star = plein(etincelle(18.6, 4.6, 3.6), actif ? t.second : t.repos); + if (actif) return svg([plein(champ + pts + curseur, t.actif, true), star]); + return svg([trait(champ, t.repos), plein(pts + curseur, t.repos), star]); +} + +// Send : l'avion de papier des illustrations. Actif : une seule forme pleine, le pli évidé en +// biseau fin (première version à deux pans séparés : on y lisait un avion de chasse, 29/09). +function send(t, actif) { + if (actif) return svg([plein('M2.2 10.6L21.8 2.3L15.6 21.3L11.3 14.4Z' + 'M9.9 12.7L21.8 2.3L12.1 15.2Z', t.actif, true)]); + return svg([trait('M2.6 10.6L21.4 2.6L15.4 21L11.3 14.3Z', t.repos), trait('M11.3 14.3L21.4 2.6', t.repos)]); +} + +// Paramètres : roue à six dents arrondies, moyeu évidé. +function roue() { + const r = 7.7, R = 10.4, p = (a, rad) => `${f(12 + rad * Math.cos(a * Math.PI / 180))} ${f(12 + rad * Math.sin(a * Math.PI / 180))}`; + let d = ''; + for (let i = 0; i < 6; i++) { + const a = i * 60 - 90; + d += `${i ? 'L' : 'M'}${p(a - 19, r)}L${p(a - 11, R)}A${R} ${R} 0 0 1 ${p(a + 11, R)}L${p(a + 19, r)}A${r} ${r} 0 0 1 ${p(a + 41, r)}`; + } + return d + 'Z'; +} +function settings(t, actif) { + if (actif) return svg([plein(roue() + circle(12, 12, 3.3), t.actif, true)]); + return svg([trait(roue(), t.repos), trait(circle(12, 12, 3.3), t.repos)]); +} + +export const ONGLETS = { vault, generator, send, settings }; + +if (process.argv[1] === fileURLToPath(import.meta.url)) { + const dir = join(HERE, 'onglets'); + mkdirSync(dir, { recursive: true }); + let n = 0; + for (const [nom, dessin] of Object.entries(ONGLETS)) for (const [theme, t] of Object.entries(THEMES)) for (const actif of [true, false]) { + writeFileSync(join(dir, `${nom}-${actif ? 'active' : 'idle'}-${theme}.svg`), dessin(t, actif)); n++; + } + console.log(`${n} pictogrammes écrits dans ${dir}`); +} diff --git a/brand/illustrations-mobiles/onglets/generator-active-dark.svg b/brand/illustrations-mobiles/onglets/generator-active-dark.svg new file mode 100644 index 0000000..acc5591 --- /dev/null +++ b/brand/illustrations-mobiles/onglets/generator-active-dark.svg @@ -0,0 +1,4 @@ + + + + diff --git a/brand/illustrations-mobiles/onglets/generator-active-light.svg b/brand/illustrations-mobiles/onglets/generator-active-light.svg new file mode 100644 index 0000000..acce2ee --- /dev/null +++ b/brand/illustrations-mobiles/onglets/generator-active-light.svg @@ -0,0 +1,4 @@ + + + + diff --git a/brand/illustrations-mobiles/onglets/generator-idle-dark.svg b/brand/illustrations-mobiles/onglets/generator-idle-dark.svg new file mode 100644 index 0000000..46560c6 --- /dev/null +++ b/brand/illustrations-mobiles/onglets/generator-idle-dark.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/brand/illustrations-mobiles/onglets/generator-idle-light.svg b/brand/illustrations-mobiles/onglets/generator-idle-light.svg new file mode 100644 index 0000000..f181a4c --- /dev/null +++ b/brand/illustrations-mobiles/onglets/generator-idle-light.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/brand/illustrations-mobiles/onglets/send-active-dark.svg b/brand/illustrations-mobiles/onglets/send-active-dark.svg new file mode 100644 index 0000000..6b59e9d --- /dev/null +++ b/brand/illustrations-mobiles/onglets/send-active-dark.svg @@ -0,0 +1,3 @@ + + + diff --git a/brand/illustrations-mobiles/onglets/send-active-light.svg b/brand/illustrations-mobiles/onglets/send-active-light.svg new file mode 100644 index 0000000..56c66cf --- /dev/null +++ b/brand/illustrations-mobiles/onglets/send-active-light.svg @@ -0,0 +1,3 @@ + + + diff --git a/brand/illustrations-mobiles/onglets/send-idle-dark.svg b/brand/illustrations-mobiles/onglets/send-idle-dark.svg new file mode 100644 index 0000000..b7199ae --- /dev/null +++ b/brand/illustrations-mobiles/onglets/send-idle-dark.svg @@ -0,0 +1,4 @@ + + + + diff --git a/brand/illustrations-mobiles/onglets/send-idle-light.svg b/brand/illustrations-mobiles/onglets/send-idle-light.svg new file mode 100644 index 0000000..a3c2073 --- /dev/null +++ b/brand/illustrations-mobiles/onglets/send-idle-light.svg @@ -0,0 +1,4 @@ + + + + diff --git a/brand/illustrations-mobiles/onglets/settings-active-dark.svg b/brand/illustrations-mobiles/onglets/settings-active-dark.svg new file mode 100644 index 0000000..39405e7 --- /dev/null +++ b/brand/illustrations-mobiles/onglets/settings-active-dark.svg @@ -0,0 +1,3 @@ + + + diff --git a/brand/illustrations-mobiles/onglets/settings-active-light.svg b/brand/illustrations-mobiles/onglets/settings-active-light.svg new file mode 100644 index 0000000..88fe9cd --- /dev/null +++ b/brand/illustrations-mobiles/onglets/settings-active-light.svg @@ -0,0 +1,3 @@ + + + diff --git a/brand/illustrations-mobiles/onglets/settings-idle-dark.svg b/brand/illustrations-mobiles/onglets/settings-idle-dark.svg new file mode 100644 index 0000000..3cc364a --- /dev/null +++ b/brand/illustrations-mobiles/onglets/settings-idle-dark.svg @@ -0,0 +1,4 @@ + + + + diff --git a/brand/illustrations-mobiles/onglets/settings-idle-light.svg b/brand/illustrations-mobiles/onglets/settings-idle-light.svg new file mode 100644 index 0000000..29d313d --- /dev/null +++ b/brand/illustrations-mobiles/onglets/settings-idle-light.svg @@ -0,0 +1,4 @@ + + + + diff --git a/brand/illustrations-mobiles/onglets/vault-active-dark.svg b/brand/illustrations-mobiles/onglets/vault-active-dark.svg new file mode 100644 index 0000000..2ab6dbf --- /dev/null +++ b/brand/illustrations-mobiles/onglets/vault-active-dark.svg @@ -0,0 +1,3 @@ + + + diff --git a/brand/illustrations-mobiles/onglets/vault-active-light.svg b/brand/illustrations-mobiles/onglets/vault-active-light.svg new file mode 100644 index 0000000..c174b9e --- /dev/null +++ b/brand/illustrations-mobiles/onglets/vault-active-light.svg @@ -0,0 +1,3 @@ + + + diff --git a/brand/illustrations-mobiles/onglets/vault-idle-dark.svg b/brand/illustrations-mobiles/onglets/vault-idle-dark.svg new file mode 100644 index 0000000..450813f --- /dev/null +++ b/brand/illustrations-mobiles/onglets/vault-idle-dark.svg @@ -0,0 +1,3 @@ + + + diff --git a/brand/illustrations-mobiles/onglets/vault-idle-light.svg b/brand/illustrations-mobiles/onglets/vault-idle-light.svg new file mode 100644 index 0000000..2993806 --- /dev/null +++ b/brand/illustrations-mobiles/onglets/vault-idle-light.svg @@ -0,0 +1,3 @@ + + + diff --git a/brand/illustrations-mobiles/render.mjs b/brand/illustrations-mobiles/render.mjs new file mode 100644 index 0000000..014e3d8 --- /dev/null +++ b/brand/illustrations-mobiles/render.mjs @@ -0,0 +1,73 @@ +// Planche d'essai et planche du jeu complet : régénère les maîtres, rend les illustrations amont pour comparaison, +// puis photographie planche.html après contrôle de la police et de chaque image. +// AMONT= node illustrations-mobiles/render.mjs +import { chromium } from 'playwright'; +import { execFileSync } from 'node:child_process'; +import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs'; +import { JEU } from './correspondance.mjs'; +import { dirname, join } from 'node:path'; +import { fileURLToPath, pathToFileURL } from 'node:url'; + +const dir = dirname(fileURLToPath(import.meta.url)); +execFileSync('node', [join(dir, 'generate.mjs')], { stdio: 'inherit' }); + +// Les rendus amont restent hors Git (amont/ est ignoré) : ce sont des dessins Bitwarden. +const ILL = 'BitwardenShared/UI/Platform/Application/Support/Images.xcassets/Images/Illustrations'; +const amont = { items_light: 'items.imageset/items_light.pdf', generate: 'generate.imageset/generate.pdf', + 'secure-devices': 'secure-devices.imageset/secure-devices.pdf' }; +// Pictogrammes de la barre d'onglets, clair et sombre. Le PDF clair actif du coffre porte une +// faute de frappe en amont (vault-actve-light.pdf), gardée telle quelle. +const TAB = 'BitwardenResources/Icons.xcassets/TabBar'; +for (const o of ['vault', 'generator', 'send', 'settings']) for (const e of ['active', 'idle']) for (const th of ['light', 'dark']) { + const fichier = o === 'vault' && e === 'active' && th === 'light' ? 'vault-actve-light.pdf' : `${o}-${e}-${th}.pdf`; + amont[`tab-${o}-${e}-${th}`] = `${TAB}/${o}-${e}.imageset/${fichier}`; +} +mkdirSync(join(dir, 'amont'), { recursive: true }); +execFileSync('node', [join(dir, 'onglets.mjs')], { stdio: 'inherit' }); +for (const [nom, pdf] of Object.entries(amont)) { + const out = join(dir, 'amont', `${nom}.png`); + if (existsSync(out)) continue; + if (!process.env.AMONT) throw new Error(`amont/${nom}.png absent : donner AMONT=`); + // 144 dpi pour un rendu net en 200 px sur un écran à 2x, 576 pour les pictogrammes de 24 pt. + execFileSync('pdftoppm', ['-png', '-r', nom.startsWith('tab-') ? '576' : '144', '-singlefile', join(process.env.AMONT, nom.startsWith('tab-') ? '' : ILL, pdf), out.replace(/\.png$/, '')]); +} + +// Planche du jeu : une carte par illustration, clair et sombre, puis tout le jeu à 80 px. +const esc = (x) => x.replace(/&/g, '&').replace(/ (v ? `
${k}
${esc(v)}
` : ''); +const cartes = JEU.map((j) => `

${j.nom}

${esc(j.ecran)}

+
${j.nom} clair
${j.nom} sombre
+
${ligne('iOS', j.ios)}${ligne('Android', j.android)}${ligne('Extension', j.extension)}
`).join('\n'); +const petits = (theme) => JEU.map((j) => `${j.nom} ${theme} 80`).join(''); +writeFileSync(join(dir, 'planche-jeu.html'), readFileSync(join(dir, 'planche-jeu.gabarit.html'), 'utf8') + .replace('{{nombre}}', String(JEU.length)).replace('{{cartes}}', cartes) + .replace('{{petits-clair}}', petits('clair')).replace('{{petits-sombre}}', petits('sombre'))); + +// Table du README, entre les deux marqueurs, tirée de la même correspondance. +const readme = join(dir, 'README.md'); +const table = ['| Loksi | Écran | iOS | Android | Extension |', '|---|---|---|---|---|', + ...JEU.map((j) => `| \`${j.nom}\` | ${j.ecran} | ${j.ios || 'aucun'} | ${j.android || 'aucun'} | ${j.extension || 'aucun'} |`)].join('\n'); +const r = readFileSync(readme, 'utf8'); +if (!/[\s\S]*/.test(r)) throw new Error('README : marqueurs jeu:debut et jeu:fin absents'); +writeFileSync(readme, r.replace(/[\s\S]*/, `\n${table}\n`)); + +const browser = await chromium.launch(); +try { + for (const [html, png] of [['planche.html', 'planche-essai.png'], ['planche-jeu.html', 'planche-jeu.png'], ['planche-onglets.html', 'planche-onglets.png']]) { + const page = await browser.newPage({ viewport: { width: 1400, height: 1000 }, deviceScaleFactor: 2 }); + await page.route('**/*', (r) => (r.request().url().startsWith('file:') ? r.continue() : r.abort())); + await page.goto(pathToFileURL(join(dir, html)).href); + await page.evaluate(() => document.fonts.ready); + const checks = await page.evaluate(() => ({ + police: [...document.fonts].some((f) => f.family === 'Raleway' && f.status === 'loaded'), + images: [...document.images].map((i) => ({ src: i.getAttribute('src'), ok: i.complete && i.naturalWidth > 0 })), + })); + const ko = checks.images.filter((i) => !i.ok); + if (!checks.police || ko.length) throw new Error(`${html} incomplète : ${JSON.stringify({ police: checks.police, ko })}`); + await page.locator('.page').screenshot({ path: join(dir, png) }); + console.log(`${png} : Raleway chargée, ${checks.images.length} images chargées`); + await page.close(); + } +} finally { + await browser.close(); +} diff --git a/brand/illustrations-mobiles/sources/appareils-clair.svg b/brand/illustrations-mobiles/sources/appareils-clair.svg new file mode 100644 index 0000000..a1091db --- /dev/null +++ b/brand/illustrations-mobiles/sources/appareils-clair.svg @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/brand/illustrations-mobiles/sources/appareils-sombre.svg b/brand/illustrations-mobiles/sources/appareils-sombre.svg new file mode 100644 index 0000000..3ddba55 --- /dev/null +++ b/brand/illustrations-mobiles/sources/appareils-sombre.svg @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/brand/illustrations-mobiles/sources/authentificateur-clair.svg b/brand/illustrations-mobiles/sources/authentificateur-clair.svg new file mode 100644 index 0000000..b52ddb4 --- /dev/null +++ b/brand/illustrations-mobiles/sources/authentificateur-clair.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/brand/illustrations-mobiles/sources/authentificateur-sombre.svg b/brand/illustrations-mobiles/sources/authentificateur-sombre.svg new file mode 100644 index 0000000..2d18018 --- /dev/null +++ b/brand/illustrations-mobiles/sources/authentificateur-sombre.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/brand/illustrations-mobiles/sources/autofill-clair.svg b/brand/illustrations-mobiles/sources/autofill-clair.svg new file mode 100644 index 0000000..726716d --- /dev/null +++ b/brand/illustrations-mobiles/sources/autofill-clair.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/brand/illustrations-mobiles/sources/autofill-sombre.svg b/brand/illustrations-mobiles/sources/autofill-sombre.svg new file mode 100644 index 0000000..152e686 --- /dev/null +++ b/brand/illustrations-mobiles/sources/autofill-sombre.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/brand/illustrations-mobiles/sources/biometrie-clair.svg b/brand/illustrations-mobiles/sources/biometrie-clair.svg new file mode 100644 index 0000000..331704b --- /dev/null +++ b/brand/illustrations-mobiles/sources/biometrie-clair.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/brand/illustrations-mobiles/sources/biometrie-sombre.svg b/brand/illustrations-mobiles/sources/biometrie-sombre.svg new file mode 100644 index 0000000..747e30a --- /dev/null +++ b/brand/illustrations-mobiles/sources/biometrie-sombre.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/brand/illustrations-mobiles/sources/cle-securite-clair.svg b/brand/illustrations-mobiles/sources/cle-securite-clair.svg new file mode 100644 index 0000000..ddca5b3 --- /dev/null +++ b/brand/illustrations-mobiles/sources/cle-securite-clair.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/brand/illustrations-mobiles/sources/cle-securite-sombre.svg b/brand/illustrations-mobiles/sources/cle-securite-sombre.svg new file mode 100644 index 0000000..11ee791 --- /dev/null +++ b/brand/illustrations-mobiles/sources/cle-securite-sombre.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/brand/illustrations-mobiles/sources/coffre-clair.svg b/brand/illustrations-mobiles/sources/coffre-clair.svg new file mode 100644 index 0000000..1c9a4ba --- /dev/null +++ b/brand/illustrations-mobiles/sources/coffre-clair.svg @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/brand/illustrations-mobiles/sources/coffre-sombre.svg b/brand/illustrations-mobiles/sources/coffre-sombre.svg new file mode 100644 index 0000000..df8e07e --- /dev/null +++ b/brand/illustrations-mobiles/sources/coffre-sombre.svg @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/brand/illustrations-mobiles/sources/corbeille-clair.svg b/brand/illustrations-mobiles/sources/corbeille-clair.svg new file mode 100644 index 0000000..c67cbb2 --- /dev/null +++ b/brand/illustrations-mobiles/sources/corbeille-clair.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/brand/illustrations-mobiles/sources/corbeille-sombre.svg b/brand/illustrations-mobiles/sources/corbeille-sombre.svg new file mode 100644 index 0000000..494233a --- /dev/null +++ b/brand/illustrations-mobiles/sources/corbeille-sombre.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/brand/illustrations-mobiles/sources/delai-expire-clair.svg b/brand/illustrations-mobiles/sources/delai-expire-clair.svg new file mode 100644 index 0000000..0b1232b --- /dev/null +++ b/brand/illustrations-mobiles/sources/delai-expire-clair.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/brand/illustrations-mobiles/sources/delai-expire-sombre.svg b/brand/illustrations-mobiles/sources/delai-expire-sombre.svg new file mode 100644 index 0000000..08624f6 --- /dev/null +++ b/brand/illustrations-mobiles/sources/delai-expire-sombre.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/brand/illustrations-mobiles/sources/dossier-vide-clair.svg b/brand/illustrations-mobiles/sources/dossier-vide-clair.svg new file mode 100644 index 0000000..4ed44bf --- /dev/null +++ b/brand/illustrations-mobiles/sources/dossier-vide-clair.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/brand/illustrations-mobiles/sources/dossier-vide-sombre.svg b/brand/illustrations-mobiles/sources/dossier-vide-sombre.svg new file mode 100644 index 0000000..4ee326c --- /dev/null +++ b/brand/illustrations-mobiles/sources/dossier-vide-sombre.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/brand/illustrations-mobiles/sources/email-clair.svg b/brand/illustrations-mobiles/sources/email-clair.svg new file mode 100644 index 0000000..66e15b5 --- /dev/null +++ b/brand/illustrations-mobiles/sources/email-clair.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/brand/illustrations-mobiles/sources/email-code-clair.svg b/brand/illustrations-mobiles/sources/email-code-clair.svg new file mode 100644 index 0000000..be70b6f --- /dev/null +++ b/brand/illustrations-mobiles/sources/email-code-clair.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/brand/illustrations-mobiles/sources/email-code-sombre.svg b/brand/illustrations-mobiles/sources/email-code-sombre.svg new file mode 100644 index 0000000..183e763 --- /dev/null +++ b/brand/illustrations-mobiles/sources/email-code-sombre.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/brand/illustrations-mobiles/sources/email-sombre.svg b/brand/illustrations-mobiles/sources/email-sombre.svg new file mode 100644 index 0000000..38534e3 --- /dev/null +++ b/brand/illustrations-mobiles/sources/email-sombre.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/brand/illustrations-mobiles/sources/fichier-erreur-clair.svg b/brand/illustrations-mobiles/sources/fichier-erreur-clair.svg new file mode 100644 index 0000000..6e682c8 --- /dev/null +++ b/brand/illustrations-mobiles/sources/fichier-erreur-clair.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/brand/illustrations-mobiles/sources/fichier-erreur-sombre.svg b/brand/illustrations-mobiles/sources/fichier-erreur-sombre.svg new file mode 100644 index 0000000..d123045 --- /dev/null +++ b/brand/illustrations-mobiles/sources/fichier-erreur-sombre.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/brand/illustrations-mobiles/sources/generateur-clair.svg b/brand/illustrations-mobiles/sources/generateur-clair.svg new file mode 100644 index 0000000..59e6339 --- /dev/null +++ b/brand/illustrations-mobiles/sources/generateur-clair.svg @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/brand/illustrations-mobiles/sources/generateur-sombre.svg b/brand/illustrations-mobiles/sources/generateur-sombre.svg new file mode 100644 index 0000000..fdeaefc --- /dev/null +++ b/brand/illustrations-mobiles/sources/generateur-sombre.svg @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/brand/illustrations-mobiles/sources/import-clair.svg b/brand/illustrations-mobiles/sources/import-clair.svg new file mode 100644 index 0000000..6dece5c --- /dev/null +++ b/brand/illustrations-mobiles/sources/import-clair.svg @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/brand/illustrations-mobiles/sources/import-sombre.svg b/brand/illustrations-mobiles/sources/import-sombre.svg new file mode 100644 index 0000000..49c4214 --- /dev/null +++ b/brand/illustrations-mobiles/sources/import-sombre.svg @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/brand/illustrations-mobiles/sources/organisation-clair.svg b/brand/illustrations-mobiles/sources/organisation-clair.svg new file mode 100644 index 0000000..0412165 --- /dev/null +++ b/brand/illustrations-mobiles/sources/organisation-clair.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/brand/illustrations-mobiles/sources/organisation-sombre.svg b/brand/illustrations-mobiles/sources/organisation-sombre.svg new file mode 100644 index 0000000..1df657a --- /dev/null +++ b/brand/illustrations-mobiles/sources/organisation-sombre.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/brand/illustrations-mobiles/sources/recherche-vide-clair.svg b/brand/illustrations-mobiles/sources/recherche-vide-clair.svg new file mode 100644 index 0000000..5315c67 --- /dev/null +++ b/brand/illustrations-mobiles/sources/recherche-vide-clair.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/brand/illustrations-mobiles/sources/recherche-vide-sombre.svg b/brand/illustrations-mobiles/sources/recherche-vide-sombre.svg new file mode 100644 index 0000000..24524ef --- /dev/null +++ b/brand/illustrations-mobiles/sources/recherche-vide-sombre.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/brand/illustrations-mobiles/sources/securite-clair.svg b/brand/illustrations-mobiles/sources/securite-clair.svg new file mode 100644 index 0000000..840c1b6 --- /dev/null +++ b/brand/illustrations-mobiles/sources/securite-clair.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/brand/illustrations-mobiles/sources/securite-sombre.svg b/brand/illustrations-mobiles/sources/securite-sombre.svg new file mode 100644 index 0000000..1baa60d --- /dev/null +++ b/brand/illustrations-mobiles/sources/securite-sombre.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/brand/illustrations-mobiles/sources/send-clair.svg b/brand/illustrations-mobiles/sources/send-clair.svg new file mode 100644 index 0000000..c18388a --- /dev/null +++ b/brand/illustrations-mobiles/sources/send-clair.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/brand/illustrations-mobiles/sources/send-sombre.svg b/brand/illustrations-mobiles/sources/send-sombre.svg new file mode 100644 index 0000000..d9a4134 --- /dev/null +++ b/brand/illustrations-mobiles/sources/send-sombre.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/brand/illustrations-mobiles/sources/succes-clair.svg b/brand/illustrations-mobiles/sources/succes-clair.svg new file mode 100644 index 0000000..bc46bb6 --- /dev/null +++ b/brand/illustrations-mobiles/sources/succes-clair.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/brand/illustrations-mobiles/sources/succes-sombre.svg b/brand/illustrations-mobiles/sources/succes-sombre.svg new file mode 100644 index 0000000..ac90a57 --- /dev/null +++ b/brand/illustrations-mobiles/sources/succes-sombre.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/brand/illustrations-mobiles/sources/synchro-navigateur-clair.svg b/brand/illustrations-mobiles/sources/synchro-navigateur-clair.svg new file mode 100644 index 0000000..7c4d271 --- /dev/null +++ b/brand/illustrations-mobiles/sources/synchro-navigateur-clair.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/brand/illustrations-mobiles/sources/synchro-navigateur-sombre.svg b/brand/illustrations-mobiles/sources/synchro-navigateur-sombre.svg new file mode 100644 index 0000000..caaf845 --- /dev/null +++ b/brand/illustrations-mobiles/sources/synchro-navigateur-sombre.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/brand/illustrations-mobiles/sources/uri-bloquee-clair.svg b/brand/illustrations-mobiles/sources/uri-bloquee-clair.svg new file mode 100644 index 0000000..a7b5af0 --- /dev/null +++ b/brand/illustrations-mobiles/sources/uri-bloquee-clair.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/brand/illustrations-mobiles/sources/uri-bloquee-sombre.svg b/brand/illustrations-mobiles/sources/uri-bloquee-sombre.svg new file mode 100644 index 0000000..a0a7d3d --- /dev/null +++ b/brand/illustrations-mobiles/sources/uri-bloquee-sombre.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/brand/illustrations-mobiles/sources/verrou-clair.svg b/brand/illustrations-mobiles/sources/verrou-clair.svg new file mode 100644 index 0000000..f5b8922 --- /dev/null +++ b/brand/illustrations-mobiles/sources/verrou-clair.svg @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/brand/illustrations-mobiles/sources/verrou-sombre.svg b/brand/illustrations-mobiles/sources/verrou-sombre.svg new file mode 100644 index 0000000..661a539 --- /dev/null +++ b/brand/illustrations-mobiles/sources/verrou-sombre.svg @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/brand/loksi-icon-16.svg b/brand/loksi-icon-16.svg new file mode 100644 index 0000000..3441721 --- /dev/null +++ b/brand/loksi-icon-16.svg @@ -0,0 +1 @@ + diff --git a/brand/loksi-icon.svg b/brand/loksi-icon.svg new file mode 100644 index 0000000..6447453 --- /dev/null +++ b/brand/loksi-icon.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/brand/package-lock.json b/brand/package-lock.json new file mode 100644 index 0000000..86889ea --- /dev/null +++ b/brand/package-lock.json @@ -0,0 +1,621 @@ +{ + "name": "loksi-brand", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "loksi-brand", + "devDependencies": { + "playwright": "1.60.0", + "sharp": "0.33.5" + } + }, + "node_modules/@emnapi/runtime": { + "version": "1.11.3", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.11.3.tgz", + "integrity": "sha512-Xz4Tpyki7XyrpbUK1jR1AhdAdaXyhhY4lZ3neLodmhpuWfy2PAQN5B46sAiU4liOXGLkHypn/qU+jvfWSCYYLA==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@img/sharp-darwin-arm64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.33.5.tgz", + "integrity": "sha512-UT4p+iz/2H4twwAoLCqfA9UH5pI6DggwKEGuaPy7nCVQ8ZsiY5PIcrRvD1DzuY3qYL07NtIQcWnBSY/heikIFQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-darwin-arm64": "1.0.4" + } + }, + "node_modules/@img/sharp-darwin-x64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.33.5.tgz", + "integrity": "sha512-fyHac4jIc1ANYGRDxtiqelIbdWkIuQaI84Mv45KvGRRxSAa7o7d1ZKAOBaYbnepLC1WqxfpimdeWfvqqSGwR2Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-darwin-x64": "1.0.4" + } + }, + "node_modules/@img/sharp-libvips-darwin-arm64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.0.4.tgz", + "integrity": "sha512-XblONe153h0O2zuFfTAbQYAX2JhYmDHeWikp1LM9Hul9gVPjFY427k6dFEcOL72O01QxQsWi761svJ/ev9xEDg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "darwin" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-darwin-x64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.0.4.tgz", + "integrity": "sha512-xnGR8YuZYfJGmWPvmlunFaWJsb9T/AO2ykoP3Fz/0X5XV2aoYBPkX6xqCQvUTKKiLddarLaxpzNe+b1hjeWHAQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "darwin" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-arm": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.0.5.tgz", + "integrity": "sha512-gvcC4ACAOPRNATg/ov8/MnbxFDJqf/pDePbBnuBDcjsI8PssmjoKMAz4LtLaVi+OnSb5FK/yIOamqDwGmXW32g==", + "cpu": [ + "arm" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-arm64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.0.4.tgz", + "integrity": "sha512-9B+taZ8DlyyqzZQnoeIvDVR/2F4EbMepXMc/NdVbkzsJbzkUjhXv/70GQJ7tdLA4YJgNP25zukcxpX2/SueNrA==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-s390x": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.0.4.tgz", + "integrity": "sha512-u7Wz6ntiSSgGSGcjZ55im6uvTrOxSIS8/dgoVMoiGE9I6JAfU50yH5BoDlYA1tcuGS7g/QNtetJnxA6QEsCVTA==", + "cpu": [ + "s390x" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-x64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.0.4.tgz", + "integrity": "sha512-MmWmQ3iPFZr0Iev+BAgVMb3ZyC4KeFc3jFxnNbEPas60e1cIfevbtuyf9nDGIzOaW9PdnDciJm+wFFaTlj5xYw==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linuxmusl-arm64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.0.4.tgz", + "integrity": "sha512-9Ti+BbTYDcsbp4wfYib8Ctm1ilkugkA/uscUn6UXK1ldpC1JjiXbLfFZtRlBhjPZ5o1NCLiDbg8fhUPKStHoTA==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linuxmusl-x64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.0.4.tgz", + "integrity": "sha512-viYN1KX9m+/hGkJtvYYp+CCLgnJXwiQB39damAO7WMdKWlIhmYTfHjwSbQeUK/20vY154mwezd9HflVFM1wVSw==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-linux-arm": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.33.5.tgz", + "integrity": "sha512-JTS1eldqZbJxjvKaAkxhZmBqPRGmxgu+qFKSInv8moZ2AmT5Yib3EQ1c6gp493HvrvV8QgdOXdyaIBrhvFhBMQ==", + "cpu": [ + "arm" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm": "1.0.5" + } + }, + "node_modules/@img/sharp-linux-arm64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.33.5.tgz", + "integrity": "sha512-JMVv+AMRyGOHtO1RFBiJy/MBsgz0x4AWrT6QoEVVTyh1E39TrCUpTRI7mx9VksGX4awWASxqCYLCV4wBZHAYxA==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm64": "1.0.4" + } + }, + "node_modules/@img/sharp-linux-s390x": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.33.5.tgz", + "integrity": "sha512-y/5PCd+mP4CA/sPDKl2961b+C9d+vPAveS33s6Z3zfASk2j5upL6fXVPZi7ztePZ5CuH+1kW8JtvxgbuXHRa4Q==", + "cpu": [ + "s390x" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-s390x": "1.0.4" + } + }, + "node_modules/@img/sharp-linux-x64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.33.5.tgz", + "integrity": "sha512-opC+Ok5pRNAzuvq1AG0ar+1owsu842/Ab+4qvU879ippJBHvyY5n2mxF1izXqkPYlGuP/M556uh53jRLJmzTWA==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-x64": "1.0.4" + } + }, + "node_modules/@img/sharp-linuxmusl-arm64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.33.5.tgz", + "integrity": "sha512-XrHMZwGQGvJg2V/oRSUfSAfjfPxO+4DkiRh6p2AFjLQztWUuY/o8Mq0eMQVIY7HJ1CDQUJlxGGZRw1a5bqmd1g==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-arm64": "1.0.4" + } + }, + "node_modules/@img/sharp-linuxmusl-x64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.33.5.tgz", + "integrity": "sha512-WT+d/cgqKkkKySYmqoZ8y3pxx7lx9vVejxW/W4DOFMYVSkErR+w7mf2u8m/y4+xHe7yY9DAXQMWQhpnMuFfScw==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-x64": "1.0.4" + } + }, + "node_modules/@img/sharp-wasm32": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.33.5.tgz", + "integrity": "sha512-ykUW4LVGaMcU9lu9thv85CbRMAwfeadCJHRsg2GmeRa/cJxsVY9Rbd57JcMxBkKHag5U/x7TSBpScF4U8ElVzg==", + "cpu": [ + "wasm32" + ], + "dev": true, + "license": "Apache-2.0 AND LGPL-3.0-or-later AND MIT", + "optional": true, + "dependencies": { + "@emnapi/runtime": "^1.2.0" + }, + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-ia32": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.33.5.tgz", + "integrity": "sha512-T36PblLaTwuVJ/zw/LaH0PdZkRz5rd3SmMHX8GSmR7vtNSP5Z6bQkExdSK7xGWyxLw4sUknBuugTelgw2faBbQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-x64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.33.5.tgz", + "integrity": "sha512-MpY/o8/8kj+EcnxwvrP4aTJSWw/aZ7JIGR4aBeZkZw5B7/Jn+tY9/VNwtcoGmdT7GfggGIU4kygOMSbYnOrAbg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/color": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/color/-/color-4.2.3.tgz", + "integrity": "sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1", + "color-string": "^1.9.0" + }, + "engines": { + "node": ">=12.5.0" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/color-string": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz", + "integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "^1.0.0", + "simple-swizzle": "^0.2.2" + } + }, + "node_modules/detect-libc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=8" + } + }, + "node_modules/fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/is-arrayish": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.4.tgz", + "integrity": "sha512-m6UrgzFVUYawGBh1dUsWR5M2Clqic9RVXC/9f8ceNlv2IcO9j9J/z8UoCLPqtsPBFNzEpfR3xftohbfqDx8EQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/playwright": { + "version": "1.60.0", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.60.0.tgz", + "integrity": "sha512-hheHdokM8cdqCb0lcE3s+zT4t4W+vvjpGxsZlDnikarzx8tSzMebh3UiFtgqwFwnTnjYQcsyMF8ei2mCO/tpeA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "playwright-core": "1.60.0" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "fsevents": "2.3.2" + } + }, + "node_modules/playwright-core": { + "version": "1.60.0", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.60.0.tgz", + "integrity": "sha512-9bW6zvX/m0lEbgTKJ6YppOKx8H3VOPBMOCFh2irXFOT4BbHgrx5hPjwJYLT40Lu+4qtD36qKc/Hn56StUW57IA==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "playwright-core": "cli.js" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/semver": { + "version": "7.8.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", + "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/sharp": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.33.5.tgz", + "integrity": "sha512-haPVm1EkS9pgvHrQ/F3Xy+hgcuMV0Wm9vfIBSiwZ05k+xgb0PkBQpGsAA/oWdDobNaZTH5ppvHtzCFbnSEwHVw==", + "dev": true, + "hasInstallScript": true, + "license": "Apache-2.0", + "dependencies": { + "color": "^4.2.3", + "detect-libc": "^2.0.3", + "semver": "^7.6.3" + }, + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-darwin-arm64": "0.33.5", + "@img/sharp-darwin-x64": "0.33.5", + "@img/sharp-libvips-darwin-arm64": "1.0.4", + "@img/sharp-libvips-darwin-x64": "1.0.4", + "@img/sharp-libvips-linux-arm": "1.0.5", + "@img/sharp-libvips-linux-arm64": "1.0.4", + "@img/sharp-libvips-linux-s390x": "1.0.4", + "@img/sharp-libvips-linux-x64": "1.0.4", + "@img/sharp-libvips-linuxmusl-arm64": "1.0.4", + "@img/sharp-libvips-linuxmusl-x64": "1.0.4", + "@img/sharp-linux-arm": "0.33.5", + "@img/sharp-linux-arm64": "0.33.5", + "@img/sharp-linux-s390x": "0.33.5", + "@img/sharp-linux-x64": "0.33.5", + "@img/sharp-linuxmusl-arm64": "0.33.5", + "@img/sharp-linuxmusl-x64": "0.33.5", + "@img/sharp-wasm32": "0.33.5", + "@img/sharp-win32-ia32": "0.33.5", + "@img/sharp-win32-x64": "0.33.5" + } + }, + "node_modules/simple-swizzle": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.4.tgz", + "integrity": "sha512-nAu1WFPQSMNr2Zn9PGSZK9AGn4t/y97lEm+MXTtUDwfP0ksAIX4nO+6ruD9Jwut4C49SB1Ws+fbXsm/yScWOHw==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-arrayish": "^0.3.1" + } + }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "dev": true, + "license": "0BSD", + "optional": true + } + } +} diff --git a/brand/package.json b/brand/package.json new file mode 100644 index 0000000..74aab37 --- /dev/null +++ b/brand/package.json @@ -0,0 +1,7 @@ +{ + "name": "loksi-brand", + "private": true, + "type": "module", + "scripts": { "logo": "node generate-logo.mjs" }, + "devDependencies": { "playwright": "1.60.0", "sharp": "0.33.5" } +} diff --git a/brand/sources/loksi-icon-16.svg b/brand/sources/loksi-icon-16.svg new file mode 100644 index 0000000..3441721 --- /dev/null +++ b/brand/sources/loksi-icon-16.svg @@ -0,0 +1 @@ + diff --git a/brand/sources/loksi-icon-mono-blanc.svg b/brand/sources/loksi-icon-mono-blanc.svg new file mode 100644 index 0000000..0d7b48d --- /dev/null +++ b/brand/sources/loksi-icon-mono-blanc.svg @@ -0,0 +1 @@ + diff --git a/brand/sources/loksi-icon-mono.svg b/brand/sources/loksi-icon-mono.svg new file mode 100644 index 0000000..3a7f61d --- /dev/null +++ b/brand/sources/loksi-icon-mono.svg @@ -0,0 +1 @@ + diff --git a/brand/sources/loksi-icon.svg b/brand/sources/loksi-icon.svg new file mode 100644 index 0000000..6447453 --- /dev/null +++ b/brand/sources/loksi-icon.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/brand/sources/loksi-logo-clair.svg b/brand/sources/loksi-logo-clair.svg new file mode 100644 index 0000000..58b872b --- /dev/null +++ b/brand/sources/loksi-logo-clair.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/brand/sources/loksi-logo-sombre.svg b/brand/sources/loksi-logo-sombre.svg new file mode 100644 index 0000000..e75c1bf --- /dev/null +++ b/brand/sources/loksi-logo-sombre.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/brand/sources/loksi-mot-inverse.svg b/brand/sources/loksi-mot-inverse.svg new file mode 100644 index 0000000..9be6df6 --- /dev/null +++ b/brand/sources/loksi-mot-inverse.svg @@ -0,0 +1 @@ + diff --git a/brand/sources/loksi-mot.svg b/brand/sources/loksi-mot.svg new file mode 100644 index 0000000..40dc537 --- /dev/null +++ b/brand/sources/loksi-mot.svg @@ -0,0 +1 @@ + diff --git a/mobile/.gitignore b/mobile/.gitignore new file mode 100644 index 0000000..dcaa62e --- /dev/null +++ b/mobile/.gitignore @@ -0,0 +1,6 @@ +.cache/ +dist/ +reports/ +*.keystore +*.jks +keystore.properties diff --git a/mobile/android/graphics.py b/mobile/android/graphics.py new file mode 100644 index 0000000..1686a8d --- /dev/null +++ b/mobile/android/graphics.py @@ -0,0 +1,385 @@ +#!/usr/bin/env python3 +"""Ressources vectorielles Loksi pour Android, GPL-3.0-only. + +Tout part des fichiers de la charte adoptée le 28/09/2026 : + - brand/loksi-icon.svg, l'icône sculptée ; + - brand/sources/loksi-logo-{clair,sombre}.svg, icône et mot déjà en tracés ; + - brand/sources/loksi-icon-mono.svg, pour la couche monochrome. + +Les SVG sont convertis en VectorDrawable par un convertisseur limité à ce que la +charte emploie : groupes translate et scale, rect arrondi, path, circle, dégradés +linéaires et radiaux. Tout autre élément ou attribut le fait échouer : c'est le +canari de structure. Les filtres (ombres floues) n'existent pas en VectorDrawable, +ils sont retirés et comptés. La géométrie des ombres dures (socle décalé, copie +foncée du symbole) reste. L'icône du lanceur, qui garde ses ombres, est en PNG par +densité, rendue par Chromium (render.mjs). +""" +import re +import xml.etree.ElementTree as ET +from pathlib import Path + +NAVY = "#003087" +SVG = "{http://www.w3.org/2000/svg}" +HEADER = ('xmlns:android="http://schemas.android.com/apk/res/android"\n' + ' xmlns:aapt="http://schemas.android.com/aapt"') +TRANSFORM = re.compile(r"(?:translate\(([-\d.]+)[ ,]+([-\d.]+)\))?\s*(?:scale\(([-\d.]+)(?:[ ,]+([-\d.]+))?\))?") +# Rotation autour d'un point, seule forme employée par les illustrations de la charte. +ROTATE = re.compile(r"rotate\(([-\d.]+)[ ,]+([-\d.]+)[ ,]+([-\d.]+)\)") +# Attributs admis par élément. Un attribut inconnu est un changement de la charte. +ALLOWED = { + "svg": {"viewBox", "role", "aria-label", "width", "height"}, + "g": {"transform", "fill", "filter"}, + "rect": {"x", "y", "width", "height", "rx", "fill", "stroke", "stroke-width", "filter", "mask"}, + "path": {"d", "fill", "fill-opacity", "fill-rule", "stroke", "stroke-width", "stroke-opacity", "stroke-linecap", + "stroke-linejoin", "transform"}, + "circle": {"cx", "cy", "r", "fill"}, +} + + +def number(value): + value = float(value) + return f"{0.0 if abs(value) < 5e-5 else value:.4f}".rstrip("0").rstrip(".") + + +def argb(color, opacity=1.0): + color = color.strip().upper() + if not re.fullmatch(r"#[0-9A-F]{3}|#[0-9A-F]{6}", color): + raise RuntimeError(f"Couleur SVG non prise en charge : {color}") + if len(color) == 4: + color = "#" + "".join(c * 2 for c in color[1:]) + return "#%02X%s" % (round(float(opacity) * 255), color[1:]) + + +def percent(value, default): + value = default if value is None else value + return float(value[:-1]) / 100 if value.endswith("%") else float(value) + + +def path_bounds(d): + from fontTools.pens.boundsPen import BoundsPen + from fontTools.svgLib.path import parse_path + pen = BoundsPen(None) + parse_path(d, pen) + return pen.bounds + + +class Converter: + def __init__(self, svg_text, white=False): + self.root = ET.fromstring(svg_text) + self.white = white + self.dropped_filters = 0 + self.gradients = {} + for tag in ("linearGradient", "radialGradient"): + for node in self.root.iter(SVG + tag): + stops = [(float(s.get("offset", "0")), argb(s.get("stop-color"), s.get("stop-opacity", "1"))) + for s in node.findall(SVG + "stop")] + self.gradients[node.get("id")] = (tag, node.attrib, stops) + + def paint(self, attribute, value, bounds): + """Couleur ou dégradé VectorDrawable pour fillColor ou strokeColor.""" + if value.startswith("url(#"): + if self.white: + return f'android:{attribute}="#FFFFFFFF"', "" + tag, attrib, stops = self.gradients[value[5:-1]] + x0, y0, x1, y1 = bounds + w, h = x1 - x0, y1 - y0 + if attrib.get("gradientUnits") == "userSpaceOnUse": + # Coordonnées absolues dans le repère de la forme, comme en VectorDrawable. + if tag != "linearGradient": + raise RuntimeError("Dégradé radial en userSpaceOnUse non pris en charge") + geometry = " ".join(f'android:{a}="{number(attrib[k])}"' for a, k in + (("startX", "x1"), ("startY", "y1"), ("endX", "x2"), ("endY", "y2"))) + items = "".join(f'\n ' + for o, c in stops) + return "", (f'\n \n' + f' {items}\n \n' + f' ') + elif attrib.get("gradientUnits") not in (None, "objectBoundingBox"): + raise RuntimeError(f"gradientUnits non pris en charge : {attrib.get('gradientUnits')}") + if tag == "linearGradient": + geometry = (f'android:type="linear" android:startX="{number(x0 + w * percent(attrib.get("x1"), "0%"))}" ' + f'android:startY="{number(y0 + h * percent(attrib.get("y1"), "0%"))}" ' + f'android:endX="{number(x0 + w * percent(attrib.get("x2"), "100%"))}" ' + f'android:endY="{number(y0 + h * percent(attrib.get("y2"), "0%"))}"') + else: + if "fx" in attrib or "fy" in attrib or abs(w - h) > 0.01: + raise RuntimeError("Dégradé radial non pris en charge (foyer ou boîte non carrée)") + geometry = (f'android:type="radial" android:centerX="{number(x0 + w * percent(attrib.get("cx"), "50%"))}" ' + f'android:centerY="{number(y0 + h * percent(attrib.get("cy"), "50%"))}" ' + f'android:gradientRadius="{number(w * percent(attrib.get("r"), "50%"))}"') + items = "".join(f'\n ' for o, c in stops) + return "", (f'\n \n' + f' {items}\n \n ') + return f'android:{attribute}="{"#FFFFFFFF" if self.white else argb(value)}"', "" + + def group(self, transform, children): + if not transform: + return children + rotation = ROTATE.fullmatch(transform.strip()) + if rotation: + angle, px, py = rotation.groups() + return ([f''] + + [" " + line for line in children] + [""]) + match = TRANSFORM.fullmatch(transform.strip()) + if not match: + raise RuntimeError(f"Transformation SVG non prise en charge : {transform}") + tx, ty, sx, sy = match.groups() + attributes = [] + if tx is not None: + attributes += [f'android:translateX="{number(tx)}"', f'android:translateY="{number(ty)}"'] + if sx is not None: + attributes += [f'android:scaleX="{number(sx)}"', f'android:scaleY="{number(sy if sy is not None else sx)}"'] + return [f''] + [" " + line for line in children] + [""] + + def shape(self, d, bounds, attrib, fill): + attributes, inner = [], "" + if fill != "none": + a, i = self.paint("fillColor", fill, bounds) + attributes.append(a) + inner += i + if "fill-opacity" in attrib: + attributes.append(f'android:fillAlpha="{number(attrib["fill-opacity"])}"') + if "fill-rule" in attrib: + if attrib["fill-rule"] != "evenodd": + raise RuntimeError(f"fill-rule non pris en charge : {attrib['fill-rule']}") + attributes.append('android:fillType="evenOdd"') + stroke = attrib.get("stroke") + if stroke and stroke != "none": + a, i = self.paint("strokeColor", stroke, bounds) + attributes.append(a) + inner += i + attributes.append(f'android:strokeWidth="{number(attrib.get("stroke-width", "1"))}"') + if "stroke-opacity" in attrib: + attributes.append(f'android:strokeAlpha="{number(attrib["stroke-opacity"])}"') + if "stroke-linecap" in attrib: + attributes.append(f'android:strokeLineCap="{attrib["stroke-linecap"]}"') + if "stroke-linejoin" in attrib: + attributes.append(f'android:strokeLineJoin="{attrib["stroke-linejoin"]}"') + attributes = " ".join(a for a in attributes if a) + if inner: + return [f'{inner}\n '] + return [f''] + + def walk(self, node, fill): + tag = node.tag.replace(SVG, "") + if tag == "defs": + return [] + if tag not in ALLOWED: + raise RuntimeError(f"Élément SVG non pris en charge : {tag}") + unknown = set(node.attrib) - ALLOWED[tag] + if unknown or "mask" in node.attrib: + raise RuntimeError(f"Attributs SVG non pris en charge sur {tag} : {sorted(unknown) or ['mask']}") + if "filter" in node.attrib: + self.dropped_filters += 1 + fill = node.get("fill", fill) + if tag in ("svg", "g"): + children = [line for child in node for line in self.walk(child, fill)] + return self.group(node.get("transform"), children) + if tag == "rect": + x, y = float(node.get("x", 0)), float(node.get("y", 0)) + w, h, r = float(node.get("width")), float(node.get("height")), float(node.get("rx", 0)) + d = (f"M{number(x + r)},{number(y)}H{number(x + w - r)}A{number(r)},{number(r)} 0 0 1 {number(x + w)},{number(y + r)}" + f"V{number(y + h - r)}A{number(r)},{number(r)} 0 0 1 {number(x + w - r)},{number(y + h)}" + f"H{number(x + r)}A{number(r)},{number(r)} 0 0 1 {number(x)},{number(y + h - r)}" + f"V{number(y + r)}A{number(r)},{number(r)} 0 0 1 {number(x + r)},{number(y)}Z") + return self.shape(d, (x, y, x + w, y + h), node.attrib, fill) + if tag == "circle": + cx, cy, r = (float(node.get(k)) for k in ("cx", "cy", "r")) + d = (f"M{number(cx - r)},{number(cy)}A{number(r)},{number(r)} 0 1 0 {number(cx + r)},{number(cy)}" + f"A{number(r)},{number(r)} 0 1 0 {number(cx - r)},{number(cy)}Z") + return self.shape(d, (cx - r, cy - r, cx + r, cy + r), node.attrib, fill) + d = node.get("d") + return self.group(node.get("transform"), self.shape(d, path_bounds(d), node.attrib, fill)) + + def vector(self, width_dp, height_dp, viewbox=None, subtree=None): + """VectorDrawable du SVG entier, ou du seul sous-arbre dont le transform est donné, + ancêtres compris. viewbox (x, y, largeur, hauteur) remplace celui du SVG.""" + if viewbox is None: + viewbox = tuple(float(v) for v in self.root.get("viewBox").split()) + if subtree is not None: + parents = {child: parent for parent in self.root.iter() for child in parent} + found = [n for n in self.root.iter() if n.get("transform") == subtree] + if len(found) != 1: + raise RuntimeError(f"Sous-arbre « {subtree} » : {len(found)} trouvés, 1 attendu") + keep, node = found[0], found[0] + while node is not self.root: + node = parents[node] + for sibling in list(node): + if sibling is not keep and sibling.tag != SVG + "defs": + node.remove(sibling) + keep = node + body = self.walk(self.root, "#000") + if not body: + raise RuntimeError("SVG vide après conversion") + x, y, w, h = viewbox + lines = "\n ".join(body) + return (f'\n' + f' \n' + f' {lines}\n \n\n') + + +# Carré de l'icône dans le repère de brand/loksi-icon.svg : translate(7 2) scale(.86). +SQUARE = (7.0, 2.0, 86.0) +SYMBOL = "translate(3 0) scale(.94)" + + +def adaptive(square): + """Repère 108 dp d'une icône adaptative : le carré occupe les 72 dp visibles du centre.""" + x, y, side = square + return (x - side / 4, y - side / 4, side * 1.5, side * 1.5) + + +def monochrome(mono_text): + """Couche monochrome : le symbole seul, pris dans le masque de loksi-icon-mono.svg, + en blanc plein. Le système pose son fond et teinte la couche.""" + root = ET.fromstring(mono_text) + masks = root.findall(f".//{SVG}mask") + if len(masks) != 1: + raise RuntimeError("loksi-icon-mono.svg : un masque attendu") + groups = masks[0].findall(SVG + "g") + if len(groups) != 1 or len(list(groups[0])) != 3: + raise RuntimeError("loksi-icon-mono.svg : le masque doit porter un groupe de 3 tracés") + ET.register_namespace("", SVG[1:-1]) + symbol = ET.tostring(groups[0], encoding="unicode") + svg = f'{symbol}' + return Converter(svg, white=True).vector(108, 108, viewbox=adaptive((0.0, 0.0, 100.0))) + + +def write_all(src, brand): + """Écrit les ressources vectorielles. Chaque cible existe déjà en amont, sauf le logo sombre.""" + brand = Path(brand) + icon = (brand / "loksi-icon.svg").read_text() + written, dropped = [], 0 + + def put(relative, content, must_exist=True): + path = src / relative + if must_exist and not path.is_file(): + raise RuntimeError(f"Ressource amont absente : {relative}") + path.parent.mkdir(parents=True, exist_ok=True) + path.write_text(content) + written.append(relative) + + def convert(svg_text, *args, **kwargs): + nonlocal dropped + converter = Converter(svg_text) + result = converter.vector(*args, **kwargs) + dropped += converter.dropped_filters + return result + + mono = monochrome((brand / "sources/loksi-icon-mono.svg").read_text()) + for variant in ("main", "beta", "release"): + # Premier plan du lanceur : PNG par densité (render.mjs), enveloppé ici. + put(f"app/src/{variant}/res/drawable/ic_launcher_foreground.xml", + '\n' + '\n' + '\n') + put(f"app/src/{variant}/res/drawable/ic_launcher_monochrome.xml", mono) + # Écran de démarrage : le symbole seul sur le fond navy, repère de l'icône adaptative. + put("ui/src/main/res/drawable/logo_shield_icon.xml", + convert(icon, 108, 108, viewbox=adaptive(SQUARE), subtree=SYMBOL)) + # Remplissage automatique et échange d'identifiants : le carré, sans marge d'ombre. + put("ui/src/main/res/drawable/logo_bitwarden_icon.xml", + convert(icon, 64, 64, viewbox=(SQUARE[0], SQUARE[1], SQUARE[2], SQUARE[2]))) + # Logo complet : 44 dp de haut comme sur iOS, cadre de la charte (marges d'ombre comprises). + for variant, relative, must_exist in (("clair", "drawable", True), ("sombre", "drawable-night", False)): + svg_text = (brand / f"sources/loksi-logo-{variant}.svg").read_text() + _, _, w, h = (float(v) for v in re.search(r'viewBox="([^"]+)"', svg_text).group(1).split()) + put(f"ui/src/main/res/{relative}/logo_bitwarden.xml", convert(svg_text, round(44 * w / h), 44), must_exist) + background = src / "app/src/main/res/values/ic_launcher_background.xml" + value = background.read_text() + if value.count("#FF175DDC") != 1: + raise RuntimeError("Couleur de fond d'icône amont modifiée") + background.write_text(value.replace("#FF175DDC", "#FF" + NAVY[1:])) + written.append("app/src/main/res/values/ic_launcher_background.xml") + # Canari : icône et deux logos portent chacun deux filtres (socle et symbole) ; le + # symbole seul en porte un. Un autre compte veut dire que la charte a changé. + if dropped != 7: + raise RuntimeError(f"Filtres retirés : {dropped}, 7 attendus") + return written + + +# Illustrations de la charte (brand/illustrations-mobiles/, style validé par Romain le +# 29/09/2026). Chaque ill_* amont est remplacé sous le même nom par le maître clair, et un +# ill_* du même nom dans drawable-night reçoit le maître sombre : l'amont n'a qu'une +# variante, recolorée par des chemins nommés, les maîtres Loksi ont leurs couleurs en dur. +# La correspondance vient de brand/illustrations-mobiles/correspondance.mjs, colonne Android. +# Hors jeu : Premium (ill_celebration) et ill_vault, que le code amont n'affiche pas. +OUT_OF_SET = {"ill_celebration", "ill_vault"} + + +def android_set(brand): + """{drawable amont: maître Loksi}, lu dans la colonne Android de correspondance.mjs.""" + text = (Path(brand) / "illustrations-mobiles/correspondance.mjs").read_text() + quoted = r"'((?:[^'\\]|\\.)*)'" + rows = re.findall(r"\[\s*" + r",\s*".join([quoted] * 5) + r"\s*\]", text) + if len(rows) < 20: + raise RuntimeError(f"correspondance.mjs illisible : {len(rows)} lignes") + mapping = {} + for name, _, _, android, _ in rows: + for drawable in re.findall(r"ill_\w+", android): + if drawable in mapping: + raise RuntimeError(f"{drawable} attribué deux fois dans correspondance.mjs") + mapping[drawable] = name + return mapping + + +def write_illustrations(src, brand): + brand = Path(brand) + res = src / "ui/src/main/res" + upstream = {p.stem for p in (res / "drawable").glob("ill_*.xml")} + mapping = android_set(brand) + # Toute illustration amont est remplacée ou écartée exprès ; toute cible existe en amont. + if set(mapping) | OUT_OF_SET != upstream or set(mapping) & OUT_OF_SET: + raise RuntimeError(f"Illustrations amont non couvertes : {sorted(upstream - set(mapping) - OUT_OF_SET)}, " + f"absentes de l'amont : {sorted(set(mapping) - upstream)}") + written, evenodd = [], 0 + for drawable, name in sorted(mapping.items()): + size = float(re.search(r'android:width="([\d.]+)dp"', (res / f"drawable/{drawable}.xml").read_text()).group(1)) + for variant, folder in (("clair", "drawable"), ("sombre", "drawable-night")): + svg_text = (brand / f"illustrations-mobiles/sources/{name}-{variant}.svg").read_text() + converter = Converter(svg_text) + vector = converter.vector(size, size) + if converter.dropped_filters: + raise RuntimeError(f"{name}-{variant}.svg : filtre dans un maître d'illustration") + if vector.count('android:fillType="evenOdd"') != svg_text.count('fill-rule="evenodd"'): + raise RuntimeError(f"{name}-{variant}.svg : évidement perdu à la conversion") + evenodd += svg_text.count('fill-rule="evenodd"') + (res / folder).mkdir(exist_ok=True) + (res / folder / f"{drawable}.xml").write_text(vector) + written.append(f"{folder}/{drawable}.xml") + return written, evenodd + + +# Barre d'onglets : pictogrammes de la charte (brand/illustrations-mobiles/onglets/). Actif : +# formes pleines aux couleurs de la charte, clair dans drawable, sombre dans drawable-night, +# affichées sans teinte par l'amont (icônes multitons). Inactif : au trait, teinté par le +# thème (icon.primary), la variante claire suffit. +TABS = {"vault": "ic_vault", "generator": "ic_generator", "send": "ic_send", "settings": "ic_settings"} + + +def write_tab_icons(src, brand): + res = src / "ui/src/main/res" + sources = Path(brand) / "illustrations-mobiles/onglets" + written, evenodd = [], 0 + for tab, drawable in TABS.items(): + for state, name, variants in (("idle", drawable, (("light", "drawable"),)), + ("active", drawable + "_filled", (("light", "drawable"), ("dark", "drawable-night")))): + if not (res / f"drawable/{name}.xml").is_file(): + raise RuntimeError(f"Pictogramme amont absent : {name}") + for theme, folder in variants: + svg_text = (sources / f"{tab}-{state}-{theme}.svg").read_text() + vector = Converter(svg_text).vector(24, 24) + if vector.count('android:fillType="evenOdd"') != svg_text.count('fill-rule="evenodd"'): + raise RuntimeError(f"{tab}-{state}-{theme}.svg : évidement perdu à la conversion") + evenodd += svg_text.count('fill-rule="evenodd"') + (res / folder / f"{name}.xml").write_text(vector) + written.append(f"{folder}/{name}.xml") + if len(written) != 12: + raise RuntimeError(f"12 pictogrammes attendus, {len(written)}") + # Canari : la roue et le coffre ont des évidements (fill-rule evenodd). Sans aucun, + # le contrôle de conversion ci-dessus ne prouve rien. + if not evenodd: + raise RuntimeError("Canari muet : aucun évidement dans les pictogrammes") + return written, evenodd diff --git a/mobile/android/kotlin/LoksiVault.kt b/mobile/android/kotlin/LoksiVault.kt new file mode 100644 index 0000000..fe49f28 --- /dev/null +++ b/mobile/android/kotlin/LoksiVault.kt @@ -0,0 +1,86 @@ +// GPL-3.0-only. Loksi: vault name or address entered at login (decision of 04/10/2026). +// Copied by mobile/android/loksi.py next to EnvironmentUrlDataJsonExtensions.kt. Same rule +// as the Loksi browser extension (extensions/loksi-coffre.ts). +package com.bitwarden.data.repository.util + +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.withContext +import kotlinx.serialization.json.Json +import kotlinx.serialization.json.jsonObject +import kotlinx.serialization.json.jsonPrimitive +import java.net.HttpURLConnection +import java.net.URI +import java.net.URL + +/** + * Loksi: domain of the Loksi vaults. The vault name "abc" gives https://abc.loksi.fr. + */ +const val LOKSI_DOMAIN: String = "loksi.fr" + +// The name chosen in the order funnel: same pattern as the order backend (_NOM), 2 to 20 +// lowercase letters or digits, a hyphen allowed but neither first nor last. Never +// interpolated as typed: it matches this pattern or it is refused. +private val LOKSI_VAULT_NAME = Regex("^[a-z0-9](?:[a-z0-9-]{0,18}[a-z0-9])$") + +private const val LOKSI_TIMEOUT_MS: Int = 10_000 + +/** + * Loksi: base address of the vault for what was typed, or null if it is refused. + * A vault name gives https://.loksi.fr. Otherwise a full https address without + * credentials, query or fragment, for a customer with their own domain. + */ +fun loksiVaultAddress(input: String?): String? { + val value = input.orEmpty().trim() + if (LOKSI_VAULT_NAME.matches(value)) { + return "https://$value.$LOKSI_DOMAIN" + } + if (!value.startsWith("https://")) { + return null + } + val uri = try { + URI(value) + } catch (_: Exception) { + return null + } + if (uri.scheme != "https" || uri.host.isNullOrEmpty() || uri.rawUserInfo != null || + uri.rawQuery != null || uri.rawFragment != null + ) { + return null + } + val port = if (uri.port == -1) "" else ":${uri.port}" + return "https://${uri.host}$port${uri.rawPath.orEmpty()}".trimEnd('/') +} + +/** + * Loksi: true only if a Vaultwarden server answers on /api/config at [base]. + * [fetch] returns the body of a successful GET, or null. + */ +suspend fun isLoksiVault( + base: String, + fetch: suspend (String) -> String? = ::loksiGet, +): Boolean = + try { + val body = fetch("$base/api/config") + body != null && + Json.parseToJsonElement(body).jsonObject["server"] + ?.jsonObject?.get("name")?.jsonPrimitive?.content == "Vaultwarden" + } catch (_: Exception) { + false + } + +private suspend fun loksiGet(url: String): String? = withContext(Dispatchers.IO) { + val connection = URL(url).openConnection() as HttpURLConnection + try { + connection.connectTimeout = LOKSI_TIMEOUT_MS + connection.readTimeout = LOKSI_TIMEOUT_MS + connection.instanceFollowRedirects = false + connection.setRequestProperty("Accept", "application/json") + if (connection.responseCode == HttpURLConnection.HTTP_OK) { + connection.inputStream.bufferedReader().use { it.readText() } + } else { + null + } + } finally { + connection.disconnect() + } +} diff --git a/mobile/android/kotlin/LoksiVaultTest.kt b/mobile/android/kotlin/LoksiVaultTest.kt new file mode 100644 index 0000000..423146f --- /dev/null +++ b/mobile/android/kotlin/LoksiVaultTest.kt @@ -0,0 +1,93 @@ +// GPL-3.0-only. Loksi: vault name or address, then /api/config. *.loksi.fr does not exist +// yet: the answers come from local servers, as for the browser extension. +package com.bitwarden.data.repository.util + +import com.sun.net.httpserver.HttpServer +import kotlinx.coroutines.runBlocking +import org.junit.jupiter.api.Assertions.assertEquals +import org.junit.jupiter.api.Assertions.assertFalse +import org.junit.jupiter.api.Assertions.assertNull +import org.junit.jupiter.api.Assertions.assertTrue +import org.junit.jupiter.api.Test +import java.net.InetSocketAddress + +class LoksiVaultTest { + @Test + fun `a vault name gives its loksi fr vault`() { + assertEquals("https://abc.loksi.fr", loksiVaultAddress("abc")) + assertEquals("https://aleop.loksi.fr", loksiVaultAddress(" aleop ")) + assertEquals("https://ab12cd34ef56.loksi.fr", loksiVaultAddress("ab12cd34ef56")) + assertEquals("https://mon-entreprise.loksi.fr", loksiVaultAddress("mon-entreprise")) + assertEquals("https://${"a".repeat(20)}.loksi.fr", loksiVaultAddress("a".repeat(20))) + } + + @Test + fun `a full https address is still accepted`() { + assertEquals("https://coffre.client.example", loksiVaultAddress("https://coffre.client.example/")) + assertEquals("https://loksi.aleop.eu", loksiVaultAddress("https://loksi.aleop.eu")) + assertEquals("https://x.example:8443/coffre", loksiVaultAddress("https://x.example:8443/coffre/")) + } + + @Test + fun `canaries are refused`() { + listOf( + "abc.evil.test", "ABC/../x", "http://abc.loksi.fr", "a", "a".repeat(21), "ABC", + "-abc", "abc-", "ab_c", "ab c", "é-corp", "https://user:pw@x.example", + "https://x.example/?q=1", "https://x.example/#a", "javascript:alert(1)", "", + " ", "https://", null, + ).forEach { refused -> + assertNull(loksiVaultAddress(refused), "accepted: $refused") + } + } + + private fun server(body: String?): HttpServer = + HttpServer.create(InetSocketAddress("127.0.0.1", 0), 0).apply { + createContext("/") { exchange -> + val answer = body?.takeIf { exchange.requestURI.path == "/api/config" } + if (answer == null) { + exchange.sendResponseHeaders(404, -1) + } else { + val bytes = answer.toByteArray() + exchange.responseHeaders.add("Content-Type", "application/json") + exchange.sendResponseHeaders(200, bytes.size.toLong()) + exchange.responseBody.use { it.write(bytes) } + } + exchange.close() + } + start() + } + + private fun withServer(body: String?, block: suspend (String) -> T): T { + val running = server(body) + return try { + runBlocking { block("http://127.0.0.1:${running.address.port}") } + } finally { + running.stop(0) + } + } + + @Test + fun `a local Vaultwarden is recognised as a vault`() { + assertTrue(withServer("""{"version":"2026.6.0","server":{"name":"Vaultwarden"}}""") { isLoksiVault(it) }) + } + + @Test + fun `canary, another server answering JSON is refused`() { + assertFalse(withServer("""{"version":"2026.6.0","server":{"name":"Bitwarden"}}""") { isLoksiVault(it) }) + } + + @Test + fun `canary, a page without api config is refused`() { + assertFalse(withServer(null) { isLoksiVault(it) }) + } + + @Test + fun `canary, a body that is not JSON is refused`() { + assertFalse(withServer("Vaultwarden") { isLoksiVault(it) }) + } + + @Test + fun `canary, an address that does not resolve is refused`() { + assertFalse(runBlocking { isLoksiVault("https://coffre-a-renseigner.invalid") }) + } +} diff --git a/mobile/android/loksi.py b/mobile/android/loksi.py new file mode 100644 index 0000000..c798c25 --- /dev/null +++ b/mobile/android/loksi.py @@ -0,0 +1,1645 @@ +#!/usr/bin/env python3 +"""Application Android Loksi, adaptée de bitwarden/android. GPL-3.0-only. + +Sources amont épinglées dans ../upstream.json. Aucune modification du SDK, de la +cryptographie ni des flux d'authentification : seulement identité, choix du serveur, +écrans d'accueil, liens, ressources et signature. + +Usage, depuis n'importe où : + loksi.py fetch archives amont et sources du SDK, empreintes vérifiées + loksi.py sdk SDK Android recompilé depuis sdk-internal, publié dans ~/.m2 + loksi.py keys clé de signature debug Loksi, générée en aveugle hors de Git + loksi.py prepare sources Android réextraites puis adaptées + loksi.py build APK fdroid debug signé Loksi, copié dans ../dist/android + loksi.py verify contrôles de l'APK produit, avec canaris + loksi.py upload-key clé d'envoi Google Play, générée en aveugle hors de Git + loksi.py release AAB fdroid release (Play) et APK release d'essai, signés par la clé d'envoi + loksi.py tests tests unitaires app liés à l'adaptation, échecs attendus listés + loksi.py install nouvelle installation (données effacées) sur l'AVD loksi-api36, lancée +""" +import hashlib +import importlib.util +import json +import os +import re +import secrets +import shutil +import subprocess +import sys +import tarfile +import zipfile +from pathlib import Path + +HERE = Path(__file__).resolve().parent +MOBILE = HERE.parent +REPO = MOBILE.parent +CACHE = MOBILE / ".cache" +DIST = MOBILE / "dist" / "android" +REPORTS = MOBILE / "reports" +UPSTREAM = json.loads((MOBILE / "upstream.json").read_text()) +CONFIG = UPSTREAM["android"] +# Version de Bitwarden adaptée, affichée dans À propos (« Basé sur Bitwarden 2026.9.0 »). +UPSTREAM_VERSION = re.fullmatch(r"v(\d+\.\d+\.\d+)-bwpm", CONFIG["tag"]).group(1) +SERVER = UPSTREAM["server"] +SRC = CACHE / "android-src" +SDK_SRC = CACHE / "sdk-internal-android" +KEYS = Path(os.environ.get("LOKSI_ANDROID_KEYS", Path.home() / ".config/loksi/android")) +ANDROID_HOME = Path(os.environ.get("ANDROID_HOME", Path.home() / "Library/Android/sdk")) +APPLICATION_ID = CONFIG["application_id"] +DEBUG_ID = APPLICATION_ID + ".dev" +COMMERCIAL = re.compile(r"bitwarden-commercial|bitwarden-pam|bitwarden-sm|commercial-marker") +AVD = "loksi-api36" + +# Textes et marqueur communs aux deux applis : ios/loksi.py fait foi (décisions de Romain +# du 29/09/2026), l'Android les reprend tels quels. +_spec = importlib.util.spec_from_file_location("loksi_ios", MOBILE / "ios/loksi.py") +IOS = importlib.util.module_from_spec(_spec) +_spec.loader.exec_module(IOS) +# Pas de serveur par défaut : loksi.aleop.eu est le coffre d'Aleop, pas celui des clients. +# Tant que rien n'est saisi, l'app vise ce marqueur .invalid, jamais résolu (RFC 6761). +UNSET_SERVER = IOS.UNSET_SERVER + +# Chaînes où « Bitwarden » reste. Relevé du 29/09/2026 sur l'APK : aucune n'est affichée +# par l'app Loksi. Le centre d'aide, son invitation et le renvoi de l'enregistreur de vols +# sont passés en Loksi avec les pages d'aide du site. L'invitation aux courriels de Bitwarden +# est sur l'écran d'inscription, que Loksi n'atteint plus. Toutes les autres servent à +# l'app Authenticator ou aux formats d'import, jamais affichées ici. Le reste désigne +# l'application ou le coffre et passe en Loksi, dont le serveur non reconnu, l'app web de +# l'abonnement, l'export vers une autre app et les applications de confiance des passkeys. +KEEP_STRINGS = { + # Écran d'inscription, inaccessible dans Loksi. + "get_emails_from_bitwarden_for_announcements_advices_and_research_opportunities_unsubscribe_any_time", + # Jamais référencées par l'app : Authenticator, formats d'import, carte de téléchargement. + "bitwarden_authenticator", "import_format_label_bitwarden_json", "import_bitwarden_unsupported_format", + "go_to_bitwarden_com_download_to_integrate_bitwarden_into_browser", + "learn_more_about_using_passkeys_with_bitwarden", "secure_your_accounts_with_bitwarden_authenticator", + "learn_more_about_how_to_use_bitwarden_authenticator_on_the_help_center", "data_backup_message", + "download_bitwarden_card_title", "sync_with_bitwarden_app", "shared_codes_error", "sync_with_the_bitwarden_app", + "copy_to_bitwarden_vault", "save_to_bitwarden", "choose_save_location_message", "account_synced_from_bitwarden_app", +} + + +def run(command, **kwargs): + print("+", " ".join(str(c) for c in command), flush=True) + return subprocess.run([str(c) for c in command], check=True, **kwargs) + + +def sha256(path): + digest = hashlib.sha256() + with open(path, "rb") as handle: + for block in iter(lambda: handle.read(1 << 20), b""): + digest.update(block) + return digest.hexdigest() + + +def replace_once(path, old, new, count=1): + value = path.read_text() + if value.count(old) != count: + raise RuntimeError(f"Point d'adaptation amont modifié : {path.relative_to(SRC)} " + f"({value.count(old)} au lieu de {count})") + path.write_text(value.replace(old, new)) + + +def java_home(): + home = subprocess.run(["/usr/libexec/java_home", "-v", CONFIG["toolchain"]["jdk"]], + capture_output=True, text=True, check=True).stdout.strip() + # java_home -v retombe en silence sur une autre version si la bonne manque : + # on lit la version réelle. Vérifié le 28/09/2026, -v 17 rend un JDK 26. + version = subprocess.run([home + "/bin/java", "-version"], capture_output=True, text=True).stderr + if f'version "{CONFIG["toolchain"]["jdk"]}.' not in version: + raise RuntimeError(f"JDK {CONFIG['toolchain']['jdk']} introuvable, java_home rend : {home}") + return home + + +def tool_env(): + rustup = "/opt/homebrew/opt/rustup/bin" + env = dict(os.environ, JAVA_HOME=java_home(), ANDROID_HOME=str(ANDROID_HOME), + ANDROID_NDK_HOME=str(ANDROID_HOME / "ndk" / CONFIG["toolchain"]["ndk"]), + LOKSI_ANDROID_KEYS=str(KEYS), + PATH=os.pathsep.join([rustup, str(Path.home() / ".cargo/bin"), os.environ["PATH"]])) + env.pop("GITHUB_TOKEN", None) + return env + + +def fetch(): + CACHE.mkdir(exist_ok=True) + archive = CACHE / "android.tar.gz" + if not archive.exists(): + run(["curl", "-fsSL", "-o", archive, CONFIG["archive_url"]]) + if sha256(archive) != CONFIG["archive_sha256"]: + raise RuntimeError("Archive Android amont incorrecte : SHA-256 différent") + for key, name in (("url", "Raleway-wght.ttf"), ("italic_url", "Raleway-Italic-wght.ttf")): + font = CACHE / name + if not font.exists(): + run(["curl", "-fsSL", "-o", font, UPSTREAM["font"][key]]) + if sha256(font) != UPSTREAM["font"][key.replace("url", "sha256")]: + raise RuntimeError(f"{name} incorrecte : SHA-256 différent") + sdk = CONFIG["sdk"] + if not SDK_SRC.exists(): + # Clone git au commit exact, sur une branche main : la publication amont lit + # la branche pour nommer l'artefact (sdk-android sur main, sdk-android.dev + # ailleurs) et git rev-parse HEAD pour sa description. + SDK_SRC.mkdir() + run(["git", "init", "-q"], cwd=SDK_SRC) + run(["git", "fetch", "-q", "--depth", "1", sdk["source_repository"], sdk["source_commit"]], cwd=SDK_SRC) + run(["git", "checkout", "-q", "-B", "main", "FETCH_HEAD"], cwd=SDK_SRC) + head = subprocess.run(["git", "rev-parse", "HEAD"], cwd=SDK_SRC, capture_output=True, text=True).stdout.strip() + if head != sdk["source_commit"]: + raise RuntimeError(f"sdk-internal au mauvais commit : {head}") + dirty = subprocess.run(["git", "status", "--porcelain", "--untracked-files=no"], cwd=SDK_SRC, + capture_output=True, text=True).stdout + if dirty.strip(): + raise RuntimeError("sdk-internal modifié localement :\n" + dirty) + print(f"Sources vérifiées : android {CONFIG['tag']}, sdk-internal {head}") + + +def sdk_tree(env, features=()): + command = ["rustup", "run", CONFIG["sdk"]["rust_toolchain"], "cargo", "tree", "-p", "bitwarden-uniffi", + "--target", "aarch64-linux-android", "-e", "normal", "--prefix", "none"] + for feature in features: + command += ["-F", feature] + output = subprocess.run(command, cwd=SDK_SRC, env=env, capture_output=True, text=True, check=True).stdout + return sorted(set(output.splitlines())) + + +def sdk(): + fetch() + env = tool_env() + tree = sdk_tree(env) + if any(COMMERCIAL.search(line) for line in tree): + raise RuntimeError("Crate sous licence Bitwarden dans le graphe du SDK") + # Canari : la même commande, fonctionnalité commerciale forcée, DOIT en trouver. + if not any(COMMERCIAL.search(line) for line in sdk_tree(env, ["bitwarden-pm/bitwarden-license"])): + raise RuntimeError("Canari du graphe SDK muet : le contrôle ne voit rien") + REPORTS.mkdir(exist_ok=True) + (REPORTS / "android-sdk-crates.txt").write_text("\n".join(tree) + "\n") + toolchain = CONFIG["sdk"]["rust_toolchain"] + run(["rustup", "run", toolchain, "cargo", "ndk", "-t", "arm64-v8a", "-P", str(CONFIG["toolchain"]["min_sdk"]), + "build", "-p", "bitwarden-uniffi", "--release"], cwd=SDK_SRC, env=env) + kotlin = SDK_SRC / "crates/bitwarden-uniffi/kotlin" + libs = kotlin / "sdk/src/main/jniLibs/arm64-v8a" + libs.mkdir(parents=True, exist_ok=True) + library = libs / "libbitwarden_uniffi.so" + shutil.copy2(SDK_SRC / "target/aarch64-linux-android/release/libbitwarden_uniffi.so", library) + run(["rustup", "run", toolchain, "bash", "./build-schemas.sh"], cwd=kotlin, env=env) + (kotlin / "local.properties").write_text(f"sdk.dir={ANDROID_HOME}\n") + run(["./gradlew", "--no-daemon", "sdk:publishToMavenLocal", "-Pversion=LOCAL"], cwd=kotlin, env=env) + aar = Path.home() / ".m2/repository/com/bitwarden/sdk-android/LOCAL/sdk-android-LOCAL.aar" + if not aar.is_file(): + raise RuntimeError(f"AAR du SDK absent : {aar}") + with zipfile.ZipFile(aar) as archive: + embedded = archive.read("jni/arm64-v8a/libbitwarden_uniffi.so") + if hashlib.sha256(embedded).hexdigest() != sha256(library): + raise RuntimeError("La bibliothèque de l'AAR n'est pas celle qui vient d'être compilée") + report = {"sdk_internal_commit": CONFIG["sdk"]["source_commit"], "crates": len(tree), + "libbitwarden_uniffi_arm64_sha256": sha256(library), "aar_sha256": sha256(aar)} + (REPORTS / "android-sdk.json").write_text(json.dumps(report, indent=2) + "\n") + print(json.dumps(report, indent=2)) + + +# Clés de signature Loksi, hors de Git (droits 700 et 600). debug : APK d'essai. upload : clé +# d'envoi Google Play (Play App Signing garde la clé de signature finale chez Google), RSA +# 4096 valable 30 ans, Play exige une validité au-delà de 2033. Le mot de passe est écrit en +# aveugle dans son fichier et n'en sort jamais : keytool, jarsigner et apksigner le lisent +# par :file, aucun argument ne le porte, aucun message d'erreur brut n'est affiché. +SIGNING = { + "debug": {"alias": "loksi-debug", "keysize": "3072", "dname": "CN=Loksi debug, O=Aleop, C=FR"}, + "upload": {"alias": "loksi-upload", "keysize": "4096", "dname": "CN=Loksi, O=Aleop, C=FR"}, +} + + +def make_key(kind): + KEYS.mkdir(parents=True, exist_ok=True) + os.chmod(KEYS, 0o700) + password, store = KEYS / f"{kind}.pass", KEYS / f"{kind}.p12" + if not store.exists(): + try: + fd = os.open(password, os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0o600) + with os.fdopen(fd, "w") as handle: + handle.write(secrets.token_urlsafe(32)) + keytool = Path(java_home()) / "bin/keytool" + result = subprocess.run([keytool, "-genkeypair", "-keystore", store, "-storetype", "PKCS12", + "-alias", SIGNING[kind]["alias"], "-keyalg", "RSA", + "-keysize", SIGNING[kind]["keysize"], "-validity", "10950", + "-dname", SIGNING[kind]["dname"], + "-storepass:file", password, "-keypass:file", password], + capture_output=True) + if result.returncode: + raise RuntimeError("keytool a échoué") + os.chmod(store, 0o600) + except Exception as error: # le message brut pourrait citer un argument + sys.exit(f"Génération de la clé {kind} interrompue : {type(error).__name__}") + print("SHA-256 du fichier de mot de passe :", sha256(password)) + print("Certificat SHA-256 :", certificate_digest(kind)) + + +def keys(): + """Clé debug Loksi.""" + make_key("debug") + + +def upload_key(): + """Clé d'envoi Google Play. À sauvegarder hors du poste : sans elle, il faut demander à + Google de la réinitialiser.""" + make_key("upload") + + +def certificate_digest(kind="debug"): + keytool = Path(java_home()) / "bin/keytool" + result = subprocess.run([keytool, "-J-Duser.language=en", "-list", "-v", "-keystore", KEYS / f"{kind}.p12", + "-storetype", "PKCS12", "-alias", SIGNING[kind]["alias"], + "-storepass:file", KEYS / f"{kind}.pass"], + capture_output=True, text=True) + match = re.search(r"SHA[- ]?256:\s*([0-9A-F:]{95})", result.stdout) + if result.returncode or not match: + raise RuntimeError(f"Empreinte du certificat {kind} illisible") + return match.group(1).replace(":", "").lower() + + +def adapt_strings(): + changed = 0 + english = SRC / "ui/src/main/res/values/strings.xml" + names = set(re.findall(r']*>)(.*?)()', re.S) + for path in sorted((SRC / "ui/src/main/res").glob("values*/strings*.xml")): + text = path.read_text() + + def rename(match): + nonlocal changed + if match.group(2) in KEEP_STRINGS or "Bitwarden" not in match.group(3): + return match.group(0) + changed += 1 + return match.group(1) + match.group(3).replace("Bitwarden", "Loksi") + match.group(4) + + text = pattern.sub(rename, text) + + def rename_plural(match): + nonlocal changed + if match.group(2) in KEEP_STRINGS or "Bitwarden" not in match.group(3): + return match.group(0) + changed += 1 + return match.group(1) + match.group(3).replace("Bitwarden", "Loksi") + match.group(4) + + path.write_text(re.sub(r'(]*>)(.*?)()', rename_plural, text, flags=re.S)) + for variant, name in (("main", "Loksi"), ("release", "Loksi"), ("beta", "Loksi Beta")): + path = SRC / f"app/src/{variant}/res/values/strings_non_localized.xml" + value = path.read_text() + new, count = re.subn(r'()[^<]*()', + r"\g<1>" + name + r"\g<2>", value) + if count != 1: + raise RuntimeError(f"app_name amont modifié : {variant}") + path.write_text(new) + if changed < 50: + raise RuntimeError(f"Seulement {changed} chaînes renommées, l'amont a changé") + return changed + + +# Palette Loksi, même correspondance que l'iOS et le coffre web +# (habillage user.vaultwarden.scss.hbs de Loksi web) : le bleu Bitwarden devient le +# navy en clair et le cyan en sombre, les fonds teintés #E5EEF9 et #0A3D58. Neutres, +# couleurs d'état, badges et illustrations restent amont. +THEME = "ui/src/main/kotlin/com/bitwarden/ui/platform/theme/color/ColorScheme.kt" +# Primitives employées dans un seul mode (relevé le 29/09/2026 sur le tag) : blue500 +# en clair (texte, boutons, bordures), blue400 en sombre, blue100 en clair (fonds teintés). +PRIMITIVES = {"blue100": ("DBE5F6", "E5EEF9"), "blue400": ("65ABFF", "009CDE"), "blue500": ("175DDC", "003087")} +# Emplois de blue500 en sombre et fond d'alerte clair : repris un par un. +SCHEME_USES = [ + ("dark", " navActiveAccent = PrimitiveColors.blue500,", " navActiveAccent = Color(color = 0xFF0A3D58),"), + ("dark", " outline = PrimitiveColors.blue500,", " outline = PrimitiveColors.blue400,"), + ("light", " alert = PrimitiveColors.blue700,", " alert = Color(color = 0xFF002260),"), +] +# Couples premier plan sur fond à tenir au-dessus du seuil WCAG AA, après correspondance. +CONTRAST = [("text.interaction", "background.primary", 4.5), ("text.interaction", "background.secondary", 4.5), + ("filledButton.foreground", "filledButton.background", 4.5), + ("outlineButton.foreground", "background.secondary", 4.5), + ("icon.secondary", "icon.navActiveAccent", 3.0), ("text.reversed", "background.alert", 4.5)] + + +def luminance(value): + def linear(c): + c /= 255 + return c / 12.92 if c <= 0.03928 else ((c + 0.055) / 1.055) ** 2.4 + r, g, b = (int(value[i:i + 2], 16) for i in (0, 2, 4)) + return 0.2126 * linear(r) + 0.7152 * linear(g) + 0.0722 * linear(b) + + +def scheme_colors(text): + """Couleur de chaque rôle (section.champ) des schémas clair et sombre.""" + primitives = dict(re.findall(r"val (\w+): Color = Color\(color = 0xFF([0-9A-F]{6})\)", text)) + roles = {} + for mode in ("dark", "light"): + block = text.split(f"val {mode}BitwardenColorScheme")[1].split("\n)\n")[0] + section = None + for line in block.splitlines(): + opened = re.match(r"\s+(\w+) = BitwardenColorScheme\.\w+\($", line) + if opened: + section = opened.group(1) + continue + value = re.match(r"\s+(\w+) = (?:PrimitiveColors\.(\w+)|Color\(color = 0xFF([0-9A-F]{6})\)),$", line) + if value and section: + roles[(mode, f"{section}.{value.group(1)}")] = primitives.get(value.group(2)) or value.group(3) + return roles + + +def adapt_colors(): + path = SRC / THEME + text = path.read_text() + for name, (old, new) in PRIMITIVES.items(): + line = f" val {name}: Color = Color(color = 0xFF{old})" + if text.count(line) != 1: + raise RuntimeError(f"Primitive amont modifiée : {name}") + text = text.replace(line, f" val {name}: Color = Color(color = 0xFF{new})") + for mode, old, new in SCHEME_USES: + head, rest = text.split(f"val {mode}BitwardenColorScheme") + block, tail = rest.split("\n)\n", 1) + if block.count(old) != 1: + raise RuntimeError(f"Emploi amont modifié ({mode}) : {old.strip()}") + text = head + f"val {mode}BitwardenColorScheme" + block.replace(old, new) + "\n)\n" + tail + path.write_text(text) + roles = scheme_colors(text) + if len(roles) < 100: + raise RuntimeError(f"Schéma de couleurs illisible : {len(roles)} rôles") + # Canari : l'amont contient bien un couple sous 4,5:1, que le calcul doit voir. + upstream = scheme_colors(tarfile.open(CACHE / "android.tar.gz").extractfile( + f"android-{CONFIG['tag'].lstrip('v')}/{THEME}").read().decode()) + ratios = {} + for colors in (upstream, roles): + for fore, back, minimum in CONTRAST: + for mode in ("light", "dark"): + a, b = sorted((luminance(colors[(mode, fore)]), luminance(colors[(mode, back)]))) + ratios[(colors is roles, fore, back, mode)] = ((b + 0.05) / (a + 0.05), minimum) + if all(r >= m for (loksi, *_), (r, m) in ratios.items() if not loksi): + raise RuntimeError("Canari de contraste muet : l'amont passe partout") + failing = [f"{f} sur {b} ({m}) : {r:.2f}" for (loksi, f, b, m), (r, minimum) in ratios.items() + if loksi and r < minimum] + if failing: + raise RuntimeError("Contrastes insuffisants : " + ", ".join(failing)) + for (loksi, f, b, m), (r, _) in sorted(ratios.items()): + if loksi: + print(f" contraste {f} sur {b} ({m}) : {r:.2f}") + return len(PRIMITIVES) + len(SCHEME_USES) + + +# DM Sans remplacée par la police Loksi (instances de Raleway, ios/fonts.py) sous les +# noms de ressource amont : Typography.kt et ses deux voisins restent intacts. Le +# fichier medium sert des styles déclarés en 600 : il reçoit le 600. L'amont Android +# n'emploie aucune italique, il n'en embarque pas. +FONTS = {"dm_sans_regular": "Loksi-Regular", "dm_sans_medium": "Loksi-SemiBold", + "dm_sans_semi_bold": "Loksi-SemiBold", "dm_sans_bold": "Loksi-Bold"} + + +def adapt_fonts(): + out = CACHE / "android-fonts" + if out.exists(): + shutil.rmtree(out) + python = CACHE / "venv/bin/python" + run([python, MOBILE / "ios/fonts.py", CACHE / "Raleway-wght.ttf", CACHE / "Raleway-Italic-wght.ttf", out]) + fonts = SRC / "ui/src/main/res/font" + upstream = sorted(p.stem for p in fonts.glob("dm_sans_*.ttf")) + if upstream != sorted(FONTS): + raise RuntimeError(f"Polices amont inattendues : {upstream}") + for resource, instance in FONTS.items(): + shutil.copy2(out / f"{instance}.ttf", fonts / f"{resource}.ttf") + return len(FONTS) + + +APP = "app/src/main/kotlin/com/x8bit/bitwarden" +STRINGS = "ui/src/main/res" +ENV_EXTENSIONS = "data/src/main/kotlin/com/bitwarden/data/repository/util/EnvironmentUrlDataJsonExtensions.kt" + + +def android_text(value): + """Valeur de ressource Android : XML échappé, apostrophes et guillemets protégés.""" + value = value.replace("&", "&").replace("<", "<").replace(">", ">") + return value.replace("\\", "\\\\").replace("'", "\\'").replace('"', '\\"').replace("\n", "\\n") + + +def language(path): + """fr pour values-fr-rFR, en pour le défaut et toutes les autres langues.""" + return "fr" if path.parent.name == "values-fr-rFR" else "en" + + +def set_strings(texts, required=("values", "values-fr-rFR")): + """Remplace la valeur des chaînes {nom: {fr, en}} dans chaque langue qui les porte. + Le défaut et le français doivent toutes les porter : une langue qui en manque retombe + sur le défaut, donc sur l'anglais Loksi.""" + replaced = 0 + for path in sorted((SRC / STRINGS).glob("values*/strings.xml")): + text = path.read_text() + for name, messages in texts.items(): + pattern = re.compile(r'(]*>)(.*?)()', re.S) + value = android_text(messages[language(path)]) + text, count = pattern.subn(lambda m: m.group(1) + value + m.group(3), text) + if count > 1 or (count == 0 and path.parent.name in required): + raise RuntimeError(f"{name} : {count} dans {path.parent.name}") + replaced += count + path.write_text(text) + return replaced + + +def add_strings(texts): + """Chaînes propres à Loksi, en anglais par défaut et en français.""" + for folder in ("values", "values-fr-rFR"): + path = SRC / STRINGS / folder / "strings.xml" + text = path.read_text() + lines = "" + for name, messages in texts.items(): + if f'name="{name}"' in text: + raise RuntimeError(f"Chaîne Loksi déjà présente dans l'amont : {name}") + lines += f' {android_text(messages[language(path)])}\n' + if text.count("") != 1: + raise RuntimeError(f"Fin de ressources amont modifiée : {folder}") + path.write_text(text.replace("", lines + "")) + + +def unset_server(): + """Aucun serveur quand rien n'est enregistré : le marqueur, présenté comme « adresse à + saisir ». La restriction gérée baseEnvironmentUrl (MDM), le compte actif et le choix de + l'utilisateur passent avant, comme en amont.""" + host = UNSET_SERVER.split("://", 1)[1] + replace_once(SRC / ENV_EXTENSIONS, + " this?.toEnvironmentUrls() ?: Environment.Prod.Us", + " this?.toEnvironmentUrls()\n" + " ?: Environment.SelfHosted(environmentUrlData = EnvironmentUrlDataJson(base = LOKSI_UNSET_SERVER))\n" + "\n" + "/**\n" + " * Loksi: host of the address that stands for \"no vault address entered yet\". The .invalid\n" + " * domain is reserved and never resolves: no server is contacted.\n" + " */\n" + f"const val LOKSI_UNSET_HOST: String = {json.dumps(host)}\n" + "\n" + "/**\n" + " * Loksi: no default server, this address stands for \"not entered yet\".\n" + " */\n" + "const val LOKSI_UNSET_SERVER: String = \"https://$LOKSI_UNSET_HOST\"\n" + "\n" + "/**\n" + " * Loksi: whether no vault address has been entered yet.\n" + " */\n" + "val EnvironmentUrlDataJson.isLoksiUnset: Boolean\n" + " get() = base == LOKSI_UNSET_SERVER") + # Le test amont du défaut suit le nouveau défaut, il n'est pas désactivé. + replace_once(SRC / "data/src/test/kotlin/com/bitwarden/data/repository/util/EnvironmentUrlsDataJsonExtensionsTest.kt", + """ fun `toEnvironmentUrlsOrDefault should convert null types to US values`() { + assertEquals( + Environment.Prod.Us,""", + """ fun `toEnvironmentUrlsOrDefault should convert null types to the Loksi unset marker`() { + assertEquals( + Environment.SelfHosted(environmentUrlData = EnvironmentUrlDataJson(base = LOKSI_UNSET_SERVER)),""") + + +# Choix du serveur : pas de bitwarden.com, bitwarden.eu ni auto-hébergé, le client saisit +# l'adresse de son coffre. « Connexion sur » affiche cette adresse et ouvre directement la +# saisie ; sans adresse, « Continuer » ouvre la saisie. Demande de Romain le 29/09/2026, +# comme iOS. Les régions restent dans le code amont. +def server_entry(): + selector = SRC / APP / "ui/platform/components/dropdown/EnvironmentSelector.kt" + replace_once(selector, " onClick = { shouldShowDialog = !shouldShowDialog },\n", + " // Loksi: no region list, the vault address is entered directly.\n" + " onClick = { onOptionSelected(Environment.Type.SELF_HOSTED) },\n") + replace_once(selector, " isHelpEnabled: Boolean = true,\n) {", + " isHelpEnabled: Boolean = true,\n selectedLabel: String? = null,\n) {") + replace_once(selector, " * @param isHelpEnabled Indicates if the help button should be available.\n", + " * @param isHelpEnabled Indicates if the help button should be available.\n" + " * @param selectedLabel Loksi: the server address shown instead of the region name.\n") + replace_once(selector, " text = selectedOption.displayLabel(),", + " text = selectedLabel ?: selectedOption.displayLabel(),") + screen = SRC / APP / "ui/auth/feature/landing/LandingScreen.kt" + replace_once(screen, "import com.bitwarden.data.repository.model.Environment\n", + "import com.bitwarden.data.repository.model.Environment\n" + "import com.bitwarden.data.repository.util.LOKSI_UNSET_HOST\n") + replace_once(screen, " selectedOption = state.selectedEnvironmentType,\n", + " selectedOption = state.selectedEnvironmentType,\n" + " selectedLabel = state.selectedEnvironmentLabel\n" + " .takeUnless { it == LOKSI_UNSET_HOST }\n" + " ?: stringResource(id = BitwardenString.loksi_vault_address_to_enter),\n") + model = SRC / APP / "ui/auth/feature/landing/LandingViewModel.kt" + replace_once(model, "import com.bitwarden.data.repository.model.Environment\n", + "import com.bitwarden.data.repository.model.Environment\n" + "import com.bitwarden.data.repository.util.isLoksiUnset\n") + replace_once(model, """ private fun handleContinueButtonClicked() { + if (""", """ private fun handleContinueButtonClicked() { + if (environmentRepository.environment.environmentUrlData.isLoksiUnset) { + // Loksi: no vault address yet, ask for it first. + sendEvent(LandingEvent.NavigateToEnvironment) + return + } + if (""") + environment = SRC / APP / "ui/auth/feature/environment/EnvironmentViewModel.kt" + replace_once(environment, "import com.bitwarden.data.repository.model.Environment\n", + "import com.bitwarden.data.repository.model.Environment\n" + "import com.bitwarden.data.repository.util.isLoksiUnset\n") + # Le marqueur « pas encore saisi » s'affiche comme un champ vide. + replace_once(environment, " is Environment.SelfHosted -> environment.environmentUrlData\n", + " is Environment.SelfHosted -> environment.environmentUrlData\n" + " .takeUnless { it.isLoksiUnset }\n" + " ?: EnvironmentUrlDataJson(base = \"\")\n") + names = {"SelfHostedEnvironment": "self_hosted_environment", + "SelfHostedEnvironmentFooter": "self_hosted_environment_footer"} + return set_strings({name: IOS.SERVER_STRINGS[key] for key, name in names.items()}) + + +# Nom ou adresse du coffre (décision de Romain du 04/10/2026, même règle que l'extension, +# extensions/loksi-coffre.ts) : un nom de 2 à 20 caractères donne https://.loksi.fr, +# sinon une adresse complète en https. Avant d'enregistrer, /api/config doit répondre +# « Vaultwarden », sinon « Aucun coffre Loksi ne répond à cette adresse ». La logique vit +# dans android/kotlin/LoksiVault.kt, copié dans le module data et testé seul +# (LoksiVaultTest.kt, canaris compris). Tant que rien n'est saisi, « Pas encore client ? +# Découvrir Loksi » mène à la page produit. +LOKSI_PRODUCT = "https://www.aleop.eu/loksi/" +LOKSI_KOTLIN = {"LoksiVault.kt": "data/src/main/kotlin/com/bitwarden/data/repository/util/LoksiVault.kt", + "LoksiVaultTest.kt": "data/src/test/kotlin/com/bitwarden/data/repository/util/LoksiVaultTest.kt"} +VAULT_TEXTS = { + "loksi_vault_name_or_address": {"fr": "Nom ou adresse de votre coffre", "en": "Name or address of your vault"}, + "loksi_vault_placeholder": {"fr": "ex. mon-entreprise", "en": "e.g. my-company"}, + "loksi_vault_address_invalid": { + "fr": "Saisissez le nom de votre coffre, choisi à la commande : 2 à 20 minuscules ou chiffres, " + "un tiret possible. Ou une adresse complète qui commence par https://.", + "en": "Enter the name of your vault, chosen when ordering: 2 to 20 lowercase letters or digits, " + "a hyphen allowed. Or a full address starting with https://.", + }, + "loksi_not_a_vault": { + "fr": "Aucun coffre Loksi ne répond à cette adresse. Vérifiez le nom auprès de votre administrateur.", + "en": "No Loksi vault answers at this address. Check the name with your administrator.", + }, + "loksi_discover_loksi": {"fr": "Pas encore client ? Découvrir Loksi", "en": "Not a customer yet? Discover Loksi"}, +} +# Aide sous le champ : celle de l'extension, qui montre le nom et l'adresse obtenue. +VAULT_FOOTER = { + "fr": "Saisissez le nom de votre coffre, par exemple mon-entreprise pour https://mon-entreprise.loksi.fr, " + "ou son adresse complète. Votre administrateur vous le donne.", + "en": "Enter the name of your vault, for example my-company for https://my-company.loksi.fr, " + "or its full address. Your administrator gives it to you.", +} + + +def vault_name_entry(): + for name, relative in LOKSI_KOTLIN.items(): + target = SRC / relative + if target.exists(): + raise RuntimeError(f"Fichier Loksi déjà présent dans l'amont : {relative}") + shutil.copy2(HERE / "kotlin" / name, target) + model = SRC / APP / "ui/auth/feature/environment/EnvironmentViewModel.kt" + replace_once(model, "import com.bitwarden.data.repository.util.isLoksiUnset\n", + "import com.bitwarden.data.repository.util.isLoksiUnset\n" + "import com.bitwarden.data.repository.util.isLoksiVault\n" + "import com.bitwarden.data.repository.util.loksiVaultAddress\n") + replace_once(model, """ private fun handleSaveClickAction() { + val urlsAreAllNullOrValid = listOf(""", """ private fun handleSaveClickAction() { + // Loksi: a vault name gives https://.loksi.fr, a full address must be https, + // and a Vaultwarden must answer on /api/config before anything is saved. + val loksiBase = loksiVaultAddress(state.serverUrl) + if (loksiBase == null) { + showErrorDialog(message = BitwardenString.loksi_vault_address_invalid.asText()) + return + } + viewModelScope.launch { + if (isLoksiVault(loksiBase)) { + mutableStateFlow.update { it.copy(serverUrl = loksiBase) } + saveLoksiEnvironment() + } else { + showErrorDialog(message = BitwardenString.loksi_not_a_vault.asText()) + } + } + } + + private fun saveLoksiEnvironment() { + val urlsAreAllNullOrValid = listOf(""") + screen = SRC / APP / "ui/auth/feature/environment/EnvironmentScreen.kt" + replace_once(screen, """ label = stringResource(id = BitwardenString.server_url), + value = state.serverUrl, + placeholder = "ex. https://bitwarden.company.com",""", + """ label = stringResource(id = BitwardenString.loksi_vault_name_or_address), + value = state.serverUrl, + placeholder = stringResource(id = BitwardenString.loksi_vault_placeholder),""") + landing = SRC / APP / "ui/auth/feature/landing/LandingScreen.kt" + replace_once(landing, "import androidx.compose.ui.text.style.TextAlign\n", + "import androidx.compose.ui.text.style.TextAlign\nimport androidx.core.net.toUri\n") + replace_once(landing, "import com.bitwarden.ui.platform.components.button.BitwardenTextButton\n", + "import com.bitwarden.ui.platform.components.button.BitwardenTextButton\n" + "import com.bitwarden.ui.platform.composition.LocalIntentManager\n") + replace_once(landing, """ .standardHorizontalMargin() + .fillMaxWidth(), + ) + Spacer(modifier = Modifier.height(height = 8.dp)) +""", f""" .standardHorizontalMargin() + .fillMaxWidth(), + ) + if (state.selectedEnvironmentLabel == LOKSI_UNSET_HOST) {{ + // Loksi: no vault entered yet, a link for whoever is not a customer yet. + val loksiIntentManager = LocalIntentManager.current + BitwardenTextButton( + label = stringResource(id = BitwardenString.loksi_discover_loksi), + onClick = {{ loksiIntentManager.launchUri("{LOKSI_PRODUCT}".toUri()) }}, + modifier = Modifier + .standardHorizontalMargin() + .fillMaxWidth(), + ) + }} + Spacer(modifier = Modifier.height(height = 8.dp)) +""") + add_strings(VAULT_TEXTS) + return set_strings({"self_hosted_environment_footer": VAULT_FOOTER}) + + +# Pas de création de compte dans l'app : un compte Loksi est créé par l'administrateur de +# l'entreprise (invitation ou SSO). Décision de Romain le 29/09/2026, comme iOS, quel que +# soit le réglage d'inscription du serveur. +def hide_registration(): + welcome = SRC / APP / "ui/auth/feature/welcome/WelcomeScreen.kt" + replace_once(welcome, """ AnimatedVisibility( + visible = state.allowCreateAccount, + label = "CreateAccountAnimatedVisibility", + ) { + BitwardenFilledButton( + label = stringResource(id = BitwardenString.create_account), + onClick = onCreateAccountClick, + modifier = Modifier + .standardHorizontalMargin(medium = HORIZONTAL_MARGIN_MEDIUM) + .fillMaxWidth() + .testTag("ChooseAccountCreationButton"), + ) + } + + BitwardenOutlinedButton( + label = stringResource(id = BitwardenString.log_in_verb),""", """ BitwardenFilledButton( + label = stringResource(id = BitwardenString.log_in_verb),""") + landing = SRC / APP / "ui/auth/feature/landing/LandingScreen.kt" + replace_once(landing, """ AnimatedVisibility( + visible = state.allowCreateAccount, + label = "CreateAccountAnimatedVisibility", + ) { + Column { + Row( + horizontalArrangement = Arrangement.Center, + verticalAlignment = Alignment.CenterVertically, + modifier = Modifier + .standardHorizontalMargin() + .fillMaxWidth() + .wrapContentHeight(), + ) { + Text( + text = stringResource(id = BitwardenString.new_to_bitwarden), + style = BitwardenTheme.typography.bodyMedium, + color = BitwardenTheme.colorScheme.text.secondary, + ) + + BitwardenTextButton( + label = stringResource(id = BitwardenString.create_an_account), + onClick = onCreateAccountClick, + modifier = Modifier + .testTag("CreateAccountLabel"), + ) + } + Spacer(modifier = Modifier.height(height = 8.dp)) + } + } +""", """ Text( + text = stringResource(id = BitwardenString.loksi_account_created_by_administrator), + textAlign = TextAlign.Center, + style = BitwardenTheme.typography.bodyMedium, + color = BitwardenTheme.colorScheme.text.secondary, + modifier = Modifier + .standardHorizontalMargin() + .fillMaxWidth(), + ) + Spacer(modifier = Modifier.height(height = 8.dp)) +""") + add_strings({"loksi_account_created_by_administrator": IOS.ADMIN_MESSAGE, + "loksi_vault_address_to_enter": IOS.VAULT_ADDRESS_TO_ENTER, **contact_texts(), + "loksi_origin_notice": ORIGIN_NOTICE}) + + +# Carrousel d'accueil : les textes Loksi d'iOS, validés par Romain le 29/09/2026, français +# pour fr et anglais pour toutes les autres langues. Une seule retouche : Face ID n'existe +# pas sur Android, la page 2 parle du déverrouillage biométrique. +CAROUSEL_KEYS = { + "IntroCarouselPage1Title": "security_prioritized", "IntroCarouselPage1Message": "welcome_message_1", + "IntroCarouselPage2Title": "quick_and_easy_login", "IntroCarouselPage2Message": "welcome_message_2", + "IntroCarouselPage3Title": "level_up_your_logins", "IntroCarouselPage3Message": "welcome_message_3", + "IntroCarouselPage4Title": "your_data_when_and_where_you_need_it", "IntroCarouselPage4Message": "welcome_message_4", +} +ANDROID_PAGE_2 = {"fr": "Le déverrouillage biométrique et le remplissage automatique ouvrent vos comptes sans rien taper.", + "en": "Biometric unlock and autofill open your accounts without typing anything."} + + +def adapt_carousel(): + texts = {} + for ios_key, name in CAROUSEL_KEYS.items(): + texts[name] = {language: IOS.CAROUSEL[language][ios_key] for language in ("fr", "en")} + if any("Face ID" in texts["welcome_message_2"][language] for language in ("fr", "en")): + texts["welcome_message_2"] = ANDROID_PAGE_2 + else: + raise RuntimeError("Carrousel iOS changé : la retouche Face ID de la page 2 est à revoir") + return set_strings(texts) + + +# Mention d'origine d'À propos, validée par Romain le 30/09/2026, la même sur tous les +# clients Loksi (brand/README.md, « Le nom Bitwarden ») : modification par Aleop, GPL v3, +# non-affiliation, puis l'avis de copyright amont, gardé comme la GPL l'impose. Français +# pour fr, anglais pour les autres langues. L'année vient de l'amont (Year.now). +ORIGIN_NOTICE = { + "fr": "Loksi, par Aleop. Application Bitwarden® modifiée par Aleop, sous licence GPL v3. " + "Aleop n'est pas affilié à Bitwarden Inc.\nBasé sur Bitwarden " + UPSTREAM_VERSION + + ".\n© Bitwarden Inc. 2015-%1$d", + "en": "Loksi, by Aleop. Bitwarden® app modified by Aleop, under the GPL v3. " + "Aleop is not affiliated with Bitwarden Inc.\nBased on Bitwarden " + UPSTREAM_VERSION + + ".\n© Bitwarden Inc. 2015-%1$d", +} + + +def adapt_about(): + replace_once(SRC / APP / "ui/platform/feature/settings/about/AboutViewModel.kt", + 'copyrightInfo = "© Bitwarden Inc. 2015-${Year.now(clock).value}".asText(),', + 'copyrightInfo = BitwardenString.loksi_origin_notice.asText(Year.now(clock).value),') + + +# Entrées vers une offre ou une app Bitwarden sans équivalent Loksi : retirées plutôt que +# renommées (brand/README.md, « Le nom Bitwarden », 29/09/2026). La page produit de Send, et +# la synchronisation avec l'app Bitwarden Authenticator, qui ne reconnaît que la signature +# de Bitwarden. Visible dès Android 12, relevé le 29/09/2026. +def remove_bitwarden_offers(): + replace_once(SRC / APP / "ui/tools/feature/send/SendScreen.kt", """ OverflowMenuItemData( + text = stringResource(id = BitwardenString.about_send), + onClick = { viewModel.trySendAction(SendAction.AboutSendClick) }, + isExternalLink = true, + ), +""", "") + replace_once(SRC / APP / "ui/platform/feature/settings/accountsecurity/AccountSecurityViewModel.kt", + " shouldShowEnableAuthenticatorSync = isBuildVersionAtLeast(Build.VERSION_CODES.S),\n", + " // Loksi: no sync with the Bitwarden Authenticator app.\n" + " shouldShowEnableAuthenticatorSync = false,\n") + + +# Aide et confidentialité : les pages Loksi du site (vitrine, 29/09/2026), adresses dans +# upstream.json, android.links, les mêmes qu'iOS. +# Après un import : le compte se gère sur le coffre web de l'entreprise, pas sur bitwarden.com. +# Même texte qu'iOS. +MANAGE_ACCOUNT_TEXT = {"fr": "Connectez-vous au coffre web de votre entreprise pour gérer votre compte et vos paramètres.", + "en": "Log in to your company's web vault to manage your account and settings."} +# Textes qui citent bitwarden.com sans qu'aucun écran de Loksi ne les affiche : formats +# d'import d'Authenticator, carte de téléchargement, dialogue des organisations retiré. +UNUSED_BITWARDEN_COM = {"go_to_bitwarden_com_download_to_integrate_bitwarden_into_browser", + "required_information_missing_message", "file_could_not_be_processed_message", + "learn_about_organizations_description_long"} +PRIVACY_TEXT = {"fr": "Consultez notre politique de confidentialité sur aleop.eu.", + "en": "Check out our privacy policy on aleop.eu."} + + +def adapt_links(): + about = SRC / APP / "ui/platform/feature/settings/about/AboutScreen.kt" + for old, key in (("https://bitwarden.com/help", "help"), ("https://bitwarden.com/privacy", "privacy"), + ("https://bitwarden.com/help/flight-recorder", "help")): + replace_once(about, f'intentManager.launchUri("{old}".toUri())', + f'intentManager.launchUri("{CONFIG["links"][key]}".toUri())') + # L'enregistreur de vols renvoie au centre d'aide Loksi, depuis son propre écran aussi. + replace_once(SRC / APP / "ui/platform/feature/settings/flightrecorder/FlightRecorderScreen.kt", + 'intentManager.launchUri(uri = "https://bitwarden.com/help/flight-recorder".toUri())', + f'intentManager.launchUri(uri = "{CONFIG["links"]["help"]}".toUri())') + # « En savoir plus sur les organisations » ouvrait bitwarden.com : ligne retirée, comme iOS. + replace_once(about, """ BitwardenExternalLinkRow( + text = stringResource(id = BitwardenString.learn_org), + onConfirmClick = onLearnAboutOrgsClick, + dialogTitle = stringResource(id = BitwardenString.continue_to_x, "bitwarden.com"), + dialogMessage = stringResource( + id = BitwardenString.learn_about_organizations_description_long, + ), + withDivider = false, + cardStyle = CardStyle.Middle(), + modifier = Modifier + .standardHorizontalMargin() + .fillMaxWidth() + .testTag(tag = "LearnAboutOrganizationsRow"), + ) +""", "") + return set_strings({"privacy_policy_description_long": PRIVACY_TEXT, + "log_in_at_bitwarden_com_to_easily_manage_your_account": MANAGE_ACCOUNT_TEXT}) + + +# Tutoriel d'import : l'anglais et le français affichent l'adresse réelle du coffre web +# (%1$s), plusieurs traductions ont vault.bitwarden.com en dur. Elles reprennent l'anglais. +def import_tutorial_address(): + name = "on_your_computer_open_a_new_browser_tab_and_go_to_vault_bitwarden_com" + pattern = re.compile(r'()(.*?)()', re.S) + english = pattern.search((SRC / STRINGS / "values/strings.xml").read_text()).group(2) + if "%1$s" not in english or "bitwarden" in english.lower(): + raise RuntimeError(f"{name} : texte anglais amont modifié") + fixed = 0 + for path in sorted((SRC / STRINGS).glob("values-*/strings.xml")): + text = path.read_text() + match = pattern.search(text) + if match and "vault.bitwarden.com" in match.group(2): + path.write_text(text[:match.start(2)] + english + text[match.end(2):]) + fixed += 1 + if not fixed: + raise RuntimeError(f"{name} : aucune traduction en dur, l'amont a changé") + return fixed + + +# « Nous contacter » dans À propos : un courriel au support, la protection des données +# citée dans le dialogue. Demande de Romain le 30/09/2026. Adresse loksi@aleop.eu, boîte +# partagée (03/10/2026) : support@aleop.eu, l'entrée du support client, rejette les inconnus. Même confirmation que les +# lignes voisines, qui ouvrent aussi une app externe. +def contact_texts(): + links = CONFIG["links"] + return { + "loksi_contact_us": {"fr": "Nous contacter", "en": "Contact us"}, + "loksi_contact_us_title": {"fr": "Écrire au support ?", "en": "Email support?"}, + "loksi_contact_us_message": { + "fr": f"Votre messagerie s'ouvre avec un courriel pour {links['support']}. " + f"Pour la protection des données, écrivez à {links['dpo']}.", + "en": f"Your email app opens with a message to {links['support']}. " + f"For data protection, write to {links['dpo']}.", + }, + } + + +def add_contact_row(): + replace_once(SRC / APP / "ui/platform/feature/settings/about/AboutScreen.kt", """ .testTag(tag = "PrivacyPolicyRow"), + ) +""", f""" .testTag(tag = "PrivacyPolicyRow"), + ) + // Loksi: contact row, an email to the support. + val loksiIntentManager = LocalIntentManager.current + BitwardenExternalLinkRow( + text = stringResource(id = BitwardenString.loksi_contact_us), + onConfirmClick = {{ loksiIntentManager.launchUri("mailto:{CONFIG['links']['support']}".toUri()) }}, + dialogTitle = stringResource(id = BitwardenString.loksi_contact_us_title), + dialogMessage = stringResource(id = BitwardenString.loksi_contact_us_message), + withDivider = false, + cardStyle = CardStyle.Middle(), + modifier = Modifier + .standardHorizontalMargin() + .fillMaxWidth() + .testTag(tag = "LoksiContactUsRow"), + ) +""") + + +def dex_literal(value): + """Chaîne telle que la table des dex la range : longueur, octets, zéro final. Elle ne + trouve que la chaîne exacte, pas une adresse plus longue qui la contient.""" + data = value.encode() + if len(data) > 127: + raise ValueError("chaîne trop longue pour ce contrôle") + return bytes([len(data)]) + data + b"\0" + + +# Numérotation des applis Loksi et Klepsi, règle de Romain du 06/10/2026, la même sur tous +# les clients : version affichée AAAA.M.n sans zéro devant, n à 0 pour la première sortie +# du mois ; numéro de build entier qui monte à chaque AAB, au-dessus de tous ceux déjà +# inscrits dans l'historique de upstream.json (Google refuse un code déjà reçu ou plus +# petit). La version de Bitwarden passe dans À propos, à côté de la mention d'origine. +VERSION_NAME = re.compile(r"(20\d\d)\.([1-9]|1[0-2])\.(0|[1-9]\d*)") + + +def check_version(name, code, used_codes): + """Refuse une version hors règle, ou un code qui ne dépasse pas tous les codes déjà pris.""" + if not VERSION_NAME.fullmatch(name): + raise ValueError(f"Version {name!r} hors règle AAAA.M.n, sans zéro devant") + if not isinstance(code, int) or isinstance(code, bool) or code < 1: + raise ValueError(f"Numéro de build {code!r} : entier positif attendu") + previous = [c for c in used_codes if c != code] + if previous and code <= max(previous): + raise ValueError(f"Numéro de build {code} : il doit dépasser {max(previous)}, déjà pris") + + +def used_codes(): + """Codes Android inscrits dans l'historique de mobile/upstream.json, commits compris.""" + commits = subprocess.run(["git", "log", "--format=%H", "--", "mobile/upstream.json"], cwd=REPO, + capture_output=True, text=True, check=True).stdout.split() + codes = set() + for commit in commits: + text = subprocess.run(["git", "show", f"{commit}:mobile/upstream.json"], cwd=REPO, + capture_output=True, text=True, check=True).stdout + code = json.loads(text)["android"].get("app_version", {}).get("code") + if isinstance(code, int): + codes.add(code) + if not codes: + raise RuntimeError("Aucun code Android dans l'historique : lecture git muette") + return codes + + +def version_selftest(): + """Contrôle de la règle, avec canaris fabriqués qui doivent être refusés.""" + for name in ("2026.10.0", "2026.10.1", "2026.11.0", "2027.1.12"): + check_version(name, 5, {3, 4}) + for name in ("2026.09.0", "2026.10.00", "2026.13.0", "2026.0.1", "26.10.0", "2026.10", "2026.10.0-rc"): + try: + check_version(name, 5, {3, 4}) + except ValueError: + continue + raise RuntimeError(f"Canari accepté : version {name!r}") + for code, used in ((4, {3, 4, 5}), (3, {3, 4}), (2, {3}), (0, set()), ("3", set())): + try: + check_version("2026.10.0", code, used) + except ValueError: + continue + raise RuntimeError(f"Canari accepté : code {code!r} après {sorted(used)}") + check_version("2026.10.0", 4, {3, 4}) # même code qu'au dernier commit : rebuild admis + + +# En-têtes envoyés au serveur : Vaultwarden active des fonctions selon Bitwarden-Client-Version, +# il doit voir la version amont réelle du code (2026.9.0), pas la version Loksi affichée. +# Même choix que l'extension (06/10/2026). Le User-Agent suit, pour rester cohérent. +HEADER_UTILS = "app/src/main/kotlin/com/x8bit/bitwarden/data/platform/datasource/network/util/HeaderUtils.kt" +CLIENT_VERSION_TEST = "app/src/test/kotlin/com/x8bit/bitwarden/data/platform/datasource/network/util/LoksiClientVersionTest.kt" + + +# Plus de Bitwarden sauf obligation (Romain, 09/10/2026). Inventaire vérifié le 09/10 sur le +# tag et sur Vaultwarden 1.37.3. Gardés car obligatoires : le schéma bitwarden:// (retour SSO +# imposé par src/sso.rs:198, Duo et WebAuthn par les connecteurs de Loksi web), les en-têtes +# Bitwarden-Client-Version et Device-Type que Vaultwarden lit (src/auth.rs), la mention GPL, +# et l'espace de noms Kotlin com.x8bit.bitwarden, jamais affiché, qui donne aussi les noms de +# composants (services, tuiles, MainActivity). Laissé : premium-checkout-result, retour du +# paiement Premium de Bitwarden, inaccessible avec Vaultwarden. Retiré ou passé à Loksi : +SHORTCUT_PACKAGES = {"main": DEBUG_ID, "release": APPLICATION_ID, "beta": APPLICATION_ID + ".beta"} +LOKSI_ACTIONS = ("ACTION_CREATE_PASSKEY", "ACTION_GET_PASSKEY", "ACTION_CREATE_PASSWORD", + "ACTION_GET_PASSWORD", "ACTION_UNLOCK_ACCOUNT") + + +def remove_bitwarden_remnants(): + # Raccourcis de l'icône : ils visaient le package de Bitwarden, donc cassés dans Loksi. + for variant, package in SHORTCUT_PACKAGES.items(): + shortcuts = SRC / f"app/src/{variant}/res/xml/shortcuts.xml" + old = "com.x8bit.bitwarden.dev" if variant == "main" else ( + "com.x8bit.bitwarden.beta" if variant == "beta" else "com.x8bit.bitwarden") + replace_once(shortcuts, f'android:targetPackage="{old}" />', f'android:targetPackage="{package}" />', count=2) + # Le remplissage ne doit jamais remplir Loksi elle-même ; l'amont s'excluait lui-même. + replace_once(SRC / APP / "data/autofill/accessibility/util/AccessibilityNodeInfoExtensions.kt", + 'private const val PACKAGE_NAME_BITWARDEN_PREFIX: String = "com.x8bit.bitwarden"', + f'private const val PACKAGE_NAME_BITWARDEN_PREFIX: String = "{APPLICATION_ID}"') + replace_once(SRC / APP / "data/autofill/parser/AutofillParserImpl.kt", """ "androidapp://com.x8bit.bitwarden", + "androidapp://com.x8bit.bitwarden.beta", + "androidapp://com.x8bit.bitwarden.dev",""", f""" "androidapp://{APPLICATION_ID}", + "androidapp://{APPLICATION_ID}.beta", + "androidapp://{DEBUG_ID}",""") + # Fichier d'export du coffre, visible dans les fichiers de l'utilisateur. + replace_once(SRC / APP / "ui/platform/feature/settings/exportvault/ExportVaultViewModel.kt", + 'val fileName = "bitwarden_export_$date.$extension"', 'val fileName = "loksi_export_$date.$extension"') + # User-Agent : Vaultwarden 1.37.3 ne le lit pas (seulement le sien en sortie, src/http_client.rs). + replace_once(SRC / HEADER_UTILS, '"Bitwarden_Mobile/$LOKSI_UPSTREAM_VERSION (', '"Loksi_Mobile/$LOKSI_UPSTREAM_VERSION (') + # Actions internes du fournisseur d'identifiants, manifeste et code ensemble. + pending = SRC / APP / "data/credentials/manager/CredentialManagerPendingIntentManagerImpl.kt" + manifest = SRC / "app/src/main/AndroidManifest.xml" + for action in LOKSI_ACTIONS: + replace_once(pending, f'"com.x8bit.bitwarden.credentials.{action}"', f'"{APPLICATION_ID}.credentials.{action}"') + replace_once(manifest, f'android:name="com.x8bit.bitwarden.credentials.{action}"', + f'android:name="{APPLICATION_ID}.credentials.{action}"') + # Pont vers Bitwarden Authenticator : service exporté aux applis signées par Bitwarden + # (known_authenticator_app_certs). Loksi n'a pas d'Authenticator : retiré du manifeste. + text = manifest.read_text() + blocks = [r"\n