Full Code of oOthkOo/whatsapp-desktop for AI

master 9079264fa5c9 cached
58 files
155.5 KB
39.8k tokens
35 symbols
1 requests
Download .txt
Repository: oOthkOo/whatsapp-desktop
Branch: master
Commit: 9079264fa5c9
Files: 58
Total size: 155.5 KB

Directory structure:
gitextract_dwb58g73/

├── .gitignore
├── ISSUE_TEMPLATE.md
├── LICENSE
├── README.md
├── app/
│   ├── agents.json
│   ├── css/
│   │   └── settings.css
│   ├── html/
│   │   ├── about.html
│   │   ├── phoneinfo.html
│   │   └── settings.html
│   ├── js/
│   │   ├── injected.js
│   │   └── views/
│   │       ├── about.js
│   │       ├── phoneinfo.js
│   │       └── settings.js
│   ├── locale/
│   │   ├── de_DE/
│   │   │   └── messages.po
│   │   ├── en_US/
│   │   │   └── messages.po
│   │   ├── es_ES/
│   │   │   └── messages.po
│   │   ├── it_IT/
│   │   │   └── messages.po
│   │   ├── messages.pot
│   │   ├── pt_BR/
│   │   │   └── messages.po
│   │   ├── ru_RU/
│   │   │   └── messages.po
│   │   └── tr_TR/
│   │       └── messages.po
│   ├── main.js
│   ├── menu.js
│   └── package.json
├── build/
│   ├── assets/
│   │   └── osx/
│   │       └── whatsapp.icns
│   └── templates/
│       ├── debian/
│       │   ├── armv7l/
│       │   │   ├── compat
│       │   │   ├── control
│       │   │   ├── copyright
│       │   │   ├── docs
│       │   │   ├── postinst
│       │   │   └── prerm
│       │   ├── changelog
│       │   ├── ia32/
│       │   │   ├── compat
│       │   │   ├── control
│       │   │   ├── copyright
│       │   │   ├── docs
│       │   │   ├── postinst
│       │   │   └── prerm
│       │   └── x64/
│       │       ├── compat
│       │       ├── control
│       │       ├── copyright
│       │       ├── docs
│       │       ├── postinst
│       │       └── prerm
│       └── whatsapp.desktop
├── package.json
├── packager.json
└── scripts/
    ├── build-all.sh
    ├── build-darwin-arm64.sh
    ├── build-darwin-x64.sh
    ├── build-linux-armv7l.sh
    ├── build-linux-x32.sh
    ├── build-linux-x64.sh
    ├── build-linux.sh
    ├── build-win-x64.sh
    ├── build-zip.sh
    ├── clean.sh
    └── constants.sh

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

================================================
FILE: .gitignore
================================================
.idea/*
.DS_Store
Thumbs.db
build/outputs
build/releases
build/dist
npm-debug.log
node_modules
electron-*
*.mo
.pc
*.log
*.substvars
*.EX
dummy.tar.bz2
rpmbuild/
build/whatsapp-desktop-*


================================================
FILE: ISSUE_TEMPLATE.md
================================================
### System details

* OS: [write here your operative system name, version, language]
* App Version: [write here the app version, or "github" if you're using latest from github]
* If Linux, Desktop Environment: [write here your desktop environment if on Linux, otherwise leave it blank]

### Expected behavior

[write here what you were expecting from an action (specified below)]

### Actual behavior

[write here what really happened]

### Step to reproduce the behavior

[write here steps to do in order to reproduce the bad behavior, so we can trace and resolve the issue quickly]


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

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

                            Preamble

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

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

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

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

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

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

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

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

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

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

                       TERMS AND CONDITIONS

  0. Definitions.

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

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

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

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

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

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

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

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

  1. Source Code.

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

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

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

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

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

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

  2. Basic Permissions.

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

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

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

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

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

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

  4. Conveying Verbatim Copies.

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

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

  5. Conveying Modified Source Versions.

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

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

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

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

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

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

  6. Conveying Non-Source Forms.

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

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

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

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

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

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

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

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

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

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

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

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

  7. Additional Terms.

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

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

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

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

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

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

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

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

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

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

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

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

  8. Termination.

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

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

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

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

  9. Acceptance Not Required for Having Copies.

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

  10. Automatic Licensing of Downstream Recipients.

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

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

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

  11. Patents.

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

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

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

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

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

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

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

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

  12. No Surrender of Others' Freedom.

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

  13. Use with the GNU Affero General Public License.

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

  14. Revised Versions of this License.

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

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

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

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

  15. Disclaimer of Warranty.

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

  16. Limitation of Liability.

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

  17. Interpretation of Sections 15 and 16.

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

                     END OF TERMS AND CONDITIONS

            How to Apply These Terms to Your New Programs

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

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

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

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

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

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

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

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

    {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
<http://www.gnu.org/licenses/>.

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


================================================
FILE: README.md
================================================
![downloads](https://img.shields.io/github/downloads/oOthkOo/whatsapp-desktop/total?style=for-the-badge)

# WhatsApp Desktop

![screenshot](https://github.com/oOthkOo/whatsapp-desktop/blob/master/screenshots/whatsapp-screen.png "Main Window")

Unofficial WhatsApp Desktop Client for OSX, Linux and Windows. Build with [Electron](http://electron.atom.io/).  

This is **NOT** an official product. This project does not attempt to reverse engineer the WhatsApp API or attempt to reimplement any part of the WhatsApp client. Any communication between the user and WhatsApp servers is handled by official WhatsApp Web itself; this is just a native wrapper for WhatsApp Web, like a browser.

Original versions of WhatsApp Desktop was written by:
* @bcalik : https://github.com/bcalik/Whatsapp-Desktop
* @Enrico204 : https://github.com/Enrico204/Whatsapp-Desktop

## Features

* Cross platform (OSX, Windows x64, Linux ia32/x64 and ARM v7l)
* Native notifications
* System tray icon
* Open links in browser
* Badge with the number of notifications in the dock/taskbar
* Dock icon bounces when a new message is received
* Focus on contact search input via CMD+F (WIN+F)
* Phone info window (s/w versions, battery status, etc)
* Auto-launch on login
* Start minimized to tray icon
* Logging system (log to console and *userData*/log.log)
* Apply custom CSS stylesheet
* Auto-hide menu bar (Windows, Linux)
* Disabling GPU rendering (useful when dealing with bugged video drivers)
* A couple of things can be configured:
  * Toggle avatar visibility
  * Toggle preview of the messages visibility
  * Set the size for the media thumbs
  * Proxy settings connect to WhatsApp web

## Download WhatsApp

