Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
829f0d779d |
@@ -1,2 +1,2 @@
|
||||
github "DigitaSecurity/dnd" "cameraUpdates"
|
||||
github "getsentry/sentry-cocoa" "4.1.0"
|
||||
github "DigitaSecurity/dnd" "master"
|
||||
github "getsentry/sentry-cocoa" "3.12.0"
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
github "Alamofire/Alamofire" "4.7.3"
|
||||
github "Alamofire/AlamofireImage" "75fadf98aab78c0829923dd496f369950aa32d6f"
|
||||
github "Alamofire/Alamofire" "4.7.2"
|
||||
github "Alamofire/AlamofireImage" "3.3.1"
|
||||
github "DigitaSecurity/CocoaAsyncSocket" "79a11b7036d0a77ca95de42cc1c92b5a4c50f0c9"
|
||||
github "DigitaSecurity/dnd" "d9a93e985b83d537942e561f028e39b978cb56a5"
|
||||
github "DigitaSecurity/dnd" "02b4b2c6d495ebafda648e6ca6ebfbed7c20d0e7"
|
||||
github "SnapKit/SnapKit" "4.0.0"
|
||||
github "SwiftyJSON/SwiftyJSON" "4.1.0"
|
||||
github "emaloney/CleanroomLogger" "5.1.0"
|
||||
github "emqtt/CocoaMQTT" "b851bdabc01dd98dda9781765ad510d818773819"
|
||||
github "getsentry/sentry-cocoa" "4.1.0"
|
||||
github "ninjaprox/NVActivityIndicatorView" "4.3.0"
|
||||
github "emqtt/CocoaMQTT" "4ef7bdcf3f0a754790dab8bff86dec67a695ee3c"
|
||||
github "getsentry/sentry-cocoa" "3.12.0"
|
||||
github "ninjaprox/NVActivityIndicatorView" "4.2.1"
|
||||
github "radex/SwiftyTimer" "2.0.0"
|
||||
github "realm/realm-cocoa" "11dd806fcaacd680d12d616b3a5e93d85bf942f9"
|
||||
github "realm/realm-cocoa" "v3.7.1"
|
||||
github "saoudrizwan/Disk" "0.3.3"
|
||||
github "soffes/CommonCrypto" "v1.1.0"
|
||||
|
||||
@@ -1,674 +1 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://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 <https://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:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
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
|
||||
<https://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
|
||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
||||
<a rel="license" href="http://creativecommons.org/licenses/by-nc/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by-nc/4.0/88x31.png" /></a><br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc/4.0/">Creative Commons Attribution-NonCommercial 4.0 International License</a>.
|
||||
|
||||
@@ -32,14 +32,9 @@
|
||||
//super
|
||||
[super windowDidLoad];
|
||||
|
||||
//not in mojave dark mode?
|
||||
// make window color white
|
||||
if(YES != isDarkMode())
|
||||
{
|
||||
//make white
|
||||
self.window.backgroundColor = NSColor.whiteColor;
|
||||
}
|
||||
|
||||
//make white
|
||||
[self.window setBackgroundColor: NSColor.whiteColor];
|
||||
|
||||
//set version sting
|
||||
self.versionLabel.stringValue = [NSString stringWithFormat:@"Version: %@", getAppVersion()];
|
||||
|
||||
|
||||
@@ -29,10 +29,10 @@ typedef void (^block)(NSNumber*);
|
||||
@property(nonatomic) BOOL gotHelp;
|
||||
|
||||
//daemom comms object
|
||||
@property(nonatomic, retain)HelperComms* xpcComms;
|
||||
@property(nonatomic, retain) HelperComms* xpcComms;
|
||||
|
||||
//status msg
|
||||
@property (nonatomic, weak)IBOutlet NSTextField *statusMsg;
|
||||
@property (nonatomic, weak) IBOutlet NSTextField *statusMsg;
|
||||
|
||||
//about window controller
|
||||
@property(nonatomic, retain)AboutWindowController* aboutWindowController;
|
||||
|
||||
@@ -40,17 +40,6 @@
|
||||
//start crash handler
|
||||
[SentryClient.sharedClient startCrashHandlerWithError:nil];
|
||||
|
||||
//make sure system is supported (lid)
|
||||
// if not, will inform user via alert
|
||||
if(YES != [self isSupported])
|
||||
{
|
||||
//dbg msg
|
||||
logMsg(LOG_ERR, @"device doesn't appear to have a lid (i.e. is unsupported)");
|
||||
|
||||
//exit
|
||||
[NSApp terminate:self];
|
||||
}
|
||||
|
||||
//alloc/init Config obj
|
||||
configureObj = [[Configure alloc] init];
|
||||
|
||||
@@ -60,51 +49,6 @@
|
||||
return;
|
||||
}
|
||||
|
||||
//check if there's a lid
|
||||
// if not, alert to tell user
|
||||
-(BOOL)isSupported
|
||||
{
|
||||
//flag
|
||||
BOOL supported = NO;
|
||||
|
||||
//alert
|
||||
NSAlert* alert = nil;
|
||||
|
||||
//no lid
|
||||
// can't support!
|
||||
if(stateUnavailable == getLidState())
|
||||
{
|
||||
//init alert
|
||||
alert = [[NSAlert alloc] init];
|
||||
|
||||
//set main text
|
||||
alert.messageText = @"Unsupported Device";
|
||||
|
||||
//set informative text
|
||||
alert.informativeText = [NSString stringWithFormat:@"'%@' does not appear to be a laptop", [[NSHost currentHost] localizedName]];
|
||||
|
||||
//add button
|
||||
[alert addButtonWithTitle:@"Ok"];
|
||||
|
||||
//set style
|
||||
alert.alertStyle = NSAlertStyleWarning;
|
||||
|
||||
//show it
|
||||
[alert runModal];
|
||||
|
||||
//bail
|
||||
goto bail;
|
||||
}
|
||||
|
||||
//happy
|
||||
supported = YES;
|
||||
|
||||
bail:
|
||||
|
||||
return supported;
|
||||
|
||||
}
|
||||
|
||||
//exit when last window is closed
|
||||
-(BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)sender
|
||||
{
|
||||
@@ -142,6 +86,7 @@ bail:
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//menu handler for 'about'
|
||||
-(IBAction)displayAboutWindow:(id)sender
|
||||
{
|
||||
|
||||
@@ -15,28 +15,13 @@
|
||||
}
|
||||
|
||||
/* PROPERTIES */
|
||||
|
||||
//config (main) view
|
||||
@property (weak) IBOutlet NSView *configView;
|
||||
|
||||
//"friends of objective-see"
|
||||
@property (strong, nonatomic) IBOutlet NSView *friendsView;
|
||||
|
||||
//status msg
|
||||
@property (weak, nonatomic) IBOutlet NSTextField *statusMsg;
|
||||
|
||||
//install button
|
||||
@property (weak, nonatomic) IBOutlet NSButton *installButton;
|
||||
|
||||
//more info button
|
||||
@property (weak, nonatomic) IBOutlet NSButton *moreInfoButton;
|
||||
|
||||
//uninstall button
|
||||
@property (weak, nonatomic) IBOutlet NSButton *uninstallButton;
|
||||
|
||||
//activity indicator (spinner)
|
||||
@property (weak, nonatomic) IBOutlet NSProgressIndicator *activityIndicator;
|
||||
|
||||
|
||||
/* METHODS */
|
||||
|
||||
//install/uninstall button handler
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
|
||||
@synthesize statusMsg;
|
||||
@synthesize moreInfoButton;
|
||||
@synthesize friendsView;
|
||||
|
||||
//automatically called when nib is loaded
|
||||
// just center window
|
||||
@@ -55,7 +54,7 @@
|
||||
self.window.title = [NSString stringWithFormat:@"Do Not Disturb (v. %@)", getAppVersion()];
|
||||
|
||||
//init status msg
|
||||
self.statusMsg.stringValue = @"evil maids: stay out! 🙅♀️🚪";
|
||||
[self.statusMsg setStringValue:@"evil maids: stay out! 🙅♀️🚪"];
|
||||
|
||||
//app already installed?
|
||||
// enable 'uninstall' button
|
||||
@@ -96,14 +95,9 @@
|
||||
|
||||
//make window front
|
||||
[NSApp activateIgnoringOtherApps:YES];
|
||||
|
||||
//not in mojave dark mode?
|
||||
// make window color white
|
||||
if(YES != isDarkMode())
|
||||
{
|
||||
//make white
|
||||
self.window.backgroundColor = NSColor.whiteColor;
|
||||
}
|
||||
|
||||
//make white
|
||||
[self.window setBackgroundColor: NSColor.whiteColor];
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -111,101 +105,42 @@
|
||||
//button handler for uninstall/install
|
||||
-(IBAction)buttonHandler:(id)sender
|
||||
{
|
||||
//frame
|
||||
NSRect frame = {0};
|
||||
|
||||
//action
|
||||
NSInteger action = 0;
|
||||
|
||||
//grab action
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, [NSString stringWithFormat:@"handling action click: %@", ((NSButton*)sender).title]);
|
||||
|
||||
//grab tag
|
||||
action = ((NSButton*)sender).tag;
|
||||
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, [NSString stringWithFormat:@"handling action click: %@ (tag: %ld)", ((NSButton*)sender).title, (long)action]);
|
||||
|
||||
//handle various actions
|
||||
switch(action)
|
||||
//close?
|
||||
// close window to trigger exit logic
|
||||
if(action == ACTION_CLOSE_FLAG)
|
||||
{
|
||||
//close
|
||||
case ACTION_CLOSE_FLAG:
|
||||
[self.window close];
|
||||
break;
|
||||
|
||||
//install/uninstall
|
||||
case ACTION_INSTALL_FLAG:
|
||||
case ACTION_UNINSTALL_FLAG:
|
||||
{
|
||||
//disable 'x' button
|
||||
// don't want user killing app during install/upgrade
|
||||
[[self.window standardWindowButton:NSWindowCloseButton] setEnabled:NO];
|
||||
|
||||
//clear status msg
|
||||
[self.statusMsg setStringValue:@""];
|
||||
|
||||
//force redraw of status msg
|
||||
// sometime doesn't refresh (e.g. slow VM)
|
||||
[self.statusMsg setNeedsDisplay:YES];
|
||||
|
||||
//invoke logic to install/uninstall
|
||||
// do in background so UI doesn't block
|
||||
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0),
|
||||
^{
|
||||
|
||||
//install/uninstall
|
||||
[self lifeCycleEvent:action];
|
||||
|
||||
});
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
//next
|
||||
// show 'friends' view
|
||||
case ACTION_NEXT_FLAG:
|
||||
{
|
||||
//unset window title
|
||||
self.window.title = @"";
|
||||
|
||||
//get main window's frame
|
||||
frame = self.window.contentView.frame;
|
||||
|
||||
//set origin to 0/0
|
||||
frame.origin = CGPointZero;
|
||||
|
||||
//increase y offset
|
||||
frame.origin.y += 5;
|
||||
|
||||
//reduce height
|
||||
frame.size.height -= 5;
|
||||
|
||||
//pre-req
|
||||
[self.friendsView setWantsLayer:YES];
|
||||
|
||||
//update overlay to take up entire window
|
||||
self.friendsView.frame = frame;
|
||||
|
||||
//not in mojave dark mode?
|
||||
// make window color white
|
||||
if(YES != isDarkMode())
|
||||
{
|
||||
//set white
|
||||
self.friendsView.layer.backgroundColor = [NSColor whiteColor].CGColor;
|
||||
}
|
||||
|
||||
//update config view
|
||||
self.window.contentView = self.friendsView;
|
||||
|
||||
//show
|
||||
self.friendsView.hidden = NO;
|
||||
|
||||
//draw
|
||||
self.friendsView.needsDisplay = YES;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
[self.window close];
|
||||
}
|
||||
|
||||
//disable 'x' button
|
||||
// don't want user killing app during install/upgrade
|
||||
[[self.window standardWindowButton:NSWindowCloseButton] setEnabled:NO];
|
||||
|
||||
//clear status msg
|
||||
[self.statusMsg setStringValue:@""];
|
||||
|
||||
//force redraw of status msg
|
||||
// sometime doesn't refresh (e.g. slow VM)
|
||||
[self.statusMsg setNeedsDisplay:YES];
|
||||
|
||||
//invoke logic to install/uninstall
|
||||
// do in background so UI doesn't block
|
||||
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0),
|
||||
^{
|
||||
//install/uninstall
|
||||
[self lifeCycleEvent:action];
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -358,13 +293,18 @@
|
||||
{
|
||||
//set result msg
|
||||
resultMsg = [NSMutableString stringWithFormat:@"Do Not Disturb %@ed!", action];
|
||||
|
||||
|
||||
//set font to black
|
||||
resultMsgColor = [NSColor blackColor];
|
||||
}
|
||||
//failure
|
||||
else
|
||||
{
|
||||
//set result msg
|
||||
resultMsg = [NSMutableString stringWithFormat:@"Error: %@ failed", action];
|
||||
resultMsg = [NSMutableString stringWithFormat:@"error: %@ failed", action];
|
||||
|
||||
//set font to red
|
||||
resultMsgColor = [NSColor redColor];
|
||||
|
||||
//show 'get more info' button
|
||||
self.moreInfoButton.hidden = NO;
|
||||
@@ -394,11 +334,12 @@
|
||||
//set status msg
|
||||
[self.statusMsg setStringValue:resultMsg];
|
||||
|
||||
//set button to 'next'
|
||||
self.installButton.title = ACTION_NEXT;
|
||||
//set button to close
|
||||
self.installButton.title = ACTION_CLOSE;
|
||||
|
||||
//set tag to next
|
||||
self.installButton.tag = ACTION_NEXT_FLAG;
|
||||
//update it's tag
|
||||
// will allow button handler method to detect the close
|
||||
self.installButton.tag = -1;
|
||||
|
||||
//enable
|
||||
self.installButton.enabled = YES;
|
||||
|
||||
@@ -1,16 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14313.18" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14113" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||
<dependencies>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14313.18"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14113"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<customObject id="-2" userLabel="File's Owner" customClass="ConfigureWindowController">
|
||||
<connections>
|
||||
<outlet property="activityIndicator" destination="b1w-5W-ayX" id="P5e-PO-Ozi"/>
|
||||
<outlet property="configView" destination="se5-gp-TjO" id="F8t-Xo-OlH"/>
|
||||
<outlet property="friendsView" destination="PmP-2C-4wF" id="INT-Fp-t78"/>
|
||||
<outlet property="installButton" destination="553-2y-kvm" id="nxf-wO-EI3"/>
|
||||
<outlet property="moreInfoButton" destination="QWu-qZ-Za2" id="8kC-Ga-5oJ"/>
|
||||
<outlet property="statusMsg" destination="SpB-Xc-WlB" id="jlm-ke-XfM"/>
|
||||
@@ -20,11 +18,11 @@
|
||||
</customObject>
|
||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
||||
<window allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" animationBehavior="default" id="F0z-JX-Cv5">
|
||||
<window allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" oneShot="NO" releasedWhenClosed="NO" showsToolbarButton="NO" visibleAtLaunch="NO" animationBehavior="default" id="F0z-JX-Cv5">
|
||||
<windowStyleMask key="styleMask" titled="YES" closable="YES" texturedBackground="YES"/>
|
||||
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
|
||||
<rect key="contentRect" x="196" y="240" width="460" height="176"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="1680" height="1028"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="1680" height="1027"/>
|
||||
<view key="contentView" id="se5-gp-TjO">
|
||||
<rect key="frame" x="0.0" y="0.0" width="460" height="176"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
@@ -92,45 +90,44 @@
|
||||
</connections>
|
||||
<point key="canvasLocation" x="185" y="-256"/>
|
||||
</window>
|
||||
<customView id="PmP-2C-4wF" userLabel="Friends">
|
||||
<customView id="PmP-2C-4wF" userLabel="Support">
|
||||
<rect key="frame" x="0.0" y="0.0" width="460" height="176"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<subviews>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="MGz-6K-qG8">
|
||||
<rect key="frame" x="18" y="142" width="424" height="19"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<textFieldCell key="cell" lineBreakMode="clipping" alignment="center" title="Mahalo to the "Friends of Objective-See"" id="7Bp-jO-RQc">
|
||||
<font key="font" size="13" name="Menlo-Regular"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="tSv-y3-y5e">
|
||||
<rect key="frame" x="80" y="27" width="138" height="19"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<textFieldCell key="cell" lineBreakMode="clipping" alignment="center" title="Digita Security" id="Jb9-oJ-xk4">
|
||||
<font key="font" size="13" name="Menlo-Regular"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="eld-oV-6lG">
|
||||
<rect key="frame" x="117" y="54" width="64" height="64"/>
|
||||
<imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="f0f-aN-ikB">
|
||||
<rect key="frame" x="0.0" y="73" width="460" height="95"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="digita" id="wJq-yW-MBL"/>
|
||||
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="objectiveSee" id="8Lr-Ox-eyh"/>
|
||||
</imageView>
|
||||
<imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="MBu-V2-MAX">
|
||||
<rect key="frame" x="286" y="54" width="64" height="64"/>
|
||||
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Euc-W6-dQ1" userLabel="No">
|
||||
<rect key="frame" x="216" y="13" width="115" height="32"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="malwarebytes" id="DiU-Xn-tkq"/>
|
||||
</imageView>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="SDE-Qu-lcq">
|
||||
<rect key="frame" x="249" y="27" width="138" height="19"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<textFieldCell key="cell" lineBreakMode="clipping" alignment="center" title="Malwarebytes" id="p1n-KZ-bj5">
|
||||
<buttonCell key="cell" type="push" title="No" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="8ir-Qw-y4G">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" size="13" name="Menlo-Regular"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<action selector="buttonHandler:" target="-2" id="uik-ZX-MTQ"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="9Sm-sm-Qzm" userLabel="Yes">
|
||||
<rect key="frame" x="331" y="13" width="115" height="32"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<buttonCell key="cell" type="push" title="Yes!" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="ezp-te-R3O">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" size="13" name="Menlo-Regular"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<action selector="buttonHandler:" target="-2" id="Yea-Bv-dgb"/>
|
||||
</connections>
|
||||
</button>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="xaj-ED-vIC">
|
||||
<rect key="frame" x="144" y="60" width="306" height="25"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="left" title="support our free tools?" id="KSy-eB-CzB">
|
||||
<font key="font" size="17" name="Menlo-Bold"/>
|
||||
<color key="textColor" white="0.25" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
</subviews>
|
||||
@@ -138,9 +135,8 @@
|
||||
</customView>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="digita" width="334" height="338"/>
|
||||
<image name="dndIcon" width="256" height="256"/>
|
||||
<image name="dndText" width="164.57142639160156" height="21.188571929931641"/>
|
||||
<image name="malwarebytes" width="300" height="267"/>
|
||||
<image name="objectiveSee" width="943" height="236"/>
|
||||
</resources>
|
||||
</document>
|
||||
|
||||
|
Before Width: | Height: | Size: 44 KiB |
|
Before Width: | Height: | Size: 20 KiB |
@@ -13,11 +13,11 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.3.0</string>
|
||||
<string>1.2.2</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.3.0</string>
|
||||
<string>1.2.2</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>Copyright (c) 2018 Objective-See</string>
|
||||
<key>NSMainNibFile</key>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<key>CFBundleName</key>
|
||||
<string>helper</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.3.0</string>
|
||||
<string>1.2.2</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>Copyright (c) 2018 Objective-See</string>
|
||||
<key>SMAuthorizedClients</key>
|
||||
|
||||
@@ -38,8 +38,6 @@
|
||||
CDAAC24B20226DFB0032F2E6 /* objectiveSee.png in Resources */ = {isa = PBXBuildFile; fileRef = CDAAC24720226DFB0032F2E6 /* objectiveSee.png */; };
|
||||
CDAAC24C20226DFB0032F2E6 /* logo.png in Resources */ = {isa = PBXBuildFile; fileRef = CDAAC24820226DFB0032F2E6 /* logo.png */; };
|
||||
CDAAC24D20226DFB0032F2E6 /* dndIcon.png in Resources */ = {isa = PBXBuildFile; fileRef = CDAAC24920226DFB0032F2E6 /* dndIcon.png */; };
|
||||
CDFA08CF213E3C280089758C /* malwarebytes.png in Resources */ = {isa = PBXBuildFile; fileRef = CDFA08CD213E3C280089758C /* malwarebytes.png */; };
|
||||
CDFA08D1213E3DD50089758C /* digita.png in Resources */ = {isa = PBXBuildFile; fileRef = CDFA08D0213E3DD50089758C /* digita.png */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
@@ -75,16 +73,6 @@
|
||||
name = "Copy Frameworks";
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
CDD3ADF42135285B004F805F /* Copy Frameworks */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = "";
|
||||
dstSubfolderSpec = 10;
|
||||
files = (
|
||||
);
|
||||
name = "Copy Frameworks";
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
@@ -129,8 +117,6 @@
|
||||
CDAAC24820226DFB0032F2E6 /* logo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = logo.png; path = ../../shared/images/logo.png; sourceTree = "<group>"; };
|
||||
CDAAC24920226DFB0032F2E6 /* dndIcon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = dndIcon.png; path = ../../shared/images/dndIcon.png; sourceTree = "<group>"; };
|
||||
CDAAC24A20226DFB0032F2E6 /* dndText.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = dndText.png; path = ../../shared/images/dndText.png; sourceTree = "<group>"; };
|
||||
CDFA08CD213E3C280089758C /* malwarebytes.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = malwarebytes.png; path = Images/malwarebytes.png; sourceTree = "<group>"; };
|
||||
CDFA08D0213E3DD50089758C /* digita.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = digita.png; path = Images/digita.png; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
@@ -192,7 +178,6 @@
|
||||
4BE4904710445D49006BE471 /* Configure */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
CDFA08CB213E3C170089758C /* Images */,
|
||||
CD3307AD203567D400F10D71 /* Assets.xcassets */,
|
||||
CD17D54420104EE700F798D7 /* AboutWindow.xib */,
|
||||
CD17D54220104EE600F798D7 /* AboutWindowController.h */,
|
||||
@@ -269,15 +254,6 @@
|
||||
name = Images;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
CDFA08CB213E3C170089758C /* Images */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
CDFA08D0213E3DD50089758C /* digita.png */,
|
||||
CDFA08CD213E3C280089758C /* malwarebytes.png */,
|
||||
);
|
||||
name = Images;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
@@ -287,7 +263,6 @@
|
||||
buildPhases = (
|
||||
4BE4905A10445E0A006BE471 /* Sources */,
|
||||
4BE4905B10445E0A006BE471 /* Frameworks */,
|
||||
CDD3ADF42135285B004F805F /* Copy Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
@@ -326,7 +301,7 @@
|
||||
29B97313FDCFA39411CA2CEA /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 1000;
|
||||
LastUpgradeCheck = 0930;
|
||||
TargetAttributes = {
|
||||
4BE4905C10445E0A006BE471 = {
|
||||
DevelopmentTeam = VBG97UB4TA;
|
||||
@@ -370,8 +345,6 @@
|
||||
CD17D54E20104EE700F798D7 /* AboutWindow.xib in Resources */,
|
||||
CD3307AE203567D500F10D71 /* Assets.xcassets in Resources */,
|
||||
CD17D55120104EE700F798D7 /* ConfigureWindowController.xib in Resources */,
|
||||
CDFA08CF213E3C280089758C /* malwarebytes.png in Resources */,
|
||||
CDFA08D1213E3DD50089758C /* digita.png in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -439,10 +412,9 @@
|
||||
buildSettings = {
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CODE_SIGN_IDENTITY = "Mac Developer";
|
||||
CODE_SIGN_IDENTITY = "Developer ID Application";
|
||||
CODE_SIGN_STYLE = Manual;
|
||||
DEVELOPMENT_TEAM = VBG97UB4TA;
|
||||
FRAMEWORK_SEARCH_PATHS = "$(PROJECT_DIR)/../Carthage/Build/Mac";
|
||||
GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = NO;
|
||||
INFOPLIST_FILE = Helper/Info.plist;
|
||||
OTHER_LDFLAGS = (
|
||||
@@ -468,10 +440,9 @@
|
||||
buildSettings = {
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CODE_SIGN_IDENTITY = "Mac Developer";
|
||||
CODE_SIGN_IDENTITY = "Developer ID Application";
|
||||
CODE_SIGN_STYLE = Manual;
|
||||
DEVELOPMENT_TEAM = VBG97UB4TA;
|
||||
FRAMEWORK_SEARCH_PATHS = "$(PROJECT_DIR)/../Carthage/Build/Mac";
|
||||
GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = NO;
|
||||
INFOPLIST_FILE = Helper/Info.plist;
|
||||
OTHER_LDFLAGS = (
|
||||
@@ -559,7 +530,7 @@
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
CODE_SIGN_IDENTITY = "Mac Developer";
|
||||
CODE_SIGN_IDENTITY = "Developer ID Application: Objective-See, LLC (VBG97UB4TA)";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
@@ -611,7 +582,7 @@
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
CODE_SIGN_IDENTITY = "Mac Developer";
|
||||
CODE_SIGN_IDENTITY = "Developer ID Application: Objective-See, LLC (VBG97UB4TA)";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "1000"
|
||||
LastUpgradeVersion = "0930"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "NO"
|
||||
@@ -84,7 +84,7 @@
|
||||
</AdditionalOptions>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Release"
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
|
||||
@@ -15,13 +15,15 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>BNDL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.3.0</string>
|
||||
<string>1.2.2</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.3.0</string>
|
||||
<string>1.2.2</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>Copyright © 2018 Objective-See. All rights reserved.</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string></string>
|
||||
<key>NSCameraUsageDescription</key>
|
||||
<string></string>
|
||||
<key>LSUIElement</key>
|
||||
<true/>
|
||||
</dict>
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
209E459F203DF5D500900B89 /* Do Not Disturb in CopyFiles */ = {isa = PBXBuildFile; fileRef = 7D7755D01F02DF9500D0017D /* Do Not Disturb */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
|
||||
209E45B0203DF64E00900B89 /* Realm.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 209E45A2203DF64E00900B89 /* Realm.framework */; };
|
||||
209E45B1203DF64E00900B89 /* AlamofireImage.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 209E45A3203DF64E00900B89 /* AlamofireImage.framework */; };
|
||||
209E45B2203DF64E00900B89 /* CleanroomLogger.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 209E45A4203DF64E00900B89 /* CleanroomLogger.framework */; };
|
||||
@@ -18,31 +19,33 @@
|
||||
209E45B9203DF64E00900B89 /* CocoaMQTT.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 209E45AB203DF64E00900B89 /* CocoaMQTT.framework */; };
|
||||
209E45BB203DF64E00900B89 /* RealmSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 209E45AD203DF64E00900B89 /* RealmSwift.framework */; };
|
||||
209E45BC203DF64E00900B89 /* dnd.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 209E45AE203DF64E00900B89 /* dnd.framework */; };
|
||||
20C87249204609A900F1275D /* Alamofire.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 209E45A7203DF64E00900B89 /* Alamofire.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
20C8724A204609A900F1275D /* AlamofireImage.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 209E45A3203DF64E00900B89 /* AlamofireImage.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
20C8724C204609A900F1275D /* CleanroomLogger.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 209E45A4203DF64E00900B89 /* CleanroomLogger.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
20C8724D204609A900F1275D /* CocoaAsyncSocket.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 209E45A5203DF64E00900B89 /* CocoaAsyncSocket.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
20C8724E204609A900F1275D /* CocoaMQTT.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 209E45AB203DF64E00900B89 /* CocoaMQTT.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
20C8724F204609A900F1275D /* CommonCrypto.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 209E45A6203DF64E00900B89 /* CommonCrypto.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
20C87250204609A900F1275D /* dnd.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 209E45AE203DF64E00900B89 /* dnd.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
20C87252204609A900F1275D /* Realm.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 209E45A2203DF64E00900B89 /* Realm.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
20C87253204609A900F1275D /* RealmSwift.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 209E45AD203DF64E00900B89 /* RealmSwift.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
20C87255204609A900F1275D /* SwiftyJSON.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 209E45AA203DF64E00900B89 /* SwiftyJSON.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
20C87256204609A900F1275D /* SwiftyTimer.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 209E45A8203DF64E00900B89 /* SwiftyTimer.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
20C8725B20460A7E00F1275D /* deviceCSRRequest.p12 in Copy Certs */ = {isa = PBXBuildFile; fileRef = 20C8725820460A7D00F1275D /* deviceCSRRequest.p12 */; };
|
||||
20C8725C20460A7E00F1275D /* rootCA.pem in Copy Certs */ = {isa = PBXBuildFile; fileRef = 20C8725920460A7E00F1275D /* rootCA.pem */; };
|
||||
20C8725D20460A7E00F1275D /* awsRootCA.pem in Copy Certs */ = {isa = PBXBuildFile; fileRef = 20C8725A20460A7E00F1275D /* awsRootCA.pem */; };
|
||||
7D46FEFF1F5E41F000FEB0F8 /* XPCListener.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D46FEFD1F5E41F000FEB0F8 /* XPCListener.m */; };
|
||||
20C87249204609A900F1275D /* Alamofire.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 209E45A7203DF64E00900B89 /* Alamofire.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
20C8724A204609A900F1275D /* AlamofireImage.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 209E45A3203DF64E00900B89 /* AlamofireImage.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
20C8724C204609A900F1275D /* CleanroomLogger.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 209E45A4203DF64E00900B89 /* CleanroomLogger.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
20C8724D204609A900F1275D /* CocoaAsyncSocket.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 209E45A5203DF64E00900B89 /* CocoaAsyncSocket.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
20C8724E204609A900F1275D /* CocoaMQTT.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 209E45AB203DF64E00900B89 /* CocoaMQTT.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
20C8724F204609A900F1275D /* CommonCrypto.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 209E45A6203DF64E00900B89 /* CommonCrypto.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
20C87250204609A900F1275D /* dnd.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 209E45AE203DF64E00900B89 /* dnd.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
20C87252204609A900F1275D /* Realm.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 209E45A2203DF64E00900B89 /* Realm.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
20C87253204609A900F1275D /* RealmSwift.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 209E45AD203DF64E00900B89 /* RealmSwift.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
20C87255204609A900F1275D /* SwiftyJSON.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 209E45AA203DF64E00900B89 /* SwiftyJSON.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
20C87256204609A900F1275D /* SwiftyTimer.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 209E45A8203DF64E00900B89 /* SwiftyTimer.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
20C8725B20460A7E00F1275D /* deviceCSRRequest.p12 in CopyFiles */ = {isa = PBXBuildFile; fileRef = 20C8725820460A7D00F1275D /* deviceCSRRequest.p12 */; };
|
||||
20C8725C20460A7E00F1275D /* rootCA.pem in CopyFiles */ = {isa = PBXBuildFile; fileRef = 20C8725920460A7E00F1275D /* rootCA.pem */; };
|
||||
20C8725D20460A7E00F1275D /* awsRootCA.pem in CopyFiles */ = {isa = PBXBuildFile; fileRef = 20C8725A20460A7E00F1275D /* awsRootCA.pem */; };
|
||||
7D46FEFF1F5E41F000FEB0F8 /* UserCommsListener.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D46FEFD1F5E41F000FEB0F8 /* UserCommsListener.m */; };
|
||||
7D4FF8C41F0E1402001A4A68 /* libbsm.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 7D4FF8C31F0E1402001A4A68 /* libbsm.tbd */; };
|
||||
7D4FF8CD1F0EF2F9001A4A68 /* XPCDaemon.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D4FF8CC1F0EF2F9001A4A68 /* XPCDaemon.m */; };
|
||||
7D4FF8CD1F0EF2F9001A4A68 /* UserComms.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D4FF8CC1F0EF2F9001A4A68 /* UserComms.m */; };
|
||||
7D6E87701F3AE6FA00D6BD7C /* libprocInfo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7D6E876F1F3AE6FA00D6BD7C /* libprocInfo.a */; };
|
||||
7D7755D41F02DF9500D0017D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D7755D31F02DF9500D0017D /* main.m */; };
|
||||
7D7755FC1F02EBBE00D0017D /* Logging.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D7755FA1F02EBBE00D0017D /* Logging.m */; };
|
||||
7DD2BF681F1DC42700B33214 /* Utilities.m in Sources */ = {isa = PBXBuildFile; fileRef = 7DD2BF671F1DC42700B33214 /* Utilities.m */; };
|
||||
7DD2BF761F1E9CE700B33214 /* NSMutableArray+QueueAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 7DD2BF731F1E9CE700B33214 /* NSMutableArray+QueueAdditions.m */; };
|
||||
7DD2BF771F1E9CE700B33214 /* Queue.m in Sources */ = {isa = PBXBuildFile; fileRef = 7DD2BF751F1E9CE700B33214 /* Queue.m */; };
|
||||
CD20869B208E8F0200BA1D0A /* VolumeMonitor.m in Sources */ = {isa = PBXBuildFile; fileRef = CD208698208E8B1200BA1D0A /* VolumeMonitor.m */; };
|
||||
CD20A0CA205793040044BCC5 /* Sentry.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CD20A0C9205793040044BCC5 /* Sentry.framework */; };
|
||||
CD20A0CC205793680044BCC5 /* Sentry.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = CD20A0C9205793040044BCC5 /* Sentry.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
CD20A0CB205793100044BCC5 /* Sentry.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CD20A0C9205793040044BCC5 /* Sentry.framework */; };
|
||||
CD20A0CC205793680044BCC5 /* Sentry.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = CD20A0C9205793040044BCC5 /* Sentry.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
CD22786620463F0700C72C76 /* dnd.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CD22786420463EB000C72C76 /* dnd.framework */; };
|
||||
CD22786C20464A6E00C72C76 /* Preferences.m in Sources */ = {isa = PBXBuildFile; fileRef = CD22786A204648E000C72C76 /* Preferences.m */; };
|
||||
CD256E022050DE9B00768457 /* ProcListener.m in Sources */ = {isa = PBXBuildFile; fileRef = CD256E002050DE6600768457 /* ProcListener.m */; };
|
||||
@@ -52,9 +55,11 @@
|
||||
CD256E062050DE9B00768457 /* ThunderboltMonitor.m in Sources */ = {isa = PBXBuildFile; fileRef = CD256DF32050DE4C00768457 /* ThunderboltMonitor.m */; };
|
||||
CD256E072050DE9B00768457 /* USBMonitor.m in Sources */ = {isa = PBXBuildFile; fileRef = CD256DF52050DE4C00768457 /* USBMonitor.m */; };
|
||||
CD256E082050DE9B00768457 /* UserAuthMonitor.m in Sources */ = {isa = PBXBuildFile; fileRef = CD256DED2050DE4B00768457 /* UserAuthMonitor.m */; };
|
||||
CD2C85F42119D9D5007CF784 /* LidTrigger.m in Sources */ = {isa = PBXBuildFile; fileRef = CD27BC6321139AD70017AEFD /* LidTrigger.m */; };
|
||||
CD2C85F82119FC02007CF784 /* DeviceTrigger.m in Sources */ = {isa = PBXBuildFile; fileRef = CD2C85F52119FB2A007CF784 /* DeviceTrigger.m */; };
|
||||
CD2C85FC211A0084007CF784 /* PowerTrigger.m in Sources */ = {isa = PBXBuildFile; fileRef = CD2C85FA211A006F007CF784 /* PowerTrigger.m */; };
|
||||
CDA993A62048905D00C1E9CD /* FrameworkInterface.m in Sources */ = {isa = PBXBuildFile; fileRef = CDA993A42048905D00C1E9CD /* FrameworkInterface.m */; };
|
||||
CDD3ADF3213527F1004F805F /* Do Not Disturb in CopyFiles */ = {isa = PBXBuildFile; fileRef = 7D7755D01F02DF9500D0017D /* Do Not Disturb */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
|
||||
CE60F9C91FC9BBE500EFFDDA /* Lid.m in Sources */ = {isa = PBXBuildFile; fileRef = CE60F9C81FC9BBE500EFFDDA /* Lid.m */; };
|
||||
CE60F9C91FC9BBE500EFFDDA /* Triggers.m in Sources */ = {isa = PBXBuildFile; fileRef = CE60F9C81FC9BBE500EFFDDA /* Triggers.m */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
@@ -68,51 +73,58 @@
|
||||
/* End PBXContainerItemProxy section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
20C8722C2046079F00F1275D /* Copy Frameworks */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = "";
|
||||
dstSubfolderSpec = 10;
|
||||
files = (
|
||||
CD20A0CC205793680044BCC5 /* Sentry.framework in Copy Frameworks */,
|
||||
20C87249204609A900F1275D /* Alamofire.framework in Copy Frameworks */,
|
||||
20C8724A204609A900F1275D /* AlamofireImage.framework in Copy Frameworks */,
|
||||
20C8724C204609A900F1275D /* CleanroomLogger.framework in Copy Frameworks */,
|
||||
20C8724D204609A900F1275D /* CocoaAsyncSocket.framework in Copy Frameworks */,
|
||||
20C8724E204609A900F1275D /* CocoaMQTT.framework in Copy Frameworks */,
|
||||
20C8724F204609A900F1275D /* CommonCrypto.framework in Copy Frameworks */,
|
||||
20C87250204609A900F1275D /* dnd.framework in Copy Frameworks */,
|
||||
20C87252204609A900F1275D /* Realm.framework in Copy Frameworks */,
|
||||
20C87253204609A900F1275D /* RealmSwift.framework in Copy Frameworks */,
|
||||
20C87255204609A900F1275D /* SwiftyJSON.framework in Copy Frameworks */,
|
||||
20C87256204609A900F1275D /* SwiftyTimer.framework in Copy Frameworks */,
|
||||
);
|
||||
name = "Copy Frameworks";
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
20C8725720460A2300F1275D /* Copy Certs */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = "";
|
||||
dstSubfolderSpec = 7;
|
||||
files = (
|
||||
20C8725B20460A7E00F1275D /* deviceCSRRequest.p12 in Copy Certs */,
|
||||
20C8725C20460A7E00F1275D /* rootCA.pem in Copy Certs */,
|
||||
20C8725D20460A7E00F1275D /* awsRootCA.pem in Copy Certs */,
|
||||
);
|
||||
name = "Copy Certs";
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
CDD3ADF2213527E0004F805F /* CopyFiles */ = {
|
||||
209E459E203DF5B200900B89 /* CopyFiles */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = "";
|
||||
dstSubfolderSpec = 6;
|
||||
files = (
|
||||
CDD3ADF3213527F1004F805F /* Do Not Disturb in CopyFiles */,
|
||||
209E459F203DF5D500900B89 /* Do Not Disturb in CopyFiles */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
20C8722C2046079F00F1275D /* CopyFiles */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = "";
|
||||
dstSubfolderSpec = 10;
|
||||
files = (
|
||||
CD20A0CC205793680044BCC5 /* Sentry.framework in CopyFiles */,
|
||||
20C87249204609A900F1275D /* Alamofire.framework in CopyFiles */,
|
||||
20C8724A204609A900F1275D /* AlamofireImage.framework in CopyFiles */,
|
||||
20C8724C204609A900F1275D /* CleanroomLogger.framework in CopyFiles */,
|
||||
20C8724D204609A900F1275D /* CocoaAsyncSocket.framework in CopyFiles */,
|
||||
20C8724E204609A900F1275D /* CocoaMQTT.framework in CopyFiles */,
|
||||
20C8724F204609A900F1275D /* CommonCrypto.framework in CopyFiles */,
|
||||
20C87250204609A900F1275D /* dnd.framework in CopyFiles */,
|
||||
20C87252204609A900F1275D /* Realm.framework in CopyFiles */,
|
||||
20C87253204609A900F1275D /* RealmSwift.framework in CopyFiles */,
|
||||
20C87255204609A900F1275D /* SwiftyJSON.framework in CopyFiles */,
|
||||
20C87256204609A900F1275D /* SwiftyTimer.framework in CopyFiles */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
20C8725720460A2300F1275D /* CopyFiles */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = "";
|
||||
dstSubfolderSpec = 7;
|
||||
files = (
|
||||
20C8725B20460A7E00F1275D /* deviceCSRRequest.p12 in CopyFiles */,
|
||||
20C8725C20460A7E00F1275D /* rootCA.pem in CopyFiles */,
|
||||
20C8725D20460A7E00F1275D /* awsRootCA.pem in CopyFiles */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
7D7755CE1F02DF9500D0017D /* CopyFiles */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 8;
|
||||
dstPath = /usr/share/man/man1/;
|
||||
dstSubfolderSpec = 0;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 1;
|
||||
};
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
@@ -132,11 +144,12 @@
|
||||
20C8725920460A7E00F1275D /* rootCA.pem */ = {isa = PBXFileReference; lastKnownFileType = text; path = rootCA.pem; sourceTree = "<group>"; };
|
||||
20C8725A20460A7E00F1275D /* awsRootCA.pem */ = {isa = PBXFileReference; lastKnownFileType = text; path = awsRootCA.pem; sourceTree = "<group>"; };
|
||||
7D2582591F1A872400D28B95 /* com.objective-see.dnd.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "com.objective-see.dnd.plist"; path = "launchDaemon/com.objective-see.dnd.plist"; sourceTree = "<group>"; };
|
||||
7D46FEFD1F5E41F000FEB0F8 /* XPCListener.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XPCListener.m; sourceTree = "<group>"; };
|
||||
7D46FEFE1F5E41F000FEB0F8 /* XPCListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPCListener.h; sourceTree = "<group>"; };
|
||||
7D46FEFD1F5E41F000FEB0F8 /* UserCommsListener.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UserCommsListener.m; sourceTree = "<group>"; };
|
||||
7D46FEFE1F5E41F000FEB0F8 /* UserCommsListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserCommsListener.h; sourceTree = "<group>"; };
|
||||
7D4FF8C31F0E1402001A4A68 /* libbsm.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libbsm.tbd; path = usr/lib/libbsm.tbd; sourceTree = SDKROOT; };
|
||||
7D4FF8CB1F0EF2F9001A4A68 /* XPCDaemon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPCDaemon.h; sourceTree = "<group>"; };
|
||||
7D4FF8CC1F0EF2F9001A4A68 /* XPCDaemon.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XPCDaemon.m; sourceTree = "<group>"; };
|
||||
7D4FF8CB1F0EF2F9001A4A68 /* UserComms.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UserComms.h; sourceTree = "<group>"; };
|
||||
7D4FF8CC1F0EF2F9001A4A68 /* UserComms.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UserComms.m; sourceTree = "<group>"; };
|
||||
7D4FF8CE1F0EF360001A4A68 /* UserCommsInterface.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = UserCommsInterface.h; path = ../../shared/UserCommsInterface.h; sourceTree = "<group>"; };
|
||||
7D6E876F1F3AE6FA00D6BD7C /* libprocInfo.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libprocInfo.a; path = launchDaemon/libs/libprocInfo.a; sourceTree = "<group>"; };
|
||||
7D7755D01F02DF9500D0017D /* Do Not Disturb */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "Do Not Disturb"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
7D7755D31F02DF9500D0017D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
|
||||
@@ -146,6 +159,8 @@
|
||||
7DD2BF671F1DC42700B33214 /* Utilities.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Utilities.m; path = ../../shared/Utilities.m; sourceTree = "<group>"; };
|
||||
7DD2BF721F1E9CE700B33214 /* NSMutableArray+QueueAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSMutableArray+QueueAdditions.h"; sourceTree = "<group>"; };
|
||||
7DD2BF731F1E9CE700B33214 /* NSMutableArray+QueueAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSMutableArray+QueueAdditions.m"; sourceTree = "<group>"; };
|
||||
7DD2BF741F1E9CE700B33214 /* Queue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Queue.h; sourceTree = "<group>"; };
|
||||
7DD2BF751F1E9CE700B33214 /* Queue.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Queue.m; sourceTree = "<group>"; };
|
||||
CD208698208E8B1200BA1D0A /* VolumeMonitor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VolumeMonitor.m; sourceTree = "<group>"; };
|
||||
CD208699208E8B1200BA1D0A /* VolumeMonitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VolumeMonitor.h; sourceTree = "<group>"; };
|
||||
CD20A0C9205793040044BCC5 /* Sentry.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Sentry.framework; path = ../Carthage/Build/Mac/Sentry.framework; sourceTree = "<group>"; };
|
||||
@@ -167,15 +182,19 @@
|
||||
CD256DF82050DE4C00768457 /* Monitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Monitor.h; path = launchDaemon/monitor/Monitor.h; sourceTree = SOURCE_ROOT; };
|
||||
CD256DFF2050DE6600768457 /* ProcListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ProcListener.h; path = launchDaemon/monitor/ProcListener.h; sourceTree = SOURCE_ROOT; };
|
||||
CD256E002050DE6600768457 /* ProcListener.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ProcListener.m; path = launchDaemon/monitor/ProcListener.m; sourceTree = SOURCE_ROOT; };
|
||||
CD27BC6321139AD70017AEFD /* LidTrigger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = LidTrigger.m; path = triggers/LidTrigger.m; sourceTree = "<group>"; };
|
||||
CD27BC6421139AD70017AEFD /* LidTrigger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LidTrigger.h; path = triggers/LidTrigger.h; sourceTree = "<group>"; };
|
||||
CD2C85F52119FB2A007CF784 /* DeviceTrigger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = DeviceTrigger.m; path = triggers/DeviceTrigger.m; sourceTree = "<group>"; };
|
||||
CD2C85F62119FB2A007CF784 /* DeviceTrigger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DeviceTrigger.h; path = triggers/DeviceTrigger.h; sourceTree = "<group>"; };
|
||||
CD2C85F9211A006F007CF784 /* PowerTrigger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PowerTrigger.h; path = triggers/PowerTrigger.h; sourceTree = "<group>"; };
|
||||
CD2C85FA211A006F007CF784 /* PowerTrigger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PowerTrigger.m; path = triggers/PowerTrigger.m; sourceTree = "<group>"; };
|
||||
CD3307C5203639AD00F10D71 /* procInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = procInfo.h; path = launchDaemon/libs/procInfo.h; sourceTree = "<group>"; };
|
||||
CD3307C82036518400F10D71 /* main.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = main.h; sourceTree = "<group>"; };
|
||||
CDA993A32048905D00C1E9CD /* FrameworkInterface.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FrameworkInterface.h; sourceTree = "<group>"; };
|
||||
CDA993A42048905D00C1E9CD /* FrameworkInterface.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FrameworkInterface.m; sourceTree = "<group>"; };
|
||||
CDAAC245202259B50032F2E6 /* Consts.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Consts.h; path = ../../shared/Consts.h; sourceTree = "<group>"; };
|
||||
CDFA088421367FB00089758C /* XPCUserProto.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = XPCUserProto.h; path = ../../shared/XPCUserProto.h; sourceTree = "<group>"; };
|
||||
CDFA088521367FB00089758C /* XPCDaemonProto.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = XPCDaemonProto.h; path = ../../shared/XPCDaemonProto.h; sourceTree = "<group>"; };
|
||||
CE60F9C71FC9BBE500EFFDDA /* Lid.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Lid.h; sourceTree = "<group>"; };
|
||||
CE60F9C81FC9BBE500EFFDDA /* Lid.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Lid.m; sourceTree = "<group>"; };
|
||||
CE60F9C71FC9BBE500EFFDDA /* Triggers.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Triggers.h; sourceTree = "<group>"; };
|
||||
CE60F9C81FC9BBE500EFFDDA /* Triggers.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Triggers.m; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
@@ -194,6 +213,7 @@
|
||||
209E45B9203DF64E00900B89 /* CocoaMQTT.framework in Frameworks */,
|
||||
209E45BB203DF64E00900B89 /* RealmSwift.framework in Frameworks */,
|
||||
209E45BC203DF64E00900B89 /* dnd.framework in Frameworks */,
|
||||
CD20A0CB205793100044BCC5 /* Sentry.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -266,22 +286,25 @@
|
||||
7D7755D21F02DF9500D0017D /* src */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
CD27BC6221139A800017AEFD /* triggers */,
|
||||
CD256DEC2050DE3200768457 /* monitor */,
|
||||
7D7756071F05D62E00D0017D /* shared */,
|
||||
7DD2BF721F1E9CE700B33214 /* NSMutableArray+QueueAdditions.h */,
|
||||
7DD2BF731F1E9CE700B33214 /* NSMutableArray+QueueAdditions.m */,
|
||||
CE60F9C71FC9BBE500EFFDDA /* Lid.h */,
|
||||
CE60F9C81FC9BBE500EFFDDA /* Lid.m */,
|
||||
CE60F9C71FC9BBE500EFFDDA /* Triggers.h */,
|
||||
CE60F9C81FC9BBE500EFFDDA /* Triggers.m */,
|
||||
CDA993A32048905D00C1E9CD /* FrameworkInterface.h */,
|
||||
CDA993A42048905D00C1E9CD /* FrameworkInterface.m */,
|
||||
CD227869204648E000C72C76 /* Preferences.h */,
|
||||
CD22786A204648E000C72C76 /* Preferences.m */,
|
||||
7DD2BF741F1E9CE700B33214 /* Queue.h */,
|
||||
7DD2BF751F1E9CE700B33214 /* Queue.m */,
|
||||
CD3307C82036518400F10D71 /* main.h */,
|
||||
7D7755D31F02DF9500D0017D /* main.m */,
|
||||
7D4FF8CB1F0EF2F9001A4A68 /* XPCDaemon.h */,
|
||||
7D4FF8CC1F0EF2F9001A4A68 /* XPCDaemon.m */,
|
||||
7D46FEFE1F5E41F000FEB0F8 /* XPCListener.h */,
|
||||
7D46FEFD1F5E41F000FEB0F8 /* XPCListener.m */,
|
||||
7D4FF8CB1F0EF2F9001A4A68 /* UserComms.h */,
|
||||
7D4FF8CC1F0EF2F9001A4A68 /* UserComms.m */,
|
||||
7D46FEFE1F5E41F000FEB0F8 /* UserCommsListener.h */,
|
||||
7D46FEFD1F5E41F000FEB0F8 /* UserCommsListener.m */,
|
||||
);
|
||||
name = src;
|
||||
path = launchDaemon;
|
||||
@@ -295,8 +318,7 @@
|
||||
7DD2BF671F1DC42700B33214 /* Utilities.m */,
|
||||
7D7755FA1F02EBBE00D0017D /* Logging.m */,
|
||||
7D7755FB1F02EBBE00D0017D /* Logging.h */,
|
||||
CDFA088421367FB00089758C /* XPCUserProto.h */,
|
||||
CDFA088521367FB00089758C /* XPCDaemonProto.h */,
|
||||
7D4FF8CE1F0EF360001A4A68 /* UserCommsInterface.h */,
|
||||
);
|
||||
name = shared;
|
||||
sourceTree = "<group>";
|
||||
@@ -324,6 +346,19 @@
|
||||
path = monitor;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
CD27BC6221139A800017AEFD /* triggers */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
CD2C85F9211A006F007CF784 /* PowerTrigger.h */,
|
||||
CD2C85FA211A006F007CF784 /* PowerTrigger.m */,
|
||||
CD2C85F62119FB2A007CF784 /* DeviceTrigger.h */,
|
||||
CD2C85F52119FB2A007CF784 /* DeviceTrigger.m */,
|
||||
CD27BC6421139AD70017AEFD /* LidTrigger.h */,
|
||||
CD27BC6321139AD70017AEFD /* LidTrigger.m */,
|
||||
);
|
||||
name = triggers;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
CD3307C42036399900F10D71 /* Supporting Files */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -341,10 +376,12 @@
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 2063725E203DC70A006D4C38 /* Build configuration list for PBXNativeTarget "launchDaemonBundle" */;
|
||||
buildPhases = (
|
||||
20637257203DC70A006D4C38 /* Sources */,
|
||||
20637258203DC70A006D4C38 /* Frameworks */,
|
||||
20C8722C2046079F00F1275D /* Copy Frameworks */,
|
||||
20C8725720460A2300F1275D /* Copy Certs */,
|
||||
CDD3ADF2213527E0004F805F /* CopyFiles */,
|
||||
20637259203DC70A006D4C38 /* Resources */,
|
||||
209E459E203DF5B200900B89 /* CopyFiles */,
|
||||
20C8722C2046079F00F1275D /* CopyFiles */,
|
||||
20C8725720460A2300F1275D /* CopyFiles */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
@@ -362,6 +399,7 @@
|
||||
buildPhases = (
|
||||
7D7755CC1F02DF9500D0017D /* Sources */,
|
||||
7D7755CD1F02DF9500D0017D /* Frameworks */,
|
||||
7D7755CE1F02DF9500D0017D /* CopyFiles */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
@@ -378,7 +416,7 @@
|
||||
7D7755C81F02DF9400D0017D /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 1000;
|
||||
LastUpgradeCheck = 0930;
|
||||
ORGANIZATIONNAME = "Objective-See";
|
||||
TargetAttributes = {
|
||||
2063725A203DC70A006D4C38 = {
|
||||
@@ -409,11 +447,31 @@
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
20637259203DC70A006D4C38 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
20637257203DC70A006D4C38 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
7D7755CC1F02DF9500D0017D /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
CD2C85FC211A0084007CF784 /* PowerTrigger.m in Sources */,
|
||||
CD2C85F82119FC02007CF784 /* DeviceTrigger.m in Sources */,
|
||||
CD2C85F42119D9D5007CF784 /* LidTrigger.m in Sources */,
|
||||
CD20869B208E8F0200BA1D0A /* VolumeMonitor.m in Sources */,
|
||||
CD256E022050DE9B00768457 /* ProcListener.m in Sources */,
|
||||
CD256E032050DE9B00768457 /* AuthEvent.m in Sources */,
|
||||
@@ -424,12 +482,13 @@
|
||||
CD256E082050DE9B00768457 /* UserAuthMonitor.m in Sources */,
|
||||
CD22786C20464A6E00C72C76 /* Preferences.m in Sources */,
|
||||
CDA993A62048905D00C1E9CD /* FrameworkInterface.m in Sources */,
|
||||
7D46FEFF1F5E41F000FEB0F8 /* XPCListener.m in Sources */,
|
||||
CE60F9C91FC9BBE500EFFDDA /* Lid.m in Sources */,
|
||||
7D46FEFF1F5E41F000FEB0F8 /* UserCommsListener.m in Sources */,
|
||||
CE60F9C91FC9BBE500EFFDDA /* Triggers.m in Sources */,
|
||||
7DD2BF761F1E9CE700B33214 /* NSMutableArray+QueueAdditions.m in Sources */,
|
||||
7DD2BF681F1DC42700B33214 /* Utilities.m in Sources */,
|
||||
7DD2BF771F1E9CE700B33214 /* Queue.m in Sources */,
|
||||
7D7755D41F02DF9500D0017D /* main.m in Sources */,
|
||||
7D4FF8CD1F0EF2F9001A4A68 /* XPCDaemon.m in Sources */,
|
||||
7D4FF8CD1F0EF2F9001A4A68 /* UserComms.m in Sources */,
|
||||
7D7755FC1F02EBBE00D0017D /* Logging.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
|
||||
@@ -7,16 +7,16 @@
|
||||
// copyright (c) 2018 Objective-See. All rights reserved.
|
||||
//
|
||||
|
||||
#import "Lid.h"
|
||||
#import "consts.h"
|
||||
#import "logging.h"
|
||||
#import "Triggers.h"
|
||||
#import "Preferences.h"
|
||||
#import "FrameworkInterface.h"
|
||||
|
||||
/* GLOBALS */
|
||||
|
||||
//lid obj
|
||||
extern Lid* lid;
|
||||
//trigger obj
|
||||
extern Triggers* triggers;
|
||||
|
||||
//DND framework interface obj
|
||||
extern FrameworkInterface* framework;
|
||||
@@ -160,28 +160,27 @@ bail:
|
||||
logMsg(LOG_DEBUG, [NSString stringWithFormat:@"updating preferences (%@)", updates]);
|
||||
|
||||
//user setting state?
|
||||
// toggle the state of the daemon (lid) watcher too
|
||||
// toggle the state of the daemon triggers too
|
||||
if(nil != updates[PREF_IS_DISABLED])
|
||||
{
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, [NSString stringWithFormat:@"client toggling state: %@", updates[PREF_IS_DISABLED]]);
|
||||
|
||||
//disable?
|
||||
//disable triggers
|
||||
if(YES == [updates[PREF_IS_DISABLED] boolValue])
|
||||
{
|
||||
//dbg msg
|
||||
// and log to file
|
||||
logMsg(LOG_DEBUG|LOG_TO_FILE, @"disabling...");
|
||||
|
||||
//unregister for lid notifications
|
||||
[lid unregister4Notifications];
|
||||
//turn off all triggers
|
||||
[triggers toggle:ALL_TRIGGERS state:NSOffState];
|
||||
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, @"unregistered for lid change notifications");
|
||||
logMsg(LOG_DEBUG, @"disabled triggers");
|
||||
|
||||
//cancel all lid notifications
|
||||
// ...will also disconnect client
|
||||
[lid cancelDispatchBlocks];
|
||||
//cancel all dispatch blocks
|
||||
[triggers cancelDispatchBlocks];
|
||||
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, @"cancelled all dispatch blocks (disconnecting any connected iOS client)");
|
||||
@@ -190,18 +189,81 @@ bail:
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:DISMISS_NOTIFICATION object:nil userInfo:nil];
|
||||
}
|
||||
|
||||
//enable?
|
||||
//enable triggers
|
||||
else
|
||||
{
|
||||
//dbg msg
|
||||
// and log to file
|
||||
logMsg(LOG_DEBUG|LOG_TO_FILE, @"enabling...");
|
||||
|
||||
//register for lid notifications
|
||||
[lid register4Notifications];
|
||||
|
||||
//turn off all triggers
|
||||
[triggers toggle:ALL_TRIGGERS state:NSOnState];
|
||||
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, @"registered for lid change notifications");
|
||||
logMsg(LOG_DEBUG, @"enabled (all) triggers");
|
||||
}
|
||||
}
|
||||
|
||||
//toggle lid triggers
|
||||
if(nil != updates[PREF_LID_TRIGGER])
|
||||
{
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, @"toggling lid notifications");
|
||||
|
||||
//enable lid trigger
|
||||
if(YES == [updates[PREF_LID_TRIGGER] boolValue])
|
||||
{
|
||||
//enable
|
||||
[triggers toggle:LID_TRIGGER state:NSOnState];
|
||||
}
|
||||
|
||||
//disable lid trigger
|
||||
else
|
||||
{
|
||||
//disable
|
||||
[triggers toggle:LID_TRIGGER state:NSOffState];
|
||||
}
|
||||
}
|
||||
|
||||
//toggle device triggers
|
||||
if(nil != updates[PREF_DEVICE_TRIGGER])
|
||||
{
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, @"toggling device notifications");
|
||||
|
||||
//enable device trigger
|
||||
if(YES == [updates[PREF_DEVICE_TRIGGER] boolValue])
|
||||
{
|
||||
//enable
|
||||
[triggers toggle:DEVICE_TRIGGER state:NSOnState];
|
||||
}
|
||||
|
||||
//disable device trigger
|
||||
else
|
||||
{
|
||||
//disable
|
||||
[triggers toggle:DEVICE_TRIGGER state:NSOffState];
|
||||
}
|
||||
}
|
||||
|
||||
//toggle power triggers
|
||||
if(nil != updates[PREF_POWER_TRIGGER])
|
||||
{
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, @"toggling power notifications");
|
||||
|
||||
//enable power trigger
|
||||
if(YES == [updates[PREF_POWER_TRIGGER] boolValue])
|
||||
{
|
||||
//enable
|
||||
[triggers toggle:POWER_TRIGGER state:NSOnState];
|
||||
}
|
||||
|
||||
//disable power trigger
|
||||
else
|
||||
{
|
||||
//disable
|
||||
[triggers toggle:POWER_TRIGGER state:NSOffState];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
//
|
||||
// file: Queue.h
|
||||
// project: DND (launch daemon)
|
||||
// description: a queue implementation (header)
|
||||
//
|
||||
// created by Patrick Wardle
|
||||
// copyright (c) 2018 Objective-See. All rights reserved.
|
||||
//
|
||||
|
||||
@import Foundation;
|
||||
#import "NSMutableArray+QueueAdditions.h"
|
||||
|
||||
@interface Queue : NSObject
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/* PROPERTIES */
|
||||
|
||||
//event queue
|
||||
@property(retain, atomic)NSMutableArray* eventQueue;
|
||||
|
||||
//queue condition
|
||||
@property (nonatomic, retain)NSCondition* queueCondition;
|
||||
|
||||
|
||||
/* METHODS */
|
||||
|
||||
//add an object to the queue
|
||||
-(void)enqueue:(id)anObject;
|
||||
|
||||
//wait until queue has item
|
||||
// then pull if off, and return it
|
||||
-(id)dequeue;
|
||||
|
||||
//wait until queue has item
|
||||
// and return it, w/o removing it
|
||||
-(id)peek;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,106 @@
|
||||
//
|
||||
// file: Queue.m
|
||||
// project: DND (launch daemon)
|
||||
// description: a queue implementation
|
||||
//
|
||||
// created by Patrick Wardle
|
||||
// copyright (c) 2018 Objective-See. All rights reserved.
|
||||
//
|
||||
|
||||
#import "Queue.h"
|
||||
#import "Consts.h"
|
||||
#import "Logging.h"
|
||||
|
||||
@implementation Queue
|
||||
|
||||
@synthesize eventQueue;
|
||||
@synthesize queueCondition;
|
||||
|
||||
//init
|
||||
-(id)init
|
||||
{
|
||||
//init super
|
||||
self = [super init];
|
||||
if(nil != self)
|
||||
{
|
||||
//init queue
|
||||
eventQueue = [NSMutableArray array];
|
||||
|
||||
//init empty condition
|
||||
queueCondition = [[NSCondition alloc] init];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
//add an object to the queue
|
||||
-(void)enqueue:(id)anObject
|
||||
{
|
||||
//lock
|
||||
[self.queueCondition lock];
|
||||
|
||||
//add to queue
|
||||
[self.eventQueue enqueue:anObject];
|
||||
|
||||
//signal
|
||||
[self.queueCondition signal];
|
||||
|
||||
//unlock
|
||||
[self.queueCondition unlock];
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//wait until queue has item
|
||||
// then pull if off, and return it
|
||||
-(id)dequeue
|
||||
{
|
||||
//queue item
|
||||
id item = nil;
|
||||
|
||||
//lock
|
||||
[self.queueCondition lock];
|
||||
|
||||
//wait while queue is empty
|
||||
while(YES == [self.eventQueue isEmpty])
|
||||
{
|
||||
//wait
|
||||
[self.queueCondition wait];
|
||||
}
|
||||
|
||||
//get item off queue
|
||||
item = [self.eventQueue dequeue];
|
||||
|
||||
//unlock
|
||||
[self.queueCondition unlock];
|
||||
|
||||
return item;
|
||||
}
|
||||
|
||||
//wait until queue has item
|
||||
// and return it, w/o removing it
|
||||
-(id)peek
|
||||
{
|
||||
//queue item
|
||||
id item = nil;
|
||||
|
||||
//lock
|
||||
[self.queueCondition lock];
|
||||
|
||||
//wait while queue is empty
|
||||
while(YES == [self.eventQueue isEmpty])
|
||||
{
|
||||
//wait
|
||||
[self.queueCondition wait];
|
||||
}
|
||||
|
||||
//get item off queue
|
||||
item = [self.eventQueue peek];
|
||||
|
||||
//unlock
|
||||
[self.queueCondition unlock];
|
||||
|
||||
return item;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -1,20 +1,19 @@
|
||||
//
|
||||
// file: Lid.h
|
||||
// file: Triggers.m
|
||||
// project: DND (launch daemon)
|
||||
// description: monitor and alert logic for lid open events (header)
|
||||
// description: generic management of various triggers (header)
|
||||
//
|
||||
// created by Patrick Wardle
|
||||
// copyright (c) 2018 Objective-See. All rights reserved.
|
||||
//
|
||||
|
||||
#import "Utilities.h"
|
||||
#import "LidTrigger.h"
|
||||
#import "PowerTrigger.h"
|
||||
#import "DeviceTrigger.h"
|
||||
#import <dnd/dnd-Swift.h>
|
||||
|
||||
@import Foundation;
|
||||
|
||||
#import <IOKit/IOKitLib.h>
|
||||
#import <IOKit/pwr_mgt/IOPM.h>
|
||||
|
||||
/* FUNCTIONS */
|
||||
|
||||
//check if user auth'd
|
||||
@@ -24,26 +23,25 @@ BOOL authViaTouchID(void);
|
||||
|
||||
/* CLASS INTERFACE */
|
||||
|
||||
@interface Lid : NSObject <DNDClientMacDelegate, DNDClientMacTaskingDelegate>
|
||||
@interface Triggers : NSObject <DNDClientMacDelegate>
|
||||
{
|
||||
//lid state
|
||||
LidState lidState;
|
||||
|
||||
//dispatch queue
|
||||
dispatch_queue_t dispatchQ;
|
||||
|
||||
//notification port
|
||||
IONotificationPortRef notificationPort;
|
||||
|
||||
//notification object
|
||||
io_object_t notification;
|
||||
|
||||
}
|
||||
|
||||
/* PROPERTIES */
|
||||
|
||||
//lid trigger obj
|
||||
@property(nonatomic, retain)LidTrigger* lidTrigger;
|
||||
|
||||
//device(s) trigger obj
|
||||
@property(nonatomic, retain)DeviceTrigger* deviceTrigger;
|
||||
|
||||
//power trigger obj
|
||||
@property(nonatomic, retain)PowerTrigger* powerTrigger;
|
||||
|
||||
|
||||
//client
|
||||
@property(nonatomic, retain)DNDClientMac *client;
|
||||
@property(nonatomic, retain)DNDClientMac* client;
|
||||
|
||||
//dismiss dispatch group
|
||||
@property(nonatomic, retain)dispatch_group_t dispatchGroup;
|
||||
@@ -54,20 +52,15 @@ BOOL authViaTouchID(void);
|
||||
//dispatch blocks
|
||||
@property(nonatomic, retain)NSMutableArray* dispatchBlocks;
|
||||
|
||||
//latest undelivered alert
|
||||
//TODO: make dictionary w/ alert
|
||||
//latest undeliveried alert
|
||||
@property(nonatomic, retain)NSDate* undeliveredAlert;
|
||||
|
||||
//observer for dismiss alerts
|
||||
@property(nonatomic, retain)id dismissObserver;
|
||||
|
||||
//observer for new client/user (login item)
|
||||
@property(nonatomic, retain)id userObserver;
|
||||
|
||||
//undelivered alerts
|
||||
@property(nonatomic, retain)NSMutableArray* undeliveredAlerts;
|
||||
|
||||
/* METHODS */
|
||||
|
||||
//toggle trigger(s)
|
||||
-(void)toggle:(NSUInteger)type state:(NSControlStateValue)state;
|
||||
|
||||
//check if client should be init'd
|
||||
-(BOOL)shouldInitClient;
|
||||
|
||||
@@ -77,14 +70,8 @@ BOOL authViaTouchID(void);
|
||||
//cancel all dipatch blocks
|
||||
-(void)cancelDispatchBlocks;
|
||||
|
||||
//register for notifications
|
||||
-(BOOL)register4Notifications;
|
||||
|
||||
//register for notifications
|
||||
-(void)unregister4Notifications;
|
||||
|
||||
//proces lid open event
|
||||
-(void)processEvent:(NSDate*)timestamp user:(NSString*)user;
|
||||
//process trigger event
|
||||
-(void)processEvent:(NSUInteger)type info:(NSDictionary*)info;
|
||||
|
||||
//wait for dismiss
|
||||
// note: handles multiple client via dispatch group
|
||||
@@ -1,36 +1,29 @@
|
||||
// file: Lid.m
|
||||
// file: Triggers.m
|
||||
// project: DND (launch daemon)
|
||||
// description: monitor and alert logic for lid open events
|
||||
// description: generic management of various triggers
|
||||
//
|
||||
// created by Patrick Wardle
|
||||
// copyright (c) 2018 Objective-See. All rights reserved.
|
||||
//
|
||||
|
||||
// code inspired by:
|
||||
// https://github.com/zarigani/ClamshellWake/blob/master/ClamshellWake.cpp
|
||||
// https://github.com/dustinrue/ControlPlane/blob/master/Source/LaptopLidEvidenceSource.m
|
||||
|
||||
// note: manually get state from terminal via:
|
||||
// ioreg -r -k AppleClamshellState -d 4 | grep AppleClamshellState
|
||||
|
||||
#import "Lid.h"
|
||||
#import "Consts.h"
|
||||
#import "Queue.h"
|
||||
#import "Logging.h"
|
||||
#import "Monitor.h"
|
||||
#import "Triggers.h"
|
||||
#import "AuthEvent.h"
|
||||
#import "Utilities.h"
|
||||
#import "XPCListener.h"
|
||||
#import "Preferences.h"
|
||||
#import "UserAuthMonitor.h"
|
||||
#import "FrameworkInterface.h"
|
||||
|
||||
#import "XPCUserProto.h"
|
||||
|
||||
|
||||
/* GLOBALS */
|
||||
|
||||
//last state
|
||||
// sometimes multiple notifications are delivered!?
|
||||
LidState lastLidState;
|
||||
//trigger obj
|
||||
extern Triggers* triggers;
|
||||
|
||||
//lid obj
|
||||
extern Lid* lid;
|
||||
//queue object
|
||||
extern Queue* eventQueue;
|
||||
|
||||
//user auth event listener
|
||||
extern UserAuthMonitor* userAuthMonitor;
|
||||
@@ -41,126 +34,6 @@ extern Preferences* preferences;
|
||||
//DND framework interface obj
|
||||
extern FrameworkInterface* framework;
|
||||
|
||||
//XPC listener
|
||||
extern XPCListener* xpcListener;
|
||||
|
||||
//callback for power/lid events
|
||||
static void pmDomainChange(void *refcon, io_service_t service, uint32_t messageType, void *messageArgument)
|
||||
{
|
||||
//lid state
|
||||
int lidState = stateUnavailable;
|
||||
|
||||
//sleep bit
|
||||
int sleepState = -1;
|
||||
|
||||
//preferences
|
||||
NSDictionary* currentPrefs = nil;
|
||||
|
||||
//timestamp
|
||||
NSDate* timestamp = nil;
|
||||
|
||||
//init timestamp
|
||||
timestamp = [NSDate date];
|
||||
|
||||
//ignore any messages that are related to lid state
|
||||
if(kIOPMMessageClamshellStateChange != messageType)
|
||||
{
|
||||
//bail
|
||||
goto bail;
|
||||
}
|
||||
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, @"got 'kIOPMMessageClamshellStateChange' message");
|
||||
|
||||
//get prefs
|
||||
currentPrefs = [preferences get:nil];
|
||||
|
||||
//if user explicity set disabled
|
||||
// bail here, to ignore everything
|
||||
if(YES == [currentPrefs[PREF_IS_DISABLED] boolValue])
|
||||
{
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, @"client disabled DND, so ignoring lid event");
|
||||
|
||||
//bail
|
||||
goto bail;
|
||||
}
|
||||
|
||||
//get state
|
||||
lidState = ((int) messageArgument & kClamshellStateBit);
|
||||
|
||||
//get sleep state
|
||||
sleepState = !!(((int)messageArgument & kClamshellSleepBit));
|
||||
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, [NSString stringWithFormat:@"lid state: %@ (sleep bit: %d)", (lidState) ? @"closed" : @"open", sleepState]);
|
||||
|
||||
//(new) open?
|
||||
// OS sometimes delivers 2x events, so ignore same same
|
||||
if( (stateOpen == lidState) &&
|
||||
(stateOpen != lastLidState) )
|
||||
{
|
||||
//ignore if lid isn't really open
|
||||
// on reboot, OS may deliver 'open' message if external monitors are connected
|
||||
if(stateOpen != getLidState())
|
||||
{
|
||||
//bail
|
||||
goto bail;
|
||||
}
|
||||
|
||||
//update 'prev' state
|
||||
lastLidState = stateOpen;
|
||||
|
||||
//dbg msg
|
||||
// log to file
|
||||
logMsg(LOG_DEBUG|LOG_TO_FILE, [NSString stringWithFormat:@"[NEW EVENT] lid state: open (sleep state: %d)", sleepState]);
|
||||
|
||||
//touch id mode?
|
||||
// wait up to 10 seconds, and ignore event if user auth'd via biometrics
|
||||
if(YES == [currentPrefs[PREF_TOUCHID_MODE] boolValue])
|
||||
{
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, @"'touch id' mode enabled, waiting up to 10 seconds for biometric auth event");
|
||||
|
||||
//user auth'd via touchID?
|
||||
// will wait for up to 10 seconds
|
||||
if(YES == authViaTouchID())
|
||||
{
|
||||
//dbg msg
|
||||
// log to file
|
||||
logMsg(LOG_DEBUG|LOG_TO_FILE, @"user authenticated via touchID, so ignoring event");
|
||||
|
||||
//bail
|
||||
// will ignore the event
|
||||
goto bail;
|
||||
}
|
||||
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, @"no touch id auth event found, so will process event");
|
||||
}
|
||||
|
||||
//process event
|
||||
// report to user, execute actions, etc
|
||||
[lid processEvent:timestamp user:getConsoleUser()];
|
||||
}
|
||||
|
||||
//(new) close?
|
||||
// OS sometimes delivers 2x events, so ignore same same
|
||||
else if( (stateClosed == lidState) &&
|
||||
(stateClosed != lastLidState) )
|
||||
{
|
||||
//update 'prev' state
|
||||
lastLidState = stateClosed;
|
||||
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG|LOG_TO_FILE, [NSString stringWithFormat:@"[NEW EVENT] lid state: closed (sleep state: %d)", sleepState]);
|
||||
}
|
||||
|
||||
bail:
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//check if user auth'd
|
||||
// a) within last 10 seconds
|
||||
// b) via biometrics (touchID)
|
||||
@@ -233,7 +106,7 @@ BOOL authViaTouchID()
|
||||
});
|
||||
|
||||
//wait for touch id auth
|
||||
// ...up to five seconds
|
||||
// ...up to ten seconds for event
|
||||
dispatch_semaphore_wait(semaphore, dispatch_time(0, 10*NSEC_PER_SEC));
|
||||
|
||||
//tell user auth monitor to stop
|
||||
@@ -245,15 +118,17 @@ BOOL authViaTouchID()
|
||||
return touchIDAuth;
|
||||
}
|
||||
|
||||
@implementation Lid
|
||||
@implementation Triggers
|
||||
|
||||
|
||||
@synthesize client;
|
||||
@synthesize userObserver;
|
||||
|
||||
@synthesize lidTrigger;
|
||||
@synthesize powerTrigger;
|
||||
@synthesize deviceTrigger;
|
||||
@synthesize dispatchGroup;
|
||||
@synthesize dispatchBlocks;
|
||||
@synthesize dismissObserver;
|
||||
@synthesize undeliveredAlert;
|
||||
@synthesize undeliveredAlerts;
|
||||
@synthesize dispatchGroupEmpty;
|
||||
|
||||
//init
|
||||
@@ -263,24 +138,15 @@ BOOL authViaTouchID()
|
||||
self = [super init];
|
||||
if(nil != self)
|
||||
{
|
||||
//init
|
||||
dispatchQ = NULL;
|
||||
//init lid (trigger) obj
|
||||
lidTrigger = [[LidTrigger alloc] init];
|
||||
|
||||
//init
|
||||
notificationPort = NULL;
|
||||
//init device (trigger) obj
|
||||
deviceTrigger = [[DeviceTrigger alloc] init];
|
||||
|
||||
//init
|
||||
notification = 0;
|
||||
//init power (trigger) obj
|
||||
powerTrigger = [[PowerTrigger alloc] init];
|
||||
|
||||
//alloc array for alerts
|
||||
undeliveredAlerts = [NSMutableArray array];
|
||||
|
||||
//init to current state
|
||||
lastLidState = getLidState();
|
||||
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, [NSString stringWithFormat:@"initial lid state: %d", lastLidState]);
|
||||
|
||||
//init dispatch group for dismiss events
|
||||
dispatchGroup = dispatch_group_create();
|
||||
|
||||
@@ -290,52 +156,6 @@ BOOL authViaTouchID()
|
||||
//init array for blocks
|
||||
dispatchBlocks = [NSMutableArray array];
|
||||
|
||||
//register listener for dismiss alerts
|
||||
// when it fires, invoke (user) XPC method to dismiss alert
|
||||
self.dismissObserver = [[NSNotificationCenter defaultCenter] addObserverForName:DISMISS_NOTIFICATION object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notification)
|
||||
{
|
||||
//connected login item?
|
||||
if(nil != xpcListener.loginItem)
|
||||
{
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, @"'DISMISS_NOTIFICATION' triggered, will send XPC msg to user (login item) to dismiss any alerts");
|
||||
|
||||
//send XPC msg to dismiss
|
||||
[[xpcListener.loginItem remoteObjectProxy] alertDismiss];
|
||||
}
|
||||
else
|
||||
{
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, @"no client (login item) is connected, so nothing to dismiss...");
|
||||
}
|
||||
}];
|
||||
|
||||
//register listener for new client/user (login item)
|
||||
// when it fires, invoke (user) XPC method to deliver any alerts that occured when user wasn't logged in
|
||||
self.userObserver = [[NSNotificationCenter defaultCenter] addObserverForName:USER_NOTIFICATION object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notification)
|
||||
{
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, [NSString stringWithFormat:@"'USER_NOTIFICATION' triggered, will send XPC msg to user (login item) to display %lu undelivered alerts", self.undeliveredAlerts.count]);
|
||||
|
||||
//sync to access
|
||||
@synchronized(self.undeliveredAlerts)
|
||||
{
|
||||
//send each alert to user
|
||||
for(NSDictionary* alert in self.undeliveredAlerts)
|
||||
{
|
||||
//send XPC msg to user, to display alert
|
||||
[[xpcListener.loginItem remoteObjectProxy] alertShow:alert];
|
||||
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, [NSString stringWithFormat:@"(re)delivered alert: %@", alert]);
|
||||
}
|
||||
|
||||
//remove all
|
||||
[self.undeliveredAlerts removeAllObjects];
|
||||
}
|
||||
|
||||
}];
|
||||
|
||||
//should init client?
|
||||
if(YES == [self shouldInitClient])
|
||||
{
|
||||
@@ -390,7 +210,7 @@ BOOL authViaTouchID()
|
||||
self.client.delegate = self;
|
||||
|
||||
//indicate we want tasking
|
||||
[self.client handleTasksWithFramework:[[preferences get:nil][PREF_NO_REMOTE_TASKING] boolValue] imageDelegate:self];
|
||||
[self.client handleTasksWithFramework:[[preferences get:nil][PREF_NO_REMOTE_TASKING] boolValue]];
|
||||
|
||||
//happy
|
||||
initialized = YES;
|
||||
@@ -400,144 +220,86 @@ bail:
|
||||
return initialized;
|
||||
}
|
||||
|
||||
//register for notifications
|
||||
-(BOOL)register4Notifications
|
||||
//toggle trigger(s)
|
||||
-(void)toggle:(NSUInteger)type state:(NSControlStateValue)state
|
||||
{
|
||||
//return var
|
||||
BOOL registered = NO;
|
||||
//current prefs
|
||||
NSDictionary* currentPrefs = nil;
|
||||
|
||||
//status var
|
||||
kern_return_t status = kIOReturnError;
|
||||
//dbd msg
|
||||
logMsg(LOG_DEBUG, [NSString stringWithFormat:@"toggling trigger (type: %lu, state: %lu)", (unsigned long)type, state]);
|
||||
|
||||
//root domain for power management
|
||||
io_service_t powerManagementRD = MACH_PORT_NULL;
|
||||
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, @"registering for lid notifications");
|
||||
|
||||
//make sure state is ok
|
||||
if(stateUnavailable == getLidState())
|
||||
//enable based on type
|
||||
switch(type)
|
||||
{
|
||||
//err msg
|
||||
logMsg(LOG_ERR, @"failed to get lid state, so aborting lid notifications registration");
|
||||
//all
|
||||
// based on triggers
|
||||
case ALL_TRIGGERS:
|
||||
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, @"toggling all triggers");
|
||||
|
||||
//get current prefs
|
||||
currentPrefs = [preferences get:nil];
|
||||
|
||||
//lid trigger?
|
||||
if(YES == [currentPrefs[PREF_LID_TRIGGER] boolValue])
|
||||
{
|
||||
//toggle
|
||||
[self.lidTrigger toggle:state];
|
||||
}
|
||||
|
||||
//device trigger?
|
||||
if(YES == [currentPrefs[PREF_DEVICE_TRIGGER] boolValue])
|
||||
{
|
||||
//toggle
|
||||
[self.deviceTrigger toggle:state];
|
||||
}
|
||||
|
||||
//power trigger
|
||||
if(YES == [currentPrefs[PREF_POWER_TRIGGER] boolValue])
|
||||
{
|
||||
//toggle
|
||||
[self.powerTrigger toggle:state];
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
//lid trigger
|
||||
case LID_TRIGGER:
|
||||
|
||||
//toggle
|
||||
[self.lidTrigger toggle:state];
|
||||
|
||||
break;
|
||||
|
||||
//error
|
||||
goto bail;
|
||||
}
|
||||
//device trigger
|
||||
case DEVICE_TRIGGER:
|
||||
|
||||
//toggle
|
||||
[self.deviceTrigger toggle:state];
|
||||
|
||||
break;
|
||||
|
||||
//power trigger
|
||||
case POWER_TRIGGER:
|
||||
|
||||
//toggle
|
||||
[self.powerTrigger toggle:state];
|
||||
|
||||
break;
|
||||
|
||||
//create queue
|
||||
dispatchQ = dispatch_queue_create(NULL, DISPATCH_QUEUE_SERIAL);
|
||||
if(NULL == dispatchQ)
|
||||
{
|
||||
//err msg
|
||||
logMsg(LOG_ERR, @"failed to create dispatch queue for lid notifications");
|
||||
|
||||
//error
|
||||
goto bail;
|
||||
}
|
||||
|
||||
//set target
|
||||
dispatch_set_target_queue(dispatchQ, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0));
|
||||
|
||||
//create notification port
|
||||
notificationPort = IONotificationPortCreate(kIOMasterPortDefault);
|
||||
if(NULL == notificationPort)
|
||||
{
|
||||
//err msg
|
||||
logMsg(LOG_ERR, @"failed to create notification port for lid notifications");
|
||||
|
||||
//error
|
||||
goto bail;
|
||||
}
|
||||
|
||||
//set dispatch queue
|
||||
IONotificationPortSetDispatchQueue(notificationPort, dispatchQ);
|
||||
|
||||
//get matching service for power management root domain
|
||||
powerManagementRD = IOServiceGetMatchingService(kIOMasterPortDefault, IOServiceMatching("IOPMrootDomain"));
|
||||
if(0 == powerManagementRD)
|
||||
{
|
||||
//err msg
|
||||
logMsg(LOG_ERR, @"failed to get power management root domain for lid notifications");
|
||||
|
||||
//error
|
||||
goto bail;
|
||||
}
|
||||
|
||||
//add interest notification
|
||||
status = IOServiceAddInterestNotification(notificationPort, powerManagementRD, kIOGeneralInterest,
|
||||
pmDomainChange, &lidState, ¬ification);
|
||||
if(KERN_SUCCESS != status)
|
||||
{
|
||||
//err msg
|
||||
logMsg(LOG_ERR, [NSString stringWithFormat:@"failed to get add interest notifcation for lid notifications (error: 0x:%x)", status]);
|
||||
|
||||
//error
|
||||
goto bail;
|
||||
}
|
||||
|
||||
//happy
|
||||
registered = YES;
|
||||
|
||||
bail:
|
||||
|
||||
//release
|
||||
if(MACH_PORT_NULL != powerManagementRD)
|
||||
{
|
||||
//release
|
||||
IOObjectRelease(powerManagementRD);
|
||||
|
||||
//unset
|
||||
powerManagementRD = MACH_PORT_NULL;
|
||||
}
|
||||
|
||||
return registered;
|
||||
}
|
||||
|
||||
//unregister for notifications
|
||||
-(void)unregister4Notifications
|
||||
{
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, @"unregistering lid notifications");
|
||||
|
||||
//release notification
|
||||
if(0 != notification)
|
||||
{
|
||||
//release
|
||||
IOObjectRelease(notification);
|
||||
|
||||
//unset
|
||||
notification = 0;
|
||||
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, @"released service interest notification");
|
||||
}
|
||||
|
||||
//destroy notification port
|
||||
if(NULL != notificationPort)
|
||||
{
|
||||
//set queue to NULL
|
||||
IONotificationPortSetDispatchQueue(notificationPort, NULL);
|
||||
|
||||
//unset dispatch queue
|
||||
dispatchQ = NULL;
|
||||
|
||||
//destroy port
|
||||
IONotificationPortDestroy(notificationPort);
|
||||
|
||||
//unset
|
||||
notificationPort = NULL;
|
||||
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, @"destroyed notification port");
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//proces lid open event
|
||||
//proces trigger event
|
||||
// report to user, execute cmd, send alert to server, etc
|
||||
-(void)processEvent:(NSDate*)timestamp user:(NSString*)user
|
||||
-(void)processEvent:(NSUInteger)type info:(NSDictionary*)info
|
||||
{
|
||||
//monitor obj
|
||||
Monitor* monitor = nil;
|
||||
@@ -545,47 +307,41 @@ bail:
|
||||
//current prefs
|
||||
NSDictionary* currentPrefs = nil;
|
||||
|
||||
//alert
|
||||
NSDictionary* alert;
|
||||
|
||||
//init alert
|
||||
alert = @{ALERT_TIMESTAMP:timestamp};
|
||||
|
||||
//get current prefs
|
||||
currentPrefs = [preferences get:nil];
|
||||
|
||||
|
||||
//auth mode?
|
||||
// wait up to 10 seconds, and ignore event if user auth'd via biometrics or apple watch
|
||||
if(YES == [currentPrefs[PREF_AUTH_MODE] boolValue])
|
||||
{
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, @"'auth' mode enabled, waiting up to 10 seconds for biometric auth || apple watch event");
|
||||
|
||||
//TODO: add apple watch
|
||||
|
||||
//user auth'd via touchID?
|
||||
// will wait for up to 10 seconds
|
||||
if(YES == authViaTouchID())
|
||||
{
|
||||
//dbg msg
|
||||
// log to file
|
||||
logMsg(LOG_DEBUG|LOG_TO_FILE, @"user authenticated via touchID, so ignoring event");
|
||||
|
||||
//bail
|
||||
goto bail;
|
||||
}
|
||||
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, @"no touch id auth event found, so will continue processing event");
|
||||
}
|
||||
|
||||
//only add events to queue
|
||||
// when client is not running in passive mode
|
||||
if(YES != [currentPrefs[PREF_PASSIVE_MODE] boolValue])
|
||||
{
|
||||
//connected client? (login item)
|
||||
// deliver alert via XPC, to user
|
||||
if(nil != xpcListener.loginItem)
|
||||
{
|
||||
//send to client
|
||||
// this will fail (but we'll handle) if no clients are connected
|
||||
[[xpcListener.loginItem remoteObjectProxyWithErrorHandler:^(NSError * proxyError)
|
||||
{
|
||||
//err msg
|
||||
logMsg(LOG_ERR, [NSString stringWithFormat:@"failed to invoke USER XPC method: 'alertShow' (error: %@)", proxyError]);
|
||||
|
||||
//save undelivered alert
|
||||
@synchronized(self.undeliveredAlerts)
|
||||
{
|
||||
//save
|
||||
[self.undeliveredAlerts addObject:alert];
|
||||
}
|
||||
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, [NSString stringWithFormat:@"saved %@, will deliver when user (login item) connects", alert]);
|
||||
|
||||
}] alertShow:alert];
|
||||
}
|
||||
else
|
||||
{
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, @"no client (login item) is connected, so won't locally deliver alert");
|
||||
}
|
||||
//add to global queue
|
||||
// this will trigger processing of alert to user
|
||||
[eventQueue enqueue:@{ALERT_TYPE:[NSNumber numberWithInteger:type], ALERT_TIMESTAMP:[NSDate date], ALERT_INFO:info}];
|
||||
}
|
||||
//passive mode
|
||||
// just log a msg about this fact
|
||||
@@ -649,7 +405,7 @@ bail:
|
||||
}
|
||||
|
||||
//registered device?
|
||||
// send to alert to server
|
||||
// send alert to server
|
||||
if(nil != self.client)
|
||||
{
|
||||
//dbg msg
|
||||
@@ -663,14 +419,14 @@ bail:
|
||||
logMsg(LOG_DEBUG, @"no (prev) alerts undelivered");
|
||||
|
||||
//save timestamp
|
||||
self.undeliveredAlert = timestamp;
|
||||
self.undeliveredAlert = [NSDate date];
|
||||
|
||||
//send to server
|
||||
// will wait up to x minutes if there's no network connectivity
|
||||
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
||||
|
||||
//wait
|
||||
[self send2Server:user];
|
||||
[self send2Server:getConsoleUser()];
|
||||
|
||||
});
|
||||
}
|
||||
@@ -683,7 +439,7 @@ bail:
|
||||
logMsg(LOG_DEBUG, @"previously alert undelivered, just updating that...");
|
||||
|
||||
//save timestamp
|
||||
self.undeliveredAlert = timestamp;
|
||||
self.undeliveredAlert = [NSDate date];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -692,7 +448,7 @@ bail:
|
||||
else
|
||||
{
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, @"did not send to server - no client/registered device");
|
||||
logMsg(LOG_DEBUG, @"did not send to server, as there's no client/registered device");
|
||||
}
|
||||
|
||||
bail:
|
||||
@@ -740,7 +496,7 @@ bail:
|
||||
logMsg(LOG_DEBUG|LOG_TO_FILE, [NSString stringWithFormat:@"sending alert to server (user: %@)", user]);
|
||||
|
||||
//send
|
||||
response = [self.client sendAlertSyncWithUuid:[NSUUID UUID] userName:user date:self.undeliveredAlert photo:NO];
|
||||
response = [self.client sendAlertSyncWithUuid:[NSUUID UUID] userName:user date:self.undeliveredAlert];
|
||||
if(nil != response)
|
||||
{
|
||||
//log
|
||||
@@ -769,7 +525,7 @@ bail:
|
||||
logMsg(LOG_DEBUG, @"could not reach endpoint - network offline?");
|
||||
|
||||
//not online
|
||||
//... so take a nap
|
||||
//... so tak a nap
|
||||
[NSThread sleepForTimeInterval:i*1.5];
|
||||
}
|
||||
|
||||
@@ -945,41 +701,4 @@ bail:
|
||||
return result;
|
||||
}
|
||||
|
||||
//framework delegate method
|
||||
// send XPC message to user (login item) to take picture
|
||||
-(void)captureImageWithCompletion:(void (^ _Nonnull)(NSData * _Nullable))completion
|
||||
{
|
||||
//connected client? (login item)
|
||||
// request image capture of camera, via XPC
|
||||
if(nil != xpcListener.loginItem)
|
||||
{
|
||||
//request to user (login item) to take a picture
|
||||
[[xpcListener.loginItem remoteObjectProxyWithErrorHandler:^(NSError * proxyError)
|
||||
{
|
||||
//err msg
|
||||
logMsg(LOG_ERR, [NSString stringWithFormat:@"failed to invoke USER XPC method: 'capture picture' (error: %@)", proxyError]);
|
||||
|
||||
//error
|
||||
completion(nil);
|
||||
|
||||
}] captureImage:^(NSData* image)
|
||||
{
|
||||
//pass back to framework
|
||||
completion(image);
|
||||
}];
|
||||
}
|
||||
else
|
||||
{
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, @"no client (login item) is connected, so can't capture image");
|
||||
|
||||
//still, invoke callback
|
||||
completion(nil);
|
||||
}
|
||||
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -1,25 +1,29 @@
|
||||
//
|
||||
// file: XPCDaemon.h
|
||||
// file: UserComms.h
|
||||
// project: DND (launch daemon)
|
||||
// description: interface for user XPC methods (header)
|
||||
// description: interface for user componets (header)
|
||||
//
|
||||
// created by Patrick Wardle
|
||||
// copyright (c) 2018 Objective-See. All rights reserved.
|
||||
//
|
||||
|
||||
@import Foundation;
|
||||
#import "UserCommsInterface.h"
|
||||
#import <dnd/dnd-Swift.h>
|
||||
|
||||
#import "XPCDaemonProto.h"
|
||||
|
||||
|
||||
@interface XPCDaemon : NSObject <XPCDaemonProtocol, DNDClientMacDelegate>
|
||||
@interface UserComms : NSObject <UserProtocol, DNDClientMacDelegate>
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/* PROPERTIES */
|
||||
|
||||
//client status
|
||||
@property NSInteger currentStatus;
|
||||
|
||||
//last alert
|
||||
@property(nonatomic,retain)NSDictionary* dequeuedAlert;
|
||||
|
||||
//registration info from server
|
||||
@property(nonatomic,retain)NSDictionary *registrationInfo;
|
||||
|
||||
@@ -1,31 +1,38 @@
|
||||
//
|
||||
// file: XPCDaemon.m
|
||||
// file: UserComms.m
|
||||
// project: DND (launch daemon)
|
||||
// description: interface for user XPC methods
|
||||
// description: interface for user componets
|
||||
//
|
||||
// created by Patrick Wardle
|
||||
// copyright (c) 2018 Objective-See. All rights reserved.
|
||||
//
|
||||
|
||||
#import "Consts.h"
|
||||
#import "Queue.h"
|
||||
#import "Logging.h"
|
||||
#import "XPCDaemon.h"
|
||||
#import "UserComms.h"
|
||||
#import "Preferences.h"
|
||||
#import "FrameworkInterface.h"
|
||||
#import "UserCommsInterface.h"
|
||||
|
||||
#import <dnd/dnd-swift.h>
|
||||
|
||||
//signing auth
|
||||
#define SIGNING_AUTH @"Developer ID Application: Objective-See, LLC (VBG97UB4TA)"
|
||||
|
||||
//global queue object
|
||||
extern Queue* eventQueue;
|
||||
|
||||
//global prefs obj
|
||||
extern Preferences* preferences;
|
||||
|
||||
//framework interface obc
|
||||
extern FrameworkInterface* framework;
|
||||
|
||||
@implementation XPCDaemon
|
||||
@implementation UserComms
|
||||
|
||||
@synthesize currentStatus;
|
||||
@synthesize dequeuedAlert;
|
||||
@synthesize registrationInfo;
|
||||
@synthesize registrationSema;
|
||||
|
||||
@@ -37,7 +44,8 @@ extern FrameworkInterface* framework;
|
||||
self = [super init];
|
||||
if(nil != self)
|
||||
{
|
||||
|
||||
//set status
|
||||
self.currentStatus = STATUS_CLIENT_UNKNOWN;
|
||||
}
|
||||
|
||||
return self;
|
||||
@@ -192,7 +200,48 @@ bail:
|
||||
return;
|
||||
}
|
||||
|
||||
//process alert request from client
|
||||
// blocks for queue item, then sends to client
|
||||
-(void)alertRequest:(void (^)(NSDictionary* alert))reply
|
||||
{
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, @"XPC request: alert request");
|
||||
|
||||
//reset
|
||||
self.dequeuedAlert = nil;
|
||||
|
||||
//read off queue
|
||||
// will block until alert is ready
|
||||
self.dequeuedAlert = [eventQueue peek];
|
||||
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, [NSString stringWithFormat:@"found alert on queue: %@", self.dequeuedAlert]);
|
||||
|
||||
//log to file
|
||||
logMsg(LOG_DEBUG|LOG_TO_FILE, [NSString stringWithFormat:@"sending alert to login item to display to user: %@", self.dequeuedAlert]);
|
||||
|
||||
//return alert
|
||||
reply(self.dequeuedAlert);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//invoke when alert has been displayed
|
||||
// for now, just remove it from the queue
|
||||
-(void)alertResponse
|
||||
{
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, @"XPC request: alert response");
|
||||
|
||||
//remove
|
||||
[eventQueue dequeue];
|
||||
|
||||
//unset
|
||||
self.dequeuedAlert = nil;
|
||||
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, @"removed alert, as it's been consumed by the user");
|
||||
}
|
||||
|
||||
//process alert dismiss request from client
|
||||
// blocks until framework tell us it was dismissed via the phone || login item said 'disable'
|
||||
@@ -1,15 +1,16 @@
|
||||
//
|
||||
// file: XPCListener.h
|
||||
// file: UserCommsListener.h
|
||||
// project: DND (launch daemon)
|
||||
// description: XPC listener for connections from user components (header)
|
||||
// description: XPC listener for connections for user components (header)
|
||||
//
|
||||
// created by Patrick Wardle
|
||||
// copyright (c) 2018 Objective-See. All rights reserved.
|
||||
//
|
||||
|
||||
@import Foundation;
|
||||
#import "UserCommsInterface.h"
|
||||
|
||||
@interface XPCListener : NSObject <NSXPCListenerDelegate>
|
||||
@interface UserCommsListener : NSObject <NSXPCListenerDelegate>
|
||||
{
|
||||
|
||||
}
|
||||
@@ -19,12 +20,6 @@
|
||||
//XPC listener
|
||||
@property(nonatomic, retain)NSXPCListener* listener;
|
||||
|
||||
//XPC connection for login item
|
||||
@property(weak)NSXPCConnection* loginItem;
|
||||
|
||||
//XPC connection for main app
|
||||
@property(weak)NSXPCConnection* mainApp;
|
||||
|
||||
/* METHODS */
|
||||
|
||||
//setup XPC listener
|
||||
@@ -35,4 +30,9 @@
|
||||
// note: we only allow binaries signed by Objective-See to talk to this!
|
||||
-(BOOL)listener:(NSXPCListener *)listener shouldAcceptNewConnection:(NSXPCConnection *)newConnection;
|
||||
|
||||
//connection invalidated
|
||||
// if there is an 'undelivered' alert, (re)enqueue it
|
||||
-(void)connectionInvalidated:(NSXPCConnection *)connection;
|
||||
|
||||
|
||||
@end
|
||||
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// file: XPCListener.h
|
||||
// file: UserCommsListener.m
|
||||
// project: DND (launch daemon)
|
||||
// description: XPC listener for connections from user components
|
||||
// description: XPC listener for connections for user components
|
||||
//
|
||||
// created by Patrick Wardle
|
||||
// copyright (c) 2018 Objective-See. All rights reserved.
|
||||
@@ -9,15 +9,18 @@
|
||||
|
||||
#import "Consts.h"
|
||||
#import "Logging.h"
|
||||
#import "Utilities.h"
|
||||
#import "XPCDaemon.h"
|
||||
#import "XPCListener.h"
|
||||
#import "XPCUSERProto.h"
|
||||
#import "XPCDaemonProto.h"
|
||||
|
||||
#import "Queue.h"
|
||||
#import "UserComms.h"
|
||||
#import "UserCommsListener.h"
|
||||
#import "UserCommsInterface.h"
|
||||
|
||||
//signing auth
|
||||
#define SIGNING_AUTH @"Developer ID Application: Objective-See, LLC (VBG97UB4TA)"
|
||||
|
||||
//global queue object
|
||||
extern Queue* eventQueue;
|
||||
|
||||
//interface for 'extension' to NSXPCConnection
|
||||
// allows us to access the 'private' auditToken iVar
|
||||
@interface ExtendedNSXPCConnection : NSXPCConnection
|
||||
@@ -39,10 +42,14 @@
|
||||
|
||||
@end
|
||||
|
||||
//function
|
||||
OSStatus SecTaskValidateForRequirement(SecTaskRef task, CFStringRef requirement);
|
||||
|
||||
@implementation XPCListener
|
||||
|
||||
//global queue object
|
||||
extern Queue* eventQueue;
|
||||
|
||||
@implementation UserCommsListener
|
||||
|
||||
|
||||
@synthesize listener;
|
||||
|
||||
@@ -58,10 +65,11 @@ OSStatus SecTaskValidateForRequirement(SecTaskRef task, CFStringRef requirement)
|
||||
if(YES != [self initListener])
|
||||
{
|
||||
//unset
|
||||
self = nil;
|
||||
self = nil;
|
||||
|
||||
//bail
|
||||
goto bail;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,6 +112,7 @@ bail:
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark NSXPCConnection method overrides
|
||||
|
||||
@@ -119,14 +128,29 @@ bail:
|
||||
SecTaskRef taskRef = 0;
|
||||
|
||||
//signing req string
|
||||
NSString* requirementString = nil;
|
||||
NSString *requirementString = nil;
|
||||
|
||||
//path of connecting app
|
||||
NSString* path = nil;
|
||||
//make weak ref
|
||||
// see: https://stackoverflow.com/a/23628986/3854841
|
||||
__weak typeof(NSXPCConnection*) weakConnection = newConnection;
|
||||
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, @"received request to connect to XPC interface");
|
||||
|
||||
//set interrupt & invalidation handler
|
||||
newConnection.interruptionHandler = newConnection.invalidationHandler = ^{
|
||||
|
||||
//make strong ref
|
||||
// see: https://stackoverflow.com/a/23628986/3854841
|
||||
__strong typeof(NSXPCConnection*)strongConnection = weakConnection;
|
||||
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, @"connection interrupted/invalidated");
|
||||
|
||||
//handle invalidation
|
||||
[self connectionInvalidated:strongConnection];
|
||||
};
|
||||
|
||||
//init signing req string
|
||||
requirementString = [NSString stringWithFormat:@"anchor trusted and certificate leaf [subject.CN] = \"%@\"", SIGNING_AUTH];
|
||||
|
||||
@@ -146,47 +170,18 @@ bail:
|
||||
//bail
|
||||
goto bail;
|
||||
}
|
||||
|
||||
|
||||
//set the interface that the exported object implements
|
||||
newConnection.exportedInterface = [NSXPCInterface interfaceWithProtocol:@protocol(XPCDaemonProtocol)];
|
||||
newConnection.exportedInterface = [NSXPCInterface interfaceWithProtocol:@protocol(UserProtocol)];
|
||||
|
||||
//set object exported by connection
|
||||
newConnection.exportedObject = [[XPCDaemon alloc] init];
|
||||
|
||||
//set type of remote object
|
||||
// user (login item/main app) will set this object
|
||||
newConnection.remoteObjectInterface = [NSXPCInterface interfaceWithProtocol: @protocol(XPCUserProtocol)];
|
||||
|
||||
//get path
|
||||
path = getProcessPath(newConnection.processIdentifier);
|
||||
|
||||
//login item
|
||||
// save connection and notify that new client has connected
|
||||
if(YES == [path hasSuffix:LOGIN_ITEM_NAME])
|
||||
{
|
||||
//save
|
||||
self.loginItem = newConnection;
|
||||
|
||||
//in background
|
||||
// notify that a new client connected
|
||||
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0),
|
||||
^{
|
||||
//notify
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:USER_NOTIFICATION object:nil userInfo:nil];
|
||||
});
|
||||
}
|
||||
//main app
|
||||
else
|
||||
{
|
||||
//save
|
||||
self.mainApp = newConnection;
|
||||
}
|
||||
|
||||
newConnection.exportedObject = [[UserComms alloc] init];
|
||||
|
||||
//resume
|
||||
[newConnection resume];
|
||||
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, [NSString stringWithFormat:@"allowed XPC connection from %@", path]);
|
||||
logMsg(LOG_DEBUG, [NSString stringWithFormat:@"allowed XPC connection: %@", newConnection.exportedObject]);
|
||||
|
||||
//happy
|
||||
shouldAccept = YES;
|
||||
@@ -206,4 +201,50 @@ bail:
|
||||
return shouldAccept;
|
||||
}
|
||||
|
||||
//connection invalidated
|
||||
// if there is an 'undelivered' alert, (re)enqueue it
|
||||
-(void)connectionInvalidated:(NSXPCConnection *)connection
|
||||
{
|
||||
//user comms obj
|
||||
UserComms* userComms = nil;
|
||||
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, @"XPC connection interrupted/invalidated");
|
||||
|
||||
//sanity check
|
||||
if(nil == connection)
|
||||
{
|
||||
//bail
|
||||
goto bail;
|
||||
}
|
||||
|
||||
//grab user comms object
|
||||
userComms = connection.exportedObject;
|
||||
|
||||
//no undelivered (dequeued) alert?
|
||||
if(nil == userComms.dequeuedAlert)
|
||||
{
|
||||
//bail
|
||||
goto bail;
|
||||
}
|
||||
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, [NSString stringWithFormat:@"found undelivered alert, will (re)enqueue"]);
|
||||
|
||||
//have alert
|
||||
// requeue it up
|
||||
[eventQueue enqueue:userComms.dequeuedAlert];
|
||||
|
||||
bail:
|
||||
|
||||
//unset export obj
|
||||
connection.exportedObject = nil;
|
||||
|
||||
//unset connection
|
||||
connection = nil;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
@@ -7,6 +7,8 @@
|
||||
// copyright (c) 2018 Objective-See. All rights reserved.
|
||||
//
|
||||
|
||||
@import Foundation;
|
||||
|
||||
/* FUNCTIONS */
|
||||
|
||||
//uninstall
|
||||
|
||||
@@ -7,14 +7,15 @@
|
||||
// copyright (c) 2018 Objective-See. All rights reserved.
|
||||
//
|
||||
|
||||
#import "Lid.h"
|
||||
#import "main.h"
|
||||
#import "Queue.h"
|
||||
#import "Consts.h"
|
||||
#import "Logging.h"
|
||||
#import "Triggers.h"
|
||||
#import "Utilities.h"
|
||||
#import "Preferences.h"
|
||||
#import "XPCListener.h"
|
||||
#import "UserAuthMonitor.h"
|
||||
#import "UserCommsListener.h"
|
||||
#import "FrameworkInterface.h"
|
||||
|
||||
@import Sentry;
|
||||
@@ -26,7 +27,11 @@ Preferences* preferences = nil;
|
||||
|
||||
//lid object
|
||||
// registers for notifications, gets state, etc
|
||||
Lid* lid = nil;
|
||||
Triggers* triggers = nil;
|
||||
|
||||
//queue object
|
||||
// contains watch items that should be processed
|
||||
Queue* eventQueue = nil;
|
||||
|
||||
//user auth event listener
|
||||
UserAuthMonitor* userAuthMonitor = nil;
|
||||
@@ -37,26 +42,29 @@ FrameworkInterface* framework = nil;
|
||||
//dispatch source for SIGTERM
|
||||
dispatch_source_t dispatchSource = nil;
|
||||
|
||||
//XPC listener
|
||||
XPCListener* xpcListener = nil;
|
||||
|
||||
//main
|
||||
// init & kickoff stuffz
|
||||
int main(int argc, const char * argv[])
|
||||
{
|
||||
//return
|
||||
int result = -1;
|
||||
|
||||
|
||||
@autoreleasepool
|
||||
{
|
||||
//user comms listener (XPC) obj
|
||||
UserCommsListener* userCommsListener = nil;
|
||||
|
||||
//current preferences
|
||||
NSDictionary* currentPrefs = nil;
|
||||
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, [NSString stringWithFormat:@"STARTED: launch daemon (args: %@)", [[NSProcessInfo processInfo] arguments]]);
|
||||
|
||||
//init crash reporting
|
||||
initCrashReporting();
|
||||
//init crash reporting client
|
||||
SentryClient.sharedClient = [[SentryClient alloc] initWithDsn:CRASH_REPORTING_URL didFailWithError:nil];
|
||||
|
||||
//start crash handler
|
||||
[SentryClient.sharedClient startCrashHandlerWithError:nil];
|
||||
|
||||
//alloc/init/load prefs
|
||||
// to here (early) as other logic (below) uses prefs
|
||||
@@ -115,6 +123,7 @@ int main(int argc, const char * argv[])
|
||||
// allows to close logging, etc.
|
||||
register4Shutdown();
|
||||
|
||||
|
||||
//1st time identity generatation is done on demand
|
||||
// subsequent times though, can just always do here
|
||||
if(nil != currentPrefs[PREF_CLIENT_ID])
|
||||
@@ -133,36 +142,39 @@ int main(int argc, const char * argv[])
|
||||
logMsg(LOG_DEBUG, @"initialized DND identity");
|
||||
}
|
||||
|
||||
//init global lid object
|
||||
lid = [[Lid alloc] init];
|
||||
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, [NSString stringWithFormat:@"lid state: %d", getLidState()]);
|
||||
//init global triggers object
|
||||
triggers = [[Triggers alloc] init];
|
||||
|
||||
//not (prev) disabled?
|
||||
// register for lid notifications
|
||||
// toggle all triggers based on their setting
|
||||
if(YES != [currentPrefs[PREF_IS_DISABLED] boolValue])
|
||||
{
|
||||
//register for lid notifications
|
||||
[lid register4Notifications];
|
||||
//toggle all triggers
|
||||
[triggers toggle:ALL_TRIGGERS state:NSOnState];
|
||||
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, @"registered for lid change notifications");
|
||||
logMsg(LOG_DEBUG, @"toggled (all) triggers");
|
||||
}
|
||||
|
||||
//(prev) disabled
|
||||
else
|
||||
{
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, @"currently disabled, so did not register for lid change notifications");
|
||||
logMsg(LOG_DEBUG, @"user set 'disabled' preference, so did not register for any triggers");
|
||||
}
|
||||
|
||||
//alloc/init XPC listener
|
||||
xpcListener = [[XPCListener alloc] init];
|
||||
if(nil == xpcListener)
|
||||
|
||||
//init global queue
|
||||
eventQueue = [[Queue alloc] init];
|
||||
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, @"initialized global queue");
|
||||
|
||||
//alloc/init user comms XPC obj
|
||||
userCommsListener = [[UserCommsListener alloc] init];
|
||||
if(nil == userCommsListener)
|
||||
{
|
||||
//err msg
|
||||
logMsg(LOG_ERR, [NSString stringWithFormat:@"failed to initialize XPC listener"]);
|
||||
logMsg(LOG_ERR, [NSString stringWithFormat:@"failed to initialize user comms XPC listener"]);
|
||||
|
||||
//bail
|
||||
goto bail;
|
||||
@@ -171,9 +183,6 @@ int main(int argc, const char * argv[])
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, @"listening for client XPC connections");
|
||||
|
||||
//run loop
|
||||
[[NSRunLoop currentRunLoop] run];
|
||||
|
||||
}//pool
|
||||
|
||||
//happy
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
//
|
||||
// file: DeviceTrigger.h
|
||||
// project: DND (launch daemon)
|
||||
// description: monitor and alert logic for device insertion events (header)
|
||||
//
|
||||
// created by Patrick Wardle
|
||||
// copyright (c) 2018 Objective-See. All rights reserved.
|
||||
//
|
||||
|
||||
@import Cocoa;
|
||||
@import Foundation;
|
||||
|
||||
#import <IOKit/usb/IOUSBLib.h>
|
||||
|
||||
/* CLASS INTERFACE */
|
||||
|
||||
@interface DeviceTrigger : NSObject
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/* PROPERTIES */
|
||||
|
||||
//notification port
|
||||
@property(nonatomic)IONotificationPortRef notificationPort;
|
||||
|
||||
//callback for USB devices
|
||||
void usbAppeared(void *refCon, io_iterator_t iterator);
|
||||
|
||||
//run loop source
|
||||
@property(nonatomic)CFRunLoopSourceRef runLoopSource;
|
||||
|
||||
|
||||
/* METHODS */
|
||||
|
||||
//register for notifications
|
||||
-(BOOL)toggle:(NSControlStateValue)state;
|
||||
|
||||
//process new USB insertion
|
||||
// get info about device and log
|
||||
-(void)handleNewDevice:(io_iterator_t)iterator;
|
||||
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,244 @@
|
||||
// file: DeviceTrigger.m
|
||||
// project: DND (launch daemon)
|
||||
// description: monitor and alert logic for device insertion events
|
||||
//
|
||||
// created by Patrick Wardle
|
||||
// copyright (c) 2018 Objective-See. All rights reserved.
|
||||
//
|
||||
|
||||
#import "Consts.h"
|
||||
#import "Logging.h"
|
||||
#import "Triggers.h"
|
||||
#import "Utilities.h"
|
||||
#import "Preferences.h"
|
||||
#import "DeviceTrigger.h"
|
||||
|
||||
/* GLOBALS */
|
||||
|
||||
//triggers object
|
||||
extern Triggers* triggers;
|
||||
|
||||
//preferences obj
|
||||
extern Preferences* preferences;
|
||||
|
||||
@implementation DeviceTrigger
|
||||
|
||||
@synthesize runLoopSource;
|
||||
@synthesize notificationPort;
|
||||
|
||||
//callback for USB devices
|
||||
void usbAppeared(void *refCon, io_iterator_t iterator)
|
||||
{
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, [NSString stringWithFormat:@"usb device inserted"]);
|
||||
|
||||
//process new device
|
||||
[(__bridge DeviceTrigger *)refCon handleNewDevice:iterator];
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//toggle lid notifications
|
||||
-(BOOL)toggle:(NSControlStateValue)state
|
||||
{
|
||||
//flag
|
||||
BOOL wasToggled = NO;
|
||||
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, [NSString stringWithFormat:@"toggling devices notifications: %lu", state]);
|
||||
|
||||
//on?
|
||||
// enable
|
||||
if(NSOnState == state)
|
||||
{
|
||||
//enable
|
||||
wasToggled = [self enable];
|
||||
}
|
||||
//off
|
||||
// disable
|
||||
else
|
||||
{
|
||||
//disable
|
||||
[self disable];
|
||||
|
||||
//manually set flag
|
||||
wasToggled = YES;
|
||||
}
|
||||
|
||||
return wasToggled;
|
||||
}
|
||||
|
||||
//start USB monitoring
|
||||
-(BOOL)enable
|
||||
{
|
||||
//status
|
||||
BOOL initialized = NO;
|
||||
|
||||
//status
|
||||
kern_return_t status = kIOReturnError;
|
||||
|
||||
//iterator
|
||||
io_iterator_t iterator = 0;
|
||||
|
||||
//device
|
||||
io_service_t device = 0;
|
||||
|
||||
//create notification port
|
||||
self.notificationPort = IONotificationPortCreate(kIOMasterPortDefault);
|
||||
|
||||
//get run loop source
|
||||
self.runLoopSource = IONotificationPortGetRunLoopSource(self.notificationPort);
|
||||
|
||||
//add source
|
||||
CFRunLoopAddSource(CFRunLoopGetMain(), runLoopSource, kCFRunLoopDefaultMode);
|
||||
|
||||
//add notification
|
||||
// pass in 'self' so can access obj-c methods in callbacks
|
||||
status = IOServiceAddMatchingNotification(self.notificationPort, kIOMatchedNotification, IOServiceMatching(kIOUSBDeviceClassName), usbAppeared,(__bridge void *)self, &iterator);
|
||||
if(kIOReturnSuccess != status)
|
||||
{
|
||||
//err
|
||||
logMsg(LOG_ERR, [NSString stringWithFormat:@"IOServiceAddMatchingNotification() failed with %d", status]);
|
||||
|
||||
//bail
|
||||
goto bail;
|
||||
}
|
||||
|
||||
//process existing devices
|
||||
// also 'drains' interator...
|
||||
device = IOIteratorNext(iterator);
|
||||
while(0 != device)
|
||||
{
|
||||
//record device name/properties
|
||||
//[self logDeviceProperties:device];
|
||||
|
||||
//release
|
||||
IOObjectRelease(device);
|
||||
|
||||
//get next
|
||||
device = IOIteratorNext(iterator);
|
||||
}
|
||||
|
||||
//happy
|
||||
initialized = YES;
|
||||
|
||||
bail:
|
||||
|
||||
return initialized;
|
||||
}
|
||||
|
||||
//stop
|
||||
// invalidate runloop src and notification port
|
||||
-(void)disable
|
||||
{
|
||||
//invalidate runloop src
|
||||
if(nil != self.runLoopSource)
|
||||
{
|
||||
//invalidate
|
||||
CFRunLoopSourceInvalidate(self.runLoopSource);
|
||||
|
||||
//unset
|
||||
self.runLoopSource = nil;
|
||||
}
|
||||
|
||||
//destroy notification port
|
||||
if(nil != self.notificationPort)
|
||||
{
|
||||
//destroy
|
||||
IONotificationPortDestroy(self.notificationPort);
|
||||
|
||||
//unset
|
||||
self.notificationPort = nil;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//process new USB insertion
|
||||
// get info about device and log
|
||||
-(void)handleNewDevice:(io_iterator_t)iterator
|
||||
{
|
||||
//usb device
|
||||
io_service_t device;
|
||||
|
||||
//device name
|
||||
io_name_t deviceName = {0};
|
||||
|
||||
//timestamp
|
||||
NSDate* timestamp = nil;
|
||||
|
||||
//process
|
||||
while((device = IOIteratorNext(iterator)))
|
||||
{
|
||||
//reset
|
||||
bzero(deviceName, sizeof(io_name_t));
|
||||
|
||||
//init timestamp
|
||||
timestamp = [NSDate date];
|
||||
|
||||
//get device name
|
||||
if(KERN_SUCCESS != IORegistryEntryGetName(device, deviceName))
|
||||
{
|
||||
//err msg
|
||||
logMsg(LOG_ERR, @"failed to get usb device name");
|
||||
|
||||
//set to unknown
|
||||
strncpy(deviceName, "<unknown>", sizeof(io_name_t)-1);
|
||||
}
|
||||
|
||||
//dbg msg
|
||||
// log to file
|
||||
logMsg(LOG_DEBUG|LOG_TO_FILE, [NSString stringWithFormat:@"[NEW EVENT] usb inserted: \"%s\"", deviceName]);
|
||||
|
||||
//process event
|
||||
// report to user, server, execute actions, etc.
|
||||
[triggers processEvent:DEVICE_TRIGGER info:@{KEY_DEVICE_NAME:[NSString stringWithUTF8String:deviceName]}];
|
||||
|
||||
//release device
|
||||
IOObjectRelease(device);
|
||||
|
||||
//unset
|
||||
device = 0;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//log name/properties of a device
|
||||
-(void)logDeviceProperties:(io_service_t)device
|
||||
{
|
||||
//device name
|
||||
io_name_t deviceName = {0};
|
||||
|
||||
//device properties
|
||||
CFMutableDictionaryRef deviceProperties = NULL;
|
||||
|
||||
//get device name
|
||||
if(KERN_SUCCESS == IORegistryEntryGetName(device, deviceName))
|
||||
{
|
||||
//dbg msg & log
|
||||
logMsg(LOG_DEBUG|LOG_TO_FILE, [NSString stringWithFormat:@"usb device name: %s", deviceName]);
|
||||
}
|
||||
|
||||
//get device properties
|
||||
if( (kIOReturnSuccess == IORegistryEntryCreateCFProperties(device, &deviceProperties, kCFAllocatorDefault, kNilOptions)) &&
|
||||
(NULL != deviceProperties) )
|
||||
{
|
||||
//dbg msg & log
|
||||
logMsg(LOG_DEBUG|LOG_TO_FILE, [NSString stringWithFormat:@"usb device properties: %@", deviceProperties]);
|
||||
}
|
||||
|
||||
//release device props
|
||||
if(NULL != deviceProperties)
|
||||
{
|
||||
//release
|
||||
CFRelease(deviceProperties);
|
||||
|
||||
//unset
|
||||
deviceProperties = NULL;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,44 @@
|
||||
//
|
||||
// file: LidTrigger.h
|
||||
// project: DND (launch daemon)
|
||||
// description: monitor and alert logic for lid open events (header)
|
||||
//
|
||||
// created by Patrick Wardle
|
||||
// copyright (c) 2018 Objective-See. All rights reserved.
|
||||
//
|
||||
|
||||
#import "Utilities.h"
|
||||
|
||||
@import Foundation;
|
||||
|
||||
#import <IOKit/IOKitLib.h>
|
||||
#import <IOKit/pwr_mgt/IOPM.h>
|
||||
|
||||
|
||||
/* CLASS INTERFACE */
|
||||
|
||||
@interface LidTrigger : NSObject
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/* PROPERTIES */
|
||||
|
||||
//lid state
|
||||
@property LidState lidState;
|
||||
|
||||
//dispatch queue
|
||||
@property dispatch_queue_t dispatchQ;
|
||||
|
||||
//notification port
|
||||
@property IONotificationPortRef notificationPort;
|
||||
|
||||
//notification object
|
||||
@property io_object_t notification;
|
||||
|
||||
/* METHODS */
|
||||
|
||||
//register for notifications
|
||||
-(BOOL)toggle:(NSControlStateValue)state;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,325 @@
|
||||
// file: LidTrigger.m
|
||||
// project: DND (launch daemon)
|
||||
// description: monitor and alert logic for lid open events
|
||||
|
||||
// code inspired by:
|
||||
// https://github.com/zarigani/ClamshellWake/blob/master/ClamshellWake.cpp
|
||||
// https://github.com/dustinrue/ControlPlane/blob/master/Source/LaptopLidEvidenceSource.m
|
||||
|
||||
// note: manually get state from terminal via:
|
||||
// ioreg -r -k AppleClamshellState -d 4 | grep AppleClamshellState
|
||||
|
||||
#import "Consts.h"
|
||||
#import "Logging.h"
|
||||
#import "Triggers.h"
|
||||
#import "Utilities.h"
|
||||
#import "LidTrigger.h"
|
||||
#import "Preferences.h"
|
||||
|
||||
/* GLOBALS */
|
||||
|
||||
//last state
|
||||
// sometimes multiple notifications are delivered!?
|
||||
LidState lastLidState;
|
||||
|
||||
//triggers object
|
||||
extern Triggers* triggers;
|
||||
|
||||
//preferences obj
|
||||
extern Preferences* preferences;
|
||||
|
||||
//callback for power/lid events
|
||||
static void pmDomainChange(void *refcon, io_service_t service, uint32_t messageType, void *messageArgument)
|
||||
{
|
||||
//lid state
|
||||
int lidState = stateUnavailable;
|
||||
|
||||
//sleep bit
|
||||
int sleepState = -1;
|
||||
|
||||
//preferences
|
||||
NSDictionary* currentPrefs = nil;
|
||||
|
||||
//timestamp
|
||||
NSDate* timestamp = nil;
|
||||
|
||||
//init timestamp
|
||||
timestamp = [NSDate date];
|
||||
|
||||
//ignore any messages that are related to lid state
|
||||
if(kIOPMMessageClamshellStateChange != messageType)
|
||||
{
|
||||
//bail
|
||||
goto bail;
|
||||
}
|
||||
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, @"got 'kIOPMMessageClamshellStateChange' message");
|
||||
|
||||
//get prefs
|
||||
currentPrefs = [preferences get:nil];
|
||||
|
||||
//if user explicity set disabled
|
||||
// bail here, to ignore everything
|
||||
if(YES == [currentPrefs[PREF_IS_DISABLED] boolValue])
|
||||
{
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, @"client disabled DND, so ignoring lid event");
|
||||
|
||||
//update 'prev' state?
|
||||
lastLidState = stateOpen;
|
||||
|
||||
//bail
|
||||
goto bail;
|
||||
}
|
||||
|
||||
//get state
|
||||
lidState = ((int) messageArgument & kClamshellStateBit);
|
||||
|
||||
//get sleep state
|
||||
sleepState = !!(((int)messageArgument & kClamshellSleepBit));
|
||||
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, [NSString stringWithFormat:@"lid state: %@ (sleep bit: %d)", (lidState) ? @"closed" : @"open", sleepState]);
|
||||
|
||||
//(new) open?
|
||||
// OS sometimes delivers 2x events, so ignore same same
|
||||
if( (stateOpen == lidState) &&
|
||||
(stateOpen != lastLidState) )
|
||||
{
|
||||
//ignore if lid isn't really open
|
||||
// on reboot, OS may deliver 'open' message if external monitors are connected
|
||||
if(stateOpen != getLidState())
|
||||
{
|
||||
//bail
|
||||
goto bail;
|
||||
}
|
||||
|
||||
//update 'prev' state
|
||||
lastLidState = stateOpen;
|
||||
|
||||
//dbg msg
|
||||
// log to file
|
||||
logMsg(LOG_DEBUG|LOG_TO_FILE, [NSString stringWithFormat:@"[NEW EVENT] lid state: open (sleep state: %d)", sleepState]);
|
||||
|
||||
//process event
|
||||
// report to user, server, execute actions, etc.
|
||||
[triggers processEvent:LID_TRIGGER info:nil];
|
||||
}
|
||||
|
||||
//(new) close?
|
||||
// OS sometimes delivers 2x events, so ignore same same
|
||||
else if( (stateClosed == lidState) &&
|
||||
(stateClosed != lastLidState) )
|
||||
{
|
||||
//update 'prev' state
|
||||
lastLidState = stateClosed;
|
||||
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG|LOG_TO_FILE, [NSString stringWithFormat:@"[NEW EVENT] lid state: closed (sleep state: %d)", sleepState]);
|
||||
}
|
||||
|
||||
bail:
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@implementation LidTrigger
|
||||
|
||||
@synthesize lidState;
|
||||
@synthesize dispatchQ;
|
||||
@synthesize notification;
|
||||
@synthesize notificationPort;
|
||||
|
||||
//init
|
||||
-(id)init
|
||||
{
|
||||
//super
|
||||
self = [super init];
|
||||
if(nil != self)
|
||||
{
|
||||
//init
|
||||
notificationPort = NULL;
|
||||
|
||||
//init
|
||||
notification = 0;
|
||||
|
||||
//init to current state
|
||||
lastLidState = getLidState();
|
||||
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, [NSString stringWithFormat:@"initial lid state: %d", lastLidState]);
|
||||
|
||||
//init
|
||||
dispatchQ = NULL;
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
//toggle lid notifications
|
||||
-(BOOL)toggle:(NSControlStateValue)state
|
||||
{
|
||||
//flag
|
||||
BOOL wasToggled = NO;
|
||||
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, [NSString stringWithFormat:@"toggling lid notifications: %lu", state]);
|
||||
|
||||
//on?
|
||||
// enable
|
||||
if(NSOnState == state)
|
||||
{
|
||||
//enable
|
||||
wasToggled = [self enable];
|
||||
}
|
||||
//off
|
||||
// disable
|
||||
else
|
||||
{
|
||||
//disable
|
||||
[self disable];
|
||||
|
||||
//manually set flag
|
||||
wasToggled = YES;
|
||||
}
|
||||
|
||||
return wasToggled;
|
||||
}
|
||||
|
||||
//register for notifications
|
||||
-(BOOL)enable
|
||||
{
|
||||
//return var
|
||||
BOOL registered = NO;
|
||||
|
||||
//status var
|
||||
kern_return_t status = kIOReturnError;
|
||||
|
||||
//root domain for power management
|
||||
io_service_t powerManagementRD = MACH_PORT_NULL;
|
||||
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, @"registering for lid notifications");
|
||||
|
||||
//make sure state is ok
|
||||
if(stateUnavailable == getLidState())
|
||||
{
|
||||
//err msg
|
||||
logMsg(LOG_ERR, @"failed to get lid state, so aborting lid notifications registration");
|
||||
|
||||
//error
|
||||
goto bail;
|
||||
}
|
||||
|
||||
//create queue
|
||||
dispatchQ = dispatch_queue_create(NULL, DISPATCH_QUEUE_SERIAL);
|
||||
if(NULL == dispatchQ)
|
||||
{
|
||||
//err msg
|
||||
logMsg(LOG_ERR, @"failed to create dispatch queue for lid notifications");
|
||||
|
||||
//error
|
||||
goto bail;
|
||||
}
|
||||
|
||||
//set target
|
||||
dispatch_set_target_queue(dispatchQ, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0));
|
||||
|
||||
//create notification port
|
||||
notificationPort = IONotificationPortCreate(kIOMasterPortDefault);
|
||||
if(NULL == notificationPort)
|
||||
{
|
||||
//err msg
|
||||
logMsg(LOG_ERR, @"failed to create notification port for lid notifications");
|
||||
|
||||
//error
|
||||
goto bail;
|
||||
}
|
||||
|
||||
//set dispatch queue
|
||||
IONotificationPortSetDispatchQueue(notificationPort, dispatchQ);
|
||||
|
||||
//get matching service for power management root domain
|
||||
powerManagementRD = IOServiceGetMatchingService(kIOMasterPortDefault, IOServiceMatching("IOPMrootDomain"));
|
||||
if(0 == powerManagementRD)
|
||||
{
|
||||
//err msg
|
||||
logMsg(LOG_ERR, @"failed to get power management root domain for lid notifications");
|
||||
|
||||
//error
|
||||
goto bail;
|
||||
}
|
||||
|
||||
//add interest notification
|
||||
status = IOServiceAddInterestNotification(notificationPort, powerManagementRD, kIOGeneralInterest,
|
||||
pmDomainChange, &lidState, ¬ification);
|
||||
if(KERN_SUCCESS != status)
|
||||
{
|
||||
//err msg
|
||||
logMsg(LOG_ERR, [NSString stringWithFormat:@"failed to get add interest notifcation for lid notifications (error: 0x:%x)", status]);
|
||||
|
||||
//error
|
||||
goto bail;
|
||||
}
|
||||
|
||||
//happy
|
||||
registered = YES;
|
||||
|
||||
bail:
|
||||
|
||||
//release
|
||||
if(MACH_PORT_NULL != powerManagementRD)
|
||||
{
|
||||
//release
|
||||
IOObjectRelease(powerManagementRD);
|
||||
|
||||
//unset
|
||||
powerManagementRD = MACH_PORT_NULL;
|
||||
}
|
||||
|
||||
return registered;
|
||||
}
|
||||
|
||||
//unregister for notifications
|
||||
-(void)disable
|
||||
{
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, @"unregistering lid notifications");
|
||||
|
||||
//release notification
|
||||
if(0 != notification)
|
||||
{
|
||||
//release
|
||||
IOObjectRelease(notification);
|
||||
|
||||
//unset
|
||||
notification = 0;
|
||||
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, @"released service interest notification");
|
||||
}
|
||||
|
||||
//destroy notification port
|
||||
if(NULL != notificationPort)
|
||||
{
|
||||
//set queue to NULL
|
||||
IONotificationPortSetDispatchQueue(notificationPort, NULL);
|
||||
|
||||
//unset dispatch queue
|
||||
dispatchQ = NULL;
|
||||
|
||||
//destroy port
|
||||
IONotificationPortDestroy(notificationPort);
|
||||
|
||||
//unset
|
||||
notificationPort = NULL;
|
||||
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, @"destroyed notification port");
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,35 @@
|
||||
//
|
||||
// file: Power.m
|
||||
// project: DND (launch daemon)
|
||||
// description: monitor and alert logic for power events (header)
|
||||
//
|
||||
// created by Patrick Wardle
|
||||
// copyright (c) 2018 Objective-See. All rights reserved.
|
||||
//
|
||||
|
||||
@import Cocoa;
|
||||
@import Foundation;
|
||||
|
||||
#import <IOKit/usb/IOUSBLib.h>
|
||||
|
||||
/* CLASS INTERFACE */
|
||||
|
||||
@interface PowerTrigger : NSObject
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/* PROPERTIES */
|
||||
|
||||
//observer for screensaver off events
|
||||
@property(nonatomic, retain)id screenSaverNotification;
|
||||
|
||||
|
||||
|
||||
/* METHODS */
|
||||
|
||||
//register for notifications
|
||||
-(BOOL)toggle:(NSControlStateValue)state;
|
||||
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,118 @@
|
||||
// file: Power.m
|
||||
// project: DND (launch daemon)
|
||||
// description: monitor and alert logic for power events (header)
|
||||
//
|
||||
// created by Patrick Wardle
|
||||
// copyright (c) 2018 Objective-See. All rights reserved.
|
||||
//
|
||||
|
||||
#import "Consts.h"
|
||||
#import "Logging.h"
|
||||
#import "Triggers.h"
|
||||
#import "Utilities.h"
|
||||
#import "Preferences.h"
|
||||
#import "PowerTrigger.h"
|
||||
|
||||
/* GLOBALS */
|
||||
|
||||
//triggers object
|
||||
extern Triggers* triggers;
|
||||
|
||||
//preferences obj
|
||||
extern Preferences* preferences;
|
||||
|
||||
@implementation PowerTrigger
|
||||
|
||||
@synthesize screenSaverNotification;
|
||||
|
||||
|
||||
//toggle lid notifications
|
||||
-(BOOL)toggle:(NSControlStateValue)state
|
||||
{
|
||||
//flag
|
||||
BOOL wasToggled = NO;
|
||||
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, [NSString stringWithFormat:@"toggling power notifications: %lu", state]);
|
||||
|
||||
//on?
|
||||
// enable
|
||||
if(NSOnState == state)
|
||||
{
|
||||
//enable
|
||||
wasToggled = [self enable];
|
||||
}
|
||||
//off
|
||||
// disable
|
||||
else
|
||||
{
|
||||
//disable
|
||||
[self disable];
|
||||
|
||||
//manually set flag
|
||||
wasToggled = YES;
|
||||
}
|
||||
|
||||
return wasToggled;
|
||||
}
|
||||
|
||||
//start power event monitoring
|
||||
-(BOOL)enable
|
||||
{
|
||||
//status
|
||||
BOOL initialized = NO;
|
||||
|
||||
/*
|
||||
com.apple.screensaver.didstart
|
||||
com.apple.screensaver.willstop
|
||||
com.apple.screensaver.didstop
|
||||
|
||||
*/
|
||||
|
||||
//add observer for screen save on
|
||||
// we don't get a screen save stop, so this will trigger process monitoring for exit of ScreenSaverEngine
|
||||
self.screenSaverNotification = [[NSDistributedNotificationCenter defaultCenter] addObserverForName:@"com.apple.screensaver.didlaunch" object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *notification)
|
||||
{
|
||||
//TODO: trigger process monitoring
|
||||
|
||||
//dbg msg
|
||||
// log to file
|
||||
//logMsg(LOG_DEBUG|LOG_TO_FILE, @"[NEW EVENT] screen saver did stop");
|
||||
|
||||
//process event
|
||||
// report to user, server, execute actions, etc.
|
||||
//[triggers processEvent:POWER_TRIGGER info:@{KEY_POWER_TYPE:@"screen saver did stop"}];
|
||||
|
||||
}];
|
||||
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, @"enabled screen saver 'did launch'");
|
||||
|
||||
|
||||
bail:
|
||||
|
||||
return initialized;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//disable
|
||||
-(void)disable
|
||||
{
|
||||
//disable
|
||||
// screen saver start notification
|
||||
if(nil != self.screenSaverNotification)
|
||||
{
|
||||
//remove
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self.screenSaverNotification];
|
||||
|
||||
//unset
|
||||
self.screenSaverNotification = nil;
|
||||
}
|
||||
|
||||
//TODO: make sure to stop process monitoring, if it's still going
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -11,6 +11,7 @@
|
||||
7D16D6951F64E43300DB3161 /* UpdateWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7D16D6911F64E43300DB3161 /* UpdateWindow.xib */; };
|
||||
7D16D6961F64E43300DB3161 /* UpdateWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D16D6931F64E43300DB3161 /* UpdateWindowController.m */; };
|
||||
7D3B75141F13354900568828 /* StatusBarMenu.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D3B74FD1F13354900568828 /* StatusBarMenu.m */; };
|
||||
7D3B75151F13354900568828 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7D3B75011F13354900568828 /* MainMenu.xib */; };
|
||||
7D3B75251F13357D00568828 /* Logging.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D3B75231F13357D00568828 /* Logging.m */; };
|
||||
7D5C5F521F200B9200C0E94A /* Utilities.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D5C5F511F200B9200C0E94A /* Utilities.m */; };
|
||||
7D7755E81F02E05B00D0017D /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D7755E71F02E05B00D0017D /* AppDelegate.m */; };
|
||||
@@ -18,7 +19,9 @@
|
||||
7D7755F01F02E05B00D0017D /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7D7755EE1F02E05B00D0017D /* MainMenu.xib */; };
|
||||
7DD25FF01F23B73C00277EC4 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 7DD25FEF1F23B73C00277EC4 /* Assets.xcassets */; };
|
||||
7DD260131F25307B00277EC4 /* HyperlinkTextField.m in Sources */ = {isa = PBXBuildFile; fileRef = 7DD260121F25307B00277EC4 /* HyperlinkTextField.m */; };
|
||||
7DD2BF7A1F1EAC9C00B33214 /* XPCDaemonClient.m in Sources */ = {isa = PBXBuildFile; fileRef = 7DD2BF791F1EAC9C00B33214 /* XPCDaemonClient.m */; };
|
||||
7DD2BF6E1F1DDF1F00B33214 /* AlertMonitor.m in Sources */ = {isa = PBXBuildFile; fileRef = 7DD2BF6D1F1DDF1F00B33214 /* AlertMonitor.m */; };
|
||||
7DD2BF7A1F1EAC9C00B33214 /* DaemonComms.m in Sources */ = {isa = PBXBuildFile; fileRef = 7DD2BF791F1EAC9C00B33214 /* DaemonComms.m */; };
|
||||
CD20A0D720579AFD0044BCC5 /* Sentry.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CD20A0D620579AFD0044BCC5 /* Sentry.framework */; };
|
||||
CD3307E020375ED000F10D71 /* StatusBarPopoverController.m in Sources */ = {isa = PBXBuildFile; fileRef = CD3307DF20375ED000F10D71 /* StatusBarPopoverController.m */; };
|
||||
CD3307E22037648B00F10D71 /* StatusBarPopover.xib in Resources */ = {isa = PBXBuildFile; fileRef = CD3307E12037648B00F10D71 /* StatusBarPopover.xib */; };
|
||||
CD3307E420376B8300F10D71 /* popoverCloseAlt.png in Resources */ = {isa = PBXBuildFile; fileRef = CD3307E320376B8300F10D71 /* popoverCloseAlt.png */; };
|
||||
@@ -26,9 +29,6 @@
|
||||
CD3307E820376CCB00F10D71 /* dndIcon.png in Resources */ = {isa = PBXBuildFile; fileRef = CD3307E720376CCB00F10D71 /* dndIcon.png */; };
|
||||
CD981A8D2069049B001B875B /* statusIconDisabled.png in Resources */ = {isa = PBXBuildFile; fileRef = CD981A8B2069049A001B875B /* statusIconDisabled.png */; };
|
||||
CD981A8E2069049B001B875B /* statusIconDisabled@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = CD981A8C2069049A001B875B /* statusIconDisabled@2x.png */; };
|
||||
CDD8075D2134E0930046594E /* Sentry.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = CDD8075C2134E0930046594E /* Sentry.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
CDFA0888213685370089758C /* XPCUser.m in Sources */ = {isa = PBXBuildFile; fileRef = CDFA0887213685370089758C /* XPCUser.m */; };
|
||||
CDFA08AA213B3ECA0089758C /* Camera.m in Sources */ = {isa = PBXBuildFile; fileRef = CDFA08A9213B3ECA0089758C /* Camera.m */; };
|
||||
CDFB7888206E2F3400ABDD04 /* statusIconWhite.png in Resources */ = {isa = PBXBuildFile; fileRef = CDFB7884206E2F3400ABDD04 /* statusIconWhite.png */; };
|
||||
CDFB7889206E2F3400ABDD04 /* statusIconDisabledWhite.png in Resources */ = {isa = PBXBuildFile; fileRef = CDFB7885206E2F3400ABDD04 /* statusIconDisabledWhite.png */; };
|
||||
CDFB788A206E2F3400ABDD04 /* statusIconDisabledWhite@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = CDFB7886206E2F3400ABDD04 /* statusIconDisabledWhite@2x.png */; };
|
||||
@@ -37,20 +37,6 @@
|
||||
CE968A9D1FCC590200AD6B78 /* statusIcon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = CE968A9B1FCC590200AD6B78 /* statusIcon@2x.png */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
CDD8075B2134E0670046594E /* Copy Frameworks */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = "";
|
||||
dstSubfolderSpec = 10;
|
||||
files = (
|
||||
CDD8075D2134E0930046594E /* Sentry.framework in Copy Frameworks */,
|
||||
);
|
||||
name = "Copy Frameworks";
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
7D16D68F1F64E43300DB3161 /* Update.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Update.h; path = ../shared/Update.h; sourceTree = "<group>"; };
|
||||
7D16D6901F64E43300DB3161 /* Update.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Update.m; path = ../shared/Update.m; sourceTree = "<group>"; };
|
||||
@@ -60,6 +46,7 @@
|
||||
7D3B74FD1F13354900568828 /* StatusBarMenu.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = StatusBarMenu.m; sourceTree = "<group>"; };
|
||||
7D3B74FF1F13354900568828 /* StatusBarMenu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StatusBarMenu.h; sourceTree = "<group>"; };
|
||||
7D3B75021F13354900568828 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = MainMenu.xib; sourceTree = "<group>"; };
|
||||
7D3B75211F13357D00568828 /* UserCommsInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UserCommsInterface.h; path = ../shared/UserCommsInterface.h; sourceTree = "<group>"; };
|
||||
7D3B75221F13357D00568828 /* Consts.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Consts.h; path = ../shared/Consts.h; sourceTree = "<group>"; };
|
||||
7D3B75231F13357D00568828 /* Logging.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Logging.m; path = ../shared/Logging.m; sourceTree = "<group>"; };
|
||||
7D3B75241F13357D00568828 /* Logging.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Logging.h; path = ../shared/Logging.h; sourceTree = "<group>"; };
|
||||
@@ -74,8 +61,11 @@
|
||||
7DD25FEF1F23B73C00277EC4 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||
7DD260111F25307B00277EC4 /* HyperlinkTextField.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HyperlinkTextField.h; path = loginItem/3rdParty/HyperlinkTextField.h; sourceTree = "<group>"; };
|
||||
7DD260121F25307B00277EC4 /* HyperlinkTextField.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = HyperlinkTextField.m; path = loginItem/3rdParty/HyperlinkTextField.m; sourceTree = "<group>"; };
|
||||
7DD2BF781F1EAC9C00B33214 /* XPCDaemonClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = XPCDaemonClient.h; path = ../shared/XPCDaemonClient.h; sourceTree = "<group>"; };
|
||||
7DD2BF791F1EAC9C00B33214 /* XPCDaemonClient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = XPCDaemonClient.m; path = ../shared/XPCDaemonClient.m; sourceTree = "<group>"; };
|
||||
7DD2BF6C1F1DDF1F00B33214 /* AlertMonitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AlertMonitor.h; sourceTree = "<group>"; };
|
||||
7DD2BF6D1F1DDF1F00B33214 /* AlertMonitor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AlertMonitor.m; sourceTree = "<group>"; };
|
||||
7DD2BF781F1EAC9C00B33214 /* DaemonComms.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DaemonComms.h; path = ../shared/DaemonComms.h; sourceTree = "<group>"; };
|
||||
7DD2BF791F1EAC9C00B33214 /* DaemonComms.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = DaemonComms.m; path = ../shared/DaemonComms.m; sourceTree = "<group>"; };
|
||||
CD20A0D620579AFD0044BCC5 /* Sentry.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Sentry.framework; path = ../Carthage/Build/Mac/Sentry.framework; sourceTree = "<group>"; };
|
||||
CD3307DE20375ECF00F10D71 /* StatusBarPopoverController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StatusBarPopoverController.h; sourceTree = "<group>"; };
|
||||
CD3307DF20375ED000F10D71 /* StatusBarPopoverController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = StatusBarPopoverController.m; sourceTree = "<group>"; };
|
||||
CD3307E12037648B00F10D71 /* StatusBarPopover.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = StatusBarPopover.xib; sourceTree = "<group>"; };
|
||||
@@ -84,14 +74,6 @@
|
||||
CD3307E720376CCB00F10D71 /* dndIcon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = dndIcon.png; path = ../shared/images/dndIcon.png; sourceTree = "<group>"; };
|
||||
CD981A8B2069049A001B875B /* statusIconDisabled.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = statusIconDisabled.png; sourceTree = "<group>"; };
|
||||
CD981A8C2069049A001B875B /* statusIconDisabled@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "statusIconDisabled@2x.png"; sourceTree = "<group>"; };
|
||||
CDD8075C2134E0930046594E /* Sentry.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Sentry.framework; path = ../Carthage/Build/Mac/Sentry.framework; sourceTree = "<group>"; };
|
||||
CDFA088121367C690089758C /* XPC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = XPC.h; path = ../shared/XPC.h; sourceTree = "<group>"; };
|
||||
CDFA088221367F980089758C /* XPCUserProto.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = XPCUserProto.h; path = ../shared/XPCUserProto.h; sourceTree = "<group>"; };
|
||||
CDFA088321367F980089758C /* XPCDaemonProto.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = XPCDaemonProto.h; path = ../shared/XPCDaemonProto.h; sourceTree = "<group>"; };
|
||||
CDFA0886213685370089758C /* XPCUser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPCUser.h; sourceTree = "<group>"; };
|
||||
CDFA0887213685370089758C /* XPCUser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XPCUser.m; sourceTree = "<group>"; };
|
||||
CDFA08A8213B3ECA0089758C /* Camera.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Camera.h; sourceTree = "<group>"; };
|
||||
CDFA08A9213B3ECA0089758C /* Camera.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Camera.m; sourceTree = "<group>"; };
|
||||
CDFB7884206E2F3400ABDD04 /* statusIconWhite.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = statusIconWhite.png; sourceTree = "<group>"; };
|
||||
CDFB7885206E2F3400ABDD04 /* statusIconDisabledWhite.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = statusIconDisabledWhite.png; sourceTree = "<group>"; };
|
||||
CDFB7886206E2F3400ABDD04 /* statusIconDisabledWhite@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "statusIconDisabledWhite@2x.png"; sourceTree = "<group>"; };
|
||||
@@ -100,6 +82,17 @@
|
||||
CE968A9B1FCC590200AD6B78 /* statusIcon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "statusIcon@2x.png"; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
7D7755E01F02E05B00D0017D /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
CD20A0D720579AFD0044BCC5 /* Sentry.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
7D3B75001F13354900568828 /* Base.lproj */ = {
|
||||
isa = PBXGroup;
|
||||
@@ -129,10 +122,7 @@
|
||||
7D3B75201F13356900568828 /* shared */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
CDFA088321367F980089758C /* XPCDaemonProto.h */,
|
||||
CDFA088221367F980089758C /* XPCUserProto.h */,
|
||||
CD3307E720376CCB00F10D71 /* dndIcon.png */,
|
||||
CDFA088121367C690089758C /* XPC.h */,
|
||||
7D16D68F1F64E43300DB3161 /* Update.h */,
|
||||
7D16D6901F64E43300DB3161 /* Update.m */,
|
||||
7D16D6911F64E43300DB3161 /* UpdateWindow.xib */,
|
||||
@@ -140,8 +130,9 @@
|
||||
7D16D6931F64E43300DB3161 /* UpdateWindowController.m */,
|
||||
7D5C5F501F200B9200C0E94A /* Utilities.h */,
|
||||
7D5C5F511F200B9200C0E94A /* Utilities.m */,
|
||||
7DD2BF781F1EAC9C00B33214 /* XPCDaemonClient.h */,
|
||||
7DD2BF791F1EAC9C00B33214 /* XPCDaemonClient.m */,
|
||||
7DD2BF781F1EAC9C00B33214 /* DaemonComms.h */,
|
||||
7DD2BF791F1EAC9C00B33214 /* DaemonComms.m */,
|
||||
7D3B75211F13357D00568828 /* UserCommsInterface.h */,
|
||||
7D3B75221F13357D00568828 /* Consts.h */,
|
||||
7D3B75231F13357D00568828 /* Logging.m */,
|
||||
7D3B75241F13357D00568828 /* Logging.h */,
|
||||
@@ -171,8 +162,8 @@
|
||||
7D7755E51F02E05B00D0017D /* src */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
CDFA0886213685370089758C /* XPCUser.h */,
|
||||
CDFA0887213685370089758C /* XPCUser.m */,
|
||||
7DD2BF6C1F1DDF1F00B33214 /* AlertMonitor.h */,
|
||||
7DD2BF6D1F1DDF1F00B33214 /* AlertMonitor.m */,
|
||||
7D7755E61F02E05B00D0017D /* AppDelegate.h */,
|
||||
7D7755E71F02E05B00D0017D /* AppDelegate.m */,
|
||||
7D3B74FF1F13354900568828 /* StatusBarMenu.h */,
|
||||
@@ -186,8 +177,6 @@
|
||||
7D7755EE1F02E05B00D0017D /* MainMenu.xib */,
|
||||
7D7755F11F02E05B00D0017D /* Info.plist */,
|
||||
7D7755E91F02E05B00D0017D /* Supporting Files */,
|
||||
CDFA08A8213B3ECA0089758C /* Camera.h */,
|
||||
CDFA08A9213B3ECA0089758C /* Camera.m */,
|
||||
);
|
||||
name = src;
|
||||
path = loginItem;
|
||||
@@ -213,7 +202,7 @@
|
||||
CD20A0D520579AE50044BCC5 /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
CDD8075C2134E0930046594E /* Sentry.framework */,
|
||||
CD20A0D620579AFD0044BCC5 /* Sentry.framework */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
@@ -226,8 +215,8 @@
|
||||
buildConfigurationList = 7D7755F41F02E05B00D0017D /* Build configuration list for PBXNativeTarget "loginItem" */;
|
||||
buildPhases = (
|
||||
7D7755DF1F02E05B00D0017D /* Sources */,
|
||||
7D7755E01F02E05B00D0017D /* Frameworks */,
|
||||
7D7755E11F02E05B00D0017D /* Resources */,
|
||||
CDD8075B2134E0670046594E /* Copy Frameworks */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
@@ -244,7 +233,7 @@
|
||||
7D7755DB1F02E05B00D0017D /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 1000;
|
||||
LastUpgradeCheck = 0930;
|
||||
ORGANIZATIONNAME = "Objective-See";
|
||||
TargetAttributes = {
|
||||
7D7755E21F02E05B00D0017D = {
|
||||
@@ -252,7 +241,7 @@
|
||||
ProvisioningStyle = Manual;
|
||||
SystemCapabilities = {
|
||||
com.apple.ApplicationGroups.Mac = {
|
||||
enabled = 0;
|
||||
enabled = 1;
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -291,6 +280,7 @@
|
||||
CDFB788B206E2F3400ABDD04 /* statusIconWhite@2x.png in Resources */,
|
||||
CDFB7889206E2F3400ABDD04 /* statusIconDisabledWhite.png in Resources */,
|
||||
CDFB788A206E2F3400ABDD04 /* statusIconDisabledWhite@2x.png in Resources */,
|
||||
7D3B75151F13354900568828 /* MainMenu.xib in Resources */,
|
||||
CD3307E22037648B00F10D71 /* StatusBarPopover.xib in Resources */,
|
||||
CD981A8D2069049B001B875B /* statusIconDisabled.png in Resources */,
|
||||
CD981A8E2069049B001B875B /* statusIconDisabled@2x.png in Resources */,
|
||||
@@ -310,13 +300,12 @@
|
||||
7D3B75141F13354900568828 /* StatusBarMenu.m in Sources */,
|
||||
7D7755EB1F02E05B00D0017D /* main.m in Sources */,
|
||||
7DD260131F25307B00277EC4 /* HyperlinkTextField.m in Sources */,
|
||||
CDFA08AA213B3ECA0089758C /* Camera.m in Sources */,
|
||||
7D3B75251F13357D00568828 /* Logging.m in Sources */,
|
||||
7D5C5F521F200B9200C0E94A /* Utilities.m in Sources */,
|
||||
CD3307E020375ED000F10D71 /* StatusBarPopoverController.m in Sources */,
|
||||
7D7755E81F02E05B00D0017D /* AppDelegate.m in Sources */,
|
||||
7DD2BF7A1F1EAC9C00B33214 /* XPCDaemonClient.m in Sources */,
|
||||
CDFA0888213685370089758C /* XPCUser.m in Sources */,
|
||||
7DD2BF6E1F1DDF1F00B33214 /* AlertMonitor.m in Sources */,
|
||||
7DD2BF7A1F1EAC9C00B33214 /* DaemonComms.m in Sources */,
|
||||
7D16D6941F64E43300DB3161 /* Update.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
@@ -372,7 +361,7 @@
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
CODE_SIGN_IDENTITY = "Mac Developer";
|
||||
CODE_SIGN_IDENTITY = "Developer ID Application: Objective-See, LLC (VBG97UB4TA)";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
@@ -427,7 +416,7 @@
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
CODE_SIGN_IDENTITY = "Mac Developer";
|
||||
CODE_SIGN_IDENTITY = "Developer ID Application: Objective-See, LLC (VBG97UB4TA)";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
@@ -450,7 +439,6 @@
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CODE_SIGN_ENTITLEMENTS = "";
|
||||
CODE_SIGN_IDENTITY = "Developer ID Application";
|
||||
CODE_SIGN_STYLE = Manual;
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
@@ -459,8 +447,7 @@
|
||||
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
|
||||
INFOPLIST_FILE = loginItem/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../../../../../Frameworks";
|
||||
OTHER_CFLAGS = "-DXPC_USER=1";
|
||||
OTHER_CODE_SIGN_FLAGS = "-o hard,kill,library";
|
||||
OTHER_CODE_SIGN_FLAGS = "";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.objective-see.dnd.helper";
|
||||
PRODUCT_NAME = "Do Not Disturb Helper";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
@@ -472,7 +459,6 @@
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CODE_SIGN_ENTITLEMENTS = "";
|
||||
CODE_SIGN_IDENTITY = "Developer ID Application";
|
||||
CODE_SIGN_STYLE = Manual;
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
@@ -481,8 +467,7 @@
|
||||
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
|
||||
INFOPLIST_FILE = loginItem/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../../../../../Frameworks";
|
||||
OTHER_CFLAGS = "-DXPC_USER=1";
|
||||
OTHER_CODE_SIGN_FLAGS = "-o hard,kill,library";
|
||||
OTHER_CODE_SIGN_FLAGS = "-o hard,kill";
|
||||
OTHER_LDFLAGS = "";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.objective-see.dnd.helper";
|
||||
PRODUCT_NAME = "Do Not Disturb Helper";
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
//
|
||||
// file: AlertMonitor.h
|
||||
// project: DND (login item)
|
||||
// description: monitor for alerts from daemon (header)
|
||||
//
|
||||
// created by Patrick Wardle
|
||||
// copyright (c) 2018 Objective-See. All rights reserved.
|
||||
//
|
||||
|
||||
@import Foundation;
|
||||
|
||||
@interface AlertMonitor : NSObject <NSUserNotificationCenterDelegate>
|
||||
|
||||
/* PROPERTIES */
|
||||
@property(nonatomic, retain)NSDate* lastAlert;
|
||||
|
||||
/* METHODS */
|
||||
|
||||
//forever,
|
||||
// wait for & display alerts
|
||||
-(void)monitor;
|
||||
|
||||
//forever
|
||||
// wait for dismiss XPC msg from dameon
|
||||
// note: currently, will dismiss all alerts...
|
||||
-(void)dismissAlerts;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,226 @@
|
||||
//
|
||||
// file: AlertMonitor.m
|
||||
// project: DND (login item)
|
||||
// description: monitor for alerts from daemom
|
||||
//
|
||||
// created by Patrick Wardle
|
||||
// copyright (c) 2018 Objective-See. All rights reserved.
|
||||
//
|
||||
|
||||
#import "Consts.h"
|
||||
#import "Logging.h"
|
||||
#import "AppDelegate.h"
|
||||
#import "DaemonComms.h"
|
||||
#import "AlertMonitor.h"
|
||||
|
||||
@implementation AlertMonitor
|
||||
|
||||
@synthesize lastAlert;
|
||||
|
||||
//forever,
|
||||
// receive & display alerts
|
||||
-(void)monitor
|
||||
{
|
||||
//daemon comms object
|
||||
DaemonComms* daemonComms = nil;
|
||||
|
||||
//wait semaphore
|
||||
dispatch_semaphore_t semaphore = 0;
|
||||
|
||||
//init daemon
|
||||
// use local var here, as we need to block
|
||||
daemonComms = [[DaemonComms alloc] init];
|
||||
|
||||
//init sema
|
||||
semaphore = dispatch_semaphore_create(0);
|
||||
|
||||
//process alerts
|
||||
// call daemon and block, then display, and repeat!
|
||||
while(YES)
|
||||
{
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, @"requesting alert(s) from daemon, will block");
|
||||
|
||||
//wait for alert from daemon via XPC
|
||||
[daemonComms alertRequest:^(NSDictionary* alert)
|
||||
{
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, [NSString stringWithFormat:@"got alert from daemon: %@", alert]);
|
||||
|
||||
//tell daemon we got it
|
||||
// allows it to be discarded from queue
|
||||
[daemonComms alertResponse];
|
||||
|
||||
//signal alert
|
||||
// indicates it was processed
|
||||
dispatch_semaphore_signal(semaphore);
|
||||
|
||||
//ignore if it's same/same
|
||||
// sometimes lid open/awake cause weird stuff with XPC resume, so multiple deliveries
|
||||
if(YES == [self.lastAlert isEqualToDate:alert[ALERT_TIMESTAMP]])
|
||||
{
|
||||
//ignore
|
||||
// will just exit block
|
||||
return;
|
||||
}
|
||||
|
||||
//update
|
||||
self.lastAlert = alert[ALERT_TIMESTAMP];
|
||||
|
||||
//show alert on main thread
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
|
||||
//show notification
|
||||
[self showNotification:alert];
|
||||
|
||||
});
|
||||
|
||||
}];
|
||||
|
||||
//wait for alert to be received
|
||||
dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER);
|
||||
|
||||
}//forevers
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//forever
|
||||
// wait for alert dismiss XPC msg from dameon
|
||||
// note: currently, will dismiss all alerts shown...
|
||||
-(void)dismissAlerts
|
||||
{
|
||||
//daemon comms object
|
||||
DaemonComms* daemonComms = nil;
|
||||
|
||||
//wait semaphore
|
||||
dispatch_semaphore_t semaphore = 0;
|
||||
|
||||
//init daemon
|
||||
// use local var here, as we need to block
|
||||
daemonComms = [[DaemonComms alloc] init];
|
||||
|
||||
//init sema
|
||||
semaphore = dispatch_semaphore_create(0);
|
||||
|
||||
//dimisss alerts
|
||||
// call daemon and block, then dismiss/repeat
|
||||
while(YES)
|
||||
{
|
||||
//pool
|
||||
@autoreleasepool
|
||||
{
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, @"requesting alert dismiss message(s) from daemon, will block");
|
||||
|
||||
//wait for alert dismiss from daemon via XPC
|
||||
// for now, will just dimiss all (shown) alerts
|
||||
[daemonComms alertDismiss:^(NSDictionary* alert)
|
||||
{
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, @"got 'alert dismiss' message from daemon");
|
||||
|
||||
//dismiss alerts on main thread
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
|
||||
//show notification
|
||||
[[NSUserNotificationCenter defaultUserNotificationCenter] removeAllDeliveredNotifications];
|
||||
|
||||
//set app delegate's touch bar to nil
|
||||
// will hide/unset the touch bar alert....
|
||||
((AppDelegate*)[[NSApplication sharedApplication] delegate]).touchBar = nil;
|
||||
|
||||
});
|
||||
|
||||
//signal alert
|
||||
// indicates it was processed
|
||||
dispatch_semaphore_signal(semaphore);
|
||||
|
||||
}];
|
||||
|
||||
//wait for alert dismiss msg to be received
|
||||
dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER);
|
||||
|
||||
}//pool
|
||||
|
||||
}//forevers
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//format, then show notification
|
||||
// both on screen and on touch bar
|
||||
-(void)showNotification:(NSDictionary*)alert
|
||||
{
|
||||
//notification
|
||||
NSUserNotification* notification = nil;
|
||||
|
||||
//formatter
|
||||
NSDateFormatter* dateFormat = nil;
|
||||
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, @"displaying alert to user...");
|
||||
|
||||
//alloc notification
|
||||
notification = [[NSUserNotification alloc] init];
|
||||
|
||||
//alloc formatter
|
||||
dateFormat = [[NSDateFormatter alloc] init];
|
||||
|
||||
//set date format
|
||||
[dateFormat setDateFormat:@"MM/dd/yyyy HH:mm:ss"];
|
||||
|
||||
//set other button title
|
||||
notification.otherButtonTitle = @"Dismiss";
|
||||
|
||||
//remove action button
|
||||
notification.hasActionButton = NO;
|
||||
|
||||
//set title
|
||||
notification.title = @"⚠️ Do Not Disturb Alert";
|
||||
|
||||
//set subtitle
|
||||
// based on trigger type (lid, usb, etc.)
|
||||
switch([alert[ALERT_TYPE] integerValue])
|
||||
{
|
||||
//lid
|
||||
case LID_TRIGGER:
|
||||
notification.subtitle = [NSString stringWithFormat:@"Lid Opened: %@", [dateFormat stringFromDate:alert[ALERT_TIMESTAMP]]];
|
||||
break;
|
||||
|
||||
//device
|
||||
case DEVICE_TRIGGER:
|
||||
notification.subtitle = [NSString stringWithFormat:@"Device Inserted: %@", alert[ALERT_INFO][KEY_DEVICE_NAME]];
|
||||
break;
|
||||
|
||||
//power
|
||||
case POWER_TRIGGER:
|
||||
notification.subtitle = [NSString stringWithFormat:@"Power Event: %@", alert[ALERT_INFO][KEY_POWER_TYPE]];
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//set delegate to self
|
||||
[[NSUserNotificationCenter defaultUserNotificationCenter] setDelegate:self];
|
||||
|
||||
//deliver notification
|
||||
[[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:notification];
|
||||
|
||||
//init/show touch bar
|
||||
[((AppDelegate*)[[NSApplication sharedApplication] delegate]) initTouchBar];
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//delegate method
|
||||
// always should alert to user
|
||||
-(BOOL)userNotificationCenter:(NSUserNotificationCenter *)center shouldPresentNotification:(NSUserNotification *)notification
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -8,10 +8,9 @@
|
||||
//
|
||||
|
||||
@import Cocoa;
|
||||
@import AVFoundation;
|
||||
|
||||
#import "DaemonComms.h"
|
||||
#import "StatusBarMenu.h"
|
||||
#import "XPCDaemonClient.h"
|
||||
#import "UpdateWindowController.h"
|
||||
|
||||
@interface AppDelegate : NSObject <NSApplicationDelegate, NSTouchBarProvider, NSTouchBarDelegate>
|
||||
@@ -31,7 +30,7 @@
|
||||
@property(nonatomic, retain)UpdateWindowController* updateWindowController;
|
||||
|
||||
//daemon comms
|
||||
@property(nonatomic, retain)XPCDaemonClient* daemonComms;
|
||||
@property(nonatomic, retain)DaemonComms* daemonComms;
|
||||
|
||||
//observer
|
||||
@property(nonatomic, retain)NSObject* appObserver;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#import "Logging.h"
|
||||
#import "Utilities.h"
|
||||
#import "AppDelegate.h"
|
||||
#import "XPCDaemonClient.h"
|
||||
#import "AlertMonitor.h"
|
||||
|
||||
@interface AppDelegate ()
|
||||
|
||||
@@ -38,14 +38,14 @@
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, @"starting DND login item");
|
||||
|
||||
//init deamon client
|
||||
daemonComms = [[XPCDaemonClient alloc] init];
|
||||
|
||||
//init deamon comms
|
||||
daemonComms = [[DaemonComms alloc] init];
|
||||
|
||||
//get preferences
|
||||
// sends XPC message to daemon
|
||||
preferences = [self.daemonComms getPreferences:nil];
|
||||
|
||||
//no preferences yet? ... first run on full (re)install
|
||||
//no preferences yet? ... first run
|
||||
// a) set some defaults for login item (passive mode, etc)
|
||||
// b) wait for main app to exit before checking in with daemon
|
||||
if(0 == preferences.count)
|
||||
@@ -70,44 +70,39 @@
|
||||
// wait until it's exited to complete initializations
|
||||
self.appObserver = [[[NSWorkspace sharedWorkspace] notificationCenter] addObserverForName:NSWorkspaceDidTerminateApplicationNotification object:nil queue:nil usingBlock:^(NSNotification *notification)
|
||||
{
|
||||
//ignore others
|
||||
if(YES != [MAIN_APP_ID isEqualToString:[((NSRunningApplication*)notification.userInfo[NSWorkspaceApplicationKey]) bundleIdentifier]])
|
||||
{
|
||||
//ignore
|
||||
return;
|
||||
}
|
||||
//ignore others
|
||||
if(YES != [MAIN_APP_ID isEqualToString:[((NSRunningApplication*)notification.userInfo[NSWorkspaceApplicationKey]) bundleIdentifier]])
|
||||
{
|
||||
//ignore
|
||||
return;
|
||||
}
|
||||
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, @"main application completed");
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, @"main application completed");
|
||||
|
||||
//remove observer
|
||||
[[[NSWorkspace sharedWorkspace] notificationCenter] removeObserver:self.appObserver];
|
||||
//remove observer
|
||||
[[[NSWorkspace sharedWorkspace] notificationCenter] removeObserver:self.appObserver];
|
||||
|
||||
//unset
|
||||
self.appObserver = nil;
|
||||
|
||||
//unset
|
||||
self.appObserver = nil;
|
||||
|
||||
//(re)load prefs
|
||||
// main app should have set em all now
|
||||
preferences = [self.daemonComms getPreferences:nil];
|
||||
|
||||
//complete initializations
|
||||
// will show popover, etc
|
||||
[self completeInitialization:preferences firstTime:YES];
|
||||
|
||||
}]; //main app (welcome screen) exited
|
||||
|
||||
//complete initializations
|
||||
[self completeInitialization:preferences firstTime:YES];
|
||||
}];
|
||||
}
|
||||
|
||||
//found prefs
|
||||
// main app already ran, so just complete init's
|
||||
else
|
||||
{
|
||||
//might be an upgrade so ask for camera permissions
|
||||
requestCameraAccess();
|
||||
|
||||
//complete initializations
|
||||
[self completeInitialization:preferences firstTime:NO];
|
||||
}
|
||||
|
||||
|
||||
bail:
|
||||
|
||||
return;
|
||||
@@ -117,6 +112,9 @@ bail:
|
||||
// based on prefs, show status bar, check for updates, etc...
|
||||
-(void)completeInitialization:(NSDictionary*)preferences firstTime:(BOOL)firstTime
|
||||
{
|
||||
//alert monitor obj
|
||||
__block AlertMonitor* alertMonitor = nil;
|
||||
|
||||
//run with status bar icon?
|
||||
if(YES != [preferences[PREF_NO_ICON_MODE] boolValue])
|
||||
{
|
||||
@@ -149,6 +147,33 @@ bail:
|
||||
});
|
||||
}
|
||||
|
||||
//wait to checkin
|
||||
// first time, need a bit to show the popover
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, firstTime * 5 * NSEC_PER_SEC), dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^
|
||||
{
|
||||
//init alert monitor
|
||||
alertMonitor = [[AlertMonitor alloc] init];
|
||||
|
||||
//in background
|
||||
// monitor / process alerts from daemon
|
||||
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
||||
|
||||
//monitor
|
||||
[alertMonitor monitor];
|
||||
|
||||
});
|
||||
|
||||
//in background
|
||||
// wait for alert dimiss msgs from daemon
|
||||
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
||||
|
||||
//monitor
|
||||
[alertMonitor dismissAlerts];
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -213,7 +238,7 @@ bail:
|
||||
touchBarItem = [[NSCustomTouchBarItem alloc] initWithIdentifier:identifier];
|
||||
|
||||
//icon
|
||||
if(YES == [identifier isEqualToString:@".icon"])
|
||||
if(YES == [identifier isEqualToString: @".icon" ])
|
||||
{
|
||||
//init icon view
|
||||
iconView = [[NSImageView alloc] initWithFrame:NSMakeRect(0, 0, 30.0, 30.0)];
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
//
|
||||
// Camera.h
|
||||
// loginItem
|
||||
//
|
||||
// Created by Patrick Wardle on 9/1/18.
|
||||
// Copyright © 2018 Objective-See. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <AVFoundation/AVFoundation.h>
|
||||
|
||||
@interface Camera : NSObject
|
||||
|
||||
/* PROPERTIES */
|
||||
|
||||
//av session
|
||||
@property(nonatomic, retain)AVCaptureSession* session;
|
||||
|
||||
/* METHODS */
|
||||
|
||||
//capture an image from the webcam
|
||||
-(NSData*)captureImage;
|
||||
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@@ -1,184 +0,0 @@
|
||||
//
|
||||
// Camera.m
|
||||
// loginItem
|
||||
//
|
||||
// Created by Patrick Wardle on 9/1/18.
|
||||
// Copyright © 2018 Objective-See. All rights reserved.
|
||||
//
|
||||
|
||||
#import "Camera.h"
|
||||
#import "Logging.h"
|
||||
|
||||
|
||||
|
||||
@implementation Camera
|
||||
|
||||
@synthesize session;
|
||||
|
||||
//configure
|
||||
-(BOOL)configure
|
||||
{
|
||||
//flag
|
||||
BOOL configured = NO;
|
||||
|
||||
//device
|
||||
AVCaptureDevice* device = nil;
|
||||
|
||||
//input
|
||||
AVCaptureInput* input = nil;
|
||||
|
||||
//output
|
||||
AVCaptureStillImageOutput* output = nil;
|
||||
|
||||
//find default camera
|
||||
device = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo];
|
||||
if(nil == device)
|
||||
{
|
||||
//err msg
|
||||
logMsg(LOG_ERR, @"failed to find camera for capture");
|
||||
|
||||
//bail
|
||||
goto bail;
|
||||
}
|
||||
|
||||
//init input from camera
|
||||
input = [AVCaptureDeviceInput deviceInputWithDevice:device error:nil];
|
||||
if(nil == input)
|
||||
{
|
||||
//err msg
|
||||
logMsg(LOG_ERR, @"failed to find input from camera");
|
||||
|
||||
//bail
|
||||
goto bail;
|
||||
}
|
||||
|
||||
//init session
|
||||
self.session = [[AVCaptureSession alloc] init];
|
||||
|
||||
//check if input can be added to session
|
||||
if(YES != [self.session canAddInput:input])
|
||||
{
|
||||
//err msg
|
||||
logMsg(LOG_ERR, @"cannot add input to session");
|
||||
|
||||
//bail
|
||||
goto bail;
|
||||
}
|
||||
|
||||
//add input
|
||||
[self.session addInput:input];
|
||||
|
||||
//init output
|
||||
output = [[AVCaptureStillImageOutput alloc] init];
|
||||
|
||||
//set output settings (jpeg)
|
||||
output.outputSettings = @{AVVideoCodecKey:AVVideoCodecJPEG};
|
||||
|
||||
//check if output can be added to session
|
||||
if(YES != [self.session canAddOutput:output])
|
||||
{
|
||||
//err msg
|
||||
logMsg(LOG_ERR, @"cannot add output to session");
|
||||
|
||||
//bail
|
||||
goto bail;
|
||||
}
|
||||
|
||||
//add output
|
||||
[self.session addOutput:output];
|
||||
|
||||
//happy
|
||||
configured = YES;
|
||||
|
||||
bail:
|
||||
|
||||
return configured;
|
||||
}
|
||||
|
||||
//capture an image from the webcam
|
||||
-(NSData*)captureImage
|
||||
{
|
||||
//image
|
||||
__block NSData* image = nil;
|
||||
|
||||
//output
|
||||
__block AVCaptureStillImageOutput* output = nil;
|
||||
|
||||
//wait semaphore
|
||||
dispatch_semaphore_t semaphore = 0;
|
||||
|
||||
//init sema
|
||||
semaphore = dispatch_semaphore_create(0);
|
||||
|
||||
//configure/init session
|
||||
if(YES == [self configure])
|
||||
{
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, @"configured camera for capture");
|
||||
|
||||
//start
|
||||
[self.session startRunning];
|
||||
|
||||
//give session some time to start
|
||||
// could use KVO, etc, but this seems like a pain
|
||||
// see: https://stackoverflow.com/questions/27260697/avcapturedevice-adjustingexposure-is-false-but-captured-image-is-dark
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 1 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
|
||||
|
||||
//grab output
|
||||
output = self.session.outputs.firstObject;
|
||||
|
||||
//capture image
|
||||
[output captureStillImageAsynchronouslyFromConnection:[output connectionWithMediaType:AVMediaTypeVideo] completionHandler:^(CMSampleBufferRef imageDataSampleBuffer, NSError *error)
|
||||
{
|
||||
//covert image
|
||||
if( (nil == error) &&
|
||||
(NULL != imageDataSampleBuffer))
|
||||
{
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, @"captured image");
|
||||
|
||||
//covert
|
||||
image = [AVCaptureStillImageOutput jpegStillImageNSDataRepresentation:imageDataSampleBuffer];
|
||||
}
|
||||
|
||||
//error
|
||||
else
|
||||
{
|
||||
//err msg
|
||||
logMsg(LOG_ERR, [NSString stringWithFormat:@"failed to capture image (%@)", error]);
|
||||
}
|
||||
|
||||
//(always) signal sema
|
||||
dispatch_semaphore_signal(semaphore);
|
||||
|
||||
}];
|
||||
|
||||
});
|
||||
|
||||
//wait for install to be completed by XPC
|
||||
dispatch_semaphore_wait(semaphore, DISPATCH_TIME_FOREVER);
|
||||
|
||||
//stop session
|
||||
if(YES == self.session.isRunning)
|
||||
{
|
||||
//stop
|
||||
[self.session stopRunning];
|
||||
}
|
||||
}
|
||||
|
||||
//failed to init session
|
||||
else
|
||||
{
|
||||
//err msg
|
||||
logMsg(LOG_ERR, @"failed to initialize/configure camera capture session");
|
||||
|
||||
//bail
|
||||
goto bail;
|
||||
}
|
||||
|
||||
bail:
|
||||
|
||||
return image;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -17,11 +17,11 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.3.0</string>
|
||||
<string>1.2.2</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.3.0</string>
|
||||
<string>1.2.2</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
|
||||
<key>LSUIElement</key>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
@import Cocoa;
|
||||
|
||||
#import "XPCDaemonClient.h"
|
||||
#import "DaemonComms.h"
|
||||
|
||||
@interface StatusBarMenu : NSObject <NSPopoverDelegate>
|
||||
{
|
||||
@@ -23,7 +23,7 @@
|
||||
@property (retain, nonatomic)NSPopover *popover;
|
||||
|
||||
//daemom comms object
|
||||
@property (nonatomic, retain)XPCDaemonClient* daemonComms;
|
||||
@property (nonatomic, retain)DaemonComms* daemonComms;
|
||||
|
||||
//disabled flag
|
||||
@property BOOL isDisabled;
|
||||
|
||||
@@ -11,8 +11,9 @@
|
||||
#import "Logging.h"
|
||||
#import "Utilities.h"
|
||||
#import "AppDelegate.h"
|
||||
#import "DaemonComms.h"
|
||||
#import "StatusBarMenu.h"
|
||||
#import "XPCDaemonClient.h"
|
||||
#import "UserCommsInterface.h"
|
||||
#import "StatusBarPopoverController.h"
|
||||
|
||||
//menu items
|
||||
@@ -43,7 +44,7 @@ enum menuItems
|
||||
if(self != nil)
|
||||
{
|
||||
//init daemon comms
|
||||
daemonComms = [[XPCDaemonClient alloc] init];
|
||||
daemonComms = [[DaemonComms alloc] init];
|
||||
|
||||
//init status item
|
||||
statusItem = [[NSStatusBar systemStatusBar] statusItemWithLength:NSSquareStatusItemLength];
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
//
|
||||
// file: XPCUser.h
|
||||
// project: DND (login item)
|
||||
// description: user XPC methods (header)
|
||||
//
|
||||
// created by Patrick Wardle
|
||||
// copyright (c) 2018 Objective-See. All rights reserved.
|
||||
//
|
||||
|
||||
@import Foundation;
|
||||
#import <dnd/dnd-Swift.h>
|
||||
|
||||
#import "XPCUserProto.h"
|
||||
|
||||
@interface XPCUser : NSObject <XPCUserProtocol, NSUserNotificationCenterDelegate>
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -1,121 +0,0 @@
|
||||
//
|
||||
// file: XPCUser.m
|
||||
// project: DND (login item)
|
||||
// description: user XPC methods
|
||||
//
|
||||
// created by Patrick Wardle
|
||||
// copyright (c) 2018 Objective-See. All rights reserved.
|
||||
//
|
||||
|
||||
#import "Camera.h"
|
||||
#import "Consts.h"
|
||||
#import "Logging.h"
|
||||
#import "XPCUser.h"
|
||||
#import "AppDelegate.h"
|
||||
|
||||
@implementation XPCUser
|
||||
|
||||
//show an alert
|
||||
-(void)alertShow:(NSDictionary*)alert
|
||||
{
|
||||
//notification
|
||||
NSUserNotification* notification = nil;
|
||||
|
||||
//formatter
|
||||
NSDateFormatter* dateFormat = nil;
|
||||
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, @"XPC request from daemon: alert show");
|
||||
|
||||
//alloc notification
|
||||
notification = [[NSUserNotification alloc] init];
|
||||
|
||||
//alloc formatter
|
||||
dateFormat = [[NSDateFormatter alloc] init];
|
||||
|
||||
//set date format
|
||||
[dateFormat setDateFormat:@"MM/dd/yyyy HH:mm:ss"];
|
||||
|
||||
//set other button title
|
||||
notification.otherButtonTitle = @"Dismiss";
|
||||
|
||||
//remove action button
|
||||
notification.hasActionButton = NO;
|
||||
|
||||
//set title
|
||||
notification.title = @"⚠️ Do Not Disturb Alert";
|
||||
|
||||
//set subtitle
|
||||
notification.subtitle = [NSString stringWithFormat:@"Lid Opened: %@", [dateFormat stringFromDate:alert[ALERT_TIMESTAMP]]];
|
||||
|
||||
//set delegate to self
|
||||
[[NSUserNotificationCenter defaultUserNotificationCenter] setDelegate:self];
|
||||
|
||||
//show alert on main thread
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
|
||||
//deliver notification
|
||||
[[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:notification];
|
||||
|
||||
//init/show touch bar
|
||||
[((AppDelegate*)[[NSApplication sharedApplication] delegate]) initTouchBar];
|
||||
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//dismiss alert(s)
|
||||
-(void)alertDismiss
|
||||
{
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, @"XPC request from daemon: alert dismiss");
|
||||
|
||||
//dismiss alerts on main thread
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
|
||||
//clear (all) notification(s)
|
||||
[[NSUserNotificationCenter defaultUserNotificationCenter] removeAllDeliveredNotifications];
|
||||
|
||||
//set app delegate's touch bar to nil
|
||||
// will hide/unset the touch bar alert....
|
||||
((AppDelegate*)[[NSApplication sharedApplication] delegate]).touchBar = nil;
|
||||
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//XPC method
|
||||
// capture an image from the webcam
|
||||
-(void)captureImage:(void (^)(NSData *))reply
|
||||
{
|
||||
//image data
|
||||
NSData* image = nil;
|
||||
|
||||
//camera obj
|
||||
Camera* camera = nil;
|
||||
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, @"XPC request from daemon: capture picture");
|
||||
|
||||
//init camera
|
||||
camera = [[Camera alloc] init];
|
||||
|
||||
//grab image
|
||||
image = [camera captureImage];
|
||||
|
||||
//get current prefs
|
||||
reply(image);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//'NSUserNotificationCenterDelegate' delegate method
|
||||
// tell system to always present (show) the alert to user
|
||||
-(BOOL)userNotificationCenter:(NSUserNotificationCenter *)center shouldPresentNotification:(NSUserNotification *)notification
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -24,8 +24,11 @@ int main(int argc, const char * argv[])
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, [NSString stringWithFormat:@"STARTED: login item (args: %@)", [[NSProcessInfo processInfo] arguments]]);
|
||||
|
||||
//init crash reporting
|
||||
initCrashReporting();
|
||||
//init crash reporting client
|
||||
SentryClient.sharedClient = [[SentryClient alloc] initWithDsn:CRASH_REPORTING_URL didFailWithError:nil];
|
||||
|
||||
//start crash handler
|
||||
[SentryClient.sharedClient startCrashHandlerWithError:nil];
|
||||
|
||||
//already running?
|
||||
if(YES == isAppRunning([[NSBundle mainBundle] bundleIdentifier]))
|
||||
|
||||
@@ -8,13 +8,14 @@
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
7D16D69A1F65EF9900DB3161 /* Update.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D16D6991F65EF9900DB3161 /* Update.m */; };
|
||||
7D2582571F19FAD700D28B95 /* XPCDaemonClient.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D2582561F19FAD700D28B95 /* XPCDaemonClient.m */; };
|
||||
7D2582571F19FAD700D28B95 /* DaemonComms.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D2582561F19FAD700D28B95 /* DaemonComms.m */; };
|
||||
7D46FF041F5F496800FEB0F8 /* patrons.txt in Resources */ = {isa = PBXBuildFile; fileRef = 7D46FF031F5F496800FEB0F8 /* patrons.txt */; };
|
||||
7D564DAE1F18434F00B8AAD6 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D564DAD1F18434F00B8AAD6 /* AppDelegate.m */; };
|
||||
7D564DB11F18434F00B8AAD6 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D564DB01F18434F00B8AAD6 /* main.m */; };
|
||||
7D564DB61F18434F00B8AAD6 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7D564DB41F18434F00B8AAD6 /* MainMenu.xib */; };
|
||||
7D564DD61F18441500B8AAD6 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 7D564DBF1F18441500B8AAD6 /* Assets.xcassets */; };
|
||||
7D564DDA1F18441500B8AAD6 /* AboutWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D564DC31F18441500B8AAD6 /* AboutWindowController.m */; };
|
||||
7D564DDB1F18441500B8AAD6 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7D564DC51F18441500B8AAD6 /* MainMenu.xib */; };
|
||||
7D564DDC1F18441500B8AAD6 /* AboutWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7D564DC71F18441500B8AAD6 /* AboutWindow.xib */; };
|
||||
7D564DDF1F18441500B8AAD6 /* HyperlinkTextField.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D564DCE1F18441500B8AAD6 /* HyperlinkTextField.m */; };
|
||||
7D564DE61F18446200B8AAD6 /* Logging.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D564DE41F18446200B8AAD6 /* Logging.m */; };
|
||||
@@ -22,7 +23,6 @@
|
||||
7D564DEB1F1855E900B8AAD6 /* UpdateWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7D564DE81F1855E900B8AAD6 /* UpdateWindow.xib */; };
|
||||
7D75537F1F22E40E0010FE88 /* PrefsWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D75537D1F22E40E0010FE88 /* PrefsWindowController.m */; };
|
||||
7D7553801F22E40E0010FE88 /* Preferences.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7D75537E1F22E40E0010FE88 /* Preferences.xib */; };
|
||||
7D7553831F23199A0010FE88 /* prefsGeneral.png in Resources */ = {isa = PBXBuildFile; fileRef = 7D7553811F23199A0010FE88 /* prefsGeneral.png */; };
|
||||
7D7553841F23199A0010FE88 /* prefsUpdate.png in Resources */ = {isa = PBXBuildFile; fileRef = 7D7553821F23199A0010FE88 /* prefsUpdate.png */; };
|
||||
7DD2BF461F1C2B4200B33214 /* logo.png in Resources */ = {isa = PBXBuildFile; fileRef = 7DD2BF431F1C2B4200B33214 /* logo.png */; };
|
||||
7DD2BF471F1C2B4200B33214 /* logoBG.png in Resources */ = {isa = PBXBuildFile; fileRef = 7DD2BF441F1C2B4200B33214 /* logoBG.png */; };
|
||||
@@ -37,12 +37,14 @@
|
||||
CD17D58C201A7F8500F798D7 /* Welcome.xib in Resources */ = {isa = PBXBuildFile; fileRef = CD17D58A201A7F8500F798D7 /* Welcome.xib */; };
|
||||
CD17D58F201A827A00F798D7 /* QuickResponseCode.m in Sources */ = {isa = PBXBuildFile; fileRef = CD17D58E201A827A00F798D7 /* QuickResponseCode.m */; };
|
||||
CD1FD56B2089224F00151D1C /* appStore.pdf in Resources */ = {isa = PBXBuildFile; fileRef = CD1FD56A2089224E00151D1C /* appStore.pdf */; };
|
||||
CD20A0DA20579B290044BCC5 /* Sentry.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = CD20A0CD205797030044BCC5 /* Sentry.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
CD20A0CE205797030044BCC5 /* Sentry.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CD20A0CD205797030044BCC5 /* Sentry.framework */; };
|
||||
CD20A0DA20579B290044BCC5 /* Sentry.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = CD20A0CD205797030044BCC5 /* Sentry.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
CD2F407F204B417E0066673E /* alert.png in Resources */ = {isa = PBXBuildFile; fileRef = CD2F407E204B417E0066673E /* alert.png */; };
|
||||
CD2F4081204B41C90066673E /* hacker.png in Resources */ = {isa = PBXBuildFile; fileRef = CD2F4080204B41C90066673E /* hacker.png */; };
|
||||
CD325425204DEAEA0059951B /* dndText@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = CD325424204DEAEA0059951B /* dndText@2x.png */; };
|
||||
CD325427204E0C500059951B /* close.png in Resources */ = {isa = PBXBuildFile; fileRef = CD325426204E0C500059951B /* close.png */; };
|
||||
CD32542B204E0E420059951B /* closeAlt.png in Resources */ = {isa = PBXBuildFile; fileRef = CD32542A204E0E420059951B /* closeAlt.png */; };
|
||||
CD68AEE02110CD9E0019E431 /* prefsTriggers.png in Resources */ = {isa = PBXBuildFile; fileRef = CD68AEDF2110CD9D0019E431 /* prefsTriggers.png */; };
|
||||
CDAAC213201D0CD90032F2E6 /* three.png in Resources */ = {isa = PBXBuildFile; fileRef = CDAAC212201D0CD80032F2E6 /* three.png */; };
|
||||
CDAAC215201D2DD30032F2E6 /* checkbox.png in Resources */ = {isa = PBXBuildFile; fileRef = CDAAC214201D2DD30032F2E6 /* checkbox.png */; };
|
||||
CDAAC217201D54C30032F2E6 /* prefsLink.png in Resources */ = {isa = PBXBuildFile; fileRef = CDAAC216201D54C20032F2E6 /* prefsLink.png */; };
|
||||
@@ -50,6 +52,8 @@
|
||||
CDAAC21C201D77390032F2E6 /* connected.png in Resources */ = {isa = PBXBuildFile; fileRef = CDAAC21A201D77390032F2E6 /* connected.png */; };
|
||||
CDAAC21D201D77390032F2E6 /* unconnected.png in Resources */ = {isa = PBXBuildFile; fileRef = CDAAC21B201D77390032F2E6 /* unconnected.png */; };
|
||||
CDAAC238201FD4660032F2E6 /* LocalAuthentication.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CDAAC237201FD4660032F2E6 /* LocalAuthentication.framework */; };
|
||||
CDEADE52210214A0005054B0 /* usb.png in Resources */ = {isa = PBXBuildFile; fileRef = CDEADE502102149F005054B0 /* usb.png */; };
|
||||
CDEADE53210214A0005054B0 /* sleep.png in Resources */ = {isa = PBXBuildFile; fileRef = CDEADE51210214A0005054B0 /* sleep.png */; };
|
||||
CE0F559C1FD408BB00529259 /* dndText.png in Resources */ = {isa = PBXBuildFile; fileRef = CE0F559B1FD408BB00529259 /* dndText.png */; };
|
||||
CE133C5F1FD756CC00A29D67 /* dndIcon.png in Resources */ = {isa = PBXBuildFile; fileRef = CE133C5E1FD756CC00A29D67 /* dndIcon.png */; };
|
||||
CE85D3FE1FDB47B200E116A5 /* settings.png in Resources */ = {isa = PBXBuildFile; fileRef = CE85D3FD1FDB47B200E116A5 /* settings.png */; };
|
||||
@@ -57,15 +61,23 @@
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
CD20A0D920579B170044BCC5 /* Copy Frameworks */ = {
|
||||
7DD25FEE1F23B5AE00277EC4 /* CopyFiles */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = Contents/Library/LoginItems;
|
||||
dstSubfolderSpec = 1;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
CD20A0D920579B170044BCC5 /* CopyFiles */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = "";
|
||||
dstSubfolderSpec = 10;
|
||||
files = (
|
||||
CD20A0DA20579B290044BCC5 /* Sentry.framework in Copy Frameworks */,
|
||||
CD20A0DA20579B290044BCC5 /* Sentry.framework in CopyFiles */,
|
||||
);
|
||||
name = "Copy Frameworks";
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
@@ -73,9 +85,9 @@
|
||||
/* Begin PBXFileReference section */
|
||||
7D16D6981F65EF9900DB3161 /* Update.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Update.h; path = ../shared/Update.h; sourceTree = "<group>"; };
|
||||
7D16D6991F65EF9900DB3161 /* Update.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Update.m; path = ../shared/Update.m; sourceTree = "<group>"; };
|
||||
7D2582551F19FAD700D28B95 /* XPCDaemonClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = XPCDaemonClient.h; path = ../shared/XPCDaemonClient.h; sourceTree = "<group>"; };
|
||||
7D2582561F19FAD700D28B95 /* XPCDaemonClient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = XPCDaemonClient.m; path = ../shared/XPCDaemonClient.m; sourceTree = "<group>"; };
|
||||
7D2582581F19FB6000D28B95 /* XPCDaemonProto.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = XPCDaemonProto.h; path = ../shared/XPCDaemonProto.h; sourceTree = "<group>"; };
|
||||
7D2582551F19FAD700D28B95 /* DaemonComms.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DaemonComms.h; path = ../shared/DaemonComms.h; sourceTree = "<group>"; };
|
||||
7D2582561F19FAD700D28B95 /* DaemonComms.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = DaemonComms.m; path = ../shared/DaemonComms.m; sourceTree = "<group>"; };
|
||||
7D2582581F19FB6000D28B95 /* UserCommsInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UserCommsInterface.h; path = ../shared/UserCommsInterface.h; sourceTree = "<group>"; };
|
||||
7D46FF031F5F496800FEB0F8 /* patrons.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = patrons.txt; sourceTree = "<group>"; };
|
||||
7D564DA91F18434F00B8AAD6 /* Do Not Disturb.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Do Not Disturb.app"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
7D564DAC1F18434F00B8AAD6 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
|
||||
@@ -99,7 +111,6 @@
|
||||
7D75537C1F22E40E0010FE88 /* PrefsWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PrefsWindowController.h; sourceTree = "<group>"; };
|
||||
7D75537D1F22E40E0010FE88 /* PrefsWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PrefsWindowController.m; sourceTree = "<group>"; };
|
||||
7D75537E1F22E40E0010FE88 /* Preferences.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = Preferences.xib; sourceTree = "<group>"; };
|
||||
7D7553811F23199A0010FE88 /* prefsGeneral.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = prefsGeneral.png; sourceTree = "<group>"; };
|
||||
7D7553821F23199A0010FE88 /* prefsUpdate.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = prefsUpdate.png; sourceTree = "<group>"; };
|
||||
7DD2BF431F1C2B4200B33214 /* logo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = logo.png; sourceTree = "<group>"; };
|
||||
7DD2BF441F1C2B4200B33214 /* logoBG.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = logoBG.png; sourceTree = "<group>"; };
|
||||
@@ -123,6 +134,7 @@
|
||||
CD325424204DEAEA0059951B /* dndText@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "dndText@2x.png"; path = "../../../shared/images/dndText@2x.png"; sourceTree = "<group>"; };
|
||||
CD325426204E0C500059951B /* close.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = close.png; sourceTree = "<group>"; };
|
||||
CD32542A204E0E420059951B /* closeAlt.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = closeAlt.png; sourceTree = "<group>"; };
|
||||
CD68AEDF2110CD9D0019E431 /* prefsTriggers.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = prefsTriggers.png; sourceTree = "<group>"; };
|
||||
CDAAC212201D0CD80032F2E6 /* three.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = three.png; sourceTree = "<group>"; };
|
||||
CDAAC214201D2DD30032F2E6 /* checkbox.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = checkbox.png; sourceTree = "<group>"; };
|
||||
CDAAC216201D54C20032F2E6 /* prefsLink.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = prefsLink.png; sourceTree = "<group>"; };
|
||||
@@ -130,6 +142,8 @@
|
||||
CDAAC21A201D77390032F2E6 /* connected.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = connected.png; sourceTree = "<group>"; };
|
||||
CDAAC21B201D77390032F2E6 /* unconnected.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = unconnected.png; sourceTree = "<group>"; };
|
||||
CDAAC237201FD4660032F2E6 /* LocalAuthentication.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = LocalAuthentication.framework; path = System/Library/Frameworks/LocalAuthentication.framework; sourceTree = SDKROOT; };
|
||||
CDEADE502102149F005054B0 /* usb.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = usb.png; sourceTree = "<group>"; };
|
||||
CDEADE51210214A0005054B0 /* sleep.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = sleep.png; sourceTree = "<group>"; };
|
||||
CE0F559B1FD408BB00529259 /* dndText.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = dndText.png; path = ../../../shared/images/dndText.png; sourceTree = "<group>"; };
|
||||
CE133C5E1FD756CC00A29D67 /* dndIcon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = dndIcon.png; path = ../../../shared/images/dndIcon.png; sourceTree = "<group>"; };
|
||||
CE85D3FD1FDB47B200E116A5 /* settings.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = settings.png; sourceTree = "<group>"; };
|
||||
@@ -142,6 +156,7 @@
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
CDAAC238201FD4660032F2E6 /* LocalAuthentication.framework in Frameworks */,
|
||||
CD20A0CE205797030044BCC5 /* Sentry.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -231,6 +246,9 @@
|
||||
7D564DD31F18441500B8AAD6 /* Images */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
CD68AEDF2110CD9D0019E431 /* prefsTriggers.png */,
|
||||
CDEADE51210214A0005054B0 /* sleep.png */,
|
||||
CDEADE502102149F005054B0 /* usb.png */,
|
||||
CD32542A204E0E420059951B /* closeAlt.png */,
|
||||
CD325426204E0C500059951B /* close.png */,
|
||||
CD325424204DEAEA0059951B /* dndText@2x.png */,
|
||||
@@ -251,7 +269,6 @@
|
||||
CE133C5E1FD756CC00A29D67 /* dndIcon.png */,
|
||||
CE0F559B1FD408BB00529259 /* dndText.png */,
|
||||
CE968A9E1FCC66A300AD6B78 /* prefsAction.png */,
|
||||
7D7553811F23199A0010FE88 /* prefsGeneral.png */,
|
||||
7D7553821F23199A0010FE88 /* prefsUpdate.png */,
|
||||
7DD2BF431F1C2B4200B33214 /* logo.png */,
|
||||
7DD2BF441F1C2B4200B33214 /* logoBG.png */,
|
||||
@@ -265,11 +282,11 @@
|
||||
children = (
|
||||
CD1FD56A2089224E00151D1C /* appStore.pdf */,
|
||||
7D564DE31F18446200B8AAD6 /* Consts.h */,
|
||||
7D2582551F19FAD700D28B95 /* XPCDaemonClient.h */,
|
||||
7D2582561F19FAD700D28B95 /* XPCDaemonClient.m */,
|
||||
7D2582551F19FAD700D28B95 /* DaemonComms.h */,
|
||||
7D2582561F19FAD700D28B95 /* DaemonComms.m */,
|
||||
7D564DE51F18446200B8AAD6 /* Logging.h */,
|
||||
7D564DE41F18446200B8AAD6 /* Logging.m */,
|
||||
7D2582581F19FB6000D28B95 /* XPCDaemonProto.h */,
|
||||
7D2582581F19FB6000D28B95 /* UserCommsInterface.h */,
|
||||
7D16D6981F65EF9900DB3161 /* Update.h */,
|
||||
7D16D6991F65EF9900DB3161 /* Update.m */,
|
||||
7D564DE91F1855E900B8AAD6 /* UpdateWindowController.h */,
|
||||
@@ -300,8 +317,9 @@
|
||||
7D564DA51F18434F00B8AAD6 /* Sources */,
|
||||
7D564DA61F18434F00B8AAD6 /* Frameworks */,
|
||||
7D564DA71F18434F00B8AAD6 /* Resources */,
|
||||
7DD25FEE1F23B5AE00277EC4 /* CopyFiles */,
|
||||
7D16D6971F650FF400DB3161 /* ShellScript */,
|
||||
CD20A0D920579B170044BCC5 /* Copy Frameworks */,
|
||||
CD20A0D920579B170044BCC5 /* CopyFiles */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
@@ -318,7 +336,7 @@
|
||||
7D564DA11F18434F00B8AAD6 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 1000;
|
||||
LastUpgradeCheck = 0930;
|
||||
ORGANIZATIONNAME = "Objective-See";
|
||||
TargetAttributes = {
|
||||
7D564DA81F18434F00B8AAD6 = {
|
||||
@@ -326,7 +344,7 @@
|
||||
ProvisioningStyle = Manual;
|
||||
SystemCapabilities = {
|
||||
com.apple.ApplicationGroups.Mac = {
|
||||
enabled = 0;
|
||||
enabled = 1;
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -356,6 +374,7 @@
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
CD32542B204E0E420059951B /* closeAlt.png in Resources */,
|
||||
CDEADE53210214A0005054B0 /* sleep.png in Resources */,
|
||||
CD17D56E20178DFC00F798D7 /* mobilePhone.png in Resources */,
|
||||
CD1FD56B2089224F00151D1C /* appStore.pdf in Resources */,
|
||||
CD2F407F204B417E0066673E /* alert.png in Resources */,
|
||||
@@ -370,13 +389,14 @@
|
||||
CDAAC213201D0CD90032F2E6 /* three.png in Resources */,
|
||||
CDAAC219201D72780032F2E6 /* linked.png in Resources */,
|
||||
CD325425204DEAEA0059951B /* dndText@2x.png in Resources */,
|
||||
CDEADE52210214A0005054B0 /* usb.png in Resources */,
|
||||
7DD2BF481F1C2B4200B33214 /* logoOver.png in Resources */,
|
||||
7D7553801F22E40E0010FE88 /* Preferences.xib in Resources */,
|
||||
7D7553831F23199A0010FE88 /* prefsGeneral.png in Resources */,
|
||||
CD17D5772017941C00F798D7 /* laptop.png in Resources */,
|
||||
CD17D58520179BC700F798D7 /* two.png in Resources */,
|
||||
CD325427204E0C500059951B /* close.png in Resources */,
|
||||
7D564DD61F18441500B8AAD6 /* Assets.xcassets in Resources */,
|
||||
CD68AEE02110CD9E0019E431 /* prefsTriggers.png in Resources */,
|
||||
CD17D57020178EB500F798D7 /* one.png in Resources */,
|
||||
7D7553841F23199A0010FE88 /* prefsUpdate.png in Resources */,
|
||||
7D564DDC1F18441500B8AAD6 /* AboutWindow.xib in Resources */,
|
||||
@@ -384,6 +404,7 @@
|
||||
CDAAC21D201D77390032F2E6 /* unconnected.png in Resources */,
|
||||
CD2F4081204B41C90066673E /* hacker.png in Resources */,
|
||||
CE968A9F1FCC66A300AD6B78 /* prefsAction.png in Resources */,
|
||||
7D564DDB1F18441500B8AAD6 /* MainMenu.xib in Resources */,
|
||||
CDAAC217201D54C30032F2E6 /* prefsLink.png in Resources */,
|
||||
CE133C5F1FD756CC00A29D67 /* dndIcon.png in Resources */,
|
||||
7D564DEB1F1855E900B8AAD6 /* UpdateWindow.xib in Resources */,
|
||||
@@ -405,7 +426,7 @@
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "rm -rf \"$BUILT_PRODUCTS_DIR/$CONTENTS_FOLDER_PATH/Library/LoginItems\"\nmkdir -p \"$BUILT_PRODUCTS_DIR/$CONTENTS_FOLDER_PATH/Library/LoginItems\"\n\n#archiving\nif [[ $BUILT_PRODUCTS_DIR = *\"ArchiveIntermediates\"* ]]; then\n cp -R -f \"$PROJECT_TEMP_ROOT/UninstalledProducts/macosx/Do Not Disturb Helper.app\" \"$BUILT_PRODUCTS_DIR/$CONTENTS_FOLDER_PATH/Library/LoginItems\"\n\n#normal build\nelse\n cp -R -f \"$BUILT_PRODUCTS_DIR/Do Not Disturb Helper.app\" \"$BUILT_PRODUCTS_DIR/$CONTENTS_FOLDER_PATH/Library/LoginItems\"\nfi\n";
|
||||
shellScript = "mkdir -p \"$BUILT_PRODUCTS_DIR/$CONTENTS_FOLDER_PATH/Library/LoginItems\"\n\n#archiving\nif [[ $BUILT_PRODUCTS_DIR = *\"ArchiveIntermediates\"* ]]; then\n cp -R -f \"$PROJECT_TEMP_ROOT/UninstalledProducts/macosx/Do Not Disturb Helper.app\" \"$BUILT_PRODUCTS_DIR/$CONTENTS_FOLDER_PATH/Library/LoginItems\"\n\n#normal build\nelse\n cp -R -f \"$BUILT_PRODUCTS_DIR/Do Not Disturb Helper.app\" \"$BUILT_PRODUCTS_DIR/$CONTENTS_FOLDER_PATH/Library/LoginItems\"\nfi";
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
||||
@@ -416,7 +437,7 @@
|
||||
files = (
|
||||
7D564DEA1F1855E900B8AAD6 /* UpdateWindowController.m in Sources */,
|
||||
CD17D58F201A827A00F798D7 /* QuickResponseCode.m in Sources */,
|
||||
7D2582571F19FAD700D28B95 /* XPCDaemonClient.m in Sources */,
|
||||
7D2582571F19FAD700D28B95 /* DaemonComms.m in Sources */,
|
||||
7D564DE61F18446200B8AAD6 /* Logging.m in Sources */,
|
||||
7D16D69A1F65EF9900DB3161 /* Update.m in Sources */,
|
||||
7D564DB11F18434F00B8AAD6 /* main.m in Sources */,
|
||||
@@ -567,7 +588,7 @@
|
||||
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
|
||||
INFOPLIST_FILE = mainApp/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
|
||||
OTHER_CODE_SIGN_FLAGS = "-o hard,kill,library";
|
||||
OTHER_CODE_SIGN_FLAGS = "";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.objective-see.dnd";
|
||||
PRODUCT_NAME = "Do Not Disturb";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
@@ -588,7 +609,7 @@
|
||||
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
|
||||
INFOPLIST_FILE = mainApp/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
|
||||
OTHER_CODE_SIGN_FLAGS = "-o hard,kill,library";
|
||||
OTHER_CODE_SIGN_FLAGS = "-o hard,kill";
|
||||
OTHER_LDFLAGS = "";
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "com.objective-see.dnd";
|
||||
PRODUCT_NAME = "Do Not Disturb";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "1000"
|
||||
LastUpgradeVersion = "0930"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "NO"
|
||||
@@ -56,7 +56,7 @@
|
||||
</AdditionalOptions>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Release"
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
@@ -75,6 +75,12 @@
|
||||
ReferencedContainer = "container:mainApp.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
<CommandLineArguments>
|
||||
<CommandLineArgument
|
||||
argument = "-prefs"
|
||||
isEnabled = "YES">
|
||||
</CommandLineArgument>
|
||||
</CommandLineArguments>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
|
||||
@@ -22,8 +22,6 @@
|
||||
{
|
||||
//center
|
||||
[self.window center];
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//automatically invoked when window is loaded
|
||||
@@ -36,13 +34,8 @@
|
||||
//super
|
||||
[super windowDidLoad];
|
||||
|
||||
//not in mojave dark mode?
|
||||
// make window color white
|
||||
if(YES != isDarkMode())
|
||||
{
|
||||
//make white
|
||||
self.window.backgroundColor = NSColor.whiteColor;
|
||||
}
|
||||
//make white
|
||||
[self.window setBackgroundColor: NSColor.whiteColor];
|
||||
|
||||
//grab app version
|
||||
version = getAppVersion();
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
@import Cocoa;
|
||||
|
||||
#import "XPCDaemonClient.h"
|
||||
#import "DaemonComms.h"
|
||||
#import "AboutWindowController.h"
|
||||
#import "PrefsWindowController.h"
|
||||
#import "UpdateWindowController.h"
|
||||
|
||||
|
Before Width: | Height: | Size: 993 B After Width: | Height: | Size: 4.2 KiB |
|
Before Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 319 B After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 868 B After Width: | Height: | Size: 4.0 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
@@ -17,9 +17,9 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.3.0</string>
|
||||
<string>1.2.2</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.3.0</string>
|
||||
<string>1.2.2</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
@@ -28,7 +28,5 @@
|
||||
<string>MainMenu</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>AppDelegate</string>
|
||||
<key>NSCameraUsageDescription</key>
|
||||
<string>When a lid open event occurs, this will allow the application to take a picture!</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14313.13.2" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14113" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
|
||||
<dependencies>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14313.13.2"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14113"/>
|
||||
<capability name="box content view" minToolsVersion="7.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
@@ -23,6 +24,7 @@
|
||||
<outlet property="qrcPanel" destination="vdL-RT-p6a" id="KrV-Fe-sK0"/>
|
||||
<outlet property="qrcProgressIndicator" destination="pUS-KZ-De6" id="EYG-28-zkH"/>
|
||||
<outlet property="toolbar" destination="V8g-Ya-LK4" id="SH2-6E-QST"/>
|
||||
<outlet property="triggersView" destination="BuY-2M-Ecx" id="hrr-N9-ajg"/>
|
||||
<outlet property="updateButton" destination="Mtn-pi-zIl" id="Oe1-Jy-nMH"/>
|
||||
<outlet property="updateIndicator" destination="o0T-ra-4H0" id="DwL-OB-WQR"/>
|
||||
<outlet property="updateLabel" destination="Oe2-Ye-1s6" id="1gP-K0-cpP"/>
|
||||
@@ -32,7 +34,7 @@
|
||||
</customObject>
|
||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
||||
<window title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" id="F0z-JX-Cv5">
|
||||
<window title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" oneShot="NO" releasedWhenClosed="NO" animationBehavior="default" id="F0z-JX-Cv5">
|
||||
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES"/>
|
||||
<rect key="contentRect" x="196" y="240" width="600" height="383"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="2560" height="1417"/>
|
||||
@@ -51,22 +53,27 @@
|
||||
<allowedToolbarItems>
|
||||
<toolbarItem implicitItemIdentifier="NSToolbarSpaceItem" id="J66-tT-qAf"/>
|
||||
<toolbarItem implicitItemIdentifier="NSToolbarFlexibleSpaceItem" id="6nW-4K-zf4"/>
|
||||
<toolbarItem implicitItemIdentifier="99F00439-5E3B-4FBB-BC65-3E1F7EBDDBC6" explicitItemIdentifier="general" label="general" paletteLabel="general" image="prefsGeneral" selectable="YES" id="Twx-TJ-y2Q">
|
||||
<toolbarItem implicitItemIdentifier="99F00439-5E3B-4FBB-BC65-3E1F7EBDDBC6" explicitItemIdentifier="general" label="general" paletteLabel="general" image="dndIcon" selectable="YES" id="Twx-TJ-y2Q">
|
||||
<connections>
|
||||
<action selector="toolbarButtonHandler:" target="-2" id="9JH-zR-BcH"/>
|
||||
</connections>
|
||||
</toolbarItem>
|
||||
<toolbarItem implicitItemIdentifier="48B3FCFA-8A19-4D19-A840-E21E6D564389" explicitItemIdentifier="action" label="action" paletteLabel="action" tag="1" image="prefsAction" selectable="YES" id="hqU-b9-59A">
|
||||
<toolbarItem implicitItemIdentifier="0204F7A2-F780-423C-89FB-28784C971A9A" explicitItemIdentifier="triggers" label="triggers" paletteLabel="triggers" tag="1" image="prefsTriggers" selectable="YES" id="pr7-Pz-jdz">
|
||||
<connections>
|
||||
<action selector="toolbarButtonHandler:" target="-2" id="jYk-kP-mSc"/>
|
||||
</connections>
|
||||
</toolbarItem>
|
||||
<toolbarItem implicitItemIdentifier="48B3FCFA-8A19-4D19-A840-E21E6D564389" explicitItemIdentifier="action" label="action" paletteLabel="action" tag="2" image="prefsAction" selectable="YES" id="hqU-b9-59A">
|
||||
<connections>
|
||||
<action selector="toolbarButtonHandler:" target="-2" id="dy9-vy-N89"/>
|
||||
</connections>
|
||||
</toolbarItem>
|
||||
<toolbarItem implicitItemIdentifier="B0FD7AF2-DAC5-45EF-A31B-2E2C7CB85294" explicitItemIdentifier="update" label="update" paletteLabel="update" tag="3" image="prefsUpdate" selectable="YES" id="2Fi-c8-fnE">
|
||||
<toolbarItem implicitItemIdentifier="B0FD7AF2-DAC5-45EF-A31B-2E2C7CB85294" explicitItemIdentifier="update" label="update" paletteLabel="update" tag="4" image="prefsUpdate" selectable="YES" id="2Fi-c8-fnE">
|
||||
<connections>
|
||||
<action selector="toolbarButtonHandler:" target="-2" id="jeu-wN-mgR"/>
|
||||
</connections>
|
||||
</toolbarItem>
|
||||
<toolbarItem implicitItemIdentifier="5DB39F09-CC43-4EC3-BF61-362FDA2DF782" explicitItemIdentifier="link" label="link" paletteLabel="link" tag="2" image="prefsLink" selectable="YES" id="43J-tU-rUa">
|
||||
<toolbarItem implicitItemIdentifier="5DB39F09-CC43-4EC3-BF61-362FDA2DF782" explicitItemIdentifier="link" label="link" paletteLabel="link" tag="3" image="prefsLink" selectable="YES" id="43J-tU-rUa">
|
||||
<connections>
|
||||
<action selector="toolbarButtonHandler:" target="-2" id="tSK-K0-f7H"/>
|
||||
</connections>
|
||||
@@ -75,6 +82,8 @@
|
||||
<defaultToolbarItems>
|
||||
<toolbarItem reference="Twx-TJ-y2Q"/>
|
||||
<toolbarItem reference="J66-tT-qAf"/>
|
||||
<toolbarItem reference="pr7-Pz-jdz"/>
|
||||
<toolbarItem reference="J66-tT-qAf"/>
|
||||
<toolbarItem reference="hqU-b9-59A"/>
|
||||
<toolbarItem reference="J66-tT-qAf"/>
|
||||
<toolbarItem reference="43J-tU-rUa"/>
|
||||
@@ -152,7 +161,7 @@
|
||||
<button fixedFrame="YES" tag="3" translatesAutoresizingMaskIntoConstraints="NO" id="ANF-lj-j0H">
|
||||
<rect key="frame" x="37" y="156" width="29" height="18"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<buttonCell key="cell" type="check" bezelStyle="regularSquare" imagePosition="left" alignment="left" enabled="NO" inset="2" id="Fpb-6d-DfT">
|
||||
<buttonCell key="cell" type="check" bezelStyle="regularSquare" imagePosition="left" alignment="left" inset="2" id="Fpb-6d-DfT">
|
||||
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||
<font key="font" size="14" name="Consolas-Bold"/>
|
||||
</buttonCell>
|
||||
@@ -163,7 +172,7 @@
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="F9r-H0-4xe">
|
||||
<rect key="frame" x="72" y="157" width="471" height="19"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="'Touch ID' Mode" id="l1H-sS-Md8">
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Authentication Mode" id="l1H-sS-Md8">
|
||||
<font key="font" size="13" name="Menlo-Bold"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
@@ -172,13 +181,13 @@
|
||||
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" allowsCharacterPickerTouchBarItem="YES" preferredMaxLayoutWidth="471" translatesAutoresizingMaskIntoConstraints="NO" id="BhQ-tq-9gJ">
|
||||
<rect key="frame" x="72" y="138" width="508" height="19"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" sendsActionOnEndEditing="YES" title="Suppress alerts if proceeded by a Touch ID login (10.13.4+)." id="yKN-Kc-8Q2">
|
||||
<textFieldCell key="cell" sendsActionOnEndEditing="YES" title="Ignore events if computer unlocked via Touch ID or Apple Watch." id="yKN-Kc-8Q2">
|
||||
<font key="font" size="13" name="Menlo-Regular"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<button fixedFrame="YES" tag="7" translatesAutoresizingMaskIntoConstraints="NO" id="OkJ-ds-qSY">
|
||||
<button fixedFrame="YES" tag="4" translatesAutoresizingMaskIntoConstraints="NO" id="OkJ-ds-qSY">
|
||||
<rect key="frame" x="37" y="99" width="29" height="18"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<buttonCell key="cell" type="check" bezelStyle="regularSquare" imagePosition="left" alignment="left" inset="2" id="HEY-GS-vSr">
|
||||
@@ -207,30 +216,95 @@
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<button fixedFrame="YES" tag="4" translatesAutoresizingMaskIntoConstraints="NO" id="5ep-7h-VpU">
|
||||
<rect key="frame" x="37" y="42" width="29" height="18"/>
|
||||
</subviews>
|
||||
<point key="canvasLocation" x="852" y="437"/>
|
||||
</customView>
|
||||
<customView id="BuY-2M-Ecx" userLabel="Triggers">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="322"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<subviews>
|
||||
<button fixedFrame="YES" tag="5" translatesAutoresizingMaskIntoConstraints="NO" id="QSk-EX-Gs3">
|
||||
<rect key="frame" x="37" y="270" width="29" height="18"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<buttonCell key="cell" type="check" bezelStyle="regularSquare" imagePosition="left" alignment="left" inset="2" id="J3b-LL-38M">
|
||||
<buttonCell key="cell" type="check" bezelStyle="regularSquare" imagePosition="left" alignment="left" enabled="NO" inset="2" id="4Ia-YW-I03">
|
||||
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||
<font key="font" size="14" name="Consolas-Bold"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<action selector="togglePreference:" target="-2" id="5gO-Zo-43d"/>
|
||||
<action selector="togglePreference:" target="-2" id="ko3-U3-K1d"/>
|
||||
</connections>
|
||||
</button>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Yza-iC-hAP">
|
||||
<rect key="frame" x="72" y="42" width="160" height="19"/>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="c2q-TO-7Hx">
|
||||
<rect key="frame" x="72" y="271" width="160" height="19"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Start at Login" id="ksD-bk-5jE">
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Laptop Lid Open" id="svL-i1-bx7">
|
||||
<font key="font" size="13" name="Menlo-Bold"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" allowsCharacterPickerTouchBarItem="YES" preferredMaxLayoutWidth="471" translatesAutoresizingMaskIntoConstraints="NO" id="LOC-tP-KQd">
|
||||
<rect key="frame" x="72" y="22" width="475" height="19"/>
|
||||
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" allowsCharacterPickerTouchBarItem="YES" preferredMaxLayoutWidth="471" translatesAutoresizingMaskIntoConstraints="NO" id="9cA-xI-Rkq">
|
||||
<rect key="frame" x="72" y="253" width="475" height="19"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" sendsActionOnEndEditing="YES" title="Automatically start login item." id="k4V-lS-86b">
|
||||
<textFieldCell key="cell" sendsActionOnEndEditing="YES" title="Alert when your laptop lid is opened." id="eYK-5x-T41">
|
||||
<font key="font" size="13" name="Menlo-Regular"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<button fixedFrame="YES" tag="6" translatesAutoresizingMaskIntoConstraints="NO" id="Tdc-FL-Prs">
|
||||
<rect key="frame" x="37" y="213" width="29" height="18"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<buttonCell key="cell" type="check" bezelStyle="regularSquare" imagePosition="left" alignment="left" inset="2" id="Lxz-uf-N9R">
|
||||
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||
<font key="font" size="14" name="Consolas-Bold"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<action selector="togglePreference:" target="-2" id="C4T-Ye-XAC"/>
|
||||
</connections>
|
||||
</button>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="wzx-aD-Ob5">
|
||||
<rect key="frame" x="72" y="214" width="161" height="19"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="USB Device Insertion" id="a2r-f0-Qw2">
|
||||
<font key="font" size="13" name="Menlo-Bold"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" allowsCharacterPickerTouchBarItem="YES" preferredMaxLayoutWidth="471" translatesAutoresizingMaskIntoConstraints="NO" id="xBV-DA-rOc">
|
||||
<rect key="frame" x="72" y="195" width="475" height="19"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" sendsActionOnEndEditing="YES" title="Alert when a USB device is plugged in." id="yaL-Sz-w38">
|
||||
<font key="font" size="13" name="Menlo-Regular"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<button fixedFrame="YES" tag="7" translatesAutoresizingMaskIntoConstraints="NO" id="G6G-cU-bdG">
|
||||
<rect key="frame" x="37" y="156" width="29" height="18"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<buttonCell key="cell" type="check" bezelStyle="regularSquare" imagePosition="left" alignment="left" inset="2" id="oKm-iS-CO8">
|
||||
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||
<font key="font" size="14" name="Consolas-Bold"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<action selector="togglePreference:" target="-2" id="whf-Fn-MSZ"/>
|
||||
</connections>
|
||||
</button>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="CjK-AK-Uzg">
|
||||
<rect key="frame" x="72" y="157" width="471" height="19"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Power Events" id="YR8-oc-TgU">
|
||||
<font key="font" size="13" name="Menlo-Bold"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" allowsCharacterPickerTouchBarItem="YES" preferredMaxLayoutWidth="471" translatesAutoresizingMaskIntoConstraints="NO" id="7Cw-J0-A9x">
|
||||
<rect key="frame" x="72" y="118" width="490" height="38"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" sendsActionOnEndEditing="YES" title="Alert when the your computer is powered on, awakened, or when the screen saver is stopped. " id="yW3-Uo-Ir7">
|
||||
<font key="font" size="13" name="Menlo-Regular"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
@@ -243,7 +317,7 @@
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="311"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<subviews>
|
||||
<button fixedFrame="YES" tag="5" translatesAutoresizingMaskIntoConstraints="NO" id="1z0-vD-5Vz">
|
||||
<button fixedFrame="YES" tag="8" translatesAutoresizingMaskIntoConstraints="NO" id="1z0-vD-5Vz">
|
||||
<rect key="frame" x="37" y="259" width="29" height="18"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<buttonCell key="cell" type="check" bezelStyle="regularSquare" imagePosition="left" alignment="left" inset="2" id="0eO-nb-SYy">
|
||||
@@ -272,8 +346,8 @@
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<button fixedFrame="YES" tag="6" translatesAutoresizingMaskIntoConstraints="NO" id="Od2-P2-SXK">
|
||||
<rect key="frame" x="37" y="201" width="29" height="18"/>
|
||||
<button fixedFrame="YES" tag="9" translatesAutoresizingMaskIntoConstraints="NO" id="Od2-P2-SXK">
|
||||
<rect key="frame" x="37" y="202" width="29" height="18"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<buttonCell key="cell" type="check" bezelStyle="regularSquare" imagePosition="left" alignment="left" inset="2" id="qyn-YP-C2s">
|
||||
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||
@@ -284,7 +358,7 @@
|
||||
</connections>
|
||||
</button>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="BXf-fg-RpF">
|
||||
<rect key="frame" x="72" y="201" width="59" height="19"/>
|
||||
<rect key="frame" x="72" y="203" width="59" height="19"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Monitor" id="YH2-4b-Iv5">
|
||||
<font key="font" size="13" name="Menlo-Bold"/>
|
||||
@@ -301,18 +375,47 @@
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<button fixedFrame="YES" tag="10" translatesAutoresizingMaskIntoConstraints="NO" id="C6E-J8-lhh">
|
||||
<rect key="frame" x="37" y="132" width="29" height="18"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<buttonCell key="cell" type="check" bezelStyle="regularSquare" imagePosition="left" alignment="left" inset="2" id="ngn-La-kHu">
|
||||
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||
<font key="font" size="14" name="Consolas-Bold"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<action selector="togglePreference:" target="-2" id="d0h-1p-AtX"/>
|
||||
</connections>
|
||||
</button>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Np1-aP-w1p">
|
||||
<rect key="frame" x="72" y="133" width="98" height="19"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Snap Picture" id="BQ4-1f-ZXw">
|
||||
<font key="font" size="13" name="Menlo-Bold"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="eWd-63-7Gn">
|
||||
<rect key="frame" x="198" y="257" width="354" height="24"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" placeholderString="path" drawsBackground="YES" id="kLf-zy-hmt">
|
||||
<font key="font" size="13" name="Menlo-Regular"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
<connections>
|
||||
<outlet property="delegate" destination="-2" id="DAs-b2-8Zb"/>
|
||||
</connections>
|
||||
</textField>
|
||||
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" allowsCharacterPickerTouchBarItem="YES" preferredMaxLayoutWidth="471" translatesAutoresizingMaskIntoConstraints="NO" id="cuP-oI-A6A">
|
||||
<rect key="frame" x="72" y="113" width="475" height="19"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" sendsActionOnEndEditing="YES" title="Automatically take a picture via the webcam." id="7Xg-3U-FQp">
|
||||
<font key="font" size="13" name="Menlo-Regular"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
</subviews>
|
||||
<point key="canvasLocation" x="911" y="901.5"/>
|
||||
</customView>
|
||||
@@ -365,7 +468,7 @@
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="272"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<subviews>
|
||||
<button fixedFrame="YES" tag="8" translatesAutoresizingMaskIntoConstraints="NO" id="dml-JS-liI">
|
||||
<button fixedFrame="YES" tag="11" translatesAutoresizingMaskIntoConstraints="NO" id="dml-JS-liI">
|
||||
<rect key="frame" x="37" y="220" width="29" height="18"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<buttonCell key="cell" type="check" bezelStyle="regularSquare" imagePosition="left" alignment="left" inset="2" id="ljs-bE-JTP">
|
||||
@@ -394,7 +497,7 @@
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Mtn-pi-zIl">
|
||||
<button verticalHuggingPriority="750" fixedFrame="YES" tag="7" translatesAutoresizingMaskIntoConstraints="NO" id="Mtn-pi-zIl">
|
||||
<rect key="frame" x="233" y="132" width="134" height="32"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<buttonCell key="cell" type="push" title="Check Now" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="2qr-2x-A3U">
|
||||
@@ -442,20 +545,20 @@
|
||||
</textField>
|
||||
<scrollView horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="RDW-1i-H7T">
|
||||
<rect key="frame" x="322" y="115" width="258" height="153"/>
|
||||
<clipView key="contentView" drawsBackground="NO" id="FSf-NQ-BdZ">
|
||||
<clipView key="contentView" id="FSf-NQ-BdZ">
|
||||
<rect key="frame" x="1" y="1" width="256" height="151"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<textView editable="NO" selectable="NO" importsGraphics="NO" verticallyResizable="YES" usesFontPanel="YES" findStyle="panel" continuousSpellChecking="YES" usesRuler="YES" allowsNonContiguousLayout="YES" quoteSubstitution="YES" dashSubstitution="YES" spellingCorrection="YES" smartInsertDelete="YES" id="9cB-rx-0JH">
|
||||
<rect key="frame" x="0.0" y="0.0" width="256" height="151"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<size key="minSize" width="256" height="151"/>
|
||||
<size key="maxSize" width="463" height="10000000"/>
|
||||
<color key="insertionPointColor" name="textColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="insertionPointColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/>
|
||||
</textView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
</clipView>
|
||||
<scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" doubleValue="1" horizontal="YES" id="efX-ju-LJj">
|
||||
<rect key="frame" x="-100" y="-100" width="87" height="18"/>
|
||||
@@ -518,7 +621,7 @@
|
||||
</constraints>
|
||||
<point key="canvasLocation" x="218" y="1428.5"/>
|
||||
</customView>
|
||||
<window title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" restorable="NO" hidesOnDeactivate="YES" releasedWhenClosed="NO" visibleAtLaunch="NO" frameAutosaveName="" animationBehavior="default" id="vdL-RT-p6a" userLabel="QRC Panel" customClass="NSPanel">
|
||||
<window title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" restorable="NO" hidesOnDeactivate="YES" oneShot="NO" releasedWhenClosed="NO" showsToolbarButton="NO" visibleAtLaunch="NO" frameAutosaveName="" animationBehavior="default" id="vdL-RT-p6a" userLabel="QRC Panel" customClass="NSPanel">
|
||||
<windowStyleMask key="styleMask" utility="YES"/>
|
||||
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
|
||||
<rect key="contentRect" x="2832" y="172" width="594" height="440"/>
|
||||
@@ -603,6 +706,7 @@
|
||||
<image name="close" width="24" height="24"/>
|
||||
<image name="closeAlt" width="24" height="24"/>
|
||||
<image name="connected" width="128" height="128"/>
|
||||
<image name="dndIcon" width="256" height="256"/>
|
||||
<image name="dndText" width="164.57142639160156" height="21.188571929931641"/>
|
||||
<image name="imageCell:eTI-5p-4rR:image" width="256" height="256">
|
||||
<mutableData key="keyedArchiveRepresentation">
|
||||
@@ -5124,9 +5228,9 @@ IGsABCB5AAQgfQAEIIQABCCJAAQglgAEIJkABCCmAAQgqwAEILMABCC2AAQguwAEIMMABCDGAAQg2AAE
|
||||
INsABCDgAAAAAAAABAEAAAAAAAAAVgAAAAAAAAAAAAAAAAAEIOI
|
||||
</mutableData>
|
||||
</image>
|
||||
<image name="prefsAction" width="64" height="64"/>
|
||||
<image name="prefsGeneral" width="64" height="64"/>
|
||||
<image name="prefsLink" width="64" height="64"/>
|
||||
<image name="prefsUpdate" width="64" height="64"/>
|
||||
<image name="prefsAction" width="256" height="256"/>
|
||||
<image name="prefsLink" width="256" height="256"/>
|
||||
<image name="prefsTriggers" width="224" height="205"/>
|
||||
<image name="prefsUpdate" width="256" height="256"/>
|
||||
</resources>
|
||||
</document>
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
|
||||
@import Cocoa;
|
||||
|
||||
#import "XPCDaemonClient.h"
|
||||
#import "UpdateWindowController.h"
|
||||
|
||||
/* CONSTS */
|
||||
@@ -18,13 +17,16 @@
|
||||
#define TOOLBAR_GENERAL 0
|
||||
|
||||
//action view
|
||||
#define TOOLBAR_ACTION 1
|
||||
#define TOOLBAR_TRIGGERS 1
|
||||
|
||||
//action view
|
||||
#define TOOLBAR_ACTION 2
|
||||
|
||||
//link view
|
||||
#define TOOLBAR_LINK 2
|
||||
#define TOOLBAR_LINK 3
|
||||
|
||||
//update view
|
||||
#define TOOLBAR_UPDATE 3
|
||||
#define TOOLBAR_UPDATE 4
|
||||
|
||||
//tool bar id for 'general'
|
||||
#define TOOLBAR_GENERAL_ID @"general"
|
||||
@@ -35,30 +37,41 @@
|
||||
//no icon mode button
|
||||
#define BUTTON_NO_ICON_MODE 2
|
||||
|
||||
//touch id mode button
|
||||
#define BUTTON_TOUCHID_MODE 3
|
||||
//auth mode button
|
||||
#define BUTTON_AUTH_MODE 3
|
||||
|
||||
//remote tasking
|
||||
#define BUTTON_TASKING_MODE 4
|
||||
|
||||
|
||||
//lid open trigger
|
||||
#define BUTTON_LID_TRIGGER 5
|
||||
|
||||
//usb device trigger
|
||||
#define BUTTON_DEVICE_TRIGGER 6
|
||||
|
||||
//power events trigger
|
||||
#define BUTTON_POWER_TRIGGER 7
|
||||
|
||||
//start mode button
|
||||
#define BUTTON_START_MODE 4
|
||||
|
||||
//execute action button
|
||||
#define BUTTON_EXECUTE_ACTION 5
|
||||
#define BUTTON_EXECUTE_ACTION 8
|
||||
|
||||
//monitor button
|
||||
#define BUTTON_MONITOR_ACTION 6
|
||||
#define BUTTON_MONITOR_ACTION 9
|
||||
|
||||
//no remote tasking button
|
||||
#define BUTTON_NO_REMOTE_TASKING 7
|
||||
//snap picture button
|
||||
#define BUTTON_PHOTO_ACTION 10
|
||||
|
||||
//no updates button
|
||||
#define BUTTON_NO_UPDATES_MODE 8
|
||||
#define BUTTON_NO_UPDATES_MODE 11
|
||||
|
||||
@interface PrefsWindowController : NSWindowController <NSTextFieldDelegate, NSToolbarDelegate>
|
||||
|
||||
/* PROPERTIES */
|
||||
|
||||
//daemon comms object
|
||||
@property (retain, nonatomic)XPCDaemonClient* daemonComms;
|
||||
@property (retain, nonatomic)DaemonComms* daemonComms;
|
||||
|
||||
//preferences
|
||||
@property(nonatomic, retain)NSDictionary* preferences;
|
||||
@@ -69,6 +82,9 @@
|
||||
//general prefs view
|
||||
@property (weak) IBOutlet NSView *generalView;
|
||||
|
||||
//triggers view
|
||||
@property (strong) IBOutlet NSView *triggersView;
|
||||
|
||||
//action view
|
||||
@property (weak) IBOutlet NSView *actionView;
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#import "Logging.h"
|
||||
#import "Utilities.h"
|
||||
#import "AppDelegate.h"
|
||||
#import "XPCDaemonClient.h"
|
||||
#import "DaemonComms.h"
|
||||
#import "QuickResponseCode.h"
|
||||
#import "PrefsWindowController.h"
|
||||
#import "UpdateWindowController.h"
|
||||
@@ -40,7 +40,7 @@
|
||||
self.window.title = [NSString stringWithFormat:@"Do Not Disturb (v. %@)", getAppVersion()];
|
||||
|
||||
//init daemon comms
|
||||
daemonComms = [[XPCDaemonClient alloc] init];
|
||||
daemonComms = [[DaemonComms alloc] init];
|
||||
|
||||
//make 'general' selected
|
||||
[self.toolbar setSelectedItemIdentifier:TOOLBAR_GENERAL_ID];
|
||||
@@ -48,13 +48,12 @@
|
||||
//set general prefs as default
|
||||
[self toolbarButtonHandler:nil];
|
||||
|
||||
//enable touchID mode option
|
||||
// if: < 10.13.4 (check first!) && no touch bar
|
||||
if( (YES == [[NSProcessInfo processInfo] isOperatingSystemAtLeastVersion:(NSOperatingSystemVersion){10, 13, 4}]) &&
|
||||
(YES == hasTouchID()) )
|
||||
//clamshell?
|
||||
// enable laptop trigger option
|
||||
if(stateUnavailable != getLidState())
|
||||
{
|
||||
//enable button
|
||||
((NSButton*)[self.generalView viewWithTag:BUTTON_TOUCHID_MODE]).enabled = YES;
|
||||
((NSButton*)[self.triggersView viewWithTag:BUTTON_LID_TRIGGER]).enabled = YES;
|
||||
}
|
||||
|
||||
return;
|
||||
@@ -63,7 +62,7 @@
|
||||
//required for toolbar item enable/disable
|
||||
-(BOOL)validateToolbarItem:(NSToolbarItem *)toolbarItem
|
||||
{
|
||||
return [toolbarItem isEnabled] ;
|
||||
return [toolbarItem isEnabled];
|
||||
}
|
||||
|
||||
//toolbar view handler
|
||||
@@ -109,13 +108,28 @@
|
||||
((NSButton*)[view viewWithTag:BUTTON_NO_ICON_MODE]).state = [self.preferences[PREF_NO_ICON_MODE] boolValue];
|
||||
|
||||
//set 'touch id' button state
|
||||
((NSButton*)[view viewWithTag:BUTTON_TOUCHID_MODE]).state = [self.preferences[PREF_TOUCHID_MODE] boolValue];
|
||||
((NSButton*)[view viewWithTag:BUTTON_AUTH_MODE]).state = [self.preferences[PREF_AUTH_MODE] boolValue];
|
||||
|
||||
//set 'no remote tasking' button state
|
||||
((NSButton*)[view viewWithTag:BUTTON_NO_REMOTE_TASKING]).state = [self.preferences[PREF_NO_REMOTE_TASKING] boolValue];
|
||||
((NSButton*)[view viewWithTag:BUTTON_TASKING_MODE]).state = [self.preferences[PREF_NO_REMOTE_TASKING] boolValue];
|
||||
|
||||
//set 'start mode' button state
|
||||
((NSButton*)[view viewWithTag:BUTTON_START_MODE]).state = [self.preferences[PREF_START_MODE] boolValue];
|
||||
break;
|
||||
}
|
||||
|
||||
//triggers
|
||||
case TOOLBAR_TRIGGERS:
|
||||
{
|
||||
//set view
|
||||
view = self.triggersView;
|
||||
|
||||
//set 'lap lid' trigger button state
|
||||
((NSButton*)[view viewWithTag:BUTTON_LID_TRIGGER]).state = [self.preferences[PREF_LID_TRIGGER] boolValue];
|
||||
|
||||
//set 'usb device' trigger button state
|
||||
((NSButton*)[view viewWithTag:BUTTON_DEVICE_TRIGGER]).state = [self.preferences[PREF_DEVICE_TRIGGER] boolValue];
|
||||
|
||||
//set 'power events' trigger button state
|
||||
((NSButton*)[view viewWithTag:BUTTON_POWER_TRIGGER]).state = [self.preferences[PREF_POWER_TRIGGER] boolValue];
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -142,6 +156,9 @@
|
||||
//set 'monitor' button state
|
||||
((NSButton*)[view viewWithTag:BUTTON_MONITOR_ACTION]).state = [self.preferences[PREF_MONITOR_ACTION] boolValue];
|
||||
|
||||
//set 'photo action' button state
|
||||
((NSButton*)[view viewWithTag:BUTTON_PHOTO_ACTION]).state = [self.preferences[PREF_PHOTO_ACTION] boolValue];
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -242,22 +259,13 @@
|
||||
self.hostName.stringValue = [[NSHost currentHost] localizedName];
|
||||
|
||||
//set font
|
||||
self.deviceNames.font = [NSFont fontWithName:@"Avenir Next Condensed Regular" size:18];
|
||||
self.deviceNames.font = [NSFont fontWithName:@"Avenir Next Condensed Regular" size:20];
|
||||
|
||||
//set inset
|
||||
self.deviceNames.textContainerInset = NSMakeSize(5.0, 10.0);
|
||||
|
||||
//reset
|
||||
self.deviceNames.string = @"";
|
||||
|
||||
//not in mojave dark mode?
|
||||
// make window color white
|
||||
if( (YES != [[NSProcessInfo processInfo] isOperatingSystemAtLeastVersion:(NSOperatingSystemVersion){10, 14, 0}]) &&
|
||||
(YES != [[[NSUserDefaults standardUserDefaults] stringForKey:@"AppleInterfaceStyle"] isEqualToString:@"Dark"]) )
|
||||
{
|
||||
//light gray
|
||||
self.deviceNames.backgroundColor = [NSColor lightGrayColor];
|
||||
}
|
||||
|
||||
//populate text view w/ registered devices
|
||||
for(NSString* deviceToken in registeredDevices[PREF_REGISTERED_DEVICES])
|
||||
@@ -313,6 +321,8 @@
|
||||
//set appropriate preference
|
||||
switch(((NSButton*)sender).tag)
|
||||
{
|
||||
/* GENERAL PREFS */
|
||||
|
||||
//passive mode
|
||||
case BUTTON_PASSIVE_MODE:
|
||||
{
|
||||
@@ -332,35 +342,54 @@
|
||||
break;
|
||||
}
|
||||
|
||||
//touch id mode
|
||||
case BUTTON_TOUCHID_MODE:
|
||||
//auth mode
|
||||
case BUTTON_AUTH_MODE:
|
||||
{
|
||||
//set pref
|
||||
preferences[PREF_TOUCHID_MODE] = state;
|
||||
preferences[PREF_AUTH_MODE] = state;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
//start mode
|
||||
// also toggle here...
|
||||
case BUTTON_START_MODE:
|
||||
//remote tasking
|
||||
case BUTTON_TASKING_MODE:
|
||||
{
|
||||
//set pref
|
||||
preferences[PREF_START_MODE] = state;
|
||||
|
||||
//toggle login item in background
|
||||
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0),
|
||||
^{
|
||||
//toggle
|
||||
if(YES != toggleLoginItem([NSURL fileURLWithPath:[((AppDelegate*)[[NSApplication sharedApplication] delegate]) path2LoginItem]], [preferences[PREF_START_MODE] intValue]))
|
||||
{
|
||||
//err msg
|
||||
logMsg(LOG_ERR, @"failed to toggle login item");
|
||||
}
|
||||
});
|
||||
preferences[PREF_NO_REMOTE_TASKING] = state;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
/* TRIGGER PREFS */
|
||||
|
||||
//lid trigger
|
||||
case BUTTON_LID_TRIGGER:
|
||||
{
|
||||
//set pref
|
||||
preferences[PREF_LID_TRIGGER] = state;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
//usb device trigger
|
||||
case BUTTON_DEVICE_TRIGGER:
|
||||
{
|
||||
//set pref
|
||||
preferences[PREF_DEVICE_TRIGGER] = state;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
//power trigger
|
||||
case BUTTON_POWER_TRIGGER:
|
||||
{
|
||||
//set pref
|
||||
preferences[PREF_POWER_TRIGGER] = state;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
/* ACTION PREFS */
|
||||
|
||||
//execute action
|
||||
// also toggle state of path
|
||||
@@ -384,14 +413,16 @@
|
||||
break;
|
||||
}
|
||||
|
||||
//no camera
|
||||
case BUTTON_NO_REMOTE_TASKING:
|
||||
//monitor mode
|
||||
case BUTTON_PHOTO_ACTION:
|
||||
{
|
||||
//set pref
|
||||
preferences[PREF_NO_REMOTE_TASKING] = state;
|
||||
preferences[PREF_PHOTO_ACTION] = state;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
/* UPDATE PREFS */
|
||||
|
||||
//(no) update mode
|
||||
case BUTTON_NO_UPDATES_MODE:
|
||||
@@ -404,7 +435,7 @@
|
||||
}
|
||||
|
||||
//tell daemon to update preferences
|
||||
[daemonComms updatePreferences:preferences];
|
||||
[self.daemonComms updatePreferences:preferences];
|
||||
|
||||
//restart login item if user toggle'd icon state
|
||||
// note: this has to be done after the prefs are written out by the daemon
|
||||
@@ -428,7 +459,7 @@
|
||||
QuickResponseCode* qrcObj = nil;
|
||||
|
||||
//daemon comms obj
|
||||
__block XPCDaemonClient* daemonComms = nil;
|
||||
__block DaemonComms* daemonComms = nil;
|
||||
|
||||
//size
|
||||
CGSize qrcSize = {0};
|
||||
@@ -508,7 +539,7 @@
|
||||
|
||||
//init daemon comms
|
||||
// will connect, etc.
|
||||
daemonComms = [[XPCDaemonClient alloc] init];
|
||||
daemonComms = [[DaemonComms alloc] init];
|
||||
|
||||
//call into daemon/framework
|
||||
// this will block until phone linking/registration is complete
|
||||
@@ -527,6 +558,7 @@
|
||||
[self toolbarButtonHandler:self.linkToolbarItem];
|
||||
|
||||
});
|
||||
|
||||
}];
|
||||
|
||||
}];
|
||||
|
||||
@@ -10,14 +10,14 @@
|
||||
@import Cocoa;
|
||||
@import Foundation;
|
||||
|
||||
#import "XPCDaemonClient.h"
|
||||
#import "DaemonComms.h"
|
||||
|
||||
@interface QuickResponseCode : NSObject
|
||||
|
||||
/* PROPERTIES */
|
||||
|
||||
//daemon comms obj
|
||||
@property(nonatomic, retain)XPCDaemonClient* daemonComms;
|
||||
@property(nonatomic, retain)DaemonComms* daemonComms;
|
||||
|
||||
|
||||
/* METHODS */
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
//
|
||||
|
||||
#import "Logging.h"
|
||||
#import "XPCDaemonClient.h"
|
||||
#import "DaemonComms.h"
|
||||
#import "QuickResponseCode.h"
|
||||
|
||||
#import <CoreImage/CoreImage.h>
|
||||
@@ -27,7 +27,7 @@
|
||||
{
|
||||
//init daemon comms
|
||||
// will connect, etc.
|
||||
daemonComms = [[XPCDaemonClient alloc] init];
|
||||
daemonComms = [[DaemonComms alloc] init];
|
||||
}
|
||||
|
||||
return self;
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14313.13.2" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14113" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
|
||||
<dependencies>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14313.13.2"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14113"/>
|
||||
<capability name="box content view" minToolsVersion="7.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
@@ -10,23 +11,27 @@
|
||||
<connections>
|
||||
<outlet property="activityIndicator" destination="12Q-wb-usj" id="OBk-O9-kxj"/>
|
||||
<outlet property="activityMessage" destination="fFv-Gr-YPE" id="ItR-ES-c5V"/>
|
||||
<outlet property="appInfo" destination="Saf-Qg-NBo" id="xs0-qj-7dm"/>
|
||||
<outlet property="appInfo" destination="uXX-Wf-ZLL" id="x8l-zh-2Ww"/>
|
||||
<outlet property="deviceName" destination="cwA-Cr-acf" id="2Iv-JH-zGS"/>
|
||||
<outlet property="deviceTrigger" destination="1yX-PX-O3F" id="0PZ-dS-dxu"/>
|
||||
<outlet property="hostName" destination="mFe-eu-nNm" id="oRs-cQ-NN6"/>
|
||||
<outlet property="lidTrigger" destination="HhM-Wb-jX6" id="mqX-9A-Tlu"/>
|
||||
<outlet property="linkedView" destination="Bbb-NZ-tuF" id="vGv-tV-8Mb"/>
|
||||
<outlet property="powerTrigger" destination="gTR-JD-PmX" id="lLC-rw-fi7"/>
|
||||
<outlet property="qrcImageView" destination="mos-zb-KRK" id="kKD-Ww-Bkx"/>
|
||||
<outlet property="qrcView" destination="klO-RE-i9P" id="30O-Tc-jSC"/>
|
||||
<outlet property="triggerView" destination="Saf-Qg-NBo" id="Aaf-2f-ehE"/>
|
||||
<outlet property="welcomeView" destination="vZ0-Uk-9P1" id="JgS-86-4S1"/>
|
||||
<outlet property="window" destination="F0z-JX-Cv5" id="gIp-Ho-8D9"/>
|
||||
</connections>
|
||||
</customObject>
|
||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
||||
<window title="Do Not Disturb" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" id="F0z-JX-Cv5">
|
||||
<window title="Do Not Disturb" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" oneShot="NO" releasedWhenClosed="NO" animationBehavior="default" id="F0z-JX-Cv5">
|
||||
<windowStyleMask key="styleMask" titled="YES" closable="YES"/>
|
||||
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
|
||||
<rect key="contentRect" x="196" y="240" width="800" height="500"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="2560" height="1417"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="1680" height="1027"/>
|
||||
<value key="minSize" type="size" width="800" height="500"/>
|
||||
<value key="maxSize" type="size" width="800" height="500"/>
|
||||
<view key="contentView" wantsLayer="YES" id="se5-gp-TjO">
|
||||
@@ -96,7 +101,7 @@
|
||||
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" preferredMaxLayoutWidth="660" translatesAutoresizingMaskIntoConstraints="NO" id="cxG-zN-szL">
|
||||
<rect key="frame" x="31" y="180" width="738" height="117"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" sendsActionOnEndEditing="YES" alignment="center" title="'Do Not Disturb' attempts to detect 'evil maid' attacks,
alerting you if somebody tampers with your laptop!" id="tYf-YX-PsV">
|
||||
<textFieldCell key="cell" sendsActionOnEndEditing="YES" alignment="center" title="'Do Not Disturb' attempts to detect 'evil maid' attacks,
alerting you if somebody tampers with your Mac!" id="tYf-YX-PsV">
|
||||
<font key="font" size="32" name="AvenirNextCondensed-Regular"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
@@ -105,33 +110,14 @@
|
||||
</subviews>
|
||||
<point key="canvasLocation" x="-156" y="647"/>
|
||||
</customView>
|
||||
<customView id="Saf-Qg-NBo" userLabel="App Info">
|
||||
<customView id="Saf-Qg-NBo" userLabel="Triggers">
|
||||
<rect key="frame" x="0.0" y="0.0" width="800" height="500"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<subviews>
|
||||
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" preferredMaxLayoutWidth="660" translatesAutoresizingMaskIntoConstraints="NO" id="qwA-lo-6xT">
|
||||
<rect key="frame" x="68" y="426" width="664" height="54"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" sendsActionOnEndEditing="YES" alignment="center" title="Let's link with your iPhone to enable mobile alerts" id="SFE-Jt-OYq">
|
||||
<font key="font" size="32" name="AvenirNextCondensed-Regular"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="hgC-yZ-fp2">
|
||||
<rect key="frame" x="342" y="292" width="116" height="73"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="unconnected" id="Mpj-kB-q4i"/>
|
||||
</imageView>
|
||||
<imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="tSA-l2-uw1">
|
||||
<rect key="frame" x="458" y="267" width="142" height="124"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="mobilePhone" id="ijd-WJ-9VT"/>
|
||||
</imageView>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" preferredMaxLayoutWidth="388" translatesAutoresizingMaskIntoConstraints="NO" id="OFG-Gz-3rE">
|
||||
<rect key="frame" x="18" y="157" width="764" height="54"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="center" title="Download 'Do Not Disturb' from the iOS App Store" id="MAH-fc-gnv">
|
||||
<textFieldCell key="cell" sendsActionOnEndEditing="YES" alignment="center" title="What should trigger 'Do Not Disturb'?" id="SFE-Jt-OYq">
|
||||
<font key="font" size="32" name="AvenirNextCondensed-Regular"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
@@ -144,18 +130,7 @@
|
||||
<rect key="frame" x="0.0" y="0.0" width="800" height="48"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<button verticalHuggingPriority="750" fixedFrame="YES" tag="2" translatesAutoresizingMaskIntoConstraints="NO" id="XhZ-7d-es8">
|
||||
<rect key="frame" x="14" y="6" width="81" height="32"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<buttonCell key="cell" type="push" title="Skip" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="jHq-Ss-1eG">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<action selector="buttonHandler:" target="-2" id="skW-Zf-sd1"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button verticalHuggingPriority="750" fixedFrame="YES" tag="3" translatesAutoresizingMaskIntoConstraints="NO" id="k0d-RO-RST">
|
||||
<button verticalHuggingPriority="750" fixedFrame="YES" tag="2" translatesAutoresizingMaskIntoConstraints="NO" id="k0d-RO-RST">
|
||||
<rect key="frame" x="715" y="6" width="81" height="32"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<buttonCell key="cell" type="push" title="Next" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="7AI-8x-NIJ">
|
||||
@@ -171,19 +146,153 @@
|
||||
<color key="fillColor" red="0.57793885469999995" green="0.75859862570000003" blue="0.2368842065" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</box>
|
||||
<imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Stm-VG-w3v">
|
||||
<rect key="frame" x="206" y="267" width="138" height="124"/>
|
||||
<rect key="frame" x="76" y="150" width="180" height="200"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="laptop" id="tNr-00-iNk"/>
|
||||
</imageView>
|
||||
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="9FN-FI-sj3">
|
||||
<button fixedFrame="YES" tag="5" translatesAutoresizingMaskIntoConstraints="NO" id="HhM-Wb-jX6">
|
||||
<rect key="frame" x="86" y="143" width="29" height="18"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<buttonCell key="cell" type="check" bezelStyle="regularSquare" imagePosition="left" alignment="left" state="on" inset="2" id="6kw-r2-rmN">
|
||||
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||
<font key="font" size="14" name="Consolas-Bold"/>
|
||||
</buttonCell>
|
||||
</button>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="e9r-Jq-TLi">
|
||||
<rect key="frame" x="111" y="143" width="140" height="23"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Laptop Lid Open" id="3rB-77-9nQ">
|
||||
<font key="font" size="15" name="Menlo-Bold"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<button fixedFrame="YES" tag="5" translatesAutoresizingMaskIntoConstraints="NO" id="gTR-JD-PmX">
|
||||
<rect key="frame" x="581" y="143" width="29" height="18"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<buttonCell key="cell" type="check" bezelStyle="regularSquare" imagePosition="left" alignment="left" inset="2" id="ok3-Cj-tDO">
|
||||
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||
<font key="font" size="14" name="Consolas-Bold"/>
|
||||
</buttonCell>
|
||||
</button>
|
||||
<imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="gYG-uo-2F5">
|
||||
<rect key="frame" x="315" y="165" width="170" height="170"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="usb" id="fcP-xx-A5f"/>
|
||||
</imageView>
|
||||
<button fixedFrame="YES" tag="5" translatesAutoresizingMaskIntoConstraints="NO" id="1yX-PX-O3F">
|
||||
<rect key="frame" x="341" y="143" width="29" height="18"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<buttonCell key="cell" type="check" bezelStyle="regularSquare" imagePosition="left" alignment="left" inset="2" id="bJj-FO-Xp6">
|
||||
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||
<font key="font" size="14" name="Consolas-Bold"/>
|
||||
</buttonCell>
|
||||
</button>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="93F-5x-Nuf">
|
||||
<rect key="frame" x="605" y="82" width="177" height="84"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Power On
Computer Wake
Screen Saver Off" id="uOY-7O-Nsb">
|
||||
<font key="font" size="15" name="Menlo-Bold"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="fTz-Wm-yY8">
|
||||
<rect key="frame" x="571" y="170" width="159" height="159"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="sleep" id="LyW-2I-nNG"/>
|
||||
</imageView>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="2Vd-M8-05L">
|
||||
<rect key="frame" x="365" y="143" width="122" height="23"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="USB Insertion" id="dHu-5b-Vk2">
|
||||
<font key="font" size="15" name="Menlo-Bold"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
</subviews>
|
||||
<point key="canvasLocation" x="831" y="-530"/>
|
||||
</customView>
|
||||
<customView id="uXX-Wf-ZLL" userLabel="App Info">
|
||||
<rect key="frame" x="0.0" y="0.0" width="800" height="500"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<subviews>
|
||||
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" preferredMaxLayoutWidth="660" translatesAutoresizingMaskIntoConstraints="NO" id="pzP-vr-mwp">
|
||||
<rect key="frame" x="68" y="426" width="664" height="54"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" sendsActionOnEndEditing="YES" alignment="center" title="Let's link with your iPhone to enable mobile alerts" id="b7f-6P-fss">
|
||||
<font key="font" size="32" name="AvenirNextCondensed-Regular"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="3Ko-5I-ZkQ">
|
||||
<rect key="frame" x="342" y="292" width="116" height="73"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="unconnected" id="biq-NY-wHH"/>
|
||||
</imageView>
|
||||
<imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Rla-hF-y7t">
|
||||
<rect key="frame" x="458" y="267" width="142" height="124"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="mobilePhone" id="ks4-qM-EJX"/>
|
||||
</imageView>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" preferredMaxLayoutWidth="388" translatesAutoresizingMaskIntoConstraints="NO" id="1NC-nB-9TF">
|
||||
<rect key="frame" x="18" y="157" width="764" height="54"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="center" title="Download 'Do Not Disturb' from the iOS App Store" id="xMO-kA-ubY">
|
||||
<font key="font" size="32" name="AvenirNextCondensed-Regular"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<box fixedFrame="YES" boxType="custom" borderType="none" titlePosition="noTitle" translatesAutoresizingMaskIntoConstraints="NO" id="2wk-PX-com">
|
||||
<rect key="frame" x="0.0" y="0.0" width="800" height="48"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<view key="contentView" ambiguous="YES" id="Cvt-0u-Fn9">
|
||||
<rect key="frame" x="0.0" y="0.0" width="800" height="48"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<button verticalHuggingPriority="750" fixedFrame="YES" tag="3" translatesAutoresizingMaskIntoConstraints="NO" id="SzW-hq-Cay">
|
||||
<rect key="frame" x="14" y="6" width="81" height="32"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<buttonCell key="cell" type="push" title="Skip" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="F4D-7D-b7M">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<action selector="buttonHandler:" target="-2" id="Q9F-RZ-B16"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button verticalHuggingPriority="750" fixedFrame="YES" tag="4" translatesAutoresizingMaskIntoConstraints="NO" id="IYF-UZ-e79">
|
||||
<rect key="frame" x="715" y="6" width="81" height="32"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<buttonCell key="cell" type="push" title="Next" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="KzN-1a-Bgl">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<action selector="buttonHandler:" target="-2" id="4kt-qR-EdK"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
</view>
|
||||
<color key="fillColor" red="0.57793885469999995" green="0.75859862570000003" blue="0.2368842065" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</box>
|
||||
<imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="pne-xe-SXP">
|
||||
<rect key="frame" x="206" y="267" width="138" height="124"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="laptop" id="Yka-Wc-tqb"/>
|
||||
</imageView>
|
||||
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="SIf-al-GRB">
|
||||
<rect key="frame" x="337" y="94" width="127" height="55"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<buttonCell key="cell" type="bevel" bezelStyle="rounded" image="appStore" imagePosition="overlaps" alignment="center" imageScaling="proportionallyDown" inset="2" id="cPG-lr-39E">
|
||||
<buttonCell key="cell" type="bevel" bezelStyle="rounded" image="appStore" imagePosition="overlaps" alignment="center" imageScaling="proportionallyDown" inset="2" id="rpd-Oh-aLh">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<action selector="downloadApp:" target="-2" id="IrW-7u-1OG"/>
|
||||
<action selector="downloadApp:" target="-2" id="u1k-Ns-xde"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
@@ -294,7 +403,7 @@
|
||||
<rect key="frame" x="0.0" y="0.0" width="800" height="48"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<button verticalHuggingPriority="750" fixedFrame="YES" tag="4" translatesAutoresizingMaskIntoConstraints="NO" id="SCr-nL-4pA">
|
||||
<button verticalHuggingPriority="750" fixedFrame="YES" tag="5" translatesAutoresizingMaskIntoConstraints="NO" id="SCr-nL-4pA">
|
||||
<rect key="frame" x="705" y="6" width="81" height="32"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<buttonCell key="cell" type="push" title="Done" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="Jhe-Eu-d4x">
|
||||
@@ -4852,6 +4961,8 @@ INsABCDgAAAAAAAABAEAAAAAAAAAVgAAAAAAAAAAAAAAAAAEIOI
|
||||
<image name="laptop" width="256" height="256"/>
|
||||
<image name="linked" width="256" height="467"/>
|
||||
<image name="mobilePhone" width="512" height="512"/>
|
||||
<image name="sleep" width="256" height="256"/>
|
||||
<image name="unconnected" width="128" height="128"/>
|
||||
<image name="usb" width="256" height="256"/>
|
||||
</resources>
|
||||
</document>
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
//
|
||||
|
||||
@import Cocoa;
|
||||
|
||||
#import <objc/message.h>
|
||||
|
||||
@interface WelcomeWindowController : NSWindowController
|
||||
@@ -18,12 +17,27 @@
|
||||
//welcome view
|
||||
@property (strong) IBOutlet NSView *welcomeView;
|
||||
|
||||
//app info view
|
||||
@property (strong) IBOutlet NSView *triggerView;
|
||||
|
||||
//app info view
|
||||
@property (strong) IBOutlet NSView *appInfo;
|
||||
|
||||
//config view
|
||||
@property (strong) IBOutlet NSView *qrcView;
|
||||
|
||||
//button
|
||||
// trigger for lid opens
|
||||
@property (weak) IBOutlet NSButton *lidTrigger;
|
||||
|
||||
//button
|
||||
// trigger for device insertions
|
||||
@property (weak) IBOutlet NSButton *deviceTrigger;
|
||||
|
||||
//button
|
||||
// trigger for power events
|
||||
@property (weak) IBOutlet NSButton *powerTrigger;
|
||||
|
||||
//activity indicator
|
||||
@property (weak) IBOutlet NSProgressIndicator *activityIndicator;
|
||||
|
||||
|
||||
@@ -10,15 +10,16 @@
|
||||
#import "Consts.h"
|
||||
#import "Logging.h"
|
||||
#import "Utilities.h"
|
||||
#import "XPCDaemonClient.h"
|
||||
#import "DaemonComms.h"
|
||||
#import "QuickResponseCode.h"
|
||||
#import "WelcomeWindowController.h"
|
||||
|
||||
#define VIEW_WELCOME 0
|
||||
#define VIEW_APP_INFO 1
|
||||
#define SKIP_LINKING 2
|
||||
#define VIEW_QRC 3
|
||||
#define VIEW_LINKED 4
|
||||
#define SELECT_TRIGGERS 1
|
||||
#define VIEW_APP_INFO 2
|
||||
#define SKIP_LINKING 3
|
||||
#define VIEW_QRC 4
|
||||
#define VIEW_LINKED 5
|
||||
|
||||
@implementation WelcomeWindowController
|
||||
|
||||
@@ -34,13 +35,8 @@
|
||||
//center
|
||||
[self.window center];
|
||||
|
||||
//not in mojave dark mode?
|
||||
// make window color white
|
||||
if(YES != isDarkMode())
|
||||
{
|
||||
//make white
|
||||
self.window.backgroundColor = NSColor.whiteColor;
|
||||
}
|
||||
//make white
|
||||
[self.window setBackgroundColor: NSColor.whiteColor];
|
||||
|
||||
//when supported
|
||||
// indicate title bar is transparent (too)
|
||||
@@ -59,7 +55,6 @@
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//button handler for all views
|
||||
// show next view, sometimes, with view specific logic
|
||||
-(IBAction)buttonHandler:(id)sender
|
||||
@@ -81,16 +76,48 @@
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (100 * NSEC_PER_MSEC)), dispatch_get_main_queue(), ^{
|
||||
|
||||
//set first responder
|
||||
[self.window makeFirstResponder:[self.welcomeView viewWithTag:VIEW_APP_INFO]];
|
||||
[self.window makeFirstResponder:[self.welcomeView viewWithTag:SELECT_TRIGGERS]];
|
||||
|
||||
});
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
//select triggers info
|
||||
case SELECT_TRIGGERS:
|
||||
{
|
||||
//remove prev. subview
|
||||
[[[self.window.contentView subviews] lastObject] removeFromSuperview];
|
||||
|
||||
//no a laptop?
|
||||
// uncheck and disable laptop lid trigger
|
||||
if(stateUnavailable == getLidState())
|
||||
{
|
||||
//uncheck
|
||||
self.lidTrigger.state = NSOffState;
|
||||
|
||||
//disable
|
||||
self.lidTrigger.enabled = NO;
|
||||
}
|
||||
|
||||
//set view
|
||||
[self.window.contentView addSubview:self.triggerView];
|
||||
|
||||
//make 'next' button first responder
|
||||
[self.window makeFirstResponder:[self.triggerView viewWithTag:VIEW_APP_INFO]];
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
//app info
|
||||
case VIEW_APP_INFO:
|
||||
{
|
||||
//save trigger prefs
|
||||
[self setTriggers];
|
||||
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, @"saved triggers");
|
||||
|
||||
//remove prev. subview
|
||||
[[[self.window.contentView subviews] lastObject] removeFromSuperview];
|
||||
|
||||
@@ -106,8 +133,8 @@
|
||||
//skip
|
||||
case SKIP_LINKING:
|
||||
{
|
||||
//bye!
|
||||
[self terminate];
|
||||
//bye
|
||||
[NSApp terminate:self];
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -130,28 +157,38 @@
|
||||
//linked view
|
||||
case VIEW_LINKED:
|
||||
{
|
||||
//bye!
|
||||
[self terminate];
|
||||
//exit
|
||||
[NSApp terminate:nil];
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//exit app
|
||||
// performing any actions
|
||||
-(void)terminate
|
||||
//get user's prefs for triggers
|
||||
// then send them to daemon to save into prefs
|
||||
-(void)setTriggers
|
||||
{
|
||||
//before exiting
|
||||
// ask for camera
|
||||
requestCameraAccess();
|
||||
//daemon comms
|
||||
DaemonComms* daemonComms = nil;
|
||||
|
||||
//exit
|
||||
[NSApp terminate:nil];
|
||||
//alloc/init
|
||||
daemonComms = [[DaemonComms alloc] init];
|
||||
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, @"setting trigger prefs");
|
||||
|
||||
//send to daemon
|
||||
// will update preferences
|
||||
[daemonComms updatePreferences:@{PREF_LID_TRIGGER:[NSNumber numberWithInteger:self.lidTrigger.state],
|
||||
PREF_DEVICE_TRIGGER:[NSNumber numberWithInteger:self.deviceTrigger.state],
|
||||
PREF_POWER_TRIGGER:[NSNumber numberWithInteger:self.powerTrigger.state]}];
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//generate a QRC
|
||||
// calls into daemon and then displays
|
||||
-(void)generateQRC
|
||||
@@ -160,7 +197,7 @@
|
||||
QuickResponseCode* qrcObj = nil;
|
||||
|
||||
//daemon comms obj
|
||||
__block XPCDaemonClient* daemonComms = nil;
|
||||
__block DaemonComms* daemonComms = nil;
|
||||
|
||||
//size
|
||||
CGSize qrcSize = {0};
|
||||
@@ -212,7 +249,7 @@
|
||||
|
||||
//init daemon comms
|
||||
// will connect, etc.
|
||||
daemonComms = [[XPCDaemonClient alloc] init];
|
||||
daemonComms = [[DaemonComms alloc] init];
|
||||
|
||||
//call into daemon/framework
|
||||
// this will block until phone linking/registration is complete
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
#import "Logging.h"
|
||||
#import "Utilities.h"
|
||||
|
||||
#import <ServiceManagement/ServiceManagement.h>
|
||||
|
||||
int main(int argc, const char * argv[])
|
||||
{
|
||||
@@ -24,8 +23,11 @@ int main(int argc, const char * argv[])
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, [NSString stringWithFormat:@"STARTED: config/prefs app (args: %@)", [[NSProcessInfo processInfo] arguments]]);
|
||||
|
||||
//init crash reporting
|
||||
initCrashReporting();
|
||||
//init crash reporting client
|
||||
SentryClient.sharedClient = [[SentryClient alloc] initWithDsn:CRASH_REPORTING_URL didFailWithError:nil];
|
||||
|
||||
//start crash handler
|
||||
[SentryClient.sharedClient startCrashHandlerWithError:nil];
|
||||
|
||||
//already running?
|
||||
if(YES == isAppRunning([[NSBundle mainBundle] bundleIdentifier]))
|
||||
|
||||
@@ -1,5 +1 @@
|
||||
Patrons:
|
||||
Halo Privacy, Ash Morgan, Jesse Daguanno, Beau Galbraith, Nando Mendonca, Khalil Sehnaoui, Jeff Golden, Geoffrey Weber, Randy Wong, Gamer_Bot
|
||||
|
||||
Friends of Objective-See:
|
||||
Digita Security, Malwarebytes, Don MacAskill
|
||||
Halo Privacy, Ash Morgan, Geoffrey Weber, Jeff Golden, Khalil Sehnaoui, Nando Mendonca, Gamer_Bot
|
||||
|
||||
@@ -52,6 +52,12 @@
|
||||
//button title: next
|
||||
#define ACTION_NEXT @"Next »"
|
||||
|
||||
//button title: no
|
||||
#define ACTION_NO @"No"
|
||||
|
||||
//button title: yes
|
||||
#define ACTION_YES @"Yes!"
|
||||
|
||||
//frame shift
|
||||
// for status msg to avoid activity indicator
|
||||
#define FRAME_SHIFT 45
|
||||
@@ -65,9 +71,6 @@
|
||||
//flag to install
|
||||
#define ACTION_INSTALL_FLAG 1
|
||||
|
||||
//next
|
||||
#define ACTION_NEXT_FLAG 2
|
||||
|
||||
//flag for partial uninstall
|
||||
// leave preferences file, etc.
|
||||
#define UNINSTALL_PARTIAL 0
|
||||
@@ -111,9 +114,6 @@
|
||||
//daemon mach name
|
||||
#define DAEMON_MACH_SERVICE @"com.objective-see.dndDaemon"
|
||||
|
||||
//user (login item) mach name
|
||||
#define USER_MACH_SERVICE @"com.objective-see.dndUser"
|
||||
|
||||
//product url
|
||||
#define PRODUCT_URL @"https://objective-see.com/products/dnd.html"
|
||||
|
||||
@@ -148,6 +148,18 @@
|
||||
// status
|
||||
#define PREF_IS_DISABLED @"disabled"
|
||||
|
||||
//prefs
|
||||
// lid trigger
|
||||
#define PREF_LID_TRIGGER @"lidTrigger"
|
||||
|
||||
//prefs
|
||||
// device trigger
|
||||
#define PREF_DEVICE_TRIGGER @"deviceTrigger"
|
||||
|
||||
//prefs
|
||||
// power trigger
|
||||
#define PREF_POWER_TRIGGER @"powerTrigger"
|
||||
|
||||
//prefs
|
||||
// passive mode
|
||||
#define PREF_PASSIVE_MODE @"passiveMode"
|
||||
@@ -157,8 +169,8 @@
|
||||
#define PREF_NO_ICON_MODE @"noIconMode"
|
||||
|
||||
//prefs
|
||||
// touchID mode
|
||||
#define PREF_TOUCHID_MODE @"touchIDMode"
|
||||
// auth mode
|
||||
#define PREF_AUTH_MODE @"touchIDMode"
|
||||
|
||||
//prefs
|
||||
// start mode
|
||||
@@ -180,6 +192,10 @@
|
||||
// monitor stuff
|
||||
#define PREF_MONITOR_ACTION @"monitorAction"
|
||||
|
||||
//pref
|
||||
// auto take photo
|
||||
#define PREF_PHOTO_ACTION @"photoAction"
|
||||
|
||||
//pref
|
||||
// no remote tasking
|
||||
#define PREF_NO_REMOTE_TASKING @"noRemoteTasking"
|
||||
@@ -188,6 +204,19 @@
|
||||
// update mode
|
||||
#define PREF_NO_UPDATES_MODE @"noUpdatesMode"
|
||||
|
||||
//trigger: all
|
||||
// based on prefs
|
||||
#define ALL_TRIGGERS 0x0
|
||||
|
||||
//trigger: lid
|
||||
#define LID_TRIGGER 0x1
|
||||
|
||||
//trigger: devices
|
||||
#define DEVICE_TRIGGER 0x2
|
||||
|
||||
//trigger: power
|
||||
#define POWER_TRIGGER 0x3
|
||||
|
||||
//log file
|
||||
#define LOG_FILE_NAME @"DND.log"
|
||||
|
||||
@@ -195,9 +224,20 @@
|
||||
// timestamp
|
||||
#define ALERT_TIMESTAMP @"timestamp"
|
||||
|
||||
//alert key
|
||||
// type (lid, usb, power)
|
||||
#define ALERT_TYPE @"eventType"
|
||||
|
||||
//alert key
|
||||
// info (specific to event type)
|
||||
#define ALERT_INFO @"info"
|
||||
|
||||
//key for device name
|
||||
#define KEY_DEVICE_NAME @"deviceName"
|
||||
|
||||
//key for power type
|
||||
#define KEY_POWER_TYPE @"powerType"
|
||||
|
||||
//key for host name
|
||||
#define KEY_HOST_NAME @"hostName"
|
||||
|
||||
@@ -276,9 +316,6 @@
|
||||
//dismiss event notification
|
||||
#define DISMISS_NOTIFICATION @"com.objective-see.dnd.dismissNotification"
|
||||
|
||||
//new user/client notification
|
||||
#define USER_NOTIFICATION @"com.objective-see.dnd.userNotification"
|
||||
|
||||
//monitoring timeout
|
||||
#define MONITORING_TIMEOUT 60*3
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// file: XPCDaemonClient
|
||||
// file: DaemonComms.h
|
||||
// project: DND (shared)
|
||||
// description: talk to the daemon, via XPC (header)
|
||||
// description: interface to talk to daemon (header)
|
||||
//
|
||||
// created by Patrick Wardle
|
||||
// copyright (c) 2018 Objective-See. All rights reserved.
|
||||
@@ -9,20 +9,16 @@
|
||||
|
||||
@import Foundation;
|
||||
|
||||
#import "XPCDaemonProto.h"
|
||||
#import "UserCommsInterface.h"
|
||||
|
||||
@interface XPCDaemonClient : NSObject
|
||||
{
|
||||
|
||||
}
|
||||
@interface DaemonComms : NSObject
|
||||
|
||||
/* PROPERTIES */
|
||||
//remote deamon proxy object
|
||||
@property(nonatomic, retain) id <UserProtocol> daemon;
|
||||
|
||||
//xpc connection
|
||||
@property (atomic, strong, readwrite) NSXPCConnection* xpcServiceConnection;
|
||||
|
||||
/* METHODS */
|
||||
|
||||
//ask daemon for QRC info
|
||||
// name, uuid, key, key size, etc...
|
||||
-(void)qrcRequest:(void (^)(NSData* qrcInfo))reply;
|
||||
@@ -38,4 +34,17 @@
|
||||
//update (save) preferences
|
||||
-(void)updatePreferences:(NSDictionary*)preferences;
|
||||
|
||||
//ask for alert
|
||||
-(void)alertRequest:(void (^)(NSDictionary* alert))reply;
|
||||
|
||||
//send alert response back to the daemon
|
||||
// for now, it's just an 'ack' that it was recieved/shown
|
||||
-(void)alertResponse;
|
||||
|
||||
//ask (and then block) for an alert dismiss
|
||||
-(void)alertDismiss:(void (^)(NSDictionary* alert))reply;
|
||||
|
||||
//close/cleanup connection
|
||||
-(void)close;
|
||||
|
||||
@end
|
||||
@@ -1,7 +1,7 @@
|
||||
//
|
||||
// file: XPCDaemonClient.m
|
||||
// file: DaemonComms.m
|
||||
// project: DND (shared)
|
||||
// description: talk to the daemon, via XPC (header)
|
||||
// description: interface to talk to daemon
|
||||
//
|
||||
// created by Patrick Wardle
|
||||
// copyright (c) 2018 Objective-See. All rights reserved.
|
||||
@@ -9,15 +9,11 @@
|
||||
|
||||
#import "Consts.h"
|
||||
#import "Logging.h"
|
||||
#import "XPCUserProto.h"
|
||||
#import "XPCDaemonClient.h"
|
||||
#import "DaemonComms.h"
|
||||
|
||||
#ifdef XPC_USER
|
||||
#import "XPCUser.h"
|
||||
#endif
|
||||
|
||||
@implementation XPCDaemonClient
|
||||
@implementation DaemonComms
|
||||
|
||||
@synthesize daemon;
|
||||
@synthesize xpcServiceConnection;
|
||||
|
||||
//init
|
||||
@@ -32,18 +28,7 @@
|
||||
xpcServiceConnection = [[NSXPCConnection alloc] initWithMachServiceName:DAEMON_MACH_SERVICE options:0];
|
||||
|
||||
//set remote object interface
|
||||
self.xpcServiceConnection.remoteObjectInterface = [NSXPCInterface interfaceWithProtocol:@protocol(XPCDaemonProtocol)];
|
||||
|
||||
#ifdef XPC_USER
|
||||
|
||||
//set exported object interface (protocol)
|
||||
self.xpcServiceConnection.exportedInterface = [NSXPCInterface interfaceWithProtocol:@protocol(XPCUserProtocol)];
|
||||
|
||||
//set exported object
|
||||
// this will allow daemon to invoke user methods!
|
||||
self.xpcServiceConnection.exportedObject = [[XPCUser alloc] init];
|
||||
|
||||
#endif
|
||||
self.xpcServiceConnection.remoteObjectInterface = [NSXPCInterface interfaceWithProtocol:@protocol(UserProtocol)];
|
||||
|
||||
//resume
|
||||
[self.xpcServiceConnection resume];
|
||||
@@ -159,4 +144,76 @@
|
||||
return;
|
||||
}
|
||||
|
||||
//ask (and then block) for an alert
|
||||
-(void)alertRequest:(void (^)(NSDictionary* alert))reply
|
||||
{
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, @"sending request, via XPC, for alert");
|
||||
|
||||
//request alert
|
||||
[[self.xpcServiceConnection remoteObjectProxyWithErrorHandler:^(NSError * proxyError)
|
||||
{
|
||||
//err msg
|
||||
logMsg(LOG_ERR, [NSString stringWithFormat:@"failed to execute 'alertRequest' method on launch daemon (error: %@)", proxyError]);
|
||||
|
||||
}] alertRequest:^(NSDictionary* alert)
|
||||
{
|
||||
//respond with alert
|
||||
reply(alert);
|
||||
}];
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//send alert response back to the daemon
|
||||
// for now, it's just an 'ack' that it was recieved/shown
|
||||
-(void)alertResponse
|
||||
{
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, @"sending request, via XPC, for alert response");
|
||||
|
||||
//respond to alert
|
||||
[[self.xpcServiceConnection remoteObjectProxyWithErrorHandler:^(NSError * proxyError)
|
||||
{
|
||||
//err msg
|
||||
logMsg(LOG_ERR, [NSString stringWithFormat:@"failed to execute 'alertResponse' method on launch daemon (error: %@)", proxyError]);
|
||||
|
||||
}] alertResponse];
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//ask (and then block) for an alert dismiss
|
||||
-(void)alertDismiss:(void (^)(NSDictionary* alert))reply
|
||||
{
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, @"sending request, via XPC, for alert dismiss events");
|
||||
|
||||
//request alert
|
||||
[[self.xpcServiceConnection remoteObjectProxyWithErrorHandler:^(NSError * proxyError)
|
||||
{
|
||||
//err msg
|
||||
logMsg(LOG_ERR, [NSString stringWithFormat:@"failed to execute 'alertDismiss' method on launch daemon (error: %@)", proxyError]);
|
||||
|
||||
}] alertDismiss:^(NSDictionary* alert)
|
||||
{
|
||||
//respond with alert
|
||||
reply(alert);
|
||||
}];
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//close/cleanup connection
|
||||
-(void)close
|
||||
{
|
||||
//invalidate
|
||||
[self.xpcServiceConnection invalidate];
|
||||
|
||||
//unset
|
||||
self.xpcServiceConnection = nil;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -41,13 +41,8 @@
|
||||
//super
|
||||
[super windowDidLoad];
|
||||
|
||||
//not in mojave dark mode?
|
||||
// make window color white
|
||||
if(YES != isDarkMode())
|
||||
{
|
||||
//make white
|
||||
self.window.backgroundColor = NSColor.whiteColor;
|
||||
}
|
||||
//make white
|
||||
[self.window setBackgroundColor: NSColor.whiteColor];
|
||||
|
||||
//when supported
|
||||
// indicate title bar is transparent (too)
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
//
|
||||
// file: XPCDaemonProtocol.h
|
||||
// file: UserCommsInterface.h
|
||||
// project: DND (shared)
|
||||
// description: methods exported by the daemon
|
||||
// description: protocol for talking to the daemon
|
||||
//
|
||||
// created by Patrick Wardle
|
||||
// copyright (c) 2018 Objective-See. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef UserCommsInterface_h
|
||||
#define UserCommsInterface_h
|
||||
|
||||
@import Foundation;
|
||||
|
||||
@protocol XPCDaemonProtocol
|
||||
@protocol UserProtocol
|
||||
|
||||
//process qrc request from client
|
||||
-(void)qrcRequest:(void (^)(NSData *))reply;
|
||||
@@ -24,5 +27,15 @@
|
||||
//update preferences
|
||||
-(void)updatePreferences:(NSDictionary*)preferences;
|
||||
|
||||
//ask (and block) alert request from daemon
|
||||
-(void)alertRequest:(void (^)(NSDictionary* alert))reply;
|
||||
|
||||
//process alert response from client
|
||||
-(void)alertResponse;
|
||||
|
||||
//ask (and block) for alert dismiss msg from daemon
|
||||
-(void)alertDismiss:(void (^)(NSDictionary* alert))reply;
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
||||
@@ -10,9 +10,6 @@
|
||||
#ifndef Utilities_h
|
||||
#define Utilities_h
|
||||
|
||||
@import Sentry;
|
||||
@import AVFoundation;
|
||||
|
||||
#import <AppKit/AppKit.h>
|
||||
#import <IOKit/IOKitLib.h>
|
||||
#import <IOKit/pwr_mgt/IOPM.h>
|
||||
@@ -20,8 +17,7 @@
|
||||
#import <SystemConfiguration/SystemConfiguration.h>
|
||||
|
||||
//enum of lid states
|
||||
typedef NS_ENUM(int, LidState)
|
||||
{
|
||||
typedef NS_ENUM(int, LidState) {
|
||||
stateUnavailable = -1,
|
||||
stateOpen = 0,
|
||||
stateClosed = 1
|
||||
@@ -29,17 +25,14 @@ typedef NS_ENUM(int, LidState)
|
||||
|
||||
/* FUNCTIONS */
|
||||
|
||||
//init crash reporting
|
||||
void initCrashReporting(void);
|
||||
|
||||
//loads a framework
|
||||
// note: assumes it is in 'Framework' dir
|
||||
NSBundle* loadFramework(NSString* name);
|
||||
|
||||
//get app's version
|
||||
// extracted from Info.plist
|
||||
NSString* getAppVersion(void);
|
||||
|
||||
//get OS version
|
||||
// note: this uses macOS 10.10+ methods
|
||||
NSOperatingSystemVersion getOSVersion(void);
|
||||
|
||||
//get path to (main) app
|
||||
// login item is in app bundle, so parse up to get main app
|
||||
NSString* getMainAppPath(void);
|
||||
@@ -91,11 +84,4 @@ BOOL hasTouchID(void);
|
||||
//get current console user
|
||||
NSString* currentConsoleUser(SCDynamicStoreRef store);
|
||||
|
||||
//macOS Mojave+
|
||||
// gotta request camera access
|
||||
void requestCameraAccess(void);
|
||||
|
||||
//check if (true) dark mode
|
||||
BOOL isDarkMode(void);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -23,101 +23,6 @@
|
||||
#import <LocalAuthentication/LocalAuthentication.h>
|
||||
#import <SystemConfiguration/SystemConfiguration.h>
|
||||
|
||||
//init crash reporting
|
||||
void initCrashReporting()
|
||||
{
|
||||
//sentry
|
||||
NSBundle *sentry = nil;
|
||||
|
||||
//error
|
||||
NSError* error = nil;
|
||||
|
||||
//class
|
||||
Class SentryClient = nil;
|
||||
|
||||
//load senty
|
||||
sentry = loadFramework(@"Sentry.framework");
|
||||
if(nil == sentry)
|
||||
{
|
||||
//err msg
|
||||
logMsg(LOG_ERR, @"failed to load 'Sentry' framework");
|
||||
|
||||
//bail
|
||||
goto bail;
|
||||
}
|
||||
|
||||
//get client class
|
||||
SentryClient = NSClassFromString(@"SentryClient");
|
||||
if(nil == SentryClient)
|
||||
{
|
||||
//bail
|
||||
goto bail;
|
||||
}
|
||||
|
||||
//set shared client
|
||||
[SentryClient setSharedClient:[[SentryClient alloc] initWithDsn:CRASH_REPORTING_URL didFailWithError:&error]];
|
||||
if(nil != error)
|
||||
{
|
||||
//log error
|
||||
logMsg(LOG_ERR, [NSString stringWithFormat:@"initializing 'Sentry' failed with %@", error]);
|
||||
|
||||
//bail
|
||||
goto bail;
|
||||
}
|
||||
|
||||
//start crash handler
|
||||
[[SentryClient sharedClient] startCrashHandlerWithError:&error];
|
||||
if(nil != error)
|
||||
{
|
||||
//log error
|
||||
logMsg(LOG_ERR, [NSString stringWithFormat:@"starting 'Sentry' crash handler failed with %@", error]);
|
||||
|
||||
//bail
|
||||
goto bail;
|
||||
}
|
||||
|
||||
bail:
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//loads a framework
|
||||
// note: assumes it is in 'Framework' dir
|
||||
NSBundle* loadFramework(NSString* name)
|
||||
{
|
||||
//handle
|
||||
NSBundle* framework = nil;
|
||||
|
||||
//framework path
|
||||
NSString* path = nil;
|
||||
|
||||
//init path
|
||||
path = [NSString stringWithFormat:@"%@/../Frameworks/%@", [NSProcessInfo.processInfo.arguments[0] stringByDeletingLastPathComponent], name];
|
||||
|
||||
//standardize path
|
||||
path = [path stringByStandardizingPath];
|
||||
|
||||
//init framework (bundle)
|
||||
framework = [NSBundle bundleWithPath:path];
|
||||
if(NULL == framework)
|
||||
{
|
||||
//bail
|
||||
goto bail;
|
||||
}
|
||||
|
||||
//load framework
|
||||
if(YES != [framework loadAndReturnError:nil])
|
||||
{
|
||||
//bail
|
||||
goto bail;
|
||||
}
|
||||
|
||||
bail:
|
||||
|
||||
return framework;
|
||||
}
|
||||
|
||||
//get app's version
|
||||
// extracted from Info.plist
|
||||
NSString* getAppVersion()
|
||||
@@ -126,6 +31,13 @@ NSString* getAppVersion()
|
||||
return [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"];
|
||||
}
|
||||
|
||||
//get OS version
|
||||
// note: this uses macOS 10.10+ methods
|
||||
NSOperatingSystemVersion getOSVersion()
|
||||
{
|
||||
return [[NSProcessInfo processInfo] operatingSystemVersion];
|
||||
}
|
||||
|
||||
//get path to (main) app
|
||||
// login item is in app bundle, so parse up to get main app
|
||||
NSString* getMainAppPath()
|
||||
@@ -1017,71 +929,9 @@ NSString* currentConsoleUser(SCDynamicStoreRef store)
|
||||
goto bail;
|
||||
}
|
||||
|
||||
|
||||
bail:
|
||||
|
||||
return consoleUser;
|
||||
}
|
||||
|
||||
//macOS Mojave+ gotta request camera access
|
||||
// note, we check first, to see if request was already made
|
||||
void requestCameraAccess()
|
||||
{
|
||||
//on macOS 10.14+
|
||||
// trigger request for camera access
|
||||
if(@available(macOS 10.14, *))
|
||||
{
|
||||
//auth status
|
||||
AVAuthorizationStatus authStatus = AVAuthorizationStatusNotDetermined;
|
||||
|
||||
//get current status
|
||||
authStatus = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo];
|
||||
|
||||
//already requested?
|
||||
if(authStatus != AVAuthorizationStatusNotDetermined)
|
||||
{
|
||||
//bail
|
||||
goto bail;
|
||||
}
|
||||
|
||||
//request
|
||||
[AVCaptureDevice requestAccessForMediaType:AVMediaTypeVideo completionHandler:^(BOOL granted)
|
||||
{
|
||||
//dbg msg
|
||||
logMsg(LOG_DEBUG, [NSString stringWithFormat:@"user response for camera access: %d", granted]);
|
||||
}];
|
||||
}
|
||||
|
||||
bail:
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//check if (true) dark mode
|
||||
BOOL isDarkMode()
|
||||
{
|
||||
//flag
|
||||
BOOL darkMode = NO;
|
||||
|
||||
//not mojave?
|
||||
// bail, since not true dark mode
|
||||
if(YES != [[NSProcessInfo processInfo] isOperatingSystemAtLeastVersion:(NSOperatingSystemVersion){10, 14, 0}])
|
||||
{
|
||||
//bail
|
||||
goto bail;
|
||||
}
|
||||
|
||||
//not dark mode?
|
||||
if(YES != [[[NSUserDefaults standardUserDefaults] stringForKey:@"AppleInterfaceStyle"] isEqualToString:@"Dark"])
|
||||
{
|
||||
//bail
|
||||
goto bail;
|
||||
}
|
||||
|
||||
//ok, mojave dark mode it is!
|
||||
darkMode = YES;
|
||||
|
||||
bail:
|
||||
|
||||
return darkMode;
|
||||
}
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
//
|
||||
// file: XPC.h
|
||||
// project: DND (shared)
|
||||
// description: xpc protocols, ivars, etc,
|
||||
//
|
||||
// created by Patrick Wardle
|
||||
// copyright (c) 2018 Objective-See. All rights reserved.
|
||||
//
|
||||
|
||||
#ifndef XPC_h
|
||||
#define XPC_h
|
||||
|
||||
//protocol
|
||||
// methods that deamon exports
|
||||
@protocol XPC_DAEMON
|
||||
|
||||
|
||||
|
||||
@end
|
||||
|
||||
//protocol
|
||||
// methods that user exports
|
||||
@protocol XPC_USER
|
||||
|
||||
- (void) updateProgress: (double) currentProgress;
|
||||
- (void) finished;
|
||||
|
||||
@end
|
||||
|
||||
@interface XPCListener : NSObject<NSXPCListenerDelegate>
|
||||
|
||||
/* PROPERTIES */
|
||||
|
||||
//XPC listener
|
||||
@property(retain, nonatomic)NSXPCListener* listener;
|
||||
|
||||
/* METHODS */
|
||||
|
||||
//setup XPC listener
|
||||
-(BOOL)initListener;
|
||||
|
||||
//automatically invoked when new client (attempts) to connect
|
||||
-(BOOL)listener:(NSXPCListener *)listener shouldAcceptNewConnection:(NSXPCConnection *)newConnection;
|
||||
|
||||
@end
|
||||
|
||||
#endif /* XPC_h */
|
||||
@@ -1,25 +0,0 @@
|
||||
//
|
||||
// file: XPCUserProtocol
|
||||
// project: DND (shared)
|
||||
// description: protocol for talking to the user (header)
|
||||
//
|
||||
// created by Patrick Wardle
|
||||
// copyright (c) 2018 Objective-See. All rights reserved.
|
||||
//
|
||||
|
||||
@import Foundation;
|
||||
|
||||
@protocol XPCUserProtocol
|
||||
|
||||
//show an alert
|
||||
// returns with rep
|
||||
-(void)alertShow:(NSDictionary*)alert;
|
||||
|
||||
//dismiss alert(s)
|
||||
-(void)alertDismiss;
|
||||
|
||||
//take a picture
|
||||
-(void)captureImage:(void (^)(NSData *))reply;
|
||||
|
||||
@end
|
||||
|
||||