* Windows 10/11 - [Download](https://github.com/oOthkOo/whatsapp-desktop/releases/latest/download/WhatsApp-win32-x64.zip) - ![Stats](https://img.shields.io/github/downloads/oOthkOo/whatsapp-desktop/latest/WhatsApp-win32-x64.zip?style=flat-square)
* Mac OSX - [Download](https://github.com/oOthkOo/whatsapp-desktop/releases/latest/download/WhatsApp-darwin-x64.zip) - ![Stats](https://img.shields.io/github/downloads/oOthkOo/whatsapp-desktop/latest/WhatsApp-darwin-x64.zip?style=flat-square)
* Ubuntu (32 bits) - [Download](https://github.com/oOthkOo/whatsapp-desktop/releases/latest/download/whatsapp-linux-ia32.deb) - ![Stats](https://img.shields.io/github/downloads/oOthkOo/whatsapp-desktop/latest/whatsapp-linux-ia32.deb?style=flat-square)
* Ubuntu (64 bits) - [Download](https://github.com/oOthkOo/whatsapp-desktop/releases/latest/download/whatsapp-linux-x64.deb) - ![Stats](https://img.shields.io/github/downloads/oOthkOo/whatsapp-desktop/latest/whatsapp-linux-x64.deb?style=flat-square)

Donations
-----

:heart: Donations are always welcome :heart:.

### Buymeacoffee

[<img height="55px" src="https://raw.githubusercontent.com/oOthkOo/oOthkOo/main/assets/bmac-btn.svg">](https://buymeacoffee.com/oothkoo)

### Crypto

Coins | Symbols | Addresses
--- | --- | ---
<img width="32" src="https://raw.githubusercontent.com/oOthkOo/oOthkOo/main/assets/btc.svg" alt="Bitcoin"/> | BTC | 3B52fbzNFQTaKZxWf5GrCUsASD2UP8na4A
<img width="32" src="https://raw.githubusercontent.com/oOthkOo/oOthkOo/main/assets/eth.svg" alt="Ethereum"/> | ETH | 0x1C389f1f85Cdb3C2996b83fAc87E496A80698B7C
<img width="32" src="https://raw.githubusercontent.com/oOthkOo/oOthkOo/main/assets/sol.svg" alt="Solana"/> | SOL | F14pWhGjGLcCF8RMk4JhbK2kD49iBBwa9KFygRJo54Fm

## Build WhatsApp Debian/Ubuntu/Mint packages

Follow these instructions to install `whatsapp-desktop` on your system.

### Install NPM and Yarn

You need NPM and Yarn to be installed on your system before building deb package.

* NPM  : https://nodejs.org/en/download/package-manager/
* Yarn : https://yarnpkg.com/lang/en/docs/install/

### Build Linux 32/64 bits packages

You can build `whatsapp-linux-xxx.deb` package with:

```sh
git clone https://github.com/oOthkOo/whatsapp-desktop.git
cd whatsapp-desktop
npm run build:linux   # for x64 arch
npm run build:linux32 # for x32 arch
```

You'll find debian packages into `build/releases` directory.

### Install WhatsApp on Debian, Ubuntu, Mint, ...

```sh
sudo apt install ./build/releases/whatsapp-linux-x64.deb
sudo apt install -f
```

## Contributions

Contributions are welcome! For feature requests and bug reports please submit an [issue](https://github.com/oOthkOo/whatsapp-desktop/issues).

## Build from source

To build from the source, run the following commands:

```sh
npm install
npm run build:{platform}
```

| Platform | OS | Format |
| --- | --- | --- |
| win | Windows only | zip |
| osx | OSX only | zip |
| osxm1 | OSX arm64 (m1) | zip |
| linux | Linux 64 bits | deb |
| linux32 | Linux 32 bits | deb |
| linuxarmv7l | ARM Linux | deb |

Or if you wants build for all platforms:

```sh
npm install
npm run build:all
```

You'll find artifacts into `build/releases/` directory.

#### Cross-build for Windows (from Linux/macOS)

`Wine` needs to be installed.
On macOS, it is installable via Homebrew:  

```sh
brew install wine
```

On Linux, it is installable via:

```sh
sudo apt install wine
```

On GNU/Linux you can install `Wine` from your distro package manager.

Please mind that `Wine` requires an Xorg display, so you should set correctly your DISPLAY env var (you can use `Xvfb` if you don't have/want a real Xorg display running)

## Run on-the-fly (for devs)

If you're a developer, you may want to use directly `yarn run dev` (in project root) instead of compiling the code each time.
Please note that autostart feature will not work in this mode.


================================================
FILE: app/agents.json
================================================
{
    "userAgents": [
        "Mozilla/5.0 (X11; Linux x86_64; rv:141.0) Gecko/20100101 Firefox/141.0",
        "Mozilla/5.0 (Macintosh; Intel Mac OS X 15_7_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36"
    ]
}


================================================
FILE: app/css/settings.css
================================================
html{
  -webkit-user-select: none;
  user-select: none;
}

header {
  -webkit-app-region: drag;
  display: block;
  border-bottom: 1px solid #ccc
}

header h4 {
  margin-top: 2px;
}

main {
  margin: 10px auto;
  padding: 20px;
}

#save-button{
  bottom: 0;
  right: 0;
}

label:after {
  width: 200px
}


================================================
FILE: app/html/about.html
================================================
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <script type="text/javascript">
  window.jQuery = window.$ = require('../js/lib/jquery.min.js');
  window.Hammer = require('../js/lib/hammer.min.js');
  window.app = require('@electron/remote');
  </script>
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.0/css/materialize.min.css">
  <link rel="stylesheet" href="../css/settings.css">
  <script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.0/js/materialize.min.js"></script>
  <script src="../js/views/about.js"></script>
  <title>About</title>
</head>
<body>
  <main class="main-container">
    <header>
      <h4 class="teal-text text-lighten-1"><script> document.write(_("Settings")); </script></h4>
    </header>

    <div id="settings-wrapper">
        <p>Unofficial WhatsApp Desktop Client for OSX, Linux and Windows. Build with Electron.</p>
        <p>This is <b>NOT</b> an official product. This project does not attempt to reverse engineer the WhatsApp API or attempt to
            reimplement any part of the WhatsApp client. Any communication between the user and WhatsApp servers is handled by
            official WhatsApp Web itself; this is just a native wrapper for WhatsApp Web, like a browser.</p>
        <p>App version: <span id="appversion"></span></p>
        <p><b><span id="appupdates"></span></b></p>
        <p>Website: <a href="http://oothkoo.com" target="_blank">http://oothkoo.com</a></p>
    </div>
  </main>
</body>
</html>


================================================
FILE: app/html/phoneinfo.html
================================================
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <script type="text/javascript">
  window.jQuery = window.$ = require('../js/lib/jquery.min.js');
  window.Hammer = require('../js/lib/hammer.min.js');
  window.app = require('@electron/remote');
  </script>
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.0/css/materialize.min.css">
  <link rel="stylesheet" href="../css/settings.css">
  <script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.0/js/materialize.min.js"></script>
  <script src="../js/views/phoneinfo.js"></script>
  <title>Phone Info</title>
</head>
<body>
  <main class="main-container">
    <header>
      <h4 class="teal-text text-lighten-1">Phone Info</h4>
    </header>

    <div id="settings-wrapper">
      <div class="row">
        <div class="col s6">
            <p>Mobile number: <span id="me"></span></p>
            <p>Battery: <span id="battery"></span></p>
            <p>Phone: <span id="manufacturer"></span> <span id="model"></span> <span id="platform"></span>
                <span id="os_version"></span> <span id="os_build_number"></span></p>
            <p>WhatsApp version: <span id="wa_version"></span></p>
        </div>
      </div>

      <div class="row">
        <div class="col s6 offset-s6 ">
          <a id="close-button" class="waves-effect waves-light btn">Close</a>
        </div>
      </div>
    </div>
  </main>
</body>
</html>


================================================
FILE: app/html/settings.html
================================================
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <script type="text/javascript">
  window.jQuery = window.$ = require('../js/lib/jquery.min.js');
  window.Hammer = require('../js/lib/hammer.min.js');
  window.app = require('@electron/remote');
  _ = window.app.getGlobal("_");
  </script>
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.0/css/materialize.min.css">
  <link rel="stylesheet" href="../css/settings.css">
  <script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.0/js/materialize.min.js"></script>
  <script src="../js/views/settings.js"></script>
  <title></title>
</head>
<body>
  <main class="main-container">
    <header>
      <h4 class="teal-text text-lighten-1"><script> document.write(_("Settings")); </script></h4>
    </header>
    <div id="settings-wrapper">
      <p>
        <input type="checkbox" id="avatars" />
        <label for="avatars"><script> document.write(_("Hide Avatars")); </script></label>
      </p>
      <p>
        <input type="checkbox" id="previews" />
        <label for="previews"><script> document.write(_("Hide Message Previews")); </script></label>
      </p>
      <p>
        <input type="checkbox" id="trayicon" />
        <label for="trayicon"><script> document.write(_("Show Tray Icon")); </script>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <small>[Windows/Linux]</small></label>
      </p>
      <p>
        <input type="checkbox" id="startminimized" />
        <label for="startminimized"><script> document.write(_("Minimize to tray on startup")); </script></label>
      </p>
      <p>
        <input type="checkbox" id="autostart" />
        <label for="autostart"><script> document.write(_("Auto start on login")); </script>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <small>[Windows/Linux]</small></label>
      </p>
      <p>
        <input type="checkbox" id="autoHideMenuBar" />
        <label for="autoHideMenuBar"><script> document.write(_("Auto hide menu bar")); </script>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <small>[Windows/Linux]</small></label>
      </p>
      <p>
        <input type="checkbox" id="disablegpu" />
        <label for="disablegpu"><script> document.write(_("Disable GPU (restart to take effect)")); </script></label>
      </p>
      <p>
        <input type="checkbox" id="globalshortcut" />
        <label for="globalshortcut"><script> document.write(_("Enable Hot Keys (CmdOrCtrl + Alt + W, restart to take effect)")); </script></label>
      </p>
      <p>
        <input type="checkbox" id="darkMode" />
        <label for="darkMode"><script> document.write(_("Dark Mode")); </script></label>
      </p>
      <p>
        <input type="checkbox" id="blurImages" />
        <label for="blurImages"><script> document.write(_("Blur images and emojis (visible on mouseover)")); </script></label>
      </p>
      <div class="row">
        <div class="input-field col s8">
          <input id="thumb-size" type="number" class="validate"  min="50" max="150">
          <label id="thumb-size_label" for="thumb-size" data-error="Must be between 50 and 150"><script> document.write(_("Thumb Size")); </script></label>
        </div>
      </div>
      <p>
          <label id="fontSize_label" for="fontSize"><script> document.write(_("Text size")); </script></label>
          <select id="fontSize" style="display: inline;">
              <option value="small">Small</option>
              <option value="normal" selected="selected">Normal</option>
              <option value="medium">Large</option>
              <option value="large">X-Large</option>
          </select>
      </p>

      <p>
        <input type="checkbox" id="useProxy" />
        <label for="useProxy"><script> document.write(_("Use Proxy (Changes in proxy settings require app restart)")); </script></label>
      </p>

      <div class="row">
        <div class="input-field col s6">
          <input id="httpProxy" type="text" class="validate">
          <label id="httpProxy_label" for="httpProxy" data-error="This field is required if you are using a proxy"><script> document.write(_("Http Proxy")); </script></label>
        </div>
        <div class="input-field col s6">
          <input id="httpsProxy" type="text" placeholder="Leave blank to use the same" class="validate">
          <label id="httpsProxy_label" for="httpsProxy" ><script> document.write(_("Https Proxy")); </script></label>
        </div>
      </div>

      <p>
        <input type="checkbox" id="custombackground_enable" onchange="chooseChatBackground();" />
        <label for="custombackground_enable"><script> document.write(_("Load custom chat background")); </script></label>
        <input type="text" id="custombackground_file" val="" readonly="readonly" />
      </p>
      <div class="row">
        <div class="input-field col s8">
          <input id="background_opacity" type="number" class="validate"  min="0" max="100">
          <label id="background_opacity_label" for="background_opacity" data-error="Must be between 0 and 100"><script> document.write(_("Background opacity")); </script></label>
        </div>
      </div>

      <p>
        <input type="checkbox" id="customcss_enable" onchange="chooseCustomCSS();" />
        <label for="customcss_enable"><script> document.write(_("Load custom CSS")); </script></label>
        <input type="text" id="customcss_file" val="" readonly="readonly" />
      </p>

      <div class="row">
        <div class="col s6 offset-s6 ">
          <a id="close-button" class="waves-effect waves-light btn"><script> document.write(_("Close")); </script></a>
          <a id="save-button" class="waves-effect waves-light btn"><script> document.write(_("Save")); </script></a>
        </div>
      </div>
    </div>
  </main>
</body>
</html>


================================================
FILE: app/js/injected.js
================================================
(function () {

    const {ipcRenderer} = require('electron');
    var updatePhoneInfoInterval = null;

    function updatePhoneInfo() {
        if (window.Store == undefined || window.Store.Conn == undefined) {
            return;
        }
        ipcRenderer.send('phoneinfoupdate', {
            'info': window.Store.Stream.info,
            'me': "+" + window.Store.Conn.me.split("@")[0],
            'battery': window.Store.Conn.battery,
            'plugged': window.Store.Conn.plugged,
            'platform': window.Store.Conn.platform,
            'phoneActive': window.Store.Stream.phoneActive,
            'phone': {
                'manufacturer': window.Store.Conn.phone.device_manufacturer,
                'model': window.Store.Conn.phone.device_model,
                'mcc': window.Store.Conn.phone.mcc,
                'mnc': window.Store.Conn.phone.mnc,
                'os_build_number': window.Store.Conn.phone.os_build_number,
                'os_version': window.Store.Conn.phone.os_version,
                'wa_version': window.Store.Conn.phone.wa_version
            }
        });
        if (updatePhoneInfoInterval != null) {
            clearInterval(updatePhoneInfoInterval);
            updatePhoneInfoInterval = null;
            setInterval(updatePhoneInfo, 2000)
        }
    }

    console.log("Waiting for DOMContentLoaded");
    document.addEventListener('DOMContentLoaded', function () {
        console.log("DOMContentLoaded event");
        updatePhoneInfoInterval = setInterval(updatePhoneInfo, 500);

        // pass in the target node, as well as the observer options
        var observer = new MutationObserver(function (mutations) {
            console.log("Mutations occurred: ", mutations.length);

            var inputSearch = document.querySelector("input.input-search");
            if (inputSearch) {
                console.log("Adding event listeners");

                document.addEventListener("keydown", function (event) {
                    // cmd+k and cmd+f focuses on search input.
                    if ((event.keyCode === 75 || event.keyCode == 70) && event.metaKey === true)
                        inputSearch.focus();
                });

                console.log("Disconnecting the observer");
                observer.disconnect();
            }
        });

        var config = {childList: true, subtree: true};
        observer.observe(document.querySelector("body"), config);

    }, false);

    setInterval(function() {
        Array.from(document.querySelectorAll('audio')).map(function(audio) {
            audio.playbackRate = (window.audioRate || 1)
        });
        if (window.audioRate) {
            Array.from(document.querySelectorAll('.meta-audio *:first-child')).map(function(span) {
                span.innerHTML = window.audioRate.toFixed(1) + "x&nbsp;";
            });
        }
    }, 200);

    var NativeNotification = Notification;
    Notification = function(title, options) {
        if (remote.getGlobal("config").currentSettings.quietMode) {
            return;
        }
    	var notification = new NativeNotification(title, options);

    	notification.addEventListener('click', function() {
    		ipcRenderer.send('notificationClick');
    	});

    	return notification;
    }

    Notification.prototype = NativeNotification.prototype;
    Notification.permission = NativeNotification.permission;
    Notification.requestPermission = NativeNotification.requestPermission.bind(Notification);

})();


================================================
FILE: app/js/views/about.js
================================================
var whatsApp = require('@electron/remote').getGlobal("whatsApp");
var pjson = require('@electron/remote').getGlobal('pjson');

$(document).ready(() => {
    $("#appversion").html(pjson["version"]);
    if (whatsApp.newVersion == null) {
        $("#appupdates").html("Unable to verify latest version from GitHub - please close and reopen this window");
    } else if (whatsApp.newVersion != "v"+pjson.version) {
        $("#appupdates").html("A new version is available: " + whatsApp.newVersion + "!");
    } else if (whatsApp.newVersion == "v"+pjson.version) {
        $("#appupdates").html("You're using latest version");
    }
});


================================================
FILE: app/js/views/phoneinfo.js
================================================
var whatsApp = require('@electron/remote').getGlobal("whatsApp");
var phoneinfo = require('@electron/remote').getGlobal('phoneinfo');

var PhoneInfoView = {
    bindEvents() {
        $this = this;
        $("#close-button").on("click", () => {
            phoneinfo.window.close();
        });
    },

    init() {
        console.log(phoneinfo);
        if (phoneinfo.infos != null) {
            $("#me").html(phoneinfo.infos.me);
            $("#battery").html(phoneinfo.infos.battery + "% (" + (phoneinfo.infos.plugged ? "charging" : "discharging") + ")");
            $("#platform").html(phoneinfo.infos.platform);
            $("#manufacturer").html(phoneinfo.infos.phone.manufacturer);
            $("#model").html(phoneinfo.infos.phone.model);
            $("#os_version").html(phoneinfo.infos.phone.os_version);
            $("#wa_version").html(phoneinfo.infos.phone.wa_version);
            $("#os_build_number").html(phoneinfo.infos.phone.os_build_number);
        } else {
            $("#me").html("Not available, try to refresh this page");
        }
        this.bindEvents();
    }
};

$(document).ready(() => {
    PhoneInfoView.init();
});


================================================
FILE: app/js/views/settings.js
================================================
var whatsApp = require('@electron/remote').getGlobal("whatsApp");
var settings = require('@electron/remote').getGlobal('settings');
var config = require('@electron/remote').getGlobal('config');
const {dialog} = require('@electron/remote');

var SettingsView = {
    bindEvents() {
        $this = this;
        $("#save-button").on("click", (e) => {
            e.preventDefault();
            if ($(".invalid").length > 0 ) {
                return;
            }
            $this.saveSettings();
            settings.window.close();
        });

        $("#close-button").on("click", () => {
            settings.window.close();
        });

        $("#useProxy").on("change", () => {
            $("#httpProxy").prop("disabled", !($("#useProxy").is(":checked")));
            $("#httpsProxy").prop("disabled", !($("#useProxy").is(":checked")));
        });
    },

    init() {
        document.title = _("Settings");

        $("#custombackground_enable").attr("checked", config.get("background-image") != undefined);
        if (config.get("background-image") != undefined) {
            $("#custombackground_file").val(config.get("background-image"));
            $("#background_opacity").val(config.get("background-opacity"));
        } else {
            $("#background_opacity").val("100");
        }

        if (config.get("fontSize") != undefined) {
            $("#fontSize").val(config.get("fontSize"));
        }

        $("#darkMode").attr("checked", config.get("darkMode") == true);
        $("#blurImages").attr("checked", config.get("blurImages") == true);
        $("#autoHideMenuBar").attr("checked", config.get("autoHideMenuBar") == true);
        $("#disablegpu").attr("checked", config.get("disablegpu") == true);
        $("#globalshortcut").attr("checked", config.get("globalshortcut") == true);
        $("#autostart").attr("checked", config.get("autostart") == true);
        $("#startminimized").attr("checked", config.get("startminimized") == true);
        $("#trayicon").attr("checked", config.get("trayicon") != false);
        $("#avatars").attr("checked", config.get("hideAvatars"));
        $("#previews").attr("checked", config.get("hidePreviews"));
        if (config.get("thumbSize")) {
            $("#thumb-size").val(config.get("thumbSize"));
        }
        $("#useProxy").attr("checked", config.get("useProxy"));
        $("#httpProxy").val(config.get("httpProxy"));
        $("#httpsProxy").val(config.get("httpsProxy"));
        $("#httpProxy").prop("disabled", !($("#useProxy").is(":checked")));
        $("#httpsProxy").prop("disabled", !($("#useProxy").is(":checked")));

        $("#customcss_enable").attr("checked", config.get("customcss") != undefined);
        if ($("#customcss_enable").is(":checked")) {
            $("#customcss_file").val(config.get("customcss"));
        }

        // Disable unavailable options
        if (process.platform === 'darwin') {
            $("#autostart").prop("disabled", true);
            $("#autoHideMenuBar").prop("disabled", true);
            $("#trayicon").prop("disabled", true);
            $("#trayicon").prop("checked", false);
        }

        this.bindEvents();
    },

    saveSettings() {

        if ($("#customcss_enable").is(":checked")) {
            config.set("customcss", $("#customcss_file").val());
        } else {
            config.set("customcss", undefined);
        }

        if ($("#custombackground_enable").is(":checked")) {
            config.set("background-image", $("#custombackground_file").val());
            config.set("background-opacity", $("#background_opacity").val());
        } else {
            config.set("background-image", undefined);
        }

        config.set("fontSize", $("#fontSize").val());

        config.set("darkMode", $("#darkMode").is(":checked"));
        config.set("blurImages", $("#blurImages").is(":checked"));
        config.set("autoHideMenuBar", $("#autoHideMenuBar").is(":checked"));
        config.set("disablegpu", $("#disablegpu").is(":checked"));
        config.set("globalshortcut", $("#globalshortcut").is(":checked"));
        config.set("autostart", $("#autostart").is(":checked"));
        config.set("startminimized", $("#startminimized").is(":checked"));
        config.set("hideAvatars", $("#avatars").is(":checked"));
        config.set("hidePreviews", $("#previews").is(":checked"));
        config.set("thumbSize", parseInt($("#thumb-size").val(), 10));
        config.set("trayicon", $("#trayicon").is(":checked"));
        if ($("#useProxy").is(":checked")) {
            config.set("useProxy", $("#useProxy").is(":checked"));
            config.set("httpProxy", $("#httpProxy").val());
            config.set("httpsProxy", $("#httpsProxy").val());
        } else {
            config.unSet("useProxy");
            config.unSet("httpProxy");
            config.unSet("httpsProxy");
        }
        config.saveConfiguration();
        config.applyConfiguration();
        whatsApp.window.reload();
    }
};

function chooseCustomCSS() {
    if ($("#customcss_enable").is(":checked")) {
        dialog.showOpenDialog(function (fileNames) {
            if (fileNames === undefined || fileNames.length == 0) {
                $("#customcss_enable").removeAttr("checked");
                return;
            }
            $("#customcss_file").val(fileNames[0]);
        });
    } else {
        $("#customcss_file").val("");
    }
}

function chooseChatBackground() {
    if ($("#custombackground_enable").is(":checked")) {
        dialog.showOpenDialog(function (fileNames) {
            if (fileNames === undefined || fileNames.length == 0) {
                $("#custombackground_enable").removeAttr("checked");
                return;
            }
            if (fileNames[0].endsWith(".jpg") || fileNames[0].endsWith(".jpeg")
                || fileNames[0].endsWith(".png")
                || fileNames[0].endsWith(".gif")) {
                $("#custombackground_file").val(fileNames[0]);
            } else {
                alert(_("Please choose a JPEG or PNG file"));
                $("#custombackground_enable").removeAttr("checked");
            }
        });
    } else {
        $("#custombackground_file").val("");
    }
}

$(document).ready(() => {
    SettingsView.init();
});


================================================
FILE: app/locale/de_DE/messages.po
================================================
# Whatsapp Desktop translations.
#
msgid ""
msgstr ""
"Project-Id-Version: Whatsapp-Desktop\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-06-17 11:15+0200\n"
"PO-Revision-Date: 2017-11-28 10:48+0100\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.0.4\n"
"Last-Translator: mrprobot\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"Language: de_DE\n"

#: app/main.js:168 app/main.js:192 app/main.js:198 app/main.js:214
msgid "Show"
msgstr "Anzeigen"

#: app/main.js:174 app/menu.js:146 app/main.js:198 app/menu.js:159
#: app/main.js:204 app/main.js:220
msgid "Hide"
msgstr "Ausblenden"

#: app/main.js:181 app/menu.js:163 app/menu.js:191 app/main.js:205
#: app/menu.js:176 app/menu.js:204 app/main.js:211 app/menu.js:197
#: app/main.js:227
msgid "Quit"
msgstr "Beenden"

#: app/menu.js:6
msgid "Edit"
msgstr "Bearbeiten"

#: app/menu.js:9
msgid "Undo"
msgstr "Rückgängig"

#: app/menu.js:14
msgid "Redo"
msgstr "Wiederherstellen"

#: app/menu.js:22
msgid "Cut"
msgstr "Ausschneiden"

#: app/menu.js:27
msgid "Copy"
msgstr "Kopieren"

#: app/menu.js:32
msgid "Paste"
msgstr "Einfügen"

#: app/menu.js:37
msgid "Select All"
msgstr "Alles auswählen"

#: app/menu.js:45 app/html/settings.html:20
msgid "Settings"
msgstr "Einstellungen"

#: app/menu.js:54
msgid "View"
msgstr "Ansicht"

#: app/menu.js:57
msgid "Reload"
msgstr "Neu laden"

#: app/menu.js:65
msgid "Toggle Full Screen"
msgstr "Vollbild"

#: app/menu.js:78
msgid "Toggle Developer Tools"
msgstr "Entwickler Werkzeuge"

#: app/menu.js:93 app/menu.js:106
msgid "Window"
msgstr "Fenster"

#: app/menu.js:97 app/menu.js:110
msgid "Minimize"
msgstr "Minimieren"

#: app/menu.js:102 app/html/settings.html:56 app/menu.js:115
#: app/html/settings.html:60 app/html/settings.html:64
#: app/html/settings.html:68
msgid "Close"
msgstr "Schließen"

#: app/menu.js:109 app/menu.js:122
msgid "Audio"
msgstr "Lautstärke"

#: app/menu.js:112 app/menu.js:125
msgid "Increase Audio Rate by 20%"
msgstr "Lautstärke um 20% erhöhen"

#: app/menu.js:121 app/menu.js:134
msgid "Decrease Audio Rate by 20%"
msgstr "Lautstärke um 20% senken"

#: app/menu.js:139 app/menu.js:184 app/menu.js:152 app/menu.js:197
msgid "About"
msgstr "Über"

#: app/menu.js:151 app/menu.js:164
msgid "Hide Others"
msgstr "Andere ausblenden"

#: app/menu.js:156 app/menu.js:169
msgid "Show All"
msgstr "Alles anzeigen"

#: app/menu.js:175 app/menu.js:188
msgid "Bring All to Front"
msgstr "Alle in Vordergrund bringen"

#: app/html/settings.html:25
msgid "Hide Avatars"
msgstr "Avatare ausblenden"

#: app/html/settings.html:29
msgid "Hide Message Previews"
msgstr "Nachrichten Vorschau ausblenden"

#: app/html/settings.html:40 app/html/settings.html:44
#: app/html/settings.html:48 app/html/settings.html:52
msgid "Use Proxy (Changes in proxy settings require app restart)"
msgstr "Proxy verwenden (Änderungen benötigen Neustart der App)"

#: app/html/settings.html:50 app/html/settings.html:54
#: app/html/settings.html:58 app/html/settings.html:62
msgid "Https Proxy"
msgstr "Https Proxy"

#: app/html/settings.html:57 app/html/settings.html:61
#: app/html/settings.html:65 app/html/settings.html:69
msgid "Save"
msgstr "Speichern"

#: app/menu.js:91
msgid "Phone info"
msgstr "Telefon Info"

#: app/html/settings.html:33
msgid "Show Tray Icon"
msgstr "Symbol im Tray anzeigen"

#: app/html/settings.html:37
msgid "Minimize to tray on startup"
msgstr "Minimiert starten"

#: app/html/settings.html:41
msgid "Auto start on login"
msgstr "Autostart"


================================================
FILE: app/locale/en_US/messages.po
================================================
# Whatsapp Desktop translations.
#
msgid ""
msgstr ""
"Project-Id-Version: Whatsapp-Desktop\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-06-17 11:15+0200\n"
"PO-Revision-Date: 2017-07-10 09:58+0100\n"
"Last-Translator: void\n"
"Language-Team: \n"
"Language: en\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.6.10\n"

#: app/main.js:168 app/main.js:192 app/main.js:198 app/main.js:214
msgid "Show"
msgstr "Show"

#: app/main.js:174 app/menu.js:146 app/main.js:198 app/menu.js:159
#: app/main.js:204 app/main.js:220
msgid "Hide"
msgstr "Hide"

#: app/main.js:181 app/menu.js:163 app/menu.js:191 app/main.js:205
#: app/menu.js:176 app/menu.js:204 app/main.js:211 app/menu.js:197
#: app/main.js:227
msgid "Quit"
msgstr "Quit"

#: app/menu.js:6
msgid "Edit"
msgstr "Edit"

#: app/menu.js:9
msgid "Undo"
msgstr "Undo"

#: app/menu.js:14
msgid "Redo"
msgstr "Redo"

#: app/menu.js:22
msgid "Cut"
msgstr "Cut"

#: app/menu.js:27
msgid "Copy"
msgstr "Copy"

#: app/menu.js:32
msgid "Paste"
msgstr "Paste"

#: app/menu.js:37
msgid "Select All"
msgstr "Select All"

#: app/menu.js:45 app/html/settings.html:20
msgid "Settings"
msgstr "Settings"

#: app/menu.js:54
msgid "View"
msgstr "View"

#: app/menu.js:57
msgid "Reload"
msgstr "Reload"

#: app/menu.js:65
msgid "Toggle Full Screen"
msgstr "Toggle Full Screen"

#: app/menu.js:78
msgid "Toggle Developer Tools"
msgstr "Toggle Developer Tools"

#: app/menu.js:93 app/menu.js:106
msgid "Window"
msgstr "Window"

#: app/menu.js:97 app/menu.js:110
msgid "Minimize"
msgstr "Minimize"

#: app/menu.js:102 app/html/settings.html:56 app/menu.js:115
#: app/html/settings.html:60 app/html/settings.html:64
#: app/html/settings.html:68
msgid "Close"
msgstr "Close"

#: app/menu.js:109 app/menu.js:122
msgid "Audio"
msgstr "Audio"

#: app/menu.js:112 app/menu.js:125
msgid "Increase Audio Rate by 20%"
msgstr "Increase Audio Rate by 20%"

#: app/menu.js:121 app/menu.js:134
msgid "Decrease Audio Rate by 20%"
msgstr "Decrease Audio Rate by 20%"

#: app/menu.js:139 app/menu.js:184 app/menu.js:152 app/menu.js:197
msgid "About"
msgstr "About"

#: app/menu.js:151 app/menu.js:164
msgid "Hide Others"
msgstr "Hide Others"

#: app/menu.js:156 app/menu.js:169
msgid "Show All"
msgstr "Show All"

#: app/menu.js:175 app/menu.js:188
msgid "Bring All to Front"
msgstr "Bring All to Front"

#: app/html/settings.html:25
msgid "Hide Avatars"
msgstr "Hide Avatars"

#: app/html/settings.html:29
msgid "Hide Message Previews"
msgstr "Hide Message Previews"

#: app/html/settings.html:40 app/html/settings.html:44
#: app/html/settings.html:48 app/html/settings.html:52
msgid "Use Proxy (Changes in proxy settings require app restart)"
msgstr "Use Proxy (Changes in proxy settings require app restart)"

#: app/html/settings.html:50 app/html/settings.html:54
#: app/html/settings.html:58 app/html/settings.html:62
msgid "Https Proxy"
msgstr "Https Proxy"

#: app/html/settings.html:57 app/html/settings.html:61
#: app/html/settings.html:65 app/html/settings.html:69
msgid "Save"
msgstr "Save"

#: app/menu.js:91
msgid "Phone info"
msgstr "Phone info"

#: app/html/settings.html:33
msgid "Show Tray Icon"
msgstr "Show Tray Icon"

#: app/html/settings.html:37
msgid "Minimize to tray on startup"
msgstr "Minimize to tray on startup"

#: app/html/settings.html:41
msgid "Auto start on login"
msgstr "Auto start on login"

#~ msgid "Thumb Size"
#~ msgstr "Thumb Size"


================================================
FILE: app/locale/es_ES/messages.po
================================================
# Whatsapp Desktop translations.
#
msgid ""
msgstr ""
"Project-Id-Version: Whatsapp-Desktop\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-06-17 11:15+0200\n"
"PO-Revision-Date: 2017-08-26 17:11-0300\n"
"Language-Team: Mauricio López\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.0.3\n"
"Last-Translator: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"Language: es_419\n"

#: app/main.js:168 app/main.js:192 app/main.js:198 app/main.js:214
msgid "Show"
msgstr "Mostrar"

#: app/main.js:174 app/menu.js:146 app/main.js:198 app/menu.js:159
#: app/main.js:204 app/main.js:220
msgid "Hide"
msgstr "Ocultar"

#: app/main.js:181 app/menu.js:163 app/menu.js:191 app/main.js:205
#: app/menu.js:176 app/menu.js:204 app/main.js:211 app/menu.js:197
#: app/main.js:227
msgid "Quit"
msgstr "Salir"

#: app/menu.js:6
msgid "Edit"
msgstr "Editar"

#: app/menu.js:9
msgid "Undo"
msgstr "Deshacer"

#: app/menu.js:14
msgid "Redo"
msgstr "Rehacer"

#: app/menu.js:22
msgid "Cut"
msgstr "Cortar"

#: app/menu.js:27
msgid "Copy"
msgstr "Copiar"

#: app/menu.js:32
msgid "Paste"
msgstr "Pegar"

#: app/menu.js:37
msgid "Select All"
msgstr "Seleccionar todo"

#: app/menu.js:45 app/html/settings.html:20
msgid "Settings"
msgstr "Ajustes"

#: app/menu.js:54
msgid "View"
msgstr "Ver"

#: app/menu.js:57
msgid "Reload"
msgstr "Actualizar"

#: app/menu.js:65
msgid "Toggle Full Screen"
msgstr "Alternar pantalla completa"

#: app/menu.js:78
msgid "Toggle Developer Tools"
msgstr "Alternar herramientas de desarrollo"

#: app/menu.js:93 app/menu.js:106
msgid "Window"
msgstr "Ventana"

#: app/menu.js:97 app/menu.js:110
msgid "Minimize"
msgstr "Minimizar"

#: app/menu.js:102 app/html/settings.html:56 app/menu.js:115
#: app/html/settings.html:60 app/html/settings.html:64
#: app/html/settings.html:68
msgid "Close"
msgstr "Cerrar"

#: app/menu.js:109 app/menu.js:122
msgid "Audio"
msgstr "Audio"

#: app/menu.js:112 app/menu.js:125
msgid "Increase Audio Rate by 20%"
msgstr "Subir volumen un 20%"

#: app/menu.js:121 app/menu.js:134
msgid "Decrease Audio Rate by 20%"
msgstr "Bajar volumen un 20%"

#: app/menu.js:139 app/menu.js:184 app/menu.js:152 app/menu.js:197
msgid "About"
msgstr "Acerca de"

#: app/menu.js:151 app/menu.js:164
msgid "Hide Others"
msgstr "Ocultar otros"

#: app/menu.js:156 app/menu.js:169
msgid "Show All"
msgstr "Mostrar todos"

#: app/menu.js:175 app/menu.js:188
msgid "Bring All to Front"
msgstr "Traer todos al frente"

#: app/html/settings.html:25
msgid "Hide Avatars"
msgstr "Ocultar avatares"

#: app/html/settings.html:29
msgid "Hide Message Previews"
msgstr "Ocultar previsualización de mensajes"

#: app/html/settings.html:40 app/html/settings.html:44
#: app/html/settings.html:48 app/html/settings.html:52
msgid "Use Proxy (Changes in proxy settings require app restart)"
msgstr "Usar proxy (los cambios en los ajustes del proxy requieren reiniciar la aplicación)"

#: app/html/settings.html:50 app/html/settings.html:54
#: app/html/settings.html:58 app/html/settings.html:62
msgid "Https Proxy"
msgstr "Proxy https"

#: app/html/settings.html:57 app/html/settings.html:61
#: app/html/settings.html:65 app/html/settings.html:69
msgid "Save"
msgstr "Guardar"

#: app/menu.js:91
msgid "Phone info"
msgstr "Información del teléfono"

#: app/html/settings.html:33
msgid "Show Tray Icon"
msgstr "Mostrar ícono en la barra de notificación"

#: app/html/settings.html:37
msgid "Minimize to tray on startup"
msgstr "Minimizar a la barra de notifiación al iniciar"

#: app/html/settings.html:41
msgid "Auto start on login"
msgstr "Inicio automático al iniciar sesión"


================================================
FILE: app/locale/it_IT/messages.po
================================================
# Whatsapp Desktop translations.
#
msgid ""
msgstr ""
"Project-Id-Version: Whatsapp-Desktop\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-06-17 11:15+0200\n"
"PO-Revision-Date: 2017-07-10 09:59+0100\n"
"Last-Translator: void\n"
"Language-Team: \n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.6.10\n"

#: app/main.js:168 app/main.js:192 app/main.js:198 app/main.js:214
msgid "Show"
msgstr "Visualizza"

#: app/main.js:174 app/menu.js:146 app/main.js:198 app/menu.js:159
#: app/main.js:204 app/main.js:220
msgid "Hide"
msgstr "Nascondi"

#: app/main.js:181 app/menu.js:163 app/menu.js:191 app/main.js:205
#: app/menu.js:176 app/menu.js:204 app/main.js:211 app/menu.js:197
#: app/main.js:227
msgid "Quit"
msgstr "Esci"

#: app/menu.js:6
msgid "Edit"
msgstr "Modifica"

#: app/menu.js:9
msgid "Undo"
msgstr "Annulla"

#: app/menu.js:14
msgid "Redo"
msgstr "Ripeti"

#: app/menu.js:22
msgid "Cut"
msgstr "Taglia"

#: app/menu.js:27
msgid "Copy"
msgstr "Copia"

#: app/menu.js:32
msgid "Paste"
msgstr "Incolla"

#: app/menu.js:37
msgid "Select All"
msgstr "Seleziona tutto"

#: app/menu.js:45 app/html/settings.html:20
msgid "Settings"
msgstr "Impostazioni"

#: app/menu.js:54
msgid "View"
msgstr "Vista"

#: app/menu.js:57
msgid "Reload"
msgstr "Ricarica"

#: app/menu.js:65
msgid "Toggle Full Screen"
msgstr "Attiva/disattiva schermo intero"

#: app/menu.js:78
msgid "Toggle Developer Tools"
msgstr "Attiva/disattiva tool sviluppatori"

#: app/menu.js:93 app/menu.js:106
msgid "Window"
msgstr "Finestra"

#: app/menu.js:97 app/menu.js:110
msgid "Minimize"
msgstr "Minimizza"

#: app/menu.js:102 app/html/settings.html:56 app/menu.js:115
#: app/html/settings.html:60 app/html/settings.html:64
#: app/html/settings.html:68
msgid "Close"
msgstr "Chiudi"

#: app/menu.js:109 app/menu.js:122
msgid "Audio"
msgstr "Audio"

#: app/menu.js:112 app/menu.js:125
msgid "Increase Audio Rate by 20%"
msgstr "Incrementa la velocità dell'audio del 20%"

#: app/menu.js:121 app/menu.js:134
msgid "Decrease Audio Rate by 20%"
msgstr "Decrementa la velocità dell'audio del 20%"

#: app/menu.js:139 app/menu.js:184 app/menu.js:152 app/menu.js:197
msgid "About"
msgstr "Riguardo a"

#: app/menu.js:151 app/menu.js:164
msgid "Hide Others"
msgstr "Nascondi le altre"

#: app/menu.js:156 app/menu.js:169
msgid "Show All"
msgstr "Visualizza tutto"

#: app/menu.js:175 app/menu.js:188
msgid "Bring All to Front"
msgstr "Porta tutto in primo piano"

#: app/html/settings.html:25
msgid "Hide Avatars"
msgstr "Nascondi gli avatars"

#: app/html/settings.html:29
msgid "Hide Message Previews"
msgstr "Nascondi le anteprime dei messaggi"

#: app/html/settings.html:40 app/html/settings.html:44
#: app/html/settings.html:48 app/html/settings.html:52
msgid "Use Proxy (Changes in proxy settings require app restart)"
msgstr "Usa un proxy (è necessario un riavvio)"

#: app/html/settings.html:50 app/html/settings.html:54
#: app/html/settings.html:58 app/html/settings.html:62
msgid "Https Proxy"
msgstr "Proxy HTTPS"

#: app/html/settings.html:57 app/html/settings.html:61
#: app/html/settings.html:65 app/html/settings.html:69
msgid "Save"
msgstr "Salva"

#: app/menu.js:91
msgid "Phone info"
msgstr "Informazioni telefono"

#: app/html/settings.html:33
msgid "Show Tray Icon"
msgstr "Visualizza icona nel vassoio"

#: app/html/settings.html:37
msgid "Minimize to tray on startup"
msgstr "Minimizza nel vassoio all'avvio"

#: app/html/settings.html:41
msgid "Auto start on login"
msgstr "Avvia automaticamente all'accesso"

#~ msgid "Thumb Size"
#~ msgstr "Dimensione anteprima"


================================================
FILE: app/locale/messages.pot
================================================
# Whatsapp Desktop translations.
#
msgid ""
msgstr ""
"Project-Id-Version: Whatsapp-Desktop\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-06-17 11:15+0200\n"
"PO-Revision-Date: 2017-06-17 12:12+0100\n"
"Last-Translator: void\n"
"Language-Team: \n"
"Language: en\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.6.10\n"

#: app/main.js:168 app/main.js:192 app/main.js:198 app/main.js:214
msgid "Show"
msgstr ""

#: app/main.js:174 app/menu.js:146 app/main.js:198 app/menu.js:159
#: app/main.js:204 app/main.js:220
msgid "Hide"
msgstr ""

#: app/main.js:181 app/menu.js:163 app/menu.js:191 app/main.js:205
#: app/menu.js:176 app/menu.js:204 app/main.js:211 app/menu.js:197
#: app/main.js:227
msgid "Quit"
msgstr ""

#: app/menu.js:6
msgid "Edit"
msgstr ""

#: app/menu.js:9
msgid "Undo"
msgstr ""

#: app/menu.js:14
msgid "Redo"
msgstr ""

#: app/menu.js:22
msgid "Cut"
msgstr ""

#: app/menu.js:27
msgid "Copy"
msgstr ""

#: app/menu.js:32
msgid "Paste"
msgstr ""

#: app/menu.js:37
msgid "Select All"
msgstr ""

#: app/menu.js:45 app/html/settings.html:20
msgid "Settings"
msgstr ""

#: app/menu.js:54
msgid "View"
msgstr ""

#: app/menu.js:57
msgid "Reload"
msgstr ""

#: app/menu.js:65
msgid "Toggle Full Screen"
msgstr ""

#: app/menu.js:78
msgid "Toggle Developer Tools"
msgstr ""

#: app/menu.js:93 app/menu.js:106
msgid "Window"
msgstr ""

#: app/menu.js:97 app/menu.js:110
msgid "Minimize"
msgstr ""

#: app/menu.js:102 app/html/settings.html:56 app/menu.js:115
#: app/html/settings.html:60 app/html/settings.html:64
#: app/html/settings.html:68
msgid "Close"
msgstr ""

#: app/menu.js:109 app/menu.js:122
msgid "Audio"
msgstr ""

#: app/menu.js:112 app/menu.js:125
msgid "Increase Audio Rate by 20%"
msgstr ""

#: app/menu.js:121 app/menu.js:134
msgid "Decrease Audio Rate by 20%"
msgstr ""

#: app/menu.js:139 app/menu.js:184 app/menu.js:152 app/menu.js:197
msgid "About"
msgstr ""

#: app/menu.js:151 app/menu.js:164
msgid "Hide Others"
msgstr ""

#: app/menu.js:156 app/menu.js:169
msgid "Show All"
msgstr ""

#: app/menu.js:175 app/menu.js:188
msgid "Bring All to Front"
msgstr ""

#: app/html/settings.html:25
msgid "Hide Avatars"
msgstr ""

#: app/html/settings.html:29
msgid "Hide Message Previews"
msgstr ""

#: app/html/settings.html:40 app/html/settings.html:44
#: app/html/settings.html:48 app/html/settings.html:52
msgid "Use Proxy (Changes in proxy settings require app restart)"
msgstr ""

#: app/html/settings.html:50 app/html/settings.html:54
#: app/html/settings.html:58 app/html/settings.html:62
msgid "Https Proxy"
msgstr ""

#: app/html/settings.html:57 app/html/settings.html:61
#: app/html/settings.html:65 app/html/settings.html:69
msgid "Save"
msgstr ""

#: app/menu.js:91
msgid "Phone info"
msgstr ""

#: app/html/settings.html:33
msgid "Show Tray Icon"
msgstr ""

#: app/html/settings.html:37
msgid "Minimize to tray on startup"
msgstr ""

#: app/html/settings.html:41
msgid "Auto start on login"
msgstr ""


================================================
FILE: app/locale/pt_BR/messages.po
================================================
# Whatsapp Desktop translations.
#
msgid ""
msgstr ""
"Project-Id-Version: Whatsapp-Desktop\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-08-05 17:02+0300\n"
"PO-Revision-Date: 2017-08-05 17:02+0300\n"
"Last-Translator: void\n"
"Language-Team: \n"
"Language: pt_br\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.6.10\n"

#: app/main.js:168 app/main.js:192 app/main.js:198 app/main.js:214
msgid "Show"
msgstr "Mostrar"

#: app/main.js:174 app/menu.js:146 app/main.js:198 app/menu.js:159
#: app/main.js:204 app/main.js:220
msgid "Hide"
msgstr "Ocultar"

#: app/main.js:181 app/menu.js:163 app/menu.js:191 app/main.js:205
#: app/menu.js:176 app/menu.js:204 app/main.js:211 app/menu.js:197
#: app/main.js:227
msgid "Quit"
msgstr "Sair"

#: app/menu.js:6
msgid "Edit"
msgstr "Editar"

#: app/menu.js:9
msgid "Undo"
msgstr "Desfazer"

#: app/menu.js:14
msgid "Redo"
msgstr "Refazer"

#: app/menu.js:22
msgid "Cut"
msgstr "Cortar"

#: app/menu.js:27
msgid "Copy"
msgstr "Copiar"

#: app/menu.js:32
msgid "Paste"
msgstr "Colar"

#: app/menu.js:37
msgid "Select All"
msgstr "Selecionar Tudo"

#: app/menu.js:45 app/html/settings.html:20
msgid "Settings"
msgstr "Configurações"

#: app/menu.js:54
msgid "View"
msgstr "Visualizar"

#: app/menu.js:57
msgid "Reload"
msgstr "Recarregar"

#: app/menu.js:65
msgid "Toggle Full Screen"
msgstr "Tela Cheia"

#: app/menu.js:78
msgid "Toggle Developer Tools"
msgstr "Ferramentas de Desenvolvedor"

#: app/menu.js:93 app/menu.js:106
msgid "Window"
msgstr "Janela"

#: app/menu.js:97 app/menu.js:110
msgid "Minimize"
msgstr "Minimizar"

#: app/menu.js:102 app/html/settings.html:56 app/menu.js:115
#: app/html/settings.html:60 app/html/settings.html:64
#: app/html/settings.html:68
msgid "Close"
msgstr "Fechar"

#: app/menu.js:109 app/menu.js:122
msgid "Audio"
msgstr "Áudio"

#: app/menu.js:112 app/menu.js:125
msgid "Increase Audio Rate by 20%"
msgstr "Aumentar Áudio em 20%"

#: app/menu.js:121 app/menu.js:134
msgid "Decrease Audio Rate by 20%"
msgstr "Diminuir Áudio em 20%"

#: app/menu.js:139 app/menu.js:184 app/menu.js:152 app/menu.js:197
msgid "About"
msgstr "Sobre"

#: app/menu.js:151 app/menu.js:164
msgid "Hide Others"
msgstr "Esconder Outros"

#: app/menu.js:156 app/menu.js:169
msgid "Show All"
msgstr "Mostrar Tudo"

#: app/menu.js:175 app/menu.js:188
msgid "Bring All to Front"
msgstr "Trazer Tudo à Frente"

#: app/html/settings.html:25
msgid "Hide Avatars"
msgstr "Ocultar Avatars"

#: app/html/settings.html:29
msgid "Hide Message Previews"
msgstr "Ocultar Preview de Mensagens "

#: app/html/settings.html:40 app/html/settings.html:44
#: app/html/settings.html:48 app/html/settings.html:52
msgid "Use Proxy (Changes in proxy settings require app restart)"
msgstr "Usar Proxy (Mudanças no proxy requerem o reínicio do app)"

#: app/html/settings.html:50 app/html/settings.html:54
#: app/html/settings.html:58 app/html/settings.html:62
msgid "Https Proxy"
msgstr "Proxy Https"

#: app/html/settings.html:57 app/html/settings.html:61
#: app/html/settings.html:65 app/html/settings.html:69
msgid "Save"
msgstr "Salvar"

#: app/menu.js:91
msgid "Phone info"
msgstr "Informações do Telefone"

#: app/html/settings.html:33
msgid "Show Tray Icon"
msgstr "Mostrar Ícone na Bandeja"

#: app/html/settings.html:37
msgid "Minimize to tray on startup"
msgstr "Minimizar para a bandeja ao iniciar"

#: app/html/settings.html:41
msgid "Auto start on login"
msgstr "Auto iniciar no login"

#~ msgid "Thumb Size"
#~ msgstr "Tamanho da Miniatura"


================================================
FILE: app/locale/ru_RU/messages.po
================================================
# Whatsapp Desktop translations.
#
msgid ""
msgstr ""
"Project-Id-Version: Whatsapp-Desktop\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-06-17 11:15+0200\n"
"PO-Revision-Date: 2017-11-27 19:54+0300\n"
"Last-Translator: void\n"
"Language-Team: \n"
"Language: ru\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.5.4\n"

#: app/main.js:168 app/main.js:192 app/main.js:198 app/main.js:214
msgid "Show"
msgstr "Восстановить"

#: app/main.js:174 app/menu.js:146 app/main.js:198 app/menu.js:159
#: app/main.js:204 app/main.js:220
msgid "Hide"
msgstr "Скрыть"

#: app/main.js:181 app/menu.js:163 app/menu.js:191 app/main.js:205
#: app/menu.js:176 app/menu.js:204 app/main.js:211 app/menu.js:197
#: app/main.js:227
msgid "Quit"
msgstr "Выход"

#: app/menu.js:6
msgid "Edit"
msgstr "Правка"

#: app/menu.js:9
msgid "Undo"
msgstr "Отменить"

#: app/menu.js:14
msgid "Redo"
msgstr "Вернуть"

#: app/menu.js:22
msgid "Cut"
msgstr "Вырезать"

#: app/menu.js:27
msgid "Copy"
msgstr "Копировать"

#: app/menu.js:32
msgid "Paste"
msgstr "Вставить"

#: app/menu.js:37
msgid "Select All"
msgstr "Выделить всё"

#: app/menu.js:45 app/html/settings.html:20
msgid "Settings"
msgstr "Настройки"

#: app/menu.js:54
msgid "View"
msgstr "Вид"

#: app/menu.js:57
msgid "Reload"
msgstr "Перезагрузить"

#: app/menu.js:65
msgid "Toggle Full Screen"
msgstr "Во весь экран"

#: app/menu.js:78
msgid "Toggle Developer Tools"
msgstr "Инструменты разработчика"

#: app/menu.js:93 app/menu.js:106
msgid "Window"
msgstr "Окно"

#: app/menu.js:97 app/menu.js:110
msgid "Minimize"
msgstr "Свернуть"

#: app/menu.js:102 app/html/settings.html:56 app/menu.js:115
#: app/html/settings.html:60 app/html/settings.html:64
#: app/html/settings.html:68
msgid "Close"
msgstr "Закрыть"

#: app/menu.js:109 app/menu.js:122
msgid "Audio"
msgstr "Звук"

#: app/menu.js:112 app/menu.js:125
msgid "Increase Audio Rate by 20%"
msgstr "Увеличить громкость на 20%"

#: app/menu.js:121 app/menu.js:134
msgid "Decrease Audio Rate by 20%"
msgstr "Уменьшить громкость на 20%"

#: app/menu.js:139 app/menu.js:184 app/menu.js:152 app/menu.js:197
msgid "About"
msgstr "О программе"

#: app/menu.js:151 app/menu.js:164
msgid "Hide Others"
msgstr "Скрыть остальные"

#: app/menu.js:156 app/menu.js:169
msgid "Show All"
msgstr "Показать все окна"

#: app/menu.js:175 app/menu.js:188
msgid "Bring All to Front"
msgstr "Расположить сверху"

#: app/html/settings.html:25
msgid "Hide Avatars"
msgstr "Скрывать аватарки"

#: app/html/settings.html:29
msgid "Hide Message Previews"
msgstr "Скрывать содержимое сообщений"

#: app/html/settings.html:40 app/html/settings.html:44
#: app/html/settings.html:48 app/html/settings.html:52
msgid "Use Proxy (Changes in proxy settings require app restart)"
msgstr "Использовать Proxy (Требуется перезапуск программы)"

#: app/html/settings.html:50 app/html/settings.html:54
#: app/html/settings.html:58 app/html/settings.html:62
msgid "Https Proxy"
msgstr "Https Proxy"

#: app/html/settings.html:57 app/html/settings.html:61
#: app/html/settings.html:65 app/html/settings.html:69
msgid "Save"
msgstr "Сохранить"

#: app/menu.js:91
msgid "Phone info"
msgstr "Информация о телефоне"

#: app/html/settings.html:33
msgid "Show Tray Icon"
msgstr "Показывать иконку в трее"

#: app/html/settings.html:37
msgid "Minimize to tray on startup"
msgstr "Свернуть в трей при запуске"

#: app/html/settings.html:41
msgid "Auto start on login"
msgstr "Автозапуск"

#~ msgid "Thumb Size"
#~ msgstr "Размер изображения"


================================================
FILE: app/locale/tr_TR/messages.po
================================================
# Whatsapp Desktop translations.
#
msgid ""
msgstr ""
"Project-Id-Version: Whatsapp-Desktop\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-01-23 19:25+0200\n"
"PO-Revision-Date: 2018-01-23 19:30+0300\n"
"Last-Translator: Demiray Muhterem <tulliana>\n"
"Language-Team: Demiray Muhterem <tulliana>\n"
"Language: tr_TR\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.0.6\n"

#: app/main.js:168 app/main.js:192 app/main.js:198 app/main.js:214
msgid "Show"
msgstr "Göster"

#: app/main.js:174 app/menu.js:146 app/main.js:198 app/menu.js:159
#: app/main.js:204 app/main.js:220
msgid "Hide"
msgstr "Gizle"

#: app/main.js:181 app/menu.js:163 app/menu.js:191 app/main.js:205
#: app/menu.js:176 app/menu.js:204 app/main.js:211 app/menu.js:197
#: app/main.js:227
msgid "Quit"
msgstr "Çıkış"

#: app/menu.js:6
msgid "Edit"
msgstr "Düzenle"

#: app/menu.js:9
msgid "Undo"
msgstr "Geri Al"

#: app/menu.js:14
msgid "Redo"
msgstr "Yenile"

#: app/menu.js:22
msgid "Cut"
msgstr "Kes"

#: app/menu.js:27
msgid "Copy"
msgstr "Kopyala"

#: app/menu.js:32
msgid "Paste"
msgstr "Yapıştır"

#: app/menu.js:37
msgid "Select All"
msgstr "Tümünü Seç"

#: app/menu.js:45 app/html/settings.html:20
msgid "Settings"
msgstr "Ayarlar"

#: app/menu.js:54
msgid "View"
msgstr "Görünüm"

#: app/menu.js:57
msgid "Reload"
msgstr "Tekrar Yükle"

#: app/menu.js:65
msgid "Toggle Full Screen"
msgstr "Tam Ekran"

#: app/menu.js:78
msgid "Toggle Developer Tools"
msgstr "Geliştirici Araçları"

#: app/menu.js:93 app/menu.js:106
msgid "Window"
msgstr "Pencere"

#: app/menu.js:97 app/menu.js:110
msgid "Minimize"
msgstr "Küçült"

#: app/menu.js:102 app/html/settings.html:56 app/menu.js:115
#: app/html/settings.html:60 app/html/settings.html:64
#: app/html/settings.html:68
msgid "Close"
msgstr "Kapat"

#: app/menu.js:109 app/menu.js:122
msgid "Audio"
msgstr "Ses"

#: app/menu.js:112 app/menu.js:125
msgid "Increase Audio Rate by 20%"
msgstr "Ses Oranını %20 Arttır"

#: app/menu.js:121 app/menu.js:134
msgid "Decrease Audio Rate by 20%"
msgstr "Ses Oranını %20 Azalt"

#: app/menu.js:139 app/menu.js:184 app/menu.js:152 app/menu.js:197
msgid "About"
msgstr "Hakkında"

#: app/menu.js:151 app/menu.js:164
msgid "Hide Others"
msgstr "Diğerlerini Gizle"

#: app/menu.js:156 app/menu.js:169
msgid "Show All"
msgstr "Tümünü Göster"

#: app/menu.js:175 app/menu.js:188
msgid "Bring All to Front"
msgstr "Herşeyi Öne Çıkar"

#: app/html/settings.html:25
msgid "Hide Avatars"
msgstr "Avatarları Gizle"

#: app/html/settings.html:29
msgid "Hide Message Previews"
msgstr "Özel Mesajları Gizle"

#: app/html/settings.html:40 app/html/settings.html:44
#: app/html/settings.html:48 app/html/settings.html:52
msgid "Use Proxy (Changes in proxy settings require app restart)"
msgstr "Proxy Kullan (Uygulamayı yeniden başlatmayı gerektirir)"

#: app/html/settings.html:50 app/html/settings.html:54
#: app/html/settings.html:58 app/html/settings.html:62
msgid "Https Proxy"
msgstr "Https Proxy"

#: app/html/settings.html:57 app/html/settings.html:61
#: app/html/settings.html:65 app/html/settings.html:69
msgid "Save"
msgstr "Kaydet"

#: app/menu.js:91
msgid "Phone info"
msgstr "Telefon Bilgisi"

#: app/html/settings.html:33
msgid "Show Tray Icon"
msgstr "Sistem Çubuğunda Göster"

#: app/html/settings.html:37
msgid "Minimize to tray on startup"
msgstr "Başlangıçta sistem çubuğuna küçült"

#: app/html/settings.html:41
msgid "Auto start on login"
msgstr "Girişte otomatik başlat"


================================================
FILE: app/main.js
================================================
(function(scope) {
    "use strict";

    const pkg = require('./package')
    const agents = require('./agents')
    const electron = require('electron')
    const fs = require('fs')
    const request = require('request')
    const nodeGettext = require('node-gettext')
    const gettextParser = require('gettext-parser')
    const AutoLaunch = require('auto-launch')
    const log = require('electron-log')
    const join = require('path').join
    const notifier = require('node-notifier')
    // electron-context-menu replaced with custom handler that supports spellcheck suggestions

    const app = electron.app
    const AppMenu = electron.Menu
    const MenuItem = electron.MenuItem
    const AppTray = electron.Tray
    const NativeImage = electron.nativeImage
    const BrowserWindow = electron.BrowserWindow
    const globalShortcut = electron.globalShortcut

    const isAlreadyLocked = app.requestSingleInstanceLock()
    app.on('second-instance', (event, argv, workingDir) => {
        if (whatsApp.window) {
            if (whatsApp.window.isMinimized()) {
                whatsApp.window.restore()
            }
            whatsApp.window.show()
        }

        var groupLinkOpenRequested = null
        if (argv.length > 1) {
            for(var i = 0; i < argv.length; i++) {
                if (argv[i].indexOf("https://chat.whatsapp.com") >= 0) {
                    groupLinkOpenRequested = argv[i]
                    log.info("Opening a group link: " + groupLinkOpenRequested)
                    break
                }
            }
        }
        if (groupLinkOpenRequested != null) {
            whatsApp.window.webContents.executeJavaScript(
                "var el = document.createElement('a');\
                el.href = \"" + groupLinkOpenRequested + "\"; \
                el.style.display = \"none\"; \
                el.rel = 'noopener noreferrer'; \
                el.id = 'newlink'; \
                document.body.appendChild(el); \
                setTimeout(function() { var el = document.getElementById('newlink'); el.click(); document.body.removeChild(el); }, 500); \
                "
            )
        }
    })

    // Needed for @electron/remote to work.
    app.on('browser-window-created', (_, window) => {
        require("@electron/remote/main").enable(window.webContents)
    })

    if (!isAlreadyLocked) {
        app.quit()
    }

    app.setAppUserModelId('whatsapp-desktop')
    app.setAsDefaultProtocolClient('whatsapp')

    if (process.argv.indexOf('--debug-log') >= 0) {
        log.transports.file.level = 'debug'
        log.info("Log level set from command line switch")
    }
    if (process.argv.indexOf('--disable-gpu') >= 0) {
        log.warn('Disabling GPU acceleration')
        app.disableHardwareAcceleration()
    }

    const userDataDir = app.getPath('userData')
    log.info(`Log init, file '${userDataDir}/whatsapp.log'`)

    var groupLinkOpenRequested = null
    if (process.argv.length > 1) {
        for (var i = 0; i < process.argv.length; i++) {
            if (process.argv[i].indexOf("https://chat.whatsapp.com") >= 0) {
                groupLinkOpenRequested = process.argv[i]
                log.info(`Opening a group link: ${groupLinkOpenRequested}`)
                break
            }
        }
    }

    var supportedLocales = [
      'en_US',
      'it_IT'
    ]

    global.gt = new nodeGettext()
    for (var i in supportedLocales) {
        const locale = supportedLocales[i]
        let messagesFile = `${process.resourcesPath}/app/locale/${locale}/messages.po`
        if (!fs.existsSync(messagesFile)) {
          messagesFile = `./app/locale/${locale}/messages.po`
        }
        log.info(`Loading locale: ${locale}`)
        gt.addTranslations(locale, 'messages', gettextParser.po.parse(fs.readFileSync(messagesFile)))
    }
    gt.setLocale('en_US')
    gt.setTextDomain('messages')
    global._ = function (t) {
        return gt.gettext(t)
    }

    // Setting default language to system language if available
    var syslang = (process.env.LC_ALL != undefined ? process.env.LC_ALL :
        (process.env.LANG != undefined ? process.env.LANG :
            (process.env.LC_MESSAGES != undefined ? process.env.LC_MESSAGES : 'en-US')))
    if (supportedLocales.indexOf(syslang.split(".")[0]) >= 0) {
        log.info("Setting locale " + syslang.split(".")[0])
        gt.setLocale(syslang.split(".")[0])
    }
    else {
        log.warn("No supported locale found, defaulting to en_US")
    }

    global.autolauncher = new AutoLaunch({
        name: app.getName()
    })
    global.onlyOSX = function(callback) {
        if (process.platform === 'darwin') {
            return Function.bind.apply(callback, this, [].slice.call(arguments, 0))
        }
        return function () {}
    }
    global.onlyLinux = function(callback) {
        if (process.platform === 'linux') {
            return Function.bind.apply(callback, this, [].slice.call(arguments, 0))
        }
        return function() {}
    }
    global.onlyWin = function(callback) {
        if (process.platform === 'win32' || process.platform === 'win64') {
            return Function.bind.apply(callback, this, [].slice.call(arguments, 0))
        }
        return function() {}
    }
    global.config = {
        defaultSettings: {
            width: 1000,
            height: 720,
            thumbSize: 0
        },

        currentSettings: {},

        init() {
            config.loadConfiguration()
            config.saveTimeout = null
        },

        loadConfiguration() {
            log.info("Loading configuration")
            var settingsFile = app.getPath('userData') +"/settings.json"
            try {
                var data = fs.readFileSync(settingsFile)
                if (data != "" && data != "{}" && data != "[]") {
                    config.currentSettings = JSON.parse(data)
                    log.info("Configuration loaded from " + settingsFile)
                }
                else {
                    config.currentSettings = config.defaultSettings
                    log.warn("Configuration file empty, loading default")
                }
            }
            catch (e) {
                config.currentSettings = config.defaultSettings
                log.warn("Error loading configuration from " + settingsFile + " (" + e + "), loading default")
            }
            // First time configuration - eg. before app init
            if(config.get("disablegpu") == true) {
                log.warn("Disabling GPU acceleration")
                app.disableHardwareAcceleration()
            }
        },

        applyConfiguration() {
            log.info("Applying configuration")
            if (config.get("maximized") && config.get("startminimized") != true) {
                whatsApp.window.maximize()
            }
            whatsApp.window.webContents.on('dom-ready', function (event, two) {
                var fontSize = config.get("fontSize")
                fontSize = (fontSize == undefined) ? "normal" : fontSize

                var fontCSS = (fontSize != "normal") ? "font-size:" + fontSize + " !important;" : ""
                this.insertCSS('* { text-rendering: optimizeSpeed !important; -webkit-font-smoothing: subpixel-antialiased !important; '
                    + fontCSS + '}')

                var imgpath = config.get("background-image")
                if (imgpath != undefined) {
                    var img = new Buffer(fs.readFileSync(imgpath)).toString('base64')
                    var opacity = parseFloat(config.get("background-opacity"))/100.0
                    var mime = (imgpath.endsWith(".jpg") || imgpath.endsWith(".jpeg"))?"image/jpg":
                        ((imgpath.endsWith(".png")?"image/png":((imgpath.endsWith(".gif")?"image/gif":""))))
                }

                var noAvatar = '.chat-avatar img { display: none !important; }'
                var noPreview = '.chat-secondary .chat-status{z-index: -999;}'

                var thumbSize = '.image-thumb { width: '+ config.currentSettings.thumbSize + 'px  !important;' +
                'height: '+ config.currentSettings.thumbSize + 'px !important;}' +
                '.image-thumb img.image-thumb-body { width: auto !important;' +
                'height: '+ config.currentSettings.thumbSize + 'px !important;}'

                var darkMode = '#pane-side, #pane-side div div div div div div, #side header, #side header div div \
                #side div, #side div div, #side div div button, #side div div label, #side div div input, \
                #main footer, #main footer div, #main footer div div, #main header, #main header div div span, \
                #main header div div div span \
                { background-color: #2E2C2B !important; color: white; }\n \
                .message-in { background-color: #75706E !important; }\n \
                .message, .media-caption { color: #F0F0F0; }\n \
                .message-in .tail-container, .message-in.tail-override-right .tail-container, \
                .message-out.tail-override-right .tail-container, .message-in.tail-override-left \
                .tail-container { background-image: none !important; }\n \
                .block-compose, .block-compose .input-container { background-color: #2E2C2B !important; }\n \
                .pane-chat-header, .chat.active, .chat, .chatlist-panel-search, .pane-header.pane-list-header, \
                .input-chatlist-search, .chatlist-panel-body, .chatlist-panel-search div label input, \
                .chatlist-panel-search div label, #app > div > div > div._3q4NP._1Iexl > div, .message > div > span \
                 { background-color: #2E2C2B !important;, background-image: none !important; }\n \
                .chat-title, .header-title, .chat-body div span { color: white; }';

                var blurImages = "div.message-in img, div.message-out img { filter: contrast(25%) blur(8px) grayscale(75%); } \n \
                div.message-in:hover img, div.message-out:hover img { filter: none; }";

                if (config.currentSettings.hideAvatars) {
                    this.insertCSS(noAvatar)
                }
                if (config.currentSettings.hidePreviews){
                    this.insertCSS(noPreview)
                }
                if (config.currentSettings.darkMode){
                    this.insertCSS(darkMode)
                }
                if (config.currentSettings.blurImages) {
                    this.insertCSS(blurImages)
                }

                if (config.currentSettings.thumbSize) {
                    this.insertCSS(thumbSize)
                }
                if (config.get("customcss") != undefined) {
                    try {
                        this.insertCSS(fs.readFileSync(config.get("customcss"), "utf-8"))
                        log.info("Loaded CSS file: " + config.get("customcss"))
                    }
                    catch (e) {
                        log.error("CSS error: " + e)
                    }
                }
            })

            if (config.get("useProxy")) {
                var session = whatsApp.window.webContents.session
                var httpProxy = config.get("httpProxy")
                var httpsProxy = config.get("httpsProxy") || httpProxy
                if(httpProxy) {
                    log.info("Proxy configured: " + "http="+ httpProxy +";https=" + httpsProxy)
                    session.setProxy("http="+ httpProxy +";https=" + httpsProxy, function(){})
                }
                else {
                    log.info("No proxy")
                }
            }

            // OSX Dock menu
            if (process.platform == 'darwin') {
                const dockMenu = AppMenu.buildFromTemplate([
                  {label: 'Show main window', click () {
                      whatsApp.window.show()
                      whatsApp.window.setAlwaysOnTop(true)
                      whatsApp.window.focus()
                      whatsApp.window.setAlwaysOnTop(false)
                  }}
                ])
                app.dock.setMenu(dockMenu)
                app.on('activate', (event, hasVisibleWindows) => {
                    whatsApp.window.show()
                    whatsApp.window.setAlwaysOnTop(true)
                    whatsApp.window.focus()
                    whatsApp.window.setAlwaysOnTop(false)
                })
            }

            if (config.get("trayicon") != false && whatsApp.tray == undefined) {
                whatsApp.createTray()
            }
            else if (config.get("trayicon") == false && whatsApp.tray != undefined) {
                log.info("Destroying tray icon")
                whatsApp.tray.destroy()
                whatsApp.tray = undefined
            }
            if (config.get("autostart") == true) {
                autolauncher.isEnabled().then(function(enabled) {
                    if (!enabled) {
                        autolauncher.enable()
                        log.info("Autostart enabled")
                    }
                })
            }
            else {
                autolauncher.isEnabled().then(function(enabled) {
                    if (enabled) {
                        autolauncher.disable()
                        log.info("Autostart disabled")
                    }
                })
            }
            whatsApp.window.setMenuBarVisibility(config.get("autoHideMenuBar") != true)
            whatsApp.window.setAutoHideMenuBar(config.get("autoHideMenuBar") == true)
        },

        saveConfiguration() {
            if (config.saveTimeout != null) {
                clearTimeout(config.saveTimeout)
                config.saveTimeout = null
            }
            config.saveTimeout = setTimeout(function() {
                log.info("Saving configuration")
                config.set("maximized", whatsApp.window.isMaximized())
                if (config.currentSettings == undefined || JSON.stringify(config.currentSettings) == "") {
                    // TODO: if we land here, we need to figure why and how. And fix that
                    log.error("Configuration empty! This should not happen!")
                    return
                }
                fs.writeFileSync(app.getPath('userData') + "/settings.json", JSON.stringify(config.currentSettings), 'utf-8')
                config.saveTimeout = null
            }, 2000)
        },

        get (key) {
            return config.currentSettings[key]
        },

        set (key, value) {
            config.currentSettings[key] = value
        },

        unSet (key) {
            if (config.currentSettings.hasOwnProperty(key)) {
                delete config.currentSettings[key]
            }
        }
    }

    global.config.init()

    global.whatsApp = {
        init() {
            global.whatsApp.warningIcon = false
            whatsApp.tray = undefined
            whatsApp.createMenu()
            // Bitmask: LSB
            // First bit: warning icon (phone disconnected)
            // Second bit: new message red-dot
            global.whatsApp.iconStatus = 0
            global.whatsApp.oldIconStatus = 0
            global.whatsApp.newVersion = null

            whatsApp.clearCache()
            whatsApp.openWindow()
            config.applyConfiguration()
        },

        createMenu() {
            log.info("Creating menu")
            whatsApp.menu =
                AppMenu.buildFromTemplate(require('./menu'))
                AppMenu.setApplicationMenu(whatsApp.menu)
        },

        setNormalTray() {
            global.whatsApp.iconStatus = global.whatsApp.iconStatus & 0xFFFFFFFE
            global.whatsApp.updateTrayIcon()
        },

        setWarningTray() {
            global.whatsApp.iconStatus = global.whatsApp.iconStatus | 0x00000001
            global.whatsApp.updateTrayIcon()
        },

        isWarningTrayIcon() {
            return (global.whatsApp.iconStatus & 0x1) > 0
        },

        setNewMessageIcon() {
            global.whatsApp.iconStatus = global.whatsApp.iconStatus | 0x00000002
            global.whatsApp.updateTrayIcon()
        },

        clearNewMessageIcon() {
            global.whatsApp.iconStatus = global.whatsApp.iconStatus & 0xFFFFFFFD
            global.whatsApp.updateTrayIcon()
        },

        isNewMessageIcon() {
            return (global.whatsApp.iconStatus & 0x2) > 0
        },

        updateTrayIcon() {
            if (global.whatsApp.oldIconStatus == global.whatsApp.iconStatus) {
                return
            }
            if (whatsApp.tray != undefined && process.platform != 'darwin') {
                if (global.whatsApp.isWarningTrayIcon() && !global.whatsApp.isNewMessageIcon()) {
                    log.info("Setting tray icon to warning")
                    whatsApp.tray.setImage(__dirname + '/assets/icon/iconWarning.png')
                } if (global.whatsApp.isWarningTrayIcon() && global.whatsApp.isNewMessageIcon()) {
                    log.info("Setting tray icon to warning with messages")
                    whatsApp.tray.setImage(__dirname + '/assets/icon/iconWarningWithMsg.png')
                } if (!global.whatsApp.isWarningTrayIcon() && global.whatsApp.isNewMessageIcon()) {
                    log.info("Setting tray icon to normal with messages")
                    whatsApp.tray.setImage(__dirname + '/assets/icon/iconWithMsg.png')
                } else {
                    log.info("Setting tray icon to normal")
                    whatsApp.tray.setImage(__dirname + '/assets/icon/icon.png')
                }
                log.info("Mask value: " + global.whatsApp.iconStatus)
            }
            global.whatsApp.oldIconStatus = global.whatsApp.iconStatus
        },

        createTray() {
            log.info("Creating tray icon")
            var trayImg = __dirname + '/assets/img/trayTemplate.png'
            // Darwin requires black/white/transparent icon, other platforms does not
            if (process.platform != 'darwin') {
                trayImg = __dirname + '/assets/icon/icon.png'
            }
            whatsApp.tray = new AppTray(trayImg)

            // Setting up a trayicon context menu
            whatsApp.trayContextMenu = AppMenu.buildFromTemplate([
                {label: _('Show'),
                visible: config.get("startminimized"), // Hide this option on start
                click: function() {
                    whatsApp.window.show()
                    whatsApp.window.setAlwaysOnTop(true)
                    whatsApp.window.focus()
                    whatsApp.window.setAlwaysOnTop(false)
                }},

                {label: _('Hide'),
                visible: !config.get("startminimized"), // Show this option on start
                click: function() {
                    whatsApp.window.hide()
                }},

                // Quit WhatsApp
                {label: _('Quit'), click: function() {
                    app.quit()
                }}
            ])
            whatsApp.tray.setContextMenu(whatsApp.trayContextMenu)

            // Normal this will show the main window, but electron under Linux
            // dosent work with the clicked event so we are using the above
            // contextmenu insted - Rightclick the trayicon and pick Show
            // WhatsApp
            // More info:
            // https://github.com/electron/electron/blob/master/docs/api/tray.md
            // See the Platform limitations section.
            whatsApp.tray.on('clicked', () => {
                whatsApp.window.show()
                whatsApp.window.setAlwaysOnTop(true)
                whatsApp.window.focus()
                whatsApp.window.setAlwaysOnTop(false)
            })
            whatsApp.tray.on('click', () => {
                whatsApp.window.show()
                whatsApp.window.setAlwaysOnTop(true)
                whatsApp.window.focus()
                whatsApp.window.setAlwaysOnTop(false)
            })

            whatsApp.tray.setToolTip('WhatsApp Desktop')
        },

        clearCache() {
            log.info("Clearing cache")
            try {
                fs.unlinkSync(app.getPath('userData') + '/Application Cache/Index')
            }
            catch (e) {
                log.warn("Error clearing cache: " + e)
            }
        },

        openWindow() {
            log.info("Open main window")
            whatsApp.window = new BrowserWindow({
                "y": config.get("posY"),
                "x": config.get("posX"),
                "width": config.get("width"),
                "height": config.get("height"),
                "minWidth": 600,
                "minHeight": 600,
                //"type": "toolbar",
                "title": "WhatsApp",
                "show": false,
                "autoHideMenuBar": config.get("autoHideMenuBar") == true,
                "icon": __dirname + "/assets/icon/icon.png",
                "webPreferences": {
                  "nodeIntegration": false,
                  "spellcheck": true,
                  "preload": join(__dirname, 'js', 'injected.js')
                }
            })

            // Custom context menu with spellcheck suggestions
            whatsApp.window.webContents.on('context-menu', (event, params) => {
                const menu = new AppMenu()

                // Add spelling suggestions if there's a misspelled word
                if (params.misspelledWord) {
                    if (params.dictionarySuggestions.length > 0) {
                        params.dictionarySuggestions.forEach(suggestion => {
                            menu.append(new MenuItem({
                                label: suggestion,
                                click: () => whatsApp.window.webContents.replaceMisspelling(suggestion)
                            }))
                        })
                    } else {
                        menu.append(new MenuItem({
                            label: 'No suggestions available',
                            enabled: false
                        }))
                    }
                    menu.append(new MenuItem({ type: 'separator' }))

                    // Add to dictionary option
                    menu.append(new MenuItem({
                        label: 'Add to Dictionary',
                        click: () => whatsApp.window.webContents.session.addWordToSpellCheckerDictionary(params.misspelledWord)
                    }))
                    menu.append(new MenuItem({ type: 'separator' }))
                }

                // Standard editing options for editable fields
                if (params.isEditable) {
                    menu.append(new MenuItem({ label: 'Cut', role: 'cut', enabled: params.editFlags.canCut }))
                    menu.append(new MenuItem({ label: 'Copy', role: 'copy', enabled: params.editFlags.canCopy }))
                    menu.append(new MenuItem({ label: 'Paste', role: 'paste', enabled: params.editFlags.canPaste }))
                    menu.append(new MenuItem({ label: 'Select All', role: 'selectAll', enabled: params.editFlags.canSelectAll }))
                } else if (params.selectionText) {
                    menu.append(new MenuItem({ label: 'Copy', role: 'copy' }))
                }

                // Link options
                if (params.linkURL) {
                    if (menu.items.length > 0) {
                        menu.append(new MenuItem({ type: 'separator' }))
                    }
                    menu.append(new MenuItem({
                        label: 'Copy Link',
                        click: () => {
                            electron.clipboard.writeText(params.linkURL)
                        }
                    }))
                }

                if (menu.items.length > 0) {
                    menu.popup({ window: whatsApp.window })
                }
            })

            // Setting User Agent
            var userAgent = 'Mozilla/5.0 (X11; Linux x86_64; rv:141.0) Gecko/20100101 Firefox/141.0'

            // Pick a random user agent from agents.json
            if (agents.userAgents) {
                const userAgentIndex = Math.floor(Math.random() * agents.userAgents.length)
                userAgent = agents.userAgents[userAgentIndex]
            }
            log.info(`User Agent selected: ${userAgent}`)
            whatsApp.window.webContents.setUserAgent(userAgent)

            electron.session.defaultSession.webRequest.onBeforeSendHeaders(function (details, callback) {
                details.requestHeaders['User-Agent'] = userAgent
                callback({ cancel: false, requestHeaders: details.requestHeaders })
            })

            whatsApp.window.loadURL('https://web.whatsapp.com', {
                userAgent: userAgent
            })

            whatsApp.window.webContents.on('did-finish-load', function() {
                if (groupLinkOpenRequested != null) {
                    whatsApp.window.webContents.executeJavaScript(
                        "var el = document.createElement('a');\
                        el.href = \"" + groupLinkOpenRequested + "\"; \
                        el.style.display = \"none\"; \
                        el.rel = 'noopener noreferrer'; \
                        el.id = 'newlink'; \
                        document.body.appendChild(el); \
                        setTimeout(function() { var el = document.getElementById('newlink'); el.click(); document.body.removeChild(el); }, 500); \
                        "
                    )
                }
                /* Checking for new version
                var ep = "https://api.github.com/repos/Enrico204/Whatsapp-Desktop/releases/latest"
                log.info("Checking for new versions (current version "+pkg.version+")")
                request.get({url: ep, headers:{'User-Agent':'Whatsapp-Desktop'}}, function(err, response, body) {
                    if (!err && response != undefined && response.statusCode == 200) {
                        var ghinfo = JSON.parse(body)
                        global.whatsApp.newVersion = ghinfo['tag_name']
                        if (ghinfo['tag_name'][0] == 'v'
                                && ghinfo['tag_name'] != "v"+pkg.version
                                && ghinfo['tag_name'].indexOf("beta") == -1) {
                            log.info("A new version is available: " + ghinfo['tag_name'])
                            var options = {
                                title: "Whatsapp-Desktop",
                                message: "A new version is available, download it at https://github.com/Enrico204/Whatsapp-Desktop",
                                open: 'https://github.com/Enrico204/Whatsapp-Desktop/releases/latest',
                                sound: true
                            }
                            notifier.notify(options, function (err, response) {
                                    if (!err) log.warn("Error: " + err)
                                })
                        } else {
                            log.info("Already on latest version");
                        }
                    } else {
                        log.warn("Error checking updates (status " + (response != undefined ? response.statusCode : " not available") + "): " + err)
                    }
                })*/
            })

            if (config.get("useProxy")) {
                var session = whatsApp.window.webContents.session
                var httpProxy = config.get("httpProxy")
                var httpsProxy = config.get("httpsProxy") || httpProxy
                if (httpProxy) {
                    session.setProxy("http="+ httpProxy +";https=" + httpsProxy, () => {})
                }
            }

            if (config.get("startminimized") != true) {
                whatsApp.window.show()
            }

            whatsApp.window.on('move', (e, evt) => {
                config.set("posX", whatsApp.window.getBounds().x)
                config.set("posY", whatsApp.window.getBounds().y)
                config.set("width", whatsApp.window.getBounds().width)
                config.set("height", whatsApp.window.getBounds().height)
                config.saveConfiguration()
            })

            whatsApp.window.on('resize', (e, evt) => {
                config.set("posX", whatsApp.window.getBounds().x)
                config.set("posY", whatsApp.window.getBounds().y)
                config.set("width", whatsApp.window.getBounds().width)
                config.set("height", whatsApp.window.getBounds().height)
                config.saveConfiguration()
            })

            whatsApp.window.on('page-title-updated', onlyOSX((event, title) => {
                var count = title.match(/\((\d+)\)/)
                    count = count ? count[1] : ''
                app.dock.setBadge(count)
                log.info("Badge updated: " + count)
            }))

            whatsApp.window.on('page-title-updated', onlyLinux((event, title) => {
                var count = title.match(/\((\d+)\)/)
                    count = count ? count[1] : ''

                if (parseInt(count) > 0) {
                    if (!whatsApp.window.isFocused() && global.config.get("quietMode") !== true) {
                      log.info("Flashing frame")
                      whatsApp.window.flashFrame(true)
                    }
                    var badge = NativeImage.createFromPath(app.getAppPath() + "/assets/badges/badge-" + (count > 9 ? 0 : count) +".png")
                    whatsApp.window.setOverlayIcon(badge, "new messages")
                    global.whatsApp.setNewMessageIcon()
                }
                else {
                    whatsApp.window.setOverlayIcon(null, "no new messages")
                    global.whatsApp.clearNewMessageIcon()
                }
                log.info("Badge updated: " + count)
            }))

            whatsApp.window.on('page-title-updated', onlyWin((event, title) => {
                var count = title.match(/\((\d+)\)/)
                    count = count ? count[1] : ''

                if (parseInt(count) > 0) {
                    if (!whatsApp.window.isFocused()) {
                      whatsApp.window.flashFrame(true)
                    }
                    var badge = NativeImage.createFromPath(app.getAppPath() + "/assets/badges/badge-" + (count > 9 ? 0 : count) +".png")
                    whatsApp.window.setOverlayIcon(badge, "new messages")
                    global.whatsApp.setNewMessageIcon()
                }
                else {
                    whatsApp.window.setOverlayIcon(null, "no new messages")
                    global.whatsApp.clearNewMessageIcon()
                }
                log.info("Badge updated: " + count)
            }))

            whatsApp.window.webContents.on("new-window", (e, url) => {
                electron.shell.openExternal(url)
                e.preventDefault()
            })

            whatsApp.window.on('close', onlyOSX((e) => {
                if (whatsApp.window.forceClose !== true) {
                    e.preventDefault()
                    whatsApp.window.hide()
                }
            }))

            whatsApp.window.on('close', onlyWin((e) => {
                if (whatsApp.tray == undefined) {
                    app.quit()
                }
                else if (whatsApp.window.forceClose !== true) {
                    e.preventDefault()
                    whatsApp.window.hide()
                }
            }))

            whatsApp.window.on('close', onlyLinux((e) => {
                if (whatsApp.tray == undefined) {
                    app.quit()
                }
                else if (whatsApp.window.forceClose !== true) {
                    e.preventDefault()
                    whatsApp.window.hide()
                }
            }))

            whatsApp.window.on('close', () => {
                if (settings.window) {
                    settings.window.close()
                    settings.window = null
                }
            })

            // Toggle contextmenu content when window is shown
            whatsApp.window.on("show", function() {
                if (whatsApp.tray != undefined) {
                    whatsApp.trayContextMenu.items[0].visible = false
                    whatsApp.trayContextMenu.items[1].visible = true

                    // Need to re-set the contextmenu for this to work under Linux
                    // TODO: Only trigger this under Linux
                    whatsApp.tray.setContextMenu(whatsApp.trayContextMenu)
                }
            })

            // Toggle contextmenu content when window is hidden
            whatsApp.window.on("hide", function() {
                if (whatsApp.tray != undefined) {
                    whatsApp.trayContextMenu.items[0].visible = true
                    whatsApp.trayContextMenu.items[1].visible = false

                    // Need to re-set the contextmenu for this to work under Linux
                    // TODO: Only trigger this under Linux
                    whatsApp.tray.setContextMenu(whatsApp.trayContextMenu)
                }
            })

            app.on('before-quit', onlyOSX(() => {
                whatsApp.window.forceClose = true
            }))

            app.on('before-quit', onlyLinux(() => {
                whatsApp.window.forceClose = true
            }))

            app.on('before-quit', onlyWin(() => {
                whatsApp.window.forceClose = true
            }))

            app.on('window-all-closed', onlyWin(() => {
                app.quit()
            }))
        }
    }

    global.settings = {
        init() {
            // if there is already one instance of the window created show that one
            if (settings.window) {
                settings.window.show()
            }
            else {
                settings.openWindow()
                settings.createMenu()
            }
        },

        createMenu() {
            settings.menu = new AppMenu()
            settings.menu.append(new MenuItem(
                {
                    label: "close",
                    visible: false,
                    accelerator: "esc",
                    click() {
                      settings.window.close()
                    }
                })
            )
            settings.menu.append(new MenuItem(
                {
                    label: 'Toggle DevTools',
                    accelerator: 'Ctrl+Shift+I',
                    visible: false,
                    click() {
                      settings.window.toggleDevTools()
                    }
                })
            )
            settings.menu.append(new MenuItem(
                {
                    label: 'Reload settings view',
                    accelerator: 'CmdOrCtrl+r',
                    visible: false,
                    click() {
                      settings.window.reload()
                    }
                })
            )
            settings.window.setMenu(settings.menu)
            settings.window.setMenuBarVisibility(false)
        },

        openWindow() {
            settings.window = new BrowserWindow(
                {
                    "width": 550,
                    "height": 550,
                    "resizable": true,
                    "center": true,
                    "frame": true,
                    "webPreferences": {
                        "nodeIntegration": true, 
                        "contextIsolation": false,
                        "enableRemoteModule": true,
                    }
                }
            )

            settings.window.loadURL("file://" + __dirname + "/html/settings.html")
            settings.window.show()

            settings.window.on("close", () => {
                settings.window = null
            })
        }
    }

    global.pkg = pkg
    global.about = {
        init() {
            // if there is already one instance of the window created show that one
            if (about.window){
                about.window.show()
            }
            else {
                about.openWindow()
                about.window.setMenu(null)
                about.window.setMenuBarVisibility(false)
            }
        },

        openWindow() {
            about.window = new BrowserWindow(
                {
                    "width": 600,
                    "height": 450,
                    "resizable": true,
                    "center": true,
                    "frame": true,
                    "webPreferences": {
                      "nodeIntegration": true,
                    }
                }
            )

            about.window.loadURL("file://" + __dirname + "/html/about.html")
            about.window.show()
            about.window.webContents.on("new-window", (e, url) => {
                electron.shell.openExternal(url)
                e.preventDefault()
            })

            about.window.on("close", () => {
                about.window = null
            })
        }
    }

    const {
      ipcMain
    } = electron
    ipcMain.on('phoneinfoupdate', (event, arg) => {
        global.phoneinfo.infos = arg
        if (arg.info != "NORMAL") {
            global.whatsApp.setWarningTray()
        }
        else {
            global.whatsApp.setNormalTray()
        }
    })
    ipcMain.on('notificationClick', (event, arg) => {
        global.whatsApp.window.show()
        global.whatsApp.window.setAlwaysOnTop(true)
        global.whatsApp.window.focus()
        global.whatsApp.window.setAlwaysOnTop(false)
    })

    global.phoneinfo = {
        init () {
            // if there is already one instance of the window created show that one
            if (phoneinfo.window) {
                phoneinfo.window.show()
            }
            else {
                phoneinfo.openWindow()
                phoneinfo.createMenu()
            }
        },

        createMenu() {
            phoneinfo.menu = new AppMenu()
            phoneinfo.menu.append(new MenuItem(
                {
                    label: "close",
                    visible: false,
                    accelerator: "esc",
                    click() {
                      phoneinfo.window.close()
                    }
                })
            )
            phoneinfo.menu.append(new MenuItem(
                {
                    label: 'Reload phoneinfo view',
                    accelerator: 'CmdOrCtrl+r',
                    visible: false,
                    click() {
                      phoneinfo.window.reload()
                    }
                })
            )
            phoneinfo.menu.append(new MenuItem({
                label: 'Toggle Developer Tools',
                accelerator: (function() {
                    if (process.platform == 'darwin')
                        return 'Alt+Command+I'
                    else
                        return 'Ctrl+Shift+I'
                })(),
                click: function(item, focusedWindow) {
                    if (focusedWindow)
                        focusedWindow.toggleDevTools()
                }
            }))
            phoneinfo.window.setMenu(phoneinfo.menu)
            phoneinfo.window.setMenuBarVisibility(false)
        },

        openWindow() {
            phoneinfo.window = new BrowserWindow(
                {
                    "width": 500,
                    "height": 500,
                    "resizable": true,
                    "center": true,
                    "frame": true,
                    "webPreferences": {
                      "nodeIntegration": true,
                    }
                }
            )

            phoneinfo.window.loadURL("file://" + __dirname + "/html/phoneinfo.html")
            phoneinfo.window.show()

            phoneinfo.window.on("close", () => {
                phoneinfo.window = null
            })
        }
    }

    app.on('ready', () => {
        whatsApp.init()
        // setting of globalShortcut
        if(config.get("globalshortcut") == true) {
            globalShortcut.register('CmdOrCtrl + Alt + W', function(){
                if(whatsApp.window.isFocused())
                    whatsApp.window.hide()
                else
                    whatsApp.window.show()
            })
        }
    })

    // unregistering the globalShorcut on quit of application
    app.on('will-quit', function(){
        if(config.get("globalshortcut") == true) {
            globalShortcut.unregisterAll()
        }
    })
})(this)


================================================
FILE: app/menu.js
================================================
(function(scope) {
    "use strict";

    var template = [
        {
            label: "&" + _('Edit'),
            submenu: [
                {
                    label: _('Undo'),
                    accelerator: 'CmdOrCtrl+Z',
                    role: 'undo'
                },
                {
                    label: _('Redo'),
                    accelerator: 'Shift+CmdOrCtrl+Z',
                    role: 'redo'
                },
                {
                    type: 'separator'
                },
                {
                    label: _('Cut'),
                    accelerator: 'CmdOrCtrl+X',
                    role: 'cut'
                },
                {
                    label: _('Copy'),
                    accelerator: 'CmdOrCtrl+C',
                    role: 'copy'
                },
                {
                    label: _('Paste'),
                    accelerator: 'CmdOrCtrl+V',
                    role: 'paste'
                },
                {
                    label: _('Select All'),
                    accelerator: 'CmdOrCtrl+A',
                    role: 'selectall'
                },
                {
                    type: 'separator'
                },
                {
                    label: _('Settings'),
                    accelerator: 'CmdOrCtrl+,',
                    click: function () {
                        global.settings.init();
                    }
                }
            ]
        },
        {
            label: "&" + _('View'),
            submenu: [
                {
                    label: _('Reload'),
                    accelerator: 'CmdOrCtrl+R',
                    click: function(item, focusedWindow) {
                        if (focusedWindow)
                            focusedWindow.reload();
                    }
                },
                {type: 'separator'},
                {
                    label: _('Toggle Full Screen'),
                    accelerator: (function() {
                        if (process.platform == 'darwin')
                            return 'Ctrl+Command+F';
                        else
                            return 'F11';
                    })(),
                    click: function(item, focusedWindow) {
                        if (focusedWindow)
                            focusedWindow.setFullScreen(!focusedWindow.isFullScreen());
                    }
                },
                {
                    label: _('Dark mode'),
                    accelerator: 'CmdOrCtrl+Shift+Alt+D',
                    type: 'checkbox',
                    checked: (function() {
                        return global.config.get("darkMode");
                    })(),
                    click: function(item, focusedWindow) {
                        global.config.set("darkMode", global.config.get("darkMode") != true);
                        item.checked = global.config.get("darkMode");
                        global.config.saveConfiguration();
                        global.config.applyConfiguration();
                        if (focusedWindow)
                            focusedWindow.reload();
                    }
                },
                {
                    label: _('Quiet mode'),
                    accelerator: 'CmdOrCtrl+Shift+Alt+Q',
                    type: 'checkbox',
                    checked: (function() {
                        return global.config.get("quietMode");
                    })(),
                    click: function(item, focusedWindow) {
                        global.config.set("quietMode", global.config.get("quietMode") != true);
                        item.checked = global.config.get("quietMode");
                        global.config.saveConfiguration();
                    }
                },
                {type: 'separator'},
                {
                    label: _('Toggle Developer Tools'),
                    accelerator: (function() {
                        if (process.platform == 'darwin')
                            return 'Alt+Command+I';
                        else
                            return 'Ctrl+Shift+I';
                    })(),
                    click: function(item, focusedWindow) {
                        if (focusedWindow)
                            focusedWindow.toggleDevTools();
                    }
                },
                {type: 'separator'},
                {
                    label: _('Phone info'),
                    accelerator: (function() {
                        if (process.platform == 'darwin')
                            return 'Alt+Command+N';
                        else
                            return 'Ctrl+Shift+N';
                    })(),
                    click: function(item, focusedWindow) {
                        if (focusedWindow)
                            global.phoneinfo.init();
                    }
                }
            ]
        },
        {
            label: "&" + _('Window'),
            role: 'window',
            submenu: [
                {
                    label: _('Minimize'),
                    accelerator: 'CmdOrCtrl+M',
                    role: 'minimize'
                },
                {
                    label: _('Close'),
                    accelerator: 'CmdOrCtrl+W',
                    role: 'close'
                },
                {
                    label: 'close2',
                    visible: false,
                    accelerator: "esc",
                    role: 'close'
                }
            ]
        },
        {
            label: "&" + _('Audio'),
            submenu: [
                {
                    label: _('Increase Audio Rate by 20%'),
                    accelerator: 'CmdOrCtrl+=',
                    click: function(item, focusedWindow) {
                        focusedWindow && focusedWindow.webContents.executeJavaScript(
                            "window.audioRate = (window.audioRate || 1) + 0.2"
                        )
                    }
                },
                {
                    label: _('Decrease Audio Rate by 20%'),
                    accelerator: 'CmdOrCtrl+-',
                    click: function(item, focusedWindow) {
                        focusedWindow && focusedWindow.webContents.executeJavaScript(
                            "window.audioRate = (window.audioRate || 1) - 0.2"
                        )
                    }
                }
            ]
        }
    ];

    if (process.platform == 'darwin') {
        var name = 'WhatsApp Desktop';
        template.unshift({
            label: "&" + name,
            submenu: [
                {
                    label: _('About') + " " + name,
                    role: 'about'
                },
                {
                    type: 'separator'
                },
                {
                    label: _('Hide') + " " + name,
                    accelerator: 'Command+H',
                    role: 'hide'
                },
                {
                    label: _('Hide Others'),
                    accelerator: 'Command+Alt+H',
                    role: 'hideothers'
                },
                {
                    label: _('Show All'),
                    role: 'unhide'
                },
                {
                    type: 'separator'
                },
                {
                    label: _('Quit'),
                    accelerator: 'Command+Q',
                    click: () => { require('electron').app.quit() }
                },
            ]
        });
        // Window menu.
        template[3].submenu.push(
            {
                type: 'separator'
            },
            {
                label: _('Bring All to Front'),
                role: 'front'
            }
        );
    } else if (process.platform == 'linux' || process.platform == 'win64' || process.platform == 'win32') {
        template.unshift({
            label: '&File',
            submenu: [
                {
                    label: _('About'),
                    click: () => { global.about.init(); }
                },
                {
                    label: _('Quit'),
                    accelerator: 'Ctrl+Q',
                    click: () => { require('electron').app.quit() }
                },
            ]
        });
    }

    module.exports = template;

})(this);


================================================
FILE: app/package.json
================================================
{
  "name": "whatsapp-desktop",
  "version": "0.5.3",
  "license": "GPL-3.0",
  "repository": {
    "type": "git",
    "url": "https://github.com/oOthkOo/whatsapp-desktop.git"
  },
  "main": "main.js",
  "author": "oothkoo",
  "description": "Unofficial WhatsApp Desktop Client for OSX, Linux and Windows. Build with Electron.",
  "dependencies": {
    "@electron/remote": "^2.1.3",
    "auto-launch": "^5.0.1",
    "electron-context-menu": "^0.9.1",
    "electron-log": "^2.2.7",
    "gettext-parser": "^1.2.2",
    "node-gettext": "^2.0.0",
    "node-notifier": "^8.0.1",
    "request": "^2.83.0"
  }
}


================================================
FILE: build/templates/debian/armv7l/compat
================================================
9


================================================
FILE: build/templates/debian/armv7l/control
================================================
Source: whatsapp-desktop
Version: {version}
Section: net
Priority: optional
Maintainer: Tierry Danquin <contact@oothkoo.com>
Build-Depends: debhelper (>= 9)
Standards-Version: 3.9.5
Homepage: https://github.com/oothkoo/whatsapp-desktop
Vcs-Git: https://github.com/oothkoo/whatsapp-desktop.git
Package: whatsapp-desktop
Architecture: armhf
Description: Unofficial whatsapp web desktop client for OSX, Linux and Windows. Build with Electron.


================================================
FILE: build/templates/debian/armv7l/copyright
================================================
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: whatsapp-desktop
Source: <https://github.com/oothkoo/whatsapp-desktop>

Files: *
Copyright: 2019 Tierry <contact@oothkoo.com>
License: GPL-3.0+

Files: debian/*
Copyright: 2017 Enrico204 <enrico204@gmail.com>
License: GPL-3.0+

License: GPL-3.0+
 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 package is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 .
 You should have received a copy of the GNU General Public License
 along with this program. If not, see <http://www.gnu.org/licenses/>.
 .
 On Debian systems, the complete text of the GNU General
 Public License version 3 can be found in "/usr/share/common-licenses/GPL-3".

# Please also look if there are files or directories which have a
# different copyright/license attached and list them here.
# Please avoid to pick license terms that are more restrictive than the
# packaged work, as it may make Debian's contributions unacceptable upstream.


================================================
FILE: build/templates/debian/armv7l/docs
================================================
readme.md


================================================
FILE: build/templates/debian/armv7l/postinst
================================================
#!/bin/sh
# postinst script
#
# see: dh_installdeb(1)

set -e

# summary of how this script can be called:
#        * <postinst> `configure' <most-recently-configured-version>
#        * <old-postinst> `abort-upgrade' <new version>
#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
#          <new-version>
#        * <postinst> `abort-remove'
#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
#          <failed-install-package> <version> `removing'
#          <conflicting-package> <version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package

case "$1" in

  configure)
    ln -s /opt/whatsapp-desktop/WhatsApp /usr/local/bin/WhatsApp
    chown root:root /opt/whatsapp-desktop/chrome-sandbox
    chmod 4755 /opt/whatsapp-desktop/chrome-sandbox
  ;;

  abort-upgrade|abort-remove|abort-deconfigure)
    rm -f /usr/local/bin/WhatsApp
    exit 0
  ;;

  *)
    echo "postinst called with unknown argument \`$1'" >&2
    exit 1
  ;;

esac

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

#DEBHELPER#

exit 0


================================================
FILE: build/templates/debian/armv7l/prerm
================================================
#!/bin/sh
# prerm script
#
# see: dh_installdeb(1)

set -e

# summary of how this script can be called:
#        * <prerm> `remove'
#        * <old-prerm> `upgrade' <new-version>
#        * <new-prerm> `failed-upgrade' <old-version>
#        * <conflictor's-prerm> `remove' `in-favour' <package> <new-version>
#        * <deconfigured's-prerm> `deconfigure' `in-favour'
#          <package-being-installed> <version> `removing'
#          <conflicting-package> <version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package

case "$1" in
  remove|upgrade|deconfigure)
    rm -f /usr/local/bin/WhatsApp
  ;;

  failed-upgrade)
  ;;

  *)
    echo "prerm called with unknown argument \`$1'" >&2
    exit 1
  ;;
esac

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

#DEBHELPER#

exit 0


================================================
FILE: build/templates/debian/changelog
================================================
whatsapp-desktop (0.5.3) unstable; urgency=high

  * Bugfix
  
 -- Tierry <contact@oothkoo.com> 14 November 2025

whatsapp-desktop (0.5.2) unstable; urgency=high

  * Bump electron to 17.0.0

 -- Tierry <contact@oothkoo.com> 18 June 2022

 whatsapp-desktop (0.5.1) unstable; urgency=high

  * Bypass Facebook user agent verification

 -- Tierry <contact@oothkoo.com> 31 July 2019

whatsapp-desktop (0.5.0-1) unstable; urgency=low

  * Bugfix
  * Dark mode

 -- Enrico <enrico204@gmail.com>  Sat, 31 Mar 2018 11:25:47 +0200

whatsapp-desktop (0.4.2-1) unstable; urgency=low

  * Fixed build issue

 -- Enrico <enrico204@gmail.com>  Wed, 03 Jan 2018 16:33:00 +0200

whatsapp-desktop (0.4.1-1) unstable; urgency=low

  * Added flatpak/AppImage support
  * Added feature: open main window on notification click
  * Bugfix: fixed various bugs on macOS

 -- Enrico <enrico204@gmail.com>  Tue, 02 Jan 2018 22:08:05 +0200

whatsapp-desktop (0.4.0-1) unstable; urgency=low

  * Bugfix
  * German translations (thanks to @wotomg)

 -- Enrico <enrico204@gmail.com>  Sun, 31 Dec 2017 00:04:30 +0200

whatsapp-desktop (0.3.14-1) unstable; urgency=low

  * Various bugfixes, update notifications

 -- Enrico <enrico204@gmail.com>  Sat, 04 Nov 2017 18:30:00 +0200

whatsapp-desktop (0.3.13-1) unstable; urgency=low

  * Fixed some bugs
  * Added a red-dot over tray icons on new messages (thanks to @Termuellinator)
  * Added Spanish locale (thanks to @mlopezcoria)
  * Added Portuguese Brazil locale (thanks to @Dssdiego)

 -- Enrico <enrico204@gmail.com>  Mon, 28 Aug 2017 20:29:02 +0200

whatsapp-desktop (0.3.12-1) unstable; urgency=medium

  * Added ability to inject custom CSS
  * Bugfix

 -- Enrico <enrico204@gmail.com>  Tue, 1 Aug 2017 00:00:00 +0200

whatsapp-desktop (0.3.11-1) unstable; urgency=medium

  * Added logging system with CLI option
  * Added auto-launch at login option
  * Hide tray icon (#5)
  * fixed tray icon click doesn't fire (#6)
  * Fixed missing dependency
  * Skip setting saving if object is invalid (see #8)
  * Other bugfixes

 -- Enrico <enrico204@gmail.com>  Wed, 19 Jul 2017 12:46:00 +0200

whatsapp-desktop (0.3.6-1) unstable; urgency=medium

  * NativeImage electron class renamed to nativeImage

 -- Enrico <enrico204@gmail.com>  Tue, 27 Jun 2017 21:58:04 +0200

whatsapp-desktop (0.3.5-1) unstable; urgency=medium

  * Initial Release.

 -- Enrico <enrico204@gmail.com>  Wed, 21 Jun 2017 22:39:32 +0200

whatsapp-desktop (0.3.4-1) unstable; urgency=low

  * Initial Release.

 -- Enrico <enrico204@gmail.com>  Wed, 21 Jun 2017 20:27:16 +0200


================================================
FILE: build/templates/debian/ia32/compat
================================================
9


================================================
FILE: build/templates/debian/ia32/control
================================================
Source: whatsapp-desktop
Version: {version}
Section: net
Priority: optional
Maintainer: Tierry Danquin <contact@oothkoo.com>
Build-Depends: debhelper (>= 9)
Standards-Version: 3.9.5
Homepage: https://github.com/oothkoo/whatsapp-desktop
Vcs-Git: https://github.com/oothkoo/whatsapp-desktop.git
Package: whatsapp-desktop
Architecture: i386
Description: Unofficial whatsapp web desktop client for OSX, Linux and Windows. Build with Electron.


================================================
FILE: build/templates/debian/ia32/copyright
================================================
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: whatsapp-desktop
Source: <https://github.com/oothkoo/whatsapp-desktop>

Files: *
Copyright: 2019 Tierry <contact@oothkoo.com>
License: GPL-3.0+

Files: debian/*
Copyright: 2017 Enrico204 <enrico204@gmail.com>
License: GPL-3.0+

License: GPL-3.0+
 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 package is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 .
 You should have received a copy of the GNU General Public License
 along with this program. If not, see <http://www.gnu.org/licenses/>.
 .
 On Debian systems, the complete text of the GNU General
 Public License version 3 can be found in "/usr/share/common-licenses/GPL-3".

# Please also look if there are files or directories which have a
# different copyright/license attached and list them here.
# Please avoid to pick license terms that are more restrictive than the
# packaged work, as it may make Debian's contributions unacceptable upstream.


================================================
FILE: build/templates/debian/ia32/docs
================================================
readme.md


================================================
FILE: build/templates/debian/ia32/postinst
================================================
#!/bin/sh
# postinst script
#
# see: dh_installdeb(1)

set -e

# summary of how this script can be called:
#        * <postinst> `configure' <most-recently-configured-version>
#        * <old-postinst> `abort-upgrade' <new version>
#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
#          <new-version>
#        * <postinst> `abort-remove'
#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
#          <failed-install-package> <version> `removing'
#          <conflicting-package> <version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package

case "$1" in

  configure)
    ln -s /opt/whatsapp-desktop/WhatsApp /usr/local/bin/WhatsApp
    chown root:root /opt/whatsapp-desktop/chrome-sandbox
    chmod 4755 /opt/whatsapp-desktop/chrome-sandbox
  ;;

  abort-upgrade|abort-remove|abort-deconfigure)
    rm -f /usr/local/bin/WhatsApp
    exit 0
  ;;

  *)
    echo "postinst called with unknown argument \`$1'" >&2
    exit 1
  ;;

esac

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

#DEBHELPER#

exit 0


================================================
FILE: build/templates/debian/ia32/prerm
================================================
#!/bin/sh
# prerm script
#
# see: dh_installdeb(1)

set -e

# summary of how this script can be called:
#        * <prerm> `remove'
#        * <old-prerm> `upgrade' <new-version>
#        * <new-prerm> `failed-upgrade' <old-version>
#        * <conflictor's-prerm> `remove' `in-favour' <package> <new-version>
#        * <deconfigured's-prerm> `deconfigure' `in-favour'
#          <package-being-installed> <version> `removing'
#          <conflicting-package> <version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package

case "$1" in
  remove|upgrade|deconfigure)
    rm -f /usr/local/bin/WhatsApp
  ;;

  failed-upgrade)
  ;;

  *)
    echo "prerm called with unknown argument \`$1'" >&2
    exit 1
  ;;
esac

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

#DEBHELPER#

exit 0


================================================
FILE: build/templates/debian/x64/compat
================================================
9


================================================
FILE: build/templates/debian/x64/control
================================================
Source: whatsapp-desktop
Version: {version}
Section: net
Priority: optional
Maintainer: Tierry Danquin <contact@oothkoo.com>
Build-Depends: debhelper (>= 9)
Standards-Version: 3.9.5
Homepage: https://github.com/oothkoo/whatsapp-desktop
Vcs-Git: https://github.com/oothkoo/whatsapp-desktop.git
Package: whatsapp-desktop
Architecture: amd64
Description: Unofficial whatsapp web desktop client for OSX, Linux and Windows. Build with Electron.


================================================
FILE: build/templates/debian/x64/copyright
================================================
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: whatsapp-desktop
Source: <https://github.com/oothkoo/whatsapp-desktop>

Files: *
Copyright: 2019 Tierry <contact@oothkoo.com>
License: GPL-3.0+

Files: debian/*
Copyright: 2017 Enrico204 <enrico204@gmail.com>
License: GPL-3.0+

License: GPL-3.0+
 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 package is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 .
 You should have received a copy of the GNU General Public License
 along with this program. If not, see <http://www.gnu.org/licenses/>.
 .
 On Debian systems, the complete text of the GNU General
 Public License version 3 can be found in "/usr/share/common-licenses/GPL-3".

# Please also look if there are files or directories which have a
# different copyright/license attached and list them here.
# Please avoid to pick license terms that are more restrictive than the
# packaged work, as it may make Debian's contributions unacceptable upstream.


================================================
FILE: build/templates/debian/x64/docs
================================================
readme.md


================================================
FILE: build/templates/debian/x64/postinst
================================================
#!/bin/sh
# postinst script
#
# see: dh_installdeb(1)

set -e

# summary of how this script can be called:
#        * <postinst> `configure' <most-recently-configured-version>
#        * <old-postinst> `abort-upgrade' <new version>
#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
#          <new-version>
#        * <postinst> `abort-remove'
#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
#          <failed-install-package> <version> `removing'
#          <conflicting-package> <version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package

case "$1" in

  configure)
    ln -s /opt/whatsapp-desktop/WhatsApp /usr/local/bin/WhatsApp
    chown root:root /opt/whatsapp-desktop/chrome-sandbox
    chmod 4755 /opt/whatsapp-desktop/chrome-sandbox
  ;;

  abort-upgrade|abort-remove|abort-deconfigure)
    rm -f /usr/local/bin/WhatsApp
    exit 0
  ;;

  *)
    echo "postinst called with unknown argument \`$1'" >&2
    exit 1
  ;;

esac

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

#DEBHELPER#

exit 0


================================================
FILE: build/templates/debian/x64/prerm
================================================
#!/bin/sh
# prerm script
#
# see: dh_installdeb(1)

set -e

# summary of how this script can be called:
#        * <prerm> `remove'
#        * <old-prerm> `upgrade' <new-version>
#        * <new-prerm> `failed-upgrade' <old-version>
#        * <conflictor's-prerm> `remove' `in-favour' <package> <new-version>
#        * <deconfigured's-prerm> `deconfigure' `in-favour'
#          <package-being-installed> <version> `removing'
#          <conflicting-package> <version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package

case "$1" in
  remove|upgrade|deconfigure)
    rm -f /usr/local/bin/WhatsApp
  ;;

  failed-upgrade)
  ;;

  *)
    echo "prerm called with unknown argument \`$1'" >&2
    exit 1
  ;;
esac

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

#DEBHELPER#

exit 0


================================================
FILE: build/templates/whatsapp.desktop
================================================
[Desktop Entry]
Type=Application
Version={version}
Name=WhatsApp
Comment=WhatsApp Desktop unofficial client
Exec=/opt/whatsapp-desktop/WhatsApp
StartupNotify=false
Terminal=false
Categories=Network;InstantMessaging;
Icon=whatsapp
StartupWMClass=whatsapp-desktop


================================================
FILE: package.json
================================================
{
    "name": "whatsapp-desktop",
    "version": "0.5.4",
    "repository": "https://github.com/oOthkOo/whatsapp-desktop.git",
    "description": "Unofficial WhatsApp Desktop Client for OSX, Linux and Windows. Build with Electron.",
    "main": "main.js",
    "scripts": {
        "dev": "electron --no-sandbox --debug=5858 ./app",
        "preinstall": "cd app && yarn",
        "gettext": "xgettext app/*.js -j --omit-header -o app/locale/messages.pot && xgettext app/html/*.html -L JavaScript -j --omit-header -o app/locale/messages.pot",
        "clean": "./scripts/clean.sh",
        "build:win": "./scripts/build-win-x64.sh",
        "build:osx": "./scripts/build-darwin-x64.sh",
        "build:osxm1": "./scripts/build-darwin-arm64.sh",
        "build:linux": "./scripts/build-linux-x64.sh",
        "build:linux32": "./scripts/build-linux-x32.sh",
        "build:linuxarmv7l": "./scripts/build-linux-armv7l.sh",
        "build:all": "./scripts/build-all.sh"
    },
    "devDependencies": {
        "electron": "^17.0.0",
        "electron-packager": "15.5.1"
    },
    "dependencies": {
        "process-nextick-args": "^1.0.7",
        "util-deprecate": "^1.0.2"
    }
}


================================================
FILE: packager.json
================================================
{
  "osx": {
    "title": "WhatsApp",
    "icon": "build/assets/osx/whatsapp.icns",
    "icon-size": 80,
    "contents": [
      {
        "x": 438,
        "y": 344,
        "type": "link",
        "path": "/Applications"
      },
      {
        "x": 192,
        "y": 344,
        "type": "file"
      }
    ]
  },
  "win": {
    "title": "WhatsApp",
    "icon": "build/assets/win/whatsapp.ico",
    "icon-size": 48,
    "app-bundle-id": "WhatsApp"
  },
  "linux": {
    "title": "WhatsApp",
    "icon": "build/assets/win/whatsapp.ico",
    "icon-size": 48,
    "app-bundle-id": "WhatsApp"
  }
}


================================================
FILE: scripts/build-all.sh
================================================
#!/bin/bash

npm run clean
npm run build:win
npm run build:osx
npm run build:osxm1
npm run build:linux
npm run build:linux32
npm run build:linuxarmv7l


================================================
FILE: scripts/build-darwin-arm64.sh
================================================
#!/bin/bash

export APP_ARCH="arm64"
export APP_PLATFORM="darwin"
export APP_ICON_PATH="assets/osx/whatsapp.icns"

./scripts/build-zip.sh


================================================
FILE: scripts/build-darwin-x64.sh
================================================
#!/bin/bash

export APP_ARCH="x64"
export APP_PLATFORM="darwin"
export APP_ICON_PATH="assets/osx/whatsapp.icns"

./scripts/build-zip.sh


================================================
FILE: scripts/build-linux-armv7l.sh
================================================
#!/bin/bash

export APP_ARCH="armv7l"

./scripts/build-linux.sh


================================================
FILE: scripts/build-linux-x32.sh
================================================
#!/bin/bash

export APP_ARCH="ia32"

./scripts/build-linux.sh


================================================
FILE: scripts/build-linux-x64.sh
================================================
#!/bin/bash

export APP_ARCH="x64"

./scripts/build-linux.sh


================================================
FILE: scripts/build-linux.sh
================================================
#!/bin/bash

source ./scripts/constants.sh

npm install
electron-packager ./app $APP_NAME \
 --overwrite \
 --out=$DIST_DIR \
 --package-manager=yarn \
 --platform=linux \
 --arch=$APP_ARCH \
 --electron-version=$ELECTRON_VERSION \
 --icon=$BUILD_DIR/assets/win/whatsapp.ico

WORK_DIR=$OUTPUT_DIR"/whatsapp-linux-"$APP_ARCH

rm -R $OUTPUT_DIR
mkdir -p $WORK_DIR/DEBIAN
cp $TEMPLATES_DIR/debian/$APP_ARCH/* $WORK_DIR/DEBIAN
cp $TEMPLATES_DIR/debian/changelog $WORK_DIR/DEBIAN
sed -i "s/{version}/${APP_VERSION}/g" $WORK_DIR/DEBIAN/control
mkdir -p $WORK_DIR/opt/whatsapp-desktop/
mkdir -p $WORK_DIR/usr/share/applications/
mkdir -p $WORK_DIR/usr/share/icons/hicolor/128x128/apps/
mkdir -p $WORK_DIR/usr/share/icons/hicolor/64x64/apps/
cp "app/assets/icon/icon@2x.png" $WORK_DIR/usr/share/icons/hicolor/128x128/apps/whatsapp.png
cp "app/assets/icon/icon.png" $WORK_DIR/usr/share/icons/hicolor/64x64/apps/whatsapp.png
cp $TEMPLATES_DIR/whatsapp.desktop $WORK_DIR/usr/share/applications/
sed -i "s/{version}/${APP_VERSION}/g" $WORK_DIR/usr/share/applications/whatsapp.desktop
cp -r $BUILD_DIR/dist/WhatsApp-linux-$APP_ARCH/* $WORK_DIR/opt/whatsapp-desktop/
dpkg-deb --build $WORK_DIR
mv $WORK_DIR.deb $RELEASES_DIR


================================================
FILE: scripts/build-win-x64.sh
================================================
#!/bin/bash

export APP_ARCH="x64"
export APP_PLATFORM="win32"
export APP_ICON_PATH="assets/win/whatsapp.ico"

./scripts/build-zip.sh


================================================
FILE: scripts/build-zip.sh
================================================
#!/bin/bash

source ./scripts/constants.sh

npm install
electron-packager ./app $APP_NAME \
 --overwrite \
 --out=$DIST_DIR \
 --package-manager=yarn \
 --platform=$APP_PLATFORM \
 --arch=$APP_ARCH \
 --electron-version=$ELECTRON_VERSION \
 --icon=$BUILD_DIR/$APP_ICON_PATH

FILE_NAME=$APP_NAME-$APP_PLATFORM-$APP_ARCH
APP_DIR=$DIST_DIR/$FILE_NAME

cd $APP_DIR
zip -r $FILE_NAME.zip *
cd ../../../
pwd
mv $APP_DIR/$FILE_NAME.zip $RELEASES_DIR


================================================
FILE: scripts/clean.sh
================================================
#!/bin/bash

source ./scripts/constants.sh

rm -Rf $DIST_DIR/*
rm -Rf $OUTPUT_DIR/*
rm -Rf $RELEASES_DIR/*


================================================
FILE: scripts/constants.sh
================================================
#!/bin/bash

APP_NAME="WhatsApp"
APP_VERSION="0.5.4"
ELECTRON_VERSION="17.0.0"
ASSETS_DIR="./assets"
BUILD_DIR="./build"
DIST_DIR="$BUILD_DIR/dist"
RELEASES_DIR="$BUILD_DIR/releases"
TEMPLATES_DIR="$BUILD_DIR/templates"
OUTPUT_DIR="$BUILD_DIR/outputs"
Download .txt
gitextract_dwb58g73/

├── .gitignore
├── ISSUE_TEMPLATE.md
├── LICENSE
├── README.md
├── app/
│   ├── agents.json
│   ├── css/
│   │   └── settings.css
│   ├── html/
│   │   ├── about.html
│   │   ├── phoneinfo.html
│   │   └── settings.html
│   ├── js/
│   │   ├── injected.js
│   │   └── views/
│   │       ├── about.js
│   │       ├── phoneinfo.js
│   │       └── settings.js
│   ├── locale/
│   │   ├── de_DE/
│   │   │   └── messages.po
│   │   ├── en_US/
│   │   │   └── messages.po
│   │   ├── es_ES/
│   │   │   └── messages.po
│   │   ├── it_IT/
│   │   │   └── messages.po
│   │   ├── messages.pot
│   │   ├── pt_BR/
│   │   │   └── messages.po
│   │   ├── ru_RU/
│   │   │   └── messages.po
│   │   └── tr_TR/
│   │       └── messages.po
│   ├── main.js
│   ├── menu.js
│   └── package.json
├── build/
│   ├── assets/
│   │   └── osx/
│   │       └── whatsapp.icns
│   └── templates/
│       ├── debian/
│       │   ├── armv7l/
│       │   │   ├── compat
│       │   │   ├── control
│       │   │   ├── copyright
│       │   │   ├── docs
│       │   │   ├── postinst
│       │   │   └── prerm
│       │   ├── changelog
│       │   ├── ia32/
│       │   │   ├── compat
│       │   │   ├── control
│       │   │   ├── copyright
│       │   │   ├── docs
│       │   │   ├── postinst
│       │   │   └── prerm
│       │   └── x64/
│       │       ├── compat
│       │       ├── control
│       │       ├── copyright
│       │       ├── docs
│       │       ├── postinst
│       │       └── prerm
│       └── whatsapp.desktop
├── package.json
├── packager.json
└── scripts/
    ├── build-all.sh
    ├── build-darwin-arm64.sh
    ├── build-darwin-x64.sh
    ├── build-linux-armv7l.sh
    ├── build-linux-x32.sh
    ├── build-linux-x64.sh
    ├── build-linux.sh
    ├── build-win-x64.sh
    ├── build-zip.sh
    ├── clean.sh
    └── constants.sh
Download .txt
SYMBOL INDEX (35 symbols across 4 files)

FILE: app/js/injected.js
  function updatePhoneInfo (line 6) | function updatePhoneInfo() {

FILE: app/js/views/phoneinfo.js
  method bindEvents (line 5) | bindEvents() {
  method init (line 12) | init() {

FILE: app/js/views/settings.js
  method bindEvents (line 7) | bindEvents() {
  method init (line 28) | init() {
  method saveSettings (line 78) | saveSettings() {
  function chooseCustomCSS (line 121) | function chooseCustomCSS() {
  function chooseChatBackground (line 135) | function chooseChatBackground() {

FILE: app/main.js
  method init (line 156) | init() {
  method loadConfiguration (line 161) | loadConfiguration() {
  method applyConfiguration (line 186) | applyConfiguration() {
  method saveConfiguration (line 322) | saveConfiguration() {
  method get (line 340) | get (key) {
  method set (line 344) | set (key, value) {
  method unSet (line 348) | unSet (key) {
  method init (line 358) | init() {
  method createMenu (line 374) | createMenu() {
  method setNormalTray (line 381) | setNormalTray() {
  method setWarningTray (line 386) | setWarningTray() {
  method isWarningTrayIcon (line 391) | isWarningTrayIcon() {
  method setNewMessageIcon (line 395) | setNewMessageIcon() {
  method clearNewMessageIcon (line 400) | clearNewMessageIcon() {
  method isNewMessageIcon (line 405) | isNewMessageIcon() {
  method updateTrayIcon (line 409) | updateTrayIcon() {
  method createTray (line 432) | createTray() {
  method clearCache (line 488) | clearCache() {
  method openWindow (line 498) | openWindow() {
  method init (line 795) | init() {
  method createMenu (line 806) | createMenu() {
  method openWindow (line 842) | openWindow() {
  method init (line 869) | init() {
  method openWindow (line 881) | openWindow() {
  method init (line 928) | init () {
  method createMenu (line 939) | createMenu() {
  method openWindow (line 978) | openWindow() {
Condensed preview — 58 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (171K chars).
[
  {
    "path": ".gitignore",
    "chars": 187,
    "preview": ".idea/*\n.DS_Store\nThumbs.db\nbuild/outputs\nbuild/releases\nbuild/dist\nnpm-debug.log\nnode_modules\nelectron-*\n*.mo\n.pc\n*.log"
  },
  {
    "path": "ISSUE_TEMPLATE.md",
    "chars": 584,
    "preview": "### System details\n\n* OS: [write here your operative system name, version, language]\n* App Version: [write here the app "
  },
  {
    "path": "LICENSE",
    "chars": 35141,
    "preview": "                    GNU GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free "
  },
  {
    "path": "README.md",
    "chars": 5568,
    "preview": "![downloads](https://img.shields.io/github/downloads/oOthkOo/whatsapp-desktop/total?style=for-the-badge)\n\n# WhatsApp Des"
  },
  {
    "path": "app/agents.json",
    "chars": 239,
    "preview": "{\n    \"userAgents\": [\n        \"Mozilla/5.0 (X11; Linux x86_64; rv:141.0) Gecko/20100101 Firefox/141.0\",\n        \"Mozilla"
  },
  {
    "path": "app/css/settings.css",
    "chars": 304,
    "preview": "html{\n  -webkit-user-select: none;\n  user-select: none;\n}\n\nheader {\n  -webkit-app-region: drag;\n  display: block;\n  bord"
  },
  {
    "path": "app/html/about.html",
    "chars": 1520,
    "preview": "<!DOCTYPE html>\n<html>\n<head>\n  <meta charset=\"utf-8\">\n  <script type=\"text/javascript\">\n  window.jQuery = window.$ = re"
  },
  {
    "path": "app/html/phoneinfo.html",
    "chars": 1442,
    "preview": "<!DOCTYPE html>\n<html>\n<head>\n  <meta charset=\"utf-8\">\n  <script type=\"text/javascript\">\n  window.jQuery = window.$ = re"
  },
  {
    "path": "app/html/settings.html",
    "chars": 5812,
    "preview": "<!DOCTYPE html>\n<html>\n<head>\n  <meta charset=\"utf-8\">\n  <script type=\"text/javascript\">\n  window.jQuery = window.$ = re"
  },
  {
    "path": "app/js/injected.js",
    "chars": 3510,
    "preview": "(function () {\n\n    const {ipcRenderer} = require('electron');\n    var updatePhoneInfoInterval = null;\n\n    function upd"
  },
  {
    "path": "app/js/views/about.js",
    "chars": 634,
    "preview": "var whatsApp = require('@electron/remote').getGlobal(\"whatsApp\");\nvar pjson = require('@electron/remote').getGlobal('pjs"
  },
  {
    "path": "app/js/views/phoneinfo.js",
    "chars": 1160,
    "preview": "var whatsApp = require('@electron/remote').getGlobal(\"whatsApp\");\nvar phoneinfo = require('@electron/remote').getGlobal("
  },
  {
    "path": "app/js/views/settings.js",
    "chars": 6288,
    "preview": "var whatsApp = require('@electron/remote').getGlobal(\"whatsApp\");\nvar settings = require('@electron/remote').getGlobal('"
  },
  {
    "path": "app/locale/de_DE/messages.po",
    "chars": 3575,
    "preview": "# Whatsapp Desktop translations.\n#\nmsgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: Whatsapp-Desktop\\n\"\n\"Report-Msgid-Bugs-To: \\n"
  },
  {
    "path": "app/locale/en_US/messages.po",
    "chars": 3472,
    "preview": "# Whatsapp Desktop translations.\n#\nmsgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: Whatsapp-Desktop\\n\"\n\"Report-Msgid-Bugs-To: \\n"
  },
  {
    "path": "app/locale/es_ES/messages.po",
    "chars": 3665,
    "preview": "# Whatsapp Desktop translations.\n#\nmsgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: Whatsapp-Desktop\\n\"\n\"Report-Msgid-Bugs-To: \\n"
  },
  {
    "path": "app/locale/it_IT/messages.po",
    "chars": 3651,
    "preview": "# Whatsapp Desktop translations.\n#\nmsgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: Whatsapp-Desktop\\n\"\n\"Report-Msgid-Bugs-To: \\n"
  },
  {
    "path": "app/locale/messages.pot",
    "chars": 3029,
    "preview": "# Whatsapp Desktop translations.\n#\nmsgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: Whatsapp-Desktop\\n\"\n\"Report-Msgid-Bugs-To: \\n"
  },
  {
    "path": "app/locale/pt_BR/messages.po",
    "chars": 3571,
    "preview": "# Whatsapp Desktop translations.\n#\nmsgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: Whatsapp-Desktop\\n\"\n\"Report-Msgid-Bugs-To: \\n"
  },
  {
    "path": "app/locale/ru_RU/messages.po",
    "chars": 3562,
    "preview": "# Whatsapp Desktop translations.\n#\nmsgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: Whatsapp-Desktop\\n\"\n\"Report-Msgid-Bugs-To: \\n"
  },
  {
    "path": "app/locale/tr_TR/messages.po",
    "chars": 3522,
    "preview": "# Whatsapp Desktop translations.\n#\nmsgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: Whatsapp-Desktop\\n\"\n\"Report-Msgid-Bugs-To: \\n"
  },
  {
    "path": "app/main.js",
    "chars": 40763,
    "preview": "(function(scope) {\n    \"use strict\";\n\n    const pkg = require('./package')\n    const agents = require('./agents')\n    co"
  },
  {
    "path": "app/menu.js",
    "chars": 8480,
    "preview": "(function(scope) {\n    \"use strict\";\n\n    var template = [\n        {\n            label: \"&\" + _('Edit'),\n            sub"
  },
  {
    "path": "app/package.json",
    "chars": 605,
    "preview": "{\n  \"name\": \"whatsapp-desktop\",\n  \"version\": \"0.5.3\",\n  \"license\": \"GPL-3.0\",\n  \"repository\": {\n    \"type\": \"git\",\n    \""
  },
  {
    "path": "build/templates/debian/armv7l/compat",
    "chars": 2,
    "preview": "9\n"
  },
  {
    "path": "build/templates/debian/armv7l/control",
    "chars": 440,
    "preview": "Source: whatsapp-desktop\nVersion: {version}\nSection: net\nPriority: optional\nMaintainer: Tierry Danquin <contact@oothkoo."
  },
  {
    "path": "build/templates/debian/armv7l/copyright",
    "chars": 1374,
    "preview": "Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/\nUpstream-Name: whatsapp-desktop\nSource: <https"
  },
  {
    "path": "build/templates/debian/armv7l/docs",
    "chars": 10,
    "preview": "readme.md\n"
  },
  {
    "path": "build/templates/debian/armv7l/postinst",
    "chars": 1145,
    "preview": "#!/bin/sh\n# postinst script\n#\n# see: dh_installdeb(1)\n\nset -e\n\n# summary of how this script can be called:\n#        * <p"
  },
  {
    "path": "build/templates/debian/armv7l/prerm",
    "chars": 878,
    "preview": "#!/bin/sh\n# prerm script\n#\n# see: dh_installdeb(1)\n\nset -e\n\n# summary of how this script can be called:\n#        * <prer"
  },
  {
    "path": "build/templates/debian/changelog",
    "chars": 2573,
    "preview": "whatsapp-desktop (0.5.3) unstable; urgency=high\n\n  * Bugfix\n  \n -- Tierry <contact@oothkoo.com> 14 November 2025\n\nwhatsa"
  },
  {
    "path": "build/templates/debian/ia32/compat",
    "chars": 2,
    "preview": "9\n"
  },
  {
    "path": "build/templates/debian/ia32/control",
    "chars": 439,
    "preview": "Source: whatsapp-desktop\nVersion: {version}\nSection: net\nPriority: optional\nMaintainer: Tierry Danquin <contact@oothkoo."
  },
  {
    "path": "build/templates/debian/ia32/copyright",
    "chars": 1374,
    "preview": "Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/\nUpstream-Name: whatsapp-desktop\nSource: <https"
  },
  {
    "path": "build/templates/debian/ia32/docs",
    "chars": 10,
    "preview": "readme.md\n"
  },
  {
    "path": "build/templates/debian/ia32/postinst",
    "chars": 1145,
    "preview": "#!/bin/sh\n# postinst script\n#\n# see: dh_installdeb(1)\n\nset -e\n\n# summary of how this script can be called:\n#        * <p"
  },
  {
    "path": "build/templates/debian/ia32/prerm",
    "chars": 878,
    "preview": "#!/bin/sh\n# prerm script\n#\n# see: dh_installdeb(1)\n\nset -e\n\n# summary of how this script can be called:\n#        * <prer"
  },
  {
    "path": "build/templates/debian/x64/compat",
    "chars": 2,
    "preview": "9\n"
  },
  {
    "path": "build/templates/debian/x64/control",
    "chars": 440,
    "preview": "Source: whatsapp-desktop\nVersion: {version}\nSection: net\nPriority: optional\nMaintainer: Tierry Danquin <contact@oothkoo."
  },
  {
    "path": "build/templates/debian/x64/copyright",
    "chars": 1374,
    "preview": "Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/\nUpstream-Name: whatsapp-desktop\nSource: <https"
  },
  {
    "path": "build/templates/debian/x64/docs",
    "chars": 10,
    "preview": "readme.md\n"
  },
  {
    "path": "build/templates/debian/x64/postinst",
    "chars": 1145,
    "preview": "#!/bin/sh\n# postinst script\n#\n# see: dh_installdeb(1)\n\nset -e\n\n# summary of how this script can be called:\n#        * <p"
  },
  {
    "path": "build/templates/debian/x64/prerm",
    "chars": 878,
    "preview": "#!/bin/sh\n# prerm script\n#\n# see: dh_installdeb(1)\n\nset -e\n\n# summary of how this script can be called:\n#        * <prer"
  },
  {
    "path": "build/templates/whatsapp.desktop",
    "chars": 262,
    "preview": "[Desktop Entry]\nType=Application\nVersion={version}\nName=WhatsApp\nComment=WhatsApp Desktop unofficial client\nExec=/opt/wh"
  },
  {
    "path": "package.json",
    "chars": 1181,
    "preview": "{\n    \"name\": \"whatsapp-desktop\",\n    \"version\": \"0.5.4\",\n    \"repository\": \"https://github.com/oOthkOo/whatsapp-desktop"
  },
  {
    "path": "packager.json",
    "chars": 599,
    "preview": "{\n  \"osx\": {\n    \"title\": \"WhatsApp\",\n    \"icon\": \"build/assets/osx/whatsapp.icns\",\n    \"icon-size\": 80,\n    \"contents\":"
  },
  {
    "path": "scripts/build-all.sh",
    "chars": 151,
    "preview": "#!/bin/bash\n\nnpm run clean\nnpm run build:win\nnpm run build:osx\nnpm run build:osxm1\nnpm run build:linux\nnpm run build:lin"
  },
  {
    "path": "scripts/build-darwin-arm64.sh",
    "chars": 138,
    "preview": "#!/bin/bash\n\nexport APP_ARCH=\"arm64\"\nexport APP_PLATFORM=\"darwin\"\nexport APP_ICON_PATH=\"assets/osx/whatsapp.icns\"\n\n./scr"
  },
  {
    "path": "scripts/build-darwin-x64.sh",
    "chars": 136,
    "preview": "#!/bin/bash\n\nexport APP_ARCH=\"x64\"\nexport APP_PLATFORM=\"darwin\"\nexport APP_ICON_PATH=\"assets/osx/whatsapp.icns\"\n\n./scrip"
  },
  {
    "path": "scripts/build-linux-armv7l.sh",
    "chars": 64,
    "preview": "#!/bin/bash\n\nexport APP_ARCH=\"armv7l\"\n\n./scripts/build-linux.sh\n"
  },
  {
    "path": "scripts/build-linux-x32.sh",
    "chars": 62,
    "preview": "#!/bin/bash\n\nexport APP_ARCH=\"ia32\"\n\n./scripts/build-linux.sh\n"
  },
  {
    "path": "scripts/build-linux-x64.sh",
    "chars": 61,
    "preview": "#!/bin/bash\n\nexport APP_ARCH=\"x64\"\n\n./scripts/build-linux.sh\n"
  },
  {
    "path": "scripts/build-linux.sh",
    "chars": 1211,
    "preview": "#!/bin/bash\n\nsource ./scripts/constants.sh\n\nnpm install\nelectron-packager ./app $APP_NAME \\\n --overwrite \\\n --out=$DIST_"
  },
  {
    "path": "scripts/build-win-x64.sh",
    "chars": 134,
    "preview": "#!/bin/bash\n\nexport APP_ARCH=\"x64\"\nexport APP_PLATFORM=\"win32\"\nexport APP_ICON_PATH=\"assets/win/whatsapp.ico\"\n\n./scripts"
  },
  {
    "path": "scripts/build-zip.sh",
    "chars": 443,
    "preview": "#!/bin/bash\n\nsource ./scripts/constants.sh\n\nnpm install\nelectron-packager ./app $APP_NAME \\\n --overwrite \\\n --out=$DIST_"
  },
  {
    "path": "scripts/clean.sh",
    "chars": 107,
    "preview": "#!/bin/bash\n\nsource ./scripts/constants.sh\n\nrm -Rf $DIST_DIR/*\nrm -Rf $OUTPUT_DIR/*\nrm -Rf $RELEASES_DIR/*\n"
  },
  {
    "path": "scripts/constants.sh",
    "chars": 251,
    "preview": "#!/bin/bash\n\nAPP_NAME=\"WhatsApp\"\nAPP_VERSION=\"0.5.4\"\nELECTRON_VERSION=\"17.0.0\"\nASSETS_DIR=\"./assets\"\nBUILD_DIR=\"./build\""
  }
]

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

About this extraction

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

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

Copied to clipboard!